diff --git a/badges/coverage.svg b/badges/coverage.svg index 9d2eafde..b378a9d9 100644 --- a/badges/coverage.svg +++ b/badges/coverage.svg @@ -1 +1 @@ -Coverage: 22.55%Coverage22.55% \ No newline at end of file +Coverage: 22.55%Coverage22.55% \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 3e8e11cd..760ac737 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8,11 +8,11 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; -var __require = /* @__PURE__ */ ((x6) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x6, { +var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, { get: (a6, b6) => (typeof require !== "undefined" ? require : a6)[b6] -}) : x6)(function(x6) { +}) : x2)(function(x2) { if (typeof require !== "undefined") return require.apply(this, arguments); - throw Error('Dynamic require of "' + x6 + '" is not supported'); + throw Error('Dynamic require of "' + x2 + '" is not supported'); }); var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; @@ -983,7 +983,7 @@ var require_util = __commonJS({ var { InvalidArgumentError } = require_errors(); var { headerNameLowerCasedRecord } = require_constants(); var { tree } = require_tree(); - var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v8) => Number(v8)); + var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v2) => Number(v2)); var BodyAsyncIterable = class { constructor(body2) { this[kBody] = body2; @@ -1170,8 +1170,8 @@ var require_util = __commonJS({ } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; function parseKeepAliveTimeout(val) { - const m6 = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); - return m6 ? parseInt(m6[1], 10) * 1e3 : null; + 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(); @@ -1195,7 +1195,7 @@ var require_util = __commonJS({ if (typeof headersValue === "string") { obj[key] = headersValue; } else { - obj[key] = Array.isArray(headersValue) ? headersValue.map((x6) => x6.toString("utf8")) : headersValue.toString("utf8"); + obj[key] = Array.isArray(headersValue) ? headersValue.map((x2) => x2.toString("utf8")) : headersValue.toString("utf8"); } } } @@ -1212,19 +1212,19 @@ var require_util = __commonJS({ let key; let val; let kLen = 0; - for (let n12 = 0; n12 < headers.length; n12 += 2) { - key = headers[n12]; - val = headers[n12 + 1]; + for (let n8 = 0; n8 < headers.length; n8 += 2) { + key = headers[n8]; + val = headers[n8 + 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 = n12 + 1; + contentDispositionIdx = n8 + 1; } - ret[n12] = key; - ret[n12 + 1] = val; + ret[n8] = key; + ret[n8 + 1] = val; } if (hasContentLength && contentDispositionIdx !== -1) { ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString("latin1"); @@ -1373,11 +1373,11 @@ var require_util = __commonJS({ } function parseRangeHeader(range6) { if (range6 == null || range6 === "") return { start: 0, end: null, size: null }; - const m6 = range6 ? range6.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null; - return m6 ? { - start: parseInt(m6[1]), - end: m6[2] ? parseInt(m6[2]) : null, - size: m6[3] ? parseInt(m6[3]) : null + const m3 = range6 ? range6.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) { @@ -1392,10 +1392,10 @@ var require_util = __commonJS({ } obj[kListeners] = null; } - function errorRequest2(client2, request3, err) { + function errorRequest2(client2, request2, err) { try { - request3.onError(err); - assert2(request3.aborted); + request2.onError(err); + assert2(request2.aborted); } catch (err2) { client2.emit("error", err2); } @@ -1685,7 +1685,7 @@ var require_request = __commonJS({ var { headerNameLowerCasedRecord } = require_constants(); var invalidPathRegex = /[^\u0021-\u00ff]/; var kHandler = /* @__PURE__ */ Symbol("handler"); - var Request3 = class { + var Request2 = class { constructor(origin, { path: path10, method, @@ -1913,7 +1913,7 @@ var require_request = __commonJS({ return this; } }; - function processHeader(request3, key, val) { + function processHeader(request2, key, val) { if (val && (typeof val === "object" && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`); } else if (val === void 0) { @@ -1953,24 +1953,24 @@ var require_request = __commonJS({ val = `${val}`; } if (headerName === "host") { - if (request3.host !== null) { + if (request2.host !== null) { throw new InvalidArgumentError("duplicate host header"); } if (typeof val !== "string") { throw new InvalidArgumentError("invalid host header"); } - request3.host = val; + request2.host = val; } else if (headerName === "content-length") { - if (request3.contentLength !== null) { + if (request2.contentLength !== null) { throw new InvalidArgumentError("duplicate content-length header"); } - request3.contentLength = parseInt(val, 10); - if (!Number.isFinite(request3.contentLength)) { + request2.contentLength = parseInt(val, 10); + if (!Number.isFinite(request2.contentLength)) { throw new InvalidArgumentError("invalid content-length header"); } - } else if (request3.contentType === null && headerName === "content-type") { - request3.contentType = val; - request3.headers.push(key, val); + } else if (request2.contentType === null && headerName === "content-type") { + request2.contentType = val; + request2.headers.push(key, val); } else if (headerName === "transfer-encoding" || headerName === "keep-alive" || headerName === "upgrade") { throw new InvalidArgumentError(`invalid ${headerName} header`); } else if (headerName === "connection") { @@ -1979,15 +1979,15 @@ var require_request = __commonJS({ throw new InvalidArgumentError("invalid connection header"); } if (value === "close") { - request3.reset = true; + request2.reset = true; } } else if (headerName === "expect") { throw new NotSupportedError("expect header not supported"); } else { - request3.headers.push(key, val); + request2.headers.push(key, val); } } - module.exports = Request3; + module.exports = Request2; } }); @@ -2097,9 +2097,9 @@ var require_dispatcher_base = __commonJS({ } close(callback) { if (callback === void 0) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { this.close((err, data) => { - return err ? reject2(err) : resolve4(data); + return err ? reject2(err) : resolve8(data); }); }); } @@ -2137,12 +2137,12 @@ var require_dispatcher_base = __commonJS({ err = null; } if (callback === void 0) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { this.destroy(err, (err2, data) => { return err2 ? ( /* istanbul ignore next: should never error */ reject2(err2) - ) : resolve4(data); + ) : resolve8(data); }); }); } @@ -2582,16 +2582,16 @@ var require_connect = __commonJS({ return noop3; } let s1 = null; - let s22 = null; + let s2 = null; const fastTimer = timers.setFastTimeout(() => { s1 = setImmediate(() => { - s22 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts)); + s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts)); }); }, opts.timeout); return () => { timers.clearFastTimeout(fastTimer); clearImmediate(s1); - clearImmediate(s22); + clearImmediate(s2); }; } : (socketWeakRef, opts) => { if (!opts.timeout) { @@ -2970,8 +2970,8 @@ var require_constants2 = __commonJS({ var require_llhttp_wasm = __commonJS({ "node_modules/undici/lib/llhttp/llhttp-wasm.js"(exports2, module) { "use strict"; - var { Buffer: Buffer7 } = __require("buffer"); - module.exports = Buffer7.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK07MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtXACAAQRhqQgA3AwAgAEIANwMAIABBOGpCADcDACAAQTBqQgA3AwAgAEEoakIANwMAIABBIGpCADcDACAAQRBqQgA3AwAgAEEIakIANwMAIABB3QE2AhwLBgAgABAyC5otAQt/IwBBEGsiCiQAQaTQACgCACIJRQRAQeTTACgCACIFRQRAQfDTAEJ/NwIAQejTAEKAgISAgIDAADcCAEHk0wAgCkEIakFwcUHYqtWqBXMiBTYCAEH40wBBADYCAEHI0wBBADYCAAtBzNMAQYDUBDYCAEGc0ABBgNQENgIAQbDQACAFNgIAQazQAEF/NgIAQdDTAEGArAM2AgADQCABQcjQAGogAUG80ABqIgI2AgAgAiABQbTQAGoiAzYCACABQcDQAGogAzYCACABQdDQAGogAUHE0ABqIgM2AgAgAyACNgIAIAFB2NAAaiABQczQAGoiAjYCACACIAM2AgAgAUHU0ABqIAI2AgAgAUEgaiIBQYACRw0AC0GM1ARBwasDNgIAQajQAEH00wAoAgA2AgBBmNAAQcCrAzYCAEGk0ABBiNQENgIAQcz/B0E4NgIAQYjUBCEJCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFNBEBBjNAAKAIAIgZBECAAQRNqQXBxIABBC0kbIgRBA3YiAHYiAUEDcQRAAkAgAUEBcSAAckEBcyICQQN0IgBBtNAAaiIBIABBvNAAaigCACIAKAIIIgNGBEBBjNAAIAZBfiACd3E2AgAMAQsgASADNgIIIAMgATYCDAsgAEEIaiEBIAAgAkEDdCICQQNyNgIEIAAgAmoiACAAKAIEQQFyNgIEDBELQZTQACgCACIIIARPDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxaCIAQQN0IgJBtNAAaiIBIAJBvNAAaigCACICKAIIIgNGBEBBjNAAIAZBfiAAd3EiBjYCAAwBCyABIAM2AgggAyABNgIMCyACIARBA3I2AgQgAEEDdCIAIARrIQUgACACaiAFNgIAIAIgBGoiBCAFQQFyNgIEIAgEQCAIQXhxQbTQAGohAEGg0AAoAgAhAwJ/QQEgCEEDdnQiASAGcUUEQEGM0AAgASAGcjYCACAADAELIAAoAggLIgEgAzYCDCAAIAM2AgggAyAANgIMIAMgATYCCAsgAkEIaiEBQaDQACAENgIAQZTQACAFNgIADBELQZDQACgCACILRQ0BIAtoQQJ0QbzSAGooAgAiACgCBEF4cSAEayEFIAAhAgNAAkAgAigCECIBRQRAIAJBFGooAgAiAUUNAQsgASgCBEF4cSAEayIDIAVJIQIgAyAFIAIbIQUgASAAIAIbIQAgASECDAELCyAAKAIYIQkgACgCDCIDIABHBEBBnNAAKAIAGiADIAAoAggiATYCCCABIAM2AgwMEAsgAEEUaiICKAIAIgFFBEAgACgCECIBRQ0DIABBEGohAgsDQCACIQcgASIDQRRqIgIoAgAiAQ0AIANBEGohAiADKAIQIgENAAsgB0EANgIADA8LQX8hBCAAQb9/Sw0AIABBE2oiAUFwcSEEQZDQACgCACIIRQ0AQQAgBGshBQJAAkACQAJ/QQAgBEGAAkkNABpBHyAEQf///wdLDQAaIARBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgZBAnRBvNIAaigCACICRQRAQQAhAUEAIQMMAQtBACEBIARBGSAGQQF2a0EAIAZBH0cbdCEAQQAhAwNAAkAgAigCBEF4cSAEayIHIAVPDQAgAiEDIAciBQ0AQQAhBSACIQEMAwsgASACQRRqKAIAIgcgByACIABBHXZBBHFqQRBqKAIAIgJGGyABIAcbIQEgAEEBdCEAIAINAAsLIAEgA3JFBEBBACEDQQIgBnQiAEEAIABrciAIcSIARQ0DIABoQQJ0QbzSAGooAgAhAQsgAUUNAQsDQCABKAIEQXhxIARrIgIgBUkhACACIAUgABshBSABIAMgABshAyABKAIQIgAEfyAABSABQRRqKAIACyIBDQALCyADRQ0AIAVBlNAAKAIAIARrTw0AIAMoAhghByADIAMoAgwiAEcEQEGc0AAoAgAaIAAgAygCCCIBNgIIIAEgADYCDAwOCyADQRRqIgIoAgAiAUUEQCADKAIQIgFFDQMgA0EQaiECCwNAIAIhBiABIgBBFGoiAigCACIBDQAgAEEQaiECIAAoAhAiAQ0ACyAGQQA2AgAMDQtBlNAAKAIAIgMgBE8EQEGg0AAoAgAhAQJAIAMgBGsiAkEQTwRAIAEgBGoiACACQQFyNgIEIAEgA2ogAjYCACABIARBA3I2AgQMAQsgASADQQNyNgIEIAEgA2oiACAAKAIEQQFyNgIEQQAhAEEAIQILQZTQACACNgIAQaDQACAANgIAIAFBCGohAQwPC0GY0AAoAgAiAyAESwRAIAQgCWoiACADIARrIgFBAXI2AgRBpNAAIAA2AgBBmNAAIAE2AgAgCSAEQQNyNgIEIAlBCGohAQwPC0EAIQEgBAJ/QeTTACgCAARAQezTACgCAAwBC0Hw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBDGpBcHFB2KrVqgVzNgIAQfjTAEEANgIAQcjTAEEANgIAQYCABAsiACAEQccAaiIFaiIGQQAgAGsiB3EiAk8EQEH80wBBMDYCAAwPCwJAQcTTACgCACIBRQ0AQbzTACgCACIIIAJqIQAgACABTSAAIAhLcQ0AQQAhAUH80wBBMDYCAAwPC0HI0wAtAABBBHENBAJAAkAgCQRAQczTACEBA0AgASgCACIAIAlNBEAgACABKAIEaiAJSw0DCyABKAIIIgENAAsLQQAQMyIAQX9GDQUgAiEGQejTACgCACIBQQFrIgMgAHEEQCACIABrIAAgA2pBACABa3FqIQYLIAQgBk8NBSAGQf7///8HSw0FQcTTACgCACIDBEBBvNMAKAIAIgcgBmohASABIAdNDQYgASADSw0GCyAGEDMiASAARw0BDAcLIAYgA2sgB3EiBkH+////B0sNBCAGEDMhACAAIAEoAgAgASgCBGpGDQMgACEBCwJAIAYgBEHIAGpPDQAgAUF/Rg0AQezTACgCACIAIAUgBmtqQQAgAGtxIgBB/v///wdLBEAgASEADAcLIAAQM0F/RwRAIAAgBmohBiABIQAMBwtBACAGaxAzGgwECyABIgBBf0cNBQwDC0EAIQMMDAtBACEADAoLIABBf0cNAgtByNMAQcjTACgCAEEEcjYCAAsgAkH+////B0sNASACEDMhAEEAEDMhASAAQX9GDQEgAUF/Rg0BIAAgAU8NASABIABrIgYgBEE4ak0NAQtBvNMAQbzTACgCACAGaiIBNgIAQcDTACgCACABSQRAQcDTACABNgIACwJAAkACQEGk0AAoAgAiAgRAQczTACEBA0AgACABKAIAIgMgASgCBCIFakYNAiABKAIIIgENAAsMAgtBnNAAKAIAIgFBAEcgACABT3FFBEBBnNAAIAA2AgALQQAhAUHQ0wAgBjYCAEHM0wAgADYCAEGs0ABBfzYCAEGw0ABB5NMAKAIANgIAQdjTAEEANgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBeCAAa0EPcSIBIABqIgIgBkE4ayIDIAFrIgFBAXI2AgRBqNAAQfTTACgCADYCAEGY0AAgATYCAEGk0AAgAjYCACAAIANqQTg2AgQMAgsgACACTQ0AIAIgA0kNACABKAIMQQhxDQBBeCACa0EPcSIAIAJqIgNBmNAAKAIAIAZqIgcgAGsiAEEBcjYCBCABIAUgBmo2AgRBqNAAQfTTACgCADYCAEGY0AAgADYCAEGk0AAgAzYCACACIAdqQTg2AgQMAQsgAEGc0AAoAgBJBEBBnNAAIAA2AgALIAAgBmohA0HM0wAhAQJAAkACQANAIAMgASgCAEcEQCABKAIIIgENAQwCCwsgAS0ADEEIcUUNAQtBzNMAIQEDQCABKAIAIgMgAk0EQCADIAEoAgRqIgUgAksNAwsgASgCCCEBDAALAAsgASAANgIAIAEgASgCBCAGajYCBCAAQXggAGtBD3FqIgkgBEEDcjYCBCADQXggA2tBD3FqIgYgBCAJaiIEayEBIAIgBkYEQEGk0AAgBDYCAEGY0ABBmNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEDAgLQaDQACgCACAGRgRAQaDQACAENgIAQZTQAEGU0AAoAgAgAWoiADYCACAEIABBAXI2AgQgACAEaiAANgIADAgLIAYoAgQiBUEDcUEBRw0GIAVBeHEhCCAFQf8BTQRAIAVBA3YhAyAGKAIIIgAgBigCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBwsgAiAANgIIIAAgAjYCDAwGCyAGKAIYIQcgBiAGKAIMIgBHBEAgACAGKAIIIgI2AgggAiAANgIMDAULIAZBFGoiAigCACIFRQRAIAYoAhAiBUUNBCAGQRBqIQILA0AgAiEDIAUiAEEUaiICKAIAIgUNACAAQRBqIQIgACgCECIFDQALIANBADYCAAwEC0F4IABrQQ9xIgEgAGoiByAGQThrIgMgAWsiAUEBcjYCBCAAIANqQTg2AgQgAiAFQTcgBWtBD3FqQT9rIgMgAyACQRBqSRsiA0EjNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAc2AgAgA0EQakHU0wApAgA3AgAgA0HM0wApAgA3AghB1NMAIANBCGo2AgBB0NMAIAY2AgBBzNMAIAA2AgBB2NMAQQA2AgAgA0EkaiEBA0AgAUEHNgIAIAUgAUEEaiIBSw0ACyACIANGDQAgAyADKAIEQX5xNgIEIAMgAyACayIFNgIAIAIgBUEBcjYCBCAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIDcUUEQEGM0AAgASADcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEGQ0AAoAgAiA0EBIAF0IgZxRQRAIAAgAjYCAEGQ0AAgAyAGcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQMCQANAIAMiACgCBEF4cSAFRg0BIAFBHXYhAyABQQF0IQEgACADQQRxakEQaiIGKAIAIgMNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAtBmNAAKAIAIgEgBE0NAEGk0AAoAgAiACAEaiICIAEgBGsiAUEBcjYCBEGY0AAgATYCAEGk0AAgAjYCACAAIARBA3I2AgQgAEEIaiEBDAgLQQAhAUH80wBBMDYCAAwHC0EAIQALIAdFDQACQCAGKAIcIgJBAnRBvNIAaiIDKAIAIAZGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAdBEEEUIAcoAhAgBkYbaiAANgIAIABFDQELIAAgBzYCGCAGKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAGQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAIaiEBIAYgCGoiBigCBCEFCyAGIAVBfnE2AgQgASAEaiABNgIAIAQgAUEBcjYCBCABQf8BTQRAIAFBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASABQQN2dCIBcUUEQEGM0AAgASACcjYCACAADAELIAAoAggLIgEgBDYCDCAAIAQ2AgggBCAANgIMIAQgATYCCAwBC0EfIQUgAUH///8HTQRAIAFBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBQsgBCAFNgIcIARCADcCECAFQQJ0QbzSAGohAEGQ0AAoAgAiAkEBIAV0IgNxRQRAIAAgBDYCAEGQ0AAgAiADcjYCACAEIAA2AhggBCAENgIIIAQgBDYCDAwBCyABQRkgBUEBdmtBACAFQR9HG3QhBSAAKAIAIQACQANAIAAiAigCBEF4cSABRg0BIAVBHXYhACAFQQF0IQUgAiAAQQRxakEQaiIDKAIAIgANAAsgAyAENgIAIAQgAjYCGCAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgCUEIaiEBDAILAkAgB0UNAAJAIAMoAhwiAUECdEG80gBqIgIoAgAgA0YEQCACIAA2AgAgAA0BQZDQACAIQX4gAXdxIgg2AgAMAgsgB0EQQRQgBygCECADRhtqIAA2AgAgAEUNAQsgACAHNgIYIAMoAhAiAQRAIAAgATYCECABIAA2AhgLIANBFGooAgAiAUUNACAAQRRqIAE2AgAgASAANgIYCwJAIAVBD00EQCADIAQgBWoiAEEDcjYCBCAAIANqIgAgACgCBEEBcjYCBAwBCyADIARqIgIgBUEBcjYCBCADIARBA3I2AgQgAiAFaiAFNgIAIAVB/wFNBEAgBUF4cUG00ABqIQACf0GM0AAoAgAiAUEBIAVBA3Z0IgVxRQRAQYzQACABIAVyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRBvNIAaiEAQQEgAXQiBCAIcUUEQCAAIAI2AgBBkNAAIAQgCHI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEEAkADQCAEIgAoAgRBeHEgBUYNASABQR12IQQgAUEBdCEBIAAgBEEEcWpBEGoiBigCACIEDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLIANBCGohAQwBCwJAIAlFDQACQCAAKAIcIgFBAnRBvNIAaiICKAIAIABGBEAgAiADNgIAIAMNAUGQ0AAgC0F+IAF3cTYCAAwCCyAJQRBBFCAJKAIQIABGG2ogAzYCACADRQ0BCyADIAk2AhggACgCECIBBEAgAyABNgIQIAEgAzYCGAsgAEEUaigCACIBRQ0AIANBFGogATYCACABIAM2AhgLAkAgBUEPTQRAIAAgBCAFaiIBQQNyNgIEIAAgAWoiASABKAIEQQFyNgIEDAELIAAgBGoiByAFQQFyNgIEIAAgBEEDcjYCBCAFIAdqIAU2AgAgCARAIAhBeHFBtNAAaiEBQaDQACgCACEDAn9BASAIQQN2dCICIAZxRQRAQYzQACACIAZyNgIAIAEMAQsgASgCCAsiAiADNgIMIAEgAzYCCCADIAE2AgwgAyACNgIIC0Gg0AAgBzYCAEGU0AAgBTYCAAsgAEEIaiEBCyAKQRBqJAAgAQtDACAARQRAPwBBEHQPCwJAIABB//8DcQ0AIABBAEgNACAAQRB2QAAiAEF/RgRAQfzTAEEwNgIAQX8PCyAAQRB0DwsACwvcPyIAQYAICwkBAAAAAgAAAAMAQZQICwUEAAAABQBBpAgLCQYAAAAHAAAACABB3AgLii1JbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AFJlc3BvbnNlIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zAFVzZXIgY2FsbGJhY2sgZXJyb3IAYG9uX3Jlc2V0YCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfaGVhZGVyYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9iZWdpbmAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3N0YXR1c19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3ZlcnNpb25fY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl91cmxfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXRob2RfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfZmllbGRfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fbmFtZWAgY2FsbGJhY2sgZXJyb3IAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzZXJ2ZXIASW52YWxpZCBoZWFkZXIgdmFsdWUgY2hhcgBJbnZhbGlkIGhlYWRlciBmaWVsZCBjaGFyAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdmVyc2lvbgBJbnZhbGlkIG1pbm9yIHZlcnNpb24ASW52YWxpZCBtYWpvciB2ZXJzaW9uAEV4cGVjdGVkIHNwYWNlIGFmdGVyIHZlcnNpb24ARXhwZWN0ZWQgQ1JMRiBhZnRlciB2ZXJzaW9uAEludmFsaWQgSFRUUCB2ZXJzaW9uAEludmFsaWQgaGVhZGVyIHRva2VuAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdXJsAEludmFsaWQgY2hhcmFjdGVycyBpbiB1cmwAVW5leHBlY3RlZCBzdGFydCBjaGFyIGluIHVybABEb3VibGUgQCBpbiB1cmwARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgARHVwbGljYXRlIENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhciBpbiB1cmwgcGF0aABDb250ZW50LUxlbmd0aCBjYW4ndCBiZSBwcmVzZW50IHdpdGggVHJhbnNmZXItRW5jb2RpbmcASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgc2l6ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl92YWx1ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlZCB2YWx1ZQBQYXVzZWQgYnkgb25faGVhZGVyc19jb21wbGV0ZQBJbnZhbGlkIEVPRiBzdGF0ZQBvbl9yZXNldCBwYXVzZQBvbl9jaHVua19oZWFkZXIgcGF1c2UAb25fbWVzc2FnZV9iZWdpbiBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fdmFsdWUgcGF1c2UAb25fc3RhdHVzX2NvbXBsZXRlIHBhdXNlAG9uX3ZlcnNpb25fY29tcGxldGUgcGF1c2UAb25fdXJsX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXNzYWdlX2NvbXBsZXRlIHBhdXNlAG9uX21ldGhvZF9jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfZmllbGRfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUgcGF1c2UAVW5leHBlY3RlZCBzcGFjZSBhZnRlciBzdGFydCBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAFBhdXNlIG9uIENPTk5FQ1QvVXBncmFkZQBQYXVzZSBvbiBQUkkvVXBncmFkZQBFeHBlY3RlZCBIVFRQLzIgQ29ubmVjdGlvbiBQcmVmYWNlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fbWV0aG9kAEV4cGVjdGVkIHNwYWNlIGFmdGVyIG1ldGhvZABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl9maWVsZABQYXVzZWQASW52YWxpZCB3b3JkIGVuY291bnRlcmVkAEludmFsaWQgbWV0aG9kIGVuY291bnRlcmVkAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2NoZW1hAFJlcXVlc3QgaGFzIGludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYABTV0lUQ0hfUFJPWFkAVVNFX1BST1hZAE1LQUNUSVZJVFkAVU5QUk9DRVNTQUJMRV9FTlRJVFkAQ09QWQBNT1ZFRF9QRVJNQU5FTlRMWQBUT09fRUFSTFkATk9USUZZAEZBSUxFRF9ERVBFTkRFTkNZAEJBRF9HQVRFV0FZAFBMQVkAUFVUAENIRUNLT1VUAEdBVEVXQVlfVElNRU9VVABSRVFVRVNUX1RJTUVPVVQATkVUV09SS19DT05ORUNUX1RJTUVPVVQAQ09OTkVDVElPTl9USU1FT1VUAExPR0lOX1RJTUVPVVQATkVUV09SS19SRUFEX1RJTUVPVVQAUE9TVABNSVNESVJFQ1RFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX0xPQURfQkFMQU5DRURfUkVRVUVTVABCQURfUkVRVUVTVABIVFRQX1JFUVVFU1RfU0VOVF9UT19IVFRQU19QT1JUAFJFUE9SVABJTV9BX1RFQVBPVABSRVNFVF9DT05URU5UAE5PX0NPTlRFTlQAUEFSVElBTF9DT05URU5UAEhQRV9JTlZBTElEX0NPTlNUQU5UAEhQRV9DQl9SRVNFVABHRVQASFBFX1NUUklDVABDT05GTElDVABURU1QT1JBUllfUkVESVJFQ1QAUEVSTUFORU5UX1JFRElSRUNUAENPTk5FQ1QATVVMVElfU1RBVFVTAEhQRV9JTlZBTElEX1NUQVRVUwBUT09fTUFOWV9SRVFVRVNUUwBFQVJMWV9ISU5UUwBVTkFWQUlMQUJMRV9GT1JfTEVHQUxfUkVBU09OUwBPUFRJT05TAFNXSVRDSElOR19QUk9UT0NPTFMAVkFSSUFOVF9BTFNPX05FR09USUFURVMATVVMVElQTEVfQ0hPSUNFUwBJTlRFUk5BTF9TRVJWRVJfRVJST1IAV0VCX1NFUlZFUl9VTktOT1dOX0VSUk9SAFJBSUxHVU5fRVJST1IASURFTlRJVFlfUFJPVklERVJfQVVUSEVOVElDQVRJT05fRVJST1IAU1NMX0NFUlRJRklDQVRFX0VSUk9SAElOVkFMSURfWF9GT1JXQVJERURfRk9SAFNFVF9QQVJBTUVURVIAR0VUX1BBUkFNRVRFUgBIUEVfVVNFUgBTRUVfT1RIRVIASFBFX0NCX0NIVU5LX0hFQURFUgBNS0NBTEVOREFSAFNFVFVQAFdFQl9TRVJWRVJfSVNfRE9XTgBURUFSRE9XTgBIUEVfQ0xPU0VEX0NPTk5FQ1RJT04ASEVVUklTVElDX0VYUElSQVRJT04ARElTQ09OTkVDVEVEX09QRVJBVElPTgBOT05fQVVUSE9SSVRBVElWRV9JTkZPUk1BVElPTgBIUEVfSU5WQUxJRF9WRVJTSU9OAEhQRV9DQl9NRVNTQUdFX0JFR0lOAFNJVEVfSVNfRlJPWkVOAEhQRV9JTlZBTElEX0hFQURFUl9UT0tFTgBJTlZBTElEX1RPS0VOAEZPUkJJRERFTgBFTkhBTkNFX1lPVVJfQ0FMTQBIUEVfSU5WQUxJRF9VUkwAQkxPQ0tFRF9CWV9QQVJFTlRBTF9DT05UUk9MAE1LQ09MAEFDTABIUEVfSU5URVJOQUwAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRV9VTk9GRklDSUFMAEhQRV9PSwBVTkxJTksAVU5MT0NLAFBSSQBSRVRSWV9XSVRIAEhQRV9JTlZBTElEX0NPTlRFTlRfTEVOR1RIAEhQRV9VTkVYUEVDVEVEX0NPTlRFTlRfTEVOR1RIAEZMVVNIAFBST1BQQVRDSABNLVNFQVJDSABVUklfVE9PX0xPTkcAUFJPQ0VTU0lORwBNSVNDRUxMQU5FT1VTX1BFUlNJU1RFTlRfV0FSTklORwBNSVNDRUxMQU5FT1VTX1dBUk5JTkcASFBFX0lOVkFMSURfVFJBTlNGRVJfRU5DT0RJTkcARXhwZWN0ZWQgQ1JMRgBIUEVfSU5WQUxJRF9DSFVOS19TSVpFAE1PVkUAQ09OVElOVUUASFBFX0NCX1NUQVRVU19DT01QTEVURQBIUEVfQ0JfSEVBREVSU19DT01QTEVURQBIUEVfQ0JfVkVSU0lPTl9DT01QTEVURQBIUEVfQ0JfVVJMX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8AAF4TAAAmEwAAMBAAAPAXAACdEwAAFRIAADkXAADwEgAAChAAAHUSAACtEgAAghMAAE8UAAB/EAAAoBUAACMUAACJEgAAixQAAE0VAADUEQAAzxQAABAYAADJFgAA3BYAAMERAADgFwAAuxQAAHQUAAB8FQAA5RQAAAgXAAAfEAAAZRUAAKMUAAAoFQAAAhUAAJkVAAAsEAAAixkAAE8PAADUDgAAahAAAM4QAAACFwAAiQ4AAG4TAAAcEwAAZhQAAFYXAADBEwAAzRMAAGwTAABoFwAAZhcAAF8XAAAiEwAAzg8AAGkOAADYDgAAYxYAAMsTAACqDgAAKBcAACYXAADFEwAAXRYAAOgRAABnEwAAZRMAAPIWAABzEwAAHRcAAPkWAADzEQAAzw4AAM4VAAAMEgAAsxEAAKURAABhEAAAMhcAALsTAEH5NQsBAQBBkDYL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB/TcLAQEAQZE4C14CAwICAgICAAACAgACAgACAgICAgICAgICAAQAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEH9OQsBAQBBkToLXgIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAQfA7Cw1sb3NlZWVwLWFsaXZlAEGJPAsBAQBBoDwL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBiT4LAQEAQaA+C+cBAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAEGwwAALXwEBAAEBAQEBAAABAQABAQABAQEBAQEBAQEBAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAEGQwgALIWVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgBBwMIACy1yYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AQfnCAAsFAQIAAQMAQZDDAAvgAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH5xAALBQECAAEDAEGQxQAL4AEEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cYACwQBAAABAEGRxwAL3wEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv", "base64"); + var { Buffer: Buffer4 } = __require("buffer"); + module.exports = Buffer4.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK07MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtXACAAQRhqQgA3AwAgAEIANwMAIABBOGpCADcDACAAQTBqQgA3AwAgAEEoakIANwMAIABBIGpCADcDACAAQRBqQgA3AwAgAEEIakIANwMAIABB3QE2AhwLBgAgABAyC5otAQt/IwBBEGsiCiQAQaTQACgCACIJRQRAQeTTACgCACIFRQRAQfDTAEJ/NwIAQejTAEKAgISAgIDAADcCAEHk0wAgCkEIakFwcUHYqtWqBXMiBTYCAEH40wBBADYCAEHI0wBBADYCAAtBzNMAQYDUBDYCAEGc0ABBgNQENgIAQbDQACAFNgIAQazQAEF/NgIAQdDTAEGArAM2AgADQCABQcjQAGogAUG80ABqIgI2AgAgAiABQbTQAGoiAzYCACABQcDQAGogAzYCACABQdDQAGogAUHE0ABqIgM2AgAgAyACNgIAIAFB2NAAaiABQczQAGoiAjYCACACIAM2AgAgAUHU0ABqIAI2AgAgAUEgaiIBQYACRw0AC0GM1ARBwasDNgIAQajQAEH00wAoAgA2AgBBmNAAQcCrAzYCAEGk0ABBiNQENgIAQcz/B0E4NgIAQYjUBCEJCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFNBEBBjNAAKAIAIgZBECAAQRNqQXBxIABBC0kbIgRBA3YiAHYiAUEDcQRAAkAgAUEBcSAAckEBcyICQQN0IgBBtNAAaiIBIABBvNAAaigCACIAKAIIIgNGBEBBjNAAIAZBfiACd3E2AgAMAQsgASADNgIIIAMgATYCDAsgAEEIaiEBIAAgAkEDdCICQQNyNgIEIAAgAmoiACAAKAIEQQFyNgIEDBELQZTQACgCACIIIARPDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxaCIAQQN0IgJBtNAAaiIBIAJBvNAAaigCACICKAIIIgNGBEBBjNAAIAZBfiAAd3EiBjYCAAwBCyABIAM2AgggAyABNgIMCyACIARBA3I2AgQgAEEDdCIAIARrIQUgACACaiAFNgIAIAIgBGoiBCAFQQFyNgIEIAgEQCAIQXhxQbTQAGohAEGg0AAoAgAhAwJ/QQEgCEEDdnQiASAGcUUEQEGM0AAgASAGcjYCACAADAELIAAoAggLIgEgAzYCDCAAIAM2AgggAyAANgIMIAMgATYCCAsgAkEIaiEBQaDQACAENgIAQZTQACAFNgIADBELQZDQACgCACILRQ0BIAtoQQJ0QbzSAGooAgAiACgCBEF4cSAEayEFIAAhAgNAAkAgAigCECIBRQRAIAJBFGooAgAiAUUNAQsgASgCBEF4cSAEayIDIAVJIQIgAyAFIAIbIQUgASAAIAIbIQAgASECDAELCyAAKAIYIQkgACgCDCIDIABHBEBBnNAAKAIAGiADIAAoAggiATYCCCABIAM2AgwMEAsgAEEUaiICKAIAIgFFBEAgACgCECIBRQ0DIABBEGohAgsDQCACIQcgASIDQRRqIgIoAgAiAQ0AIANBEGohAiADKAIQIgENAAsgB0EANgIADA8LQX8hBCAAQb9/Sw0AIABBE2oiAUFwcSEEQZDQACgCACIIRQ0AQQAgBGshBQJAAkACQAJ/QQAgBEGAAkkNABpBHyAEQf///wdLDQAaIARBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgZBAnRBvNIAaigCACICRQRAQQAhAUEAIQMMAQtBACEBIARBGSAGQQF2a0EAIAZBH0cbdCEAQQAhAwNAAkAgAigCBEF4cSAEayIHIAVPDQAgAiEDIAciBQ0AQQAhBSACIQEMAwsgASACQRRqKAIAIgcgByACIABBHXZBBHFqQRBqKAIAIgJGGyABIAcbIQEgAEEBdCEAIAINAAsLIAEgA3JFBEBBACEDQQIgBnQiAEEAIABrciAIcSIARQ0DIABoQQJ0QbzSAGooAgAhAQsgAUUNAQsDQCABKAIEQXhxIARrIgIgBUkhACACIAUgABshBSABIAMgABshAyABKAIQIgAEfyAABSABQRRqKAIACyIBDQALCyADRQ0AIAVBlNAAKAIAIARrTw0AIAMoAhghByADIAMoAgwiAEcEQEGc0AAoAgAaIAAgAygCCCIBNgIIIAEgADYCDAwOCyADQRRqIgIoAgAiAUUEQCADKAIQIgFFDQMgA0EQaiECCwNAIAIhBiABIgBBFGoiAigCACIBDQAgAEEQaiECIAAoAhAiAQ0ACyAGQQA2AgAMDQtBlNAAKAIAIgMgBE8EQEGg0AAoAgAhAQJAIAMgBGsiAkEQTwRAIAEgBGoiACACQQFyNgIEIAEgA2ogAjYCACABIARBA3I2AgQMAQsgASADQQNyNgIEIAEgA2oiACAAKAIEQQFyNgIEQQAhAEEAIQILQZTQACACNgIAQaDQACAANgIAIAFBCGohAQwPC0GY0AAoAgAiAyAESwRAIAQgCWoiACADIARrIgFBAXI2AgRBpNAAIAA2AgBBmNAAIAE2AgAgCSAEQQNyNgIEIAlBCGohAQwPC0EAIQEgBAJ/QeTTACgCAARAQezTACgCAAwBC0Hw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBDGpBcHFB2KrVqgVzNgIAQfjTAEEANgIAQcjTAEEANgIAQYCABAsiACAEQccAaiIFaiIGQQAgAGsiB3EiAk8EQEH80wBBMDYCAAwPCwJAQcTTACgCACIBRQ0AQbzTACgCACIIIAJqIQAgACABTSAAIAhLcQ0AQQAhAUH80wBBMDYCAAwPC0HI0wAtAABBBHENBAJAAkAgCQRAQczTACEBA0AgASgCACIAIAlNBEAgACABKAIEaiAJSw0DCyABKAIIIgENAAsLQQAQMyIAQX9GDQUgAiEGQejTACgCACIBQQFrIgMgAHEEQCACIABrIAAgA2pBACABa3FqIQYLIAQgBk8NBSAGQf7///8HSw0FQcTTACgCACIDBEBBvNMAKAIAIgcgBmohASABIAdNDQYgASADSw0GCyAGEDMiASAARw0BDAcLIAYgA2sgB3EiBkH+////B0sNBCAGEDMhACAAIAEoAgAgASgCBGpGDQMgACEBCwJAIAYgBEHIAGpPDQAgAUF/Rg0AQezTACgCACIAIAUgBmtqQQAgAGtxIgBB/v///wdLBEAgASEADAcLIAAQM0F/RwRAIAAgBmohBiABIQAMBwtBACAGaxAzGgwECyABIgBBf0cNBQwDC0EAIQMMDAtBACEADAoLIABBf0cNAgtByNMAQcjTACgCAEEEcjYCAAsgAkH+////B0sNASACEDMhAEEAEDMhASAAQX9GDQEgAUF/Rg0BIAAgAU8NASABIABrIgYgBEE4ak0NAQtBvNMAQbzTACgCACAGaiIBNgIAQcDTACgCACABSQRAQcDTACABNgIACwJAAkACQEGk0AAoAgAiAgRAQczTACEBA0AgACABKAIAIgMgASgCBCIFakYNAiABKAIIIgENAAsMAgtBnNAAKAIAIgFBAEcgACABT3FFBEBBnNAAIAA2AgALQQAhAUHQ0wAgBjYCAEHM0wAgADYCAEGs0ABBfzYCAEGw0ABB5NMAKAIANgIAQdjTAEEANgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBeCAAa0EPcSIBIABqIgIgBkE4ayIDIAFrIgFBAXI2AgRBqNAAQfTTACgCADYCAEGY0AAgATYCAEGk0AAgAjYCACAAIANqQTg2AgQMAgsgACACTQ0AIAIgA0kNACABKAIMQQhxDQBBeCACa0EPcSIAIAJqIgNBmNAAKAIAIAZqIgcgAGsiAEEBcjYCBCABIAUgBmo2AgRBqNAAQfTTACgCADYCAEGY0AAgADYCAEGk0AAgAzYCACACIAdqQTg2AgQMAQsgAEGc0AAoAgBJBEBBnNAAIAA2AgALIAAgBmohA0HM0wAhAQJAAkACQANAIAMgASgCAEcEQCABKAIIIgENAQwCCwsgAS0ADEEIcUUNAQtBzNMAIQEDQCABKAIAIgMgAk0EQCADIAEoAgRqIgUgAksNAwsgASgCCCEBDAALAAsgASAANgIAIAEgASgCBCAGajYCBCAAQXggAGtBD3FqIgkgBEEDcjYCBCADQXggA2tBD3FqIgYgBCAJaiIEayEBIAIgBkYEQEGk0AAgBDYCAEGY0ABBmNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEDAgLQaDQACgCACAGRgRAQaDQACAENgIAQZTQAEGU0AAoAgAgAWoiADYCACAEIABBAXI2AgQgACAEaiAANgIADAgLIAYoAgQiBUEDcUEBRw0GIAVBeHEhCCAFQf8BTQRAIAVBA3YhAyAGKAIIIgAgBigCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBwsgAiAANgIIIAAgAjYCDAwGCyAGKAIYIQcgBiAGKAIMIgBHBEAgACAGKAIIIgI2AgggAiAANgIMDAULIAZBFGoiAigCACIFRQRAIAYoAhAiBUUNBCAGQRBqIQILA0AgAiEDIAUiAEEUaiICKAIAIgUNACAAQRBqIQIgACgCECIFDQALIANBADYCAAwEC0F4IABrQQ9xIgEgAGoiByAGQThrIgMgAWsiAUEBcjYCBCAAIANqQTg2AgQgAiAFQTcgBWtBD3FqQT9rIgMgAyACQRBqSRsiA0EjNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAc2AgAgA0EQakHU0wApAgA3AgAgA0HM0wApAgA3AghB1NMAIANBCGo2AgBB0NMAIAY2AgBBzNMAIAA2AgBB2NMAQQA2AgAgA0EkaiEBA0AgAUEHNgIAIAUgAUEEaiIBSw0ACyACIANGDQAgAyADKAIEQX5xNgIEIAMgAyACayIFNgIAIAIgBUEBcjYCBCAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIDcUUEQEGM0AAgASADcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEGQ0AAoAgAiA0EBIAF0IgZxRQRAIAAgAjYCAEGQ0AAgAyAGcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQMCQANAIAMiACgCBEF4cSAFRg0BIAFBHXYhAyABQQF0IQEgACADQQRxakEQaiIGKAIAIgMNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAtBmNAAKAIAIgEgBE0NAEGk0AAoAgAiACAEaiICIAEgBGsiAUEBcjYCBEGY0AAgATYCAEGk0AAgAjYCACAAIARBA3I2AgQgAEEIaiEBDAgLQQAhAUH80wBBMDYCAAwHC0EAIQALIAdFDQACQCAGKAIcIgJBAnRBvNIAaiIDKAIAIAZGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAdBEEEUIAcoAhAgBkYbaiAANgIAIABFDQELIAAgBzYCGCAGKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAGQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAIaiEBIAYgCGoiBigCBCEFCyAGIAVBfnE2AgQgASAEaiABNgIAIAQgAUEBcjYCBCABQf8BTQRAIAFBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASABQQN2dCIBcUUEQEGM0AAgASACcjYCACAADAELIAAoAggLIgEgBDYCDCAAIAQ2AgggBCAANgIMIAQgATYCCAwBC0EfIQUgAUH///8HTQRAIAFBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBQsgBCAFNgIcIARCADcCECAFQQJ0QbzSAGohAEGQ0AAoAgAiAkEBIAV0IgNxRQRAIAAgBDYCAEGQ0AAgAiADcjYCACAEIAA2AhggBCAENgIIIAQgBDYCDAwBCyABQRkgBUEBdmtBACAFQR9HG3QhBSAAKAIAIQACQANAIAAiAigCBEF4cSABRg0BIAVBHXYhACAFQQF0IQUgAiAAQQRxakEQaiIDKAIAIgANAAsgAyAENgIAIAQgAjYCGCAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgCUEIaiEBDAILAkAgB0UNAAJAIAMoAhwiAUECdEG80gBqIgIoAgAgA0YEQCACIAA2AgAgAA0BQZDQACAIQX4gAXdxIgg2AgAMAgsgB0EQQRQgBygCECADRhtqIAA2AgAgAEUNAQsgACAHNgIYIAMoAhAiAQRAIAAgATYCECABIAA2AhgLIANBFGooAgAiAUUNACAAQRRqIAE2AgAgASAANgIYCwJAIAVBD00EQCADIAQgBWoiAEEDcjYCBCAAIANqIgAgACgCBEEBcjYCBAwBCyADIARqIgIgBUEBcjYCBCADIARBA3I2AgQgAiAFaiAFNgIAIAVB/wFNBEAgBUF4cUG00ABqIQACf0GM0AAoAgAiAUEBIAVBA3Z0IgVxRQRAQYzQACABIAVyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRBvNIAaiEAQQEgAXQiBCAIcUUEQCAAIAI2AgBBkNAAIAQgCHI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEEAkADQCAEIgAoAgRBeHEgBUYNASABQR12IQQgAUEBdCEBIAAgBEEEcWpBEGoiBigCACIEDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLIANBCGohAQwBCwJAIAlFDQACQCAAKAIcIgFBAnRBvNIAaiICKAIAIABGBEAgAiADNgIAIAMNAUGQ0AAgC0F+IAF3cTYCAAwCCyAJQRBBFCAJKAIQIABGG2ogAzYCACADRQ0BCyADIAk2AhggACgCECIBBEAgAyABNgIQIAEgAzYCGAsgAEEUaigCACIBRQ0AIANBFGogATYCACABIAM2AhgLAkAgBUEPTQRAIAAgBCAFaiIBQQNyNgIEIAAgAWoiASABKAIEQQFyNgIEDAELIAAgBGoiByAFQQFyNgIEIAAgBEEDcjYCBCAFIAdqIAU2AgAgCARAIAhBeHFBtNAAaiEBQaDQACgCACEDAn9BASAIQQN2dCICIAZxRQRAQYzQACACIAZyNgIAIAEMAQsgASgCCAsiAiADNgIMIAEgAzYCCCADIAE2AgwgAyACNgIIC0Gg0AAgBzYCAEGU0AAgBTYCAAsgAEEIaiEBCyAKQRBqJAAgAQtDACAARQRAPwBBEHQPCwJAIABB//8DcQ0AIABBAEgNACAAQRB2QAAiAEF/RgRAQfzTAEEwNgIAQX8PCyAAQRB0DwsACwvcPyIAQYAICwkBAAAAAgAAAAMAQZQICwUEAAAABQBBpAgLCQYAAAAHAAAACABB3AgLii1JbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AFJlc3BvbnNlIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zAFVzZXIgY2FsbGJhY2sgZXJyb3IAYG9uX3Jlc2V0YCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfaGVhZGVyYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9iZWdpbmAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3N0YXR1c19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3ZlcnNpb25fY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl91cmxfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXRob2RfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfZmllbGRfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fbmFtZWAgY2FsbGJhY2sgZXJyb3IAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzZXJ2ZXIASW52YWxpZCBoZWFkZXIgdmFsdWUgY2hhcgBJbnZhbGlkIGhlYWRlciBmaWVsZCBjaGFyAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdmVyc2lvbgBJbnZhbGlkIG1pbm9yIHZlcnNpb24ASW52YWxpZCBtYWpvciB2ZXJzaW9uAEV4cGVjdGVkIHNwYWNlIGFmdGVyIHZlcnNpb24ARXhwZWN0ZWQgQ1JMRiBhZnRlciB2ZXJzaW9uAEludmFsaWQgSFRUUCB2ZXJzaW9uAEludmFsaWQgaGVhZGVyIHRva2VuAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdXJsAEludmFsaWQgY2hhcmFjdGVycyBpbiB1cmwAVW5leHBlY3RlZCBzdGFydCBjaGFyIGluIHVybABEb3VibGUgQCBpbiB1cmwARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgARHVwbGljYXRlIENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhciBpbiB1cmwgcGF0aABDb250ZW50LUxlbmd0aCBjYW4ndCBiZSBwcmVzZW50IHdpdGggVHJhbnNmZXItRW5jb2RpbmcASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgc2l6ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl92YWx1ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlZCB2YWx1ZQBQYXVzZWQgYnkgb25faGVhZGVyc19jb21wbGV0ZQBJbnZhbGlkIEVPRiBzdGF0ZQBvbl9yZXNldCBwYXVzZQBvbl9jaHVua19oZWFkZXIgcGF1c2UAb25fbWVzc2FnZV9iZWdpbiBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fdmFsdWUgcGF1c2UAb25fc3RhdHVzX2NvbXBsZXRlIHBhdXNlAG9uX3ZlcnNpb25fY29tcGxldGUgcGF1c2UAb25fdXJsX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXNzYWdlX2NvbXBsZXRlIHBhdXNlAG9uX21ldGhvZF9jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfZmllbGRfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUgcGF1c2UAVW5leHBlY3RlZCBzcGFjZSBhZnRlciBzdGFydCBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAFBhdXNlIG9uIENPTk5FQ1QvVXBncmFkZQBQYXVzZSBvbiBQUkkvVXBncmFkZQBFeHBlY3RlZCBIVFRQLzIgQ29ubmVjdGlvbiBQcmVmYWNlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fbWV0aG9kAEV4cGVjdGVkIHNwYWNlIGFmdGVyIG1ldGhvZABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl9maWVsZABQYXVzZWQASW52YWxpZCB3b3JkIGVuY291bnRlcmVkAEludmFsaWQgbWV0aG9kIGVuY291bnRlcmVkAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2NoZW1hAFJlcXVlc3QgaGFzIGludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYABTV0lUQ0hfUFJPWFkAVVNFX1BST1hZAE1LQUNUSVZJVFkAVU5QUk9DRVNTQUJMRV9FTlRJVFkAQ09QWQBNT1ZFRF9QRVJNQU5FTlRMWQBUT09fRUFSTFkATk9USUZZAEZBSUxFRF9ERVBFTkRFTkNZAEJBRF9HQVRFV0FZAFBMQVkAUFVUAENIRUNLT1VUAEdBVEVXQVlfVElNRU9VVABSRVFVRVNUX1RJTUVPVVQATkVUV09SS19DT05ORUNUX1RJTUVPVVQAQ09OTkVDVElPTl9USU1FT1VUAExPR0lOX1RJTUVPVVQATkVUV09SS19SRUFEX1RJTUVPVVQAUE9TVABNSVNESVJFQ1RFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX0xPQURfQkFMQU5DRURfUkVRVUVTVABCQURfUkVRVUVTVABIVFRQX1JFUVVFU1RfU0VOVF9UT19IVFRQU19QT1JUAFJFUE9SVABJTV9BX1RFQVBPVABSRVNFVF9DT05URU5UAE5PX0NPTlRFTlQAUEFSVElBTF9DT05URU5UAEhQRV9JTlZBTElEX0NPTlNUQU5UAEhQRV9DQl9SRVNFVABHRVQASFBFX1NUUklDVABDT05GTElDVABURU1QT1JBUllfUkVESVJFQ1QAUEVSTUFORU5UX1JFRElSRUNUAENPTk5FQ1QATVVMVElfU1RBVFVTAEhQRV9JTlZBTElEX1NUQVRVUwBUT09fTUFOWV9SRVFVRVNUUwBFQVJMWV9ISU5UUwBVTkFWQUlMQUJMRV9GT1JfTEVHQUxfUkVBU09OUwBPUFRJT05TAFNXSVRDSElOR19QUk9UT0NPTFMAVkFSSUFOVF9BTFNPX05FR09USUFURVMATVVMVElQTEVfQ0hPSUNFUwBJTlRFUk5BTF9TRVJWRVJfRVJST1IAV0VCX1NFUlZFUl9VTktOT1dOX0VSUk9SAFJBSUxHVU5fRVJST1IASURFTlRJVFlfUFJPVklERVJfQVVUSEVOVElDQVRJT05fRVJST1IAU1NMX0NFUlRJRklDQVRFX0VSUk9SAElOVkFMSURfWF9GT1JXQVJERURfRk9SAFNFVF9QQVJBTUVURVIAR0VUX1BBUkFNRVRFUgBIUEVfVVNFUgBTRUVfT1RIRVIASFBFX0NCX0NIVU5LX0hFQURFUgBNS0NBTEVOREFSAFNFVFVQAFdFQl9TRVJWRVJfSVNfRE9XTgBURUFSRE9XTgBIUEVfQ0xPU0VEX0NPTk5FQ1RJT04ASEVVUklTVElDX0VYUElSQVRJT04ARElTQ09OTkVDVEVEX09QRVJBVElPTgBOT05fQVVUSE9SSVRBVElWRV9JTkZPUk1BVElPTgBIUEVfSU5WQUxJRF9WRVJTSU9OAEhQRV9DQl9NRVNTQUdFX0JFR0lOAFNJVEVfSVNfRlJPWkVOAEhQRV9JTlZBTElEX0hFQURFUl9UT0tFTgBJTlZBTElEX1RPS0VOAEZPUkJJRERFTgBFTkhBTkNFX1lPVVJfQ0FMTQBIUEVfSU5WQUxJRF9VUkwAQkxPQ0tFRF9CWV9QQVJFTlRBTF9DT05UUk9MAE1LQ09MAEFDTABIUEVfSU5URVJOQUwAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRV9VTk9GRklDSUFMAEhQRV9PSwBVTkxJTksAVU5MT0NLAFBSSQBSRVRSWV9XSVRIAEhQRV9JTlZBTElEX0NPTlRFTlRfTEVOR1RIAEhQRV9VTkVYUEVDVEVEX0NPTlRFTlRfTEVOR1RIAEZMVVNIAFBST1BQQVRDSABNLVNFQVJDSABVUklfVE9PX0xPTkcAUFJPQ0VTU0lORwBNSVNDRUxMQU5FT1VTX1BFUlNJU1RFTlRfV0FSTklORwBNSVNDRUxMQU5FT1VTX1dBUk5JTkcASFBFX0lOVkFMSURfVFJBTlNGRVJfRU5DT0RJTkcARXhwZWN0ZWQgQ1JMRgBIUEVfSU5WQUxJRF9DSFVOS19TSVpFAE1PVkUAQ09OVElOVUUASFBFX0NCX1NUQVRVU19DT01QTEVURQBIUEVfQ0JfSEVBREVSU19DT01QTEVURQBIUEVfQ0JfVkVSU0lPTl9DT01QTEVURQBIUEVfQ0JfVVJMX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8AAF4TAAAmEwAAMBAAAPAXAACdEwAAFRIAADkXAADwEgAAChAAAHUSAACtEgAAghMAAE8UAAB/EAAAoBUAACMUAACJEgAAixQAAE0VAADUEQAAzxQAABAYAADJFgAA3BYAAMERAADgFwAAuxQAAHQUAAB8FQAA5RQAAAgXAAAfEAAAZRUAAKMUAAAoFQAAAhUAAJkVAAAsEAAAixkAAE8PAADUDgAAahAAAM4QAAACFwAAiQ4AAG4TAAAcEwAAZhQAAFYXAADBEwAAzRMAAGwTAABoFwAAZhcAAF8XAAAiEwAAzg8AAGkOAADYDgAAYxYAAMsTAACqDgAAKBcAACYXAADFEwAAXRYAAOgRAABnEwAAZRMAAPIWAABzEwAAHRcAAPkWAADzEQAAzw4AAM4VAAAMEgAAsxEAAKURAABhEAAAMhcAALsTAEH5NQsBAQBBkDYL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB/TcLAQEAQZE4C14CAwICAgICAAACAgACAgACAgICAgICAgICAAQAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEH9OQsBAQBBkToLXgIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAQfA7Cw1sb3NlZWVwLWFsaXZlAEGJPAsBAQBBoDwL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBiT4LAQEAQaA+C+cBAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAEGwwAALXwEBAAEBAQEBAAABAQABAQABAQEBAQEBAQEBAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAEGQwgALIWVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgBBwMIACy1yYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AQfnCAAsFAQIAAQMAQZDDAAvgAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH5xAALBQECAAEDAEGQxQAL4AEEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cYACwQBAAABAEGRxwAL3wEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv", "base64"); } }); @@ -2979,8 +2979,8 @@ var require_llhttp_wasm = __commonJS({ var require_llhttp_simd_wasm = __commonJS({ "node_modules/undici/lib/llhttp/llhttp_simd-wasm.js"(exports2, module) { "use strict"; - var { Buffer: Buffer7 } = __require("buffer"); - module.exports = Buffer7.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK77MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtzACAAQRBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAA/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQTBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQSBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQd0BNgIcCwYAIAAQMguaLQELfyMAQRBrIgokAEGk0AAoAgAiCUUEQEHk0wAoAgAiBUUEQEHw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBCGpBcHFB2KrVqgVzIgU2AgBB+NMAQQA2AgBByNMAQQA2AgALQczTAEGA1AQ2AgBBnNAAQYDUBDYCAEGw0AAgBTYCAEGs0ABBfzYCAEHQ0wBBgKwDNgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBjNQEQcGrAzYCAEGo0ABB9NMAKAIANgIAQZjQAEHAqwM2AgBBpNAAQYjUBDYCAEHM/wdBODYCAEGI1AQhCQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQewBTQRAQYzQACgCACIGQRAgAEETakFwcSAAQQtJGyIEQQN2IgB2IgFBA3EEQAJAIAFBAXEgAHJBAXMiAkEDdCIAQbTQAGoiASAAQbzQAGooAgAiACgCCCIDRgRAQYzQACAGQX4gAndxNgIADAELIAEgAzYCCCADIAE2AgwLIABBCGohASAAIAJBA3QiAkEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwRC0GU0AAoAgAiCCAETw0BIAEEQAJAQQIgAHQiAkEAIAJrciABIAB0cWgiAEEDdCICQbTQAGoiASACQbzQAGooAgAiAigCCCIDRgRAQYzQACAGQX4gAHdxIgY2AgAMAQsgASADNgIIIAMgATYCDAsgAiAEQQNyNgIEIABBA3QiACAEayEFIAAgAmogBTYCACACIARqIgQgBUEBcjYCBCAIBEAgCEF4cUG00ABqIQBBoNAAKAIAIQMCf0EBIAhBA3Z0IgEgBnFFBEBBjNAAIAEgBnI2AgAgAAwBCyAAKAIICyIBIAM2AgwgACADNgIIIAMgADYCDCADIAE2AggLIAJBCGohAUGg0AAgBDYCAEGU0AAgBTYCAAwRC0GQ0AAoAgAiC0UNASALaEECdEG80gBqKAIAIgAoAgRBeHEgBGshBSAAIQIDQAJAIAIoAhAiAUUEQCACQRRqKAIAIgFFDQELIAEoAgRBeHEgBGsiAyAFSSECIAMgBSACGyEFIAEgACACGyEAIAEhAgwBCwsgACgCGCEJIAAoAgwiAyAARwRAQZzQACgCABogAyAAKAIIIgE2AgggASADNgIMDBALIABBFGoiAigCACIBRQRAIAAoAhAiAUUNAyAAQRBqIQILA0AgAiEHIAEiA0EUaiICKAIAIgENACADQRBqIQIgAygCECIBDQALIAdBADYCAAwPC0F/IQQgAEG/f0sNACAAQRNqIgFBcHEhBEGQ0AAoAgAiCEUNAEEAIARrIQUCQAJAAkACf0EAIARBgAJJDQAaQR8gBEH///8HSw0AGiAEQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qCyIGQQJ0QbzSAGooAgAiAkUEQEEAIQFBACEDDAELQQAhASAEQRkgBkEBdmtBACAGQR9HG3QhAEEAIQMDQAJAIAIoAgRBeHEgBGsiByAFTw0AIAIhAyAHIgUNAEEAIQUgAiEBDAMLIAEgAkEUaigCACIHIAcgAiAAQR12QQRxakEQaigCACICRhsgASAHGyEBIABBAXQhACACDQALCyABIANyRQRAQQAhA0ECIAZ0IgBBACAAa3IgCHEiAEUNAyAAaEECdEG80gBqKAIAIQELIAFFDQELA0AgASgCBEF4cSAEayICIAVJIQAgAiAFIAAbIQUgASADIAAbIQMgASgCECIABH8gAAUgAUEUaigCAAsiAQ0ACwsgA0UNACAFQZTQACgCACAEa08NACADKAIYIQcgAyADKAIMIgBHBEBBnNAAKAIAGiAAIAMoAggiATYCCCABIAA2AgwMDgsgA0EUaiICKAIAIgFFBEAgAygCECIBRQ0DIANBEGohAgsDQCACIQYgASIAQRRqIgIoAgAiAQ0AIABBEGohAiAAKAIQIgENAAsgBkEANgIADA0LQZTQACgCACIDIARPBEBBoNAAKAIAIQECQCADIARrIgJBEE8EQCABIARqIgAgAkEBcjYCBCABIANqIAI2AgAgASAEQQNyNgIEDAELIAEgA0EDcjYCBCABIANqIgAgACgCBEEBcjYCBEEAIQBBACECC0GU0AAgAjYCAEGg0AAgADYCACABQQhqIQEMDwtBmNAAKAIAIgMgBEsEQCAEIAlqIgAgAyAEayIBQQFyNgIEQaTQACAANgIAQZjQACABNgIAIAkgBEEDcjYCBCAJQQhqIQEMDwtBACEBIAQCf0Hk0wAoAgAEQEHs0wAoAgAMAQtB8NMAQn83AgBB6NMAQoCAhICAgMAANwIAQeTTACAKQQxqQXBxQdiq1aoFczYCAEH40wBBADYCAEHI0wBBADYCAEGAgAQLIgAgBEHHAGoiBWoiBkEAIABrIgdxIgJPBEBB/NMAQTA2AgAMDwsCQEHE0wAoAgAiAUUNAEG80wAoAgAiCCACaiEAIAAgAU0gACAIS3ENAEEAIQFB/NMAQTA2AgAMDwtByNMALQAAQQRxDQQCQAJAIAkEQEHM0wAhAQNAIAEoAgAiACAJTQRAIAAgASgCBGogCUsNAwsgASgCCCIBDQALC0EAEDMiAEF/Rg0FIAIhBkHo0wAoAgAiAUEBayIDIABxBEAgAiAAayAAIANqQQAgAWtxaiEGCyAEIAZPDQUgBkH+////B0sNBUHE0wAoAgAiAwRAQbzTACgCACIHIAZqIQEgASAHTQ0GIAEgA0sNBgsgBhAzIgEgAEcNAQwHCyAGIANrIAdxIgZB/v///wdLDQQgBhAzIQAgACABKAIAIAEoAgRqRg0DIAAhAQsCQCAGIARByABqTw0AIAFBf0YNAEHs0wAoAgAiACAFIAZrakEAIABrcSIAQf7///8HSwRAIAEhAAwHCyAAEDNBf0cEQCAAIAZqIQYgASEADAcLQQAgBmsQMxoMBAsgASIAQX9HDQUMAwtBACEDDAwLQQAhAAwKCyAAQX9HDQILQcjTAEHI0wAoAgBBBHI2AgALIAJB/v///wdLDQEgAhAzIQBBABAzIQEgAEF/Rg0BIAFBf0YNASAAIAFPDQEgASAAayIGIARBOGpNDQELQbzTAEG80wAoAgAgBmoiATYCAEHA0wAoAgAgAUkEQEHA0wAgATYCAAsCQAJAAkBBpNAAKAIAIgIEQEHM0wAhAQNAIAAgASgCACIDIAEoAgQiBWpGDQIgASgCCCIBDQALDAILQZzQACgCACIBQQBHIAAgAU9xRQRAQZzQACAANgIAC0EAIQFB0NMAIAY2AgBBzNMAIAA2AgBBrNAAQX82AgBBsNAAQeTTACgCADYCAEHY0wBBADYCAANAIAFByNAAaiABQbzQAGoiAjYCACACIAFBtNAAaiIDNgIAIAFBwNAAaiADNgIAIAFB0NAAaiABQcTQAGoiAzYCACADIAI2AgAgAUHY0ABqIAFBzNAAaiICNgIAIAIgAzYCACABQdTQAGogAjYCACABQSBqIgFBgAJHDQALQXggAGtBD3EiASAAaiICIAZBOGsiAyABayIBQQFyNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAI2AgAgACADakE4NgIEDAILIAAgAk0NACACIANJDQAgASgCDEEIcQ0AQXggAmtBD3EiACACaiIDQZjQACgCACAGaiIHIABrIgBBAXI2AgQgASAFIAZqNgIEQajQAEH00wAoAgA2AgBBmNAAIAA2AgBBpNAAIAM2AgAgAiAHakE4NgIEDAELIABBnNAAKAIASQRAQZzQACAANgIACyAAIAZqIQNBzNMAIQECQAJAAkADQCADIAEoAgBHBEAgASgCCCIBDQEMAgsLIAEtAAxBCHFFDQELQczTACEBA0AgASgCACIDIAJNBEAgAyABKAIEaiIFIAJLDQMLIAEoAgghAQwACwALIAEgADYCACABIAEoAgQgBmo2AgQgAEF4IABrQQ9xaiIJIARBA3I2AgQgA0F4IANrQQ9xaiIGIAQgCWoiBGshASACIAZGBEBBpNAAIAQ2AgBBmNAAQZjQACgCACABaiIANgIAIAQgAEEBcjYCBAwIC0Gg0AAoAgAgBkYEQEGg0AAgBDYCAEGU0ABBlNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEIAAgBGogADYCAAwICyAGKAIEIgVBA3FBAUcNBiAFQXhxIQggBUH/AU0EQCAFQQN2IQMgBigCCCIAIAYoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAcLIAIgADYCCCAAIAI2AgwMBgsgBigCGCEHIAYgBigCDCIARwRAIAAgBigCCCICNgIIIAIgADYCDAwFCyAGQRRqIgIoAgAiBUUEQCAGKAIQIgVFDQQgBkEQaiECCwNAIAIhAyAFIgBBFGoiAigCACIFDQAgAEEQaiECIAAoAhAiBQ0ACyADQQA2AgAMBAtBeCAAa0EPcSIBIABqIgcgBkE4ayIDIAFrIgFBAXI2AgQgACADakE4NgIEIAIgBUE3IAVrQQ9xakE/ayIDIAMgAkEQakkbIgNBIzYCBEGo0ABB9NMAKAIANgIAQZjQACABNgIAQaTQACAHNgIAIANBEGpB1NMAKQIANwIAIANBzNMAKQIANwIIQdTTACADQQhqNgIAQdDTACAGNgIAQczTACAANgIAQdjTAEEANgIAIANBJGohAQNAIAFBBzYCACAFIAFBBGoiAUsNAAsgAiADRg0AIAMgAygCBEF+cTYCBCADIAMgAmsiBTYCACACIAVBAXI2AgQgBUH/AU0EQCAFQXhxQbTQAGohAAJ/QYzQACgCACIBQQEgBUEDdnQiA3FFBEBBjNAAIAEgA3I2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEG80gBqIQBBkNAAKAIAIgNBASABdCIGcUUEQCAAIAI2AgBBkNAAIAMgBnI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEDAkADQCADIgAoAgRBeHEgBUYNASABQR12IQMgAUEBdCEBIAAgA0EEcWpBEGoiBigCACIDDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLQZjQACgCACIBIARNDQBBpNAAKAIAIgAgBGoiAiABIARrIgFBAXI2AgRBmNAAIAE2AgBBpNAAIAI2AgAgACAEQQNyNgIEIABBCGohAQwIC0EAIQFB/NMAQTA2AgAMBwtBACEACyAHRQ0AAkAgBigCHCICQQJ0QbzSAGoiAygCACAGRgRAIAMgADYCACAADQFBkNAAQZDQACgCAEF+IAJ3cTYCAAwCCyAHQRBBFCAHKAIQIAZGG2ogADYCACAARQ0BCyAAIAc2AhggBigCECICBEAgACACNgIQIAIgADYCGAsgBkEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgCGohASAGIAhqIgYoAgQhBQsgBiAFQX5xNgIEIAEgBGogATYCACAEIAFBAXI2AgQgAUH/AU0EQCABQXhxQbTQAGohAAJ/QYzQACgCACICQQEgAUEDdnQiAXFFBEBBjNAAIAEgAnI2AgAgAAwBCyAAKAIICyIBIAQ2AgwgACAENgIIIAQgADYCDCAEIAE2AggMAQtBHyEFIAFB////B00EQCABQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQULIAQgBTYCHCAEQgA3AhAgBUECdEG80gBqIQBBkNAAKAIAIgJBASAFdCIDcUUEQCAAIAQ2AgBBkNAAIAIgA3I2AgAgBCAANgIYIAQgBDYCCCAEIAQ2AgwMAQsgAUEZIAVBAXZrQQAgBUEfRxt0IQUgACgCACEAAkADQCAAIgIoAgRBeHEgAUYNASAFQR12IQAgBUEBdCEFIAIgAEEEcWpBEGoiAygCACIADQALIAMgBDYCACAEIAI2AhggBCAENgIMIAQgBDYCCAwBCyACKAIIIgAgBDYCDCACIAQ2AgggBEEANgIYIAQgAjYCDCAEIAA2AggLIAlBCGohAQwCCwJAIAdFDQACQCADKAIcIgFBAnRBvNIAaiICKAIAIANGBEAgAiAANgIAIAANAUGQ0AAgCEF+IAF3cSIINgIADAILIAdBEEEUIAcoAhAgA0YbaiAANgIAIABFDQELIAAgBzYCGCADKAIQIgEEQCAAIAE2AhAgASAANgIYCyADQRRqKAIAIgFFDQAgAEEUaiABNgIAIAEgADYCGAsCQCAFQQ9NBEAgAyAEIAVqIgBBA3I2AgQgACADaiIAIAAoAgRBAXI2AgQMAQsgAyAEaiICIAVBAXI2AgQgAyAEQQNyNgIEIAIgBWogBTYCACAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIFcUUEQEGM0AAgASAFcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEEBIAF0IgQgCHFFBEAgACACNgIAQZDQACAEIAhyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhBAJAA0AgBCIAKAIEQXhxIAVGDQEgAUEddiEEIAFBAXQhASAAIARBBHFqQRBqIgYoAgAiBA0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIICyADQQhqIQEMAQsCQCAJRQ0AAkAgACgCHCIBQQJ0QbzSAGoiAigCACAARgRAIAIgAzYCACADDQFBkNAAIAtBfiABd3E2AgAMAgsgCUEQQRQgCSgCECAARhtqIAM2AgAgA0UNAQsgAyAJNgIYIAAoAhAiAQRAIAMgATYCECABIAM2AhgLIABBFGooAgAiAUUNACADQRRqIAE2AgAgASADNgIYCwJAIAVBD00EQCAAIAQgBWoiAUEDcjYCBCAAIAFqIgEgASgCBEEBcjYCBAwBCyAAIARqIgcgBUEBcjYCBCAAIARBA3I2AgQgBSAHaiAFNgIAIAgEQCAIQXhxQbTQAGohAUGg0AAoAgAhAwJ/QQEgCEEDdnQiAiAGcUUEQEGM0AAgAiAGcjYCACABDAELIAEoAggLIgIgAzYCDCABIAM2AgggAyABNgIMIAMgAjYCCAtBoNAAIAc2AgBBlNAAIAU2AgALIABBCGohAQsgCkEQaiQAIAELQwAgAEUEQD8AQRB0DwsCQCAAQf//A3ENACAAQQBIDQAgAEEQdkAAIgBBf0YEQEH80wBBMDYCAEF/DwsgAEEQdA8LAAsL3D8iAEGACAsJAQAAAAIAAAADAEGUCAsFBAAAAAUAQaQICwkGAAAABwAAAAgAQdwIC4otSW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwBB+TULAQEAQZA2C+ABAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQf03CwEBAEGROAteAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgBB/TkLAQEAQZE6C14CAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEHwOwsNbG9zZWVlcC1hbGl2ZQBBiTwLAQEAQaA8C+ABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQYk+CwEBAEGgPgvnAQEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZABBsMAAC18BAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBBkMIACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQcDCAAstcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQoNClNNDQoNClRUUC9DRS9UU1AvAEH5wgALBQECAAEDAEGQwwAL4AEEAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cQACwUBAgABAwBBkMUAC+ABBAEBBQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQfnGAAsEAQAAAQBBkccAC98BAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+sgACwQBAAACAEGQyQALXwMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==", "base64"); + var { Buffer: Buffer4 } = __require("buffer"); + module.exports = Buffer4.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK77MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtzACAAQRBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAA/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQTBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQSBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQd0BNgIcCwYAIAAQMguaLQELfyMAQRBrIgokAEGk0AAoAgAiCUUEQEHk0wAoAgAiBUUEQEHw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBCGpBcHFB2KrVqgVzIgU2AgBB+NMAQQA2AgBByNMAQQA2AgALQczTAEGA1AQ2AgBBnNAAQYDUBDYCAEGw0AAgBTYCAEGs0ABBfzYCAEHQ0wBBgKwDNgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBjNQEQcGrAzYCAEGo0ABB9NMAKAIANgIAQZjQAEHAqwM2AgBBpNAAQYjUBDYCAEHM/wdBODYCAEGI1AQhCQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQewBTQRAQYzQACgCACIGQRAgAEETakFwcSAAQQtJGyIEQQN2IgB2IgFBA3EEQAJAIAFBAXEgAHJBAXMiAkEDdCIAQbTQAGoiASAAQbzQAGooAgAiACgCCCIDRgRAQYzQACAGQX4gAndxNgIADAELIAEgAzYCCCADIAE2AgwLIABBCGohASAAIAJBA3QiAkEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwRC0GU0AAoAgAiCCAETw0BIAEEQAJAQQIgAHQiAkEAIAJrciABIAB0cWgiAEEDdCICQbTQAGoiASACQbzQAGooAgAiAigCCCIDRgRAQYzQACAGQX4gAHdxIgY2AgAMAQsgASADNgIIIAMgATYCDAsgAiAEQQNyNgIEIABBA3QiACAEayEFIAAgAmogBTYCACACIARqIgQgBUEBcjYCBCAIBEAgCEF4cUG00ABqIQBBoNAAKAIAIQMCf0EBIAhBA3Z0IgEgBnFFBEBBjNAAIAEgBnI2AgAgAAwBCyAAKAIICyIBIAM2AgwgACADNgIIIAMgADYCDCADIAE2AggLIAJBCGohAUGg0AAgBDYCAEGU0AAgBTYCAAwRC0GQ0AAoAgAiC0UNASALaEECdEG80gBqKAIAIgAoAgRBeHEgBGshBSAAIQIDQAJAIAIoAhAiAUUEQCACQRRqKAIAIgFFDQELIAEoAgRBeHEgBGsiAyAFSSECIAMgBSACGyEFIAEgACACGyEAIAEhAgwBCwsgACgCGCEJIAAoAgwiAyAARwRAQZzQACgCABogAyAAKAIIIgE2AgggASADNgIMDBALIABBFGoiAigCACIBRQRAIAAoAhAiAUUNAyAAQRBqIQILA0AgAiEHIAEiA0EUaiICKAIAIgENACADQRBqIQIgAygCECIBDQALIAdBADYCAAwPC0F/IQQgAEG/f0sNACAAQRNqIgFBcHEhBEGQ0AAoAgAiCEUNAEEAIARrIQUCQAJAAkACf0EAIARBgAJJDQAaQR8gBEH///8HSw0AGiAEQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qCyIGQQJ0QbzSAGooAgAiAkUEQEEAIQFBACEDDAELQQAhASAEQRkgBkEBdmtBACAGQR9HG3QhAEEAIQMDQAJAIAIoAgRBeHEgBGsiByAFTw0AIAIhAyAHIgUNAEEAIQUgAiEBDAMLIAEgAkEUaigCACIHIAcgAiAAQR12QQRxakEQaigCACICRhsgASAHGyEBIABBAXQhACACDQALCyABIANyRQRAQQAhA0ECIAZ0IgBBACAAa3IgCHEiAEUNAyAAaEECdEG80gBqKAIAIQELIAFFDQELA0AgASgCBEF4cSAEayICIAVJIQAgAiAFIAAbIQUgASADIAAbIQMgASgCECIABH8gAAUgAUEUaigCAAsiAQ0ACwsgA0UNACAFQZTQACgCACAEa08NACADKAIYIQcgAyADKAIMIgBHBEBBnNAAKAIAGiAAIAMoAggiATYCCCABIAA2AgwMDgsgA0EUaiICKAIAIgFFBEAgAygCECIBRQ0DIANBEGohAgsDQCACIQYgASIAQRRqIgIoAgAiAQ0AIABBEGohAiAAKAIQIgENAAsgBkEANgIADA0LQZTQACgCACIDIARPBEBBoNAAKAIAIQECQCADIARrIgJBEE8EQCABIARqIgAgAkEBcjYCBCABIANqIAI2AgAgASAEQQNyNgIEDAELIAEgA0EDcjYCBCABIANqIgAgACgCBEEBcjYCBEEAIQBBACECC0GU0AAgAjYCAEGg0AAgADYCACABQQhqIQEMDwtBmNAAKAIAIgMgBEsEQCAEIAlqIgAgAyAEayIBQQFyNgIEQaTQACAANgIAQZjQACABNgIAIAkgBEEDcjYCBCAJQQhqIQEMDwtBACEBIAQCf0Hk0wAoAgAEQEHs0wAoAgAMAQtB8NMAQn83AgBB6NMAQoCAhICAgMAANwIAQeTTACAKQQxqQXBxQdiq1aoFczYCAEH40wBBADYCAEHI0wBBADYCAEGAgAQLIgAgBEHHAGoiBWoiBkEAIABrIgdxIgJPBEBB/NMAQTA2AgAMDwsCQEHE0wAoAgAiAUUNAEG80wAoAgAiCCACaiEAIAAgAU0gACAIS3ENAEEAIQFB/NMAQTA2AgAMDwtByNMALQAAQQRxDQQCQAJAIAkEQEHM0wAhAQNAIAEoAgAiACAJTQRAIAAgASgCBGogCUsNAwsgASgCCCIBDQALC0EAEDMiAEF/Rg0FIAIhBkHo0wAoAgAiAUEBayIDIABxBEAgAiAAayAAIANqQQAgAWtxaiEGCyAEIAZPDQUgBkH+////B0sNBUHE0wAoAgAiAwRAQbzTACgCACIHIAZqIQEgASAHTQ0GIAEgA0sNBgsgBhAzIgEgAEcNAQwHCyAGIANrIAdxIgZB/v///wdLDQQgBhAzIQAgACABKAIAIAEoAgRqRg0DIAAhAQsCQCAGIARByABqTw0AIAFBf0YNAEHs0wAoAgAiACAFIAZrakEAIABrcSIAQf7///8HSwRAIAEhAAwHCyAAEDNBf0cEQCAAIAZqIQYgASEADAcLQQAgBmsQMxoMBAsgASIAQX9HDQUMAwtBACEDDAwLQQAhAAwKCyAAQX9HDQILQcjTAEHI0wAoAgBBBHI2AgALIAJB/v///wdLDQEgAhAzIQBBABAzIQEgAEF/Rg0BIAFBf0YNASAAIAFPDQEgASAAayIGIARBOGpNDQELQbzTAEG80wAoAgAgBmoiATYCAEHA0wAoAgAgAUkEQEHA0wAgATYCAAsCQAJAAkBBpNAAKAIAIgIEQEHM0wAhAQNAIAAgASgCACIDIAEoAgQiBWpGDQIgASgCCCIBDQALDAILQZzQACgCACIBQQBHIAAgAU9xRQRAQZzQACAANgIAC0EAIQFB0NMAIAY2AgBBzNMAIAA2AgBBrNAAQX82AgBBsNAAQeTTACgCADYCAEHY0wBBADYCAANAIAFByNAAaiABQbzQAGoiAjYCACACIAFBtNAAaiIDNgIAIAFBwNAAaiADNgIAIAFB0NAAaiABQcTQAGoiAzYCACADIAI2AgAgAUHY0ABqIAFBzNAAaiICNgIAIAIgAzYCACABQdTQAGogAjYCACABQSBqIgFBgAJHDQALQXggAGtBD3EiASAAaiICIAZBOGsiAyABayIBQQFyNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAI2AgAgACADakE4NgIEDAILIAAgAk0NACACIANJDQAgASgCDEEIcQ0AQXggAmtBD3EiACACaiIDQZjQACgCACAGaiIHIABrIgBBAXI2AgQgASAFIAZqNgIEQajQAEH00wAoAgA2AgBBmNAAIAA2AgBBpNAAIAM2AgAgAiAHakE4NgIEDAELIABBnNAAKAIASQRAQZzQACAANgIACyAAIAZqIQNBzNMAIQECQAJAAkADQCADIAEoAgBHBEAgASgCCCIBDQEMAgsLIAEtAAxBCHFFDQELQczTACEBA0AgASgCACIDIAJNBEAgAyABKAIEaiIFIAJLDQMLIAEoAgghAQwACwALIAEgADYCACABIAEoAgQgBmo2AgQgAEF4IABrQQ9xaiIJIARBA3I2AgQgA0F4IANrQQ9xaiIGIAQgCWoiBGshASACIAZGBEBBpNAAIAQ2AgBBmNAAQZjQACgCACABaiIANgIAIAQgAEEBcjYCBAwIC0Gg0AAoAgAgBkYEQEGg0AAgBDYCAEGU0ABBlNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEIAAgBGogADYCAAwICyAGKAIEIgVBA3FBAUcNBiAFQXhxIQggBUH/AU0EQCAFQQN2IQMgBigCCCIAIAYoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAcLIAIgADYCCCAAIAI2AgwMBgsgBigCGCEHIAYgBigCDCIARwRAIAAgBigCCCICNgIIIAIgADYCDAwFCyAGQRRqIgIoAgAiBUUEQCAGKAIQIgVFDQQgBkEQaiECCwNAIAIhAyAFIgBBFGoiAigCACIFDQAgAEEQaiECIAAoAhAiBQ0ACyADQQA2AgAMBAtBeCAAa0EPcSIBIABqIgcgBkE4ayIDIAFrIgFBAXI2AgQgACADakE4NgIEIAIgBUE3IAVrQQ9xakE/ayIDIAMgAkEQakkbIgNBIzYCBEGo0ABB9NMAKAIANgIAQZjQACABNgIAQaTQACAHNgIAIANBEGpB1NMAKQIANwIAIANBzNMAKQIANwIIQdTTACADQQhqNgIAQdDTACAGNgIAQczTACAANgIAQdjTAEEANgIAIANBJGohAQNAIAFBBzYCACAFIAFBBGoiAUsNAAsgAiADRg0AIAMgAygCBEF+cTYCBCADIAMgAmsiBTYCACACIAVBAXI2AgQgBUH/AU0EQCAFQXhxQbTQAGohAAJ/QYzQACgCACIBQQEgBUEDdnQiA3FFBEBBjNAAIAEgA3I2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEG80gBqIQBBkNAAKAIAIgNBASABdCIGcUUEQCAAIAI2AgBBkNAAIAMgBnI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEDAkADQCADIgAoAgRBeHEgBUYNASABQR12IQMgAUEBdCEBIAAgA0EEcWpBEGoiBigCACIDDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLQZjQACgCACIBIARNDQBBpNAAKAIAIgAgBGoiAiABIARrIgFBAXI2AgRBmNAAIAE2AgBBpNAAIAI2AgAgACAEQQNyNgIEIABBCGohAQwIC0EAIQFB/NMAQTA2AgAMBwtBACEACyAHRQ0AAkAgBigCHCICQQJ0QbzSAGoiAygCACAGRgRAIAMgADYCACAADQFBkNAAQZDQACgCAEF+IAJ3cTYCAAwCCyAHQRBBFCAHKAIQIAZGG2ogADYCACAARQ0BCyAAIAc2AhggBigCECICBEAgACACNgIQIAIgADYCGAsgBkEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgCGohASAGIAhqIgYoAgQhBQsgBiAFQX5xNgIEIAEgBGogATYCACAEIAFBAXI2AgQgAUH/AU0EQCABQXhxQbTQAGohAAJ/QYzQACgCACICQQEgAUEDdnQiAXFFBEBBjNAAIAEgAnI2AgAgAAwBCyAAKAIICyIBIAQ2AgwgACAENgIIIAQgADYCDCAEIAE2AggMAQtBHyEFIAFB////B00EQCABQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQULIAQgBTYCHCAEQgA3AhAgBUECdEG80gBqIQBBkNAAKAIAIgJBASAFdCIDcUUEQCAAIAQ2AgBBkNAAIAIgA3I2AgAgBCAANgIYIAQgBDYCCCAEIAQ2AgwMAQsgAUEZIAVBAXZrQQAgBUEfRxt0IQUgACgCACEAAkADQCAAIgIoAgRBeHEgAUYNASAFQR12IQAgBUEBdCEFIAIgAEEEcWpBEGoiAygCACIADQALIAMgBDYCACAEIAI2AhggBCAENgIMIAQgBDYCCAwBCyACKAIIIgAgBDYCDCACIAQ2AgggBEEANgIYIAQgAjYCDCAEIAA2AggLIAlBCGohAQwCCwJAIAdFDQACQCADKAIcIgFBAnRBvNIAaiICKAIAIANGBEAgAiAANgIAIAANAUGQ0AAgCEF+IAF3cSIINgIADAILIAdBEEEUIAcoAhAgA0YbaiAANgIAIABFDQELIAAgBzYCGCADKAIQIgEEQCAAIAE2AhAgASAANgIYCyADQRRqKAIAIgFFDQAgAEEUaiABNgIAIAEgADYCGAsCQCAFQQ9NBEAgAyAEIAVqIgBBA3I2AgQgACADaiIAIAAoAgRBAXI2AgQMAQsgAyAEaiICIAVBAXI2AgQgAyAEQQNyNgIEIAIgBWogBTYCACAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIFcUUEQEGM0AAgASAFcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEEBIAF0IgQgCHFFBEAgACACNgIAQZDQACAEIAhyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhBAJAA0AgBCIAKAIEQXhxIAVGDQEgAUEddiEEIAFBAXQhASAAIARBBHFqQRBqIgYoAgAiBA0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIICyADQQhqIQEMAQsCQCAJRQ0AAkAgACgCHCIBQQJ0QbzSAGoiAigCACAARgRAIAIgAzYCACADDQFBkNAAIAtBfiABd3E2AgAMAgsgCUEQQRQgCSgCECAARhtqIAM2AgAgA0UNAQsgAyAJNgIYIAAoAhAiAQRAIAMgATYCECABIAM2AhgLIABBFGooAgAiAUUNACADQRRqIAE2AgAgASADNgIYCwJAIAVBD00EQCAAIAQgBWoiAUEDcjYCBCAAIAFqIgEgASgCBEEBcjYCBAwBCyAAIARqIgcgBUEBcjYCBCAAIARBA3I2AgQgBSAHaiAFNgIAIAgEQCAIQXhxQbTQAGohAUGg0AAoAgAhAwJ/QQEgCEEDdnQiAiAGcUUEQEGM0AAgAiAGcjYCACABDAELIAEoAggLIgIgAzYCDCABIAM2AgggAyABNgIMIAMgAjYCCAtBoNAAIAc2AgBBlNAAIAU2AgALIABBCGohAQsgCkEQaiQAIAELQwAgAEUEQD8AQRB0DwsCQCAAQf//A3ENACAAQQBIDQAgAEEQdkAAIgBBf0YEQEH80wBBMDYCAEF/DwsgAEEQdA8LAAsL3D8iAEGACAsJAQAAAAIAAAADAEGUCAsFBAAAAAUAQaQICwkGAAAABwAAAAgAQdwIC4otSW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwBB+TULAQEAQZA2C+ABAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQf03CwEBAEGROAteAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgBB/TkLAQEAQZE6C14CAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEHwOwsNbG9zZWVlcC1hbGl2ZQBBiTwLAQEAQaA8C+ABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQYk+CwEBAEGgPgvnAQEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZABBsMAAC18BAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBBkMIACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQcDCAAstcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQoNClNNDQoNClRUUC9DRS9UU1AvAEH5wgALBQECAAEDAEGQwwAL4AEEAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cQACwUBAgABAwBBkMUAC+ABBAEBBQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQfnGAAsEAQAAAQBBkccAC98BAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+sgACwQBAAACAEGQyQALXwMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==", "base64"); } }); @@ -3594,7 +3594,7 @@ var require_data_url = __commonJS({ var require_webidl = __commonJS({ "node_modules/undici/lib/web/fetch/webidl.js"(exports2, module) { "use strict"; - var { types: types3, inspect: inspect2 } = __require("util"); + var { types: types3, inspect: inspect3 } = __require("util"); var { markAsUncloneable } = __require("worker_threads"); var { toUSVString } = require_util(); var webidl = {}; @@ -3618,15 +3618,15 @@ var require_webidl = __commonJS({ message: `"${context5.value}" is an invalid ${context5.type}.` }); }; - webidl.brandCheck = function(V2, I3, opts) { + webidl.brandCheck = function(V2, I2, opts) { if (opts?.strict !== false) { - if (!(V2 instanceof I3)) { + if (!(V2 instanceof I2)) { const err = new TypeError("Illegal invocation"); err.code = "ERR_INVALID_THIS"; throw err; } } else { - if (V2?.[Symbol.toStringTag] !== I3.prototype[Symbol.toStringTag]) { + if (V2?.[Symbol.toStringTag] !== I2.prototype[Symbol.toStringTag]) { const err = new TypeError("Illegal invocation"); err.code = "ERR_INVALID_THIS"; throw err; @@ -3689,48 +3689,48 @@ var require_webidl = __commonJS({ lowerBound = Math.pow(-2, bitLength) - 1; upperBound = Math.pow(2, bitLength - 1) - 1; } - let x6 = Number(V2); - if (x6 === 0) { - x6 = 0; + let x2 = Number(V2); + if (x2 === 0) { + x2 = 0; } if (opts?.enforceRange === true) { - if (Number.isNaN(x6) || x6 === Number.POSITIVE_INFINITY || x6 === Number.NEGATIVE_INFINITY) { + if (Number.isNaN(x2) || x2 === Number.POSITIVE_INFINITY || x2 === Number.NEGATIVE_INFINITY) { throw webidl.errors.exception({ header: "Integer conversion", message: `Could not convert ${webidl.util.Stringify(V2)} to an integer.` }); } - x6 = webidl.util.IntegerPart(x6); - if (x6 < lowerBound || x6 > upperBound) { + x2 = webidl.util.IntegerPart(x2); + if (x2 < lowerBound || x2 > upperBound) { throw webidl.errors.exception({ header: "Integer conversion", - message: `Value must be between ${lowerBound}-${upperBound}, got ${x6}.` + message: `Value must be between ${lowerBound}-${upperBound}, got ${x2}.` }); } - return x6; + return x2; } - if (!Number.isNaN(x6) && opts?.clamp === true) { - x6 = Math.min(Math.max(x6, lowerBound), upperBound); - if (Math.floor(x6) % 2 === 0) { - x6 = Math.floor(x6); + if (!Number.isNaN(x2) && opts?.clamp === true) { + x2 = Math.min(Math.max(x2, lowerBound), upperBound); + if (Math.floor(x2) % 2 === 0) { + x2 = Math.floor(x2); } else { - x6 = Math.ceil(x6); + x2 = Math.ceil(x2); } - return x6; + return x2; } - if (Number.isNaN(x6) || x6 === 0 && Object.is(0, x6) || x6 === Number.POSITIVE_INFINITY || x6 === Number.NEGATIVE_INFINITY) { + if (Number.isNaN(x2) || x2 === 0 && Object.is(0, x2) || x2 === Number.POSITIVE_INFINITY || x2 === Number.NEGATIVE_INFINITY) { return 0; } - x6 = webidl.util.IntegerPart(x6); - x6 = x6 % Math.pow(2, bitLength); - if (signedness === "signed" && x6 >= Math.pow(2, bitLength) - 1) { - return x6 - Math.pow(2, bitLength); + x2 = webidl.util.IntegerPart(x2); + x2 = x2 % Math.pow(2, bitLength); + if (signedness === "signed" && x2 >= Math.pow(2, bitLength) - 1) { + return x2 - Math.pow(2, bitLength); } - return x6; + return x2; }; - webidl.util.IntegerPart = function(n12) { - const r6 = Math.floor(Math.abs(n12)); - if (n12 < 0) { + webidl.util.IntegerPart = function(n8) { + const r6 = Math.floor(Math.abs(n8)); + if (n8 < 0) { return -1 * r6; } return r6; @@ -3741,7 +3741,7 @@ var require_webidl = __commonJS({ case "Symbol": return `Symbol(${V2.description})`; case "Object": - return inspect2(V2); + return inspect3(V2); case "String": return `"${V2}"`; default: @@ -3878,39 +3878,39 @@ var require_webidl = __commonJS({ return String(V2); }; webidl.converters.ByteString = function(V2, prefix2, argument) { - const x6 = webidl.converters.DOMString(V2, prefix2, argument); - for (let index2 = 0; index2 < x6.length; index2++) { - if (x6.charCodeAt(index2) > 255) { + const x2 = webidl.converters.DOMString(V2, prefix2, argument); + for (let index2 = 0; index2 < x2.length; index2++) { + if (x2.charCodeAt(index2) > 255) { throw new TypeError( - `Cannot convert argument to a ByteString because the character at index ${index2} has a value of ${x6.charCodeAt(index2)} which is greater than 255.` + `Cannot convert argument to a ByteString because the character at index ${index2} has a value of ${x2.charCodeAt(index2)} which is greater than 255.` ); } } - return x6; + return x2; }; webidl.converters.USVString = toUSVString; webidl.converters.boolean = function(V2) { - const x6 = Boolean(V2); - return x6; + const x2 = Boolean(V2); + return x2; }; webidl.converters.any = function(V2) { return V2; }; webidl.converters["long long"] = function(V2, prefix2, argument) { - const x6 = webidl.util.ConvertToInt(V2, 64, "signed", void 0, prefix2, argument); - return x6; + const x2 = webidl.util.ConvertToInt(V2, 64, "signed", void 0, prefix2, argument); + return x2; }; webidl.converters["unsigned long long"] = function(V2, prefix2, argument) { - const x6 = webidl.util.ConvertToInt(V2, 64, "unsigned", void 0, prefix2, argument); - return x6; + const x2 = webidl.util.ConvertToInt(V2, 64, "unsigned", void 0, prefix2, argument); + return x2; }; webidl.converters["unsigned long"] = function(V2, prefix2, argument) { - const x6 = webidl.util.ConvertToInt(V2, 32, "unsigned", void 0, prefix2, argument); - return x6; + const x2 = webidl.util.ConvertToInt(V2, 32, "unsigned", void 0, prefix2, argument); + return x2; }; webidl.converters["unsigned short"] = function(V2, prefix2, argument, opts) { - const x6 = webidl.util.ConvertToInt(V2, 16, "unsigned", opts, prefix2, argument); - return x6; + const x2 = webidl.util.ConvertToInt(V2, 16, "unsigned", opts, prefix2, argument); + return x2; }; webidl.converters.ArrayBuffer = function(V2, prefix2, argument, opts) { if (webidl.util.Type(V2) !== "Object" || !types3.isAnyArrayBuffer(V2)) { @@ -4024,11 +4024,11 @@ var require_util2 = __commonJS({ var { isUint8Array } = __require("util/types"); var { webidl } = require_webidl(); var supportedHashes = []; - var crypto6; + var crypto5; try { - crypto6 = __require("crypto"); + crypto5 = __require("crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto6.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); + supportedHashes = crypto5.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); } catch { } function responseURL(response) { @@ -4065,11 +4065,11 @@ var require_util2 = __commonJS({ function normalizeBinaryStringToUtf8(value) { return Buffer.from(value, "binary").toString("utf8"); } - function requestCurrentURL(request3) { - return request3.urlList[request3.urlList.length - 1]; + function requestCurrentURL(request2) { + return request2.urlList[request2.urlList.length - 1]; } - function requestBadPort(request3) { - const url2 = requestCurrentURL(request3); + function requestBadPort(request2) { + const url2 = requestCurrentURL(request2); if (urlIsHttpHttpsScheme(url2) && badPortsSet.has(url2.port)) { return "blocked"; } @@ -4093,7 +4093,7 @@ var require_util2 = __commonJS({ 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(request3, actualResponse) { + function setRequestReferrerPolicyOnRedirect(request2, actualResponse) { const { headersList } = actualResponse; const policyHeader = (headersList.get("referrer-policy", true) ?? "").split(","); let policy = ""; @@ -4107,7 +4107,7 @@ var require_util2 = __commonJS({ } } if (policy !== "") { - request3.referrerPolicy = policy; + request2.referrerPolicy = policy; } } function crossOriginResourcePolicyCheck() { @@ -4124,33 +4124,33 @@ var require_util2 = __commonJS({ header = httpRequest2.mode; httpRequest2.headersList.set("sec-fetch-mode", header, true); } - function appendRequestOriginHeader(request3) { - let serializedOrigin = request3.origin; + function appendRequestOriginHeader(request2) { + let serializedOrigin = request2.origin; if (serializedOrigin === "client" || serializedOrigin === void 0) { return; } - if (request3.responseTainting === "cors" || request3.mode === "websocket") { - request3.headersList.append("origin", serializedOrigin, true); - } else if (request3.method !== "GET" && request3.method !== "HEAD") { - switch (request3.referrerPolicy) { + if (request2.responseTainting === "cors" || request2.mode === "websocket") { + request2.headersList.append("origin", serializedOrigin, true); + } else if (request2.method !== "GET" && request2.method !== "HEAD") { + switch (request2.referrerPolicy) { case "no-referrer": serializedOrigin = null; break; case "no-referrer-when-downgrade": case "strict-origin": case "strict-origin-when-cross-origin": - if (request3.origin && urlHasHttpsScheme(request3.origin) && !urlHasHttpsScheme(requestCurrentURL(request3))) { + if (request2.origin && urlHasHttpsScheme(request2.origin) && !urlHasHttpsScheme(requestCurrentURL(request2))) { serializedOrigin = null; } break; case "same-origin": - if (!sameOrigin(request3, requestCurrentURL(request3))) { + if (!sameOrigin(request2, requestCurrentURL(request2))) { serializedOrigin = null; } break; default: } - request3.headersList.append("origin", serializedOrigin, true); + request2.headersList.append("origin", serializedOrigin, true); } } function coarsenTime(timestamp, crossOriginIsolatedCapability) { @@ -4204,26 +4204,26 @@ var require_util2 = __commonJS({ referrerPolicy: policyContainer.referrerPolicy }; } - function determineRequestsReferrer(request3) { - const policy = request3.referrerPolicy; + function determineRequestsReferrer(request2) { + const policy = request2.referrerPolicy; assert2(policy); let referrerSource = null; - if (request3.referrer === "client") { + if (request2.referrer === "client") { const globalOrigin = getGlobalOrigin(); if (!globalOrigin || globalOrigin.origin === "null") { return "no-referrer"; } referrerSource = new URL(globalOrigin); - } else if (request3.referrer instanceof URL) { - referrerSource = request3.referrer; + } else if (request2.referrer instanceof URL) { + referrerSource = request2.referrer; } let referrerURL = stripURLForReferrer(referrerSource); const referrerOrigin = stripURLForReferrer(referrerSource, true); if (referrerURL.toString().length > 4096) { referrerURL = referrerOrigin; } - const areSameOrigin = sameOrigin(request3, referrerURL); - const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(request3.url); + const areSameOrigin = sameOrigin(request2, referrerURL); + const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(request2.url); switch (policy) { case "origin": return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true); @@ -4234,7 +4234,7 @@ var require_util2 = __commonJS({ case "origin-when-cross-origin": return areSameOrigin ? referrerURL : referrerOrigin; case "strict-origin-when-cross-origin": { - const currentURL = requestCurrentURL(request3); + const currentURL = requestCurrentURL(request2); if (sameOrigin(referrerURL, currentURL)) { return referrerURL; } @@ -4301,7 +4301,7 @@ var require_util2 = __commonJS({ } } function bytesMatch(bytes, metadataList) { - if (crypto6 === void 0) { + if (crypto5 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -4316,7 +4316,7 @@ var require_util2 = __commonJS({ for (const item of metadata2) { const algorithm = item.algo; const expectedValue = item.hash; - let actualValue = crypto6.createHash(algorithm).update(bytes).digest("base64"); + let actualValue = crypto5.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); @@ -4395,13 +4395,13 @@ var require_util2 = __commonJS({ } return true; } - function tryUpgradeRequestToAPotentiallyTrustworthyURL(request3) { + function tryUpgradeRequestToAPotentiallyTrustworthyURL(request2) { } - function sameOrigin(A3, B3) { - if (A3.origin === B3.origin && A3.origin === "null") { + function sameOrigin(A2, B2) { + if (A2.origin === B2.origin && A2.origin === "null") { return true; } - if (A3.protocol === B3.protocol && A3.hostname === B3.hostname && A3.port === B3.port) { + if (A2.protocol === B2.protocol && A2.hostname === B2.hostname && A2.port === B2.port) { return true; } return false; @@ -4409,8 +4409,8 @@ var require_util2 = __commonJS({ function createDeferredPromise() { let res; let rej; - const promise = new Promise((resolve4, reject2) => { - res = resolve4; + const promise = new Promise((resolve8, reject2) => { + res = resolve8; rej = reject2; }); return { promise, resolve: res, reject: rej }; @@ -4902,13 +4902,13 @@ var require_file = __commonJS({ var { webidl } = require_webidl(); var FileLike = class _FileLike { constructor(blobLike, fileName, options = {}) { - const n12 = fileName; - const t6 = options.type; + const n8 = fileName; + const t = options.type; const d6 = options.lastModified ?? Date.now(); this[kState] = { blobLike, - name: n12, - type: t6, + name: n8, + type: t, lastModified: d6 }; } @@ -5119,9 +5119,9 @@ var require_formdata_parser = __commonJS({ var filenameBuffer = Buffer.from("; filename"); var dd = Buffer.from("--"); var ddcrlf = Buffer.from("--\r\n"); - function isAsciiString(chars) { - for (let i6 = 0; i6 < chars.length; ++i6) { - if ((chars.charCodeAt(i6) & ~127) !== 0) { + function isAsciiString(chars2) { + for (let i6 = 0; i6 < chars2.length; ++i6) { + if ((chars2.charCodeAt(i6) & ~127) !== 0) { return false; } } @@ -5380,8 +5380,8 @@ var require_body = __commonJS({ var { multipartFormDataParser } = require_formdata_parser(); var random; try { - const crypto6 = __require("crypto"); - random = (max) => crypto6.randomInt(0, max); + const crypto5 = __require("crypto"); + random = (max) => crypto5.randomInt(0, max); } catch { random = (max) => Math.floor(Math.random(max)); } @@ -5690,7 +5690,7 @@ var require_client_h1 = __commonJS({ } = require_errors(); var { kUrl, - kReset, + kReset: kReset2, kClient, kParser, kBlocking, @@ -5738,39 +5738,39 @@ var require_client_h1 = __commonJS({ return await WebAssembly.instantiate(mod, { env: { /* eslint-disable camelcase */ - wasm_on_url: (p6, at2, len) => { + wasm_on_url: (p2, at2, len) => { return 0; }, - wasm_on_status: (p6, at2, len) => { - assert2(currentParser.ptr === p6); + wasm_on_status: (p2, at2, len) => { + assert2(currentParser.ptr === p2); const start = at2 - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, - wasm_on_message_begin: (p6) => { - assert2(currentParser.ptr === p6); + wasm_on_message_begin: (p2) => { + assert2(currentParser.ptr === p2); return currentParser.onMessageBegin() || 0; }, - wasm_on_header_field: (p6, at2, len) => { - assert2(currentParser.ptr === p6); + wasm_on_header_field: (p2, at2, len) => { + assert2(currentParser.ptr === p2); const start = at2 - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, - wasm_on_header_value: (p6, at2, len) => { - assert2(currentParser.ptr === p6); + wasm_on_header_value: (p2, at2, len) => { + assert2(currentParser.ptr === p2); const start = at2 - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, - wasm_on_headers_complete: (p6, statusCode, upgrade, shouldKeepAlive) => { - assert2(currentParser.ptr === p6); + wasm_on_headers_complete: (p2, statusCode, upgrade, shouldKeepAlive) => { + assert2(currentParser.ptr === p2); return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0; }, - wasm_on_body: (p6, at2, len) => { - assert2(currentParser.ptr === p6); + wasm_on_body: (p2, at2, len) => { + assert2(currentParser.ptr === p2); const start = at2 - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, - wasm_on_message_complete: (p6) => { - assert2(currentParser.ptr === p6); + wasm_on_message_complete: (p2) => { + assert2(currentParser.ptr === p2); return currentParser.onMessageComplete() || 0; } /* eslint-enable camelcase */ @@ -5789,7 +5789,7 @@ var require_client_h1 = __commonJS({ 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 { + var Parser2 = class { constructor(client2, socket, { exports: exports3 }) { assert2(Number.isFinite(client2[kMaxHeadersSize]) && client2[kMaxHeadersSize] > 0); this.llhttp = exports3; @@ -5925,11 +5925,11 @@ var require_client_h1 = __commonJS({ if (socket.destroyed) { return -1; } - const request3 = client2[kQueue][client2[kRunningIdx]]; - if (!request3) { + const request2 = client2[kQueue][client2[kRunningIdx]]; + if (!request2) { return -1; } - request3.onResponseStarted(); + request2.onResponseStarted(); } onHeaderField(buf) { const len = this.headers.length; @@ -5974,9 +5974,9 @@ var require_client_h1 = __commonJS({ assert2(!socket.destroyed); assert2(!this.paused); assert2((headers.length & 1) === 0); - const request3 = client2[kQueue][client2[kRunningIdx]]; - assert2(request3); - assert2(request3.upgrade || request3.method === "CONNECT"); + const request2 = client2[kQueue][client2[kRunningIdx]]; + assert2(request2); + assert2(request2.upgrade || request2.method === "CONNECT"); this.statusCode = null; this.statusText = ""; this.shouldKeepAlive = null; @@ -5993,7 +5993,7 @@ var require_client_h1 = __commonJS({ client2[kQueue][client2[kRunningIdx]++] = null; client2.emit("disconnect", client2[kUrl], [client2], new InformationalError("upgrade")); try { - request3.onUpgrade(statusCode, headers, socket); + request2.onUpgrade(statusCode, headers, socket); } catch (err) { util3.destroy(socket, err); } @@ -6004,8 +6004,8 @@ var require_client_h1 = __commonJS({ if (socket.destroyed) { return -1; } - const request3 = client2[kQueue][client2[kRunningIdx]]; - if (!request3) { + const request2 = client2[kQueue][client2[kRunningIdx]]; + if (!request2) { return -1; } assert2(!this.upgrade); @@ -6014,23 +6014,23 @@ var require_client_h1 = __commonJS({ util3.destroy(socket, new SocketError("bad response", util3.getSocketInfo(socket))); return -1; } - if (upgrade && !request3.upgrade) { + if (upgrade && !request2.upgrade) { util3.destroy(socket, new SocketError("bad upgrade", util3.getSocketInfo(socket))); return -1; } assert2(this.timeoutType === TIMEOUT_HEADERS); this.statusCode = statusCode; this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD. - request3.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive"; + request2.method === "HEAD" && !socket[kReset2] && this.connection.toLowerCase() === "keep-alive"; if (this.statusCode >= 200) { - const bodyTimeout = request3.bodyTimeout != null ? request3.bodyTimeout : client2[kBodyTimeout]; + const bodyTimeout = request2.bodyTimeout != null ? request2.bodyTimeout : client2[kBodyTimeout]; this.setTimeout(bodyTimeout, TIMEOUT_BODY); } else if (this.timeout) { if (this.timeout.refresh) { this.timeout.refresh(); } } - if (request3.method === "CONNECT") { + if (request2.method === "CONNECT") { assert2(client2[kRunning] === 1); this.upgrade = true; return 2; @@ -6051,7 +6051,7 @@ var require_client_h1 = __commonJS({ client2[kKeepAliveMaxTimeout] ); if (timeout2 <= 0) { - socket[kReset] = true; + socket[kReset2] = true; } else { client2[kKeepAliveTimeoutValue] = timeout2; } @@ -6059,13 +6059,13 @@ var require_client_h1 = __commonJS({ client2[kKeepAliveTimeoutValue] = client2[kKeepAliveDefaultTimeout]; } } else { - socket[kReset] = true; + socket[kReset2] = true; } - const pause = request3.onHeaders(statusCode, headers, this.resume, statusText) === false; - if (request3.aborted) { + const pause = request2.onHeaders(statusCode, headers, this.resume, statusText) === false; + if (request2.aborted) { return -1; } - if (request3.method === "HEAD") { + if (request2.method === "HEAD") { return 1; } if (statusCode < 200) { @@ -6082,8 +6082,8 @@ var require_client_h1 = __commonJS({ if (socket.destroyed) { return -1; } - const request3 = client2[kQueue][client2[kRunningIdx]]; - assert2(request3); + const request2 = client2[kQueue][client2[kRunningIdx]]; + assert2(request2); assert2(this.timeoutType === TIMEOUT_BODY); if (this.timeout) { if (this.timeout.refresh) { @@ -6096,7 +6096,7 @@ var require_client_h1 = __commonJS({ return -1; } this.bytesRead += buf.length; - if (request3.onData(buf) === false) { + if (request2.onData(buf) === false) { return constants4.ERROR.PAUSED; } } @@ -6110,8 +6110,8 @@ var require_client_h1 = __commonJS({ } assert2(statusCode >= 100); assert2((this.headers.length & 1) === 0); - const request3 = client2[kQueue][client2[kRunningIdx]]; - assert2(request3); + const request2 = client2[kQueue][client2[kRunningIdx]]; + assert2(request2); this.statusCode = null; this.statusText = ""; this.bytesRead = 0; @@ -6123,11 +6123,11 @@ var require_client_h1 = __commonJS({ if (statusCode < 200) { return; } - if (request3.method !== "HEAD" && contentLength2 && bytesRead !== parseInt(contentLength2, 10)) { + if (request2.method !== "HEAD" && contentLength2 && bytesRead !== parseInt(contentLength2, 10)) { util3.destroy(socket, new ResponseContentLengthMismatchError()); return -1; } - request3.onComplete(headers); + request2.onComplete(headers); client2[kQueue][client2[kRunningIdx]++] = null; if (socket[kWriting]) { assert2(client2[kRunning] === 0); @@ -6136,7 +6136,7 @@ var require_client_h1 = __commonJS({ } else if (!shouldKeepAlive) { util3.destroy(socket, new InformationalError("reset")); return constants4.ERROR.PAUSED; - } else if (socket[kReset] && client2[kRunning] === 0) { + } else if (socket[kReset2] && client2[kRunning] === 0) { util3.destroy(socket, new InformationalError("reset")); return constants4.ERROR.PAUSED; } else if (client2[kPipelining] == null || client2[kPipelining] === 1) { @@ -6146,8 +6146,8 @@ var require_client_h1 = __commonJS({ } } }; - function onParserTimeout(parser2) { - const { socket, timeoutType, client: client2, paused } = parser2.deref(); + function onParserTimeout(parser3) { + const { socket, timeoutType, client: client2, paused } = parser3.deref(); if (timeoutType === TIMEOUT_HEADERS) { if (!socket[kWriting] || socket.writableNeedDrain || client2[kRunning] > 1) { assert2(!paused, "cannot be paused while waiting for headers"); @@ -6170,39 +6170,39 @@ var require_client_h1 = __commonJS({ } socket[kNoRef] = false; socket[kWriting] = false; - socket[kReset] = false; + socket[kReset2] = false; socket[kBlocking] = false; - socket[kParser] = new Parser(client2, socket, llhttpInstance); + socket[kParser] = new Parser2(client2, socket, llhttpInstance); addListener(socket, "error", function(err) { assert2(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); - const parser2 = this[kParser]; - if (err.code === "ECONNRESET" && parser2.statusCode && !parser2.shouldKeepAlive) { - parser2.onMessageComplete(); + const parser3 = this[kParser]; + if (err.code === "ECONNRESET" && parser3.statusCode && !parser3.shouldKeepAlive) { + parser3.onMessageComplete(); return; } this[kError] = err; this[kClient][kOnError](err); }); addListener(socket, "readable", function() { - const parser2 = this[kParser]; - if (parser2) { - parser2.readMore(); + const parser3 = this[kParser]; + if (parser3) { + parser3.readMore(); } }); addListener(socket, "end", function() { - const parser2 = this[kParser]; - if (parser2.statusCode && !parser2.shouldKeepAlive) { - parser2.onMessageComplete(); + const parser3 = this[kParser]; + if (parser3.statusCode && !parser3.shouldKeepAlive) { + parser3.onMessageComplete(); return; } util3.destroy(this, new SocketError("other side closed", util3.getSocketInfo(this))); }); addListener(socket, "close", function() { const client3 = this[kClient]; - const parser2 = this[kParser]; - if (parser2) { - if (!this[kError] && parser2.statusCode && !parser2.shouldKeepAlive) { - parser2.onMessageComplete(); + const parser3 = this[kParser]; + if (parser3) { + if (!this[kError] && parser3.statusCode && !parser3.shouldKeepAlive) { + parser3.onMessageComplete(); } this[kParser].destroy(); this[kParser] = null; @@ -6214,13 +6214,13 @@ var require_client_h1 = __commonJS({ assert2(client3[kPending] === 0); const requests = client3[kQueue].splice(client3[kRunningIdx]); for (let i6 = 0; i6 < requests.length; i6++) { - const request3 = requests[i6]; - util3.errorRequest(client3, request3, err); + const request2 = requests[i6]; + util3.errorRequest(client3, request2, err); } } else if (client3[kRunning] > 0 && err.code !== "UND_ERR_INFO") { - const request3 = client3[kQueue][client3[kRunningIdx]]; + const request2 = client3[kQueue][client3[kRunningIdx]]; client3[kQueue][client3[kRunningIdx]++] = null; - util3.errorRequest(client3, request3, err); + util3.errorRequest(client3, request2, err); } client3[kPendingIdx] = client3[kRunningIdx]; assert2(client3[kRunning] === 0); @@ -6250,18 +6250,18 @@ var require_client_h1 = __commonJS({ get destroyed() { return socket.destroyed; }, - busy(request3) { - if (socket[kWriting] || socket[kReset] || socket[kBlocking]) { + busy(request2) { + if (socket[kWriting] || socket[kReset2] || socket[kBlocking]) { return true; } - if (request3) { - if (client2[kRunning] > 0 && !request3.idempotent) { + if (request2) { + if (client2[kRunning] > 0 && !request2.idempotent) { return true; } - if (client2[kRunning] > 0 && (request3.upgrade || request3.method === "CONNECT")) { + if (client2[kRunning] > 0 && (request2.upgrade || request2.method === "CONNECT")) { return true; } - if (client2[kRunning] > 0 && util3.bodyLength(request3.body) !== 0 && (util3.isStream(request3.body) || util3.isAsyncIterable(request3.body) || util3.isFormDataLike(request3.body))) { + if (client2[kRunning] > 0 && util3.bodyLength(request2.body) !== 0 && (util3.isStream(request2.body) || util3.isAsyncIterable(request2.body) || util3.isFormDataLike(request2.body))) { return true; } } @@ -6287,8 +6287,8 @@ var require_client_h1 = __commonJS({ } } else if (client2[kRunning] > 0 && socket[kParser].statusCode < 200) { if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { - const request3 = client2[kQueue][client2[kRunningIdx]]; - const headersTimeout = request3.headersTimeout != null ? request3.headersTimeout : client2[kHeadersTimeout]; + const request2 = client2[kQueue][client2[kRunningIdx]]; + const headersTimeout = request2.headersTimeout != null ? request2.headersTimeout : client2[kHeadersTimeout]; socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS); } } @@ -6297,21 +6297,21 @@ var require_client_h1 = __commonJS({ function shouldSendContentLength(method) { return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } - function writeH1(client2, request3) { - const { method, path: path10, host, upgrade, blocking, reset } = request3; - let { body: body2, headers, contentLength: contentLength2 } = request3; + function writeH1(client2, request2) { + const { method, path: path10, host, upgrade, blocking, reset } = request2; + let { body: body2, headers, contentLength: contentLength2 } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util3.isFormDataLike(body2)) { if (!extractBody) { extractBody = require_body().extractBody; } const [bodyStream, contentType2] = extractBody(body2); - if (request3.contentType == null) { + if (request2.contentType == null) { headers.push("content-type", contentType2); } body2 = bodyStream.stream; contentLength2 = bodyStream.length; - } else if (util3.isBlobLike(body2) && request3.contentType == null && body2.type) { + } else if (util3.isBlobLike(body2) && request2.contentType == null && body2.type) { headers.push("content-type", body2.type); } if (body2 && typeof body2.read === "function") { @@ -6320,46 +6320,46 @@ var require_client_h1 = __commonJS({ const bodyLength = util3.bodyLength(body2); contentLength2 = bodyLength ?? contentLength2; if (contentLength2 === null) { - contentLength2 = request3.contentLength; + contentLength2 = request2.contentLength; } if (contentLength2 === 0 && !expectsPayload) { contentLength2 = null; } - if (shouldSendContentLength(method) && contentLength2 > 0 && request3.contentLength !== null && request3.contentLength !== contentLength2) { + if (shouldSendContentLength(method) && contentLength2 > 0 && request2.contentLength !== null && request2.contentLength !== contentLength2) { if (client2[kStrictContentLength]) { - util3.errorRequest(client2, request3, new RequestContentLengthMismatchError()); + util3.errorRequest(client2, request2, new RequestContentLengthMismatchError()); return false; } process.emitWarning(new RequestContentLengthMismatchError()); } const socket = client2[kSocket]; const abort = (err) => { - if (request3.aborted || request3.completed) { + if (request2.aborted || request2.completed) { return; } - util3.errorRequest(client2, request3, err || new RequestAbortedError()); + util3.errorRequest(client2, request2, err || new RequestAbortedError()); util3.destroy(body2); util3.destroy(socket, new InformationalError("aborted")); }; try { - request3.onConnect(abort); + request2.onConnect(abort); } catch (err) { - util3.errorRequest(client2, request3, err); + util3.errorRequest(client2, request2, err); } - if (request3.aborted) { + if (request2.aborted) { return false; } if (method === "HEAD") { - socket[kReset] = true; + socket[kReset2] = true; } if (upgrade || method === "CONNECT") { - socket[kReset] = true; + socket[kReset2] = true; } if (reset != null) { - socket[kReset] = reset; + socket[kReset2] = reset; } if (client2[kMaxRequests] && socket[kCounter]++ >= client2[kMaxRequests]) { - socket[kReset] = true; + socket[kReset2] = true; } if (blocking) { socket[kBlocking] = true; @@ -6376,15 +6376,15 @@ var require_client_h1 = __commonJS({ header += `connection: upgrade\r upgrade: ${upgrade}\r `; - } else if (client2[kPipelining] && !socket[kReset]) { + } else if (client2[kPipelining] && !socket[kReset2]) { header += "connection: keep-alive\r\n"; } else { header += "connection: close\r\n"; } if (Array.isArray(headers)) { - for (let n12 = 0; n12 < headers.length; n12 += 2) { - const key = headers[n12 + 0]; - const val = headers[n12 + 1]; + for (let n8 = 0; n8 < headers.length; n8 += 2) { + const key = headers[n8 + 0]; + const val = headers[n8 + 1]; if (Array.isArray(val)) { for (let i6 = 0; i6 < val.length; i6++) { header += `${key}: ${val[i6]}\r @@ -6397,31 +6397,31 @@ upgrade: ${upgrade}\r } } if (channels.sendHeaders.hasSubscribers) { - channels.sendHeaders.publish({ request: request3, headers: header, socket }); + channels.sendHeaders.publish({ request: request2, headers: header, socket }); } if (!body2 || bodyLength === 0) { - writeBuffer(abort, null, client2, request3, socket, contentLength2, header, expectsPayload); + writeBuffer(abort, null, client2, request2, socket, contentLength2, header, expectsPayload); } else if (util3.isBuffer(body2)) { - writeBuffer(abort, body2, client2, request3, socket, contentLength2, header, expectsPayload); + writeBuffer(abort, body2, client2, request2, socket, contentLength2, header, expectsPayload); } else if (util3.isBlobLike(body2)) { if (typeof body2.stream === "function") { - writeIterable(abort, body2.stream(), client2, request3, socket, contentLength2, header, expectsPayload); + writeIterable(abort, body2.stream(), client2, request2, socket, contentLength2, header, expectsPayload); } else { - writeBlob(abort, body2, client2, request3, socket, contentLength2, header, expectsPayload); + writeBlob(abort, body2, client2, request2, socket, contentLength2, header, expectsPayload); } } else if (util3.isStream(body2)) { - writeStream(abort, body2, client2, request3, socket, contentLength2, header, expectsPayload); + writeStream(abort, body2, client2, request2, socket, contentLength2, header, expectsPayload); } else if (util3.isIterable(body2)) { - writeIterable(abort, body2, client2, request3, socket, contentLength2, header, expectsPayload); + writeIterable(abort, body2, client2, request2, socket, contentLength2, header, expectsPayload); } else { assert2(false); } return true; } - function writeStream(abort, body2, client2, request3, socket, contentLength2, header, expectsPayload) { + function writeStream(abort, body2, client2, request2, socket, contentLength2, header, expectsPayload) { assert2(contentLength2 !== 0 || client2[kRunning] === 0, "stream body cannot be pipelined"); let finished = false; - const writer = new AsyncWriter({ abort, socket, request: request3, contentLength: contentLength2, client: client2, expectsPayload, header }); + const writer = new AsyncWriter({ abort, socket, request: request2, contentLength: contentLength2, client: client2, expectsPayload, header }); const onData = function(chunk) { if (finished) { return; @@ -6487,7 +6487,7 @@ upgrade: ${upgrade}\r setImmediate(onClose); } } - function writeBuffer(abort, body2, client2, request3, socket, contentLength2, header, expectsPayload) { + function writeBuffer(abort, body2, client2, request2, socket, contentLength2, header, expectsPayload) { try { if (!body2) { if (contentLength2 === 0) { @@ -6507,18 +6507,18 @@ upgrade: ${upgrade}\r `, "latin1"); socket.write(body2); socket.uncork(); - request3.onBodySent(body2); - if (!expectsPayload && request3.reset !== false) { - socket[kReset] = true; + request2.onBodySent(body2); + if (!expectsPayload && request2.reset !== false) { + socket[kReset2] = true; } } - request3.onRequestSent(); + request2.onRequestSent(); client2[kResume](); } catch (err) { abort(err); } } - async function writeBlob(abort, body2, client2, request3, socket, contentLength2, header, expectsPayload) { + async function writeBlob(abort, body2, client2, request2, socket, contentLength2, header, expectsPayload) { assert2(contentLength2 === body2.size, "blob body must have content length"); try { if (contentLength2 != null && contentLength2 !== body2.size) { @@ -6531,17 +6531,17 @@ upgrade: ${upgrade}\r `, "latin1"); socket.write(buffer2); socket.uncork(); - request3.onBodySent(buffer2); - request3.onRequestSent(); - if (!expectsPayload && request3.reset !== false) { - socket[kReset] = true; + request2.onBodySent(buffer2); + request2.onRequestSent(); + if (!expectsPayload && request2.reset !== false) { + socket[kReset2] = true; } client2[kResume](); } catch (err) { abort(err); } } - async function writeIterable(abort, body2, client2, request3, socket, contentLength2, header, expectsPayload) { + async function writeIterable(abort, body2, client2, request2, socket, contentLength2, header, expectsPayload) { assert2(contentLength2 !== 0 || client2[kRunning] === 0, "iterator body cannot be pipelined"); let callback = null; function onDrain() { @@ -6551,16 +6551,16 @@ upgrade: ${upgrade}\r cb(); } } - const waitForDrain = () => new Promise((resolve4, reject2) => { + const waitForDrain = () => new Promise((resolve8, reject2) => { assert2(callback === null); if (socket[kError]) { reject2(socket[kError]); } else { - callback = resolve4; + callback = resolve8; } }); socket.on("close", onDrain).on("drain", onDrain); - const writer = new AsyncWriter({ abort, socket, request: request3, contentLength: contentLength2, client: client2, expectsPayload, header }); + const writer = new AsyncWriter({ abort, socket, request: request2, contentLength: contentLength2, client: client2, expectsPayload, header }); try { for await (const chunk of body2) { if (socket[kError]) { @@ -6578,9 +6578,9 @@ upgrade: ${upgrade}\r } } var AsyncWriter = class { - constructor({ abort, socket, request: request3, contentLength: contentLength2, client: client2, expectsPayload, header }) { + constructor({ abort, socket, request: request2, contentLength: contentLength2, client: client2, expectsPayload, header }) { this.socket = socket; - this.request = request3; + this.request = request2; this.contentLength = contentLength2; this.client = client2; this.bytesWritten = 0; @@ -6590,7 +6590,7 @@ upgrade: ${upgrade}\r socket[kWriting] = true; } write(chunk) { - const { socket, request: request3, contentLength: contentLength2, client: client2, bytesWritten, expectsPayload, header } = this; + const { socket, request: request2, contentLength: contentLength2, client: client2, bytesWritten, expectsPayload, header } = this; if (socket[kError]) { throw socket[kError]; } @@ -6609,8 +6609,8 @@ upgrade: ${upgrade}\r } socket.cork(); if (bytesWritten === 0) { - if (!expectsPayload && request3.reset !== false) { - socket[kReset] = true; + if (!expectsPayload && request2.reset !== false) { + socket[kReset2] = true; } if (contentLength2 === null) { socket.write(`${header}transfer-encoding: chunked\r @@ -6629,7 +6629,7 @@ ${len.toString(16)}\r this.bytesWritten += len; const ret = socket.write(chunk); socket.uncork(); - request3.onBodySent(chunk); + request2.onBodySent(chunk); if (!ret) { if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { if (socket[kParser].timeout.refresh) { @@ -6640,8 +6640,8 @@ ${len.toString(16)}\r return ret; } end() { - const { socket, contentLength: contentLength2, client: client2, bytesWritten, expectsPayload, header, request: request3 } = this; - request3.onRequestSent(); + const { socket, contentLength: contentLength2, client: client2, bytesWritten, expectsPayload, header, request: request2 } = this; + request2.onRequestSent(); socket[kWriting] = false; if (socket[kError]) { throw socket[kError]; @@ -6703,7 +6703,7 @@ var require_client_h2 = __commonJS({ } = require_errors(); var { kUrl, - kReset, + kReset: kReset2, kClient, kRunning, kPending, @@ -6781,8 +6781,8 @@ var require_client_h2 = __commonJS({ assert2(client3[kPending] === 0); const requests = client3[kQueue].splice(client3[kRunningIdx]); for (let i6 = 0; i6 < requests.length; i6++) { - const request3 = requests[i6]; - util3.errorRequest(client3, request3, err); + const request2 = requests[i6]; + util3.errorRequest(client3, request2, err); } } }); @@ -6876,9 +6876,9 @@ var require_client_h2 = __commonJS({ } util3.destroy(this[kSocket], err); if (client2[kRunningIdx] < client2[kQueue].length) { - const request3 = client2[kQueue][client2[kRunningIdx]]; + const request2 = client2[kQueue][client2[kRunningIdx]]; client2[kQueue][client2[kRunningIdx]++] = null; - util3.errorRequest(client2, request3, err); + util3.errorRequest(client2, request2, err); client2[kPendingIdx] = client2[kRunningIdx]; } assert2(client2[kRunning] === 0); @@ -6888,18 +6888,18 @@ var require_client_h2 = __commonJS({ function shouldSendContentLength(method) { return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } - function writeH2(client2, request3) { + function writeH2(client2, request2) { const session = client2[kHTTP2Session]; - const { method, path: path10, host, upgrade, expectContinue, signal, headers: reqHeaders } = request3; - let { body: body2 } = request3; + const { method, path: path10, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + let { body: body2 } = request2; if (upgrade) { - util3.errorRequest(client2, request3, new Error("Upgrade not supported for H2")); + util3.errorRequest(client2, request2, new Error("Upgrade not supported for H2")); return false; } const headers = {}; - for (let n12 = 0; n12 < reqHeaders.length; n12 += 2) { - const key = reqHeaders[n12 + 0]; - const val = reqHeaders[n12 + 1]; + for (let n8 = 0; n8 < reqHeaders.length; n8 += 2) { + const key = reqHeaders[n8 + 0]; + const val = reqHeaders[n8 + 1]; if (Array.isArray(val)) { for (let i6 = 0; i6 < val.length; i6++) { if (headers[key]) { @@ -6917,11 +6917,11 @@ var require_client_h2 = __commonJS({ headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ""}`; headers[HTTP2_HEADER_METHOD] = method; const abort = (err) => { - if (request3.aborted || request3.completed) { + if (request2.aborted || request2.completed) { return; } err = err || new RequestAbortedError(); - util3.errorRequest(client2, request3, err); + util3.errorRequest(client2, request2, err); if (stream5 != null) { util3.destroy(stream5, err); } @@ -6930,23 +6930,23 @@ var require_client_h2 = __commonJS({ client2[kResume](); }; try { - request3.onConnect(abort); + request2.onConnect(abort); } catch (err) { - util3.errorRequest(client2, request3, err); + util3.errorRequest(client2, request2, err); } - if (request3.aborted) { + if (request2.aborted) { return false; } if (method === "CONNECT") { session.ref(); stream5 = session.request(headers, { endStream: false, signal }); if (stream5.id && !stream5.pending) { - request3.onUpgrade(null, null, stream5); + request2.onUpgrade(null, null, stream5); ++session[kOpenStreams]; client2[kQueue][client2[kRunningIdx]++] = null; } else { stream5.once("ready", () => { - request3.onUpgrade(null, null, stream5); + request2.onUpgrade(null, null, stream5); ++session[kOpenStreams]; client2[kQueue][client2[kRunningIdx]++] = null; }); @@ -6972,14 +6972,14 @@ var require_client_h2 = __commonJS({ contentLength2 = bodyStream.length; } if (contentLength2 == null) { - contentLength2 = request3.contentLength; + contentLength2 = request2.contentLength; } if (contentLength2 === 0 || !expectsPayload) { contentLength2 = null; } - if (shouldSendContentLength(method) && contentLength2 > 0 && request3.contentLength != null && request3.contentLength !== contentLength2) { + if (shouldSendContentLength(method) && contentLength2 > 0 && request2.contentLength != null && request2.contentLength !== contentLength2) { if (client2[kStrictContentLength]) { - util3.errorRequest(client2, request3, new RequestContentLengthMismatchError()); + util3.errorRequest(client2, request2, new RequestContentLengthMismatchError()); return false; } process.emitWarning(new RequestContentLengthMismatchError()); @@ -7004,25 +7004,25 @@ var require_client_h2 = __commonJS({ ++session[kOpenStreams]; stream5.once("response", (headers2) => { const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers2; - request3.onResponseStarted(); - if (request3.aborted) { + request2.onResponseStarted(); + if (request2.aborted) { const err = new RequestAbortedError(); - util3.errorRequest(client2, request3, err); + util3.errorRequest(client2, request2, err); util3.destroy(stream5, err); return; } - if (request3.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream5.resume.bind(stream5), "") === false) { + if (request2.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream5.resume.bind(stream5), "") === false) { stream5.pause(); } stream5.on("data", (chunk) => { - if (request3.onData(chunk) === false) { + if (request2.onData(chunk) === false) { stream5.pause(); } }); }); stream5.once("end", () => { if (stream5.state?.state == null || stream5.state.state < 6) { - request3.onComplete([]); + request2.onComplete([]); } if (session[kOpenStreams] === 0) { session.unref(); @@ -7052,7 +7052,7 @@ var require_client_h2 = __commonJS({ stream5, null, client2, - request3, + request2, client2[kSocket], contentLength2, expectsPayload @@ -7063,7 +7063,7 @@ var require_client_h2 = __commonJS({ stream5, body2, client2, - request3, + request2, client2[kSocket], contentLength2, expectsPayload @@ -7075,7 +7075,7 @@ var require_client_h2 = __commonJS({ stream5, body2.stream(), client2, - request3, + request2, client2[kSocket], contentLength2, expectsPayload @@ -7086,7 +7086,7 @@ var require_client_h2 = __commonJS({ stream5, body2, client2, - request3, + request2, client2[kSocket], contentLength2, expectsPayload @@ -7100,7 +7100,7 @@ var require_client_h2 = __commonJS({ stream5, body2, client2, - request3, + request2, contentLength2 ); } else if (util3.isIterable(body2)) { @@ -7109,7 +7109,7 @@ var require_client_h2 = __commonJS({ stream5, body2, client2, - request3, + request2, client2[kSocket], contentLength2, expectsPayload @@ -7119,7 +7119,7 @@ var require_client_h2 = __commonJS({ } } } - function writeBuffer(abort, h2stream, body2, client2, request3, socket, contentLength2, expectsPayload) { + function writeBuffer(abort, h2stream, body2, client2, request2, socket, contentLength2, expectsPayload) { try { if (body2 != null && util3.isBuffer(body2)) { assert2(contentLength2 === body2.byteLength, "buffer body must have content length"); @@ -7127,18 +7127,18 @@ var require_client_h2 = __commonJS({ h2stream.write(body2); h2stream.uncork(); h2stream.end(); - request3.onBodySent(body2); + request2.onBodySent(body2); } if (!expectsPayload) { - socket[kReset] = true; + socket[kReset2] = true; } - request3.onRequestSent(); + request2.onRequestSent(); client2[kResume](); } catch (error2) { abort(error2); } } - function writeStream(abort, socket, expectsPayload, h2stream, body2, client2, request3, contentLength2) { + function writeStream(abort, socket, expectsPayload, h2stream, body2, client2, request2, contentLength2) { assert2(contentLength2 !== 0 || client2[kRunning] === 0, "stream body cannot be pipelined"); const pipe = pipeline2( body2, @@ -7149,9 +7149,9 @@ var require_client_h2 = __commonJS({ abort(err); } else { util3.removeAllListeners(pipe); - request3.onRequestSent(); + request2.onRequestSent(); if (!expectsPayload) { - socket[kReset] = true; + socket[kReset2] = true; } client2[kResume](); } @@ -7159,10 +7159,10 @@ var require_client_h2 = __commonJS({ ); util3.addListener(pipe, "data", onPipeData); function onPipeData(chunk) { - request3.onBodySent(chunk); + request2.onBodySent(chunk); } } - async function writeBlob(abort, h2stream, body2, client2, request3, socket, contentLength2, expectsPayload) { + async function writeBlob(abort, h2stream, body2, client2, request2, socket, contentLength2, expectsPayload) { assert2(contentLength2 === body2.size, "blob body must have content length"); try { if (contentLength2 != null && contentLength2 !== body2.size) { @@ -7173,17 +7173,17 @@ var require_client_h2 = __commonJS({ h2stream.write(buffer2); h2stream.uncork(); h2stream.end(); - request3.onBodySent(buffer2); - request3.onRequestSent(); + request2.onBodySent(buffer2); + request2.onRequestSent(); if (!expectsPayload) { - socket[kReset] = true; + socket[kReset2] = true; } client2[kResume](); } catch (err) { abort(err); } } - async function writeIterable(abort, h2stream, body2, client2, request3, socket, contentLength2, expectsPayload) { + async function writeIterable(abort, h2stream, body2, client2, request2, socket, contentLength2, expectsPayload) { assert2(contentLength2 !== 0 || client2[kRunning] === 0, "iterator body cannot be pipelined"); let callback = null; function onDrain() { @@ -7193,12 +7193,12 @@ var require_client_h2 = __commonJS({ cb(); } } - const waitForDrain = () => new Promise((resolve4, reject2) => { + const waitForDrain = () => new Promise((resolve8, reject2) => { assert2(callback === null); if (socket[kError]) { reject2(socket[kError]); } else { - callback = resolve4; + callback = resolve8; } }); h2stream.on("close", onDrain).on("drain", onDrain); @@ -7208,15 +7208,15 @@ var require_client_h2 = __commonJS({ throw socket[kError]; } const res = h2stream.write(chunk); - request3.onBodySent(chunk); + request2.onBodySent(chunk); if (!res) { await waitForDrain(); } } h2stream.end(); - request3.onRequestSent(); + request2.onRequestSent(); if (!expectsPayload) { - socket[kReset] = true; + socket[kReset2] = true; } client2[kResume](); } catch (err) { @@ -7419,7 +7419,7 @@ var require_client = __commonJS({ var http4 = __require("http"); var util3 = require_util(); var { channels } = require_diagnostics(); - var Request3 = require_request(); + var Request2 = require_request(); var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, @@ -7661,10 +7661,10 @@ var require_client = __commonJS({ } [kDispatch](opts, handler2) { const origin = opts.origin || this[kUrl].origin; - const request3 = new Request3(origin, opts, handler2); - this[kQueue].push(request3); + const request2 = new Request2(origin, opts, handler2); + this[kQueue].push(request2); if (this[kResuming]) { - } else if (util3.bodyLength(request3.body) == null && util3.isIterable(request3.body)) { + } else if (util3.bodyLength(request2.body) == null && util3.isIterable(request2.body)) { this[kResuming] = 1; queueMicrotask(() => resume(this)); } else { @@ -7676,27 +7676,27 @@ var require_client = __commonJS({ return this[kNeedDrain] < 2; } async [kClose]() { - return new Promise((resolve4) => { + return new Promise((resolve8) => { if (this[kSize]) { - this[kClosedResolve] = resolve4; + this[kClosedResolve] = resolve8; } else { - resolve4(null); + resolve8(null); } }); } async [kDestroy](err) { - return new Promise((resolve4) => { + return new Promise((resolve8) => { const requests = this[kQueue].splice(this[kPendingIdx]); for (let i6 = 0; i6 < requests.length; i6++) { - const request3 = requests[i6]; - util3.errorRequest(this, request3, err); + const request2 = requests[i6]; + util3.errorRequest(this, request2, err); } const callback = () => { if (this[kClosedResolve]) { this[kClosedResolve](); this[kClosedResolve] = null; } - resolve4(null); + resolve8(null); }; if (this[kHTTPContext]) { this[kHTTPContext].destroy(err, callback); @@ -7714,8 +7714,8 @@ var require_client = __commonJS({ assert2(client2[kPendingIdx] === client2[kRunningIdx]); const requests = client2[kQueue].splice(client2[kRunningIdx]); for (let i6 = 0; i6 < requests.length; i6++) { - const request3 = requests[i6]; - util3.errorRequest(client2, request3, err); + const request2 = requests[i6]; + util3.errorRequest(client2, request2, err); } assert2(client2[kSize] === 0); } @@ -7747,7 +7747,7 @@ var require_client = __commonJS({ }); } try { - const socket = await new Promise((resolve4, reject2) => { + const socket = await new Promise((resolve8, reject2) => { client2[kConnector]({ host, hostname, @@ -7759,7 +7759,7 @@ var require_client = __commonJS({ if (err) { reject2(err); } else { - resolve4(socket2); + resolve8(socket2); } }); }); @@ -7818,8 +7818,8 @@ var require_client = __commonJS({ if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { assert2(client2[kRunning] === 0); while (client2[kPending] > 0 && client2[kQueue][client2[kPendingIdx]].servername === client2[kServerName]) { - const request3 = client2[kQueue][client2[kPendingIdx]++]; - util3.errorRequest(client2, request3, err); + const request2 = client2[kQueue][client2[kPendingIdx]++]; + util3.errorRequest(client2, request2, err); } } else { onError(client2, err); @@ -7876,12 +7876,12 @@ var require_client = __commonJS({ if (client2[kRunning] >= (getPipelining(client2) || 1)) { return; } - const request3 = client2[kQueue][client2[kPendingIdx]]; - if (client2[kUrl].protocol === "https:" && client2[kServerName] !== request3.servername) { + const request2 = client2[kQueue][client2[kPendingIdx]]; + if (client2[kUrl].protocol === "https:" && client2[kServerName] !== request2.servername) { if (client2[kRunning] > 0) { return; } - client2[kServerName] = request3.servername; + client2[kServerName] = request2.servername; client2[kHTTPContext]?.destroy(new InformationalError("servername changed"), () => { client2[kHTTPContext] = null; resume(client2); @@ -7897,10 +7897,10 @@ var require_client = __commonJS({ if (client2[kHTTPContext].destroyed) { return; } - if (client2[kHTTPContext].busy(request3)) { + if (client2[kHTTPContext].busy(request2)) { return; } - if (!request3.aborted && client2[kHTTPContext].write(request3)) { + if (!request2.aborted && client2[kHTTPContext].write(request2)) { client2[kPendingIdx]++; } else { client2[kQueue].splice(client2[kPendingIdx], 1); @@ -8096,8 +8096,8 @@ var require_pool_base = __commonJS({ if (this[kQueue].isEmpty()) { await Promise.all(this[kClients].map((c6) => c6.close())); } else { - await new Promise((resolve4) => { - this[kClosedResolve] = resolve4; + await new Promise((resolve8) => { + this[kClosedResolve] = resolve8; }); } } @@ -8277,9 +8277,9 @@ var require_balanced_pool = __commonJS({ function getGreatestCommonDivisor(a6, b6) { if (a6 === 0) return b6; while (b6 !== 0) { - const t6 = b6; + const t = b6; b6 = a6 % b6; - a6 = t6; + a6 = t; } return a6; } @@ -8350,7 +8350,7 @@ var require_balanced_pool = __commonJS({ return this; } get upstreams() { - return this[kClients].filter((dispatcher) => dispatcher.closed !== true && dispatcher.destroyed !== true).map((p6) => p6[kUrl].origin); + return this[kClients].filter((dispatcher) => dispatcher.closed !== true && dispatcher.destroyed !== true).map((p2) => p2[kUrl].origin); } [kGetDispatcher]() { if (this[kClients].length === 0) { @@ -9185,7 +9185,7 @@ var require_readable = __commonJS({ "node_modules/undici/lib/api/readable.js"(exports2, module) { "use strict"; var assert2 = __require("assert"); - var { Readable: Readable13 } = __require("stream"); + var { Readable: Readable11 } = __require("stream"); var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError: AbortError4 } = require_errors(); var util3 = require_util(); var { ReadableStreamFrom } = require_util(); @@ -9197,7 +9197,7 @@ var require_readable = __commonJS({ var kContentLength = /* @__PURE__ */ Symbol("kContentLength"); var noop3 = () => { }; - var BodyReadable = class extends Readable13 { + var BodyReadable = class extends Readable11 { constructor({ resume, abort, @@ -9312,7 +9312,7 @@ var require_readable = __commonJS({ if (this._readableState.closeEmitted) { return null; } - return await new Promise((resolve4, reject2) => { + return await new Promise((resolve8, reject2) => { if (this[kContentLength] > limit) { this.destroy(new AbortError4()); } @@ -9325,7 +9325,7 @@ var require_readable = __commonJS({ if (signal?.aborted) { reject2(signal.reason ?? new AbortError4()); } else { - resolve4(null); + resolve8(null); } }).on("error", noop3).on("data", function(chunk) { limit -= chunk.length; @@ -9344,7 +9344,7 @@ var require_readable = __commonJS({ } async function consume(stream5, type) { assert2(!stream5[kConsume]); - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { if (isUnusable(stream5)) { const rState = stream5._readableState; if (rState.destroyed && rState.closeEmitted === false) { @@ -9361,7 +9361,7 @@ var require_readable = __commonJS({ stream5[kConsume] = { type, stream: stream5, - resolve: resolve4, + resolve: resolve8, reject: reject2, length: 0, body: [] @@ -9386,8 +9386,8 @@ var require_readable = __commonJS({ if (state4.bufferIndex) { const start = state4.bufferIndex; const end = state4.buffer.length; - for (let n12 = start; n12 < end; n12++) { - consumePush(consume2, state4.buffer[n12]); + for (let n8 = start; n8 < end; n8++) { + consumePush(consume2, state4.buffer[n8]); } } else { for (const chunk of state4.buffer) { @@ -9431,18 +9431,18 @@ var require_readable = __commonJS({ return buffer2; } function consumeEnd(consume2) { - const { type, body: body2, resolve: resolve4, stream: stream5, length } = consume2; + const { type, body: body2, resolve: resolve8, stream: stream5, length } = consume2; try { if (type === "text") { - resolve4(chunksDecode(body2, length)); + resolve8(chunksDecode(body2, length)); } else if (type === "json") { - resolve4(JSON.parse(chunksDecode(body2, length))); + resolve8(JSON.parse(chunksDecode(body2, length))); } else if (type === "arrayBuffer") { - resolve4(chunksConcat(body2, length).buffer); + resolve8(chunksConcat(body2, length).buffer); } else if (type === "blob") { - resolve4(new Blob(body2, { type: stream5[kContentType] })); + resolve8(new Blob(body2, { type: stream5[kContentType] })); } else if (type === "bytes") { - resolve4(chunksConcat(body2, length)); + resolve8(chunksConcat(body2, length)); } consumeFinish(consume2); } catch (err) { @@ -9540,7 +9540,7 @@ var require_api_request = __commonJS({ "node_modules/undici/lib/api/api-request.js"(exports2, module) { "use strict"; var assert2 = __require("assert"); - var { Readable: Readable13 } = require_readable(); + var { Readable: Readable11 } = require_readable(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var util3 = require_util(); var { getResolveErrorBodyCallback } = require_util3(); @@ -9635,7 +9635,7 @@ var require_api_request = __commonJS({ const parsedHeaders = responseHeaders === "raw" ? util3.parseHeaders(rawHeaders) : headers; const contentType2 = parsedHeaders["content-type"]; const contentLength2 = parsedHeaders["content-length"]; - const res = new Readable13({ + const res = new Readable11({ resume, abort, contentType: contentType2, @@ -9698,11 +9698,11 @@ var require_api_request = __commonJS({ } } }; - function request3(opts, callback) { + function request2(opts, callback) { if (callback === void 0) { - return new Promise((resolve4, reject2) => { - request3.call(this, opts, (err, data) => { - return err ? reject2(err) : resolve4(data); + return new Promise((resolve8, reject2) => { + request2.call(this, opts, (err, data) => { + return err ? reject2(err) : resolve8(data); }); }); } @@ -9716,7 +9716,7 @@ var require_api_request = __commonJS({ queueMicrotask(() => callback(err, { opaque })); } } - module.exports = request3; + module.exports = request2; module.exports.RequestHandler = RequestHandler; } }); @@ -9926,9 +9926,9 @@ var require_api_stream = __commonJS({ }; function stream5(opts, factory, callback) { if (callback === void 0) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { stream5.call(this, opts, factory, (err, data) => { - return err ? reject2(err) : resolve4(data); + return err ? reject2(err) : resolve8(data); }); }); } @@ -9951,7 +9951,7 @@ var require_api_pipeline = __commonJS({ "node_modules/undici/lib/api/api-pipeline.js"(exports2, module) { "use strict"; var { - Readable: Readable13, + Readable: Readable11, Duplex, PassThrough: PassThrough5 } = __require("stream"); @@ -9965,7 +9965,7 @@ var require_api_pipeline = __commonJS({ var { addSignal, removeSignal } = require_abort_signal(); var assert2 = __require("assert"); var kResume = /* @__PURE__ */ Symbol("resume"); - var PipelineRequest = class extends Readable13 { + var PipelineRequest = class extends Readable11 { constructor() { super({ autoDestroy: true }); this[kResume] = null; @@ -9982,7 +9982,7 @@ var require_api_pipeline = __commonJS({ callback(err); } }; - var PipelineResponse = class extends Readable13 { + var PipelineResponse = class extends Readable11 { constructor(resume) { super({ autoDestroy: true }); this[kResume] = resume; @@ -10213,9 +10213,9 @@ var require_api_upgrade = __commonJS({ }; function upgrade(opts, callback) { if (callback === void 0) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { upgrade.call(this, opts, (err, data) => { - return err ? reject2(err) : resolve4(data); + return err ? reject2(err) : resolve8(data); }); }); } @@ -10307,9 +10307,9 @@ var require_api_connect = __commonJS({ }; function connect(opts, callback) { if (callback === void 0) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { connect.call(this, opts, (err, data) => { - return err ? reject2(err) : resolve4(data); + return err ? reject2(err) : resolve8(data); }); }); } @@ -10409,7 +10409,7 @@ var require_mock_utils = __commonJS({ var { STATUS_CODES: STATUS_CODES2 } = __require("http"); var { types: { - isPromise + isPromise: isPromise2 } } = __require("util"); function matchValue(match3, value) { @@ -10609,7 +10609,7 @@ var require_mock_utils = __commonJS({ function handleReply(mockDispatches, _data6 = data) { const optsHeaders = Array.isArray(opts.headers) ? buildHeadersFromArray(opts.headers) : opts.headers; const body2 = typeof _data6 === "function" ? _data6({ ...opts, headers: optsHeaders }) : _data6; - if (isPromise(body2)) { + if (isPromise2(body2)) { body2.then((newData) => handleReply(mockDispatches, newData)); return; } @@ -11870,26 +11870,26 @@ var require_headers = __commonJS({ const firstValue = iterator2.next().value; array[0] = [firstValue[0], firstValue[1].value]; assert2(firstValue[1].value !== null); - for (let i6 = 1, j7 = 0, right = 0, left = 0, pivot = 0, x6, value; i6 < size; ++i6) { + for (let i6 = 1, j7 = 0, right2 = 0, left2 = 0, pivot = 0, x2, value; i6 < size; ++i6) { value = iterator2.next().value; - x6 = array[i6] = [value[0], value[1].value]; - assert2(x6[1] !== null); - left = 0; - right = i6; - while (left < right) { - pivot = left + (right - left >> 1); - if (array[pivot][0] <= x6[0]) { - left = pivot + 1; + x2 = array[i6] = [value[0], value[1].value]; + assert2(x2[1] !== null); + left2 = 0; + right2 = i6; + while (left2 < right2) { + pivot = left2 + (right2 - left2 >> 1); + if (array[pivot][0] <= x2[0]) { + left2 = pivot + 1; } else { - right = pivot; + right2 = pivot; } } if (i6 !== pivot) { j7 = i6; - while (j7 > left) { + while (j7 > left2) { array[j7] = array[--j7]; } - array[left] = x6; + array[left2] = x2; } } if (!iterator2.next().done) { @@ -12043,17 +12043,17 @@ var require_headers = __commonJS({ options.depth ??= depth; return `Headers ${util3.formatWithOptions(options, this.#headersList.entries)}`; } - static getHeadersGuard(o6) { - return o6.#guard; + static getHeadersGuard(o2) { + return o2.#guard; } - static setHeadersGuard(o6, guard) { - o6.#guard = guard; + static setHeadersGuard(o2, guard) { + o2.#guard = guard; } - static getHeadersList(o6) { - return o6.#headersList; + static getHeadersList(o2) { + return o2.#headersList; } - static setHeadersList(o6, list) { - o6.#headersList = list; + static setHeadersList(o2, list) { + o2.#headersList = list; } }; var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers4; @@ -12142,7 +12142,7 @@ var require_response = __commonJS({ var assert2 = __require("assert"); var { types: types3 } = __require("util"); var textEncoder = new TextEncoder("utf-8"); - var Response2 = class _Response { + var Response3 = class _Response { // Creates network error Response. static error() { const responseObject = fromInnerResponse(makeNetworkError(), "immutable"); @@ -12285,8 +12285,8 @@ var require_response = __commonJS({ return `Response ${nodeUtil.formatWithOptions(options, properties)}`; } }; - mixinBody(Response2); - Object.defineProperties(Response2.prototype, { + mixinBody(Response3); + Object.defineProperties(Response3.prototype, { type: kEnumerableProperty, url: kEnumerableProperty, status: kEnumerableProperty, @@ -12302,7 +12302,7 @@ var require_response = __commonJS({ configurable: true } }); - Object.defineProperties(Response2, { + Object.defineProperties(Response3, { json: kEnumerableProperty, redirect: kEnumerableProperty, error: kEnumerableProperty @@ -12358,12 +12358,12 @@ var require_response = __commonJS({ ...state4 }; return new Proxy(response, { - get(target, p6) { - return p6 in state4 ? state4[p6] : target[p6]; + get(target, p2) { + return p2 in state4 ? state4[p2] : target[p2]; }, - set(target, p6, value) { - assert2(!(p6 in state4)); - target[p6] = value; + set(target, p2, value) { + assert2(!(p2 in state4)); + target[p2] = value; return true; } }); @@ -12435,7 +12435,7 @@ var require_response = __commonJS({ } } function fromInnerResponse(innerResponse, guard) { - const response = new Response2(kConstruct); + const response = new Response3(kConstruct); response[kState] = innerResponse; response[kHeaders] = new Headers4(kConstruct); setHeadersList(response[kHeaders], innerResponse.headersList); @@ -12503,7 +12503,7 @@ var require_response = __commonJS({ makeResponse, makeAppropriateNetworkError, filterResponse, - Response: Response2, + Response: Response3, cloneResponse, fromInnerResponse }; @@ -12613,7 +12613,7 @@ var require_request2 = __commonJS({ } } var patchMethodWarning = false; - var Request3 = class _Request { + var Request2 = class _Request { // https://fetch.spec.whatwg.org/#dom-request constructor(input, init = {}) { webidl.util.markAsUncloneable(this); @@ -12624,7 +12624,7 @@ var require_request2 = __commonJS({ webidl.argumentLengthCheck(arguments, 1, prefix2); input = webidl.converters.RequestInfo(input, prefix2, "input"); init = webidl.converters.RequestInit(init, prefix2, "init"); - let request3 = null; + let request2 = null; let fallbackMode = null; const baseUrl2 = environmentSettingsObject.settingsObject.baseUrl; let signal = null; @@ -12641,18 +12641,18 @@ var require_request2 = __commonJS({ "Request cannot be constructed from a URL that includes credentials: " + input ); } - request3 = makeRequest({ urlList: [parsedURL] }); + request2 = makeRequest({ urlList: [parsedURL] }); fallbackMode = "cors"; } else { this[kDispatcher] = init.dispatcher || input[kDispatcher]; assert2(input instanceof _Request); - request3 = input[kState]; + request2 = input[kState]; signal = input[kSignal]; } const origin = environmentSettingsObject.settingsObject.origin; let window2 = "client"; - if (request3.window?.constructor?.name === "EnvironmentSettingsObject" && sameOrigin(request3.window, origin)) { - window2 = request3.window; + if (request2.window?.constructor?.name === "EnvironmentSettingsObject" && sameOrigin(request2.window, origin)) { + window2 = request2.window; } if (init.window != null) { throw new TypeError(`'window' option '${window2}' must be null`); @@ -12660,66 +12660,66 @@ var require_request2 = __commonJS({ if ("window" in init) { window2 = "no-window"; } - request3 = makeRequest({ + request2 = 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: request3.method, + method: request2.method, // header list A copy of request’s header list. // undici implementation note: headersList is cloned in makeRequest - headersList: request3.headersList, + headersList: request2.headersList, // unsafe-request flag Set. - unsafeRequest: request3.unsafeRequest, + unsafeRequest: request2.unsafeRequest, // client This’s relevant settings object. client: environmentSettingsObject.settingsObject, // window window. window: window2, // priority request’s priority. - priority: request3.priority, + priority: request2.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: request3.origin, + origin: request2.origin, // referrer request’s referrer. - referrer: request3.referrer, + referrer: request2.referrer, // referrer policy request’s referrer policy. - referrerPolicy: request3.referrerPolicy, + referrerPolicy: request2.referrerPolicy, // mode request’s mode. - mode: request3.mode, + mode: request2.mode, // credentials mode request’s credentials mode. - credentials: request3.credentials, + credentials: request2.credentials, // cache mode request’s cache mode. - cache: request3.cache, + cache: request2.cache, // redirect mode request’s redirect mode. - redirect: request3.redirect, + redirect: request2.redirect, // integrity metadata request’s integrity metadata. - integrity: request3.integrity, + integrity: request2.integrity, // keepalive request’s keepalive. - keepalive: request3.keepalive, + keepalive: request2.keepalive, // reload-navigation flag request’s reload-navigation flag. - reloadNavigation: request3.reloadNavigation, + reloadNavigation: request2.reloadNavigation, // history-navigation flag request’s history-navigation flag. - historyNavigation: request3.historyNavigation, + historyNavigation: request2.historyNavigation, // URL list A clone of request’s URL list. - urlList: [...request3.urlList] + urlList: [...request2.urlList] }); const initHasKey = Object.keys(init).length !== 0; if (initHasKey) { - if (request3.mode === "navigate") { - request3.mode = "same-origin"; + if (request2.mode === "navigate") { + request2.mode = "same-origin"; } - request3.reloadNavigation = false; - request3.historyNavigation = false; - request3.origin = "client"; - request3.referrer = "client"; - request3.referrerPolicy = ""; - request3.url = request3.urlList[request3.urlList.length - 1]; - request3.urlList = [request3.url]; + request2.reloadNavigation = false; + request2.historyNavigation = false; + request2.origin = "client"; + request2.referrer = "client"; + request2.referrerPolicy = ""; + request2.url = request2.urlList[request2.urlList.length - 1]; + request2.urlList = [request2.url]; } if (init.referrer !== void 0) { const referrer = init.referrer; if (referrer === "") { - request3.referrer = "no-referrer"; + request2.referrer = "no-referrer"; } else { let parsedReferrer; try { @@ -12728,14 +12728,14 @@ var require_request2 = __commonJS({ 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)) { - request3.referrer = "client"; + request2.referrer = "client"; } else { - request3.referrer = parsedReferrer; + request2.referrer = parsedReferrer; } } } if (init.referrerPolicy !== void 0) { - request3.referrerPolicy = init.referrerPolicy; + request2.referrerPolicy = init.referrerPolicy; } let mode; if (init.mode !== void 0) { @@ -12750,33 +12750,33 @@ var require_request2 = __commonJS({ }); } if (mode != null) { - request3.mode = mode; + request2.mode = mode; } if (init.credentials !== void 0) { - request3.credentials = init.credentials; + request2.credentials = init.credentials; } if (init.cache !== void 0) { - request3.cache = init.cache; + request2.cache = init.cache; } - if (request3.cache === "only-if-cached" && request3.mode !== "same-origin") { + if (request2.cache === "only-if-cached" && request2.mode !== "same-origin") { throw new TypeError( "'only-if-cached' can be set only with 'same-origin' mode" ); } if (init.redirect !== void 0) { - request3.redirect = init.redirect; + request2.redirect = init.redirect; } if (init.integrity != null) { - request3.integrity = String(init.integrity); + request2.integrity = String(init.integrity); } if (init.keepalive !== void 0) { - request3.keepalive = Boolean(init.keepalive); + request2.keepalive = Boolean(init.keepalive); } if (init.method !== void 0) { let method = init.method; const mayBeNormalized = normalizedMethodRecords[method]; if (mayBeNormalized !== void 0) { - request3.method = mayBeNormalized; + request2.method = mayBeNormalized; } else { if (!isValidHTTPToken(method)) { throw new TypeError(`'${method}' is not a valid HTTP method.`); @@ -12786,9 +12786,9 @@ var require_request2 = __commonJS({ throw new TypeError(`'${method}' HTTP method is unsupported.`); } method = normalizedMethodRecordsBase[upperCase] ?? method; - request3.method = method; + request2.method = method; } - if (!patchMethodWarning && request3.method === "patch") { + if (!patchMethodWarning && request2.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" }); @@ -12798,7 +12798,7 @@ var require_request2 = __commonJS({ if (init.signal !== void 0) { signal = init.signal; } - this[kState] = request3; + this[kState] = request2; const ac = new AbortController(); this[kSignal] = ac.signal; if (signal != null) { @@ -12826,12 +12826,12 @@ var require_request2 = __commonJS({ } } this[kHeaders] = new Headers4(kConstruct); - setHeadersList(this[kHeaders], request3.headersList); + setHeadersList(this[kHeaders], request2.headersList); setHeadersGuard(this[kHeaders], "request"); if (mode === "no-cors") { - if (!corsSafeListedMethodsSet.has(request3.method)) { + if (!corsSafeListedMethodsSet.has(request2.method)) { throw new TypeError( - `'${request3.method} is unsupported in no-cors mode.` + `'${request2.method} is unsupported in no-cors mode.` ); } setHeadersGuard(this[kHeaders], "request-no-cors"); @@ -12850,14 +12850,14 @@ var require_request2 = __commonJS({ } } const inputBody = input instanceof _Request ? input[kState].body : null; - if ((init.body != null || inputBody != null) && (request3.method === "GET" || request3.method === "HEAD")) { + if ((init.body != null || inputBody != null) && (request2.method === "GET" || request2.method === "HEAD")) { throw new TypeError("Request with GET/HEAD method cannot have body."); } let initBody = null; if (init.body != null) { const [extractedBody, contentType2] = extractBody( init.body, - request3.keepalive + request2.keepalive ); initBody = extractedBody; if (contentType2 && !getHeadersList(this[kHeaders]).contains("content-type", true)) { @@ -12869,12 +12869,12 @@ var require_request2 = __commonJS({ if (initBody != null && init.duplex == null) { throw new TypeError("RequestInit: duplex option is required when sending a body."); } - if (request3.mode !== "same-origin" && request3.mode !== "cors") { + if (request2.mode !== "same-origin" && request2.mode !== "cors") { throw new TypeError( 'If request is made from ReadableStream, mode should be "same-origin" or "cors"' ); } - request3.useCORSPreflightFlag = true; + request2.useCORSPreflightFlag = true; } let finalBody = inputOrInitBody; if (initBody == null && inputBody != null) { @@ -13060,7 +13060,7 @@ var require_request2 = __commonJS({ return `Request ${nodeUtil.formatWithOptions(options, properties)}`; } }; - mixinBody(Request3); + mixinBody(Request2); function makeRequest(init) { return { method: init.method ?? "GET", @@ -13103,23 +13103,23 @@ var require_request2 = __commonJS({ headersList: init.headersList ? new HeadersList(init.headersList) : new HeadersList() }; } - function cloneRequest(request3) { - const newRequest = makeRequest({ ...request3, body: null }); - if (request3.body != null) { - newRequest.body = cloneBody(newRequest, request3.body); + function cloneRequest(request2) { + const newRequest = makeRequest({ ...request2, body: null }); + if (request2.body != null) { + newRequest.body = cloneBody(newRequest, request2.body); } return newRequest; } function fromInnerRequest(innerRequest, signal, guard) { - const request3 = new Request3(kConstruct); - request3[kState] = innerRequest; - request3[kSignal] = signal; - request3[kHeaders] = new Headers4(kConstruct); - setHeadersList(request3[kHeaders], innerRequest.headersList); - setHeadersGuard(request3[kHeaders], guard); - return request3; - } - Object.defineProperties(Request3.prototype, { + const request2 = new Request2(kConstruct); + request2[kState] = innerRequest; + request2[kSignal] = signal; + request2[kHeaders] = new Headers4(kConstruct); + setHeadersList(request2[kHeaders], innerRequest.headersList); + setHeadersGuard(request2[kHeaders], guard); + return request2; + } + Object.defineProperties(Request2.prototype, { method: kEnumerableProperty, url: kEnumerableProperty, headers: kEnumerableProperty, @@ -13146,13 +13146,13 @@ var require_request2 = __commonJS({ } }); webidl.converters.Request = webidl.interfaceConverter( - Request3 + Request2 ); webidl.converters.RequestInfo = function(V2, prefix2, argument) { if (typeof V2 === "string") { return webidl.converters.USVString(V2, prefix2, argument); } - if (V2 instanceof Request3) { + if (V2 instanceof Request2) { return webidl.converters.Request(V2, prefix2, argument); } return webidl.converters.USVString(V2, prefix2, argument); @@ -13243,7 +13243,7 @@ var require_request2 = __commonJS({ converter: webidl.converters.any } ]); - module.exports = { Request: Request3, makeRequest, fromInnerRequest, cloneRequest }; + module.exports = { Request: Request2, makeRequest, fromInnerRequest, cloneRequest }; } }); @@ -13259,7 +13259,7 @@ var require_fetch = __commonJS({ fromInnerResponse } = require_response(); var { HeadersList } = require_headers(); - var { Request: Request3, cloneRequest } = require_request2(); + var { Request: Request2, cloneRequest } = require_request2(); var zlib3 = __require("zlib"); var { bytesMatch, @@ -13307,14 +13307,14 @@ var require_fetch = __commonJS({ subresourceSet } = require_constants3(); var EE = __require("events"); - var { Readable: Readable13, pipeline: pipeline2, finished } = __require("stream"); + var { Readable: Readable11, pipeline: pipeline2, finished } = __require("stream"); var { addAbortListener, isErrored, isReadable: isReadable2, bufferToLowerCasedHeaderName } = require_util(); var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url(); var { getGlobalDispatcher } = require_global2(); var { webidl } = require_webidl(); var { STATUS_CODES: STATUS_CODES2 } = __require("http"); var GET_OR_HEAD = ["GET", "HEAD"]; - var defaultUserAgent = typeof __UNDICI_IS_NODE__ !== "undefined" || typeof esbuildDetection !== "undefined" ? "node" : "undici"; + var defaultUserAgent2 = typeof __UNDICI_IS_NODE__ !== "undefined" || typeof esbuildDetection !== "undefined" ? "node" : "undici"; var resolveObjectURL; var Fetch = class extends EE { constructor(dispatcher) { @@ -13351,22 +13351,22 @@ var require_fetch = __commonJS({ } function fetch4(input, init = void 0) { webidl.argumentLengthCheck(arguments, 1, "globalThis.fetch"); - let p6 = createDeferredPromise(); + let p2 = createDeferredPromise(); let requestObject; try { - requestObject = new Request3(input, init); + requestObject = new Request2(input, init); } catch (e6) { - p6.reject(e6); - return p6.promise; + p2.reject(e6); + return p2.promise; } - const request3 = requestObject[kState]; + const request2 = requestObject[kState]; if (requestObject.signal.aborted) { - abortFetch(p6, request3, null, requestObject.signal.reason); - return p6.promise; + abortFetch(p2, request2, null, requestObject.signal.reason); + return p2.promise; } - const globalObject = request3.client.globalObject; + const globalObject = request2.client.globalObject; if (globalObject?.constructor?.name === "ServiceWorkerGlobalScope") { - request3.serviceWorkers = "none"; + request2.serviceWorkers = "none"; } let responseObject = null; let locallyAborted = false; @@ -13378,7 +13378,7 @@ var require_fetch = __commonJS({ assert2(controller != null); controller.abort(requestObject.signal.reason); const realResponse = responseObject?.deref(); - abortFetch(p6, request3, realResponse, requestObject.signal.reason); + abortFetch(p2, request2, realResponse, requestObject.signal.reason); } ); const processResponse = (response) => { @@ -13386,25 +13386,25 @@ var require_fetch = __commonJS({ return; } if (response.aborted) { - abortFetch(p6, request3, responseObject, controller.serializedAbortReason); + abortFetch(p2, request2, responseObject, controller.serializedAbortReason); return; } if (response.type === "error") { - p6.reject(new TypeError("fetch failed", { cause: response.error })); + p2.reject(new TypeError("fetch failed", { cause: response.error })); return; } responseObject = new WeakRef(fromInnerResponse(response, "immutable")); - p6.resolve(responseObject.deref()); - p6 = null; + p2.resolve(responseObject.deref()); + p2 = null; }; controller = fetching({ - request: request3, + request: request2, processResponseEndOfBody: handleFetchDone, processResponse, dispatcher: requestObject[kDispatcher] // undici }); - return p6.promise; + return p2.promise; } function finalizeAndReportTiming(response, initiatorType = "other") { if (response.type === "error" && response.aborted) { @@ -13439,12 +13439,12 @@ var require_fetch = __commonJS({ ); } var markResourceTiming = performance.markResourceTiming; - function abortFetch(p6, request3, responseObject, error2) { - if (p6) { - p6.reject(error2); + function abortFetch(p2, request2, responseObject, error2) { + if (p2) { + p2.reject(error2); } - if (request3.body != null && isReadable2(request3.body?.stream)) { - request3.body.stream.cancel(error2).catch((err) => { + if (request2.body != null && isReadable2(request2.body?.stream)) { + request2.body.stream.cancel(error2).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13465,7 +13465,7 @@ var require_fetch = __commonJS({ } } function fetching({ - request: request3, + request: request2, processRequestBodyChunkLength, processRequestEndOfBody, processResponse, @@ -13478,9 +13478,9 @@ var require_fetch = __commonJS({ assert2(dispatcher); let taskDestination = null; let crossOriginIsolatedCapability = false; - if (request3.client != null) { - taskDestination = request3.client.globalObject; - crossOriginIsolatedCapability = request3.client.crossOriginIsolatedCapability; + if (request2.client != null) { + taskDestination = request2.client.globalObject; + crossOriginIsolatedCapability = request2.client.crossOriginIsolatedCapability; } const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability); const timingInfo = createOpaqueTimingInfo({ @@ -13488,7 +13488,7 @@ var require_fetch = __commonJS({ }); const fetchParams = { controller: new Fetch(dispatcher), - request: request3, + request: request2, timingInfo, processRequestBodyChunkLength, processRequestEndOfBody, @@ -13498,32 +13498,32 @@ var require_fetch = __commonJS({ taskDestination, crossOriginIsolatedCapability }; - assert2(!request3.body || request3.body.stream); - if (request3.window === "client") { - request3.window = request3.client?.globalObject?.constructor?.name === "Window" ? request3.client : "no-window"; + assert2(!request2.body || request2.body.stream); + if (request2.window === "client") { + request2.window = request2.client?.globalObject?.constructor?.name === "Window" ? request2.client : "no-window"; } - if (request3.origin === "client") { - request3.origin = request3.client.origin; + if (request2.origin === "client") { + request2.origin = request2.client.origin; } - if (request3.policyContainer === "client") { - if (request3.client != null) { - request3.policyContainer = clonePolicyContainer( - request3.client.policyContainer + if (request2.policyContainer === "client") { + if (request2.client != null) { + request2.policyContainer = clonePolicyContainer( + request2.client.policyContainer ); } else { - request3.policyContainer = makePolicyContainer(); + request2.policyContainer = makePolicyContainer(); } } - if (!request3.headersList.contains("accept", true)) { + if (!request2.headersList.contains("accept", true)) { const value = "*/*"; - request3.headersList.append("accept", value, true); + request2.headersList.append("accept", value, true); } - if (!request3.headersList.contains("accept-language", true)) { - request3.headersList.append("accept-language", "*", true); + if (!request2.headersList.contains("accept-language", true)) { + request2.headersList.append("accept-language", "*", true); } - if (request3.priority === null) { + if (request2.priority === null) { } - if (subresourceSet.has(request3.destination)) { + if (subresourceSet.has(request2.destination)) { } mainFetch(fetchParams).catch((err) => { fetchParams.controller.terminate(err); @@ -13531,50 +13531,50 @@ var require_fetch = __commonJS({ return fetchParams.controller; } async function mainFetch(fetchParams, recursive = false) { - const request3 = fetchParams.request; + const request2 = fetchParams.request; let response = null; - if (request3.localURLsOnly && !urlIsLocal(requestCurrentURL(request3))) { + if (request2.localURLsOnly && !urlIsLocal(requestCurrentURL(request2))) { response = makeNetworkError("local URLs only"); } - tryUpgradeRequestToAPotentiallyTrustworthyURL(request3); - if (requestBadPort(request3) === "blocked") { + tryUpgradeRequestToAPotentiallyTrustworthyURL(request2); + if (requestBadPort(request2) === "blocked") { response = makeNetworkError("bad port"); } - if (request3.referrerPolicy === "") { - request3.referrerPolicy = request3.policyContainer.referrerPolicy; + if (request2.referrerPolicy === "") { + request2.referrerPolicy = request2.policyContainer.referrerPolicy; } - if (request3.referrer !== "no-referrer") { - request3.referrer = determineRequestsReferrer(request3); + if (request2.referrer !== "no-referrer") { + request2.referrer = determineRequestsReferrer(request2); } if (response === null) { response = await (async () => { - const currentURL = requestCurrentURL(request3); + const currentURL = requestCurrentURL(request2); if ( // - request’s current URL’s origin is same origin with request’s origin, // and request’s response tainting is "basic" - sameOrigin(currentURL, request3.url) && request3.responseTainting === "basic" || // request’s current URL’s scheme is "data" + sameOrigin(currentURL, request2.url) && request2.responseTainting === "basic" || // request’s current URL’s scheme is "data" currentURL.protocol === "data:" || // - request’s mode is "navigate" or "websocket" - (request3.mode === "navigate" || request3.mode === "websocket") + (request2.mode === "navigate" || request2.mode === "websocket") ) { - request3.responseTainting = "basic"; + request2.responseTainting = "basic"; return await schemeFetch(fetchParams); } - if (request3.mode === "same-origin") { + if (request2.mode === "same-origin") { return makeNetworkError('request mode cannot be "same-origin"'); } - if (request3.mode === "no-cors") { - if (request3.redirect !== "follow") { + if (request2.mode === "no-cors") { + if (request2.redirect !== "follow") { return makeNetworkError( 'redirect mode cannot be "follow" for "no-cors" request' ); } - request3.responseTainting = "opaque"; + request2.responseTainting = "opaque"; return await schemeFetch(fetchParams); } - if (!urlIsHttpHttpsScheme(requestCurrentURL(request3))) { + if (!urlIsHttpHttpsScheme(requestCurrentURL(request2))) { return makeNetworkError("URL scheme must be a HTTP(S) scheme"); } - request3.responseTainting = "cors"; + request2.responseTainting = "cors"; return await httpFetch(fetchParams); })(); } @@ -13582,13 +13582,13 @@ var require_fetch = __commonJS({ return response; } if (response.status !== 0 && !response.internalResponse) { - if (request3.responseTainting === "cors") { + if (request2.responseTainting === "cors") { } - if (request3.responseTainting === "basic") { + if (request2.responseTainting === "basic") { response = filterResponse(response, "basic"); - } else if (request3.responseTainting === "cors") { + } else if (request2.responseTainting === "cors") { response = filterResponse(response, "cors"); - } else if (request3.responseTainting === "opaque") { + } else if (request2.responseTainting === "opaque") { response = filterResponse(response, "opaque"); } else { assert2(false); @@ -13596,26 +13596,26 @@ var require_fetch = __commonJS({ } let internalResponse = response.status === 0 ? response : response.internalResponse; if (internalResponse.urlList.length === 0) { - internalResponse.urlList.push(...request3.urlList); + internalResponse.urlList.push(...request2.urlList); } - if (!request3.timingAllowFailed) { + if (!request2.timingAllowFailed) { response.timingAllowPassed = true; } - if (response.type === "opaque" && internalResponse.status === 206 && internalResponse.rangeRequested && !request3.headers.contains("range", true)) { + if (response.type === "opaque" && internalResponse.status === 206 && internalResponse.rangeRequested && !request2.headers.contains("range", true)) { response = internalResponse = makeNetworkError(); } - if (response.status !== 0 && (request3.method === "HEAD" || request3.method === "CONNECT" || nullBodyStatus.includes(internalResponse.status))) { + if (response.status !== 0 && (request2.method === "HEAD" || request2.method === "CONNECT" || nullBodyStatus.includes(internalResponse.status))) { internalResponse.body = null; fetchParams.controller.dump = true; } - if (request3.integrity) { + if (request2.integrity) { const processBodyError = (reason) => fetchFinale(fetchParams, makeNetworkError(reason)); - if (request3.responseTainting === "opaque" || response.body == null) { + if (request2.responseTainting === "opaque" || response.body == null) { processBodyError(response.error); return; } const processBody = (bytes) => { - if (!bytesMatch(bytes, request3.integrity)) { + if (!bytesMatch(bytes, request2.integrity)) { processBodyError("integrity mismatch"); return; } @@ -13631,8 +13631,8 @@ var require_fetch = __commonJS({ if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) { return Promise.resolve(makeAppropriateNetworkError(fetchParams)); } - const { request: request3 } = fetchParams; - const { protocol: scheme } = requestCurrentURL(request3); + const { request: request2 } = fetchParams; + const { protocol: scheme } = requestCurrentURL(request2); switch (scheme) { case "about:": { return Promise.resolve(makeNetworkError("about scheme is not supported")); @@ -13641,19 +13641,19 @@ var require_fetch = __commonJS({ if (!resolveObjectURL) { resolveObjectURL = __require("buffer").resolveObjectURL; } - const blobURLEntry = requestCurrentURL(request3); + const blobURLEntry = requestCurrentURL(request2); if (blobURLEntry.search.length !== 0) { return Promise.resolve(makeNetworkError("NetworkError when attempting to fetch resource.")); } const blob = resolveObjectURL(blobURLEntry.toString()); - if (request3.method !== "GET" || !isBlobLike(blob)) { + if (request2.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 (!request3.headersList.contains("range", true)) { + if (!request2.headersList.contains("range", true)) { const bodyWithType = extractBody(blob); response.statusText = "OK"; response.body = bodyWithType[0]; @@ -13661,7 +13661,7 @@ var require_fetch = __commonJS({ response.headersList.set("content-type", type, true); } else { response.rangeRequested = true; - const rangeHeader = request3.headersList.get("range", true); + const rangeHeader = request2.headersList.get("range", true); const rangeValue = simpleRangeHeaderValue(rangeHeader, true); if (rangeValue === "failure") { return Promise.resolve(makeNetworkError("failed to fetch the data URL")); @@ -13692,7 +13692,7 @@ var require_fetch = __commonJS({ return Promise.resolve(response); } case "data:": { - const currentURL = requestCurrentURL(request3); + const currentURL = requestCurrentURL(request2); const dataURLStruct = dataURLProcessor(currentURL); if (dataURLStruct === "failure") { return Promise.resolve(makeNetworkError("failed to fetch the data URL")); @@ -13781,41 +13781,41 @@ var require_fetch = __commonJS({ } } async function httpFetch(fetchParams) { - const request3 = fetchParams.request; + const request2 = fetchParams.request; let response = null; let actualResponse = null; const timingInfo = fetchParams.timingInfo; - if (request3.serviceWorkers === "all") { + if (request2.serviceWorkers === "all") { } if (response === null) { - if (request3.redirect === "follow") { - request3.serviceWorkers = "none"; + if (request2.redirect === "follow") { + request2.serviceWorkers = "none"; } actualResponse = response = await httpNetworkOrCacheFetch(fetchParams); - if (request3.responseTainting === "cors" && corsCheck(request3, response) === "failure") { + if (request2.responseTainting === "cors" && corsCheck(request2, response) === "failure") { return makeNetworkError("cors failure"); } - if (TAOCheck(request3, response) === "failure") { - request3.timingAllowFailed = true; + if (TAOCheck(request2, response) === "failure") { + request2.timingAllowFailed = true; } } - if ((request3.responseTainting === "opaque" || response.type === "opaque") && crossOriginResourcePolicyCheck( - request3.origin, - request3.client, - request3.destination, + if ((request2.responseTainting === "opaque" || response.type === "opaque") && crossOriginResourcePolicyCheck( + request2.origin, + request2.client, + request2.destination, actualResponse ) === "blocked") { return makeNetworkError("blocked"); } if (redirectStatusSet.has(actualResponse.status)) { - if (request3.redirect !== "manual") { + if (request2.redirect !== "manual") { fetchParams.controller.connection.destroy(void 0, false); } - if (request3.redirect === "error") { + if (request2.redirect === "error") { response = makeNetworkError("unexpected redirect"); - } else if (request3.redirect === "manual") { + } else if (request2.redirect === "manual") { response = actualResponse; - } else if (request3.redirect === "follow") { + } else if (request2.redirect === "follow") { response = await httpRedirectFetch(fetchParams, response); } else { assert2(false); @@ -13825,13 +13825,13 @@ var require_fetch = __commonJS({ return response; } function httpRedirectFetch(fetchParams, response) { - const request3 = fetchParams.request; + const request2 = fetchParams.request; const actualResponse = response.internalResponse ? response.internalResponse : response; let locationURL; try { locationURL = responseLocationURL( actualResponse, - requestCurrentURL(request3).hash + requestCurrentURL(request2).hash ); if (locationURL == null) { return response; @@ -13842,63 +13842,63 @@ var require_fetch = __commonJS({ if (!urlIsHttpHttpsScheme(locationURL)) { return Promise.resolve(makeNetworkError("URL scheme must be a HTTP(S) scheme")); } - if (request3.redirectCount === 20) { + if (request2.redirectCount === 20) { return Promise.resolve(makeNetworkError("redirect count exceeded")); } - request3.redirectCount += 1; - if (request3.mode === "cors" && (locationURL.username || locationURL.password) && !sameOrigin(request3, locationURL)) { + request2.redirectCount += 1; + if (request2.mode === "cors" && (locationURL.username || locationURL.password) && !sameOrigin(request2, locationURL)) { return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"')); } - if (request3.responseTainting === "cors" && (locationURL.username || locationURL.password)) { + if (request2.responseTainting === "cors" && (locationURL.username || locationURL.password)) { return Promise.resolve(makeNetworkError( 'URL cannot contain credentials for request mode "cors"' )); } - if (actualResponse.status !== 303 && request3.body != null && request3.body.source == null) { + if (actualResponse.status !== 303 && request2.body != null && request2.body.source == null) { return Promise.resolve(makeNetworkError()); } - if ([301, 302].includes(actualResponse.status) && request3.method === "POST" || actualResponse.status === 303 && !GET_OR_HEAD.includes(request3.method)) { - request3.method = "GET"; - request3.body = null; + if ([301, 302].includes(actualResponse.status) && request2.method === "POST" || actualResponse.status === 303 && !GET_OR_HEAD.includes(request2.method)) { + request2.method = "GET"; + request2.body = null; for (const headerName of requestBodyHeader) { - request3.headersList.delete(headerName); + request2.headersList.delete(headerName); } } - if (!sameOrigin(requestCurrentURL(request3), locationURL)) { - request3.headersList.delete("authorization", true); - request3.headersList.delete("proxy-authorization", true); - request3.headersList.delete("cookie", true); - request3.headersList.delete("host", true); + if (!sameOrigin(requestCurrentURL(request2), locationURL)) { + request2.headersList.delete("authorization", true); + request2.headersList.delete("proxy-authorization", true); + request2.headersList.delete("cookie", true); + request2.headersList.delete("host", true); } - if (request3.body != null) { - assert2(request3.body.source != null); - request3.body = safelyExtractBody(request3.body.source)[0]; + if (request2.body != null) { + assert2(request2.body.source != null); + request2.body = safelyExtractBody(request2.body.source)[0]; } const timingInfo = fetchParams.timingInfo; timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability); if (timingInfo.redirectStartTime === 0) { timingInfo.redirectStartTime = timingInfo.startTime; } - request3.urlList.push(locationURL); - setRequestReferrerPolicyOnRedirect(request3, actualResponse); + request2.urlList.push(locationURL); + setRequestReferrerPolicyOnRedirect(request2, actualResponse); return mainFetch(fetchParams, true); } async function httpNetworkOrCacheFetch(fetchParams, isAuthenticationFetch = false, isNewConnectionFetch = false) { - const request3 = fetchParams.request; + const request2 = fetchParams.request; let httpFetchParams = null; let httpRequest2 = null; let response = null; const httpCache = null; const revalidatingFlag = false; - if (request3.window === "no-window" && request3.redirect === "error") { + if (request2.window === "no-window" && request2.redirect === "error") { httpFetchParams = fetchParams; - httpRequest2 = request3; + httpRequest2 = request2; } else { - httpRequest2 = cloneRequest(request3); + httpRequest2 = cloneRequest(request2); httpFetchParams = { ...fetchParams }; httpFetchParams.request = httpRequest2; } - const includeCredentials = request3.credentials === "include" || request3.credentials === "same-origin" && request3.responseTainting === "basic"; + const includeCredentials = request2.credentials === "include" || request2.credentials === "same-origin" && request2.responseTainting === "basic"; const contentLength2 = httpRequest2.body ? httpRequest2.body.length : null; let contentLengthHeaderValue = null; if (httpRequest2.body == null && ["POST", "PUT"].includes(httpRequest2.method)) { @@ -13918,7 +13918,7 @@ var require_fetch = __commonJS({ appendRequestOriginHeader(httpRequest2); appendFetchMetadata(httpRequest2); if (!httpRequest2.headersList.contains("user-agent", true)) { - httpRequest2.headersList.append("user-agent", defaultUserAgent); + httpRequest2.headersList.append("user-agent", defaultUserAgent2); } if (httpRequest2.cache === "default" && (httpRequest2.headersList.contains("if-modified-since", true) || httpRequest2.headersList.contains("if-none-match", true) || httpRequest2.headersList.contains("if-unmodified-since", true) || httpRequest2.headersList.contains("if-match", true) || httpRequest2.headersList.contains("if-range", true))) { httpRequest2.cache = "no-store"; @@ -13975,7 +13975,7 @@ var require_fetch = __commonJS({ } response.requestIncludesCredentials = includeCredentials; if (response.status === 407) { - if (request3.window === "no-window") { + if (request2.window === "no-window") { return makeNetworkError(); } if (isCancelled(fetchParams)) { @@ -13987,7 +13987,7 @@ var require_fetch = __commonJS({ // 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 - (request3.body == null || request3.body.source != null) + (request2.body == null || request2.body.source != null) ) { if (isCancelled(fetchParams)) { return makeAppropriateNetworkError(fetchParams); @@ -14017,21 +14017,21 @@ var require_fetch = __commonJS({ } } }; - const request3 = fetchParams.request; + const request2 = fetchParams.request; let response = null; const timingInfo = fetchParams.timingInfo; const httpCache = null; if (httpCache == null) { - request3.cache = "no-store"; + request2.cache = "no-store"; } const newConnection = forceNewConnection ? "yes" : "no"; - if (request3.mode === "websocket") { + if (request2.mode === "websocket") { } else { } let requestBody = null; - if (request3.body == null && fetchParams.processRequestEndOfBody) { + if (request2.body == null && fetchParams.processRequestEndOfBody) { queueMicrotask(() => fetchParams.processRequestEndOfBody()); - } else if (request3.body != null) { + } else if (request2.body != null) { const processBodyChunk = async function* (bytes) { if (isCancelled(fetchParams)) { return; @@ -14059,7 +14059,7 @@ var require_fetch = __commonJS({ }; requestBody = (async function* () { try { - for await (const bytes of request3.body.stream) { + for await (const bytes of request2.body.stream) { yield* processBodyChunk(bytes); } processEndOfBody(); @@ -14169,17 +14169,17 @@ var require_fetch = __commonJS({ } return response; function dispatch({ body: body2 }) { - const url2 = requestCurrentURL(request3); + const url2 = requestCurrentURL(request2); const agent = fetchParams.controller.dispatcher; - return new Promise((resolve4, reject2) => agent.dispatch( + return new Promise((resolve8, reject2) => agent.dispatch( { path: url2.pathname + url2.search, origin: url2.origin, - method: request3.method, - body: agent.isMockActive ? request3.body && (request3.body.source || request3.body.stream) : body2, - headers: request3.headersList.entries, + method: request2.method, + body: agent.isMockActive ? request2.body && (request2.body.source || request2.body.stream) : body2, + headers: request2.headersList.entries, maxRedirections: 0, - upgrade: request3.mode === "websocket" ? "websocket" : void 0 + upgrade: request2.mode === "websocket" ? "websocket" : void 0 }, { body: null, @@ -14208,10 +14208,10 @@ var require_fetch = __commonJS({ headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i6]), rawHeaders[i6 + 1].toString("latin1"), true); } location = headersList.get("location", true); - this.body = new Readable13({ read: resume }); + this.body = new Readable11({ read: resume }); const decoders = []; - const willFollow = location && request3.redirect === "follow" && redirectStatusSet.has(status); - if (request3.method !== "HEAD" && request3.method !== "CONNECT" && !nullBodyStatus.includes(status) && !willFollow) { + const willFollow = location && request2.redirect === "follow" && redirectStatusSet.has(status); + if (request2.method !== "HEAD" && request2.method !== "CONNECT" && !nullBodyStatus.includes(status) && !willFollow) { const contentEncoding = headersList.get("content-encoding", true); const codings = contentEncoding ? contentEncoding.toLowerCase().split(",") : []; const maxContentEncodings = 5; @@ -14247,7 +14247,7 @@ var require_fetch = __commonJS({ } } const onError = this.onError.bind(this); - resolve4({ + resolve8({ status, statusText, headersList, @@ -14293,7 +14293,7 @@ var require_fetch = __commonJS({ for (let i6 = 0; i6 < rawHeaders.length; i6 += 2) { headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i6]), rawHeaders[i6 + 1].toString("latin1"), true); } - resolve4({ + resolve8({ status, statusText: STATUS_CODES2[status], headersList, @@ -15144,9 +15144,9 @@ var require_util5 = __commonJS({ var assert2 = __require("assert"); var { URLSerializer } = require_data_url(); var { isValidHeaderName } = require_util2(); - function urlEquals(A3, B3, excludeFragment = false) { - const serializedA = URLSerializer(A3, excludeFragment); - const serializedB = URLSerializer(B3, excludeFragment); + function urlEquals(A2, B2, excludeFragment = false) { + const serializedA = URLSerializer(A2, excludeFragment); + const serializedB = URLSerializer(B2, excludeFragment); return serializedA === serializedB; } function getFieldValues(header) { @@ -15175,8 +15175,8 @@ var require_cache = __commonJS({ var { urlEquals, getFieldValues } = require_util5(); var { kEnumerableProperty, isDisturbed } = require_util(); var { webidl } = require_webidl(); - var { Response: Response2, cloneResponse, fromInnerResponse } = require_response(); - var { Request: Request3, fromInnerRequest } = require_request2(); + var { Response: Response3, cloneResponse, fromInnerResponse } = require_response(); + var { Request: Request2, fromInnerRequest } = require_request2(); var { kState } = require_symbols2(); var { fetching } = require_fetch(); var { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require_util2(); @@ -15194,31 +15194,31 @@ var require_cache = __commonJS({ webidl.util.markAsUncloneable(this); this.#relevantRequestResponseList = arguments[1]; } - async match(request3, options = {}) { + async match(request2, options = {}) { webidl.brandCheck(this, _Cache); const prefix2 = "Cache.match"; webidl.argumentLengthCheck(arguments, 1, prefix2); - request3 = webidl.converters.RequestInfo(request3, prefix2, "request"); + request2 = webidl.converters.RequestInfo(request2, prefix2, "request"); options = webidl.converters.CacheQueryOptions(options, prefix2, "options"); - const p6 = this.#internalMatchAll(request3, options, 1); - if (p6.length === 0) { + const p2 = this.#internalMatchAll(request2, options, 1); + if (p2.length === 0) { return; } - return p6[0]; + return p2[0]; } - async matchAll(request3 = void 0, options = {}) { + async matchAll(request2 = void 0, options = {}) { webidl.brandCheck(this, _Cache); const prefix2 = "Cache.matchAll"; - if (request3 !== void 0) request3 = webidl.converters.RequestInfo(request3, prefix2, "request"); + if (request2 !== void 0) request2 = webidl.converters.RequestInfo(request2, prefix2, "request"); options = webidl.converters.CacheQueryOptions(options, prefix2, "options"); - return this.#internalMatchAll(request3, options); + return this.#internalMatchAll(request2, options); } - async add(request3) { + async add(request2) { webidl.brandCheck(this, _Cache); const prefix2 = "Cache.add"; webidl.argumentLengthCheck(arguments, 1, prefix2); - request3 = webidl.converters.RequestInfo(request3, prefix2, "request"); - const requests = [request3]; + request2 = webidl.converters.RequestInfo(request2, prefix2, "request"); + const requests = [request2]; const responseArrayPromise = this.addAll(requests); return await responseArrayPromise; } @@ -15228,19 +15228,19 @@ var require_cache = __commonJS({ webidl.argumentLengthCheck(arguments, 1, prefix2); const responsePromises = []; const requestList = []; - for (let request3 of requests) { - if (request3 === void 0) { + for (let request2 of requests) { + if (request2 === void 0) { throw webidl.errors.conversionFailed({ prefix: prefix2, argument: "Argument 1", types: ["undefined is not allowed"] }); } - request3 = webidl.converters.RequestInfo(request3); - if (typeof request3 === "string") { + request2 = webidl.converters.RequestInfo(request2); + if (typeof request2 === "string") { continue; } - const r6 = request3[kState]; + const r6 = request2[kState]; if (!urlIsHttpHttpsScheme(r6.url) || r6.method !== "GET") { throw webidl.errors.exception({ header: prefix2, @@ -15249,8 +15249,8 @@ var require_cache = __commonJS({ } } const fetchControllers = []; - for (const request3 of requests) { - const r6 = new Request3(request3)[kState]; + for (const request2 of requests) { + const r6 = new Request2(request2)[kState]; if (!urlIsHttpHttpsScheme(r6.url)) { throw webidl.errors.exception({ header: prefix2, @@ -15295,8 +15295,8 @@ var require_cache = __commonJS({ })); responsePromises.push(responsePromise.promise); } - const p6 = Promise.all(responsePromises); - const responses = await p6; + const p2 = Promise.all(responsePromises); + const responses = await p2; const operations = []; let index2 = 0; for (const response of responses) { @@ -15327,17 +15327,17 @@ var require_cache = __commonJS({ }); return cacheJobPromise.promise; } - async put(request3, response) { + async put(request2, response) { webidl.brandCheck(this, _Cache); const prefix2 = "Cache.put"; webidl.argumentLengthCheck(arguments, 2, prefix2); - request3 = webidl.converters.RequestInfo(request3, prefix2, "request"); + request2 = webidl.converters.RequestInfo(request2, prefix2, "request"); response = webidl.converters.Response(response, prefix2, "response"); let innerRequest = null; - if (request3 instanceof Request3) { - innerRequest = request3[kState]; + if (request2 instanceof Request2) { + innerRequest = request2[kState]; } else { - innerRequest = new Request3(request3)[kState]; + innerRequest = new Request2(request2)[kState]; } if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== "GET") { throw webidl.errors.exception({ @@ -15408,21 +15408,21 @@ var require_cache = __commonJS({ }); return cacheJobPromise.promise; } - async delete(request3, options = {}) { + async delete(request2, options = {}) { webidl.brandCheck(this, _Cache); const prefix2 = "Cache.delete"; webidl.argumentLengthCheck(arguments, 1, prefix2); - request3 = webidl.converters.RequestInfo(request3, prefix2, "request"); + request2 = webidl.converters.RequestInfo(request2, prefix2, "request"); options = webidl.converters.CacheQueryOptions(options, prefix2, "options"); let r6 = null; - if (request3 instanceof Request3) { - r6 = request3[kState]; + if (request2 instanceof Request2) { + r6 = request2[kState]; if (r6.method !== "GET" && !options.ignoreMethod) { return false; } } else { - assert2(typeof request3 === "string"); - r6 = new Request3(request3)[kState]; + assert2(typeof request2 === "string"); + r6 = new Request2(request2)[kState]; } const operations = []; const operation2 = { @@ -15454,25 +15454,25 @@ var require_cache = __commonJS({ * @param {import('../../types/cache').CacheQueryOptions} options * @returns {Promise} */ - async keys(request3 = void 0, options = {}) { + async keys(request2 = void 0, options = {}) { webidl.brandCheck(this, _Cache); const prefix2 = "Cache.keys"; - if (request3 !== void 0) request3 = webidl.converters.RequestInfo(request3, prefix2, "request"); + if (request2 !== void 0) request2 = webidl.converters.RequestInfo(request2, prefix2, "request"); options = webidl.converters.CacheQueryOptions(options, prefix2, "options"); let r6 = null; - if (request3 !== void 0) { - if (request3 instanceof Request3) { - r6 = request3[kState]; + if (request2 !== void 0) { + if (request2 instanceof Request2) { + r6 = request2[kState]; if (r6.method !== "GET" && !options.ignoreMethod) { return []; } - } else if (typeof request3 === "string") { - r6 = new Request3(request3)[kState]; + } else if (typeof request2 === "string") { + r6 = new Request2(request2)[kState]; } } const promise = createDeferredPromise(); const requests = []; - if (request3 === void 0) { + if (request2 === void 0) { for (const requestResponse of this.#relevantRequestResponseList) { requests.push(requestResponse[0]); } @@ -15484,9 +15484,9 @@ var require_cache = __commonJS({ } queueMicrotask(() => { const requestList = []; - for (const request4 of requests) { + for (const request3 of requests) { const requestObject = fromInnerRequest( - request4, + request3, new AbortController().signal, "immutable" ); @@ -15604,9 +15604,9 @@ var require_cache = __commonJS({ * @param {import('../../types/cache').CacheQueryOptions | undefined} options * @returns {boolean} */ - #requestMatchesCachedItem(requestQuery, request3, response = null, options) { + #requestMatchesCachedItem(requestQuery, request2, response = null, options) { const queryURL = new URL(requestQuery.url); - const cachedURL = new URL(request3.url); + const cachedURL = new URL(request2.url); if (options?.ignoreSearch) { cachedURL.search = ""; queryURL.search = ""; @@ -15622,7 +15622,7 @@ var require_cache = __commonJS({ if (fieldValue === "*") { return false; } - const requestValue = request3.headersList.get(fieldValue); + const requestValue = request2.headersList.get(fieldValue); const queryValue = requestQuery.headersList.get(fieldValue); if (requestValue !== queryValue) { return false; @@ -15630,20 +15630,20 @@ var require_cache = __commonJS({ } return true; } - #internalMatchAll(request3, options, maxResponses = Infinity) { + #internalMatchAll(request2, options, maxResponses = Infinity) { let r6 = null; - if (request3 !== void 0) { - if (request3 instanceof Request3) { - r6 = request3[kState]; + if (request2 !== void 0) { + if (request2 instanceof Request2) { + r6 = request2[kState]; if (r6.method !== "GET" && !options.ignoreMethod) { return []; } - } else if (typeof request3 === "string") { - r6 = new Request3(request3)[kState]; + } else if (typeof request2 === "string") { + r6 = new Request2(request2)[kState]; } } const responses = []; - if (request3 === void 0) { + if (request2 === void 0) { for (const requestResponse of this.#relevantRequestResponseList) { responses.push(requestResponse[1]); } @@ -15702,7 +15702,7 @@ var require_cache = __commonJS({ converter: webidl.converters.DOMString } ]); - webidl.converters.Response = webidl.interfaceConverter(Response2); + webidl.converters.Response = webidl.interfaceConverter(Response3); webidl.converters["sequence"] = webidl.sequenceConverter( webidl.converters.RequestInfo ); @@ -15732,21 +15732,21 @@ var require_cachestorage = __commonJS({ } webidl.util.markAsUncloneable(this); } - async match(request3, options = {}) { + async match(request2, options = {}) { webidl.brandCheck(this, _CacheStorage); webidl.argumentLengthCheck(arguments, 1, "CacheStorage.match"); - request3 = webidl.converters.RequestInfo(request3); + request2 = webidl.converters.RequestInfo(request2); options = webidl.converters.MultiCacheQueryOptions(options); if (options.cacheName != null) { if (this.#caches.has(options.cacheName)) { const cacheList = this.#caches.get(options.cacheName); const cache6 = new Cache(kConstruct, cacheList); - return await cache6.match(request3, options); + return await cache6.match(request2, options); } } else { for (const cacheList of this.#caches.values()) { const cache6 = new Cache(kConstruct, cacheList); - const response = await cache6.match(request3, options); + const response = await cache6.match(request2, options); if (response !== void 0) { return response; } @@ -16793,13 +16793,13 @@ var require_frame = __commonJS({ "use strict"; var { maxUnsigned16Bit } = require_constants5(); var BUFFER_SIZE = 16386; - var crypto6; + var crypto5; var buffer2 = null; var bufIdx = BUFFER_SIZE; try { - crypto6 = __require("crypto"); + crypto5 = __require("crypto"); } catch { - crypto6 = { + crypto5 = { // not full compatibility, but minimum. randomFillSync: function randomFillSync(buffer3, _offset, _size) { for (let i6 = 0; i6 < buffer3.length; ++i6) { @@ -16812,7 +16812,7 @@ var require_frame = __commonJS({ function generateMask() { if (bufIdx === BUFFER_SIZE) { bufIdx = 0; - crypto6.randomFillSync(buffer2 ??= Buffer.allocUnsafe(BUFFER_SIZE), 0, BUFFER_SIZE); + crypto5.randomFillSync(buffer2 ??= Buffer.allocUnsafe(BUFFER_SIZE), 0, BUFFER_SIZE); } return [buffer2[bufIdx++], buffer2[bufIdx++], buffer2[bufIdx++], buffer2[bufIdx++]]; } @@ -16884,15 +16884,15 @@ var require_connection = __commonJS({ var { Headers: Headers4, getHeadersList } = require_headers(); var { getDecodeSplit } = require_util2(); var { WebsocketFrameSend } = require_frame(); - var crypto6; + var crypto5; try { - crypto6 = __require("crypto"); + crypto5 = __require("crypto"); } catch { } function establishWebSocketConnection(url2, protocols, client2, ws2, onEstablish, options) { const requestURL = url2; requestURL.protocol = url2.protocol === "ws:" ? "http:" : "https:"; - const request3 = makeRequest({ + const request2 = makeRequest({ urlList: [requestURL], client: client2, serviceWorkers: "none", @@ -16904,18 +16904,18 @@ var require_connection = __commonJS({ }); if (options.headers) { const headersList = getHeadersList(new Headers4(options.headers)); - request3.headersList = headersList; + request2.headersList = headersList; } - const keyValue = crypto6.randomBytes(16).toString("base64"); - request3.headersList.append("sec-websocket-key", keyValue); - request3.headersList.append("sec-websocket-version", "13"); + const keyValue = crypto5.randomBytes(16).toString("base64"); + request2.headersList.append("sec-websocket-key", keyValue); + request2.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { - request3.headersList.append("sec-websocket-protocol", protocol); + request2.headersList.append("sec-websocket-protocol", protocol); } const permessageDeflate = "permessage-deflate; client_max_window_bits"; - request3.headersList.append("sec-websocket-extensions", permessageDeflate); + request2.headersList.append("sec-websocket-extensions", permessageDeflate); const controller = fetching({ - request: request3, + request: request2, useParallelQueue: true, dispatcher: options.dispatcher, processResponse(response) { @@ -16936,7 +16936,7 @@ var require_connection = __commonJS({ return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto6.createHash("sha1").update(keyValue + uid).digest("base64"); + const digest = crypto5.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws2, "Incorrect hash received in Sec-WebSocket-Accept header."); return; @@ -16952,7 +16952,7 @@ var require_connection = __commonJS({ } const secProtocol = response.headersList.get("Sec-WebSocket-Protocol"); if (secProtocol !== null) { - const requestProtocols = getDecodeSplit("sec-websocket-protocol", request3.headersList); + const requestProtocols = getDecodeSplit("sec-websocket-protocol", request2.headersList); if (!requestProtocols.includes(secProtocol)) { failWebsocketConnection(ws2, "Protocol was not set in the opening handshake."); return; @@ -17134,7 +17134,7 @@ var require_permessage_deflate = __commonJS({ var require_receiver = __commonJS({ "node_modules/undici/lib/web/websocket/receiver.js"(exports2, module) { "use strict"; - var { Writable: Writable2 } = __require("stream"); + var { Writable: Writable3 } = __require("stream"); var assert2 = __require("assert"); var { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require_constants5(); var { kReadyState, kSentClose, kResponse, kReceivedClose } = require_symbols5(); @@ -17153,7 +17153,7 @@ var require_receiver = __commonJS({ var { closeWebSocketConnection } = require_connection(); var { PerMessageDeflate } = require_permessage_deflate(); var { MessageSizeExceededError } = require_errors(); - var ByteParser = class extends Writable2 { + var ByteParser = class extends Writable3 { #buffers = []; #fragmentsBytes = 0; #byteOffset = 0; @@ -17354,34 +17354,34 @@ var require_receiver = __commonJS({ * @param {number} n * @returns {Buffer} */ - consume(n12) { - if (n12 > this.#byteOffset) { + consume(n8) { + if (n8 > this.#byteOffset) { throw new Error("Called consume() before buffers satiated."); - } else if (n12 === 0) { + } else if (n8 === 0) { return emptyBuffer; } - if (this.#buffers[0].length === n12) { + if (this.#buffers[0].length === n8) { this.#byteOffset -= this.#buffers[0].length; return this.#buffers.shift(); } - const buffer2 = Buffer.allocUnsafe(n12); + const buffer2 = Buffer.allocUnsafe(n8); let offset = 0; - while (offset !== n12) { + while (offset !== n8) { const next = this.#buffers[0]; const { length } = next; - if (length + offset === n12) { + if (length + offset === n8) { buffer2.set(this.#buffers.shift(), offset); break; - } else if (length + offset > n12) { - buffer2.set(next.subarray(0, n12 - offset), offset); - this.#buffers[0] = next.subarray(n12 - offset); + } else if (length + offset > n8) { + buffer2.set(next.subarray(0, n8 - offset), offset); + this.#buffers[0] = next.subarray(n8 - offset); break; } else { buffer2.set(this.#buffers.shift(), offset); offset += next.length; } } - this.#byteOffset -= n12; + this.#byteOffset -= n8; return buffer2; } writeFragments(fragment) { @@ -17646,10 +17646,10 @@ var require_websocket = __commonJS({ if (typeof protocols === "string") { protocols = [protocols]; } - if (protocols.length !== new Set(protocols.map((p6) => p6.toLowerCase())).size) { + if (protocols.length !== new Set(protocols.map((p2) => p2.toLowerCase())).size) { throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError"); } - if (protocols.length > 0 && !protocols.every((p6) => isValidSubprotocol(p6))) { + if (protocols.length > 0 && !protocols.every((p2) => isValidSubprotocol(p2))) { throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError"); } this[kWebSocketURL] = new URL(urlRecord.href); @@ -17837,13 +17837,13 @@ var require_websocket = __commonJS({ #onConnectionEstablished(response, parsedExtensions) { this[kResponse] = response; const maxPayloadSize = this[kController]?.dispatcher?.webSocketOptions?.maxPayloadSize; - const parser2 = new ByteParser(this, parsedExtensions, { + const parser3 = new ByteParser(this, parsedExtensions, { maxPayloadSize }); - parser2.on("drain", onParserDrain); - parser2.on("error", onParserError.bind(this)); + parser3.on("drain", onParserDrain); + parser3.on("error", onParserError.bind(this)); response.socket.ws = this; - this[kByteParser] = parser2; + this[kByteParser] = parser3; this.#sendQueue = new SendQueue(response.socket); this[kReadyState] = states.OPEN; const extensions = response.headersList.get("sec-websocket-extensions"); @@ -17969,8 +17969,8 @@ var require_util8 = __commonJS({ return true; } function delay4(ms2) { - return new Promise((resolve4) => { - setTimeout(resolve4, ms2).unref(); + return new Promise((resolve8) => { + setTimeout(resolve8, ms2).unref(); }); } module.exports = { @@ -18672,7 +18672,7 @@ var require_proxy = __commonJS({ if (proxyVar) { try { return new DecodedURL2(proxyVar); - } catch (_a5) { + } catch (_a6) { if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) return new DecodedURL2(`http://${proxyVar}`); } @@ -18704,8 +18704,8 @@ var require_proxy = __commonJS({ if (typeof reqPort === "number") { upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - for (const upperNoProxyItem of noProxy.split(",").map((x6) => x6.trim().toUpperCase()).filter((x6) => x6)) { - if (upperNoProxyItem === "*" || upperReqHosts.some((x6) => x6 === upperNoProxyItem || x6.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x6.endsWith(`${upperNoProxyItem}`))) { + for (const upperNoProxyItem of noProxy.split(",").map((x2) => x2.trim().toUpperCase()).filter((x2) => x2)) { + if (upperNoProxyItem === "*" || upperReqHosts.some((x2) => x2 === upperNoProxyItem || x2.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x2.endsWith(`${upperNoProxyItem}`))) { return true; } } @@ -18735,32 +18735,32 @@ var require_proxy = __commonJS({ var require_lib = __commonJS({ "node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { + var desc = Object.getOwnPropertyDescriptor(m3, k7); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { - return m6[k7]; + return m3[k7]; } }; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { + Object.defineProperty(o2, k22, desc); + }) : (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; + o2[k22] = m3[k7]; })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + }) : function(o2, v2) { + o2["default"] = v2; }); var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o6) { - ownKeys = Object.getOwnPropertyNames || function(o7) { + var ownKeys = function(o2) { + ownKeys = Object.getOwnPropertyNames || function(o3) { var ar = []; - for (var k7 in o7) if (Object.prototype.hasOwnProperty.call(o7, k7)) ar[ar.length] = k7; + for (var k7 in o3) if (Object.prototype.hasOwnProperty.call(o3, k7)) ar[ar.length] = k7; return ar; }; - return ownKeys(o6); + return ownKeys(o2); }; return function(mod) { if (mod && mod.__esModule) return mod; @@ -18774,11 +18774,11 @@ var require_lib = __commonJS({ })(); var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -18794,7 +18794,7 @@ var require_lib = __commonJS({ } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -18881,26 +18881,26 @@ var require_lib = __commonJS({ } readBody() { return __awaiter16(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter16(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter16(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", () => { - resolve4(output.toString()); + resolve8(output.toString()); }); })); }); } readBodyBuffer() { return __awaiter16(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter16(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter16(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); }); this.message.on("end", () => { - resolve4(Buffer.concat(chunks)); + resolve8(Buffer.concat(chunks)); }); })); }); @@ -19108,14 +19108,14 @@ var require_lib = __commonJS({ */ requestRaw(info2, data) { return __awaiter16(this, void 0, void 0, function* () { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { function callbackForResult(err, res) { if (err) { reject2(err); } else if (!res) { reject2(new Error("Unknown error")); } else { - resolve4(res); + resolve8(res); } } this.requestRawWithCallback(info2, data, callbackForResult); @@ -19359,12 +19359,12 @@ var require_lib = __commonJS({ return __awaiter16(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling2, retryNumber); const ms2 = ExponentialBackoffTimeSlice2 * Math.pow(2, retryNumber); - return new Promise((resolve4) => setTimeout(() => resolve4(), ms2)); + return new Promise((resolve8) => setTimeout(() => resolve8(), ms2)); }); } _processResponse(res, options) { return __awaiter16(this, void 0, void 0, function* () { - return new Promise((resolve4, reject2) => __awaiter16(this, void 0, void 0, function* () { + return new Promise((resolve8, reject2) => __awaiter16(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -19372,7 +19372,7 @@ var require_lib = __commonJS({ headers: {} }; if (statusCode === HttpCodes2.NotFound) { - resolve4(response); + resolve8(response); } function dateTimeDeserializer(key, value) { if (typeof value === "string") { @@ -19411,7 +19411,7 @@ var require_lib = __commonJS({ err.result = response.result; reject2(err); } else { - resolve4(response); + resolve8(response); } })); }); @@ -19829,7 +19829,7 @@ function parse(options) { if (!isBinaryRequest) { if (options.mediaType.format) { headers.accept = headers.accept.split(/,/).map( - (format2) => format2.replace( + (format4) => format4.replace( /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}` ) @@ -19839,8 +19839,8 @@ function parse(options) { if (options.mediaType.previews?.length) { const previewsFromAcceptHeader = headers.accept.match(/(? { - const format2 = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; - return `application/vnd.github.${preview}-preview${format2}`; + const format4 = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; + return `application/vnd.github.${preview}-preview${format4}`; }).join(","); } } @@ -19933,7 +19933,7 @@ var require_fast_content_type_parse = __commonJS({ var defaultContentType = { type: "", parameters: new NullObject() }; Object.freeze(defaultContentType.parameters); Object.freeze(defaultContentType); - function parse4(header) { + function parse3(header) { if (typeof header !== "string") { throw new TypeError("argument header is required and must be a string"); } @@ -20009,8 +20009,8 @@ var require_fast_content_type_parse = __commonJS({ } return result; } - module.exports.default = { parse: parse4, safeParse: safeParse2 }; - module.exports.parse = parse4; + module.exports.default = { parse: parse3, safeParse: safeParse2 }; + module.exports.parse = parse3; module.exports.safeParse = safeParse2; module.exports.defaultContentType = defaultContentType; } @@ -20312,7 +20312,7 @@ function toErrorMessage(data) { } if ("message" in data) { const suffix = "documentation_url" in data ? ` - ${data.documentation_url}` : ""; - return Array.isArray(data.errors) ? `${data.message}: ${data.errors.map((v8) => JSON.stringify(v8)).join(", ")}${suffix}` : `${data.message}${suffix}`; + return Array.isArray(data.errors) ? `${data.message}: ${data.errors.map((v2) => JSON.stringify(v2)).join(", ")}${suffix}` : `${data.message}${suffix}`; } return `Unknown error: ${JSON.stringify(data)}`; } @@ -20323,16 +20323,16 @@ function withDefaults2(oldEndpoint, newDefaults) { if (!endpointOptions.request || !endpointOptions.request.hook) { return fetchWrapper(endpoint2.parse(endpointOptions)); } - const request22 = (route2, parameters2) => { + const request2 = (route2, parameters2) => { return fetchWrapper( endpoint2.parse(endpoint2.merge(route2, parameters2)) ); }; - Object.assign(request22, { + Object.assign(request2, { endpoint: endpoint2, defaults: withDefaults2.bind(null, endpoint2) }); - return endpointOptions.request.hook(request22, endpointOptions); + return endpointOptions.request.hook(request2, endpointOptions); }; return Object.assign(newApi, { endpoint: endpoint2, @@ -20380,7 +20380,7 @@ function _buildMessageForResponseErrors(data) { return `Request failed due to following response errors: ` + data.errors.map((e6) => ` - ${e6.message}`).join("\n"); } -function graphql(request22, query, options) { +function graphql(request2, query, options) { if (options) { if (typeof query === "string" && "query" in options) { return Promise.reject( @@ -20410,11 +20410,11 @@ function graphql(request22, query, options) { result.variables[key] = parsedOptions[key]; return result; }, {}); - const baseUrl2 = parsedOptions.baseUrl || request22.endpoint.DEFAULTS.baseUrl; + const baseUrl2 = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl; if (GHES_V3_SUFFIX_REGEX.test(baseUrl2)) { requestOptions.url = baseUrl2.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); } - return request22(requestOptions).then((response) => { + return request2(requestOptions).then((response) => { if (response.data.errors) { const headers = {}; for (const key of Object.keys(response.headers)) { @@ -20429,8 +20429,8 @@ function graphql(request22, query, options) { return response.data.data; }); } -function withDefaults3(request22, newDefaults) { - const newRequest = request22.defaults(newDefaults); +function withDefaults3(request2, newDefaults) { + const newRequest = request2.defaults(newDefaults); const newApi = (query, options) => { return graphql(newRequest, query, options); }; @@ -20453,9 +20453,9 @@ var init_dist_bundle3 = __esm({ init_universal_user_agent4(); VERSION3 = "0.0.0-development"; GraphqlResponseError = class extends Error { - constructor(request22, headers, response) { + constructor(request2, headers, response) { super(_buildMessageForResponseErrors(response)); - this.request = request22; + this.request = request2; this.headers = headers; this.response = response; this.errors = response.errors; @@ -20508,13 +20508,13 @@ function withAuthorizationPrefix(token) { } return `token ${token}`; } -async function hook(token, request3, route, parameters) { - const endpoint2 = request3.endpoint.merge( +async function hook(token, request2, route, parameters) { + const endpoint2 = request2.endpoint.merge( route, parameters ); endpoint2.headers.authorization = withAuthorizationPrefix(token); - return request3(endpoint2); + return request2(endpoint2); } var b64url, sep, jwtRE, isJWT, createTokenAuth; var init_dist_bundle4 = __esm({ @@ -23290,12 +23290,12 @@ var init_version3 = __esm({ // node_modules/@octokit/plugin-request-log/dist-src/index.js function requestLog(octokit) { - octokit.hook.wrap("request", (request3, options) => { + octokit.hook.wrap("request", (request2, options) => { octokit.log.debug("request", options); const start = Date.now(); const requestOptions = octokit.request.endpoint.parse(options); const path10 = requestOptions.url.replace(options.baseUrl, ""); - return request3(options).then((response) => { + return request2(options).then((response) => { const requestId2 = response.headers["x-github-request-id"]; octokit.log.info( `${requestOptions.method} ${path10} - ${response.status} with id ${requestId2} in ${Date.now() - start}ms` @@ -23358,28 +23358,28 @@ var require_light = __commonJS({ })(exports2, (function() { "use strict"; var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; - function getCjsExportFromNamespace(n12) { - return n12 && n12["default"] || n12; + function getCjsExportFromNamespace(n8) { + return n8 && n8["default"] || n8; } var load = function(received, defaults4, onto = {}) { - var k7, ref, v8; + var k7, ref, v2; for (k7 in defaults4) { - v8 = defaults4[k7]; - onto[k7] = (ref = received[k7]) != null ? ref : v8; + v2 = defaults4[k7]; + onto[k7] = (ref = received[k7]) != null ? ref : v2; } return onto; }; var overwrite = function(received, defaults4, onto = {}) { - var k7, v8; + var k7, v2; for (k7 in received) { - v8 = received[k7]; + v2 = received[k7]; if (defaults4[k7] !== void 0) { - onto[k7] = v8; + onto[k7] = v2; } } return onto; }; - var parser2 = { + var parser3 = { load, overwrite }; @@ -23538,8 +23538,8 @@ var require_light = __commonJS({ return null; } }); - return (await Promise.all(promises4)).find(function(x6) { - return x6 != null; + return (await Promise.all(promises4)).find(function(x2) { + return x2 != null; }); } catch (error2) { e6 = error2; @@ -23619,7 +23619,7 @@ var require_light = __commonJS({ var BottleneckError$1, DEFAULT_PRIORITY, Job, NUM_PRIORITIES, parser$1; NUM_PRIORITIES = 10; DEFAULT_PRIORITY = 5; - parser$1 = parser2; + parser$1 = parser3; BottleneckError$1 = BottleneckError_1; Job = class Job { constructor(task, args, options, jobDefaults, rejectOnDrop, Events2, _states, Promise2) { @@ -23748,7 +23748,7 @@ var require_light = __commonJS({ }; var Job_1 = Job; var BottleneckError$2, LocalDatastore, parser$2; - parser$2 = parser2; + parser$2 = parser3; BottleneckError$2 = BottleneckError_1; LocalDatastore = class LocalDatastore { constructor(instance, storeOptions, storeInstanceOptions) { @@ -23802,9 +23802,9 @@ var require_light = __commonJS({ clearInterval(this.heartbeat); return this.Promise.resolve(); } - yieldLoop(t6 = 0) { - return new this.Promise(function(resolve4, reject2) { - return setTimeout(resolve4, t6); + yieldLoop(t = 0) { + return new this.Promise(function(resolve8, reject2) { + return setTimeout(resolve8, t); }); } computePenalty() { @@ -23974,7 +23974,7 @@ var require_light = __commonJS({ return (ref = this.status[this._jobs[id]]) != null ? ref : null; } statusJobs(status) { - var k7, pos, ref, results, v8; + var k7, pos, ref, results, v2; if (status != null) { pos = this.status.indexOf(status); if (pos < 0) { @@ -23983,8 +23983,8 @@ var require_light = __commonJS({ ref = this._jobs; results = []; for (k7 in ref) { - v8 = ref[k7]; - if (v8 === pos) { + v2 = ref[k7]; + if (v2 === pos) { results.push(k7); } } @@ -23994,8 +23994,8 @@ var require_light = __commonJS({ } } statusCounts() { - return this.counts.reduce(((acc, v8, i6) => { - acc[this.status[i6]] = v8; + return this.counts.reduce(((acc, v2, i6) => { + acc[this.status[i6]] = v2; return acc; }), {}); } @@ -24015,15 +24015,15 @@ var require_light = __commonJS({ return this._queue.length === 0; } async _tryToRun() { - var args, cb, error2, reject2, resolve4, returned, task; + var args, cb, error2, reject2, resolve8, returned, task; if (this._running < 1 && this._queue.length > 0) { this._running++; - ({ task, args, resolve: resolve4, reject: reject2 } = this._queue.shift()); + ({ task, args, resolve: resolve8, reject: reject2 } = this._queue.shift()); cb = await (async function() { try { returned = await task(...args); return function() { - return resolve4(returned); + return resolve8(returned); }; } catch (error1) { error2 = error1; @@ -24038,13 +24038,13 @@ var require_light = __commonJS({ } } schedule(task, ...args) { - var promise, reject2, resolve4; - resolve4 = reject2 = null; + var promise, reject2, resolve8; + resolve8 = reject2 = null; promise = new this.Promise(function(_resolve, _reject) { - resolve4 = _resolve; + resolve8 = _resolve; return reject2 = _reject; }); - this._queue.push({ task, args, resolve: resolve4, reject: reject2 }); + this._queue.push({ task, args, resolve: resolve8, reject: reject2 }); this._tryToRun(); return promise; } @@ -24062,7 +24062,7 @@ var require_light = __commonJS({ var require$$3 = () => console.log("You must import the full version of Bottleneck in order to use this feature."); var require$$4 = () => console.log("You must import the full version of Bottleneck in order to use this feature."); var Events$2, Group, IORedisConnection$1, RedisConnection$1, Scripts$1, parser$3; - parser$3 = parser2; + parser$3 = parser3; Events$2 = Events_1; RedisConnection$1 = require$$2; IORedisConnection$1 = require$$3; @@ -24112,14 +24112,14 @@ var require_light = __commonJS({ return instance != null || deleted > 0; } limiters() { - var k7, ref, results, v8; + var k7, ref, results, v2; ref = this.instances; results = []; for (k7 in ref) { - v8 = ref[k7]; + v2 = ref[k7]; results.push({ key: k7, - limiter: v8 + limiter: v2 }); } return results; @@ -24150,21 +24150,21 @@ var require_light = __commonJS({ var base; clearInterval(this.interval); return typeof (base = this.interval = setInterval(async () => { - var e6, k7, ref, results, time2, v8; + var e6, k7, ref, results, time2, v2; time2 = Date.now(); ref = this.instances; results = []; for (k7 in ref) { - v8 = ref[k7]; + v2 = ref[k7]; try { - if (await v8._store.__groupCheck__(time2)) { + if (await v2._store.__groupCheck__(time2)) { results.push(this.deleteKey(k7)); } else { results.push(void 0); } } catch (error2) { e6 = error2; - results.push(v8.Events.trigger("error", e6)); + results.push(v2.Events.trigger("error", e6)); } } return results; @@ -24194,7 +24194,7 @@ var require_light = __commonJS({ }).call(commonjsGlobal); var Group_1 = Group; var Batcher, Events$3, parser$4; - parser$4 = parser2; + parser$4 = parser3; Events$3 = Events_1; Batcher = (function() { class Batcher2 { @@ -24246,7 +24246,7 @@ var require_light = __commonJS({ var Bottleneck2, DEFAULT_PRIORITY$1, Events$4, Job$1, LocalDatastore$1, NUM_PRIORITIES$1, Queues$1, RedisDatastore$1, States$1, Sync$1, parser$5, splice = [].splice; NUM_PRIORITIES$1 = 10; DEFAULT_PRIORITY$1 = 5; - parser$5 = parser2; + parser$5 = parser3; Queues$1 = Queues_1; Job$1 = Job_1; LocalDatastore$1 = LocalDatastore_1; @@ -24445,14 +24445,14 @@ var require_light = __commonJS({ counts = this._states.counts; return counts[0] + counts[1] + counts[2] + counts[3] === at2; }; - return new this.Promise((resolve4, reject2) => { + return new this.Promise((resolve8, reject2) => { if (finished()) { - return resolve4(); + return resolve8(); } else { return this.on("done", () => { if (finished()) { this.removeAllListeners("done"); - return resolve4(); + return resolve8(); } }); } @@ -24466,14 +24466,14 @@ var require_light = __commonJS({ return this.Promise.resolve(null); }, this._registerLock.schedule(() => { return this._submitLock.schedule(() => { - var k7, ref, v8; + var k7, ref, v2; ref = this._scheduled; for (k7 in ref) { - v8 = ref[k7]; - if (this.jobStatus(v8.job.options.id) === "RUNNING") { - clearTimeout(v8.timeout); - clearTimeout(v8.expiration); - v8.job.doDrop({ + v2 = ref[k7]; + if (this.jobStatus(v2.job.options.id) === "RUNNING") { + clearTimeout(v2.timeout); + clearTimeout(v2.expiration); + v2.job.doDrop({ message: options.dropErrorMessage }); } @@ -24545,9 +24545,9 @@ var require_light = __commonJS({ options = parser$5.load(options, this.jobDefaults); } task = (...args2) => { - return new this.Promise(function(resolve4, reject2) { + return new this.Promise(function(resolve8, reject2) { return fn(...args2, function(...args3) { - return (args3[0] != null ? reject2 : resolve4)(args3); + return (args3[0] != null ? reject2 : resolve8)(args3); }); }); }; @@ -24689,7 +24689,7 @@ async function errorRequest(state4, octokit, error2, options) { } throw error2; } -async function wrapRequest(state4, octokit, request3, options) { +async function wrapRequest(state4, octokit, request2, options) { const limiter = new import_light.default(); limiter.on("failed", function(error2, info2) { const maxRetries = ~~error2.request.request?.retries; @@ -24700,12 +24700,12 @@ async function wrapRequest(state4, octokit, request3, options) { } }); return limiter.schedule( - requestWithGraphqlErrorHandling.bind(null, state4, octokit, request3), + requestWithGraphqlErrorHandling.bind(null, state4, octokit, request2), options ); } -async function requestWithGraphqlErrorHandling(state4, octokit, request3, options) { - const response = await request3(options); +async function requestWithGraphqlErrorHandling(state4, octokit, request2, options) { + const response = await request2(options); if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test( response.data.errors[0].message )) { @@ -25022,16 +25022,16 @@ var require_errors2 = __commonJS({ // Comment can be max 65535 bytes long (NOTE: some non-US characters may take more space) EXTRA_FIELD_PARSE_ERROR: "Extra field parsing error" }; - function E2(message) { + function E(message) { return function(...args) { if (args.length) { - message = message.replace(/\{(\d)\}/g, (_3, n12) => args[n12] || ""); + message = message.replace(/\{(\d)\}/g, (_3, n8) => args[n8] || ""); } return new Error("ADM-ZIP: " + message); }; } for (const msg of Object.keys(errors)) { - exports2[msg] = E2(errors[msg]); + exports2[msg] = E(errors[msg]); } } }); @@ -25046,7 +25046,7 @@ var require_utils2 = __commonJS({ var Errors = require_errors2(); var isWin = typeof process === "object" && "win32" === process.platform; var is_Obj = (obj) => typeof obj === "object" && obj !== null; - var crcTable = new Uint32Array(256).map((t6, c6) => { + var crcTable = new Uint32Array(256).map((t, c6) => { for (let k7 = 0; k7 < 8; k7++) { if ((c6 & 1) !== 0) { c6 = 3988292384 ^ c6 >>> 1; @@ -25260,8 +25260,8 @@ var require_utils2 = __commonJS({ Utils.sanitize = function(prefix2, name) { prefix2 = pth.resolve(pth.normalize(prefix2)); var parts = name.split("/"); - for (var i6 = 0, l6 = parts.length; i6 < l6; i6++) { - var path10 = pth.normalize(pth.join(prefix2, parts.slice(i6, l6).join(pth.sep))); + for (var i6 = 0, l3 = parts.length; i6 < l3; i6++) { + var path10 = pth.normalize(pth.join(prefix2, parts.slice(i6, l3).join(pth.sep))); if (path10.indexOf(prefix2) === 0) { return path10; } @@ -25842,7 +25842,7 @@ var require_zipcrypto = __commonJS({ "use strict"; var { randomFillSync } = __require("crypto"); var Errors = require_errors2(); - var crctable = new Uint32Array(256).map((t6, crc) => { + var crctable = new Uint32Array(256).map((t, crc) => { for (let j7 = 0; j7 < 8; j7++) { if (0 !== (crc & 1)) { crc = crc >>> 1 ^ 3988292384; @@ -26197,8 +26197,8 @@ var require_zipEntry = __commonJS({ if (_comment.length > 65535) throw Utils.Errors.COMMENT_TOO_LONG(); }, get name() { - var n12 = decoder.decode(_entryName); - return _isDirectory ? n12.substr(n12.length - 1).split("/").pop() : n12.split("/").pop(); + var n8 = decoder.decode(_entryName); + return _isDirectory ? n8.substr(n8.length - 1).split("/").pop() : n8.split("/").pop(); }, get isDirectory() { return _isDirectory; @@ -26359,20 +26359,20 @@ var require_zipFile = __commonJS({ makeTemporaryFolders(); } function readMainHeader(readNow) { - var i6 = inBuffer.length - Utils.Constants.ENDHDR, max = Math.max(0, i6 - 65535), n12 = max, endStart = inBuffer.length, endOffset = -1, commentEnd = 0; + var i6 = inBuffer.length - Utils.Constants.ENDHDR, max = Math.max(0, i6 - 65535), n8 = max, endStart = inBuffer.length, endOffset = -1, commentEnd = 0; const trailingSpace = typeof opts.trailingSpace === "boolean" ? opts.trailingSpace : false; if (trailingSpace) max = 0; - for (i6; i6 >= n12; i6--) { + for (i6; i6 >= n8; i6--) { if (inBuffer[i6] !== 80) continue; if (inBuffer.readUInt32LE(i6) === Utils.Constants.ENDSIG) { endOffset = i6; commentEnd = i6; endStart = i6 + Utils.Constants.ENDHDR; - n12 = i6 - Utils.Constants.END64HDR; + n8 = i6 - Utils.Constants.END64HDR; continue; } if (inBuffer.readUInt32LE(i6) === Utils.Constants.END64SIG) { - n12 = max; + n8 = max; continue; } if (inBuffer.readUInt32LE(i6) === Utils.Constants.ZIP64SIG) { @@ -26705,8 +26705,8 @@ var require_adm_zip = __commonJS({ return null; } function fixPath(zipPath) { - const { join: join10, normalize: normalize4, sep: sep7 } = pth.posix; - return join10(pth.isAbsolute(zipPath) ? "/" : ".", normalize4(sep7 + zipPath.split("\\").join(sep7) + sep7)); + const { join: join11, normalize: normalize5, sep: sep7 } = pth.posix; + return join11(pth.isAbsolute(zipPath) ? "/" : ".", normalize5(sep7 + zipPath.split("\\").join(sep7) + sep7)); } function filenameFilter(filterfn) { if (filterfn instanceof RegExp) { @@ -26894,8 +26894,8 @@ var require_adm_zip = __commonJS({ addLocalFile: function(localPath2, zipPath, zipName, comment) { if (filetools.fs.existsSync(localPath2)) { zipPath = zipPath ? fixPath(zipPath) : ""; - const p6 = pth.win32.basename(pth.win32.normalize(localPath2)); - zipPath += zipName ? zipName : p6; + const p2 = pth.win32.basename(pth.win32.normalize(localPath2)); + zipPath += zipName ? zipName : p2; const _attr = filetools.fs.statSync(localPath2); const data = _attr.isFile() ? filetools.fs.readFileSync(localPath2) : Buffer.alloc(0); if (_attr.isDirectory()) zipPath += filetools.sep; @@ -26930,8 +26930,8 @@ var require_adm_zip = __commonJS({ filetools.fs.stat(localPath2, function(err, stats) { if (err) return callback(err, false); zipPath = zipPath ? fixPath(zipPath) : ""; - const p6 = pth.win32.basename(pth.win32.normalize(localPath2)); - zipPath += zipName ? zipName : p6; + const p2 = pth.win32.basename(pth.win32.normalize(localPath2)); + zipPath += zipName ? zipName : p2; if (stats.isFile()) { filetools.fs.readFile(localPath2, function(err2, data) { if (err2) return callback(err2, false); @@ -26961,9 +26961,9 @@ var require_adm_zip = __commonJS({ const self2 = this; if (items.length) { for (const filepath of items) { - const p6 = pth.join(zipPath, relativePath(localPath2, filepath)); - if (filter4(p6)) { - self2.addLocalFile(filepath, pth.dirname(p6)); + const p2 = pth.join(zipPath, relativePath(localPath2, filepath)); + if (filter4(p2)) { + self2.addLocalFile(filepath, pth.dirname(p2)); } } } @@ -26996,9 +26996,9 @@ var require_adm_zip = __commonJS({ i6 += 1; if (i6 < items.length) { var filepath = items[i6]; - var p6 = relativePath(localPath2, filepath).split("\\").join("/"); - p6 = p6.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^\x20-\x7E]/g, ""); - if (filter4(p6)) { + var p2 = relativePath(localPath2, filepath).split("\\").join("/"); + p2 = p2.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^\x20-\x7E]/g, ""); + if (filter4(p2)) { filetools.fs.stat(filepath, function(er0, stats) { if (er0) callback(void 0, er0); if (stats.isFile()) { @@ -27006,12 +27006,12 @@ var require_adm_zip = __commonJS({ if (er1) { callback(void 0, er1); } else { - self2.addFile(zipPath + p6, data, "", stats); + self2.addFile(zipPath + p2, data, "", stats); next(); } }); } else { - self2.addFile(zipPath + p6 + "/", Buffer.alloc(0), "", stats); + self2.addFile(zipPath + p2 + "/", Buffer.alloc(0), "", stats); next(); } }); @@ -27101,10 +27101,10 @@ var require_adm_zip = __commonJS({ * @param {function|string} [props.namefix] - optional function to help fix filename */ addLocalFolderPromise: function(localPath2, props) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { this.addLocalFolderAsync2(Object.assign({ localPath: localPath2 }, props), (err, done) => { if (err) reject2(err); - if (done) resolve4(this); + if (done) resolve8(this); }); }); }, @@ -27291,12 +27291,12 @@ var require_adm_zip = __commonJS({ keepOriginalPermission = get_Bool(false, keepOriginalPermission); overwrite = get_Bool(false, overwrite); if (!callback) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { this.extractAllToAsync(targetPath, overwrite, keepOriginalPermission, function(err) { if (err) { reject2(err); } else { - resolve4(this); + resolve8(this); } }); }); @@ -27394,11 +27394,11 @@ var require_adm_zip = __commonJS({ */ writeZipPromise: function(targetFileName, props) { const { overwrite, perm } = Object.assign({ overwrite: true }, props); - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { if (!targetFileName && opts.filename) targetFileName = opts.filename; if (!targetFileName) reject2("ADM-ZIP: ZIP File Name Missing"); this.toBufferPromise().then((zipData) => { - const ret = (done) => done ? resolve4(done) : reject2("ADM-ZIP: Wasn't able to write zip file"); + const ret = (done) => done ? resolve8(done) : reject2("ADM-ZIP: Wasn't able to write zip file"); filetools.writeFileToAsync(targetFileName, zipData, overwrite, perm, ret); }, reject2); }); @@ -27407,8 +27407,8 @@ var require_adm_zip = __commonJS({ * @returns {Promise} A promise to the Buffer. */ toBufferPromise: function() { - return new Promise((resolve4, reject2) => { - _zip.toAsyncBuffer(resolve4, reject2); + return new Promise((resolve8, reject2) => { + _zip.toAsyncBuffer(resolve8, reject2); }); }, /** @@ -27527,17 +27527,17 @@ var require_package_version = __commonJS({ var require_ms = __commonJS({ "node_modules/ms/index.js"(exports2, module) { "use strict"; - var s6 = 1e3; - var m6 = s6 * 60; - var h6 = m6 * 60; + var s = 1e3; + var m3 = s * 60; + var h6 = m3 * 60; var d6 = h6 * 24; - var w5 = d6 * 7; - var y2 = d6 * 365.25; + var w = d6 * 7; + var y = d6 * 365.25; module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === "string" && val.length > 0) { - return parse4(val); + return parse3(val); } else if (type === "number" && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } @@ -27545,7 +27545,7 @@ var require_ms = __commonJS({ "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) ); }; - function parse4(str) { + function parse3(str) { str = String(str); if (str.length > 100) { return; @@ -27556,7 +27556,7 @@ var require_ms = __commonJS({ if (!match3) { return; } - var n12 = parseFloat(match3[1]); + var n8 = parseFloat(match3[1]); var type = (match3[2] || "ms").toLowerCase(); switch (type) { case "years": @@ -27564,39 +27564,39 @@ var require_ms = __commonJS({ case "yrs": case "yr": case "y": - return n12 * y2; + return n8 * y; case "weeks": case "week": case "w": - return n12 * w5; + return n8 * w; case "days": case "day": case "d": - return n12 * d6; + return n8 * d6; case "hours": case "hour": case "hrs": case "hr": case "h": - return n12 * h6; + return n8 * h6; case "minutes": case "minute": case "mins": case "min": case "m": - return n12 * m6; + return n8 * m3; case "seconds": case "second": case "secs": case "sec": case "s": - return n12 * s6; + return n8 * s; case "milliseconds": case "millisecond": case "msecs": case "msec": case "ms": - return n12; + return n8; default: return void 0; } @@ -27609,11 +27609,11 @@ var require_ms = __commonJS({ if (msAbs >= h6) { return Math.round(ms2 / h6) + "h"; } - if (msAbs >= m6) { - return Math.round(ms2 / m6) + "m"; + if (msAbs >= m3) { + return Math.round(ms2 / m3) + "m"; } - if (msAbs >= s6) { - return Math.round(ms2 / s6) + "s"; + if (msAbs >= s) { + return Math.round(ms2 / s) + "s"; } return ms2 + "ms"; } @@ -27625,17 +27625,17 @@ var require_ms = __commonJS({ if (msAbs >= h6) { return plural(ms2, msAbs, h6, "hour"); } - if (msAbs >= m6) { - return plural(ms2, msAbs, m6, "minute"); + if (msAbs >= m3) { + return plural(ms2, msAbs, m3, "minute"); } - if (msAbs >= s6) { - return plural(ms2, msAbs, s6, "second"); + if (msAbs >= s) { + return plural(ms2, msAbs, s, "second"); } return ms2 + " ms"; } - function plural(ms2, msAbs, n12, name) { - var isPlural = msAbs >= n12 * 1.5; - return Math.round(ms2 / n12) + " " + name + (isPlural ? "s" : ""); + function plural(ms2, msAbs, n8, name) { + var isPlural = msAbs >= n8 * 1.5; + return Math.round(ms2 / n8) + " " + name + (isPlural ? "s" : ""); } } }); @@ -27644,7 +27644,7 @@ var require_ms = __commonJS({ var require_common = __commonJS({ "node_modules/debug/src/common.js"(exports2, module) { "use strict"; - function setup(env2) { + function setup(env3) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; @@ -27653,8 +27653,8 @@ var require_common = __commonJS({ createDebug.enabled = enabled2; createDebug.humanize = require_ms(); createDebug.destroy = destroy2; - Object.keys(env2).forEach((key) => { - createDebug[key] = env2[key]; + Object.keys(env3).forEach((key) => { + createDebug[key] = env3[key]; }); createDebug.names = []; createDebug.skips = []; @@ -27689,12 +27689,12 @@ var require_common = __commonJS({ args.unshift("%O"); } let index2 = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match3, format2) => { + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match3, format4) => { if (match3 === "%%") { return "%"; } index2++; - const formatter = createDebug.formatters[format2]; + const formatter = createDebug.formatters[format4]; if (typeof formatter === "function") { const val = args[index2]; match3 = formatter.call(self2, val); @@ -27725,8 +27725,8 @@ var require_common = __commonJS({ } return enabledCache; }, - set: (v8) => { - enableOverride = v8; + set: (v2) => { + enableOverride = v2; } }); if (typeof createDebug.init === "function") { @@ -27744,8 +27744,8 @@ var require_common = __commonJS({ createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; - const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); - for (const ns2 of split) { + const split2 = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); + for (const ns2 of split2) { if (ns2[0] === "-") { createDebug.skips.push(ns2.slice(1)); } else { @@ -27921,11 +27921,11 @@ var require_browser = __commonJS({ if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } - let m6; + 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 && (m6 = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m6[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker + typeof navigator !== "undefined" && navigator.userAgent && (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) { @@ -27979,9 +27979,9 @@ var require_browser = __commonJS({ } module.exports = require_common()(exports2); var { formatters } = module.exports; - formatters.j = function(v8) { + formatters.j = function(v2) { try { - return JSON.stringify(v8); + return JSON.stringify(v2); } catch (error2) { return "[UnexpectedJSONParseError]: " + error2.message; } @@ -28009,20 +28009,20 @@ var require_supports_color = __commonJS({ var os9 = __require("os"); var tty = __require("tty"); var hasFlag = require_has_flag(); - var { env: env2 } = process; + var { env: env3 } = 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 env2) { - if (env2.FORCE_COLOR === "true") { + if ("FORCE_COLOR" in env3) { + if (env3.FORCE_COLOR === "true") { forceColor = 1; - } else if (env2.FORCE_COLOR === "false") { + } else if (env3.FORCE_COLOR === "false") { forceColor = 0; } else { - forceColor = env2.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env2.FORCE_COLOR, 10), 3); + forceColor = env3.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env3.FORCE_COLOR, 10), 3); } } function translateLevel(level) { @@ -28050,7 +28050,7 @@ var require_supports_color = __commonJS({ return 0; } const min = forceColor || 0; - if (env2.TERM === "dumb") { + if (env3.TERM === "dumb") { return min; } if (process.platform === "win32") { @@ -28060,34 +28060,34 @@ var require_supports_color = __commonJS({ } return 1; } - if ("CI" in env2) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign2) => sign2 in env2) || env2.CI_NAME === "codeship") { + if ("CI" in env3) { + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign2) => sign2 in env3) || env3.CI_NAME === "codeship") { return 1; } return min; } - if ("TEAMCITY_VERSION" in env2) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0; + if ("TEAMCITY_VERSION" in env3) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env3.TEAMCITY_VERSION) ? 1 : 0; } - if (env2.COLORTERM === "truecolor") { + if (env3.COLORTERM === "truecolor") { return 3; } - if ("TERM_PROGRAM" in env2) { - const version3 = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env2.TERM_PROGRAM) { + if ("TERM_PROGRAM" in env3) { + const version3 = parseInt((env3.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env3.TERM_PROGRAM) { case "iTerm.app": return version3 >= 3 ? 3 : 2; case "Apple_Terminal": return 2; } } - if (/-256(color)?$/i.test(env2.TERM)) { + if (/-256(color)?$/i.test(env3.TERM)) { return 2; } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) { + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env3.TERM)) { return 1; } - if ("COLORTERM" in env2) { + if ("COLORTERM" in env3) { return 1; } return min; @@ -28268,13 +28268,13 @@ var require_node = __commonJS({ } module.exports = require_common()(exports2); var { formatters } = module.exports; - formatters.o = function(v8) { + formatters.o = function(v2) { this.inspectOpts.colors = this.useColors; - return util3.inspect(v8, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); + return util3.inspect(v2, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); }; - formatters.O = function(v8) { + formatters.O = function(v2) { this.inspectOpts.colors = this.useColors; - return util3.inspect(v8, this.inspectOpts); + return util3.inspect(v2, this.inspectOpts); }; } }); @@ -28295,23 +28295,23 @@ var require_src = __commonJS({ var require_helpers = __commonJS({ "node_modules/agent-base/dist/helpers.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { + var desc = Object.getOwnPropertyDescriptor(m3, k7); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { - return m6[k7]; + return m3[k7]; } }; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { + Object.defineProperty(o2, k22, desc); + }) : (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; + o2[k22] = m3[k7]; })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + }) : function(o2, v2) { + o2["default"] = v2; }); var __importStar = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; @@ -28351,8 +28351,8 @@ var require_helpers = __commonJS({ function req(url2, opts = {}) { const href = typeof url2 === "string" ? url2 : url2.href; const req2 = (href.startsWith("https:") ? https4 : http4).request(url2, opts); - const promise = new Promise((resolve4, reject2) => { - req2.once("response", resolve4).once("error", reject2).end(); + const promise = new Promise((resolve8, reject2) => { + req2.once("response", resolve8).once("error", reject2).end(); }); req2.then = promise.then.bind(promise); return req2; @@ -28365,23 +28365,23 @@ var require_helpers = __commonJS({ var require_dist = __commonJS({ "node_modules/agent-base/dist/index.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { + var desc = Object.getOwnPropertyDescriptor(m3, k7); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { - return m6[k7]; + return m3[k7]; } }; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { + Object.defineProperty(o2, k22, desc); + }) : (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; + o2[k22] = m3[k7]; })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + }) : function(o2, v2) { + o2["default"] = v2; }); var __importStar = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; @@ -28392,8 +28392,8 @@ var require_dist = __commonJS({ __setModuleDefault(result, mod); return result; }; - var __exportStar = exports2 && exports2.__exportStar || function(m6, exports3) { - for (var p6 in m6) if (p6 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p6)) __createBinding(exports3, m6, p6); + var __exportStar = exports2 && exports2.__exportStar || function(m3, exports3) { + for (var p2 in m3) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p2)) __createBinding(exports3, m3, p2); }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Agent = void 0; @@ -28422,7 +28422,7 @@ var require_dist = __commonJS({ const { stack } = new Error(); if (typeof stack !== "string") return false; - return stack.split("\n").some((l6) => l6.indexOf("(https.js:") !== -1 || l6.indexOf("node:https:") !== -1); + 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 @@ -28499,17 +28499,17 @@ var require_dist = __commonJS({ get defaultPort() { return this[INTERNAL2].defaultPort ?? (this.protocol === "https:" ? 443 : 80); } - set defaultPort(v8) { + set defaultPort(v2) { if (this[INTERNAL2]) { - this[INTERNAL2].defaultPort = v8; + this[INTERNAL2].defaultPort = v2; } } get protocol() { return this[INTERNAL2].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); } - set protocol(v8) { + set protocol(v2) { if (this[INTERNAL2]) { - this[INTERNAL2].protocol = v8; + this[INTERNAL2].protocol = v2; } } }; @@ -28529,7 +28529,7 @@ var require_parse_proxy_response = __commonJS({ var debug_1 = __importDefault(require_src()); var debug2 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); function parseProxyResponse(socket) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { let buffersLength = 0; const buffers = []; function read() { @@ -28595,7 +28595,7 @@ var require_parse_proxy_response = __commonJS({ } debug2("got proxy server response: %o %o", firstLine, headers); cleanup(); - resolve4({ + resolve8({ connect: { statusCode, statusText, @@ -28617,23 +28617,23 @@ var require_parse_proxy_response = __commonJS({ var require_dist2 = __commonJS({ "node_modules/https-proxy-agent/dist/index.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { + var desc = Object.getOwnPropertyDescriptor(m3, k7); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { - return m6[k7]; + return m3[k7]; } }; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { + Object.defineProperty(o2, k22, desc); + }) : (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; + o2[k22] = m3[k7]; })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + }) : function(o2, v2) { + o2["default"] = v2; }); var __importStar = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; @@ -28736,11 +28736,11 @@ var require_dist2 = __commonJS({ socket.destroy(); const fakeSocket = new net.Socket({ writable: false }); fakeSocket.readable = true; - req.once("socket", (s6) => { + req.once("socket", (s) => { debug2("Replaying proxy buffer for failed request"); - (0, assert_1.default)(s6.listenerCount("data") > 0); - s6.push(buffered); - s6.push(null); + (0, assert_1.default)(s.listenerCount("data") > 0); + s.push(buffered); + s.push(null); }); return fakeSocket; } @@ -28767,23 +28767,23 @@ var require_dist2 = __commonJS({ var require_dist3 = __commonJS({ "node_modules/http-proxy-agent/dist/index.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { + var desc = Object.getOwnPropertyDescriptor(m3, k7); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { - return m6[k7]; + return m3[k7]; } }; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { + Object.defineProperty(o2, k22, desc); + }) : (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; + o2[k22] = m3[k7]; })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + }) : function(o2, v2) { + o2["default"] = v2; }); var __importStar = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; @@ -28918,23 +28918,23 @@ var require_state2 = __commonJS({ }); // node_modules/fast-xml-parser/src/util.js -function getAllMatches(string, regex) { +function getAllMatches(string, regex3) { const matches = []; - let match3 = regex.exec(string); + let match3 = regex3.exec(string); while (match3) { const allmatches = []; - allmatches.startIndex = regex.lastIndex - match3[0].length; + allmatches.startIndex = regex3.lastIndex - match3[0].length; const len = match3.length; for (let index2 = 0; index2 < len; index2++) { allmatches.push(match3[index2]); } matches.push(allmatches); - match3 = regex.exec(string); + match3 = regex3.exec(string); } return matches; } -function isExist(v8) { - return typeof v8 !== "undefined"; +function isExist(v2) { + return typeof v2 !== "undefined"; } var nameStartChar, nameChar, nameRegexp, regexName, isName, DANGEROUS_PROPERTY_NAMES, criticalProperties; var init_util = __esm({ @@ -29096,7 +29096,7 @@ function validate(xmlData, options) { } else if (tags2.length == 1) { return getErrorObject("InvalidTag", "Unclosed tag '" + tags2[0].tagName + "'.", getLineNumberForPosition(xmlData, tags2[0].tagStartPos)); } else if (tags2.length > 0) { - return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags2.map((t6) => t6.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); + return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags2.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); } return true; } @@ -31270,11 +31270,11 @@ function toNumber(str, options = {}) { else if (parsedStr === `${sign2}${numTrimmedByZeros}`) return num; else return str; } - let n12 = leadingZeros ? numTrimmedByZeros : trimmedStr; + let n8 = leadingZeros ? numTrimmedByZeros : trimmedStr; if (leadingZeros) { - return n12 === parsedStr || sign2 + n12 === parsedStr ? num : str; + return n8 === parsedStr || sign2 + n8 === parsedStr ? num : str; } else { - return n12 === parsedStr || n12 === sign2 + parsedStr ? num : str; + return n8 === parsedStr || n8 === sign2 + parsedStr ? num : str; } } } else { @@ -31817,7 +31817,7 @@ var init_Matcher = __esm({ * @returns {string[]} */ toArray() { - return this._matcher.path.map((n12) => n12.tag); + return this._matcher.path.map((n8) => n8.tag); } /** * Match current path against an Expression. @@ -31989,13 +31989,13 @@ var init_Matcher = __esm({ return this._pathStringCache; } const result = this.path.map( - (n12) => n12.namespace ? `${n12.namespace}:${n12.tag}` : n12.tag + (n8) => n8.namespace ? `${n8.namespace}:${n8.tag}` : n8.tag ).join(sep7); this._pathStringCache = result; return result; } return this.path.map( - (n12) => includeNamespace && n12.namespace ? `${n12.namespace}:${n12.tag}` : n12.tag + (n8) => includeNamespace && n8.namespace ? `${n8.namespace}:${n8.tag}` : n8.tag ).join(sep7); } /** @@ -32003,7 +32003,7 @@ var init_Matcher = __esm({ * @returns {string[]} */ toArray() { - return this.path.map((n12) => n12.tag); + return this.path.map((n8) => n8.tag); } /** * Reset the path to empty. @@ -32461,7 +32461,7 @@ function readStopNodeData(xmlData, tagName, i6) { const closeIndex = findClosingIndex(xmlData, "]]>", i6, "StopNode is not closed.") - 2; i6 = closeIndex; } else { - const tagData = readTagExp(xmlData, i6, ">"); + const tagData = readTagExp(xmlData, i6, false); if (tagData) { const openTagName = tagData && tagData.tagName; if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { @@ -32813,6 +32813,9 @@ function compress(arr, options, matcher, readonlyMatcher) { } else if (tagObj[property]) { let val = compress(tagObj[property], options, matcher, readonlyMatcher); const isLeaf = isLeafTag(val, options); + if (Object.keys(val).length === 0 && options.alwaysCreateTextNode) { + val[options.textNodeName] = ""; + } if (tagObj[":@"]) { assignAttributes(val, tagObj[":@"], readonlyMatcher, options); } else if (Object.keys(val).length === 1 && val[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { @@ -32961,10 +32964,72 @@ var init_XMLParser = __esm({ } }); +// node_modules/fast-xml-builder/src/util.js +function safeComment(val) { + return String(val).replace(/--/g, "- -").replace(/--/g, "- -").replace(/-$/, "- "); +} +function safeCdata(val) { + return String(val).replace(/\]\]>/g, "]]]]>"); +} +function escapeAttribute(val) { + return String(val).replace(/"/g, """).replace(/'/g, "'"); +} +var init_util2 = __esm({ + "node_modules/fast-xml-builder/src/util.js"() { + "use strict"; + } +}); + +// node_modules/xml-naming/src/index.js +var nameStartChar10, nameChar10, nameStartChar11, nameChar11, buildRegexes, regexes10, regexes11, getRegexes, qName; +var init_src3 = __esm({ + "node_modules/xml-naming/src/index.js"() { + "use strict"; + nameStartChar10 = ":A-Za-z_\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u0486\u0488-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD"; + nameChar10 = nameStartChar10 + "\\-\\.\\d\xB7\u0300-\u036F\u203F-\u2040"; + nameStartChar11 = ":A-Za-z_\xC0-\u02FF\u0370-\u037D\u037F-\u0486\u0488-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}"; + nameChar11 = nameStartChar11 + "\\-\\.\\d\xB7\u0300-\u036F\u0487\u203F-\u2040"; + buildRegexes = (startChar, char, flags = "") => { + const ncStart = startChar.replace(":", ""); + const ncChar = char.replace(":", ""); + const ncNamePat = `[${ncStart}][${ncChar}]*`; + return { + name: new RegExp(`^[${startChar}][${char}]*$`, flags), + ncName: new RegExp(`^${ncNamePat}$`, flags), + qName: new RegExp(`^${ncNamePat}(?::${ncNamePat})?$`, flags), + nmToken: new RegExp(`^[${char}]+$`, flags), + nmTokens: new RegExp(`^[${char}]+(?:\\s+[${char}]+)*$`, flags) + }; + }; + regexes10 = buildRegexes(nameStartChar10, nameChar10); + regexes11 = buildRegexes(nameStartChar11, nameChar11, "u"); + getRegexes = (xmlVersion = "1.0") => xmlVersion === "1.1" ? regexes11 : regexes10; + qName = (str, { xmlVersion = "1.0" } = {}) => getRegexes(xmlVersion).qName.test(str); + } +}); + // node_modules/fast-xml-builder/src/orderedJs2Xml.js +function detectXmlVersionFromArray(jArray, options) { + if (!Array.isArray(jArray) || jArray.length === 0) return "1.0"; + const first = jArray[0]; + const firstKey = propName2(first); + if (firstKey === "?xml") { + const attrs = first[":@"]; + if (attrs) { + const versionKey = options.attributeNamePrefix + "version"; + if (attrs[versionKey]) return attrs[versionKey]; + } + } + return "1.0"; +} +function resolveTagName(name, isAttribute2, options, matcher, xmlVersion) { + if (!options.sanitizeName) return name; + if (qName(name, { xmlVersion })) return name; + return options.sanitizeName(name, { isAttribute: isAttribute2, matcher: matcher.readOnly() }); +} function toXml(jArray, options) { let indentation = ""; - if (options.format && options.indentBy.length > 0) { + if (options.format) { indentation = EOL7; } const stopNodeExpressions = []; @@ -32978,10 +33043,11 @@ function toXml(jArray, options) { } } } + const xmlVersion = detectXmlVersionFromArray(jArray, options); const matcher = new Matcher(); - return arrToStr(jArray, options, indentation, matcher, stopNodeExpressions); + return arrToStr(jArray, options, indentation, matcher, stopNodeExpressions, xmlVersion); } -function arrToStr(arr, options, indentation, matcher, stopNodeExpressions) { +function arrToStr(arr, options, indentation, matcher, stopNodeExpressions, xmlVersion) { let xmlStr = ""; let isPreviousElementTag = false; if (options.maxNestedTags && matcher.getDepth() > options.maxNestedTags) { @@ -32997,13 +33063,15 @@ function arrToStr(arr, options, indentation, matcher, stopNodeExpressions) { } for (let i6 = 0; i6 < arr.length; i6++) { const tagObj = arr[i6]; - const tagName = propName2(tagObj); - if (tagName === void 0) continue; + const rawTagName = propName2(tagObj); + if (rawTagName === void 0) continue; + const isSpecialName = rawTagName === options.textNodeName || rawTagName === options.cdataPropName || rawTagName === options.commentPropName || rawTagName[0] === "?"; + const tagName = isSpecialName ? rawTagName : resolveTagName(rawTagName, false, options, matcher, xmlVersion); const attrValues = extractAttributeValues(tagObj[":@"], options); matcher.push(tagName, attrValues); const isStopNode = checkStopNode(matcher, stopNodeExpressions); if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; + let tagText = tagObj[rawTagName]; if (!isStopNode) { tagText = options.tagValueProcessor(tagName, tagText); tagText = replaceEntitiesValue2(tagText, options); @@ -33019,25 +33087,23 @@ function arrToStr(arr, options, indentation, matcher, stopNodeExpressions) { if (isPreviousElementTag) { xmlStr += indentation; } - const val = tagObj[tagName][0][options.textNodeName]; - const safeVal = String(val).replace(/\]\]>/g, "]]]]>"); + const val = tagObj[rawTagName][0][options.textNodeName]; + const safeVal = safeCdata(val); xmlStr += ``; isPreviousElementTag = false; matcher.pop(); continue; } else if (tagName === options.commentPropName) { - const val = tagObj[tagName][0][options.textNodeName]; - const safeVal = String(val).replace(/--/g, "- -").replace(/-$/, "- "); + const val = tagObj[rawTagName][0][options.textNodeName]; + const safeVal = safeComment(val); xmlStr += indentation + ``; isPreviousElementTag = true; matcher.pop(); continue; } else if (tagName[0] === "?") { - const attStr2 = attr_to_str(tagObj[":@"], options, isStopNode); + const attStr2 = attr_to_str(tagObj[":@"], options, isStopNode, matcher, xmlVersion); const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; + xmlStr += tempInd + `<${tagName}${attStr2}?>`; isPreviousElementTag = true; matcher.pop(); continue; @@ -33046,13 +33112,13 @@ function arrToStr(arr, options, indentation, matcher, stopNodeExpressions) { if (newIdentation !== "") { newIdentation += options.indentBy; } - const attStr = attr_to_str(tagObj[":@"], options, isStopNode); + const attStr = attr_to_str(tagObj[":@"], options, isStopNode, matcher, xmlVersion); const tagStart = indentation + `<${tagName}${attStr}`; let tagValue; if (isStopNode) { - tagValue = getRawContent2(tagObj[tagName], options); + tagValue = getRawContent2(tagObj[rawTagName], options); } else { - tagValue = arrToStr(tagObj[tagName], options, newIdentation, matcher, stopNodeExpressions); + tagValue = arrToStr(tagObj[rawTagName], options, newIdentation, matcher, stopNodeExpressions, xmlVersion); } if (options.unpairedTags.indexOf(tagName) !== -1) { if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; @@ -33082,7 +33148,7 @@ function extractAttributeValues(attrMap, options) { for (let attr in attrMap) { if (!Object.prototype.hasOwnProperty.call(attrMap, attr)) continue; const cleanAttrName = attr.startsWith(options.attributeNamePrefix) ? attr.substr(options.attributeNamePrefix.length) : attr; - attrValues[cleanAttrName] = attrMap[attr]; + attrValues[cleanAttrName] = escapeAttribute(attrMap[attr]); hasAttrs = true; } return hasAttrs ? attrValues : null; @@ -33127,7 +33193,7 @@ function attr_to_str_raw(attrMap, options) { if (attrVal === true && options.suppressBooleanAttributes) { attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; + attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${escapeAttribute(attrVal)}"`; } } } @@ -33141,11 +33207,13 @@ function propName2(obj) { if (key !== ":@") return key; } } -function attr_to_str(attrMap, options, isStopNode) { +function attr_to_str(attrMap, options, isStopNode, matcher, xmlVersion) { let attrStr = ""; if (attrMap && !options.ignoreAttributes) { for (let attr in attrMap) { if (!Object.prototype.hasOwnProperty.call(attrMap, attr)) continue; + const cleanAttrName = attr.substr(options.attributeNamePrefix.length); + const resolvedAttrName = isStopNode ? cleanAttrName : resolveTagName(cleanAttrName, true, options, matcher, xmlVersion); let attrVal; if (isStopNode) { attrVal = attrMap[attr]; @@ -33154,9 +33222,9 @@ function attr_to_str(attrMap, options, isStopNode) { attrVal = replaceEntitiesValue2(attrVal, options); } if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; + attrStr += ` ${resolvedAttrName}`; } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; + attrStr += ` ${resolvedAttrName}="${escapeAttribute(attrVal)}"`; } } } @@ -33185,6 +33253,8 @@ var init_orderedJs2Xml = __esm({ "node_modules/fast-xml-builder/src/orderedJs2Xml.js"() { "use strict"; init_src2(); + init_util2(); + init_src3(); EOL7 = "\n"; } }); @@ -33258,7 +33328,24 @@ function Builder(options) { this.newLine = ""; } } -function processTextOrObjNode(object, key, level, matcher) { +function detectXmlVersionFromObj(jObj, options) { + const decl = jObj["?xml"]; + if (decl && typeof decl === "object") { + if (options.attributesGroupName && decl[options.attributesGroupName]) { + const v3 = decl[options.attributesGroupName][options.attributeNamePrefix + "version"]; + if (v3) return v3; + } + const v2 = decl[options.attributeNamePrefix + "version"]; + if (v2) return v2; + } + return "1.0"; +} +function resolveTagName2(name, isAttribute2, options, matcher, xmlVersion) { + if (!options.sanitizeName) return name; + if (qName(name, { xmlVersion })) return name; + return options.sanitizeName(name, { isAttribute: isAttribute2, matcher: matcher.readOnly() }); +} +function processTextOrObjNode(object, key, level, matcher, xmlVersion) { const attrValues = this.extractAttributes(object); matcher.push(key, attrValues); const isStopNode = this.checkStopNode(matcher); @@ -33268,9 +33355,11 @@ function processTextOrObjNode(object, key, level, matcher) { matcher.pop(); return this.buildObjectNode(rawContent2, key, attrStr, level); } - const result = this.j2x(object, level + 1, matcher); + const result = this.j2x(object, level + 1, matcher, xmlVersion); matcher.pop(); - if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { + if (key[0] === "?") { + return this.buildTextValNode("", key, result.attrStr, level, matcher); + } else if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level, matcher); } else { return this.buildObjectNode(result.val, key, result.attrStr, level); @@ -33293,6 +33382,8 @@ var init_fxb = __esm({ init_orderedJs2Xml(); init_ignoreAttributes2(); init_src2(); + init_util2(); + init_src3(); defaultOptions3 = { attributeNamePrefix: "@_", attributesGroupName: false, @@ -33327,8 +33418,13 @@ var init_fxb = __esm({ // transformAttributeName: false, oneListGroup: false, maxNestedTags: 100, - jPath: true + jPath: true, // When true, callbacks receive string jPath; when false, receive Matcher instance + sanitizeName: false + // false = allow all names as-is (default, backward-compatible). + // Set to a function (name, { isAttribute, matcher }) => string to + // validate/sanitize tag and attribute names. Throw inside the function + // to reject an invalid name. }; Builder.prototype.build = function(jObj) { if (this.options.preserveOrder) { @@ -33340,10 +33436,11 @@ var init_fxb = __esm({ }; } const matcher = new Matcher(); - return this.j2x(jObj, 0, matcher).val; + const xmlVersion = detectXmlVersionFromObj(jObj, this.options); + return this.j2x(jObj, 0, matcher, xmlVersion).val; } }; - Builder.prototype.j2x = function(jObj, level, matcher) { + Builder.prototype.j2x = function(jObj, level, matcher, xmlVersion) { let attrStr = ""; let val = ""; if (this.options.maxNestedTags && matcher.getDepth() >= this.options.maxNestedTags) { @@ -33353,6 +33450,8 @@ var init_fxb = __esm({ const isCurrentStopNode = this.checkStopNode(matcher); for (let key in jObj) { if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue; + const isSpecialKey = key === this.options.textNodeName || key === this.options.cdataPropName || key === this.options.commentPropName || this.options.attributesGroupName && key === this.options.attributesGroupName || this.isAttribute(key) || key[0] === "?"; + const resolvedKey = isSpecialKey ? key : resolveTagName2(key, false, this.options, matcher, xmlVersion); if (typeof jObj[key] === "undefined") { if (this.isAttribute(key)) { val += ""; @@ -33360,36 +33459,37 @@ var init_fxb = __esm({ } else if (jObj[key] === null) { if (this.isAttribute(key)) { val += ""; - } else if (key === this.options.cdataPropName) { + } else if (resolvedKey === this.options.cdataPropName || resolvedKey === this.options.commentPropName) { val += ""; - } else if (key[0] === "?") { - val += this.indentate(level) + "<" + key + "?" + this.tagEndChar; + } else if (resolvedKey[0] === "?") { + val += this.indentate(level) + "<" + resolvedKey + "?" + this.tagEndChar; } else { - val += this.indentate(level) + "<" + key + "/" + this.tagEndChar; + val += this.indentate(level) + "<" + resolvedKey + "/" + this.tagEndChar; } } else if (jObj[key] instanceof Date) { - val += this.buildTextValNode(jObj[key], key, "", level, matcher); + val += this.buildTextValNode(jObj[key], resolvedKey, "", level, matcher); } else if (typeof jObj[key] !== "object") { const attr = this.isAttribute(key); if (attr && !this.ignoreAttributesFn(attr, jPath)) { - attrStr += this.buildAttrPairStr(attr, "" + jObj[key], isCurrentStopNode); + const resolvedAttr = resolveTagName2(attr, true, this.options, matcher, xmlVersion); + attrStr += this.buildAttrPairStr(resolvedAttr, "" + jObj[key], isCurrentStopNode); } else if (!attr) { if (key === this.options.textNodeName) { let newval = this.options.tagValueProcessor(key, "" + jObj[key]); val += this.replaceEntitiesValue(newval); } else { - matcher.push(key); + matcher.push(resolvedKey); const isStopNode = this.checkStopNode(matcher); matcher.pop(); if (isStopNode) { const textValue = "" + jObj[key]; if (textValue === "") { - val += this.indentate(level) + "<" + key + this.closeTag(key) + this.tagEndChar; + val += this.indentate(level) + "<" + resolvedKey + this.closeTag(resolvedKey) + this.tagEndChar; } else { - val += this.indentate(level) + "<" + key + ">" + textValue + "" + textValue + "" + textValue + "" + textValue + "/g, "]]]]>"); + const safeVal = safeCdata(val); return this.indentate(level) + `` + this.newLine; } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - const safeVal = String(val).replace(/--/g, "- -").replace(/-$/, "- "); + const safeVal = safeComment(val); return this.indentate(level) + `` + this.newLine; } else if (key[0] === "?") { return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; @@ -33690,12 +33793,12 @@ var require_balanced_match = __commonJS({ }; } function maybeMatch3(reg, str) { - var m6 = str.match(reg); - return m6 ? m6[0] : null; + var m3 = str.match(reg); + return m3 ? m3[0] : null; } balanced3.range = range6; function range6(a6, b6, str) { - var begs, beg, left, right, result; + var begs, beg, left2, right2, result; var ai2 = str.indexOf(a6); var bi2 = str.indexOf(b6, ai2 + 1); var i6 = ai2; @@ -33704,7 +33807,7 @@ var require_balanced_match = __commonJS({ return [ai2, bi2]; } begs = []; - left = str.length; + left2 = str.length; while (i6 >= 0 && !result) { if (i6 == ai2) { begs.push(i6); @@ -33713,16 +33816,16 @@ var require_balanced_match = __commonJS({ result = [begs.pop(), bi2]; } else { beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi2; + if (beg < left2) { + left2 = beg; + right2 = bi2; } bi2 = str.indexOf(b6, i6 + 1); } i6 = ai2 < bi2 && ai2 >= 0 ? ai2 : bi2; } if (begs.length) { - result = [left, right]; + result = [left2, right2]; } } return result; @@ -33754,20 +33857,20 @@ var require_brace_expansion = __commonJS({ if (!str) return [""]; var parts = []; - var m6 = balanced3("{", "}", str); - if (!m6) + var m3 = balanced3("{", "}", str); + if (!m3) return str.split(","); - var pre = m6.pre; - var body2 = m6.body; - var post = m6.post; - var p6 = pre.split(","); - p6[p6.length - 1] += "{" + body2 + "}"; + var pre = m3.pre; + var body2 = m3.body; + var post = m3.post; + var p2 = pre.split(","); + p2[p2.length - 1] += "{" + body2 + "}"; var postParts = parseCommaParts3(post); if (post.length) { - p6[p6.length - 1] += postParts.shift(); - p6.push.apply(p6, postParts); + p2[p2.length - 1] += postParts.shift(); + p2.push.apply(p2, postParts); } - parts.push.apply(parts, p6); + parts.push.apply(parts, p2); return parts; } function expandTop(str, options) { @@ -33786,64 +33889,64 @@ var require_brace_expansion = __commonJS({ function isPadded3(el) { return /^-?0\d/.test(el); } - function lte3(i6, y2) { - return i6 <= y2; + function lte3(i6, y) { + return i6 <= y; } - function gte3(i6, y2) { - return i6 >= y2; + function gte3(i6, y) { + return i6 >= y; } function expand4(str, max, isTop) { var expansions = []; - var m6 = balanced3("{", "}", str); - if (!m6) return [str]; - var pre = m6.pre; - var post = m6.post.length ? expand4(m6.post, max, false) : [""]; - if (/\$$/.test(m6.pre)) { + var m3 = balanced3("{", "}", str); + if (!m3) return [str]; + var pre = m3.pre; + var post = m3.post.length ? expand4(m3.post, max, false) : [""]; + if (/\$$/.test(m3.pre)) { for (var k7 = 0; k7 < post.length && k7 < max; k7++) { - var expansion = pre + "{" + m6.body + "}" + post[k7]; + var expansion = pre + "{" + m3.body + "}" + post[k7]; expansions.push(expansion); } } else { - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m6.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m6.body); + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m3.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m3.body); var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m6.body.indexOf(",") >= 0; + var isOptions = m3.body.indexOf(",") >= 0; if (!isSequence && !isOptions) { - if (m6.post.match(/,(?!,).*\}/)) { - str = m6.pre + "{" + m6.body + escClose3 + m6.post; + if (m3.post.match(/,(?!,).*\}/)) { + str = m3.pre + "{" + m3.body + escClose3 + m3.post; return expand4(str, max, true); } return [str]; } - var n12; + var n8; if (isSequence) { - n12 = m6.body.split(/\.\./); + n8 = m3.body.split(/\.\./); } else { - n12 = parseCommaParts3(m6.body); - if (n12.length === 1) { - n12 = expand4(n12[0], max, false).map(embrace3); - if (n12.length === 1) { - return post.map(function(p6) { - return m6.pre + n12[0] + p6; + n8 = parseCommaParts3(m3.body); + if (n8.length === 1) { + n8 = expand4(n8[0], max, false).map(embrace3); + if (n8.length === 1) { + return post.map(function(p2) { + return m3.pre + n8[0] + p2; }); } } } var N2; if (isSequence) { - var x6 = numeric3(n12[0]); - var y2 = numeric3(n12[1]); - var width = Math.max(n12[0].length, n12[1].length); - var incr = n12.length == 3 ? Math.max(Math.abs(numeric3(n12[2])), 1) : 1; + var x2 = numeric3(n8[0]); + var y = numeric3(n8[1]); + var width = Math.max(n8[0].length, n8[1].length); + var incr = n8.length == 3 ? Math.max(Math.abs(numeric3(n8[2])), 1) : 1; var test = lte3; - var reverse = y2 < x6; + var reverse = y < x2; if (reverse) { incr *= -1; test = gte3; } - var pad = n12.some(isPadded3); + var pad = n8.some(isPadded3); N2 = []; - for (var i6 = x6; test(i6, y2); i6 += incr) { + for (var i6 = x2; test(i6, y); i6 += incr) { var c6; if (isAlphaSequence) { c6 = String.fromCharCode(i6); @@ -33854,11 +33957,11 @@ var require_brace_expansion = __commonJS({ if (pad) { var need = width - c6.length; if (need > 0) { - var z2 = new Array(need + 1).join("0"); + var z = new Array(need + 1).join("0"); if (i6 < 0) - c6 = "-" + z2 + c6.slice(1); + c6 = "-" + z + c6.slice(1); else - c6 = z2 + c6; + c6 = z + c6; } } } @@ -33866,8 +33969,8 @@ var require_brace_expansion = __commonJS({ } } else { N2 = []; - for (var j7 = 0; j7 < n12.length; j7++) { - N2.push.apply(N2, expand4(n12[j7], max, false)); + for (var j7 = 0; j7 < n8.length; j7++) { + N2.push.apply(N2, expand4(n8[j7], max, false)); } } for (var j7 = 0; j7 < N2.length; j7++) { @@ -33887,12 +33990,12 @@ var require_brace_expansion = __commonJS({ var require_minimatch = __commonJS({ "node_modules/readdir-glob/node_modules/minimatch/minimatch.js"(exports2, module) { "use strict"; - var minimatch3 = module.exports = (p6, pattern, options = {}) => { + var minimatch3 = module.exports = (p2, pattern, options = {}) => { assertValidPattern3(pattern); if (!options.nocomment && pattern.charAt(0) === "#") { return false; } - return new Minimatch3(pattern, options).match(p6); + return new Minimatch3(pattern, options).match(p2); }; module.exports = minimatch3; var path10 = require_path(); @@ -33911,38 +34014,38 @@ var require_minimatch = __commonJS({ var star5 = qmark5 + "*?"; var twoStarDot3 = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; var twoStarNoDot3 = "(?:(?!(?:\\/|^)\\.).)*?"; - var charSet = (s6) => s6.split("").reduce((set, c6) => { + var charSet = (s) => s.split("").reduce((set, c6) => { set[c6] = true; return set; }, {}); var reSpecials3 = charSet("().*{}+?[]^$\\!"); var addPatternStartSet = charSet("[.("); var slashSplit = /\/+/; - minimatch3.filter = (pattern, options = {}) => (p6, i6, list) => minimatch3(p6, pattern, options); + minimatch3.filter = (pattern, options = {}) => (p2, i6, list) => minimatch3(p2, pattern, options); var ext3 = (a6, b6 = {}) => { - const t6 = {}; - Object.keys(a6).forEach((k7) => t6[k7] = a6[k7]); - Object.keys(b6).forEach((k7) => t6[k7] = b6[k7]); - return t6; + const t = {}; + Object.keys(a6).forEach((k7) => t[k7] = a6[k7]); + Object.keys(b6).forEach((k7) => t[k7] = b6[k7]); + return t; }; minimatch3.defaults = (def) => { if (!def || typeof def !== "object" || !Object.keys(def).length) { return minimatch3; } const orig = minimatch3; - const m6 = (p6, pattern, options) => orig(p6, pattern, ext3(def, options)); - m6.Minimatch = class Minimatch extends orig.Minimatch { + const m3 = (p2, pattern, options) => orig(p2, pattern, ext3(def, options)); + m3.Minimatch = class Minimatch extends orig.Minimatch { constructor(pattern, options) { super(pattern, ext3(def, options)); } }; - m6.Minimatch.defaults = (options) => orig.defaults(ext3(def, options)).Minimatch; - m6.filter = (pattern, options) => orig.filter(pattern, ext3(def, options)); - m6.defaults = (options) => orig.defaults(ext3(def, options)); - m6.makeRe = (pattern, options) => orig.makeRe(pattern, ext3(def, options)); - m6.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext3(def, options)); - m6.match = (list, pattern, options) => orig.match(list, pattern, ext3(def, options)); - return m6; + m3.Minimatch.defaults = (options) => orig.defaults(ext3(def, options)).Minimatch; + m3.filter = (pattern, options) => orig.filter(pattern, ext3(def, options)); + m3.defaults = (options) => orig.defaults(ext3(def, options)); + m3.makeRe = (pattern, options) => orig.makeRe(pattern, ext3(def, options)); + m3.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext3(def, options)); + m3.match = (list, pattern, options) => orig.match(list, pattern, ext3(def, options)); + return m3; }; minimatch3.braceExpand = (pattern, options) => braceExpand3(pattern, options); var braceExpand3 = (pattern, options = {}) => { @@ -33971,10 +34074,10 @@ var require_minimatch = __commonJS({ } return list; }; - var globUnescape = (s6) => s6.replace(/\\(.)/g, "$1"); - var charUnescape = (s6) => s6.replace(/\\([^-\]])/g, "$1"); - var regExpEscape5 = (s6) => s6.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - var braExpEscape = (s6) => s6.replace(/[[\]\\]/g, "\\$&"); + var globUnescape = (s) => s.replace(/\\(.)/g, "$1"); + var charUnescape = (s) => s.replace(/\\([^-\]])/g, "$1"); + var regExpEscape5 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + var braExpEscape = (s) => s.replace(/[[\]\\]/g, "\\$&"); var Minimatch3 = class { constructor(pattern, options) { assertValidPattern3(pattern); @@ -34011,11 +34114,11 @@ var require_minimatch = __commonJS({ let set = this.globSet = this.braceExpand(); if (options.debug) this.debug = (...args) => console.error(...args); this.debug(this.pattern, set); - set = this.globParts = set.map((s6) => s6.split(slashSplit)); + set = this.globParts = set.map((s) => s.split(slashSplit)); this.debug(this.pattern, set); - set = set.map((s6, si2, set2) => s6.map(this.parse, this)); + set = set.map((s, si2, set2) => s.map(this.parse, this)); this.debug(this.pattern, set); - set = set.filter((s6) => s6.indexOf(false) === -1); + set = set.filter((s) => s.indexOf(false) === -1); this.debug(this.pattern, set); this.set = set; } @@ -34139,14 +34242,14 @@ var require_minimatch = __commonJS({ } const [body2, after] = bs2; while (fileIndex <= after) { - const m6 = this._matchOne( + const m3 = this._matchOne( file.slice(0, fileIndex + body2.length), body2, partial, fileIndex, 0 ); - if (m6 && globStarDepth < this.maxGlobstarRecursion) { + if (m3 && globStarDepth < this.maxGlobstarRecursion) { const sub = this._matchGlobStarBodySections( file, bodySegments, @@ -34172,17 +34275,17 @@ var require_minimatch = __commonJS({ let fi2, pi2, fl, pl; for (fi2 = fileIndex, pi2 = patternIndex, fl = file.length, pl = pattern.length; fi2 < fl && pi2 < pl; fi2++, pi2++) { this.debug("matchOne loop"); - const p6 = pattern[pi2]; + const p2 = pattern[pi2]; const f6 = file[fi2]; - this.debug(pattern, p6, f6); - if (p6 === false || p6 === GLOBSTAR3) return false; + this.debug(pattern, p2, f6); + if (p2 === false || p2 === GLOBSTAR3) return false; let hit; - if (typeof p6 === "string") { - hit = f6 === p6; - this.debug("string match", p6, f6, hit); + if (typeof p2 === "string") { + hit = f6 === p2; + this.debug("string match", p2, f6, hit); } else { - hit = f6.match(p6); - this.debug("pattern match", p6, f6, hit); + hit = f6.match(p2); + this.debug("pattern match", p2, f6, hit); } if (!hit) return false; } @@ -34223,7 +34326,7 @@ var require_minimatch = __commonJS({ let dotTravAllowed = pattern.charAt(0) === "."; let dotFileAllowed = options.dot || dotTravAllowed; const patternStart = () => dotTravAllowed ? "" : dotFileAllowed ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; - const subPatternStart = (p6) => p6.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; + const subPatternStart = (p2) => p2.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; const clearStateChar = () => { if (stateChar) { switch (stateChar) { @@ -34399,17 +34502,17 @@ var require_minimatch = __commonJS({ return $1 + $1 + $2 + "|"; }); this.debug("tail=%j\n %s", tail, tail, pl, re2); - const t6 = pl.type === "*" ? star5 : pl.type === "?" ? qmark5 : "\\" + pl.type; + const t = pl.type === "*" ? star5 : pl.type === "?" ? qmark5 : "\\" + pl.type; hasMagic2 = true; - re2 = re2.slice(0, pl.reStart) + t6 + "\\(" + tail; + re2 = re2.slice(0, pl.reStart) + t + "\\(" + tail; } clearStateChar(); if (escaping) { re2 += "\\\\"; } const addPatternStart3 = addPatternStartSet[re2.charAt(0)]; - for (let n12 = negativeLists.length - 1; n12 > -1; n12--) { - const nl = negativeLists[n12]; + for (let n8 = negativeLists.length - 1; n8 > -1; n8--) { + const nl = negativeLists[n8]; const nlBefore = re2.slice(0, nl.reStart); const nlFirst = re2.slice(nl.reStart, nl.reEnd - 8); let nlAfter = re2.slice(nl.reEnd); @@ -34461,15 +34564,15 @@ var require_minimatch = __commonJS({ const flags = options.nocase ? "i" : ""; let re2 = set.map((pattern) => { pattern = pattern.map( - (p6) => typeof p6 === "string" ? regExpEscape5(p6) : p6 === GLOBSTAR3 ? GLOBSTAR3 : p6._src - ).reduce((set2, p6) => { - if (!(set2[set2.length - 1] === GLOBSTAR3 && p6 === GLOBSTAR3)) { - set2.push(p6); + (p2) => typeof p2 === "string" ? regExpEscape5(p2) : p2 === GLOBSTAR3 ? GLOBSTAR3 : p2._src + ).reduce((set2, p2) => { + if (!(set2[set2.length - 1] === GLOBSTAR3 && p2 === GLOBSTAR3)) { + set2.push(p2); } return set2; }, []); - pattern.forEach((p6, i6) => { - if (p6 !== GLOBSTAR3 || pattern[i6 - 1] === GLOBSTAR3) { + pattern.forEach((p2, i6) => { + if (p2 !== GLOBSTAR3 || pattern[i6 - 1] === GLOBSTAR3) { return; } if (i6 === 0) { @@ -34485,7 +34588,7 @@ var require_minimatch = __commonJS({ pattern[i6 + 1] = GLOBSTAR3; } }); - return pattern.filter((p6) => p6 !== GLOBSTAR3).join("/"); + return pattern.filter((p2) => p2 !== GLOBSTAR3).join("/"); }).join("|"); re2 = "^(?:" + re2 + ")$"; if (this.negate) re2 = "^(?!" + re2 + ").*$"; @@ -34545,9 +34648,9 @@ var require_readdir_glob = __commonJS({ var fs16 = __require("fs"); var { EventEmitter: EventEmitter4 } = __require("events"); var { Minimatch: Minimatch3 } = require_minimatch(); - var { resolve: resolve4 } = __require("path"); + var { resolve: resolve8 } = __require("path"); function readdir3(dir2, strict) { - return new Promise((resolve5, reject2) => { + return new Promise((resolve9, reject2) => { fs16.readdir(dir2, { withFileTypes: true }, (err, files) => { if (err) { switch (err.code) { @@ -34555,7 +34658,7 @@ var require_readdir_glob = __commonJS({ if (strict) { reject2(err); } else { - resolve5([]); + resolve9([]); } break; case "ENOTSUP": @@ -34565,7 +34668,7 @@ var require_readdir_glob = __commonJS({ case "ENAMETOOLONG": // Filename too long case "UNKNOWN": - resolve5([]); + resolve9([]); break; case "ELOOP": // Too many levels of symbolic links @@ -34574,30 +34677,30 @@ var require_readdir_glob = __commonJS({ break; } } else { - resolve5(files); + resolve9(files); } }); }); } function stat2(file, followSymlinks) { - return new Promise((resolve5, reject2) => { + return new Promise((resolve9, reject2) => { const statFunc = followSymlinks ? fs16.stat : fs16.lstat; statFunc(file, (err, stats) => { if (err) { switch (err.code) { case "ENOENT": if (followSymlinks) { - resolve5(stat2(file, false)); + resolve9(stat2(file, false)); } else { - resolve5(null); + resolve9(null); } break; default: - resolve5(null); + resolve9(null); break; } } else { - resolve5(stats); + resolve9(stats); } }); }); @@ -34611,8 +34714,8 @@ var require_readdir_glob = __commonJS({ useStat = true; } const filename = dir2 + "/" + name; - const relative2 = filename.slice(1); - const absolute = path10 + "/" + relative2; + const relative3 = filename.slice(1); + const absolute = path10 + "/" + relative3; let stats = null; if (useStat || followSymlinks) { stats = await stat2(absolute, followSymlinks); @@ -34624,12 +34727,12 @@ var require_readdir_glob = __commonJS({ stats = { isDirectory: () => false }; } if (stats.isDirectory()) { - if (!shouldSkip(relative2)) { - yield { relative: relative2, absolute, stats }; + if (!shouldSkip(relative3)) { + yield { relative: relative3, absolute, stats }; yield* exploreWalkAsync(filename, path10, followSymlinks, useStat, shouldSkip, false); } } else { - yield { relative: relative2, absolute, stats }; + yield { relative: relative3, absolute, stats }; } } } @@ -34665,7 +34768,7 @@ var require_readdir_glob = __commonJS({ if (this.options.pattern) { const matchers = Array.isArray(this.options.pattern) ? this.options.pattern : [this.options.pattern]; this.matchers = matchers.map( - (m6) => new Minimatch3(m6, { + (m3) => new Minimatch3(m3, { dot: this.options.dot, noglobstar: this.options.noglobstar, matchBase: this.options.matchBase, @@ -34687,7 +34790,7 @@ var require_readdir_glob = __commonJS({ (skip) => new Minimatch3(skip, { dot: true }) ); } - this.iterator = explore(resolve4(cwd || "."), this.options.follow, this.options.stat, this._shouldSkipDirectory.bind(this)); + this.iterator = explore(resolve8(cwd || "."), this.options.follow, this.options.stat, this._shouldSkipDirectory.bind(this)); this.paused = false; this.inactive = false; this.aborted = false; @@ -34699,12 +34802,12 @@ var require_readdir_glob = __commonJS({ } setTimeout(() => this._next(), 0); } - _shouldSkipDirectory(relative2) { - return this.skipMatchers.some((m6) => m6.match(relative2)); + _shouldSkipDirectory(relative3) { + return this.skipMatchers.some((m3) => m3.match(relative3)); } - _fileMatches(relative2, isDirectory2) { - const file = relative2 + (isDirectory2 ? "/" : ""); - return (this.matchers.length === 0 || this.matchers.some((m6) => m6.match(file))) && !this.ignoreMatchers.some((m6) => m6.match(file)) && (!this.options.nodir || !isDirectory2); + _fileMatches(relative3, isDirectory2) { + const file = relative3 + (isDirectory2 ? "/" : ""); + return (this.matchers.length === 0 || this.matchers.some((m3) => m3.match(file))) && !this.ignoreMatchers.some((m3) => m3.match(file)) && (!this.options.nodir || !isDirectory2); } _next() { if (!this.paused && !this.aborted) { @@ -34712,16 +34815,16 @@ var require_readdir_glob = __commonJS({ if (!obj.done) { const isDirectory2 = obj.value.stats.isDirectory(); if (this._fileMatches(obj.value.relative, isDirectory2)) { - let relative2 = obj.value.relative; + let relative3 = obj.value.relative; let absolute = obj.value.absolute; if (this.options.mark && isDirectory2) { - relative2 += "/"; + relative3 += "/"; absolute += "/"; } if (this.options.stat) { - this.emit("match", { relative: relative2, absolute, stat: obj.value.stats }); + this.emit("match", { relative: relative3, absolute, stat: obj.value.stats }); } else { - this.emit("match", { relative: relative2, absolute }); + this.emit("match", { relative: relative3, absolute }); } } this._next(this.iterator); @@ -34941,10 +35044,10 @@ function awaitify(asyncFn, arity) { if (typeof args[arity - 1] === "function") { return asyncFn.apply(this, args); } - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { args[arity - 1] = (err, ...cbArgs) => { if (err) return reject2(err); - resolve4(cbArgs.length > 1 ? cbArgs : cbArgs[0]); + resolve8(cbArgs.length > 1 ? cbArgs : cbArgs[0]); }; asyncFn.apply(this, args); }); @@ -34969,8 +35072,8 @@ function _asyncMap(eachfn, arr, iteratee, callback) { var _iteratee = wrapAsync(iteratee); return eachfn(arr, (value, _3, iterCb) => { var index2 = counter++; - _iteratee(value, (err, v8) => { - results[index2] = v8; + _iteratee(value, (err, v2) => { + results[index2] = v2; iterCb(err); }); }, (err) => { @@ -35126,13 +35229,13 @@ function mapSeries(coll, iteratee, callback) { return _asyncMap(eachOfSeries$1, coll, iteratee, callback); } function promiseCallback() { - let resolve4, reject2; + let resolve8, reject2; function callback(err, ...args) { if (err) return reject2(err); - resolve4(args.length > 1 ? args : args[0]); + resolve8(args.length > 1 ? args : args[0]); } callback[PROMISE_SYMBOL] = new Promise((res, rej) => { - resolve4 = res, reject2 = rej; + resolve8 = res, reject2 = rej; }); return callback; } @@ -35381,32 +35484,32 @@ function queue$1(worker, concurrency, payload) { if (callback != null && typeof callback !== "function") { throw new Error("task callback must be a function"); } - q7.started = true; + q3.started = true; var res, rej; function promiseCallback2(err, ...args) { if (err) return rejectOnError ? rej(err) : res(); if (args.length <= 1) return res(args[0]); res(args); } - var item = q7._createTaskItem( + var item = q3._createTaskItem( data, rejectOnError ? promiseCallback2 : callback || promiseCallback2 ); if (insertAtFront) { - q7._tasks.unshift(item); + q3._tasks.unshift(item); } else { - q7._tasks.push(item); + q3._tasks.push(item); } if (!processingScheduled) { processingScheduled = true; setImmediate$1(() => { processingScheduled = false; - q7.process(); + q3.process(); }); } if (rejectOnError || !callback) { - return new Promise((resolve4, reject2) => { - res = resolve4; + return new Promise((resolve8, reject2) => { + res = resolve8; rej = reject2; }); } @@ -35414,7 +35517,7 @@ function queue$1(worker, concurrency, payload) { function _createCB(tasks) { return function(err, ...args) { numRunning -= 1; - for (var i6 = 0, l6 = tasks.length; i6 < l6; i6++) { + for (var i6 = 0, l3 = tasks.length; i6 < l3; i6++) { var task = tasks[i6]; var index2 = workersList.indexOf(task); if (index2 === 0) { @@ -35427,17 +35530,17 @@ function queue$1(worker, concurrency, payload) { trigger("error", err, task.data); } } - if (numRunning <= q7.concurrency - q7.buffer) { + if (numRunning <= q3.concurrency - q3.buffer) { trigger("unsaturated"); } - if (q7.idle()) { + if (q3.idle()) { trigger("drain"); } - q7.process(); + q3.process(); }; } function _maybeDrain(data) { - if (data.length === 0 && q7.idle()) { + if (data.length === 0 && q3.idle()) { setImmediate$1(() => trigger("drain")); return true; } @@ -35445,10 +35548,10 @@ function queue$1(worker, concurrency, payload) { } const eventMethod = (name) => (handler2) => { if (!handler2) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { once2(name, (err, data) => { if (err) return reject2(err); - resolve4(data); + resolve8(data); }); }); } @@ -35456,7 +35559,7 @@ function queue$1(worker, concurrency, payload) { on(name, handler2); }; var isProcessing = false; - var q7 = { + var q3 = { _tasks: new DLL(), _createTaskItem(data, callback) { return { @@ -35465,7 +35568,7 @@ function queue$1(worker, concurrency, payload) { }; }, *[Symbol.iterator]() { - yield* q7._tasks[Symbol.iterator](); + yield* q3._tasks[Symbol.iterator](); }, concurrency, payload, @@ -35488,7 +35591,7 @@ function queue$1(worker, concurrency, payload) { }, kill() { off(); - q7._tasks.empty(); + q3._tasks.empty(); }, unshift(data, callback) { if (Array.isArray(data)) { @@ -35505,28 +35608,28 @@ function queue$1(worker, concurrency, payload) { return _insert(data, true, true, callback); }, remove(testFn) { - q7._tasks.remove(testFn); + q3._tasks.remove(testFn); }, process() { if (isProcessing) { return; } isProcessing = true; - while (!q7.paused && numRunning < q7.concurrency && q7._tasks.length) { + while (!q3.paused && numRunning < q3.concurrency && q3._tasks.length) { var tasks = [], data = []; - var l6 = q7._tasks.length; - if (q7.payload) l6 = Math.min(l6, q7.payload); - for (var i6 = 0; i6 < l6; i6++) { - var node = q7._tasks.shift(); + var l3 = q3._tasks.length; + if (q3.payload) l3 = Math.min(l3, q3.payload); + for (var i6 = 0; i6 < l3; i6++) { + var node = q3._tasks.shift(); tasks.push(node); workersList.push(node); data.push(node.data); } numRunning += 1; - if (q7._tasks.length === 0) { + if (q3._tasks.length === 0) { trigger("empty"); } - if (numRunning === q7.concurrency) { + if (numRunning === q3.concurrency) { trigger("saturated"); } var cb = onlyOnce(_createCB(tasks)); @@ -35535,7 +35638,7 @@ function queue$1(worker, concurrency, payload) { isProcessing = false; }, length() { - return q7._tasks.length; + return q3._tasks.length; }, running() { return numRunning; @@ -35544,20 +35647,20 @@ function queue$1(worker, concurrency, payload) { return workersList; }, idle() { - return q7._tasks.length + numRunning === 0; + return q3._tasks.length + numRunning === 0; }, pause() { - q7.paused = true; + q3.paused = true; }, resume() { - if (q7.paused === false) { + if (q3.paused === false) { return; } - q7.paused = false; - setImmediate$1(q7.process); + q3.paused = false; + setImmediate$1(q3.process); } }; - Object.defineProperties(q7, { + Object.defineProperties(q3, { saturated: { writable: false, value: eventMethod("saturated") @@ -35579,7 +35682,7 @@ function queue$1(worker, concurrency, payload) { value: eventMethod("error") } }); - return q7; + return q3; } function cargo$1(worker, payload) { return queue$1(worker, 1, payload); @@ -35590,9 +35693,9 @@ function cargo(worker, concurrency, payload) { function reduce(coll, memo, iteratee, callback) { callback = once(callback); var _iteratee = wrapAsync(iteratee); - return eachOfSeries$1(coll, (x6, i6, iterCb) => { - _iteratee(memo, x6, (err, v8) => { - memo = v8; + return eachOfSeries$1(coll, (x2, i6, iterCb) => { + _iteratee(memo, x2, (err, v2) => { + memo = v2; iterCb(err); }); }, (err) => callback(err, memo)); @@ -35693,7 +35796,7 @@ function consoleFunc(name) { console.error(err); } } else if (console[name]) { - resultArgs.forEach((x6) => console[name](x6)); + resultArgs.forEach((x2) => console[name](x2)); } } }); @@ -35763,9 +35866,9 @@ function everySeries(coll, iteratee, callback) { } function filterArray(eachfn, arr, iteratee, callback) { var truthValues = new Array(arr.length); - eachfn(arr, (x6, index2, iterCb) => { - iteratee(x6, (err, v8) => { - truthValues[index2] = !!v8; + eachfn(arr, (x2, index2, iterCb) => { + iteratee(x2, (err, v2) => { + truthValues[index2] = !!v2; iterCb(err); }); }, (err) => { @@ -35779,17 +35882,17 @@ function filterArray(eachfn, arr, iteratee, callback) { } function filterGeneric(eachfn, coll, iteratee, callback) { var results = []; - eachfn(coll, (x6, index2, iterCb) => { - iteratee(x6, (err, v8) => { + eachfn(coll, (x2, index2, iterCb) => { + iteratee(x2, (err, v2) => { if (err) return iterCb(err); - if (v8) { - results.push({ index: index2, value: x6 }); + if (v2) { + results.push({ index: index2, value: x2 }); } iterCb(err); }); }, (err) => { if (err) return callback(err); - callback(null, results.sort((a6, b6) => a6.index - b6.index).map((v8) => v8.value)); + callback(null, results.sort((a6, b6) => a6.index - b6.index).map((v2) => v2.value)); }); } function _filter(eachfn, coll, iteratee, callback) { @@ -35863,7 +35966,7 @@ function mapValues(obj, iteratee, callback) { function mapValuesSeries(obj, iteratee, callback) { return mapValuesLimit$1(obj, 1, iteratee, callback); } -function memoize(fn, hasher = (v8) => v8) { +function memoize(fn, hasher = (v2) => v2) { var memo = /* @__PURE__ */ Object.create(null); var queues = /* @__PURE__ */ Object.create(null); var _fn = wrapAsync(fn); @@ -35879,10 +35982,10 @@ function memoize(fn, hasher = (v8) => v8) { if (!err) { memo[key] = resultArgs; } - var q7 = queues[key]; + var q3 = queues[key]; delete queues[key]; - for (var i6 = 0, l6 = q7.length; i6 < l6; i6++) { - q7[i6](err, ...resultArgs); + for (var i6 = 0, l3 = q3.length; i6 < l3; i6++) { + q3[i6](err, ...resultArgs); } }); } @@ -35909,21 +36012,21 @@ function leftChi(i6) { function parent(i6) { return (i6 + 1 >> 1) - 1; } -function smaller(x6, y2) { - if (x6.priority !== y2.priority) { - return x6.priority < y2.priority; +function smaller(x2, y) { + if (x2.priority !== y.priority) { + return x2.priority < y.priority; } else { - return x6.pushCount < y2.pushCount; + return x2.pushCount < y.pushCount; } } function priorityQueue(worker, concurrency) { - var q7 = queue(worker, concurrency); + var q3 = queue(worker, concurrency); var { push, pushAsync - } = q7; - q7._tasks = new Heap(); - q7._createTaskItem = ({ data, priority }, callback) => { + } = q3; + q3._tasks = new Heap(); + q3._createTaskItem = ({ data, priority }, callback) => { return { data, priority, @@ -35938,21 +36041,21 @@ function priorityQueue(worker, concurrency) { return { data, priority }; }); } - q7.push = function(data, priority = 0, callback) { + q3.push = function(data, priority = 0, callback) { return push(createDataItems(data, priority), callback); }; - q7.pushAsync = function(data, priority = 0, callback) { + q3.pushAsync = function(data, priority = 0, callback) { return pushAsync(createDataItems(data, priority), callback); }; - delete q7.unshift; - delete q7.unshiftAsync; - return q7; + delete q3.unshift; + delete q3.unshiftAsync; + return q3; } function race(tasks, callback) { callback = once(callback); if (!Array.isArray(tasks)) return callback(new TypeError("First argument to race must be an array of functions")); if (!tasks.length) return callback(); - for (var i6 = 0, l6 = tasks.length; i6 < l6; i6++) { + for (var i6 = 0, l3 = tasks.length; i6 < l3; i6++) { wrapAsync(tasks[i6])(callback); } } @@ -35995,8 +36098,8 @@ function reflectAll(tasks) { function reject$2(eachfn, arr, _iteratee, callback) { const iteratee = wrapAsync(_iteratee); return _filter(eachfn, arr, (value, cb) => { - iteratee(value, (err, v8) => { - cb(err, !v8); + iteratee(value, (err, v2) => { + cb(err, !v2); }); }, callback); } @@ -36044,13 +36147,13 @@ function retry2(opts, task, callback) { retryAttempt(); return callback[PROMISE_SYMBOL]; } -function parseTimes(acc, t6) { - if (typeof t6 === "object") { - acc.times = +t6.times || DEFAULT_TIMES; - acc.intervalFunc = typeof t6.interval === "function" ? t6.interval : constant(+t6.interval || DEFAULT_INTERVAL); - acc.errorFilter = t6.errorFilter; - } else if (typeof t6 === "number" || typeof t6 === "string") { - acc.times = +t6 || DEFAULT_TIMES; +function parseTimes(acc, t) { + if (typeof t === "object") { + acc.times = +t.times || DEFAULT_TIMES; + acc.intervalFunc = typeof t.interval === "function" ? t.interval : constant(+t.interval || DEFAULT_INTERVAL); + acc.errorFilter = t.errorFilter; + } else if (typeof t === "number" || typeof t === "string") { + acc.times = +t || DEFAULT_TIMES; } else { throw new Error("Invalid arguments for async.retry"); } @@ -36092,17 +36195,17 @@ function someSeries(coll, iteratee, callback) { } function sortBy(coll, iteratee, callback) { var _iteratee = wrapAsync(iteratee); - return map$1(coll, (x6, iterCb) => { - _iteratee(x6, (err, criteria) => { + return map$1(coll, (x2, iterCb) => { + _iteratee(x2, (err, criteria) => { if (err) return iterCb(err); - iterCb(err, { value: x6, criteria }); + iterCb(err, { value: x2, criteria }); }); }, (err, results) => { if (err) return callback(err); - callback(null, results.sort(comparator).map((v8) => v8.value)); + callback(null, results.sort(comparator).map((v2) => v2.value)); }); - function comparator(left, right) { - var a6 = left.criteria, b6 = right.criteria; + function comparator(left2, right2) { + var a6 = left2.criteria, b6 = right2.criteria; return a6 < b6 ? -1 : a6 > b6 ? 1 : 0; } } @@ -36142,11 +36245,11 @@ function timesLimit(count, limit, iteratee, callback) { var _iteratee = wrapAsync(iteratee); return mapLimit$1(range2(count), limit, _iteratee, callback); } -function times(n12, iteratee, callback) { - return timesLimit(n12, Infinity, iteratee, callback); +function times(n8, iteratee, callback) { + return timesLimit(n8, Infinity, iteratee, callback); } -function timesSeries(n12, iteratee, callback) { - return timesLimit(n12, 1, iteratee, callback); +function timesSeries(n8, iteratee, callback) { + return timesLimit(n8, 1, iteratee, callback); } function transform(coll, accumulator, iteratee, callback) { if (arguments.length <= 3 && typeof accumulator === "function") { @@ -36156,8 +36259,8 @@ function transform(coll, accumulator, iteratee, callback) { } callback = once(callback || promiseCallback()); var _iteratee = wrapAsync(iteratee); - eachOf$1(coll, (v8, k7, cb) => { - _iteratee(accumulator, v8, k7, cb); + eachOf$1(coll, (v2, k7, cb) => { + _iteratee(accumulator, v2, k7, cb); }, (err) => callback(err, accumulator)); return callback[PROMISE_SYMBOL]; } @@ -36434,27 +36537,27 @@ var init_async = __esm({ return this; } percUp(index2) { - let p6; - while (index2 > 0 && smaller(this.heap[index2], this.heap[p6 = parent(index2)])) { - let t6 = this.heap[index2]; - this.heap[index2] = this.heap[p6]; - this.heap[p6] = t6; - index2 = p6; + let p2; + while (index2 > 0 && smaller(this.heap[index2], this.heap[p2 = parent(index2)])) { + let t = this.heap[index2]; + this.heap[index2] = this.heap[p2]; + this.heap[p2] = t; + index2 = p2; } } percDown(index2) { - let l6; - while ((l6 = leftChi(index2)) < this.heap.length) { - if (l6 + 1 < this.heap.length && smaller(this.heap[l6 + 1], this.heap[l6])) { - l6 = l6 + 1; + let l3; + while ((l3 = leftChi(index2)) < this.heap.length) { + if (l3 + 1 < this.heap.length && smaller(this.heap[l3 + 1], this.heap[l3])) { + l3 = l3 + 1; } - if (smaller(this.heap[index2], this.heap[l6])) { + if (smaller(this.heap[index2], this.heap[l3])) { break; } - let t6 = this.heap[index2]; - this.heap[index2] = this.heap[l6]; - this.heap[l6] = t6; - index2 = l6; + let t = this.heap[index2]; + this.heap[index2] = this.heap[l3]; + this.heap[l3] = t; + index2 = l3; } } push(node) { @@ -36466,11 +36569,11 @@ var init_async = __esm({ return this.heap.push(node); } shift() { - let [top] = this.heap; + let [top2] = this.heap; this.heap[0] = this.heap[this.heap.length - 1]; this.heap.pop(); this.percDown(0); - return top; + return top2; } toArray() { return [...this]; @@ -36817,7 +36920,7 @@ var require_polyfills = __commonJS({ return ret; }; } else if (fs17.futimes) { - fs17.lutimes = function(_a5, _b2, _c6, cb) { + fs17.lutimes = function(_a6, _b3, _c7, cb) { if (cb) process.nextTick(cb); }; fs17.lutimesSync = function() { @@ -37058,9 +37161,9 @@ var require_graceful_fs = __commonJS({ debug2 = util3.debuglog("gfs4"); else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) debug2 = function() { - var m6 = util3.format.apply(util3, arguments); - m6 = "GFS4: " + m6.split(/\n/).join("\nGFS4: "); - console.error(m6); + var m3 = util3.format.apply(util3, arguments); + m3 = "GFS4: " + m3.split(/\n/).join("\nGFS4: "); + console.error(m3); }; if (!fs16[gracefulQueue]) { queue2 = global[gracefulQueue] || []; @@ -37129,8 +37232,8 @@ var require_graceful_fs = __commonJS({ } } var fs$writeFile = fs17.writeFile; - fs17.writeFile = writeFile3; - function writeFile3(path10, data, options, cb) { + fs17.writeFile = writeFile4; + function writeFile4(path10, data, options, cb) { if (typeof options === "function") cb = options, options = null; return go$writeFile(path10, data, options, cb); @@ -37479,33 +37582,33 @@ var require_safe_buffer = __commonJS({ "node_modules/safe-buffer/index.js"(exports2, module) { "use strict"; var buffer2 = __require("buffer"); - var Buffer7 = buffer2.Buffer; + var Buffer4 = buffer2.Buffer; function copyProps(src, dst) { for (var key in src) { dst[key] = src[key]; } } - if (Buffer7.from && Buffer7.alloc && Buffer7.allocUnsafe && Buffer7.allocUnsafeSlow) { + if (Buffer4.from && Buffer4.alloc && Buffer4.allocUnsafe && Buffer4.allocUnsafeSlow) { module.exports = buffer2; } else { copyProps(buffer2, exports2); exports2.Buffer = SafeBuffer; } function SafeBuffer(arg, encodingOrOffset, length) { - return Buffer7(arg, encodingOrOffset, length); + return Buffer4(arg, encodingOrOffset, length); } - copyProps(Buffer7, SafeBuffer); + copyProps(Buffer4, SafeBuffer); SafeBuffer.from = function(arg, encodingOrOffset, length) { if (typeof arg === "number") { throw new TypeError("Argument must not be a number"); } - return Buffer7(arg, encodingOrOffset, length); + return Buffer4(arg, encodingOrOffset, length); }; SafeBuffer.alloc = function(size, fill, encoding) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } - var buf = Buffer7(size); + var buf = Buffer4(size); if (fill !== void 0) { if (typeof encoding === "string") { buf.fill(fill, encoding); @@ -37521,7 +37624,7 @@ var require_safe_buffer = __commonJS({ if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } - return Buffer7(size); + return Buffer4(size); }; SafeBuffer.allocUnsafeSlow = function(size) { if (typeof size !== "number") { @@ -37543,10 +37646,10 @@ var require_util10 = __commonJS({ return objectToString(arg) === "[object Array]"; } exports2.isArray = isArray; - function isBoolean(arg) { + function isBoolean2(arg) { return typeof arg === "boolean"; } - exports2.isBoolean = isBoolean; + exports2.isBoolean = isBoolean2; function isNull(arg) { return arg === null; } @@ -37587,18 +37690,18 @@ var require_util10 = __commonJS({ return objectToString(e6) === "[object Error]" || e6 instanceof Error; } exports2.isError = isError3; - function isFunction2(arg) { + function isFunction3(arg) { return typeof arg === "function"; } - exports2.isFunction = isFunction2; + exports2.isFunction = isFunction3; function isPrimitive(arg) { return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || // ES6 symbol typeof arg === "undefined"; } exports2.isPrimitive = isPrimitive; exports2.isBuffer = __require("buffer").Buffer.isBuffer; - function objectToString(o6) { - return Object.prototype.toString.call(o6); + function objectToString(o2) { + return Object.prototype.toString.call(o2); } } }); @@ -37660,7 +37763,7 @@ var require_BufferList = __commonJS({ throw new TypeError("Cannot call a class as a function"); } } - var Buffer7 = require_safe_buffer().Buffer; + var Buffer4 = require_safe_buffer().Buffer; var util3 = __require("util"); function copyBuffer(src, target, offset) { src.copy(target, offset); @@ -37672,15 +37775,15 @@ var require_BufferList = __commonJS({ this.tail = null; this.length = 0; } - BufferList.prototype.push = function push(v8) { - var entry = { data: v8, next: null }; + BufferList.prototype.push = function push(v2) { + var entry = { data: v2, next: null }; if (this.length > 0) this.tail.next = entry; else this.head = entry; this.tail = entry; ++this.length; }; - BufferList.prototype.unshift = function unshift(v8) { - var entry = { data: v8, next: this.head }; + BufferList.prototype.unshift = function unshift(v2) { + var entry = { data: v2, next: this.head }; if (this.length === 0) this.tail = entry; this.head = entry; ++this.length; @@ -37697,24 +37800,24 @@ var require_BufferList = __commonJS({ this.head = this.tail = null; this.length = 0; }; - BufferList.prototype.join = function join10(s6) { + BufferList.prototype.join = function join11(s) { if (this.length === 0) return ""; - var p6 = this.head; - var ret = "" + p6.data; - while (p6 = p6.next) { - ret += s6 + p6.data; + var p2 = this.head; + var ret = "" + p2.data; + while (p2 = p2.next) { + ret += s + p2.data; } return ret; }; - BufferList.prototype.concat = function concat3(n12) { - if (this.length === 0) return Buffer7.alloc(0); - var ret = Buffer7.allocUnsafe(n12 >>> 0); - var p6 = this.head; + BufferList.prototype.concat = function concat3(n8) { + if (this.length === 0) return Buffer4.alloc(0); + var ret = Buffer4.allocUnsafe(n8 >>> 0); + var p2 = this.head; var i6 = 0; - while (p6) { - copyBuffer(p6.data, ret, i6); - i6 += p6.data.length; - p6 = p6.next; + while (p2) { + copyBuffer(p2.data, ret, i6); + i6 += p2.data.length; + p2 = p2.next; } return ret; }; @@ -37811,7 +37914,7 @@ var require_stream_writable = __commonJS({ "node_modules/lazystream/node_modules/readable-stream/lib/_stream_writable.js"(exports2, module) { "use strict"; var pna = require_process_nextick_args(); - module.exports = Writable2; + module.exports = Writable3; function CorkedRequest(state4) { var _this = this; this.next = null; @@ -37822,24 +37925,24 @@ var require_stream_writable = __commonJS({ } var asyncWrite = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; var Duplex; - Writable2.WritableState = WritableState; + Writable3.WritableState = WritableState; var util3 = Object.create(require_util10()); util3.inherits = require_inherits(); var internalUtil = { deprecate: require_node2() }; var Stream3 = require_stream(); - var Buffer7 = require_safe_buffer().Buffer; + var Buffer4 = require_safe_buffer().Buffer; var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { }; function _uint8ArrayToBuffer(chunk) { - return Buffer7.from(chunk); + return Buffer4.from(chunk); } function _isUint8Array(obj) { - return Buffer7.isBuffer(obj) || obj instanceof OurUint8Array; + return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array; } var destroyImpl = require_destroy(); - util3.inherits(Writable2, Stream3); + util3.inherits(Writable3, Stream3); function nop() { } function WritableState(options, stream5) { @@ -37904,10 +38007,10 @@ var require_stream_writable = __commonJS({ var realHasInstance; if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable2, Symbol.hasInstance, { + Object.defineProperty(Writable3, Symbol.hasInstance, { value: function(object) { if (realHasInstance.call(this, object)) return true; - if (this !== Writable2) return false; + if (this !== Writable3) return false; return object && object._writableState instanceof WritableState; } }); @@ -37916,10 +38019,10 @@ var require_stream_writable = __commonJS({ return object instanceof this; }; } - function Writable2(options) { + function Writable3(options) { Duplex = Duplex || require_stream_duplex(); - if (!realHasInstance.call(Writable2, this) && !(this instanceof Duplex)) { - return new Writable2(options); + if (!realHasInstance.call(Writable3, this) && !(this instanceof Duplex)) { + return new Writable3(options); } this._writableState = new WritableState(options, this); this.writable = true; @@ -37931,7 +38034,7 @@ var require_stream_writable = __commonJS({ } Stream3.call(this); } - Writable2.prototype.pipe = function() { + Writable3.prototype.pipe = function() { this.emit("error", new Error("Cannot pipe, not readable")); }; function writeAfterEnd(stream5, cb) { @@ -37954,11 +38057,11 @@ var require_stream_writable = __commonJS({ } return valid; } - Writable2.prototype.write = function(chunk, encoding, cb) { + Writable3.prototype.write = function(chunk, encoding, cb) { var state4 = this._writableState; var ret = false; var isBuf = !state4.objectMode && _isUint8Array(chunk); - if (isBuf && !Buffer7.isBuffer(chunk)) { + if (isBuf && !Buffer4.isBuffer(chunk)) { chunk = _uint8ArrayToBuffer(chunk); } if (typeof encoding === "function") { @@ -37975,18 +38078,18 @@ var require_stream_writable = __commonJS({ } return ret; }; - Writable2.prototype.cork = function() { + Writable3.prototype.cork = function() { var state4 = this._writableState; state4.corked++; }; - Writable2.prototype.uncork = function() { + Writable3.prototype.uncork = function() { var state4 = this._writableState; if (state4.corked) { state4.corked--; if (!state4.writing && !state4.corked && !state4.bufferProcessing && state4.bufferedRequest) clearBuffer(this, state4); } }; - Writable2.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + Writable3.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { if (typeof encoding === "string") encoding = encoding.toLowerCase(); if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + encoding); this._writableState.defaultEncoding = encoding; @@ -37994,11 +38097,11 @@ var require_stream_writable = __commonJS({ }; function decodeChunk(state4, chunk, encoding) { if (!state4.objectMode && state4.decodeStrings !== false && typeof chunk === "string") { - chunk = Buffer7.from(chunk, encoding); + chunk = Buffer4.from(chunk, encoding); } return chunk; } - Object.defineProperty(Writable2.prototype, "writableHighWaterMark", { + Object.defineProperty(Writable3.prototype, "writableHighWaterMark", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail @@ -38103,8 +38206,8 @@ var require_stream_writable = __commonJS({ state4.bufferProcessing = true; var entry = state4.bufferedRequest; if (stream5._writev && entry && entry.next) { - var l6 = state4.bufferedRequestCount; - var buffer2 = new Array(l6); + var l3 = state4.bufferedRequestCount; + var buffer2 = new Array(l3); var holder = state4.corkedRequestsFree; holder.entry = entry; var count = 0; @@ -38144,11 +38247,11 @@ var require_stream_writable = __commonJS({ state4.bufferedRequest = entry; state4.bufferProcessing = false; } - Writable2.prototype._write = function(chunk, encoding, cb) { + Writable3.prototype._write = function(chunk, encoding, cb) { cb(new Error("_write() is not implemented")); }; - Writable2.prototype._writev = null; - Writable2.prototype.end = function(chunk, encoding, cb) { + Writable3.prototype._writev = null; + Writable3.prototype.end = function(chunk, encoding, cb) { var state4 = this._writableState; if (typeof chunk === "function") { cb = chunk; @@ -38223,7 +38326,7 @@ var require_stream_writable = __commonJS({ } state4.corkedRequestsFree.next = corkReq; } - Object.defineProperty(Writable2.prototype, "destroyed", { + Object.defineProperty(Writable3.prototype, "destroyed", { get: function() { if (this._writableState === void 0) { return false; @@ -38237,9 +38340,9 @@ var require_stream_writable = __commonJS({ this._writableState.destroyed = value; } }); - Writable2.prototype.destroy = destroyImpl.destroy; - Writable2.prototype._undestroy = destroyImpl.undestroy; - Writable2.prototype._destroy = function(err, cb) { + Writable3.prototype.destroy = destroyImpl.destroy; + Writable3.prototype._undestroy = destroyImpl.undestroy; + Writable3.prototype._destroy = function(err, cb) { this.end(); cb(err); }; @@ -38251,7 +38354,7 @@ var require_stream_duplex = __commonJS({ "node_modules/lazystream/node_modules/readable-stream/lib/_stream_duplex.js"(exports2, module) { "use strict"; var pna = require_process_nextick_args(); - var objectKeys = Object.keys || function(obj) { + var objectKeys2 = Object.keys || function(obj) { var keys2 = []; for (var key in obj) { keys2.push(key); @@ -38261,23 +38364,23 @@ var require_stream_duplex = __commonJS({ module.exports = Duplex; var util3 = Object.create(require_util10()); util3.inherits = require_inherits(); - var Readable13 = require_stream_readable(); - var Writable2 = require_stream_writable(); - util3.inherits(Duplex, Readable13); + var Readable11 = require_stream_readable(); + var Writable3 = require_stream_writable(); + util3.inherits(Duplex, Readable11); { - keys = objectKeys(Writable2.prototype); - for (v8 = 0; v8 < keys.length; v8++) { - method = keys[v8]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable2.prototype[method]; + keys = objectKeys2(Writable3.prototype); + for (v2 = 0; v2 < keys.length; v2++) { + method = keys[v2]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable3.prototype[method]; } } var keys; var method; - var v8; + var v2; function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); - Readable13.call(this, options); - Writable2.call(this, options); + Readable11.call(this, options); + Writable3.call(this, options); if (options && options.readable === false) this.readable = false; if (options && options.writable === false) this.writable = false; this.allowHalfOpen = true; @@ -38327,8 +38430,8 @@ var require_stream_duplex = __commonJS({ var require_string_decoder = __commonJS({ "node_modules/lazystream/node_modules/string_decoder/lib/string_decoder.js"(exports2) { "use strict"; - var Buffer7 = require_safe_buffer().Buffer; - var isEncoding = Buffer7.isEncoding || function(encoding) { + var Buffer4 = require_safe_buffer().Buffer; + var isEncoding = Buffer4.isEncoding || function(encoding) { encoding = "" + encoding; switch (encoding && encoding.toLowerCase()) { case "hex": @@ -38376,7 +38479,7 @@ var require_string_decoder = __commonJS({ } function normalizeEncoding(enc) { var nenc = _normalizeEncoding(enc); - if (typeof nenc !== "string" && (Buffer7.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); + if (typeof nenc !== "string" && (Buffer4.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); return nenc || enc; } exports2.StringDecoder = StringDecoder2; @@ -38405,7 +38508,7 @@ var require_string_decoder = __commonJS({ } this.lastNeed = 0; this.lastTotal = 0; - this.lastChar = Buffer7.allocUnsafe(nb); + this.lastChar = Buffer4.allocUnsafe(nb); } StringDecoder2.prototype.write = function(buf) { if (buf.length === 0) return ""; @@ -38464,7 +38567,7 @@ var require_string_decoder = __commonJS({ } return 0; } - function utf8CheckExtraBytes(self2, buf, p6) { + function utf8CheckExtraBytes(self2, buf, p2) { if ((buf[0] & 192) !== 128) { self2.lastNeed = 0; return "\uFFFD"; @@ -38483,14 +38586,14 @@ var require_string_decoder = __commonJS({ } } function utf8FillLast(buf) { - var p6 = this.lastTotal - this.lastNeed; - var r6 = utf8CheckExtraBytes(this, buf, p6); + var p2 = this.lastTotal - this.lastNeed; + var r6 = utf8CheckExtraBytes(this, buf, p2); if (r6 !== void 0) return r6; if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p6, 0, this.lastNeed); + buf.copy(this.lastChar, p2, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } - buf.copy(this.lastChar, p6, 0, buf.length); + buf.copy(this.lastChar, p2, 0, buf.length); this.lastNeed -= buf.length; } function utf8Text(buf, i6) { @@ -38535,17 +38638,17 @@ var require_string_decoder = __commonJS({ return r6; } function base64Text(buf, i6) { - var n12 = (buf.length - i6) % 3; - if (n12 === 0) return buf.toString("base64", i6); - this.lastNeed = 3 - n12; + var n8 = (buf.length - i6) % 3; + if (n8 === 0) return buf.toString("base64", i6); + this.lastNeed = 3 - n8; this.lastTotal = 3; - if (n12 === 1) { + if (n8 === 1) { this.lastChar[0] = buf[buf.length - 1]; } else { this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; } - return buf.toString("base64", i6, buf.length - n12); + return buf.toString("base64", i6, buf.length - n8); } function base64End(buf) { var r6 = buf && buf.length ? this.write(buf) : ""; @@ -38566,23 +38669,23 @@ var require_stream_readable = __commonJS({ "node_modules/lazystream/node_modules/readable-stream/lib/_stream_readable.js"(exports2, module) { "use strict"; var pna = require_process_nextick_args(); - module.exports = Readable13; + module.exports = Readable11; var isArray = require_isarray(); var Duplex; - Readable13.ReadableState = ReadableState; + Readable11.ReadableState = ReadableState; var EE = __require("events").EventEmitter; var EElistenerCount = function(emitter, type) { return emitter.listeners(type).length; }; var Stream3 = require_stream(); - var Buffer7 = require_safe_buffer().Buffer; + var Buffer4 = require_safe_buffer().Buffer; var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { }; function _uint8ArrayToBuffer(chunk) { - return Buffer7.from(chunk); + return Buffer4.from(chunk); } function _isUint8Array(obj) { - return Buffer7.isBuffer(obj) || obj instanceof OurUint8Array; + return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array; } var util3 = Object.create(require_util10()); util3.inherits = require_inherits(); @@ -38597,7 +38700,7 @@ var require_stream_readable = __commonJS({ var BufferList = require_BufferList(); var destroyImpl = require_destroy(); var StringDecoder2; - util3.inherits(Readable13, Stream3); + util3.inherits(Readable11, Stream3); var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; function prependListener(emitter, event, fn) { if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn); @@ -38643,9 +38746,9 @@ var require_stream_readable = __commonJS({ this.encoding = options.encoding; } } - function Readable13(options) { + function Readable11(options) { Duplex = Duplex || require_stream_duplex(); - if (!(this instanceof Readable13)) return new Readable13(options); + if (!(this instanceof Readable11)) return new Readable11(options); this._readableState = new ReadableState(options, this); this.readable = true; if (options) { @@ -38654,7 +38757,7 @@ var require_stream_readable = __commonJS({ } Stream3.call(this); } - Object.defineProperty(Readable13.prototype, "destroyed", { + Object.defineProperty(Readable11.prototype, "destroyed", { get: function() { if (this._readableState === void 0) { return false; @@ -38668,20 +38771,20 @@ var require_stream_readable = __commonJS({ this._readableState.destroyed = value; } }); - Readable13.prototype.destroy = destroyImpl.destroy; - Readable13.prototype._undestroy = destroyImpl.undestroy; - Readable13.prototype._destroy = function(err, cb) { + Readable11.prototype.destroy = destroyImpl.destroy; + Readable11.prototype._undestroy = destroyImpl.undestroy; + Readable11.prototype._destroy = function(err, cb) { this.push(null); cb(err); }; - Readable13.prototype.push = function(chunk, encoding) { + Readable11.prototype.push = function(chunk, encoding) { var state4 = this._readableState; var skipChunkCheck; if (!state4.objectMode) { if (typeof chunk === "string") { encoding = encoding || state4.defaultEncoding; if (encoding !== state4.encoding) { - chunk = Buffer7.from(chunk, encoding); + chunk = Buffer4.from(chunk, encoding); encoding = ""; } skipChunkCheck = true; @@ -38691,7 +38794,7 @@ var require_stream_readable = __commonJS({ } return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; - Readable13.prototype.unshift = function(chunk) { + Readable11.prototype.unshift = function(chunk) { return readableAddChunk(this, chunk, null, true, false); }; function readableAddChunk(stream5, chunk, encoding, addToFront, skipChunkCheck) { @@ -38705,7 +38808,7 @@ var require_stream_readable = __commonJS({ if (er) { stream5.emit("error", er); } else if (state4.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== "string" && !state4.objectMode && Object.getPrototypeOf(chunk) !== Buffer7.prototype) { + if (typeof chunk !== "string" && !state4.objectMode && Object.getPrototypeOf(chunk) !== Buffer4.prototype) { chunk = _uint8ArrayToBuffer(chunk); } if (addToFront) { @@ -38751,65 +38854,65 @@ var require_stream_readable = __commonJS({ function needMoreData(state4) { return !state4.ended && (state4.needReadable || state4.length < state4.highWaterMark || state4.length === 0); } - Readable13.prototype.isPaused = function() { + Readable11.prototype.isPaused = function() { return this._readableState.flowing === false; }; - Readable13.prototype.setEncoding = function(enc) { + Readable11.prototype.setEncoding = function(enc) { if (!StringDecoder2) StringDecoder2 = require_string_decoder().StringDecoder; this._readableState.decoder = new StringDecoder2(enc); this._readableState.encoding = enc; return this; }; var MAX_HWM = 8388608; - function computeNewHighWaterMark(n12) { - if (n12 >= MAX_HWM) { - n12 = MAX_HWM; + function computeNewHighWaterMark(n8) { + if (n8 >= MAX_HWM) { + n8 = MAX_HWM; } else { - n12--; - n12 |= n12 >>> 1; - n12 |= n12 >>> 2; - n12 |= n12 >>> 4; - n12 |= n12 >>> 8; - n12 |= n12 >>> 16; - n12++; - } - return n12; - } - function howMuchToRead(n12, state4) { - if (n12 <= 0 || state4.length === 0 && state4.ended) return 0; + n8--; + n8 |= n8 >>> 1; + n8 |= n8 >>> 2; + n8 |= n8 >>> 4; + n8 |= n8 >>> 8; + n8 |= n8 >>> 16; + n8++; + } + return n8; + } + function howMuchToRead(n8, state4) { + if (n8 <= 0 || state4.length === 0 && state4.ended) return 0; if (state4.objectMode) return 1; - if (n12 !== n12) { + if (n8 !== n8) { if (state4.flowing && state4.length) return state4.buffer.head.data.length; else return state4.length; } - if (n12 > state4.highWaterMark) state4.highWaterMark = computeNewHighWaterMark(n12); - if (n12 <= state4.length) return n12; + if (n8 > state4.highWaterMark) state4.highWaterMark = computeNewHighWaterMark(n8); + if (n8 <= state4.length) return n8; if (!state4.ended) { state4.needReadable = true; return 0; } return state4.length; } - Readable13.prototype.read = function(n12) { - debug2("read", n12); - n12 = parseInt(n12, 10); + Readable11.prototype.read = function(n8) { + debug2("read", n8); + n8 = parseInt(n8, 10); var state4 = this._readableState; - var nOrig = n12; - if (n12 !== 0) state4.emittedReadable = false; - if (n12 === 0 && state4.needReadable && (state4.length >= state4.highWaterMark || state4.ended)) { + var nOrig = n8; + if (n8 !== 0) state4.emittedReadable = false; + if (n8 === 0 && state4.needReadable && (state4.length >= state4.highWaterMark || state4.ended)) { debug2("read: emitReadable", state4.length, state4.ended); if (state4.length === 0 && state4.ended) endReadable(this); else emitReadable(this); return null; } - n12 = howMuchToRead(n12, state4); - if (n12 === 0 && state4.ended) { + n8 = howMuchToRead(n8, state4); + if (n8 === 0 && state4.ended) { if (state4.length === 0) endReadable(this); return null; } var doRead = state4.needReadable; debug2("need readable", doRead); - if (state4.length === 0 || state4.length - n12 < state4.highWaterMark) { + if (state4.length === 0 || state4.length - n8 < state4.highWaterMark) { doRead = true; debug2("length less than watermark", doRead); } @@ -38823,20 +38926,20 @@ var require_stream_readable = __commonJS({ if (state4.length === 0) state4.needReadable = true; this._read(state4.highWaterMark); state4.sync = false; - if (!state4.reading) n12 = howMuchToRead(nOrig, state4); + if (!state4.reading) n8 = howMuchToRead(nOrig, state4); } var ret; - if (n12 > 0) ret = fromList(n12, state4); + if (n8 > 0) ret = fromList(n8, state4); else ret = null; if (ret === null) { state4.needReadable = true; - n12 = 0; + n8 = 0; } else { - state4.length -= n12; + state4.length -= n8; } if (state4.length === 0) { if (!state4.ended) state4.needReadable = true; - if (nOrig !== n12 && state4.ended) endReadable(this); + if (nOrig !== n8 && state4.ended) endReadable(this); } if (ret !== null) this.emit("data", ret); return ret; @@ -38885,10 +38988,10 @@ var require_stream_readable = __commonJS({ } state4.readingMore = false; } - Readable13.prototype._read = function(n12) { + Readable11.prototype._read = function(n8) { this.emit("error", new Error("_read() is not implemented")); }; - Readable13.prototype.pipe = function(dest, pipeOpts) { + Readable11.prototype.pipe = function(dest, pipeOpts) { var src = this; var state4 = this._readableState; switch (state4.pipesCount) { @@ -38993,7 +39096,7 @@ var require_stream_readable = __commonJS({ } }; } - Readable13.prototype.unpipe = function(dest) { + Readable11.prototype.unpipe = function(dest) { var state4 = this._readableState; var unpipeInfo = { hasUnpiped: false }; if (state4.pipesCount === 0) return this; @@ -39025,7 +39128,7 @@ var require_stream_readable = __commonJS({ dest.emit("unpipe", this, unpipeInfo); return this; }; - Readable13.prototype.on = function(ev, fn) { + Readable11.prototype.on = function(ev, fn) { var res = Stream3.prototype.on.call(this, ev, fn); if (ev === "data") { if (this._readableState.flowing !== false) this.resume(); @@ -39043,12 +39146,12 @@ var require_stream_readable = __commonJS({ } return res; }; - Readable13.prototype.addListener = Readable13.prototype.on; + Readable11.prototype.addListener = Readable11.prototype.on; function nReadingNextTick(self2) { debug2("readable nexttick read 0"); self2.read(0); } - Readable13.prototype.resume = function() { + Readable11.prototype.resume = function() { var state4 = this._readableState; if (!state4.flowing) { debug2("resume"); @@ -39074,7 +39177,7 @@ var require_stream_readable = __commonJS({ flow(stream5); if (state4.flowing && !state4.reading) stream5.read(0); } - Readable13.prototype.pause = function() { + Readable11.prototype.pause = function() { debug2("call pause flowing=%j", this._readableState.flowing); if (false !== this._readableState.flowing) { debug2("pause"); @@ -39089,7 +39192,7 @@ var require_stream_readable = __commonJS({ while (state4.flowing && stream5.read() !== null) { } } - Readable13.prototype.wrap = function(stream5) { + Readable11.prototype.wrap = function(stream5) { var _this = this; var state4 = this._readableState; var paused = false; @@ -39121,11 +39224,11 @@ var require_stream_readable = __commonJS({ })(i6); } } - for (var n12 = 0; n12 < kProxyEvents.length; n12++) { - stream5.on(kProxyEvents[n12], this.emit.bind(this, kProxyEvents[n12])); + for (var n8 = 0; n8 < kProxyEvents.length; n8++) { + stream5.on(kProxyEvents[n8], this.emit.bind(this, kProxyEvents[n8])); } - this._read = function(n13) { - debug2("wrapped _read", n13); + this._read = function(n9) { + debug2("wrapped _read", n9); if (paused) { paused = false; stream5.resume(); @@ -39133,7 +39236,7 @@ var require_stream_readable = __commonJS({ }; return this; }; - Object.defineProperty(Readable13.prototype, "readableHighWaterMark", { + Object.defineProperty(Readable11.prototype, "readableHighWaterMark", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail @@ -39142,52 +39245,52 @@ var require_stream_readable = __commonJS({ return this._readableState.highWaterMark; } }); - Readable13._fromList = fromList; - function fromList(n12, state4) { + Readable11._fromList = fromList; + function fromList(n8, state4) { if (state4.length === 0) return null; var ret; if (state4.objectMode) ret = state4.buffer.shift(); - else if (!n12 || n12 >= state4.length) { + else if (!n8 || n8 >= state4.length) { if (state4.decoder) ret = state4.buffer.join(""); else if (state4.buffer.length === 1) ret = state4.buffer.head.data; else ret = state4.buffer.concat(state4.length); state4.buffer.clear(); } else { - ret = fromListPartial(n12, state4.buffer, state4.decoder); + ret = fromListPartial(n8, state4.buffer, state4.decoder); } return ret; } - function fromListPartial(n12, list, hasStrings) { + function fromListPartial(n8, list, hasStrings) { var ret; - if (n12 < list.head.data.length) { - ret = list.head.data.slice(0, n12); - list.head.data = list.head.data.slice(n12); - } else if (n12 === list.head.data.length) { + if (n8 < list.head.data.length) { + ret = list.head.data.slice(0, n8); + list.head.data = list.head.data.slice(n8); + } else if (n8 === list.head.data.length) { ret = list.shift(); } else { - ret = hasStrings ? copyFromBufferString(n12, list) : copyFromBuffer(n12, list); + ret = hasStrings ? copyFromBufferString(n8, list) : copyFromBuffer(n8, list); } return ret; } - function copyFromBufferString(n12, list) { - var p6 = list.head; + function copyFromBufferString(n8, list) { + var p2 = list.head; var c6 = 1; - var ret = p6.data; - n12 -= ret.length; - while (p6 = p6.next) { - var str = p6.data; - var nb = n12 > str.length ? str.length : n12; + var ret = p2.data; + n8 -= ret.length; + while (p2 = p2.next) { + var str = p2.data; + var nb = n8 > str.length ? str.length : n8; if (nb === str.length) ret += str; - else ret += str.slice(0, n12); - n12 -= nb; - if (n12 === 0) { + else ret += str.slice(0, n8); + n8 -= nb; + if (n8 === 0) { if (nb === str.length) { ++c6; - if (p6.next) list.head = p6.next; + if (p2.next) list.head = p2.next; else list.head = list.tail = null; } else { - list.head = p6; - p6.data = str.slice(nb); + list.head = p2; + p2.data = str.slice(nb); } break; } @@ -39196,25 +39299,25 @@ var require_stream_readable = __commonJS({ list.length -= c6; return ret; } - function copyFromBuffer(n12, list) { - var ret = Buffer7.allocUnsafe(n12); - var p6 = list.head; + function copyFromBuffer(n8, list) { + var ret = Buffer4.allocUnsafe(n8); + var p2 = list.head; var c6 = 1; - p6.data.copy(ret); - n12 -= p6.data.length; - while (p6 = p6.next) { - var buf = p6.data; - var nb = n12 > buf.length ? buf.length : n12; - buf.copy(ret, ret.length - n12, 0, nb); - n12 -= nb; - if (n12 === 0) { + p2.data.copy(ret); + n8 -= p2.data.length; + while (p2 = p2.next) { + var buf = p2.data; + var nb = n8 > buf.length ? buf.length : n8; + buf.copy(ret, ret.length - n8, 0, nb); + n8 -= nb; + if (n8 === 0) { if (nb === buf.length) { ++c6; - if (p6.next) list.head = p6.next; + if (p2.next) list.head = p2.next; else list.head = list.tail = null; } else { - list.head = p6; - p6.data = buf.slice(nb); + list.head = p2; + p2.data = buf.slice(nb); } break; } @@ -39238,9 +39341,9 @@ var require_stream_readable = __commonJS({ stream5.emit("end"); } } - function indexOf(xs2, x6) { - for (var i6 = 0, l6 = xs2.length; i6 < l6; i6++) { - if (xs2[i6] === x6) return i6; + function indexOf(xs2, x2) { + for (var i6 = 0, l3 = xs2.length; i6 < l3; i6++) { + if (xs2[i6] === x2) return i6; } return -1; } @@ -39320,7 +39423,7 @@ var require_stream_transform = __commonJS({ if (ts2.needTransform || rs2.needReadable || rs2.length < rs2.highWaterMark) this._read(rs2.highWaterMark); } }; - Transform4.prototype._read = function(n12) { + Transform4.prototype._read = function(n8) { var ts2 = this._transformState; if (ts2.writechunk !== null && ts2.writecb && !ts2.transforming) { ts2.transforming = true; @@ -39407,11 +39510,11 @@ var require_lazystream = __commonJS({ var util3 = __require("util"); var PassThrough5 = require_passthrough(); module.exports = { - Readable: Readable13, - Writable: Writable2 + Readable: Readable11, + Writable: Writable3 }; - util3.inherits(Readable13, PassThrough5); - util3.inherits(Writable2, PassThrough5); + util3.inherits(Readable11, PassThrough5); + util3.inherits(Writable3, PassThrough5); function beforeFirstCall(instance, method, callback) { instance[method] = function() { delete instance[method]; @@ -39419,9 +39522,9 @@ var require_lazystream = __commonJS({ return this[method].apply(this, arguments); }; } - function Readable13(fn, options) { - if (!(this instanceof Readable13)) - return new Readable13(fn, options); + function Readable11(fn, options) { + if (!(this instanceof Readable11)) + return new Readable11(fn, options); PassThrough5.call(this, options); beforeFirstCall(this, "_read", function() { var source = fn.call(this, options); @@ -39431,9 +39534,9 @@ var require_lazystream = __commonJS({ }); this.emit("readable"); } - function Writable2(fn, options) { - if (!(this instanceof Writable2)) - return new Writable2(fn, options); + function Writable3(fn, options) { + if (!(this instanceof Writable3)) + return new Writable3(fn, options); PassThrough5.call(this, options); beforeFirstCall(this, "_write", function() { var destination = fn.call(this, options); @@ -39560,8 +39663,8 @@ var require_root = __commonJS({ "use strict"; var freeGlobal = require_freeGlobal(); var freeSelf = typeof self == "object" && self && self.Object === Object && self; - var root = freeGlobal || freeSelf || Function("return this")(); - module.exports = root; + var root6 = freeGlobal || freeSelf || Function("return this")(); + module.exports = root6; } }); @@ -39569,8 +39672,8 @@ var require_root = __commonJS({ var require_Symbol = __commonJS({ "node_modules/lodash/_Symbol.js"(exports2, module) { "use strict"; - var root = require_root(); - var Symbol2 = root.Symbol; + var root6 = require_root(); + var Symbol2 = root6.Symbol; module.exports = Symbol2; } }); @@ -39660,14 +39763,14 @@ var require_isFunction = __commonJS({ var funcTag = "[object Function]"; var genTag = "[object GeneratorFunction]"; var proxyTag = "[object Proxy]"; - function isFunction2(value) { + function isFunction3(value) { if (!isObject2(value)) { return false; } var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } - module.exports = isFunction2; + module.exports = isFunction3; } }); @@ -39675,8 +39778,8 @@ var require_isFunction = __commonJS({ var require_coreJsData = __commonJS({ "node_modules/lodash/_coreJsData.js"(exports2, module) { "use strict"; - var root = require_root(); - var coreJsData = root["__core-js_shared__"]; + var root6 = require_root(); + var coreJsData = root6["__core-js_shared__"]; module.exports = coreJsData; } }); @@ -39724,7 +39827,7 @@ var require_toSource = __commonJS({ var require_baseIsNative = __commonJS({ "node_modules/lodash/_baseIsNative.js"(exports2, module) { "use strict"; - var isFunction2 = require_isFunction(); + var isFunction3 = require_isFunction(); var isMasked = require_isMasked(); var isObject2 = require_isObject(); var toSource = require_toSource(); @@ -39741,7 +39844,7 @@ var require_baseIsNative = __commonJS({ if (!isObject2(value) || isMasked(value)) { return false; } - var pattern = isFunction2(value) ? reIsNative : reIsHostCtor; + var pattern = isFunction3(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } module.exports = baseIsNative; @@ -39887,10 +39990,10 @@ var require_isLength = __commonJS({ var require_isArrayLike = __commonJS({ "node_modules/lodash/isArrayLike.js"(exports2, module) { "use strict"; - var isFunction2 = require_isFunction(); + var isFunction3 = require_isFunction(); var isLength = require_isLength(); function isArrayLike2(value) { - return value != null && isLength(value.length) && !isFunction2(value); + return value != null && isLength(value.length) && !isFunction3(value); } module.exports = isArrayLike2; } @@ -39937,9 +40040,9 @@ var require_isIterateeCall = __commonJS({ var require_baseTimes = __commonJS({ "node_modules/lodash/_baseTimes.js"(exports2, module) { "use strict"; - function baseTimes(n12, iteratee) { - var index2 = -1, result = Array(n12); - while (++index2 < n12) { + function baseTimes(n8, iteratee) { + var index2 = -1, result = Array(n8); + while (++index2 < n8) { result[index2] = iteratee(index2); } return result; @@ -40015,13 +40118,13 @@ var require_stubFalse = __commonJS({ var require_isBuffer = __commonJS({ "node_modules/lodash/isBuffer.js"(exports2, module) { "use strict"; - var root = require_root(); + var root6 = require_root(); var stubFalse = require_stubFalse(); var freeExports = typeof exports2 == "object" && exports2 && !exports2.nodeType && exports2; var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; var moduleExports = freeModule && freeModule.exports === freeExports; - var Buffer7 = moduleExports ? root.Buffer : void 0; - var nativeIsBuffer = Buffer7 ? Buffer7.isBuffer : void 0; + var Buffer4 = moduleExports ? root6.Buffer : void 0; + var nativeIsBuffer = Buffer4 ? Buffer4.isBuffer : void 0; var isBuffer = nativeIsBuffer || stubFalse; module.exports = isBuffer; } @@ -40378,8 +40481,8 @@ var require_inspect = __commonJS({ "node_modules/archiver-utils/node_modules/readable-stream/lib/ours/util/inspect.js"(exports2, module) { "use strict"; module.exports = { - format(format2, ...args) { - return format2.replace(/%([sdifj])/g, function(...[_unused, type]) { + format(format4, ...args) { + return format4.replace(/%([sdifj])/g, function(...[_unused, type]) { const replacement = args.shift(); if (type === "f") { return replacement.toFixed(6); @@ -40428,7 +40531,7 @@ var require_inspect = __commonJS({ var require_errors3 = __commonJS({ "node_modules/archiver-utils/node_modules/readable-stream/lib/ours/errors.js"(exports2, module) { "use strict"; - var { format: format2, inspect: inspect2 } = require_inspect(); + var { format: format4, inspect: inspect3 } = require_inspect(); var { AggregateError: CustomAggregateError } = require_primordials(); var AggregateError = globalThis.AggregateError || CustomAggregateError; var kIsNodeError = /* @__PURE__ */ Symbol("kIsNodeError"); @@ -40478,9 +40581,9 @@ var require_errors3 = __commonJS({ if (args.length === 0) { return msg; } - return format2(msg, ...args); + return format4(msg, ...args); } - function E2(code, message, Base) { + function E(code, message, Base) { if (!Base) { Base = Error; } @@ -40541,8 +40644,8 @@ var require_errors3 = __commonJS({ this.name = "AbortError"; } }; - E2("ERR_ASSERTION", "%s", Error); - E2( + E("ERR_ASSERTION", "%s", Error); + E( "ERR_INVALID_ARG_TYPE", (name, expected, actual) => { assert2(typeof name === "string", "'name' must be a string"); @@ -40637,13 +40740,13 @@ var require_errors3 = __commonJS({ if ((_actual$constructor = actual.constructor) !== null && _actual$constructor !== void 0 && _actual$constructor.name) { msg += `. Received an instance of ${actual.constructor.name}`; } else { - const inspected = inspect2(actual, { + const inspected = inspect3(actual, { depth: -1 }); msg += `. Received ${inspected}`; } } else { - let inspected = inspect2(actual, { + let inspected = inspect3(actual, { colors: false }); if (inspected.length > 25) { @@ -40655,10 +40758,10 @@ var require_errors3 = __commonJS({ }, TypeError ); - E2( + E( "ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => { - let inspected = inspect2(value); + let inspected = inspect3(value); if (inspected.length > 128) { inspected = inspected.slice(0, 128) + "..."; } @@ -40667,7 +40770,7 @@ var require_errors3 = __commonJS({ }, TypeError ); - E2( + E( "ERR_INVALID_RETURN_VALUE", (input, name, value) => { var _value$constructor; @@ -40676,7 +40779,7 @@ var require_errors3 = __commonJS({ }, TypeError ); - E2( + E( "ERR_MISSING_ARGS", (...args) => { assert2(args.length > 0, "At least one arg needs to be specified"); @@ -40701,7 +40804,7 @@ var require_errors3 = __commonJS({ }, TypeError ); - E2( + E( "ERR_OUT_OF_RANGE", (str, range6, input) => { assert2(range6, 'Missing "range" argument'); @@ -40716,23 +40819,23 @@ var require_errors3 = __commonJS({ } received += "n"; } else { - received = inspect2(input); + received = inspect3(input); } return `The value of "${str}" is out of range. It must be ${range6}. Received ${received}`; }, RangeError ); - E2("ERR_MULTIPLE_CALLBACK", "Callback called multiple times", Error); - E2("ERR_METHOD_NOT_IMPLEMENTED", "The %s method is not implemented", Error); - E2("ERR_STREAM_ALREADY_FINISHED", "Cannot call %s after a stream was finished", Error); - E2("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable", Error); - E2("ERR_STREAM_DESTROYED", "Cannot call %s after a stream was destroyed", Error); - E2("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); - E2("ERR_STREAM_PREMATURE_CLOSE", "Premature close", Error); - E2("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF", Error); - E2("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event", Error); - E2("ERR_STREAM_WRITE_AFTER_END", "write after end", Error); - E2("ERR_UNKNOWN_ENCODING", "Unknown encoding: %s", TypeError); + E("ERR_MULTIPLE_CALLBACK", "Callback called multiple times", Error); + E("ERR_METHOD_NOT_IMPLEMENTED", "The %s method is not implemented", Error); + E("ERR_STREAM_ALREADY_FINISHED", "Cannot call %s after a stream was finished", Error); + E("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable", Error); + E("ERR_STREAM_DESTROYED", "Cannot call %s after a stream was destroyed", Error); + E("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); + E("ERR_STREAM_PREMATURE_CLOSE", "Premature close", Error); + E("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF", Error); + E("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event", Error); + E("ERR_STREAM_WRITE_AFTER_END", "write after end", Error); + E("ERR_UNKNOWN_ENCODING", "Unknown encoding: %s", TypeError); module.exports = { AbortError: AbortError4, aggregateTwoErrors: hideStackFrames(aggregateTwoErrors), @@ -41065,8 +41168,8 @@ var require_event_target_shim = __commonJS({ var CAPTURE = 1; var BUBBLE = 2; var ATTRIBUTE = 3; - function isObject2(x6) { - return x6 !== null && typeof x6 === "object"; + function isObject2(x2) { + return x2 !== null && typeof x2 === "object"; } function getListeners(eventTarget) { const listeners = listenersMap.get(eventTarget); @@ -41415,7 +41518,7 @@ var require_util11 = __commonJS({ "node_modules/archiver-utils/node_modules/readable-stream/lib/ours/util.js"(exports2, module) { "use strict"; var bufferModule = __require("buffer"); - var { format: format2, inspect: inspect2 } = require_inspect(); + var { format: format4, inspect: inspect3 } = require_inspect(); var { codes: { ERR_INVALID_ARG_TYPE } } = require_errors3(); @@ -41454,25 +41557,25 @@ var require_util11 = __commonJS({ }; }, createDeferredPromise: function() { - let resolve4; + let resolve8; let reject2; const promise = new Promise((res, rej) => { - resolve4 = res; + resolve8 = res; reject2 = rej; }); return { promise, - resolve: resolve4, + resolve: resolve8, reject: reject2 }; }, promisify(fn) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { fn((err, ...args) => { if (err) { return reject2(err); } - return resolve4(...args); + return resolve8(...args); }); }); }, @@ -41480,8 +41583,8 @@ var require_util11 = __commonJS({ return function() { }; }, - format: format2, - inspect: inspect2, + format: format4, + inspect: inspect3, types: { isAsyncFunction(fn) { return fn instanceof AsyncFunction; @@ -41642,7 +41745,7 @@ var require_validators = __commonJS({ var validateOneOf = hideStackFrames((value, name, oneOf) => { if (!ArrayPrototypeIncludes(oneOf, value)) { const allowed = ArrayPrototypeJoin( - ArrayPrototypeMap(oneOf, (v8) => typeof v8 === "string" ? `'${v8}'` : String2(v8)), + ArrayPrototypeMap(oneOf, (v2) => typeof v2 === "string" ? `'${v2}'` : String2(v2)), ", " ); const reason = "must be one of: " + allowed; @@ -42264,7 +42367,7 @@ var require_end_of_stream = __commonJS({ validateBoolean(opts.cleanup, "cleanup"); autoCleanup = opts.cleanup; } - return new Promise2((resolve4, reject2) => { + return new Promise2((resolve8, reject2) => { const cleanup = eos(stream5, opts, (err) => { if (autoCleanup) { cleanup(); @@ -42272,7 +42375,7 @@ var require_end_of_stream = __commonJS({ if (err) { reject2(err); } else { - resolve4(); + resolve8(); } }); }); @@ -42296,11 +42399,11 @@ var require_destroy2 = __commonJS({ var { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils3(); var kDestroy = Symbol2("kDestroy"); var kConstruct = Symbol2("kConstruct"); - function checkError(err, w5, r6) { + function checkError(err, w, r6) { if (err) { err.stack; - if (w5 && !w5.errored) { - w5.errored = err; + if (w && !w.errored) { + w.errored = err; } if (r6 && !r6.errored) { r6.errored = err; @@ -42309,22 +42412,22 @@ var require_destroy2 = __commonJS({ } function destroy2(err, cb) { const r6 = this._readableState; - const w5 = this._writableState; - const s6 = w5 || r6; - if (w5 !== null && w5 !== void 0 && w5.destroyed || r6 !== null && r6 !== void 0 && r6.destroyed) { + const w = this._writableState; + const s = w || r6; + if (w !== null && w !== void 0 && w.destroyed || r6 !== null && r6 !== void 0 && r6.destroyed) { if (typeof cb === "function") { cb(); } return this; } - checkError(err, w5, r6); - if (w5) { - w5.destroyed = true; + checkError(err, w, r6); + if (w) { + w.destroyed = true; } if (r6) { r6.destroyed = true; } - if (!s6.constructed) { + if (!s.constructed) { this.once(kDestroy, function(er) { _destroy(this, aggregateTwoErrors(er, err), cb); }); @@ -42341,10 +42444,10 @@ var require_destroy2 = __commonJS({ } called = true; const r6 = self2._readableState; - const w5 = self2._writableState; - checkError(err2, w5, r6); - if (w5) { - w5.closed = true; + const w = self2._writableState; + checkError(err2, w, r6); + if (w) { + w.closed = true; } if (r6) { r6.closed = true; @@ -42370,25 +42473,25 @@ var require_destroy2 = __commonJS({ } function emitCloseNT(self2) { const r6 = self2._readableState; - const w5 = self2._writableState; - if (w5) { - w5.closeEmitted = true; + const w = self2._writableState; + if (w) { + w.closeEmitted = true; } if (r6) { r6.closeEmitted = true; } - if (w5 !== null && w5 !== void 0 && w5.emitClose || r6 !== null && r6 !== void 0 && r6.emitClose) { + if (w !== null && w !== void 0 && w.emitClose || r6 !== null && r6 !== void 0 && r6.emitClose) { self2.emit("close"); } } function emitErrorNT(self2, err) { const r6 = self2._readableState; - const w5 = self2._writableState; - if (w5 !== null && w5 !== void 0 && w5.errorEmitted || r6 !== null && r6 !== void 0 && r6.errorEmitted) { + const w = self2._writableState; + if (w !== null && w !== void 0 && w.errorEmitted || r6 !== null && r6 !== void 0 && r6.errorEmitted) { return; } - if (w5) { - w5.errorEmitted = true; + if (w) { + w.errorEmitted = true; } if (r6) { r6.errorEmitted = true; @@ -42397,7 +42500,7 @@ var require_destroy2 = __commonJS({ } function undestroy() { const r6 = this._readableState; - const w5 = this._writableState; + const w = this._writableState; if (r6) { r6.constructed = true; r6.closed = false; @@ -42409,32 +42512,32 @@ var require_destroy2 = __commonJS({ r6.ended = r6.readable === false; r6.endEmitted = r6.readable === false; } - if (w5) { - w5.constructed = true; - w5.destroyed = false; - w5.closed = false; - w5.closeEmitted = false; - w5.errored = null; - w5.errorEmitted = false; - w5.finalCalled = false; - w5.prefinished = false; - w5.ended = w5.writable === false; - w5.ending = w5.writable === false; - w5.finished = w5.writable === false; + if (w) { + w.constructed = true; + w.destroyed = false; + w.closed = false; + w.closeEmitted = false; + w.errored = null; + w.errorEmitted = false; + w.finalCalled = false; + w.prefinished = false; + w.ended = w.writable === false; + w.ending = w.writable === false; + w.finished = w.writable === false; } } function errorOrDestroy(stream5, err, sync2) { const r6 = stream5._readableState; - const w5 = stream5._writableState; - if (w5 !== null && w5 !== void 0 && w5.destroyed || r6 !== null && r6 !== void 0 && r6.destroyed) { + const w = stream5._writableState; + if (w !== null && w !== void 0 && w.destroyed || r6 !== null && r6 !== void 0 && r6.destroyed) { return this; } - if (r6 !== null && r6 !== void 0 && r6.autoDestroy || w5 !== null && w5 !== void 0 && w5.autoDestroy) + if (r6 !== null && r6 !== void 0 && r6.autoDestroy || w !== null && w !== void 0 && w.autoDestroy) stream5.destroy(err); else if (err) { err.stack; - if (w5 && !w5.errored) { - w5.errored = err; + if (w && !w.errored) { + w.errored = err; } if (r6 && !r6.errored) { r6.errored = err; @@ -42451,12 +42554,12 @@ var require_destroy2 = __commonJS({ return; } const r6 = stream5._readableState; - const w5 = stream5._writableState; + const w = stream5._writableState; if (r6) { r6.constructed = false; } - if (w5) { - w5.constructed = false; + if (w) { + w.constructed = false; } stream5.once(kConstruct, cb); if (stream5.listenerCount(kConstruct) > 1) { @@ -42473,15 +42576,15 @@ var require_destroy2 = __commonJS({ } called = true; const r6 = stream5._readableState; - const w5 = stream5._writableState; - const s6 = w5 || r6; + const w = stream5._writableState; + const s = w || r6; if (r6) { r6.constructed = true; } - if (w5) { - w5.constructed = true; + if (w) { + w.constructed = true; } - if (s6.destroyed) { + if (s.destroyed) { stream5.emit(kDestroy, err); } else if (err) { errorOrDestroy(stream5, err, true); @@ -42681,17 +42784,17 @@ var require_buffer_list = __commonJS({ "node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports2, module) { "use strict"; var { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array: Uint8Array2 } = require_primordials(); - var { Buffer: Buffer7 } = __require("buffer"); - var { inspect: inspect2 } = require_util11(); + var { Buffer: Buffer4 } = __require("buffer"); + var { inspect: inspect3 } = require_util11(); module.exports = class BufferList { constructor() { this.head = null; this.tail = null; this.length = 0; } - push(v8) { + push(v2) { const entry = { - data: v8, + data: v2, next: null }; if (this.length > 0) this.tail.next = entry; @@ -42699,9 +42802,9 @@ var require_buffer_list = __commonJS({ this.tail = entry; ++this.length; } - unshift(v8) { + unshift(v2) { const entry = { - data: v8, + data: v2, next: this.head }; if (this.length === 0) this.tail = entry; @@ -42720,106 +42823,106 @@ var require_buffer_list = __commonJS({ this.head = this.tail = null; this.length = 0; } - join(s6) { + join(s) { if (this.length === 0) return ""; - let p6 = this.head; - let ret = "" + p6.data; - while ((p6 = p6.next) !== null) ret += s6 + p6.data; + let p2 = this.head; + let ret = "" + p2.data; + while ((p2 = p2.next) !== null) ret += s + p2.data; return ret; } - concat(n12) { - if (this.length === 0) return Buffer7.alloc(0); - const ret = Buffer7.allocUnsafe(n12 >>> 0); - let p6 = this.head; + concat(n8) { + if (this.length === 0) return Buffer4.alloc(0); + const ret = Buffer4.allocUnsafe(n8 >>> 0); + let p2 = this.head; let i6 = 0; - while (p6) { - TypedArrayPrototypeSet(ret, p6.data, i6); - i6 += p6.data.length; - p6 = p6.next; + while (p2) { + TypedArrayPrototypeSet(ret, p2.data, i6); + i6 += p2.data.length; + p2 = p2.next; } return ret; } // Consumes a specified amount of bytes or characters from the buffered data. - consume(n12, hasStrings) { + consume(n8, hasStrings) { const data = this.head.data; - if (n12 < data.length) { - const slice = data.slice(0, n12); - this.head.data = data.slice(n12); + if (n8 < data.length) { + const slice = data.slice(0, n8); + this.head.data = data.slice(n8); return slice; } - if (n12 === data.length) { + if (n8 === data.length) { return this.shift(); } - return hasStrings ? this._getString(n12) : this._getBuffer(n12); + return hasStrings ? this._getString(n8) : this._getBuffer(n8); } first() { return this.head.data; } *[SymbolIterator]() { - for (let p6 = this.head; p6; p6 = p6.next) { - yield p6.data; + for (let p2 = this.head; p2; p2 = p2.next) { + yield p2.data; } } // Consumes a specified amount of characters from the buffered data. - _getString(n12) { + _getString(n8) { let ret = ""; - let p6 = this.head; + let p2 = this.head; let c6 = 0; do { - const str = p6.data; - if (n12 > str.length) { + const str = p2.data; + if (n8 > str.length) { ret += str; - n12 -= str.length; + n8 -= str.length; } else { - if (n12 === str.length) { + if (n8 === str.length) { ret += str; ++c6; - if (p6.next) this.head = p6.next; + if (p2.next) this.head = p2.next; else this.head = this.tail = null; } else { - ret += StringPrototypeSlice(str, 0, n12); - this.head = p6; - p6.data = StringPrototypeSlice(str, n12); + ret += StringPrototypeSlice(str, 0, n8); + this.head = p2; + p2.data = StringPrototypeSlice(str, n8); } break; } ++c6; - } while ((p6 = p6.next) !== null); + } while ((p2 = p2.next) !== null); this.length -= c6; return ret; } // Consumes a specified amount of bytes from the buffered data. - _getBuffer(n12) { - const ret = Buffer7.allocUnsafe(n12); - const retLen = n12; - let p6 = this.head; + _getBuffer(n8) { + const ret = Buffer4.allocUnsafe(n8); + const retLen = n8; + let p2 = this.head; let c6 = 0; do { - const buf = p6.data; - if (n12 > buf.length) { - TypedArrayPrototypeSet(ret, buf, retLen - n12); - n12 -= buf.length; + const buf = p2.data; + if (n8 > buf.length) { + TypedArrayPrototypeSet(ret, buf, retLen - n8); + n8 -= buf.length; } else { - if (n12 === buf.length) { - TypedArrayPrototypeSet(ret, buf, retLen - n12); + if (n8 === buf.length) { + TypedArrayPrototypeSet(ret, buf, retLen - n8); ++c6; - if (p6.next) this.head = p6.next; + if (p2.next) this.head = p2.next; else this.head = this.tail = null; } else { - TypedArrayPrototypeSet(ret, new Uint8Array2(buf.buffer, buf.byteOffset, n12), retLen - n12); - this.head = p6; - p6.data = buf.slice(n12); + TypedArrayPrototypeSet(ret, new Uint8Array2(buf.buffer, buf.byteOffset, n8), retLen - n8); + this.head = p2; + p2.data = buf.slice(n8); } break; } ++c6; - } while ((p6 = p6.next) !== null); + } while ((p2 = p2.next) !== null); this.length -= c6; return ret; } // Make sure the linked list only shows the minimal necessary information. [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")](_3, options) { - return inspect2(this, { + return inspect3(this, { ...options, // Only inspect one level. depth: 0, @@ -42878,34 +42981,34 @@ var require_safe_buffer2 = __commonJS({ "node_modules/archiver-utils/node_modules/safe-buffer/index.js"(exports2, module) { "use strict"; var buffer2 = __require("buffer"); - var Buffer7 = buffer2.Buffer; + var Buffer4 = buffer2.Buffer; function copyProps(src, dst) { for (var key in src) { dst[key] = src[key]; } } - if (Buffer7.from && Buffer7.alloc && Buffer7.allocUnsafe && Buffer7.allocUnsafeSlow) { + if (Buffer4.from && Buffer4.alloc && Buffer4.allocUnsafe && Buffer4.allocUnsafeSlow) { module.exports = buffer2; } else { copyProps(buffer2, exports2); exports2.Buffer = SafeBuffer; } function SafeBuffer(arg, encodingOrOffset, length) { - return Buffer7(arg, encodingOrOffset, length); + return Buffer4(arg, encodingOrOffset, length); } - SafeBuffer.prototype = Object.create(Buffer7.prototype); - copyProps(Buffer7, SafeBuffer); + SafeBuffer.prototype = Object.create(Buffer4.prototype); + copyProps(Buffer4, SafeBuffer); SafeBuffer.from = function(arg, encodingOrOffset, length) { if (typeof arg === "number") { throw new TypeError("Argument must not be a number"); } - return Buffer7(arg, encodingOrOffset, length); + return Buffer4(arg, encodingOrOffset, length); }; SafeBuffer.alloc = function(size, fill, encoding) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } - var buf = Buffer7(size); + var buf = Buffer4(size); if (fill !== void 0) { if (typeof encoding === "string") { buf.fill(fill, encoding); @@ -42921,7 +43024,7 @@ var require_safe_buffer2 = __commonJS({ if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } - return Buffer7(size); + return Buffer4(size); }; SafeBuffer.allocUnsafeSlow = function(size) { if (typeof size !== "number") { @@ -42936,8 +43039,8 @@ var require_safe_buffer2 = __commonJS({ var require_string_decoder2 = __commonJS({ "node_modules/archiver-utils/node_modules/string_decoder/lib/string_decoder.js"(exports2) { "use strict"; - var Buffer7 = require_safe_buffer2().Buffer; - var isEncoding = Buffer7.isEncoding || function(encoding) { + var Buffer4 = require_safe_buffer2().Buffer; + var isEncoding = Buffer4.isEncoding || function(encoding) { encoding = "" + encoding; switch (encoding && encoding.toLowerCase()) { case "hex": @@ -42985,7 +43088,7 @@ var require_string_decoder2 = __commonJS({ } function normalizeEncoding(enc) { var nenc = _normalizeEncoding(enc); - if (typeof nenc !== "string" && (Buffer7.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); + if (typeof nenc !== "string" && (Buffer4.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); return nenc || enc; } exports2.StringDecoder = StringDecoder2; @@ -43014,7 +43117,7 @@ var require_string_decoder2 = __commonJS({ } this.lastNeed = 0; this.lastTotal = 0; - this.lastChar = Buffer7.allocUnsafe(nb); + this.lastChar = Buffer4.allocUnsafe(nb); } StringDecoder2.prototype.write = function(buf) { if (buf.length === 0) return ""; @@ -43073,7 +43176,7 @@ var require_string_decoder2 = __commonJS({ } return 0; } - function utf8CheckExtraBytes(self2, buf, p6) { + function utf8CheckExtraBytes(self2, buf, p2) { if ((buf[0] & 192) !== 128) { self2.lastNeed = 0; return "\uFFFD"; @@ -43092,14 +43195,14 @@ var require_string_decoder2 = __commonJS({ } } function utf8FillLast(buf) { - var p6 = this.lastTotal - this.lastNeed; - var r6 = utf8CheckExtraBytes(this, buf, p6); + var p2 = this.lastTotal - this.lastNeed; + var r6 = utf8CheckExtraBytes(this, buf, p2); if (r6 !== void 0) return r6; if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p6, 0, this.lastNeed); + buf.copy(this.lastChar, p2, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } - buf.copy(this.lastChar, p6, 0, buf.length); + buf.copy(this.lastChar, p2, 0, buf.length); this.lastNeed -= buf.length; } function utf8Text(buf, i6) { @@ -43144,17 +43247,17 @@ var require_string_decoder2 = __commonJS({ return r6; } function base64Text(buf, i6) { - var n12 = (buf.length - i6) % 3; - if (n12 === 0) return buf.toString("base64", i6); - this.lastNeed = 3 - n12; + var n8 = (buf.length - i6) % 3; + if (n8 === 0) return buf.toString("base64", i6); + this.lastNeed = 3 - n8; this.lastTotal = 3; - if (n12 === 1) { + if (n8 === 1) { this.lastChar[0] = buf[buf.length - 1]; } else { this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; } - return buf.toString("base64", i6, buf.length - n12); + return buf.toString("base64", i6, buf.length - n8); } function base64End(buf) { var r6 = buf && buf.length ? this.write(buf) : ""; @@ -43176,12 +43279,12 @@ var require_from = __commonJS({ "use strict"; var process5 = require_process(); var { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require_primordials(); - var { Buffer: Buffer7 } = __require("buffer"); + var { Buffer: Buffer4 } = __require("buffer"); var { ERR_INVALID_ARG_TYPE, ERR_STREAM_NULL_VALUES } = require_errors3().codes; - function from(Readable13, iterable, opts) { + function from(Readable11, iterable, opts) { let iterator2; - if (typeof iterable === "string" || iterable instanceof Buffer7) { - return new Readable13({ + if (typeof iterable === "string" || iterable instanceof Buffer4) { + return new Readable11({ objectMode: true, ...opts, read() { @@ -43200,7 +43303,7 @@ var require_from = __commonJS({ } else { throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable); } - const readable = new Readable13({ + const readable = new Readable11({ objectMode: true, highWaterMark: 1, // TODO(ronag): What options should be allowed? @@ -43284,11 +43387,11 @@ var require_readable3 = __commonJS({ SymbolAsyncIterator, Symbol: Symbol2 } = require_primordials(); - module.exports = Readable13; - Readable13.ReadableState = ReadableState; + module.exports = Readable11; + Readable11.ReadableState = ReadableState; var { EventEmitter: EE } = __require("events"); var { Stream: Stream3, prependListener } = require_legacy(); - var { Buffer: Buffer7 } = __require("buffer"); + var { Buffer: Buffer4 } = __require("buffer"); var { addAbortSignal } = require_add_abort_signal(); var eos = require_end_of_stream(); var debug2 = require_util11().debuglog("stream", (fn) => { @@ -43312,8 +43415,8 @@ var require_readable3 = __commonJS({ var kPaused = Symbol2("kPaused"); var { StringDecoder: StringDecoder2 } = require_string_decoder2(); var from = require_from(); - ObjectSetPrototypeOf(Readable13.prototype, Stream3.prototype); - ObjectSetPrototypeOf(Readable13, Stream3); + ObjectSetPrototypeOf(Readable11.prototype, Stream3.prototype); + ObjectSetPrototypeOf(Readable11, Stream3); var nop = () => { }; var { errorOrDestroy } = destroyImpl; @@ -43408,8 +43511,8 @@ var require_readable3 = __commonJS({ this.encoding = options.encoding; } } - function Readable13(options) { - if (!(this instanceof Readable13)) return new Readable13(options); + function Readable11(options) { + if (!(this instanceof Readable11)) return new Readable11(options); const isDuplex = this instanceof require_duplex(); this._readableState = new ReadableState(options, this, isDuplex); if (options) { @@ -43425,26 +43528,26 @@ var require_readable3 = __commonJS({ } }); } - Readable13.prototype.destroy = destroyImpl.destroy; - Readable13.prototype._undestroy = destroyImpl.undestroy; - Readable13.prototype._destroy = function(err, cb) { + Readable11.prototype.destroy = destroyImpl.destroy; + Readable11.prototype._undestroy = destroyImpl.undestroy; + Readable11.prototype._destroy = function(err, cb) { cb(err); }; - Readable13.prototype[EE.captureRejectionSymbol] = function(err) { + Readable11.prototype[EE.captureRejectionSymbol] = function(err) { this.destroy(err); }; - Readable13.prototype[SymbolAsyncDispose] = function() { + Readable11.prototype[SymbolAsyncDispose] = function() { let error2; if (!this.destroyed) { error2 = this.readableEnded ? null : new AbortError4(); this.destroy(error2); } - return new Promise2((resolve4, reject2) => eos(this, (err) => err && err !== error2 ? reject2(err) : resolve4(null))); + return new Promise2((resolve8, reject2) => eos(this, (err) => err && err !== error2 ? reject2(err) : resolve8(null))); }; - Readable13.prototype.push = function(chunk, encoding) { + Readable11.prototype.push = function(chunk, encoding) { return readableAddChunk(this, chunk, encoding, false); }; - Readable13.prototype.unshift = function(chunk, encoding) { + Readable11.prototype.unshift = function(chunk, encoding) { return readableAddChunk(this, chunk, encoding, true); }; function readableAddChunk(stream5, chunk, encoding, addToFront) { @@ -43456,13 +43559,13 @@ var require_readable3 = __commonJS({ encoding = encoding || state4.defaultEncoding; if (state4.encoding !== encoding) { if (addToFront && state4.encoding) { - chunk = Buffer7.from(chunk, encoding).toString(state4.encoding); + chunk = Buffer4.from(chunk, encoding).toString(state4.encoding); } else { - chunk = Buffer7.from(chunk, encoding); + chunk = Buffer4.from(chunk, encoding); encoding = ""; } } - } else if (chunk instanceof Buffer7) { + } else if (chunk instanceof Buffer4) { encoding = ""; } else if (Stream3._isUint8Array(chunk)) { chunk = Stream3._uint8ArrayToBuffer(chunk); @@ -43518,11 +43621,11 @@ var require_readable3 = __commonJS({ } maybeReadMore(stream5, state4); } - Readable13.prototype.isPaused = function() { + Readable11.prototype.isPaused = function() { const state4 = this._readableState; return state4[kPaused] === true || state4.flowing === false; }; - Readable13.prototype.setEncoding = function(enc) { + Readable11.prototype.setEncoding = function(enc) { const decoder = new StringDecoder2(enc); this._readableState.decoder = decoder; this._readableState.encoding = this._readableState.decoder.encoding; @@ -43537,55 +43640,55 @@ var require_readable3 = __commonJS({ return this; }; var MAX_HWM = 1073741824; - function computeNewHighWaterMark(n12) { - if (n12 > MAX_HWM) { - throw new ERR_OUT_OF_RANGE("size", "<= 1GiB", n12); + function computeNewHighWaterMark(n8) { + if (n8 > MAX_HWM) { + throw new ERR_OUT_OF_RANGE("size", "<= 1GiB", n8); } else { - n12--; - n12 |= n12 >>> 1; - n12 |= n12 >>> 2; - n12 |= n12 >>> 4; - n12 |= n12 >>> 8; - n12 |= n12 >>> 16; - n12++; - } - return n12; - } - function howMuchToRead(n12, state4) { - if (n12 <= 0 || state4.length === 0 && state4.ended) return 0; + n8--; + n8 |= n8 >>> 1; + n8 |= n8 >>> 2; + n8 |= n8 >>> 4; + n8 |= n8 >>> 8; + n8 |= n8 >>> 16; + n8++; + } + return n8; + } + function howMuchToRead(n8, state4) { + if (n8 <= 0 || state4.length === 0 && state4.ended) return 0; if ((state4.state & kObjectMode) !== 0) return 1; - if (NumberIsNaN(n12)) { + if (NumberIsNaN(n8)) { if (state4.flowing && state4.length) return state4.buffer.first().length; return state4.length; } - if (n12 <= state4.length) return n12; + if (n8 <= state4.length) return n8; return state4.ended ? state4.length : 0; } - Readable13.prototype.read = function(n12) { - debug2("read", n12); - if (n12 === void 0) { - n12 = NaN; - } else if (!NumberIsInteger(n12)) { - n12 = NumberParseInt(n12, 10); + Readable11.prototype.read = function(n8) { + debug2("read", n8); + if (n8 === void 0) { + n8 = NaN; + } else if (!NumberIsInteger(n8)) { + n8 = NumberParseInt(n8, 10); } const state4 = this._readableState; - const nOrig = n12; - if (n12 > state4.highWaterMark) state4.highWaterMark = computeNewHighWaterMark(n12); - if (n12 !== 0) state4.state &= ~kEmittedReadable; - if (n12 === 0 && state4.needReadable && ((state4.highWaterMark !== 0 ? state4.length >= state4.highWaterMark : state4.length > 0) || state4.ended)) { + const nOrig = n8; + if (n8 > state4.highWaterMark) state4.highWaterMark = computeNewHighWaterMark(n8); + if (n8 !== 0) state4.state &= ~kEmittedReadable; + if (n8 === 0 && state4.needReadable && ((state4.highWaterMark !== 0 ? state4.length >= state4.highWaterMark : state4.length > 0) || state4.ended)) { debug2("read: emitReadable", state4.length, state4.ended); if (state4.length === 0 && state4.ended) endReadable(this); else emitReadable(this); return null; } - n12 = howMuchToRead(n12, state4); - if (n12 === 0 && state4.ended) { + n8 = howMuchToRead(n8, state4); + if (n8 === 0 && state4.ended) { if (state4.length === 0) endReadable(this); return null; } let doRead = (state4.state & kNeedReadable) !== 0; debug2("need readable", doRead); - if (state4.length === 0 || state4.length - n12 < state4.highWaterMark) { + if (state4.length === 0 || state4.length - n8 < state4.highWaterMark) { doRead = true; debug2("length less than watermark", doRead); } @@ -43602,16 +43705,16 @@ var require_readable3 = __commonJS({ errorOrDestroy(this, err); } state4.state &= ~kSync; - if (!state4.reading) n12 = howMuchToRead(nOrig, state4); + if (!state4.reading) n8 = howMuchToRead(nOrig, state4); } let ret; - if (n12 > 0) ret = fromList(n12, state4); + if (n8 > 0) ret = fromList(n8, state4); else ret = null; if (ret === null) { state4.needReadable = state4.length <= state4.highWaterMark; - n12 = 0; + n8 = 0; } else { - state4.length -= n12; + state4.length -= n8; if (state4.multiAwaitDrain) { state4.awaitDrainWriters.clear(); } else { @@ -43620,7 +43723,7 @@ var require_readable3 = __commonJS({ } if (state4.length === 0) { if (!state4.ended) state4.needReadable = true; - if (nOrig !== n12 && state4.ended) endReadable(this); + if (nOrig !== n8 && state4.ended) endReadable(this); } if (ret !== null && !state4.errorEmitted && !state4.closeEmitted) { state4.dataEmitted = true; @@ -43683,10 +43786,10 @@ var require_readable3 = __commonJS({ } state4.readingMore = false; } - Readable13.prototype._read = function(n12) { + Readable11.prototype._read = function(n8) { throw new ERR_METHOD_NOT_IMPLEMENTED("_read()"); }; - Readable13.prototype.pipe = function(dest, pipeOpts) { + Readable11.prototype.pipe = function(dest, pipeOpts) { const src = this; const state4 = this._readableState; if (state4.pipes.length === 1) { @@ -43763,8 +43866,8 @@ var require_readable3 = __commonJS({ unpipe(); dest.removeListener("error", onerror); if (dest.listenerCount("error") === 0) { - const s6 = dest._writableState || dest._readableState; - if (s6 && !s6.errorEmitted) { + const s = dest._writableState || dest._readableState; + if (s && !s.errorEmitted) { errorOrDestroy(dest, er); } else { dest.emit("error", er); @@ -43811,7 +43914,7 @@ var require_readable3 = __commonJS({ } }; } - Readable13.prototype.unpipe = function(dest) { + Readable11.prototype.unpipe = function(dest) { const state4 = this._readableState; const unpipeInfo = { hasUnpiped: false @@ -43834,7 +43937,7 @@ var require_readable3 = __commonJS({ dest.emit("unpipe", this, unpipeInfo); return this; }; - Readable13.prototype.on = function(ev, fn) { + Readable11.prototype.on = function(ev, fn) { const res = Stream3.prototype.on.call(this, ev, fn); const state4 = this._readableState; if (ev === "data") { @@ -43855,16 +43958,16 @@ var require_readable3 = __commonJS({ } return res; }; - Readable13.prototype.addListener = Readable13.prototype.on; - Readable13.prototype.removeListener = function(ev, fn) { + Readable11.prototype.addListener = Readable11.prototype.on; + Readable11.prototype.removeListener = function(ev, fn) { const res = Stream3.prototype.removeListener.call(this, ev, fn); if (ev === "readable") { process5.nextTick(updateReadableListening, this); } return res; }; - Readable13.prototype.off = Readable13.prototype.removeListener; - Readable13.prototype.removeAllListeners = function(ev) { + Readable11.prototype.off = Readable11.prototype.removeListener; + Readable11.prototype.removeAllListeners = function(ev) { const res = Stream3.prototype.removeAllListeners.apply(this, arguments); if (ev === "readable" || ev === void 0) { process5.nextTick(updateReadableListening, this); @@ -43886,7 +43989,7 @@ var require_readable3 = __commonJS({ debug2("readable nexttick read 0"); self2.read(0); } - Readable13.prototype.resume = function() { + Readable11.prototype.resume = function() { const state4 = this._readableState; if (!state4.flowing) { debug2("resume"); @@ -43912,7 +44015,7 @@ var require_readable3 = __commonJS({ flow(stream5); if (state4.flowing && !state4.reading) stream5.read(0); } - Readable13.prototype.pause = function() { + Readable11.prototype.pause = function() { debug2("call pause flowing=%j", this._readableState.flowing); if (this._readableState.flowing !== false) { debug2("pause"); @@ -43927,7 +44030,7 @@ var require_readable3 = __commonJS({ debug2("flow", state4.flowing); while (state4.flowing && stream5.read() !== null) ; } - Readable13.prototype.wrap = function(stream5) { + Readable11.prototype.wrap = function(stream5) { let paused = false; stream5.on("data", (chunk) => { if (!this.push(chunk) && stream5.pause) { @@ -43962,10 +44065,10 @@ var require_readable3 = __commonJS({ } return this; }; - Readable13.prototype[SymbolAsyncIterator] = function() { + Readable11.prototype[SymbolAsyncIterator] = function() { return streamToAsyncIterator(this); }; - Readable13.prototype.iterator = function(options) { + Readable11.prototype.iterator = function(options) { if (options !== void 0) { validateObject(options, "options"); } @@ -43973,7 +44076,7 @@ var require_readable3 = __commonJS({ }; function streamToAsyncIterator(stream5, options) { if (typeof stream5.read !== "function") { - stream5 = Readable13.wrap(stream5, { + stream5 = Readable11.wrap(stream5, { objectMode: true }); } @@ -43983,12 +44086,12 @@ var require_readable3 = __commonJS({ } async function* createAsyncIterator(stream5, options) { let callback = nop; - function next(resolve4) { + function next(resolve8) { if (this === stream5) { callback(); callback = nop; } else { - callback = resolve4; + callback = resolve8; } } stream5.on("readable", next); @@ -44029,7 +44132,7 @@ var require_readable3 = __commonJS({ } } } - ObjectDefineProperties(Readable13.prototype, { + ObjectDefineProperties(Readable11.prototype, { readable: { __proto__: null, get() { @@ -44156,18 +44259,18 @@ var require_readable3 = __commonJS({ } } }); - Readable13._fromList = fromList; - function fromList(n12, state4) { + Readable11._fromList = fromList; + function fromList(n8, state4) { if (state4.length === 0) return null; let ret; if (state4.objectMode) ret = state4.buffer.shift(); - else if (!n12 || n12 >= state4.length) { + else if (!n8 || n8 >= state4.length) { if (state4.decoder) ret = state4.buffer.join(""); else if (state4.buffer.length === 1) ret = state4.buffer.first(); else ret = state4.buffer.concat(state4.length); state4.buffer.clear(); } else { - ret = state4.buffer.consume(n12, state4.decoder); + ret = state4.buffer.consume(n8, state4.decoder); } return ret; } @@ -44203,23 +44306,23 @@ var require_readable3 = __commonJS({ stream5.end(); } } - Readable13.from = function(iterable, opts) { - return from(Readable13, iterable, opts); + Readable11.from = function(iterable, opts) { + return from(Readable11, iterable, opts); }; var webStreamsAdapters; function lazyWebStreams() { if (webStreamsAdapters === void 0) webStreamsAdapters = {}; return webStreamsAdapters; } - Readable13.fromWeb = function(readableStream, options) { + Readable11.fromWeb = function(readableStream, options) { return lazyWebStreams().newStreamReadableFromReadableStream(readableStream, options); }; - Readable13.toWeb = function(streamReadable, options) { + Readable11.toWeb = function(streamReadable, options) { return lazyWebStreams().newReadableStreamFromStreamReadable(streamReadable, options); }; - Readable13.wrap = function(src, options) { + Readable11.wrap = function(src, options) { var _ref, _src$readableObjectMo; - return new Readable13({ + return new Readable11({ objectMode: (_ref = (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== void 0 ? _src$readableObjectMo : src.objectMode) !== null && _ref !== void 0 ? _ref : true, ...options, destroy(err, callback) { @@ -44247,11 +44350,11 @@ var require_writable = __commonJS({ Symbol: Symbol2, SymbolHasInstance } = require_primordials(); - module.exports = Writable2; - Writable2.WritableState = WritableState; + module.exports = Writable3; + Writable3.WritableState = WritableState; var { EventEmitter: EE } = __require("events"); var Stream3 = require_legacy().Stream; - var { Buffer: Buffer7 } = __require("buffer"); + var { Buffer: Buffer4 } = __require("buffer"); var destroyImpl = require_destroy2(); var { addAbortSignal } = require_add_abort_signal(); var { getHighWaterMark, getDefaultHighWaterMark } = require_state3(); @@ -44267,8 +44370,8 @@ var require_writable = __commonJS({ ERR_UNKNOWN_ENCODING } = require_errors3().codes; var { errorOrDestroy } = destroyImpl; - ObjectSetPrototypeOf(Writable2.prototype, Stream3.prototype); - ObjectSetPrototypeOf(Writable2, Stream3); + ObjectSetPrototypeOf(Writable3.prototype, Stream3.prototype); + ObjectSetPrototypeOf(Writable3, Stream3); function nop() { } var kOnFinished = Symbol2("kOnFinished"); @@ -44322,9 +44425,9 @@ var require_writable = __commonJS({ return this.buffered.length - this.bufferedIndex; } }); - function Writable2(options) { + function Writable3(options) { const isDuplex = this instanceof require_duplex(); - if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable2, this)) return new Writable2(options); + if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable3, this)) return new Writable3(options); this._writableState = new WritableState(options, this, isDuplex); if (options) { if (typeof options.write === "function") this._write = options.write; @@ -44343,15 +44446,15 @@ var require_writable = __commonJS({ finishMaybe(this, state4); }); } - ObjectDefineProperty(Writable2, SymbolHasInstance, { + ObjectDefineProperty(Writable3, SymbolHasInstance, { __proto__: null, value: function(object) { if (FunctionPrototypeSymbolHasInstance(this, object)) return true; - if (this !== Writable2) return false; + if (this !== Writable3) return false; return object && object._writableState instanceof WritableState; } }); - Writable2.prototype.pipe = function() { + Writable3.prototype.pipe = function() { errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); }; function _write(stream5, chunk, encoding, cb) { @@ -44361,7 +44464,7 @@ var require_writable = __commonJS({ encoding = state4.defaultEncoding; } else { if (!encoding) encoding = state4.defaultEncoding; - else if (encoding !== "buffer" && !Buffer7.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); + else if (encoding !== "buffer" && !Buffer4.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); if (typeof cb !== "function") cb = nop; } if (chunk === null) { @@ -44369,10 +44472,10 @@ var require_writable = __commonJS({ } else if (!state4.objectMode) { if (typeof chunk === "string") { if (state4.decodeStrings !== false) { - chunk = Buffer7.from(chunk, encoding); + chunk = Buffer4.from(chunk, encoding); encoding = "buffer"; } - } else if (chunk instanceof Buffer7) { + } else if (chunk instanceof Buffer4) { encoding = "buffer"; } else if (Stream3._isUint8Array(chunk)) { chunk = Stream3._uint8ArrayToBuffer(chunk); @@ -44395,22 +44498,22 @@ var require_writable = __commonJS({ state4.pendingcb++; return writeOrBuffer(stream5, state4, chunk, encoding, cb); } - Writable2.prototype.write = function(chunk, encoding, cb) { + Writable3.prototype.write = function(chunk, encoding, cb) { return _write(this, chunk, encoding, cb) === true; }; - Writable2.prototype.cork = function() { + Writable3.prototype.cork = function() { this._writableState.corked++; }; - Writable2.prototype.uncork = function() { + Writable3.prototype.uncork = function() { const state4 = this._writableState; if (state4.corked) { state4.corked--; if (!state4.writing) clearBuffer(this, state4); } }; - Writable2.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + Writable3.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { if (typeof encoding === "string") encoding = StringPrototypeToLowerCase(encoding); - if (!Buffer7.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); + if (!Buffer4.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); this._writableState.defaultEncoding = encoding; return this; }; @@ -44526,9 +44629,9 @@ var require_writable = __commonJS({ if (state4.writing) { return; } - for (let n12 = state4.bufferedIndex; n12 < state4.buffered.length; ++n12) { + for (let n8 = state4.bufferedIndex; n8 < state4.buffered.length; ++n8) { var _state$errored; - const { chunk, callback } = state4.buffered[n12]; + const { chunk, callback } = state4.buffered[n8]; const len = state4.objectMode ? 1 : chunk.length; state4.length -= len; callback( @@ -44558,8 +44661,8 @@ var require_writable = __commonJS({ if (bufferedLength > 1 && stream5._writev) { state4.pendingcb -= bufferedLength - 1; const callback = state4.allNoop ? nop : (err) => { - for (let n12 = i6; n12 < buffered.length; ++n12) { - buffered[n12].callback(err); + for (let n8 = i6; n8 < buffered.length; ++n8) { + buffered[n8].callback(err); } }; const chunks = state4.allNoop && i6 === 0 ? buffered : ArrayPrototypeSlice(buffered, i6); @@ -44584,7 +44687,7 @@ var require_writable = __commonJS({ } state4.bufferProcessing = false; } - Writable2.prototype._write = function(chunk, encoding, cb) { + Writable3.prototype._write = function(chunk, encoding, cb) { if (this._writev) { this._writev( [ @@ -44599,8 +44702,8 @@ var require_writable = __commonJS({ throw new ERR_METHOD_NOT_IMPLEMENTED("_write()"); } }; - Writable2.prototype._writev = null; - Writable2.prototype.end = function(chunk, encoding, cb) { + Writable3.prototype._writev = null; + Writable3.prototype.end = function(chunk, encoding, cb) { const state4 = this._writableState; if (typeof chunk === "function") { cb = chunk; @@ -44727,7 +44830,7 @@ var require_writable = __commonJS({ } } } - ObjectDefineProperties(Writable2.prototype, { + ObjectDefineProperties(Writable3.prototype, { closed: { __proto__: null, get() { @@ -44748,8 +44851,8 @@ var require_writable = __commonJS({ writable: { __proto__: null, get() { - const w5 = this._writableState; - return !!w5 && w5.writable !== false && !w5.destroyed && !w5.errored && !w5.ending && !w5.ended; + const w = this._writableState; + return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended; }, set(val) { if (this._writableState) { @@ -44823,7 +44926,7 @@ var require_writable = __commonJS({ } }); var destroy2 = destroyImpl.destroy; - Writable2.prototype.destroy = function(err, cb) { + Writable3.prototype.destroy = function(err, cb) { const state4 = this._writableState; if (!state4.destroyed && (state4.bufferedIndex < state4.buffered.length || state4[kOnFinished].length)) { process5.nextTick(errorBuffer, state4); @@ -44831,11 +44934,11 @@ var require_writable = __commonJS({ destroy2.call(this, err, cb); return this; }; - Writable2.prototype._undestroy = destroyImpl.undestroy; - Writable2.prototype._destroy = function(err, cb) { + Writable3.prototype._undestroy = destroyImpl.undestroy; + Writable3.prototype._destroy = function(err, cb) { cb(err); }; - Writable2.prototype[EE.captureRejectionSymbol] = function(err) { + Writable3.prototype[EE.captureRejectionSymbol] = function(err) { this.destroy(err); }; var webStreamsAdapters; @@ -44843,10 +44946,10 @@ var require_writable = __commonJS({ if (webStreamsAdapters === void 0) webStreamsAdapters = {}; return webStreamsAdapters; } - Writable2.fromWeb = function(writableStream, options) { + Writable3.fromWeb = function(writableStream, options) { return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options); }; - Writable2.toWeb = function(streamWritable) { + Writable3.toWeb = function(streamWritable) { return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable); }; } @@ -44876,8 +44979,8 @@ var require_duplexify = __commonJS({ } = require_errors3(); var { destroyer } = require_destroy2(); var Duplex = require_duplex(); - var Readable13 = require_readable3(); - var Writable2 = require_writable(); + var Readable11 = require_readable3(); + var Writable3 = require_writable(); var { createDeferredPromise } = require_util11(); var from = require_from(); var Blob3 = globalThis.Blob || bufferModule.Blob; @@ -44926,12 +45029,12 @@ var require_duplexify = __commonJS({ } if (isReadableStream4(body2)) { return _duplexify({ - readable: Readable13.fromWeb(body2) + readable: Readable11.fromWeb(body2) }); } if (isWritableStream(body2)) { return _duplexify({ - writable: Writable2.fromWeb(body2) + writable: Writable3.fromWeb(body2) }); } if (typeof body2 === "function") { @@ -45041,7 +45144,7 @@ var require_duplexify = __commonJS({ ); }; function fromAsyncGen(fn) { - let { promise, resolve: resolve4 } = createDeferredPromise(); + let { promise, resolve: resolve8 } = createDeferredPromise(); const ac = new AbortController2(); const signal = ac.signal; const value = fn( @@ -45056,7 +45159,7 @@ var require_duplexify = __commonJS({ throw new AbortError4(void 0, { cause: signal.reason }); - ({ promise, resolve: resolve4 } = createDeferredPromise()); + ({ promise, resolve: resolve8 } = createDeferredPromise()); yield chunk; } })(), @@ -45067,8 +45170,8 @@ var require_duplexify = __commonJS({ return { value, write(chunk, encoding, cb) { - const _resolve = resolve4; - resolve4 = null; + const _resolve = resolve8; + resolve8 = null; _resolve({ chunk, done: false, @@ -45076,8 +45179,8 @@ var require_duplexify = __commonJS({ }); }, final(cb) { - const _resolve = resolve4; - resolve4 = null; + const _resolve = resolve8; + resolve8 = null; _resolve({ done: true, cb @@ -45090,10 +45193,10 @@ var require_duplexify = __commonJS({ }; } function _duplexify(pair) { - const r6 = pair.readable && typeof pair.readable.read !== "function" ? Readable13.wrap(pair.readable) : pair.readable; - const w5 = pair.writable; + const r6 = pair.readable && typeof pair.readable.read !== "function" ? Readable11.wrap(pair.readable) : pair.readable; + const w = pair.writable; let readable = !!isReadable2(r6); - let writable = !!isWritable2(w5); + let writable = !!isWritable2(w); let ondrain; let onfinish; let onreadable; @@ -45111,12 +45214,12 @@ var require_duplexify = __commonJS({ d6 = new Duplexify({ // TODO (ronag): highWaterMark? readableObjectMode: !!(r6 !== null && r6 !== void 0 && r6.readableObjectMode), - writableObjectMode: !!(w5 !== null && w5 !== void 0 && w5.writableObjectMode), + writableObjectMode: !!(w !== null && w !== void 0 && w.writableObjectMode), readable, writable }); if (writable) { - eos(w5, (err) => { + eos(w, (err) => { writable = false; if (err) { destroyer(r6, err); @@ -45124,24 +45227,24 @@ var require_duplexify = __commonJS({ onfinished(err); }); d6._write = function(chunk, encoding, callback) { - if (w5.write(chunk, encoding)) { + if (w.write(chunk, encoding)) { callback(); } else { ondrain = callback; } }; d6._final = function(callback) { - w5.end(); + w.end(); onfinish = callback; }; - w5.on("drain", function() { + w.on("drain", function() { if (ondrain) { const cb = ondrain; ondrain = null; cb(); } }); - w5.on("finish", function() { + w.on("finish", function() { if (onfinish) { const cb = onfinish; onfinish = null; @@ -45191,7 +45294,7 @@ var require_duplexify = __commonJS({ callback(err); } else { onclose = callback; - destroyer(w5, err); + destroyer(w, err); destroyer(r6, err); } }; @@ -45211,21 +45314,21 @@ var require_duplex = __commonJS({ ObjectSetPrototypeOf } = require_primordials(); module.exports = Duplex; - var Readable13 = require_readable3(); - var Writable2 = require_writable(); - ObjectSetPrototypeOf(Duplex.prototype, Readable13.prototype); - ObjectSetPrototypeOf(Duplex, Readable13); + var Readable11 = require_readable3(); + var Writable3 = require_writable(); + ObjectSetPrototypeOf(Duplex.prototype, Readable11.prototype); + ObjectSetPrototypeOf(Duplex, Readable11); { - const keys = ObjectKeys(Writable2.prototype); + const keys = ObjectKeys(Writable3.prototype); for (let i6 = 0; i6 < keys.length; i6++) { const method = keys[i6]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable2.prototype[method]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable3.prototype[method]; } } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); - Readable13.call(this, options); - Writable2.call(this, options); + Readable11.call(this, options); + Writable3.call(this, options); if (options) { this.allowHalfOpen = options.allowHalfOpen !== false; if (options.readable === false) { @@ -45246,39 +45349,39 @@ var require_duplex = __commonJS({ ObjectDefineProperties(Duplex.prototype, { writable: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writable") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writable") }, writableHighWaterMark: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableHighWaterMark") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableHighWaterMark") }, writableObjectMode: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableObjectMode") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableObjectMode") }, writableBuffer: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableBuffer") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableBuffer") }, writableLength: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableLength") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableLength") }, writableFinished: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableFinished") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableFinished") }, writableCorked: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableCorked") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableCorked") }, writableEnded: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableEnded") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableEnded") }, writableNeedDrain: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableNeedDrain") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableNeedDrain") }, destroyed: { __proto__: null, @@ -45472,7 +45575,7 @@ var require_pipeline = __commonJS({ } = require_utils3(); var AbortController2 = globalThis.AbortController || require_abort_controller().AbortController; var PassThrough5; - var Readable13; + var Readable11; var addAbortListener; function destroyer(stream5, reading, writing) { let finished = false; @@ -45511,10 +45614,10 @@ var require_pipeline = __commonJS({ throw new ERR_INVALID_ARG_TYPE("val", ["Readable", "Iterable", "AsyncIterable"], val); } async function* fromReadable(val) { - if (!Readable13) { - Readable13 = require_readable3(); + if (!Readable11) { + Readable11 = require_readable3(); } - yield* Readable13.prototype[SymbolAsyncIterator].call(val); + yield* Readable11.prototype[SymbolAsyncIterator].call(val); } async function pumpToNode(iterable, writable, finish, { end }) { let error2; @@ -45529,7 +45632,7 @@ var require_pipeline = __commonJS({ callback(); } }; - const wait = () => new Promise2((resolve4, reject2) => { + const wait = () => new Promise2((resolve8, reject2) => { if (error2) { reject2(error2); } else { @@ -45537,7 +45640,7 @@ var require_pipeline = __commonJS({ if (error2) { reject2(error2); } else { - resolve4(); + resolve8(); } }; } @@ -45903,15 +46006,15 @@ var require_compose = __commonJS({ const idx = streams.length - 1; streams[idx] = Duplex.from(streams[idx]); } - for (let n12 = 0; n12 < streams.length; ++n12) { - if (!isNodeStream(streams[n12]) && !isWebStream(streams[n12])) { + for (let n8 = 0; n8 < streams.length; ++n8) { + if (!isNodeStream(streams[n8]) && !isWebStream(streams[n8])) { continue; } - if (n12 < streams.length - 1 && !(isReadable2(streams[n12]) || isReadableStream4(streams[n12]) || isTransformStream(streams[n12]))) { - throw new ERR_INVALID_ARG_VALUE(`streams[${n12}]`, orgStreams[n12], "must be readable"); + if (n8 < streams.length - 1 && !(isReadable2(streams[n8]) || isReadableStream4(streams[n8]) || isTransformStream(streams[n8]))) { + throw new ERR_INVALID_ARG_VALUE(`streams[${n8}]`, orgStreams[n8], "must be readable"); } - if (n12 > 0 && !(isWritable2(streams[n12]) || isWritableStream(streams[n12]) || isTransformStream(streams[n12]))) { - throw new ERR_INVALID_ARG_VALUE(`streams[${n12}]`, orgStreams[n12], "must be writable"); + if (n8 > 0 && !(isWritable2(streams[n8]) || isWritableStream(streams[n8]) || isTransformStream(streams[n8]))) { + throw new ERR_INVALID_ARG_VALUE(`streams[${n8}]`, orgStreams[n8], "must be writable"); } } let ondrain; @@ -46181,8 +46284,8 @@ var require_operators = __commonJS({ next = null; } if (!done && (queue2.length >= highWaterMark || cnt >= concurrency)) { - await new Promise2((resolve4) => { - resume = resolve4; + await new Promise2((resolve8) => { + resume = resolve8; }); } } @@ -46216,8 +46319,8 @@ var require_operators = __commonJS({ queue2.shift(); maybeResume(); } - await new Promise2((resolve4) => { - next = resolve4; + await new Promise2((resolve8) => { + next = resolve8; }); } } finally { @@ -46475,7 +46578,7 @@ var require_promises = __commonJS({ var { finished } = require_end_of_stream(); require_stream2(); function pipeline2(...streams) { - return new Promise2((resolve4, reject2) => { + return new Promise2((resolve8, reject2) => { let signal; let end; const lastArg = streams[streams.length - 1]; @@ -46490,7 +46593,7 @@ var require_promises = __commonJS({ if (err) { reject2(err); } else { - resolve4(value); + resolve8(value); } }, { @@ -46511,7 +46614,7 @@ var require_promises = __commonJS({ var require_stream2 = __commonJS({ "node_modules/archiver-utils/node_modules/readable-stream/lib/stream.js"(exports2, module) { "use strict"; - var { Buffer: Buffer7 } = __require("buffer"); + var { Buffer: Buffer4 } = __require("buffer"); var { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials(); var { promisify: { custom: customPromisify } @@ -46621,7 +46724,7 @@ var require_stream2 = __commonJS({ return value instanceof Uint8Array; }; Stream3._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) { - return Buffer7.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); + return Buffer4.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); }; } }); @@ -47004,8 +47107,8 @@ var require_Map = __commonJS({ "node_modules/lodash/_Map.js"(exports2, module) { "use strict"; var getNative = require_getNative(); - var root = require_root(); - var Map2 = getNative(root, "Map"); + var root6 = require_root(); + var Map2 = getNative(root6, "Map"); module.exports = Map2; } }); @@ -47374,8 +47477,8 @@ var require_Set = __commonJS({ "node_modules/lodash/_Set.js"(exports2, module) { "use strict"; var getNative = require_getNative(); - var root = require_root(); - var Set2 = getNative(root, "Set"); + var root6 = require_root(); + var Set2 = getNative(root6, "Set"); module.exports = Set2; } }); @@ -47582,8 +47685,8 @@ var require_brace_expressions = __commonJS({ "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true], "[:xdigit:]": ["A-Fa-f0-9", false] }; - var braceEscape3 = (s6) => s6.replace(/[[\]\\-]/g, "\\$&"); - var regexpEscape3 = (s6) => s6.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + var braceEscape3 = (s) => s.replace(/[[\]\\-]/g, "\\$&"); + var regexpEscape3 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); var rangesToString3 = (ranges) => ranges.join(""); var parseClass3 = (glob2, position) => { const pos = position; @@ -47619,7 +47722,7 @@ var require_brace_expressions = __commonJS({ } } if (c6 === "[" && !escaping) { - for (const [cls, [unip, u6, neg]] of Object.entries(posixClasses3)) { + for (const [cls, [unip, u, neg]] of Object.entries(posixClasses3)) { if (glob2.startsWith(cls, i6)) { if (rangeStart) { return ["$.", false, glob2.length - pos, true]; @@ -47629,7 +47732,7 @@ var require_brace_expressions = __commonJS({ negs.push(unip); else ranges.push(unip); - uflag = uflag || u6; + uflag = uflag || u; continue WHILE; } } @@ -47683,8 +47786,8 @@ var require_unescape = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.unescape = void 0; - var unescape4 = (s6, { windowsPathsNoEscape = false } = {}) => { - return windowsPathsNoEscape ? s6.replace(/\[([^\/\\])\]/g, "$1") : s6.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"); + var unescape4 = (s, { windowsPathsNoEscape = false } = {}) => { + return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"); }; exports2.unescape = unescape4; } @@ -47694,7 +47797,7 @@ var require_unescape = __commonJS({ var require_ast = __commonJS({ "node_modules/minimatch/dist/commonjs/ast.js"(exports2) { "use strict"; - var _a5; + var _a6; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.AST = void 0; var brace_expressions_js_1 = require_brace_expressions(); @@ -47732,7 +47835,7 @@ var require_ast = __commonJS({ var addPatternStart3 = /* @__PURE__ */ new Set(["[", "."]); var justDots3 = /* @__PURE__ */ new Set(["..", "."]); var reSpecials3 = new Set("().*{}+?[]^$\\!"); - var regExpEscape5 = (s6) => s6.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + var regExpEscape5 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); var qmark5 = "[^/]"; var star5 = qmark5 + "*?"; var starNoEmpty3 = qmark5 + "+?"; @@ -47766,10 +47869,10 @@ var require_ast = __commonJS({ get hasMagic() { if (this.#hasMagic !== void 0) return this.#hasMagic; - for (const p6 of this.#parts) { - if (typeof p6 === "string") + for (const p2 of this.#parts) { + if (typeof p2 === "string") continue; - if (p6.type || p6.hasMagic) + if (p2.type || p2.hasMagic) return this.#hasMagic = true; } return this.#hasMagic; @@ -47779,9 +47882,9 @@ var require_ast = __commonJS({ if (this.#toString !== void 0) return this.#toString; if (!this.type) { - return this.#toString = this.#parts.map((p6) => String(p6)).join(""); + return this.#toString = this.#parts.map((p2) => String(p2)).join(""); } else { - return this.#toString = this.type + "(" + this.#parts.map((p6) => String(p6)).join("|") + ")"; + return this.#toString = this.type + "(" + this.#parts.map((p2) => String(p2)).join("|") + ")"; } } #fillNegs() { @@ -47791,39 +47894,39 @@ var require_ast = __commonJS({ return this; this.toString(); this.#filledNegs = true; - let n12; - while (n12 = this.#negs.pop()) { - if (n12.type !== "!") + let n8; + while (n8 = this.#negs.pop()) { + if (n8.type !== "!") continue; - let p6 = n12; - let pp = p6.#parent; + let p2 = n8; + let pp = p2.#parent; while (pp) { - for (let i6 = p6.#parentIndex + 1; !pp.type && i6 < pp.#parts.length; i6++) { - for (const part of n12.#parts) { + for (let i6 = p2.#parentIndex + 1; !pp.type && i6 < pp.#parts.length; i6++) { + for (const part of n8.#parts) { if (typeof part === "string") { throw new Error("string part in extglob AST??"); } part.copyIn(pp.#parts[i6]); } } - p6 = pp; - pp = p6.#parent; + p2 = pp; + pp = p2.#parent; } } return this; } push(...parts) { - for (const p6 of parts) { - if (p6 === "") + for (const p2 of parts) { + if (p2 === "") continue; - if (typeof p6 !== "string" && !(p6 instanceof _a5 && p6.#parent === this)) { - throw new Error("invalid part: " + p6); + if (typeof p2 !== "string" && !(p2 instanceof _a6 && p2.#parent === this)) { + throw new Error("invalid part: " + p2); } - this.#parts.push(p6); + this.#parts.push(p2); } } toJSON() { - const ret = this.type === null ? this.#parts.slice().map((p6) => typeof p6 === "string" ? p6 : p6.toJSON()) : [this.type, ...this.#parts.map((p6) => p6.toJSON())]; + const ret = this.type === null ? this.#parts.slice().map((p2) => typeof p2 === "string" ? p2 : p2.toJSON()) : [this.type, ...this.#parts.map((p2) => p2.toJSON())]; if (this.isStart() && !this.type) ret.unshift([]); if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && this.#parent?.type === "!")) { @@ -47838,10 +47941,10 @@ var require_ast = __commonJS({ return false; if (this.#parentIndex === 0) return true; - const p6 = this.#parent; + const p2 = this.#parent; for (let i6 = 0; i6 < this.#parentIndex; i6++) { - const pp = p6.#parts[i6]; - if (!(pp instanceof _a5 && pp.type === "!")) { + const pp = p2.#parts[i6]; + if (!(pp instanceof _a6 && pp.type === "!")) { return false; } } @@ -47866,9 +47969,9 @@ var require_ast = __commonJS({ this.push(part.clone(this)); } clone(parent2) { - const c6 = new _a5(this.type, parent2); - for (const p6 of this.#parts) { - c6.copyIn(p6); + const c6 = new _a6(this.type, parent2); + for (const p2 of this.#parts) { + c6.copyIn(p2); } return c6; } @@ -47909,8 +48012,8 @@ var require_ast = __commonJS({ if (doRecurse) { ast.push(acc2); acc2 = ""; - const ext3 = new _a5(c6, ast); - i7 = _a5.#parseAST(str, ext3, i7, opt, extDepth + 1); + const ext3 = new _a6(c6, ast); + i7 = _a6.#parseAST(str, ext3, i7, opt, extDepth + 1); ast.push(ext3); continue; } @@ -47920,7 +48023,7 @@ var require_ast = __commonJS({ return i7; } let i6 = pos + 1; - let part = new _a5(null, ast); + let part = new _a6(null, ast); const parts = []; let acc = ""; while (i6 < str.length) { @@ -47953,16 +48056,16 @@ var require_ast = __commonJS({ const depthAdd = ast && ast.#canAdoptType(c6) ? 0 : 1; part.push(acc); acc = ""; - const ext3 = new _a5(c6, part); + const ext3 = new _a6(c6, part); part.push(ext3); - i6 = _a5.#parseAST(str, ext3, i6, opt, extDepth + depthAdd); + i6 = _a6.#parseAST(str, ext3, i6, opt, extDepth + depthAdd); continue; } if (c6 === "|") { part.push(acc); acc = ""; parts.push(part); - part = new _a5(null, ast); + part = new _a6(null, ast); continue; } if (c6 === ")") { @@ -47999,7 +48102,7 @@ var require_ast = __commonJS({ } #adoptWithSpace(child, index2) { const gc = child.#parts[0]; - const blank = new _a5(null, gc, this.options); + const blank = new _a6(null, gc, this.options); blank.#parts.push(""); gc.push(blank); this.#adopt(child, index2); @@ -48007,15 +48110,15 @@ var require_ast = __commonJS({ #adopt(child, index2) { const gc = child.#parts[0]; this.#parts.splice(index2, 1, ...gc.#parts); - for (const p6 of gc.#parts) { - if (typeof p6 === "object") - p6.#parent = this; + for (const p2 of gc.#parts) { + if (typeof p2 === "object") + p2.#parent = this; } this.#toString = void 0; } #canUsurpType(c6) { - const m6 = usurpMap3.get(this.type); - return !!m6?.has(c6); + const m3 = usurpMap3.get(this.type); + return !!m3?.has(c6); } #canUsurp(child) { if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) { @@ -48028,15 +48131,15 @@ var require_ast = __commonJS({ return this.#canUsurpType(gc.type); } #usurp(child) { - const m6 = usurpMap3.get(this.type); + const m3 = usurpMap3.get(this.type); const gc = child.#parts[0]; - const nt2 = m6?.get(gc.type); + const nt2 = m3?.get(gc.type); if (!nt2) return false; this.#parts = gc.#parts; - for (const p6 of this.#parts) { - if (typeof p6 === "object") - p6.#parent = this; + for (const p2 of this.#parts) { + if (typeof p2 === "object") + p2.#parent = this; } this.type = nt2; this.#toString = void 0; @@ -48044,9 +48147,9 @@ var require_ast = __commonJS({ } #flatten() { if (!isExtglobAST3(this)) { - for (const p6 of this.#parts) { - if (typeof p6 === "object") - p6.#flatten(); + for (const p2 of this.#parts) { + if (typeof p2 === "object") + p2.#flatten(); } } else { let iterations = 0; @@ -48074,8 +48177,8 @@ var require_ast = __commonJS({ this.#toString = void 0; } static fromGlob(pattern, options = {}) { - const ast = new _a5(null, void 0, options); - _a5.#parseAST(pattern, ast, 0, options, 0); + const ast = new _a6(null, void 0, options); + _a6.#parseAST(pattern, ast, 0, options, 0); return ast; } // returns the regular expression if there's magic, or the unescaped @@ -48175,8 +48278,8 @@ var require_ast = __commonJS({ } if (!isExtglobAST3(this)) { const noEmpty = this.isStart() && this.isEnd(); - const src = this.#parts.map((p6) => { - const [re2, _3, hasMagic2, uflag] = typeof p6 === "string" ? _a5.#parseGlob(p6, this.#hasMagic, noEmpty) : p6.toRegExpSource(allowDot); + const src = this.#parts.map((p2) => { + const [re2, _3, hasMagic2, uflag] = typeof p2 === "string" ? _a6.#parseGlob(p2, this.#hasMagic, noEmpty) : p2.toRegExpSource(allowDot); this.#hasMagic = this.#hasMagic || hasMagic2; this.#uflag = this.#uflag || uflag; return re2; @@ -48214,12 +48317,12 @@ var require_ast = __commonJS({ const start = this.type === "!" ? "(?:(?!(?:" : "(?:"; let body2 = this.#partsToRegExp(dot); if (this.isStart() && this.isEnd() && !body2 && this.type !== "!") { - const s6 = this.toString(); + const s = this.toString(); const me2 = this; - me2.#parts = [s6]; + me2.#parts = [s]; me2.type = null; me2.#hasMagic = void 0; - return [s6, (0, unescape_js_1.unescape)(this.toString()), false, false]; + return [s, (0, unescape_js_1.unescape)(this.toString()), false, false]; } let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot3 ? "" : this.#partsToRegExp(true); if (bodyDotAllowed === body2) { @@ -48246,14 +48349,14 @@ var require_ast = __commonJS({ ]; } #partsToRegExp(dot) { - return this.#parts.map((p6) => { - if (typeof p6 === "string") { + return this.#parts.map((p2) => { + if (typeof p2 === "string") { throw new Error("string type in extglob ast??"); } - const [re2, _3, _hasMagic, uflag] = p6.toRegExpSource(dot); + const [re2, _3, _hasMagic, uflag] = p2.toRegExpSource(dot); this.#uflag = this.#uflag || uflag; return re2; - }).filter((p6) => !(this.isStart() && this.isEnd()) || !!p6).join("|"); + }).filter((p2) => !(this.isStart() && this.isEnd()) || !!p2).join("|"); } static #parseGlob(glob2, hasMagic2, noEmpty = false) { let escaping = false; @@ -48308,7 +48411,7 @@ var require_ast = __commonJS({ } }; exports2.AST = AST3; - _a5 = AST3; + _a6 = AST3; } }); @@ -48318,8 +48421,8 @@ var require_escape = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.escape = void 0; - var escape5 = (s6, { windowsPathsNoEscape = false } = {}) => { - return windowsPathsNoEscape ? s6.replace(/[?*()[\]]/g, "[$&]") : s6.replace(/[?*()[\]\\]/g, "\\$&"); + var escape5 = (s, { windowsPathsNoEscape = false } = {}) => { + return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&"); }; exports2.escape = escape5; } @@ -48339,12 +48442,12 @@ var require_commonjs = __commonJS({ var ast_js_1 = require_ast(); var escape_js_1 = require_escape(); var unescape_js_1 = require_unescape(); - var minimatch3 = (p6, pattern, options = {}) => { + var minimatch3 = (p2, pattern, options = {}) => { (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); if (!options.nocomment && pattern.charAt(0) === "#") { return false; } - return new Minimatch3(pattern, options).match(p6); + return new Minimatch3(pattern, options).match(p2); }; exports2.minimatch = minimatch3; var starDotExtRE3 = /^\*+([^+@!?\*\[\(]*)$/; @@ -48410,7 +48513,7 @@ var require_commonjs = __commonJS({ var star5 = qmark5 + "*?"; var twoStarDot3 = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; var twoStarNoDot3 = "(?:(?!(?:\\/|^)\\.).)*?"; - var filter4 = (pattern, options = {}) => (p6) => (0, exports2.minimatch)(p6, pattern, options); + var filter4 = (pattern, options = {}) => (p2) => (0, exports2.minimatch)(p2, pattern, options); exports2.filter = filter4; exports2.minimatch.filter = exports2.filter; var ext3 = (a6, b6 = {}) => Object.assign({}, a6, b6); @@ -48419,8 +48522,8 @@ var require_commonjs = __commonJS({ return exports2.minimatch; } const orig = exports2.minimatch; - const m6 = (p6, pattern, options = {}) => orig(p6, pattern, ext3(def, options)); - return Object.assign(m6, { + const m3 = (p2, pattern, options = {}) => orig(p2, pattern, ext3(def, options)); + return Object.assign(m3, { Minimatch: class Minimatch extends orig.Minimatch { constructor(pattern, options = {}) { super(pattern, ext3(def, options)); @@ -48439,8 +48542,8 @@ var require_commonjs = __commonJS({ return orig.AST.fromGlob(pattern, ext3(def, options)); } }, - unescape: (s6, options = {}) => orig.unescape(s6, ext3(def, options)), - escape: (s6, options = {}) => orig.escape(s6, ext3(def, options)), + unescape: (s, options = {}) => orig.unescape(s, ext3(def, options)), + escape: (s, options = {}) => orig.escape(s, ext3(def, options)), filter: (pattern, options = {}) => orig.filter(pattern, ext3(def, options)), defaults: (options) => orig.defaults(ext3(def, options)), makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext3(def, options)), @@ -48475,7 +48578,7 @@ var require_commonjs = __commonJS({ exports2.match = match3; exports2.minimatch.match = exports2.match; var globMagic3 = /[?*]|[+@!]\(.*?\)|\[|\]/; - var regExpEscape5 = (s6) => s6.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + var regExpEscape5 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); var Minimatch3 = class { options; set; @@ -48552,28 +48655,28 @@ var require_commonjs = __commonJS({ this.debug = (...args) => console.error(...args); } this.debug(this.pattern, this.globSet); - const rawGlobParts = this.globSet.map((s6) => this.slashSplit(s6)); + const rawGlobParts = this.globSet.map((s) => this.slashSplit(s)); this.globParts = this.preprocess(rawGlobParts); this.debug(this.pattern, this.globParts); - let set = this.globParts.map((s6, _3, __) => { + let set = this.globParts.map((s, _3, __) => { if (this.isWindows && this.windowsNoMagicRoot) { - const isUNC = s6[0] === "" && s6[1] === "" && (s6[2] === "?" || !globMagic3.test(s6[2])) && !globMagic3.test(s6[3]); - const isDrive = /^[a-z]:/i.test(s6[0]); + const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic3.test(s[2])) && !globMagic3.test(s[3]); + const isDrive = /^[a-z]:/i.test(s[0]); if (isUNC) { - return [...s6.slice(0, 4), ...s6.slice(4).map((ss2) => this.parse(ss2))]; + return [...s.slice(0, 4), ...s.slice(4).map((ss2) => this.parse(ss2))]; } else if (isDrive) { - return [s6[0], ...s6.slice(1).map((ss2) => this.parse(ss2))]; + return [s[0], ...s.slice(1).map((ss2) => this.parse(ss2))]; } } - return s6.map((ss2) => this.parse(ss2)); + return s.map((ss2) => this.parse(ss2)); }); this.debug(this.pattern, set); - this.set = set.filter((s6) => s6.indexOf(false) === -1); + this.set = set.filter((s) => s.indexOf(false) === -1); if (this.isWindows) { for (let i6 = 0; i6 < this.set.length; i6++) { - const p6 = this.set[i6]; - if (p6[0] === "" && p6[1] === "" && this.globParts[i6][2] === "?" && typeof p6[3] === "string" && /^[a-z]:$/i.test(p6[3])) { - p6[2] = "?"; + const p2 = this.set[i6]; + if (p2[0] === "" && p2[1] === "" && this.globParts[i6][2] === "?" && typeof p2[3] === "string" && /^[a-z]:$/i.test(p2[3])) { + p2[2] = "?"; } } } @@ -48650,10 +48753,10 @@ var require_commonjs = __commonJS({ didSomething = false; if (!this.preserveMultipleSlashes) { for (let i6 = 1; i6 < parts.length - 1; i6++) { - const p6 = parts[i6]; - if (i6 === 1 && p6 === "" && parts[0] === "") + const p2 = parts[i6]; + if (i6 === 1 && p2 === "" && parts[0] === "") continue; - if (p6 === "." || p6 === "") { + if (p2 === "." || p2 === "") { didSomething = true; parts.splice(i6, 1); i6--; @@ -48666,8 +48769,8 @@ var require_commonjs = __commonJS({ } let dd = 0; while (-1 !== (dd = parts.indexOf("..", dd + 1))) { - const p6 = parts[dd - 1]; - if (p6 && p6 !== "." && p6 !== ".." && p6 !== "**") { + const p2 = parts[dd - 1]; + if (p2 && p2 !== "." && p2 !== ".." && p2 !== "**") { didSomething = true; parts.splice(dd - 1, 2); dd -= 2; @@ -48709,11 +48812,11 @@ var require_commonjs = __commonJS({ parts.splice(gs2 + 1, gss - gs2); } let next = parts[gs2 + 1]; - const p6 = parts[gs2 + 2]; + const p2 = parts[gs2 + 2]; const p22 = parts[gs2 + 3]; if (next !== "..") continue; - if (!p6 || p6 === "." || p6 === ".." || !p22 || p22 === "." || p22 === "..") { + if (!p2 || p2 === "." || p2 === ".." || !p22 || p22 === "." || p22 === "..") { continue; } didSomething = true; @@ -48725,10 +48828,10 @@ var require_commonjs = __commonJS({ } if (!this.preserveMultipleSlashes) { for (let i6 = 1; i6 < parts.length - 1; i6++) { - const p6 = parts[i6]; - if (i6 === 1 && p6 === "" && parts[0] === "") + const p2 = parts[i6]; + if (i6 === 1 && p2 === "" && parts[0] === "") continue; - if (p6 === "." || p6 === "") { + if (p2 === "." || p2 === "") { didSomething = true; parts.splice(i6, 1); i6--; @@ -48741,8 +48844,8 @@ var require_commonjs = __commonJS({ } let dd = 0; while (-1 !== (dd = parts.indexOf("..", dd + 1))) { - const p6 = parts[dd - 1]; - if (p6 && p6 !== "." && p6 !== ".." && p6 !== "**") { + const p2 = parts[dd - 1]; + if (p2 && p2 !== "." && p2 !== ".." && p2 !== "**") { didSomething = true; const needDot = dd === 1 && parts[dd + 1] === "**"; const splin = needDot ? ["."] : []; @@ -48943,8 +49046,8 @@ var require_commonjs = __commonJS({ } const [body2, after] = bs2; while (fileIndex <= after) { - const m6 = this.#matchOne(file.slice(0, fileIndex + body2.length), body2, partial, fileIndex, 0); - if (m6 && globStarDepth < this.maxGlobstarRecursion) { + const m3 = this.#matchOne(file.slice(0, fileIndex + body2.length), body2, partial, fileIndex, 0); + if (m3 && globStarDepth < this.maxGlobstarRecursion) { const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body2.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail); if (sub !== false) return sub; @@ -48964,18 +49067,18 @@ var require_commonjs = __commonJS({ let fl; for (fi2 = fileIndex, pi2 = patternIndex, fl = file.length, pl = pattern.length; fi2 < fl && pi2 < pl; fi2++, pi2++) { this.debug("matchOne loop"); - let p6 = pattern[pi2]; + let p2 = pattern[pi2]; let f6 = file[fi2]; - this.debug(pattern, p6, f6); - if (p6 === false || p6 === exports2.GLOBSTAR) + this.debug(pattern, p2, f6); + if (p2 === false || p2 === exports2.GLOBSTAR) return false; let hit; - if (typeof p6 === "string") { - hit = f6 === p6; - this.debug("string match", p6, f6, hit); + if (typeof p2 === "string") { + hit = f6 === p2; + this.debug("string match", p2, f6, hit); } else { - hit = p6.test(f6); - this.debug("pattern match", p6, f6, hit); + hit = p2.test(f6); + this.debug("pattern match", p2, f6, hit); } if (!hit) return false; @@ -49000,17 +49103,17 @@ var require_commonjs = __commonJS({ return exports2.GLOBSTAR; if (pattern === "") return ""; - let m6; + let m3; let fastTest = null; - if (m6 = pattern.match(starRE3)) { + if (m3 = pattern.match(starRE3)) { fastTest = options.dot ? starTestDot3 : starTest3; - } else if (m6 = pattern.match(starDotExtRE3)) { - fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot3 : starDotExtTestNocase3 : options.dot ? starDotExtTestDot3 : starDotExtTest3)(m6[1]); - } else if (m6 = pattern.match(qmarksRE3)) { - fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot3 : qmarksTestNocase3 : options.dot ? qmarksTestDot3 : qmarksTest3)(m6); - } else if (m6 = pattern.match(starDotStarRE3)) { + } else if (m3 = pattern.match(starDotExtRE3)) { + fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot3 : starDotExtTestNocase3 : options.dot ? starDotExtTestDot3 : starDotExtTest3)(m3[1]); + } else if (m3 = pattern.match(qmarksRE3)) { + fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot3 : qmarksTestNocase3 : options.dot ? qmarksTestDot3 : qmarksTest3)(m3); + } else if (m3 = pattern.match(starDotStarRE3)) { fastTest = options.dot ? starDotStarTestDot3 : starDotStarTest3; - } else if (m6 = pattern.match(dotStarRE3)) { + } else if (m3 = pattern.match(dotStarRE3)) { fastTest = dotStarTest3; } const re2 = ast_js_1.AST.fromGlob(pattern, this.options).toMMPattern(); @@ -49031,17 +49134,17 @@ var require_commonjs = __commonJS({ const twoStar = options.noglobstar ? star5 : options.dot ? twoStarDot3 : twoStarNoDot3; const flags = new Set(options.nocase ? ["i"] : []); let re2 = set.map((pattern) => { - const pp = pattern.map((p6) => { - if (p6 instanceof RegExp) { - for (const f6 of p6.flags.split("")) + const pp = pattern.map((p2) => { + if (p2 instanceof RegExp) { + for (const f6 of p2.flags.split("")) flags.add(f6); } - return typeof p6 === "string" ? regExpEscape5(p6) : p6 === exports2.GLOBSTAR ? exports2.GLOBSTAR : p6._src; + return typeof p2 === "string" ? regExpEscape5(p2) : p2 === exports2.GLOBSTAR ? exports2.GLOBSTAR : p2._src; }); - pp.forEach((p6, i6) => { + pp.forEach((p2, i6) => { const next = pp[i6 + 1]; const prev = pp[i6 - 1]; - if (p6 !== exports2.GLOBSTAR || prev === exports2.GLOBSTAR) { + if (p2 !== exports2.GLOBSTAR || prev === exports2.GLOBSTAR) { return; } if (prev === void 0) { @@ -49057,7 +49160,7 @@ var require_commonjs = __commonJS({ pp[i6 + 1] = exports2.GLOBSTAR; } }); - return pp.filter((p6) => p6 !== exports2.GLOBSTAR).join("/"); + return pp.filter((p2) => p2 !== exports2.GLOBSTAR).join("/"); }).join("|"); const [open2, close] = set.length > 1 ? ["(?:", ")"] : ["", ""]; re2 = "^" + open2 + re2 + close + "$"; @@ -49070,13 +49173,13 @@ var require_commonjs = __commonJS({ } return this.regexp; } - slashSplit(p6) { + slashSplit(p2) { if (this.preserveMultipleSlashes) { - return p6.split("/"); - } else if (this.isWindows && /^\/\/[^\/]+/.test(p6)) { - return ["", ...p6.split(/\/+/)]; + return p2.split("/"); + } else if (this.isWindows && /^\/\/[^\/]+/.test(p2)) { + return ["", ...p2.split(/\/+/)]; } else { - return p6.split(/\/+/); + return p2.split(/\/+/); } } match(f6, partial = this.partial) { @@ -49196,7 +49299,7 @@ var require_commonjs2 = __commonJS({ }; } var shouldWarn2 = (code) => !warned2.has(code); - var isPosInt2 = (n12) => n12 && n12 === Math.floor(n12) && n12 > 0 && isFinite(n12); + var isPosInt2 = (n8) => n8 && n8 === Math.floor(n8) && n8 > 0 && isFinite(n8); var getUintArray2 = (max) => !isPosInt2(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 ? ZeroArray2 : null; var ZeroArray2 = class extends Array { constructor(size) { @@ -49214,9 +49317,9 @@ var require_commonjs2 = __commonJS({ if (!HeapCls) return []; _Stack.#constructing = true; - const s6 = new _Stack(max, HeapCls); + const s = new _Stack(max, HeapCls); _Stack.#constructing = false; - return s6; + return s; } constructor(max, HeapCls) { if (!_Stack.#constructing) { @@ -49225,8 +49328,8 @@ var require_commonjs2 = __commonJS({ this.heap = new HeapCls(max); this.length = 0; } - push(n12) { - this.heap[this.length++] = n12; + push(n8) { + this.heap[this.length++] = n8; } pop() { return this.heap[--this.length]; @@ -49346,7 +49449,7 @@ var require_commonjs2 = __commonJS({ }, free: c6.#free, // methods - isBackgroundFetch: (p6) => c6.#isBackgroundFetch(p6), + isBackgroundFetch: (p2) => c6.#isBackgroundFetch(p2), backgroundFetch: (k7, index2, options, context5) => c6.#backgroundFetch(k7, index2, options, context5), moveToTail: (index2) => c6.#moveToTail(index2), indexes: (options) => c6.#indexes(options), @@ -49510,13 +49613,13 @@ var require_commonjs2 = __commonJS({ starts[index2] = ttl !== 0 ? start : 0; ttls[index2] = ttl; if (ttl !== 0 && this.ttlAutopurge) { - const t6 = setTimeout(() => { + const t = setTimeout(() => { if (this.#isStale(index2)) { this.#delete(this.#keyList[index2], "expire"); } }, ttl + 1); - if (t6.unref) { - t6.unref(); + if (t.unref) { + t.unref(); } } }; @@ -49538,15 +49641,15 @@ var require_commonjs2 = __commonJS({ }; let cachedNow = 0; const getNow = () => { - const n12 = perf2.now(); + const n8 = perf2.now(); if (this.ttlResolution > 0) { - cachedNow = n12; - const t6 = setTimeout(() => cachedNow = 0, this.ttlResolution); - if (t6.unref) { - t6.unref(); + cachedNow = n8; + const t = setTimeout(() => cachedNow = 0, this.ttlResolution); + if (t.unref) { + t.unref(); } } - return n12; + return n8; }; this.getRemainingTTL = (key) => { const index2 = this.#keyMap.get(key); @@ -49562,9 +49665,9 @@ var require_commonjs2 = __commonJS({ return ttl - age; }; this.#isStale = (index2) => { - const s6 = starts[index2]; - const t6 = ttls[index2]; - return !!t6 && !!s6 && (cachedNow || getNow()) - s6 > t6; + const s = starts[index2]; + const t = ttls[index2]; + return !!t && !!s && (cachedNow || getNow()) - s > t; }; } // conditionally set private methods related to TTL @@ -49584,8 +49687,8 @@ var require_commonjs2 = __commonJS({ this.#calculatedSize -= sizes[index2]; sizes[index2] = 0; }; - this.#requireSize = (k7, v8, size, sizeCalculation) => { - if (this.#isBackgroundFetch(v8)) { + this.#requireSize = (k7, v2, size, sizeCalculation) => { + if (this.#isBackgroundFetch(v2)) { return 0; } if (!isPosInt2(size)) { @@ -49593,7 +49696,7 @@ var require_commonjs2 = __commonJS({ if (typeof sizeCalculation !== "function") { throw new TypeError("sizeCalculation must be a function"); } - size = sizeCalculation(v8, k7); + size = sizeCalculation(v2, k7); if (!isPosInt2(size)) { throw new TypeError("sizeCalculation return invalid (expect positive integer)"); } @@ -49721,8 +49824,8 @@ var require_commonjs2 = __commonJS({ */ *values() { for (const i6 of this.#indexes()) { - const v8 = this.#valList[i6]; - if (v8 !== void 0 && !this.#isBackgroundFetch(this.#valList[i6])) { + const v2 = this.#valList[i6]; + if (v2 !== void 0 && !this.#isBackgroundFetch(this.#valList[i6])) { yield this.#valList[i6]; } } @@ -49735,8 +49838,8 @@ var require_commonjs2 = __commonJS({ */ *rvalues() { for (const i6 of this.#rindexes()) { - const v8 = this.#valList[i6]; - if (v8 !== void 0 && !this.#isBackgroundFetch(this.#valList[i6])) { + const v2 = this.#valList[i6]; + if (v2 !== void 0 && !this.#isBackgroundFetch(this.#valList[i6])) { yield this.#valList[i6]; } } @@ -49760,8 +49863,8 @@ var require_commonjs2 = __commonJS({ */ find(fn, getOptions = {}) { for (const i6 of this.#indexes()) { - const v8 = this.#valList[i6]; - const value = this.#isBackgroundFetch(v8) ? v8.__staleWhileFetching : v8; + const v2 = this.#valList[i6]; + const value = this.#isBackgroundFetch(v2) ? v2.__staleWhileFetching : v2; if (value === void 0) continue; if (fn(value, this.#keyList[i6], this)) { @@ -49782,8 +49885,8 @@ var require_commonjs2 = __commonJS({ */ forEach(fn, thisp = this) { for (const i6 of this.#indexes()) { - const v8 = this.#valList[i6]; - const value = this.#isBackgroundFetch(v8) ? v8.__staleWhileFetching : v8; + const v2 = this.#valList[i6]; + const value = this.#isBackgroundFetch(v2) ? v2.__staleWhileFetching : v2; if (value === void 0) continue; fn.call(thisp, value, this.#keyList[i6], this); @@ -49795,8 +49898,8 @@ var require_commonjs2 = __commonJS({ */ rforEach(fn, thisp = this) { for (const i6 of this.#rindexes()) { - const v8 = this.#valList[i6]; - const value = this.#isBackgroundFetch(v8) ? v8.__staleWhileFetching : v8; + const v2 = this.#valList[i6]; + const value = this.#isBackgroundFetch(v2) ? v2.__staleWhileFetching : v2; if (value === void 0) continue; fn.call(thisp, value, this.#keyList[i6], this); @@ -49832,8 +49935,8 @@ var require_commonjs2 = __commonJS({ const i6 = this.#keyMap.get(key); if (i6 === void 0) return void 0; - const v8 = this.#valList[i6]; - const value = this.#isBackgroundFetch(v8) ? v8.__staleWhileFetching : v8; + const v2 = this.#valList[i6]; + const value = this.#isBackgroundFetch(v2) ? v2.__staleWhileFetching : v2; if (value === void 0) return void 0; const entry = { value }; @@ -49868,8 +49971,8 @@ var require_commonjs2 = __commonJS({ const arr = []; for (const i6 of this.#indexes({ allowStale: true })) { const key = this.#keyList[i6]; - const v8 = this.#valList[i6]; - const value = this.#isBackgroundFetch(v8) ? v8.__staleWhileFetching : v8; + const v2 = this.#valList[i6]; + const value = this.#isBackgroundFetch(v2) ? v2.__staleWhileFetching : v2; if (value === void 0 || key === void 0) continue; const entry = { value }; @@ -49934,14 +50037,14 @@ var require_commonjs2 = __commonJS({ * If the value is `undefined`, then this is an alias for * `cache.delete(key)`. `undefined` is never stored in the cache. */ - set(k7, v8, setOptions = {}) { - if (v8 === void 0) { + set(k7, v2, setOptions = {}) { + if (v2 === void 0) { this.delete(k7); return this; } const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status } = setOptions; let { noUpdateTTL = this.noUpdateTTL } = setOptions; - const size = this.#requireSize(k7, v8, setOptions.size || 0, sizeCalculation); + const size = this.#requireSize(k7, v2, setOptions.size || 0, sizeCalculation); if (this.maxEntrySize && size > this.maxEntrySize) { if (status) { status.set = "miss"; @@ -49954,7 +50057,7 @@ var require_commonjs2 = __commonJS({ if (index2 === void 0) { index2 = this.#size === 0 ? this.#tail : this.#free.length !== 0 ? this.#free.pop() : this.#size === this.#max ? this.#evict(false) : this.#size; this.#keyList[index2] = k7; - this.#valList[index2] = v8; + this.#valList[index2] = v2; this.#keyMap.set(k7, index2); this.#next[this.#tail] = index2; this.#prev[index2] = this.#tail; @@ -49967,16 +50070,16 @@ var require_commonjs2 = __commonJS({ } else { this.#moveToTail(index2); const oldVal = this.#valList[index2]; - if (v8 !== oldVal) { + if (v2 !== oldVal) { if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) { oldVal.__abortController.abort(new Error("replaced")); - const { __staleWhileFetching: s6 } = oldVal; - if (s6 !== void 0 && !noDisposeOnSet) { + const { __staleWhileFetching: s } = oldVal; + if (s !== void 0 && !noDisposeOnSet) { if (this.#hasDispose) { - this.#dispose?.(s6, k7, "set"); + this.#dispose?.(s, k7, "set"); } if (this.#hasDisposeAfter) { - this.#disposed?.push([s6, k7, "set"]); + this.#disposed?.push([s, k7, "set"]); } } } else if (!noDisposeOnSet) { @@ -49989,7 +50092,7 @@ var require_commonjs2 = __commonJS({ } this.#removeItemSize(index2); this.#addItemSize(index2, size, status); - this.#valList[index2] = v8; + this.#valList[index2] = v2; if (status) { status.set = "replace"; const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? oldVal.__staleWhileFetching : oldVal; @@ -50049,15 +50152,15 @@ var require_commonjs2 = __commonJS({ #evict(free) { const head = this.#head; const k7 = this.#keyList[head]; - const v8 = this.#valList[head]; - if (this.#hasFetchMethod && this.#isBackgroundFetch(v8)) { - v8.__abortController.abort(new Error("evicted")); + const v2 = this.#valList[head]; + if (this.#hasFetchMethod && this.#isBackgroundFetch(v2)) { + v2.__abortController.abort(new Error("evicted")); } else if (this.#hasDispose || this.#hasDisposeAfter) { if (this.#hasDispose) { - this.#dispose?.(v8, k7, "evict"); + this.#dispose?.(v2, k7, "evict"); } if (this.#hasDisposeAfter) { - this.#disposed?.push([v8, k7, "evict"]); + this.#disposed?.push([v2, k7, "evict"]); } } this.#removeItemSize(head); @@ -50096,8 +50199,8 @@ var require_commonjs2 = __commonJS({ const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; const index2 = this.#keyMap.get(k7); if (index2 !== void 0) { - const v8 = this.#valList[index2]; - if (this.#isBackgroundFetch(v8) && v8.__staleWhileFetching === void 0) { + const v2 = this.#valList[index2]; + if (this.#isBackgroundFetch(v2) && v2.__staleWhileFetching === void 0) { return false; } if (!this.#isStale(index2)) { @@ -50131,13 +50234,13 @@ var require_commonjs2 = __commonJS({ if (index2 === void 0 || !allowStale && this.#isStale(index2)) { return; } - const v8 = this.#valList[index2]; - return this.#isBackgroundFetch(v8) ? v8.__staleWhileFetching : v8; + const v2 = this.#valList[index2]; + return this.#isBackgroundFetch(v2) ? v2.__staleWhileFetching : v2; } #backgroundFetch(k7, index2, options, context5) { - const v8 = index2 === void 0 ? void 0 : this.#valList[index2]; - if (this.#isBackgroundFetch(v8)) { - return v8; + const v2 = index2 === void 0 ? void 0 : this.#valList[index2]; + if (this.#isBackgroundFetch(v2)) { + return v2; } const ac = new AC2(); const { signal } = options; @@ -50149,9 +50252,9 @@ var require_commonjs2 = __commonJS({ options, context: context5 }; - const cb = (v9, updateCache = false) => { + const cb = (v3, updateCache = false) => { const { aborted } = ac.signal; - const ignoreAbort = options.ignoreFetchAbort && v9 !== void 0; + const ignoreAbort = options.ignoreFetchAbort && v3 !== void 0; if (options.status) { if (aborted && !updateCache) { options.status.fetchAborted = true; @@ -50165,9 +50268,9 @@ var require_commonjs2 = __commonJS({ if (aborted && !ignoreAbort && !updateCache) { return fetchFail(ac.signal.reason); } - const bf2 = p6; - if (this.#valList[index2] === p6) { - if (v9 === void 0) { + const bf2 = p2; + if (this.#valList[index2] === p2) { + if (v3 === void 0) { if (bf2.__staleWhileFetching) { this.#valList[index2] = bf2.__staleWhileFetching; } else { @@ -50176,10 +50279,10 @@ var require_commonjs2 = __commonJS({ } else { if (options.status) options.status.fetchUpdated = true; - this.set(k7, v9, fetchOpts.options); + this.set(k7, v3, fetchOpts.options); } } - return v9; + return v3; }; const eb = (er) => { if (options.status) { @@ -50193,8 +50296,8 @@ var require_commonjs2 = __commonJS({ const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; const noDelete = allowStale || options.noDeleteOnFetchRejection; - const bf2 = p6; - if (this.#valList[index2] === p6) { + const bf2 = p2; + if (this.#valList[index2] === p2) { const del = !noDelete || bf2.__staleWhileFetching === void 0; if (del) { this.#delete(k7, "fetch"); @@ -50212,25 +50315,25 @@ var require_commonjs2 = __commonJS({ } }; const pcall = (res, rej) => { - const fmp = this.#fetchMethod?.(k7, v8, fetchOpts); + const fmp = this.#fetchMethod?.(k7, v2, fetchOpts); if (fmp && fmp instanceof Promise) { - fmp.then((v9) => res(v9 === void 0 ? void 0 : v9), rej); + fmp.then((v3) => res(v3 === void 0 ? void 0 : v3), rej); } ac.signal.addEventListener("abort", () => { if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { res(void 0); if (options.allowStaleOnFetchAbort) { - res = (v9) => cb(v9, true); + res = (v3) => cb(v3, true); } } }); }; if (options.status) options.status.fetchDispatched = true; - const p6 = new Promise(pcall).then(cb, eb); - const bf = Object.assign(p6, { + const p2 = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p2, { __abortController: ac, - __staleWhileFetching: v8, + __staleWhileFetching: v2, __returned: void 0 }); if (index2 === void 0) { @@ -50241,10 +50344,10 @@ var require_commonjs2 = __commonJS({ } return bf; } - #isBackgroundFetch(p6) { + #isBackgroundFetch(p2) { if (!this.#hasFetchMethod) return false; - const b6 = p6; + const b6 = p2; return !!b6 && b6 instanceof Promise && b6.hasOwnProperty("__staleWhileFetching") && b6.__abortController instanceof AC2; } async fetch(k7, fetchOptions = {}) { @@ -50299,18 +50402,18 @@ var require_commonjs2 = __commonJS({ if (index2 === void 0) { if (status) status.fetch = "miss"; - const p6 = this.#backgroundFetch(k7, index2, options, context5); - return p6.__returned = p6; + const p2 = this.#backgroundFetch(k7, index2, options, context5); + return p2.__returned = p2; } else { - const v8 = this.#valList[index2]; - if (this.#isBackgroundFetch(v8)) { - const stale = allowStale && v8.__staleWhileFetching !== void 0; + const v2 = this.#valList[index2]; + if (this.#isBackgroundFetch(v2)) { + const stale = allowStale && v2.__staleWhileFetching !== void 0; if (status) { status.fetch = "inflight"; if (stale) status.returnedStale = true; } - return stale ? v8.__staleWhileFetching : v8.__returned = v8; + return stale ? v2.__staleWhileFetching : v2.__returned = v2; } const isStale = this.#isStale(index2); if (!forceRefresh && !isStale) { @@ -50322,24 +50425,24 @@ var require_commonjs2 = __commonJS({ } if (status) this.#statusTTL(status, index2); - return v8; + return v2; } - const p6 = this.#backgroundFetch(k7, index2, options, context5); - const hasStale = p6.__staleWhileFetching !== void 0; + const p2 = this.#backgroundFetch(k7, index2, options, context5); + const hasStale = p2.__staleWhileFetching !== void 0; const staleVal = hasStale && allowStale; if (status) { status.fetch = isStale ? "stale" : "refresh"; if (staleVal && isStale) status.returnedStale = true; } - return staleVal ? p6.__staleWhileFetching : p6.__returned = p6; + return staleVal ? p2.__staleWhileFetching : p2.__returned = p2; } } async forceFetch(k7, fetchOptions = {}) { - const v8 = await this.fetch(k7, fetchOptions); - if (v8 === void 0) + const v2 = await this.fetch(k7, fetchOptions); + if (v2 === void 0) throw new Error("fetch() returned undefined"); - return v8; + return v2; } memo(k7, memoOptions = {}) { const memoMethod = this.#memoMethod; @@ -50347,10 +50450,10 @@ var require_commonjs2 = __commonJS({ throw new Error("no memoMethod provided to constructor"); } const { context: context5, forceRefresh, ...options } = memoOptions; - const v8 = this.get(k7, options); - if (!forceRefresh && v8 !== void 0) - return v8; - const vv = memoMethod(k7, v8, { + const v2 = this.get(k7, options); + if (!forceRefresh && v2 !== void 0) + return v2; + const vv = memoMethod(k7, v2, { options, context: context5 }); @@ -50403,9 +50506,9 @@ var require_commonjs2 = __commonJS({ status.get = "miss"; } } - #connect(p6, n12) { - this.#prev[n12] = p6; - this.#next[p6] = n12; + #connect(p2, n8) { + this.#prev[n8] = p2; + this.#next[p2] = n8; } #moveToTail(index2) { if (index2 !== this.#tail) { @@ -50436,15 +50539,15 @@ var require_commonjs2 = __commonJS({ this.#clear(reason); } else { this.#removeItemSize(index2); - const v8 = this.#valList[index2]; - if (this.#isBackgroundFetch(v8)) { - v8.__abortController.abort(new Error("deleted")); + const v2 = this.#valList[index2]; + if (this.#isBackgroundFetch(v2)) { + v2.__abortController.abort(new Error("deleted")); } else if (this.#hasDispose || this.#hasDisposeAfter) { if (this.#hasDispose) { - this.#dispose?.(v8, k7, reason); + this.#dispose?.(v2, k7, reason); } if (this.#hasDisposeAfter) { - this.#disposed?.push([v8, k7, reason]); + this.#disposed?.push([v2, k7, reason]); } } this.#keyMap.delete(k7); @@ -50482,16 +50585,16 @@ var require_commonjs2 = __commonJS({ } #clear(reason) { for (const index2 of this.#rindexes({ allowStale: true })) { - const v8 = this.#valList[index2]; - if (this.#isBackgroundFetch(v8)) { - v8.__abortController.abort(new Error("deleted")); + const v2 = this.#valList[index2]; + if (this.#isBackgroundFetch(v2)) { + v2.__abortController.abort(new Error("deleted")); } else { const k7 = this.#keyList[index2]; if (this.#hasDispose) { - this.#dispose?.(v8, k7, reason); + this.#dispose?.(v2, k7, reason); } if (this.#hasDisposeAfter) { - this.#disposed?.push([v8, k7, reason]); + this.#disposed?.push([v2, k7, reason]); } } } @@ -50539,12 +50642,12 @@ var require_commonjs3 = __commonJS({ var node_events_1 = __require("events"); var node_stream_1 = __importDefault(__require("stream")); var node_string_decoder_1 = __require("string_decoder"); - var isStream2 = (s6) => !!s6 && typeof s6 === "object" && (s6 instanceof Minipass2 || s6 instanceof node_stream_1.default || (0, exports2.isReadable)(s6) || (0, exports2.isWritable)(s6)); + var isStream2 = (s) => !!s && typeof s === "object" && (s instanceof Minipass2 || s instanceof node_stream_1.default || (0, exports2.isReadable)(s) || (0, exports2.isWritable)(s)); exports2.isStream = isStream2; - var isReadable2 = (s6) => !!s6 && typeof s6 === "object" && s6 instanceof node_events_1.EventEmitter && typeof s6.pipe === "function" && // node core Writable streams have a pipe() method, but it throws - s6.pipe !== node_stream_1.default.Writable.prototype.pipe; + var isReadable2 = (s) => !!s && typeof s === "object" && s instanceof node_events_1.EventEmitter && typeof s.pipe === "function" && // node core Writable streams have a pipe() method, but it throws + s.pipe !== node_stream_1.default.Writable.prototype.pipe; exports2.isReadable = isReadable2; - var isWritable2 = (s6) => !!s6 && typeof s6 === "object" && s6 instanceof node_events_1.EventEmitter && typeof s6.write === "function" && typeof s6.end === "function"; + var isWritable2 = (s) => !!s && typeof s === "object" && s instanceof node_events_1.EventEmitter && typeof s.write === "function" && typeof s.end === "function"; exports2.isWritable = isWritable2; var EOF2 = /* @__PURE__ */ Symbol("EOF"); var MAYBE_EMIT_END2 = /* @__PURE__ */ Symbol("maybeEmitEnd"); @@ -50619,8 +50722,8 @@ var require_commonjs3 = __commonJS({ src.on("error", this.proxyErrors); } }; - var isObjectModeOptions2 = (o6) => !!o6.objectMode; - var isEncodingOptions2 = (o6) => !o6.objectMode && !!o6.encoding && o6.encoding !== "buffer"; + var isObjectModeOptions2 = (o2) => !!o2.objectMode; + var isEncodingOptions2 = (o2) => !o2.objectMode && !!o2.encoding && o2.encoding !== "buffer"; var Minipass2 = class extends node_events_1.EventEmitter { [FLOWING2] = false; [PAUSED2] = false; @@ -50842,40 +50945,40 @@ var require_commonjs3 = __commonJS({ * If `n` is greater that the amount of data in the internal buffer, * then `null` is returned. */ - read(n12) { + read(n8) { if (this[DESTROYED2]) return null; this[DISCARDED2] = false; - if (this[BUFFERLENGTH2] === 0 || n12 === 0 || n12 && n12 > this[BUFFERLENGTH2]) { + if (this[BUFFERLENGTH2] === 0 || n8 === 0 || n8 && n8 > this[BUFFERLENGTH2]) { this[MAYBE_EMIT_END2](); return null; } if (this[OBJECTMODE2]) - n12 = null; + n8 = null; if (this[BUFFER3].length > 1 && !this[OBJECTMODE2]) { this[BUFFER3] = [ this[ENCODING2] ? this[BUFFER3].join("") : Buffer.concat(this[BUFFER3], this[BUFFERLENGTH2]) ]; } - const ret = this[READ2](n12 || null, this[BUFFER3][0]); + const ret = this[READ2](n8 || null, this[BUFFER3][0]); this[MAYBE_EMIT_END2](); return ret; } - [READ2](n12, chunk) { + [READ2](n8, chunk) { if (this[OBJECTMODE2]) this[BUFFERSHIFT2](); else { const c6 = chunk; - if (n12 === c6.length || n12 === null) + if (n8 === c6.length || n8 === null) this[BUFFERSHIFT2](); else if (typeof c6 === "string") { - this[BUFFER3][0] = c6.slice(n12); - chunk = c6.slice(0, n12); - this[BUFFERLENGTH2] -= n12; + this[BUFFER3][0] = c6.slice(n8); + chunk = c6.slice(0, n8); + this[BUFFERLENGTH2] -= n8; } else { - this[BUFFER3][0] = c6.subarray(n12); - chunk = c6.subarray(0, n12); - this[BUFFERLENGTH2] -= n12; + this[BUFFER3][0] = c6.subarray(n8); + chunk = c6.subarray(0, n8); + this[BUFFERLENGTH2] -= n8; } } this.emit("data", chunk); @@ -51019,16 +51122,16 @@ var require_commonjs3 = __commonJS({ * {@link Minipass#resume} is explicitly called. */ unpipe(dest) { - const p6 = this[PIPES2].find((p7) => p7.dest === dest); - if (p6) { + const p2 = this[PIPES2].find((p3) => p3.dest === dest); + if (p2) { if (this[PIPES2].length === 1) { if (this[FLOWING2] && this[DATALISTENERS2] === 0) { this[FLOWING2] = false; } this[PIPES2] = []; } else - this[PIPES2].splice(this[PIPES2].indexOf(p6), 1); - p6.unpipe(); + this[PIPES2].splice(this[PIPES2].indexOf(p2), 1); + p2.unpipe(); } } /** @@ -51194,8 +51297,8 @@ var require_commonjs3 = __commonJS({ return ret; } [EMITDATA2](data) { - for (const p6 of this[PIPES2]) { - if (p6.dest.write(data) === false) + for (const p2 of this[PIPES2]) { + if (p2.dest.write(data) === false) this.pause(); } const ret = this[DISCARDED2] ? false : super.emit("data", data); @@ -51213,15 +51316,15 @@ var require_commonjs3 = __commonJS({ if (this[DECODER2]) { const data = this[DECODER2].end(); if (data) { - for (const p6 of this[PIPES2]) { - p6.dest.write(data); + for (const p2 of this[PIPES2]) { + p2.dest.write(data); } if (!this[DISCARDED2]) super.emit("data", data); } } - for (const p6 of this[PIPES2]) { - p6.end(); + for (const p2 of this[PIPES2]) { + p2.end(); } const ret = super.emit("end"); this.removeAllListeners("end"); @@ -51237,13 +51340,13 @@ var require_commonjs3 = __commonJS({ }); if (!this[OBJECTMODE2]) buf.dataLength = 0; - const p6 = this.promise(); + const p2 = this.promise(); this.on("data", (c6) => { buf.push(c6); if (!this[OBJECTMODE2]) buf.dataLength += c6.length; }); - await p6; + await p2; return buf; } /** @@ -51263,10 +51366,10 @@ var require_commonjs3 = __commonJS({ * Return a void Promise that resolves once the stream ends. */ async promise() { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { this.on(DESTROYED2, () => reject2(new Error("stream destroyed"))); this.on("error", (er) => reject2(er)); - this.on("end", () => resolve4()); + this.on("end", () => resolve8()); }); } /** @@ -51290,7 +51393,7 @@ var require_commonjs3 = __commonJS({ return Promise.resolve({ done: false, value: res }); if (this[EOF2]) return stop(); - let resolve4; + let resolve8; let reject2; const onerr = (er) => { this.off("data", ondata); @@ -51304,19 +51407,19 @@ var require_commonjs3 = __commonJS({ this.off("end", onend); this.off(DESTROYED2, ondestroy); this.pause(); - resolve4({ value, done: !!this[EOF2] }); + resolve8({ value, done: !!this[EOF2] }); }; const onend = () => { this.off("error", onerr); this.off("data", ondata); this.off(DESTROYED2, ondestroy); stop(); - resolve4({ done: true, value: void 0 }); + resolve8({ done: true, value: void 0 }); }; const ondestroy = () => onerr(new Error("stream destroyed")); return new Promise((res2, rej) => { reject2 = rej; - resolve4 = res2; + resolve8 = res2; this.once(DESTROYED2, ondestroy); this.once("error", onerr); this.once("end", onend); @@ -51423,23 +51526,23 @@ var require_commonjs3 = __commonJS({ var require_commonjs4 = __commonJS({ "node_modules/archiver-utils/node_modules/path-scurry/dist/commonjs/index.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { + var desc = Object.getOwnPropertyDescriptor(m3, k7); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { - return m6[k7]; + return m3[k7]; } }; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { + Object.defineProperty(o2, k22, desc); + }) : (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; + o2[k22] = m3[k7]; })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + }) : function(o2, v2) { + o2["default"] = v2; }); var __importStar = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; @@ -51502,24 +51605,24 @@ var require_commonjs4 = __commonJS({ var ENOREALPATH2 = 512; var ENOCHILD2 = ENOTDIR2 | ENOENT2 | ENOREALPATH2; var TYPEMASK2 = 1023; - var entToType2 = (s6) => s6.isFile() ? IFREG2 : s6.isDirectory() ? IFDIR2 : s6.isSymbolicLink() ? IFLNK2 : s6.isCharacterDevice() ? IFCHR2 : s6.isBlockDevice() ? IFBLK2 : s6.isSocket() ? IFSOCK2 : s6.isFIFO() ? IFIFO2 : UNKNOWN2; + var entToType2 = (s) => s.isFile() ? IFREG2 : s.isDirectory() ? IFDIR2 : s.isSymbolicLink() ? IFLNK2 : s.isCharacterDevice() ? IFCHR2 : s.isBlockDevice() ? IFBLK2 : s.isSocket() ? IFSOCK2 : s.isFIFO() ? IFIFO2 : UNKNOWN2; var normalizeCache2 = /* @__PURE__ */ new Map(); - var normalize4 = (s6) => { - const c6 = normalizeCache2.get(s6); + var normalize5 = (s) => { + const c6 = normalizeCache2.get(s); if (c6) return c6; - const n12 = s6.normalize("NFKD"); - normalizeCache2.set(s6, n12); - return n12; + const n8 = s.normalize("NFKD"); + normalizeCache2.set(s, n8); + return n8; }; var normalizeNocaseCache2 = /* @__PURE__ */ new Map(); - var normalizeNocase2 = (s6) => { - const c6 = normalizeNocaseCache2.get(s6); + var normalizeNocase2 = (s) => { + const c6 = normalizeNocaseCache2.get(s); if (c6) return c6; - const n12 = normalize4(s6.toLowerCase()); - normalizeNocaseCache2.set(s6, n12); - return n12; + const n8 = normalize5(s.toLowerCase()); + normalizeNocaseCache2.set(s, n8); + return n8; }; var ResolveCache2 = class extends lru_cache_1.LRUCache { constructor() { @@ -51684,13 +51787,13 @@ var require_commonjs4 = __commonJS({ * * @internal */ - constructor(name, type = UNKNOWN2, root, roots, nocase, children2, opts) { + constructor(name, type = UNKNOWN2, root6, roots, nocase, children2, opts) { this.name = name; - this.#matchName = nocase ? normalizeNocase2(name) : normalize4(name); + this.#matchName = nocase ? normalizeNocase2(name) : normalize5(name); this.#type = type & TYPEMASK2; this.nocase = nocase; this.roots = roots; - this.root = root || this; + this.root = root6 || this; this.#children = children2; this.#fullpath = opts.fullpath; this.#relative = opts.relative; @@ -51734,11 +51837,11 @@ var require_commonjs4 = __commonJS({ return result; } #resolveParts(dirParts) { - let p6 = this; + let p2 = this; for (const part of dirParts) { - p6 = p6.child(part); + p2 = p2.child(part); } - return p6; + return p2; } /** * Returns the cached children Path objects, if still available. If they @@ -51779,14 +51882,14 @@ var require_commonjs4 = __commonJS({ return this.parent || this; } const children2 = this.children(); - const name = this.nocase ? normalizeNocase2(pathPart) : normalize4(pathPart); - for (const p6 of children2) { - if (p6.#matchName === name) { - return p6; + const name = this.nocase ? normalizeNocase2(pathPart) : normalize5(pathPart); + for (const p2 of children2) { + if (p2.#matchName === name) { + return p2; } } - const s6 = this.parent ? this.sep : ""; - const fullpath = this.#fullpath ? this.#fullpath + s6 + pathPart : void 0; + const s = this.parent ? this.sep : ""; + const fullpath = this.#fullpath ? this.#fullpath + s + pathPart : void 0; const pchild = this.newChild(pathPart, UNKNOWN2, { ...opts, parent: this, @@ -51809,12 +51912,12 @@ var require_commonjs4 = __commonJS({ return this.#relative; } const name = this.name; - const p6 = this.parent; - if (!p6) { + const p2 = this.parent; + if (!p2) { return this.#relative = this.name; } - const pv = p6.relative(); - return pv + (!pv || !p6.parent ? "" : this.sep) + name; + const pv = p2.relative(); + return pv + (!pv || !p2.parent ? "" : this.sep) + name; } /** * The relative path from the cwd, using / as the path separator. @@ -51830,12 +51933,12 @@ var require_commonjs4 = __commonJS({ if (this.#relativePosix !== void 0) return this.#relativePosix; const name = this.name; - const p6 = this.parent; - if (!p6) { + const p2 = this.parent; + if (!p2) { return this.#relativePosix = this.fullpathPosix(); } - const pv = p6.relativePosix(); - return pv + (!pv || !p6.parent ? "" : "/") + name; + const pv = p2.relativePosix(); + return pv + (!pv || !p2.parent ? "" : "/") + name; } /** * The fully resolved path string for this Path entry @@ -51845,12 +51948,12 @@ var require_commonjs4 = __commonJS({ return this.#fullpath; } const name = this.name; - const p6 = this.parent; - if (!p6) { + const p2 = this.parent; + if (!p2) { return this.#fullpath = this.name; } - const pv = p6.fullpath(); - const fp = pv + (!p6.parent ? "" : this.sep) + name; + const pv = p2.fullpath(); + const fp = pv + (!p2.parent ? "" : this.sep) + name; return this.#fullpath = fp; } /** @@ -51865,16 +51968,16 @@ var require_commonjs4 = __commonJS({ if (this.sep === "/") return this.#fullpathPosix = this.fullpath(); if (!this.parent) { - const p7 = this.fullpath().replace(/\\/g, "/"); - if (/^[a-z]:\//i.test(p7)) { - return this.#fullpathPosix = `//?/${p7}`; + const p3 = this.fullpath().replace(/\\/g, "/"); + if (/^[a-z]:\//i.test(p3)) { + return this.#fullpathPosix = `//?/${p3}`; } else { - return this.#fullpathPosix = p7; + return this.#fullpathPosix = p3; } } - const p6 = this.parent; - const pfpp = p6.fullpathPosix(); - const fpp = pfpp + (!pfpp || !p6.parent ? "" : "/") + this.name; + const p2 = this.parent; + const pfpp = p2.fullpathPosix(); + const fpp = pfpp + (!pfpp || !p2.parent ? "" : "/") + this.name; return this.#fullpathPosix = fpp; } /** @@ -52023,8 +52126,8 @@ var require_commonjs4 = __commonJS({ * Always use this method instead of testing the `path.name` property * directly. */ - isNamed(n12) { - return !this.nocase ? this.#matchName === normalize4(n12) : this.#matchName === normalizeNocase2(n12); + isNamed(n8) { + return !this.nocase ? this.#matchName === normalize5(n8) : this.#matchName === normalizeNocase2(n8); } /** * Return the Path object corresponding to the target of a symbolic link. @@ -52083,8 +52186,8 @@ var require_commonjs4 = __commonJS({ } #readdirSuccess(children2) { this.#type |= READDIR_CALLED2; - for (let p6 = children2.provisional; p6 < children2.length; p6++) { - const c6 = children2[p6]; + for (let p2 = children2.provisional; p2 < children2.length; p2++) { + const c6 = children2[p2]; if (c6) c6.#markENOENT(); } @@ -52098,8 +52201,8 @@ var require_commonjs4 = __commonJS({ #markChildrenENOENT() { const children2 = this.children(); children2.provisional = 0; - for (const p6 of children2) { - p6.#markENOENT(); + for (const p2 of children2) { + p2.#markENOENT(); } } #markENOREALPATH() { @@ -52110,10 +52213,10 @@ var require_commonjs4 = __commonJS({ #markENOTDIR() { if (this.#type & ENOTDIR2) return; - let t6 = this.#type; - if ((t6 & IFMT2) === IFDIR2) - t6 &= IFMT_UNKNOWN2; - this.#type = t6 | ENOTDIR2; + let t = this.#type; + if ((t & IFMT2) === IFDIR2) + t &= IFMT_UNKNOWN2; + this.#type = t | ENOTDIR2; this.#markChildrenENOENT(); } #readdirFail(code = "") { @@ -52127,8 +52230,8 @@ var require_commonjs4 = __commonJS({ } #lstatFail(code = "") { if (code === "ENOTDIR") { - const p6 = this.parent; - p6.#markENOTDIR(); + const p2 = this.parent; + p2.#markENOTDIR(); } else if (code === "ENOENT") { this.#markENOENT(); } @@ -52161,29 +52264,29 @@ var require_commonjs4 = __commonJS({ return child; } #readdirMaybePromoteChild(e6, c6) { - for (let p6 = c6.provisional; p6 < c6.length; p6++) { - const pchild = c6[p6]; - const name = this.nocase ? normalizeNocase2(e6.name) : normalize4(e6.name); + for (let p2 = c6.provisional; p2 < c6.length; p2++) { + const pchild = c6[p2]; + const name = this.nocase ? normalizeNocase2(e6.name) : normalize5(e6.name); if (name !== pchild.#matchName) { continue; } - return this.#readdirPromoteChild(e6, pchild, p6, c6); + return this.#readdirPromoteChild(e6, pchild, p2, c6); } } - #readdirPromoteChild(e6, p6, index2, c6) { - const v8 = p6.name; - p6.#type = p6.#type & IFMT_UNKNOWN2 | entToType2(e6); - if (v8 !== e6.name) - p6.name = e6.name; + #readdirPromoteChild(e6, p2, index2, c6) { + const v2 = p2.name; + p2.#type = p2.#type & IFMT_UNKNOWN2 | entToType2(e6); + if (v2 !== e6.name) + p2.name = e6.name; if (index2 !== c6.provisional) { if (index2 === c6.length - 1) c6.pop(); else c6.splice(index2, 1); - c6.unshift(p6); + c6.unshift(p2); } c6.provisional++; - return p6; + return p2; } /** * Call lstat() on this Path, and update all known information that can be @@ -52332,9 +52435,9 @@ var require_commonjs4 = __commonJS({ if (this.#asyncReaddirInFlight) { await this.#asyncReaddirInFlight; } else { - let resolve4 = () => { + let resolve8 = () => { }; - this.#asyncReaddirInFlight = new Promise((res) => resolve4 = res); + this.#asyncReaddirInFlight = new Promise((res) => resolve8 = res); try { for (const e6 of await this.#fs.promises.readdir(fullpath, { withFileTypes: true @@ -52347,7 +52450,7 @@ var require_commonjs4 = __commonJS({ children2.provisional = 0; } this.#asyncReaddirInFlight = void 0; - resolve4(); + resolve8(); } return children2.slice(0, children2.provisional); } @@ -52437,19 +52540,19 @@ var require_commonjs4 = __commonJS({ this.isCWD = true; const changed = /* @__PURE__ */ new Set([]); let rp = []; - let p6 = this; - while (p6 && p6.parent) { - changed.add(p6); - p6.#relative = rp.join(this.sep); - p6.#relativePosix = rp.join("/"); - p6 = p6.parent; + let p2 = this; + while (p2 && p2.parent) { + changed.add(p2); + p2.#relative = rp.join(this.sep); + p2.#relativePosix = rp.join("/"); + p2 = p2.parent; rp.push(".."); } - p6 = oldCwd; - while (p6 && p6.parent && !changed.has(p6)) { - p6.#relative = void 0; - p6.#relativePosix = void 0; - p6 = p6.parent; + p2 = oldCwd; + while (p2 && p2.parent && !changed.has(p2)) { + p2.#relative = void 0; + p2.#relativePosix = void 0; + p2 = p2.parent; } } }; @@ -52469,8 +52572,8 @@ var require_commonjs4 = __commonJS({ * * @internal */ - constructor(name, type = UNKNOWN2, root, roots, nocase, children2, opts) { - super(name, type, root, roots, nocase, children2, opts); + constructor(name, type = UNKNOWN2, root6, roots, nocase, children2, opts) { + super(name, type, root6, roots, nocase, children2, opts); } /** * @internal @@ -52492,9 +52595,9 @@ var require_commonjs4 = __commonJS({ if (rootPath === this.root.name) { return this.root; } - for (const [compare, root] of Object.entries(this.roots)) { + for (const [compare, root6] of Object.entries(this.roots)) { if (this.sameRoot(rootPath, compare)) { - return this.roots[rootPath] = root; + return this.roots[rootPath] = root6; } } return this.roots[rootPath] = new PathScurryWin322(rootPath, this).root; @@ -52523,8 +52626,8 @@ var require_commonjs4 = __commonJS({ * * @internal */ - constructor(name, type = UNKNOWN2, root, roots, nocase, children2, opts) { - super(name, type, root, roots, nocase, children2, opts); + constructor(name, type = UNKNOWN2, root6, roots, nocase, children2, opts) { + super(name, type, root6, roots, nocase, children2, opts); } /** * @internal @@ -52591,9 +52694,9 @@ var require_commonjs4 = __commonJS({ this.#resolveCache = new ResolveCache2(); this.#resolvePosixCache = new ResolveCache2(); this.#children = new ChildrenCache2(childrenCacheSize); - const split = cwdPath.substring(this.rootPath.length).split(sep7); - if (split.length === 1 && !split[0]) { - split.pop(); + const split2 = cwdPath.substring(this.rootPath.length).split(sep7); + if (split2.length === 1 && !split2[0]) { + split2.pop(); } if (nocase === void 0) { throw new TypeError("must provide nocase setting to PathScurryBase ctor"); @@ -52602,15 +52705,15 @@ var require_commonjs4 = __commonJS({ this.root = this.newRoot(this.#fs); this.roots[this.rootPath] = this.root; let prev = this.root; - let len = split.length - 1; + let len = split2.length - 1; const joinSep = pathImpl.sep; let abs = this.rootPath; let sawFirst = false; - for (const part of split) { - const l6 = len--; + for (const part of split2) { + const l3 = len--; prev = prev.child(part, { - relative: new Array(l6).fill("..").join(joinSep), - relativePosix: new Array(l6).fill("..").join("/"), + relative: new Array(l3).fill("..").join(joinSep), + relativePosix: new Array(l3).fill("..").join("/"), fullpath: abs += (sawFirst ? "" : joinSep) + part }); sawFirst = true; @@ -52647,11 +52750,11 @@ var require_commonjs4 = __commonJS({ resolve(...paths) { let r6 = ""; for (let i6 = paths.length - 1; i6 >= 0; i6--) { - const p6 = paths[i6]; - if (!p6 || p6 === ".") + const p2 = paths[i6]; + if (!p2 || p2 === ".") continue; - r6 = r6 ? `${p6}/${r6}` : p6; - if (this.isAbsolute(p6)) { + r6 = r6 ? `${p2}/${r6}` : p2; + if (this.isAbsolute(p2)) { break; } } @@ -52677,11 +52780,11 @@ var require_commonjs4 = __commonJS({ resolvePosix(...paths) { let r6 = ""; for (let i6 = paths.length - 1; i6 >= 0; i6--) { - const p6 = paths[i6]; - if (!p6 || p6 === ".") + const p2 = paths[i6]; + if (!p2 || p2 === ".") continue; - r6 = r6 ? `${p6}/${r6}` : p6; - if (this.isAbsolute(p6)) { + r6 = r6 ? `${p2}/${r6}` : p2; + if (this.isAbsolute(p2)) { break; } } @@ -52743,8 +52846,8 @@ var require_commonjs4 = __commonJS({ if (!entry.canReaddir()) { return []; } else { - const p6 = await entry.readdir(); - return withFileTypes ? p6 : p6.map((e6) => e6.name); + const p2 = await entry.readdir(); + return withFileTypes ? p2 : p2.map((e6) => e6.name); } } readdirSync(entry = this.cwd, opts = { @@ -53127,8 +53230,8 @@ var require_commonjs4 = __commonJS({ const { nocase = true } = opts; super(cwd, node_path_1.win32, "\\", { ...opts, nocase }); this.nocase = nocase; - for (let p6 = this.cwd; p6; p6 = p6.parent) { - p6.nocase = this.nocase; + for (let p2 = this.cwd; p2; p2 = p2.parent) { + p2.nocase = this.nocase; } } /** @@ -53146,8 +53249,8 @@ var require_commonjs4 = __commonJS({ /** * Return true if the provided path string is an absolute path */ - isAbsolute(p6) { - return p6.startsWith("/") || p6.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(p6); + isAbsolute(p2) { + return p2.startsWith("/") || p2.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(p2); } }; exports2.PathScurryWin32 = PathScurryWin322; @@ -53176,8 +53279,8 @@ var require_commonjs4 = __commonJS({ /** * Return true if the provided path string is an absolute path */ - isAbsolute(p6) { - return p6.startsWith("/"); + isAbsolute(p2) { + return p2.startsWith("/"); } }; exports2.PathScurryPosix = PathScurryPosix2; @@ -53234,15 +53337,15 @@ var require_pattern = __commonJS({ this.#platform = platform3; if (this.#index === 0) { if (this.isUNC()) { - const [p0, p1, p22, p32, ...prest] = this.#patternList; + const [p0, p1, p2, p3, ...prest] = this.#patternList; const [g0, g1, g22, g32, ...grest] = this.#globList; if (prest[0] === "") { prest.shift(); grest.shift(); } - const p6 = [p0, p1, p22, p32, ""].join("/"); + const p4 = [p0, p1, p2, p3, ""].join("/"); const g6 = [g0, g1, g22, g32, ""].join("/"); - this.#patternList = [p6, ...prest]; + this.#patternList = [p4, ...prest]; this.#globList = [g6, ...grest]; this.length = this.#patternList.length; } else if (this.isDrive() || this.isAbsolute()) { @@ -53252,9 +53355,9 @@ var require_pattern = __commonJS({ prest.shift(); grest.shift(); } - const p6 = p1 + "/"; + const p2 = p1 + "/"; const g6 = g1 + "/"; - this.#patternList = [p6, ...prest]; + this.#patternList = [p2, ...prest]; this.#globList = [g6, ...grest]; this.length = this.#patternList.length; } @@ -53343,8 +53446,8 @@ var require_pattern = __commonJS({ * consume the root of the pattern, and return it */ root() { - const p6 = this.#patternList[0]; - return typeof p6 === "string" && this.isAbsolute() && this.#index === 0 ? p6 : ""; + const p2 = this.#patternList[0]; + return typeof p2 === "string" && this.isAbsolute() && this.#index === 0 ? p2 : ""; } /** * Check to see if the current globstar pattern is allowed to follow @@ -53415,46 +53518,46 @@ var require_ignore = __commonJS({ parsed.shift(); globParts.shift(); } - const p6 = new pattern_js_1.Pattern(parsed, globParts, 0, this.platform); - const m6 = new minimatch_1.Minimatch(p6.globString(), this.mmopts); + const p2 = new pattern_js_1.Pattern(parsed, globParts, 0, this.platform); + const m3 = new minimatch_1.Minimatch(p2.globString(), this.mmopts); const children2 = globParts[globParts.length - 1] === "**"; - const absolute = p6.isAbsolute(); + const absolute = p2.isAbsolute(); if (absolute) - this.absolute.push(m6); + this.absolute.push(m3); else - this.relative.push(m6); + this.relative.push(m3); if (children2) { if (absolute) - this.absoluteChildren.push(m6); + this.absoluteChildren.push(m3); else - this.relativeChildren.push(m6); + this.relativeChildren.push(m3); } } } - ignored(p6) { - const fullpath = p6.fullpath(); + ignored(p2) { + const fullpath = p2.fullpath(); const fullpaths = `${fullpath}/`; - const relative2 = p6.relative() || "."; - const relatives = `${relative2}/`; - for (const m6 of this.relative) { - if (m6.match(relative2) || m6.match(relatives)) + const relative3 = p2.relative() || "."; + const relatives = `${relative3}/`; + for (const m3 of this.relative) { + if (m3.match(relative3) || m3.match(relatives)) return true; } - for (const m6 of this.absolute) { - if (m6.match(fullpath) || m6.match(fullpaths)) + for (const m3 of this.absolute) { + if (m3.match(fullpath) || m3.match(fullpaths)) return true; } return false; } - childrenIgnored(p6) { - const fullpath = p6.fullpath() + "/"; - const relative2 = (p6.relative() || ".") + "/"; - for (const m6 of this.relativeChildren) { - if (m6.match(relative2)) + childrenIgnored(p2) { + const fullpath = p2.fullpath() + "/"; + const relative3 = (p2.relative() || ".") + "/"; + for (const m3 of this.relativeChildren) { + if (m3.match(relative3)) return true; } - for (const m6 of this.absoluteChildren) { - if (m6.match(fullpath)) + for (const m3 of this.absoluteChildren) { + if (m3.match(fullpath)) return true; } return false; @@ -53495,16 +53598,16 @@ var require_processor = __commonJS({ var MatchRecord2 = class { store = /* @__PURE__ */ new Map(); add(target, absolute, ifDir) { - const n12 = (absolute ? 2 : 0) | (ifDir ? 1 : 0); + const n8 = (absolute ? 2 : 0) | (ifDir ? 1 : 0); const current = this.store.get(target); - this.store.set(target, current === void 0 ? n12 : n12 & current); + this.store.set(target, current === void 0 ? n8 : n8 & current); } // match, absolute, ifdir entries() { - return [...this.store.entries()].map(([path10, n12]) => [ + return [...this.store.entries()].map(([path10, n8]) => [ path10, - !!(n12 & 2), - !!(n12 & 1) + !!(n8 & 2), + !!(n8 & 1) ]); } }; @@ -53517,7 +53620,7 @@ var require_processor = __commonJS({ } const subs = this.store.get(target); if (subs) { - if (!subs.find((p6) => p6.globString() === pattern.globString())) { + if (!subs.find((p2) => p2.globString() === pattern.globString())) { subs.push(pattern); } } else @@ -53534,7 +53637,7 @@ var require_processor = __commonJS({ return this.keys().map((k7) => [k7, this.store.get(k7)]); } keys() { - return [...this.store.keys()].filter((t6) => t6.canReaddir()); + return [...this.store.keys()].filter((t) => t.canReaddir()); } }; exports2.SubWalks = SubWalks2; @@ -53554,54 +53657,54 @@ var require_processor = __commonJS({ } processPatterns(target, patterns) { this.patterns = patterns; - const processingSet = patterns.map((p6) => [target, p6]); - for (let [t6, pattern] of processingSet) { - this.hasWalkedCache.storeWalked(t6, pattern); - const root = pattern.root(); + const processingSet = patterns.map((p2) => [target, p2]); + for (let [t, pattern] of processingSet) { + this.hasWalkedCache.storeWalked(t, pattern); + const root6 = pattern.root(); const absolute = pattern.isAbsolute() && this.opts.absolute !== false; - if (root) { - t6 = t6.resolve(root === "/" && this.opts.root !== void 0 ? this.opts.root : root); + if (root6) { + t = t.resolve(root6 === "/" && this.opts.root !== void 0 ? this.opts.root : root6); const rest2 = pattern.rest(); if (!rest2) { - this.matches.add(t6, true, false); + this.matches.add(t, true, false); continue; } else { pattern = rest2; } } - if (t6.isENOENT()) + if (t.isENOENT()) continue; - let p6; + let p2; let rest; let changed = false; - while (typeof (p6 = pattern.pattern()) === "string" && (rest = pattern.rest())) { - const c6 = t6.resolve(p6); - t6 = c6; + while (typeof (p2 = pattern.pattern()) === "string" && (rest = pattern.rest())) { + const c6 = t.resolve(p2); + t = c6; pattern = rest; changed = true; } - p6 = pattern.pattern(); + p2 = pattern.pattern(); rest = pattern.rest(); if (changed) { - if (this.hasWalkedCache.hasWalked(t6, pattern)) + if (this.hasWalkedCache.hasWalked(t, pattern)) continue; - this.hasWalkedCache.storeWalked(t6, pattern); + this.hasWalkedCache.storeWalked(t, pattern); } - if (typeof p6 === "string") { - const ifDir = p6 === ".." || p6 === "" || p6 === "."; - this.matches.add(t6.resolve(p6), absolute, ifDir); + if (typeof p2 === "string") { + const ifDir = p2 === ".." || p2 === "" || p2 === "."; + this.matches.add(t.resolve(p2), absolute, ifDir); continue; - } else if (p6 === minimatch_1.GLOBSTAR) { - if (!t6.isSymbolicLink() || this.follow || pattern.checkFollowGlobstar()) { - this.subwalks.add(t6, pattern); + } else if (p2 === minimatch_1.GLOBSTAR) { + if (!t.isSymbolicLink() || this.follow || pattern.checkFollowGlobstar()) { + this.subwalks.add(t, pattern); } const rp = rest?.pattern(); const rrest = rest?.rest(); if (!rest || (rp === "" || rp === ".") && !rrest) { - this.matches.add(t6, absolute, rp === "" || rp === "."); + this.matches.add(t, absolute, rp === "" || rp === "."); } else { if (rp === "..") { - const tp = t6.parent || t6; + const tp = t.parent || t; if (!rrest) this.matches.add(tp, absolute, true); else if (!this.hasWalkedCache.hasWalked(tp, rrest)) { @@ -53609,8 +53712,8 @@ var require_processor = __commonJS({ } } } - } else if (p6 instanceof RegExp) { - this.subwalks.add(t6, pattern); + } else if (p2 instanceof RegExp) { + this.subwalks.add(t, pattern); } } return this; @@ -53631,14 +53734,14 @@ var require_processor = __commonJS({ for (const e6 of entries) { for (const pattern of patterns) { const absolute = pattern.isAbsolute(); - const p6 = pattern.pattern(); + const p2 = pattern.pattern(); const rest = pattern.rest(); - if (p6 === minimatch_1.GLOBSTAR) { + if (p2 === minimatch_1.GLOBSTAR) { results.testGlobstar(e6, pattern, rest, absolute); - } else if (p6 instanceof RegExp) { - results.testRegExp(e6, p6, rest, absolute); + } else if (p2 instanceof RegExp) { + results.testRegExp(e6, p2, rest, absolute); } else { - results.testString(e6, p6, rest, absolute); + results.testString(e6, p2, rest, absolute); } } } @@ -53674,8 +53777,8 @@ var require_processor = __commonJS({ } } } - testRegExp(e6, p6, rest, absolute) { - if (!p6.test(e6.name)) + testRegExp(e6, p2, rest, absolute) { + if (!p2.test(e6.name)) return; if (!rest) { this.matches.add(e6, absolute, false); @@ -53683,8 +53786,8 @@ var require_processor = __commonJS({ this.subwalks.add(e6, rest); } } - testString(e6, p6, rest, absolute) { - if (!e6.isNamed(p6)) + testString(e6, p2, rest, absolute) { + if (!e6.isNamed(p2)) return; if (!rest) { this.matches.add(e6, absolute, false); @@ -53729,8 +53832,8 @@ var require_walker = __commonJS({ if (opts.ignore || !this.includeChildMatches) { this.#ignore = makeIgnore2(opts.ignore ?? [], opts); if (!this.includeChildMatches && typeof this.#ignore.add !== "function") { - const m6 = "cannot ignore child matches, ignore lacks add() method."; - throw new Error(m6); + const m3 = "cannot ignore child matches, ignore lacks add() method."; + throw new Error(m3); } } this.maxDepth = opts.maxDepth || Infinity; @@ -53782,14 +53885,14 @@ var require_walker = __commonJS({ e6 = rpc; } const needStat = e6.isUnknown() || this.opts.stat; - const s6 = needStat ? await e6.lstat() : e6; - if (this.opts.follow && this.opts.nodir && s6?.isSymbolicLink()) { - const target = await s6.realpath(); + const s = needStat ? await e6.lstat() : e6; + if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) { + const target = await s.realpath(); if (target && (target.isUnknown() || this.opts.stat)) { await target.lstat(); } } - return this.matchCheckTest(s6, ifDir); + return this.matchCheckTest(s, ifDir); } matchCheckTest(e6, ifDir) { return e6 && (this.maxDepth === Infinity || e6.depth() <= this.maxDepth) && (!ifDir || e6.canReaddir()) && (!this.opts.nodir || !e6.isDirectory()) && (!this.opts.nodir || !this.opts.follow || !e6.isSymbolicLink() || !e6.realpathCached()?.isDirectory()) && !this.#ignored(e6) ? e6 : void 0; @@ -53805,14 +53908,14 @@ var require_walker = __commonJS({ e6 = rpc; } const needStat = e6.isUnknown() || this.opts.stat; - const s6 = needStat ? e6.lstatSync() : e6; - if (this.opts.follow && this.opts.nodir && s6?.isSymbolicLink()) { - const target = s6.realpathSync(); + const s = needStat ? e6.lstatSync() : e6; + if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) { + const target = s.realpathSync(); if (target && (target?.isUnknown() || this.opts.stat)) { target.lstatSync(); } } - return this.matchCheckTest(s6, ifDir); + return this.matchCheckTest(s, ifDir); } matchFinish(e6, absolute) { if (this.#ignored(e6)) @@ -53836,14 +53939,14 @@ var require_walker = __commonJS({ } } async match(e6, absolute, ifDir) { - const p6 = await this.matchCheck(e6, ifDir); - if (p6) - this.matchFinish(p6, absolute); + const p2 = await this.matchCheck(e6, ifDir); + if (p2) + this.matchFinish(p2, absolute); } matchSync(e6, absolute, ifDir) { - const p6 = this.matchCheckSync(e6, ifDir); - if (p6) - this.matchFinish(p6, absolute); + const p2 = this.matchCheckSync(e6, ifDir); + if (p2) + this.matchFinish(p2, absolute); } walkCB(target, patterns, cb) { if (this.signal?.aborted) @@ -53865,22 +53968,22 @@ var require_walker = __commonJS({ if (--tasks === 0) cb(); }; - for (const [m6, absolute, ifDir] of processor.matches.entries()) { - if (this.#ignored(m6)) + for (const [m3, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m3)) continue; tasks++; - this.match(m6, absolute, ifDir).then(() => next()); + this.match(m3, absolute, ifDir).then(() => next()); } - for (const t6 of processor.subwalkTargets()) { - if (this.maxDepth !== Infinity && t6.depth() >= this.maxDepth) { + for (const t of processor.subwalkTargets()) { + if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) { continue; } tasks++; - const childrenCached = t6.readdirCached(); - if (t6.calledReaddir()) - this.walkCB3(t6, childrenCached, processor, next); + const childrenCached = t.readdirCached(); + if (t.calledReaddir()) + this.walkCB3(t, childrenCached, processor, next); else { - t6.readdirCB((_3, entries) => this.walkCB3(t6, entries, processor, next), true); + t.readdirCB((_3, entries) => this.walkCB3(t, entries, processor, next), true); } } next(); @@ -53892,11 +53995,11 @@ var require_walker = __commonJS({ if (--tasks === 0) cb(); }; - for (const [m6, absolute, ifDir] of processor.matches.entries()) { - if (this.#ignored(m6)) + for (const [m3, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m3)) continue; tasks++; - this.match(m6, absolute, ifDir).then(() => next()); + this.match(m3, absolute, ifDir).then(() => next()); } for (const [target2, patterns] of processor.subwalks.entries()) { tasks++; @@ -53924,18 +54027,18 @@ var require_walker = __commonJS({ if (--tasks === 0) cb(); }; - for (const [m6, absolute, ifDir] of processor.matches.entries()) { - if (this.#ignored(m6)) + for (const [m3, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m3)) continue; - this.matchSync(m6, absolute, ifDir); + this.matchSync(m3, absolute, ifDir); } - for (const t6 of processor.subwalkTargets()) { - if (this.maxDepth !== Infinity && t6.depth() >= this.maxDepth) { + for (const t of processor.subwalkTargets()) { + if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) { continue; } tasks++; - const children2 = t6.readdirSync(); - this.walkCB3Sync(t6, children2, processor, next); + const children2 = t.readdirSync(); + this.walkCB3Sync(t, children2, processor, next); } next(); } @@ -53946,10 +54049,10 @@ var require_walker = __commonJS({ if (--tasks === 0) cb(); }; - for (const [m6, absolute, ifDir] of processor.matches.entries()) { - if (this.#ignored(m6)) + for (const [m3, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m3)) continue; - this.matchSync(m6, absolute, ifDir); + this.matchSync(m3, absolute, ifDir); } for (const [target2, patterns] of processor.subwalks.entries()) { tasks++; @@ -54131,13 +54234,13 @@ var require_glob = __commonJS({ } this.windowsPathsNoEscape = !!opts.windowsPathsNoEscape || opts.allowWindowsEscape === false; if (this.windowsPathsNoEscape) { - pattern = pattern.map((p6) => p6.replace(/\\/g, "/")); + pattern = pattern.map((p2) => p2.replace(/\\/g, "/")); } if (this.matchBase) { if (opts.noglobstar) { throw new TypeError("base matching requires globstar"); } - pattern = pattern.map((p6) => p6.includes("/") ? p6 : `./**/${p6}`); + pattern = pattern.map((p2) => p2.includes("/") ? p2 : `./**/${p2}`); } this.pattern = pattern; this.platform = opts.platform || defaultPlatform5; @@ -54172,10 +54275,10 @@ var require_glob = __commonJS({ windowsPathsNoEscape: this.windowsPathsNoEscape, debug: !!this.opts.debug }; - const mms = this.pattern.map((p6) => new minimatch_1.Minimatch(p6, mmo)); - const [matchSet, globParts] = mms.reduce((set, m6) => { - set[0].push(...m6.set); - set[1].push(...m6.globParts); + const mms = this.pattern.map((p2) => new minimatch_1.Minimatch(p2, mmo)); + const [matchSet, globParts] = mms.reduce((set, m3) => { + set[0].push(...m3.set); + set[1].push(...m3.globParts); return set; }, [[], []]); this.patterns = matchSet.map((set, i6) => { @@ -54261,8 +54364,8 @@ var require_has_magic = __commonJS({ if (!Array.isArray(pattern)) { pattern = [pattern]; } - for (const p6 of pattern) { - if (new minimatch_1.Minimatch(p6, options).hasMagic()) + for (const p2 of pattern) { + if (new minimatch_1.Minimatch(p2, options).hasMagic()) return true; } return false; @@ -54787,8 +54890,8 @@ var require_inspect2 = __commonJS({ "node_modules/archiver/node_modules/readable-stream/lib/ours/util/inspect.js"(exports2, module) { "use strict"; module.exports = { - format(format2, ...args) { - return format2.replace(/%([sdifj])/g, function(...[_unused, type]) { + format(format4, ...args) { + return format4.replace(/%([sdifj])/g, function(...[_unused, type]) { const replacement = args.shift(); if (type === "f") { return replacement.toFixed(6); @@ -54837,7 +54940,7 @@ var require_inspect2 = __commonJS({ var require_errors4 = __commonJS({ "node_modules/archiver/node_modules/readable-stream/lib/ours/errors.js"(exports2, module) { "use strict"; - var { format: format2, inspect: inspect2 } = require_inspect2(); + var { format: format4, inspect: inspect3 } = require_inspect2(); var { AggregateError: CustomAggregateError } = require_primordials2(); var AggregateError = globalThis.AggregateError || CustomAggregateError; var kIsNodeError = /* @__PURE__ */ Symbol("kIsNodeError"); @@ -54887,9 +54990,9 @@ var require_errors4 = __commonJS({ if (args.length === 0) { return msg; } - return format2(msg, ...args); + return format4(msg, ...args); } - function E2(code, message, Base) { + function E(code, message, Base) { if (!Base) { Base = Error; } @@ -54950,8 +55053,8 @@ var require_errors4 = __commonJS({ this.name = "AbortError"; } }; - E2("ERR_ASSERTION", "%s", Error); - E2( + E("ERR_ASSERTION", "%s", Error); + E( "ERR_INVALID_ARG_TYPE", (name, expected, actual) => { assert2(typeof name === "string", "'name' must be a string"); @@ -55046,13 +55149,13 @@ var require_errors4 = __commonJS({ if ((_actual$constructor = actual.constructor) !== null && _actual$constructor !== void 0 && _actual$constructor.name) { msg += `. Received an instance of ${actual.constructor.name}`; } else { - const inspected = inspect2(actual, { + const inspected = inspect3(actual, { depth: -1 }); msg += `. Received ${inspected}`; } } else { - let inspected = inspect2(actual, { + let inspected = inspect3(actual, { colors: false }); if (inspected.length > 25) { @@ -55064,10 +55167,10 @@ var require_errors4 = __commonJS({ }, TypeError ); - E2( + E( "ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => { - let inspected = inspect2(value); + let inspected = inspect3(value); if (inspected.length > 128) { inspected = inspected.slice(0, 128) + "..."; } @@ -55076,7 +55179,7 @@ var require_errors4 = __commonJS({ }, TypeError ); - E2( + E( "ERR_INVALID_RETURN_VALUE", (input, name, value) => { var _value$constructor; @@ -55085,7 +55188,7 @@ var require_errors4 = __commonJS({ }, TypeError ); - E2( + E( "ERR_MISSING_ARGS", (...args) => { assert2(args.length > 0, "At least one arg needs to be specified"); @@ -55110,7 +55213,7 @@ var require_errors4 = __commonJS({ }, TypeError ); - E2( + E( "ERR_OUT_OF_RANGE", (str, range6, input) => { assert2(range6, 'Missing "range" argument'); @@ -55125,23 +55228,23 @@ var require_errors4 = __commonJS({ } received += "n"; } else { - received = inspect2(input); + received = inspect3(input); } return `The value of "${str}" is out of range. It must be ${range6}. Received ${received}`; }, RangeError ); - E2("ERR_MULTIPLE_CALLBACK", "Callback called multiple times", Error); - E2("ERR_METHOD_NOT_IMPLEMENTED", "The %s method is not implemented", Error); - E2("ERR_STREAM_ALREADY_FINISHED", "Cannot call %s after a stream was finished", Error); - E2("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable", Error); - E2("ERR_STREAM_DESTROYED", "Cannot call %s after a stream was destroyed", Error); - E2("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); - E2("ERR_STREAM_PREMATURE_CLOSE", "Premature close", Error); - E2("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF", Error); - E2("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event", Error); - E2("ERR_STREAM_WRITE_AFTER_END", "write after end", Error); - E2("ERR_UNKNOWN_ENCODING", "Unknown encoding: %s", TypeError); + E("ERR_MULTIPLE_CALLBACK", "Callback called multiple times", Error); + E("ERR_METHOD_NOT_IMPLEMENTED", "The %s method is not implemented", Error); + E("ERR_STREAM_ALREADY_FINISHED", "Cannot call %s after a stream was finished", Error); + E("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable", Error); + E("ERR_STREAM_DESTROYED", "Cannot call %s after a stream was destroyed", Error); + E("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); + E("ERR_STREAM_PREMATURE_CLOSE", "Premature close", Error); + E("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF", Error); + E("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event", Error); + E("ERR_STREAM_WRITE_AFTER_END", "write after end", Error); + E("ERR_UNKNOWN_ENCODING", "Unknown encoding: %s", TypeError); module.exports = { AbortError: AbortError4, aggregateTwoErrors: hideStackFrames(aggregateTwoErrors), @@ -55156,7 +55259,7 @@ var require_util12 = __commonJS({ "node_modules/archiver/node_modules/readable-stream/lib/ours/util.js"(exports2, module) { "use strict"; var bufferModule = __require("buffer"); - var { format: format2, inspect: inspect2 } = require_inspect2(); + var { format: format4, inspect: inspect3 } = require_inspect2(); var { codes: { ERR_INVALID_ARG_TYPE } } = require_errors4(); @@ -55195,25 +55298,25 @@ var require_util12 = __commonJS({ }; }, createDeferredPromise: function() { - let resolve4; + let resolve8; let reject2; const promise = new Promise((res, rej) => { - resolve4 = res; + resolve8 = res; reject2 = rej; }); return { promise, - resolve: resolve4, + resolve: resolve8, reject: reject2 }; }, promisify(fn) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { fn((err, ...args) => { if (err) { return reject2(err); } - return resolve4(...args); + return resolve8(...args); }); }); }, @@ -55221,8 +55324,8 @@ var require_util12 = __commonJS({ return function() { }; }, - format: format2, - inspect: inspect2, + format: format4, + inspect: inspect3, types: { isAsyncFunction(fn) { return fn instanceof AsyncFunction; @@ -55383,7 +55486,7 @@ var require_validators2 = __commonJS({ var validateOneOf = hideStackFrames((value, name, oneOf) => { if (!ArrayPrototypeIncludes(oneOf, value)) { const allowed = ArrayPrototypeJoin( - ArrayPrototypeMap(oneOf, (v8) => typeof v8 === "string" ? `'${v8}'` : String2(v8)), + ArrayPrototypeMap(oneOf, (v2) => typeof v2 === "string" ? `'${v2}'` : String2(v2)), ", " ); const reason = "must be one of: " + allowed; @@ -55997,7 +56100,7 @@ var require_end_of_stream2 = __commonJS({ validateBoolean(opts.cleanup, "cleanup"); autoCleanup = opts.cleanup; } - return new Promise2((resolve4, reject2) => { + return new Promise2((resolve8, reject2) => { const cleanup = eos(stream5, opts, (err) => { if (autoCleanup) { cleanup(); @@ -56005,7 +56108,7 @@ var require_end_of_stream2 = __commonJS({ if (err) { reject2(err); } else { - resolve4(); + resolve8(); } }); }); @@ -56029,11 +56132,11 @@ var require_destroy3 = __commonJS({ var { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils4(); var kDestroy = Symbol2("kDestroy"); var kConstruct = Symbol2("kConstruct"); - function checkError(err, w5, r6) { + function checkError(err, w, r6) { if (err) { err.stack; - if (w5 && !w5.errored) { - w5.errored = err; + if (w && !w.errored) { + w.errored = err; } if (r6 && !r6.errored) { r6.errored = err; @@ -56042,22 +56145,22 @@ var require_destroy3 = __commonJS({ } function destroy2(err, cb) { const r6 = this._readableState; - const w5 = this._writableState; - const s6 = w5 || r6; - if (w5 !== null && w5 !== void 0 && w5.destroyed || r6 !== null && r6 !== void 0 && r6.destroyed) { + const w = this._writableState; + const s = w || r6; + if (w !== null && w !== void 0 && w.destroyed || r6 !== null && r6 !== void 0 && r6.destroyed) { if (typeof cb === "function") { cb(); } return this; } - checkError(err, w5, r6); - if (w5) { - w5.destroyed = true; + checkError(err, w, r6); + if (w) { + w.destroyed = true; } if (r6) { r6.destroyed = true; } - if (!s6.constructed) { + if (!s.constructed) { this.once(kDestroy, function(er) { _destroy(this, aggregateTwoErrors(er, err), cb); }); @@ -56074,10 +56177,10 @@ var require_destroy3 = __commonJS({ } called = true; const r6 = self2._readableState; - const w5 = self2._writableState; - checkError(err2, w5, r6); - if (w5) { - w5.closed = true; + const w = self2._writableState; + checkError(err2, w, r6); + if (w) { + w.closed = true; } if (r6) { r6.closed = true; @@ -56103,25 +56206,25 @@ var require_destroy3 = __commonJS({ } function emitCloseNT(self2) { const r6 = self2._readableState; - const w5 = self2._writableState; - if (w5) { - w5.closeEmitted = true; + const w = self2._writableState; + if (w) { + w.closeEmitted = true; } if (r6) { r6.closeEmitted = true; } - if (w5 !== null && w5 !== void 0 && w5.emitClose || r6 !== null && r6 !== void 0 && r6.emitClose) { + if (w !== null && w !== void 0 && w.emitClose || r6 !== null && r6 !== void 0 && r6.emitClose) { self2.emit("close"); } } function emitErrorNT(self2, err) { const r6 = self2._readableState; - const w5 = self2._writableState; - if (w5 !== null && w5 !== void 0 && w5.errorEmitted || r6 !== null && r6 !== void 0 && r6.errorEmitted) { + const w = self2._writableState; + if (w !== null && w !== void 0 && w.errorEmitted || r6 !== null && r6 !== void 0 && r6.errorEmitted) { return; } - if (w5) { - w5.errorEmitted = true; + if (w) { + w.errorEmitted = true; } if (r6) { r6.errorEmitted = true; @@ -56130,7 +56233,7 @@ var require_destroy3 = __commonJS({ } function undestroy() { const r6 = this._readableState; - const w5 = this._writableState; + const w = this._writableState; if (r6) { r6.constructed = true; r6.closed = false; @@ -56142,32 +56245,32 @@ var require_destroy3 = __commonJS({ r6.ended = r6.readable === false; r6.endEmitted = r6.readable === false; } - if (w5) { - w5.constructed = true; - w5.destroyed = false; - w5.closed = false; - w5.closeEmitted = false; - w5.errored = null; - w5.errorEmitted = false; - w5.finalCalled = false; - w5.prefinished = false; - w5.ended = w5.writable === false; - w5.ending = w5.writable === false; - w5.finished = w5.writable === false; + if (w) { + w.constructed = true; + w.destroyed = false; + w.closed = false; + w.closeEmitted = false; + w.errored = null; + w.errorEmitted = false; + w.finalCalled = false; + w.prefinished = false; + w.ended = w.writable === false; + w.ending = w.writable === false; + w.finished = w.writable === false; } } function errorOrDestroy(stream5, err, sync2) { const r6 = stream5._readableState; - const w5 = stream5._writableState; - if (w5 !== null && w5 !== void 0 && w5.destroyed || r6 !== null && r6 !== void 0 && r6.destroyed) { + const w = stream5._writableState; + if (w !== null && w !== void 0 && w.destroyed || r6 !== null && r6 !== void 0 && r6.destroyed) { return this; } - if (r6 !== null && r6 !== void 0 && r6.autoDestroy || w5 !== null && w5 !== void 0 && w5.autoDestroy) + if (r6 !== null && r6 !== void 0 && r6.autoDestroy || w !== null && w !== void 0 && w.autoDestroy) stream5.destroy(err); else if (err) { err.stack; - if (w5 && !w5.errored) { - w5.errored = err; + if (w && !w.errored) { + w.errored = err; } if (r6 && !r6.errored) { r6.errored = err; @@ -56184,12 +56287,12 @@ var require_destroy3 = __commonJS({ return; } const r6 = stream5._readableState; - const w5 = stream5._writableState; + const w = stream5._writableState; if (r6) { r6.constructed = false; } - if (w5) { - w5.constructed = false; + if (w) { + w.constructed = false; } stream5.once(kConstruct, cb); if (stream5.listenerCount(kConstruct) > 1) { @@ -56206,15 +56309,15 @@ var require_destroy3 = __commonJS({ } called = true; const r6 = stream5._readableState; - const w5 = stream5._writableState; - const s6 = w5 || r6; + const w = stream5._writableState; + const s = w || r6; if (r6) { r6.constructed = true; } - if (w5) { - w5.constructed = true; + if (w) { + w.constructed = true; } - if (s6.destroyed) { + if (s.destroyed) { stream5.emit(kDestroy, err); } else if (err) { errorOrDestroy(stream5, err, true); @@ -56414,17 +56517,17 @@ var require_buffer_list2 = __commonJS({ "node_modules/archiver/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports2, module) { "use strict"; var { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array: Uint8Array2 } = require_primordials2(); - var { Buffer: Buffer7 } = __require("buffer"); - var { inspect: inspect2 } = require_util12(); + var { Buffer: Buffer4 } = __require("buffer"); + var { inspect: inspect3 } = require_util12(); module.exports = class BufferList { constructor() { this.head = null; this.tail = null; this.length = 0; } - push(v8) { + push(v2) { const entry = { - data: v8, + data: v2, next: null }; if (this.length > 0) this.tail.next = entry; @@ -56432,9 +56535,9 @@ var require_buffer_list2 = __commonJS({ this.tail = entry; ++this.length; } - unshift(v8) { + unshift(v2) { const entry = { - data: v8, + data: v2, next: this.head }; if (this.length === 0) this.tail = entry; @@ -56453,106 +56556,106 @@ var require_buffer_list2 = __commonJS({ this.head = this.tail = null; this.length = 0; } - join(s6) { + join(s) { if (this.length === 0) return ""; - let p6 = this.head; - let ret = "" + p6.data; - while ((p6 = p6.next) !== null) ret += s6 + p6.data; + let p2 = this.head; + let ret = "" + p2.data; + while ((p2 = p2.next) !== null) ret += s + p2.data; return ret; } - concat(n12) { - if (this.length === 0) return Buffer7.alloc(0); - const ret = Buffer7.allocUnsafe(n12 >>> 0); - let p6 = this.head; + concat(n8) { + if (this.length === 0) return Buffer4.alloc(0); + const ret = Buffer4.allocUnsafe(n8 >>> 0); + let p2 = this.head; let i6 = 0; - while (p6) { - TypedArrayPrototypeSet(ret, p6.data, i6); - i6 += p6.data.length; - p6 = p6.next; + while (p2) { + TypedArrayPrototypeSet(ret, p2.data, i6); + i6 += p2.data.length; + p2 = p2.next; } return ret; } // Consumes a specified amount of bytes or characters from the buffered data. - consume(n12, hasStrings) { + consume(n8, hasStrings) { const data = this.head.data; - if (n12 < data.length) { - const slice = data.slice(0, n12); - this.head.data = data.slice(n12); + if (n8 < data.length) { + const slice = data.slice(0, n8); + this.head.data = data.slice(n8); return slice; } - if (n12 === data.length) { + if (n8 === data.length) { return this.shift(); } - return hasStrings ? this._getString(n12) : this._getBuffer(n12); + return hasStrings ? this._getString(n8) : this._getBuffer(n8); } first() { return this.head.data; } *[SymbolIterator]() { - for (let p6 = this.head; p6; p6 = p6.next) { - yield p6.data; + for (let p2 = this.head; p2; p2 = p2.next) { + yield p2.data; } } // Consumes a specified amount of characters from the buffered data. - _getString(n12) { + _getString(n8) { let ret = ""; - let p6 = this.head; + let p2 = this.head; let c6 = 0; do { - const str = p6.data; - if (n12 > str.length) { + const str = p2.data; + if (n8 > str.length) { ret += str; - n12 -= str.length; + n8 -= str.length; } else { - if (n12 === str.length) { + if (n8 === str.length) { ret += str; ++c6; - if (p6.next) this.head = p6.next; + if (p2.next) this.head = p2.next; else this.head = this.tail = null; } else { - ret += StringPrototypeSlice(str, 0, n12); - this.head = p6; - p6.data = StringPrototypeSlice(str, n12); + ret += StringPrototypeSlice(str, 0, n8); + this.head = p2; + p2.data = StringPrototypeSlice(str, n8); } break; } ++c6; - } while ((p6 = p6.next) !== null); + } while ((p2 = p2.next) !== null); this.length -= c6; return ret; } // Consumes a specified amount of bytes from the buffered data. - _getBuffer(n12) { - const ret = Buffer7.allocUnsafe(n12); - const retLen = n12; - let p6 = this.head; + _getBuffer(n8) { + const ret = Buffer4.allocUnsafe(n8); + const retLen = n8; + let p2 = this.head; let c6 = 0; do { - const buf = p6.data; - if (n12 > buf.length) { - TypedArrayPrototypeSet(ret, buf, retLen - n12); - n12 -= buf.length; + const buf = p2.data; + if (n8 > buf.length) { + TypedArrayPrototypeSet(ret, buf, retLen - n8); + n8 -= buf.length; } else { - if (n12 === buf.length) { - TypedArrayPrototypeSet(ret, buf, retLen - n12); + if (n8 === buf.length) { + TypedArrayPrototypeSet(ret, buf, retLen - n8); ++c6; - if (p6.next) this.head = p6.next; + if (p2.next) this.head = p2.next; else this.head = this.tail = null; } else { - TypedArrayPrototypeSet(ret, new Uint8Array2(buf.buffer, buf.byteOffset, n12), retLen - n12); - this.head = p6; - p6.data = buf.slice(n12); + TypedArrayPrototypeSet(ret, new Uint8Array2(buf.buffer, buf.byteOffset, n8), retLen - n8); + this.head = p2; + p2.data = buf.slice(n8); } break; } ++c6; - } while ((p6 = p6.next) !== null); + } while ((p2 = p2.next) !== null); this.length -= c6; return ret; } // Make sure the linked list only shows the minimal necessary information. [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")](_3, options) { - return inspect2(this, { + return inspect3(this, { ...options, // Only inspect one level. depth: 0, @@ -56611,34 +56714,34 @@ var require_safe_buffer3 = __commonJS({ "node_modules/archiver/node_modules/safe-buffer/index.js"(exports2, module) { "use strict"; var buffer2 = __require("buffer"); - var Buffer7 = buffer2.Buffer; + var Buffer4 = buffer2.Buffer; function copyProps(src, dst) { for (var key in src) { dst[key] = src[key]; } } - if (Buffer7.from && Buffer7.alloc && Buffer7.allocUnsafe && Buffer7.allocUnsafeSlow) { + if (Buffer4.from && Buffer4.alloc && Buffer4.allocUnsafe && Buffer4.allocUnsafeSlow) { module.exports = buffer2; } else { copyProps(buffer2, exports2); exports2.Buffer = SafeBuffer; } function SafeBuffer(arg, encodingOrOffset, length) { - return Buffer7(arg, encodingOrOffset, length); + return Buffer4(arg, encodingOrOffset, length); } - SafeBuffer.prototype = Object.create(Buffer7.prototype); - copyProps(Buffer7, SafeBuffer); + SafeBuffer.prototype = Object.create(Buffer4.prototype); + copyProps(Buffer4, SafeBuffer); SafeBuffer.from = function(arg, encodingOrOffset, length) { if (typeof arg === "number") { throw new TypeError("Argument must not be a number"); } - return Buffer7(arg, encodingOrOffset, length); + return Buffer4(arg, encodingOrOffset, length); }; SafeBuffer.alloc = function(size, fill, encoding) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } - var buf = Buffer7(size); + var buf = Buffer4(size); if (fill !== void 0) { if (typeof encoding === "string") { buf.fill(fill, encoding); @@ -56654,7 +56757,7 @@ var require_safe_buffer3 = __commonJS({ if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } - return Buffer7(size); + return Buffer4(size); }; SafeBuffer.allocUnsafeSlow = function(size) { if (typeof size !== "number") { @@ -56669,8 +56772,8 @@ var require_safe_buffer3 = __commonJS({ var require_string_decoder3 = __commonJS({ "node_modules/archiver/node_modules/string_decoder/lib/string_decoder.js"(exports2) { "use strict"; - var Buffer7 = require_safe_buffer3().Buffer; - var isEncoding = Buffer7.isEncoding || function(encoding) { + var Buffer4 = require_safe_buffer3().Buffer; + var isEncoding = Buffer4.isEncoding || function(encoding) { encoding = "" + encoding; switch (encoding && encoding.toLowerCase()) { case "hex": @@ -56718,7 +56821,7 @@ var require_string_decoder3 = __commonJS({ } function normalizeEncoding(enc) { var nenc = _normalizeEncoding(enc); - if (typeof nenc !== "string" && (Buffer7.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); + if (typeof nenc !== "string" && (Buffer4.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); return nenc || enc; } exports2.StringDecoder = StringDecoder2; @@ -56747,7 +56850,7 @@ var require_string_decoder3 = __commonJS({ } this.lastNeed = 0; this.lastTotal = 0; - this.lastChar = Buffer7.allocUnsafe(nb); + this.lastChar = Buffer4.allocUnsafe(nb); } StringDecoder2.prototype.write = function(buf) { if (buf.length === 0) return ""; @@ -56806,7 +56909,7 @@ var require_string_decoder3 = __commonJS({ } return 0; } - function utf8CheckExtraBytes(self2, buf, p6) { + function utf8CheckExtraBytes(self2, buf, p2) { if ((buf[0] & 192) !== 128) { self2.lastNeed = 0; return "\uFFFD"; @@ -56825,14 +56928,14 @@ var require_string_decoder3 = __commonJS({ } } function utf8FillLast(buf) { - var p6 = this.lastTotal - this.lastNeed; - var r6 = utf8CheckExtraBytes(this, buf, p6); + var p2 = this.lastTotal - this.lastNeed; + var r6 = utf8CheckExtraBytes(this, buf, p2); if (r6 !== void 0) return r6; if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p6, 0, this.lastNeed); + buf.copy(this.lastChar, p2, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } - buf.copy(this.lastChar, p6, 0, buf.length); + buf.copy(this.lastChar, p2, 0, buf.length); this.lastNeed -= buf.length; } function utf8Text(buf, i6) { @@ -56877,17 +56980,17 @@ var require_string_decoder3 = __commonJS({ return r6; } function base64Text(buf, i6) { - var n12 = (buf.length - i6) % 3; - if (n12 === 0) return buf.toString("base64", i6); - this.lastNeed = 3 - n12; + var n8 = (buf.length - i6) % 3; + if (n8 === 0) return buf.toString("base64", i6); + this.lastNeed = 3 - n8; this.lastTotal = 3; - if (n12 === 1) { + if (n8 === 1) { this.lastChar[0] = buf[buf.length - 1]; } else { this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; } - return buf.toString("base64", i6, buf.length - n12); + return buf.toString("base64", i6, buf.length - n8); } function base64End(buf) { var r6 = buf && buf.length ? this.write(buf) : ""; @@ -56909,12 +57012,12 @@ var require_from2 = __commonJS({ "use strict"; var process5 = require_process(); var { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require_primordials2(); - var { Buffer: Buffer7 } = __require("buffer"); + var { Buffer: Buffer4 } = __require("buffer"); var { ERR_INVALID_ARG_TYPE, ERR_STREAM_NULL_VALUES } = require_errors4().codes; - function from(Readable13, iterable, opts) { + function from(Readable11, iterable, opts) { let iterator2; - if (typeof iterable === "string" || iterable instanceof Buffer7) { - return new Readable13({ + if (typeof iterable === "string" || iterable instanceof Buffer4) { + return new Readable11({ objectMode: true, ...opts, read() { @@ -56933,7 +57036,7 @@ var require_from2 = __commonJS({ } else { throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable); } - const readable = new Readable13({ + const readable = new Readable11({ objectMode: true, highWaterMark: 1, // TODO(ronag): What options should be allowed? @@ -57017,11 +57120,11 @@ var require_readable4 = __commonJS({ SymbolAsyncIterator, Symbol: Symbol2 } = require_primordials2(); - module.exports = Readable13; - Readable13.ReadableState = ReadableState; + module.exports = Readable11; + Readable11.ReadableState = ReadableState; var { EventEmitter: EE } = __require("events"); var { Stream: Stream3, prependListener } = require_legacy2(); - var { Buffer: Buffer7 } = __require("buffer"); + var { Buffer: Buffer4 } = __require("buffer"); var { addAbortSignal } = require_add_abort_signal2(); var eos = require_end_of_stream2(); var debug2 = require_util12().debuglog("stream", (fn) => { @@ -57045,8 +57148,8 @@ var require_readable4 = __commonJS({ var kPaused = Symbol2("kPaused"); var { StringDecoder: StringDecoder2 } = require_string_decoder3(); var from = require_from2(); - ObjectSetPrototypeOf(Readable13.prototype, Stream3.prototype); - ObjectSetPrototypeOf(Readable13, Stream3); + ObjectSetPrototypeOf(Readable11.prototype, Stream3.prototype); + ObjectSetPrototypeOf(Readable11, Stream3); var nop = () => { }; var { errorOrDestroy } = destroyImpl; @@ -57141,8 +57244,8 @@ var require_readable4 = __commonJS({ this.encoding = options.encoding; } } - function Readable13(options) { - if (!(this instanceof Readable13)) return new Readable13(options); + function Readable11(options) { + if (!(this instanceof Readable11)) return new Readable11(options); const isDuplex = this instanceof require_duplex2(); this._readableState = new ReadableState(options, this, isDuplex); if (options) { @@ -57158,26 +57261,26 @@ var require_readable4 = __commonJS({ } }); } - Readable13.prototype.destroy = destroyImpl.destroy; - Readable13.prototype._undestroy = destroyImpl.undestroy; - Readable13.prototype._destroy = function(err, cb) { + Readable11.prototype.destroy = destroyImpl.destroy; + Readable11.prototype._undestroy = destroyImpl.undestroy; + Readable11.prototype._destroy = function(err, cb) { cb(err); }; - Readable13.prototype[EE.captureRejectionSymbol] = function(err) { + Readable11.prototype[EE.captureRejectionSymbol] = function(err) { this.destroy(err); }; - Readable13.prototype[SymbolAsyncDispose] = function() { + Readable11.prototype[SymbolAsyncDispose] = function() { let error2; if (!this.destroyed) { error2 = this.readableEnded ? null : new AbortError4(); this.destroy(error2); } - return new Promise2((resolve4, reject2) => eos(this, (err) => err && err !== error2 ? reject2(err) : resolve4(null))); + return new Promise2((resolve8, reject2) => eos(this, (err) => err && err !== error2 ? reject2(err) : resolve8(null))); }; - Readable13.prototype.push = function(chunk, encoding) { + Readable11.prototype.push = function(chunk, encoding) { return readableAddChunk(this, chunk, encoding, false); }; - Readable13.prototype.unshift = function(chunk, encoding) { + Readable11.prototype.unshift = function(chunk, encoding) { return readableAddChunk(this, chunk, encoding, true); }; function readableAddChunk(stream5, chunk, encoding, addToFront) { @@ -57189,13 +57292,13 @@ var require_readable4 = __commonJS({ encoding = encoding || state4.defaultEncoding; if (state4.encoding !== encoding) { if (addToFront && state4.encoding) { - chunk = Buffer7.from(chunk, encoding).toString(state4.encoding); + chunk = Buffer4.from(chunk, encoding).toString(state4.encoding); } else { - chunk = Buffer7.from(chunk, encoding); + chunk = Buffer4.from(chunk, encoding); encoding = ""; } } - } else if (chunk instanceof Buffer7) { + } else if (chunk instanceof Buffer4) { encoding = ""; } else if (Stream3._isUint8Array(chunk)) { chunk = Stream3._uint8ArrayToBuffer(chunk); @@ -57251,11 +57354,11 @@ var require_readable4 = __commonJS({ } maybeReadMore(stream5, state4); } - Readable13.prototype.isPaused = function() { + Readable11.prototype.isPaused = function() { const state4 = this._readableState; return state4[kPaused] === true || state4.flowing === false; }; - Readable13.prototype.setEncoding = function(enc) { + Readable11.prototype.setEncoding = function(enc) { const decoder = new StringDecoder2(enc); this._readableState.decoder = decoder; this._readableState.encoding = this._readableState.decoder.encoding; @@ -57270,55 +57373,55 @@ var require_readable4 = __commonJS({ return this; }; var MAX_HWM = 1073741824; - function computeNewHighWaterMark(n12) { - if (n12 > MAX_HWM) { - throw new ERR_OUT_OF_RANGE("size", "<= 1GiB", n12); + function computeNewHighWaterMark(n8) { + if (n8 > MAX_HWM) { + throw new ERR_OUT_OF_RANGE("size", "<= 1GiB", n8); } else { - n12--; - n12 |= n12 >>> 1; - n12 |= n12 >>> 2; - n12 |= n12 >>> 4; - n12 |= n12 >>> 8; - n12 |= n12 >>> 16; - n12++; - } - return n12; - } - function howMuchToRead(n12, state4) { - if (n12 <= 0 || state4.length === 0 && state4.ended) return 0; + n8--; + n8 |= n8 >>> 1; + n8 |= n8 >>> 2; + n8 |= n8 >>> 4; + n8 |= n8 >>> 8; + n8 |= n8 >>> 16; + n8++; + } + return n8; + } + function howMuchToRead(n8, state4) { + if (n8 <= 0 || state4.length === 0 && state4.ended) return 0; if ((state4.state & kObjectMode) !== 0) return 1; - if (NumberIsNaN(n12)) { + if (NumberIsNaN(n8)) { if (state4.flowing && state4.length) return state4.buffer.first().length; return state4.length; } - if (n12 <= state4.length) return n12; + if (n8 <= state4.length) return n8; return state4.ended ? state4.length : 0; } - Readable13.prototype.read = function(n12) { - debug2("read", n12); - if (n12 === void 0) { - n12 = NaN; - } else if (!NumberIsInteger(n12)) { - n12 = NumberParseInt(n12, 10); + Readable11.prototype.read = function(n8) { + debug2("read", n8); + if (n8 === void 0) { + n8 = NaN; + } else if (!NumberIsInteger(n8)) { + n8 = NumberParseInt(n8, 10); } const state4 = this._readableState; - const nOrig = n12; - if (n12 > state4.highWaterMark) state4.highWaterMark = computeNewHighWaterMark(n12); - if (n12 !== 0) state4.state &= ~kEmittedReadable; - if (n12 === 0 && state4.needReadable && ((state4.highWaterMark !== 0 ? state4.length >= state4.highWaterMark : state4.length > 0) || state4.ended)) { + const nOrig = n8; + if (n8 > state4.highWaterMark) state4.highWaterMark = computeNewHighWaterMark(n8); + if (n8 !== 0) state4.state &= ~kEmittedReadable; + if (n8 === 0 && state4.needReadable && ((state4.highWaterMark !== 0 ? state4.length >= state4.highWaterMark : state4.length > 0) || state4.ended)) { debug2("read: emitReadable", state4.length, state4.ended); if (state4.length === 0 && state4.ended) endReadable(this); else emitReadable(this); return null; } - n12 = howMuchToRead(n12, state4); - if (n12 === 0 && state4.ended) { + n8 = howMuchToRead(n8, state4); + if (n8 === 0 && state4.ended) { if (state4.length === 0) endReadable(this); return null; } let doRead = (state4.state & kNeedReadable) !== 0; debug2("need readable", doRead); - if (state4.length === 0 || state4.length - n12 < state4.highWaterMark) { + if (state4.length === 0 || state4.length - n8 < state4.highWaterMark) { doRead = true; debug2("length less than watermark", doRead); } @@ -57335,16 +57438,16 @@ var require_readable4 = __commonJS({ errorOrDestroy(this, err); } state4.state &= ~kSync; - if (!state4.reading) n12 = howMuchToRead(nOrig, state4); + if (!state4.reading) n8 = howMuchToRead(nOrig, state4); } let ret; - if (n12 > 0) ret = fromList(n12, state4); + if (n8 > 0) ret = fromList(n8, state4); else ret = null; if (ret === null) { state4.needReadable = state4.length <= state4.highWaterMark; - n12 = 0; + n8 = 0; } else { - state4.length -= n12; + state4.length -= n8; if (state4.multiAwaitDrain) { state4.awaitDrainWriters.clear(); } else { @@ -57353,7 +57456,7 @@ var require_readable4 = __commonJS({ } if (state4.length === 0) { if (!state4.ended) state4.needReadable = true; - if (nOrig !== n12 && state4.ended) endReadable(this); + if (nOrig !== n8 && state4.ended) endReadable(this); } if (ret !== null && !state4.errorEmitted && !state4.closeEmitted) { state4.dataEmitted = true; @@ -57416,10 +57519,10 @@ var require_readable4 = __commonJS({ } state4.readingMore = false; } - Readable13.prototype._read = function(n12) { + Readable11.prototype._read = function(n8) { throw new ERR_METHOD_NOT_IMPLEMENTED("_read()"); }; - Readable13.prototype.pipe = function(dest, pipeOpts) { + Readable11.prototype.pipe = function(dest, pipeOpts) { const src = this; const state4 = this._readableState; if (state4.pipes.length === 1) { @@ -57496,8 +57599,8 @@ var require_readable4 = __commonJS({ unpipe(); dest.removeListener("error", onerror); if (dest.listenerCount("error") === 0) { - const s6 = dest._writableState || dest._readableState; - if (s6 && !s6.errorEmitted) { + const s = dest._writableState || dest._readableState; + if (s && !s.errorEmitted) { errorOrDestroy(dest, er); } else { dest.emit("error", er); @@ -57544,7 +57647,7 @@ var require_readable4 = __commonJS({ } }; } - Readable13.prototype.unpipe = function(dest) { + Readable11.prototype.unpipe = function(dest) { const state4 = this._readableState; const unpipeInfo = { hasUnpiped: false @@ -57567,7 +57670,7 @@ var require_readable4 = __commonJS({ dest.emit("unpipe", this, unpipeInfo); return this; }; - Readable13.prototype.on = function(ev, fn) { + Readable11.prototype.on = function(ev, fn) { const res = Stream3.prototype.on.call(this, ev, fn); const state4 = this._readableState; if (ev === "data") { @@ -57588,16 +57691,16 @@ var require_readable4 = __commonJS({ } return res; }; - Readable13.prototype.addListener = Readable13.prototype.on; - Readable13.prototype.removeListener = function(ev, fn) { + Readable11.prototype.addListener = Readable11.prototype.on; + Readable11.prototype.removeListener = function(ev, fn) { const res = Stream3.prototype.removeListener.call(this, ev, fn); if (ev === "readable") { process5.nextTick(updateReadableListening, this); } return res; }; - Readable13.prototype.off = Readable13.prototype.removeListener; - Readable13.prototype.removeAllListeners = function(ev) { + Readable11.prototype.off = Readable11.prototype.removeListener; + Readable11.prototype.removeAllListeners = function(ev) { const res = Stream3.prototype.removeAllListeners.apply(this, arguments); if (ev === "readable" || ev === void 0) { process5.nextTick(updateReadableListening, this); @@ -57619,7 +57722,7 @@ var require_readable4 = __commonJS({ debug2("readable nexttick read 0"); self2.read(0); } - Readable13.prototype.resume = function() { + Readable11.prototype.resume = function() { const state4 = this._readableState; if (!state4.flowing) { debug2("resume"); @@ -57645,7 +57748,7 @@ var require_readable4 = __commonJS({ flow(stream5); if (state4.flowing && !state4.reading) stream5.read(0); } - Readable13.prototype.pause = function() { + Readable11.prototype.pause = function() { debug2("call pause flowing=%j", this._readableState.flowing); if (this._readableState.flowing !== false) { debug2("pause"); @@ -57660,7 +57763,7 @@ var require_readable4 = __commonJS({ debug2("flow", state4.flowing); while (state4.flowing && stream5.read() !== null) ; } - Readable13.prototype.wrap = function(stream5) { + Readable11.prototype.wrap = function(stream5) { let paused = false; stream5.on("data", (chunk) => { if (!this.push(chunk) && stream5.pause) { @@ -57695,10 +57798,10 @@ var require_readable4 = __commonJS({ } return this; }; - Readable13.prototype[SymbolAsyncIterator] = function() { + Readable11.prototype[SymbolAsyncIterator] = function() { return streamToAsyncIterator(this); }; - Readable13.prototype.iterator = function(options) { + Readable11.prototype.iterator = function(options) { if (options !== void 0) { validateObject(options, "options"); } @@ -57706,7 +57809,7 @@ var require_readable4 = __commonJS({ }; function streamToAsyncIterator(stream5, options) { if (typeof stream5.read !== "function") { - stream5 = Readable13.wrap(stream5, { + stream5 = Readable11.wrap(stream5, { objectMode: true }); } @@ -57716,12 +57819,12 @@ var require_readable4 = __commonJS({ } async function* createAsyncIterator(stream5, options) { let callback = nop; - function next(resolve4) { + function next(resolve8) { if (this === stream5) { callback(); callback = nop; } else { - callback = resolve4; + callback = resolve8; } } stream5.on("readable", next); @@ -57762,7 +57865,7 @@ var require_readable4 = __commonJS({ } } } - ObjectDefineProperties(Readable13.prototype, { + ObjectDefineProperties(Readable11.prototype, { readable: { __proto__: null, get() { @@ -57889,18 +57992,18 @@ var require_readable4 = __commonJS({ } } }); - Readable13._fromList = fromList; - function fromList(n12, state4) { + Readable11._fromList = fromList; + function fromList(n8, state4) { if (state4.length === 0) return null; let ret; if (state4.objectMode) ret = state4.buffer.shift(); - else if (!n12 || n12 >= state4.length) { + else if (!n8 || n8 >= state4.length) { if (state4.decoder) ret = state4.buffer.join(""); else if (state4.buffer.length === 1) ret = state4.buffer.first(); else ret = state4.buffer.concat(state4.length); state4.buffer.clear(); } else { - ret = state4.buffer.consume(n12, state4.decoder); + ret = state4.buffer.consume(n8, state4.decoder); } return ret; } @@ -57936,23 +58039,23 @@ var require_readable4 = __commonJS({ stream5.end(); } } - Readable13.from = function(iterable, opts) { - return from(Readable13, iterable, opts); + Readable11.from = function(iterable, opts) { + return from(Readable11, iterable, opts); }; var webStreamsAdapters; function lazyWebStreams() { if (webStreamsAdapters === void 0) webStreamsAdapters = {}; return webStreamsAdapters; } - Readable13.fromWeb = function(readableStream, options) { + Readable11.fromWeb = function(readableStream, options) { return lazyWebStreams().newStreamReadableFromReadableStream(readableStream, options); }; - Readable13.toWeb = function(streamReadable, options) { + Readable11.toWeb = function(streamReadable, options) { return lazyWebStreams().newReadableStreamFromStreamReadable(streamReadable, options); }; - Readable13.wrap = function(src, options) { + Readable11.wrap = function(src, options) { var _ref, _src$readableObjectMo; - return new Readable13({ + return new Readable11({ objectMode: (_ref = (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== void 0 ? _src$readableObjectMo : src.objectMode) !== null && _ref !== void 0 ? _ref : true, ...options, destroy(err, callback) { @@ -57980,11 +58083,11 @@ var require_writable2 = __commonJS({ Symbol: Symbol2, SymbolHasInstance } = require_primordials2(); - module.exports = Writable2; - Writable2.WritableState = WritableState; + module.exports = Writable3; + Writable3.WritableState = WritableState; var { EventEmitter: EE } = __require("events"); var Stream3 = require_legacy2().Stream; - var { Buffer: Buffer7 } = __require("buffer"); + var { Buffer: Buffer4 } = __require("buffer"); var destroyImpl = require_destroy3(); var { addAbortSignal } = require_add_abort_signal2(); var { getHighWaterMark, getDefaultHighWaterMark } = require_state4(); @@ -58000,8 +58103,8 @@ var require_writable2 = __commonJS({ ERR_UNKNOWN_ENCODING } = require_errors4().codes; var { errorOrDestroy } = destroyImpl; - ObjectSetPrototypeOf(Writable2.prototype, Stream3.prototype); - ObjectSetPrototypeOf(Writable2, Stream3); + ObjectSetPrototypeOf(Writable3.prototype, Stream3.prototype); + ObjectSetPrototypeOf(Writable3, Stream3); function nop() { } var kOnFinished = Symbol2("kOnFinished"); @@ -58055,9 +58158,9 @@ var require_writable2 = __commonJS({ return this.buffered.length - this.bufferedIndex; } }); - function Writable2(options) { + function Writable3(options) { const isDuplex = this instanceof require_duplex2(); - if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable2, this)) return new Writable2(options); + if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable3, this)) return new Writable3(options); this._writableState = new WritableState(options, this, isDuplex); if (options) { if (typeof options.write === "function") this._write = options.write; @@ -58076,15 +58179,15 @@ var require_writable2 = __commonJS({ finishMaybe(this, state4); }); } - ObjectDefineProperty(Writable2, SymbolHasInstance, { + ObjectDefineProperty(Writable3, SymbolHasInstance, { __proto__: null, value: function(object) { if (FunctionPrototypeSymbolHasInstance(this, object)) return true; - if (this !== Writable2) return false; + if (this !== Writable3) return false; return object && object._writableState instanceof WritableState; } }); - Writable2.prototype.pipe = function() { + Writable3.prototype.pipe = function() { errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); }; function _write(stream5, chunk, encoding, cb) { @@ -58094,7 +58197,7 @@ var require_writable2 = __commonJS({ encoding = state4.defaultEncoding; } else { if (!encoding) encoding = state4.defaultEncoding; - else if (encoding !== "buffer" && !Buffer7.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); + else if (encoding !== "buffer" && !Buffer4.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); if (typeof cb !== "function") cb = nop; } if (chunk === null) { @@ -58102,10 +58205,10 @@ var require_writable2 = __commonJS({ } else if (!state4.objectMode) { if (typeof chunk === "string") { if (state4.decodeStrings !== false) { - chunk = Buffer7.from(chunk, encoding); + chunk = Buffer4.from(chunk, encoding); encoding = "buffer"; } - } else if (chunk instanceof Buffer7) { + } else if (chunk instanceof Buffer4) { encoding = "buffer"; } else if (Stream3._isUint8Array(chunk)) { chunk = Stream3._uint8ArrayToBuffer(chunk); @@ -58128,22 +58231,22 @@ var require_writable2 = __commonJS({ state4.pendingcb++; return writeOrBuffer(stream5, state4, chunk, encoding, cb); } - Writable2.prototype.write = function(chunk, encoding, cb) { + Writable3.prototype.write = function(chunk, encoding, cb) { return _write(this, chunk, encoding, cb) === true; }; - Writable2.prototype.cork = function() { + Writable3.prototype.cork = function() { this._writableState.corked++; }; - Writable2.prototype.uncork = function() { + Writable3.prototype.uncork = function() { const state4 = this._writableState; if (state4.corked) { state4.corked--; if (!state4.writing) clearBuffer(this, state4); } }; - Writable2.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + Writable3.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { if (typeof encoding === "string") encoding = StringPrototypeToLowerCase(encoding); - if (!Buffer7.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); + if (!Buffer4.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); this._writableState.defaultEncoding = encoding; return this; }; @@ -58259,9 +58362,9 @@ var require_writable2 = __commonJS({ if (state4.writing) { return; } - for (let n12 = state4.bufferedIndex; n12 < state4.buffered.length; ++n12) { + for (let n8 = state4.bufferedIndex; n8 < state4.buffered.length; ++n8) { var _state$errored; - const { chunk, callback } = state4.buffered[n12]; + const { chunk, callback } = state4.buffered[n8]; const len = state4.objectMode ? 1 : chunk.length; state4.length -= len; callback( @@ -58291,8 +58394,8 @@ var require_writable2 = __commonJS({ if (bufferedLength > 1 && stream5._writev) { state4.pendingcb -= bufferedLength - 1; const callback = state4.allNoop ? nop : (err) => { - for (let n12 = i6; n12 < buffered.length; ++n12) { - buffered[n12].callback(err); + for (let n8 = i6; n8 < buffered.length; ++n8) { + buffered[n8].callback(err); } }; const chunks = state4.allNoop && i6 === 0 ? buffered : ArrayPrototypeSlice(buffered, i6); @@ -58317,7 +58420,7 @@ var require_writable2 = __commonJS({ } state4.bufferProcessing = false; } - Writable2.prototype._write = function(chunk, encoding, cb) { + Writable3.prototype._write = function(chunk, encoding, cb) { if (this._writev) { this._writev( [ @@ -58332,8 +58435,8 @@ var require_writable2 = __commonJS({ throw new ERR_METHOD_NOT_IMPLEMENTED("_write()"); } }; - Writable2.prototype._writev = null; - Writable2.prototype.end = function(chunk, encoding, cb) { + Writable3.prototype._writev = null; + Writable3.prototype.end = function(chunk, encoding, cb) { const state4 = this._writableState; if (typeof chunk === "function") { cb = chunk; @@ -58460,7 +58563,7 @@ var require_writable2 = __commonJS({ } } } - ObjectDefineProperties(Writable2.prototype, { + ObjectDefineProperties(Writable3.prototype, { closed: { __proto__: null, get() { @@ -58481,8 +58584,8 @@ var require_writable2 = __commonJS({ writable: { __proto__: null, get() { - const w5 = this._writableState; - return !!w5 && w5.writable !== false && !w5.destroyed && !w5.errored && !w5.ending && !w5.ended; + const w = this._writableState; + return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended; }, set(val) { if (this._writableState) { @@ -58556,7 +58659,7 @@ var require_writable2 = __commonJS({ } }); var destroy2 = destroyImpl.destroy; - Writable2.prototype.destroy = function(err, cb) { + Writable3.prototype.destroy = function(err, cb) { const state4 = this._writableState; if (!state4.destroyed && (state4.bufferedIndex < state4.buffered.length || state4[kOnFinished].length)) { process5.nextTick(errorBuffer, state4); @@ -58564,11 +58667,11 @@ var require_writable2 = __commonJS({ destroy2.call(this, err, cb); return this; }; - Writable2.prototype._undestroy = destroyImpl.undestroy; - Writable2.prototype._destroy = function(err, cb) { + Writable3.prototype._undestroy = destroyImpl.undestroy; + Writable3.prototype._destroy = function(err, cb) { cb(err); }; - Writable2.prototype[EE.captureRejectionSymbol] = function(err) { + Writable3.prototype[EE.captureRejectionSymbol] = function(err) { this.destroy(err); }; var webStreamsAdapters; @@ -58576,10 +58679,10 @@ var require_writable2 = __commonJS({ if (webStreamsAdapters === void 0) webStreamsAdapters = {}; return webStreamsAdapters; } - Writable2.fromWeb = function(writableStream, options) { + Writable3.fromWeb = function(writableStream, options) { return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options); }; - Writable2.toWeb = function(streamWritable) { + Writable3.toWeb = function(streamWritable) { return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable); }; } @@ -58609,8 +58712,8 @@ var require_duplexify2 = __commonJS({ } = require_errors4(); var { destroyer } = require_destroy3(); var Duplex = require_duplex2(); - var Readable13 = require_readable4(); - var Writable2 = require_writable2(); + var Readable11 = require_readable4(); + var Writable3 = require_writable2(); var { createDeferredPromise } = require_util12(); var from = require_from2(); var Blob3 = globalThis.Blob || bufferModule.Blob; @@ -58659,12 +58762,12 @@ var require_duplexify2 = __commonJS({ } if (isReadableStream4(body2)) { return _duplexify({ - readable: Readable13.fromWeb(body2) + readable: Readable11.fromWeb(body2) }); } if (isWritableStream(body2)) { return _duplexify({ - writable: Writable2.fromWeb(body2) + writable: Writable3.fromWeb(body2) }); } if (typeof body2 === "function") { @@ -58774,7 +58877,7 @@ var require_duplexify2 = __commonJS({ ); }; function fromAsyncGen(fn) { - let { promise, resolve: resolve4 } = createDeferredPromise(); + let { promise, resolve: resolve8 } = createDeferredPromise(); const ac = new AbortController2(); const signal = ac.signal; const value = fn( @@ -58789,7 +58892,7 @@ var require_duplexify2 = __commonJS({ throw new AbortError4(void 0, { cause: signal.reason }); - ({ promise, resolve: resolve4 } = createDeferredPromise()); + ({ promise, resolve: resolve8 } = createDeferredPromise()); yield chunk; } })(), @@ -58800,8 +58903,8 @@ var require_duplexify2 = __commonJS({ return { value, write(chunk, encoding, cb) { - const _resolve = resolve4; - resolve4 = null; + const _resolve = resolve8; + resolve8 = null; _resolve({ chunk, done: false, @@ -58809,8 +58912,8 @@ var require_duplexify2 = __commonJS({ }); }, final(cb) { - const _resolve = resolve4; - resolve4 = null; + const _resolve = resolve8; + resolve8 = null; _resolve({ done: true, cb @@ -58823,10 +58926,10 @@ var require_duplexify2 = __commonJS({ }; } function _duplexify(pair) { - const r6 = pair.readable && typeof pair.readable.read !== "function" ? Readable13.wrap(pair.readable) : pair.readable; - const w5 = pair.writable; + const r6 = pair.readable && typeof pair.readable.read !== "function" ? Readable11.wrap(pair.readable) : pair.readable; + const w = pair.writable; let readable = !!isReadable2(r6); - let writable = !!isWritable2(w5); + let writable = !!isWritable2(w); let ondrain; let onfinish; let onreadable; @@ -58844,12 +58947,12 @@ var require_duplexify2 = __commonJS({ d6 = new Duplexify({ // TODO (ronag): highWaterMark? readableObjectMode: !!(r6 !== null && r6 !== void 0 && r6.readableObjectMode), - writableObjectMode: !!(w5 !== null && w5 !== void 0 && w5.writableObjectMode), + writableObjectMode: !!(w !== null && w !== void 0 && w.writableObjectMode), readable, writable }); if (writable) { - eos(w5, (err) => { + eos(w, (err) => { writable = false; if (err) { destroyer(r6, err); @@ -58857,24 +58960,24 @@ var require_duplexify2 = __commonJS({ onfinished(err); }); d6._write = function(chunk, encoding, callback) { - if (w5.write(chunk, encoding)) { + if (w.write(chunk, encoding)) { callback(); } else { ondrain = callback; } }; d6._final = function(callback) { - w5.end(); + w.end(); onfinish = callback; }; - w5.on("drain", function() { + w.on("drain", function() { if (ondrain) { const cb = ondrain; ondrain = null; cb(); } }); - w5.on("finish", function() { + w.on("finish", function() { if (onfinish) { const cb = onfinish; onfinish = null; @@ -58924,7 +59027,7 @@ var require_duplexify2 = __commonJS({ callback(err); } else { onclose = callback; - destroyer(w5, err); + destroyer(w, err); destroyer(r6, err); } }; @@ -58944,21 +59047,21 @@ var require_duplex2 = __commonJS({ ObjectSetPrototypeOf } = require_primordials2(); module.exports = Duplex; - var Readable13 = require_readable4(); - var Writable2 = require_writable2(); - ObjectSetPrototypeOf(Duplex.prototype, Readable13.prototype); - ObjectSetPrototypeOf(Duplex, Readable13); + var Readable11 = require_readable4(); + var Writable3 = require_writable2(); + ObjectSetPrototypeOf(Duplex.prototype, Readable11.prototype); + ObjectSetPrototypeOf(Duplex, Readable11); { - const keys = ObjectKeys(Writable2.prototype); + const keys = ObjectKeys(Writable3.prototype); for (let i6 = 0; i6 < keys.length; i6++) { const method = keys[i6]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable2.prototype[method]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable3.prototype[method]; } } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); - Readable13.call(this, options); - Writable2.call(this, options); + Readable11.call(this, options); + Writable3.call(this, options); if (options) { this.allowHalfOpen = options.allowHalfOpen !== false; if (options.readable === false) { @@ -58979,39 +59082,39 @@ var require_duplex2 = __commonJS({ ObjectDefineProperties(Duplex.prototype, { writable: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writable") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writable") }, writableHighWaterMark: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableHighWaterMark") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableHighWaterMark") }, writableObjectMode: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableObjectMode") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableObjectMode") }, writableBuffer: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableBuffer") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableBuffer") }, writableLength: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableLength") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableLength") }, writableFinished: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableFinished") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableFinished") }, writableCorked: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableCorked") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableCorked") }, writableEnded: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableEnded") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableEnded") }, writableNeedDrain: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableNeedDrain") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableNeedDrain") }, destroyed: { __proto__: null, @@ -59205,7 +59308,7 @@ var require_pipeline2 = __commonJS({ } = require_utils4(); var AbortController2 = globalThis.AbortController || require_abort_controller().AbortController; var PassThrough5; - var Readable13; + var Readable11; var addAbortListener; function destroyer(stream5, reading, writing) { let finished = false; @@ -59244,10 +59347,10 @@ var require_pipeline2 = __commonJS({ throw new ERR_INVALID_ARG_TYPE("val", ["Readable", "Iterable", "AsyncIterable"], val); } async function* fromReadable(val) { - if (!Readable13) { - Readable13 = require_readable4(); + if (!Readable11) { + Readable11 = require_readable4(); } - yield* Readable13.prototype[SymbolAsyncIterator].call(val); + yield* Readable11.prototype[SymbolAsyncIterator].call(val); } async function pumpToNode(iterable, writable, finish, { end }) { let error2; @@ -59262,7 +59365,7 @@ var require_pipeline2 = __commonJS({ callback(); } }; - const wait = () => new Promise2((resolve4, reject2) => { + const wait = () => new Promise2((resolve8, reject2) => { if (error2) { reject2(error2); } else { @@ -59270,7 +59373,7 @@ var require_pipeline2 = __commonJS({ if (error2) { reject2(error2); } else { - resolve4(); + resolve8(); } }; } @@ -59636,15 +59739,15 @@ var require_compose2 = __commonJS({ const idx = streams.length - 1; streams[idx] = Duplex.from(streams[idx]); } - for (let n12 = 0; n12 < streams.length; ++n12) { - if (!isNodeStream(streams[n12]) && !isWebStream(streams[n12])) { + for (let n8 = 0; n8 < streams.length; ++n8) { + if (!isNodeStream(streams[n8]) && !isWebStream(streams[n8])) { continue; } - if (n12 < streams.length - 1 && !(isReadable2(streams[n12]) || isReadableStream4(streams[n12]) || isTransformStream(streams[n12]))) { - throw new ERR_INVALID_ARG_VALUE(`streams[${n12}]`, orgStreams[n12], "must be readable"); + if (n8 < streams.length - 1 && !(isReadable2(streams[n8]) || isReadableStream4(streams[n8]) || isTransformStream(streams[n8]))) { + throw new ERR_INVALID_ARG_VALUE(`streams[${n8}]`, orgStreams[n8], "must be readable"); } - if (n12 > 0 && !(isWritable2(streams[n12]) || isWritableStream(streams[n12]) || isTransformStream(streams[n12]))) { - throw new ERR_INVALID_ARG_VALUE(`streams[${n12}]`, orgStreams[n12], "must be writable"); + if (n8 > 0 && !(isWritable2(streams[n8]) || isWritableStream(streams[n8]) || isTransformStream(streams[n8]))) { + throw new ERR_INVALID_ARG_VALUE(`streams[${n8}]`, orgStreams[n8], "must be writable"); } } let ondrain; @@ -59914,8 +60017,8 @@ var require_operators2 = __commonJS({ next = null; } if (!done && (queue2.length >= highWaterMark || cnt >= concurrency)) { - await new Promise2((resolve4) => { - resume = resolve4; + await new Promise2((resolve8) => { + resume = resolve8; }); } } @@ -59949,8 +60052,8 @@ var require_operators2 = __commonJS({ queue2.shift(); maybeResume(); } - await new Promise2((resolve4) => { - next = resolve4; + await new Promise2((resolve8) => { + next = resolve8; }); } } finally { @@ -60208,7 +60311,7 @@ var require_promises2 = __commonJS({ var { finished } = require_end_of_stream2(); require_stream3(); function pipeline2(...streams) { - return new Promise2((resolve4, reject2) => { + return new Promise2((resolve8, reject2) => { let signal; let end; const lastArg = streams[streams.length - 1]; @@ -60223,7 +60326,7 @@ var require_promises2 = __commonJS({ if (err) { reject2(err); } else { - resolve4(value); + resolve8(value); } }, { @@ -60244,7 +60347,7 @@ var require_promises2 = __commonJS({ var require_stream3 = __commonJS({ "node_modules/archiver/node_modules/readable-stream/lib/stream.js"(exports2, module) { "use strict"; - var { Buffer: Buffer7 } = __require("buffer"); + var { Buffer: Buffer4 } = __require("buffer"); var { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials2(); var { promisify: { custom: customPromisify } @@ -60354,7 +60457,7 @@ var require_stream3 = __commonJS({ return value instanceof Uint8Array; }; Stream3._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) { - return Buffer7.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); + return Buffer4.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); }; } }); @@ -60436,13 +60539,13 @@ var require_core = __commonJS({ var ArchiverError = require_error(); var Transform4 = require_ours2().Transform; var win322 = process.platform === "win32"; - var Archiver = function(format2, options) { + var Archiver = function(format4, options) { if (!(this instanceof Archiver)) { - return new Archiver(format2, options); + return new Archiver(format4, options); } - if (typeof format2 !== "string") { - options = format2; - format2 = "zip"; + if (typeof format4 !== "string") { + options = format4; + format4 = "zip"; } options = this.options = util3.defaults(options, { highWaterMark: 1024 * 1024, @@ -60882,11 +60985,11 @@ var require_core = __commonJS({ this._finalize(); } var self2 = this; - return new Promise(function(resolve4, reject2) { + return new Promise(function(resolve8, reject2) { var errored; self2._module.on("end", function() { if (!errored) { - resolve4(); + resolve8(); } }); self2._module.on("error", function(err) { @@ -60895,12 +60998,12 @@ var require_core = __commonJS({ }); }); }; - Archiver.prototype.setFormat = function(format2) { + Archiver.prototype.setFormat = function(format4) { if (this._format) { this.emit("error", new ArchiverError("FORMATSET")); return this; } - this._format = format2; + this._format = format4; return this; }; Archiver.prototype.setModule = function(module2) { @@ -61005,23 +61108,23 @@ var require_util13 = __commonJS({ util3.fromDosTime = function(buf) { return util3.dosToDate(buf.readUInt32LE(0)); }; - util3.getEightBytes = function(v8) { + util3.getEightBytes = function(v2) { var buf = Buffer.alloc(8); - buf.writeUInt32LE(v8 % 4294967296, 0); - buf.writeUInt32LE(v8 / 4294967296 | 0, 4); + buf.writeUInt32LE(v2 % 4294967296, 0); + buf.writeUInt32LE(v2 / 4294967296 | 0, 4); return buf; }; - util3.getShortBytes = function(v8) { + util3.getShortBytes = function(v2) { var buf = Buffer.alloc(2); - buf.writeUInt16LE((v8 & 65535) >>> 0, 0); + buf.writeUInt16LE((v2 & 65535) >>> 0, 0); return buf; }; util3.getShortBytesValue = function(buf, offset) { return buf.readUInt16LE(offset); }; - util3.getLongBytes = function(v8) { + util3.getLongBytes = function(v2) { var buf = Buffer.alloc(4); - buf.writeUInt32LE((v8 & 4294967295) >>> 0, 0); + buf.writeUInt32LE((v2 & 4294967295) >>> 0, 0); return buf; }; util3.getLongBytesValue = function(buf, offset) { @@ -61072,14 +61175,14 @@ var require_general_purpose_bit = __commonJS({ gbp.setNumberOfShannonFanoTrees((flag & NUMBER_OF_SHANNON_FANO_TREES_FLAG) !== 0 ? 3 : 2); return gbp; }; - GeneralPurposeBit.prototype.setNumberOfShannonFanoTrees = function(n12) { - this.numberOfShannonFanoTrees = n12; + GeneralPurposeBit.prototype.setNumberOfShannonFanoTrees = function(n8) { + this.numberOfShannonFanoTrees = n8; }; GeneralPurposeBit.prototype.getNumberOfShannonFanoTrees = function() { return this.numberOfShannonFanoTrees; }; - GeneralPurposeBit.prototype.setSlidingDictionarySize = function(n12) { - this.slidingDictionarySize = n12; + GeneralPurposeBit.prototype.setSlidingDictionarySize = function(n8) { + this.slidingDictionarySize = n8; }; GeneralPurposeBit.prototype.getSlidingDictionarySize = function() { return this.slidingDictionarySize; @@ -61544,8 +61647,8 @@ var require_inspect3 = __commonJS({ "node_modules/compress-commons/node_modules/readable-stream/lib/ours/util/inspect.js"(exports2, module) { "use strict"; module.exports = { - format(format2, ...args) { - return format2.replace(/%([sdifj])/g, function(...[_unused, type]) { + format(format4, ...args) { + return format4.replace(/%([sdifj])/g, function(...[_unused, type]) { const replacement = args.shift(); if (type === "f") { return replacement.toFixed(6); @@ -61594,7 +61697,7 @@ var require_inspect3 = __commonJS({ var require_errors5 = __commonJS({ "node_modules/compress-commons/node_modules/readable-stream/lib/ours/errors.js"(exports2, module) { "use strict"; - var { format: format2, inspect: inspect2 } = require_inspect3(); + var { format: format4, inspect: inspect3 } = require_inspect3(); var { AggregateError: CustomAggregateError } = require_primordials3(); var AggregateError = globalThis.AggregateError || CustomAggregateError; var kIsNodeError = /* @__PURE__ */ Symbol("kIsNodeError"); @@ -61644,9 +61747,9 @@ var require_errors5 = __commonJS({ if (args.length === 0) { return msg; } - return format2(msg, ...args); + return format4(msg, ...args); } - function E2(code, message, Base) { + function E(code, message, Base) { if (!Base) { Base = Error; } @@ -61707,8 +61810,8 @@ var require_errors5 = __commonJS({ this.name = "AbortError"; } }; - E2("ERR_ASSERTION", "%s", Error); - E2( + E("ERR_ASSERTION", "%s", Error); + E( "ERR_INVALID_ARG_TYPE", (name, expected, actual) => { assert2(typeof name === "string", "'name' must be a string"); @@ -61803,13 +61906,13 @@ var require_errors5 = __commonJS({ if ((_actual$constructor = actual.constructor) !== null && _actual$constructor !== void 0 && _actual$constructor.name) { msg += `. Received an instance of ${actual.constructor.name}`; } else { - const inspected = inspect2(actual, { + const inspected = inspect3(actual, { depth: -1 }); msg += `. Received ${inspected}`; } } else { - let inspected = inspect2(actual, { + let inspected = inspect3(actual, { colors: false }); if (inspected.length > 25) { @@ -61821,10 +61924,10 @@ var require_errors5 = __commonJS({ }, TypeError ); - E2( + E( "ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => { - let inspected = inspect2(value); + let inspected = inspect3(value); if (inspected.length > 128) { inspected = inspected.slice(0, 128) + "..."; } @@ -61833,7 +61936,7 @@ var require_errors5 = __commonJS({ }, TypeError ); - E2( + E( "ERR_INVALID_RETURN_VALUE", (input, name, value) => { var _value$constructor; @@ -61842,7 +61945,7 @@ var require_errors5 = __commonJS({ }, TypeError ); - E2( + E( "ERR_MISSING_ARGS", (...args) => { assert2(args.length > 0, "At least one arg needs to be specified"); @@ -61867,7 +61970,7 @@ var require_errors5 = __commonJS({ }, TypeError ); - E2( + E( "ERR_OUT_OF_RANGE", (str, range6, input) => { assert2(range6, 'Missing "range" argument'); @@ -61882,23 +61985,23 @@ var require_errors5 = __commonJS({ } received += "n"; } else { - received = inspect2(input); + received = inspect3(input); } return `The value of "${str}" is out of range. It must be ${range6}. Received ${received}`; }, RangeError ); - E2("ERR_MULTIPLE_CALLBACK", "Callback called multiple times", Error); - E2("ERR_METHOD_NOT_IMPLEMENTED", "The %s method is not implemented", Error); - E2("ERR_STREAM_ALREADY_FINISHED", "Cannot call %s after a stream was finished", Error); - E2("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable", Error); - E2("ERR_STREAM_DESTROYED", "Cannot call %s after a stream was destroyed", Error); - E2("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); - E2("ERR_STREAM_PREMATURE_CLOSE", "Premature close", Error); - E2("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF", Error); - E2("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event", Error); - E2("ERR_STREAM_WRITE_AFTER_END", "write after end", Error); - E2("ERR_UNKNOWN_ENCODING", "Unknown encoding: %s", TypeError); + E("ERR_MULTIPLE_CALLBACK", "Callback called multiple times", Error); + E("ERR_METHOD_NOT_IMPLEMENTED", "The %s method is not implemented", Error); + E("ERR_STREAM_ALREADY_FINISHED", "Cannot call %s after a stream was finished", Error); + E("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable", Error); + E("ERR_STREAM_DESTROYED", "Cannot call %s after a stream was destroyed", Error); + E("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); + E("ERR_STREAM_PREMATURE_CLOSE", "Premature close", Error); + E("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF", Error); + E("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event", Error); + E("ERR_STREAM_WRITE_AFTER_END", "write after end", Error); + E("ERR_UNKNOWN_ENCODING", "Unknown encoding: %s", TypeError); module.exports = { AbortError: AbortError4, aggregateTwoErrors: hideStackFrames(aggregateTwoErrors), @@ -61913,7 +62016,7 @@ var require_util14 = __commonJS({ "node_modules/compress-commons/node_modules/readable-stream/lib/ours/util.js"(exports2, module) { "use strict"; var bufferModule = __require("buffer"); - var { format: format2, inspect: inspect2 } = require_inspect3(); + var { format: format4, inspect: inspect3 } = require_inspect3(); var { codes: { ERR_INVALID_ARG_TYPE } } = require_errors5(); @@ -61952,25 +62055,25 @@ var require_util14 = __commonJS({ }; }, createDeferredPromise: function() { - let resolve4; + let resolve8; let reject2; const promise = new Promise((res, rej) => { - resolve4 = res; + resolve8 = res; reject2 = rej; }); return { promise, - resolve: resolve4, + resolve: resolve8, reject: reject2 }; }, promisify(fn) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { fn((err, ...args) => { if (err) { return reject2(err); } - return resolve4(...args); + return resolve8(...args); }); }); }, @@ -61978,8 +62081,8 @@ var require_util14 = __commonJS({ return function() { }; }, - format: format2, - inspect: inspect2, + format: format4, + inspect: inspect3, types: { isAsyncFunction(fn) { return fn instanceof AsyncFunction; @@ -62140,7 +62243,7 @@ var require_validators3 = __commonJS({ var validateOneOf = hideStackFrames((value, name, oneOf) => { if (!ArrayPrototypeIncludes(oneOf, value)) { const allowed = ArrayPrototypeJoin( - ArrayPrototypeMap(oneOf, (v8) => typeof v8 === "string" ? `'${v8}'` : String2(v8)), + ArrayPrototypeMap(oneOf, (v2) => typeof v2 === "string" ? `'${v2}'` : String2(v2)), ", " ); const reason = "must be one of: " + allowed; @@ -62754,7 +62857,7 @@ var require_end_of_stream3 = __commonJS({ validateBoolean(opts.cleanup, "cleanup"); autoCleanup = opts.cleanup; } - return new Promise2((resolve4, reject2) => { + return new Promise2((resolve8, reject2) => { const cleanup = eos(stream5, opts, (err) => { if (autoCleanup) { cleanup(); @@ -62762,7 +62865,7 @@ var require_end_of_stream3 = __commonJS({ if (err) { reject2(err); } else { - resolve4(); + resolve8(); } }); }); @@ -62786,11 +62889,11 @@ var require_destroy4 = __commonJS({ var { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils5(); var kDestroy = Symbol2("kDestroy"); var kConstruct = Symbol2("kConstruct"); - function checkError(err, w5, r6) { + function checkError(err, w, r6) { if (err) { err.stack; - if (w5 && !w5.errored) { - w5.errored = err; + if (w && !w.errored) { + w.errored = err; } if (r6 && !r6.errored) { r6.errored = err; @@ -62799,22 +62902,22 @@ var require_destroy4 = __commonJS({ } function destroy2(err, cb) { const r6 = this._readableState; - const w5 = this._writableState; - const s6 = w5 || r6; - if (w5 !== null && w5 !== void 0 && w5.destroyed || r6 !== null && r6 !== void 0 && r6.destroyed) { + const w = this._writableState; + const s = w || r6; + if (w !== null && w !== void 0 && w.destroyed || r6 !== null && r6 !== void 0 && r6.destroyed) { if (typeof cb === "function") { cb(); } return this; } - checkError(err, w5, r6); - if (w5) { - w5.destroyed = true; + checkError(err, w, r6); + if (w) { + w.destroyed = true; } if (r6) { r6.destroyed = true; } - if (!s6.constructed) { + if (!s.constructed) { this.once(kDestroy, function(er) { _destroy(this, aggregateTwoErrors(er, err), cb); }); @@ -62831,10 +62934,10 @@ var require_destroy4 = __commonJS({ } called = true; const r6 = self2._readableState; - const w5 = self2._writableState; - checkError(err2, w5, r6); - if (w5) { - w5.closed = true; + const w = self2._writableState; + checkError(err2, w, r6); + if (w) { + w.closed = true; } if (r6) { r6.closed = true; @@ -62860,25 +62963,25 @@ var require_destroy4 = __commonJS({ } function emitCloseNT(self2) { const r6 = self2._readableState; - const w5 = self2._writableState; - if (w5) { - w5.closeEmitted = true; + const w = self2._writableState; + if (w) { + w.closeEmitted = true; } if (r6) { r6.closeEmitted = true; } - if (w5 !== null && w5 !== void 0 && w5.emitClose || r6 !== null && r6 !== void 0 && r6.emitClose) { + if (w !== null && w !== void 0 && w.emitClose || r6 !== null && r6 !== void 0 && r6.emitClose) { self2.emit("close"); } } function emitErrorNT(self2, err) { const r6 = self2._readableState; - const w5 = self2._writableState; - if (w5 !== null && w5 !== void 0 && w5.errorEmitted || r6 !== null && r6 !== void 0 && r6.errorEmitted) { + const w = self2._writableState; + if (w !== null && w !== void 0 && w.errorEmitted || r6 !== null && r6 !== void 0 && r6.errorEmitted) { return; } - if (w5) { - w5.errorEmitted = true; + if (w) { + w.errorEmitted = true; } if (r6) { r6.errorEmitted = true; @@ -62887,7 +62990,7 @@ var require_destroy4 = __commonJS({ } function undestroy() { const r6 = this._readableState; - const w5 = this._writableState; + const w = this._writableState; if (r6) { r6.constructed = true; r6.closed = false; @@ -62899,32 +63002,32 @@ var require_destroy4 = __commonJS({ r6.ended = r6.readable === false; r6.endEmitted = r6.readable === false; } - if (w5) { - w5.constructed = true; - w5.destroyed = false; - w5.closed = false; - w5.closeEmitted = false; - w5.errored = null; - w5.errorEmitted = false; - w5.finalCalled = false; - w5.prefinished = false; - w5.ended = w5.writable === false; - w5.ending = w5.writable === false; - w5.finished = w5.writable === false; + if (w) { + w.constructed = true; + w.destroyed = false; + w.closed = false; + w.closeEmitted = false; + w.errored = null; + w.errorEmitted = false; + w.finalCalled = false; + w.prefinished = false; + w.ended = w.writable === false; + w.ending = w.writable === false; + w.finished = w.writable === false; } } function errorOrDestroy(stream5, err, sync2) { const r6 = stream5._readableState; - const w5 = stream5._writableState; - if (w5 !== null && w5 !== void 0 && w5.destroyed || r6 !== null && r6 !== void 0 && r6.destroyed) { + const w = stream5._writableState; + if (w !== null && w !== void 0 && w.destroyed || r6 !== null && r6 !== void 0 && r6.destroyed) { return this; } - if (r6 !== null && r6 !== void 0 && r6.autoDestroy || w5 !== null && w5 !== void 0 && w5.autoDestroy) + if (r6 !== null && r6 !== void 0 && r6.autoDestroy || w !== null && w !== void 0 && w.autoDestroy) stream5.destroy(err); else if (err) { err.stack; - if (w5 && !w5.errored) { - w5.errored = err; + if (w && !w.errored) { + w.errored = err; } if (r6 && !r6.errored) { r6.errored = err; @@ -62941,12 +63044,12 @@ var require_destroy4 = __commonJS({ return; } const r6 = stream5._readableState; - const w5 = stream5._writableState; + const w = stream5._writableState; if (r6) { r6.constructed = false; } - if (w5) { - w5.constructed = false; + if (w) { + w.constructed = false; } stream5.once(kConstruct, cb); if (stream5.listenerCount(kConstruct) > 1) { @@ -62963,15 +63066,15 @@ var require_destroy4 = __commonJS({ } called = true; const r6 = stream5._readableState; - const w5 = stream5._writableState; - const s6 = w5 || r6; + const w = stream5._writableState; + const s = w || r6; if (r6) { r6.constructed = true; } - if (w5) { - w5.constructed = true; + if (w) { + w.constructed = true; } - if (s6.destroyed) { + if (s.destroyed) { stream5.emit(kDestroy, err); } else if (err) { errorOrDestroy(stream5, err, true); @@ -63171,17 +63274,17 @@ var require_buffer_list3 = __commonJS({ "node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports2, module) { "use strict"; var { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array: Uint8Array2 } = require_primordials3(); - var { Buffer: Buffer7 } = __require("buffer"); - var { inspect: inspect2 } = require_util14(); + var { Buffer: Buffer4 } = __require("buffer"); + var { inspect: inspect3 } = require_util14(); module.exports = class BufferList { constructor() { this.head = null; this.tail = null; this.length = 0; } - push(v8) { + push(v2) { const entry = { - data: v8, + data: v2, next: null }; if (this.length > 0) this.tail.next = entry; @@ -63189,9 +63292,9 @@ var require_buffer_list3 = __commonJS({ this.tail = entry; ++this.length; } - unshift(v8) { + unshift(v2) { const entry = { - data: v8, + data: v2, next: this.head }; if (this.length === 0) this.tail = entry; @@ -63210,106 +63313,106 @@ var require_buffer_list3 = __commonJS({ this.head = this.tail = null; this.length = 0; } - join(s6) { + join(s) { if (this.length === 0) return ""; - let p6 = this.head; - let ret = "" + p6.data; - while ((p6 = p6.next) !== null) ret += s6 + p6.data; + let p2 = this.head; + let ret = "" + p2.data; + while ((p2 = p2.next) !== null) ret += s + p2.data; return ret; } - concat(n12) { - if (this.length === 0) return Buffer7.alloc(0); - const ret = Buffer7.allocUnsafe(n12 >>> 0); - let p6 = this.head; + concat(n8) { + if (this.length === 0) return Buffer4.alloc(0); + const ret = Buffer4.allocUnsafe(n8 >>> 0); + let p2 = this.head; let i6 = 0; - while (p6) { - TypedArrayPrototypeSet(ret, p6.data, i6); - i6 += p6.data.length; - p6 = p6.next; + while (p2) { + TypedArrayPrototypeSet(ret, p2.data, i6); + i6 += p2.data.length; + p2 = p2.next; } return ret; } // Consumes a specified amount of bytes or characters from the buffered data. - consume(n12, hasStrings) { + consume(n8, hasStrings) { const data = this.head.data; - if (n12 < data.length) { - const slice = data.slice(0, n12); - this.head.data = data.slice(n12); + if (n8 < data.length) { + const slice = data.slice(0, n8); + this.head.data = data.slice(n8); return slice; } - if (n12 === data.length) { + if (n8 === data.length) { return this.shift(); } - return hasStrings ? this._getString(n12) : this._getBuffer(n12); + return hasStrings ? this._getString(n8) : this._getBuffer(n8); } first() { return this.head.data; } *[SymbolIterator]() { - for (let p6 = this.head; p6; p6 = p6.next) { - yield p6.data; + for (let p2 = this.head; p2; p2 = p2.next) { + yield p2.data; } } // Consumes a specified amount of characters from the buffered data. - _getString(n12) { + _getString(n8) { let ret = ""; - let p6 = this.head; + let p2 = this.head; let c6 = 0; do { - const str = p6.data; - if (n12 > str.length) { + const str = p2.data; + if (n8 > str.length) { ret += str; - n12 -= str.length; + n8 -= str.length; } else { - if (n12 === str.length) { + if (n8 === str.length) { ret += str; ++c6; - if (p6.next) this.head = p6.next; + if (p2.next) this.head = p2.next; else this.head = this.tail = null; } else { - ret += StringPrototypeSlice(str, 0, n12); - this.head = p6; - p6.data = StringPrototypeSlice(str, n12); + ret += StringPrototypeSlice(str, 0, n8); + this.head = p2; + p2.data = StringPrototypeSlice(str, n8); } break; } ++c6; - } while ((p6 = p6.next) !== null); + } while ((p2 = p2.next) !== null); this.length -= c6; return ret; } // Consumes a specified amount of bytes from the buffered data. - _getBuffer(n12) { - const ret = Buffer7.allocUnsafe(n12); - const retLen = n12; - let p6 = this.head; + _getBuffer(n8) { + const ret = Buffer4.allocUnsafe(n8); + const retLen = n8; + let p2 = this.head; let c6 = 0; do { - const buf = p6.data; - if (n12 > buf.length) { - TypedArrayPrototypeSet(ret, buf, retLen - n12); - n12 -= buf.length; + const buf = p2.data; + if (n8 > buf.length) { + TypedArrayPrototypeSet(ret, buf, retLen - n8); + n8 -= buf.length; } else { - if (n12 === buf.length) { - TypedArrayPrototypeSet(ret, buf, retLen - n12); + if (n8 === buf.length) { + TypedArrayPrototypeSet(ret, buf, retLen - n8); ++c6; - if (p6.next) this.head = p6.next; + if (p2.next) this.head = p2.next; else this.head = this.tail = null; } else { - TypedArrayPrototypeSet(ret, new Uint8Array2(buf.buffer, buf.byteOffset, n12), retLen - n12); - this.head = p6; - p6.data = buf.slice(n12); + TypedArrayPrototypeSet(ret, new Uint8Array2(buf.buffer, buf.byteOffset, n8), retLen - n8); + this.head = p2; + p2.data = buf.slice(n8); } break; } ++c6; - } while ((p6 = p6.next) !== null); + } while ((p2 = p2.next) !== null); this.length -= c6; return ret; } // Make sure the linked list only shows the minimal necessary information. [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")](_3, options) { - return inspect2(this, { + return inspect3(this, { ...options, // Only inspect one level. depth: 0, @@ -63368,34 +63471,34 @@ var require_safe_buffer4 = __commonJS({ "node_modules/compress-commons/node_modules/safe-buffer/index.js"(exports2, module) { "use strict"; var buffer2 = __require("buffer"); - var Buffer7 = buffer2.Buffer; + var Buffer4 = buffer2.Buffer; function copyProps(src, dst) { for (var key in src) { dst[key] = src[key]; } } - if (Buffer7.from && Buffer7.alloc && Buffer7.allocUnsafe && Buffer7.allocUnsafeSlow) { + if (Buffer4.from && Buffer4.alloc && Buffer4.allocUnsafe && Buffer4.allocUnsafeSlow) { module.exports = buffer2; } else { copyProps(buffer2, exports2); exports2.Buffer = SafeBuffer; } function SafeBuffer(arg, encodingOrOffset, length) { - return Buffer7(arg, encodingOrOffset, length); + return Buffer4(arg, encodingOrOffset, length); } - SafeBuffer.prototype = Object.create(Buffer7.prototype); - copyProps(Buffer7, SafeBuffer); + SafeBuffer.prototype = Object.create(Buffer4.prototype); + copyProps(Buffer4, SafeBuffer); SafeBuffer.from = function(arg, encodingOrOffset, length) { if (typeof arg === "number") { throw new TypeError("Argument must not be a number"); } - return Buffer7(arg, encodingOrOffset, length); + return Buffer4(arg, encodingOrOffset, length); }; SafeBuffer.alloc = function(size, fill, encoding) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } - var buf = Buffer7(size); + var buf = Buffer4(size); if (fill !== void 0) { if (typeof encoding === "string") { buf.fill(fill, encoding); @@ -63411,7 +63514,7 @@ var require_safe_buffer4 = __commonJS({ if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } - return Buffer7(size); + return Buffer4(size); }; SafeBuffer.allocUnsafeSlow = function(size) { if (typeof size !== "number") { @@ -63426,8 +63529,8 @@ var require_safe_buffer4 = __commonJS({ var require_string_decoder4 = __commonJS({ "node_modules/compress-commons/node_modules/string_decoder/lib/string_decoder.js"(exports2) { "use strict"; - var Buffer7 = require_safe_buffer4().Buffer; - var isEncoding = Buffer7.isEncoding || function(encoding) { + var Buffer4 = require_safe_buffer4().Buffer; + var isEncoding = Buffer4.isEncoding || function(encoding) { encoding = "" + encoding; switch (encoding && encoding.toLowerCase()) { case "hex": @@ -63475,7 +63578,7 @@ var require_string_decoder4 = __commonJS({ } function normalizeEncoding(enc) { var nenc = _normalizeEncoding(enc); - if (typeof nenc !== "string" && (Buffer7.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); + if (typeof nenc !== "string" && (Buffer4.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); return nenc || enc; } exports2.StringDecoder = StringDecoder2; @@ -63504,7 +63607,7 @@ var require_string_decoder4 = __commonJS({ } this.lastNeed = 0; this.lastTotal = 0; - this.lastChar = Buffer7.allocUnsafe(nb); + this.lastChar = Buffer4.allocUnsafe(nb); } StringDecoder2.prototype.write = function(buf) { if (buf.length === 0) return ""; @@ -63563,7 +63666,7 @@ var require_string_decoder4 = __commonJS({ } return 0; } - function utf8CheckExtraBytes(self2, buf, p6) { + function utf8CheckExtraBytes(self2, buf, p2) { if ((buf[0] & 192) !== 128) { self2.lastNeed = 0; return "\uFFFD"; @@ -63582,14 +63685,14 @@ var require_string_decoder4 = __commonJS({ } } function utf8FillLast(buf) { - var p6 = this.lastTotal - this.lastNeed; - var r6 = utf8CheckExtraBytes(this, buf, p6); + var p2 = this.lastTotal - this.lastNeed; + var r6 = utf8CheckExtraBytes(this, buf, p2); if (r6 !== void 0) return r6; if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p6, 0, this.lastNeed); + buf.copy(this.lastChar, p2, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } - buf.copy(this.lastChar, p6, 0, buf.length); + buf.copy(this.lastChar, p2, 0, buf.length); this.lastNeed -= buf.length; } function utf8Text(buf, i6) { @@ -63634,17 +63737,17 @@ var require_string_decoder4 = __commonJS({ return r6; } function base64Text(buf, i6) { - var n12 = (buf.length - i6) % 3; - if (n12 === 0) return buf.toString("base64", i6); - this.lastNeed = 3 - n12; + var n8 = (buf.length - i6) % 3; + if (n8 === 0) return buf.toString("base64", i6); + this.lastNeed = 3 - n8; this.lastTotal = 3; - if (n12 === 1) { + if (n8 === 1) { this.lastChar[0] = buf[buf.length - 1]; } else { this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; } - return buf.toString("base64", i6, buf.length - n12); + return buf.toString("base64", i6, buf.length - n8); } function base64End(buf) { var r6 = buf && buf.length ? this.write(buf) : ""; @@ -63666,12 +63769,12 @@ var require_from3 = __commonJS({ "use strict"; var process5 = require_process(); var { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require_primordials3(); - var { Buffer: Buffer7 } = __require("buffer"); + var { Buffer: Buffer4 } = __require("buffer"); var { ERR_INVALID_ARG_TYPE, ERR_STREAM_NULL_VALUES } = require_errors5().codes; - function from(Readable13, iterable, opts) { + function from(Readable11, iterable, opts) { let iterator2; - if (typeof iterable === "string" || iterable instanceof Buffer7) { - return new Readable13({ + if (typeof iterable === "string" || iterable instanceof Buffer4) { + return new Readable11({ objectMode: true, ...opts, read() { @@ -63690,7 +63793,7 @@ var require_from3 = __commonJS({ } else { throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable); } - const readable = new Readable13({ + const readable = new Readable11({ objectMode: true, highWaterMark: 1, // TODO(ronag): What options should be allowed? @@ -63774,11 +63877,11 @@ var require_readable5 = __commonJS({ SymbolAsyncIterator, Symbol: Symbol2 } = require_primordials3(); - module.exports = Readable13; - Readable13.ReadableState = ReadableState; + module.exports = Readable11; + Readable11.ReadableState = ReadableState; var { EventEmitter: EE } = __require("events"); var { Stream: Stream3, prependListener } = require_legacy3(); - var { Buffer: Buffer7 } = __require("buffer"); + var { Buffer: Buffer4 } = __require("buffer"); var { addAbortSignal } = require_add_abort_signal3(); var eos = require_end_of_stream3(); var debug2 = require_util14().debuglog("stream", (fn) => { @@ -63802,8 +63905,8 @@ var require_readable5 = __commonJS({ var kPaused = Symbol2("kPaused"); var { StringDecoder: StringDecoder2 } = require_string_decoder4(); var from = require_from3(); - ObjectSetPrototypeOf(Readable13.prototype, Stream3.prototype); - ObjectSetPrototypeOf(Readable13, Stream3); + ObjectSetPrototypeOf(Readable11.prototype, Stream3.prototype); + ObjectSetPrototypeOf(Readable11, Stream3); var nop = () => { }; var { errorOrDestroy } = destroyImpl; @@ -63898,8 +64001,8 @@ var require_readable5 = __commonJS({ this.encoding = options.encoding; } } - function Readable13(options) { - if (!(this instanceof Readable13)) return new Readable13(options); + function Readable11(options) { + if (!(this instanceof Readable11)) return new Readable11(options); const isDuplex = this instanceof require_duplex3(); this._readableState = new ReadableState(options, this, isDuplex); if (options) { @@ -63915,26 +64018,26 @@ var require_readable5 = __commonJS({ } }); } - Readable13.prototype.destroy = destroyImpl.destroy; - Readable13.prototype._undestroy = destroyImpl.undestroy; - Readable13.prototype._destroy = function(err, cb) { + Readable11.prototype.destroy = destroyImpl.destroy; + Readable11.prototype._undestroy = destroyImpl.undestroy; + Readable11.prototype._destroy = function(err, cb) { cb(err); }; - Readable13.prototype[EE.captureRejectionSymbol] = function(err) { + Readable11.prototype[EE.captureRejectionSymbol] = function(err) { this.destroy(err); }; - Readable13.prototype[SymbolAsyncDispose] = function() { + Readable11.prototype[SymbolAsyncDispose] = function() { let error2; if (!this.destroyed) { error2 = this.readableEnded ? null : new AbortError4(); this.destroy(error2); } - return new Promise2((resolve4, reject2) => eos(this, (err) => err && err !== error2 ? reject2(err) : resolve4(null))); + return new Promise2((resolve8, reject2) => eos(this, (err) => err && err !== error2 ? reject2(err) : resolve8(null))); }; - Readable13.prototype.push = function(chunk, encoding) { + Readable11.prototype.push = function(chunk, encoding) { return readableAddChunk(this, chunk, encoding, false); }; - Readable13.prototype.unshift = function(chunk, encoding) { + Readable11.prototype.unshift = function(chunk, encoding) { return readableAddChunk(this, chunk, encoding, true); }; function readableAddChunk(stream5, chunk, encoding, addToFront) { @@ -63946,13 +64049,13 @@ var require_readable5 = __commonJS({ encoding = encoding || state4.defaultEncoding; if (state4.encoding !== encoding) { if (addToFront && state4.encoding) { - chunk = Buffer7.from(chunk, encoding).toString(state4.encoding); + chunk = Buffer4.from(chunk, encoding).toString(state4.encoding); } else { - chunk = Buffer7.from(chunk, encoding); + chunk = Buffer4.from(chunk, encoding); encoding = ""; } } - } else if (chunk instanceof Buffer7) { + } else if (chunk instanceof Buffer4) { encoding = ""; } else if (Stream3._isUint8Array(chunk)) { chunk = Stream3._uint8ArrayToBuffer(chunk); @@ -64008,11 +64111,11 @@ var require_readable5 = __commonJS({ } maybeReadMore(stream5, state4); } - Readable13.prototype.isPaused = function() { + Readable11.prototype.isPaused = function() { const state4 = this._readableState; return state4[kPaused] === true || state4.flowing === false; }; - Readable13.prototype.setEncoding = function(enc) { + Readable11.prototype.setEncoding = function(enc) { const decoder = new StringDecoder2(enc); this._readableState.decoder = decoder; this._readableState.encoding = this._readableState.decoder.encoding; @@ -64027,55 +64130,55 @@ var require_readable5 = __commonJS({ return this; }; var MAX_HWM = 1073741824; - function computeNewHighWaterMark(n12) { - if (n12 > MAX_HWM) { - throw new ERR_OUT_OF_RANGE("size", "<= 1GiB", n12); + function computeNewHighWaterMark(n8) { + if (n8 > MAX_HWM) { + throw new ERR_OUT_OF_RANGE("size", "<= 1GiB", n8); } else { - n12--; - n12 |= n12 >>> 1; - n12 |= n12 >>> 2; - n12 |= n12 >>> 4; - n12 |= n12 >>> 8; - n12 |= n12 >>> 16; - n12++; - } - return n12; - } - function howMuchToRead(n12, state4) { - if (n12 <= 0 || state4.length === 0 && state4.ended) return 0; + n8--; + n8 |= n8 >>> 1; + n8 |= n8 >>> 2; + n8 |= n8 >>> 4; + n8 |= n8 >>> 8; + n8 |= n8 >>> 16; + n8++; + } + return n8; + } + function howMuchToRead(n8, state4) { + if (n8 <= 0 || state4.length === 0 && state4.ended) return 0; if ((state4.state & kObjectMode) !== 0) return 1; - if (NumberIsNaN(n12)) { + if (NumberIsNaN(n8)) { if (state4.flowing && state4.length) return state4.buffer.first().length; return state4.length; } - if (n12 <= state4.length) return n12; + if (n8 <= state4.length) return n8; return state4.ended ? state4.length : 0; } - Readable13.prototype.read = function(n12) { - debug2("read", n12); - if (n12 === void 0) { - n12 = NaN; - } else if (!NumberIsInteger(n12)) { - n12 = NumberParseInt(n12, 10); + Readable11.prototype.read = function(n8) { + debug2("read", n8); + if (n8 === void 0) { + n8 = NaN; + } else if (!NumberIsInteger(n8)) { + n8 = NumberParseInt(n8, 10); } const state4 = this._readableState; - const nOrig = n12; - if (n12 > state4.highWaterMark) state4.highWaterMark = computeNewHighWaterMark(n12); - if (n12 !== 0) state4.state &= ~kEmittedReadable; - if (n12 === 0 && state4.needReadable && ((state4.highWaterMark !== 0 ? state4.length >= state4.highWaterMark : state4.length > 0) || state4.ended)) { + const nOrig = n8; + if (n8 > state4.highWaterMark) state4.highWaterMark = computeNewHighWaterMark(n8); + if (n8 !== 0) state4.state &= ~kEmittedReadable; + if (n8 === 0 && state4.needReadable && ((state4.highWaterMark !== 0 ? state4.length >= state4.highWaterMark : state4.length > 0) || state4.ended)) { debug2("read: emitReadable", state4.length, state4.ended); if (state4.length === 0 && state4.ended) endReadable(this); else emitReadable(this); return null; } - n12 = howMuchToRead(n12, state4); - if (n12 === 0 && state4.ended) { + n8 = howMuchToRead(n8, state4); + if (n8 === 0 && state4.ended) { if (state4.length === 0) endReadable(this); return null; } let doRead = (state4.state & kNeedReadable) !== 0; debug2("need readable", doRead); - if (state4.length === 0 || state4.length - n12 < state4.highWaterMark) { + if (state4.length === 0 || state4.length - n8 < state4.highWaterMark) { doRead = true; debug2("length less than watermark", doRead); } @@ -64092,16 +64195,16 @@ var require_readable5 = __commonJS({ errorOrDestroy(this, err); } state4.state &= ~kSync; - if (!state4.reading) n12 = howMuchToRead(nOrig, state4); + if (!state4.reading) n8 = howMuchToRead(nOrig, state4); } let ret; - if (n12 > 0) ret = fromList(n12, state4); + if (n8 > 0) ret = fromList(n8, state4); else ret = null; if (ret === null) { state4.needReadable = state4.length <= state4.highWaterMark; - n12 = 0; + n8 = 0; } else { - state4.length -= n12; + state4.length -= n8; if (state4.multiAwaitDrain) { state4.awaitDrainWriters.clear(); } else { @@ -64110,7 +64213,7 @@ var require_readable5 = __commonJS({ } if (state4.length === 0) { if (!state4.ended) state4.needReadable = true; - if (nOrig !== n12 && state4.ended) endReadable(this); + if (nOrig !== n8 && state4.ended) endReadable(this); } if (ret !== null && !state4.errorEmitted && !state4.closeEmitted) { state4.dataEmitted = true; @@ -64173,10 +64276,10 @@ var require_readable5 = __commonJS({ } state4.readingMore = false; } - Readable13.prototype._read = function(n12) { + Readable11.prototype._read = function(n8) { throw new ERR_METHOD_NOT_IMPLEMENTED("_read()"); }; - Readable13.prototype.pipe = function(dest, pipeOpts) { + Readable11.prototype.pipe = function(dest, pipeOpts) { const src = this; const state4 = this._readableState; if (state4.pipes.length === 1) { @@ -64253,8 +64356,8 @@ var require_readable5 = __commonJS({ unpipe(); dest.removeListener("error", onerror); if (dest.listenerCount("error") === 0) { - const s6 = dest._writableState || dest._readableState; - if (s6 && !s6.errorEmitted) { + const s = dest._writableState || dest._readableState; + if (s && !s.errorEmitted) { errorOrDestroy(dest, er); } else { dest.emit("error", er); @@ -64301,7 +64404,7 @@ var require_readable5 = __commonJS({ } }; } - Readable13.prototype.unpipe = function(dest) { + Readable11.prototype.unpipe = function(dest) { const state4 = this._readableState; const unpipeInfo = { hasUnpiped: false @@ -64324,7 +64427,7 @@ var require_readable5 = __commonJS({ dest.emit("unpipe", this, unpipeInfo); return this; }; - Readable13.prototype.on = function(ev, fn) { + Readable11.prototype.on = function(ev, fn) { const res = Stream3.prototype.on.call(this, ev, fn); const state4 = this._readableState; if (ev === "data") { @@ -64345,16 +64448,16 @@ var require_readable5 = __commonJS({ } return res; }; - Readable13.prototype.addListener = Readable13.prototype.on; - Readable13.prototype.removeListener = function(ev, fn) { + Readable11.prototype.addListener = Readable11.prototype.on; + Readable11.prototype.removeListener = function(ev, fn) { const res = Stream3.prototype.removeListener.call(this, ev, fn); if (ev === "readable") { process5.nextTick(updateReadableListening, this); } return res; }; - Readable13.prototype.off = Readable13.prototype.removeListener; - Readable13.prototype.removeAllListeners = function(ev) { + Readable11.prototype.off = Readable11.prototype.removeListener; + Readable11.prototype.removeAllListeners = function(ev) { const res = Stream3.prototype.removeAllListeners.apply(this, arguments); if (ev === "readable" || ev === void 0) { process5.nextTick(updateReadableListening, this); @@ -64376,7 +64479,7 @@ var require_readable5 = __commonJS({ debug2("readable nexttick read 0"); self2.read(0); } - Readable13.prototype.resume = function() { + Readable11.prototype.resume = function() { const state4 = this._readableState; if (!state4.flowing) { debug2("resume"); @@ -64402,7 +64505,7 @@ var require_readable5 = __commonJS({ flow(stream5); if (state4.flowing && !state4.reading) stream5.read(0); } - Readable13.prototype.pause = function() { + Readable11.prototype.pause = function() { debug2("call pause flowing=%j", this._readableState.flowing); if (this._readableState.flowing !== false) { debug2("pause"); @@ -64417,7 +64520,7 @@ var require_readable5 = __commonJS({ debug2("flow", state4.flowing); while (state4.flowing && stream5.read() !== null) ; } - Readable13.prototype.wrap = function(stream5) { + Readable11.prototype.wrap = function(stream5) { let paused = false; stream5.on("data", (chunk) => { if (!this.push(chunk) && stream5.pause) { @@ -64452,10 +64555,10 @@ var require_readable5 = __commonJS({ } return this; }; - Readable13.prototype[SymbolAsyncIterator] = function() { + Readable11.prototype[SymbolAsyncIterator] = function() { return streamToAsyncIterator(this); }; - Readable13.prototype.iterator = function(options) { + Readable11.prototype.iterator = function(options) { if (options !== void 0) { validateObject(options, "options"); } @@ -64463,7 +64566,7 @@ var require_readable5 = __commonJS({ }; function streamToAsyncIterator(stream5, options) { if (typeof stream5.read !== "function") { - stream5 = Readable13.wrap(stream5, { + stream5 = Readable11.wrap(stream5, { objectMode: true }); } @@ -64473,12 +64576,12 @@ var require_readable5 = __commonJS({ } async function* createAsyncIterator(stream5, options) { let callback = nop; - function next(resolve4) { + function next(resolve8) { if (this === stream5) { callback(); callback = nop; } else { - callback = resolve4; + callback = resolve8; } } stream5.on("readable", next); @@ -64519,7 +64622,7 @@ var require_readable5 = __commonJS({ } } } - ObjectDefineProperties(Readable13.prototype, { + ObjectDefineProperties(Readable11.prototype, { readable: { __proto__: null, get() { @@ -64646,18 +64749,18 @@ var require_readable5 = __commonJS({ } } }); - Readable13._fromList = fromList; - function fromList(n12, state4) { + Readable11._fromList = fromList; + function fromList(n8, state4) { if (state4.length === 0) return null; let ret; if (state4.objectMode) ret = state4.buffer.shift(); - else if (!n12 || n12 >= state4.length) { + else if (!n8 || n8 >= state4.length) { if (state4.decoder) ret = state4.buffer.join(""); else if (state4.buffer.length === 1) ret = state4.buffer.first(); else ret = state4.buffer.concat(state4.length); state4.buffer.clear(); } else { - ret = state4.buffer.consume(n12, state4.decoder); + ret = state4.buffer.consume(n8, state4.decoder); } return ret; } @@ -64693,23 +64796,23 @@ var require_readable5 = __commonJS({ stream5.end(); } } - Readable13.from = function(iterable, opts) { - return from(Readable13, iterable, opts); + Readable11.from = function(iterable, opts) { + return from(Readable11, iterable, opts); }; var webStreamsAdapters; function lazyWebStreams() { if (webStreamsAdapters === void 0) webStreamsAdapters = {}; return webStreamsAdapters; } - Readable13.fromWeb = function(readableStream, options) { + Readable11.fromWeb = function(readableStream, options) { return lazyWebStreams().newStreamReadableFromReadableStream(readableStream, options); }; - Readable13.toWeb = function(streamReadable, options) { + Readable11.toWeb = function(streamReadable, options) { return lazyWebStreams().newReadableStreamFromStreamReadable(streamReadable, options); }; - Readable13.wrap = function(src, options) { + Readable11.wrap = function(src, options) { var _ref, _src$readableObjectMo; - return new Readable13({ + return new Readable11({ objectMode: (_ref = (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== void 0 ? _src$readableObjectMo : src.objectMode) !== null && _ref !== void 0 ? _ref : true, ...options, destroy(err, callback) { @@ -64737,11 +64840,11 @@ var require_writable3 = __commonJS({ Symbol: Symbol2, SymbolHasInstance } = require_primordials3(); - module.exports = Writable2; - Writable2.WritableState = WritableState; + module.exports = Writable3; + Writable3.WritableState = WritableState; var { EventEmitter: EE } = __require("events"); var Stream3 = require_legacy3().Stream; - var { Buffer: Buffer7 } = __require("buffer"); + var { Buffer: Buffer4 } = __require("buffer"); var destroyImpl = require_destroy4(); var { addAbortSignal } = require_add_abort_signal3(); var { getHighWaterMark, getDefaultHighWaterMark } = require_state5(); @@ -64757,8 +64860,8 @@ var require_writable3 = __commonJS({ ERR_UNKNOWN_ENCODING } = require_errors5().codes; var { errorOrDestroy } = destroyImpl; - ObjectSetPrototypeOf(Writable2.prototype, Stream3.prototype); - ObjectSetPrototypeOf(Writable2, Stream3); + ObjectSetPrototypeOf(Writable3.prototype, Stream3.prototype); + ObjectSetPrototypeOf(Writable3, Stream3); function nop() { } var kOnFinished = Symbol2("kOnFinished"); @@ -64812,9 +64915,9 @@ var require_writable3 = __commonJS({ return this.buffered.length - this.bufferedIndex; } }); - function Writable2(options) { + function Writable3(options) { const isDuplex = this instanceof require_duplex3(); - if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable2, this)) return new Writable2(options); + if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable3, this)) return new Writable3(options); this._writableState = new WritableState(options, this, isDuplex); if (options) { if (typeof options.write === "function") this._write = options.write; @@ -64833,15 +64936,15 @@ var require_writable3 = __commonJS({ finishMaybe(this, state4); }); } - ObjectDefineProperty(Writable2, SymbolHasInstance, { + ObjectDefineProperty(Writable3, SymbolHasInstance, { __proto__: null, value: function(object) { if (FunctionPrototypeSymbolHasInstance(this, object)) return true; - if (this !== Writable2) return false; + if (this !== Writable3) return false; return object && object._writableState instanceof WritableState; } }); - Writable2.prototype.pipe = function() { + Writable3.prototype.pipe = function() { errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); }; function _write(stream5, chunk, encoding, cb) { @@ -64851,7 +64954,7 @@ var require_writable3 = __commonJS({ encoding = state4.defaultEncoding; } else { if (!encoding) encoding = state4.defaultEncoding; - else if (encoding !== "buffer" && !Buffer7.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); + else if (encoding !== "buffer" && !Buffer4.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); if (typeof cb !== "function") cb = nop; } if (chunk === null) { @@ -64859,10 +64962,10 @@ var require_writable3 = __commonJS({ } else if (!state4.objectMode) { if (typeof chunk === "string") { if (state4.decodeStrings !== false) { - chunk = Buffer7.from(chunk, encoding); + chunk = Buffer4.from(chunk, encoding); encoding = "buffer"; } - } else if (chunk instanceof Buffer7) { + } else if (chunk instanceof Buffer4) { encoding = "buffer"; } else if (Stream3._isUint8Array(chunk)) { chunk = Stream3._uint8ArrayToBuffer(chunk); @@ -64885,22 +64988,22 @@ var require_writable3 = __commonJS({ state4.pendingcb++; return writeOrBuffer(stream5, state4, chunk, encoding, cb); } - Writable2.prototype.write = function(chunk, encoding, cb) { + Writable3.prototype.write = function(chunk, encoding, cb) { return _write(this, chunk, encoding, cb) === true; }; - Writable2.prototype.cork = function() { + Writable3.prototype.cork = function() { this._writableState.corked++; }; - Writable2.prototype.uncork = function() { + Writable3.prototype.uncork = function() { const state4 = this._writableState; if (state4.corked) { state4.corked--; if (!state4.writing) clearBuffer(this, state4); } }; - Writable2.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + Writable3.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { if (typeof encoding === "string") encoding = StringPrototypeToLowerCase(encoding); - if (!Buffer7.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); + if (!Buffer4.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); this._writableState.defaultEncoding = encoding; return this; }; @@ -65016,9 +65119,9 @@ var require_writable3 = __commonJS({ if (state4.writing) { return; } - for (let n12 = state4.bufferedIndex; n12 < state4.buffered.length; ++n12) { + for (let n8 = state4.bufferedIndex; n8 < state4.buffered.length; ++n8) { var _state$errored; - const { chunk, callback } = state4.buffered[n12]; + const { chunk, callback } = state4.buffered[n8]; const len = state4.objectMode ? 1 : chunk.length; state4.length -= len; callback( @@ -65048,8 +65151,8 @@ var require_writable3 = __commonJS({ if (bufferedLength > 1 && stream5._writev) { state4.pendingcb -= bufferedLength - 1; const callback = state4.allNoop ? nop : (err) => { - for (let n12 = i6; n12 < buffered.length; ++n12) { - buffered[n12].callback(err); + for (let n8 = i6; n8 < buffered.length; ++n8) { + buffered[n8].callback(err); } }; const chunks = state4.allNoop && i6 === 0 ? buffered : ArrayPrototypeSlice(buffered, i6); @@ -65074,7 +65177,7 @@ var require_writable3 = __commonJS({ } state4.bufferProcessing = false; } - Writable2.prototype._write = function(chunk, encoding, cb) { + Writable3.prototype._write = function(chunk, encoding, cb) { if (this._writev) { this._writev( [ @@ -65089,8 +65192,8 @@ var require_writable3 = __commonJS({ throw new ERR_METHOD_NOT_IMPLEMENTED("_write()"); } }; - Writable2.prototype._writev = null; - Writable2.prototype.end = function(chunk, encoding, cb) { + Writable3.prototype._writev = null; + Writable3.prototype.end = function(chunk, encoding, cb) { const state4 = this._writableState; if (typeof chunk === "function") { cb = chunk; @@ -65217,7 +65320,7 @@ var require_writable3 = __commonJS({ } } } - ObjectDefineProperties(Writable2.prototype, { + ObjectDefineProperties(Writable3.prototype, { closed: { __proto__: null, get() { @@ -65238,8 +65341,8 @@ var require_writable3 = __commonJS({ writable: { __proto__: null, get() { - const w5 = this._writableState; - return !!w5 && w5.writable !== false && !w5.destroyed && !w5.errored && !w5.ending && !w5.ended; + const w = this._writableState; + return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended; }, set(val) { if (this._writableState) { @@ -65313,7 +65416,7 @@ var require_writable3 = __commonJS({ } }); var destroy2 = destroyImpl.destroy; - Writable2.prototype.destroy = function(err, cb) { + Writable3.prototype.destroy = function(err, cb) { const state4 = this._writableState; if (!state4.destroyed && (state4.bufferedIndex < state4.buffered.length || state4[kOnFinished].length)) { process5.nextTick(errorBuffer, state4); @@ -65321,11 +65424,11 @@ var require_writable3 = __commonJS({ destroy2.call(this, err, cb); return this; }; - Writable2.prototype._undestroy = destroyImpl.undestroy; - Writable2.prototype._destroy = function(err, cb) { + Writable3.prototype._undestroy = destroyImpl.undestroy; + Writable3.prototype._destroy = function(err, cb) { cb(err); }; - Writable2.prototype[EE.captureRejectionSymbol] = function(err) { + Writable3.prototype[EE.captureRejectionSymbol] = function(err) { this.destroy(err); }; var webStreamsAdapters; @@ -65333,10 +65436,10 @@ var require_writable3 = __commonJS({ if (webStreamsAdapters === void 0) webStreamsAdapters = {}; return webStreamsAdapters; } - Writable2.fromWeb = function(writableStream, options) { + Writable3.fromWeb = function(writableStream, options) { return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options); }; - Writable2.toWeb = function(streamWritable) { + Writable3.toWeb = function(streamWritable) { return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable); }; } @@ -65366,8 +65469,8 @@ var require_duplexify3 = __commonJS({ } = require_errors5(); var { destroyer } = require_destroy4(); var Duplex = require_duplex3(); - var Readable13 = require_readable5(); - var Writable2 = require_writable3(); + var Readable11 = require_readable5(); + var Writable3 = require_writable3(); var { createDeferredPromise } = require_util14(); var from = require_from3(); var Blob3 = globalThis.Blob || bufferModule.Blob; @@ -65416,12 +65519,12 @@ var require_duplexify3 = __commonJS({ } if (isReadableStream4(body2)) { return _duplexify({ - readable: Readable13.fromWeb(body2) + readable: Readable11.fromWeb(body2) }); } if (isWritableStream(body2)) { return _duplexify({ - writable: Writable2.fromWeb(body2) + writable: Writable3.fromWeb(body2) }); } if (typeof body2 === "function") { @@ -65531,7 +65634,7 @@ var require_duplexify3 = __commonJS({ ); }; function fromAsyncGen(fn) { - let { promise, resolve: resolve4 } = createDeferredPromise(); + let { promise, resolve: resolve8 } = createDeferredPromise(); const ac = new AbortController2(); const signal = ac.signal; const value = fn( @@ -65546,7 +65649,7 @@ var require_duplexify3 = __commonJS({ throw new AbortError4(void 0, { cause: signal.reason }); - ({ promise, resolve: resolve4 } = createDeferredPromise()); + ({ promise, resolve: resolve8 } = createDeferredPromise()); yield chunk; } })(), @@ -65557,8 +65660,8 @@ var require_duplexify3 = __commonJS({ return { value, write(chunk, encoding, cb) { - const _resolve = resolve4; - resolve4 = null; + const _resolve = resolve8; + resolve8 = null; _resolve({ chunk, done: false, @@ -65566,8 +65669,8 @@ var require_duplexify3 = __commonJS({ }); }, final(cb) { - const _resolve = resolve4; - resolve4 = null; + const _resolve = resolve8; + resolve8 = null; _resolve({ done: true, cb @@ -65580,10 +65683,10 @@ var require_duplexify3 = __commonJS({ }; } function _duplexify(pair) { - const r6 = pair.readable && typeof pair.readable.read !== "function" ? Readable13.wrap(pair.readable) : pair.readable; - const w5 = pair.writable; + const r6 = pair.readable && typeof pair.readable.read !== "function" ? Readable11.wrap(pair.readable) : pair.readable; + const w = pair.writable; let readable = !!isReadable2(r6); - let writable = !!isWritable2(w5); + let writable = !!isWritable2(w); let ondrain; let onfinish; let onreadable; @@ -65601,12 +65704,12 @@ var require_duplexify3 = __commonJS({ d6 = new Duplexify({ // TODO (ronag): highWaterMark? readableObjectMode: !!(r6 !== null && r6 !== void 0 && r6.readableObjectMode), - writableObjectMode: !!(w5 !== null && w5 !== void 0 && w5.writableObjectMode), + writableObjectMode: !!(w !== null && w !== void 0 && w.writableObjectMode), readable, writable }); if (writable) { - eos(w5, (err) => { + eos(w, (err) => { writable = false; if (err) { destroyer(r6, err); @@ -65614,24 +65717,24 @@ var require_duplexify3 = __commonJS({ onfinished(err); }); d6._write = function(chunk, encoding, callback) { - if (w5.write(chunk, encoding)) { + if (w.write(chunk, encoding)) { callback(); } else { ondrain = callback; } }; d6._final = function(callback) { - w5.end(); + w.end(); onfinish = callback; }; - w5.on("drain", function() { + w.on("drain", function() { if (ondrain) { const cb = ondrain; ondrain = null; cb(); } }); - w5.on("finish", function() { + w.on("finish", function() { if (onfinish) { const cb = onfinish; onfinish = null; @@ -65681,7 +65784,7 @@ var require_duplexify3 = __commonJS({ callback(err); } else { onclose = callback; - destroyer(w5, err); + destroyer(w, err); destroyer(r6, err); } }; @@ -65701,21 +65804,21 @@ var require_duplex3 = __commonJS({ ObjectSetPrototypeOf } = require_primordials3(); module.exports = Duplex; - var Readable13 = require_readable5(); - var Writable2 = require_writable3(); - ObjectSetPrototypeOf(Duplex.prototype, Readable13.prototype); - ObjectSetPrototypeOf(Duplex, Readable13); + var Readable11 = require_readable5(); + var Writable3 = require_writable3(); + ObjectSetPrototypeOf(Duplex.prototype, Readable11.prototype); + ObjectSetPrototypeOf(Duplex, Readable11); { - const keys = ObjectKeys(Writable2.prototype); + const keys = ObjectKeys(Writable3.prototype); for (let i6 = 0; i6 < keys.length; i6++) { const method = keys[i6]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable2.prototype[method]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable3.prototype[method]; } } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); - Readable13.call(this, options); - Writable2.call(this, options); + Readable11.call(this, options); + Writable3.call(this, options); if (options) { this.allowHalfOpen = options.allowHalfOpen !== false; if (options.readable === false) { @@ -65736,39 +65839,39 @@ var require_duplex3 = __commonJS({ ObjectDefineProperties(Duplex.prototype, { writable: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writable") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writable") }, writableHighWaterMark: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableHighWaterMark") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableHighWaterMark") }, writableObjectMode: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableObjectMode") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableObjectMode") }, writableBuffer: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableBuffer") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableBuffer") }, writableLength: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableLength") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableLength") }, writableFinished: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableFinished") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableFinished") }, writableCorked: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableCorked") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableCorked") }, writableEnded: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableEnded") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableEnded") }, writableNeedDrain: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableNeedDrain") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableNeedDrain") }, destroyed: { __proto__: null, @@ -65962,7 +66065,7 @@ var require_pipeline3 = __commonJS({ } = require_utils5(); var AbortController2 = globalThis.AbortController || require_abort_controller().AbortController; var PassThrough5; - var Readable13; + var Readable11; var addAbortListener; function destroyer(stream5, reading, writing) { let finished = false; @@ -66001,10 +66104,10 @@ var require_pipeline3 = __commonJS({ throw new ERR_INVALID_ARG_TYPE("val", ["Readable", "Iterable", "AsyncIterable"], val); } async function* fromReadable(val) { - if (!Readable13) { - Readable13 = require_readable5(); + if (!Readable11) { + Readable11 = require_readable5(); } - yield* Readable13.prototype[SymbolAsyncIterator].call(val); + yield* Readable11.prototype[SymbolAsyncIterator].call(val); } async function pumpToNode(iterable, writable, finish, { end }) { let error2; @@ -66019,7 +66122,7 @@ var require_pipeline3 = __commonJS({ callback(); } }; - const wait = () => new Promise2((resolve4, reject2) => { + const wait = () => new Promise2((resolve8, reject2) => { if (error2) { reject2(error2); } else { @@ -66027,7 +66130,7 @@ var require_pipeline3 = __commonJS({ if (error2) { reject2(error2); } else { - resolve4(); + resolve8(); } }; } @@ -66393,15 +66496,15 @@ var require_compose3 = __commonJS({ const idx = streams.length - 1; streams[idx] = Duplex.from(streams[idx]); } - for (let n12 = 0; n12 < streams.length; ++n12) { - if (!isNodeStream(streams[n12]) && !isWebStream(streams[n12])) { + for (let n8 = 0; n8 < streams.length; ++n8) { + if (!isNodeStream(streams[n8]) && !isWebStream(streams[n8])) { continue; } - if (n12 < streams.length - 1 && !(isReadable2(streams[n12]) || isReadableStream4(streams[n12]) || isTransformStream(streams[n12]))) { - throw new ERR_INVALID_ARG_VALUE(`streams[${n12}]`, orgStreams[n12], "must be readable"); + if (n8 < streams.length - 1 && !(isReadable2(streams[n8]) || isReadableStream4(streams[n8]) || isTransformStream(streams[n8]))) { + throw new ERR_INVALID_ARG_VALUE(`streams[${n8}]`, orgStreams[n8], "must be readable"); } - if (n12 > 0 && !(isWritable2(streams[n12]) || isWritableStream(streams[n12]) || isTransformStream(streams[n12]))) { - throw new ERR_INVALID_ARG_VALUE(`streams[${n12}]`, orgStreams[n12], "must be writable"); + if (n8 > 0 && !(isWritable2(streams[n8]) || isWritableStream(streams[n8]) || isTransformStream(streams[n8]))) { + throw new ERR_INVALID_ARG_VALUE(`streams[${n8}]`, orgStreams[n8], "must be writable"); } } let ondrain; @@ -66671,8 +66774,8 @@ var require_operators3 = __commonJS({ next = null; } if (!done && (queue2.length >= highWaterMark || cnt >= concurrency)) { - await new Promise2((resolve4) => { - resume = resolve4; + await new Promise2((resolve8) => { + resume = resolve8; }); } } @@ -66706,8 +66809,8 @@ var require_operators3 = __commonJS({ queue2.shift(); maybeResume(); } - await new Promise2((resolve4) => { - next = resolve4; + await new Promise2((resolve8) => { + next = resolve8; }); } } finally { @@ -66965,7 +67068,7 @@ var require_promises3 = __commonJS({ var { finished } = require_end_of_stream3(); require_stream4(); function pipeline2(...streams) { - return new Promise2((resolve4, reject2) => { + return new Promise2((resolve8, reject2) => { let signal; let end; const lastArg = streams[streams.length - 1]; @@ -66980,7 +67083,7 @@ var require_promises3 = __commonJS({ if (err) { reject2(err); } else { - resolve4(value); + resolve8(value); } }, { @@ -67001,7 +67104,7 @@ var require_promises3 = __commonJS({ var require_stream4 = __commonJS({ "node_modules/compress-commons/node_modules/readable-stream/lib/stream.js"(exports2, module) { "use strict"; - var { Buffer: Buffer7 } = __require("buffer"); + var { Buffer: Buffer4 } = __require("buffer"); var { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials3(); var { promisify: { custom: customPromisify } @@ -67111,7 +67214,7 @@ var require_stream4 = __commonJS({ return value instanceof Uint8Array; }; Stream3._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) { - return Buffer7.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); + return Buffer4.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); }; } }); @@ -67317,8 +67420,8 @@ var require_crc32 = __commonJS({ CRC322.version = "1.2.2"; function signed_crc_table() { var c6 = 0, table = new Array(256); - for (var n12 = 0; n12 != 256; ++n12) { - c6 = n12; + for (var n8 = 0; n8 != 256; ++n8) { + c6 = n8; c6 = c6 & 1 ? -306674912 ^ c6 >>> 1 : c6 >>> 1; c6 = c6 & 1 ? -306674912 ^ c6 >>> 1 : c6 >>> 1; c6 = c6 & 1 ? -306674912 ^ c6 >>> 1 : c6 >>> 1; @@ -67327,20 +67430,20 @@ var require_crc32 = __commonJS({ c6 = c6 & 1 ? -306674912 ^ c6 >>> 1 : c6 >>> 1; c6 = c6 & 1 ? -306674912 ^ c6 >>> 1 : c6 >>> 1; c6 = c6 & 1 ? -306674912 ^ c6 >>> 1 : c6 >>> 1; - table[n12] = c6; + table[n8] = c6; } return typeof Int32Array !== "undefined" ? new Int32Array(table) : table; } var T0 = signed_crc_table(); function slice_by_16_tables(T10) { - var c6 = 0, v8 = 0, n12 = 0, table = typeof Int32Array !== "undefined" ? new Int32Array(4096) : new Array(4096); - for (n12 = 0; n12 != 256; ++n12) table[n12] = T10[n12]; - for (n12 = 0; n12 != 256; ++n12) { - v8 = T10[n12]; - for (c6 = 256 + n12; c6 < 4096; c6 += 256) v8 = table[c6] = v8 >>> 8 ^ T10[v8 & 255]; + var c6 = 0, v2 = 0, n8 = 0, table = typeof Int32Array !== "undefined" ? new Int32Array(4096) : new Array(4096); + for (n8 = 0; n8 != 256; ++n8) table[n8] = T10[n8]; + for (n8 = 0; n8 != 256; ++n8) { + v2 = T10[n8]; + for (c6 = 256 + n8; c6 < 4096; c6 += 256) v2 = table[c6] = v2 >>> 8 ^ T10[v2 & 255]; } var out = []; - for (n12 = 1; n12 != 16; ++n12) out[n12 - 1] = typeof Int32Array !== "undefined" ? table.subarray(n12 * 256, n12 * 256 + 256) : table.slice(n12 * 256, n12 * 256 + 256); + for (n8 = 1; n8 != 16; ++n8) out[n8 - 1] = typeof Int32Array !== "undefined" ? table.subarray(n8 * 256, n8 * 256 + 256) : table.slice(n8 * 256, n8 * 256 + 256); return out; } var TT = slice_by_16_tables(T0); @@ -67348,40 +67451,40 @@ var require_crc32 = __commonJS({ var T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9]; var Tb = TT[10], Tc = TT[11], Td = TT[12], Te2 = TT[13], Tf = TT[14]; function crc32_bstr(bstr, seed) { - var C3 = seed ^ -1; - for (var i6 = 0, L2 = bstr.length; i6 < L2; ) C3 = C3 >>> 8 ^ T0[(C3 ^ bstr.charCodeAt(i6++)) & 255]; - return ~C3; + var C2 = seed ^ -1; + for (var i6 = 0, L2 = bstr.length; i6 < L2; ) C2 = C2 >>> 8 ^ T0[(C2 ^ bstr.charCodeAt(i6++)) & 255]; + return ~C2; } - function crc32_buf(B3, seed) { - var C3 = seed ^ -1, L2 = B3.length - 15, i6 = 0; - for (; i6 < L2; ) C3 = Tf[B3[i6++] ^ C3 & 255] ^ Te2[B3[i6++] ^ C3 >> 8 & 255] ^ Td[B3[i6++] ^ C3 >> 16 & 255] ^ Tc[B3[i6++] ^ C3 >>> 24] ^ Tb[B3[i6++]] ^ Ta[B3[i6++]] ^ T9[B3[i6++]] ^ T8[B3[i6++]] ^ T7[B3[i6++]] ^ T6[B3[i6++]] ^ T5[B3[i6++]] ^ T4[B3[i6++]] ^ T3[B3[i6++]] ^ T2[B3[i6++]] ^ T1[B3[i6++]] ^ T0[B3[i6++]]; + function crc32_buf(B2, seed) { + var C2 = seed ^ -1, L2 = B2.length - 15, i6 = 0; + for (; i6 < L2; ) C2 = Tf[B2[i6++] ^ C2 & 255] ^ Te2[B2[i6++] ^ C2 >> 8 & 255] ^ Td[B2[i6++] ^ C2 >> 16 & 255] ^ Tc[B2[i6++] ^ C2 >>> 24] ^ Tb[B2[i6++]] ^ Ta[B2[i6++]] ^ T9[B2[i6++]] ^ T8[B2[i6++]] ^ T7[B2[i6++]] ^ T6[B2[i6++]] ^ T5[B2[i6++]] ^ T4[B2[i6++]] ^ T3[B2[i6++]] ^ T2[B2[i6++]] ^ T1[B2[i6++]] ^ T0[B2[i6++]]; L2 += 15; - while (i6 < L2) C3 = C3 >>> 8 ^ T0[(C3 ^ B3[i6++]) & 255]; - return ~C3; + while (i6 < L2) C2 = C2 >>> 8 ^ T0[(C2 ^ B2[i6++]) & 255]; + return ~C2; } function crc32_str(str, seed) { - var C3 = seed ^ -1; + var C2 = seed ^ -1; for (var i6 = 0, L2 = str.length, c6 = 0, d6 = 0; i6 < L2; ) { c6 = str.charCodeAt(i6++); if (c6 < 128) { - C3 = C3 >>> 8 ^ T0[(C3 ^ c6) & 255]; + C2 = C2 >>> 8 ^ T0[(C2 ^ c6) & 255]; } else if (c6 < 2048) { - C3 = C3 >>> 8 ^ T0[(C3 ^ (192 | c6 >> 6 & 31)) & 255]; - C3 = C3 >>> 8 ^ T0[(C3 ^ (128 | c6 & 63)) & 255]; + C2 = C2 >>> 8 ^ T0[(C2 ^ (192 | c6 >> 6 & 31)) & 255]; + C2 = C2 >>> 8 ^ T0[(C2 ^ (128 | c6 & 63)) & 255]; } else if (c6 >= 55296 && c6 < 57344) { c6 = (c6 & 1023) + 64; d6 = str.charCodeAt(i6++) & 1023; - C3 = C3 >>> 8 ^ T0[(C3 ^ (240 | c6 >> 8 & 7)) & 255]; - C3 = C3 >>> 8 ^ T0[(C3 ^ (128 | c6 >> 2 & 63)) & 255]; - C3 = C3 >>> 8 ^ T0[(C3 ^ (128 | d6 >> 6 & 15 | (c6 & 3) << 4)) & 255]; - C3 = C3 >>> 8 ^ T0[(C3 ^ (128 | d6 & 63)) & 255]; + C2 = C2 >>> 8 ^ T0[(C2 ^ (240 | c6 >> 8 & 7)) & 255]; + C2 = C2 >>> 8 ^ T0[(C2 ^ (128 | c6 >> 2 & 63)) & 255]; + C2 = C2 >>> 8 ^ T0[(C2 ^ (128 | d6 >> 6 & 15 | (c6 & 3) << 4)) & 255]; + C2 = C2 >>> 8 ^ T0[(C2 ^ (128 | d6 & 63)) & 255]; } else { - C3 = C3 >>> 8 ^ T0[(C3 ^ (224 | c6 >> 12 & 15)) & 255]; - C3 = C3 >>> 8 ^ T0[(C3 ^ (128 | c6 >> 6 & 63)) & 255]; - C3 = C3 >>> 8 ^ T0[(C3 ^ (128 | c6 & 63)) & 255]; + C2 = C2 >>> 8 ^ T0[(C2 ^ (224 | c6 >> 12 & 15)) & 255]; + C2 = C2 >>> 8 ^ T0[(C2 ^ (128 | c6 >> 6 & 63)) & 255]; + C2 = C2 >>> 8 ^ T0[(C2 ^ (128 | c6 & 63)) & 255]; } } - return ~C3; + return ~C2; } CRC322.table = T0; CRC322.bstr = crc32_bstr; @@ -67517,8 +67620,8 @@ var require_inspect4 = __commonJS({ "node_modules/crc32-stream/node_modules/readable-stream/lib/ours/util/inspect.js"(exports2, module) { "use strict"; module.exports = { - format(format2, ...args) { - return format2.replace(/%([sdifj])/g, function(...[_unused, type]) { + format(format4, ...args) { + return format4.replace(/%([sdifj])/g, function(...[_unused, type]) { const replacement = args.shift(); if (type === "f") { return replacement.toFixed(6); @@ -67567,7 +67670,7 @@ var require_inspect4 = __commonJS({ var require_errors6 = __commonJS({ "node_modules/crc32-stream/node_modules/readable-stream/lib/ours/errors.js"(exports2, module) { "use strict"; - var { format: format2, inspect: inspect2 } = require_inspect4(); + var { format: format4, inspect: inspect3 } = require_inspect4(); var { AggregateError: CustomAggregateError } = require_primordials4(); var AggregateError = globalThis.AggregateError || CustomAggregateError; var kIsNodeError = /* @__PURE__ */ Symbol("kIsNodeError"); @@ -67617,9 +67720,9 @@ var require_errors6 = __commonJS({ if (args.length === 0) { return msg; } - return format2(msg, ...args); + return format4(msg, ...args); } - function E2(code, message, Base) { + function E(code, message, Base) { if (!Base) { Base = Error; } @@ -67680,8 +67783,8 @@ var require_errors6 = __commonJS({ this.name = "AbortError"; } }; - E2("ERR_ASSERTION", "%s", Error); - E2( + E("ERR_ASSERTION", "%s", Error); + E( "ERR_INVALID_ARG_TYPE", (name, expected, actual) => { assert2(typeof name === "string", "'name' must be a string"); @@ -67776,13 +67879,13 @@ var require_errors6 = __commonJS({ if ((_actual$constructor = actual.constructor) !== null && _actual$constructor !== void 0 && _actual$constructor.name) { msg += `. Received an instance of ${actual.constructor.name}`; } else { - const inspected = inspect2(actual, { + const inspected = inspect3(actual, { depth: -1 }); msg += `. Received ${inspected}`; } } else { - let inspected = inspect2(actual, { + let inspected = inspect3(actual, { colors: false }); if (inspected.length > 25) { @@ -67794,10 +67897,10 @@ var require_errors6 = __commonJS({ }, TypeError ); - E2( + E( "ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => { - let inspected = inspect2(value); + let inspected = inspect3(value); if (inspected.length > 128) { inspected = inspected.slice(0, 128) + "..."; } @@ -67806,7 +67909,7 @@ var require_errors6 = __commonJS({ }, TypeError ); - E2( + E( "ERR_INVALID_RETURN_VALUE", (input, name, value) => { var _value$constructor; @@ -67815,7 +67918,7 @@ var require_errors6 = __commonJS({ }, TypeError ); - E2( + E( "ERR_MISSING_ARGS", (...args) => { assert2(args.length > 0, "At least one arg needs to be specified"); @@ -67840,7 +67943,7 @@ var require_errors6 = __commonJS({ }, TypeError ); - E2( + E( "ERR_OUT_OF_RANGE", (str, range6, input) => { assert2(range6, 'Missing "range" argument'); @@ -67855,23 +67958,23 @@ var require_errors6 = __commonJS({ } received += "n"; } else { - received = inspect2(input); + received = inspect3(input); } return `The value of "${str}" is out of range. It must be ${range6}. Received ${received}`; }, RangeError ); - E2("ERR_MULTIPLE_CALLBACK", "Callback called multiple times", Error); - E2("ERR_METHOD_NOT_IMPLEMENTED", "The %s method is not implemented", Error); - E2("ERR_STREAM_ALREADY_FINISHED", "Cannot call %s after a stream was finished", Error); - E2("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable", Error); - E2("ERR_STREAM_DESTROYED", "Cannot call %s after a stream was destroyed", Error); - E2("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); - E2("ERR_STREAM_PREMATURE_CLOSE", "Premature close", Error); - E2("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF", Error); - E2("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event", Error); - E2("ERR_STREAM_WRITE_AFTER_END", "write after end", Error); - E2("ERR_UNKNOWN_ENCODING", "Unknown encoding: %s", TypeError); + E("ERR_MULTIPLE_CALLBACK", "Callback called multiple times", Error); + E("ERR_METHOD_NOT_IMPLEMENTED", "The %s method is not implemented", Error); + E("ERR_STREAM_ALREADY_FINISHED", "Cannot call %s after a stream was finished", Error); + E("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable", Error); + E("ERR_STREAM_DESTROYED", "Cannot call %s after a stream was destroyed", Error); + E("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); + E("ERR_STREAM_PREMATURE_CLOSE", "Premature close", Error); + E("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF", Error); + E("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event", Error); + E("ERR_STREAM_WRITE_AFTER_END", "write after end", Error); + E("ERR_UNKNOWN_ENCODING", "Unknown encoding: %s", TypeError); module.exports = { AbortError: AbortError4, aggregateTwoErrors: hideStackFrames(aggregateTwoErrors), @@ -67886,7 +67989,7 @@ var require_util16 = __commonJS({ "node_modules/crc32-stream/node_modules/readable-stream/lib/ours/util.js"(exports2, module) { "use strict"; var bufferModule = __require("buffer"); - var { format: format2, inspect: inspect2 } = require_inspect4(); + var { format: format4, inspect: inspect3 } = require_inspect4(); var { codes: { ERR_INVALID_ARG_TYPE } } = require_errors6(); @@ -67925,25 +68028,25 @@ var require_util16 = __commonJS({ }; }, createDeferredPromise: function() { - let resolve4; + let resolve8; let reject2; const promise = new Promise((res, rej) => { - resolve4 = res; + resolve8 = res; reject2 = rej; }); return { promise, - resolve: resolve4, + resolve: resolve8, reject: reject2 }; }, promisify(fn) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { fn((err, ...args) => { if (err) { return reject2(err); } - return resolve4(...args); + return resolve8(...args); }); }); }, @@ -67951,8 +68054,8 @@ var require_util16 = __commonJS({ return function() { }; }, - format: format2, - inspect: inspect2, + format: format4, + inspect: inspect3, types: { isAsyncFunction(fn) { return fn instanceof AsyncFunction; @@ -68113,7 +68216,7 @@ var require_validators4 = __commonJS({ var validateOneOf = hideStackFrames((value, name, oneOf) => { if (!ArrayPrototypeIncludes(oneOf, value)) { const allowed = ArrayPrototypeJoin( - ArrayPrototypeMap(oneOf, (v8) => typeof v8 === "string" ? `'${v8}'` : String2(v8)), + ArrayPrototypeMap(oneOf, (v2) => typeof v2 === "string" ? `'${v2}'` : String2(v2)), ", " ); const reason = "must be one of: " + allowed; @@ -68727,7 +68830,7 @@ var require_end_of_stream4 = __commonJS({ validateBoolean(opts.cleanup, "cleanup"); autoCleanup = opts.cleanup; } - return new Promise2((resolve4, reject2) => { + return new Promise2((resolve8, reject2) => { const cleanup = eos(stream5, opts, (err) => { if (autoCleanup) { cleanup(); @@ -68735,7 +68838,7 @@ var require_end_of_stream4 = __commonJS({ if (err) { reject2(err); } else { - resolve4(); + resolve8(); } }); }); @@ -68759,11 +68862,11 @@ var require_destroy5 = __commonJS({ var { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils6(); var kDestroy = Symbol2("kDestroy"); var kConstruct = Symbol2("kConstruct"); - function checkError(err, w5, r6) { + function checkError(err, w, r6) { if (err) { err.stack; - if (w5 && !w5.errored) { - w5.errored = err; + if (w && !w.errored) { + w.errored = err; } if (r6 && !r6.errored) { r6.errored = err; @@ -68772,22 +68875,22 @@ var require_destroy5 = __commonJS({ } function destroy2(err, cb) { const r6 = this._readableState; - const w5 = this._writableState; - const s6 = w5 || r6; - if (w5 !== null && w5 !== void 0 && w5.destroyed || r6 !== null && r6 !== void 0 && r6.destroyed) { + const w = this._writableState; + const s = w || r6; + if (w !== null && w !== void 0 && w.destroyed || r6 !== null && r6 !== void 0 && r6.destroyed) { if (typeof cb === "function") { cb(); } return this; } - checkError(err, w5, r6); - if (w5) { - w5.destroyed = true; + checkError(err, w, r6); + if (w) { + w.destroyed = true; } if (r6) { r6.destroyed = true; } - if (!s6.constructed) { + if (!s.constructed) { this.once(kDestroy, function(er) { _destroy(this, aggregateTwoErrors(er, err), cb); }); @@ -68804,10 +68907,10 @@ var require_destroy5 = __commonJS({ } called = true; const r6 = self2._readableState; - const w5 = self2._writableState; - checkError(err2, w5, r6); - if (w5) { - w5.closed = true; + const w = self2._writableState; + checkError(err2, w, r6); + if (w) { + w.closed = true; } if (r6) { r6.closed = true; @@ -68833,25 +68936,25 @@ var require_destroy5 = __commonJS({ } function emitCloseNT(self2) { const r6 = self2._readableState; - const w5 = self2._writableState; - if (w5) { - w5.closeEmitted = true; + const w = self2._writableState; + if (w) { + w.closeEmitted = true; } if (r6) { r6.closeEmitted = true; } - if (w5 !== null && w5 !== void 0 && w5.emitClose || r6 !== null && r6 !== void 0 && r6.emitClose) { + if (w !== null && w !== void 0 && w.emitClose || r6 !== null && r6 !== void 0 && r6.emitClose) { self2.emit("close"); } } function emitErrorNT(self2, err) { const r6 = self2._readableState; - const w5 = self2._writableState; - if (w5 !== null && w5 !== void 0 && w5.errorEmitted || r6 !== null && r6 !== void 0 && r6.errorEmitted) { + const w = self2._writableState; + if (w !== null && w !== void 0 && w.errorEmitted || r6 !== null && r6 !== void 0 && r6.errorEmitted) { return; } - if (w5) { - w5.errorEmitted = true; + if (w) { + w.errorEmitted = true; } if (r6) { r6.errorEmitted = true; @@ -68860,7 +68963,7 @@ var require_destroy5 = __commonJS({ } function undestroy() { const r6 = this._readableState; - const w5 = this._writableState; + const w = this._writableState; if (r6) { r6.constructed = true; r6.closed = false; @@ -68872,32 +68975,32 @@ var require_destroy5 = __commonJS({ r6.ended = r6.readable === false; r6.endEmitted = r6.readable === false; } - if (w5) { - w5.constructed = true; - w5.destroyed = false; - w5.closed = false; - w5.closeEmitted = false; - w5.errored = null; - w5.errorEmitted = false; - w5.finalCalled = false; - w5.prefinished = false; - w5.ended = w5.writable === false; - w5.ending = w5.writable === false; - w5.finished = w5.writable === false; + if (w) { + w.constructed = true; + w.destroyed = false; + w.closed = false; + w.closeEmitted = false; + w.errored = null; + w.errorEmitted = false; + w.finalCalled = false; + w.prefinished = false; + w.ended = w.writable === false; + w.ending = w.writable === false; + w.finished = w.writable === false; } } function errorOrDestroy(stream5, err, sync2) { const r6 = stream5._readableState; - const w5 = stream5._writableState; - if (w5 !== null && w5 !== void 0 && w5.destroyed || r6 !== null && r6 !== void 0 && r6.destroyed) { + const w = stream5._writableState; + if (w !== null && w !== void 0 && w.destroyed || r6 !== null && r6 !== void 0 && r6.destroyed) { return this; } - if (r6 !== null && r6 !== void 0 && r6.autoDestroy || w5 !== null && w5 !== void 0 && w5.autoDestroy) + if (r6 !== null && r6 !== void 0 && r6.autoDestroy || w !== null && w !== void 0 && w.autoDestroy) stream5.destroy(err); else if (err) { err.stack; - if (w5 && !w5.errored) { - w5.errored = err; + if (w && !w.errored) { + w.errored = err; } if (r6 && !r6.errored) { r6.errored = err; @@ -68914,12 +69017,12 @@ var require_destroy5 = __commonJS({ return; } const r6 = stream5._readableState; - const w5 = stream5._writableState; + const w = stream5._writableState; if (r6) { r6.constructed = false; } - if (w5) { - w5.constructed = false; + if (w) { + w.constructed = false; } stream5.once(kConstruct, cb); if (stream5.listenerCount(kConstruct) > 1) { @@ -68936,15 +69039,15 @@ var require_destroy5 = __commonJS({ } called = true; const r6 = stream5._readableState; - const w5 = stream5._writableState; - const s6 = w5 || r6; + const w = stream5._writableState; + const s = w || r6; if (r6) { r6.constructed = true; } - if (w5) { - w5.constructed = true; + if (w) { + w.constructed = true; } - if (s6.destroyed) { + if (s.destroyed) { stream5.emit(kDestroy, err); } else if (err) { errorOrDestroy(stream5, err, true); @@ -69144,17 +69247,17 @@ var require_buffer_list4 = __commonJS({ "node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports2, module) { "use strict"; var { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array: Uint8Array2 } = require_primordials4(); - var { Buffer: Buffer7 } = __require("buffer"); - var { inspect: inspect2 } = require_util16(); + var { Buffer: Buffer4 } = __require("buffer"); + var { inspect: inspect3 } = require_util16(); module.exports = class BufferList { constructor() { this.head = null; this.tail = null; this.length = 0; } - push(v8) { + push(v2) { const entry = { - data: v8, + data: v2, next: null }; if (this.length > 0) this.tail.next = entry; @@ -69162,9 +69265,9 @@ var require_buffer_list4 = __commonJS({ this.tail = entry; ++this.length; } - unshift(v8) { + unshift(v2) { const entry = { - data: v8, + data: v2, next: this.head }; if (this.length === 0) this.tail = entry; @@ -69183,106 +69286,106 @@ var require_buffer_list4 = __commonJS({ this.head = this.tail = null; this.length = 0; } - join(s6) { + join(s) { if (this.length === 0) return ""; - let p6 = this.head; - let ret = "" + p6.data; - while ((p6 = p6.next) !== null) ret += s6 + p6.data; + let p2 = this.head; + let ret = "" + p2.data; + while ((p2 = p2.next) !== null) ret += s + p2.data; return ret; } - concat(n12) { - if (this.length === 0) return Buffer7.alloc(0); - const ret = Buffer7.allocUnsafe(n12 >>> 0); - let p6 = this.head; + concat(n8) { + if (this.length === 0) return Buffer4.alloc(0); + const ret = Buffer4.allocUnsafe(n8 >>> 0); + let p2 = this.head; let i6 = 0; - while (p6) { - TypedArrayPrototypeSet(ret, p6.data, i6); - i6 += p6.data.length; - p6 = p6.next; + while (p2) { + TypedArrayPrototypeSet(ret, p2.data, i6); + i6 += p2.data.length; + p2 = p2.next; } return ret; } // Consumes a specified amount of bytes or characters from the buffered data. - consume(n12, hasStrings) { + consume(n8, hasStrings) { const data = this.head.data; - if (n12 < data.length) { - const slice = data.slice(0, n12); - this.head.data = data.slice(n12); + if (n8 < data.length) { + const slice = data.slice(0, n8); + this.head.data = data.slice(n8); return slice; } - if (n12 === data.length) { + if (n8 === data.length) { return this.shift(); } - return hasStrings ? this._getString(n12) : this._getBuffer(n12); + return hasStrings ? this._getString(n8) : this._getBuffer(n8); } first() { return this.head.data; } *[SymbolIterator]() { - for (let p6 = this.head; p6; p6 = p6.next) { - yield p6.data; + for (let p2 = this.head; p2; p2 = p2.next) { + yield p2.data; } } // Consumes a specified amount of characters from the buffered data. - _getString(n12) { + _getString(n8) { let ret = ""; - let p6 = this.head; + let p2 = this.head; let c6 = 0; do { - const str = p6.data; - if (n12 > str.length) { + const str = p2.data; + if (n8 > str.length) { ret += str; - n12 -= str.length; + n8 -= str.length; } else { - if (n12 === str.length) { + if (n8 === str.length) { ret += str; ++c6; - if (p6.next) this.head = p6.next; + if (p2.next) this.head = p2.next; else this.head = this.tail = null; } else { - ret += StringPrototypeSlice(str, 0, n12); - this.head = p6; - p6.data = StringPrototypeSlice(str, n12); + ret += StringPrototypeSlice(str, 0, n8); + this.head = p2; + p2.data = StringPrototypeSlice(str, n8); } break; } ++c6; - } while ((p6 = p6.next) !== null); + } while ((p2 = p2.next) !== null); this.length -= c6; return ret; } // Consumes a specified amount of bytes from the buffered data. - _getBuffer(n12) { - const ret = Buffer7.allocUnsafe(n12); - const retLen = n12; - let p6 = this.head; + _getBuffer(n8) { + const ret = Buffer4.allocUnsafe(n8); + const retLen = n8; + let p2 = this.head; let c6 = 0; do { - const buf = p6.data; - if (n12 > buf.length) { - TypedArrayPrototypeSet(ret, buf, retLen - n12); - n12 -= buf.length; + const buf = p2.data; + if (n8 > buf.length) { + TypedArrayPrototypeSet(ret, buf, retLen - n8); + n8 -= buf.length; } else { - if (n12 === buf.length) { - TypedArrayPrototypeSet(ret, buf, retLen - n12); + if (n8 === buf.length) { + TypedArrayPrototypeSet(ret, buf, retLen - n8); ++c6; - if (p6.next) this.head = p6.next; + if (p2.next) this.head = p2.next; else this.head = this.tail = null; } else { - TypedArrayPrototypeSet(ret, new Uint8Array2(buf.buffer, buf.byteOffset, n12), retLen - n12); - this.head = p6; - p6.data = buf.slice(n12); + TypedArrayPrototypeSet(ret, new Uint8Array2(buf.buffer, buf.byteOffset, n8), retLen - n8); + this.head = p2; + p2.data = buf.slice(n8); } break; } ++c6; - } while ((p6 = p6.next) !== null); + } while ((p2 = p2.next) !== null); this.length -= c6; return ret; } // Make sure the linked list only shows the minimal necessary information. [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")](_3, options) { - return inspect2(this, { + return inspect3(this, { ...options, // Only inspect one level. depth: 0, @@ -69341,34 +69444,34 @@ var require_safe_buffer5 = __commonJS({ "node_modules/crc32-stream/node_modules/safe-buffer/index.js"(exports2, module) { "use strict"; var buffer2 = __require("buffer"); - var Buffer7 = buffer2.Buffer; + var Buffer4 = buffer2.Buffer; function copyProps(src, dst) { for (var key in src) { dst[key] = src[key]; } } - if (Buffer7.from && Buffer7.alloc && Buffer7.allocUnsafe && Buffer7.allocUnsafeSlow) { + if (Buffer4.from && Buffer4.alloc && Buffer4.allocUnsafe && Buffer4.allocUnsafeSlow) { module.exports = buffer2; } else { copyProps(buffer2, exports2); exports2.Buffer = SafeBuffer; } function SafeBuffer(arg, encodingOrOffset, length) { - return Buffer7(arg, encodingOrOffset, length); + return Buffer4(arg, encodingOrOffset, length); } - SafeBuffer.prototype = Object.create(Buffer7.prototype); - copyProps(Buffer7, SafeBuffer); + SafeBuffer.prototype = Object.create(Buffer4.prototype); + copyProps(Buffer4, SafeBuffer); SafeBuffer.from = function(arg, encodingOrOffset, length) { if (typeof arg === "number") { throw new TypeError("Argument must not be a number"); } - return Buffer7(arg, encodingOrOffset, length); + return Buffer4(arg, encodingOrOffset, length); }; SafeBuffer.alloc = function(size, fill, encoding) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } - var buf = Buffer7(size); + var buf = Buffer4(size); if (fill !== void 0) { if (typeof encoding === "string") { buf.fill(fill, encoding); @@ -69384,7 +69487,7 @@ var require_safe_buffer5 = __commonJS({ if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } - return Buffer7(size); + return Buffer4(size); }; SafeBuffer.allocUnsafeSlow = function(size) { if (typeof size !== "number") { @@ -69399,8 +69502,8 @@ var require_safe_buffer5 = __commonJS({ var require_string_decoder5 = __commonJS({ "node_modules/crc32-stream/node_modules/string_decoder/lib/string_decoder.js"(exports2) { "use strict"; - var Buffer7 = require_safe_buffer5().Buffer; - var isEncoding = Buffer7.isEncoding || function(encoding) { + var Buffer4 = require_safe_buffer5().Buffer; + var isEncoding = Buffer4.isEncoding || function(encoding) { encoding = "" + encoding; switch (encoding && encoding.toLowerCase()) { case "hex": @@ -69448,7 +69551,7 @@ var require_string_decoder5 = __commonJS({ } function normalizeEncoding(enc) { var nenc = _normalizeEncoding(enc); - if (typeof nenc !== "string" && (Buffer7.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); + if (typeof nenc !== "string" && (Buffer4.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); return nenc || enc; } exports2.StringDecoder = StringDecoder2; @@ -69477,7 +69580,7 @@ var require_string_decoder5 = __commonJS({ } this.lastNeed = 0; this.lastTotal = 0; - this.lastChar = Buffer7.allocUnsafe(nb); + this.lastChar = Buffer4.allocUnsafe(nb); } StringDecoder2.prototype.write = function(buf) { if (buf.length === 0) return ""; @@ -69536,7 +69639,7 @@ var require_string_decoder5 = __commonJS({ } return 0; } - function utf8CheckExtraBytes(self2, buf, p6) { + function utf8CheckExtraBytes(self2, buf, p2) { if ((buf[0] & 192) !== 128) { self2.lastNeed = 0; return "\uFFFD"; @@ -69555,14 +69658,14 @@ var require_string_decoder5 = __commonJS({ } } function utf8FillLast(buf) { - var p6 = this.lastTotal - this.lastNeed; - var r6 = utf8CheckExtraBytes(this, buf, p6); + var p2 = this.lastTotal - this.lastNeed; + var r6 = utf8CheckExtraBytes(this, buf, p2); if (r6 !== void 0) return r6; if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p6, 0, this.lastNeed); + buf.copy(this.lastChar, p2, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } - buf.copy(this.lastChar, p6, 0, buf.length); + buf.copy(this.lastChar, p2, 0, buf.length); this.lastNeed -= buf.length; } function utf8Text(buf, i6) { @@ -69607,17 +69710,17 @@ var require_string_decoder5 = __commonJS({ return r6; } function base64Text(buf, i6) { - var n12 = (buf.length - i6) % 3; - if (n12 === 0) return buf.toString("base64", i6); - this.lastNeed = 3 - n12; + var n8 = (buf.length - i6) % 3; + if (n8 === 0) return buf.toString("base64", i6); + this.lastNeed = 3 - n8; this.lastTotal = 3; - if (n12 === 1) { + if (n8 === 1) { this.lastChar[0] = buf[buf.length - 1]; } else { this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; } - return buf.toString("base64", i6, buf.length - n12); + return buf.toString("base64", i6, buf.length - n8); } function base64End(buf) { var r6 = buf && buf.length ? this.write(buf) : ""; @@ -69639,12 +69742,12 @@ var require_from4 = __commonJS({ "use strict"; var process5 = require_process(); var { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require_primordials4(); - var { Buffer: Buffer7 } = __require("buffer"); + var { Buffer: Buffer4 } = __require("buffer"); var { ERR_INVALID_ARG_TYPE, ERR_STREAM_NULL_VALUES } = require_errors6().codes; - function from(Readable13, iterable, opts) { + function from(Readable11, iterable, opts) { let iterator2; - if (typeof iterable === "string" || iterable instanceof Buffer7) { - return new Readable13({ + if (typeof iterable === "string" || iterable instanceof Buffer4) { + return new Readable11({ objectMode: true, ...opts, read() { @@ -69663,7 +69766,7 @@ var require_from4 = __commonJS({ } else { throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable); } - const readable = new Readable13({ + const readable = new Readable11({ objectMode: true, highWaterMark: 1, // TODO(ronag): What options should be allowed? @@ -69747,11 +69850,11 @@ var require_readable6 = __commonJS({ SymbolAsyncIterator, Symbol: Symbol2 } = require_primordials4(); - module.exports = Readable13; - Readable13.ReadableState = ReadableState; + module.exports = Readable11; + Readable11.ReadableState = ReadableState; var { EventEmitter: EE } = __require("events"); var { Stream: Stream3, prependListener } = require_legacy4(); - var { Buffer: Buffer7 } = __require("buffer"); + var { Buffer: Buffer4 } = __require("buffer"); var { addAbortSignal } = require_add_abort_signal4(); var eos = require_end_of_stream4(); var debug2 = require_util16().debuglog("stream", (fn) => { @@ -69775,8 +69878,8 @@ var require_readable6 = __commonJS({ var kPaused = Symbol2("kPaused"); var { StringDecoder: StringDecoder2 } = require_string_decoder5(); var from = require_from4(); - ObjectSetPrototypeOf(Readable13.prototype, Stream3.prototype); - ObjectSetPrototypeOf(Readable13, Stream3); + ObjectSetPrototypeOf(Readable11.prototype, Stream3.prototype); + ObjectSetPrototypeOf(Readable11, Stream3); var nop = () => { }; var { errorOrDestroy } = destroyImpl; @@ -69871,8 +69974,8 @@ var require_readable6 = __commonJS({ this.encoding = options.encoding; } } - function Readable13(options) { - if (!(this instanceof Readable13)) return new Readable13(options); + function Readable11(options) { + if (!(this instanceof Readable11)) return new Readable11(options); const isDuplex = this instanceof require_duplex4(); this._readableState = new ReadableState(options, this, isDuplex); if (options) { @@ -69888,26 +69991,26 @@ var require_readable6 = __commonJS({ } }); } - Readable13.prototype.destroy = destroyImpl.destroy; - Readable13.prototype._undestroy = destroyImpl.undestroy; - Readable13.prototype._destroy = function(err, cb) { + Readable11.prototype.destroy = destroyImpl.destroy; + Readable11.prototype._undestroy = destroyImpl.undestroy; + Readable11.prototype._destroy = function(err, cb) { cb(err); }; - Readable13.prototype[EE.captureRejectionSymbol] = function(err) { + Readable11.prototype[EE.captureRejectionSymbol] = function(err) { this.destroy(err); }; - Readable13.prototype[SymbolAsyncDispose] = function() { + Readable11.prototype[SymbolAsyncDispose] = function() { let error2; if (!this.destroyed) { error2 = this.readableEnded ? null : new AbortError4(); this.destroy(error2); } - return new Promise2((resolve4, reject2) => eos(this, (err) => err && err !== error2 ? reject2(err) : resolve4(null))); + return new Promise2((resolve8, reject2) => eos(this, (err) => err && err !== error2 ? reject2(err) : resolve8(null))); }; - Readable13.prototype.push = function(chunk, encoding) { + Readable11.prototype.push = function(chunk, encoding) { return readableAddChunk(this, chunk, encoding, false); }; - Readable13.prototype.unshift = function(chunk, encoding) { + Readable11.prototype.unshift = function(chunk, encoding) { return readableAddChunk(this, chunk, encoding, true); }; function readableAddChunk(stream5, chunk, encoding, addToFront) { @@ -69919,13 +70022,13 @@ var require_readable6 = __commonJS({ encoding = encoding || state4.defaultEncoding; if (state4.encoding !== encoding) { if (addToFront && state4.encoding) { - chunk = Buffer7.from(chunk, encoding).toString(state4.encoding); + chunk = Buffer4.from(chunk, encoding).toString(state4.encoding); } else { - chunk = Buffer7.from(chunk, encoding); + chunk = Buffer4.from(chunk, encoding); encoding = ""; } } - } else if (chunk instanceof Buffer7) { + } else if (chunk instanceof Buffer4) { encoding = ""; } else if (Stream3._isUint8Array(chunk)) { chunk = Stream3._uint8ArrayToBuffer(chunk); @@ -69981,11 +70084,11 @@ var require_readable6 = __commonJS({ } maybeReadMore(stream5, state4); } - Readable13.prototype.isPaused = function() { + Readable11.prototype.isPaused = function() { const state4 = this._readableState; return state4[kPaused] === true || state4.flowing === false; }; - Readable13.prototype.setEncoding = function(enc) { + Readable11.prototype.setEncoding = function(enc) { const decoder = new StringDecoder2(enc); this._readableState.decoder = decoder; this._readableState.encoding = this._readableState.decoder.encoding; @@ -70000,55 +70103,55 @@ var require_readable6 = __commonJS({ return this; }; var MAX_HWM = 1073741824; - function computeNewHighWaterMark(n12) { - if (n12 > MAX_HWM) { - throw new ERR_OUT_OF_RANGE("size", "<= 1GiB", n12); + function computeNewHighWaterMark(n8) { + if (n8 > MAX_HWM) { + throw new ERR_OUT_OF_RANGE("size", "<= 1GiB", n8); } else { - n12--; - n12 |= n12 >>> 1; - n12 |= n12 >>> 2; - n12 |= n12 >>> 4; - n12 |= n12 >>> 8; - n12 |= n12 >>> 16; - n12++; - } - return n12; - } - function howMuchToRead(n12, state4) { - if (n12 <= 0 || state4.length === 0 && state4.ended) return 0; + n8--; + n8 |= n8 >>> 1; + n8 |= n8 >>> 2; + n8 |= n8 >>> 4; + n8 |= n8 >>> 8; + n8 |= n8 >>> 16; + n8++; + } + return n8; + } + function howMuchToRead(n8, state4) { + if (n8 <= 0 || state4.length === 0 && state4.ended) return 0; if ((state4.state & kObjectMode) !== 0) return 1; - if (NumberIsNaN(n12)) { + if (NumberIsNaN(n8)) { if (state4.flowing && state4.length) return state4.buffer.first().length; return state4.length; } - if (n12 <= state4.length) return n12; + if (n8 <= state4.length) return n8; return state4.ended ? state4.length : 0; } - Readable13.prototype.read = function(n12) { - debug2("read", n12); - if (n12 === void 0) { - n12 = NaN; - } else if (!NumberIsInteger(n12)) { - n12 = NumberParseInt(n12, 10); + Readable11.prototype.read = function(n8) { + debug2("read", n8); + if (n8 === void 0) { + n8 = NaN; + } else if (!NumberIsInteger(n8)) { + n8 = NumberParseInt(n8, 10); } const state4 = this._readableState; - const nOrig = n12; - if (n12 > state4.highWaterMark) state4.highWaterMark = computeNewHighWaterMark(n12); - if (n12 !== 0) state4.state &= ~kEmittedReadable; - if (n12 === 0 && state4.needReadable && ((state4.highWaterMark !== 0 ? state4.length >= state4.highWaterMark : state4.length > 0) || state4.ended)) { + const nOrig = n8; + if (n8 > state4.highWaterMark) state4.highWaterMark = computeNewHighWaterMark(n8); + if (n8 !== 0) state4.state &= ~kEmittedReadable; + if (n8 === 0 && state4.needReadable && ((state4.highWaterMark !== 0 ? state4.length >= state4.highWaterMark : state4.length > 0) || state4.ended)) { debug2("read: emitReadable", state4.length, state4.ended); if (state4.length === 0 && state4.ended) endReadable(this); else emitReadable(this); return null; } - n12 = howMuchToRead(n12, state4); - if (n12 === 0 && state4.ended) { + n8 = howMuchToRead(n8, state4); + if (n8 === 0 && state4.ended) { if (state4.length === 0) endReadable(this); return null; } let doRead = (state4.state & kNeedReadable) !== 0; debug2("need readable", doRead); - if (state4.length === 0 || state4.length - n12 < state4.highWaterMark) { + if (state4.length === 0 || state4.length - n8 < state4.highWaterMark) { doRead = true; debug2("length less than watermark", doRead); } @@ -70065,16 +70168,16 @@ var require_readable6 = __commonJS({ errorOrDestroy(this, err); } state4.state &= ~kSync; - if (!state4.reading) n12 = howMuchToRead(nOrig, state4); + if (!state4.reading) n8 = howMuchToRead(nOrig, state4); } let ret; - if (n12 > 0) ret = fromList(n12, state4); + if (n8 > 0) ret = fromList(n8, state4); else ret = null; if (ret === null) { state4.needReadable = state4.length <= state4.highWaterMark; - n12 = 0; + n8 = 0; } else { - state4.length -= n12; + state4.length -= n8; if (state4.multiAwaitDrain) { state4.awaitDrainWriters.clear(); } else { @@ -70083,7 +70186,7 @@ var require_readable6 = __commonJS({ } if (state4.length === 0) { if (!state4.ended) state4.needReadable = true; - if (nOrig !== n12 && state4.ended) endReadable(this); + if (nOrig !== n8 && state4.ended) endReadable(this); } if (ret !== null && !state4.errorEmitted && !state4.closeEmitted) { state4.dataEmitted = true; @@ -70146,10 +70249,10 @@ var require_readable6 = __commonJS({ } state4.readingMore = false; } - Readable13.prototype._read = function(n12) { + Readable11.prototype._read = function(n8) { throw new ERR_METHOD_NOT_IMPLEMENTED("_read()"); }; - Readable13.prototype.pipe = function(dest, pipeOpts) { + Readable11.prototype.pipe = function(dest, pipeOpts) { const src = this; const state4 = this._readableState; if (state4.pipes.length === 1) { @@ -70226,8 +70329,8 @@ var require_readable6 = __commonJS({ unpipe(); dest.removeListener("error", onerror); if (dest.listenerCount("error") === 0) { - const s6 = dest._writableState || dest._readableState; - if (s6 && !s6.errorEmitted) { + const s = dest._writableState || dest._readableState; + if (s && !s.errorEmitted) { errorOrDestroy(dest, er); } else { dest.emit("error", er); @@ -70274,7 +70377,7 @@ var require_readable6 = __commonJS({ } }; } - Readable13.prototype.unpipe = function(dest) { + Readable11.prototype.unpipe = function(dest) { const state4 = this._readableState; const unpipeInfo = { hasUnpiped: false @@ -70297,7 +70400,7 @@ var require_readable6 = __commonJS({ dest.emit("unpipe", this, unpipeInfo); return this; }; - Readable13.prototype.on = function(ev, fn) { + Readable11.prototype.on = function(ev, fn) { const res = Stream3.prototype.on.call(this, ev, fn); const state4 = this._readableState; if (ev === "data") { @@ -70318,16 +70421,16 @@ var require_readable6 = __commonJS({ } return res; }; - Readable13.prototype.addListener = Readable13.prototype.on; - Readable13.prototype.removeListener = function(ev, fn) { + Readable11.prototype.addListener = Readable11.prototype.on; + Readable11.prototype.removeListener = function(ev, fn) { const res = Stream3.prototype.removeListener.call(this, ev, fn); if (ev === "readable") { process5.nextTick(updateReadableListening, this); } return res; }; - Readable13.prototype.off = Readable13.prototype.removeListener; - Readable13.prototype.removeAllListeners = function(ev) { + Readable11.prototype.off = Readable11.prototype.removeListener; + Readable11.prototype.removeAllListeners = function(ev) { const res = Stream3.prototype.removeAllListeners.apply(this, arguments); if (ev === "readable" || ev === void 0) { process5.nextTick(updateReadableListening, this); @@ -70349,7 +70452,7 @@ var require_readable6 = __commonJS({ debug2("readable nexttick read 0"); self2.read(0); } - Readable13.prototype.resume = function() { + Readable11.prototype.resume = function() { const state4 = this._readableState; if (!state4.flowing) { debug2("resume"); @@ -70375,7 +70478,7 @@ var require_readable6 = __commonJS({ flow(stream5); if (state4.flowing && !state4.reading) stream5.read(0); } - Readable13.prototype.pause = function() { + Readable11.prototype.pause = function() { debug2("call pause flowing=%j", this._readableState.flowing); if (this._readableState.flowing !== false) { debug2("pause"); @@ -70390,7 +70493,7 @@ var require_readable6 = __commonJS({ debug2("flow", state4.flowing); while (state4.flowing && stream5.read() !== null) ; } - Readable13.prototype.wrap = function(stream5) { + Readable11.prototype.wrap = function(stream5) { let paused = false; stream5.on("data", (chunk) => { if (!this.push(chunk) && stream5.pause) { @@ -70425,10 +70528,10 @@ var require_readable6 = __commonJS({ } return this; }; - Readable13.prototype[SymbolAsyncIterator] = function() { + Readable11.prototype[SymbolAsyncIterator] = function() { return streamToAsyncIterator(this); }; - Readable13.prototype.iterator = function(options) { + Readable11.prototype.iterator = function(options) { if (options !== void 0) { validateObject(options, "options"); } @@ -70436,7 +70539,7 @@ var require_readable6 = __commonJS({ }; function streamToAsyncIterator(stream5, options) { if (typeof stream5.read !== "function") { - stream5 = Readable13.wrap(stream5, { + stream5 = Readable11.wrap(stream5, { objectMode: true }); } @@ -70446,12 +70549,12 @@ var require_readable6 = __commonJS({ } async function* createAsyncIterator(stream5, options) { let callback = nop; - function next(resolve4) { + function next(resolve8) { if (this === stream5) { callback(); callback = nop; } else { - callback = resolve4; + callback = resolve8; } } stream5.on("readable", next); @@ -70492,7 +70595,7 @@ var require_readable6 = __commonJS({ } } } - ObjectDefineProperties(Readable13.prototype, { + ObjectDefineProperties(Readable11.prototype, { readable: { __proto__: null, get() { @@ -70619,18 +70722,18 @@ var require_readable6 = __commonJS({ } } }); - Readable13._fromList = fromList; - function fromList(n12, state4) { + Readable11._fromList = fromList; + function fromList(n8, state4) { if (state4.length === 0) return null; let ret; if (state4.objectMode) ret = state4.buffer.shift(); - else if (!n12 || n12 >= state4.length) { + else if (!n8 || n8 >= state4.length) { if (state4.decoder) ret = state4.buffer.join(""); else if (state4.buffer.length === 1) ret = state4.buffer.first(); else ret = state4.buffer.concat(state4.length); state4.buffer.clear(); } else { - ret = state4.buffer.consume(n12, state4.decoder); + ret = state4.buffer.consume(n8, state4.decoder); } return ret; } @@ -70666,23 +70769,23 @@ var require_readable6 = __commonJS({ stream5.end(); } } - Readable13.from = function(iterable, opts) { - return from(Readable13, iterable, opts); + Readable11.from = function(iterable, opts) { + return from(Readable11, iterable, opts); }; var webStreamsAdapters; function lazyWebStreams() { if (webStreamsAdapters === void 0) webStreamsAdapters = {}; return webStreamsAdapters; } - Readable13.fromWeb = function(readableStream, options) { + Readable11.fromWeb = function(readableStream, options) { return lazyWebStreams().newStreamReadableFromReadableStream(readableStream, options); }; - Readable13.toWeb = function(streamReadable, options) { + Readable11.toWeb = function(streamReadable, options) { return lazyWebStreams().newReadableStreamFromStreamReadable(streamReadable, options); }; - Readable13.wrap = function(src, options) { + Readable11.wrap = function(src, options) { var _ref, _src$readableObjectMo; - return new Readable13({ + return new Readable11({ objectMode: (_ref = (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== void 0 ? _src$readableObjectMo : src.objectMode) !== null && _ref !== void 0 ? _ref : true, ...options, destroy(err, callback) { @@ -70710,11 +70813,11 @@ var require_writable4 = __commonJS({ Symbol: Symbol2, SymbolHasInstance } = require_primordials4(); - module.exports = Writable2; - Writable2.WritableState = WritableState; + module.exports = Writable3; + Writable3.WritableState = WritableState; var { EventEmitter: EE } = __require("events"); var Stream3 = require_legacy4().Stream; - var { Buffer: Buffer7 } = __require("buffer"); + var { Buffer: Buffer4 } = __require("buffer"); var destroyImpl = require_destroy5(); var { addAbortSignal } = require_add_abort_signal4(); var { getHighWaterMark, getDefaultHighWaterMark } = require_state6(); @@ -70730,8 +70833,8 @@ var require_writable4 = __commonJS({ ERR_UNKNOWN_ENCODING } = require_errors6().codes; var { errorOrDestroy } = destroyImpl; - ObjectSetPrototypeOf(Writable2.prototype, Stream3.prototype); - ObjectSetPrototypeOf(Writable2, Stream3); + ObjectSetPrototypeOf(Writable3.prototype, Stream3.prototype); + ObjectSetPrototypeOf(Writable3, Stream3); function nop() { } var kOnFinished = Symbol2("kOnFinished"); @@ -70785,9 +70888,9 @@ var require_writable4 = __commonJS({ return this.buffered.length - this.bufferedIndex; } }); - function Writable2(options) { + function Writable3(options) { const isDuplex = this instanceof require_duplex4(); - if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable2, this)) return new Writable2(options); + if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable3, this)) return new Writable3(options); this._writableState = new WritableState(options, this, isDuplex); if (options) { if (typeof options.write === "function") this._write = options.write; @@ -70806,15 +70909,15 @@ var require_writable4 = __commonJS({ finishMaybe(this, state4); }); } - ObjectDefineProperty(Writable2, SymbolHasInstance, { + ObjectDefineProperty(Writable3, SymbolHasInstance, { __proto__: null, value: function(object) { if (FunctionPrototypeSymbolHasInstance(this, object)) return true; - if (this !== Writable2) return false; + if (this !== Writable3) return false; return object && object._writableState instanceof WritableState; } }); - Writable2.prototype.pipe = function() { + Writable3.prototype.pipe = function() { errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); }; function _write(stream5, chunk, encoding, cb) { @@ -70824,7 +70927,7 @@ var require_writable4 = __commonJS({ encoding = state4.defaultEncoding; } else { if (!encoding) encoding = state4.defaultEncoding; - else if (encoding !== "buffer" && !Buffer7.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); + else if (encoding !== "buffer" && !Buffer4.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); if (typeof cb !== "function") cb = nop; } if (chunk === null) { @@ -70832,10 +70935,10 @@ var require_writable4 = __commonJS({ } else if (!state4.objectMode) { if (typeof chunk === "string") { if (state4.decodeStrings !== false) { - chunk = Buffer7.from(chunk, encoding); + chunk = Buffer4.from(chunk, encoding); encoding = "buffer"; } - } else if (chunk instanceof Buffer7) { + } else if (chunk instanceof Buffer4) { encoding = "buffer"; } else if (Stream3._isUint8Array(chunk)) { chunk = Stream3._uint8ArrayToBuffer(chunk); @@ -70858,22 +70961,22 @@ var require_writable4 = __commonJS({ state4.pendingcb++; return writeOrBuffer(stream5, state4, chunk, encoding, cb); } - Writable2.prototype.write = function(chunk, encoding, cb) { + Writable3.prototype.write = function(chunk, encoding, cb) { return _write(this, chunk, encoding, cb) === true; }; - Writable2.prototype.cork = function() { + Writable3.prototype.cork = function() { this._writableState.corked++; }; - Writable2.prototype.uncork = function() { + Writable3.prototype.uncork = function() { const state4 = this._writableState; if (state4.corked) { state4.corked--; if (!state4.writing) clearBuffer(this, state4); } }; - Writable2.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + Writable3.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { if (typeof encoding === "string") encoding = StringPrototypeToLowerCase(encoding); - if (!Buffer7.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); + if (!Buffer4.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding); this._writableState.defaultEncoding = encoding; return this; }; @@ -70989,9 +71092,9 @@ var require_writable4 = __commonJS({ if (state4.writing) { return; } - for (let n12 = state4.bufferedIndex; n12 < state4.buffered.length; ++n12) { + for (let n8 = state4.bufferedIndex; n8 < state4.buffered.length; ++n8) { var _state$errored; - const { chunk, callback } = state4.buffered[n12]; + const { chunk, callback } = state4.buffered[n8]; const len = state4.objectMode ? 1 : chunk.length; state4.length -= len; callback( @@ -71021,8 +71124,8 @@ var require_writable4 = __commonJS({ if (bufferedLength > 1 && stream5._writev) { state4.pendingcb -= bufferedLength - 1; const callback = state4.allNoop ? nop : (err) => { - for (let n12 = i6; n12 < buffered.length; ++n12) { - buffered[n12].callback(err); + for (let n8 = i6; n8 < buffered.length; ++n8) { + buffered[n8].callback(err); } }; const chunks = state4.allNoop && i6 === 0 ? buffered : ArrayPrototypeSlice(buffered, i6); @@ -71047,7 +71150,7 @@ var require_writable4 = __commonJS({ } state4.bufferProcessing = false; } - Writable2.prototype._write = function(chunk, encoding, cb) { + Writable3.prototype._write = function(chunk, encoding, cb) { if (this._writev) { this._writev( [ @@ -71062,8 +71165,8 @@ var require_writable4 = __commonJS({ throw new ERR_METHOD_NOT_IMPLEMENTED("_write()"); } }; - Writable2.prototype._writev = null; - Writable2.prototype.end = function(chunk, encoding, cb) { + Writable3.prototype._writev = null; + Writable3.prototype.end = function(chunk, encoding, cb) { const state4 = this._writableState; if (typeof chunk === "function") { cb = chunk; @@ -71190,7 +71293,7 @@ var require_writable4 = __commonJS({ } } } - ObjectDefineProperties(Writable2.prototype, { + ObjectDefineProperties(Writable3.prototype, { closed: { __proto__: null, get() { @@ -71211,8 +71314,8 @@ var require_writable4 = __commonJS({ writable: { __proto__: null, get() { - const w5 = this._writableState; - return !!w5 && w5.writable !== false && !w5.destroyed && !w5.errored && !w5.ending && !w5.ended; + const w = this._writableState; + return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended; }, set(val) { if (this._writableState) { @@ -71286,7 +71389,7 @@ var require_writable4 = __commonJS({ } }); var destroy2 = destroyImpl.destroy; - Writable2.prototype.destroy = function(err, cb) { + Writable3.prototype.destroy = function(err, cb) { const state4 = this._writableState; if (!state4.destroyed && (state4.bufferedIndex < state4.buffered.length || state4[kOnFinished].length)) { process5.nextTick(errorBuffer, state4); @@ -71294,11 +71397,11 @@ var require_writable4 = __commonJS({ destroy2.call(this, err, cb); return this; }; - Writable2.prototype._undestroy = destroyImpl.undestroy; - Writable2.prototype._destroy = function(err, cb) { + Writable3.prototype._undestroy = destroyImpl.undestroy; + Writable3.prototype._destroy = function(err, cb) { cb(err); }; - Writable2.prototype[EE.captureRejectionSymbol] = function(err) { + Writable3.prototype[EE.captureRejectionSymbol] = function(err) { this.destroy(err); }; var webStreamsAdapters; @@ -71306,10 +71409,10 @@ var require_writable4 = __commonJS({ if (webStreamsAdapters === void 0) webStreamsAdapters = {}; return webStreamsAdapters; } - Writable2.fromWeb = function(writableStream, options) { + Writable3.fromWeb = function(writableStream, options) { return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options); }; - Writable2.toWeb = function(streamWritable) { + Writable3.toWeb = function(streamWritable) { return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable); }; } @@ -71339,8 +71442,8 @@ var require_duplexify4 = __commonJS({ } = require_errors6(); var { destroyer } = require_destroy5(); var Duplex = require_duplex4(); - var Readable13 = require_readable6(); - var Writable2 = require_writable4(); + var Readable11 = require_readable6(); + var Writable3 = require_writable4(); var { createDeferredPromise } = require_util16(); var from = require_from4(); var Blob3 = globalThis.Blob || bufferModule.Blob; @@ -71389,12 +71492,12 @@ var require_duplexify4 = __commonJS({ } if (isReadableStream4(body2)) { return _duplexify({ - readable: Readable13.fromWeb(body2) + readable: Readable11.fromWeb(body2) }); } if (isWritableStream(body2)) { return _duplexify({ - writable: Writable2.fromWeb(body2) + writable: Writable3.fromWeb(body2) }); } if (typeof body2 === "function") { @@ -71504,7 +71607,7 @@ var require_duplexify4 = __commonJS({ ); }; function fromAsyncGen(fn) { - let { promise, resolve: resolve4 } = createDeferredPromise(); + let { promise, resolve: resolve8 } = createDeferredPromise(); const ac = new AbortController2(); const signal = ac.signal; const value = fn( @@ -71519,7 +71622,7 @@ var require_duplexify4 = __commonJS({ throw new AbortError4(void 0, { cause: signal.reason }); - ({ promise, resolve: resolve4 } = createDeferredPromise()); + ({ promise, resolve: resolve8 } = createDeferredPromise()); yield chunk; } })(), @@ -71530,8 +71633,8 @@ var require_duplexify4 = __commonJS({ return { value, write(chunk, encoding, cb) { - const _resolve = resolve4; - resolve4 = null; + const _resolve = resolve8; + resolve8 = null; _resolve({ chunk, done: false, @@ -71539,8 +71642,8 @@ var require_duplexify4 = __commonJS({ }); }, final(cb) { - const _resolve = resolve4; - resolve4 = null; + const _resolve = resolve8; + resolve8 = null; _resolve({ done: true, cb @@ -71553,10 +71656,10 @@ var require_duplexify4 = __commonJS({ }; } function _duplexify(pair) { - const r6 = pair.readable && typeof pair.readable.read !== "function" ? Readable13.wrap(pair.readable) : pair.readable; - const w5 = pair.writable; + const r6 = pair.readable && typeof pair.readable.read !== "function" ? Readable11.wrap(pair.readable) : pair.readable; + const w = pair.writable; let readable = !!isReadable2(r6); - let writable = !!isWritable2(w5); + let writable = !!isWritable2(w); let ondrain; let onfinish; let onreadable; @@ -71574,12 +71677,12 @@ var require_duplexify4 = __commonJS({ d6 = new Duplexify({ // TODO (ronag): highWaterMark? readableObjectMode: !!(r6 !== null && r6 !== void 0 && r6.readableObjectMode), - writableObjectMode: !!(w5 !== null && w5 !== void 0 && w5.writableObjectMode), + writableObjectMode: !!(w !== null && w !== void 0 && w.writableObjectMode), readable, writable }); if (writable) { - eos(w5, (err) => { + eos(w, (err) => { writable = false; if (err) { destroyer(r6, err); @@ -71587,24 +71690,24 @@ var require_duplexify4 = __commonJS({ onfinished(err); }); d6._write = function(chunk, encoding, callback) { - if (w5.write(chunk, encoding)) { + if (w.write(chunk, encoding)) { callback(); } else { ondrain = callback; } }; d6._final = function(callback) { - w5.end(); + w.end(); onfinish = callback; }; - w5.on("drain", function() { + w.on("drain", function() { if (ondrain) { const cb = ondrain; ondrain = null; cb(); } }); - w5.on("finish", function() { + w.on("finish", function() { if (onfinish) { const cb = onfinish; onfinish = null; @@ -71654,7 +71757,7 @@ var require_duplexify4 = __commonJS({ callback(err); } else { onclose = callback; - destroyer(w5, err); + destroyer(w, err); destroyer(r6, err); } }; @@ -71674,21 +71777,21 @@ var require_duplex4 = __commonJS({ ObjectSetPrototypeOf } = require_primordials4(); module.exports = Duplex; - var Readable13 = require_readable6(); - var Writable2 = require_writable4(); - ObjectSetPrototypeOf(Duplex.prototype, Readable13.prototype); - ObjectSetPrototypeOf(Duplex, Readable13); + var Readable11 = require_readable6(); + var Writable3 = require_writable4(); + ObjectSetPrototypeOf(Duplex.prototype, Readable11.prototype); + ObjectSetPrototypeOf(Duplex, Readable11); { - const keys = ObjectKeys(Writable2.prototype); + const keys = ObjectKeys(Writable3.prototype); for (let i6 = 0; i6 < keys.length; i6++) { const method = keys[i6]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable2.prototype[method]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable3.prototype[method]; } } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); - Readable13.call(this, options); - Writable2.call(this, options); + Readable11.call(this, options); + Writable3.call(this, options); if (options) { this.allowHalfOpen = options.allowHalfOpen !== false; if (options.readable === false) { @@ -71709,39 +71812,39 @@ var require_duplex4 = __commonJS({ ObjectDefineProperties(Duplex.prototype, { writable: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writable") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writable") }, writableHighWaterMark: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableHighWaterMark") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableHighWaterMark") }, writableObjectMode: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableObjectMode") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableObjectMode") }, writableBuffer: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableBuffer") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableBuffer") }, writableLength: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableLength") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableLength") }, writableFinished: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableFinished") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableFinished") }, writableCorked: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableCorked") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableCorked") }, writableEnded: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableEnded") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableEnded") }, writableNeedDrain: { __proto__: null, - ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableNeedDrain") + ...ObjectGetOwnPropertyDescriptor(Writable3.prototype, "writableNeedDrain") }, destroyed: { __proto__: null, @@ -71935,7 +72038,7 @@ var require_pipeline4 = __commonJS({ } = require_utils6(); var AbortController2 = globalThis.AbortController || require_abort_controller().AbortController; var PassThrough5; - var Readable13; + var Readable11; var addAbortListener; function destroyer(stream5, reading, writing) { let finished = false; @@ -71974,10 +72077,10 @@ var require_pipeline4 = __commonJS({ throw new ERR_INVALID_ARG_TYPE("val", ["Readable", "Iterable", "AsyncIterable"], val); } async function* fromReadable(val) { - if (!Readable13) { - Readable13 = require_readable6(); + if (!Readable11) { + Readable11 = require_readable6(); } - yield* Readable13.prototype[SymbolAsyncIterator].call(val); + yield* Readable11.prototype[SymbolAsyncIterator].call(val); } async function pumpToNode(iterable, writable, finish, { end }) { let error2; @@ -71992,7 +72095,7 @@ var require_pipeline4 = __commonJS({ callback(); } }; - const wait = () => new Promise2((resolve4, reject2) => { + const wait = () => new Promise2((resolve8, reject2) => { if (error2) { reject2(error2); } else { @@ -72000,7 +72103,7 @@ var require_pipeline4 = __commonJS({ if (error2) { reject2(error2); } else { - resolve4(); + resolve8(); } }; } @@ -72366,15 +72469,15 @@ var require_compose4 = __commonJS({ const idx = streams.length - 1; streams[idx] = Duplex.from(streams[idx]); } - for (let n12 = 0; n12 < streams.length; ++n12) { - if (!isNodeStream(streams[n12]) && !isWebStream(streams[n12])) { + for (let n8 = 0; n8 < streams.length; ++n8) { + if (!isNodeStream(streams[n8]) && !isWebStream(streams[n8])) { continue; } - if (n12 < streams.length - 1 && !(isReadable2(streams[n12]) || isReadableStream4(streams[n12]) || isTransformStream(streams[n12]))) { - throw new ERR_INVALID_ARG_VALUE(`streams[${n12}]`, orgStreams[n12], "must be readable"); + if (n8 < streams.length - 1 && !(isReadable2(streams[n8]) || isReadableStream4(streams[n8]) || isTransformStream(streams[n8]))) { + throw new ERR_INVALID_ARG_VALUE(`streams[${n8}]`, orgStreams[n8], "must be readable"); } - if (n12 > 0 && !(isWritable2(streams[n12]) || isWritableStream(streams[n12]) || isTransformStream(streams[n12]))) { - throw new ERR_INVALID_ARG_VALUE(`streams[${n12}]`, orgStreams[n12], "must be writable"); + if (n8 > 0 && !(isWritable2(streams[n8]) || isWritableStream(streams[n8]) || isTransformStream(streams[n8]))) { + throw new ERR_INVALID_ARG_VALUE(`streams[${n8}]`, orgStreams[n8], "must be writable"); } } let ondrain; @@ -72644,8 +72747,8 @@ var require_operators4 = __commonJS({ next = null; } if (!done && (queue2.length >= highWaterMark || cnt >= concurrency)) { - await new Promise2((resolve4) => { - resume = resolve4; + await new Promise2((resolve8) => { + resume = resolve8; }); } } @@ -72679,8 +72782,8 @@ var require_operators4 = __commonJS({ queue2.shift(); maybeResume(); } - await new Promise2((resolve4) => { - next = resolve4; + await new Promise2((resolve8) => { + next = resolve8; }); } } finally { @@ -72938,7 +73041,7 @@ var require_promises4 = __commonJS({ var { finished } = require_end_of_stream4(); require_stream5(); function pipeline2(...streams) { - return new Promise2((resolve4, reject2) => { + return new Promise2((resolve8, reject2) => { let signal; let end; const lastArg = streams[streams.length - 1]; @@ -72953,7 +73056,7 @@ var require_promises4 = __commonJS({ if (err) { reject2(err); } else { - resolve4(value); + resolve8(value); } }, { @@ -72974,7 +73077,7 @@ var require_promises4 = __commonJS({ var require_stream5 = __commonJS({ "node_modules/crc32-stream/node_modules/readable-stream/lib/stream.js"(exports2, module) { "use strict"; - var { Buffer: Buffer7 } = __require("buffer"); + var { Buffer: Buffer4 } = __require("buffer"); var { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials4(); var { promisify: { custom: customPromisify } @@ -73084,7 +73187,7 @@ var require_stream5 = __commonJS({ return value instanceof Uint8Array; }; Stream3._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) { - return Buffer7.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); + return Buffer4.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); }; } }); @@ -73327,19 +73430,19 @@ var require_zip_archive_output_stream = __commonJS({ }); source.pipe(smart); }; - ZipArchiveOutputStream.prototype._defaults = function(o6) { - if (typeof o6 !== "object") { - o6 = {}; + ZipArchiveOutputStream.prototype._defaults = function(o2) { + if (typeof o2 !== "object") { + o2 = {}; } - if (typeof o6.zlib !== "object") { - o6.zlib = {}; + if (typeof o2.zlib !== "object") { + o2.zlib = {}; } - if (typeof o6.zlib.level !== "number") { - o6.zlib.level = constants4.ZLIB_BEST_SPEED; + if (typeof o2.zlib.level !== "number") { + o2.zlib.level = constants4.ZLIB_BEST_SPEED; } - o6.forceZip64 = !!o6.forceZip64; - o6.forceLocalTime = !!o6.forceLocalTime; - return o6; + o2.forceZip64 = !!o2.forceZip64; + o2.forceLocalTime = !!o2.forceLocalTime; + return o2; }; ZipArchiveOutputStream.prototype._finish = function() { this._archive.centralOffset = this.offset; @@ -73979,13 +74082,13 @@ var require_utf8_decoder = __commonJS({ decode(data) { if (this.bytesNeeded === 0) { let isBoundary = true; - for (let i6 = Math.max(0, data.byteLength - 4), n12 = data.byteLength; i6 < n12 && isBoundary; i6++) { + for (let i6 = Math.max(0, data.byteLength - 4), n8 = data.byteLength; i6 < n8 && isBoundary; i6++) { isBoundary = data[i6] <= 127; } if (isBoundary) return b4a.toString(data, "utf8"); } let result = ""; - for (let i6 = 0, n12 = data.byteLength; i6 < n12; i6++) { + for (let i6 = 0, n8 = data.byteLength; i6 < n8; i6++) { const byte = data[i6]; if (this.bytesNeeded === 0) { if (byte <= 127) { @@ -74663,7 +74766,7 @@ var require_streamx = __commonJS({ } } }; - var Readable13 = class _Readable extends Stream3 { + var Readable11 = class _Readable extends Stream3 { constructor(opts) { super(opts); this._duplexState |= OPENING | WRITE_DONE | READ_READ_AHEAD; @@ -74714,15 +74817,15 @@ var require_streamx = __commonJS({ this._duplexState &= this._readableState.readAhead === false ? READ_PAUSED_NO_READ_AHEAD : READ_PAUSED; return this; } - static _fromAsyncIterator(ite, opts) { + static _fromAsyncIterator(ite2, opts) { let destroy2; const rs2 = new _Readable({ ...opts, read(cb) { - ite.next().then(push).then(cb.bind(null, null)).catch(cb); + ite2.next().then(push).then(cb.bind(null, null)).catch(cb); }, predestroy() { - destroy2 = ite.return(); + destroy2 = ite2.return(); }, destroy(cb) { if (!destroy2) return cb(null); @@ -74769,8 +74872,8 @@ var require_streamx = __commonJS({ return this; }, next() { - return new Promise(function(resolve4, reject2) { - promiseResolve = resolve4; + return new Promise(function(resolve8, reject2) { + promiseResolve = resolve8; promiseReject = reject2; const data = stream5.read(); if (data !== null) ondata(data); @@ -74799,17 +74902,17 @@ var require_streamx = __commonJS({ } function destroy2(err) { stream5.destroy(err); - return new Promise((resolve4, reject2) => { - if (stream5._duplexState & DESTROYED2) return resolve4({ value: void 0, done: true }); + return new Promise((resolve8, reject2) => { + if (stream5._duplexState & DESTROYED2) return resolve8({ value: void 0, done: true }); stream5.once("close", function() { if (err) reject2(err); - else resolve4({ value: void 0, done: true }); + else resolve8({ value: void 0, done: true }); }); }); } } }; - var Writable2 = class extends Stream3 { + var Writable3 = class extends Stream3 { constructor(opts) { super(opts); this._duplexState |= OPENING | READ_DONE; @@ -74847,8 +74950,8 @@ var require_streamx = __commonJS({ const writes = pending + (ws2._duplexState & WRITE_WRITING ? 1 : 0); if (writes === 0) return Promise.resolve(true); if (state4.drains === null) state4.drains = []; - return new Promise((resolve4) => { - state4.drains.push({ writes, resolve: resolve4 }); + return new Promise((resolve8) => { + state4.drains.push({ writes, resolve: resolve8 }); }); } write(data) { @@ -74861,7 +74964,7 @@ var require_streamx = __commonJS({ return this; } }; - var Duplex = class extends Readable13 { + var Duplex = class extends Readable11 { // and Writable constructor(opts) { super(opts); @@ -74953,10 +75056,10 @@ var require_streamx = __commonJS({ cb(null); } function pipelinePromise(...streams) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { return pipeline2(...streams, (err) => { if (err) return reject2(err); - resolve4(); + resolve8(); }); }); } @@ -74992,24 +75095,24 @@ var require_streamx = __commonJS({ } } return dest; - function errorHandle(s6, rd, wr, onerror2) { - s6.on("error", onerror2); - s6.on("close", onclose); + function errorHandle(s, rd, wr, onerror2) { + s.on("error", onerror2); + s.on("close", onclose); function onclose() { - if (rd && s6._readableState && !s6._readableState.ended) return onerror2(PREMATURE_CLOSE); - if (wr && s6._writableState && !s6._writableState.ended) return onerror2(PREMATURE_CLOSE); + if (rd && s._readableState && !s._readableState.ended) return onerror2(PREMATURE_CLOSE); + if (wr && s._writableState && !s._writableState.ended) return onerror2(PREMATURE_CLOSE); } } function onerror(err) { if (!err || error2) return; error2 = err; - for (const s6 of all) { - s6.destroy(err); + for (const s of all) { + s.destroy(err); } } } - function echo(s6) { - return s6; + function echo(s) { + return s; } function isStream2(stream5) { return !!stream5._readableState || !!stream5._writableState; @@ -75044,8 +75147,8 @@ var require_streamx = __commonJS({ function abort() { this.destroy(new Error("Stream aborted.")); } - function isWritev(s6) { - return s6._writev !== Writable2.prototype._writev && s6._writev !== Duplex.prototype._writev; + function isWritev(s) { + return s._writev !== Writable3.prototype._writev && s._writev !== Duplex.prototype._writev; } module.exports = { pipeline: pipeline2, @@ -75057,8 +75160,8 @@ var require_streamx = __commonJS({ isDisturbed, getStreamError, Stream: Stream3, - Writable: Writable2, - Readable: Readable13, + Writable: Writable3, + Readable: Readable11, Duplex, Transform: Transform4, // Export PassThrough for compatibility with Node.js core's stream module @@ -75266,10 +75369,10 @@ var require_headers3 = __commonJS({ for (let j7 = 156; j7 < 512; j7++) sum += block[j7]; return sum; } - function encodeOct(val, n12) { + function encodeOct(val, n8) { val = val.toString(8); - if (val.length > n12) return SEVENS.slice(0, n12) + " "; - return ZEROS.slice(0, n12 - val.length) + val + " "; + if (val.length > n8) return SEVENS.slice(0, n8) + " "; + return ZEROS.slice(0, n8 - val.length) + val + " "; } function encodeSizeBin(num, buf, off) { buf[off] = 128; @@ -75298,8 +75401,8 @@ var require_headers3 = __commonJS({ else tuple.push(255 - byte); } let sum = 0; - const l6 = tuple.length; - for (i6 = 0; i6 < l6; i6++) { + const l3 = tuple.length; + for (i6 = 0; i6 < l3; i6++) { sum += tuple[i6] * Math.pow(256, i6); } return positive ? sum : -1 * sum; @@ -75333,7 +75436,7 @@ var require_headers3 = __commonJS({ var require_extract = __commonJS({ "node_modules/tar-stream/extract.js"(exports2, module) { "use strict"; - var { Writable: Writable2, Readable: Readable13, getStreamError } = require_streamx(); + var { Writable: Writable3, Readable: Readable11, getStreamError } = require_streamx(); var FIFO = require_fast_fifo(); var b4a = require_b4a(); var headers = require_headers3(); @@ -75380,7 +75483,7 @@ var require_extract = __commonJS({ return buf.subarray(this._offset, this._offset += size); } }; - var Source = class extends Readable13 { + var Source = class extends Readable11 { constructor(self2, header, offset) { super(); this.header = header; @@ -75411,7 +75514,7 @@ var require_extract = __commonJS({ cb(null); } }; - var Extract = class extends Writable2 { + var Extract = class extends Writable3 { constructor(opts) { super(opts); if (!opts) opts = {}; @@ -75605,16 +75708,16 @@ var require_extract = __commonJS({ entryCallback = null; cb(err); } - function onnext(resolve4, reject2) { + function onnext(resolve8, reject2) { if (error2) { return reject2(error2); } if (entryStream) { - resolve4({ value: entryStream, done: false }); + resolve8({ value: entryStream, done: false }); entryStream = null; return; } - promiseResolve = resolve4; + promiseResolve = resolve8; promiseReject = reject2; consumeCallback(null); if (extract._finished && promiseResolve) { @@ -75642,11 +75745,11 @@ var require_extract = __commonJS({ function destroy2(err) { extract.destroy(err); consumeCallback(err); - return new Promise((resolve4, reject2) => { - if (extract.destroyed) return resolve4({ value: void 0, done: true }); + return new Promise((resolve8, reject2) => { + if (extract.destroyed) return resolve8({ value: void 0, done: true }); extract.once("close", function() { if (err) reject2(err); - else resolve4({ value: void 0, done: true }); + else resolve8({ value: void 0, done: true }); }); }); } @@ -75689,14 +75792,14 @@ var require_constants8 = __commonJS({ var require_pack = __commonJS({ "node_modules/tar-stream/pack.js"(exports2, module) { "use strict"; - var { Readable: Readable13, Writable: Writable2, getStreamError } = require_streamx(); + var { Readable: Readable11, Writable: Writable3, getStreamError } = require_streamx(); var b4a = require_b4a(); var constants4 = require_constants8(); var headers = require_headers3(); var DMODE = 493; var FMODE = 420; var END_OF_TAR = b4a.alloc(1024); - var Sink = class extends Writable2 { + var Sink = class extends Writable3 { constructor(pack, header, callback) { super({ mapWritable, eagerOpen: true }); this.written = 0; @@ -75782,7 +75885,7 @@ var require_pack = __commonJS({ cb(); } }; - var Pack = class extends Readable13 { + var Pack = class extends Readable11 { constructor(opts) { super(opts); this._drain = noop3; @@ -76012,8 +76115,8 @@ var require_tar = __commonJS({ var require_dist4 = __commonJS({ "node_modules/buffer-crc32/dist/index.cjs"(exports2, module) { "use strict"; - function getDefaultExportFromCjs(x6) { - return x6 && x6.__esModule && Object.prototype.hasOwnProperty.call(x6, "default") ? x6["default"] : x6; + function getDefaultExportFromCjs(x2) { + return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2; } var CRC_TABLE = new Int32Array([ 0, @@ -76296,8 +76399,8 @@ var require_dist4 = __commonJS({ previous = previous.readUInt32BE(0); } let crc = ~~previous ^ -1; - for (var n12 = 0; n12 < buf.length; n12++) { - crc = CRC_TABLE[(crc ^ buf[n12]) & 255] ^ crc >>> 8; + for (var n8 = 0; n8 < buf.length; n8++) { + crc = CRC_TABLE[(crc ^ buf[n8]) & 255] ^ crc >>> 8; } return crc ^ -1; } @@ -76377,33 +76480,33 @@ var require_archiver = __commonJS({ "use strict"; var Archiver = require_core(); var formats = {}; - var vending = function(format2, options) { - return vending.create(format2, options); - }; - vending.create = function(format2, options) { - if (formats[format2]) { - var instance = new Archiver(format2, options); - instance.setFormat(format2); - instance.setModule(new formats[format2](options)); + var vending = function(format4, options) { + return vending.create(format4, options); + }; + vending.create = function(format4, options) { + if (formats[format4]) { + var instance = new Archiver(format4, options); + instance.setFormat(format4); + instance.setModule(new formats[format4](options)); return instance; } else { - throw new Error("create(" + format2 + "): format not registered"); + throw new Error("create(" + format4 + "): format not registered"); } }; - vending.registerFormat = function(format2, module2) { - if (formats[format2]) { - throw new Error("register(" + format2 + "): format already registered"); + vending.registerFormat = function(format4, module2) { + if (formats[format4]) { + throw new Error("register(" + format4 + "): format already registered"); } if (typeof module2 !== "function") { - throw new Error("register(" + format2 + "): format module invalid"); + throw new Error("register(" + format4 + "): format module invalid"); } if (typeof module2.prototype.append !== "function" || typeof module2.prototype.finalize !== "function") { - throw new Error("register(" + format2 + "): format module missing methods"); + throw new Error("register(" + format4 + "): format module missing methods"); } - formats[format2] = module2; + formats[format4] = module2; }; - vending.isRegisteredFormat = function(format2) { - if (formats[format2]) { + vending.isRegisteredFormat = function(format4) { + if (formats[format4]) { return true; } return false; @@ -76456,9 +76559,9 @@ var require_traverse = __commonJS({ Traverse.prototype.reduce = function(cb, init) { var skip = arguments.length === 1; var acc = skip ? this.value : init; - this.forEach(function(x6) { + this.forEach(function(x2) { if (!this.isRoot || !skip) { - acc = cb.call(this, acc, x6); + acc = cb.call(this, acc, x2); } }); return acc; @@ -76471,7 +76574,7 @@ var require_traverse = __commonJS({ } var equal = true; var node = obj; - this.forEach(function(y2) { + this.forEach(function(y) { var notEqual = (function() { equal = false; return void 0; @@ -76480,42 +76583,42 @@ var require_traverse = __commonJS({ if (typeof node !== "object") return notEqual(); node = node[this.key]; } - var x6 = node; + var x2 = node; this.post(function() { - node = x6; + node = x2; }); - var toS = function(o6) { - return Object.prototype.toString.call(o6); + var toS = function(o2) { + return Object.prototype.toString.call(o2); }; if (this.circular) { - if (Traverse(obj).get(this.circular.path) !== x6) notEqual(); - } else if (typeof x6 !== typeof y2) { + if (Traverse(obj).get(this.circular.path) !== x2) notEqual(); + } else if (typeof x2 !== typeof y) { notEqual(); - } else if (x6 === null || y2 === null || x6 === void 0 || y2 === void 0) { - if (x6 !== y2) notEqual(); - } else if (x6.__proto__ !== y2.__proto__) { + } else if (x2 === null || y === null || x2 === void 0 || y === void 0) { + if (x2 !== y) notEqual(); + } else if (x2.__proto__ !== y.__proto__) { notEqual(); - } else if (x6 === y2) { - } else if (typeof x6 === "function") { - if (x6 instanceof RegExp) { - if (x6.toString() != y2.toString()) notEqual(); - } else if (x6 !== y2) notEqual(); - } else if (typeof x6 === "object") { - if (toS(y2) === "[object Arguments]" || toS(x6) === "[object Arguments]") { - if (toS(x6) !== toS(y2)) { + } else if (x2 === y) { + } else if (typeof x2 === "function") { + if (x2 instanceof RegExp) { + if (x2.toString() != y.toString()) notEqual(); + } else if (x2 !== y) notEqual(); + } else if (typeof x2 === "object") { + if (toS(y) === "[object Arguments]" || toS(x2) === "[object Arguments]") { + if (toS(x2) !== toS(y)) { notEqual(); } - } else if (x6 instanceof Date || y2 instanceof Date) { - if (!(x6 instanceof Date) || !(y2 instanceof Date) || x6.getTime() !== y2.getTime()) { + } else if (x2 instanceof Date || y instanceof Date) { + if (!(x2 instanceof Date) || !(y instanceof Date) || x2.getTime() !== y.getTime()) { notEqual(); } } else { - var kx = Object.keys(x6); - var ky = Object.keys(y2); + var kx = Object.keys(x2); + var ky = Object.keys(y); if (kx.length !== ky.length) return notEqual(); for (var i6 = 0; i6 < kx.length; i6++) { var k7 = kx[i6]; - if (!Object.hasOwnProperty.call(y2, k7)) { + if (!Object.hasOwnProperty.call(y, k7)) { notEqual(); } } @@ -76526,42 +76629,42 @@ var require_traverse = __commonJS({ }; Traverse.prototype.paths = function() { var acc = []; - this.forEach(function(x6) { + this.forEach(function(x2) { acc.push(this.path); }); return acc; }; Traverse.prototype.nodes = function() { var acc = []; - this.forEach(function(x6) { + this.forEach(function(x2) { acc.push(this.node); }); return acc; }; Traverse.prototype.clone = function() { - var parents = [], nodes = []; + var parents = [], nodes6 = []; return (function clone2(src) { for (var i6 = 0; i6 < parents.length; i6++) { if (parents[i6] === src) { - return nodes[i6]; + return nodes6[i6]; } } if (typeof src === "object" && src !== null) { var dst = copy(src); parents.push(src); - nodes.push(dst); + nodes6.push(dst); Object.keys(src).forEach(function(key) { dst[key] = clone2(src[key]); }); parents.pop(); - nodes.pop(); + nodes6.pop(); return dst; } else { return src; } })(this.value); }; - function walk(root, cb, immutable) { + function walk(root6, cb, immutable) { var path10 = []; var parents = []; var alive = true; @@ -76577,11 +76680,11 @@ var require_traverse = __commonJS({ isRoot: path10.length === 0, level: path10.length, circular: null, - update: function(x6) { + update: function(x2) { if (!state4.isRoot) { - state4.parent.node[state4.key] = x6; + state4.parent.node[state4.key] = x2; } - state4.node = x6; + state4.node = x2; }, "delete": function() { delete state4.parent.node[state4.key]; @@ -76645,13 +76748,13 @@ var require_traverse = __commonJS({ } if (modifiers.after) modifiers.after.call(state4, state4.node); return state4; - })(root).node; + })(root6).node; } Object.keys(Traverse.prototype).forEach(function(key) { Traverse[key] = function(obj) { var args = [].slice.call(arguments, 1); - var t6 = Traverse(obj); - return t6[key].apply(t6, args); + var t = Traverse(obj); + return t[key].apply(t, args); }; }); function copy(src) { @@ -76745,14 +76848,14 @@ var require_chainsaw = __commonJS({ var autonext = cb; cb = args.shift(); } - var s6 = Chainsaw.saw(builder, {}); - var r6 = builder.call(s6.handlers, s6); - if (r6 !== void 0) s6.handlers = r6; + var s = Chainsaw.saw(builder, {}); + var r6 = builder.call(s.handlers, s); + if (r6 !== void 0) s.handlers = r6; if ("undefined" !== typeof saw.step) { - s6.record(); + s.record(); } - cb.apply(s6.chain(), args); - if (autonext !== false) s6.on("end", saw.next); + cb.apply(s.chain(), args); + if (autonext !== false) s.on("end", saw.next); }; saw.record = function() { upgradeChainsaw(saw); @@ -76780,9 +76883,9 @@ var require_chainsaw = __commonJS({ }; saw.down = function(name) { var ps2 = (Array.isArray(name) ? name : [name]).join("/"); - var i6 = saw.actions.slice(saw.step).map(function(x6) { - if (x6.trap && x6.step <= saw.step) return false; - return x6.path.join("/") == ps2; + var i6 = saw.actions.slice(saw.step).map(function(x2) { + if (x2.trap && x2.step <= saw.step) return false; + return x2.path.join("/") == ps2; }).indexOf(true); if (i6 >= 0) saw.step += i6; else saw.step = saw.actions.length; @@ -76930,13 +77033,13 @@ var require_buffers = __commonJS({ }; Buffers.prototype.pos = function(i6) { if (i6 < 0 || i6 >= this.length) throw new Error("oob"); - var l6 = i6, bi2 = 0, bu = null; + var l3 = i6, bi2 = 0, bu = null; for (; ; ) { bu = this.buffers[bi2]; - if (l6 < bu.length) { - return { buf: bi2, offset: l6 }; + if (l3 < bu.length) { + return { buf: bi2, offset: l3 }; } else { - l6 -= bu.length; + l3 -= bu.length; } bi2++; } @@ -76964,9 +77067,9 @@ var require_buffers = __commonJS({ } var i6 = 0, j7 = 0, match3 = 0, mstart, pos = 0; if (offset) { - var p6 = this.pos(offset); - i6 = p6.buf; - j7 = p6.offset; + var p2 = this.pos(offset); + i6 = p2.buf; + j7 = p2.offset; pos = offset; } for (; ; ) { @@ -77055,18 +77158,18 @@ var require_binary = __commonJS({ if (Buffer.isBuffer(bufOrEm)) { return exports2.parse(bufOrEm); } - var s6 = exports2.stream(); + var s = exports2.stream(); if (bufOrEm && bufOrEm.pipe) { - bufOrEm.pipe(s6); + bufOrEm.pipe(s); } else if (bufOrEm) { bufOrEm.on(eventName || "data", function(buf) { - s6.write(buf); + s.write(buf); }); bufOrEm.on("end", function() { - s6.end(); + s.end(); }); } - return s6; + return s; }; exports2.stream = function(input) { if (input) return exports2.apply(null, arguments); @@ -77238,7 +77341,7 @@ var require_binary = __commonJS({ }); return stream5; }; - exports2.parse = function parse4(buffer2) { + exports2.parse = function parse3(buffer2) { var self2 = words(function(bytes, cb) { return function(name) { if (offset + bytes <= buffer2.length) { @@ -77379,8 +77482,8 @@ var require_matcher_stream = __commonJS({ return new MatcherStream(); } Transform4.call(this); - var p6 = typeof patternDesc === "object" ? patternDesc.pattern : patternDesc; - this.pattern = Buffer.isBuffer(p6) ? p6 : Buffer.from(p6); + var p2 = typeof patternDesc === "object" ? patternDesc.pattern : patternDesc; + this.pattern = Buffer.isBuffer(p2) ? p2 : Buffer.from(p2); this.requiredLength = this.pattern.length; if (patternDesc.requiredExtraSize) this.requiredLength += patternDesc.requiredExtraSize; this.data = new Buffer(""); @@ -78124,7 +78227,7 @@ var require_mkdirp = __commonJS({ var fs16 = __require("fs"); var _0777 = parseInt("0777", 8); module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - function mkdirP(p6, opts, f6, made) { + function mkdirP(p2, opts, f6, made) { if (typeof opts === "function") { f6 = opts; opts = {}; @@ -78140,25 +78243,25 @@ var require_mkdirp = __commonJS({ var cb = f6 || /* istanbul ignore next */ function() { }; - p6 = path10.resolve(p6); - xfs.mkdir(p6, mode, function(er) { + p2 = path10.resolve(p2); + xfs.mkdir(p2, mode, function(er) { if (!er) { - made = made || p6; + made = made || p2; return cb(null, made); } switch (er.code) { case "ENOENT": - if (path10.dirname(p6) === p6) return cb(er); - mkdirP(path10.dirname(p6), opts, function(er2, made2) { + if (path10.dirname(p2) === p2) return cb(er); + mkdirP(path10.dirname(p2), opts, function(er2, made2) { if (er2) cb(er2, made2); - else mkdirP(p6, opts, cb, made2); + else mkdirP(p2, opts, cb, made2); }); break; // In the case of any other error, just see if there's a dir // there already. If so, then hooray! If not, then something // is borked. default: - xfs.stat(p6, function(er2, stat2) { + xfs.stat(p2, function(er2, stat2) { if (er2 || !stat2.isDirectory()) cb(er, made); else cb(null, made); }); @@ -78166,7 +78269,7 @@ var require_mkdirp = __commonJS({ } }); } - mkdirP.sync = function sync2(p6, opts, made) { + mkdirP.sync = function sync2(p2, opts, made) { if (!opts || typeof opts !== "object") { opts = { mode: opts }; } @@ -78176,15 +78279,15 @@ var require_mkdirp = __commonJS({ mode = _0777; } if (!made) made = null; - p6 = path10.resolve(p6); + p2 = path10.resolve(p2); try { - xfs.mkdirSync(p6, mode); - made = made || p6; + xfs.mkdirSync(p2, mode); + made = made || p2; } catch (err0) { switch (err0.code) { case "ENOENT": - made = sync2(path10.dirname(p6), opts, made); - sync2(p6, opts, made); + made = sync2(path10.dirname(p2), opts, made); + sync2(p2, opts, made); break; // In the case of any other error, just see if there's a dir // there already. If so, then hooray! If not, then something @@ -78192,7 +78295,7 @@ var require_mkdirp = __commonJS({ default: var stat2; try { - stat2 = xfs.statSync(p6); + stat2 = xfs.statSync(p2); } catch (err1) { throw err0; } @@ -78307,8 +78410,8 @@ var require_universalify = __commonJS({ return Object.defineProperty(function(...args) { if (typeof args[args.length - 1] === "function") fn.apply(this, args); else { - return new Promise((resolve4, reject2) => { - args.push((err, res) => err != null ? reject2(err) : resolve4(res)); + return new Promise((resolve8, reject2) => { + args.push((err, res) => err != null ? reject2(err) : resolve8(res)); fn.apply(this, args); }); } @@ -78331,7 +78434,7 @@ var require_universalify = __commonJS({ var require_fs = __commonJS({ "node_modules/fs-extra/lib/fs/index.js"(exports2) { "use strict"; - var u6 = require_universalify().fromCallback; + var u = require_universalify().fromCallback; var fs16 = require_graceful_fs(); var api = [ "access", @@ -78377,24 +78480,24 @@ var require_fs = __commonJS({ }); Object.assign(exports2, fs16); api.forEach((method) => { - exports2[method] = u6(fs16[method]); + exports2[method] = u(fs16[method]); }); exports2.exists = function(filename, callback) { if (typeof callback === "function") { return fs16.exists(filename, callback); } - return new Promise((resolve4) => { - return fs16.exists(filename, resolve4); + return new Promise((resolve8) => { + return fs16.exists(filename, resolve8); }); }; exports2.read = function(fd, buffer2, offset, length, position, callback) { if (typeof callback === "function") { return fs16.read(fd, buffer2, offset, length, position, callback); } - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { fs16.read(fd, buffer2, offset, length, position, (err, bytesRead, buffer3) => { if (err) return reject2(err); - resolve4({ bytesRead, buffer: buffer3 }); + resolve8({ bytesRead, buffer: buffer3 }); }); }); }; @@ -78402,10 +78505,10 @@ var require_fs = __commonJS({ if (typeof args[args.length - 1] === "function") { return fs16.write(fd, buffer2, ...args); } - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { fs16.write(fd, buffer2, ...args, (err, bytesWritten, buffer3) => { if (err) return reject2(err); - resolve4({ bytesWritten, buffer: buffer3 }); + resolve8({ bytesWritten, buffer: buffer3 }); }); }); }; @@ -78413,10 +78516,10 @@ var require_fs = __commonJS({ if (typeof args[args.length - 1] === "function") { return fs16.readv(fd, buffers, ...args); } - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { fs16.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => { if (err) return reject2(err); - resolve4({ bytesRead, buffers: buffers2 }); + resolve8({ bytesRead, buffers: buffers2 }); }); }); }; @@ -78424,15 +78527,15 @@ var require_fs = __commonJS({ if (typeof args[args.length - 1] === "function") { return fs16.writev(fd, buffers, ...args); } - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { fs16.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => { if (err) return reject2(err); - resolve4({ bytesWritten, buffers: buffers2 }); + resolve8({ bytesWritten, buffers: buffers2 }); }); }); }; if (typeof fs16.realpath.native === "function") { - exports2.realpath.native = u6(fs16.realpath.native); + exports2.realpath.native = u(fs16.realpath.native); } else { process.emitWarning( "fs.realpath.native is not a function. Is fs being monkey-patched?", @@ -78493,9 +78596,9 @@ var require_make_dir = __commonJS({ var require_mkdirs = __commonJS({ "node_modules/fs-extra/lib/mkdirs/index.js"(exports2, module) { "use strict"; - var u6 = require_universalify().fromPromise; + var u = require_universalify().fromPromise; var { makeDir: _makeDir, makeDirSync } = require_make_dir(); - var makeDir = u6(_makeDir); + var makeDir = u(_makeDir); module.exports = { mkdirs: makeDir, mkdirsSync: makeDirSync, @@ -78512,13 +78615,13 @@ var require_mkdirs = __commonJS({ var require_path_exists = __commonJS({ "node_modules/fs-extra/lib/path-exists/index.js"(exports2, module) { "use strict"; - var u6 = require_universalify().fromPromise; + var u = require_universalify().fromPromise; var fs16 = require_fs(); function pathExists(path10) { return fs16.access(path10).then(() => true).catch(() => false); } module.exports = { - pathExists: u6(pathExists), + pathExists: u(pathExists), pathExistsSync: fs16.existsSync }; } @@ -78529,7 +78632,7 @@ var require_utimes = __commonJS({ "node_modules/fs-extra/lib/util/utimes.js"(exports2, module) { "use strict"; var fs16 = require_fs(); - var u6 = require_universalify().fromPromise; + var u = require_universalify().fromPromise; async function utimesMillis(path10, atime, mtime) { const fd = await fs16.open(path10, "r+"); let closeErr = null; @@ -78552,7 +78655,7 @@ var require_utimes = __commonJS({ return fs16.closeSync(fd); } module.exports = { - utimesMillis: u6(utimesMillis), + utimesMillis: u(utimesMillis), utimesMillisSync }; } @@ -78564,7 +78667,7 @@ var require_stat = __commonJS({ "use strict"; var fs16 = require_fs(); var path10 = __require("path"); - var u6 = require_universalify().fromPromise; + var u = require_universalify().fromPromise; function getStats(src, dest, opts) { const statFunc = opts.dereference ? (file) => fs16.stat(file, { bigint: true }) : (file) => fs16.lstat(file, { bigint: true }); return Promise.all([ @@ -78678,10 +78781,10 @@ var require_stat = __commonJS({ } module.exports = { // checkPaths - checkPaths: u6(checkPaths), + checkPaths: u(checkPaths), checkPathsSync, // checkParent - checkParentPaths: u6(checkParentPaths), + checkParentPaths: u(checkParentPaths), checkParentPathsSync, // Misc isSrcSubdir, @@ -78850,8 +78953,8 @@ var require_copy_sync = __commonJS({ return getStats(destStat, src, dest, opts); } function getStats(destStat, src, dest, opts) { - const statSync2 = opts.dereference ? fs16.statSync : fs16.lstatSync; - const srcStat = statSync2(src); + const statSync4 = opts.dereference ? fs16.statSync : fs16.lstatSync; + const srcStat = statSync4(src); if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts); else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts); else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts); @@ -78959,9 +79062,9 @@ var require_copy_sync = __commonJS({ var require_copy2 = __commonJS({ "node_modules/fs-extra/lib/copy/index.js"(exports2, module) { "use strict"; - var u6 = require_universalify().fromPromise; + var u = require_universalify().fromPromise; module.exports = { - copy: u6(require_copy()), + copy: u(require_copy()), copySync: require_copy_sync() }; } @@ -78972,7 +79075,7 @@ var require_remove = __commonJS({ "node_modules/fs-extra/lib/remove/index.js"(exports2, module) { "use strict"; var fs16 = require_graceful_fs(); - var u6 = require_universalify().fromCallback; + var u = require_universalify().fromCallback; function remove(path10, callback) { fs16.rm(path10, { recursive: true, force: true }, callback); } @@ -78980,7 +79083,7 @@ var require_remove = __commonJS({ fs16.rmSync(path10, { recursive: true, force: true }); } module.exports = { - remove: u6(remove), + remove: u(remove), removeSync }; } @@ -78990,12 +79093,12 @@ var require_remove = __commonJS({ var require_empty = __commonJS({ "node_modules/fs-extra/lib/empty/index.js"(exports2, module) { "use strict"; - var u6 = require_universalify().fromPromise; + var u = require_universalify().fromPromise; var fs16 = require_fs(); var path10 = __require("path"); var mkdir2 = require_mkdirs(); var remove = require_remove(); - var emptyDir = u6(async function emptyDir2(dir2) { + var emptyDir = u(async function emptyDir2(dir2) { let items; try { items = await fs16.readdir(dir2); @@ -79029,7 +79132,7 @@ var require_empty = __commonJS({ var require_file3 = __commonJS({ "node_modules/fs-extra/lib/ensure/file.js"(exports2, module) { "use strict"; - var u6 = require_universalify().fromPromise; + var u = require_universalify().fromPromise; var path10 = __require("path"); var fs16 = require_fs(); var mkdir2 = require_mkdirs(); @@ -79078,7 +79181,7 @@ var require_file3 = __commonJS({ fs16.writeFileSync(file, ""); } module.exports = { - createFile: u6(createFile2), + createFile: u(createFile2), createFileSync }; } @@ -79088,7 +79191,7 @@ var require_file3 = __commonJS({ var require_link = __commonJS({ "node_modules/fs-extra/lib/ensure/link.js"(exports2, module) { "use strict"; - var u6 = require_universalify().fromPromise; + var u = require_universalify().fromPromise; var path10 = __require("path"); var fs16 = require_fs(); var mkdir2 = require_mkdirs(); @@ -79135,7 +79238,7 @@ var require_link = __commonJS({ return fs16.linkSync(srcpath, dstpath); } module.exports = { - createLink: u6(createLink), + createLink: u(createLink), createLinkSync }; } @@ -79148,7 +79251,7 @@ var require_symlink_paths = __commonJS({ var path10 = __require("path"); var fs16 = require_fs(); var { pathExists } = require_path_exists(); - var u6 = require_universalify().fromPromise; + var u = require_universalify().fromPromise; async function symlinkPaths(srcpath, dstpath) { if (path10.isAbsolute(srcpath)) { try { @@ -79208,7 +79311,7 @@ var require_symlink_paths = __commonJS({ }; } module.exports = { - symlinkPaths: u6(symlinkPaths), + symlinkPaths: u(symlinkPaths), symlinkPathsSync }; } @@ -79219,7 +79322,7 @@ var require_symlink_type = __commonJS({ "node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module) { "use strict"; var fs16 = require_fs(); - var u6 = require_universalify().fromPromise; + var u = require_universalify().fromPromise; async function symlinkType(srcpath, type) { if (type) return type; let stats; @@ -79241,7 +79344,7 @@ var require_symlink_type = __commonJS({ return stats && stats.isDirectory() ? "dir" : "file"; } module.exports = { - symlinkType: u6(symlinkType), + symlinkType: u(symlinkType), symlinkTypeSync }; } @@ -79251,7 +79354,7 @@ var require_symlink_type = __commonJS({ var require_symlink = __commonJS({ "node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module) { "use strict"; - var u6 = require_universalify().fromPromise; + var u = require_universalify().fromPromise; var path10 = __require("path"); var fs16 = require_fs(); var { mkdirs, mkdirsSync } = require_mkdirs(); @@ -79272,9 +79375,9 @@ var require_symlink = __commonJS({ ]); if (areIdentical(srcStat, dstStat)) return; } - const relative2 = await symlinkPaths(srcpath, dstpath); - srcpath = relative2.toDst; - const toType = await symlinkType(relative2.toCwd, type); + const relative3 = await symlinkPaths(srcpath, dstpath); + srcpath = relative3.toDst; + const toType = await symlinkType(relative3.toCwd, type); const dir2 = path10.dirname(dstpath); if (!await pathExists(dir2)) { await mkdirs(dir2); @@ -79292,9 +79395,9 @@ var require_symlink = __commonJS({ const dstStat = fs16.statSync(dstpath); if (areIdentical(srcStat, dstStat)) return; } - const relative2 = symlinkPathsSync(srcpath, dstpath); - srcpath = relative2.toDst; - type = symlinkTypeSync(relative2.toCwd, type); + const relative3 = symlinkPathsSync(srcpath, dstpath); + srcpath = relative3.toDst; + type = symlinkTypeSync(relative3.toCwd, type); const dir2 = path10.dirname(dstpath); const exists3 = fs16.existsSync(dir2); if (exists3) return fs16.symlinkSync(srcpath, dstpath, type); @@ -79302,7 +79405,7 @@ var require_symlink = __commonJS({ return fs16.symlinkSync(srcpath, dstpath, type); } module.exports = { - createSymlink: u6(createSymlink), + createSymlink: u(createSymlink), createSymlinkSync }; } @@ -79386,7 +79489,7 @@ var require_jsonfile = __commonJS({ return obj; } var readFile4 = universalify.fromPromise(_readFile); - function readFileSync5(file, options = {}) { + function readFileSync8(file, options = {}) { if (typeof options === "string") { options = { encoding: options }; } @@ -79410,7 +79513,7 @@ var require_jsonfile = __commonJS({ const str = stringify(obj, options); await universalify.fromCallback(fs16.writeFile)(file, str, options); } - var writeFile3 = universalify.fromPromise(_writeFile); + var writeFile4 = universalify.fromPromise(_writeFile); function writeFileSync2(file, obj, options = {}) { const fs16 = options.fs || _fs; const str = stringify(obj, options); @@ -79418,8 +79521,8 @@ var require_jsonfile = __commonJS({ } var jsonfile = { readFile: readFile4, - readFileSync: readFileSync5, - writeFile: writeFile3, + readFileSync: readFileSync8, + writeFile: writeFile4, writeFileSync: writeFileSync2 }; module.exports = jsonfile; @@ -79445,7 +79548,7 @@ var require_jsonfile2 = __commonJS({ var require_output_file = __commonJS({ "node_modules/fs-extra/lib/output-file/index.js"(exports2, module) { "use strict"; - var u6 = require_universalify().fromPromise; + var u = require_universalify().fromPromise; var fs16 = require_fs(); var path10 = __require("path"); var mkdir2 = require_mkdirs(); @@ -79465,7 +79568,7 @@ var require_output_file = __commonJS({ fs16.writeFileSync(file, ...args); } module.exports = { - outputFile: u6(outputFile), + outputFile: u(outputFile), outputFileSync }; } @@ -79503,9 +79606,9 @@ var require_output_json_sync = __commonJS({ var require_json2 = __commonJS({ "node_modules/fs-extra/lib/json/index.js"(exports2, module) { "use strict"; - var u6 = require_universalify().fromPromise; + var u = require_universalify().fromPromise; var jsonFile = require_jsonfile2(); - jsonFile.outputJson = u6(require_output_json()); + jsonFile.outputJson = u(require_output_json()); jsonFile.outputJsonSync = require_output_json_sync(); jsonFile.outputJSON = jsonFile.outputJson; jsonFile.outputJSONSync = jsonFile.outputJsonSync; @@ -79626,9 +79729,9 @@ var require_move_sync = __commonJS({ var require_move2 = __commonJS({ "node_modules/fs-extra/lib/move/index.js"(exports2, module) { "use strict"; - var u6 = require_universalify().fromPromise; + var u = require_universalify().fromPromise; module.exports = { - move: u6(require_move()), + move: u(require_move()), moveSync: require_move_sync() }; } @@ -79737,11 +79840,11 @@ var require_Utility = __commonJS({ "node_modules/xmlbuilder/lib/Utility.js"(exports2, module) { "use strict"; (function() { - var assign, getValue, isArray, isEmpty, isFunction2, isObject2, isPlainObject3, slice = [].slice, hasProp = {}.hasOwnProperty; + var assign, getValue, isArray, isEmpty, isFunction3, isObject2, isPlainObject3, slice = [].slice, hasProp = {}.hasOwnProperty; assign = function() { var i6, key, len, source, sources, target; target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : []; - if (isFunction2(Object.assign)) { + if (isFunction3(Object.assign)) { Object.assign.apply(null, arguments); } else { for (i6 = 0, len = sources.length; i6 < len; i6++) { @@ -79756,7 +79859,7 @@ var require_Utility = __commonJS({ } return target; }; - isFunction2 = function(val) { + isFunction3 = function(val) { return !!val && Object.prototype.toString.call(val) === "[object Function]"; }; isObject2 = function(val) { @@ -79764,7 +79867,7 @@ var require_Utility = __commonJS({ return !!val && ((ref = typeof val) === "function" || ref === "object"); }; isArray = function(val) { - if (isFunction2(Array.isArray)) { + if (isFunction3(Array.isArray)) { return Array.isArray(val); } else { return Object.prototype.toString.call(val) === "[object Array]"; @@ -79787,14 +79890,14 @@ var require_Utility = __commonJS({ return isObject2(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && typeof ctor === "function" && ctor instanceof ctor && Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object); }; getValue = function(obj) { - if (isFunction2(obj.valueOf)) { + if (isFunction3(obj.valueOf)) { return obj.valueOf(); } else { return obj; } }; module.exports.assign = assign; - module.exports.isFunction = isFunction2; + module.exports.isFunction = isFunction3; module.exports.isObject = isObject2; module.exports.isArray = isArray; module.exports.isEmpty = isEmpty; @@ -80071,8 +80174,8 @@ var require_XMLNamedNodeMap = __commonJS({ (function() { var XMLNamedNodeMap; module.exports = XMLNamedNodeMap = (function() { - function XMLNamedNodeMap2(nodes) { - this.nodes = nodes; + function XMLNamedNodeMap2(nodes6) { + this.nodes = nodes6; } Object.defineProperty(XMLNamedNodeMap2.prototype, "length", { get: function() { @@ -80120,7 +80223,7 @@ var require_XMLElement = __commonJS({ "node_modules/xmlbuilder/lib/XMLElement.js"(exports2, module) { "use strict"; (function() { - var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue, isFunction2, isObject2, ref, extend2 = function(child, parent2) { + var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue, isFunction3, isObject2, ref, extend2 = function(child, parent2) { for (var key in parent2) { if (hasProp.call(parent2, key)) child[key] = parent2[key]; } @@ -80132,7 +80235,7 @@ var require_XMLElement = __commonJS({ child.__super__ = parent2.prototype; return child; }, hasProp = {}.hasOwnProperty; - ref = require_Utility(), isObject2 = ref.isObject, isFunction2 = ref.isFunction, getValue = ref.getValue; + ref = require_Utility(), isObject2 = ref.isObject, isFunction3 = ref.isFunction, getValue = ref.getValue; XMLNode = require_XMLNode(); NodeType = require_NodeType(); XMLAttribute = require_XMLAttribute(); @@ -80245,7 +80348,7 @@ var require_XMLElement = __commonJS({ this.attribute(attName, attValue); } } else { - if (isFunction2(value)) { + if (isFunction3(value)) { value = value.apply(); } if (this.options.keepNullAttributes && value == null) { @@ -80912,30 +81015,30 @@ var require_XMLDocType = __commonJS({ } Object.defineProperty(XMLDocType2.prototype, "entities", { get: function() { - var child, i6, len, nodes, ref; - nodes = {}; + var child, i6, len, nodes6, ref; + nodes6 = {}; ref = this.children; for (i6 = 0, len = ref.length; i6 < len; i6++) { child = ref[i6]; if (child.type === NodeType.EntityDeclaration && !child.pe) { - nodes[child.name] = child; + nodes6[child.name] = child; } } - return new XMLNamedNodeMap(nodes); + return new XMLNamedNodeMap(nodes6); } }); Object.defineProperty(XMLDocType2.prototype, "notations", { get: function() { - var child, i6, len, nodes, ref; - nodes = {}; + var child, i6, len, nodes6, ref; + nodes6 = {}; ref = this.children; for (i6 = 0, len = ref.length; i6 < len; i6++) { child = ref[i6]; if (child.type === NodeType.NotationDeclaration) { - nodes[child.name] = child; + nodes6[child.name] = child; } } - return new XMLNamedNodeMap(nodes); + return new XMLNamedNodeMap(nodes6); } }); Object.defineProperty(XMLDocType2.prototype, "publicId", { @@ -81235,8 +81338,8 @@ var require_XMLNodeList = __commonJS({ (function() { var XMLNodeList; module.exports = XMLNodeList = (function() { - function XMLNodeList2(nodes) { - this.nodes = nodes; + function XMLNodeList2(nodes6) { + this.nodes = nodes6; } Object.defineProperty(XMLNodeList2.prototype, "length", { get: function() { @@ -81277,8 +81380,8 @@ var require_XMLNode = __commonJS({ "node_modules/xmlbuilder/lib/XMLNode.js"(exports2, module) { "use strict"; (function() { - var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction2, isObject2, ref1, hasProp = {}.hasOwnProperty; - ref1 = require_Utility(), isObject2 = ref1.isObject, isFunction2 = ref1.isFunction, isEmpty = ref1.isEmpty, getValue = ref1.getValue; + var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction3, isObject2, ref1, hasProp = {}.hasOwnProperty; + ref1 = require_Utility(), isObject2 = ref1.isObject, isFunction3 = ref1.isFunction, isEmpty = ref1.isEmpty, getValue = ref1.getValue; XMLElement = null; XMLCData = null; XMLComment = null; @@ -81432,13 +81535,13 @@ var require_XMLNode = __commonJS({ item = name[j7]; lastChild = this.element(item); } - } else if (isFunction2(name)) { + } else if (isFunction3(name)) { lastChild = this.element(name.apply()); } else if (isObject2(name)) { for (key in name) { if (!hasProp.call(name, key)) continue; val = name[key]; - if (isFunction2(val)) { + if (isFunction3(val)) { val = val.apply(); } if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) { @@ -81620,7 +81723,7 @@ var require_XMLNode = __commonJS({ this.instruction(insTarget, insValue); } } else { - if (isFunction2(value)) { + if (isFunction3(value)) { value = value.apply(); } instruction = new XMLProcessingInstruction(this, target, value); @@ -82130,32 +82233,32 @@ var require_XMLStringifier = __commonJS({ XMLStringifier2.prototype.convertCommentKey = "#comment"; XMLStringifier2.prototype.convertRawKey = "#raw"; XMLStringifier2.prototype.assertLegalChar = function(str) { - var regex, res; + var regex3, res; if (this.options.noValidation) { return str; } - regex = ""; + regex3 = ""; if (this.options.version === "1.0") { - regex = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; - if (res = str.match(regex)) { + regex3 = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + if (res = str.match(regex3)) { throw new Error("Invalid character in string: " + str + " at index " + res.index); } } else if (this.options.version === "1.1") { - regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; - if (res = str.match(regex)) { + regex3 = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + if (res = str.match(regex3)) { throw new Error("Invalid character in string: " + str + " at index " + res.index); } } return str; }; XMLStringifier2.prototype.assertLegalName = function(str) { - var regex; + var regex3; if (this.options.noValidation) { return str; } this.assertLegalChar(str); - regex = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/; - if (!str.match(regex)) { + regex3 = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/; + if (!str.match(regex3)) { throw new Error("Invalid character in name"); } return str; @@ -82832,10 +82935,10 @@ var require_XMLDocument = __commonJS({ XMLDocument2.prototype.createRange = function() { throw new Error("This DOM method is not implemented." + this.debugInfo()); }; - XMLDocument2.prototype.createNodeIterator = function(root, whatToShow, filter4) { + XMLDocument2.prototype.createNodeIterator = function(root6, whatToShow, filter4) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }; - XMLDocument2.prototype.createTreeWalker = function(root, whatToShow, filter4) { + XMLDocument2.prototype.createTreeWalker = function(root6, whatToShow, filter4) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }; return XMLDocument2; @@ -82849,8 +82952,8 @@ var require_XMLDocumentCB = __commonJS({ "node_modules/xmlbuilder/lib/XMLDocumentCB.js"(exports2, module) { "use strict"; (function() { - var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction2, isObject2, isPlainObject3, ref, hasProp = {}.hasOwnProperty; - ref = require_Utility(), isObject2 = ref.isObject, isFunction2 = ref.isFunction, isPlainObject3 = ref.isPlainObject, getValue = ref.getValue; + var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction3, isObject2, isPlainObject3, ref, hasProp = {}.hasOwnProperty; + ref = require_Utility(), isObject2 = ref.isObject, isFunction3 = ref.isFunction, isPlainObject3 = ref.isPlainObject, getValue = ref.getValue; NodeType = require_NodeType(); XMLDocument = require_XMLDocument(); XMLElement = require_XMLElement(); @@ -82971,17 +83074,17 @@ var require_XMLDocumentCB = __commonJS({ return this; }; XMLDocumentCB2.prototype.element = function(name, attributes, text) { - var child, i6, len, oldValidationFlag, ref1, root; + var child, i6, len, oldValidationFlag, ref1, root6; if (this.currentNode && this.currentNode.type === NodeType.DocType) { this.dtdElement.apply(this, arguments); } else { - if (Array.isArray(name) || isObject2(name) || isFunction2(name)) { + if (Array.isArray(name) || isObject2(name) || isFunction3(name)) { oldValidationFlag = this.options.noValidation; this.options.noValidation = true; - root = new XMLDocument(this.options).element("TEMP_ROOT"); - root.element(name); + root6 = new XMLDocument(this.options).element("TEMP_ROOT"); + root6.element(name); this.options.noValidation = oldValidationFlag; - ref1 = root.children; + ref1 = root6.children; for (i6 = 0, len = ref1.length; i6 < len; i6++) { child = ref1[i6]; this.createChildNode(child); @@ -83010,7 +83113,7 @@ var require_XMLDocumentCB = __commonJS({ this.attribute(attName, attValue); } } else { - if (isFunction2(value)) { + if (isFunction3(value)) { value = value.apply(); } if (this.options.keepNullAttributes && value == null) { @@ -83070,7 +83173,7 @@ var require_XMLDocumentCB = __commonJS({ this.instruction(insTarget, insValue); } } else { - if (isFunction2(value)) { + if (isFunction3(value)) { value = value.apply(); } node = new XMLProcessingInstruction(this, target, value); @@ -83088,16 +83191,16 @@ var require_XMLDocumentCB = __commonJS({ this.onData(this.writer.declaration(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); return this; }; - XMLDocumentCB2.prototype.doctype = function(root, pubID, sysID) { + XMLDocumentCB2.prototype.doctype = function(root6, pubID, sysID) { this.openCurrent(); - if (root == null) { + if (root6 == null) { throw new Error("Missing root node name."); } if (this.root) { throw new Error("dtd() must come before the root node."); } this.currentNode = new XMLDocType(this, pubID, sysID); - this.currentNode.rootNodeName = root; + this.currentNode.rootNodeName = root6; this.currentNode.children = false; this.currentLevel++; this.openTags[this.currentLevel] = this.currentNode; @@ -83258,8 +83361,8 @@ var require_XMLDocumentCB = __commonJS({ XMLDocumentCB2.prototype.dec = function(version3, encoding, standalone) { return this.declaration(version3, encoding, standalone); }; - XMLDocumentCB2.prototype.dtd = function(root, pubID, sysID) { - return this.doctype(root, pubID, sysID); + XMLDocumentCB2.prototype.dtd = function(root6, pubID, sysID) { + return this.doctype(root6, pubID, sysID); }; XMLDocumentCB2.prototype.e = function(name, attributes, text) { return this.element(name, attributes, text); @@ -83484,8 +83587,8 @@ var require_lib4 = __commonJS({ "node_modules/xmlbuilder/lib/index.js"(exports2, module) { "use strict"; (function() { - var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction2, ref; - ref = require_Utility(), assign = ref.assign, isFunction2 = ref.isFunction; + var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction3, ref; + ref = require_Utility(), assign = ref.assign, isFunction3 = ref.isFunction; XMLDOMImplementation = require_XMLDOMImplementation(); XMLDocument = require_XMLDocument(); XMLDocumentCB = require_XMLDocumentCB(); @@ -83494,24 +83597,24 @@ var require_lib4 = __commonJS({ NodeType = require_NodeType(); WriterState = require_WriterState(); module.exports.create = function(name, xmldec, doctype, options) { - var doc, root; + var doc, root6; if (name == null) { throw new Error("Root element needs a name."); } options = assign({}, xmldec, doctype, options); doc = new XMLDocument(options); - root = doc.element(name); + root6 = doc.element(name); if (!options.headless) { doc.declaration(options); if (options.pubID != null || options.sysID != null) { doc.dtd(options); } } - return root; + return root6; }; module.exports.begin = function(options, onData, onEnd) { var ref1; - if (isFunction2(options)) { + if (isFunction3(options)) { ref1 = [options, onData], onData = ref1[0], onEnd = ref1[1]; options = {}; } @@ -83706,91 +83809,91 @@ var require_sax = __commonJS({ if (!(this instanceof SAXParser)) { return new SAXParser(strict, opt); } - var parser2 = this; - clearBuffers(parser2); - parser2.q = parser2.c = ""; - parser2.bufferCheckPosition = sax.MAX_BUFFER_LENGTH; - parser2.opt = opt || {}; - parser2.opt.lowercase = parser2.opt.lowercase || parser2.opt.lowercasetags; - parser2.looseCase = parser2.opt.lowercase ? "toLowerCase" : "toUpperCase"; - parser2.tags = []; - parser2.closed = parser2.closedRoot = parser2.sawRoot = false; - parser2.tag = parser2.error = null; - parser2.strict = !!strict; - parser2.noscript = !!(strict || parser2.opt.noscript); - parser2.state = S.BEGIN; - parser2.strictEntities = parser2.opt.strictEntities; - parser2.ENTITIES = parser2.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES); - parser2.attribList = []; - if (parser2.opt.xmlns) { - parser2.ns = Object.create(rootNS); - } - if (parser2.opt.unquotedAttributeValues === void 0) { - parser2.opt.unquotedAttributeValues = !strict; - } - parser2.trackPosition = parser2.opt.position !== false; - if (parser2.trackPosition) { - parser2.position = parser2.line = parser2.column = 0; - } - emit(parser2, "onready"); + var parser3 = this; + clearBuffers(parser3); + parser3.q = parser3.c = ""; + parser3.bufferCheckPosition = sax.MAX_BUFFER_LENGTH; + parser3.opt = opt || {}; + parser3.opt.lowercase = parser3.opt.lowercase || parser3.opt.lowercasetags; + parser3.looseCase = parser3.opt.lowercase ? "toLowerCase" : "toUpperCase"; + parser3.tags = []; + parser3.closed = parser3.closedRoot = parser3.sawRoot = false; + parser3.tag = parser3.error = null; + parser3.strict = !!strict; + parser3.noscript = !!(strict || parser3.opt.noscript); + parser3.state = S.BEGIN; + parser3.strictEntities = parser3.opt.strictEntities; + parser3.ENTITIES = parser3.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES); + parser3.attribList = []; + if (parser3.opt.xmlns) { + parser3.ns = Object.create(rootNS); + } + if (parser3.opt.unquotedAttributeValues === void 0) { + parser3.opt.unquotedAttributeValues = !strict; + } + parser3.trackPosition = parser3.opt.position !== false; + if (parser3.trackPosition) { + parser3.position = parser3.line = parser3.column = 0; + } + emit(parser3, "onready"); } if (!Object.create) { - Object.create = function(o6) { - function F3() { + Object.create = function(o2) { + function F2() { } - F3.prototype = o6; - var newf = new F3(); + F2.prototype = o2; + var newf = new F2(); return newf; }; } if (!Object.keys) { - Object.keys = function(o6) { + Object.keys = function(o2) { var a6 = []; - for (var i6 in o6) if (o6.hasOwnProperty(i6)) a6.push(i6); + for (var i6 in o2) if (o2.hasOwnProperty(i6)) a6.push(i6); return a6; }; } - function checkBufferLength(parser2) { + function checkBufferLength(parser3) { var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10); var maxActual = 0; - for (var i6 = 0, l6 = buffers.length; i6 < l6; i6++) { - var len = parser2[buffers[i6]].length; + for (var i6 = 0, l3 = buffers.length; i6 < l3; i6++) { + var len = parser3[buffers[i6]].length; if (len > maxAllowed) { switch (buffers[i6]) { case "textNode": - closeText(parser2); + closeText(parser3); break; case "cdata": - emitNode(parser2, "oncdata", parser2.cdata); - parser2.cdata = ""; + emitNode(parser3, "oncdata", parser3.cdata); + parser3.cdata = ""; break; case "script": - emitNode(parser2, "onscript", parser2.script); - parser2.script = ""; + emitNode(parser3, "onscript", parser3.script); + parser3.script = ""; break; default: - error2(parser2, "Max buffer length exceeded: " + buffers[i6]); + error2(parser3, "Max buffer length exceeded: " + buffers[i6]); } } maxActual = Math.max(maxActual, len); } - var m6 = sax.MAX_BUFFER_LENGTH - maxActual; - parser2.bufferCheckPosition = m6 + parser2.position; + var m3 = sax.MAX_BUFFER_LENGTH - maxActual; + parser3.bufferCheckPosition = m3 + parser3.position; } - function clearBuffers(parser2) { - for (var i6 = 0, l6 = buffers.length; i6 < l6; i6++) { - parser2[buffers[i6]] = ""; + function clearBuffers(parser3) { + for (var i6 = 0, l3 = buffers.length; i6 < l3; i6++) { + parser3[buffers[i6]] = ""; } } - function flushBuffers(parser2) { - closeText(parser2); - if (parser2.cdata !== "") { - emitNode(parser2, "oncdata", parser2.cdata); - parser2.cdata = ""; + function flushBuffers(parser3) { + closeText(parser3); + if (parser3.cdata !== "") { + emitNode(parser3, "oncdata", parser3.cdata); + parser3.cdata = ""; } - if (parser2.script !== "") { - emitNode(parser2, "onscript", parser2.script); - parser2.script = ""; + if (parser3.script !== "") { + emitNode(parser3, "onscript", parser3.script); + parser3.script = ""; } } SAXParser.prototype = { @@ -83912,11 +84015,11 @@ var require_sax = __commonJS({ function isAttribEnd(c6) { return c6 === ">" || isWhitespace(c6); } - function isMatch(regex, c6) { - return regex.test(c6); + function isMatch(regex3, c6) { + return regex3.test(c6); } - function notMatch(regex, c6) { - return !isMatch(regex, c6); + function notMatch(regex3, c6) { + return !isMatch(regex3, c6); } var S = 0; sax.STATE = { @@ -84257,69 +84360,69 @@ var require_sax = __commonJS({ }; Object.keys(sax.ENTITIES).forEach(function(key) { var e6 = sax.ENTITIES[key]; - var s7 = typeof e6 === "number" ? String.fromCharCode(e6) : e6; - sax.ENTITIES[key] = s7; + var s2 = typeof e6 === "number" ? String.fromCharCode(e6) : e6; + sax.ENTITIES[key] = s2; }); - for (var s6 in sax.STATE) { - sax.STATE[sax.STATE[s6]] = s6; + for (var s in sax.STATE) { + sax.STATE[sax.STATE[s]] = s; } S = sax.STATE; - function emit(parser2, event, data) { - parser2[event] && parser2[event](data); + function emit(parser3, event, data) { + parser3[event] && parser3[event](data); } - function emitNode(parser2, nodeType, data) { - if (parser2.textNode) closeText(parser2); - emit(parser2, nodeType, data); + function emitNode(parser3, nodeType, data) { + if (parser3.textNode) closeText(parser3); + emit(parser3, nodeType, data); } - function closeText(parser2) { - parser2.textNode = textopts(parser2.opt, parser2.textNode); - if (parser2.textNode) emit(parser2, "ontext", parser2.textNode); - parser2.textNode = ""; + function closeText(parser3) { + parser3.textNode = textopts(parser3.opt, parser3.textNode); + if (parser3.textNode) emit(parser3, "ontext", parser3.textNode); + parser3.textNode = ""; } function textopts(opt, text) { if (opt.trim) text = text.trim(); if (opt.normalize) text = text.replace(/\s+/g, " "); return text; } - function error2(parser2, er) { - closeText(parser2); - if (parser2.trackPosition) { - er += "\nLine: " + parser2.line + "\nColumn: " + parser2.column + "\nChar: " + parser2.c; + function error2(parser3, er) { + closeText(parser3); + if (parser3.trackPosition) { + er += "\nLine: " + parser3.line + "\nColumn: " + parser3.column + "\nChar: " + parser3.c; } er = new Error(er); - parser2.error = er; - emit(parser2, "onerror", er); - return parser2; - } - function end(parser2) { - if (parser2.sawRoot && !parser2.closedRoot) strictFail(parser2, "Unclosed root tag"); - if (parser2.state !== S.BEGIN && parser2.state !== S.BEGIN_WHITESPACE && parser2.state !== S.TEXT) { - error2(parser2, "Unexpected end"); - } - closeText(parser2); - parser2.c = ""; - parser2.closed = true; - emit(parser2, "onend"); - SAXParser.call(parser2, parser2.strict, parser2.opt); - return parser2; - } - function strictFail(parser2, message) { - if (typeof parser2 !== "object" || !(parser2 instanceof SAXParser)) { + parser3.error = er; + emit(parser3, "onerror", er); + return parser3; + } + function end(parser3) { + if (parser3.sawRoot && !parser3.closedRoot) strictFail(parser3, "Unclosed root tag"); + if (parser3.state !== S.BEGIN && parser3.state !== S.BEGIN_WHITESPACE && parser3.state !== S.TEXT) { + error2(parser3, "Unexpected end"); + } + closeText(parser3); + parser3.c = ""; + parser3.closed = true; + emit(parser3, "onend"); + SAXParser.call(parser3, parser3.strict, parser3.opt); + return parser3; + } + function strictFail(parser3, message) { + if (typeof parser3 !== "object" || !(parser3 instanceof SAXParser)) { throw new Error("bad call to strictFail"); } - if (parser2.strict) { - error2(parser2, message); + if (parser3.strict) { + error2(parser3, message); } } - function newTag(parser2) { - if (!parser2.strict) parser2.tagName = parser2.tagName[parser2.looseCase](); - var parent2 = parser2.tags[parser2.tags.length - 1] || parser2; - var tag = parser2.tag = { name: parser2.tagName, attributes: {} }; - if (parser2.opt.xmlns) { + function newTag(parser3) { + if (!parser3.strict) parser3.tagName = parser3.tagName[parser3.looseCase](); + var parent2 = parser3.tags[parser3.tags.length - 1] || parser3; + var tag = parser3.tag = { name: parser3.tagName, attributes: {} }; + if (parser3.opt.xmlns) { tag.ns = parent2.ns; } - parser2.attribList.length = 0; - emitNode(parser2, "onopentagstart", tag); + parser3.attribList.length = 0; + emitNode(parser3, "onopentagstart", tag); } function qname(name, attribute) { var i6 = name.indexOf(":"); @@ -84332,72 +84435,72 @@ var require_sax = __commonJS({ } return { prefix: prefix2, local }; } - function attrib(parser2) { - if (!parser2.strict) { - parser2.attribName = parser2.attribName[parser2.looseCase](); + function attrib(parser3) { + if (!parser3.strict) { + parser3.attribName = parser3.attribName[parser3.looseCase](); } - if (parser2.attribList.indexOf(parser2.attribName) !== -1 || parser2.tag.attributes.hasOwnProperty(parser2.attribName)) { - parser2.attribName = parser2.attribValue = ""; + if (parser3.attribList.indexOf(parser3.attribName) !== -1 || parser3.tag.attributes.hasOwnProperty(parser3.attribName)) { + parser3.attribName = parser3.attribValue = ""; return; } - if (parser2.opt.xmlns) { - var qn = qname(parser2.attribName, true); + if (parser3.opt.xmlns) { + var qn = qname(parser3.attribName, true); var prefix2 = qn.prefix; var local = qn.local; if (prefix2 === "xmlns") { - if (local === "xml" && parser2.attribValue !== XML_NAMESPACE) { + if (local === "xml" && parser3.attribValue !== XML_NAMESPACE) { strictFail( - parser2, - "xml: prefix must be bound to " + XML_NAMESPACE + "\nActual: " + parser2.attribValue + parser3, + "xml: prefix must be bound to " + XML_NAMESPACE + "\nActual: " + parser3.attribValue ); - } else if (local === "xmlns" && parser2.attribValue !== XMLNS_NAMESPACE) { + } else if (local === "xmlns" && parser3.attribValue !== XMLNS_NAMESPACE) { strictFail( - parser2, - "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\nActual: " + parser2.attribValue + parser3, + "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\nActual: " + parser3.attribValue ); } else { - var tag = parser2.tag; - var parent2 = parser2.tags[parser2.tags.length - 1] || parser2; + var tag = parser3.tag; + var parent2 = parser3.tags[parser3.tags.length - 1] || parser3; if (tag.ns === parent2.ns) { tag.ns = Object.create(parent2.ns); } - tag.ns[local] = parser2.attribValue; + tag.ns[local] = parser3.attribValue; } } - parser2.attribList.push([parser2.attribName, parser2.attribValue]); + parser3.attribList.push([parser3.attribName, parser3.attribValue]); } else { - parser2.tag.attributes[parser2.attribName] = parser2.attribValue; - emitNode(parser2, "onattribute", { - name: parser2.attribName, - value: parser2.attribValue + parser3.tag.attributes[parser3.attribName] = parser3.attribValue; + emitNode(parser3, "onattribute", { + name: parser3.attribName, + value: parser3.attribValue }); } - parser2.attribName = parser2.attribValue = ""; + parser3.attribName = parser3.attribValue = ""; } - function openTag(parser2, selfClosing) { - if (parser2.opt.xmlns) { - var tag = parser2.tag; - var qn = qname(parser2.tagName); + function openTag(parser3, selfClosing) { + if (parser3.opt.xmlns) { + var tag = parser3.tag; + var qn = qname(parser3.tagName); tag.prefix = qn.prefix; tag.local = qn.local; tag.uri = tag.ns[qn.prefix] || ""; if (tag.prefix && !tag.uri) { - strictFail(parser2, "Unbound namespace prefix: " + JSON.stringify(parser2.tagName)); + strictFail(parser3, "Unbound namespace prefix: " + JSON.stringify(parser3.tagName)); tag.uri = qn.prefix; } - var parent2 = parser2.tags[parser2.tags.length - 1] || parser2; + var parent2 = parser3.tags[parser3.tags.length - 1] || parser3; if (tag.ns && parent2.ns !== tag.ns) { - Object.keys(tag.ns).forEach(function(p6) { - emitNode(parser2, "onopennamespace", { - prefix: p6, - uri: tag.ns[p6] + Object.keys(tag.ns).forEach(function(p2) { + emitNode(parser3, "onopennamespace", { + prefix: p2, + uri: tag.ns[p2] }); }); } - for (var i6 = 0, l6 = parser2.attribList.length; i6 < l6; i6++) { - var nv = parser2.attribList[i6]; - var name = nv[0]; - var value = nv[1]; + for (var i6 = 0, l3 = parser3.attribList.length; i6 < l3; i6++) { + var nv2 = parser3.attribList[i6]; + var name = nv2[0]; + var value = nv2[1]; var qualName = qname(name, true); var prefix2 = qualName.prefix; var local = qualName.local; @@ -84410,100 +84513,100 @@ var require_sax = __commonJS({ uri }; if (prefix2 && prefix2 !== "xmlns" && !uri) { - strictFail(parser2, "Unbound namespace prefix: " + JSON.stringify(prefix2)); + strictFail(parser3, "Unbound namespace prefix: " + JSON.stringify(prefix2)); a6.uri = prefix2; } - parser2.tag.attributes[name] = a6; - emitNode(parser2, "onattribute", a6); + parser3.tag.attributes[name] = a6; + emitNode(parser3, "onattribute", a6); } - parser2.attribList.length = 0; + parser3.attribList.length = 0; } - parser2.tag.isSelfClosing = !!selfClosing; - parser2.sawRoot = true; - parser2.tags.push(parser2.tag); - emitNode(parser2, "onopentag", parser2.tag); + parser3.tag.isSelfClosing = !!selfClosing; + parser3.sawRoot = true; + parser3.tags.push(parser3.tag); + emitNode(parser3, "onopentag", parser3.tag); if (!selfClosing) { - if (!parser2.noscript && parser2.tagName.toLowerCase() === "script") { - parser2.state = S.SCRIPT; + if (!parser3.noscript && parser3.tagName.toLowerCase() === "script") { + parser3.state = S.SCRIPT; } else { - parser2.state = S.TEXT; + parser3.state = S.TEXT; } - parser2.tag = null; - parser2.tagName = ""; + parser3.tag = null; + parser3.tagName = ""; } - parser2.attribName = parser2.attribValue = ""; - parser2.attribList.length = 0; + parser3.attribName = parser3.attribValue = ""; + parser3.attribList.length = 0; } - function closeTag(parser2) { - if (!parser2.tagName) { - strictFail(parser2, "Weird empty close tag."); - parser2.textNode += ""; - parser2.state = S.TEXT; + function closeTag(parser3) { + if (!parser3.tagName) { + strictFail(parser3, "Weird empty close tag."); + parser3.textNode += ""; + parser3.state = S.TEXT; return; } - if (parser2.script) { - if (parser2.tagName !== "script") { - parser2.script += ""; - parser2.tagName = ""; - parser2.state = S.SCRIPT; + if (parser3.script) { + if (parser3.tagName !== "script") { + parser3.script += ""; + parser3.tagName = ""; + parser3.state = S.SCRIPT; return; } - emitNode(parser2, "onscript", parser2.script); - parser2.script = ""; + emitNode(parser3, "onscript", parser3.script); + parser3.script = ""; } - var t6 = parser2.tags.length; - var tagName = parser2.tagName; - if (!parser2.strict) { - tagName = tagName[parser2.looseCase](); + var t = parser3.tags.length; + var tagName = parser3.tagName; + if (!parser3.strict) { + tagName = tagName[parser3.looseCase](); } var closeTo = tagName; - while (t6--) { - var close = parser2.tags[t6]; + while (t--) { + var close = parser3.tags[t]; if (close.name !== closeTo) { - strictFail(parser2, "Unexpected close tag"); + strictFail(parser3, "Unexpected close tag"); } else { break; } } - if (t6 < 0) { - strictFail(parser2, "Unmatched closing tag: " + parser2.tagName); - parser2.textNode += ""; - parser2.state = S.TEXT; + if (t < 0) { + strictFail(parser3, "Unmatched closing tag: " + parser3.tagName); + parser3.textNode += ""; + parser3.state = S.TEXT; return; } - parser2.tagName = tagName; - var s7 = parser2.tags.length; - while (s7-- > t6) { - var tag = parser2.tag = parser2.tags.pop(); - parser2.tagName = parser2.tag.name; - emitNode(parser2, "onclosetag", parser2.tagName); - var x6 = {}; + parser3.tagName = tagName; + var s2 = parser3.tags.length; + while (s2-- > t) { + var tag = parser3.tag = parser3.tags.pop(); + parser3.tagName = parser3.tag.name; + emitNode(parser3, "onclosetag", parser3.tagName); + var x2 = {}; for (var i6 in tag.ns) { - x6[i6] = tag.ns[i6]; + x2[i6] = tag.ns[i6]; } - var parent2 = parser2.tags[parser2.tags.length - 1] || parser2; - if (parser2.opt.xmlns && tag.ns !== parent2.ns) { - Object.keys(tag.ns).forEach(function(p6) { - var n12 = tag.ns[p6]; - emitNode(parser2, "onclosenamespace", { prefix: p6, uri: n12 }); + var parent2 = parser3.tags[parser3.tags.length - 1] || parser3; + if (parser3.opt.xmlns && tag.ns !== parent2.ns) { + Object.keys(tag.ns).forEach(function(p2) { + var n8 = tag.ns[p2]; + emitNode(parser3, "onclosenamespace", { prefix: p2, uri: n8 }); }); } } - if (t6 === 0) parser2.closedRoot = true; - parser2.tagName = parser2.attribValue = parser2.attribName = ""; - parser2.attribList.length = 0; - parser2.state = S.TEXT; + if (t === 0) parser3.closedRoot = true; + parser3.tagName = parser3.attribValue = parser3.attribName = ""; + parser3.attribList.length = 0; + parser3.state = S.TEXT; } - function parseEntity(parser2) { - var entity = parser2.entity; + function parseEntity(parser3) { + var entity = parser3.entity; var entityLC = entity.toLowerCase(); var num; var numStr = ""; - if (parser2.ENTITIES[entity]) { - return parser2.ENTITIES[entity]; + if (parser3.ENTITIES[entity]) { + return parser3.ENTITIES[entity]; } - if (parser2.ENTITIES[entityLC]) { - return parser2.ENTITIES[entityLC]; + if (parser3.ENTITIES[entityLC]) { + return parser3.ENTITIES[entityLC]; } entity = entityLC; if (entity.charAt(0) === "#") { @@ -84519,19 +84622,19 @@ var require_sax = __commonJS({ } entity = entity.replace(/^0+/, ""); if (isNaN(num) || numStr.toLowerCase() !== entity) { - strictFail(parser2, "Invalid character entity"); - return "&" + parser2.entity + ";"; + strictFail(parser3, "Invalid character entity"); + return "&" + parser3.entity + ";"; } return String.fromCodePoint(num); } - function beginWhiteSpace(parser2, c6) { + function beginWhiteSpace(parser3, c6) { if (c6 === "<") { - parser2.state = S.OPEN_WAKA; - parser2.startTagPosition = parser2.position; + parser3.state = S.OPEN_WAKA; + parser3.startTagPosition = parser3.position; } else if (!isWhitespace(c6)) { - strictFail(parser2, "Non-whitespace before first tag."); - parser2.textNode = c6; - parser2.state = S.TEXT; + strictFail(parser3, "Non-whitespace before first tag."); + parser3.textNode = c6; + parser3.state = S.TEXT; } } function charAt(chunk, i6) { @@ -84542,18 +84645,18 @@ var require_sax = __commonJS({ return result; } function write(chunk) { - var parser2 = this; + var parser3 = this; if (this.error) { throw this.error; } - if (parser2.closed) { + if (parser3.closed) { return error2( - parser2, + parser3, "Cannot write after close. Assign an onready handler." ); } if (chunk === null) { - return end(parser2); + return end(parser3); } if (typeof chunk === "object") { chunk = chunk.toString(); @@ -84562,359 +84665,359 @@ var require_sax = __commonJS({ var c6 = ""; while (true) { c6 = charAt(chunk, i6++); - parser2.c = c6; + parser3.c = c6; if (!c6) { break; } - if (parser2.trackPosition) { - parser2.position++; + if (parser3.trackPosition) { + parser3.position++; if (c6 === "\n") { - parser2.line++; - parser2.column = 0; + parser3.line++; + parser3.column = 0; } else { - parser2.column++; + parser3.column++; } } - switch (parser2.state) { + switch (parser3.state) { case S.BEGIN: - parser2.state = S.BEGIN_WHITESPACE; + parser3.state = S.BEGIN_WHITESPACE; if (c6 === "\uFEFF") { continue; } - beginWhiteSpace(parser2, c6); + beginWhiteSpace(parser3, c6); continue; case S.BEGIN_WHITESPACE: - beginWhiteSpace(parser2, c6); + beginWhiteSpace(parser3, c6); continue; case S.TEXT: - if (parser2.sawRoot && !parser2.closedRoot) { + if (parser3.sawRoot && !parser3.closedRoot) { var starti = i6 - 1; while (c6 && c6 !== "<" && c6 !== "&") { c6 = charAt(chunk, i6++); - if (c6 && parser2.trackPosition) { - parser2.position++; + if (c6 && parser3.trackPosition) { + parser3.position++; if (c6 === "\n") { - parser2.line++; - parser2.column = 0; + parser3.line++; + parser3.column = 0; } else { - parser2.column++; + parser3.column++; } } } - parser2.textNode += chunk.substring(starti, i6 - 1); + parser3.textNode += chunk.substring(starti, i6 - 1); } - if (c6 === "<" && !(parser2.sawRoot && parser2.closedRoot && !parser2.strict)) { - parser2.state = S.OPEN_WAKA; - parser2.startTagPosition = parser2.position; + if (c6 === "<" && !(parser3.sawRoot && parser3.closedRoot && !parser3.strict)) { + parser3.state = S.OPEN_WAKA; + parser3.startTagPosition = parser3.position; } else { - if (!isWhitespace(c6) && (!parser2.sawRoot || parser2.closedRoot)) { - strictFail(parser2, "Text data outside of root node."); + if (!isWhitespace(c6) && (!parser3.sawRoot || parser3.closedRoot)) { + strictFail(parser3, "Text data outside of root node."); } if (c6 === "&") { - parser2.state = S.TEXT_ENTITY; + parser3.state = S.TEXT_ENTITY; } else { - parser2.textNode += c6; + parser3.textNode += c6; } } continue; case S.SCRIPT: if (c6 === "<") { - parser2.state = S.SCRIPT_ENDING; + parser3.state = S.SCRIPT_ENDING; } else { - parser2.script += c6; + parser3.script += c6; } continue; case S.SCRIPT_ENDING: if (c6 === "/") { - parser2.state = S.CLOSE_TAG; + parser3.state = S.CLOSE_TAG; } else { - parser2.script += "<" + c6; - parser2.state = S.SCRIPT; + parser3.script += "<" + c6; + parser3.state = S.SCRIPT; } continue; case S.OPEN_WAKA: if (c6 === "!") { - parser2.state = S.SGML_DECL; - parser2.sgmlDecl = ""; + parser3.state = S.SGML_DECL; + parser3.sgmlDecl = ""; } else if (isWhitespace(c6)) { } else if (isMatch(nameStart, c6)) { - parser2.state = S.OPEN_TAG; - parser2.tagName = c6; + parser3.state = S.OPEN_TAG; + parser3.tagName = c6; } else if (c6 === "/") { - parser2.state = S.CLOSE_TAG; - parser2.tagName = ""; + parser3.state = S.CLOSE_TAG; + parser3.tagName = ""; } else if (c6 === "?") { - parser2.state = S.PROC_INST; - parser2.procInstName = parser2.procInstBody = ""; + parser3.state = S.PROC_INST; + parser3.procInstName = parser3.procInstBody = ""; } else { - strictFail(parser2, "Unencoded <"); - if (parser2.startTagPosition + 1 < parser2.position) { - var pad = parser2.position - parser2.startTagPosition; + strictFail(parser3, "Unencoded <"); + if (parser3.startTagPosition + 1 < parser3.position) { + var pad = parser3.position - parser3.startTagPosition; c6 = new Array(pad).join(" ") + c6; } - parser2.textNode += "<" + c6; - parser2.state = S.TEXT; + parser3.textNode += "<" + c6; + parser3.state = S.TEXT; } continue; case S.SGML_DECL: - if (parser2.sgmlDecl + c6 === "--") { - parser2.state = S.COMMENT; - parser2.comment = ""; - parser2.sgmlDecl = ""; + if (parser3.sgmlDecl + c6 === "--") { + parser3.state = S.COMMENT; + parser3.comment = ""; + parser3.sgmlDecl = ""; continue; } - if (parser2.doctype && parser2.doctype !== true && parser2.sgmlDecl) { - parser2.state = S.DOCTYPE_DTD; - parser2.doctype += "") { - emitNode(parser2, "onsgmldeclaration", parser2.sgmlDecl); - parser2.sgmlDecl = ""; - parser2.state = S.TEXT; + emitNode(parser3, "onsgmldeclaration", parser3.sgmlDecl); + parser3.sgmlDecl = ""; + parser3.state = S.TEXT; } else if (isQuote(c6)) { - parser2.state = S.SGML_DECL_QUOTED; - parser2.sgmlDecl += c6; + parser3.state = S.SGML_DECL_QUOTED; + parser3.sgmlDecl += c6; } else { - parser2.sgmlDecl += c6; + parser3.sgmlDecl += c6; } continue; case S.SGML_DECL_QUOTED: - if (c6 === parser2.q) { - parser2.state = S.SGML_DECL; - parser2.q = ""; + if (c6 === parser3.q) { + parser3.state = S.SGML_DECL; + parser3.q = ""; } - parser2.sgmlDecl += c6; + parser3.sgmlDecl += c6; continue; case S.DOCTYPE: if (c6 === ">") { - parser2.state = S.TEXT; - emitNode(parser2, "ondoctype", parser2.doctype); - parser2.doctype = true; + parser3.state = S.TEXT; + emitNode(parser3, "ondoctype", parser3.doctype); + parser3.doctype = true; } else { - parser2.doctype += c6; + parser3.doctype += c6; if (c6 === "[") { - parser2.state = S.DOCTYPE_DTD; + parser3.state = S.DOCTYPE_DTD; } else if (isQuote(c6)) { - parser2.state = S.DOCTYPE_QUOTED; - parser2.q = c6; + parser3.state = S.DOCTYPE_QUOTED; + parser3.q = c6; } } continue; case S.DOCTYPE_QUOTED: - parser2.doctype += c6; - if (c6 === parser2.q) { - parser2.q = ""; - parser2.state = S.DOCTYPE; + parser3.doctype += c6; + if (c6 === parser3.q) { + parser3.q = ""; + parser3.state = S.DOCTYPE; } continue; case S.DOCTYPE_DTD: if (c6 === "]") { - parser2.doctype += c6; - parser2.state = S.DOCTYPE; + parser3.doctype += c6; + parser3.state = S.DOCTYPE; } else if (c6 === "<") { - parser2.state = S.OPEN_WAKA; - parser2.startTagPosition = parser2.position; + parser3.state = S.OPEN_WAKA; + parser3.startTagPosition = parser3.position; } else if (isQuote(c6)) { - parser2.doctype += c6; - parser2.state = S.DOCTYPE_DTD_QUOTED; - parser2.q = c6; + parser3.doctype += c6; + parser3.state = S.DOCTYPE_DTD_QUOTED; + parser3.q = c6; } else { - parser2.doctype += c6; + parser3.doctype += c6; } continue; case S.DOCTYPE_DTD_QUOTED: - parser2.doctype += c6; - if (c6 === parser2.q) { - parser2.state = S.DOCTYPE_DTD; - parser2.q = ""; + parser3.doctype += c6; + if (c6 === parser3.q) { + parser3.state = S.DOCTYPE_DTD; + parser3.q = ""; } continue; case S.COMMENT: if (c6 === "-") { - parser2.state = S.COMMENT_ENDING; + parser3.state = S.COMMENT_ENDING; } else { - parser2.comment += c6; + parser3.comment += c6; } continue; case S.COMMENT_ENDING: if (c6 === "-") { - parser2.state = S.COMMENT_ENDED; - parser2.comment = textopts(parser2.opt, parser2.comment); - if (parser2.comment) { - emitNode(parser2, "oncomment", parser2.comment); + parser3.state = S.COMMENT_ENDED; + parser3.comment = textopts(parser3.opt, parser3.comment); + if (parser3.comment) { + emitNode(parser3, "oncomment", parser3.comment); } - parser2.comment = ""; + parser3.comment = ""; } else { - parser2.comment += "-" + c6; - parser2.state = S.COMMENT; + parser3.comment += "-" + c6; + parser3.state = S.COMMENT; } continue; case S.COMMENT_ENDED: if (c6 !== ">") { - strictFail(parser2, "Malformed comment"); - parser2.comment += "--" + c6; - parser2.state = S.COMMENT; - } else if (parser2.doctype && parser2.doctype !== true) { - parser2.state = S.DOCTYPE_DTD; + strictFail(parser3, "Malformed comment"); + parser3.comment += "--" + c6; + parser3.state = S.COMMENT; + } else if (parser3.doctype && parser3.doctype !== true) { + parser3.state = S.DOCTYPE_DTD; } else { - parser2.state = S.TEXT; + parser3.state = S.TEXT; } continue; case S.CDATA: if (c6 === "]") { - parser2.state = S.CDATA_ENDING; + parser3.state = S.CDATA_ENDING; } else { - parser2.cdata += c6; + parser3.cdata += c6; } continue; case S.CDATA_ENDING: if (c6 === "]") { - parser2.state = S.CDATA_ENDING_2; + parser3.state = S.CDATA_ENDING_2; } else { - parser2.cdata += "]" + c6; - parser2.state = S.CDATA; + parser3.cdata += "]" + c6; + parser3.state = S.CDATA; } continue; case S.CDATA_ENDING_2: if (c6 === ">") { - if (parser2.cdata) { - emitNode(parser2, "oncdata", parser2.cdata); + if (parser3.cdata) { + emitNode(parser3, "oncdata", parser3.cdata); } - emitNode(parser2, "onclosecdata"); - parser2.cdata = ""; - parser2.state = S.TEXT; + emitNode(parser3, "onclosecdata"); + parser3.cdata = ""; + parser3.state = S.TEXT; } else if (c6 === "]") { - parser2.cdata += "]"; + parser3.cdata += "]"; } else { - parser2.cdata += "]]" + c6; - parser2.state = S.CDATA; + parser3.cdata += "]]" + c6; + parser3.state = S.CDATA; } continue; case S.PROC_INST: if (c6 === "?") { - parser2.state = S.PROC_INST_ENDING; + parser3.state = S.PROC_INST_ENDING; } else if (isWhitespace(c6)) { - parser2.state = S.PROC_INST_BODY; + parser3.state = S.PROC_INST_BODY; } else { - parser2.procInstName += c6; + parser3.procInstName += c6; } continue; case S.PROC_INST_BODY: - if (!parser2.procInstBody && isWhitespace(c6)) { + if (!parser3.procInstBody && isWhitespace(c6)) { continue; } else if (c6 === "?") { - parser2.state = S.PROC_INST_ENDING; + parser3.state = S.PROC_INST_ENDING; } else { - parser2.procInstBody += c6; + parser3.procInstBody += c6; } continue; case S.PROC_INST_ENDING: if (c6 === ">") { - emitNode(parser2, "onprocessinginstruction", { - name: parser2.procInstName, - body: parser2.procInstBody + emitNode(parser3, "onprocessinginstruction", { + name: parser3.procInstName, + body: parser3.procInstBody }); - parser2.procInstName = parser2.procInstBody = ""; - parser2.state = S.TEXT; + parser3.procInstName = parser3.procInstBody = ""; + parser3.state = S.TEXT; } else { - parser2.procInstBody += "?" + c6; - parser2.state = S.PROC_INST_BODY; + parser3.procInstBody += "?" + c6; + parser3.state = S.PROC_INST_BODY; } continue; case S.OPEN_TAG: if (isMatch(nameBody, c6)) { - parser2.tagName += c6; + parser3.tagName += c6; } else { - newTag(parser2); + newTag(parser3); if (c6 === ">") { - openTag(parser2); + openTag(parser3); } else if (c6 === "/") { - parser2.state = S.OPEN_TAG_SLASH; + parser3.state = S.OPEN_TAG_SLASH; } else { if (!isWhitespace(c6)) { - strictFail(parser2, "Invalid character in tag name"); + strictFail(parser3, "Invalid character in tag name"); } - parser2.state = S.ATTRIB; + parser3.state = S.ATTRIB; } } continue; case S.OPEN_TAG_SLASH: if (c6 === ">") { - openTag(parser2, true); - closeTag(parser2); + openTag(parser3, true); + closeTag(parser3); } else { - strictFail(parser2, "Forward-slash in opening tag not followed by >"); - parser2.state = S.ATTRIB; + strictFail(parser3, "Forward-slash in opening tag not followed by >"); + parser3.state = S.ATTRIB; } continue; case S.ATTRIB: if (isWhitespace(c6)) { continue; } else if (c6 === ">") { - openTag(parser2); + openTag(parser3); } else if (c6 === "/") { - parser2.state = S.OPEN_TAG_SLASH; + parser3.state = S.OPEN_TAG_SLASH; } else if (isMatch(nameStart, c6)) { - parser2.attribName = c6; - parser2.attribValue = ""; - parser2.state = S.ATTRIB_NAME; + parser3.attribName = c6; + parser3.attribValue = ""; + parser3.state = S.ATTRIB_NAME; } else { - strictFail(parser2, "Invalid attribute name"); + strictFail(parser3, "Invalid attribute name"); } continue; case S.ATTRIB_NAME: if (c6 === "=") { - parser2.state = S.ATTRIB_VALUE; + parser3.state = S.ATTRIB_VALUE; } else if (c6 === ">") { - strictFail(parser2, "Attribute without value"); - parser2.attribValue = parser2.attribName; - attrib(parser2); - openTag(parser2); + strictFail(parser3, "Attribute without value"); + parser3.attribValue = parser3.attribName; + attrib(parser3); + openTag(parser3); } else if (isWhitespace(c6)) { - parser2.state = S.ATTRIB_NAME_SAW_WHITE; + parser3.state = S.ATTRIB_NAME_SAW_WHITE; } else if (isMatch(nameBody, c6)) { - parser2.attribName += c6; + parser3.attribName += c6; } else { - strictFail(parser2, "Invalid attribute name"); + strictFail(parser3, "Invalid attribute name"); } continue; case S.ATTRIB_NAME_SAW_WHITE: if (c6 === "=") { - parser2.state = S.ATTRIB_VALUE; + parser3.state = S.ATTRIB_VALUE; } else if (isWhitespace(c6)) { continue; } else { - strictFail(parser2, "Attribute without value"); - parser2.tag.attributes[parser2.attribName] = ""; - parser2.attribValue = ""; - emitNode(parser2, "onattribute", { - name: parser2.attribName, + strictFail(parser3, "Attribute without value"); + parser3.tag.attributes[parser3.attribName] = ""; + parser3.attribValue = ""; + emitNode(parser3, "onattribute", { + name: parser3.attribName, value: "" }); - parser2.attribName = ""; + parser3.attribName = ""; if (c6 === ">") { - openTag(parser2); + openTag(parser3); } else if (isMatch(nameStart, c6)) { - parser2.attribName = c6; - parser2.state = S.ATTRIB_NAME; + parser3.attribName = c6; + parser3.state = S.ATTRIB_NAME; } else { - strictFail(parser2, "Invalid attribute name"); - parser2.state = S.ATTRIB; + strictFail(parser3, "Invalid attribute name"); + parser3.state = S.ATTRIB; } } continue; @@ -84922,88 +85025,88 @@ var require_sax = __commonJS({ if (isWhitespace(c6)) { continue; } else if (isQuote(c6)) { - parser2.q = c6; - parser2.state = S.ATTRIB_VALUE_QUOTED; + parser3.q = c6; + parser3.state = S.ATTRIB_VALUE_QUOTED; } else { - if (!parser2.opt.unquotedAttributeValues) { - error2(parser2, "Unquoted attribute value"); + if (!parser3.opt.unquotedAttributeValues) { + error2(parser3, "Unquoted attribute value"); } - parser2.state = S.ATTRIB_VALUE_UNQUOTED; - parser2.attribValue = c6; + parser3.state = S.ATTRIB_VALUE_UNQUOTED; + parser3.attribValue = c6; } continue; case S.ATTRIB_VALUE_QUOTED: - if (c6 !== parser2.q) { + if (c6 !== parser3.q) { if (c6 === "&") { - parser2.state = S.ATTRIB_VALUE_ENTITY_Q; + parser3.state = S.ATTRIB_VALUE_ENTITY_Q; } else { - parser2.attribValue += c6; + parser3.attribValue += c6; } continue; } - attrib(parser2); - parser2.q = ""; - parser2.state = S.ATTRIB_VALUE_CLOSED; + attrib(parser3); + parser3.q = ""; + parser3.state = S.ATTRIB_VALUE_CLOSED; continue; case S.ATTRIB_VALUE_CLOSED: if (isWhitespace(c6)) { - parser2.state = S.ATTRIB; + parser3.state = S.ATTRIB; } else if (c6 === ">") { - openTag(parser2); + openTag(parser3); } else if (c6 === "/") { - parser2.state = S.OPEN_TAG_SLASH; + parser3.state = S.OPEN_TAG_SLASH; } else if (isMatch(nameStart, c6)) { - strictFail(parser2, "No whitespace between attributes"); - parser2.attribName = c6; - parser2.attribValue = ""; - parser2.state = S.ATTRIB_NAME; + strictFail(parser3, "No whitespace between attributes"); + parser3.attribName = c6; + parser3.attribValue = ""; + parser3.state = S.ATTRIB_NAME; } else { - strictFail(parser2, "Invalid attribute name"); + strictFail(parser3, "Invalid attribute name"); } continue; case S.ATTRIB_VALUE_UNQUOTED: if (!isAttribEnd(c6)) { if (c6 === "&") { - parser2.state = S.ATTRIB_VALUE_ENTITY_U; + parser3.state = S.ATTRIB_VALUE_ENTITY_U; } else { - parser2.attribValue += c6; + parser3.attribValue += c6; } continue; } - attrib(parser2); + attrib(parser3); if (c6 === ">") { - openTag(parser2); + openTag(parser3); } else { - parser2.state = S.ATTRIB; + parser3.state = S.ATTRIB; } continue; case S.CLOSE_TAG: - if (!parser2.tagName) { + if (!parser3.tagName) { if (isWhitespace(c6)) { continue; } else if (notMatch(nameStart, c6)) { - if (parser2.script) { - parser2.script += "") { - closeTag(parser2); + closeTag(parser3); } else if (isMatch(nameBody, c6)) { - parser2.tagName += c6; - } else if (parser2.script) { - parser2.script += "") { - closeTag(parser2); + closeTag(parser3); } else { - strictFail(parser2, "Invalid characters in closing tag"); + strictFail(parser3, "Invalid characters in closing tag"); } continue; case S.TEXT_ENTITY: @@ -85021,7 +85124,7 @@ var require_sax = __commonJS({ case S.ATTRIB_VALUE_ENTITY_U: var returnState; var buffer2; - switch (parser2.state) { + switch (parser3.state) { case S.TEXT_ENTITY: returnState = S.TEXT; buffer2 = "textNode"; @@ -85036,34 +85139,34 @@ var require_sax = __commonJS({ break; } if (c6 === ";") { - var parsedEntity = parseEntity(parser2); - if (parser2.opt.unparsedEntities && !Object.values(sax.XML_ENTITIES).includes(parsedEntity)) { - parser2.entity = ""; - parser2.state = returnState; - parser2.write(parsedEntity); + var parsedEntity = parseEntity(parser3); + if (parser3.opt.unparsedEntities && !Object.values(sax.XML_ENTITIES).includes(parsedEntity)) { + parser3.entity = ""; + parser3.state = returnState; + parser3.write(parsedEntity); } else { - parser2[buffer2] += parsedEntity; - parser2.entity = ""; - parser2.state = returnState; + parser3[buffer2] += parsedEntity; + parser3.entity = ""; + parser3.state = returnState; } - } else if (isMatch(parser2.entity.length ? entityBody : entityStart, c6)) { - parser2.entity += c6; + } else if (isMatch(parser3.entity.length ? entityBody : entityStart, c6)) { + parser3.entity += c6; } else { - strictFail(parser2, "Invalid character in entity name"); - parser2[buffer2] += "&" + parser2.entity + c6; - parser2.entity = ""; - parser2.state = returnState; + strictFail(parser3, "Invalid character in entity name"); + parser3[buffer2] += "&" + parser3.entity + c6; + parser3.entity = ""; + parser3.state = returnState; } continue; default: { - throw new Error(parser2, "Unknown state: " + parser2.state); + throw new Error(parser3, "Unknown state: " + parser3.state); } } } - if (parser2.position >= parser2.bufferCheckPosition) { - checkBufferLength(parser2); + if (parser3.position >= parser3.bufferCheckPosition) { + checkBufferLength(parser3); } - return parser2; + return parser3; } if (!String.fromCodePoint) { (function() { @@ -85217,8 +85320,8 @@ var require_parser = __commonJS({ return Object.defineProperty(obj, key, descriptor); }; exports2.Parser = (function(superClass) { - extend2(Parser, superClass); - function Parser(opts) { + extend2(Parser2, superClass); + function Parser2(opts) { this.parseStringPromise = bind2(this.parseStringPromise, this); this.parseString = bind2(this.parseString, this); this.reset = bind2(this.reset, this); @@ -85251,7 +85354,7 @@ var require_parser = __commonJS({ } this.reset(); } - Parser.prototype.processAsync = function() { + Parser2.prototype.processAsync = function() { var chunk, err; try { if (this.remaining.length <= this.options.chunkSize) { @@ -85273,7 +85376,7 @@ var require_parser = __commonJS({ } } }; - Parser.prototype.assignOrPush = function(obj, key, newValue) { + Parser2.prototype.assignOrPush = function(obj, key, newValue) { if (!(key in obj)) { if (!this.options.explicitArray) { return defineProperty(obj, key, newValue); @@ -85287,7 +85390,7 @@ var require_parser = __commonJS({ return obj[key].push(newValue); } }; - Parser.prototype.reset = function() { + Parser2.prototype.reset = function() { var attrkey, charkey, ontext, stack; this.removeAllListeners(); this.saxParser = sax.parser(this.options.strict, { @@ -85352,7 +85455,7 @@ var require_parser = __commonJS({ })(this); this.saxParser.onclosetag = /* @__PURE__ */ (function(_this) { return function() { - var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s6, xpath; + var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath; obj = stack.pop(); nodeName = obj["#name"]; if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) { @@ -85362,7 +85465,7 @@ var require_parser = __commonJS({ cdata = obj.cdata; delete obj.cdata; } - s6 = stack[stack.length - 1]; + s = stack[stack.length - 1]; if (obj[charkey].match(/^\s*$/) && !cdata) { emptyStr = obj[charkey]; delete obj[charkey]; @@ -85398,7 +85501,7 @@ var require_parser = __commonJS({ (function() { var err; try { - return obj = _this.options.validator(xpath, s6 && s6[nodeName], obj); + return obj = _this.options.validator(xpath, s && s[nodeName], obj); } catch (error1) { err = error1; return _this.emit("error", err); @@ -85420,14 +85523,14 @@ var require_parser = __commonJS({ node[_this.options.childkey] = obj; } obj = node; - } else if (s6) { - s6[_this.options.childkey] = s6[_this.options.childkey] || []; + } else if (s) { + s[_this.options.childkey] = s[_this.options.childkey] || []; objClone = {}; for (key in obj) { if (!hasProp.call(obj, key)) continue; defineProperty(objClone, key, obj[key]); } - s6[_this.options.childkey].push(objClone); + s[_this.options.childkey].push(objClone); delete obj["#name"]; if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) { obj = obj[charkey]; @@ -85435,7 +85538,7 @@ var require_parser = __commonJS({ } } if (stack.length > 0) { - return _this.assignOrPush(s6, nodeName, obj); + return _this.assignOrPush(s, nodeName, obj); } else { if (_this.options.explicitRoot) { old = obj; @@ -85450,12 +85553,12 @@ var require_parser = __commonJS({ })(this); ontext = /* @__PURE__ */ (function(_this) { return function(text) { - var charChild, s6; - s6 = stack[stack.length - 1]; - if (s6) { - s6[charkey] += text; + var charChild, s; + s = stack[stack.length - 1]; + if (s) { + s[charkey] += text; if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || text.replace(/\\n/g, "").trim() !== "")) { - s6[_this.options.childkey] = s6[_this.options.childkey] || []; + s[_this.options.childkey] = s[_this.options.childkey] || []; charChild = { "#name": "__text__" }; @@ -85463,24 +85566,24 @@ var require_parser = __commonJS({ if (_this.options.normalize) { charChild[charkey] = charChild[charkey].replace(/\s{2,}/g, " ").trim(); } - s6[_this.options.childkey].push(charChild); + s[_this.options.childkey].push(charChild); } - return s6; + return s; } }; })(this); this.saxParser.ontext = ontext; return this.saxParser.oncdata = /* @__PURE__ */ (function(_this) { return function(text) { - var s6; - s6 = ontext(text); - if (s6) { - return s6.cdata = true; + var s; + s = ontext(text); + if (s) { + return s.cdata = true; } }; })(this); }; - Parser.prototype.parseString = function(str, cb) { + Parser2.prototype.parseString = function(str, cb) { var err; if (cb != null && typeof cb === "function") { this.on("end", function(result) { @@ -85515,23 +85618,23 @@ var require_parser = __commonJS({ } } }; - Parser.prototype.parseStringPromise = function(str) { + Parser2.prototype.parseStringPromise = function(str) { return new Promise(/* @__PURE__ */ (function(_this) { - return function(resolve4, reject2) { + return function(resolve8, reject2) { return _this.parseString(str, function(err, value) { if (err) { return reject2(err); } else { - return resolve4(value); + return resolve8(value); } }); }; })(this)); }; - return Parser; + return Parser2; })(events); exports2.parseString = function(str, a6, b6) { - var cb, options, parser2; + var cb, options, parser3; if (b6 != null) { if (typeof b6 === "function") { cb = b6; @@ -85545,16 +85648,16 @@ var require_parser = __commonJS({ } options = {}; } - parser2 = new exports2.Parser(options); - return parser2.parseString(str, cb); + parser3 = new exports2.Parser(options); + return parser3.parseString(str, cb); }; exports2.parseStringPromise = function(str, a6) { - var options, parser2; + var options, parser3; if (typeof a6 === "object") { options = a6; } - parser2 = new exports2.Parser(options); - return parser2.parseStringPromise(str); + parser3 = new exports2.Parser(options); + return parser3.parseStringPromise(str); }; }).call(exports2); } @@ -85566,7 +85669,7 @@ var require_xml2js = __commonJS({ "use strict"; (function() { "use strict"; - var builder, defaults4, parser2, processors, extend2 = function(child, parent2) { + var builder, defaults4, parser3, processors, extend2 = function(child, parent2) { for (var key in parent2) { if (hasProp.call(parent2, key)) child[key] = parent2[key]; } @@ -85580,7 +85683,7 @@ var require_xml2js = __commonJS({ }, hasProp = {}.hasOwnProperty; defaults4 = require_defaults2(); builder = require_builder(); - parser2 = require_parser(); + parser3 = require_parser(); processors = require_processors(); exports2.defaults = defaults4.defaults; exports2.processors = processors; @@ -85592,9 +85695,9 @@ var require_xml2js = __commonJS({ return ValidationError; })(Error); exports2.Builder = builder.Builder; - exports2.Parser = parser2.Parser; - exports2.parseString = parser2.parseString; - exports2.parseStringPromise = parser2.parseStringPromise; + exports2.Parser = parser3.Parser; + exports2.parseString = parser3.parseString; + exports2.parseStringPromise = parser3.parseStringPromise; }).call(exports2); } }); @@ -85637,15 +85740,15 @@ var require_utils9 = __commonJS({ } var toString3 = Object.prototype.toString; exports2.toString = toString3; - var isFunction2 = function isFunction3(value) { + var isFunction3 = function isFunction4(value) { return typeof value === "function"; }; - if (isFunction2(/x/)) { - exports2.isFunction = isFunction2 = function(value) { + if (isFunction3(/x/)) { + exports2.isFunction = isFunction3 = function(value) { return typeof value === "function" && toString3.call(value) === "[object Function]"; }; } - exports2.isFunction = isFunction2; + exports2.isFunction = isFunction3; var isArray = Array.isArray || function(value) { return value && typeof value === "object" ? toString3.call(value) === "[object Array]" : false; }; @@ -85688,8 +85791,8 @@ var require_utils9 = __commonJS({ frame._parent = object; return frame; } - function blockParams(params, ids) { - params.path = ids; + function blockParams(params, ids2) { + params.path = ids2; return params; } function appendContextPath(contextPath, id) { @@ -86393,15 +86496,15 @@ var require_runtime = __commonJS({ throw new _exception2["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version (" + compilerInfo[1] + ")."); } } - function template(templateSpec, env2) { - if (!env2) { + function template(templateSpec, env3) { + if (!env3) { throw new _exception2["default"]("No environment passed to template"); } if (!templateSpec || !templateSpec.main) { throw new _exception2["default"]("Unknown template object: " + typeof templateSpec); } templateSpec.main.decorator = templateSpec.main_d; - env2.VM.checkRevision(templateSpec.compiler); + env3.VM.checkRevision(templateSpec.compiler); var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7; function invokePartialWrapper(partial, context5, options) { if (options.hash) { @@ -86410,19 +86513,19 @@ var require_runtime = __commonJS({ options.ids[0] = true; } } - partial = env2.VM.resolvePartial.call(this, partial, context5, options); + partial = env3.VM.resolvePartial.call(this, partial, context5, options); options.hooks = this.hooks; options.protoAccessControl = this.protoAccessControl; - var result = env2.VM.invokePartial.call(this, partial, context5, options); - if (result == null && env2.compile) { - options.partials[options.name] = env2.compile(partial, templateSpec.compilerOptions, env2); + var result = env3.VM.invokePartial.call(this, partial, context5, options); + if (result == null && env3.compile) { + options.partials[options.name] = env3.compile(partial, templateSpec.compilerOptions, env3); result = options.partials[options.name](context5, options); } if (result != null) { if (options.indent) { var lines = result.split("\n"); - for (var i6 = 0, l6 = lines.length; i6 < l6; i6++) { - if (!lines[i6] && i6 + 1 === l6) { + for (var i6 = 0, l3 = lines.length; i6 < l3; i6++) { + if (!lines[i6] && i6 + 1 === l3) { break; } lines[i6] = options.indent + lines[i6]; @@ -86500,7 +86603,7 @@ var require_runtime = __commonJS({ }, // An empty object to use as replacement for null-contexts nullContext: Object.seal({}), - noop: env2.VM.noop, + noop: env3.VM.noop, compilerInfo: templateSpec.compiler }; function ret(context5) { @@ -86528,14 +86631,14 @@ var require_runtime = __commonJS({ ret._setup = function(options) { if (!options.partial) { var mergedHelpers = {}; - addHelpers(mergedHelpers, env2.helpers, container); + addHelpers(mergedHelpers, env3.helpers, container); addHelpers(mergedHelpers, options.helpers, container); container.helpers = mergedHelpers; if (templateSpec.usePartial) { - container.partials = container.mergeIfNeeded(options.partials, env2.partials); + container.partials = container.mergeIfNeeded(options.partials, env3.partials); } if (templateSpec.usePartial || templateSpec.useDecorators) { - container.decorators = Utils.extend({}, env2.decorators, options.decorators); + container.decorators = Utils.extend({}, env3.decorators, options.decorators); } container.hooks = {}; container.protoAccessControl = _internalProtoAccess.createProtoAccessControl(options); @@ -86777,7 +86880,7 @@ var require_parser2 = __commonJS({ "use strict"; exports2.__esModule = true; var handlebars = (function() { - var parser2 = { + var parser3 = { trace: function trace() { }, yy: {}, @@ -87034,7 +87137,7 @@ var require_parser2 = __commonJS({ parseError: function parseError(str, hash) { throw new Error(str); }, - parse: function parse4(input) { + parse: function parse3(input) { var self2 = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1; this.lexer.setInput(input); this.lexer.yy = this.yy; @@ -87045,10 +87148,10 @@ var require_parser2 = __commonJS({ lstack.push(yyloc); var ranges = this.lexer.options && this.lexer.options.ranges; if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError; - function popStack(n12) { - stack.length = stack.length - 2 * n12; - vstack.length = vstack.length - n12; - lstack.length = lstack.length - n12; + function popStack(n8) { + stack.length = stack.length - 2 * n8; + vstack.length = vstack.length - n8; + lstack.length = lstack.length - n8; } function lex() { var token; @@ -87058,7 +87161,7 @@ var require_parser2 = __commonJS({ } return token; } - var symbol, preErrorSymbol, state4, action5, a6, r6, yyval = {}, p6, len, newState, expected; + var symbol, preErrorSymbol, state4, action5, a6, r6, yyval = {}, p2, len, newState, expected; while (true) { state4 = stack[stack.length - 1]; if (this.defaultActions[state4]) { @@ -87073,8 +87176,8 @@ var require_parser2 = __commonJS({ var errStr = ""; if (!recovering) { expected = []; - for (p6 in table[state4]) if (this.terminals_[p6] && p6 > 2) { - expected.push("'" + this.terminals_[p6] + "'"); + for (p2 in table[state4]) if (this.terminals_[p2] && p2 > 2) { + expected.push("'" + this.terminals_[p2] + "'"); } if (this.lexer.showPosition) { errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; @@ -87199,8 +87302,8 @@ var require_parser2 = __commonJS({ this._more = true; return this; }, - less: function less(n12) { - this.unput(this.match.slice(n12)); + less: function less(n8) { + this.unput(this.match.slice(n8)); }, pastInput: function pastInput() { var past = this.matched.substr(0, this.matched.length - this.match.length); @@ -87468,13 +87571,13 @@ var require_parser2 = __commonJS({ lexer2.conditions = { "mu": { "rules": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "inclusive": true } }; return lexer2; })(); - parser2.lexer = lexer; - function Parser() { + parser3.lexer = lexer; + function Parser2() { this.yy = {}; } - Parser.prototype = parser2; - parser2.Parser = Parser; - return new Parser(); + Parser2.prototype = parser3; + parser3.Parser = Parser2; + return new Parser2(); })(); exports2["default"] = handlebars; module.exports = exports2["default"]; @@ -87518,12 +87621,12 @@ var require_visitor = __commonJS({ // Traverses a given array. If mutating, empty respnses will be removed // for child elements. acceptArray: function acceptArray(array) { - for (var i6 = 0, l6 = array.length; i6 < l6; i6++) { + for (var i6 = 0, l3 = array.length; i6 < l3; i6++) { this.acceptKey(array, i6); if (!array[i6]) { array.splice(i6, 1); i6--; - l6--; + l3--; } } }, @@ -87622,7 +87725,7 @@ var require_whitespace_control = __commonJS({ var isRoot = !this.isRootSeen; this.isRootSeen = true; var body2 = program.body; - for (var i6 = 0, l6 = body2.length; i6 < l6; i6++) { + for (var i6 = 0, l3 = body2.length; i6 < l3; i6++) { var current = body2[i6], strip = this.accept(current); if (!strip) { continue; @@ -87810,7 +87913,7 @@ var require_helpers3 = __commonJS({ function preparePath(data, parts, loc) { loc = this.locInfo(loc); var original = data ? "@" : "", dig = [], depth = 0; - for (var i6 = 0, l6 = parts.length; i6 < l6; i6++) { + for (var i6 = 0, l3 = parts.length; i6 < l3; i6++) { var part = parts[i6].part, isLiteral = parts[i6].original !== part; original += (parts[i6].separator || "") + part; if (!isLiteral && (part === ".." || part === "." || part === "this")) { @@ -87947,7 +88050,7 @@ var require_base2 = __commonJS({ "use strict"; exports2.__esModule = true; exports2.parseWithoutProcessing = parseWithoutProcessing; - exports2.parse = parse4; + exports2.parse = parse3; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; @@ -87989,7 +88092,7 @@ var require_base2 = __commonJS({ var ast = _parser2["default"].parse(input); return ast; } - function parse4(input, options) { + function parse3(input, options) { var ast = parseWithoutProcessing(input, options); var strip = new _whitespaceControl2["default"](options); return strip.accept(ast); @@ -88279,9 +88382,9 @@ var require_compiler = __commonJS({ this.opcode("pushLiteral", "null"); }, Hash: function Hash2(hash) { - var pairs = hash.pairs, i6 = 0, l6 = pairs.length; + var pairs = hash.pairs, i6 = 0, l3 = pairs.length; this.opcode("pushHash"); - for (; i6 < l6; i6++) { + for (; i6 < l3; i6++) { this.pushParam(pairs[i6].value); } while (i6--) { @@ -88325,7 +88428,7 @@ var require_compiler = __commonJS({ } }, pushParams: function pushParams(params) { - for (var i6 = 0, l6 = params.length; i6 < l6; i6++) { + for (var i6 = 0, l3 = params.length; i6 < l3; i6++) { this.pushParam(params[i6]); } }, @@ -88384,7 +88487,7 @@ var require_compiler = __commonJS({ } } }; - function precompile(input, options, env2) { + function precompile(input, options, env3) { if (input == null || typeof input !== "string" && input.type !== "Program") { throw new _exception2["default"]("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input); } @@ -88395,10 +88498,10 @@ var require_compiler = __commonJS({ if (options.compat) { options.useDepths = true; } - var ast = env2.parse(input, options), environment = new env2.Compiler().compile(ast, options); - return new env2.JavaScriptCompiler().compile(environment, options); + var ast = env3.parse(input, options), environment = new env3.Compiler().compile(ast, options); + return new env3.JavaScriptCompiler().compile(environment, options); } - function compile(input, options, env2) { + function compile(input, options, env3) { if (options === void 0) options = {}; if (input == null || typeof input !== "string" && input.type !== "Program") { throw new _exception2["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input); @@ -88412,8 +88515,8 @@ var require_compiler = __commonJS({ } var compiled = void 0; function compileInput() { - var ast = env2.parse(input, options), environment = new env2.Compiler().compile(ast, options), templateSpec = new env2.JavaScriptCompiler().compile(environment, options, void 0, true); - return env2.template(templateSpec); + var ast = env3.parse(input, options), environment = new env3.Compiler().compile(ast, options), templateSpec = new env3.JavaScriptCompiler().compile(environment, options, void 0, true); + return env3.template(templateSpec); } function ret(context5, execOptions) { if (!compiled) { @@ -88612,7 +88715,7 @@ var require_util17 = __commonJS({ return url2; } exports2.urlGenerate = urlGenerate; - function normalize4(aPath) { + function normalize5(aPath) { var path10 = aPath; var url2 = urlParse(aPath); if (url2) { @@ -88649,8 +88752,8 @@ var require_util17 = __commonJS({ } return path10; } - exports2.normalize = normalize4; - function join10(aRoot, aPath) { + exports2.normalize = normalize5; + function join11(aRoot, aPath) { if (aRoot === "") { aRoot = "."; } @@ -88675,18 +88778,18 @@ var require_util17 = __commonJS({ aRootUrl.host = aPath; return urlGenerate(aRootUrl); } - var joined = aPath.charAt(0) === "/" ? aPath : normalize4(aRoot.replace(/\/+$/, "") + "/" + aPath); + var joined = aPath.charAt(0) === "/" ? aPath : normalize5(aRoot.replace(/\/+$/, "") + "/" + aPath); if (aRootUrl) { aRootUrl.path = joined; return urlGenerate(aRootUrl); } return joined; } - exports2.join = join10; + exports2.join = join11; exports2.isAbsolute = function(aPath) { return aPath.charAt(0) === "/" || urlRegexp.test(aPath); }; - function relative2(aRoot, aPath) { + function relative3(aRoot, aPath) { if (aRoot === "") { aRoot = "."; } @@ -88705,13 +88808,13 @@ var require_util17 = __commonJS({ } return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); } - exports2.relative = relative2; + exports2.relative = relative3; var supportsNullProto = (function() { var obj = /* @__PURE__ */ Object.create(null); return !("__proto__" in obj); })(); - function identity(s6) { - return s6; + function identity(s) { + return s; } function toSetString(aStr) { if (isProtoString(aStr)) { @@ -88727,19 +88830,19 @@ var require_util17 = __commonJS({ return aStr; } exports2.fromSetString = supportsNullProto ? identity : fromSetString; - function isProtoString(s6) { - if (!s6) { + function isProtoString(s) { + if (!s) { return false; } - var length = s6.length; + var length = s.length; if (length < 9) { return false; } - if (s6.charCodeAt(length - 1) !== 95 || s6.charCodeAt(length - 2) !== 95 || s6.charCodeAt(length - 3) !== 111 || s6.charCodeAt(length - 4) !== 116 || s6.charCodeAt(length - 5) !== 111 || s6.charCodeAt(length - 6) !== 114 || s6.charCodeAt(length - 7) !== 112 || s6.charCodeAt(length - 8) !== 95 || s6.charCodeAt(length - 9) !== 95) { + 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 i6 = length - 10; i6 >= 0; i6--) { - if (s6.charCodeAt(i6) !== 36) { + if (s.charCodeAt(i6) !== 36) { return false; } } @@ -88855,9 +88958,9 @@ var require_util17 = __commonJS({ parsed.path = parsed.path.substring(0, index2 + 1); } } - sourceURL = join10(urlGenerate(parsed), sourceURL); + sourceURL = join11(urlGenerate(parsed), sourceURL); } - return normalize4(sourceURL); + return normalize5(sourceURL); } exports2.computeSourceURL = computeSourceURL; } @@ -89312,30 +89415,30 @@ var require_binary_search = __commonJS({ var require_quick_sort = __commonJS({ "node_modules/source-map/lib/quick-sort.js"(exports2) { "use strict"; - function swap(ary, x6, y2) { - var temp = ary[x6]; - ary[x6] = ary[y2]; - ary[y2] = temp; + function swap(ary, x2, y) { + var temp = ary[x2]; + ary[x2] = ary[y]; + ary[y] = temp; } function randomIntInRange(low, high) { return Math.round(low + Math.random() * (high - low)); } - function doQuickSort(ary, comparator, p6, r6) { - if (p6 < r6) { - var pivotIndex = randomIntInRange(p6, r6); - var i6 = p6 - 1; + function doQuickSort(ary, comparator, p2, r6) { + if (p2 < r6) { + var pivotIndex = randomIntInRange(p2, r6); + var i6 = p2 - 1; swap(ary, pivotIndex, r6); var pivot = ary[r6]; - for (var j7 = p6; j7 < r6; j7++) { + for (var j7 = p2; j7 < r6; j7++) { if (comparator(ary[j7], pivot) <= 0) { i6 += 1; swap(ary, i6, j7); } } swap(ary, i6 + 1, j7); - var q7 = i6 + 1; - doQuickSort(ary, comparator, p6, q7 - 1); - doQuickSort(ary, comparator, q7 + 1, r6); + var q3 = i6 + 1; + doQuickSort(ary, comparator, p2, q3 - 1); + doQuickSort(ary, comparator, q3 + 1, r6); } } exports2.quickSort = function(ary, comparator) { @@ -89495,8 +89598,8 @@ var require_source_map_consumer = __commonJS({ }); this._names = ArraySet.fromArray(names.map(String), true); this._sources = ArraySet.fromArray(sources, true); - this._absoluteSources = this._sources.toArray().map(function(s6) { - return util3.computeSourceURL(sourceRoot, s6, aSourceMapURL); + this._absoluteSources = this._sources.toArray().map(function(s) { + return util3.computeSourceURL(sourceRoot, s, aSourceMapURL); }); this.sourceRoot = sourceRoot; this.sourcesContent = sourcesContent; @@ -89533,8 +89636,8 @@ var require_source_map_consumer = __commonJS({ ); smc.file = aSourceMap._file; smc._sourceMapURL = aSourceMapURL; - smc._absoluteSources = smc._sources.toArray().map(function(s6) { - return util3.computeSourceURL(smc.sourceRoot, s6, aSourceMapURL); + smc._absoluteSources = smc._sources.toArray().map(function(s) { + return util3.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); }); var generatedMappings = aSourceMap._mappings.toArray().slice(); var destGeneratedMappings = smc.__generatedMappings = []; @@ -89801,11 +89904,11 @@ var require_source_map_consumer = __commonJS({ line: -1, column: 0 }; - this._sections = sections.map(function(s6) { - if (s6.url) { + this._sections = sections.map(function(s) { + if (s.url) { throw new Error("Support for url field in sections not implemented."); } - var offset = util3.getArg(s6, "offset"); + var offset = util3.getArg(s, "offset"); var offsetLine = util3.getArg(offset, "line"); var offsetColumn = util3.getArg(offset, "column"); if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) { @@ -89819,7 +89922,7 @@ var require_source_map_consumer = __commonJS({ generatedLine: offsetLine + 1, generatedColumn: offsetColumn + 1 }, - consumer: new SourceMapConsumer(util3.getArg(s6, "map"), aSourceMapURL) + consumer: new SourceMapConsumer(util3.getArg(s, "map"), aSourceMapURL) }; }); } @@ -89869,8 +89972,8 @@ var require_source_map_consumer = __commonJS({ }); }; IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function(s6) { - return s6.consumer.hasContentsOfAllSources(); + return this._sections.every(function(s) { + return s.consumer.hasContentsOfAllSources(); }); }; IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { @@ -90438,8 +90541,8 @@ var require_javascript_compiler = __commonJS({ this.compileChildren(environment, options); this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat; this.useBlockParams = this.useBlockParams || environment.useBlockParams; - var opcodes = environment.opcodes, opcode = void 0, firstLoc = void 0, i6 = void 0, l6 = void 0; - for (i6 = 0, l6 = opcodes.length; i6 < l6; i6++) { + var opcodes = environment.opcodes, opcode = void 0, firstLoc = void 0, i6 = void 0, l3 = void 0; + for (i6 = 0, l3 = opcodes.length; i6 < l3; i6++) { opcode = opcodes[i6]; this.source.currentLocation = opcode.loc; firstLoc = firstLoc || opcode.loc; @@ -90477,7 +90580,7 @@ var require_javascript_compiler = __commonJS({ var _context = this.context; var programs = _context.programs; var decorators = _context.decorators; - for (i6 = 0, l6 = programs.length; i6 < l6; i6++) { + for (i6 = 0, l3 = programs.length; i6 < l3; i6++) { ret[i6] = programs[i6]; if (decorators[i6]) { ret[i6 + "_d"] = decorators[i6]; @@ -91008,7 +91111,7 @@ var require_javascript_compiler = __commonJS({ compiler: JavaScriptCompiler, compileChildren: function compileChildren(environment, options) { var children2 = environment.children, child = void 0, compiler = void 0; - for (var i6 = 0, l6 = children2.length; i6 < l6; i6++) { + for (var i6 = 0, l3 = children2.length; i6 < l3; i6++) { child = children2[i6]; compiler = new this.compiler(); var existing = this.matchExistingProgram(child); @@ -91079,15 +91182,15 @@ var require_javascript_compiler = __commonJS({ if (!this.isInline()) { throw new _exception2["default"]("replaceStack on non-inline"); } - var top = this.popStack(true); - if (top instanceof Literal) { - stack = [top.value]; + var top2 = this.popStack(true); + if (top2 instanceof Literal) { + stack = [top2.value]; prefix2 = ["(", stack]; usedLiteral = true; } else { createdStack = true; var _name = this.incrStack(); - prefix2 = ["((", this.push(_name), " = ", top, ")"]; + prefix2 = ["((", this.push(_name), " = ", top2, ")"]; stack = this.topStack(); } var item = callback.call(this, stack); @@ -91183,7 +91286,7 @@ var require_javascript_compiler = __commonJS({ }; }, setupParams: function setupParams(helper, paramSize, params) { - var options = {}, contexts = [], types3 = [], ids = [], objectArgs = !params, param = void 0; + var options = {}, contexts = [], types3 = [], ids2 = [], objectArgs = !params, param = void 0; if (objectArgs) { params = []; } @@ -91206,7 +91309,7 @@ var require_javascript_compiler = __commonJS({ param = this.popStack(); params[i6] = param; if (this.trackIds) { - ids[i6] = this.popStack(); + ids2[i6] = this.popStack(); } if (this.stringParams) { types3[i6] = this.popStack(); @@ -91217,7 +91320,7 @@ var require_javascript_compiler = __commonJS({ options.args = this.source.generateArray(params); } if (this.trackIds) { - options.ids = this.source.generateArray(ids); + options.ids = this.source.generateArray(ids2); } if (this.stringParams) { options.types = this.source.generateArray(types3); @@ -91250,7 +91353,7 @@ var require_javascript_compiler = __commonJS({ (function() { var reservedWords = "break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "); var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {}; - for (var i6 = 0, l6 = reservedWords.length; i6 < l6; i6++) { + for (var i6 = 0, l3 = reservedWords.length; i6 < l3; i6++) { compilerWords[reservedWords[i6]] = true; } })(); @@ -91344,23 +91447,23 @@ var require_printer = __commonJS({ PrintVisitor.prototype = new _visitor2["default"](); PrintVisitor.prototype.pad = function(string) { var out = ""; - for (var i6 = 0, l6 = this.padding; i6 < l6; i6++) { + for (var i6 = 0, l3 = this.padding; i6 < l3; i6++) { out += " "; } out += string + "\n"; return out; }; PrintVisitor.prototype.Program = function(program) { - var out = "", body2 = program.body, i6 = void 0, l6 = void 0; + var out = "", body2 = program.body, i6 = void 0, l3 = void 0; if (program.blockParams) { var blockParams = "BLOCK PARAMS: ["; - for (i6 = 0, l6 = program.blockParams.length; i6 < l6; i6++) { + for (i6 = 0, l3 = program.blockParams.length; i6 < l3; i6++) { blockParams += " " + program.blockParams[i6]; } blockParams += " ]"; out += this.pad(blockParams); } - for (i6 = 0, l6 = body2.length; i6 < l6; i6++) { + for (i6 = 0, l3 = body2.length; i6 < l3; i6++) { out += this.accept(body2[i6]); } this.padding--; @@ -91430,7 +91533,7 @@ var require_printer = __commonJS({ }; PrintVisitor.prototype.SubExpression = function(sexpr) { var params = sexpr.params, paramStrings = [], hash = void 0; - for (var i6 = 0, l6 = params.length; i6 < l6; i6++) { + for (var i6 = 0, l3 = params.length; i6 < l3; i6++) { paramStrings.push(this.accept(params[i6])); } params = "[" + paramStrings.join(", ") + "]"; @@ -91458,7 +91561,7 @@ var require_printer = __commonJS({ }; PrintVisitor.prototype.Hash = function(hash) { var pairs = hash.pairs, joinedPairs = []; - for (var i6 = 0, l6 = pairs.length; i6 < l6; i6++) { + for (var i6 = 0, l3 = pairs.length; i6 < l3; i6++) { joinedPairs.push(this.accept(pairs[i6])); } return "HASH{" + joinedPairs.join(", ") + "}"; @@ -91642,8 +91745,8 @@ var require_encode = __commonJS({ function getInverseReplacer(inverse) { var single = []; var multiple = []; - for (var _i3 = 0, _a5 = Object.keys(inverse); _i3 < _a5.length; _i3++) { - var k7 = _a5[_i3]; + for (var _i3 = 0, _a6 = Object.keys(inverse); _i3 < _a6.length; _i3++) { + var k7 = _a6[_i3]; if (k7.length === 1) { single.push("\\" + k7); } else { @@ -91801,27 +91904,27 @@ var require_ansi_to_html = __commonJS({ if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - function _createForOfIteratorHelper(o6, allowArrayLike) { - var it2 = typeof Symbol !== "undefined" && o6[Symbol.iterator] || o6["@@iterator"]; + function _createForOfIteratorHelper(o2, allowArrayLike) { + var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"]; if (!it2) { - if (Array.isArray(o6) || (it2 = _unsupportedIterableToArray(o6)) || allowArrayLike && o6 && typeof o6.length === "number") { - if (it2) o6 = it2; + if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray(o2)) || allowArrayLike && o2 && typeof o2.length === "number") { + if (it2) o2 = it2; var i6 = 0; - var F3 = function F4() { + var F2 = function F3() { }; - return { s: F3, n: function n12() { - if (i6 >= o6.length) return { done: true }; - return { done: false, value: o6[i6++] }; + return { s: F2, n: function n8() { + if (i6 >= o2.length) return { done: true }; + return { done: false, value: o2[i6++] }; }, e: function e6(_e7) { throw _e7; - }, f: F3 }; + }, f: F2 }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; - return { s: function s6() { - it2 = it2.call(o6); - }, n: function n12() { + return { s: function s() { + it2 = it2.call(o2); + }, n: function n8() { var step = it2.next(); normalCompletion = step.done; return step; @@ -91836,13 +91939,13 @@ var require_ansi_to_html = __commonJS({ } } }; } - function _unsupportedIterableToArray(o6, minLen) { - if (!o6) return; - if (typeof o6 === "string") return _arrayLikeToArray(o6, minLen); - var n12 = Object.prototype.toString.call(o6).slice(8, -1); - if (n12 === "Object" && o6.constructor) n12 = o6.constructor.name; - if (n12 === "Map" || n12 === "Set") return Array.from(o6); - if (n12 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n12)) return _arrayLikeToArray(o6, minLen); + function _unsupportedIterableToArray(o2, minLen) { + if (!o2) return; + if (typeof o2 === "string") return _arrayLikeToArray(o2, minLen); + var n8 = Object.prototype.toString.call(o2).slice(8, -1); + if (n8 === "Object" && o2.constructor) n8 = o2.constructor.name; + if (n8 === "Map" || n8 === "Set") return Array.from(o2); + if (n8 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n8)) return _arrayLikeToArray(o2, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; @@ -91888,8 +91991,8 @@ var require_ansi_to_html = __commonJS({ }); range6(0, 23).forEach(function(gray) { var c6 = gray + 232; - var l6 = toHexString(gray * 10 + 8); - colors[c6] = "#" + l6 + l6 + l6; + var l3 = toHexString(gray * 10 + 8); + colors[c6] = "#" + l3 + l3 + l3; }); return colors; } @@ -92083,23 +92186,23 @@ var require_ansi_to_html = __commonJS({ function remove() { return ""; } - function removeXterm256Foreground(m6, g1) { + function removeXterm256Foreground(m3, g1) { callback("xterm256Foreground", g1); return ""; } - function removeXterm256Background(m6, g1) { + function removeXterm256Background(m3, g1) { callback("xterm256Background", g1); return ""; } - function newline(m6) { + function newline(m3) { if (options.newline) { callback("display", -1); } else { - callback("text", m6); + callback("text", m3); } return ""; } - function ansiMess(m6, g1) { + function ansiMess(m3, g1) { ansiMatch = true; if (g1.trim().length === 0) { g1 = "0"; @@ -92118,12 +92221,12 @@ var require_ansi_to_html = __commonJS({ } return ""; } - function realText(m6) { - callback("text", m6); + function realText(m3) { + callback("text", m3); return ""; } - function rgb(m6) { - callback("rgb", m6); + function rgb(m3) { + callback("rgb", m3); return ""; } var tokens = [{ @@ -92196,7 +92299,7 @@ var require_ansi_to_html = __commonJS({ var results1 = []; var _text = text, length = _text.length; outer: while (length > 0) { - for (var i6 = 0, o6 = 0, len = tokens.length; o6 < len; i6 = ++o6) { + for (var i6 = 0, o2 = 0, len = tokens.length; o2 < len; i6 = ++o2) { var handler2 = tokens[i6]; process5(handler2, i6); if (text.length !== length) { @@ -93040,7 +93143,7 @@ var require_slack_notify = __commonJS({ if (!slackWebhookUrl) { return Promise.reject(new Error("SLACK_WEBHOOK_URL is not defined in the environment variables")); } - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { const url2 = new URL(slackWebhookUrl); const data = JSON.stringify(message); const options = { @@ -93059,7 +93162,7 @@ var require_slack_notify = __commonJS({ }); res.on("end", () => { if (res.statusCode === 200) { - resolve4(); + resolve8(); } else { reject2(new Error(`Failed to send message, status code: ${res.statusCode}, response: ${response}`)); } @@ -93082,34 +93185,34 @@ var require_common2 = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getTestName = exports2.stripAnsiFromErrors = exports2.stripAnsi = exports2.ansiRegex = void 0; - function ansiRegex3({ onlyFirst = false } = {}) { + function ansiRegex5({ onlyFirst = false } = {}) { const pattern = [ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))" ].join("|"); return new RegExp(pattern, onlyFirst ? void 0 : "g"); } - exports2.ansiRegex = ansiRegex3; - function stripAnsi3(message) { + exports2.ansiRegex = ansiRegex5; + function stripAnsi5(message) { if (typeof message !== "string") { throw new TypeError(`Expected a \`string\`, got \`${typeof message}\``); } - let sanitizedMessage = message.replace(ansiRegex3(), ""); + let sanitizedMessage = message.replace(ansiRegex5(), ""); sanitizedMessage = sanitizedMessage.replace(/[^\x00-\x7F]/g, ""); return sanitizedMessage; } - exports2.stripAnsi = stripAnsi3; + exports2.stripAnsi = stripAnsi5; function stripAnsiFromErrors2(report) { - var _a5; - if (!((_a5 = report === null || report === void 0 ? void 0 : report.results) === null || _a5 === void 0 ? void 0 : _a5.tests)) { + var _a6; + if (!((_a6 = report === null || report === void 0 ? void 0 : report.results) === null || _a6 === void 0 ? void 0 : _a6.tests)) { return report; } report.results.tests.forEach((test) => { if (test.message) { - test.message = stripAnsi3(test.message); + test.message = stripAnsi5(test.message); } if (test.trace) { - test.trace = stripAnsi3(test.trace); + test.trace = stripAnsi5(test.trace); } }); return report; @@ -93131,11 +93234,11 @@ var require_slack_reporter = __commonJS({ "use strict"; var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -93151,7 +93254,7 @@ var require_slack_reporter = __commonJS({ } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -93163,7 +93266,7 @@ var require_slack_reporter = __commonJS({ var common_1 = require_common2(); function sendTestResultsToSlack2(report_1) { return __awaiter16(this, arguments, void 0, function* (report, options = {}, logs = false) { - var _a5, _b2, _c6; + var _a6, _b3, _c7; if (options.token) { process.env.SLACK_WEBHOOK_URL = options.token; } @@ -93171,7 +93274,7 @@ var require_slack_reporter = __commonJS({ logs && console.log("No failed tests. Message not sent."); return; } - const message = (0, message_formatter_1.formatResultsMessage)(report, Object.assign(Object.assign({}, options), { title: (_a5 = options.title) !== null && _a5 !== void 0 ? _a5 : "Test Results", prefix: (_b2 = options.prefix) !== null && _b2 !== void 0 ? _b2 : "", suffix: (_c6 = options.suffix) !== null && _c6 !== void 0 ? _c6 : "" })); + const message = (0, message_formatter_1.formatResultsMessage)(report, Object.assign(Object.assign({}, options), { title: (_a6 = options.title) !== null && _a6 !== void 0 ? _a6 : "Test Results", prefix: (_b3 = options.prefix) !== null && _b3 !== void 0 ? _b3 : "", suffix: (_c7 = options.suffix) !== null && _c7 !== void 0 ? _c7 : "" })); yield (0, slack_notify_1.sendSlackMessage)(message); logs && console.log("Test results message sent to Slack."); }); @@ -93179,7 +93282,7 @@ var require_slack_reporter = __commonJS({ exports2.sendTestResultsToSlack = sendTestResultsToSlack2; function sendFailedResultsToSlack2(report_1) { return __awaiter16(this, arguments, void 0, function* (report, options = {}, logs = false) { - var _a5, _b2, _c6; + var _a6, _b3, _c7; if (options.token) { process.env.SLACK_WEBHOOK_URL = options.token; } @@ -93188,7 +93291,7 @@ var require_slack_reporter = __commonJS({ } report = (0, common_1.stripAnsiFromErrors)(report); if (options.consolidated) { - const message = (0, message_formatter_1.formatConsolidatedFailedTestSummary)(report.results.tests, report.results.environment, Object.assign(Object.assign({}, options), { title: (_a5 = options.title) !== null && _a5 !== void 0 ? _a5 : "Failed Test Results", prefix: (_b2 = options.prefix) !== null && _b2 !== void 0 ? _b2 : "", suffix: (_c6 = options.suffix) !== null && _c6 !== void 0 ? _c6 : "" })); + const message = (0, message_formatter_1.formatConsolidatedFailedTestSummary)(report.results.tests, report.results.environment, Object.assign(Object.assign({}, options), { title: (_a6 = options.title) !== null && _a6 !== void 0 ? _a6 : "Failed Test Results", prefix: (_b3 = options.prefix) !== null && _b3 !== void 0 ? _b3 : "", suffix: (_c7 = options.suffix) !== null && _c7 !== void 0 ? _c7 : "" })); if (message) { yield (0, slack_notify_1.sendSlackMessage)(message); logs && console.log("Failed test summary sent to Slack."); @@ -93213,11 +93316,11 @@ var require_slack_reporter = __commonJS({ exports2.sendFailedResultsToSlack = sendFailedResultsToSlack2; function sendFlakyResultsToSlack2(report_1) { return __awaiter16(this, arguments, void 0, function* (report, options = {}, logs = false) { - var _a5, _b2, _c6; + var _a6, _b3, _c7; if (options.token) { process.env.SLACK_WEBHOOK_URL = options.token; } - const message = (0, message_formatter_1.formatFlakyTestsMessage)(report, Object.assign(Object.assign({}, options), { title: (_a5 = options.title) !== null && _a5 !== void 0 ? _a5 : "Flaky Tests", prefix: (_b2 = options.prefix) !== null && _b2 !== void 0 ? _b2 : "", suffix: (_c6 = options.suffix) !== null && _c6 !== void 0 ? _c6 : "" })); + const message = (0, message_formatter_1.formatFlakyTestsMessage)(report, Object.assign(Object.assign({}, options), { title: (_a6 = options.title) !== null && _a6 !== void 0 ? _a6 : "Flaky Tests", prefix: (_b3 = options.prefix) !== null && _b3 !== void 0 ? _b3 : "", suffix: (_c7 = options.suffix) !== null && _c7 !== void 0 ? _c7 : "" })); if (message) { yield (0, slack_notify_1.sendSlackMessage)(message); logs && console.log("Flaky tests message sent to Slack."); @@ -93229,12 +93332,12 @@ var require_slack_reporter = __commonJS({ exports2.sendFlakyResultsToSlack = sendFlakyResultsToSlack2; function sendAISummaryToSlack2(report_1) { return __awaiter16(this, arguments, void 0, function* (report, options = {}, logs = false) { - var _a5, _b2, _c6; + var _a6, _b3, _c7; if (options.token) { process.env.SLACK_WEBHOOK_URL = options.token; } if (options.consolidated) { - const message = (0, message_formatter_1.formatConsolidatedAiTestSummary)(report.results.tests, report.results.environment, Object.assign(Object.assign({}, options), { title: (_a5 = options.title) !== null && _a5 !== void 0 ? _a5 : "AI Test Summary", prefix: (_b2 = options.prefix) !== null && _b2 !== void 0 ? _b2 : "", suffix: (_c6 = options.suffix) !== null && _c6 !== void 0 ? _c6 : "" })); + const message = (0, message_formatter_1.formatConsolidatedAiTestSummary)(report.results.tests, report.results.environment, Object.assign(Object.assign({}, options), { title: (_a6 = options.title) !== null && _a6 !== void 0 ? _a6 : "AI Test Summary", prefix: (_b3 = options.prefix) !== null && _b3 !== void 0 ? _b3 : "", suffix: (_c7 = options.suffix) !== null && _c7 !== void 0 ? _c7 : "" })); if (message) { yield (0, slack_notify_1.sendSlackMessage)(message); logs && console.log("AI test summary sent to Slack."); @@ -93498,7 +93601,7 @@ var require_teams_notify = __commonJS({ if (!teamsWebhookUrl) { return Promise.reject(new Error("TEAMS_WEBHOOK_URL is not defined in the environment variables")); } - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { const url2 = new URL(teamsWebhookUrl); const data = JSON.stringify(message); const options = { @@ -93517,7 +93620,7 @@ var require_teams_notify = __commonJS({ }); res.on("end", () => { if (res.statusCode === 200) { - resolve4(); + resolve8(); } else { reject2(new Error(`Failed to send message, status code: ${res.statusCode}, response: ${response}`)); } @@ -93540,11 +93643,11 @@ var require_teams_reporter = __commonJS({ "use strict"; var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -93560,7 +93663,7 @@ var require_teams_reporter = __commonJS({ } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -93638,294 +93741,1046 @@ var require_dist6 = __commonJS({ } }); -// node_modules/y18n/build/index.cjs -var require_build = __commonJS({ - "node_modules/y18n/build/index.cjs"(exports2, module) { +// node_modules/cliui/build/lib/index.js +function addBorder(col, ts2, style) { + if (col.border) { + if (/[.']-+[.']/.test(ts2)) { + return ""; + } + if (ts2.trim().length !== 0) { + return style; + } + return " "; + } + return ""; +} +function _minWidth(col) { + const padding = col.padding || []; + const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0); + if (col.border) { + return minWidth + 4; + } + return minWidth; +} +function getWindowWidth() { + if (typeof process === "object" && process.stdout && process.stdout.columns) { + return process.stdout.columns; + } + return 80; +} +function alignRight(str, width) { + str = str.trim(); + const strWidth = mixin.stringWidth(str); + if (strWidth < width) { + return " ".repeat(width - strWidth) + str; + } + return str; +} +function alignCenter(str, width) { + str = str.trim(); + const strWidth = mixin.stringWidth(str); + if (strWidth >= width) { + return str; + } + return " ".repeat(width - strWidth >> 1) + str; +} +function cliui(opts, _mixin) { + mixin = _mixin; + return new UI({ + width: (opts === null || opts === void 0 ? void 0 : opts.width) || getWindowWidth(), + wrap: opts === null || opts === void 0 ? void 0 : opts.wrap + }); +} +var align, top, right, bottom, left, UI, mixin; +var init_lib = __esm({ + "node_modules/cliui/build/lib/index.js"() { "use strict"; - var fs16 = __require("fs"); - var util3 = __require("util"); - var path10 = __require("path"); - var shim; - var Y18N = class { + align = { + right: alignRight, + center: alignCenter + }; + top = 0; + right = 1; + bottom = 2; + left = 3; + UI = class { constructor(opts) { - opts = opts || {}; - this.directory = opts.directory || "./locales"; - this.updateFiles = typeof opts.updateFiles === "boolean" ? opts.updateFiles : true; - this.locale = opts.locale || "en"; - this.fallbackToLanguage = typeof opts.fallbackToLanguage === "boolean" ? opts.fallbackToLanguage : true; - this.cache = /* @__PURE__ */ Object.create(null); - this.writeQueue = []; + var _a6; + this.width = opts.width; + this.wrap = (_a6 = opts.wrap) !== null && _a6 !== void 0 ? _a6 : true; + this.rows = []; } - __(...args) { - if (typeof arguments[0] !== "string") { - return this._taggedLiteral(arguments[0], ...arguments); - } - const str = args.shift(); - let cb = function() { - }; - if (typeof args[args.length - 1] === "function") - cb = args.pop(); - cb = cb || function() { - }; - if (!this.cache[this.locale]) - this._readLocaleFile(); - if (!this.cache[this.locale][str] && this.updateFiles) { - this.cache[this.locale][str] = str; - this._enqueueWrite({ - directory: this.directory, - locale: this.locale, - cb - }); - } else { - cb(); - } - return shim.format.apply(shim.format, [this.cache[this.locale][str] || str].concat(args)); + span(...args) { + const cols = this.div(...args); + cols.span = true; } - __n() { - const args = Array.prototype.slice.call(arguments); - const singular = args.shift(); - const plural = args.shift(); - const quantity = args.shift(); - let cb = function() { - }; - if (typeof args[args.length - 1] === "function") - cb = args.pop(); - if (!this.cache[this.locale]) - this._readLocaleFile(); - let str = quantity === 1 ? singular : plural; - if (this.cache[this.locale][singular]) { - const entry = this.cache[this.locale][singular]; - str = entry[quantity === 1 ? "one" : "other"]; + resetOutput() { + this.rows = []; + } + div(...args) { + if (args.length === 0) { + this.div(""); } - if (!this.cache[this.locale][singular] && this.updateFiles) { - this.cache[this.locale][singular] = { - one: singular, - other: plural - }; - this._enqueueWrite({ - directory: this.directory, - locale: this.locale, - cb - }); - } else { - cb(); + if (this.wrap && this.shouldApplyLayoutDSL(...args) && typeof args[0] === "string") { + return this.applyLayoutDSL(args[0]); } - const values = [str]; - if (~str.indexOf("%d")) - values.push(quantity); - return shim.format.apply(shim.format, values.concat(args)); - } - setLocale(locale) { - this.locale = locale; - } - getLocale() { - return this.locale; - } - updateLocale(obj) { - if (!this.cache[this.locale]) - this._readLocaleFile(); - for (const key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - this.cache[this.locale][key] = obj[key]; + const cols = args.map((arg) => { + if (typeof arg === "string") { + return this.colFromString(arg); } - } + return arg; + }); + this.rows.push(cols); + return cols; } - _taggedLiteral(parts, ...args) { - let str = ""; - parts.forEach(function(part, i6) { - const arg = args[i6 + 1]; - str += part; - if (typeof arg !== "undefined") { - str += "%s"; + shouldApplyLayoutDSL(...args) { + return args.length === 1 && typeof args[0] === "string" && /[\t\n]/.test(args[0]); + } + applyLayoutDSL(str) { + const rows = str.split("\n").map((row) => row.split(" ")); + let leftColumnWidth = 0; + rows.forEach((columns) => { + if (columns.length > 1 && mixin.stringWidth(columns[0]) > leftColumnWidth) { + leftColumnWidth = Math.min(Math.floor(this.width * 0.5), mixin.stringWidth(columns[0])); } }); - return this.__.apply(this, [str].concat([].slice.call(args, 1))); + rows.forEach((columns) => { + this.div(...columns.map((r6, i6) => { + return { + text: r6.trim(), + padding: this.measurePadding(r6), + width: i6 === 0 && columns.length > 1 ? leftColumnWidth : void 0 + }; + })); + }); + return this.rows[this.rows.length - 1]; } - _enqueueWrite(work) { - this.writeQueue.push(work); - if (this.writeQueue.length === 1) - this._processWriteQueue(); + colFromString(text) { + return { + text, + padding: this.measurePadding(text) + }; } - _processWriteQueue() { - const _this = this; - const work = this.writeQueue[0]; - const directory = work.directory; - const locale = work.locale; - const cb = work.cb; - const languageFile = this._resolveLocaleFile(directory, locale); - const serializedLocale = JSON.stringify(this.cache[locale], null, 2); - shim.fs.writeFile(languageFile, serializedLocale, "utf-8", function(err) { - _this.writeQueue.shift(); - if (_this.writeQueue.length > 0) - _this._processWriteQueue(); - cb(err); + measurePadding(str) { + const noAnsi = mixin.stripAnsi(str); + return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length]; + } + toString() { + const lines = []; + this.rows.forEach((row) => { + this.rowToString(row, lines); }); + return lines.filter((line) => !line.hidden).map((line) => line.text).join("\n"); } - _readLocaleFile() { - let localeLookup = {}; - const languageFile = this._resolveLocaleFile(this.directory, this.locale); - try { - if (shim.fs.readFileSync) { - localeLookup = JSON.parse(shim.fs.readFileSync(languageFile, "utf-8")); + rowToString(row, lines) { + this.rasterize(row).forEach((rrow, r6) => { + let str = ""; + rrow.forEach((col, c6) => { + const { width } = row[c6]; + const wrapWidth = this.negatePadding(row[c6]); + let ts2 = col; + if (wrapWidth > mixin.stringWidth(col)) { + ts2 += " ".repeat(wrapWidth - mixin.stringWidth(col)); + } + if (row[c6].align && row[c6].align !== "left" && this.wrap) { + const fn = align[row[c6].align]; + ts2 = fn(ts2, wrapWidth); + if (mixin.stringWidth(ts2) < wrapWidth) { + ts2 += " ".repeat((width || 0) - mixin.stringWidth(ts2) - 1); + } + } + const padding = row[c6].padding || [0, 0, 0, 0]; + if (padding[left]) { + str += " ".repeat(padding[left]); + } + str += addBorder(row[c6], ts2, "| "); + str += ts2; + str += addBorder(row[c6], ts2, " |"); + if (padding[right]) { + str += " ".repeat(padding[right]); + } + if (r6 === 0 && lines.length > 0) { + str = this.renderInline(str, lines[lines.length - 1]); + } + }); + lines.push({ + text: str.replace(/ +$/, ""), + span: row.span + }); + }); + return lines; + } + // if the full 'source' can render in + // the target line, do so. + renderInline(source, previousLine) { + const match3 = source.match(/^ */); + const leadingWhitespace = match3 ? match3[0].length : 0; + const target = previousLine.text; + const targetTextWidth = mixin.stringWidth(target.trimRight()); + if (!previousLine.span) { + return source; + } + if (!this.wrap) { + previousLine.hidden = true; + return target + source; + } + if (leadingWhitespace < targetTextWidth) { + return source; + } + previousLine.hidden = true; + return target.trimRight() + " ".repeat(leadingWhitespace - targetTextWidth) + source.trimLeft(); + } + rasterize(row) { + const rrows = []; + const widths = this.columnWidths(row); + let wrapped; + row.forEach((col, c6) => { + col.width = widths[c6]; + if (this.wrap) { + wrapped = mixin.wrap(col.text, this.negatePadding(col), { hard: true }).split("\n"); + } else { + wrapped = col.text.split("\n"); } - } catch (err) { - if (err instanceof SyntaxError) { - err.message = "syntax error in " + languageFile; + if (col.border) { + wrapped.unshift("." + "-".repeat(this.negatePadding(col) + 2) + "."); + wrapped.push("'" + "-".repeat(this.negatePadding(col) + 2) + "'"); } - if (err.code === "ENOENT") - localeLookup = {}; - else - throw err; - } - this.cache[this.locale] = localeLookup; + if (col.padding) { + wrapped.unshift(...new Array(col.padding[top] || 0).fill("")); + wrapped.push(...new Array(col.padding[bottom] || 0).fill("")); + } + wrapped.forEach((str, r6) => { + if (!rrows[r6]) { + rrows.push([]); + } + const rrow = rrows[r6]; + for (let i6 = 0; i6 < c6; i6++) { + if (rrow[i6] === void 0) { + rrow.push(""); + } + } + rrow.push(str); + }); + }); + return rrows; } - _resolveLocaleFile(directory, locale) { - let file = shim.resolve(directory, "./", locale + ".json"); - if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf("_")) { - const languageFile = shim.resolve(directory, "./", locale.split("_")[0] + ".json"); - if (this._fileExistsSync(languageFile)) - file = languageFile; + negatePadding(col) { + let wrapWidth = col.width || 0; + if (col.padding) { + wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0); } - return file; - } - _fileExistsSync(file) { - return shim.exists(file); + if (col.border) { + wrapWidth -= 4; + } + return wrapWidth; } - }; - function y18n$1(opts, _shim) { - shim = _shim; - const y18n2 = new Y18N(opts); - return { - __: y18n2.__.bind(y18n2), - __n: y18n2.__n.bind(y18n2), - setLocale: y18n2.setLocale.bind(y18n2), - getLocale: y18n2.getLocale.bind(y18n2), - updateLocale: y18n2.updateLocale.bind(y18n2), - locale: y18n2.locale - }; - } - var nodePlatformShim = { - fs: { - readFileSync: fs16.readFileSync, - writeFile: fs16.writeFile - }, - format: util3.format, - resolve: path10.resolve, - exists: (file) => { - try { - return fs16.statSync(file).isFile(); - } catch (err) { - return false; + columnWidths(row) { + if (!this.wrap) { + return row.map((col) => { + return col.width || mixin.stringWidth(col.text); + }); } + let unset = row.length; + let remainingWidth = this.width; + const widths = row.map((col) => { + if (col.width) { + unset--; + remainingWidth -= col.width; + return col.width; + } + return void 0; + }); + const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0; + return widths.map((w, i6) => { + if (w === void 0) { + return Math.max(unsetWidth, _minWidth(row[i6])); + } + return w; + }); } }; - var y18n = (opts) => { - return y18n$1(opts, nodePlatformShim); - }; - module.exports = y18n; } }); -// node_modules/yargs-parser/build/index.cjs -var require_build2 = __commonJS({ - "node_modules/yargs-parser/build/index.cjs"(exports2, module) { +// node_modules/cliui/node_modules/ansi-regex/index.js +function ansiRegex3({ onlyFirst = false } = {}) { + const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)"; + const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`; + const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]"; + const pattern = `${osc}|${csi}`; + return new RegExp(pattern, onlyFirst ? void 0 : "g"); +} +var init_ansi_regex = __esm({ + "node_modules/cliui/node_modules/ansi-regex/index.js"() { + "use strict"; + } +}); + +// node_modules/cliui/node_modules/strip-ansi/index.js +function stripAnsi3(string) { + if (typeof string !== "string") { + throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``); + } + if (!string.includes("\x1B") && !string.includes("\x9B")) { + return string; + } + return string.replace(regex, ""); +} +var regex; +var init_strip_ansi = __esm({ + "node_modules/cliui/node_modules/strip-ansi/index.js"() { "use strict"; - var util3 = __require("util"); - var path10 = __require("path"); - var fs16 = __require("fs"); - function camelCase(str) { - const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase(); - if (!isCamelCase) { - str = str.toLowerCase(); - } - if (str.indexOf("-") === -1 && str.indexOf("_") === -1) { - return str; - } else { - let camelcase = ""; - let nextChrUpper = false; - const leadingHyphens = str.match(/^-+/); - for (let i6 = leadingHyphens ? leadingHyphens[0].length : 0; i6 < str.length; i6++) { - let chr = str.charAt(i6); - if (nextChrUpper) { - nextChrUpper = false; - chr = chr.toUpperCase(); - } - if (i6 !== 0 && (chr === "-" || chr === "_")) { - nextChrUpper = true; - } else if (chr !== "-" && chr !== "_") { - camelcase += chr; - } - } - return camelcase; - } - } - function decamelize(str, joinString) { - const lowercase = str.toLowerCase(); - joinString = joinString || "-"; - let notCamelcase = ""; - for (let i6 = 0; i6 < str.length; i6++) { - const chrLower = lowercase.charAt(i6); - const chrString = str.charAt(i6); - if (chrLower !== chrString && i6 > 0) { - notCamelcase += `${joinString}${lowercase.charAt(i6)}`; + init_ansi_regex(); + regex = ansiRegex3(); + } +}); + +// node_modules/get-east-asian-width/lookup-data.js +var ambiguousRanges, fullwidthRanges, halfwidthRanges, narrowRanges, wideRanges; +var init_lookup_data = __esm({ + "node_modules/get-east-asian-width/lookup-data.js"() { + "use strict"; + ambiguousRanges = [161, 161, 164, 164, 167, 168, 170, 170, 173, 174, 176, 180, 182, 186, 188, 191, 198, 198, 208, 208, 215, 216, 222, 225, 230, 230, 232, 234, 236, 237, 240, 240, 242, 243, 247, 250, 252, 252, 254, 254, 257, 257, 273, 273, 275, 275, 283, 283, 294, 295, 299, 299, 305, 307, 312, 312, 319, 322, 324, 324, 328, 331, 333, 333, 338, 339, 358, 359, 363, 363, 462, 462, 464, 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 593, 593, 609, 609, 708, 708, 711, 711, 713, 715, 717, 717, 720, 720, 728, 731, 733, 733, 735, 735, 768, 879, 913, 929, 931, 937, 945, 961, 963, 969, 1025, 1025, 1040, 1103, 1105, 1105, 8208, 8208, 8211, 8214, 8216, 8217, 8220, 8221, 8224, 8226, 8228, 8231, 8240, 8240, 8242, 8243, 8245, 8245, 8251, 8251, 8254, 8254, 8308, 8308, 8319, 8319, 8321, 8324, 8364, 8364, 8451, 8451, 8453, 8453, 8457, 8457, 8467, 8467, 8470, 8470, 8481, 8482, 8486, 8486, 8491, 8491, 8531, 8532, 8539, 8542, 8544, 8555, 8560, 8569, 8585, 8585, 8592, 8601, 8632, 8633, 8658, 8658, 8660, 8660, 8679, 8679, 8704, 8704, 8706, 8707, 8711, 8712, 8715, 8715, 8719, 8719, 8721, 8721, 8725, 8725, 8730, 8730, 8733, 8736, 8739, 8739, 8741, 8741, 8743, 8748, 8750, 8750, 8756, 8759, 8764, 8765, 8776, 8776, 8780, 8780, 8786, 8786, 8800, 8801, 8804, 8807, 8810, 8811, 8814, 8815, 8834, 8835, 8838, 8839, 8853, 8853, 8857, 8857, 8869, 8869, 8895, 8895, 8978, 8978, 9312, 9449, 9451, 9547, 9552, 9587, 9600, 9615, 9618, 9621, 9632, 9633, 9635, 9641, 9650, 9651, 9654, 9655, 9660, 9661, 9664, 9665, 9670, 9672, 9675, 9675, 9678, 9681, 9698, 9701, 9711, 9711, 9733, 9734, 9737, 9737, 9742, 9743, 9756, 9756, 9758, 9758, 9792, 9792, 9794, 9794, 9824, 9825, 9827, 9829, 9831, 9834, 9836, 9837, 9839, 9839, 9886, 9887, 9919, 9919, 9926, 9933, 9935, 9939, 9941, 9953, 9955, 9955, 9960, 9961, 9963, 9969, 9972, 9972, 9974, 9977, 9979, 9980, 9982, 9983, 10045, 10045, 10102, 10111, 11094, 11097, 12872, 12879, 57344, 63743, 65024, 65039, 65533, 65533, 127232, 127242, 127248, 127277, 127280, 127337, 127344, 127373, 127375, 127376, 127387, 127404, 917760, 917999, 983040, 1048573, 1048576, 1114109]; + fullwidthRanges = [12288, 12288, 65281, 65376, 65504, 65510]; + halfwidthRanges = [8361, 8361, 65377, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65512, 65518]; + narrowRanges = [32, 126, 162, 163, 165, 166, 172, 172, 175, 175, 10214, 10221, 10629, 10630]; + wideRanges = [4352, 4447, 8986, 8987, 9001, 9002, 9193, 9196, 9200, 9200, 9203, 9203, 9725, 9726, 9748, 9749, 9776, 9783, 9800, 9811, 9855, 9855, 9866, 9871, 9875, 9875, 9889, 9889, 9898, 9899, 9917, 9918, 9924, 9925, 9934, 9934, 9940, 9940, 9962, 9962, 9970, 9971, 9973, 9973, 9978, 9978, 9981, 9981, 9989, 9989, 9994, 9995, 10024, 10024, 10060, 10060, 10062, 10062, 10067, 10069, 10071, 10071, 10133, 10135, 10160, 10160, 10175, 10175, 11035, 11036, 11088, 11088, 11093, 11093, 11904, 11929, 11931, 12019, 12032, 12245, 12272, 12287, 12289, 12350, 12353, 12438, 12441, 12543, 12549, 12591, 12593, 12686, 12688, 12773, 12783, 12830, 12832, 12871, 12880, 42124, 42128, 42182, 43360, 43388, 44032, 55203, 63744, 64255, 65040, 65049, 65072, 65106, 65108, 65126, 65128, 65131, 94176, 94180, 94192, 94198, 94208, 101589, 101631, 101662, 101760, 101874, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 119552, 119638, 119648, 119670, 126980, 126980, 127183, 127183, 127374, 127374, 127377, 127386, 127488, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 127776, 127789, 127797, 127799, 127868, 127870, 127891, 127904, 127946, 127951, 127955, 127968, 127984, 127988, 127988, 127992, 128062, 128064, 128064, 128066, 128252, 128255, 128317, 128331, 128334, 128336, 128359, 128378, 128378, 128405, 128406, 128420, 128420, 128507, 128591, 128640, 128709, 128716, 128716, 128720, 128722, 128725, 128728, 128732, 128735, 128747, 128748, 128756, 128764, 128992, 129003, 129008, 129008, 129292, 129338, 129340, 129349, 129351, 129535, 129648, 129660, 129664, 129674, 129678, 129734, 129736, 129736, 129741, 129756, 129759, 129770, 129775, 129784, 131072, 196605, 196608, 262141]; + } +}); + +// node_modules/get-east-asian-width/utilities.js +var isInRange; +var init_utilities = __esm({ + "node_modules/get-east-asian-width/utilities.js"() { + "use strict"; + isInRange = (ranges, codePoint) => { + let low = 0; + let high = Math.floor(ranges.length / 2) - 1; + while (low <= high) { + const mid = Math.floor((low + high) / 2); + const i6 = mid * 2; + if (codePoint < ranges[i6]) { + high = mid - 1; + } else if (codePoint > ranges[i6 + 1]) { + low = mid + 1; } else { - notCamelcase += chrString; + return true; } } - return notCamelcase; - } - function looksLikeNumber(x6) { - if (x6 === null || x6 === void 0) + return false; + }; + } +}); + +// node_modules/get-east-asian-width/lookup.js +function findWideFastPathRange(ranges) { + let fastPathStart = ranges[0]; + let fastPathEnd = ranges[1]; + for (let index2 = 0; index2 < ranges.length; index2 += 2) { + const start = ranges[index2]; + const end = ranges[index2 + 1]; + if (commonCjkCodePoint >= start && commonCjkCodePoint <= end) { + return [start, end]; + } + if (end - start > fastPathEnd - fastPathStart) { + fastPathStart = start; + fastPathEnd = end; + } + } + return [fastPathStart, fastPathEnd]; +} +var minimumAmbiguousCodePoint, maximumAmbiguousCodePoint, minimumFullWidthCodePoint, maximumFullWidthCodePoint, minimumHalfWidthCodePoint, maximumHalfWidthCodePoint, minimumNarrowCodePoint, maximumNarrowCodePoint, minimumWideCodePoint, maximumWideCodePoint, commonCjkCodePoint, wideFastPathStart, wideFastPathEnd, isAmbiguous, isFullWidth, isWide; +var init_lookup = __esm({ + "node_modules/get-east-asian-width/lookup.js"() { + "use strict"; + init_lookup_data(); + init_utilities(); + minimumAmbiguousCodePoint = ambiguousRanges[0]; + maximumAmbiguousCodePoint = ambiguousRanges.at(-1); + minimumFullWidthCodePoint = fullwidthRanges[0]; + maximumFullWidthCodePoint = fullwidthRanges.at(-1); + minimumHalfWidthCodePoint = halfwidthRanges[0]; + maximumHalfWidthCodePoint = halfwidthRanges.at(-1); + minimumNarrowCodePoint = narrowRanges[0]; + maximumNarrowCodePoint = narrowRanges.at(-1); + minimumWideCodePoint = wideRanges[0]; + maximumWideCodePoint = wideRanges.at(-1); + commonCjkCodePoint = 19968; + [wideFastPathStart, wideFastPathEnd] = findWideFastPathRange(wideRanges); + isAmbiguous = (codePoint) => { + if (codePoint < minimumAmbiguousCodePoint || codePoint > maximumAmbiguousCodePoint) { return false; - if (typeof x6 === "number") - return true; - if (/^0x[0-9a-f]+$/i.test(x6)) + } + return isInRange(ambiguousRanges, codePoint); + }; + isFullWidth = (codePoint) => { + if (codePoint < minimumFullWidthCodePoint || codePoint > maximumFullWidthCodePoint) { + return false; + } + return isInRange(fullwidthRanges, codePoint); + }; + isWide = (codePoint) => { + if (codePoint >= wideFastPathStart && codePoint <= wideFastPathEnd) { return true; - if (/^0[^.]/.test(x6)) + } + if (codePoint < minimumWideCodePoint || codePoint > maximumWideCodePoint) { return false; - return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x6); + } + return isInRange(wideRanges, codePoint); + }; + } +}); + +// node_modules/get-east-asian-width/index.js +function validate2(codePoint) { + if (!Number.isSafeInteger(codePoint)) { + throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`); + } +} +function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) { + validate2(codePoint); + if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) { + return 2; + } + return 1; +} +var init_get_east_asian_width = __esm({ + "node_modules/get-east-asian-width/index.js"() { + "use strict"; + init_lookup(); + } +}); + +// node_modules/cliui/node_modules/emoji-regex/index.mjs +var emoji_regex_default; +var init_emoji_regex = __esm({ + "node_modules/cliui/node_modules/emoji-regex/index.mjs"() { + "use strict"; + emoji_regex_default = () => { + return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g; + }; + } +}); + +// node_modules/cliui/node_modules/string-width/index.js +function stringWidth(string, options = {}) { + if (typeof string !== "string" || string.length === 0) { + return 0; + } + const { + ambiguousIsNarrow = true, + countAnsiEscapeCodes = false + } = options; + if (!countAnsiEscapeCodes) { + string = stripAnsi3(string); + } + if (string.length === 0) { + return 0; + } + let width = 0; + const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow }; + for (const { segment: character } of segmenter.segment(string)) { + const codePoint = character.codePointAt(0); + if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) { + continue; + } + if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) { + continue; } - function tokenizeArgString(argString) { - if (Array.isArray(argString)) { - return argString.map((e6) => typeof e6 !== "string" ? e6 + "" : e6); + if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) { + continue; + } + if (codePoint >= 55296 && codePoint <= 57343) { + continue; + } + if (codePoint >= 65024 && codePoint <= 65039) { + continue; + } + if (defaultIgnorableCodePointRegex.test(character)) { + continue; + } + if (emoji_regex_default().test(character)) { + width += 2; + continue; + } + width += eastAsianWidth(codePoint, eastAsianWidthOptions); + } + return width; +} +var segmenter, defaultIgnorableCodePointRegex; +var init_string_width = __esm({ + "node_modules/cliui/node_modules/string-width/index.js"() { + "use strict"; + init_strip_ansi(); + init_get_east_asian_width(); + init_emoji_regex(); + segmenter = new Intl.Segmenter(); + defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u; + } +}); + +// node_modules/cliui/node_modules/ansi-styles/index.js +function assembleStyles() { + const codes = /* @__PURE__ */ new Map(); + for (const [groupName, group3] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group3)) { + styles[styleName] = { + open: `\x1B[${style[0]}m`, + close: `\x1B[${style[1]}m` + }; + group3[styleName] = styles[styleName]; + codes.set(style[0], style[1]); + } + Object.defineProperty(styles, groupName, { + value: group3, + enumerable: false + }); + } + Object.defineProperty(styles, "codes", { + value: codes, + enumerable: false + }); + styles.color.close = "\x1B[39m"; + styles.bgColor.close = "\x1B[49m"; + styles.color.ansi = wrapAnsi16(); + styles.color.ansi256 = wrapAnsi256(); + styles.color.ansi16m = wrapAnsi16m(); + styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); + Object.defineProperties(styles, { + rgbToAnsi256: { + value(red, green, blue) { + if (red === green && green === blue) { + if (red < 8) { + return 16; + } + if (red > 248) { + return 231; + } + return Math.round((red - 8) / 247 * 24) + 232; + } + return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5); + }, + enumerable: false + }, + hexToRgb: { + value(hex) { + const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); + if (!matches) { + return [0, 0, 0]; + } + let [colorString] = matches; + if (colorString.length === 3) { + colorString = [...colorString].map((character) => character + character).join(""); + } + const integer = Number.parseInt(colorString, 16); + return [ + /* eslint-disable no-bitwise */ + integer >> 16 & 255, + integer >> 8 & 255, + integer & 255 + /* eslint-enable no-bitwise */ + ]; + }, + enumerable: false + }, + hexToAnsi256: { + value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)), + enumerable: false + }, + ansi256ToAnsi: { + value(code) { + if (code < 8) { + return 30 + code; + } + if (code < 16) { + return 90 + (code - 8); + } + let red; + let green; + let blue; + if (code >= 232) { + red = ((code - 232) * 10 + 8) / 255; + green = red; + blue = red; + } else { + code -= 16; + const remainder = code % 36; + red = Math.floor(code / 36) / 5; + green = Math.floor(remainder / 6) / 5; + blue = remainder % 6 / 5; + } + const value = Math.max(red, green, blue) * 2; + if (value === 0) { + return 30; + } + let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red)); + if (value === 2) { + result += 60; + } + return result; + }, + enumerable: false + }, + rgbToAnsi: { + value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), + enumerable: false + }, + hexToAnsi: { + value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), + enumerable: false + } + }); + return styles; +} +var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, modifierNames, foregroundColorNames, backgroundColorNames, colorNames, ansiStyles, ansi_styles_default; +var init_ansi_styles = __esm({ + "node_modules/cliui/node_modules/ansi-styles/index.js"() { + "use strict"; + ANSI_BACKGROUND_OFFSET = 10; + wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`; + wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`; + wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`; + styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + overline: [53, 55], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + // Bright color + blackBright: [90, 39], + gray: [90, 39], + // Alias of `blackBright` + grey: [90, 39], + // Alias of `blackBright` + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + // Bright color + bgBlackBright: [100, 49], + bgGray: [100, 49], + // Alias of `bgBlackBright` + bgGrey: [100, 49], + // Alias of `bgBlackBright` + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + modifierNames = Object.keys(styles.modifier); + foregroundColorNames = Object.keys(styles.color); + backgroundColorNames = Object.keys(styles.bgColor); + colorNames = [...foregroundColorNames, ...backgroundColorNames]; + ansiStyles = assembleStyles(); + ansi_styles_default = ansiStyles; + } +}); + +// node_modules/cliui/node_modules/wrap-ansi/index.js +function wrapAnsi(string, columns, options) { + return String(string).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec(line, columns, options)).join("\n"); +} +var ESCAPES, END_CODE, ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_SGR_TERMINATOR, ANSI_ESCAPE_LINK, wrapAnsiCode, wrapAnsiHyperlink, wordLengths, wrapWord, stringVisibleTrimSpacesRight, exec; +var init_wrap_ansi = __esm({ + "node_modules/cliui/node_modules/wrap-ansi/index.js"() { + "use strict"; + init_string_width(); + init_strip_ansi(); + init_ansi_styles(); + ESCAPES = /* @__PURE__ */ new Set([ + "\x1B", + "\x9B" + ]); + END_CODE = 39; + ANSI_ESCAPE_BELL = "\x07"; + ANSI_CSI = "["; + ANSI_OSC = "]"; + ANSI_SGR_TERMINATOR = "m"; + ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`; + wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`; + wrapAnsiHyperlink = (url2) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url2}${ANSI_ESCAPE_BELL}`; + wordLengths = (string) => string.split(" ").map((character) => stringWidth(character)); + wrapWord = (rows, word, columns) => { + const characters = [...word]; + let isInsideEscape = false; + let isInsideLinkEscape = false; + let visible = stringWidth(stripAnsi3(rows.at(-1))); + for (const [index2, character] of characters.entries()) { + const characterLength = stringWidth(character); + if (visible + characterLength <= columns) { + rows[rows.length - 1] += character; + } else { + rows.push(character); + visible = 0; + } + if (ESCAPES.has(character)) { + isInsideEscape = true; + const ansiEscapeLinkCandidate = characters.slice(index2 + 1, index2 + 1 + ANSI_ESCAPE_LINK.length).join(""); + isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK; + } + if (isInsideEscape) { + if (isInsideLinkEscape) { + if (character === ANSI_ESCAPE_BELL) { + isInsideEscape = false; + isInsideLinkEscape = false; + } + } else if (character === ANSI_SGR_TERMINATOR) { + isInsideEscape = false; + } + continue; + } + visible += characterLength; + if (visible === columns && index2 < characters.length - 1) { + rows.push(""); + visible = 0; + } } - argString = argString.trim(); - let i6 = 0; - let prevC = null; - let c6 = null; - let opening = null; - const args = []; - for (let ii2 = 0; ii2 < argString.length; ii2++) { - prevC = c6; - c6 = argString.charAt(ii2); - if (c6 === " " && !opening) { - if (!(prevC === " ")) { - i6++; + if (!visible && rows.at(-1).length > 0 && rows.length > 1) { + rows[rows.length - 2] += rows.pop(); + } + }; + stringVisibleTrimSpacesRight = (string) => { + const words = string.split(" "); + let last = words.length; + while (last > 0) { + if (stringWidth(words[last - 1]) > 0) { + break; + } + last--; + } + if (last === words.length) { + return string; + } + return words.slice(0, last).join(" ") + words.slice(last).join(""); + }; + exec = (string, columns, options = {}) => { + if (options.trim !== false && string.trim() === "") { + return ""; + } + let returnValue = ""; + let escapeCode; + let escapeUrl; + const lengths = wordLengths(string); + let rows = [""]; + for (const [index2, word] of string.split(" ").entries()) { + if (options.trim !== false) { + rows[rows.length - 1] = rows.at(-1).trimStart(); + } + let rowLength = stringWidth(rows.at(-1)); + if (index2 !== 0) { + if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) { + rows.push(""); + rowLength = 0; } + if (rowLength > 0 || options.trim === false) { + rows[rows.length - 1] += " "; + rowLength++; + } + } + if (options.hard && lengths[index2] > columns) { + const remainingColumns = columns - rowLength; + const breaksStartingThisLine = 1 + Math.floor((lengths[index2] - remainingColumns - 1) / columns); + const breaksStartingNextLine = Math.floor((lengths[index2] - 1) / columns); + if (breaksStartingNextLine < breaksStartingThisLine) { + rows.push(""); + } + wrapWord(rows, word, columns); + continue; + } + if (rowLength + lengths[index2] > columns && rowLength > 0 && lengths[index2] > 0) { + if (options.wordWrap === false && rowLength < columns) { + wrapWord(rows, word, columns); + continue; + } + rows.push(""); + } + if (rowLength + lengths[index2] > columns && options.wordWrap === false) { + wrapWord(rows, word, columns); continue; } - if (c6 === opening) { - opening = null; - } else if ((c6 === "'" || c6 === '"') && !opening) { - opening = c6; + rows[rows.length - 1] += word; + } + if (options.trim !== false) { + rows = rows.map((row) => stringVisibleTrimSpacesRight(row)); + } + const preString = rows.join("\n"); + const pre = [...preString]; + let preStringIndex = 0; + for (const [index2, character] of pre.entries()) { + returnValue += character; + if (ESCAPES.has(character)) { + const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?\\d+)m|\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`).exec(preString.slice(preStringIndex)) || { groups: {} }; + if (groups.code !== void 0) { + const code2 = Number.parseFloat(groups.code); + escapeCode = code2 === END_CODE ? void 0 : code2; + } else if (groups.uri !== void 0) { + escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri; + } + } + const code = ansi_styles_default.codes.get(Number(escapeCode)); + if (pre[index2 + 1] === "\n") { + if (escapeUrl) { + returnValue += wrapAnsiHyperlink(""); + } + if (escapeCode && code) { + returnValue += wrapAnsiCode(code); + } + } else if (character === "\n") { + if (escapeCode && code) { + returnValue += wrapAnsiCode(escapeCode); + } + if (escapeUrl) { + returnValue += wrapAnsiHyperlink(escapeUrl); + } } - if (!args[i6]) - args[i6] = ""; - args[i6] += c6; + preStringIndex += character.length; } - return args; + return returnValue; + }; + } +}); + +// node_modules/cliui/index.mjs +function ui2(opts) { + return cliui(opts, { + stringWidth, + stripAnsi: stripAnsi3, + wrap: wrapAnsi + }); +} +var init_cliui = __esm({ + "node_modules/cliui/index.mjs"() { + "use strict"; + init_lib(); + init_string_width(); + init_strip_ansi(); + init_wrap_ansi(); + } +}); + +// node_modules/escalade/sync/index.mjs +import { dirname as dirname2, resolve as resolve4 } from "path"; +import { readdirSync as readdirSync3, statSync as statSync2 } from "fs"; +function sync_default(start, callback) { + let dir2 = resolve4(".", start); + let tmp, stats = statSync2(dir2); + if (!stats.isDirectory()) { + dir2 = dirname2(dir2); + } + while (true) { + tmp = callback(dir2, readdirSync3(dir2)); + if (tmp) return resolve4(dir2, tmp); + dir2 = dirname2(tmp = dir2); + if (tmp === dir2) break; + } +} +var init_sync = __esm({ + "node_modules/escalade/sync/index.mjs"() { + "use strict"; + } +}); + +// node_modules/yargs/node_modules/yargs-parser/build/lib/string-utils.js +function camelCase(str) { + const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase(); + if (!isCamelCase) { + str = str.toLowerCase(); + } + if (str.indexOf("-") === -1 && str.indexOf("_") === -1) { + return str; + } else { + let camelcase = ""; + let nextChrUpper = false; + const leadingHyphens = str.match(/^-+/); + for (let i6 = leadingHyphens ? leadingHyphens[0].length : 0; i6 < str.length; i6++) { + let chr = str.charAt(i6); + if (nextChrUpper) { + nextChrUpper = false; + chr = chr.toUpperCase(); + } + if (i6 !== 0 && (chr === "-" || chr === "_")) { + nextChrUpper = true; + } else if (chr !== "-" && chr !== "_") { + camelcase += chr; + } + } + return camelcase; + } +} +function decamelize(str, joinString) { + const lowercase = str.toLowerCase(); + joinString = joinString || "-"; + let notCamelcase = ""; + for (let i6 = 0; i6 < str.length; i6++) { + const chrLower = lowercase.charAt(i6); + const chrString = str.charAt(i6); + if (chrLower !== chrString && i6 > 0) { + notCamelcase += `${joinString}${lowercase.charAt(i6)}`; + } else { + notCamelcase += chrString; } - var DefaultValuesForTypeKey; + } + return notCamelcase; +} +function looksLikeNumber(x2) { + if (x2 === null || x2 === void 0) + return false; + if (typeof x2 === "number") + return true; + if (/^0x[0-9a-f]+$/i.test(x2)) + return true; + if (/^0[^.]/.test(x2)) + return false; + return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x2); +} +var init_string_utils = __esm({ + "node_modules/yargs/node_modules/yargs-parser/build/lib/string-utils.js"() { + "use strict"; + } +}); + +// node_modules/yargs/node_modules/yargs-parser/build/lib/tokenize-arg-string.js +function tokenizeArgString(argString) { + if (Array.isArray(argString)) { + return argString.map((e6) => typeof e6 !== "string" ? e6 + "" : e6); + } + argString = argString.trim(); + let i6 = 0; + let prevC = null; + let c6 = null; + let opening = null; + const args = []; + for (let ii2 = 0; ii2 < argString.length; ii2++) { + prevC = c6; + c6 = argString.charAt(ii2); + if (c6 === " " && !opening) { + if (!(prevC === " ")) { + i6++; + } + continue; + } + if (c6 === opening) { + opening = null; + } else if ((c6 === "'" || c6 === '"') && !opening) { + opening = c6; + } + if (!args[i6]) + args[i6] = ""; + args[i6] += c6; + } + return args; +} +var init_tokenize_arg_string = __esm({ + "node_modules/yargs/node_modules/yargs-parser/build/lib/tokenize-arg-string.js"() { + "use strict"; + } +}); + +// node_modules/yargs/node_modules/yargs-parser/build/lib/yargs-parser-types.js +var DefaultValuesForTypeKey; +var init_yargs_parser_types = __esm({ + "node_modules/yargs/node_modules/yargs-parser/build/lib/yargs-parser-types.js"() { + "use strict"; (function(DefaultValuesForTypeKey2) { DefaultValuesForTypeKey2["BOOLEAN"] = "boolean"; DefaultValuesForTypeKey2["STRING"] = "string"; DefaultValuesForTypeKey2["NUMBER"] = "number"; DefaultValuesForTypeKey2["ARRAY"] = "array"; })(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {})); - var mixin; - var YargsParser = class { + } +}); + +// node_modules/yargs/node_modules/yargs-parser/build/lib/yargs-parser.js +function combineAliases(aliases) { + const aliasArrays = []; + const combined = /* @__PURE__ */ Object.create(null); + let change = true; + Object.keys(aliases).forEach(function(key) { + aliasArrays.push([].concat(aliases[key], key)); + }); + while (change) { + change = false; + for (let i6 = 0; i6 < aliasArrays.length; i6++) { + for (let ii2 = i6 + 1; ii2 < aliasArrays.length; ii2++) { + const intersect = aliasArrays[i6].filter(function(v2) { + return aliasArrays[ii2].indexOf(v2) !== -1; + }); + if (intersect.length) { + aliasArrays[i6] = aliasArrays[i6].concat(aliasArrays[ii2]); + aliasArrays.splice(ii2, 1); + change = true; + break; + } + } + } + } + aliasArrays.forEach(function(aliasArray) { + aliasArray = aliasArray.filter(function(v2, i6, self2) { + return self2.indexOf(v2) === i6; + }); + const lastAlias = aliasArray.pop(); + if (lastAlias !== void 0 && typeof lastAlias === "string") { + combined[lastAlias] = aliasArray; + } + }); + return combined; +} +function increment(orig) { + return orig !== void 0 ? orig + 1 : 1; +} +function sanitizeKey(key) { + if (key === "__proto__") + return "___proto___"; + return key; +} +function stripQuotes(val) { + return typeof val === "string" && (val[0] === "'" || val[0] === '"') && val[val.length - 1] === val[0] ? val.substring(1, val.length - 1) : val; +} +var mixin2, YargsParser; +var init_yargs_parser = __esm({ + "node_modules/yargs/node_modules/yargs-parser/build/lib/yargs-parser.js"() { + "use strict"; + init_tokenize_arg_string(); + init_yargs_parser_types(); + init_string_utils(); + YargsParser = class { constructor(_mixin) { - mixin = _mixin; + mixin2 = _mixin; } parse(argsInput, options) { const opts = Object.assign({ @@ -93976,7 +94831,7 @@ var require_build2 = __commonJS({ const notFlagsArgv = notFlagsOption ? "--" : "_"; const newAliases = /* @__PURE__ */ Object.create(null); const defaulted = /* @__PURE__ */ Object.create(null); - const __ = opts.__ || mixin.format; + const __ = opts.__ || mixin2.format; const flags = { aliases: /* @__PURE__ */ Object.create(null), arrays: /* @__PURE__ */ Object.create(null), @@ -94046,6 +94901,7 @@ var require_build2 = __commonJS({ } if (typeof opts.config !== "undefined") { if (Array.isArray(opts.config) || typeof opts.config === "string") { + ; [].concat(opts.config).filter(Boolean).forEach(function(key) { flags.configs[key] = true; }); @@ -94074,7 +94930,7 @@ var require_build2 = __commonJS({ let broken; let key; let letters; - let m6; + let m3; let next; let value; if (arg !== "--" && /^-/.test(arg) && isUnknownOptionAsArg(arg)) { @@ -94083,26 +94939,26 @@ var require_build2 = __commonJS({ pushPositional(arg); continue; } else if (arg.match(/^--.+=/) || !configuration["short-option-groups"] && arg.match(/^-.+=/)) { - m6 = arg.match(/^--?([^=]+)=([\s\S]*)$/); - if (m6 !== null && Array.isArray(m6) && m6.length >= 3) { - if (checkAllAliases(m6[1], flags.arrays)) { - i6 = eatArray(i6, m6[1], args, m6[2]); - } else if (checkAllAliases(m6[1], flags.nargs) !== false) { - i6 = eatNargs(i6, m6[1], args, m6[2]); + m3 = arg.match(/^--?([^=]+)=([\s\S]*)$/); + if (m3 !== null && Array.isArray(m3) && m3.length >= 3) { + if (checkAllAliases(m3[1], flags.arrays)) { + i6 = eatArray(i6, m3[1], args, m3[2]); + } else if (checkAllAliases(m3[1], flags.nargs) !== false) { + i6 = eatNargs(i6, m3[1], args, m3[2]); } else { - setArg(m6[1], m6[2], true); + setArg(m3[1], m3[2], true); } } } else if (arg.match(negatedBoolean) && configuration["boolean-negation"]) { - m6 = arg.match(negatedBoolean); - if (m6 !== null && Array.isArray(m6) && m6.length >= 2) { - key = m6[1]; + m3 = arg.match(negatedBoolean); + if (m3 !== null && Array.isArray(m3) && m3.length >= 2) { + key = m3[1]; setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false); } } else if (arg.match(/^--.+/) || !configuration["short-option-groups"] && arg.match(/^-[^-]+/)) { - m6 = arg.match(/^--?(.+)/); - if (m6 !== null && Array.isArray(m6) && m6.length >= 2) { - key = m6[1]; + m3 = arg.match(/^--?(.+)/); + if (m3 !== null && Array.isArray(m3) && m3.length >= 2) { + key = m3[1]; if (checkAllAliases(key, flags.arrays)) { i6 = eatArray(i6, key, args); } else if (checkAllAliases(key, flags.nargs) !== false) { @@ -94121,15 +94977,15 @@ var require_build2 = __commonJS({ } } } else if (arg.match(/^-.\..+=/)) { - m6 = arg.match(/^-([^=]+)=([\s\S]*)$/); - if (m6 !== null && Array.isArray(m6) && m6.length >= 3) { - setArg(m6[1], m6[2]); + m3 = arg.match(/^-([^=]+)=([\s\S]*)$/); + if (m3 !== null && Array.isArray(m3) && m3.length >= 3) { + setArg(m3[1], m3[2]); } } else if (arg.match(/^-.\..+/) && !arg.match(negative)) { next = args[i6 + 1]; - m6 = arg.match(/^-(.\..+)/); - if (m6 !== null && Array.isArray(m6) && m6.length >= 2) { - key = m6[1]; + m3 = arg.match(/^-(.\..+)/); + if (m3 !== null && Array.isArray(m3) && m3.length >= 2) { + key = m3[1]; if (next !== void 0 && !next.match(/^-/) && !checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts)) { setArg(key, next); i6++; @@ -94227,6 +95083,7 @@ var require_build2 = __commonJS({ }); } if (configuration["strip-aliased"]) { + ; [].concat(...Object.keys(aliases).map((k7) => aliases[k7])).forEach((alias) => { if (configuration["camel-case-expansion"] && alias.includes("-")) { delete argv[alias.split(".").map((prop) => camelCase(prop)).join(".")]; @@ -94319,14 +95176,15 @@ var require_build2 = __commonJS({ const splitKey = key.split("."); setKey(argv, splitKey, value); if (flags.aliases[key]) { - flags.aliases[key].forEach(function(x6) { - const keyProperties = x6.split("."); + flags.aliases[key].forEach(function(x2) { + const keyProperties = x2.split("."); setKey(argv, keyProperties, value); }); } if (splitKey.length > 1 && configuration["dot-notation"]) { - (flags.aliases[splitKey[0]] || []).forEach(function(x6) { - let keyProperties = x6.split("."); + ; + (flags.aliases[splitKey[0]] || []).forEach(function(x2) { + let keyProperties = x2.split("."); const a6 = [].concat(splitKey); a6.shift(); keyProperties = keyProperties.concat(a6); @@ -94344,7 +95202,7 @@ var require_build2 = __commonJS({ return val; }, set(value2) { - val = typeof value2 === "string" ? mixin.normalize(value2) : value2; + val = typeof value2 === "string" ? mixin2.normalize(value2) : value2; } }); }); @@ -94367,8 +95225,8 @@ var require_build2 = __commonJS({ if (typeof val === "string") val = val === "true"; } - let value = Array.isArray(val) ? val.map(function(v8) { - return maybeCoerceNumber(key, v8); + let value = Array.isArray(val) ? val.map(function(v2) { + return maybeCoerceNumber(key, v2); }) : maybeCoerceNumber(key, val); if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === "boolean")) { value = increment(); @@ -94376,10 +95234,10 @@ var require_build2 = __commonJS({ if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) { if (Array.isArray(val)) value = val.map((val2) => { - return mixin.normalize(val2); + return mixin2.normalize(val2); }); else - value = mixin.normalize(val); + value = mixin2.normalize(val); } return value; } @@ -94402,7 +95260,7 @@ var require_build2 = __commonJS({ if (configPath) { try { let config = null; - const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath); + const resolvedConfigPath = mixin2.resolve(mixin2.cwd(), configPath); const resolveConfig = flags.configs[configKey]; if (typeof resolveConfig === "function") { try { @@ -94415,7 +95273,7 @@ var require_build2 = __commonJS({ return; } } else { - config = mixin.require(resolvedConfigPath); + config = mixin2.require(resolvedConfigPath); } setConfigObject(config); } catch (ex) { @@ -94451,7 +95309,7 @@ var require_build2 = __commonJS({ if (typeof envPrefix === "undefined") return; const prefix2 = typeof envPrefix === "string" ? envPrefix : ""; - const env3 = mixin.env(); + const env3 = mixin2.env(); Object.keys(env3).forEach(function(envVar) { if (prefix2 === "" || envVar.lastIndexOf(prefix2, 0) === 0) { const keys = envVar.split("__").map(function(key, i6) { @@ -94501,45 +95359,45 @@ var require_build2 = __commonJS({ setKey(obj, key.split("."), defaults5[key]); if (canLog) defaulted[key] = true; - (aliases2[key] || []).forEach(function(x6) { - if (hasKey(obj, x6.split("."))) + (aliases2[key] || []).forEach(function(x2) { + if (hasKey(obj, x2.split("."))) return; - setKey(obj, x6.split("."), defaults5[key]); + setKey(obj, x2.split("."), defaults5[key]); }); } }); } function hasKey(obj, keys) { - let o6 = obj; + let o2 = obj; if (!configuration["dot-notation"]) keys = [keys.join(".")]; keys.slice(0, -1).forEach(function(key2) { - o6 = o6[key2] || {}; + o2 = o2[key2] || {}; }); const key = keys[keys.length - 1]; - if (typeof o6 !== "object") + if (typeof o2 !== "object") return false; else - return key in o6; + return key in o2; } function setKey(obj, keys, value) { - let o6 = obj; + let o2 = obj; if (!configuration["dot-notation"]) keys = [keys.join(".")]; keys.slice(0, -1).forEach(function(key2) { key2 = sanitizeKey(key2); - if (typeof o6 === "object" && o6[key2] === void 0) { - o6[key2] = {}; + if (typeof o2 === "object" && o2[key2] === void 0) { + o2[key2] = {}; } - if (typeof o6[key2] !== "object" || Array.isArray(o6[key2])) { - if (Array.isArray(o6[key2])) { - o6[key2].push({}); + if (typeof o2[key2] !== "object" || Array.isArray(o2[key2])) { + if (Array.isArray(o2[key2])) { + o2[key2].push({}); } else { - o6[key2] = [o6[key2], {}]; + o2[key2] = [o2[key2], {}]; } - o6 = o6[key2][o6[key2].length - 1]; + o2 = o2[key2][o2[key2].length - 1]; } else { - o6 = o6[key2]; + o2 = o2[key2]; } }); const key = sanitizeKey(keys[keys.length - 1]); @@ -94548,26 +95406,26 @@ var require_build2 = __commonJS({ let duplicate = configuration["duplicate-arguments-array"]; if (!duplicate && checkAllAliases(key, flags.nargs)) { duplicate = true; - if (!isUndefined(o6[key]) && flags.nargs[key] === 1 || Array.isArray(o6[key]) && o6[key].length === flags.nargs[key]) { - o6[key] = void 0; + if (!isUndefined(o2[key]) && flags.nargs[key] === 1 || Array.isArray(o2[key]) && o2[key].length === flags.nargs[key]) { + o2[key] = void 0; } } if (value === increment()) { - o6[key] = increment(o6[key]); - } else if (Array.isArray(o6[key])) { + o2[key] = increment(o2[key]); + } else if (Array.isArray(o2[key])) { if (duplicate && isTypeArray && isValueArray) { - o6[key] = configuration["flatten-duplicate-arrays"] ? o6[key].concat(value) : (Array.isArray(o6[key][0]) ? o6[key] : [o6[key]]).concat([value]); + o2[key] = configuration["flatten-duplicate-arrays"] ? o2[key].concat(value) : (Array.isArray(o2[key][0]) ? o2[key] : [o2[key]]).concat([value]); } else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { - o6[key] = value; + o2[key] = value; } else { - o6[key] = o6[key].concat([value]); + o2[key] = o2[key].concat([value]); } - } else if (o6[key] === void 0 && isTypeArray) { - o6[key] = isValueArray ? value : [value]; - } else if (duplicate && !(o6[key] === void 0 || checkAllAliases(key, flags.counts) || checkAllAliases(key, flags.bools))) { - o6[key] = [o6[key], value]; + } else if (o2[key] === void 0 && isTypeArray) { + o2[key] = isValueArray ? value : [value]; + } else if (duplicate && !(o2[key] === void 0 || checkAllAliases(key, flags.counts) || checkAllAliases(key, flags.bools))) { + o2[key] = [o2[key], value]; } else { - o6[key] = value; + o2[key] = value; } } function extendAliases(...args2) { @@ -94576,27 +95434,27 @@ var require_build2 = __commonJS({ if (flags.aliases[key]) return; flags.aliases[key] = [].concat(aliases[key] || []); - flags.aliases[key].concat(key).forEach(function(x6) { - if (/-/.test(x6) && configuration["camel-case-expansion"]) { - const c6 = camelCase(x6); + flags.aliases[key].concat(key).forEach(function(x2) { + if (/-/.test(x2) && configuration["camel-case-expansion"]) { + const c6 = camelCase(x2); if (c6 !== key && flags.aliases[key].indexOf(c6) === -1) { flags.aliases[key].push(c6); newAliases[c6] = true; } } }); - flags.aliases[key].concat(key).forEach(function(x6) { - if (x6.length > 1 && /[A-Z]/.test(x6) && configuration["camel-case-expansion"]) { - const c6 = decamelize(x6, "-"); + flags.aliases[key].concat(key).forEach(function(x2) { + if (x2.length > 1 && /[A-Z]/.test(x2) && configuration["camel-case-expansion"]) { + const c6 = decamelize(x2, "-"); if (c6 !== key && flags.aliases[key].indexOf(c6) === -1) { flags.aliases[key].push(c6); newAliases[c6] = true; } } }); - flags.aliases[key].forEach(function(x6) { - flags.aliases[x6] = [key].concat(flags.aliases[key].filter(function(y2) { - return x6 !== y2; + flags.aliases[key].forEach(function(x2) { + flags.aliases[x2] = [key].concat(flags.aliases[key].filter(function(y) { + return x2 !== y; })); }); }); @@ -94663,7 +95521,7 @@ var require_build2 = __commonJS({ if (!checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts) && `${key}` in defaults4) { return defaults4[key]; } else { - return defaultForType(guessType(key)); + return defaultForType(guessType2(key)); } } function defaultForType(type) { @@ -94675,7 +95533,7 @@ var require_build2 = __commonJS({ }; return def[type]; } - function guessType(key) { + function guessType2(key) { let type = DefaultValuesForTypeKey.BOOLEAN; if (checkAllAliases(key, flags.strings)) type = DefaultValuesForTypeKey.STRING; @@ -94712,1752 +95570,390 @@ var require_build2 = __commonJS({ }; } }; - function combineAliases(aliases) { - const aliasArrays = []; - const combined = /* @__PURE__ */ Object.create(null); - let change = true; - Object.keys(aliases).forEach(function(key) { - aliasArrays.push([].concat(aliases[key], key)); - }); - while (change) { - change = false; - for (let i6 = 0; i6 < aliasArrays.length; i6++) { - for (let ii2 = i6 + 1; ii2 < aliasArrays.length; ii2++) { - const intersect = aliasArrays[i6].filter(function(v8) { - return aliasArrays[ii2].indexOf(v8) !== -1; - }); - if (intersect.length) { - aliasArrays[i6] = aliasArrays[i6].concat(aliasArrays[ii2]); - aliasArrays.splice(ii2, 1); - change = true; - break; - } - } - } - } - aliasArrays.forEach(function(aliasArray) { - aliasArray = aliasArray.filter(function(v8, i6, self2) { - return self2.indexOf(v8) === i6; - }); - const lastAlias = aliasArray.pop(); - if (lastAlias !== void 0 && typeof lastAlias === "string") { - combined[lastAlias] = aliasArray; - } - }); - return combined; - } - function increment(orig) { - return orig !== void 0 ? orig + 1 : 1; - } - function sanitizeKey(key) { - if (key === "__proto__") - return "___proto___"; - return key; - } - function stripQuotes(val) { - return typeof val === "string" && (val[0] === "'" || val[0] === '"') && val[val.length - 1] === val[0] ? val.substring(1, val.length - 1) : val; - } - var _a5; - var _b2; - var _c6; - var minNodeVersion = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12; - var nodeVersion = (_b2 = (_a5 = process === null || process === void 0 ? void 0 : process.versions) === null || _a5 === void 0 ? void 0 : _a5.node) !== null && _b2 !== void 0 ? _b2 : (_c6 = process === null || process === void 0 ? void 0 : process.version) === null || _c6 === void 0 ? void 0 : _c6.slice(1); + } +}); + +// node_modules/yargs/node_modules/yargs-parser/build/lib/index.js +import { format } from "util"; +import { normalize as normalize3, resolve as resolve5 } from "path"; +import { readFileSync as readFileSync4 } from "fs"; +import { createRequire } from "module"; +var _a3, _b, _c, minNodeVersion, nodeVersion, env, require2, parser, yargsParser, lib_default; +var init_lib2 = __esm({ + "node_modules/yargs/node_modules/yargs-parser/build/lib/index.js"() { + "use strict"; + init_string_utils(); + init_yargs_parser(); + minNodeVersion = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 20; + nodeVersion = (_b = (_a3 = process === null || process === void 0 ? void 0 : process.versions) === null || _a3 === void 0 ? void 0 : _a3.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1); if (nodeVersion) { const major = Number(nodeVersion.match(/^([^.]+)/)[1]); if (major < minNodeVersion) { throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); } } - var env2 = process ? process.env : {}; - var parser2 = new YargsParser({ + env = process ? process.env : {}; + require2 = createRequire ? createRequire(import.meta.url) : void 0; + parser = new YargsParser({ cwd: process.cwd, env: () => { - return env2; - }, - format: util3.format, - normalize: path10.normalize, - resolve: path10.resolve, - require: (path11) => { - if (typeof __require !== "undefined") { - return __require(path11); - } else if (path11.match(/\.json$/)) { - return JSON.parse(fs16.readFileSync(path11, "utf8")); + return env; + }, + format, + normalize: normalize3, + resolve: resolve5, + require: (path10) => { + if (typeof require2 !== "undefined") { + return require2(path10); + } else if (path10.match(/\.json$/)) { + return JSON.parse(readFileSync4(path10, "utf8")); } else { throw Error("only .json config files are supported in ESM"); } } }); - var yargsParser = function Parser(args, opts) { - const result = parser2.parse(args.slice(), opts); + yargsParser = function Parser(args, opts) { + const result = parser.parse(args.slice(), opts); return result.argv; }; yargsParser.detailed = function(args, opts) { - return parser2.parse(args.slice(), opts); + return parser.parse(args.slice(), opts); }; yargsParser.camelCase = camelCase; yargsParser.decamelize = decamelize; yargsParser.looksLikeNumber = looksLikeNumber; - module.exports = yargsParser; + lib_default = yargsParser; } }); -// node_modules/ansi-regex/index.js -var require_ansi_regex = __commonJS({ - "node_modules/ansi-regex/index.js"(exports2, module) { +// node_modules/yargs/build/lib/utils/process-argv.js +function getProcessArgvBinIndex() { + if (isBundledElectronApp()) + return 0; + return 1; +} +function isBundledElectronApp() { + return isElectronApp() && !process.defaultApp; +} +function isElectronApp() { + return !!process.versions.electron; +} +function hideBin(argv) { + return argv.slice(getProcessArgvBinIndex() + 1); +} +function getProcessArgvBin() { + return process.argv[getProcessArgvBinIndex()]; +} +var init_process_argv = __esm({ + "node_modules/yargs/build/lib/utils/process-argv.js"() { "use strict"; - module.exports = ({ onlyFirst = false } = {}) => { - const pattern = [ - "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", - "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))" - ].join("|"); - return new RegExp(pattern, onlyFirst ? void 0 : "g"); - }; } }); -// node_modules/strip-ansi/index.js -var require_strip_ansi = __commonJS({ - "node_modules/strip-ansi/index.js"(exports2, module) { +// node_modules/yargs/node_modules/ansi-regex/index.js +function ansiRegex4({ onlyFirst = false } = {}) { + const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)"; + const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`; + const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]"; + const pattern = `${osc}|${csi}`; + return new RegExp(pattern, onlyFirst ? void 0 : "g"); +} +var init_ansi_regex2 = __esm({ + "node_modules/yargs/node_modules/ansi-regex/index.js"() { "use strict"; - var ansiRegex3 = require_ansi_regex(); - module.exports = (string) => typeof string === "string" ? string.replace(ansiRegex3(), "") : string; } }); -// node_modules/is-fullwidth-code-point/index.js -var require_is_fullwidth_code_point = __commonJS({ - "node_modules/is-fullwidth-code-point/index.js"(exports2, module) { - "use strict"; - var isFullwidthCodePoint = (codePoint) => { - if (Number.isNaN(codePoint)) { - return false; - } - if (codePoint >= 4352 && (codePoint <= 4447 || // Hangul Jamo - codePoint === 9001 || // LEFT-POINTING ANGLE BRACKET - codePoint === 9002 || // RIGHT-POINTING ANGLE BRACKET - // CJK Radicals Supplement .. Enclosed CJK Letters and Months - 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A - 12880 <= codePoint && codePoint <= 19903 || // CJK Unified Ideographs .. Yi Radicals - 19968 <= codePoint && codePoint <= 42182 || // Hangul Jamo Extended-A - 43360 <= codePoint && codePoint <= 43388 || // Hangul Syllables - 44032 <= codePoint && codePoint <= 55203 || // CJK Compatibility Ideographs - 63744 <= codePoint && codePoint <= 64255 || // Vertical Forms - 65040 <= codePoint && codePoint <= 65049 || // CJK Compatibility Forms .. Small Form Variants - 65072 <= codePoint && codePoint <= 65131 || // Halfwidth and Fullwidth Forms - 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || // Kana Supplement - 110592 <= codePoint && codePoint <= 110593 || // Enclosed Ideographic Supplement - 127488 <= codePoint && codePoint <= 127569 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane - 131072 <= codePoint && codePoint <= 262141)) { - return true; - } - return false; - }; - module.exports = isFullwidthCodePoint; - module.exports.default = isFullwidthCodePoint; +// node_modules/yargs/node_modules/strip-ansi/index.js +function stripAnsi4(string) { + if (typeof string !== "string") { + throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``); } -}); - -// node_modules/emoji-regex/index.js -var require_emoji_regex = __commonJS({ - "node_modules/emoji-regex/index.js"(exports2, module) { - "use strict"; - module.exports = function() { - return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; - }; + if (!string.includes("\x1B") && !string.includes("\x9B")) { + return string; } -}); - -// node_modules/string-width/index.js -var require_string_width = __commonJS({ - "node_modules/string-width/index.js"(exports2, module) { + return string.replace(regex2, ""); +} +var regex2; +var init_strip_ansi2 = __esm({ + "node_modules/yargs/node_modules/strip-ansi/index.js"() { "use strict"; - var stripAnsi3 = require_strip_ansi(); - var isFullwidthCodePoint = require_is_fullwidth_code_point(); - var emojiRegex = require_emoji_regex(); - var stringWidth = (string) => { - if (typeof string !== "string" || string.length === 0) { - return 0; - } - string = stripAnsi3(string); - if (string.length === 0) { - return 0; - } - string = string.replace(emojiRegex(), " "); - let width = 0; - for (let i6 = 0; i6 < string.length; i6++) { - const code = string.codePointAt(i6); - if (code <= 31 || code >= 127 && code <= 159) { - continue; - } - if (code >= 768 && code <= 879) { - continue; - } - if (code > 65535) { - i6++; - } - width += isFullwidthCodePoint(code) ? 2 : 1; - } - return width; - }; - module.exports = stringWidth; - module.exports.default = stringWidth; + init_ansi_regex2(); + regex2 = ansiRegex4(); } }); -// node_modules/color-name/index.js -var require_color_name = __commonJS({ - "node_modules/color-name/index.js"(exports2, module) { +// node_modules/yargs/node_modules/emoji-regex/index.mjs +var emoji_regex_default2; +var init_emoji_regex2 = __esm({ + "node_modules/yargs/node_modules/emoji-regex/index.mjs"() { "use strict"; - module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] - }; - } -}); - -// node_modules/color-convert/conversions.js -var require_conversions = __commonJS({ - "node_modules/color-convert/conversions.js"(exports2, module) { - "use strict"; - var cssKeywords = require_color_name(); - var reverseKeywords = {}; - for (const key of Object.keys(cssKeywords)) { - reverseKeywords[cssKeywords[key]] = key; - } - var convert2 = { - rgb: { channels: 3, labels: "rgb" }, - hsl: { channels: 3, labels: "hsl" }, - hsv: { channels: 3, labels: "hsv" }, - hwb: { channels: 3, labels: "hwb" }, - cmyk: { channels: 4, labels: "cmyk" }, - xyz: { channels: 3, labels: "xyz" }, - lab: { channels: 3, labels: "lab" }, - lch: { channels: 3, labels: "lch" }, - hex: { channels: 1, labels: ["hex"] }, - keyword: { channels: 1, labels: ["keyword"] }, - ansi16: { channels: 1, labels: ["ansi16"] }, - ansi256: { channels: 1, labels: ["ansi256"] }, - hcg: { channels: 3, labels: ["h", "c", "g"] }, - apple: { channels: 3, labels: ["r16", "g16", "b16"] }, - gray: { channels: 1, labels: ["gray"] } - }; - module.exports = convert2; - for (const model of Object.keys(convert2)) { - if (!("channels" in convert2[model])) { - throw new Error("missing channels property: " + model); - } - if (!("labels" in convert2[model])) { - throw new Error("missing channel labels property: " + model); - } - if (convert2[model].labels.length !== convert2[model].channels) { - throw new Error("channel and label counts mismatch: " + model); - } - const { channels, labels } = convert2[model]; - delete convert2[model].channels; - delete convert2[model].labels; - Object.defineProperty(convert2[model], "channels", { value: channels }); - Object.defineProperty(convert2[model], "labels", { value: labels }); - } - convert2.rgb.hsl = function(rgb) { - const r6 = rgb[0] / 255; - const g6 = rgb[1] / 255; - const b6 = rgb[2] / 255; - const min = Math.min(r6, g6, b6); - const max = Math.max(r6, g6, b6); - const delta = max - min; - let h6; - let s6; - if (max === min) { - h6 = 0; - } else if (r6 === max) { - h6 = (g6 - b6) / delta; - } else if (g6 === max) { - h6 = 2 + (b6 - r6) / delta; - } else if (b6 === max) { - h6 = 4 + (r6 - g6) / delta; - } - h6 = Math.min(h6 * 60, 360); - if (h6 < 0) { - h6 += 360; - } - const l6 = (min + max) / 2; - if (max === min) { - s6 = 0; - } else if (l6 <= 0.5) { - s6 = delta / (max + min); - } else { - s6 = delta / (2 - max - min); - } - return [h6, s6 * 100, l6 * 100]; - }; - convert2.rgb.hsv = function(rgb) { - let rdif; - let gdif; - let bdif; - let h6; - let s6; - const r6 = rgb[0] / 255; - const g6 = rgb[1] / 255; - const b6 = rgb[2] / 255; - const v8 = Math.max(r6, g6, b6); - const diff = v8 - Math.min(r6, g6, b6); - const diffc = function(c6) { - return (v8 - c6) / 6 / diff + 1 / 2; - }; - if (diff === 0) { - h6 = 0; - s6 = 0; - } else { - s6 = diff / v8; - rdif = diffc(r6); - gdif = diffc(g6); - bdif = diffc(b6); - if (r6 === v8) { - h6 = bdif - gdif; - } else if (g6 === v8) { - h6 = 1 / 3 + rdif - bdif; - } else if (b6 === v8) { - h6 = 2 / 3 + gdif - rdif; - } - if (h6 < 0) { - h6 += 1; - } else if (h6 > 1) { - h6 -= 1; - } - } - return [ - h6 * 360, - s6 * 100, - v8 * 100 - ]; - }; - convert2.rgb.hwb = function(rgb) { - const r6 = rgb[0]; - const g6 = rgb[1]; - let b6 = rgb[2]; - const h6 = convert2.rgb.hsl(rgb)[0]; - const w5 = 1 / 255 * Math.min(r6, Math.min(g6, b6)); - b6 = 1 - 1 / 255 * Math.max(r6, Math.max(g6, b6)); - return [h6, w5 * 100, b6 * 100]; - }; - convert2.rgb.cmyk = function(rgb) { - const r6 = rgb[0] / 255; - const g6 = rgb[1] / 255; - const b6 = rgb[2] / 255; - const k7 = Math.min(1 - r6, 1 - g6, 1 - b6); - const c6 = (1 - r6 - k7) / (1 - k7) || 0; - const m6 = (1 - g6 - k7) / (1 - k7) || 0; - const y2 = (1 - b6 - k7) / (1 - k7) || 0; - return [c6 * 100, m6 * 100, y2 * 100, k7 * 100]; - }; - function comparativeDistance(x6, y2) { - return (x6[0] - y2[0]) ** 2 + (x6[1] - y2[1]) ** 2 + (x6[2] - y2[2]) ** 2; - } - convert2.rgb.keyword = function(rgb) { - const reversed = reverseKeywords[rgb]; - if (reversed) { - return reversed; - } - let currentClosestDistance = Infinity; - let currentClosestKeyword; - for (const keyword of Object.keys(cssKeywords)) { - const value = cssKeywords[keyword]; - const distance = comparativeDistance(rgb, value); - if (distance < currentClosestDistance) { - currentClosestDistance = distance; - currentClosestKeyword = keyword; - } - } - return currentClosestKeyword; - }; - convert2.keyword.rgb = function(keyword) { - return cssKeywords[keyword]; - }; - convert2.rgb.xyz = function(rgb) { - let r6 = rgb[0] / 255; - let g6 = rgb[1] / 255; - let b6 = rgb[2] / 255; - r6 = r6 > 0.04045 ? ((r6 + 0.055) / 1.055) ** 2.4 : r6 / 12.92; - g6 = g6 > 0.04045 ? ((g6 + 0.055) / 1.055) ** 2.4 : g6 / 12.92; - b6 = b6 > 0.04045 ? ((b6 + 0.055) / 1.055) ** 2.4 : b6 / 12.92; - const x6 = r6 * 0.4124 + g6 * 0.3576 + b6 * 0.1805; - const y2 = r6 * 0.2126 + g6 * 0.7152 + b6 * 0.0722; - const z2 = r6 * 0.0193 + g6 * 0.1192 + b6 * 0.9505; - return [x6 * 100, y2 * 100, z2 * 100]; - }; - convert2.rgb.lab = function(rgb) { - const xyz = convert2.rgb.xyz(rgb); - let x6 = xyz[0]; - let y2 = xyz[1]; - let z2 = xyz[2]; - x6 /= 95.047; - y2 /= 100; - z2 /= 108.883; - x6 = x6 > 8856e-6 ? x6 ** (1 / 3) : 7.787 * x6 + 16 / 116; - y2 = y2 > 8856e-6 ? y2 ** (1 / 3) : 7.787 * y2 + 16 / 116; - z2 = z2 > 8856e-6 ? z2 ** (1 / 3) : 7.787 * z2 + 16 / 116; - const l6 = 116 * y2 - 16; - const a6 = 500 * (x6 - y2); - const b6 = 200 * (y2 - z2); - return [l6, a6, b6]; - }; - convert2.hsl.rgb = function(hsl) { - const h6 = hsl[0] / 360; - const s6 = hsl[1] / 100; - const l6 = hsl[2] / 100; - let t22; - let t32; - let val; - if (s6 === 0) { - val = l6 * 255; - return [val, val, val]; - } - if (l6 < 0.5) { - t22 = l6 * (1 + s6); - } else { - t22 = l6 + s6 - l6 * s6; - } - const t1 = 2 * l6 - t22; - const rgb = [0, 0, 0]; - for (let i6 = 0; i6 < 3; i6++) { - t32 = h6 + 1 / 3 * -(i6 - 1); - if (t32 < 0) { - t32++; - } - if (t32 > 1) { - t32--; - } - if (6 * t32 < 1) { - val = t1 + (t22 - t1) * 6 * t32; - } else if (2 * t32 < 1) { - val = t22; - } else if (3 * t32 < 2) { - val = t1 + (t22 - t1) * (2 / 3 - t32) * 6; - } else { - val = t1; - } - rgb[i6] = val * 255; - } - return rgb; - }; - convert2.hsl.hsv = function(hsl) { - const h6 = hsl[0]; - let s6 = hsl[1] / 100; - let l6 = hsl[2] / 100; - let smin = s6; - const lmin = Math.max(l6, 0.01); - l6 *= 2; - s6 *= l6 <= 1 ? l6 : 2 - l6; - smin *= lmin <= 1 ? lmin : 2 - lmin; - const v8 = (l6 + s6) / 2; - const sv = l6 === 0 ? 2 * smin / (lmin + smin) : 2 * s6 / (l6 + s6); - return [h6, sv * 100, v8 * 100]; - }; - convert2.hsv.rgb = function(hsv) { - const h6 = hsv[0] / 60; - const s6 = hsv[1] / 100; - let v8 = hsv[2] / 100; - const hi2 = Math.floor(h6) % 6; - const f6 = h6 - Math.floor(h6); - const p6 = 255 * v8 * (1 - s6); - const q7 = 255 * v8 * (1 - s6 * f6); - const t6 = 255 * v8 * (1 - s6 * (1 - f6)); - v8 *= 255; - switch (hi2) { - case 0: - return [v8, t6, p6]; - case 1: - return [q7, v8, p6]; - case 2: - return [p6, v8, t6]; - case 3: - return [p6, q7, v8]; - case 4: - return [t6, p6, v8]; - case 5: - return [v8, p6, q7]; - } - }; - convert2.hsv.hsl = function(hsv) { - const h6 = hsv[0]; - const s6 = hsv[1] / 100; - const v8 = hsv[2] / 100; - const vmin = Math.max(v8, 0.01); - let sl; - let l6; - l6 = (2 - s6) * v8; - const lmin = (2 - s6) * vmin; - sl = s6 * vmin; - sl /= lmin <= 1 ? lmin : 2 - lmin; - sl = sl || 0; - l6 /= 2; - return [h6, sl * 100, l6 * 100]; - }; - convert2.hwb.rgb = function(hwb) { - const h6 = hwb[0] / 360; - let wh = hwb[1] / 100; - let bl = hwb[2] / 100; - const ratio = wh + bl; - let f6; - if (ratio > 1) { - wh /= ratio; - bl /= ratio; - } - const i6 = Math.floor(6 * h6); - const v8 = 1 - bl; - f6 = 6 * h6 - i6; - if ((i6 & 1) !== 0) { - f6 = 1 - f6; - } - const n12 = wh + f6 * (v8 - wh); - let r6; - let g6; - let b6; - switch (i6) { - default: - case 6: - case 0: - r6 = v8; - g6 = n12; - b6 = wh; - break; - case 1: - r6 = n12; - g6 = v8; - b6 = wh; - break; - case 2: - r6 = wh; - g6 = v8; - b6 = n12; - break; - case 3: - r6 = wh; - g6 = n12; - b6 = v8; - break; - case 4: - r6 = n12; - g6 = wh; - b6 = v8; - break; - case 5: - r6 = v8; - g6 = wh; - b6 = n12; - break; - } - return [r6 * 255, g6 * 255, b6 * 255]; - }; - convert2.cmyk.rgb = function(cmyk) { - const c6 = cmyk[0] / 100; - const m6 = cmyk[1] / 100; - const y2 = cmyk[2] / 100; - const k7 = cmyk[3] / 100; - const r6 = 1 - Math.min(1, c6 * (1 - k7) + k7); - const g6 = 1 - Math.min(1, m6 * (1 - k7) + k7); - const b6 = 1 - Math.min(1, y2 * (1 - k7) + k7); - return [r6 * 255, g6 * 255, b6 * 255]; - }; - convert2.xyz.rgb = function(xyz) { - const x6 = xyz[0] / 100; - const y2 = xyz[1] / 100; - const z2 = xyz[2] / 100; - let r6; - let g6; - let b6; - r6 = x6 * 3.2406 + y2 * -1.5372 + z2 * -0.4986; - g6 = x6 * -0.9689 + y2 * 1.8758 + z2 * 0.0415; - b6 = x6 * 0.0557 + y2 * -0.204 + z2 * 1.057; - r6 = r6 > 31308e-7 ? 1.055 * r6 ** (1 / 2.4) - 0.055 : r6 * 12.92; - g6 = g6 > 31308e-7 ? 1.055 * g6 ** (1 / 2.4) - 0.055 : g6 * 12.92; - b6 = b6 > 31308e-7 ? 1.055 * b6 ** (1 / 2.4) - 0.055 : b6 * 12.92; - r6 = Math.min(Math.max(0, r6), 1); - g6 = Math.min(Math.max(0, g6), 1); - b6 = Math.min(Math.max(0, b6), 1); - return [r6 * 255, g6 * 255, b6 * 255]; - }; - convert2.xyz.lab = function(xyz) { - let x6 = xyz[0]; - let y2 = xyz[1]; - let z2 = xyz[2]; - x6 /= 95.047; - y2 /= 100; - z2 /= 108.883; - x6 = x6 > 8856e-6 ? x6 ** (1 / 3) : 7.787 * x6 + 16 / 116; - y2 = y2 > 8856e-6 ? y2 ** (1 / 3) : 7.787 * y2 + 16 / 116; - z2 = z2 > 8856e-6 ? z2 ** (1 / 3) : 7.787 * z2 + 16 / 116; - const l6 = 116 * y2 - 16; - const a6 = 500 * (x6 - y2); - const b6 = 200 * (y2 - z2); - return [l6, a6, b6]; - }; - convert2.lab.xyz = function(lab) { - const l6 = lab[0]; - const a6 = lab[1]; - const b6 = lab[2]; - let x6; - let y2; - let z2; - y2 = (l6 + 16) / 116; - x6 = a6 / 500 + y2; - z2 = y2 - b6 / 200; - const y22 = y2 ** 3; - const x22 = x6 ** 3; - const z22 = z2 ** 3; - y2 = y22 > 8856e-6 ? y22 : (y2 - 16 / 116) / 7.787; - x6 = x22 > 8856e-6 ? x22 : (x6 - 16 / 116) / 7.787; - z2 = z22 > 8856e-6 ? z22 : (z2 - 16 / 116) / 7.787; - x6 *= 95.047; - y2 *= 100; - z2 *= 108.883; - return [x6, y2, z2]; - }; - convert2.lab.lch = function(lab) { - const l6 = lab[0]; - const a6 = lab[1]; - const b6 = lab[2]; - let h6; - const hr = Math.atan2(b6, a6); - h6 = hr * 360 / 2 / Math.PI; - if (h6 < 0) { - h6 += 360; - } - const c6 = Math.sqrt(a6 * a6 + b6 * b6); - return [l6, c6, h6]; - }; - convert2.lch.lab = function(lch) { - const l6 = lch[0]; - const c6 = lch[1]; - const h6 = lch[2]; - const hr = h6 / 360 * 2 * Math.PI; - const a6 = c6 * Math.cos(hr); - const b6 = c6 * Math.sin(hr); - return [l6, a6, b6]; - }; - convert2.rgb.ansi16 = function(args, saturation = null) { - const [r6, g6, b6] = args; - let value = saturation === null ? convert2.rgb.hsv(args)[2] : saturation; - value = Math.round(value / 50); - if (value === 0) { - return 30; - } - let ansi = 30 + (Math.round(b6 / 255) << 2 | Math.round(g6 / 255) << 1 | Math.round(r6 / 255)); - if (value === 2) { - ansi += 60; - } - return ansi; - }; - convert2.hsv.ansi16 = function(args) { - return convert2.rgb.ansi16(convert2.hsv.rgb(args), args[2]); - }; - convert2.rgb.ansi256 = function(args) { - const r6 = args[0]; - const g6 = args[1]; - const b6 = args[2]; - if (r6 === g6 && g6 === b6) { - if (r6 < 8) { - return 16; - } - if (r6 > 248) { - return 231; - } - return Math.round((r6 - 8) / 247 * 24) + 232; - } - const ansi = 16 + 36 * Math.round(r6 / 255 * 5) + 6 * Math.round(g6 / 255 * 5) + Math.round(b6 / 255 * 5); - return ansi; - }; - convert2.ansi16.rgb = function(args) { - let color = args % 10; - if (color === 0 || color === 7) { - if (args > 50) { - color += 3.5; - } - color = color / 10.5 * 255; - return [color, color, color]; - } - const mult = (~~(args > 50) + 1) * 0.5; - const r6 = (color & 1) * mult * 255; - const g6 = (color >> 1 & 1) * mult * 255; - const b6 = (color >> 2 & 1) * mult * 255; - return [r6, g6, b6]; - }; - convert2.ansi256.rgb = function(args) { - if (args >= 232) { - const c6 = (args - 232) * 10 + 8; - return [c6, c6, c6]; - } - args -= 16; - let rem; - const r6 = Math.floor(args / 36) / 5 * 255; - const g6 = Math.floor((rem = args % 36) / 6) / 5 * 255; - const b6 = rem % 6 / 5 * 255; - return [r6, g6, b6]; - }; - convert2.rgb.hex = function(args) { - const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255); - const string = integer.toString(16).toUpperCase(); - return "000000".substring(string.length) + string; - }; - convert2.hex.rgb = function(args) { - const match3 = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); - if (!match3) { - return [0, 0, 0]; - } - let colorString = match3[0]; - if (match3[0].length === 3) { - colorString = colorString.split("").map((char) => { - return char + char; - }).join(""); - } - const integer = parseInt(colorString, 16); - const r6 = integer >> 16 & 255; - const g6 = integer >> 8 & 255; - const b6 = integer & 255; - return [r6, g6, b6]; - }; - convert2.rgb.hcg = function(rgb) { - const r6 = rgb[0] / 255; - const g6 = rgb[1] / 255; - const b6 = rgb[2] / 255; - const max = Math.max(Math.max(r6, g6), b6); - const min = Math.min(Math.min(r6, g6), b6); - const chroma = max - min; - let grayscale; - let hue; - if (chroma < 1) { - grayscale = min / (1 - chroma); - } else { - grayscale = 0; - } - if (chroma <= 0) { - hue = 0; - } else if (max === r6) { - hue = (g6 - b6) / chroma % 6; - } else if (max === g6) { - hue = 2 + (b6 - r6) / chroma; - } else { - hue = 4 + (r6 - g6) / chroma; - } - hue /= 6; - hue %= 1; - return [hue * 360, chroma * 100, grayscale * 100]; - }; - convert2.hsl.hcg = function(hsl) { - const s6 = hsl[1] / 100; - const l6 = hsl[2] / 100; - const c6 = l6 < 0.5 ? 2 * s6 * l6 : 2 * s6 * (1 - l6); - let f6 = 0; - if (c6 < 1) { - f6 = (l6 - 0.5 * c6) / (1 - c6); - } - return [hsl[0], c6 * 100, f6 * 100]; - }; - convert2.hsv.hcg = function(hsv) { - const s6 = hsv[1] / 100; - const v8 = hsv[2] / 100; - const c6 = s6 * v8; - let f6 = 0; - if (c6 < 1) { - f6 = (v8 - c6) / (1 - c6); - } - return [hsv[0], c6 * 100, f6 * 100]; - }; - convert2.hcg.rgb = function(hcg) { - const h6 = hcg[0] / 360; - const c6 = hcg[1] / 100; - const g6 = hcg[2] / 100; - if (c6 === 0) { - return [g6 * 255, g6 * 255, g6 * 255]; - } - const pure = [0, 0, 0]; - const hi2 = h6 % 1 * 6; - const v8 = hi2 % 1; - const w5 = 1 - v8; - let mg = 0; - switch (Math.floor(hi2)) { - case 0: - pure[0] = 1; - pure[1] = v8; - pure[2] = 0; - break; - case 1: - pure[0] = w5; - pure[1] = 1; - pure[2] = 0; - break; - case 2: - pure[0] = 0; - pure[1] = 1; - pure[2] = v8; - break; - case 3: - pure[0] = 0; - pure[1] = w5; - pure[2] = 1; - break; - case 4: - pure[0] = v8; - pure[1] = 0; - pure[2] = 1; - break; - default: - pure[0] = 1; - pure[1] = 0; - pure[2] = w5; - } - mg = (1 - c6) * g6; - return [ - (c6 * pure[0] + mg) * 255, - (c6 * pure[1] + mg) * 255, - (c6 * pure[2] + mg) * 255 - ]; - }; - convert2.hcg.hsv = function(hcg) { - const c6 = hcg[1] / 100; - const g6 = hcg[2] / 100; - const v8 = c6 + g6 * (1 - c6); - let f6 = 0; - if (v8 > 0) { - f6 = c6 / v8; - } - return [hcg[0], f6 * 100, v8 * 100]; - }; - convert2.hcg.hsl = function(hcg) { - const c6 = hcg[1] / 100; - const g6 = hcg[2] / 100; - const l6 = g6 * (1 - c6) + 0.5 * c6; - let s6 = 0; - if (l6 > 0 && l6 < 0.5) { - s6 = c6 / (2 * l6); - } else if (l6 >= 0.5 && l6 < 1) { - s6 = c6 / (2 * (1 - l6)); - } - return [hcg[0], s6 * 100, l6 * 100]; - }; - convert2.hcg.hwb = function(hcg) { - const c6 = hcg[1] / 100; - const g6 = hcg[2] / 100; - const v8 = c6 + g6 * (1 - c6); - return [hcg[0], (v8 - c6) * 100, (1 - v8) * 100]; - }; - convert2.hwb.hcg = function(hwb) { - const w5 = hwb[1] / 100; - const b6 = hwb[2] / 100; - const v8 = 1 - b6; - const c6 = v8 - w5; - let g6 = 0; - if (c6 < 1) { - g6 = (v8 - c6) / (1 - c6); - } - return [hwb[0], c6 * 100, g6 * 100]; - }; - convert2.apple.rgb = function(apple) { - return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255]; - }; - convert2.rgb.apple = function(rgb) { - return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535]; - }; - convert2.gray.rgb = function(args) { - return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; - }; - convert2.gray.hsl = function(args) { - return [0, 0, args[0]]; - }; - convert2.gray.hsv = convert2.gray.hsl; - convert2.gray.hwb = function(gray) { - return [0, 100, gray[0]]; - }; - convert2.gray.cmyk = function(gray) { - return [0, 0, 0, gray[0]]; - }; - convert2.gray.lab = function(gray) { - return [gray[0], 0, 0]; - }; - convert2.gray.hex = function(gray) { - const val = Math.round(gray[0] / 100 * 255) & 255; - const integer = (val << 16) + (val << 8) + val; - const string = integer.toString(16).toUpperCase(); - return "000000".substring(string.length) + string; - }; - convert2.rgb.gray = function(rgb) { - const val = (rgb[0] + rgb[1] + rgb[2]) / 3; - return [val / 255 * 100]; + emoji_regex_default2 = () => { + return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g; }; } }); -// node_modules/color-convert/route.js -var require_route = __commonJS({ - "node_modules/color-convert/route.js"(exports2, module) { - "use strict"; - var conversions = require_conversions(); - function buildGraph() { - const graph = {}; - const models = Object.keys(conversions); - for (let len = models.length, i6 = 0; i6 < len; i6++) { - graph[models[i6]] = { - // http://jsperf.com/1-vs-infinity - // micro-opt, but this is simple. - distance: -1, - parent: null - }; - } - return graph; +// node_modules/yargs/node_modules/string-width/index.js +function stringWidth2(string, options = {}) { + if (typeof string !== "string" || string.length === 0) { + return 0; + } + const { + ambiguousIsNarrow = true, + countAnsiEscapeCodes = false + } = options; + if (!countAnsiEscapeCodes) { + string = stripAnsi4(string); + } + if (string.length === 0) { + return 0; + } + let width = 0; + const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow }; + for (const { segment: character } of segmenter2.segment(string)) { + const codePoint = character.codePointAt(0); + if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) { + continue; } - function deriveBFS(fromModel) { - const graph = buildGraph(); - const queue2 = [fromModel]; - graph[fromModel].distance = 0; - while (queue2.length) { - const current = queue2.pop(); - const adjacents = Object.keys(conversions[current]); - for (let len = adjacents.length, i6 = 0; i6 < len; i6++) { - const adjacent = adjacents[i6]; - const node = graph[adjacent]; - if (node.distance === -1) { - node.distance = graph[current].distance + 1; - node.parent = current; - queue2.unshift(adjacent); - } - } - } - return graph; - } - function link(from, to) { - return function(args) { - return to(from(args)); - }; + if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) { + continue; } - function wrapConversion(toModel, graph) { - const path10 = [graph[toModel].parent, toModel]; - let fn = conversions[graph[toModel].parent][toModel]; - let cur = graph[toModel].parent; - while (graph[cur].parent) { - path10.unshift(graph[cur].parent); - fn = link(conversions[graph[cur].parent][cur], fn); - cur = graph[cur].parent; - } - fn.conversion = path10; - return fn; + if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) { + continue; } - module.exports = function(fromModel) { - const graph = deriveBFS(fromModel); - const conversion = {}; - const models = Object.keys(graph); - for (let len = models.length, i6 = 0; i6 < len; i6++) { - const toModel = models[i6]; - const node = graph[toModel]; - if (node.parent === null) { - continue; - } - conversion[toModel] = wrapConversion(toModel, graph); - } - return conversion; - }; - } -}); - -// node_modules/color-convert/index.js -var require_color_convert = __commonJS({ - "node_modules/color-convert/index.js"(exports2, module) { - "use strict"; - var conversions = require_conversions(); - var route = require_route(); - var convert2 = {}; - var models = Object.keys(conversions); - function wrapRaw(fn) { - const wrappedFn = function(...args) { - const arg0 = args[0]; - if (arg0 === void 0 || arg0 === null) { - return arg0; - } - if (arg0.length > 1) { - args = arg0; - } - return fn(args); - }; - if ("conversion" in fn) { - wrappedFn.conversion = fn.conversion; - } - return wrappedFn; + if (codePoint >= 55296 && codePoint <= 57343) { + continue; } - function wrapRounded(fn) { - const wrappedFn = function(...args) { - const arg0 = args[0]; - if (arg0 === void 0 || arg0 === null) { - return arg0; - } - if (arg0.length > 1) { - args = arg0; - } - const result = fn(args); - if (typeof result === "object") { - for (let len = result.length, i6 = 0; i6 < len; i6++) { - result[i6] = Math.round(result[i6]); - } - } - return result; - }; - if ("conversion" in fn) { - wrappedFn.conversion = fn.conversion; - } - return wrappedFn; + if (codePoint >= 65024 && codePoint <= 65039) { + continue; } - models.forEach((fromModel) => { - convert2[fromModel] = {}; - Object.defineProperty(convert2[fromModel], "channels", { value: conversions[fromModel].channels }); - Object.defineProperty(convert2[fromModel], "labels", { value: conversions[fromModel].labels }); - const routes = route(fromModel); - const routeModels = Object.keys(routes); - routeModels.forEach((toModel) => { - const fn = routes[toModel]; - convert2[fromModel][toModel] = wrapRounded(fn); - convert2[fromModel][toModel].raw = wrapRaw(fn); - }); - }); - module.exports = convert2; + if (defaultIgnorableCodePointRegex2.test(character)) { + continue; + } + if (emoji_regex_default2().test(character)) { + width += 2; + continue; + } + width += eastAsianWidth(codePoint, eastAsianWidthOptions); } -}); - -// node_modules/ansi-styles/index.js -var require_ansi_styles = __commonJS({ - "node_modules/ansi-styles/index.js"(exports2, module) { + return width; +} +var segmenter2, defaultIgnorableCodePointRegex2; +var init_string_width2 = __esm({ + "node_modules/yargs/node_modules/string-width/index.js"() { "use strict"; - var wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\x1B[${code + offset}m`; - }; - var wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\x1B[${38 + offset};5;${code}m`; - }; - var wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); - return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; - }; - var ansi2ansi = (n12) => n12; - var rgb2rgb = (r6, g6, b6) => [r6, g6, b6]; - var setLazyProperty = (object, property, get2) => { - Object.defineProperty(object, property, { - get: () => { - const value = get2(); - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); - return value; - }, - enumerable: true, - configurable: true - }); - }; - var colorConvert; - var makeDynamicStyles = (wrap2, targetSpace, identity, isBackground) => { - if (colorConvert === void 0) { - colorConvert = require_color_convert(); - } - const offset = isBackground ? 10 : 0; - const styles = {}; - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap2(identity, offset); - } else if (typeof suite === "object") { - styles[name] = wrap2(suite[targetSpace], offset); - } - } - return styles; - }; - function assembleStyles() { - const codes = /* @__PURE__ */ new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - // Bright color - blackBright: [90, 39], - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; - for (const [groupName, group4] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group4)) { - styles[styleName] = { - open: `\x1B[${style[0]}m`, - close: `\x1B[${style[1]}m` - }; - group4[styleName] = styles[styleName]; - codes.set(style[0], style[1]); - } - Object.defineProperty(styles, groupName, { - value: group4, - enumerable: false - }); - } - Object.defineProperty(styles, "codes", { - value: codes, - enumerable: false - }); - styles.color.close = "\x1B[39m"; - styles.bgColor.close = "\x1B[49m"; - setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false)); - setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false)); - setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false)); - setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true)); - setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true)); - setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true)); - return styles; - } - Object.defineProperty(module, "exports", { - enumerable: true, - get: assembleStyles - }); + init_strip_ansi2(); + init_get_east_asian_width(); + init_emoji_regex2(); + segmenter2 = new Intl.Segmenter(); + defaultIgnorableCodePointRegex2 = /^\p{Default_Ignorable_Code_Point}$/u; } }); -// node_modules/wrap-ansi/index.js -var require_wrap_ansi = __commonJS({ - "node_modules/wrap-ansi/index.js"(exports2, module) { +// node_modules/y18n/build/lib/platform-shims/node.js +import { readFileSync as readFileSync5, statSync as statSync3, writeFile as writeFile2 } from "fs"; +import { format as format2 } from "util"; +import { resolve as resolve6 } from "path"; +var node_default; +var init_node = __esm({ + "node_modules/y18n/build/lib/platform-shims/node.js"() { "use strict"; - var stringWidth = require_string_width(); - var stripAnsi3 = require_strip_ansi(); - var ansiStyles = require_ansi_styles(); - var ESCAPES = /* @__PURE__ */ new Set([ - "\x1B", - "\x9B" - ]); - var END_CODE = 39; - var ANSI_ESCAPE_BELL = "\x07"; - var ANSI_CSI = "["; - var ANSI_OSC = "]"; - var ANSI_SGR_TERMINATOR = "m"; - var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`; - var wrapAnsi = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`; - var wrapAnsiHyperlink = (uri) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`; - var wordLengths = (string) => string.split(" ").map((character) => stringWidth(character)); - var wrapWord = (rows, word, columns) => { - const characters = [...word]; - let isInsideEscape = false; - let isInsideLinkEscape = false; - let visible = stringWidth(stripAnsi3(rows[rows.length - 1])); - for (const [index2, character] of characters.entries()) { - const characterLength = stringWidth(character); - if (visible + characterLength <= columns) { - rows[rows.length - 1] += character; - } else { - rows.push(character); - visible = 0; - } - if (ESCAPES.has(character)) { - isInsideEscape = true; - isInsideLinkEscape = characters.slice(index2 + 1).join("").startsWith(ANSI_ESCAPE_LINK); - } - if (isInsideEscape) { - if (isInsideLinkEscape) { - if (character === ANSI_ESCAPE_BELL) { - isInsideEscape = false; - isInsideLinkEscape = false; - } - } else if (character === ANSI_SGR_TERMINATOR) { - isInsideEscape = false; - } - continue; - } - visible += characterLength; - if (visible === columns && index2 < characters.length - 1) { - rows.push(""); - visible = 0; - } - } - if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) { - rows[rows.length - 2] += rows.pop(); - } - }; - var stringVisibleTrimSpacesRight = (string) => { - const words = string.split(" "); - let last = words.length; - while (last > 0) { - if (stringWidth(words[last - 1]) > 0) { - break; - } - last--; - } - if (last === words.length) { - return string; - } - return words.slice(0, last).join(" ") + words.slice(last).join(""); - }; - var exec2 = (string, columns, options = {}) => { - if (options.trim !== false && string.trim() === "") { - return ""; - } - let returnValue = ""; - let escapeCode; - let escapeUrl; - const lengths = wordLengths(string); - let rows = [""]; - for (const [index2, word] of string.split(" ").entries()) { - if (options.trim !== false) { - rows[rows.length - 1] = rows[rows.length - 1].trimStart(); - } - let rowLength = stringWidth(rows[rows.length - 1]); - if (index2 !== 0) { - if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) { - rows.push(""); - rowLength = 0; - } - if (rowLength > 0 || options.trim === false) { - rows[rows.length - 1] += " "; - rowLength++; - } - } - if (options.hard && lengths[index2] > columns) { - const remainingColumns = columns - rowLength; - const breaksStartingThisLine = 1 + Math.floor((lengths[index2] - remainingColumns - 1) / columns); - const breaksStartingNextLine = Math.floor((lengths[index2] - 1) / columns); - if (breaksStartingNextLine < breaksStartingThisLine) { - rows.push(""); - } - wrapWord(rows, word, columns); - continue; - } - if (rowLength + lengths[index2] > columns && rowLength > 0 && lengths[index2] > 0) { - if (options.wordWrap === false && rowLength < columns) { - wrapWord(rows, word, columns); - continue; - } - rows.push(""); - } - if (rowLength + lengths[index2] > columns && options.wordWrap === false) { - wrapWord(rows, word, columns); - continue; - } - rows[rows.length - 1] += word; - } - if (options.trim !== false) { - rows = rows.map(stringVisibleTrimSpacesRight); - } - const pre = [...rows.join("\n")]; - for (const [index2, character] of pre.entries()) { - returnValue += character; - if (ESCAPES.has(character)) { - const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?\\d+)m|\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index2).join("")) || { groups: {} }; - if (groups.code !== void 0) { - const code2 = Number.parseFloat(groups.code); - escapeCode = code2 === END_CODE ? void 0 : code2; - } else if (groups.uri !== void 0) { - escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri; - } - } - const code = ansiStyles.codes.get(Number(escapeCode)); - if (pre[index2 + 1] === "\n") { - if (escapeUrl) { - returnValue += wrapAnsiHyperlink(""); - } - if (escapeCode && code) { - returnValue += wrapAnsi(code); - } - } else if (character === "\n") { - if (escapeCode && code) { - returnValue += wrapAnsi(escapeCode); - } - if (escapeUrl) { - returnValue += wrapAnsiHyperlink(escapeUrl); - } + node_default = { + fs: { + readFileSync: readFileSync5, + writeFile: writeFile2 + }, + format: format2, + resolve: resolve6, + exists: (file) => { + try { + return statSync3(file).isFile(); + } catch (err) { + return false; } } - return returnValue; - }; - module.exports = (string, columns, options) => { - return String(string).normalize().replace(/\r\n/g, "\n").split("\n").map((line) => exec2(line, columns, options)).join("\n"); }; } }); -// node_modules/ai-ctrf/node_modules/cliui/build/index.cjs -var require_build3 = __commonJS({ - "node_modules/ai-ctrf/node_modules/cliui/build/index.cjs"(exports2, module) { +// node_modules/y18n/build/lib/index.js +function y18n(opts, _shim) { + shim = _shim; + const y18n3 = new Y18N(opts); + return { + __: y18n3.__.bind(y18n3), + __n: y18n3.__n.bind(y18n3), + setLocale: y18n3.setLocale.bind(y18n3), + getLocale: y18n3.getLocale.bind(y18n3), + updateLocale: y18n3.updateLocale.bind(y18n3), + locale: y18n3.locale + }; +} +var shim, Y18N; +var init_lib3 = __esm({ + "node_modules/y18n/build/lib/index.js"() { "use strict"; - var align = { - right: alignRight, - center: alignCenter - }; - var top = 0; - var right = 1; - var bottom = 2; - var left = 3; - var UI = class { + Y18N = class { constructor(opts) { - var _a5; - this.width = opts.width; - this.wrap = (_a5 = opts.wrap) !== null && _a5 !== void 0 ? _a5 : true; - this.rows = []; - } - span(...args) { - const cols = this.div(...args); - cols.span = true; - } - resetOutput() { - this.rows = []; + opts = opts || {}; + this.directory = opts.directory || "./locales"; + this.updateFiles = typeof opts.updateFiles === "boolean" ? opts.updateFiles : true; + this.locale = opts.locale || "en"; + this.fallbackToLanguage = typeof opts.fallbackToLanguage === "boolean" ? opts.fallbackToLanguage : true; + this.cache = /* @__PURE__ */ Object.create(null); + this.writeQueue = []; } - div(...args) { - if (args.length === 0) { - this.div(""); + __(...args) { + if (typeof arguments[0] !== "string") { + return this._taggedLiteral(arguments[0], ...arguments); } - if (this.wrap && this.shouldApplyLayoutDSL(...args) && typeof args[0] === "string") { - return this.applyLayoutDSL(args[0]); + const str = args.shift(); + let cb = function() { + }; + if (typeof args[args.length - 1] === "function") + cb = args.pop(); + cb = cb || function() { + }; + if (!this.cache[this.locale]) + this._readLocaleFile(); + if (!this.cache[this.locale][str] && this.updateFiles) { + this.cache[this.locale][str] = str; + this._enqueueWrite({ + directory: this.directory, + locale: this.locale, + cb + }); + } else { + cb(); } - const cols = args.map((arg) => { - if (typeof arg === "string") { - return this.colFromString(arg); - } - return arg; - }); - this.rows.push(cols); - return cols; - } - shouldApplyLayoutDSL(...args) { - return args.length === 1 && typeof args[0] === "string" && /[\t\n]/.test(args[0]); - } - applyLayoutDSL(str) { - const rows = str.split("\n").map((row) => row.split(" ")); - let leftColumnWidth = 0; - rows.forEach((columns) => { - if (columns.length > 1 && mixin.stringWidth(columns[0]) > leftColumnWidth) { - leftColumnWidth = Math.min(Math.floor(this.width * 0.5), mixin.stringWidth(columns[0])); - } - }); - rows.forEach((columns) => { - this.div(...columns.map((r6, i6) => { - return { - text: r6.trim(), - padding: this.measurePadding(r6), - width: i6 === 0 && columns.length > 1 ? leftColumnWidth : void 0 - }; - })); - }); - return this.rows[this.rows.length - 1]; + return shim.format.apply(shim.format, [this.cache[this.locale][str] || str].concat(args)); } - colFromString(text) { - return { - text, - padding: this.measurePadding(text) + __n() { + const args = Array.prototype.slice.call(arguments); + const singular = args.shift(); + const plural = args.shift(); + const quantity = args.shift(); + let cb = function() { }; + if (typeof args[args.length - 1] === "function") + cb = args.pop(); + if (!this.cache[this.locale]) + this._readLocaleFile(); + let str = quantity === 1 ? singular : plural; + if (this.cache[this.locale][singular]) { + const entry = this.cache[this.locale][singular]; + str = entry[quantity === 1 ? "one" : "other"]; + } + if (!this.cache[this.locale][singular] && this.updateFiles) { + this.cache[this.locale][singular] = { + one: singular, + other: plural + }; + this._enqueueWrite({ + directory: this.directory, + locale: this.locale, + cb + }); + } else { + cb(); + } + const values = [str]; + if (~str.indexOf("%d")) + values.push(quantity); + return shim.format.apply(shim.format, values.concat(args)); } - measurePadding(str) { - const noAnsi = mixin.stripAnsi(str); - return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length]; - } - toString() { - const lines = []; - this.rows.forEach((row) => { - this.rowToString(row, lines); - }); - return lines.filter((line) => !line.hidden).map((line) => line.text).join("\n"); + setLocale(locale) { + this.locale = locale; } - rowToString(row, lines) { - this.rasterize(row).forEach((rrow, r6) => { - let str = ""; - rrow.forEach((col, c6) => { - const { width } = row[c6]; - const wrapWidth = this.negatePadding(row[c6]); - let ts2 = col; - if (wrapWidth > mixin.stringWidth(col)) { - ts2 += " ".repeat(wrapWidth - mixin.stringWidth(col)); - } - if (row[c6].align && row[c6].align !== "left" && this.wrap) { - const fn = align[row[c6].align]; - ts2 = fn(ts2, wrapWidth); - if (mixin.stringWidth(ts2) < wrapWidth) { - ts2 += " ".repeat((width || 0) - mixin.stringWidth(ts2) - 1); - } - } - const padding = row[c6].padding || [0, 0, 0, 0]; - if (padding[left]) { - str += " ".repeat(padding[left]); - } - str += addBorder(row[c6], ts2, "| "); - str += ts2; - str += addBorder(row[c6], ts2, " |"); - if (padding[right]) { - str += " ".repeat(padding[right]); - } - if (r6 === 0 && lines.length > 0) { - str = this.renderInline(str, lines[lines.length - 1]); - } - }); - lines.push({ - text: str.replace(/ +$/, ""), - span: row.span - }); - }); - return lines; + getLocale() { + return this.locale; } - // if the full 'source' can render in - // the target line, do so. - renderInline(source, previousLine) { - const match3 = source.match(/^ */); - const leadingWhitespace = match3 ? match3[0].length : 0; - const target = previousLine.text; - const targetTextWidth = mixin.stringWidth(target.trimRight()); - if (!previousLine.span) { - return source; - } - if (!this.wrap) { - previousLine.hidden = true; - return target + source; - } - if (leadingWhitespace < targetTextWidth) { - return source; + updateLocale(obj) { + if (!this.cache[this.locale]) + this._readLocaleFile(); + for (const key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + this.cache[this.locale][key] = obj[key]; + } } - previousLine.hidden = true; - return target.trimRight() + " ".repeat(leadingWhitespace - targetTextWidth) + source.trimLeft(); } - rasterize(row) { - const rrows = []; - const widths = this.columnWidths(row); - let wrapped; - row.forEach((col, c6) => { - col.width = widths[c6]; - if (this.wrap) { - wrapped = mixin.wrap(col.text, this.negatePadding(col), { hard: true }).split("\n"); - } else { - wrapped = col.text.split("\n"); - } - if (col.border) { - wrapped.unshift("." + "-".repeat(this.negatePadding(col) + 2) + "."); - wrapped.push("'" + "-".repeat(this.negatePadding(col) + 2) + "'"); - } - if (col.padding) { - wrapped.unshift(...new Array(col.padding[top] || 0).fill("")); - wrapped.push(...new Array(col.padding[bottom] || 0).fill("")); + _taggedLiteral(parts, ...args) { + let str = ""; + parts.forEach(function(part, i6) { + const arg = args[i6 + 1]; + str += part; + if (typeof arg !== "undefined") { + str += "%s"; } - wrapped.forEach((str, r6) => { - if (!rrows[r6]) { - rrows.push([]); - } - const rrow = rrows[r6]; - for (let i6 = 0; i6 < c6; i6++) { - if (rrow[i6] === void 0) { - rrow.push(""); - } - } - rrow.push(str); - }); }); - return rrows; + return this.__.apply(this, [str].concat([].slice.call(args, 1))); } - negatePadding(col) { - let wrapWidth = col.width || 0; - if (col.padding) { - wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0); - } - if (col.border) { - wrapWidth -= 4; - } - return wrapWidth; + _enqueueWrite(work) { + this.writeQueue.push(work); + if (this.writeQueue.length === 1) + this._processWriteQueue(); } - columnWidths(row) { - if (!this.wrap) { - return row.map((col) => { - return col.width || mixin.stringWidth(col.text); - }); - } - let unset = row.length; - let remainingWidth = this.width; - const widths = row.map((col) => { - if (col.width) { - unset--; - remainingWidth -= col.width; - return col.width; - } - return void 0; - }); - const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0; - return widths.map((w5, i6) => { - if (w5 === void 0) { - return Math.max(unsetWidth, _minWidth(row[i6])); - } - return w5; + _processWriteQueue() { + const _this = this; + const work = this.writeQueue[0]; + const directory = work.directory; + const locale = work.locale; + const cb = work.cb; + const languageFile = this._resolveLocaleFile(directory, locale); + const serializedLocale = JSON.stringify(this.cache[locale], null, 2); + shim.fs.writeFile(languageFile, serializedLocale, "utf-8", function(err) { + _this.writeQueue.shift(); + if (_this.writeQueue.length > 0) + _this._processWriteQueue(); + cb(err); }); } - }; - function addBorder(col, ts2, style) { - if (col.border) { - if (/[.']-+[.']/.test(ts2)) { - return ""; - } - if (ts2.trim().length !== 0) { - return style; + _readLocaleFile() { + let localeLookup = {}; + const languageFile = this._resolveLocaleFile(this.directory, this.locale); + try { + if (shim.fs.readFileSync) { + localeLookup = JSON.parse(shim.fs.readFileSync(languageFile, "utf-8")); + } + } catch (err) { + if (err instanceof SyntaxError) { + err.message = "syntax error in " + languageFile; + } + if (err.code === "ENOENT") + localeLookup = {}; + else + throw err; } - return " "; - } - return ""; - } - function _minWidth(col) { - const padding = col.padding || []; - const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0); - if (col.border) { - return minWidth + 4; - } - return minWidth; - } - function getWindowWidth() { - if (typeof process === "object" && process.stdout && process.stdout.columns) { - return process.stdout.columns; + this.cache[this.locale] = localeLookup; } - return 80; - } - function alignRight(str, width) { - str = str.trim(); - const strWidth = mixin.stringWidth(str); - if (strWidth < width) { - return " ".repeat(width - strWidth) + str; + _resolveLocaleFile(directory, locale) { + let file = shim.resolve(directory, "./", locale + ".json"); + if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf("_")) { + const languageFile = shim.resolve(directory, "./", locale.split("_")[0] + ".json"); + if (this._fileExistsSync(languageFile)) + file = languageFile; + } + return file; } - return str; - } - function alignCenter(str, width) { - str = str.trim(); - const strWidth = mixin.stringWidth(str); - if (strWidth >= width) { - return str; + _fileExistsSync(file) { + return shim.exists(file); } - return " ".repeat(width - strWidth >> 1) + str; - } - var mixin; - function cliui(opts, _mixin) { - mixin = _mixin; - return new UI({ - width: (opts === null || opts === void 0 ? void 0 : opts.width) || getWindowWidth(), - wrap: opts === null || opts === void 0 ? void 0 : opts.wrap - }); - } - var stringWidth = require_string_width(); - var stripAnsi3 = require_strip_ansi(); - var wrap2 = require_wrap_ansi(); - function ui2(opts) { - return cliui(opts, { - stringWidth, - stripAnsi: stripAnsi3, - wrap: wrap2 - }); - } - module.exports = ui2; + }; } }); -// node_modules/escalade/sync/index.js -var require_sync = __commonJS({ - "node_modules/escalade/sync/index.js"(exports2, module) { +// node_modules/y18n/index.mjs +var y18n2, y18n_default; +var init_y18n = __esm({ + "node_modules/y18n/index.mjs"() { "use strict"; - var { dirname: dirname3, resolve: resolve4 } = __require("path"); - var { readdirSync: readdirSync3, statSync: statSync2 } = __require("fs"); - module.exports = function(start, callback) { - let dir2 = resolve4(".", start); - let tmp, stats = statSync2(dir2); - if (!stats.isDirectory()) { - dir2 = dirname3(dir2); - } - while (true) { - tmp = callback(dir2, readdirSync3(dir2)); - if (tmp) return resolve4(dir2, tmp); - dir2 = dirname3(tmp = dir2); - if (tmp === dir2) break; - } + init_node(); + init_lib3(); + y18n2 = (opts) => { + return y18n(opts, node_default); }; + y18n_default = y18n2; } }); @@ -96465,7 +95961,7 @@ var require_sync = __commonJS({ var require_get_caller_file = __commonJS({ "node_modules/get-caller-file/index.js"(exports2, module) { "use strict"; - module.exports = function getCallerFile(position) { + module.exports = function getCallerFile2(position) { if (position === void 0) { position = 2; } @@ -96485,210 +95981,294 @@ var require_get_caller_file = __commonJS({ } }); -// node_modules/require-directory/index.js -var require_require_directory = __commonJS({ - "node_modules/require-directory/index.js"(exports2, module) { +// node_modules/yargs/lib/platform-shims/esm.mjs +import { notStrictEqual, strictEqual } from "assert"; +import { inspect as inspect2 } from "util"; +import { fileURLToPath as fileURLToPath3 } from "url"; +import { basename as basename4, dirname as dirname3, extname as extname3, relative as relative2, resolve as resolve7, join as join4 } from "path"; +import { createRequire as createRequire2 } from "module"; +import { readFileSync as readFileSync6, readdirSync as readdirSync4 } from "fs"; +var import_get_caller_file, __dirname2, mainFilename, require3, esm_default; +var init_esm = __esm({ + "node_modules/yargs/lib/platform-shims/esm.mjs"() { "use strict"; - var fs16 = __require("fs"); - var join10 = __require("path").join; - var resolve4 = __require("path").resolve; - var dirname3 = __require("path").dirname; - var defaultOptions4 = { - extensions: ["js", "json", "coffee"], - recurse: true, - rename: function(name) { - return name; + init_cliui(); + init_sync(); + init_lib2(); + init_process_argv(); + init_string_width2(); + init_y18n(); + import_get_caller_file = __toESM(require_get_caller_file(), 1); + __dirname2 = fileURLToPath3(import.meta.url); + mainFilename = __dirname2.substring(0, __dirname2.lastIndexOf("node_modules")); + require3 = createRequire2(import.meta.url); + esm_default = { + assert: { + notStrictEqual, + strictEqual + }, + cliui: ui2, + findUp: sync_default, + getEnv: (key) => { + return process.env[key]; }, - visit: function(obj) { - return obj; - } + inspect: inspect2, + getProcessArgvBin, + mainFilename: mainFilename || process.cwd(), + Parser: lib_default, + path: { + basename: basename4, + dirname: dirname3, + extname: extname3, + relative: relative2, + resolve: resolve7, + join: join4 + }, + process: { + argv: () => process.argv, + cwd: process.cwd, + emitWarning: (warning3, type) => process.emitWarning(warning3, type), + execPath: () => process.execPath, + exit: (code) => { + process.exit(code); + }, + nextTick: process.nextTick, + stdColumns: typeof process.stdout.columns !== "undefined" ? process.stdout.columns : null + }, + readFileSync: readFileSync6, + readdirSync: readdirSync4, + require: require3, + getCallerFile: () => { + const callerFile = (0, import_get_caller_file.default)(3); + return callerFile.match(/^file:\/\//) ? fileURLToPath3(callerFile) : callerFile; + }, + stringWidth: stringWidth2, + y18n: y18n_default({ + directory: resolve7(__dirname2, "../../../locales"), + updateFiles: false + }) }; - function checkFileInclusion(path10, filename, options) { - return ( - // verify file has valid extension - new RegExp("\\.(" + options.extensions.join("|") + ")$", "i").test(filename) && // if options.include is a RegExp, evaluate it and make sure the path passes - !(options.include && options.include instanceof RegExp && !options.include.test(path10)) && // if options.include is a function, evaluate it and make sure the path passes - !(options.include && typeof options.include === "function" && !options.include(path10, filename)) && // if options.exclude is a RegExp, evaluate it and make sure the path doesn't pass - !(options.exclude && options.exclude instanceof RegExp && options.exclude.test(path10)) && // if options.exclude is a function, evaluate it and make sure the path doesn't pass - !(options.exclude && typeof options.exclude === "function" && options.exclude(path10, filename)) - ); - } - function requireDirectory(m6, path10, options) { - var retval = {}; - if (path10 && !options && typeof path10 !== "string") { - options = path10; - path10 = null; - } - options = options || {}; - for (var prop in defaultOptions4) { - if (typeof options[prop] === "undefined") { - options[prop] = defaultOptions4[prop]; + } +}); + +// node_modules/yargs/build/lib/typings/common-types.js +function assertNotStrictEqual(actual, expected, shim3, message) { + shim3.assert.notStrictEqual(actual, expected, message); +} +function assertSingleKey(actual, shim3) { + shim3.assert.strictEqual(typeof actual, "string"); +} +function objectKeys(object) { + return Object.keys(object); +} +var init_common_types = __esm({ + "node_modules/yargs/build/lib/typings/common-types.js"() { + "use strict"; + } +}); + +// node_modules/yargs/build/lib/utils/is-promise.js +function isPromise(maybePromise) { + return !!maybePromise && !!maybePromise.then && typeof maybePromise.then === "function"; +} +var init_is_promise = __esm({ + "node_modules/yargs/build/lib/utils/is-promise.js"() { + "use strict"; + } +}); + +// node_modules/yargs/build/lib/yerror.js +var YError; +var init_yerror = __esm({ + "node_modules/yargs/build/lib/yerror.js"() { + "use strict"; + YError = class _YError extends Error { + constructor(msg) { + super(msg || "yargs error"); + this.name = "YError"; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, _YError); } } - path10 = !path10 ? dirname3(m6.filename) : resolve4(dirname3(m6.filename), path10); - fs16.readdirSync(path10).forEach(function(filename) { - var joined = join10(path10, filename), files, key, obj; - if (fs16.statSync(joined).isDirectory() && options.recurse) { - files = requireDirectory(m6, joined, options); - if (Object.keys(files).length) { - retval[options.rename(filename, joined, filename)] = files; - } - } else { - if (joined !== m6.filename && checkFileInclusion(joined, filename, options)) { - key = filename.substring(0, filename.lastIndexOf(".")); - obj = m6.require(joined); - retval[options.rename(key, joined, filename)] = options.visit(obj, joined, filename) || obj; - } - } + }; + } +}); + +// node_modules/yargs/build/lib/parse-command.js +function parseCommand(cmd) { + const extraSpacesStrippedCommand = cmd.replace(/\s{2,}/g, " "); + const splitCommand = extraSpacesStrippedCommand.split(/\s+(?![^[]*]|[^<]*>)/); + const bregex = /\.*[\][<>]/g; + const firstCommand = splitCommand.shift(); + if (!firstCommand) + throw new Error(`No command found in: ${cmd}`); + const parsedCommand = { + cmd: firstCommand.replace(bregex, ""), + demanded: [], + optional: [] + }; + splitCommand.forEach((cmd2, i6) => { + let variadic = false; + cmd2 = cmd2.replace(/\s/g, ""); + if (/\.+[\]>]/.test(cmd2) && i6 === splitCommand.length - 1) + variadic = true; + if (/^\[/.test(cmd2)) { + parsedCommand.optional.push({ + cmd: cmd2.replace(bregex, "").split("|"), + variadic + }); + } else { + parsedCommand.demanded.push({ + cmd: cmd2.replace(bregex, "").split("|"), + variadic }); - return retval; } - module.exports = requireDirectory; - module.exports.defaults = defaultOptions4; + }); + return parsedCommand; +} +var init_parse_command = __esm({ + "node_modules/yargs/build/lib/parse-command.js"() { + "use strict"; } }); -// node_modules/ai-ctrf/node_modules/yargs/build/index.cjs -var require_build4 = __commonJS({ - "node_modules/ai-ctrf/node_modules/yargs/build/index.cjs"(exports2, module) { +// node_modules/yargs/build/lib/argsert.js +function argsert(arg1, arg2, arg3) { + function parseArgs() { + return typeof arg1 === "object" ? [{ demanded: [], optional: [] }, arg1, arg2] : [ + parseCommand(`cmd ${arg1}`), + arg2, + arg3 + ]; + } + try { + let position = 0; + const [parsed, callerArguments, _length] = parseArgs(); + const args = [].slice.call(callerArguments); + while (args.length && args[args.length - 1] === void 0) + args.pop(); + const length = _length || args.length; + if (length < parsed.demanded.length) { + throw new YError(`Not enough arguments provided. Expected ${parsed.demanded.length} but received ${args.length}.`); + } + const totalCommands = parsed.demanded.length + parsed.optional.length; + if (length > totalCommands) { + throw new YError(`Too many arguments provided. Expected max ${totalCommands} but received ${length}.`); + } + parsed.demanded.forEach((demanded) => { + const arg = args.shift(); + const observedType = guessType(arg); + const matchingTypes = demanded.cmd.filter((type) => type === observedType || type === "*"); + if (matchingTypes.length === 0) + argumentTypeError(observedType, demanded.cmd, position); + position += 1; + }); + parsed.optional.forEach((optional) => { + if (args.length === 0) + return; + const arg = args.shift(); + const observedType = guessType(arg); + const matchingTypes = optional.cmd.filter((type) => type === observedType || type === "*"); + if (matchingTypes.length === 0) + argumentTypeError(observedType, optional.cmd, position); + position += 1; + }); + } catch (err) { + console.warn(err.stack); + } +} +function guessType(arg) { + if (Array.isArray(arg)) { + return "array"; + } else if (arg === null) { + return "null"; + } + return typeof arg; +} +function argumentTypeError(observedType, allowedTypes, position) { + throw new YError(`Invalid ${positionName[position] || "manyith"} argument. Expected ${allowedTypes.join(" or ")} but received ${observedType}.`); +} +var positionName; +var init_argsert = __esm({ + "node_modules/yargs/build/lib/argsert.js"() { "use strict"; - var t6 = __require("assert"); - var e6 = class _e7 extends Error { - constructor(t7) { - super(t7 || "yargs error"), this.name = "YError", Error.captureStackTrace && Error.captureStackTrace(this, _e7); - } - }; - var s6; - var i6 = []; - function n12(t7, o7, a7, h7) { - s6 = h7; - let l7 = {}; - if (Object.prototype.hasOwnProperty.call(t7, "extends")) { - if ("string" != typeof t7.extends) return l7; - const r7 = /\.json|\..*rc$/.test(t7.extends); - let h8 = null; - if (r7) h8 = (function(t8, e7) { - return s6.path.resolve(t8, e7); - })(o7, t7.extends); - else try { - h8 = __require.resolve(t7.extends); - } catch (e7) { - return t7; - } - !(function(t8) { - if (i6.indexOf(t8) > -1) throw new e6(`Circular extended configurations: '${t8}'.`); - })(h8), i6.push(h8), l7 = r7 ? JSON.parse(s6.readFileSync(h8, "utf8")) : __require(t7.extends), delete t7.extends, l7 = n12(l7, s6.path.dirname(h8), a7, s6); - } - return i6 = [], a7 ? r6(l7, t7) : Object.assign({}, l7, t7); - } - function r6(t7, e7) { - const s7 = {}; - function i7(t8) { - return t8 && "object" == typeof t8 && !Array.isArray(t8); - } - Object.assign(s7, t7); - for (const n13 of Object.keys(e7)) i7(e7[n13]) && i7(s7[n13]) ? s7[n13] = r6(t7[n13], e7[n13]) : s7[n13] = e7[n13]; - return s7; - } - function o6(t7) { - const e7 = t7.replace(/\s{2,}/g, " ").split(/\s+(?![^[]*]|[^<]*>)/), s7 = /\.*[\][<>]/g, i7 = e7.shift(); - if (!i7) throw new Error(`No command found in: ${t7}`); - const n13 = { cmd: i7.replace(s7, ""), demanded: [], optional: [] }; - return e7.forEach(((t8, i8) => { - let r7 = false; - t8 = t8.replace(/\s/g, ""), /\.+[\]>]/.test(t8) && i8 === e7.length - 1 && (r7 = true), /^\[/.test(t8) ? n13.optional.push({ cmd: t8.replace(s7, "").split("|"), variadic: r7 }) : n13.demanded.push({ cmd: t8.replace(s7, "").split("|"), variadic: r7 }); - })), n13; - } - var a6 = ["first", "second", "third", "fourth", "fifth", "sixth"]; - function h6(t7, s7, i7) { - try { - let n13 = 0; - const [r7, a7, h7] = "object" == typeof t7 ? [{ demanded: [], optional: [] }, t7, s7] : [o6(`cmd ${t7}`), s7, i7], f7 = [].slice.call(a7); - for (; f7.length && void 0 === f7[f7.length - 1]; ) f7.pop(); - const d7 = h7 || f7.length; - if (d7 < r7.demanded.length) throw new e6(`Not enough arguments provided. Expected ${r7.demanded.length} but received ${f7.length}.`); - const u7 = r7.demanded.length + r7.optional.length; - if (d7 > u7) throw new e6(`Too many arguments provided. Expected max ${u7} but received ${d7}.`); - r7.demanded.forEach(((t8) => { - const e7 = l6(f7.shift()); - 0 === t8.cmd.filter(((t9) => t9 === e7 || "*" === t9)).length && c6(e7, t8.cmd, n13), n13 += 1; - })), r7.optional.forEach(((t8) => { - if (0 === f7.length) return; - const e7 = l6(f7.shift()); - 0 === t8.cmd.filter(((t9) => t9 === e7 || "*" === t9)).length && c6(e7, t8.cmd, n13), n13 += 1; - })); - } catch (t8) { - console.warn(t8.stack); - } - } - function l6(t7) { - return Array.isArray(t7) ? "array" : null === t7 ? "null" : typeof t7; - } - function c6(t7, s7, i7) { - throw new e6(`Invalid ${a6[i7] || "manyith"} argument. Expected ${s7.join(" or ")} but received ${t7}.`); - } - function f6(t7) { - return !!t7 && !!t7.then && "function" == typeof t7.then; - } - function d6(t7, e7, s7, i7) { - s7.assert.notStrictEqual(t7, e7, i7); - } - function u6(t7, e7) { - e7.assert.strictEqual(typeof t7, "string"); - } - function p6(t7) { - return Object.keys(t7); - } - function g6(t7 = {}, e7 = (() => true)) { - const s7 = {}; - return p6(t7).forEach(((i7) => { - e7(i7, t7[i7]) && (s7[i7] = t7[i7]); - })), s7; - } - function m6() { - return process.versions.electron && !process.defaultApp ? 0 : 1; - } - function y2() { - return process.argv[m6()]; + init_yerror(); + init_parse_command(); + positionName = ["first", "second", "third", "fourth", "fifth", "sixth"]; + } +}); + +// node_modules/yargs/build/lib/middleware.js +function commandMiddlewareFactory(commandMiddleware) { + if (!commandMiddleware) + return []; + return commandMiddleware.map((middleware) => { + middleware.applyBeforeValidation = false; + return middleware; + }); +} +function applyMiddleware(argv, yargs, middlewares, beforeValidation) { + return middlewares.reduce((acc, middleware) => { + if (middleware.applyBeforeValidation !== beforeValidation) { + return acc; } - var b6 = Object.freeze({ __proto__: null, hideBin: function(t7) { - return t7.slice(m6() + 1); - }, getProcessArgvBin: y2 }); - function v8(t7, e7, s7, i7) { - if ("a" === s7 && !i7) throw new TypeError("Private accessor was defined without a getter"); - if ("function" == typeof e7 ? t7 !== e7 || !i7 : !e7.has(t7)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return "m" === s7 ? i7 : "a" === s7 ? i7.call(t7) : i7 ? i7.value : e7.get(t7); + if (middleware.mutates) { + if (middleware.applied) + return acc; + middleware.applied = true; } - function O2(t7, e7, s7, i7, n13) { - if ("m" === i7) throw new TypeError("Private method is not writable"); - if ("a" === i7 && !n13) throw new TypeError("Private accessor was defined without a setter"); - if ("function" == typeof e7 ? t7 !== e7 || !n13 : !e7.has(t7)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return "a" === i7 ? n13.call(t7, s7) : n13 ? n13.value = s7 : e7.set(t7, s7), s7; + if (isPromise(acc)) { + return acc.then((initialObj) => Promise.all([initialObj, middleware(initialObj, yargs)])).then(([initialObj, middlewareObj]) => Object.assign(initialObj, middlewareObj)); + } else { + const result = middleware(acc, yargs); + return isPromise(result) ? result.then((middlewareObj) => Object.assign(acc, middlewareObj)) : Object.assign(acc, result); } - var w5 = class { - constructor(t7) { - this.globalMiddleware = [], this.frozens = [], this.yargs = t7; - } - addMiddleware(t7, e7, s7 = true, i7 = false) { - if (h6(" [boolean] [boolean] [boolean]", [t7, e7, s7], arguments.length), Array.isArray(t7)) { - for (let i8 = 0; i8 < t7.length; i8++) { - if ("function" != typeof t7[i8]) throw Error("middleware must be a function"); - const n13 = t7[i8]; - n13.applyBeforeValidation = e7, n13.global = s7; - } - Array.prototype.push.apply(this.globalMiddleware, t7); - } else if ("function" == typeof t7) { - const n13 = t7; - n13.applyBeforeValidation = e7, n13.global = s7, n13.mutates = i7, this.globalMiddleware.push(t7); + }, argv); +} +var GlobalMiddleware; +var init_middleware = __esm({ + "node_modules/yargs/build/lib/middleware.js"() { + "use strict"; + init_argsert(); + init_is_promise(); + GlobalMiddleware = class { + constructor(yargs) { + this.globalMiddleware = []; + this.frozens = []; + this.yargs = yargs; + } + addMiddleware(callback, applyBeforeValidation, global2 = true, mutates = false) { + argsert(" [boolean] [boolean] [boolean]", [callback, applyBeforeValidation, global2], arguments.length); + if (Array.isArray(callback)) { + for (let i6 = 0; i6 < callback.length; i6++) { + if (typeof callback[i6] !== "function") { + throw Error("middleware must be a function"); + } + const m3 = callback[i6]; + m3.applyBeforeValidation = applyBeforeValidation; + m3.global = global2; + } + Array.prototype.push.apply(this.globalMiddleware, callback); + } else if (typeof callback === "function") { + const m3 = callback; + m3.applyBeforeValidation = applyBeforeValidation; + m3.global = global2; + m3.mutates = mutates; + this.globalMiddleware.push(callback); } return this.yargs; } - addCoerceMiddleware(t7, e7) { - const s7 = this.yargs.getAliases(); - return this.globalMiddleware = this.globalMiddleware.filter(((t8) => { - const i7 = [...s7[e7] || [], e7]; - return !t8.option || !i7.includes(t8.option); - })), t7.option = e7, this.addMiddleware(t7, true, true, true); + addCoerceMiddleware(callback, option) { + const aliases = this.yargs.getAliases(); + this.globalMiddleware = this.globalMiddleware.filter((m3) => { + const toCheck = [...aliases[option] || [], option]; + if (!m3.option) + return true; + else + return !toCheck.includes(m3.option); + }); + callback.option = option; + return this.addMiddleware(callback, true, true, true); } getMiddleware() { return this.globalMiddleware; @@ -96697,81 +96277,196 @@ var require_build4 = __commonJS({ this.frozens.push([...this.globalMiddleware]); } unfreeze() { - const t7 = this.frozens.pop(); - void 0 !== t7 && (this.globalMiddleware = t7); + const frozen = this.frozens.pop(); + if (frozen !== void 0) + this.globalMiddleware = frozen; } reset() { - this.globalMiddleware = this.globalMiddleware.filter(((t7) => t7.global)); + this.globalMiddleware = this.globalMiddleware.filter((m3) => m3.global); } }; - function C3(t7, e7, s7, i7) { - return s7.reduce(((t8, s8) => { - if (s8.applyBeforeValidation !== i7) return t8; - if (s8.mutates) { - if (s8.applied) return t8; - s8.applied = true; - } - if (f6(t8)) return t8.then(((t9) => Promise.all([t9, s8(t9, e7)]))).then((([t9, e8]) => Object.assign(t9, e8))); - { - const i8 = s8(t8, e7); - return f6(i8) ? i8.then(((e8) => Object.assign(t8, e8))) : Object.assign(t8, i8); + } +}); + +// node_modules/yargs/build/lib/utils/maybe-async-result.js +function maybeAsyncResult(getResult, resultHandler, errorHandler = (err) => { + throw err; +}) { + try { + const result = isFunction(getResult) ? getResult() : getResult; + return isPromise(result) ? result.then((result2) => resultHandler(result2)) : resultHandler(result); + } catch (err) { + return errorHandler(err); + } +} +function isFunction(arg) { + return typeof arg === "function"; +} +var init_maybe_async_result = __esm({ + "node_modules/yargs/build/lib/utils/maybe-async-result.js"() { + "use strict"; + init_is_promise(); + } +}); + +// node_modules/yargs/build/lib/command.js +function command(usage2, validation2, globalMiddleware, shim3) { + return new CommandInstance(usage2, validation2, globalMiddleware, shim3); +} +function isCommandBuilderDefinition(builder) { + return typeof builder === "object" && !!builder.builder && typeof builder.handler === "function"; +} +function isCommandAndAliases(cmd) { + return cmd.every((c6) => typeof c6 === "string"); +} +function isCommandBuilderCallback(builder) { + return typeof builder === "function"; +} +function isCommandBuilderOptionDefinitions(builder) { + return typeof builder === "object"; +} +function isCommandHandlerDefinition(cmd) { + return typeof cmd === "object" && !Array.isArray(cmd); +} +var DEFAULT_MARKER, CommandInstance; +var init_command = __esm({ + "node_modules/yargs/build/lib/command.js"() { + "use strict"; + init_common_types(); + init_is_promise(); + init_middleware(); + init_parse_command(); + init_yargs_factory(); + init_maybe_async_result(); + DEFAULT_MARKER = /(^\*)|(^\$0)/; + CommandInstance = class { + constructor(usage2, validation2, globalMiddleware, shim3) { + this.requireCache = /* @__PURE__ */ new Set(); + this.handlers = {}; + this.aliasMap = {}; + this.frozens = []; + this.shim = shim3; + this.usage = usage2; + this.globalMiddleware = globalMiddleware; + this.validation = validation2; + } + addDirectory(dir2, req, callerFile, opts) { + opts = opts || {}; + this.requireCache.add(callerFile); + const fullDirPath = this.shim.path.resolve(this.shim.path.dirname(callerFile), dir2); + const files = this.shim.readdirSync(fullDirPath, { + recursive: opts.recurse ? true : false + }); + if (!Array.isArray(opts.extensions)) + opts.extensions = ["js"]; + const visit = typeof opts.visit === "function" ? opts.visit : (o2) => o2; + for (const fileb of files) { + const file = fileb.toString(); + if (opts.exclude) { + let exclude = false; + if (typeof opts.exclude === "function") { + exclude = opts.exclude(file); + } else { + exclude = opts.exclude.test(file); + } + if (exclude) + continue; + } + if (opts.include) { + let include2 = false; + if (typeof opts.include === "function") { + include2 = opts.include(file); + } else { + include2 = opts.include.test(file); + } + if (!include2) + continue; + } + let supportedExtension = false; + for (const ext3 of opts.extensions) { + if (file.endsWith(ext3)) + supportedExtension = true; + } + if (supportedExtension) { + const joined = this.shim.path.join(fullDirPath, file); + const module = req(joined); + const extendableModule = Object.create(null, Object.getOwnPropertyDescriptors({ ...module })); + const visited = visit(extendableModule, joined, file); + if (visited) { + if (this.requireCache.has(joined)) + continue; + else + this.requireCache.add(joined); + if (!extendableModule.command) { + extendableModule.command = this.shim.path.basename(joined, this.shim.path.extname(joined)); + } + this.addHandler(extendableModule); + } + } } - }), t7); - } - function j7(t7, e7, s7 = ((t8) => { - throw t8; - })) { - try { - const s8 = "function" == typeof t7 ? t7() : t7; - return f6(s8) ? s8.then(((t8) => e7(t8))) : e7(s8); - } catch (t8) { - return s7(t8); - } - } - var M2 = /(^\*)|(^\$0)/; - var _3 = class { - constructor(t7, e7, s7, i7) { - this.requireCache = /* @__PURE__ */ new Set(), this.handlers = {}, this.aliasMap = {}, this.frozens = [], this.shim = i7, this.usage = t7, this.globalMiddleware = s7, this.validation = e7; - } - addDirectory(t7, e7, s7, i7) { - "boolean" != typeof (i7 = i7 || {}).recurse && (i7.recurse = false), Array.isArray(i7.extensions) || (i7.extensions = ["js"]); - const n13 = "function" == typeof i7.visit ? i7.visit : (t8) => t8; - i7.visit = (t8, e8, s8) => { - const i8 = n13(t8, e8, s8); - if (i8) { - if (this.requireCache.has(e8)) return i8; - this.requireCache.add(e8), this.addHandler(i8); - } - return i8; - }, this.shim.requireDirectory({ require: e7, filename: s7 }, t7, i7); - } - addHandler(t7, e7, s7, i7, n13, r7) { - let a7 = []; - const h7 = (function(t8) { - return t8 ? t8.map(((t9) => (t9.applyBeforeValidation = false, t9))) : []; - })(n13); - if (i7 = i7 || (() => { - }), Array.isArray(t7)) if ((function(t8) { - return t8.every(((t9) => "string" == typeof t9)); - })(t7)) [t7, ...a7] = t7; - else for (const e8 of t7) this.addHandler(e8); - else { - if ((function(t8) { - return "object" == typeof t8 && !Array.isArray(t8); - })(t7)) { - let e8 = Array.isArray(t7.command) || "string" == typeof t7.command ? t7.command : this.moduleName(t7); - return t7.aliases && (e8 = [].concat(e8).concat(t7.aliases)), void this.addHandler(e8, this.extractDesc(t7), t7.builder, t7.handler, t7.middlewares, t7.deprecated); + } + addHandler(cmd, description, builder, handler2, commandMiddleware, deprecated) { + let aliases = []; + const middlewares = commandMiddlewareFactory(commandMiddleware); + handler2 = handler2 || (() => { + }); + if (Array.isArray(cmd)) { + if (isCommandAndAliases(cmd)) { + [cmd, ...aliases] = cmd; + } else { + for (const command2 of cmd) { + this.addHandler(command2); + } } - if (k7(s7)) return void this.addHandler([t7].concat(a7), e7, s7.builder, s7.handler, s7.middlewares, s7.deprecated); + } else if (isCommandHandlerDefinition(cmd)) { + let command2 = Array.isArray(cmd.command) || typeof cmd.command === "string" ? cmd.command : null; + if (command2 === null) { + throw new Error(`No command name given for module: ${this.shim.inspect(cmd)}`); + } + if (cmd.aliases) + command2 = [].concat(command2).concat(cmd.aliases); + this.addHandler(command2, this.extractDesc(cmd), cmd.builder, cmd.handler, cmd.middlewares, cmd.deprecated); + return; + } else if (isCommandBuilderDefinition(builder)) { + this.addHandler([cmd].concat(aliases), description, builder.builder, builder.handler, builder.middlewares, builder.deprecated); + return; } - if ("string" == typeof t7) { - const n14 = o6(t7); - a7 = a7.map(((t8) => o6(t8).cmd)); - let l7 = false; - const c7 = [n14.cmd].concat(a7).filter(((t8) => !M2.test(t8) || (l7 = true, false))); - 0 === c7.length && l7 && c7.push("$0"), l7 && (n14.cmd = c7[0], a7 = c7.slice(1), t7 = t7.replace(M2, n14.cmd)), a7.forEach(((t8) => { - this.aliasMap[t8] = n14.cmd; - })), false !== e7 && this.usage.command(t7, e7, l7, a7, r7), this.handlers[n14.cmd] = { original: t7, description: e7, handler: i7, builder: s7 || {}, middlewares: h7, deprecated: r7, demanded: n14.demanded, optional: n14.optional }, l7 && (this.defaultCommand = this.handlers[n14.cmd]); + if (typeof cmd === "string") { + const parsedCommand = parseCommand(cmd); + aliases = aliases.map((alias) => parseCommand(alias).cmd); + let isDefault = false; + const parsedAliases = [parsedCommand.cmd].concat(aliases).filter((c6) => { + if (DEFAULT_MARKER.test(c6)) { + isDefault = true; + return false; + } + return true; + }); + if (parsedAliases.length === 0 && isDefault) + parsedAliases.push("$0"); + if (isDefault) { + parsedCommand.cmd = parsedAliases[0]; + aliases = parsedAliases.slice(1); + cmd = cmd.replace(DEFAULT_MARKER, parsedCommand.cmd); + } + aliases.forEach((alias) => { + this.aliasMap[alias] = parsedCommand.cmd; + }); + if (description !== false) { + this.usage.command(cmd, description, isDefault, aliases, deprecated); + } + this.handlers[parsedCommand.cmd] = { + original: cmd, + description, + handler: handler2, + builder: builder || {}, + middlewares, + deprecated, + demanded: parsedCommand.demanded, + optional: parsedCommand.optional + }; + if (isDefault) + this.defaultCommand = this.handlers[parsedCommand.cmd]; } } getCommandHandlers() { @@ -96783,510 +96478,874 @@ var require_build4 = __commonJS({ hasDefaultCommand() { return !!this.defaultCommand; } - runCommand(t7, e7, s7, i7, n13, r7) { - const o7 = this.handlers[t7] || this.handlers[this.aliasMap[t7]] || this.defaultCommand, a7 = e7.getInternalMethods().getContext(), h7 = a7.commands.slice(), l7 = !t7; - t7 && (a7.commands.push(t7), a7.fullCommands.push(o7.original)); - const c7 = this.applyBuilderUpdateUsageAndParse(l7, o7, e7, s7.aliases, h7, i7, n13, r7); - return f6(c7) ? c7.then(((t8) => this.applyMiddlewareAndGetResult(l7, o7, t8.innerArgv, a7, n13, t8.aliases, e7))) : this.applyMiddlewareAndGetResult(l7, o7, c7.innerArgv, a7, n13, c7.aliases, e7); - } - applyBuilderUpdateUsageAndParse(t7, e7, s7, i7, n13, r7, o7, a7) { - const h7 = e7.builder; - let l7 = s7; - if (x6(h7)) { - s7.getInternalMethods().getUsageInstance().freeze(); - const c7 = h7(s7.getInternalMethods().reset(i7), a7); - if (f6(c7)) return c7.then(((i8) => { - var a8; - return l7 = (a8 = i8) && "function" == typeof a8.getInternalMethods ? i8 : s7, this.parseAndUpdateUsage(t7, e7, l7, n13, r7, o7); - })); - } else /* @__PURE__ */ (function(t8) { - return "object" == typeof t8; - })(h7) && (s7.getInternalMethods().getUsageInstance().freeze(), l7 = s7.getInternalMethods().reset(i7), Object.keys(e7.builder).forEach(((t8) => { - l7.option(t8, h7[t8]); - }))); - return this.parseAndUpdateUsage(t7, e7, l7, n13, r7, o7); - } - parseAndUpdateUsage(t7, e7, s7, i7, n13, r7) { - t7 && s7.getInternalMethods().getUsageInstance().unfreeze(true), this.shouldUpdateUsage(s7) && s7.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i7, e7), e7.description); - const o7 = s7.getInternalMethods().runYargsParserAndExecuteCommands(null, void 0, true, n13, r7); - return f6(o7) ? o7.then(((t8) => ({ aliases: s7.parsed.aliases, innerArgv: t8 }))) : { aliases: s7.parsed.aliases, innerArgv: o7 }; - } - shouldUpdateUsage(t7) { - return !t7.getInternalMethods().getUsageInstance().getUsageDisabled() && 0 === t7.getInternalMethods().getUsageInstance().getUsage().length; - } - usageFromParentCommandsCommandHandler(t7, e7) { - const s7 = M2.test(e7.original) ? e7.original.replace(M2, "").trim() : e7.original, i7 = t7.filter(((t8) => !M2.test(t8))); - return i7.push(s7), `$0 ${i7.join(" ")}`; - } - handleValidationAndGetResult(t7, e7, s7, i7, n13, r7, o7, a7) { - if (!r7.getInternalMethods().getHasOutput()) { - const e8 = r7.getInternalMethods().runValidation(n13, a7, r7.parsed.error, t7); - s7 = j7(s7, ((t8) => (e8(t8), t8))); - } - if (e7.handler && !r7.getInternalMethods().getHasOutput()) { - r7.getInternalMethods().setHasOutput(); - const i8 = !!r7.getOptions().configuration["populate--"]; - r7.getInternalMethods().postProcess(s7, i8, false, false), s7 = j7(s7 = C3(s7, r7, o7, false), ((t8) => { - const s8 = e7.handler(t8); - return f6(s8) ? s8.then((() => t8)) : t8; - })), t7 || r7.getInternalMethods().getUsageInstance().cacheHelpMessage(), f6(s7) && !r7.getInternalMethods().hasParseCallback() && s7.catch(((t8) => { - try { - r7.getInternalMethods().getUsageInstance().fail(null, t8); - } catch (t9) { - } - })); + runCommand(command2, yargs, parsed, commandIndex, helpOnly, helpOrVersionSet) { + const commandHandler = this.handlers[command2] || this.handlers[this.aliasMap[command2]] || this.defaultCommand; + const currentContext = yargs.getInternalMethods().getContext(); + const parentCommands = currentContext.commands.slice(); + const isDefaultCommand = !command2; + if (command2) { + currentContext.commands.push(command2); + currentContext.fullCommands.push(commandHandler.original); + } + const builderResult = this.applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, parsed.aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet); + return isPromise(builderResult) ? builderResult.then((result) => this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, result.innerArgv, currentContext, helpOnly, result.aliases, yargs)) : this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, builderResult.innerArgv, currentContext, helpOnly, builderResult.aliases, yargs); + } + applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet) { + const builder = commandHandler.builder; + let innerYargs = yargs; + if (isCommandBuilderCallback(builder)) { + yargs.getInternalMethods().getUsageInstance().freeze(); + const builderOutput = builder(yargs.getInternalMethods().reset(aliases), helpOrVersionSet); + if (isPromise(builderOutput)) { + return builderOutput.then((output) => { + innerYargs = isYargsInstance(output) ? output : yargs; + return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly); + }); + } + } else if (isCommandBuilderOptionDefinitions(builder)) { + yargs.getInternalMethods().getUsageInstance().freeze(); + innerYargs = yargs.getInternalMethods().reset(aliases); + Object.keys(commandHandler.builder).forEach((key) => { + innerYargs.option(key, builder[key]); + }); } - return t7 || (i7.commands.pop(), i7.fullCommands.pop()), s7; - } - applyMiddlewareAndGetResult(t7, e7, s7, i7, n13, r7, o7) { - let a7 = {}; - if (n13) return s7; - o7.getInternalMethods().getHasOutput() || (a7 = this.populatePositionals(e7, s7, i7, o7)); - const h7 = this.globalMiddleware.getMiddleware().slice(0).concat(e7.middlewares), l7 = C3(s7, o7, h7, true); - return f6(l7) ? l7.then(((s8) => this.handleValidationAndGetResult(t7, e7, s8, i7, r7, o7, h7, a7))) : this.handleValidationAndGetResult(t7, e7, l7, i7, r7, o7, h7, a7); - } - populatePositionals(t7, e7, s7, i7) { - e7._ = e7._.slice(s7.commands.length); - const n13 = t7.demanded.slice(0), r7 = t7.optional.slice(0), o7 = {}; - for (this.validation.positionalCount(n13.length, e7._.length); n13.length; ) { - const t8 = n13.shift(); - this.populatePositional(t8, e7, o7); - } - for (; r7.length; ) { - const t8 = r7.shift(); - this.populatePositional(t8, e7, o7); - } - return e7._ = s7.commands.concat(e7._.map(((t8) => "" + t8))), this.postProcessPositionals(e7, o7, this.cmdToParseOptions(t7.original), i7), o7; - } - populatePositional(t7, e7, s7) { - const i7 = t7.cmd[0]; - t7.variadic ? s7[i7] = e7._.splice(0).map(String) : e7._.length && (s7[i7] = [String(e7._.shift())]); - } - cmdToParseOptions(t7) { - const e7 = { array: [], default: {}, alias: {}, demand: {} }, s7 = o6(t7); - return s7.demanded.forEach(((t8) => { - const [s8, ...i7] = t8.cmd; - t8.variadic && (e7.array.push(s8), e7.default[s8] = []), e7.alias[s8] = i7, e7.demand[s8] = true; - })), s7.optional.forEach(((t8) => { - const [s8, ...i7] = t8.cmd; - t8.variadic && (e7.array.push(s8), e7.default[s8] = []), e7.alias[s8] = i7; - })), e7; - } - postProcessPositionals(t7, e7, s7, i7) { - const n13 = Object.assign({}, i7.getOptions()); - n13.default = Object.assign(s7.default, n13.default); - for (const t8 of Object.keys(s7.alias)) n13.alias[t8] = (n13.alias[t8] || []).concat(s7.alias[t8]); - n13.array = n13.array.concat(s7.array), n13.config = {}; - const r7 = []; - if (Object.keys(e7).forEach(((t8) => { - e7[t8].map(((e8) => { - n13.configuration["unknown-options-as-args"] && (n13.key[t8] = true), r7.push(`--${t8}`), r7.push(e8); - })); - })), !r7.length) return; - const o7 = Object.assign({}, n13.configuration, { "populate--": false }), a7 = this.shim.Parser.detailed(r7, Object.assign({}, n13, { configuration: o7 })); - if (a7.error) i7.getInternalMethods().getUsageInstance().fail(a7.error.message, a7.error); - else { - const s8 = Object.keys(e7); - Object.keys(e7).forEach(((t8) => { - s8.push(...a7.aliases[t8]); - })), Object.keys(a7.argv).forEach(((n14) => { - s8.includes(n14) && (e7[n14] || (e7[n14] = a7.argv[n14]), !this.isInConfigs(i7, n14) && !this.isDefaulted(i7, n14) && Object.prototype.hasOwnProperty.call(t7, n14) && Object.prototype.hasOwnProperty.call(a7.argv, n14) && (Array.isArray(t7[n14]) || Array.isArray(a7.argv[n14])) ? t7[n14] = [].concat(t7[n14], a7.argv[n14]) : t7[n14] = a7.argv[n14]); - })); + return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly); + } + parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly) { + if (isDefaultCommand) + innerYargs.getInternalMethods().getUsageInstance().unfreeze(true); + if (this.shouldUpdateUsage(innerYargs)) { + innerYargs.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(parentCommands, commandHandler), commandHandler.description); } + const innerArgv = innerYargs.getInternalMethods().runYargsParserAndExecuteCommands(null, void 0, true, commandIndex, helpOnly); + return isPromise(innerArgv) ? innerArgv.then((argv) => ({ + aliases: innerYargs.parsed.aliases, + innerArgv: argv + })) : { + aliases: innerYargs.parsed.aliases, + innerArgv + }; } - isDefaulted(t7, e7) { - const { default: s7 } = t7.getOptions(); - return Object.prototype.hasOwnProperty.call(s7, e7) || Object.prototype.hasOwnProperty.call(s7, this.shim.Parser.camelCase(e7)); + shouldUpdateUsage(yargs) { + return !yargs.getInternalMethods().getUsageInstance().getUsageDisabled() && yargs.getInternalMethods().getUsageInstance().getUsage().length === 0; } - isInConfigs(t7, e7) { - const { configObjects: s7 } = t7.getOptions(); - return s7.some(((t8) => Object.prototype.hasOwnProperty.call(t8, e7))) || s7.some(((t8) => Object.prototype.hasOwnProperty.call(t8, this.shim.Parser.camelCase(e7)))); + usageFromParentCommandsCommandHandler(parentCommands, commandHandler) { + const c6 = DEFAULT_MARKER.test(commandHandler.original) ? commandHandler.original.replace(DEFAULT_MARKER, "").trim() : commandHandler.original; + const pc = parentCommands.filter((c7) => { + return !DEFAULT_MARKER.test(c7); + }); + pc.push(c6); + return `$0 ${pc.join(" ")}`; } - runDefaultBuilderOn(t7) { - if (!this.defaultCommand) return; - if (this.shouldUpdateUsage(t7)) { - const e8 = M2.test(this.defaultCommand.original) ? this.defaultCommand.original : this.defaultCommand.original.replace(/^[^[\]<>]*/, "$0 "); - t7.getInternalMethods().getUsageInstance().usage(e8, this.defaultCommand.description); + handleValidationAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, aliases, yargs, middlewares, positionalMap) { + if (!yargs.getInternalMethods().getHasOutput()) { + const validation2 = yargs.getInternalMethods().runValidation(aliases, positionalMap, yargs.parsed.error, isDefaultCommand); + innerArgv = maybeAsyncResult(innerArgv, (result) => { + validation2(result); + return result; + }); } - const e7 = this.defaultCommand.builder; - if (x6(e7)) return e7(t7, true); - k7(e7) || Object.keys(e7).forEach(((s7) => { - t7.option(s7, e7[s7]); + if (commandHandler.handler && !yargs.getInternalMethods().getHasOutput()) { + yargs.getInternalMethods().setHasOutput(); + const populateDoubleDash = !!yargs.getOptions().configuration["populate--"]; + yargs.getInternalMethods().postProcess(innerArgv, populateDoubleDash, false, false); + innerArgv = applyMiddleware(innerArgv, yargs, middlewares, false); + innerArgv = maybeAsyncResult(innerArgv, (result) => { + const handlerResult = commandHandler.handler(result); + return isPromise(handlerResult) ? handlerResult.then(() => result) : result; + }); + if (!isDefaultCommand) { + yargs.getInternalMethods().getUsageInstance().cacheHelpMessage(); + } + if (isPromise(innerArgv) && !yargs.getInternalMethods().hasParseCallback()) { + innerArgv.catch((error2) => { + try { + yargs.getInternalMethods().getUsageInstance().fail(null, error2); + } catch (_err) { + } + }); + } + } + if (!isDefaultCommand) { + currentContext.commands.pop(); + currentContext.fullCommands.pop(); + } + return innerArgv; + } + applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, helpOnly, aliases, yargs) { + let positionalMap = {}; + if (helpOnly) + return innerArgv; + if (!yargs.getInternalMethods().getHasOutput()) { + positionalMap = this.populatePositionals(commandHandler, innerArgv, currentContext, yargs); + } + const middlewares = this.globalMiddleware.getMiddleware().slice(0).concat(commandHandler.middlewares); + const maybePromiseArgv = applyMiddleware(innerArgv, yargs, middlewares, true); + return isPromise(maybePromiseArgv) ? maybePromiseArgv.then((resolvedInnerArgv) => this.handleValidationAndGetResult(isDefaultCommand, commandHandler, resolvedInnerArgv, currentContext, aliases, yargs, middlewares, positionalMap)) : this.handleValidationAndGetResult(isDefaultCommand, commandHandler, maybePromiseArgv, currentContext, aliases, yargs, middlewares, positionalMap); + } + populatePositionals(commandHandler, argv, context5, yargs) { + argv._ = argv._.slice(context5.commands.length); + const demanded = commandHandler.demanded.slice(0); + const optional = commandHandler.optional.slice(0); + const positionalMap = {}; + this.validation.positionalCount(demanded.length, argv._.length); + while (demanded.length) { + const demand = demanded.shift(); + this.populatePositional(demand, argv, positionalMap); + } + while (optional.length) { + const maybe = optional.shift(); + this.populatePositional(maybe, argv, positionalMap); + } + argv._ = context5.commands.concat(argv._.map((a6) => "" + a6)); + this.postProcessPositionals(argv, positionalMap, this.cmdToParseOptions(commandHandler.original), yargs); + return positionalMap; + } + populatePositional(positional, argv, positionalMap) { + const cmd = positional.cmd[0]; + if (positional.variadic) { + positionalMap[cmd] = argv._.splice(0).map(String); + } else { + if (argv._.length) + positionalMap[cmd] = [String(argv._.shift())]; + } + } + cmdToParseOptions(cmdString) { + const parseOptions = { + array: [], + default: {}, + alias: {}, + demand: {} + }; + const parsed = parseCommand(cmdString); + parsed.demanded.forEach((d6) => { + const [cmd, ...aliases] = d6.cmd; + if (d6.variadic) { + parseOptions.array.push(cmd); + parseOptions.default[cmd] = []; + } + parseOptions.alias[cmd] = aliases; + parseOptions.demand[cmd] = true; + }); + parsed.optional.forEach((o2) => { + const [cmd, ...aliases] = o2.cmd; + if (o2.variadic) { + parseOptions.array.push(cmd); + parseOptions.default[cmd] = []; + } + parseOptions.alias[cmd] = aliases; + }); + return parseOptions; + } + postProcessPositionals(argv, positionalMap, parseOptions, yargs) { + const options = Object.assign({}, yargs.getOptions()); + options.default = Object.assign(parseOptions.default, options.default); + for (const key of Object.keys(parseOptions.alias)) { + options.alias[key] = (options.alias[key] || []).concat(parseOptions.alias[key]); + } + options.array = options.array.concat(parseOptions.array); + options.config = {}; + const unparsed = []; + Object.keys(positionalMap).forEach((key) => { + positionalMap[key].map((value) => { + if (options.configuration["unknown-options-as-args"]) + options.key[key] = true; + unparsed.push(`--${key}`); + unparsed.push(value); + }); + }); + if (!unparsed.length) + return; + const config = Object.assign({}, options.configuration, { + "populate--": false + }); + const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, { + configuration: config })); + if (parsed.error) { + yargs.getInternalMethods().getUsageInstance().fail(parsed.error.message, parsed.error); + } else { + const positionalKeys = Object.keys(positionalMap); + Object.keys(positionalMap).forEach((key) => { + positionalKeys.push(...parsed.aliases[key]); + }); + Object.keys(parsed.argv).forEach((key) => { + if (positionalKeys.includes(key)) { + if (!positionalMap[key]) + positionalMap[key] = parsed.argv[key]; + if (!this.isInConfigs(yargs, key) && !this.isDefaulted(yargs, key) && Object.prototype.hasOwnProperty.call(argv, key) && Object.prototype.hasOwnProperty.call(parsed.argv, key) && (Array.isArray(argv[key]) || Array.isArray(parsed.argv[key]))) { + argv[key] = [].concat(argv[key], parsed.argv[key]); + } else { + argv[key] = parsed.argv[key]; + } + } + }); + } } - moduleName(t7) { - const e7 = (function(t8) { - if ("undefined" == typeof __require) return null; - for (let e8, s7 = 0, i7 = Object.keys(__require.cache); s7 < i7.length; s7++) if (e8 = __require.cache[i7[s7]], e8.exports === t8) return e8; - return null; - })(t7); - if (!e7) throw new Error(`No command name given for module: ${this.shim.inspect(t7)}`); - return this.commandFromFilename(e7.filename); + isDefaulted(yargs, key) { + const { default: defaults4 } = yargs.getOptions(); + return Object.prototype.hasOwnProperty.call(defaults4, key) || Object.prototype.hasOwnProperty.call(defaults4, this.shim.Parser.camelCase(key)); } - commandFromFilename(t7) { - return this.shim.path.basename(t7, this.shim.path.extname(t7)); + isInConfigs(yargs, key) { + const { configObjects } = yargs.getOptions(); + return configObjects.some((c6) => Object.prototype.hasOwnProperty.call(c6, key)) || configObjects.some((c6) => Object.prototype.hasOwnProperty.call(c6, this.shim.Parser.camelCase(key))); + } + runDefaultBuilderOn(yargs) { + if (!this.defaultCommand) + return; + if (this.shouldUpdateUsage(yargs)) { + const commandString = DEFAULT_MARKER.test(this.defaultCommand.original) ? this.defaultCommand.original : this.defaultCommand.original.replace(/^[^[\]<>]*/, "$0 "); + yargs.getInternalMethods().getUsageInstance().usage(commandString, this.defaultCommand.description); + } + const builder = this.defaultCommand.builder; + if (isCommandBuilderCallback(builder)) { + return builder(yargs, true); + } else if (!isCommandBuilderDefinition(builder)) { + Object.keys(builder).forEach((key) => { + yargs.option(key, builder[key]); + }); + } + return void 0; } - extractDesc({ describe: t7, description: e7, desc: s7 }) { - for (const i7 of [t7, e7, s7]) { - if ("string" == typeof i7 || false === i7) return i7; - d6(i7, true, this.shim); + extractDesc({ describe, description, desc }) { + for (const test of [describe, description, desc]) { + if (typeof test === "string" || test === false) + return test; + assertNotStrictEqual(test, true, this.shim); } return false; } freeze() { - this.frozens.push({ handlers: this.handlers, aliasMap: this.aliasMap, defaultCommand: this.defaultCommand }); + this.frozens.push({ + handlers: this.handlers, + aliasMap: this.aliasMap, + defaultCommand: this.defaultCommand + }); } unfreeze() { - const t7 = this.frozens.pop(); - d6(t7, void 0, this.shim), { handlers: this.handlers, aliasMap: this.aliasMap, defaultCommand: this.defaultCommand } = t7; + const frozen = this.frozens.pop(); + assertNotStrictEqual(frozen, void 0, this.shim); + ({ + handlers: this.handlers, + aliasMap: this.aliasMap, + defaultCommand: this.defaultCommand + } = frozen); } reset() { - return this.handlers = {}, this.aliasMap = {}, this.defaultCommand = void 0, this.requireCache = /* @__PURE__ */ new Set(), this; + this.handlers = {}; + this.aliasMap = {}; + this.defaultCommand = void 0; + this.requireCache = /* @__PURE__ */ new Set(); + return this; } }; - function k7(t7) { - return "object" == typeof t7 && !!t7.builder && "function" == typeof t7.handler; - } - function x6(t7) { - return "function" == typeof t7; + } +}); + +// node_modules/yargs/build/lib/utils/obj-filter.js +function objFilter(original = {}, filter4 = () => true) { + const obj = {}; + objectKeys(original).forEach((key) => { + if (filter4(key, original[key])) { + obj[key] = original[key]; } - function E2(t7) { - "undefined" != typeof process && [process.stdout, process.stderr].forEach(((e7) => { - const s7 = e7; - s7._handle && s7.isTTY && "function" == typeof s7._handle.setBlocking && s7._handle.setBlocking(t7); - })); + }); + return obj; +} +var init_obj_filter = __esm({ + "node_modules/yargs/build/lib/utils/obj-filter.js"() { + "use strict"; + init_common_types(); + } +}); + +// node_modules/yargs/build/lib/utils/set-blocking.js +function setBlocking(blocking) { + if (typeof process === "undefined") + return; + [process.stdout, process.stderr].forEach((_stream) => { + const stream5 = _stream; + if (stream5._handle && stream5.isTTY && typeof stream5._handle.setBlocking === "function") { + stream5._handle.setBlocking(blocking); } - function A3(t7) { - return "boolean" == typeof t7; - } - function P2(t7, s7) { - const i7 = s7.y18n.__, n13 = {}, r7 = []; - n13.failFn = function(t8) { - r7.push(t8); - }; - let o7 = null, a7 = null, h7 = true; - n13.showHelpOnFail = function(e7 = true, s8) { - const [i8, r8] = "string" == typeof e7 ? [true, e7] : [e7, s8]; - return t7.getInternalMethods().isGlobalContext() && (a7 = r8), o7 = r8, h7 = i8, n13; - }; - let l7 = false; - n13.fail = function(s8, i8) { - const c8 = t7.getInternalMethods().getLoggerInstance(); - if (!r7.length) { - if (t7.getExitProcess() && E2(true), !l7) { - l7 = true, h7 && (t7.showHelp("error"), c8.error()), (s8 || i8) && c8.error(s8 || i8); - const e7 = o7 || a7; - e7 && ((s8 || i8) && c8.error(""), c8.error(e7)); - } - if (i8 = i8 || new e6(s8), t7.getExitProcess()) return t7.exit(1); - if (t7.getInternalMethods().hasParseCallback()) return t7.exit(1, i8); - throw i8; - } - for (let t8 = r7.length - 1; t8 >= 0; --t8) { - const e7 = r7[t8]; - if (A3(e7)) { - if (i8) throw i8; - if (s8) throw Error(s8); - } else e7(s8, i8, n13); - } - }; - let c7 = [], f7 = false; - n13.usage = (t8, e7) => null === t8 ? (f7 = true, c7 = [], n13) : (f7 = false, c7.push([t8, e7 || ""]), n13), n13.getUsage = () => c7, n13.getUsageDisabled = () => f7, n13.getPositionalGroupName = () => i7("Positionals:"); - let d7 = []; - n13.example = (t8, e7) => { - d7.push([t8, e7 || ""]); - }; - let u7 = []; - n13.command = function(t8, e7, s8, i8, n14 = false) { - s8 && (u7 = u7.map(((t9) => (t9[2] = false, t9)))), u7.push([t8, e7 || "", s8, i8, n14]); - }, n13.getCommands = () => u7; - let p7 = {}; - n13.describe = function(t8, e7) { - Array.isArray(t8) ? t8.forEach(((t9) => { - n13.describe(t9, e7); - })) : "object" == typeof t8 ? Object.keys(t8).forEach(((e8) => { - n13.describe(e8, t8[e8]); - })) : p7[t8] = e7; - }, n13.getDescriptions = () => p7; - let m7 = []; - n13.epilog = (t8) => { - m7.push(t8); - }; - let y3, b7 = false; - n13.wrap = (t8) => { - b7 = true, y3 = t8; - }, n13.getWrap = () => s7.getEnv("YARGS_DISABLE_WRAP") ? null : (b7 || (y3 = (function() { - const t8 = 80; - return s7.process.stdColumns ? Math.min(t8, s7.process.stdColumns) : t8; - })(), b7 = true), y3); - const v9 = "__yargsString__:"; - function O3(t8, e7, i8) { - let n14 = 0; - return Array.isArray(t8) || (t8 = Object.values(t8).map(((t9) => [t9]))), t8.forEach(((t9) => { - n14 = Math.max(s7.stringWidth(i8 ? `${i8} ${I3(t9[0])}` : I3(t9[0])) + $(t9[0]), n14); - })), e7 && (n14 = Math.min(n14, parseInt((0.5 * e7).toString(), 10))), n14; - } - let w6; - function C4(e7) { - return t7.getOptions().hiddenOptions.indexOf(e7) < 0 || t7.parsed.argv[t7.getOptions().showHiddenOpt]; - } - function j8(t8, e7) { - let s8 = `[${i7("default:")} `; - if (void 0 === t8 && !e7) return null; - if (e7) s8 += e7; - else switch (typeof t8) { - case "string": - s8 += `"${t8}"`; - break; - case "object": - s8 += JSON.stringify(t8); - break; - default: - s8 += t8; + }); +} +var init_set_blocking = __esm({ + "node_modules/yargs/build/lib/utils/set-blocking.js"() { + "use strict"; + } +}); + +// node_modules/yargs/build/lib/usage.js +function isBoolean(fail) { + return typeof fail === "boolean"; +} +function usage(yargs, shim3) { + const __ = shim3.y18n.__; + const self2 = {}; + const fails = []; + self2.failFn = function failFn(f6) { + fails.push(f6); + }; + let failMessage = null; + let globalFailMessage = null; + let showHelpOnFail = true; + self2.showHelpOnFail = function showHelpOnFailFn(arg1 = true, arg2) { + const [enabled2, message] = typeof arg1 === "string" ? [true, arg1] : [arg1, arg2]; + if (yargs.getInternalMethods().isGlobalContext()) { + globalFailMessage = message; + } + failMessage = message; + showHelpOnFail = enabled2; + return self2; + }; + let failureOutput = false; + self2.fail = function fail(msg, err) { + const logger8 = yargs.getInternalMethods().getLoggerInstance(); + if (fails.length) { + for (let i6 = fails.length - 1; i6 >= 0; --i6) { + const fail2 = fails[i6]; + if (isBoolean(fail2)) { + if (err) + throw err; + else if (msg) + throw Error(msg); + } else { + fail2(msg, err, self2); } - return `${s8}]`; } - n13.deferY18nLookup = (t8) => v9 + t8, n13.help = function() { - if (w6) return w6; - !(function() { - const e8 = t7.getDemandedOptions(), s8 = t7.getOptions(); - (Object.keys(s8.alias) || []).forEach(((i8) => { - s8.alias[i8].forEach(((r9) => { - p7[r9] && n13.describe(i8, p7[r9]), r9 in e8 && t7.demandOption(i8, e8[r9]), s8.boolean.includes(r9) && t7.boolean(i8), s8.count.includes(r9) && t7.count(i8), s8.string.includes(r9) && t7.string(i8), s8.normalize.includes(r9) && t7.normalize(i8), s8.array.includes(r9) && t7.array(i8), s8.number.includes(r9) && t7.number(i8); - })); - })); - })(); - const e7 = t7.customScriptName ? t7.$0 : s7.path.basename(t7.$0), r8 = t7.getDemandedOptions(), o8 = t7.getDemandedCommands(), a8 = t7.getDeprecatedOptions(), h8 = t7.getGroups(), l8 = t7.getOptions(); - let g7 = []; - g7 = g7.concat(Object.keys(p7)), g7 = g7.concat(Object.keys(r8)), g7 = g7.concat(Object.keys(o8)), g7 = g7.concat(Object.keys(l8.default)), g7 = g7.filter(C4), g7 = Object.keys(g7.reduce(((t8, e8) => ("_" !== e8 && (t8[e8] = true), t8)), {})); - const y4 = n13.getWrap(), b8 = s7.cliui({ width: y4, wrap: !!y4 }); - if (!f7) { - if (c7.length) c7.forEach(((t8) => { - b8.div({ text: `${t8[0].replace(/\$0/g, e7)}` }), t8[1] && b8.div({ text: `${t8[1]}`, padding: [1, 0, 0, 0] }); - })), b8.div(); - else if (u7.length) { - let t8 = null; - t8 = o8._ ? `${e7} <${i7("command")}> -` : `${e7} [${i7("command")}] -`, b8.div(`${t8}`); - } - } - if (u7.length > 1 || 1 === u7.length && !u7[0][2]) { - b8.div(i7("Commands:")); - const s8 = t7.getInternalMethods().getContext(), n14 = s8.commands.length ? `${s8.commands.join(" ")} ` : ""; - true === t7.getInternalMethods().getParserConfiguration()["sort-commands"] && (u7 = u7.sort(((t8, e8) => t8[0].localeCompare(e8[0])))); - const r9 = e7 ? `${e7} ` : ""; - u7.forEach(((t8) => { - const s9 = `${r9}${n14}${t8[0].replace(/^\$0 ?/, "")}`; - b8.span({ text: s9, padding: [0, 2, 0, 2], width: O3(u7, y4, `${e7}${n14}`) + 4 }, { text: t8[1] }); - const o9 = []; - t8[2] && o9.push(`[${i7("default")}]`), t8[3] && t8[3].length && o9.push(`[${i7("aliases:")} ${t8[3].join(", ")}]`), t8[4] && ("string" == typeof t8[4] ? o9.push(`[${i7("deprecated: %s", t8[4])}]`) : o9.push(`[${i7("deprecated")}]`)), o9.length ? b8.div({ text: o9.join(" "), padding: [0, 0, 0, 2], align: "right" }) : b8.div(); - })), b8.div(); - } - const M4 = (Object.keys(l8.alias) || []).concat(Object.keys(t7.parsed.newAliases) || []); - g7 = g7.filter(((e8) => !t7.parsed.newAliases[e8] && M4.every(((t8) => -1 === (l8.alias[t8] || []).indexOf(e8))))); - const _5 = i7("Options:"); - h8[_5] || (h8[_5] = []), (function(t8, e8, s8, i8) { - let n14 = [], r9 = null; - Object.keys(s8).forEach(((t9) => { - n14 = n14.concat(s8[t9]); - })), t8.forEach(((t9) => { - r9 = [t9].concat(e8[t9]), r9.some(((t10) => -1 !== n14.indexOf(t10))) || s8[i8].push(t9); - })); - })(g7, l8.alias, h8, _5); - const k8 = (t8) => /^--/.test(I3(t8)), x7 = Object.keys(h8).filter(((t8) => h8[t8].length > 0)).map(((t8) => ({ groupName: t8, normalizedKeys: h8[t8].filter(C4).map(((t9) => { - if (M4.includes(t9)) return t9; - for (let e8, s8 = 0; void 0 !== (e8 = M4[s8]); s8++) if ((l8.alias[e8] || []).includes(t9)) return e8; - return t9; - })) }))).filter((({ normalizedKeys: t8 }) => t8.length > 0)).map((({ groupName: t8, normalizedKeys: e8 }) => { - const s8 = e8.reduce(((e9, s9) => (e9[s9] = [s9].concat(l8.alias[s9] || []).map(((e10) => t8 === n13.getPositionalGroupName() ? e10 : (/^[0-9]$/.test(e10) ? l8.boolean.includes(s9) ? "-" : "--" : e10.length > 1 ? "--" : "-") + e10)).sort(((t9, e10) => k8(t9) === k8(e10) ? 0 : k8(t9) ? 1 : -1)).join(", "), e9)), {}); - return { groupName: t8, normalizedKeys: e8, switches: s8 }; - })); - if (x7.filter((({ groupName: t8 }) => t8 !== n13.getPositionalGroupName())).some((({ normalizedKeys: t8, switches: e8 }) => !t8.every(((t9) => k8(e8[t9]))))) && x7.filter((({ groupName: t8 }) => t8 !== n13.getPositionalGroupName())).forEach((({ normalizedKeys: t8, switches: e8 }) => { - t8.forEach(((t9) => { - var s8, i8; - k8(e8[t9]) && (e8[t9] = (s8 = e8[t9], i8 = 4, S(s8) ? { text: s8.text, indentation: s8.indentation + i8 } : { text: s8, indentation: i8 })); - })); - })), x7.forEach((({ groupName: e8, normalizedKeys: s8, switches: o9 }) => { - b8.div(e8), s8.forEach(((e9) => { - const s9 = o9[e9]; - let h9 = p7[e9] || "", c8 = null; - h9.includes(v9) && (h9 = i7(h9.substring(16))), l8.boolean.includes(e9) && (c8 = `[${i7("boolean")}]`), l8.count.includes(e9) && (c8 = `[${i7("count")}]`), l8.string.includes(e9) && (c8 = `[${i7("string")}]`), l8.normalize.includes(e9) && (c8 = `[${i7("string")}]`), l8.array.includes(e9) && (c8 = `[${i7("array")}]`), l8.number.includes(e9) && (c8 = `[${i7("number")}]`); - const f8 = [e9 in a8 ? (d8 = a8[e9], "string" == typeof d8 ? `[${i7("deprecated: %s", d8)}]` : `[${i7("deprecated")}]`) : null, c8, e9 in r8 ? `[${i7("required")}]` : null, l8.choices && l8.choices[e9] ? `[${i7("choices:")} ${n13.stringifiedValues(l8.choices[e9])}]` : null, j8(l8.default[e9], l8.defaultDescription[e9])].filter(Boolean).join(" "); - var d8; - b8.span({ text: I3(s9), padding: [0, 2, 0, 2 + $(s9)], width: O3(o9, y4) + 4 }, h9); - const u8 = true === t7.getInternalMethods().getUsageConfiguration()["hide-types"]; - f8 && !u8 ? b8.div({ text: f8, padding: [0, 0, 0, 2], align: "right" }) : b8.div(); - })), b8.div(); - })), d7.length && (b8.div(i7("Examples:")), d7.forEach(((t8) => { - t8[0] = t8[0].replace(/\$0/g, e7); - })), d7.forEach(((t8) => { - "" === t8[1] ? b8.div({ text: t8[0], padding: [0, 2, 0, 2] }) : b8.div({ text: t8[0], padding: [0, 2, 0, 2], width: O3(d7, y4) + 4 }, { text: t8[1] }); - })), b8.div()), m7.length > 0) { - const t8 = m7.map(((t9) => t9.replace(/\$0/g, e7))).join("\n"); - b8.div(`${t8} -`); - } - return b8.toString().replace(/\s*$/, ""); - }, n13.cacheHelpMessage = function() { - w6 = this.help(); - }, n13.clearCachedHelpMessage = function() { - w6 = void 0; - }, n13.hasCachedHelpMessage = function() { - return !!w6; - }, n13.showHelp = (e7) => { - const s8 = t7.getInternalMethods().getLoggerInstance(); - e7 || (e7 = "error"); - ("function" == typeof e7 ? e7 : s8[e7])(n13.help()); - }, n13.functionDescription = (t8) => ["(", t8.name ? s7.Parser.decamelize(t8.name, "-") : i7("generated-value"), ")"].join(""), n13.stringifiedValues = function(t8, e7) { - let s8 = ""; - const i8 = e7 || ", ", n14 = [].concat(t8); - return t8 && n14.length ? (n14.forEach(((t9) => { - s8.length && (s8 += i8), s8 += JSON.stringify(t9); - })), s8) : s8; - }; - let M3 = null; - n13.version = (t8) => { - M3 = t8; - }, n13.showVersion = (e7) => { - const s8 = t7.getInternalMethods().getLoggerInstance(); - e7 || (e7 = "error"); - ("function" == typeof e7 ? e7 : s8[e7])(M3); - }, n13.reset = function(t8) { - return o7 = null, l7 = false, c7 = [], f7 = false, m7 = [], d7 = [], u7 = [], p7 = g6(p7, ((e7) => !t8[e7])), n13; - }; - const _4 = []; - return n13.freeze = function() { - _4.push({ failMessage: o7, failureOutput: l7, usages: c7, usageDisabled: f7, epilogs: m7, examples: d7, commands: u7, descriptions: p7 }); - }, n13.unfreeze = function(t8 = false) { - const e7 = _4.pop(); - e7 && (t8 ? (p7 = { ...e7.descriptions, ...p7 }, u7 = [...e7.commands, ...u7], c7 = [...e7.usages, ...c7], d7 = [...e7.examples, ...d7], m7 = [...e7.epilogs, ...m7]) : { failMessage: o7, failureOutput: l7, usages: c7, usageDisabled: f7, epilogs: m7, examples: d7, commands: u7, descriptions: p7 } = e7); - }, n13; - } - function S(t7) { - return "object" == typeof t7; - } - function $(t7) { - return S(t7) ? t7.indentation : 0; - } - function I3(t7) { - return S(t7) ? t7.text : t7; - } - var D3 = class { - constructor(t7, e7, s7, i7) { - var n13, r7, o7; - this.yargs = t7, this.usage = e7, this.command = s7, this.shim = i7, this.completionKey = "get-yargs-completions", this.aliases = null, this.customCompletionFunction = null, this.indexAfterLastReset = 0, this.zshShell = null !== (o7 = (null === (n13 = this.shim.getEnv("SHELL")) || void 0 === n13 ? void 0 : n13.includes("zsh")) || (null === (r7 = this.shim.getEnv("ZSH_NAME")) || void 0 === r7 ? void 0 : r7.includes("zsh"))) && void 0 !== o7 && o7; - } - defaultCompletion(t7, e7, s7, i7) { - const n13 = this.command.getCommandHandlers(); - for (let e8 = 0, s8 = t7.length; e8 < s8; ++e8) if (n13[t7[e8]] && n13[t7[e8]].builder) { - const s9 = n13[t7[e8]].builder; - if (x6(s9)) { - this.indexAfterLastReset = e8 + 1; - const t8 = this.yargs.getInternalMethods().reset(); - return s9(t8, true), t8.argv; - } - } - const r7 = []; - this.commandCompletions(r7, t7, s7), this.optionCompletions(r7, t7, e7, s7), this.choicesFromOptionsCompletions(r7, t7, e7, s7), this.choicesFromPositionalsCompletions(r7, t7, e7, s7), i7(null, r7); - } - commandCompletions(t7, e7, s7) { - const i7 = this.yargs.getInternalMethods().getContext().commands; - s7.match(/^-/) || i7[i7.length - 1] === s7 || this.previousArgHasChoices(e7) || this.usage.getCommands().forEach(((s8) => { - const i8 = o6(s8[0]).cmd; - if (-1 === e7.indexOf(i8)) if (this.zshShell) { - const e8 = s8[1] || ""; - t7.push(i8.replace(/:/g, "\\:") + ":" + e8); - } else t7.push(i8); - })); + } else { + if (yargs.getExitProcess()) + setBlocking(true); + if (!failureOutput) { + failureOutput = true; + if (showHelpOnFail) { + yargs.showHelp("error"); + logger8.error(); + } + if (msg || err) + logger8.error(msg || err); + const globalOrCommandFailMessage = failMessage || globalFailMessage; + if (globalOrCommandFailMessage) { + if (msg || err) + logger8.error(""); + logger8.error(globalOrCommandFailMessage); + } + } + err = err || new YError(msg); + if (yargs.getExitProcess()) { + return yargs.exit(1); + } else if (yargs.getInternalMethods().hasParseCallback()) { + return yargs.exit(1, err); + } else { + throw err; } - optionCompletions(t7, e7, s7, i7) { - if ((i7.match(/^-/) || "" === i7 && 0 === t7.length) && !this.previousArgHasChoices(e7)) { - const s8 = this.yargs.getOptions(), n13 = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || []; - Object.keys(s8.key).forEach(((r7) => { - const o7 = !!s8.configuration["boolean-negation"] && s8.boolean.includes(r7); - n13.includes(r7) || s8.hiddenOptions.includes(r7) || this.argsContainKey(e7, r7, o7) || this.completeOptionKey(r7, t7, i7, o7 && !!s8.default[r7]); - })); + } + }; + let usages = []; + let usageDisabled = false; + self2.usage = (msg, description) => { + if (msg === null) { + usageDisabled = true; + usages = []; + return self2; + } + usageDisabled = false; + usages.push([msg, description || ""]); + return self2; + }; + self2.getUsage = () => { + return usages; + }; + self2.getUsageDisabled = () => { + return usageDisabled; + }; + self2.getPositionalGroupName = () => { + return __("Positionals:"); + }; + let examples = []; + self2.example = (cmd, description) => { + examples.push([cmd, description || ""]); + }; + let commands6 = []; + self2.command = function command2(cmd, description, isDefault, aliases, deprecated = false) { + if (isDefault) { + commands6 = commands6.map((cmdArray) => { + cmdArray[2] = false; + return cmdArray; + }); + } + commands6.push([cmd, description || "", isDefault, aliases, deprecated]); + }; + self2.getCommands = () => commands6; + let descriptions = {}; + self2.describe = function describe(keyOrKeys, desc) { + if (Array.isArray(keyOrKeys)) { + keyOrKeys.forEach((k7) => { + self2.describe(k7, desc); + }); + } else if (typeof keyOrKeys === "object") { + Object.keys(keyOrKeys).forEach((k7) => { + self2.describe(k7, keyOrKeys[k7]); + }); + } else { + descriptions[keyOrKeys] = desc; + } + }; + self2.getDescriptions = () => descriptions; + let epilogs = []; + self2.epilog = (msg) => { + epilogs.push(msg); + }; + let wrapSet = false; + let wrap2; + self2.wrap = (cols) => { + wrapSet = true; + wrap2 = cols; + }; + self2.getWrap = () => { + if (shim3.getEnv("YARGS_DISABLE_WRAP")) { + return null; + } + if (!wrapSet) { + wrap2 = windowWidth(); + wrapSet = true; + } + return wrap2; + }; + const deferY18nLookupPrefix = "__yargsString__:"; + self2.deferY18nLookup = (str) => deferY18nLookupPrefix + str; + self2.help = function help() { + if (cachedHelpMessage) + return cachedHelpMessage; + normalizeAliases(); + const base$0 = yargs.customScriptName ? yargs.$0 : shim3.path.basename(yargs.$0); + const demandedOptions = yargs.getDemandedOptions(); + const demandedCommands = yargs.getDemandedCommands(); + const deprecatedOptions = yargs.getDeprecatedOptions(); + const groups = yargs.getGroups(); + const options = yargs.getOptions(); + let keys = []; + keys = keys.concat(Object.keys(descriptions)); + keys = keys.concat(Object.keys(demandedOptions)); + keys = keys.concat(Object.keys(demandedCommands)); + keys = keys.concat(Object.keys(options.default)); + keys = keys.filter(filterHiddenOptions); + keys = Object.keys(keys.reduce((acc, key) => { + if (key !== "_") + acc[key] = true; + return acc; + }, {})); + const theWrap = self2.getWrap(); + const ui3 = shim3.cliui({ + width: theWrap, + wrap: !!theWrap + }); + if (!usageDisabled) { + if (usages.length) { + usages.forEach((usage2) => { + ui3.div({ text: `${usage2[0].replace(/\$0/g, base$0)}` }); + if (usage2[1]) { + ui3.div({ text: `${usage2[1]}`, padding: [1, 0, 0, 0] }); + } + }); + ui3.div(); + } else if (commands6.length) { + let u = null; + if (demandedCommands._) { + u = `${base$0} <${__("command")}> +`; + } else { + u = `${base$0} [${__("command")}] +`; } - } - choicesFromOptionsCompletions(t7, e7, s7, i7) { - if (this.previousArgHasChoices(e7)) { - const s8 = this.getPreviousArgChoices(e7); - s8 && s8.length > 0 && t7.push(...s8.map(((t8) => t8.replace(/:/g, "\\:")))); + ui3.div(`${u}`); + } + } + if (commands6.length > 1 || commands6.length === 1 && !commands6[0][2]) { + ui3.div(__("Commands:")); + const context5 = yargs.getInternalMethods().getContext(); + const parentCommands = context5.commands.length ? `${context5.commands.join(" ")} ` : ""; + if (yargs.getInternalMethods().getParserConfiguration()["sort-commands"] === true) { + commands6 = commands6.sort((a6, b6) => a6[0].localeCompare(b6[0])); + } + const prefix2 = base$0 ? `${base$0} ` : ""; + commands6.forEach((command2) => { + const commandString = `${prefix2}${parentCommands}${command2[0].replace(/^\$0 ?/, "")}`; + ui3.span({ + text: commandString, + padding: [0, 2, 0, 2], + width: maxWidth(commands6, theWrap, `${base$0}${parentCommands}`) + 4 + }, { text: command2[1] }); + const hints = []; + if (command2[2]) + hints.push(`[${__("default")}]`); + if (command2[3] && command2[3].length) { + hints.push(`[${__("aliases:")} ${command2[3].join(", ")}]`); + } + if (command2[4]) { + if (typeof command2[4] === "string") { + hints.push(`[${__("deprecated: %s", command2[4])}]`); + } else { + hints.push(`[${__("deprecated")}]`); + } } - } - choicesFromPositionalsCompletions(t7, e7, s7, i7) { - if ("" === i7 && t7.length > 0 && this.previousArgHasChoices(e7)) return; - const n13 = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [], r7 = Math.max(this.indexAfterLastReset, this.yargs.getInternalMethods().getContext().commands.length + 1), o7 = n13[s7._.length - r7 - 1]; - if (!o7) return; - const a7 = this.yargs.getOptions().choices[o7] || []; - for (const e8 of a7) e8.startsWith(i7) && t7.push(e8.replace(/:/g, "\\:")); - } - getPreviousArgChoices(t7) { - if (t7.length < 1) return; - let e7 = t7[t7.length - 1], s7 = ""; - if (!e7.startsWith("-") && t7.length > 1 && (s7 = e7, e7 = t7[t7.length - 2]), !e7.startsWith("-")) return; - const i7 = e7.replace(/^-+/, ""), n13 = this.yargs.getOptions(), r7 = [i7, ...this.yargs.getAliases()[i7] || []]; - let o7; - for (const t8 of r7) if (Object.prototype.hasOwnProperty.call(n13.key, t8) && Array.isArray(n13.choices[t8])) { - o7 = n13.choices[t8]; - break; + if (hints.length) { + ui3.div({ + text: hints.join(" "), + padding: [0, 0, 0, 2], + align: "right" + }); + } else { + ui3.div(); + } + }); + ui3.div(); + } + const aliasKeys = (Object.keys(options.alias) || []).concat(Object.keys(yargs.parsed.newAliases) || []); + keys = keys.filter((key) => !yargs.parsed.newAliases[key] && aliasKeys.every((alias) => (options.alias[alias] || []).indexOf(key) === -1)); + const defaultGroup = __("Options:"); + if (!groups[defaultGroup]) + groups[defaultGroup] = []; + addUngroupedKeys(keys, options.alias, groups, defaultGroup); + const isLongSwitch = (sw) => /^--/.test(getText(sw)); + const displayedGroups = Object.keys(groups).filter((groupName) => groups[groupName].length > 0).map((groupName) => { + const normalizedKeys = groups[groupName].filter(filterHiddenOptions).map((key) => { + if (aliasKeys.includes(key)) + return key; + for (let i6 = 0, aliasKey; (aliasKey = aliasKeys[i6]) !== void 0; i6++) { + if ((options.alias[aliasKey] || []).includes(key)) + return aliasKey; } - return o7 ? o7.filter(((t8) => !s7 || t8.startsWith(s7))) : void 0; - } - previousArgHasChoices(t7) { - const e7 = this.getPreviousArgChoices(t7); - return void 0 !== e7 && e7.length > 0; - } - argsContainKey(t7, e7, s7) { - const i7 = (e8) => -1 !== t7.indexOf((/^[^0-9]$/.test(e8) ? "-" : "--") + e8); - if (i7(e7)) return true; - if (s7 && i7(`no-${e7}`)) return true; - if (this.aliases) { - for (const t8 of this.aliases[e7]) if (i7(t8)) return true; + return key; + }); + return { groupName, normalizedKeys }; + }).filter(({ normalizedKeys }) => normalizedKeys.length > 0).map(({ groupName, normalizedKeys }) => { + const switches = normalizedKeys.reduce((acc, key) => { + acc[key] = [key].concat(options.alias[key] || []).map((sw) => { + if (groupName === self2.getPositionalGroupName()) + return sw; + else { + return (/^[0-9]$/.test(sw) ? options.boolean.includes(key) ? "-" : "--" : sw.length > 1 ? "--" : "-") + sw; + } + }).sort((sw1, sw2) => isLongSwitch(sw1) === isLongSwitch(sw2) ? 0 : isLongSwitch(sw1) ? 1 : -1).join(", "); + return acc; + }, {}); + return { groupName, normalizedKeys, switches }; + }); + const shortSwitchesUsed = displayedGroups.filter(({ groupName }) => groupName !== self2.getPositionalGroupName()).some(({ normalizedKeys, switches }) => !normalizedKeys.every((key) => isLongSwitch(switches[key]))); + if (shortSwitchesUsed) { + displayedGroups.filter(({ groupName }) => groupName !== self2.getPositionalGroupName()).forEach(({ normalizedKeys, switches }) => { + normalizedKeys.forEach((key) => { + if (isLongSwitch(switches[key])) { + switches[key] = addIndentation(switches[key], "-x, ".length); + } + }); + }); + } + displayedGroups.forEach(({ groupName, normalizedKeys, switches }) => { + ui3.div(groupName); + normalizedKeys.forEach((key) => { + const kswitch = switches[key]; + let desc = descriptions[key] || ""; + let type = null; + if (desc.includes(deferY18nLookupPrefix)) + desc = __(desc.substring(deferY18nLookupPrefix.length)); + if (options.boolean.includes(key)) + type = `[${__("boolean")}]`; + if (options.count.includes(key)) + type = `[${__("count")}]`; + if (options.string.includes(key)) + type = `[${__("string")}]`; + if (options.normalize.includes(key)) + type = `[${__("string")}]`; + if (options.array.includes(key)) + type = `[${__("array")}]`; + if (options.number.includes(key)) + type = `[${__("number")}]`; + const deprecatedExtra = (deprecated) => typeof deprecated === "string" ? `[${__("deprecated: %s", deprecated)}]` : `[${__("deprecated")}]`; + const extra = [ + key in deprecatedOptions ? deprecatedExtra(deprecatedOptions[key]) : null, + type, + key in demandedOptions ? `[${__("required")}]` : null, + options.choices && options.choices[key] ? `[${__("choices:")} ${self2.stringifiedValues(options.choices[key])}]` : null, + defaultString(options.default[key], options.defaultDescription[key]) + ].filter(Boolean).join(" "); + ui3.span({ + text: getText(kswitch), + padding: [0, 2, 0, 2 + getIndentation(kswitch)], + width: maxWidth(switches, theWrap) + 4 + }, desc); + const shouldHideOptionExtras = yargs.getInternalMethods().getUsageConfiguration()["hide-types"] === true; + if (extra && !shouldHideOptionExtras) + ui3.div({ text: extra, padding: [0, 0, 0, 2], align: "right" }); + else + ui3.div(); + }); + ui3.div(); + }); + if (examples.length) { + ui3.div(__("Examples:")); + examples.forEach((example) => { + example[0] = example[0].replace(/\$0/g, base$0); + }); + examples.forEach((example) => { + if (example[1] === "") { + ui3.div({ + text: example[0], + padding: [0, 2, 0, 2] + }); + } else { + ui3.div({ + text: example[0], + padding: [0, 2, 0, 2], + width: maxWidth(examples, theWrap) + 4 + }, { + text: example[1] + }); } - return false; - } - completeOptionKey(t7, e7, s7, i7) { - var n13, r7, o7, a7; - let h7 = t7; - if (this.zshShell) { - const e8 = this.usage.getDescriptions(), s8 = null === (r7 = null === (n13 = null == this ? void 0 : this.aliases) || void 0 === n13 ? void 0 : n13[t7]) || void 0 === r7 ? void 0 : r7.find(((t8) => { - const s9 = e8[t8]; - return "string" == typeof s9 && s9.length > 0; - })), i8 = s8 ? e8[s8] : void 0, l8 = null !== (a7 = null !== (o7 = e8[t7]) && void 0 !== o7 ? o7 : i8) && void 0 !== a7 ? a7 : ""; - h7 = `${t7.replace(/:/g, "\\:")}:${l8.replace("__yargsString__:", "").replace(/(\r\n|\n|\r)/gm, " ")}`; - } - const l7 = !/^--/.test(s7) && ((t8) => /^[^0-9]$/.test(t8))(t7) ? "-" : "--"; - e7.push(l7 + h7), i7 && e7.push(l7 + "no-" + h7); - } - customCompletion(t7, e7, s7, i7) { - if (d6(this.customCompletionFunction, null, this.shim), this.customCompletionFunction.length < 3) { - const t8 = this.customCompletionFunction(s7, e7); - return f6(t8) ? t8.then(((t9) => { - this.shim.process.nextTick((() => { - i7(null, t9); - })); - })).catch(((t9) => { - this.shim.process.nextTick((() => { - i7(t9, void 0); - })); - })) : i7(null, t8); - } - return (function(t8) { - return t8.length > 3; - })(this.customCompletionFunction) ? this.customCompletionFunction(s7, e7, ((n13 = i7) => this.defaultCompletion(t7, e7, s7, n13)), ((t8) => { - i7(null, t8); - })) : this.customCompletionFunction(s7, e7, ((t8) => { - i7(null, t8); - })); + }); + ui3.div(); + } + if (epilogs.length > 0) { + const e6 = epilogs.map((epilog) => epilog.replace(/\$0/g, base$0)).join("\n"); + ui3.div(`${e6} +`); + } + return ui3.toString().replace(/\s*$/, ""); + }; + function maxWidth(table, theWrap, modifier) { + let width = 0; + if (!Array.isArray(table)) { + table = Object.values(table).map((v2) => [v2]); + } + table.forEach((v2) => { + width = Math.max(shim3.stringWidth(modifier ? `${modifier} ${getText(v2[0])}` : getText(v2[0])) + getIndentation(v2[0]), width); + }); + if (theWrap) + width = Math.min(width, parseInt((theWrap * 0.5).toString(), 10)); + return width; + } + function normalizeAliases() { + const demandedOptions = yargs.getDemandedOptions(); + const options = yargs.getOptions(); + (Object.keys(options.alias) || []).forEach((key) => { + options.alias[key].forEach((alias) => { + if (descriptions[alias]) + self2.describe(key, descriptions[alias]); + if (alias in demandedOptions) + yargs.demandOption(key, demandedOptions[alias]); + if (options.boolean.includes(alias)) + yargs.boolean(key); + if (options.count.includes(alias)) + yargs.count(key); + if (options.string.includes(alias)) + yargs.string(key); + if (options.normalize.includes(alias)) + yargs.normalize(key); + if (options.array.includes(alias)) + yargs.array(key); + if (options.number.includes(alias)) + yargs.number(key); + }); + }); + } + let cachedHelpMessage; + self2.cacheHelpMessage = function() { + cachedHelpMessage = this.help(); + }; + self2.clearCachedHelpMessage = function() { + cachedHelpMessage = void 0; + }; + self2.hasCachedHelpMessage = function() { + return !!cachedHelpMessage; + }; + function addUngroupedKeys(keys, aliases, groups, defaultGroup) { + let groupedKeys = []; + let toCheck = null; + Object.keys(groups).forEach((group3) => { + groupedKeys = groupedKeys.concat(groups[group3]); + }); + keys.forEach((key) => { + toCheck = [key].concat(aliases[key]); + if (!toCheck.some((k7) => groupedKeys.indexOf(k7) !== -1)) { + groups[defaultGroup].push(key); } - getCompletion(t7, e7) { - const s7 = t7.length ? t7[t7.length - 1] : "", i7 = this.yargs.parse(t7, true), n13 = this.customCompletionFunction ? (i8) => this.customCompletion(t7, i8, s7, e7) : (i8) => this.defaultCompletion(t7, i8, s7, e7); - return f6(i7) ? i7.then(n13) : n13(i7); + }); + return groupedKeys; + } + function filterHiddenOptions(key) { + return yargs.getOptions().hiddenOptions.indexOf(key) < 0 || yargs.parsed.argv[yargs.getOptions().showHiddenOpt]; + } + self2.showHelp = (level) => { + const logger8 = yargs.getInternalMethods().getLoggerInstance(); + if (!level) + level = "error"; + const emit = typeof level === "function" ? level : logger8[level]; + emit(self2.help()); + }; + self2.functionDescription = (fn) => { + const description = fn.name ? shim3.Parser.decamelize(fn.name, "-") : __("generated-value"); + return ["(", description, ")"].join(""); + }; + self2.stringifiedValues = function stringifiedValues(values, separator) { + let string = ""; + const sep7 = separator || ", "; + const array = [].concat(values); + if (!values || !array.length) + return string; + array.forEach((value) => { + if (string.length) + string += sep7; + string += JSON.stringify(value); + }); + return string; + }; + function defaultString(value, defaultDescription) { + let string = `[${__("default:")} `; + if (value === void 0 && !defaultDescription) + return null; + if (defaultDescription) { + string += defaultDescription; + } else { + switch (typeof value) { + case "string": + string += `"${value}"`; + break; + case "object": + string += JSON.stringify(value); + break; + default: + string += value; } - generateCompletionScript(t7, e7) { - let s7 = this.zshShell ? `#compdef {{app_name}} + } + return `${string}]`; + } + function windowWidth() { + const maxWidth2 = 80; + if (shim3.process.stdColumns) { + return Math.min(maxWidth2, shim3.process.stdColumns); + } else { + return maxWidth2; + } + } + let version3 = null; + self2.version = (ver) => { + version3 = ver; + }; + self2.showVersion = (level) => { + const logger8 = yargs.getInternalMethods().getLoggerInstance(); + if (!level) + level = "error"; + const emit = typeof level === "function" ? level : logger8[level]; + emit(version3); + }; + self2.reset = function reset(localLookup) { + failMessage = null; + failureOutput = false; + usages = []; + usageDisabled = false; + epilogs = []; + examples = []; + commands6 = []; + descriptions = objFilter(descriptions, (k7) => !localLookup[k7]); + return self2; + }; + const frozens = []; + self2.freeze = function freeze() { + frozens.push({ + failMessage, + failureOutput, + usages, + usageDisabled, + epilogs, + examples, + commands: commands6, + descriptions + }); + }; + self2.unfreeze = function unfreeze(defaultCommand = false) { + const frozen = frozens.pop(); + if (!frozen) + return; + if (defaultCommand) { + descriptions = { ...frozen.descriptions, ...descriptions }; + commands6 = [...frozen.commands, ...commands6]; + usages = [...frozen.usages, ...usages]; + examples = [...frozen.examples, ...examples]; + epilogs = [...frozen.epilogs, ...epilogs]; + } else { + ({ + failMessage, + failureOutput, + usages, + usageDisabled, + epilogs, + examples, + commands: commands6, + descriptions + } = frozen); + } + }; + return self2; +} +function isIndentedText(text) { + return typeof text === "object"; +} +function addIndentation(text, indent) { + return isIndentedText(text) ? { text: text.text, indentation: text.indentation + indent } : { text, indentation: indent }; +} +function getIndentation(text) { + return isIndentedText(text) ? text.indentation : 0; +} +function getText(text) { + return isIndentedText(text) ? text.text : text; +} +var init_usage = __esm({ + "node_modules/yargs/build/lib/usage.js"() { + "use strict"; + init_obj_filter(); + init_yerror(); + init_set_blocking(); + } +}); + +// node_modules/yargs/build/lib/completion-templates.js +var completionShTemplate, completionZshTemplate; +var init_completion_templates = __esm({ + "node_modules/yargs/build/lib/completion-templates.js"() { + "use strict"; + completionShTemplate = `###-begin-{{app_name}}-completions-### +# +# yargs command completion script +# +# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc +# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX. +# +_{{app_name}}_yargs_completions() +{ + local cur_word args type_list + + cur_word="\${COMP_WORDS[COMP_CWORD]}" + args=("\${COMP_WORDS[@]}") + + # ask yargs to generate completions. + # see https://stackoverflow.com/a/40944195/7080036 for the spaces-handling awk + mapfile -t type_list < <({{app_path}} --get-yargs-completions "\${args[@]}") + mapfile -t COMPREPLY < <(compgen -W "$( printf '%q ' "\${type_list[@]}" )" -- "\${cur_word}" | + awk '/ / { print "\\""$0"\\"" } /^[^ ]+$/ { print $0 }') + + # if no match was found, fall back to filename completion + if [ \${#COMPREPLY[@]} -eq 0 ]; then + COMPREPLY=() + fi + + return 0 +} +complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}} +###-end-{{app_name}}-completions-### +`; + completionZshTemplate = `#compdef {{app_name}} ###-begin-{{app_name}}-completions-### # # yargs command completion script @@ -97301,961 +97360,2138 @@ _{{app_name}}_yargs_completions() IFS=$' ' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}")) IFS=$si - _describe 'values' reply -} -compdef _{{app_name}}_yargs_completions {{app_name}} + if [[ \${#reply} -gt 0 ]]; then + _describe 'values' reply + else + _default + fi +} +if [[ "'\${zsh_eval_context[-1]}" == "loadautofunc" ]]; then + _{{app_name}}_yargs_completions "$@" +else + compdef _{{app_name}}_yargs_completions {{app_name}} +fi ###-end-{{app_name}}-completions-### -` : '###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n'; - const i7 = this.shim.path.basename(t7); - return t7.match(/\.js$/) && (t7 = `./${t7}`), s7 = s7.replace(/{{app_name}}/g, i7), s7 = s7.replace(/{{completion_command}}/g, e7), s7.replace(/{{app_path}}/g, t7); - } - registerFunction(t7) { - this.customCompletionFunction = t7; - } - setParsed(t7) { - this.aliases = t7.aliases; - } - }; - function N2(t7, e7) { - if (0 === t7.length) return e7.length; - if (0 === e7.length) return t7.length; - const s7 = []; - let i7, n13; - for (i7 = 0; i7 <= e7.length; i7++) s7[i7] = [i7]; - for (n13 = 0; n13 <= t7.length; n13++) s7[0][n13] = n13; - for (i7 = 1; i7 <= e7.length; i7++) for (n13 = 1; n13 <= t7.length; n13++) e7.charAt(i7 - 1) === t7.charAt(n13 - 1) ? s7[i7][n13] = s7[i7 - 1][n13 - 1] : i7 > 1 && n13 > 1 && e7.charAt(i7 - 2) === t7.charAt(n13 - 1) && e7.charAt(i7 - 1) === t7.charAt(n13 - 2) ? s7[i7][n13] = s7[i7 - 2][n13 - 2] + 1 : s7[i7][n13] = Math.min(s7[i7 - 1][n13 - 1] + 1, Math.min(s7[i7][n13 - 1] + 1, s7[i7 - 1][n13] + 1)); - return s7[e7.length][t7.length]; - } - var H3 = ["$0", "--", "_"]; - var z2; - var W2; - var q7; - var U2; - var F3; - var L2; - var V2; - var G3; - var R2; - var T2; - var B3; - var Y2; - var K2; - var J2; - var Z; - var X2; - var Q2; - var tt2; - var et2; - var st2; - var it2; - var nt2; - var rt2; - var ot2; - var at2; - var ht2; - var lt2; - var ct2; - var ft2; - var dt2; - var ut2; - var pt2; - var gt2; - var mt2; - var yt2; - var bt2 = /* @__PURE__ */ Symbol("copyDoubleDash"); - var vt2 = /* @__PURE__ */ Symbol("copyDoubleDash"); - var Ot2 = /* @__PURE__ */ Symbol("deleteFromParserHintObject"); - var wt2 = /* @__PURE__ */ Symbol("emitWarning"); - var Ct2 = /* @__PURE__ */ Symbol("freeze"); - var jt2 = /* @__PURE__ */ Symbol("getDollarZero"); - var Mt2 = /* @__PURE__ */ Symbol("getParserConfiguration"); - var _t3 = /* @__PURE__ */ Symbol("getUsageConfiguration"); - var kt2 = /* @__PURE__ */ Symbol("guessLocale"); - var xt2 = /* @__PURE__ */ Symbol("guessVersion"); - var Et2 = /* @__PURE__ */ Symbol("parsePositionalNumbers"); - var At2 = /* @__PURE__ */ Symbol("pkgUp"); - var Pt2 = /* @__PURE__ */ Symbol("populateParserHintArray"); - var St2 = /* @__PURE__ */ Symbol("populateParserHintSingleValueDictionary"); - var $t = /* @__PURE__ */ Symbol("populateParserHintArrayDictionary"); - var It2 = /* @__PURE__ */ Symbol("populateParserHintDictionary"); - var Dt2 = /* @__PURE__ */ Symbol("sanitizeKey"); - var Nt2 = /* @__PURE__ */ Symbol("setKey"); - var Ht2 = /* @__PURE__ */ Symbol("unfreeze"); - var zt2 = /* @__PURE__ */ Symbol("validateAsync"); - var Wt2 = /* @__PURE__ */ Symbol("getCommandInstance"); - var qt2 = /* @__PURE__ */ Symbol("getContext"); - var Ut2 = /* @__PURE__ */ Symbol("getHasOutput"); - var Ft2 = /* @__PURE__ */ Symbol("getLoggerInstance"); - var Lt2 = /* @__PURE__ */ Symbol("getParseContext"); - var Vt2 = /* @__PURE__ */ Symbol("getUsageInstance"); - var Gt2 = /* @__PURE__ */ Symbol("getValidationInstance"); - var Rt2 = /* @__PURE__ */ Symbol("hasParseCallback"); - var Tt2 = /* @__PURE__ */ Symbol("isGlobalContext"); - var Bt2 = /* @__PURE__ */ Symbol("postProcess"); - var Yt2 = /* @__PURE__ */ Symbol("rebase"); - var Kt2 = /* @__PURE__ */ Symbol("reset"); - var Jt2 = /* @__PURE__ */ Symbol("runYargsParserAndExecuteCommands"); - var Zt2 = /* @__PURE__ */ Symbol("runValidation"); - var Xt2 = /* @__PURE__ */ Symbol("setHasOutput"); - var Qt2 = /* @__PURE__ */ Symbol("kTrackManuallySetKeys"); - var te2 = class { - constructor(t7 = [], e7, s7, i7) { - this.customScriptName = false, this.parsed = false, z2.set(this, void 0), W2.set(this, void 0), q7.set(this, { commands: [], fullCommands: [] }), U2.set(this, null), F3.set(this, null), L2.set(this, "show-hidden"), V2.set(this, null), G3.set(this, true), R2.set(this, {}), T2.set(this, true), B3.set(this, []), Y2.set(this, void 0), K2.set(this, {}), J2.set(this, false), Z.set(this, null), X2.set(this, true), Q2.set(this, void 0), tt2.set(this, ""), et2.set(this, void 0), st2.set(this, void 0), it2.set(this, {}), nt2.set(this, null), rt2.set(this, null), ot2.set(this, {}), at2.set(this, {}), ht2.set(this, void 0), lt2.set(this, false), ct2.set(this, void 0), ft2.set(this, false), dt2.set(this, false), ut2.set(this, false), pt2.set(this, void 0), gt2.set(this, {}), mt2.set(this, null), yt2.set(this, void 0), O2(this, ct2, i7, "f"), O2(this, ht2, t7, "f"), O2(this, W2, e7, "f"), O2(this, st2, s7, "f"), O2(this, Y2, new w5(this), "f"), this.$0 = this[jt2](), this[Kt2](), O2(this, z2, v8(this, z2, "f"), "f"), O2(this, pt2, v8(this, pt2, "f"), "f"), O2(this, yt2, v8(this, yt2, "f"), "f"), O2(this, et2, v8(this, et2, "f"), "f"), v8(this, et2, "f").showHiddenOpt = v8(this, L2, "f"), O2(this, Q2, this[vt2](), "f"); - } - addHelpOpt(t7, e7) { - return h6("[string|boolean] [string]", [t7, e7], arguments.length), v8(this, Z, "f") && (this[Ot2](v8(this, Z, "f")), O2(this, Z, null, "f")), false === t7 && void 0 === e7 || (O2(this, Z, "string" == typeof t7 ? t7 : "help", "f"), this.boolean(v8(this, Z, "f")), this.describe(v8(this, Z, "f"), e7 || v8(this, pt2, "f").deferY18nLookup("Show help"))), this; - } - help(t7, e7) { - return this.addHelpOpt(t7, e7); - } - addShowHiddenOpt(t7, e7) { - if (h6("[string|boolean] [string]", [t7, e7], arguments.length), false === t7 && void 0 === e7) return this; - const s7 = "string" == typeof t7 ? t7 : v8(this, L2, "f"); - return this.boolean(s7), this.describe(s7, e7 || v8(this, pt2, "f").deferY18nLookup("Show hidden options")), v8(this, et2, "f").showHiddenOpt = s7, this; - } - showHidden(t7, e7) { - return this.addShowHiddenOpt(t7, e7); - } - alias(t7, e7) { - return h6(" [string|array]", [t7, e7], arguments.length), this[$t](this.alias.bind(this), "alias", t7, e7), this; - } - array(t7) { - return h6("", [t7], arguments.length), this[Pt2]("array", t7), this[Qt2](t7), this; - } - boolean(t7) { - return h6("", [t7], arguments.length), this[Pt2]("boolean", t7), this[Qt2](t7), this; - } - check(t7, e7) { - return h6(" [boolean]", [t7, e7], arguments.length), this.middleware(((e8, s7) => j7((() => t7(e8, s7.getOptions())), ((s8) => (s8 ? ("string" == typeof s8 || s8 instanceof Error) && v8(this, pt2, "f").fail(s8.toString(), s8) : v8(this, pt2, "f").fail(v8(this, ct2, "f").y18n.__("Argument check failed: %s", t7.toString())), e8)), ((t8) => (v8(this, pt2, "f").fail(t8.message ? t8.message : t8.toString(), t8), e8)))), false, e7), this; - } - choices(t7, e7) { - return h6(" [string|array]", [t7, e7], arguments.length), this[$t](this.choices.bind(this), "choices", t7, e7), this; - } - coerce(t7, s7) { - if (h6(" [function]", [t7, s7], arguments.length), Array.isArray(t7)) { - if (!s7) throw new e6("coerce callback must be provided"); - for (const e7 of t7) this.coerce(e7, s7); - return this; - } - if ("object" == typeof t7) { - for (const e7 of Object.keys(t7)) this.coerce(e7, t7[e7]); - return this; - } - if (!s7) throw new e6("coerce callback must be provided"); - return v8(this, et2, "f").key[t7] = true, v8(this, Y2, "f").addCoerceMiddleware(((i7, n13) => { - let r7; - return Object.prototype.hasOwnProperty.call(i7, t7) ? j7((() => (r7 = n13.getAliases(), s7(i7[t7]))), ((e7) => { - i7[t7] = e7; - const s8 = n13.getInternalMethods().getParserConfiguration()["strip-aliased"]; - if (r7[t7] && true !== s8) for (const s9 of r7[t7]) i7[s9] = e7; - return i7; - }), ((t8) => { - throw new e6(t8.message); - })) : i7; - }), t7), this; - } - conflicts(t7, e7) { - return h6(" [string|array]", [t7, e7], arguments.length), v8(this, yt2, "f").conflicts(t7, e7), this; - } - config(t7 = "config", e7, s7) { - return h6("[object|string] [string|function] [function]", [t7, e7, s7], arguments.length), "object" != typeof t7 || Array.isArray(t7) ? ("function" == typeof e7 && (s7 = e7, e7 = void 0), this.describe(t7, e7 || v8(this, pt2, "f").deferY18nLookup("Path to JSON config file")), (Array.isArray(t7) ? t7 : [t7]).forEach(((t8) => { - v8(this, et2, "f").config[t8] = s7 || true; - })), this) : (t7 = n12(t7, v8(this, W2, "f"), this[Mt2]()["deep-merge-config"] || false, v8(this, ct2, "f")), v8(this, et2, "f").configObjects = (v8(this, et2, "f").configObjects || []).concat(t7), this); - } - completion(t7, e7, s7) { - return h6("[string] [string|boolean|function] [function]", [t7, e7, s7], arguments.length), "function" == typeof e7 && (s7 = e7, e7 = void 0), O2(this, F3, t7 || v8(this, F3, "f") || "completion", "f"), e7 || false === e7 || (e7 = "generate completion script"), this.command(v8(this, F3, "f"), e7), s7 && v8(this, U2, "f").registerFunction(s7), this; - } - command(t7, e7, s7, i7, n13, r7) { - return h6(" [string|boolean] [function|object] [function] [array] [boolean|string]", [t7, e7, s7, i7, n13, r7], arguments.length), v8(this, z2, "f").addHandler(t7, e7, s7, i7, n13, r7), this; - } - commands(t7, e7, s7, i7, n13, r7) { - return this.command(t7, e7, s7, i7, n13, r7); - } - commandDir(t7, e7) { - h6(" [object]", [t7, e7], arguments.length); - const s7 = v8(this, st2, "f") || v8(this, ct2, "f").require; - return v8(this, z2, "f").addDirectory(t7, s7, v8(this, ct2, "f").getCallerFile(), e7), this; - } - count(t7) { - return h6("", [t7], arguments.length), this[Pt2]("count", t7), this[Qt2](t7), this; +`; + } +}); + +// node_modules/yargs/build/lib/completion.js +function completion(yargs, usage2, command2, shim3) { + return new Completion(yargs, usage2, command2, shim3); +} +function isSyncCompletionFunction(completionFunction) { + return completionFunction.length < 3; +} +function isFallbackCompletionFunction(completionFunction) { + return completionFunction.length > 3; +} +var Completion; +var init_completion = __esm({ + "node_modules/yargs/build/lib/completion.js"() { + "use strict"; + init_command(); + init_common_types(); + init_completion_templates(); + init_is_promise(); + init_parse_command(); + Completion = class { + constructor(yargs, usage2, command2, shim3) { + var _a6, _b3, _c7; + this.yargs = yargs; + this.usage = usage2; + this.command = command2; + this.shim = shim3; + this.completionKey = "get-yargs-completions"; + this.aliases = null; + this.customCompletionFunction = null; + this.indexAfterLastReset = 0; + this.zshShell = (_c7 = ((_a6 = this.shim.getEnv("SHELL")) === null || _a6 === void 0 ? void 0 : _a6.includes("zsh")) || ((_b3 = this.shim.getEnv("ZSH_NAME")) === null || _b3 === void 0 ? void 0 : _b3.includes("zsh"))) !== null && _c7 !== void 0 ? _c7 : false; + } + defaultCompletion(args, argv, current, done) { + const handlers = this.command.getCommandHandlers(); + for (let i6 = 0, ii2 = args.length; i6 < ii2; ++i6) { + if (handlers[args[i6]] && handlers[args[i6]].builder) { + const builder = handlers[args[i6]].builder; + if (isCommandBuilderCallback(builder)) { + this.indexAfterLastReset = i6 + 1; + const y = this.yargs.getInternalMethods().reset(); + builder(y, true); + return y.argv; + } + } + } + const completions = []; + this.commandCompletions(completions, args, current); + this.optionCompletions(completions, args, argv, current); + this.choicesFromOptionsCompletions(completions, args, argv, current); + this.choicesFromPositionalsCompletions(completions, args, argv, current); + done(null, completions); + } + commandCompletions(completions, args, current) { + const parentCommands = this.yargs.getInternalMethods().getContext().commands; + if (!current.match(/^-/) && parentCommands[parentCommands.length - 1] !== current && !this.previousArgHasChoices(args)) { + this.usage.getCommands().forEach((usageCommand) => { + const commandName = parseCommand(usageCommand[0]).cmd; + if (args.indexOf(commandName) === -1) { + if (!this.zshShell) { + completions.push(commandName); + } else { + const desc = usageCommand[1] || ""; + completions.push(commandName.replace(/:/g, "\\:") + ":" + desc); + } + } + }); + } + } + optionCompletions(completions, args, argv, current) { + if ((current.match(/^-/) || current === "" && completions.length === 0) && !this.previousArgHasChoices(args)) { + const options = this.yargs.getOptions(); + const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || []; + Object.keys(options.key).forEach((key) => { + const negable = !!options.configuration["boolean-negation"] && options.boolean.includes(key); + const isPositionalKey = positionalKeys.includes(key); + if (!isPositionalKey && !options.hiddenOptions.includes(key) && !this.argsContainKey(args, key, negable)) { + this.completeOptionKey(key, completions, current, negable && !!options.default[key]); + } + }); + } + } + choicesFromOptionsCompletions(completions, args, argv, current) { + if (this.previousArgHasChoices(args)) { + const choices = this.getPreviousArgChoices(args); + if (choices && choices.length > 0) { + completions.push(...choices.map((c6) => c6.replace(/:/g, "\\:"))); + } + } + } + choicesFromPositionalsCompletions(completions, args, argv, current) { + if (current === "" && completions.length > 0 && this.previousArgHasChoices(args)) { + return; + } + const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || []; + const offset = Math.max(this.indexAfterLastReset, this.yargs.getInternalMethods().getContext().commands.length + 1); + const positionalKey = positionalKeys[argv._.length - offset - 1]; + if (!positionalKey) { + return; + } + const choices = this.yargs.getOptions().choices[positionalKey] || []; + for (const choice of choices) { + if (choice.startsWith(current)) { + completions.push(choice.replace(/:/g, "\\:")); + } + } + } + getPreviousArgChoices(args) { + if (args.length < 1) + return; + let previousArg = args[args.length - 1]; + let filter4 = ""; + if (!previousArg.startsWith("-") && args.length > 1) { + filter4 = previousArg; + previousArg = args[args.length - 2]; + } + if (!previousArg.startsWith("-")) + return; + const previousArgKey = previousArg.replace(/^-+/, ""); + const options = this.yargs.getOptions(); + const possibleAliases = [ + previousArgKey, + ...this.yargs.getAliases()[previousArgKey] || [] + ]; + let choices; + for (const possibleAlias of possibleAliases) { + if (Object.prototype.hasOwnProperty.call(options.key, possibleAlias) && Array.isArray(options.choices[possibleAlias])) { + choices = options.choices[possibleAlias]; + break; + } + } + if (choices) { + return choices.filter((choice) => !filter4 || choice.startsWith(filter4)); + } + } + previousArgHasChoices(args) { + const choices = this.getPreviousArgChoices(args); + return choices !== void 0 && choices.length > 0; + } + argsContainKey(args, key, negable) { + const argsContains = (s) => args.indexOf((/^[^0-9]$/.test(s) ? "-" : "--") + s) !== -1; + if (argsContains(key)) + return true; + if (negable && argsContains(`no-${key}`)) + return true; + if (this.aliases) { + for (const alias of this.aliases[key]) { + if (argsContains(alias)) + return true; + } + } + return false; + } + completeOptionKey(key, completions, current, negable) { + var _a6, _b3, _c7, _d2; + let keyWithDesc = key; + if (this.zshShell) { + const descs = this.usage.getDescriptions(); + const aliasKey = (_b3 = (_a6 = this === null || this === void 0 ? void 0 : this.aliases) === null || _a6 === void 0 ? void 0 : _a6[key]) === null || _b3 === void 0 ? void 0 : _b3.find((alias) => { + const desc2 = descs[alias]; + return typeof desc2 === "string" && desc2.length > 0; + }); + const descFromAlias = aliasKey ? descs[aliasKey] : void 0; + const desc = (_d2 = (_c7 = descs[key]) !== null && _c7 !== void 0 ? _c7 : descFromAlias) !== null && _d2 !== void 0 ? _d2 : ""; + keyWithDesc = `${key.replace(/:/g, "\\:")}:${desc.replace("__yargsString__:", "").replace(/(\r\n|\n|\r)/gm, " ")}`; + } + const startsByTwoDashes = (s) => /^--/.test(s); + const isShortOption = (s) => /^[^0-9]$/.test(s); + const dashes = !startsByTwoDashes(current) && isShortOption(key) ? "-" : "--"; + completions.push(dashes + keyWithDesc); + if (negable) { + completions.push(dashes + "no-" + keyWithDesc); + } + } + customCompletion(args, argv, current, done) { + assertNotStrictEqual(this.customCompletionFunction, null, this.shim); + if (isSyncCompletionFunction(this.customCompletionFunction)) { + const result = this.customCompletionFunction(current, argv); + if (isPromise(result)) { + return result.then((list) => { + this.shim.process.nextTick(() => { + done(null, list); + }); + }).catch((err) => { + this.shim.process.nextTick(() => { + done(err, void 0); + }); + }); + } + return done(null, result); + } else if (isFallbackCompletionFunction(this.customCompletionFunction)) { + return this.customCompletionFunction(current, argv, (onCompleted = done) => this.defaultCompletion(args, argv, current, onCompleted), (completions) => { + done(null, completions); + }); + } else { + return this.customCompletionFunction(current, argv, (completions) => { + done(null, completions); + }); + } + } + getCompletion(args, done) { + const current = args.length ? args[args.length - 1] : ""; + const argv = this.yargs.parse(args, true); + const completionFunction = this.customCompletionFunction ? (argv2) => this.customCompletion(args, argv2, current, done) : (argv2) => this.defaultCompletion(args, argv2, current, done); + return isPromise(argv) ? argv.then(completionFunction) : completionFunction(argv); + } + generateCompletionScript($0, cmd) { + let script = this.zshShell ? completionZshTemplate : completionShTemplate; + const name = this.shim.path.basename($0); + if ($0.match(/\.js$/)) + $0 = `./${$0}`; + script = script.replace(/{{app_name}}/g, name); + script = script.replace(/{{completion_command}}/g, cmd); + return script.replace(/{{app_path}}/g, $0); + } + registerFunction(fn) { + this.customCompletionFunction = fn; + } + setParsed(parsed) { + this.aliases = parsed.aliases; + } + }; + } +}); + +// node_modules/yargs/build/lib/utils/levenshtein.js +function levenshtein(a6, b6) { + if (a6.length === 0) + return b6.length; + if (b6.length === 0) + return a6.length; + const matrix = []; + let i6; + for (i6 = 0; i6 <= b6.length; i6++) { + matrix[i6] = [i6]; + } + let j7; + for (j7 = 0; j7 <= a6.length; j7++) { + matrix[0][j7] = j7; + } + for (i6 = 1; i6 <= b6.length; i6++) { + for (j7 = 1; j7 <= a6.length; j7++) { + if (b6.charAt(i6 - 1) === a6.charAt(j7 - 1)) { + matrix[i6][j7] = matrix[i6 - 1][j7 - 1]; + } else { + if (i6 > 1 && j7 > 1 && b6.charAt(i6 - 2) === a6.charAt(j7 - 1) && b6.charAt(i6 - 1) === a6.charAt(j7 - 2)) { + matrix[i6][j7] = matrix[i6 - 2][j7 - 2] + 1; + } else { + matrix[i6][j7] = Math.min(matrix[i6 - 1][j7 - 1] + 1, Math.min(matrix[i6][j7 - 1] + 1, matrix[i6 - 1][j7] + 1)); + } + } + } + } + return matrix[b6.length][a6.length]; +} +var init_levenshtein = __esm({ + "node_modules/yargs/build/lib/utils/levenshtein.js"() { + "use strict"; + } +}); + +// node_modules/yargs/build/lib/validation.js +function validation(yargs, usage2, shim3) { + const __ = shim3.y18n.__; + const __n = shim3.y18n.__n; + const self2 = {}; + self2.nonOptionCount = function nonOptionCount(argv) { + const demandedCommands = yargs.getDemandedCommands(); + const positionalCount = argv._.length + (argv["--"] ? argv["--"].length : 0); + const _s7 = positionalCount - yargs.getInternalMethods().getContext().commands.length; + if (demandedCommands._ && (_s7 < demandedCommands._.min || _s7 > demandedCommands._.max)) { + if (_s7 < demandedCommands._.min) { + if (demandedCommands._.minMsg !== void 0) { + usage2.fail(demandedCommands._.minMsg ? demandedCommands._.minMsg.replace(/\$0/g, _s7.toString()).replace(/\$1/, demandedCommands._.min.toString()) : null); + } else { + usage2.fail(__n("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", _s7, _s7.toString(), demandedCommands._.min.toString())); + } + } else if (_s7 > demandedCommands._.max) { + if (demandedCommands._.maxMsg !== void 0) { + usage2.fail(demandedCommands._.maxMsg ? demandedCommands._.maxMsg.replace(/\$0/g, _s7.toString()).replace(/\$1/, demandedCommands._.max.toString()) : null); + } else { + usage2.fail(__n("Too many non-option arguments: got %s, maximum of %s", "Too many non-option arguments: got %s, maximum of %s", _s7, _s7.toString(), demandedCommands._.max.toString())); + } + } + } + }; + self2.positionalCount = function positionalCount(required, observed) { + if (observed < required) { + usage2.fail(__n("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", observed, observed + "", required + "")); + } + }; + self2.requiredArguments = function requiredArguments(argv, demandedOptions) { + let missing = null; + for (const key of Object.keys(demandedOptions)) { + if (!Object.prototype.hasOwnProperty.call(argv, key) || typeof argv[key] === "undefined") { + missing = missing || {}; + missing[key] = demandedOptions[key]; + } + } + if (missing) { + const customMsgs = []; + for (const key of Object.keys(missing)) { + const msg = missing[key]; + if (msg && customMsgs.indexOf(msg) < 0) { + customMsgs.push(msg); + } + } + const customMsg = customMsgs.length ? ` +${customMsgs.join("\n")}` : ""; + usage2.fail(__n("Missing required argument: %s", "Missing required arguments: %s", Object.keys(missing).length, Object.keys(missing).join(", ") + customMsg)); + } + }; + self2.unknownArguments = function unknownArguments(argv, aliases, positionalMap, isDefaultCommand, checkPositionals = true) { + var _a6; + const commandKeys = yargs.getInternalMethods().getCommandInstance().getCommands(); + const unknown = []; + const currentContext = yargs.getInternalMethods().getContext(); + Object.keys(argv).forEach((key) => { + if (!specialKeys.includes(key) && !Object.prototype.hasOwnProperty.call(positionalMap, key) && !Object.prototype.hasOwnProperty.call(yargs.getInternalMethods().getParseContext(), key) && !self2.isValidAndSomeAliasIsNotNew(key, aliases)) { + unknown.push(key); + } + }); + if (checkPositionals && (currentContext.commands.length > 0 || commandKeys.length > 0 || isDefaultCommand)) { + argv._.slice(currentContext.commands.length).forEach((key) => { + if (!commandKeys.includes("" + key)) { + unknown.push("" + key); + } + }); + } + if (checkPositionals) { + const demandedCommands = yargs.getDemandedCommands(); + const maxNonOptDemanded = ((_a6 = demandedCommands._) === null || _a6 === void 0 ? void 0 : _a6.max) || 0; + const expected = currentContext.commands.length + maxNonOptDemanded; + if (expected < argv._.length) { + argv._.slice(expected).forEach((key) => { + key = String(key); + if (!currentContext.commands.includes(key) && !unknown.includes(key)) { + unknown.push(key); + } + }); + } + } + if (unknown.length) { + usage2.fail(__n("Unknown argument: %s", "Unknown arguments: %s", unknown.length, unknown.map((s) => s.trim() ? s : `"${s}"`).join(", "))); + } + }; + self2.unknownCommands = function unknownCommands(argv) { + const commandKeys = yargs.getInternalMethods().getCommandInstance().getCommands(); + const unknown = []; + const currentContext = yargs.getInternalMethods().getContext(); + if (currentContext.commands.length > 0 || commandKeys.length > 0) { + argv._.slice(currentContext.commands.length).forEach((key) => { + if (!commandKeys.includes("" + key)) { + unknown.push("" + key); + } + }); + } + if (unknown.length > 0) { + usage2.fail(__n("Unknown command: %s", "Unknown commands: %s", unknown.length, unknown.join(", "))); + return true; + } else { + return false; + } + }; + self2.isValidAndSomeAliasIsNotNew = function isValidAndSomeAliasIsNotNew(key, aliases) { + if (!Object.prototype.hasOwnProperty.call(aliases, key)) { + return false; + } + const newAliases = yargs.parsed.newAliases; + return [key, ...aliases[key]].some((a6) => !Object.prototype.hasOwnProperty.call(newAliases, a6) || !newAliases[key]); + }; + self2.limitedChoices = function limitedChoices(argv) { + const options = yargs.getOptions(); + const invalid = {}; + if (!Object.keys(options.choices).length) + return; + Object.keys(argv).forEach((key) => { + if (specialKeys.indexOf(key) === -1 && Object.prototype.hasOwnProperty.call(options.choices, key)) { + [].concat(argv[key]).forEach((value) => { + if (options.choices[key].indexOf(value) === -1 && value !== void 0) { + invalid[key] = (invalid[key] || []).concat(value); + } + }); + } + }); + const invalidKeys = Object.keys(invalid); + if (!invalidKeys.length) + return; + let msg = __("Invalid values:"); + invalidKeys.forEach((key) => { + msg += ` + ${__("Argument: %s, Given: %s, Choices: %s", key, usage2.stringifiedValues(invalid[key]), usage2.stringifiedValues(options.choices[key]))}`; + }); + usage2.fail(msg); + }; + let implied = {}; + self2.implies = function implies(key, value) { + argsert(" [array|number|string]", [key, value], arguments.length); + if (typeof key === "object") { + Object.keys(key).forEach((k7) => { + self2.implies(k7, key[k7]); + }); + } else { + yargs.global(key); + if (!implied[key]) { + implied[key] = []; + } + if (Array.isArray(value)) { + value.forEach((i6) => self2.implies(key, i6)); + } else { + assertNotStrictEqual(value, void 0, shim3); + implied[key].push(value); + } + } + }; + self2.getImplied = function getImplied() { + return implied; + }; + function keyExists(argv, val) { + const num = Number(val); + val = isNaN(num) ? val : num; + if (typeof val === "number") { + val = argv._.length >= val; + } else if (val.match(/^--no-.+/)) { + val = val.match(/^--no-(.+)/)[1]; + val = !Object.prototype.hasOwnProperty.call(argv, val); + } else { + val = Object.prototype.hasOwnProperty.call(argv, val); + } + return val; + } + self2.implications = function implications(argv) { + const implyFail = []; + Object.keys(implied).forEach((key) => { + const origKey = key; + (implied[key] || []).forEach((value) => { + let key2 = origKey; + const origValue = value; + key2 = keyExists(argv, key2); + value = keyExists(argv, value); + if (key2 && !value) { + implyFail.push(` ${origKey} -> ${origValue}`); + } + }); + }); + if (implyFail.length) { + let msg = `${__("Implications failed:")} +`; + implyFail.forEach((value) => { + msg += value; + }); + usage2.fail(msg); + } + }; + let conflicting = {}; + self2.conflicts = function conflicts(key, value) { + argsert(" [array|string]", [key, value], arguments.length); + if (typeof key === "object") { + Object.keys(key).forEach((k7) => { + self2.conflicts(k7, key[k7]); + }); + } else { + yargs.global(key); + if (!conflicting[key]) { + conflicting[key] = []; + } + if (Array.isArray(value)) { + value.forEach((i6) => self2.conflicts(key, i6)); + } else { + conflicting[key].push(value); + } + } + }; + self2.getConflicting = () => conflicting; + self2.conflicting = function conflictingFn(argv) { + Object.keys(argv).forEach((key) => { + if (conflicting[key]) { + conflicting[key].forEach((value) => { + if (value && argv[key] !== void 0 && argv[value] !== void 0) { + usage2.fail(__("Arguments %s and %s are mutually exclusive", key, value)); + } + }); + } + }); + if (yargs.getInternalMethods().getParserConfiguration()["strip-dashed"]) { + Object.keys(conflicting).forEach((key) => { + conflicting[key].forEach((value) => { + if (value && argv[shim3.Parser.camelCase(key)] !== void 0 && argv[shim3.Parser.camelCase(value)] !== void 0) { + usage2.fail(__("Arguments %s and %s are mutually exclusive", key, value)); + } + }); + }); + } + }; + self2.recommendCommands = function recommendCommands(cmd, potentialCommands) { + const threshold = 3; + potentialCommands = potentialCommands.sort((a6, b6) => b6.length - a6.length); + let recommended = null; + let bestDistance = Infinity; + for (let i6 = 0, candidate; (candidate = potentialCommands[i6]) !== void 0; i6++) { + const d6 = levenshtein(cmd, candidate); + if (d6 <= threshold && d6 < bestDistance) { + bestDistance = d6; + recommended = candidate; + } + } + if (recommended) + usage2.fail(__("Did you mean %s?", recommended)); + }; + self2.reset = function reset(localLookup) { + implied = objFilter(implied, (k7) => !localLookup[k7]); + conflicting = objFilter(conflicting, (k7) => !localLookup[k7]); + return self2; + }; + const frozens = []; + self2.freeze = function freeze() { + frozens.push({ + implied, + conflicting + }); + }; + self2.unfreeze = function unfreeze() { + const frozen = frozens.pop(); + assertNotStrictEqual(frozen, void 0, shim3); + ({ implied, conflicting } = frozen); + }; + return self2; +} +var specialKeys; +var init_validation = __esm({ + "node_modules/yargs/build/lib/validation.js"() { + "use strict"; + init_argsert(); + init_common_types(); + init_levenshtein(); + init_obj_filter(); + specialKeys = ["$0", "--", "_"]; + } +}); + +// node_modules/yargs/build/lib/utils/apply-extends.js +function applyExtends(config, cwd, mergeExtends, _shim) { + shim2 = _shim; + let defaultConfig = {}; + if (Object.prototype.hasOwnProperty.call(config, "extends")) { + if (typeof config.extends !== "string") + return defaultConfig; + const isPath = /\.json|\..*rc$/.test(config.extends); + let pathToDefault = null; + if (!isPath) { + try { + pathToDefault = import.meta.resolve(config.extends); + } catch (_err) { + return config; + } + } else { + pathToDefault = getPathToDefaultConfig(cwd, config.extends); + } + checkForCircularExtends(pathToDefault); + previouslyVisitedConfigs.push(pathToDefault); + defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : _shim.require(config.extends); + delete config.extends; + defaultConfig = applyExtends(defaultConfig, shim2.path.dirname(pathToDefault), mergeExtends, shim2); + } + previouslyVisitedConfigs = []; + return mergeExtends ? mergeDeep2(defaultConfig, config) : Object.assign({}, defaultConfig, config); +} +function checkForCircularExtends(cfgPath) { + if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) { + throw new YError(`Circular extended configurations: '${cfgPath}'.`); + } +} +function getPathToDefaultConfig(cwd, pathToExtend) { + return shim2.path.resolve(cwd, pathToExtend); +} +function mergeDeep2(config1, config2) { + const target = {}; + function isObject2(obj) { + return obj && typeof obj === "object" && !Array.isArray(obj); + } + Object.assign(target, config1); + for (const key of Object.keys(config2)) { + if (isObject2(config2[key]) && isObject2(target[key])) { + target[key] = mergeDeep2(config1[key], config2[key]); + } else { + target[key] = config2[key]; + } + } + return target; +} +var previouslyVisitedConfigs, shim2; +var init_apply_extends = __esm({ + "node_modules/yargs/build/lib/utils/apply-extends.js"() { + "use strict"; + init_yerror(); + previouslyVisitedConfigs = []; + } +}); + +// node_modules/yargs/build/lib/yargs-factory.js +function YargsFactory(_shim) { + return (processArgs = [], cwd = _shim.process.cwd(), parentRequire) => { + const yargs = new YargsInstance(processArgs, cwd, parentRequire, _shim); + Object.defineProperty(yargs, "argv", { + get: () => { + return yargs.parse(); + }, + enumerable: true + }); + yargs.help(); + yargs.version(); + return yargs; + }; +} +function isYargsInstance(y) { + return !!y && typeof y.getInternalMethods === "function"; +} +var __classPrivateFieldSet, __classPrivateFieldGet, _YargsInstance_command, _YargsInstance_cwd, _YargsInstance_context, _YargsInstance_completion, _YargsInstance_completionCommand, _YargsInstance_defaultShowHiddenOpt, _YargsInstance_exitError, _YargsInstance_detectLocale, _YargsInstance_emittedWarnings, _YargsInstance_exitProcess, _YargsInstance_frozens, _YargsInstance_globalMiddleware, _YargsInstance_groups, _YargsInstance_hasOutput, _YargsInstance_helpOpt, _YargsInstance_isGlobalContext, _YargsInstance_logger, _YargsInstance_output, _YargsInstance_options, _YargsInstance_parentRequire, _YargsInstance_parserConfig, _YargsInstance_parseFn, _YargsInstance_parseContext, _YargsInstance_pkgs, _YargsInstance_preservedGroups, _YargsInstance_processArgs, _YargsInstance_recommendCommands, _YargsInstance_shim, _YargsInstance_strict, _YargsInstance_strictCommands, _YargsInstance_strictOptions, _YargsInstance_usage, _YargsInstance_usageConfig, _YargsInstance_versionOpt, _YargsInstance_validation, kCopyDoubleDash, kCreateLogger, kDeleteFromParserHintObject, kEmitWarning, kFreeze, kGetDollarZero, kGetParserConfiguration, kGetUsageConfiguration, kGuessLocale, kGuessVersion, kParsePositionalNumbers, kPkgUp, kPopulateParserHintArray, kPopulateParserHintSingleValueDictionary, kPopulateParserHintArrayDictionary, kPopulateParserHintDictionary, kSanitizeKey, kSetKey, kUnfreeze, kValidateAsync, kGetCommandInstance, kGetContext, kGetHasOutput, kGetLoggerInstance, kGetParseContext, kGetUsageInstance, kGetValidationInstance, kHasParseCallback, kIsGlobalContext, kPostProcess, kRebase, kReset, kRunYargsParserAndExecuteCommands, kRunValidation, kSetHasOutput, kTrackManuallySetKeys, DEFAULT_LOCALE, YargsInstance; +var init_yargs_factory = __esm({ + "node_modules/yargs/build/lib/yargs-factory.js"() { + "use strict"; + init_command(); + init_common_types(); + init_yerror(); + init_usage(); + init_argsert(); + init_completion(); + init_validation(); + init_obj_filter(); + init_apply_extends(); + init_middleware(); + init_is_promise(); + init_maybe_async_result(); + init_set_blocking(); + __classPrivateFieldSet = function(receiver, state4, value, kind, f6) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; + }; + __classPrivateFieldGet = function(receiver, state4, kind, f6) { + if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); + }; + kCopyDoubleDash = /* @__PURE__ */ Symbol("copyDoubleDash"); + kCreateLogger = /* @__PURE__ */ Symbol("copyDoubleDash"); + kDeleteFromParserHintObject = /* @__PURE__ */ Symbol("deleteFromParserHintObject"); + kEmitWarning = /* @__PURE__ */ Symbol("emitWarning"); + kFreeze = /* @__PURE__ */ Symbol("freeze"); + kGetDollarZero = /* @__PURE__ */ Symbol("getDollarZero"); + kGetParserConfiguration = /* @__PURE__ */ Symbol("getParserConfiguration"); + kGetUsageConfiguration = /* @__PURE__ */ Symbol("getUsageConfiguration"); + kGuessLocale = /* @__PURE__ */ Symbol("guessLocale"); + kGuessVersion = /* @__PURE__ */ Symbol("guessVersion"); + kParsePositionalNumbers = /* @__PURE__ */ Symbol("parsePositionalNumbers"); + kPkgUp = /* @__PURE__ */ Symbol("pkgUp"); + kPopulateParserHintArray = /* @__PURE__ */ Symbol("populateParserHintArray"); + kPopulateParserHintSingleValueDictionary = /* @__PURE__ */ Symbol("populateParserHintSingleValueDictionary"); + kPopulateParserHintArrayDictionary = /* @__PURE__ */ Symbol("populateParserHintArrayDictionary"); + kPopulateParserHintDictionary = /* @__PURE__ */ Symbol("populateParserHintDictionary"); + kSanitizeKey = /* @__PURE__ */ Symbol("sanitizeKey"); + kSetKey = /* @__PURE__ */ Symbol("setKey"); + kUnfreeze = /* @__PURE__ */ Symbol("unfreeze"); + kValidateAsync = /* @__PURE__ */ Symbol("validateAsync"); + kGetCommandInstance = /* @__PURE__ */ Symbol("getCommandInstance"); + kGetContext = /* @__PURE__ */ Symbol("getContext"); + kGetHasOutput = /* @__PURE__ */ Symbol("getHasOutput"); + kGetLoggerInstance = /* @__PURE__ */ Symbol("getLoggerInstance"); + kGetParseContext = /* @__PURE__ */ Symbol("getParseContext"); + kGetUsageInstance = /* @__PURE__ */ Symbol("getUsageInstance"); + kGetValidationInstance = /* @__PURE__ */ Symbol("getValidationInstance"); + kHasParseCallback = /* @__PURE__ */ Symbol("hasParseCallback"); + kIsGlobalContext = /* @__PURE__ */ Symbol("isGlobalContext"); + kPostProcess = /* @__PURE__ */ Symbol("postProcess"); + kRebase = /* @__PURE__ */ Symbol("rebase"); + kReset = /* @__PURE__ */ Symbol("reset"); + kRunYargsParserAndExecuteCommands = /* @__PURE__ */ Symbol("runYargsParserAndExecuteCommands"); + kRunValidation = /* @__PURE__ */ Symbol("runValidation"); + kSetHasOutput = /* @__PURE__ */ Symbol("setHasOutput"); + kTrackManuallySetKeys = /* @__PURE__ */ Symbol("kTrackManuallySetKeys"); + DEFAULT_LOCALE = "en_US"; + YargsInstance = class { + constructor(processArgs = [], cwd, parentRequire, shim3) { + this.customScriptName = false; + this.parsed = false; + _YargsInstance_command.set(this, void 0); + _YargsInstance_cwd.set(this, void 0); + _YargsInstance_context.set(this, { commands: [], fullCommands: [] }); + _YargsInstance_completion.set(this, null); + _YargsInstance_completionCommand.set(this, null); + _YargsInstance_defaultShowHiddenOpt.set(this, "show-hidden"); + _YargsInstance_exitError.set(this, null); + _YargsInstance_detectLocale.set(this, true); + _YargsInstance_emittedWarnings.set(this, {}); + _YargsInstance_exitProcess.set(this, true); + _YargsInstance_frozens.set(this, []); + _YargsInstance_globalMiddleware.set(this, void 0); + _YargsInstance_groups.set(this, {}); + _YargsInstance_hasOutput.set(this, false); + _YargsInstance_helpOpt.set(this, null); + _YargsInstance_isGlobalContext.set(this, true); + _YargsInstance_logger.set(this, void 0); + _YargsInstance_output.set(this, ""); + _YargsInstance_options.set(this, void 0); + _YargsInstance_parentRequire.set(this, void 0); + _YargsInstance_parserConfig.set(this, {}); + _YargsInstance_parseFn.set(this, null); + _YargsInstance_parseContext.set(this, null); + _YargsInstance_pkgs.set(this, {}); + _YargsInstance_preservedGroups.set(this, {}); + _YargsInstance_processArgs.set(this, void 0); + _YargsInstance_recommendCommands.set(this, false); + _YargsInstance_shim.set(this, void 0); + _YargsInstance_strict.set(this, false); + _YargsInstance_strictCommands.set(this, false); + _YargsInstance_strictOptions.set(this, false); + _YargsInstance_usage.set(this, void 0); + _YargsInstance_usageConfig.set(this, {}); + _YargsInstance_versionOpt.set(this, null); + _YargsInstance_validation.set(this, void 0); + __classPrivateFieldSet(this, _YargsInstance_shim, shim3, "f"); + __classPrivateFieldSet(this, _YargsInstance_processArgs, processArgs, "f"); + __classPrivateFieldSet(this, _YargsInstance_cwd, cwd, "f"); + __classPrivateFieldSet(this, _YargsInstance_parentRequire, parentRequire, "f"); + __classPrivateFieldSet(this, _YargsInstance_globalMiddleware, new GlobalMiddleware(this), "f"); + this.$0 = this[kGetDollarZero](); + this[kReset](); + __classPrivateFieldSet(this, _YargsInstance_command, __classPrivateFieldGet(this, _YargsInstance_command, "f"), "f"); + __classPrivateFieldSet(this, _YargsInstance_usage, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), "f"); + __classPrivateFieldSet(this, _YargsInstance_validation, __classPrivateFieldGet(this, _YargsInstance_validation, "f"), "f"); + __classPrivateFieldSet(this, _YargsInstance_options, __classPrivateFieldGet(this, _YargsInstance_options, "f"), "f"); + __classPrivateFieldGet(this, _YargsInstance_options, "f").showHiddenOpt = __classPrivateFieldGet(this, _YargsInstance_defaultShowHiddenOpt, "f"); + __classPrivateFieldSet(this, _YargsInstance_logger, this[kCreateLogger](), "f"); + __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.setLocale(DEFAULT_LOCALE); + } + addHelpOpt(opt, msg) { + const defaultHelpOpt = "help"; + argsert("[string|boolean] [string]", [opt, msg], arguments.length); + if (__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")) { + this[kDeleteFromParserHintObject](__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")); + __classPrivateFieldSet(this, _YargsInstance_helpOpt, null, "f"); + } + if (opt === false && msg === void 0) + return this; + __classPrivateFieldSet(this, _YargsInstance_helpOpt, typeof opt === "string" ? opt : defaultHelpOpt, "f"); + this.boolean(__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")); + this.describe(__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f"), msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup("Show help")); + return this; + } + help(opt, msg) { + return this.addHelpOpt(opt, msg); + } + addShowHiddenOpt(opt, msg) { + argsert("[string|boolean] [string]", [opt, msg], arguments.length); + if (opt === false && msg === void 0) + return this; + const showHiddenOpt = typeof opt === "string" ? opt : __classPrivateFieldGet(this, _YargsInstance_defaultShowHiddenOpt, "f"); + this.boolean(showHiddenOpt); + this.describe(showHiddenOpt, msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup("Show hidden options")); + __classPrivateFieldGet(this, _YargsInstance_options, "f").showHiddenOpt = showHiddenOpt; + return this; + } + showHidden(opt, msg) { + return this.addShowHiddenOpt(opt, msg); + } + alias(key, value) { + argsert(" [string|array]", [key, value], arguments.length); + this[kPopulateParserHintArrayDictionary](this.alias.bind(this), "alias", key, value); + return this; + } + array(keys) { + argsert("", [keys], arguments.length); + this[kPopulateParserHintArray]("array", keys); + this[kTrackManuallySetKeys](keys); + return this; + } + boolean(keys) { + argsert("", [keys], arguments.length); + this[kPopulateParserHintArray]("boolean", keys); + this[kTrackManuallySetKeys](keys); + return this; + } + check(f6, global2) { + argsert(" [boolean]", [f6, global2], arguments.length); + this.middleware((argv, _yargs) => { + return maybeAsyncResult(() => { + return f6(argv, _yargs.getOptions()); + }, (result) => { + if (!result) { + __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(__classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__("Argument check failed: %s", f6.toString())); + } else if (typeof result === "string" || result instanceof Error) { + __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(result.toString(), result); + } + return argv; + }, (err) => { + __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message ? err.message : err.toString(), err); + return argv; + }); + }, false, global2); + return this; + } + choices(key, value) { + argsert(" [string|array]", [key, value], arguments.length); + this[kPopulateParserHintArrayDictionary](this.choices.bind(this), "choices", key, value); + return this; + } + coerce(keys, value) { + argsert(" [function]", [keys, value], arguments.length); + if (Array.isArray(keys)) { + if (!value) { + throw new YError("coerce callback must be provided"); + } + for (const key of keys) { + this.coerce(key, value); + } + return this; + } else if (typeof keys === "object") { + for (const key of Object.keys(keys)) { + this.coerce(key, keys[key]); + } + return this; + } + if (!value) { + throw new YError("coerce callback must be provided"); + } + const coerceKey = keys; + __classPrivateFieldGet(this, _YargsInstance_options, "f").key[coerceKey] = true; + __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addCoerceMiddleware((argv, yargs) => { + var _a6; + const coerceKeyAliases = (_a6 = yargs.getAliases()[coerceKey]) !== null && _a6 !== void 0 ? _a6 : []; + const argvKeys = [coerceKey, ...coerceKeyAliases].filter((key) => Object.prototype.hasOwnProperty.call(argv, key)); + if (argvKeys.length === 0) { + return argv; + } + return maybeAsyncResult(() => { + return value(argv[argvKeys[0]]); + }, (result) => { + argvKeys.forEach((key) => { + argv[key] = result; + }); + return argv; + }, (err) => { + throw new YError(err.message); + }); + }, coerceKey); + return this; + } + conflicts(key1, key2) { + argsert(" [string|array]", [key1, key2], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_validation, "f").conflicts(key1, key2); + return this; + } + config(key = "config", msg, parseFn) { + argsert("[object|string] [string|function] [function]", [key, msg, parseFn], arguments.length); + if (typeof key === "object" && !Array.isArray(key)) { + key = applyExtends(key, __classPrivateFieldGet(this, _YargsInstance_cwd, "f"), this[kGetParserConfiguration]()["deep-merge-config"] || false, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = (__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []).concat(key); + return this; + } + if (typeof msg === "function") { + parseFn = msg; + msg = void 0; + } + this.describe(key, msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup("Path to JSON config file")); + (Array.isArray(key) ? key : [key]).forEach((k7) => { + __classPrivateFieldGet(this, _YargsInstance_options, "f").config[k7] = parseFn || true; + }); + return this; + } + completion(cmd, desc, fn) { + argsert("[string] [string|boolean|function] [function]", [cmd, desc, fn], arguments.length); + if (typeof desc === "function") { + fn = desc; + desc = void 0; + } + __classPrivateFieldSet(this, _YargsInstance_completionCommand, cmd || __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") || "completion", "f"); + if (!desc && desc !== false) { + desc = "generate completion script"; + } + this.command(__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f"), desc); + if (fn) + __classPrivateFieldGet(this, _YargsInstance_completion, "f").registerFunction(fn); + return this; + } + command(cmd, description, builder, handler2, middlewares, deprecated) { + argsert(" [string|boolean] [function|object] [function] [array] [boolean|string]", [cmd, description, builder, handler2, middlewares, deprecated], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_command, "f").addHandler(cmd, description, builder, handler2, middlewares, deprecated); + return this; + } + commands(cmd, description, builder, handler2, middlewares, deprecated) { + return this.command(cmd, description, builder, handler2, middlewares, deprecated); + } + commandDir(dir2, opts) { + argsert(" [object]", [dir2, opts], arguments.length); + const req = __classPrivateFieldGet(this, _YargsInstance_parentRequire, "f") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").require; + __classPrivateFieldGet(this, _YargsInstance_command, "f").addDirectory(dir2, req, __classPrivateFieldGet(this, _YargsInstance_shim, "f").getCallerFile(), opts); + return this; + } + count(keys) { + argsert("", [keys], arguments.length); + this[kPopulateParserHintArray]("count", keys); + this[kTrackManuallySetKeys](keys); + return this; } - default(t7, e7, s7) { - return h6(" [*] [string]", [t7, e7, s7], arguments.length), s7 && (u6(t7, v8(this, ct2, "f")), v8(this, et2, "f").defaultDescription[t7] = s7), "function" == typeof e7 && (u6(t7, v8(this, ct2, "f")), v8(this, et2, "f").defaultDescription[t7] || (v8(this, et2, "f").defaultDescription[t7] = v8(this, pt2, "f").functionDescription(e7)), e7 = e7.call()), this[St2](this.default.bind(this), "default", t7, e7), this; + default(key, value, defaultDescription) { + argsert(" [*] [string]", [key, value, defaultDescription], arguments.length); + if (defaultDescription) { + assertSingleKey(key, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = defaultDescription; + } + if (typeof value === "function") { + assertSingleKey(key, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + if (!__classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key]) + __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = __classPrivateFieldGet(this, _YargsInstance_usage, "f").functionDescription(value); + value = value.call(); + } + this[kPopulateParserHintSingleValueDictionary](this.default.bind(this), "default", key, value); + return this; } - defaults(t7, e7, s7) { - return this.default(t7, e7, s7); + defaults(key, value, defaultDescription) { + return this.default(key, value, defaultDescription); } - demandCommand(t7 = 1, e7, s7, i7) { - return h6("[number] [number|string] [string|null|undefined] [string|null|undefined]", [t7, e7, s7, i7], arguments.length), "number" != typeof e7 && (s7 = e7, e7 = 1 / 0), this.global("_", false), v8(this, et2, "f").demandedCommands._ = { min: t7, max: e7, minMsg: s7, maxMsg: i7 }, this; + demandCommand(min = 1, max, minMsg, maxMsg) { + argsert("[number] [number|string] [string|null|undefined] [string|null|undefined]", [min, max, minMsg, maxMsg], arguments.length); + if (typeof max !== "number") { + minMsg = max; + max = Infinity; + } + this.global("_", false); + __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedCommands._ = { + min, + max, + minMsg, + maxMsg + }; + return this; } - demand(t7, e7, s7) { - return Array.isArray(e7) ? (e7.forEach(((t8) => { - d6(s7, true, v8(this, ct2, "f")), this.demandOption(t8, s7); - })), e7 = 1 / 0) : "number" != typeof e7 && (s7 = e7, e7 = 1 / 0), "number" == typeof t7 ? (d6(s7, true, v8(this, ct2, "f")), this.demandCommand(t7, e7, s7, s7)) : Array.isArray(t7) ? t7.forEach(((t8) => { - d6(s7, true, v8(this, ct2, "f")), this.demandOption(t8, s7); - })) : "string" == typeof s7 ? this.demandOption(t7, s7) : true !== s7 && void 0 !== s7 || this.demandOption(t7), this; + demand(keys, max, msg) { + if (Array.isArray(max)) { + max.forEach((key) => { + assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + this.demandOption(key, msg); + }); + max = Infinity; + } else if (typeof max !== "number") { + msg = max; + max = Infinity; + } + if (typeof keys === "number") { + assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + this.demandCommand(keys, max, msg, msg); + } else if (Array.isArray(keys)) { + keys.forEach((key) => { + assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + this.demandOption(key, msg); + }); + } else { + if (typeof msg === "string") { + this.demandOption(keys, msg); + } else if (msg === true || typeof msg === "undefined") { + this.demandOption(keys); + } + } + return this; } - demandOption(t7, e7) { - return h6(" [string]", [t7, e7], arguments.length), this[St2](this.demandOption.bind(this), "demandedOptions", t7, e7), this; + demandOption(keys, msg) { + argsert(" [string]", [keys, msg], arguments.length); + this[kPopulateParserHintSingleValueDictionary](this.demandOption.bind(this), "demandedOptions", keys, msg); + return this; } - deprecateOption(t7, e7) { - return h6(" [string|boolean]", [t7, e7], arguments.length), v8(this, et2, "f").deprecatedOptions[t7] = e7, this; + deprecateOption(option, message) { + argsert(" [string|boolean]", [option, message], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_options, "f").deprecatedOptions[option] = message; + return this; } - describe(t7, e7) { - return h6(" [string]", [t7, e7], arguments.length), this[Nt2](t7, true), v8(this, pt2, "f").describe(t7, e7), this; + describe(keys, description) { + argsert(" [string]", [keys, description], arguments.length); + this[kSetKey](keys, true); + __classPrivateFieldGet(this, _YargsInstance_usage, "f").describe(keys, description); + return this; } - detectLocale(t7) { - return h6("", [t7], arguments.length), O2(this, G3, t7, "f"), this; + detectLocale(detect2) { + argsert("", [detect2], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_detectLocale, detect2, "f"); + return this; } - env(t7) { - return h6("[string|boolean]", [t7], arguments.length), false === t7 ? delete v8(this, et2, "f").envPrefix : v8(this, et2, "f").envPrefix = t7 || "", this; + env(prefix2) { + argsert("[string|boolean]", [prefix2], arguments.length); + if (prefix2 === false) + delete __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix; + else + __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix = prefix2 || ""; + return this; } - epilogue(t7) { - return h6("", [t7], arguments.length), v8(this, pt2, "f").epilog(t7), this; + epilogue(msg) { + argsert("", [msg], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_usage, "f").epilog(msg); + return this; } - epilog(t7) { - return this.epilogue(t7); + epilog(msg) { + return this.epilogue(msg); } - example(t7, e7) { - return h6(" [string]", [t7, e7], arguments.length), Array.isArray(t7) ? t7.forEach(((t8) => this.example(...t8))) : v8(this, pt2, "f").example(t7, e7), this; + example(cmd, description) { + argsert(" [string]", [cmd, description], arguments.length); + if (Array.isArray(cmd)) { + cmd.forEach((exampleParams) => this.example(...exampleParams)); + } else { + __classPrivateFieldGet(this, _YargsInstance_usage, "f").example(cmd, description); + } + return this; } - exit(t7, e7) { - O2(this, J2, true, "f"), O2(this, V2, e7, "f"), v8(this, T2, "f") && v8(this, ct2, "f").process.exit(t7); + exit(code, err) { + __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); + __classPrivateFieldSet(this, _YargsInstance_exitError, err, "f"); + if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) + __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.exit(code); } - exitProcess(t7 = true) { - return h6("[boolean]", [t7], arguments.length), O2(this, T2, t7, "f"), this; + exitProcess(enabled2 = true) { + argsert("[boolean]", [enabled2], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_exitProcess, enabled2, "f"); + return this; } - fail(t7) { - if (h6("", [t7], arguments.length), "boolean" == typeof t7 && false !== t7) throw new e6("Invalid first argument. Expected function or boolean 'false'"); - return v8(this, pt2, "f").failFn(t7), this; + fail(f6) { + argsert("", [f6], arguments.length); + if (typeof f6 === "boolean" && f6 !== false) { + throw new YError("Invalid first argument. Expected function or boolean 'false'"); + } + __classPrivateFieldGet(this, _YargsInstance_usage, "f").failFn(f6); + return this; } getAliases() { return this.parsed ? this.parsed.aliases : {}; } - async getCompletion(t7, e7) { - return h6(" [function]", [t7, e7], arguments.length), e7 ? v8(this, U2, "f").getCompletion(t7, e7) : new Promise(((e8, s7) => { - v8(this, U2, "f").getCompletion(t7, ((t8, i7) => { - t8 ? s7(t8) : e8(i7); - })); - })); + async getCompletion(args, done) { + argsert(" [function]", [args, done], arguments.length); + if (!done) { + return new Promise((resolve8, reject2) => { + __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, (err, completions) => { + if (err) + reject2(err); + else + resolve8(completions); + }); + }); + } else { + return __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, done); + } } getDemandedOptions() { - return h6([], 0), v8(this, et2, "f").demandedOptions; + argsert([], 0); + return __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedOptions; } getDemandedCommands() { - return h6([], 0), v8(this, et2, "f").demandedCommands; + argsert([], 0); + return __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedCommands; } getDeprecatedOptions() { - return h6([], 0), v8(this, et2, "f").deprecatedOptions; + argsert([], 0); + return __classPrivateFieldGet(this, _YargsInstance_options, "f").deprecatedOptions; } getDetectLocale() { - return v8(this, G3, "f"); + return __classPrivateFieldGet(this, _YargsInstance_detectLocale, "f"); } getExitProcess() { - return v8(this, T2, "f"); + return __classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"); } getGroups() { - return Object.assign({}, v8(this, K2, "f"), v8(this, at2, "f")); + return Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_groups, "f"), __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")); } getHelp() { - if (O2(this, J2, true, "f"), !v8(this, pt2, "f").hasCachedHelpMessage()) { + __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); + if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) { if (!this.parsed) { - const t8 = this[Jt2](v8(this, ht2, "f"), void 0, void 0, 0, true); - if (f6(t8)) return t8.then((() => v8(this, pt2, "f").help())); + const parse3 = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true); + if (isPromise(parse3)) { + return parse3.then(() => { + return __classPrivateFieldGet(this, _YargsInstance_usage, "f").help(); + }); + } + } + const builderResponse = __classPrivateFieldGet(this, _YargsInstance_command, "f").runDefaultBuilderOn(this); + if (isPromise(builderResponse)) { + return builderResponse.then(() => { + return __classPrivateFieldGet(this, _YargsInstance_usage, "f").help(); + }); } - const t7 = v8(this, z2, "f").runDefaultBuilderOn(this); - if (f6(t7)) return t7.then((() => v8(this, pt2, "f").help())); } - return Promise.resolve(v8(this, pt2, "f").help()); + return Promise.resolve(__classPrivateFieldGet(this, _YargsInstance_usage, "f").help()); } getOptions() { - return v8(this, et2, "f"); + return __classPrivateFieldGet(this, _YargsInstance_options, "f"); } getStrict() { - return v8(this, ft2, "f"); + return __classPrivateFieldGet(this, _YargsInstance_strict, "f"); } getStrictCommands() { - return v8(this, dt2, "f"); + return __classPrivateFieldGet(this, _YargsInstance_strictCommands, "f"); } getStrictOptions() { - return v8(this, ut2, "f"); + return __classPrivateFieldGet(this, _YargsInstance_strictOptions, "f"); } - global(t7, e7) { - return h6(" [boolean]", [t7, e7], arguments.length), t7 = [].concat(t7), false !== e7 ? v8(this, et2, "f").local = v8(this, et2, "f").local.filter(((e8) => -1 === t7.indexOf(e8))) : t7.forEach(((t8) => { - v8(this, et2, "f").local.includes(t8) || v8(this, et2, "f").local.push(t8); - })), this; + global(globals, global2) { + argsert(" [boolean]", [globals, global2], arguments.length); + globals = [].concat(globals); + if (global2 !== false) { + __classPrivateFieldGet(this, _YargsInstance_options, "f").local = __classPrivateFieldGet(this, _YargsInstance_options, "f").local.filter((l3) => globals.indexOf(l3) === -1); + } else { + globals.forEach((g6) => { + if (!__classPrivateFieldGet(this, _YargsInstance_options, "f").local.includes(g6)) + __classPrivateFieldGet(this, _YargsInstance_options, "f").local.push(g6); + }); + } + return this; } - group(t7, e7) { - h6(" ", [t7, e7], arguments.length); - const s7 = v8(this, at2, "f")[e7] || v8(this, K2, "f")[e7]; - v8(this, at2, "f")[e7] && delete v8(this, at2, "f")[e7]; - const i7 = {}; - return v8(this, K2, "f")[e7] = (s7 || []).concat(t7).filter(((t8) => !i7[t8] && (i7[t8] = true))), this; + group(opts, groupName) { + argsert(" ", [opts, groupName], arguments.length); + const existing = __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName] || __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName]; + if (__classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName]) { + delete __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName]; + } + const seen = {}; + __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName] = (existing || []).concat(opts).filter((key) => { + if (seen[key]) + return false; + return seen[key] = true; + }); + return this; } - hide(t7) { - return h6("", [t7], arguments.length), v8(this, et2, "f").hiddenOptions.push(t7), this; + hide(key) { + argsert("", [key], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_options, "f").hiddenOptions.push(key); + return this; } - implies(t7, e7) { - return h6(" [number|string|array]", [t7, e7], arguments.length), v8(this, yt2, "f").implies(t7, e7), this; + implies(key, value) { + argsert(" [number|string|array]", [key, value], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_validation, "f").implies(key, value); + return this; } - locale(t7) { - return h6("[string]", [t7], arguments.length), void 0 === t7 ? (this[kt2](), v8(this, ct2, "f").y18n.getLocale()) : (O2(this, G3, false, "f"), v8(this, ct2, "f").y18n.setLocale(t7), this); + locale(locale) { + argsert("[string]", [locale], arguments.length); + if (locale === void 0) { + this[kGuessLocale](); + return __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.getLocale(); + } + __classPrivateFieldSet(this, _YargsInstance_detectLocale, false, "f"); + __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.setLocale(locale); + return this; } - middleware(t7, e7, s7) { - return v8(this, Y2, "f").addMiddleware(t7, !!e7, s7); + middleware(callback, applyBeforeValidation, global2) { + return __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addMiddleware(callback, !!applyBeforeValidation, global2); } - nargs(t7, e7) { - return h6(" [number]", [t7, e7], arguments.length), this[St2](this.nargs.bind(this), "narg", t7, e7), this; + nargs(key, value) { + argsert(" [number]", [key, value], arguments.length); + this[kPopulateParserHintSingleValueDictionary](this.nargs.bind(this), "narg", key, value); + return this; } - normalize(t7) { - return h6("", [t7], arguments.length), this[Pt2]("normalize", t7), this; + normalize(keys) { + argsert("", [keys], arguments.length); + this[kPopulateParserHintArray]("normalize", keys); + return this; } - number(t7) { - return h6("", [t7], arguments.length), this[Pt2]("number", t7), this[Qt2](t7), this; + number(keys) { + argsert("", [keys], arguments.length); + this[kPopulateParserHintArray]("number", keys); + this[kTrackManuallySetKeys](keys); + return this; } - option(t7, e7) { - if (h6(" [object]", [t7, e7], arguments.length), "object" == typeof t7) Object.keys(t7).forEach(((e8) => { - this.options(e8, t7[e8]); - })); - else { - "object" != typeof e7 && (e7 = {}), this[Qt2](t7), !v8(this, mt2, "f") || "version" !== t7 && "version" !== (null == e7 ? void 0 : e7.alias) || this[wt2](['"version" is a reserved word.', "Please do one of the following:", '- Disable version with `yargs.version(false)` if using "version" as an option', "- Use the built-in `yargs.version` method instead (if applicable)", "- Use a different option key", "https://yargs.js.org/docs/#api-reference-version"].join("\n"), void 0, "versionWarning"), v8(this, et2, "f").key[t7] = true, e7.alias && this.alias(t7, e7.alias); - const s7 = e7.deprecate || e7.deprecated; - s7 && this.deprecateOption(t7, s7); - const i7 = e7.demand || e7.required || e7.require; - i7 && this.demand(t7, i7), e7.demandOption && this.demandOption(t7, "string" == typeof e7.demandOption ? e7.demandOption : void 0), e7.conflicts && this.conflicts(t7, e7.conflicts), "default" in e7 && this.default(t7, e7.default), void 0 !== e7.implies && this.implies(t7, e7.implies), void 0 !== e7.nargs && this.nargs(t7, e7.nargs), e7.config && this.config(t7, e7.configParser), e7.normalize && this.normalize(t7), e7.choices && this.choices(t7, e7.choices), e7.coerce && this.coerce(t7, e7.coerce), e7.group && this.group(t7, e7.group), (e7.boolean || "boolean" === e7.type) && (this.boolean(t7), e7.alias && this.boolean(e7.alias)), (e7.array || "array" === e7.type) && (this.array(t7), e7.alias && this.array(e7.alias)), (e7.number || "number" === e7.type) && (this.number(t7), e7.alias && this.number(e7.alias)), (e7.string || "string" === e7.type) && (this.string(t7), e7.alias && this.string(e7.alias)), (e7.count || "count" === e7.type) && this.count(t7), "boolean" == typeof e7.global && this.global(t7, e7.global), e7.defaultDescription && (v8(this, et2, "f").defaultDescription[t7] = e7.defaultDescription), e7.skipValidation && this.skipValidation(t7); - const n13 = e7.describe || e7.description || e7.desc, r7 = v8(this, pt2, "f").getDescriptions(); - Object.prototype.hasOwnProperty.call(r7, t7) && "string" != typeof n13 || this.describe(t7, n13), e7.hidden && this.hide(t7), e7.requiresArg && this.requiresArg(t7); + option(key, opt) { + argsert(" [object]", [key, opt], arguments.length); + if (typeof key === "object") { + Object.keys(key).forEach((k7) => { + this.options(k7, key[k7]); + }); + } else { + if (typeof opt !== "object") { + opt = {}; + } + this[kTrackManuallySetKeys](key); + if (__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f") && (key === "version" || (opt === null || opt === void 0 ? void 0 : opt.alias) === "version")) { + this[kEmitWarning]([ + '"version" is a reserved word.', + "Please do one of the following:", + '- Disable version with `yargs.version(false)` if using "version" as an option', + "- Use the built-in `yargs.version` method instead (if applicable)", + "- Use a different option key", + "https://yargs.js.org/docs/#api-reference-version" + ].join("\n"), void 0, "versionWarning"); + } + __classPrivateFieldGet(this, _YargsInstance_options, "f").key[key] = true; + if (opt.alias) + this.alias(key, opt.alias); + const deprecate = opt.deprecate || opt.deprecated; + if (deprecate) { + this.deprecateOption(key, deprecate); + } + const demand = opt.demand || opt.required || opt.require; + if (demand) { + this.demand(key, demand); + } + if (opt.demandOption) { + this.demandOption(key, typeof opt.demandOption === "string" ? opt.demandOption : void 0); + } + if (opt.conflicts) { + this.conflicts(key, opt.conflicts); + } + if ("default" in opt) { + this.default(key, opt.default); + } + if (opt.implies !== void 0) { + this.implies(key, opt.implies); + } + if (opt.nargs !== void 0) { + this.nargs(key, opt.nargs); + } + if (opt.config) { + this.config(key, opt.configParser); + } + if (opt.normalize) { + this.normalize(key); + } + if (opt.choices) { + this.choices(key, opt.choices); + } + if (opt.coerce) { + this.coerce(key, opt.coerce); + } + if (opt.group) { + this.group(key, opt.group); + } + if (opt.boolean || opt.type === "boolean") { + this.boolean(key); + if (opt.alias) + this.boolean(opt.alias); + } + if (opt.array || opt.type === "array") { + this.array(key); + if (opt.alias) + this.array(opt.alias); + } + if (opt.number || opt.type === "number") { + this.number(key); + if (opt.alias) + this.number(opt.alias); + } + if (opt.string || opt.type === "string") { + this.string(key); + if (opt.alias) + this.string(opt.alias); + } + if (opt.count || opt.type === "count") { + this.count(key); + } + if (typeof opt.global === "boolean") { + this.global(key, opt.global); + } + if (opt.defaultDescription) { + __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = opt.defaultDescription; + } + if (opt.skipValidation) { + this.skipValidation(key); + } + const desc = opt.describe || opt.description || opt.desc; + const descriptions = __classPrivateFieldGet(this, _YargsInstance_usage, "f").getDescriptions(); + if (!Object.prototype.hasOwnProperty.call(descriptions, key) || typeof desc === "string") { + this.describe(key, desc); + } + if (opt.hidden) { + this.hide(key); + } + if (opt.requiresArg) { + this.requiresArg(key); + } + } + return this; + } + options(key, opt) { + return this.option(key, opt); + } + parse(args, shortCircuit, _parseFn) { + argsert("[string|array] [function|boolean|object] [function]", [args, shortCircuit, _parseFn], arguments.length); + this[kFreeze](); + if (typeof args === "undefined") { + args = __classPrivateFieldGet(this, _YargsInstance_processArgs, "f"); + } + if (typeof shortCircuit === "object") { + __classPrivateFieldSet(this, _YargsInstance_parseContext, shortCircuit, "f"); + shortCircuit = _parseFn; + } + if (typeof shortCircuit === "function") { + __classPrivateFieldSet(this, _YargsInstance_parseFn, shortCircuit, "f"); + shortCircuit = false; + } + if (!shortCircuit) + __classPrivateFieldSet(this, _YargsInstance_processArgs, args, "f"); + if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) + __classPrivateFieldSet(this, _YargsInstance_exitProcess, false, "f"); + const parsed = this[kRunYargsParserAndExecuteCommands](args, !!shortCircuit); + const tmpParsed = this.parsed; + __classPrivateFieldGet(this, _YargsInstance_completion, "f").setParsed(this.parsed); + if (isPromise(parsed)) { + return parsed.then((argv) => { + if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) + __classPrivateFieldGet(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), argv, __classPrivateFieldGet(this, _YargsInstance_output, "f")); + return argv; + }).catch((err) => { + if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) { + __classPrivateFieldGet(this, _YargsInstance_parseFn, "f")(err, this.parsed.argv, __classPrivateFieldGet(this, _YargsInstance_output, "f")); + } + throw err; + }).finally(() => { + this[kUnfreeze](); + this.parsed = tmpParsed; + }); + } else { + if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) + __classPrivateFieldGet(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), parsed, __classPrivateFieldGet(this, _YargsInstance_output, "f")); + this[kUnfreeze](); + this.parsed = tmpParsed; + } + return parsed; + } + parseAsync(args, shortCircuit, _parseFn) { + const maybePromise = this.parse(args, shortCircuit, _parseFn); + return !isPromise(maybePromise) ? Promise.resolve(maybePromise) : maybePromise; + } + parseSync(args, shortCircuit, _parseFn) { + const maybePromise = this.parse(args, shortCircuit, _parseFn); + if (isPromise(maybePromise)) { + throw new YError(".parseSync() must not be used with asynchronous builders, handlers, or middleware"); + } + return maybePromise; + } + parserConfiguration(config) { + argsert("", [config], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_parserConfig, config, "f"); + return this; + } + pkgConf(key, rootPath) { + argsert(" [string]", [key, rootPath], arguments.length); + let conf = null; + const obj = this[kPkgUp](rootPath || __classPrivateFieldGet(this, _YargsInstance_cwd, "f")); + if (obj[key] && typeof obj[key] === "object") { + conf = applyExtends(obj[key], rootPath || __classPrivateFieldGet(this, _YargsInstance_cwd, "f"), this[kGetParserConfiguration]()["deep-merge-config"] || false, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = (__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []).concat(conf); + } + return this; + } + positional(key, opts) { + argsert(" ", [key, opts], arguments.length); + const supportedOpts = [ + "default", + "defaultDescription", + "implies", + "normalize", + "choices", + "conflicts", + "coerce", + "type", + "describe", + "desc", + "description", + "alias" + ]; + opts = objFilter(opts, (k7, v2) => { + if (k7 === "type" && !["string", "number", "boolean"].includes(v2)) + return false; + return supportedOpts.includes(k7); + }); + const fullCommand = __classPrivateFieldGet(this, _YargsInstance_context, "f").fullCommands[__classPrivateFieldGet(this, _YargsInstance_context, "f").fullCommands.length - 1]; + const parseOptions = fullCommand ? __classPrivateFieldGet(this, _YargsInstance_command, "f").cmdToParseOptions(fullCommand) : { + array: [], + alias: {}, + default: {}, + demand: {} + }; + objectKeys(parseOptions).forEach((pk) => { + const parseOption = parseOptions[pk]; + if (Array.isArray(parseOption)) { + if (parseOption.indexOf(key) !== -1) + opts[pk] = true; + } else { + if (parseOption[key] && !(pk in opts)) + opts[pk] = parseOption[key]; + } + }); + this.group(key, __classPrivateFieldGet(this, _YargsInstance_usage, "f").getPositionalGroupName()); + return this.option(key, opts); + } + recommendCommands(recommend = true) { + argsert("[boolean]", [recommend], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_recommendCommands, recommend, "f"); + return this; + } + required(keys, max, msg) { + return this.demand(keys, max, msg); + } + require(keys, max, msg) { + return this.demand(keys, max, msg); + } + requiresArg(keys) { + argsert(" [number]", [keys], arguments.length); + if (typeof keys === "string" && __classPrivateFieldGet(this, _YargsInstance_options, "f").narg[keys]) { + return this; + } else { + this[kPopulateParserHintSingleValueDictionary](this.requiresArg.bind(this), "narg", keys, NaN); } return this; } - options(t7, e7) { - return this.option(t7, e7); - } - parse(t7, e7, s7) { - h6("[string|array] [function|boolean|object] [function]", [t7, e7, s7], arguments.length), this[Ct2](), void 0 === t7 && (t7 = v8(this, ht2, "f")), "object" == typeof e7 && (O2(this, rt2, e7, "f"), e7 = s7), "function" == typeof e7 && (O2(this, nt2, e7, "f"), e7 = false), e7 || O2(this, ht2, t7, "f"), v8(this, nt2, "f") && O2(this, T2, false, "f"); - const i7 = this[Jt2](t7, !!e7), n13 = this.parsed; - return v8(this, U2, "f").setParsed(this.parsed), f6(i7) ? i7.then(((t8) => (v8(this, nt2, "f") && v8(this, nt2, "f").call(this, v8(this, V2, "f"), t8, v8(this, tt2, "f")), t8))).catch(((t8) => { - throw v8(this, nt2, "f") && v8(this, nt2, "f")(t8, this.parsed.argv, v8(this, tt2, "f")), t8; - })).finally((() => { - this[Ht2](), this.parsed = n13; - })) : (v8(this, nt2, "f") && v8(this, nt2, "f").call(this, v8(this, V2, "f"), i7, v8(this, tt2, "f")), this[Ht2](), this.parsed = n13, i7); - } - parseAsync(t7, e7, s7) { - const i7 = this.parse(t7, e7, s7); - return f6(i7) ? i7 : Promise.resolve(i7); - } - parseSync(t7, s7, i7) { - const n13 = this.parse(t7, s7, i7); - if (f6(n13)) throw new e6(".parseSync() must not be used with asynchronous builders, handlers, or middleware"); - return n13; - } - parserConfiguration(t7) { - return h6("", [t7], arguments.length), O2(this, it2, t7, "f"), this; - } - pkgConf(t7, e7) { - h6(" [string]", [t7, e7], arguments.length); - let s7 = null; - const i7 = this[At2](e7 || v8(this, W2, "f")); - return i7[t7] && "object" == typeof i7[t7] && (s7 = n12(i7[t7], e7 || v8(this, W2, "f"), this[Mt2]()["deep-merge-config"] || false, v8(this, ct2, "f")), v8(this, et2, "f").configObjects = (v8(this, et2, "f").configObjects || []).concat(s7)), this; - } - positional(t7, e7) { - h6(" ", [t7, e7], arguments.length); - const s7 = ["default", "defaultDescription", "implies", "normalize", "choices", "conflicts", "coerce", "type", "describe", "desc", "description", "alias"]; - e7 = g6(e7, ((t8, e8) => !("type" === t8 && !["string", "number", "boolean"].includes(e8)) && s7.includes(t8))); - const i7 = v8(this, q7, "f").fullCommands[v8(this, q7, "f").fullCommands.length - 1], n13 = i7 ? v8(this, z2, "f").cmdToParseOptions(i7) : { array: [], alias: {}, default: {}, demand: {} }; - return p6(n13).forEach(((s8) => { - const i8 = n13[s8]; - Array.isArray(i8) ? -1 !== i8.indexOf(t7) && (e7[s8] = true) : i8[t7] && !(s8 in e7) && (e7[s8] = i8[t7]); - })), this.group(t7, v8(this, pt2, "f").getPositionalGroupName()), this.option(t7, e7); - } - recommendCommands(t7 = true) { - return h6("[boolean]", [t7], arguments.length), O2(this, lt2, t7, "f"), this; - } - required(t7, e7, s7) { - return this.demand(t7, e7, s7); - } - require(t7, e7, s7) { - return this.demand(t7, e7, s7); - } - requiresArg(t7) { - return h6(" [number]", [t7], arguments.length), "string" == typeof t7 && v8(this, et2, "f").narg[t7] || this[St2](this.requiresArg.bind(this), "narg", t7, NaN), this; - } - showCompletionScript(t7, e7) { - return h6("[string] [string]", [t7, e7], arguments.length), t7 = t7 || this.$0, v8(this, Q2, "f").log(v8(this, U2, "f").generateCompletionScript(t7, e7 || v8(this, F3, "f") || "completion")), this; - } - showHelp(t7) { - if (h6("[string|function]", [t7], arguments.length), O2(this, J2, true, "f"), !v8(this, pt2, "f").hasCachedHelpMessage()) { + showCompletionScript($0, cmd) { + argsert("[string] [string]", [$0, cmd], arguments.length); + $0 = $0 || this.$0; + __classPrivateFieldGet(this, _YargsInstance_logger, "f").log(__classPrivateFieldGet(this, _YargsInstance_completion, "f").generateCompletionScript($0, cmd || __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") || "completion")); + return this; + } + showHelp(level) { + argsert("[string|function]", [level], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); + if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) { if (!this.parsed) { - const e8 = this[Jt2](v8(this, ht2, "f"), void 0, void 0, 0, true); - if (f6(e8)) return e8.then((() => { - v8(this, pt2, "f").showHelp(t7); - })), this; + const parse3 = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true); + if (isPromise(parse3)) { + parse3.then(() => { + __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level); + }); + return this; + } + } + const builderResponse = __classPrivateFieldGet(this, _YargsInstance_command, "f").runDefaultBuilderOn(this); + if (isPromise(builderResponse)) { + builderResponse.then(() => { + __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level); + }); + return this; } - const e7 = v8(this, z2, "f").runDefaultBuilderOn(this); - if (f6(e7)) return e7.then((() => { - v8(this, pt2, "f").showHelp(t7); - })), this; } - return v8(this, pt2, "f").showHelp(t7), this; + __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level); + return this; } - scriptName(t7) { - return this.customScriptName = true, this.$0 = t7, this; + scriptName(scriptName) { + this.customScriptName = true; + this.$0 = scriptName; + return this; } - showHelpOnFail(t7, e7) { - return h6("[boolean|string] [string]", [t7, e7], arguments.length), v8(this, pt2, "f").showHelpOnFail(t7, e7), this; + showHelpOnFail(enabled2, message) { + argsert("[boolean|string] [string]", [enabled2, message], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelpOnFail(enabled2, message); + return this; } - showVersion(t7) { - return h6("[string|function]", [t7], arguments.length), v8(this, pt2, "f").showVersion(t7), this; + showVersion(level) { + argsert("[string|function]", [level], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_usage, "f").showVersion(level); + return this; } - skipValidation(t7) { - return h6("", [t7], arguments.length), this[Pt2]("skipValidation", t7), this; + skipValidation(keys) { + argsert("", [keys], arguments.length); + this[kPopulateParserHintArray]("skipValidation", keys); + return this; } - strict(t7) { - return h6("[boolean]", [t7], arguments.length), O2(this, ft2, false !== t7, "f"), this; + strict(enabled2) { + argsert("[boolean]", [enabled2], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_strict, enabled2 !== false, "f"); + return this; } - strictCommands(t7) { - return h6("[boolean]", [t7], arguments.length), O2(this, dt2, false !== t7, "f"), this; + strictCommands(enabled2) { + argsert("[boolean]", [enabled2], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_strictCommands, enabled2 !== false, "f"); + return this; } - strictOptions(t7) { - return h6("[boolean]", [t7], arguments.length), O2(this, ut2, false !== t7, "f"), this; + strictOptions(enabled2) { + argsert("[boolean]", [enabled2], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_strictOptions, enabled2 !== false, "f"); + return this; } - string(t7) { - return h6("", [t7], arguments.length), this[Pt2]("string", t7), this[Qt2](t7), this; + string(keys) { + argsert("", [keys], arguments.length); + this[kPopulateParserHintArray]("string", keys); + this[kTrackManuallySetKeys](keys); + return this; } terminalWidth() { - return h6([], 0), v8(this, ct2, "f").process.stdColumns; + argsert([], 0); + return __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.stdColumns; } - updateLocale(t7) { - return this.updateStrings(t7); + updateLocale(obj) { + return this.updateStrings(obj); } - updateStrings(t7) { - return h6("", [t7], arguments.length), O2(this, G3, false, "f"), v8(this, ct2, "f").y18n.updateLocale(t7), this; + updateStrings(obj) { + argsert("", [obj], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_detectLocale, false, "f"); + __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.updateLocale(obj); + return this; } - usage(t7, s7, i7, n13) { - if (h6(" [string|boolean] [function|object] [function]", [t7, s7, i7, n13], arguments.length), void 0 !== s7) { - if (d6(t7, null, v8(this, ct2, "f")), (t7 || "").match(/^\$0( |$)/)) return this.command(t7, s7, i7, n13); - throw new e6(".usage() description must start with $0 if being used as alias for .command()"); + usage(msg, description, builder, handler2) { + argsert(" [string|boolean] [function|object] [function]", [msg, description, builder, handler2], arguments.length); + if (description !== void 0) { + assertNotStrictEqual(msg, null, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + if ((msg || "").match(/^\$0( |$)/)) { + return this.command(msg, description, builder, handler2); + } else { + throw new YError(".usage() description must start with $0 if being used as alias for .command()"); + } + } else { + __classPrivateFieldGet(this, _YargsInstance_usage, "f").usage(msg); + return this; } - return v8(this, pt2, "f").usage(t7), this; } - usageConfiguration(t7) { - return h6("", [t7], arguments.length), O2(this, gt2, t7, "f"), this; + usageConfiguration(config) { + argsert("", [config], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_usageConfig, config, "f"); + return this; } - version(t7, e7, s7) { - const i7 = "version"; - if (h6("[boolean|string] [string] [string]", [t7, e7, s7], arguments.length), v8(this, mt2, "f") && (this[Ot2](v8(this, mt2, "f")), v8(this, pt2, "f").version(void 0), O2(this, mt2, null, "f")), 0 === arguments.length) s7 = this[xt2](), t7 = i7; - else if (1 === arguments.length) { - if (false === t7) return this; - s7 = t7, t7 = i7; - } else 2 === arguments.length && (s7 = e7, e7 = void 0); - return O2(this, mt2, "string" == typeof t7 ? t7 : i7, "f"), e7 = e7 || v8(this, pt2, "f").deferY18nLookup("Show version number"), v8(this, pt2, "f").version(s7 || void 0), this.boolean(v8(this, mt2, "f")), this.describe(v8(this, mt2, "f"), e7), this; + version(opt, msg, ver) { + const defaultVersionOpt = "version"; + argsert("[boolean|string] [string] [string]", [opt, msg, ver], arguments.length); + if (__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f")) { + this[kDeleteFromParserHintObject](__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f")); + __classPrivateFieldGet(this, _YargsInstance_usage, "f").version(void 0); + __classPrivateFieldSet(this, _YargsInstance_versionOpt, null, "f"); + } + if (arguments.length === 0) { + ver = this[kGuessVersion](); + opt = defaultVersionOpt; + } else if (arguments.length === 1) { + if (opt === false) { + return this; + } + ver = opt; + opt = defaultVersionOpt; + } else if (arguments.length === 2) { + ver = msg; + msg = void 0; + } + __classPrivateFieldSet(this, _YargsInstance_versionOpt, typeof opt === "string" ? opt : defaultVersionOpt, "f"); + msg = msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup("Show version number"); + __classPrivateFieldGet(this, _YargsInstance_usage, "f").version(ver || void 0); + this.boolean(__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f")); + this.describe(__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f"), msg); + return this; } - wrap(t7) { - return h6("", [t7], arguments.length), v8(this, pt2, "f").wrap(t7), this; + wrap(cols) { + argsert("", [cols], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_usage, "f").wrap(cols); + return this; } - [(z2 = /* @__PURE__ */ new WeakMap(), W2 = /* @__PURE__ */ new WeakMap(), q7 = /* @__PURE__ */ new WeakMap(), U2 = /* @__PURE__ */ new WeakMap(), F3 = /* @__PURE__ */ new WeakMap(), L2 = /* @__PURE__ */ new WeakMap(), V2 = /* @__PURE__ */ new WeakMap(), G3 = /* @__PURE__ */ new WeakMap(), R2 = /* @__PURE__ */ new WeakMap(), T2 = /* @__PURE__ */ new WeakMap(), B3 = /* @__PURE__ */ new WeakMap(), Y2 = /* @__PURE__ */ new WeakMap(), K2 = /* @__PURE__ */ new WeakMap(), J2 = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), X2 = /* @__PURE__ */ new WeakMap(), Q2 = /* @__PURE__ */ new WeakMap(), tt2 = /* @__PURE__ */ new WeakMap(), et2 = /* @__PURE__ */ new WeakMap(), st2 = /* @__PURE__ */ new WeakMap(), it2 = /* @__PURE__ */ new WeakMap(), nt2 = /* @__PURE__ */ new WeakMap(), rt2 = /* @__PURE__ */ new WeakMap(), ot2 = /* @__PURE__ */ new WeakMap(), at2 = /* @__PURE__ */ new WeakMap(), ht2 = /* @__PURE__ */ new WeakMap(), lt2 = /* @__PURE__ */ new WeakMap(), ct2 = /* @__PURE__ */ new WeakMap(), ft2 = /* @__PURE__ */ new WeakMap(), dt2 = /* @__PURE__ */ new WeakMap(), ut2 = /* @__PURE__ */ new WeakMap(), pt2 = /* @__PURE__ */ new WeakMap(), gt2 = /* @__PURE__ */ new WeakMap(), mt2 = /* @__PURE__ */ new WeakMap(), yt2 = /* @__PURE__ */ new WeakMap(), bt2)](t7) { - if (!t7._ || !t7["--"]) return t7; - t7._.push.apply(t7._, t7["--"]); + [(_YargsInstance_command = /* @__PURE__ */ new WeakMap(), _YargsInstance_cwd = /* @__PURE__ */ new WeakMap(), _YargsInstance_context = /* @__PURE__ */ new WeakMap(), _YargsInstance_completion = /* @__PURE__ */ new WeakMap(), _YargsInstance_completionCommand = /* @__PURE__ */ new WeakMap(), _YargsInstance_defaultShowHiddenOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_exitError = /* @__PURE__ */ new WeakMap(), _YargsInstance_detectLocale = /* @__PURE__ */ new WeakMap(), _YargsInstance_emittedWarnings = /* @__PURE__ */ new WeakMap(), _YargsInstance_exitProcess = /* @__PURE__ */ new WeakMap(), _YargsInstance_frozens = /* @__PURE__ */ new WeakMap(), _YargsInstance_globalMiddleware = /* @__PURE__ */ new WeakMap(), _YargsInstance_groups = /* @__PURE__ */ new WeakMap(), _YargsInstance_hasOutput = /* @__PURE__ */ new WeakMap(), _YargsInstance_helpOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_isGlobalContext = /* @__PURE__ */ new WeakMap(), _YargsInstance_logger = /* @__PURE__ */ new WeakMap(), _YargsInstance_output = /* @__PURE__ */ new WeakMap(), _YargsInstance_options = /* @__PURE__ */ new WeakMap(), _YargsInstance_parentRequire = /* @__PURE__ */ new WeakMap(), _YargsInstance_parserConfig = /* @__PURE__ */ new WeakMap(), _YargsInstance_parseFn = /* @__PURE__ */ new WeakMap(), _YargsInstance_parseContext = /* @__PURE__ */ new WeakMap(), _YargsInstance_pkgs = /* @__PURE__ */ new WeakMap(), _YargsInstance_preservedGroups = /* @__PURE__ */ new WeakMap(), _YargsInstance_processArgs = /* @__PURE__ */ new WeakMap(), _YargsInstance_recommendCommands = /* @__PURE__ */ new WeakMap(), _YargsInstance_shim = /* @__PURE__ */ new WeakMap(), _YargsInstance_strict = /* @__PURE__ */ new WeakMap(), _YargsInstance_strictCommands = /* @__PURE__ */ new WeakMap(), _YargsInstance_strictOptions = /* @__PURE__ */ new WeakMap(), _YargsInstance_usage = /* @__PURE__ */ new WeakMap(), _YargsInstance_usageConfig = /* @__PURE__ */ new WeakMap(), _YargsInstance_versionOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_validation = /* @__PURE__ */ new WeakMap(), kCopyDoubleDash)](argv) { + if (!argv._ || !argv["--"]) + return argv; + argv._.push.apply(argv._, argv["--"]); try { - delete t7["--"]; - } catch (t8) { + delete argv["--"]; + } catch (_err) { } - return t7; + return argv; } - [vt2]() { - return { log: (...t7) => { - this[Rt2]() || console.log(...t7), O2(this, J2, true, "f"), v8(this, tt2, "f").length && O2(this, tt2, v8(this, tt2, "f") + "\n", "f"), O2(this, tt2, v8(this, tt2, "f") + t7.join(" "), "f"); - }, error: (...t7) => { - this[Rt2]() || console.error(...t7), O2(this, J2, true, "f"), v8(this, tt2, "f").length && O2(this, tt2, v8(this, tt2, "f") + "\n", "f"), O2(this, tt2, v8(this, tt2, "f") + t7.join(" "), "f"); - } }; + [kCreateLogger]() { + return { + log: (...args) => { + if (!this[kHasParseCallback]()) + console.log(...args); + __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); + if (__classPrivateFieldGet(this, _YargsInstance_output, "f").length) + __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + "\n", "f"); + __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + args.join(" "), "f"); + }, + error: (...args) => { + if (!this[kHasParseCallback]()) + console.error(...args); + __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); + if (__classPrivateFieldGet(this, _YargsInstance_output, "f").length) + __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + "\n", "f"); + __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + args.join(" "), "f"); + } + }; } - [Ot2](t7) { - p6(v8(this, et2, "f")).forEach(((e7) => { - if ("configObjects" === e7) return; - const s7 = v8(this, et2, "f")[e7]; - Array.isArray(s7) ? s7.includes(t7) && s7.splice(s7.indexOf(t7), 1) : "object" == typeof s7 && delete s7[t7]; - })), delete v8(this, pt2, "f").getDescriptions()[t7]; - } - [wt2](t7, e7, s7) { - v8(this, R2, "f")[s7] || (v8(this, ct2, "f").process.emitWarning(t7, e7), v8(this, R2, "f")[s7] = true); - } - [Ct2]() { - v8(this, B3, "f").push({ options: v8(this, et2, "f"), configObjects: v8(this, et2, "f").configObjects.slice(0), exitProcess: v8(this, T2, "f"), groups: v8(this, K2, "f"), strict: v8(this, ft2, "f"), strictCommands: v8(this, dt2, "f"), strictOptions: v8(this, ut2, "f"), completionCommand: v8(this, F3, "f"), output: v8(this, tt2, "f"), exitError: v8(this, V2, "f"), hasOutput: v8(this, J2, "f"), parsed: this.parsed, parseFn: v8(this, nt2, "f"), parseContext: v8(this, rt2, "f") }), v8(this, pt2, "f").freeze(), v8(this, yt2, "f").freeze(), v8(this, z2, "f").freeze(), v8(this, Y2, "f").freeze(); - } - [jt2]() { - let t7, e7 = ""; - return t7 = /\b(node|iojs|electron)(\.exe)?$/.test(v8(this, ct2, "f").process.argv()[0]) ? v8(this, ct2, "f").process.argv().slice(1, 2) : v8(this, ct2, "f").process.argv().slice(0, 1), e7 = t7.map(((t8) => { - const e8 = this[Yt2](v8(this, W2, "f"), t8); - return t8.match(/^(\/|([a-zA-Z]:)?\\)/) && e8.length < t8.length ? e8 : t8; - })).join(" ").trim(), v8(this, ct2, "f").getEnv("_") && v8(this, ct2, "f").getProcessArgvBin() === v8(this, ct2, "f").getEnv("_") && (e7 = v8(this, ct2, "f").getEnv("_").replace(`${v8(this, ct2, "f").path.dirname(v8(this, ct2, "f").process.execPath())}/`, "")), e7; - } - [Mt2]() { - return v8(this, it2, "f"); - } - [_t3]() { - return v8(this, gt2, "f"); - } - [kt2]() { - if (!v8(this, G3, "f")) return; - const t7 = v8(this, ct2, "f").getEnv("LC_ALL") || v8(this, ct2, "f").getEnv("LC_MESSAGES") || v8(this, ct2, "f").getEnv("LANG") || v8(this, ct2, "f").getEnv("LANGUAGE") || "en_US"; - this.locale(t7.replace(/[.:].*/, "")); - } - [xt2]() { - return this[At2]().version || "unknown"; - } - [Et2](t7) { - const e7 = t7["--"] ? t7["--"] : t7._; - for (let t8, s7 = 0; void 0 !== (t8 = e7[s7]); s7++) v8(this, ct2, "f").Parser.looksLikeNumber(t8) && Number.isSafeInteger(Math.floor(parseFloat(`${t8}`))) && (e7[s7] = Number(t8)); - return t7; - } - [At2](t7) { - const e7 = t7 || "*"; - if (v8(this, ot2, "f")[e7]) return v8(this, ot2, "f")[e7]; - let s7 = {}; - try { - let e8 = t7 || v8(this, ct2, "f").mainFilename; - !t7 && v8(this, ct2, "f").path.extname(e8) && (e8 = v8(this, ct2, "f").path.dirname(e8)); - const i7 = v8(this, ct2, "f").findUp(e8, ((t8, e9) => e9.includes("package.json") ? "package.json" : void 0)); - d6(i7, void 0, v8(this, ct2, "f")), s7 = JSON.parse(v8(this, ct2, "f").readFileSync(i7, "utf8")); - } catch (t8) { + [kDeleteFromParserHintObject](optionKey) { + objectKeys(__classPrivateFieldGet(this, _YargsInstance_options, "f")).forEach((hintKey) => { + if (/* @__PURE__ */ ((key) => key === "configObjects")(hintKey)) + return; + const hint = __classPrivateFieldGet(this, _YargsInstance_options, "f")[hintKey]; + if (Array.isArray(hint)) { + if (hint.includes(optionKey)) + hint.splice(hint.indexOf(optionKey), 1); + } else if (typeof hint === "object") { + delete hint[optionKey]; + } + }); + delete __classPrivateFieldGet(this, _YargsInstance_usage, "f").getDescriptions()[optionKey]; + } + [kEmitWarning](warning3, type, deduplicationId) { + if (!__classPrivateFieldGet(this, _YargsInstance_emittedWarnings, "f")[deduplicationId]) { + __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.emitWarning(warning3, type); + __classPrivateFieldGet(this, _YargsInstance_emittedWarnings, "f")[deduplicationId] = true; + } + } + [kFreeze]() { + __classPrivateFieldGet(this, _YargsInstance_frozens, "f").push({ + options: __classPrivateFieldGet(this, _YargsInstance_options, "f"), + configObjects: __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects.slice(0), + exitProcess: __classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"), + groups: __classPrivateFieldGet(this, _YargsInstance_groups, "f"), + strict: __classPrivateFieldGet(this, _YargsInstance_strict, "f"), + strictCommands: __classPrivateFieldGet(this, _YargsInstance_strictCommands, "f"), + strictOptions: __classPrivateFieldGet(this, _YargsInstance_strictOptions, "f"), + completionCommand: __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f"), + output: __classPrivateFieldGet(this, _YargsInstance_output, "f"), + exitError: __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), + hasOutput: __classPrivateFieldGet(this, _YargsInstance_hasOutput, "f"), + parsed: this.parsed, + parseFn: __classPrivateFieldGet(this, _YargsInstance_parseFn, "f"), + parseContext: __classPrivateFieldGet(this, _YargsInstance_parseContext, "f") + }); + __classPrivateFieldGet(this, _YargsInstance_usage, "f").freeze(); + __classPrivateFieldGet(this, _YargsInstance_validation, "f").freeze(); + __classPrivateFieldGet(this, _YargsInstance_command, "f").freeze(); + __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").freeze(); + } + [kGetDollarZero]() { + let $0 = ""; + let default$0; + if (/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv()[0])) { + default$0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv().slice(1, 2); + } else { + default$0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv().slice(0, 1); } - return v8(this, ot2, "f")[e7] = s7 || {}, v8(this, ot2, "f")[e7]; - } - [Pt2](t7, e7) { - (e7 = [].concat(e7)).forEach(((e8) => { - e8 = this[Dt2](e8), v8(this, et2, "f")[t7].push(e8); - })); + $0 = default$0.map((x2) => { + const b6 = this[kRebase](__classPrivateFieldGet(this, _YargsInstance_cwd, "f"), x2); + return x2.match(/^(\/|([a-zA-Z]:)?\\)/) && b6.length < x2.length ? b6 : x2; + }).join(" ").trim(); + if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("_") && __classPrivateFieldGet(this, _YargsInstance_shim, "f").getProcessArgvBin() === __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("_")) { + $0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("_").replace(`${__classPrivateFieldGet(this, _YargsInstance_shim, "f").path.dirname(__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.execPath())}/`, ""); + } + return $0; } - [St2](t7, e7, s7, i7) { - this[It2](t7, e7, s7, i7, ((t8, e8, s8) => { - v8(this, et2, "f")[t8][e8] = s8; - })); + [kGetParserConfiguration]() { + return __classPrivateFieldGet(this, _YargsInstance_parserConfig, "f"); } - [$t](t7, e7, s7, i7) { - this[It2](t7, e7, s7, i7, ((t8, e8, s8) => { - v8(this, et2, "f")[t8][e8] = (v8(this, et2, "f")[t8][e8] || []).concat(s8); - })); + [kGetUsageConfiguration]() { + return __classPrivateFieldGet(this, _YargsInstance_usageConfig, "f"); } - [It2](t7, e7, s7, i7, n13) { - if (Array.isArray(s7)) s7.forEach(((e8) => { - t7(e8, i7); - })); - else if (/* @__PURE__ */ ((t8) => "object" == typeof t8)(s7)) for (const e8 of p6(s7)) t7(e8, s7[e8]); - else n13(e7, this[Dt2](s7), i7); - } - [Dt2](t7) { - return "__proto__" === t7 ? "___proto___" : t7; - } - [Nt2](t7, e7) { - return this[St2](this[Nt2].bind(this), "key", t7, e7), this; - } - [Ht2]() { - var t7, e7, s7, i7, n13, r7, o7, a7, h7, l7, c7, f7; - const u7 = v8(this, B3, "f").pop(); - let p7; - d6(u7, void 0, v8(this, ct2, "f")), t7 = this, e7 = this, s7 = this, i7 = this, n13 = this, r7 = this, o7 = this, a7 = this, h7 = this, l7 = this, c7 = this, f7 = this, { options: { set value(e8) { - O2(t7, et2, e8, "f"); - } }.value, configObjects: p7, exitProcess: { set value(t8) { - O2(e7, T2, t8, "f"); - } }.value, groups: { set value(t8) { - O2(s7, K2, t8, "f"); - } }.value, output: { set value(t8) { - O2(i7, tt2, t8, "f"); - } }.value, exitError: { set value(t8) { - O2(n13, V2, t8, "f"); - } }.value, hasOutput: { set value(t8) { - O2(r7, J2, t8, "f"); - } }.value, parsed: this.parsed, strict: { set value(t8) { - O2(o7, ft2, t8, "f"); - } }.value, strictCommands: { set value(t8) { - O2(a7, dt2, t8, "f"); - } }.value, strictOptions: { set value(t8) { - O2(h7, ut2, t8, "f"); - } }.value, completionCommand: { set value(t8) { - O2(l7, F3, t8, "f"); - } }.value, parseFn: { set value(t8) { - O2(c7, nt2, t8, "f"); - } }.value, parseContext: { set value(t8) { - O2(f7, rt2, t8, "f"); - } }.value } = u7, v8(this, et2, "f").configObjects = p7, v8(this, pt2, "f").unfreeze(), v8(this, yt2, "f").unfreeze(), v8(this, z2, "f").unfreeze(), v8(this, Y2, "f").unfreeze(); - } - [zt2](t7, e7) { - return j7(e7, ((e8) => (t7(e8), e8))); + [kGuessLocale]() { + if (!__classPrivateFieldGet(this, _YargsInstance_detectLocale, "f")) + return; + const locale = __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("LC_ALL") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("LC_MESSAGES") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("LANG") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("LANGUAGE") || "en_US"; + this.locale(locale.replace(/[.:].*/, "")); } - getInternalMethods() { - return { getCommandInstance: this[Wt2].bind(this), getContext: this[qt2].bind(this), getHasOutput: this[Ut2].bind(this), getLoggerInstance: this[Ft2].bind(this), getParseContext: this[Lt2].bind(this), getParserConfiguration: this[Mt2].bind(this), getUsageConfiguration: this[_t3].bind(this), getUsageInstance: this[Vt2].bind(this), getValidationInstance: this[Gt2].bind(this), hasParseCallback: this[Rt2].bind(this), isGlobalContext: this[Tt2].bind(this), postProcess: this[Bt2].bind(this), reset: this[Kt2].bind(this), runValidation: this[Zt2].bind(this), runYargsParserAndExecuteCommands: this[Jt2].bind(this), setHasOutput: this[Xt2].bind(this) }; + [kGuessVersion]() { + const obj = this[kPkgUp](); + return obj.version || "unknown"; } - [Wt2]() { - return v8(this, z2, "f"); + [kParsePositionalNumbers](argv) { + const args = argv["--"] ? argv["--"] : argv._; + for (let i6 = 0, arg; (arg = args[i6]) !== void 0; i6++) { + if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.looksLikeNumber(arg) && Number.isSafeInteger(Math.floor(parseFloat(`${arg}`)))) { + args[i6] = Number(arg); + } + } + return argv; } - [qt2]() { - return v8(this, q7, "f"); + [kPkgUp](rootPath) { + const npath = rootPath || "*"; + if (__classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath]) + return __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath]; + let obj = {}; + try { + let startDir = rootPath || __classPrivateFieldGet(this, _YargsInstance_shim, "f").mainFilename; + if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").path.extname(startDir)) { + startDir = __classPrivateFieldGet(this, _YargsInstance_shim, "f").path.dirname(startDir); + } + const pkgJsonPath = __classPrivateFieldGet(this, _YargsInstance_shim, "f").findUp(startDir, (dir2, names) => { + if (names.includes("package.json")) { + return "package.json"; + } else { + return void 0; + } + }); + assertNotStrictEqual(pkgJsonPath, void 0, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + obj = JSON.parse(__classPrivateFieldGet(this, _YargsInstance_shim, "f").readFileSync(pkgJsonPath, "utf8")); + } catch (_noop) { + } + __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath] = obj || {}; + return __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath]; } - [Ut2]() { - return v8(this, J2, "f"); + [kPopulateParserHintArray](type, keys) { + keys = [].concat(keys); + keys.forEach((key) => { + key = this[kSanitizeKey](key); + __classPrivateFieldGet(this, _YargsInstance_options, "f")[type].push(key); + }); } - [Ft2]() { - return v8(this, Q2, "f"); + [kPopulateParserHintSingleValueDictionary](builder, type, key, value) { + this[kPopulateParserHintDictionary](builder, type, key, value, (type2, key2, value2) => { + __classPrivateFieldGet(this, _YargsInstance_options, "f")[type2][key2] = value2; + }); } - [Lt2]() { - return v8(this, rt2, "f") || {}; + [kPopulateParserHintArrayDictionary](builder, type, key, value) { + this[kPopulateParserHintDictionary](builder, type, key, value, (type2, key2, value2) => { + __classPrivateFieldGet(this, _YargsInstance_options, "f")[type2][key2] = (__classPrivateFieldGet(this, _YargsInstance_options, "f")[type2][key2] || []).concat(value2); + }); } - [Vt2]() { - return v8(this, pt2, "f"); + [kPopulateParserHintDictionary](builder, type, key, value, singleKeyHandler) { + if (Array.isArray(key)) { + key.forEach((k7) => { + builder(k7, value); + }); + } else if (/* @__PURE__ */ ((key2) => typeof key2 === "object")(key)) { + for (const k7 of objectKeys(key)) { + builder(k7, key[k7]); + } + } else { + singleKeyHandler(type, this[kSanitizeKey](key), value); + } } - [Gt2]() { - return v8(this, yt2, "f"); + [kSanitizeKey](key) { + if (key === "__proto__") + return "___proto___"; + return key; } - [Rt2]() { - return !!v8(this, nt2, "f"); + [kSetKey](key, set) { + this[kPopulateParserHintSingleValueDictionary](this[kSetKey].bind(this), "key", key, set); + return this; } - [Tt2]() { - return v8(this, X2, "f"); + [kUnfreeze]() { + var _a6, _b3, _c7, _d2, _e7, _f2, _g2, _h5, _j2, _k2, _l2, _m5; + const frozen = __classPrivateFieldGet(this, _YargsInstance_frozens, "f").pop(); + assertNotStrictEqual(frozen, void 0, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + let configObjects; + _a6 = this, _b3 = this, _c7 = this, _d2 = this, _e7 = this, _f2 = this, _g2 = this, _h5 = this, _j2 = this, _k2 = this, _l2 = this, _m5 = this, { + options: { set value(_o2) { + __classPrivateFieldSet(_a6, _YargsInstance_options, _o2, "f"); + } }.value, + configObjects, + exitProcess: { set value(_o2) { + __classPrivateFieldSet(_b3, _YargsInstance_exitProcess, _o2, "f"); + } }.value, + groups: { set value(_o2) { + __classPrivateFieldSet(_c7, _YargsInstance_groups, _o2, "f"); + } }.value, + output: { set value(_o2) { + __classPrivateFieldSet(_d2, _YargsInstance_output, _o2, "f"); + } }.value, + exitError: { set value(_o2) { + __classPrivateFieldSet(_e7, _YargsInstance_exitError, _o2, "f"); + } }.value, + hasOutput: { set value(_o2) { + __classPrivateFieldSet(_f2, _YargsInstance_hasOutput, _o2, "f"); + } }.value, + parsed: this.parsed, + strict: { set value(_o2) { + __classPrivateFieldSet(_g2, _YargsInstance_strict, _o2, "f"); + } }.value, + strictCommands: { set value(_o2) { + __classPrivateFieldSet(_h5, _YargsInstance_strictCommands, _o2, "f"); + } }.value, + strictOptions: { set value(_o2) { + __classPrivateFieldSet(_j2, _YargsInstance_strictOptions, _o2, "f"); + } }.value, + completionCommand: { set value(_o2) { + __classPrivateFieldSet(_k2, _YargsInstance_completionCommand, _o2, "f"); + } }.value, + parseFn: { set value(_o2) { + __classPrivateFieldSet(_l2, _YargsInstance_parseFn, _o2, "f"); + } }.value, + parseContext: { set value(_o2) { + __classPrivateFieldSet(_m5, _YargsInstance_parseContext, _o2, "f"); + } }.value + } = frozen; + __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = configObjects; + __classPrivateFieldGet(this, _YargsInstance_usage, "f").unfreeze(); + __classPrivateFieldGet(this, _YargsInstance_validation, "f").unfreeze(); + __classPrivateFieldGet(this, _YargsInstance_command, "f").unfreeze(); + __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").unfreeze(); + } + [kValidateAsync](validation2, argv) { + return maybeAsyncResult(argv, (result) => { + validation2(result); + return result; + }); } - [Bt2](t7, e7, s7, i7) { - if (s7) return t7; - if (f6(t7)) return t7; - e7 || (t7 = this[bt2](t7)); - return (this[Mt2]()["parse-positional-numbers"] || void 0 === this[Mt2]()["parse-positional-numbers"]) && (t7 = this[Et2](t7)), i7 && (t7 = C3(t7, this, v8(this, Y2, "f").getMiddleware(), false)), t7; + getInternalMethods() { + return { + getCommandInstance: this[kGetCommandInstance].bind(this), + getContext: this[kGetContext].bind(this), + getHasOutput: this[kGetHasOutput].bind(this), + getLoggerInstance: this[kGetLoggerInstance].bind(this), + getParseContext: this[kGetParseContext].bind(this), + getParserConfiguration: this[kGetParserConfiguration].bind(this), + getUsageConfiguration: this[kGetUsageConfiguration].bind(this), + getUsageInstance: this[kGetUsageInstance].bind(this), + getValidationInstance: this[kGetValidationInstance].bind(this), + hasParseCallback: this[kHasParseCallback].bind(this), + isGlobalContext: this[kIsGlobalContext].bind(this), + postProcess: this[kPostProcess].bind(this), + reset: this[kReset].bind(this), + runValidation: this[kRunValidation].bind(this), + runYargsParserAndExecuteCommands: this[kRunYargsParserAndExecuteCommands].bind(this), + setHasOutput: this[kSetHasOutput].bind(this) + }; + } + [kGetCommandInstance]() { + return __classPrivateFieldGet(this, _YargsInstance_command, "f"); + } + [kGetContext]() { + return __classPrivateFieldGet(this, _YargsInstance_context, "f"); + } + [kGetHasOutput]() { + return __classPrivateFieldGet(this, _YargsInstance_hasOutput, "f"); + } + [kGetLoggerInstance]() { + return __classPrivateFieldGet(this, _YargsInstance_logger, "f"); + } + [kGetParseContext]() { + return __classPrivateFieldGet(this, _YargsInstance_parseContext, "f") || {}; + } + [kGetUsageInstance]() { + return __classPrivateFieldGet(this, _YargsInstance_usage, "f"); + } + [kGetValidationInstance]() { + return __classPrivateFieldGet(this, _YargsInstance_validation, "f"); + } + [kHasParseCallback]() { + return !!__classPrivateFieldGet(this, _YargsInstance_parseFn, "f"); + } + [kIsGlobalContext]() { + return __classPrivateFieldGet(this, _YargsInstance_isGlobalContext, "f"); + } + [kPostProcess](argv, populateDoubleDash, calledFromCommand, runGlobalMiddleware) { + if (calledFromCommand) + return argv; + if (isPromise(argv)) + return argv; + if (!populateDoubleDash) { + argv = this[kCopyDoubleDash](argv); + } + const parsePositionalNumbers = this[kGetParserConfiguration]()["parse-positional-numbers"] || this[kGetParserConfiguration]()["parse-positional-numbers"] === void 0; + if (parsePositionalNumbers) { + argv = this[kParsePositionalNumbers](argv); + } + if (runGlobalMiddleware) { + argv = applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false); + } + return argv; + } + [kReset](aliases = {}) { + __classPrivateFieldSet(this, _YargsInstance_options, __classPrivateFieldGet(this, _YargsInstance_options, "f") || {}, "f"); + const tmpOptions = {}; + tmpOptions.local = __classPrivateFieldGet(this, _YargsInstance_options, "f").local || []; + tmpOptions.configObjects = __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []; + const localLookup = {}; + tmpOptions.local.forEach((l3) => { + localLookup[l3] = true; + (aliases[l3] || []).forEach((a6) => { + localLookup[a6] = true; + }); + }); + Object.assign(__classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f"), Object.keys(__classPrivateFieldGet(this, _YargsInstance_groups, "f")).reduce((acc, groupName) => { + const keys = __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName].filter((key) => !(key in localLookup)); + if (keys.length > 0) { + acc[groupName] = keys; + } + return acc; + }, {})); + __classPrivateFieldSet(this, _YargsInstance_groups, {}, "f"); + const arrayOptions = [ + "array", + "boolean", + "string", + "skipValidation", + "count", + "normalize", + "number", + "hiddenOptions" + ]; + const objectOptions = [ + "narg", + "key", + "alias", + "default", + "defaultDescription", + "config", + "choices", + "demandedOptions", + "demandedCommands", + "deprecatedOptions" + ]; + arrayOptions.forEach((k7) => { + tmpOptions[k7] = (__classPrivateFieldGet(this, _YargsInstance_options, "f")[k7] || []).filter((k8) => !localLookup[k8]); + }); + objectOptions.forEach((k7) => { + tmpOptions[k7] = objFilter(__classPrivateFieldGet(this, _YargsInstance_options, "f")[k7], (k8) => !localLookup[k8]); + }); + tmpOptions.envPrefix = __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix; + __classPrivateFieldSet(this, _YargsInstance_options, tmpOptions, "f"); + __classPrivateFieldSet(this, _YargsInstance_usage, __classPrivateFieldGet(this, _YargsInstance_usage, "f") ? __classPrivateFieldGet(this, _YargsInstance_usage, "f").reset(localLookup) : usage(this, __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f"); + __classPrivateFieldSet(this, _YargsInstance_validation, __classPrivateFieldGet(this, _YargsInstance_validation, "f") ? __classPrivateFieldGet(this, _YargsInstance_validation, "f").reset(localLookup) : validation(this, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f"); + __classPrivateFieldSet(this, _YargsInstance_command, __classPrivateFieldGet(this, _YargsInstance_command, "f") ? __classPrivateFieldGet(this, _YargsInstance_command, "f").reset() : command(__classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_validation, "f"), __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f"); + if (!__classPrivateFieldGet(this, _YargsInstance_completion, "f")) + __classPrivateFieldSet(this, _YargsInstance_completion, completion(this, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_command, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f"); + __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").reset(); + __classPrivateFieldSet(this, _YargsInstance_completionCommand, null, "f"); + __classPrivateFieldSet(this, _YargsInstance_output, "", "f"); + __classPrivateFieldSet(this, _YargsInstance_exitError, null, "f"); + __classPrivateFieldSet(this, _YargsInstance_hasOutput, false, "f"); + this.parsed = false; + return this; } - [Kt2](t7 = {}) { - O2(this, et2, v8(this, et2, "f") || {}, "f"); - const e7 = {}; - e7.local = v8(this, et2, "f").local || [], e7.configObjects = v8(this, et2, "f").configObjects || []; - const s7 = {}; - e7.local.forEach(((e8) => { - s7[e8] = true, (t7[e8] || []).forEach(((t8) => { - s7[t8] = true; - })); - })), Object.assign(v8(this, at2, "f"), Object.keys(v8(this, K2, "f")).reduce(((t8, e8) => { - const i7 = v8(this, K2, "f")[e8].filter(((t9) => !(t9 in s7))); - return i7.length > 0 && (t8[e8] = i7), t8; - }), {})), O2(this, K2, {}, "f"); - return ["array", "boolean", "string", "skipValidation", "count", "normalize", "number", "hiddenOptions"].forEach(((t8) => { - e7[t8] = (v8(this, et2, "f")[t8] || []).filter(((t9) => !s7[t9])); - })), ["narg", "key", "alias", "default", "defaultDescription", "config", "choices", "demandedOptions", "demandedCommands", "deprecatedOptions"].forEach(((t8) => { - e7[t8] = g6(v8(this, et2, "f")[t8], ((t9) => !s7[t9])); - })), e7.envPrefix = v8(this, et2, "f").envPrefix, O2(this, et2, e7, "f"), O2(this, pt2, v8(this, pt2, "f") ? v8(this, pt2, "f").reset(s7) : P2(this, v8(this, ct2, "f")), "f"), O2(this, yt2, v8(this, yt2, "f") ? v8(this, yt2, "f").reset(s7) : (function(t8, e8, s8) { - const i7 = s8.y18n.__, n13 = s8.y18n.__n, r7 = { nonOptionCount: function(s9) { - const i8 = t8.getDemandedCommands(), r8 = s9._.length + (s9["--"] ? s9["--"].length : 0) - t8.getInternalMethods().getContext().commands.length; - i8._ && (r8 < i8._.min || r8 > i8._.max) && (r8 < i8._.min ? void 0 !== i8._.minMsg ? e8.fail(i8._.minMsg ? i8._.minMsg.replace(/\$0/g, r8.toString()).replace(/\$1/, i8._.min.toString()) : null) : e8.fail(n13("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", r8, r8.toString(), i8._.min.toString())) : r8 > i8._.max && (void 0 !== i8._.maxMsg ? e8.fail(i8._.maxMsg ? i8._.maxMsg.replace(/\$0/g, r8.toString()).replace(/\$1/, i8._.max.toString()) : null) : e8.fail(n13("Too many non-option arguments: got %s, maximum of %s", "Too many non-option arguments: got %s, maximum of %s", r8, r8.toString(), i8._.max.toString())))); - }, positionalCount: function(t9, s9) { - s9 < t9 && e8.fail(n13("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", s9, s9 + "", t9 + "")); - }, requiredArguments: function(t9, s9) { - let i8 = null; - for (const e9 of Object.keys(s9)) Object.prototype.hasOwnProperty.call(t9, e9) && void 0 !== t9[e9] || (i8 = i8 || {}, i8[e9] = s9[e9]); - if (i8) { - const t10 = []; - for (const e9 of Object.keys(i8)) { - const s11 = i8[e9]; - s11 && t10.indexOf(s11) < 0 && t10.push(s11); - } - const s10 = t10.length ? ` -${t10.join("\n")}` : ""; - e8.fail(n13("Missing required argument: %s", "Missing required arguments: %s", Object.keys(i8).length, Object.keys(i8).join(", ") + s10)); - } - }, unknownArguments: function(s9, i8, o8, a8, h7 = true) { - var l8; - const c8 = t8.getInternalMethods().getCommandInstance().getCommands(), f7 = [], d7 = t8.getInternalMethods().getContext(); - if (Object.keys(s9).forEach(((e9) => { - H3.includes(e9) || Object.prototype.hasOwnProperty.call(o8, e9) || Object.prototype.hasOwnProperty.call(t8.getInternalMethods().getParseContext(), e9) || r7.isValidAndSomeAliasIsNotNew(e9, i8) || f7.push(e9); - })), h7 && (d7.commands.length > 0 || c8.length > 0 || a8) && s9._.slice(d7.commands.length).forEach(((t9) => { - c8.includes("" + t9) || f7.push("" + t9); - })), h7) { - const e9 = (null === (l8 = t8.getDemandedCommands()._) || void 0 === l8 ? void 0 : l8.max) || 0, i9 = d7.commands.length + e9; - i9 < s9._.length && s9._.slice(i9).forEach(((t9) => { - t9 = String(t9), d7.commands.includes(t9) || f7.includes(t9) || f7.push(t9); - })); - } - f7.length && e8.fail(n13("Unknown argument: %s", "Unknown arguments: %s", f7.length, f7.map(((t9) => t9.trim() ? t9 : `"${t9}"`)).join(", "))); - }, unknownCommands: function(s9) { - const i8 = t8.getInternalMethods().getCommandInstance().getCommands(), r8 = [], o8 = t8.getInternalMethods().getContext(); - return (o8.commands.length > 0 || i8.length > 0) && s9._.slice(o8.commands.length).forEach(((t9) => { - i8.includes("" + t9) || r8.push("" + t9); - })), r8.length > 0 && (e8.fail(n13("Unknown command: %s", "Unknown commands: %s", r8.length, r8.join(", "))), true); - }, isValidAndSomeAliasIsNotNew: function(e9, s9) { - if (!Object.prototype.hasOwnProperty.call(s9, e9)) return false; - const i8 = t8.parsed.newAliases; - return [e9, ...s9[e9]].some(((t9) => !Object.prototype.hasOwnProperty.call(i8, t9) || !i8[e9])); - }, limitedChoices: function(s9) { - const n14 = t8.getOptions(), r8 = {}; - if (!Object.keys(n14.choices).length) return; - Object.keys(s9).forEach(((t9) => { - -1 === H3.indexOf(t9) && Object.prototype.hasOwnProperty.call(n14.choices, t9) && [].concat(s9[t9]).forEach(((e9) => { - -1 === n14.choices[t9].indexOf(e9) && void 0 !== e9 && (r8[t9] = (r8[t9] || []).concat(e9)); - })); - })); - const o8 = Object.keys(r8); - if (!o8.length) return; - let a8 = i7("Invalid values:"); - o8.forEach(((t9) => { - a8 += ` - ${i7("Argument: %s, Given: %s, Choices: %s", t9, e8.stringifiedValues(r8[t9]), e8.stringifiedValues(n14.choices[t9]))}`; - })), e8.fail(a8); - } }; - let o7 = {}; - function a7(t9, e9) { - const s9 = Number(e9); - return "number" == typeof (e9 = isNaN(s9) ? e9 : s9) ? e9 = t9._.length >= e9 : e9.match(/^--no-.+/) ? (e9 = e9.match(/^--no-(.+)/)[1], e9 = !Object.prototype.hasOwnProperty.call(t9, e9)) : e9 = Object.prototype.hasOwnProperty.call(t9, e9), e9; - } - r7.implies = function(e9, i8) { - h6(" [array|number|string]", [e9, i8], arguments.length), "object" == typeof e9 ? Object.keys(e9).forEach(((t9) => { - r7.implies(t9, e9[t9]); - })) : (t8.global(e9), o7[e9] || (o7[e9] = []), Array.isArray(i8) ? i8.forEach(((t9) => r7.implies(e9, t9))) : (d6(i8, void 0, s8), o7[e9].push(i8))); - }, r7.getImplied = function() { - return o7; - }, r7.implications = function(t9) { - const s9 = []; - if (Object.keys(o7).forEach(((e9) => { - const i8 = e9; - (o7[e9] || []).forEach(((e10) => { - let n14 = i8; - const r8 = e10; - n14 = a7(t9, n14), e10 = a7(t9, e10), n14 && !e10 && s9.push(` ${i8} -> ${r8}`); - })); - })), s9.length) { - let t10 = `${i7("Implications failed:")} -`; - s9.forEach(((e9) => { - t10 += e9; - })), e8.fail(t10); - } - }; - let l7 = {}; - r7.conflicts = function(e9, s9) { - h6(" [array|string]", [e9, s9], arguments.length), "object" == typeof e9 ? Object.keys(e9).forEach(((t9) => { - r7.conflicts(t9, e9[t9]); - })) : (t8.global(e9), l7[e9] || (l7[e9] = []), Array.isArray(s9) ? s9.forEach(((t9) => r7.conflicts(e9, t9))) : l7[e9].push(s9)); - }, r7.getConflicting = () => l7, r7.conflicting = function(n14) { - Object.keys(n14).forEach(((t9) => { - l7[t9] && l7[t9].forEach(((s9) => { - s9 && void 0 !== n14[t9] && void 0 !== n14[s9] && e8.fail(i7("Arguments %s and %s are mutually exclusive", t9, s9)); - })); - })), t8.getInternalMethods().getParserConfiguration()["strip-dashed"] && Object.keys(l7).forEach(((t9) => { - l7[t9].forEach(((r8) => { - r8 && void 0 !== n14[s8.Parser.camelCase(t9)] && void 0 !== n14[s8.Parser.camelCase(r8)] && e8.fail(i7("Arguments %s and %s are mutually exclusive", t9, r8)); - })); - })); - }, r7.recommendCommands = function(t9, s9) { - s9 = s9.sort(((t10, e9) => e9.length - t10.length)); - let n14 = null, r8 = 1 / 0; - for (let e9, i8 = 0; void 0 !== (e9 = s9[i8]); i8++) { - const s10 = N2(t9, e9); - s10 <= 3 && s10 < r8 && (r8 = s10, n14 = e9); - } - n14 && e8.fail(i7("Did you mean %s?", n14)); - }, r7.reset = function(t9) { - return o7 = g6(o7, ((e9) => !t9[e9])), l7 = g6(l7, ((e9) => !t9[e9])), r7; - }; - const c7 = []; - return r7.freeze = function() { - c7.push({ implied: o7, conflicting: l7 }); - }, r7.unfreeze = function() { - const t9 = c7.pop(); - d6(t9, void 0, s8), { implied: o7, conflicting: l7 } = t9; - }, r7; - })(this, v8(this, pt2, "f"), v8(this, ct2, "f")), "f"), O2(this, z2, v8(this, z2, "f") ? v8(this, z2, "f").reset() : (function(t8, e8, s8, i7) { - return new _3(t8, e8, s8, i7); - })(v8(this, pt2, "f"), v8(this, yt2, "f"), v8(this, Y2, "f"), v8(this, ct2, "f")), "f"), v8(this, U2, "f") || O2(this, U2, (function(t8, e8, s8, i7) { - return new D3(t8, e8, s8, i7); - })(this, v8(this, pt2, "f"), v8(this, z2, "f"), v8(this, ct2, "f")), "f"), v8(this, Y2, "f").reset(), O2(this, F3, null, "f"), O2(this, tt2, "", "f"), O2(this, V2, null, "f"), O2(this, J2, false, "f"), this.parsed = false, this; - } - [Yt2](t7, e7) { - return v8(this, ct2, "f").path.relative(t7, e7); - } - [Jt2](t7, s7, i7, n13 = 0, r7 = false) { - let o7 = !!i7 || r7; - t7 = t7 || v8(this, ht2, "f"), v8(this, et2, "f").__ = v8(this, ct2, "f").y18n.__, v8(this, et2, "f").configuration = this[Mt2](); - const a7 = !!v8(this, et2, "f").configuration["populate--"], h7 = Object.assign({}, v8(this, et2, "f").configuration, { "populate--": true }), l7 = v8(this, ct2, "f").Parser.detailed(t7, Object.assign({}, v8(this, et2, "f"), { configuration: { "parse-positional-numbers": false, ...h7 } })), c7 = Object.assign(l7.argv, v8(this, rt2, "f")); - let d7; - const u7 = l7.aliases; - let p7 = false, g7 = false; - Object.keys(c7).forEach(((t8) => { - t8 === v8(this, Z, "f") && c7[t8] ? p7 = true : t8 === v8(this, mt2, "f") && c7[t8] && (g7 = true); - })), c7.$0 = this.$0, this.parsed = l7, 0 === n13 && v8(this, pt2, "f").clearCachedHelpMessage(); + [kRebase](base, dir2) { + return __classPrivateFieldGet(this, _YargsInstance_shim, "f").path.relative(base, dir2); + } + [kRunYargsParserAndExecuteCommands](args, shortCircuit, calledFromCommand, commandIndex = 0, helpOnly = false) { + var _a6, _b3, _c7, _d2; + let skipValidation = !!calledFromCommand || helpOnly; + args = args || __classPrivateFieldGet(this, _YargsInstance_processArgs, "f"); + __classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__; + __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration](); + const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration["populate--"]; + const config = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, { + "populate--": true + }); + const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), { + configuration: { "parse-positional-numbers": false, ...config } + })); + const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f")); + let argvPromise = void 0; + const aliases = parsed.aliases; + let helpOptSet = false; + let versionOptSet = false; + Object.keys(argv).forEach((key) => { + if (key === __classPrivateFieldGet(this, _YargsInstance_helpOpt, "f") && argv[key]) { + helpOptSet = true; + } else if (key === __classPrivateFieldGet(this, _YargsInstance_versionOpt, "f") && argv[key]) { + versionOptSet = true; + } + }); + argv.$0 = this.$0; + this.parsed = parsed; + if (commandIndex === 0) { + __classPrivateFieldGet(this, _YargsInstance_usage, "f").clearCachedHelpMessage(); + } try { - if (this[kt2](), s7) return this[Bt2](c7, a7, !!i7, false); - if (v8(this, Z, "f")) { - [v8(this, Z, "f")].concat(u7[v8(this, Z, "f")] || []).filter(((t8) => t8.length > 1)).includes("" + c7._[c7._.length - 1]) && (c7._.pop(), p7 = true); - } - O2(this, X2, false, "f"); - const h8 = v8(this, z2, "f").getCommands(), m7 = v8(this, U2, "f").completionKey in c7, y3 = p7 || m7 || r7; - if (c7._.length) { - if (h8.length) { - let t8; - for (let e7, s8 = n13 || 0; void 0 !== c7._[s8]; s8++) { - if (e7 = String(c7._[s8]), h8.includes(e7) && e7 !== v8(this, F3, "f")) { - const t9 = v8(this, z2, "f").runCommand(e7, this, l7, s8 + 1, r7, p7 || g7 || r7); - return this[Bt2](t9, a7, !!i7, false); - } - if (!t8 && e7 !== v8(this, F3, "f")) { - t8 = e7; + this[kGuessLocale](); + if (shortCircuit) { + return this[kPostProcess](argv, populateDoubleDash, !!calledFromCommand, false); + } + if (__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")) { + const helpCmds = [__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")].concat(aliases[__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")] || []).filter((k7) => k7.length > 1); + if (helpCmds.includes("" + argv._[argv._.length - 1])) { + argv._.pop(); + helpOptSet = true; + } + } + __classPrivateFieldSet(this, _YargsInstance_isGlobalContext, false, "f"); + const handlerKeys = __classPrivateFieldGet(this, _YargsInstance_command, "f").getCommands(); + const requestCompletions = ((_a6 = __classPrivateFieldGet(this, _YargsInstance_completion, "f")) === null || _a6 === void 0 ? void 0 : _a6.completionKey) ? [ + (_b3 = __classPrivateFieldGet(this, _YargsInstance_completion, "f")) === null || _b3 === void 0 ? void 0 : _b3.completionKey, + ...(_d2 = this.getAliases()[(_c7 = __classPrivateFieldGet(this, _YargsInstance_completion, "f")) === null || _c7 === void 0 ? void 0 : _c7.completionKey]) !== null && _d2 !== void 0 ? _d2 : [] + ].some((key) => Object.prototype.hasOwnProperty.call(argv, key)) : false; + const skipRecommendation = helpOptSet || requestCompletions || helpOnly; + if (argv._.length) { + if (handlerKeys.length) { + let firstUnknownCommand; + for (let i6 = commandIndex || 0, cmd; argv._[i6] !== void 0; i6++) { + cmd = String(argv._[i6]); + if (handlerKeys.includes(cmd) && cmd !== __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) { + const innerArgv = __classPrivateFieldGet(this, _YargsInstance_command, "f").runCommand(cmd, this, parsed, i6 + 1, helpOnly, helpOptSet || versionOptSet || helpOnly); + return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false); + } else if (!firstUnknownCommand && cmd !== __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) { + firstUnknownCommand = cmd; break; } } - !v8(this, z2, "f").hasDefaultCommand() && v8(this, lt2, "f") && t8 && !y3 && v8(this, yt2, "f").recommendCommands(t8, h8); + if (!__classPrivateFieldGet(this, _YargsInstance_command, "f").hasDefaultCommand() && __classPrivateFieldGet(this, _YargsInstance_recommendCommands, "f") && firstUnknownCommand && !skipRecommendation) { + __classPrivateFieldGet(this, _YargsInstance_validation, "f").recommendCommands(firstUnknownCommand, handlerKeys); + } } - v8(this, F3, "f") && c7._.includes(v8(this, F3, "f")) && !m7 && (v8(this, T2, "f") && E2(true), this.showCompletionScript(), this.exit(0)); - } - if (v8(this, z2, "f").hasDefaultCommand() && !y3) { - const t8 = v8(this, z2, "f").runCommand(null, this, l7, 0, r7, p7 || g7 || r7); - return this[Bt2](t8, a7, !!i7, false); - } - if (m7) { - v8(this, T2, "f") && E2(true); - const s8 = (t7 = [].concat(t7)).slice(t7.indexOf(`--${v8(this, U2, "f").completionKey}`) + 1); - return v8(this, U2, "f").getCompletion(s8, ((t8, s9) => { - if (t8) throw new e6(t8.message); - (s9 || []).forEach(((t9) => { - v8(this, Q2, "f").log(t9); - })), this.exit(0); - })), this[Bt2](c7, !a7, !!i7, false); - } - if (v8(this, J2, "f") || (p7 ? (v8(this, T2, "f") && E2(true), o7 = true, this.showHelp("log"), this.exit(0)) : g7 && (v8(this, T2, "f") && E2(true), o7 = true, v8(this, pt2, "f").showVersion("log"), this.exit(0))), !o7 && v8(this, et2, "f").skipValidation.length > 0 && (o7 = Object.keys(c7).some(((t8) => v8(this, et2, "f").skipValidation.indexOf(t8) >= 0 && true === c7[t8]))), !o7) { - if (l7.error) throw new e6(l7.error.message); - if (!m7) { - const t8 = this[Zt2](u7, {}, l7.error); - i7 || (d7 = C3(c7, this, v8(this, Y2, "f").getMiddleware(), true)), d7 = this[zt2](t8, null != d7 ? d7 : c7), f6(d7) && !i7 && (d7 = d7.then((() => C3(c7, this, v8(this, Y2, "f").getMiddleware(), false)))); + if (__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") && argv._.includes(__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) && !requestCompletions) { + if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) + setBlocking(true); + this.showCompletionScript(); + this.exit(0); + } + } + if (__classPrivateFieldGet(this, _YargsInstance_command, "f").hasDefaultCommand() && !skipRecommendation) { + const innerArgv = __classPrivateFieldGet(this, _YargsInstance_command, "f").runCommand(null, this, parsed, 0, helpOnly, helpOptSet || versionOptSet || helpOnly); + return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false); + } + if (requestCompletions) { + if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) + setBlocking(true); + args = [].concat(args); + const completionArgs = args.slice(args.indexOf(`--${__classPrivateFieldGet(this, _YargsInstance_completion, "f").completionKey}`) + 1); + __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(completionArgs, (err, completions) => { + if (err) + throw new YError(err.message); + (completions || []).forEach((completion2) => { + __classPrivateFieldGet(this, _YargsInstance_logger, "f").log(completion2); + }); + this.exit(0); + }); + return this[kPostProcess](argv, !populateDoubleDash, !!calledFromCommand, false); + } + if (!__classPrivateFieldGet(this, _YargsInstance_hasOutput, "f")) { + if (helpOptSet) { + if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) + setBlocking(true); + skipValidation = true; + this.showHelp((message) => { + __classPrivateFieldGet(this, _YargsInstance_logger, "f").log(message); + this.exit(0); + }); + } else if (versionOptSet) { + if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) + setBlocking(true); + skipValidation = true; + __classPrivateFieldGet(this, _YargsInstance_usage, "f").showVersion("log"); + this.exit(0); + } + } + if (!skipValidation && __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.length > 0) { + skipValidation = Object.keys(argv).some((key) => __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.indexOf(key) >= 0 && argv[key] === true); + } + if (!skipValidation) { + if (parsed.error) + throw new YError(parsed.error.message); + if (!requestCompletions) { + const validation2 = this[kRunValidation](aliases, {}, parsed.error); + if (!calledFromCommand) { + argvPromise = applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), true); + } + argvPromise = this[kValidateAsync](validation2, argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv); + if (isPromise(argvPromise) && !calledFromCommand) { + argvPromise = argvPromise.then(() => { + return applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false); + }); + } } } - } catch (t8) { - if (!(t8 instanceof e6)) throw t8; - v8(this, pt2, "f").fail(t8.message, t8); + } catch (err) { + if (err instanceof YError) + __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message, err); + else + throw err; } - return this[Bt2](null != d7 ? d7 : c7, a7, !!i7, true); + return this[kPostProcess](argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv, populateDoubleDash, !!calledFromCommand, true); } - [Zt2](t7, s7, i7, n13) { - const r7 = { ...this.getDemandedOptions() }; - return (o7) => { - if (i7) throw new e6(i7.message); - v8(this, yt2, "f").nonOptionCount(o7), v8(this, yt2, "f").requiredArguments(o7, r7); - let a7 = false; - v8(this, dt2, "f") && (a7 = v8(this, yt2, "f").unknownCommands(o7)), v8(this, ft2, "f") && !a7 ? v8(this, yt2, "f").unknownArguments(o7, t7, s7, !!n13) : v8(this, ut2, "f") && v8(this, yt2, "f").unknownArguments(o7, t7, {}, false, false), v8(this, yt2, "f").limitedChoices(o7), v8(this, yt2, "f").implications(o7), v8(this, yt2, "f").conflicting(o7); + [kRunValidation](aliases, positionalMap, parseErrors, isDefaultCommand) { + const demandedOptions = { ...this.getDemandedOptions() }; + return (argv) => { + if (parseErrors) + throw new YError(parseErrors.message); + __classPrivateFieldGet(this, _YargsInstance_validation, "f").nonOptionCount(argv); + __classPrivateFieldGet(this, _YargsInstance_validation, "f").requiredArguments(argv, demandedOptions); + let failedStrictCommands = false; + if (__classPrivateFieldGet(this, _YargsInstance_strictCommands, "f")) { + failedStrictCommands = __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownCommands(argv); + } + if (__classPrivateFieldGet(this, _YargsInstance_strict, "f") && !failedStrictCommands) { + __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases, positionalMap, !!isDefaultCommand); + } else if (__classPrivateFieldGet(this, _YargsInstance_strictOptions, "f")) { + __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases, {}, false, false); + } + __classPrivateFieldGet(this, _YargsInstance_validation, "f").limitedChoices(argv); + __classPrivateFieldGet(this, _YargsInstance_validation, "f").implications(argv); + __classPrivateFieldGet(this, _YargsInstance_validation, "f").conflicting(argv); }; } - [Xt2]() { - O2(this, J2, true, "f"); + [kSetHasOutput]() { + __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); } - [Qt2](t7) { - if ("string" == typeof t7) v8(this, et2, "f").key[t7] = true; - else for (const e7 of t7) v8(this, et2, "f").key[e7] = true; + [kTrackManuallySetKeys](keys) { + if (typeof keys === "string") { + __classPrivateFieldGet(this, _YargsInstance_options, "f").key[keys] = true; + } else { + for (const k7 of keys) { + __classPrivateFieldGet(this, _YargsInstance_options, "f").key[k7] = true; + } + } } }; - var ee2; - var se2; - var { readFileSync: ie2 } = __require("fs"); - var { inspect: ne2 } = __require("util"); - var { resolve: re2 } = __require("path"); - var oe2 = require_build(); - var ae2 = require_build2(); - var he2; - var le2 = { assert: { notStrictEqual: t6.notStrictEqual, strictEqual: t6.strictEqual }, cliui: require_build3(), findUp: require_sync(), getEnv: (t7) => process.env[t7], getCallerFile: require_get_caller_file(), getProcessArgvBin: y2, inspect: ne2, mainFilename: null !== (se2 = null === (ee2 = null === __require || void 0 === __require ? void 0 : __require.main) || void 0 === ee2 ? void 0 : ee2.filename) && void 0 !== se2 ? se2 : process.cwd(), Parser: ae2, path: __require("path"), process: { argv: () => process.argv, cwd: process.cwd, emitWarning: (t7, e7) => process.emitWarning(t7, e7), execPath: () => process.execPath, exit: (t7) => { - process.exit(t7); - }, nextTick: process.nextTick, stdColumns: void 0 !== process.stdout.columns ? process.stdout.columns : null }, readFileSync: ie2, require: __require, requireDirectory: require_require_directory(), stringWidth: require_string_width(), y18n: oe2({ directory: re2(__dirname, "../locales"), updateFiles: false }) }; - var ce2 = (null === (he2 = null === process || void 0 === process ? void 0 : process.env) || void 0 === he2 ? void 0 : he2.YARGS_MIN_NODE_VERSION) ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12; - if (process && process.version) { - if (Number(process.version.match(/v([^.]+)/)[1]) < ce2) throw Error(`yargs supports a minimum Node.js version of ${ce2}. Read our version support policy: https://github.com/yargs/yargs#supported-nodejs-versions`); - } - var fe2 = require_build2(); - var de2; - var ue2 = { applyExtends: n12, cjsPlatformShim: le2, Yargs: (de2 = le2, (t7 = [], e7 = de2.process.cwd(), s7) => { - const i7 = new te2(t7, e7, s7, de2); - return Object.defineProperty(i7, "argv", { get: () => i7.parse(), enumerable: true }), i7.help(), i7.version(), i7; - }), argsert: h6, isPromise: f6, objFilter: g6, parseCommand: o6, Parser: fe2, processArgv: b6, YError: e6 }; - module.exports = ue2; } }); -// node_modules/ai-ctrf/node_modules/yargs/yargs -var require_yargs = __commonJS({ - "node_modules/ai-ctrf/node_modules/yargs/yargs"(exports2, module) { - "use strict"; - var { applyExtends, cjsPlatformShim, Parser, Yargs, processArgv } = require_build4(); - Yargs.applyExtends = (config, cwd, mergeExtends) => { - return applyExtends(config, cwd, mergeExtends, cjsPlatformShim); - }; - Yargs.hideBin = processArgv.hideBin; - Yargs.Parser = Parser; - module.exports = Yargs; - } +// node_modules/yargs/index.mjs +var yargs_exports = {}; +__export(yargs_exports, { + default: () => yargs_default, + "module.exports": () => Yargs }); - -// node_modules/ai-ctrf/node_modules/yargs/helpers/index.js -var require_helpers4 = __commonJS({ - "node_modules/ai-ctrf/node_modules/yargs/helpers/index.js"(exports2, module) { +var Yargs, yargs_default; +var init_yargs = __esm({ + "node_modules/yargs/index.mjs"() { "use strict"; - var { - applyExtends, - cjsPlatformShim, - Parser, - processArgv - } = require_build4(); - module.exports = { - applyExtends: (config, cwd, mergeExtends) => { - return applyExtends(config, cwd, mergeExtends, cjsPlatformShim); - }, - hideBin: processArgv.hideBin, - Parser - }; + init_esm(); + init_yargs_factory(); + Yargs = YargsFactory(esm_default); + yargs_default = Yargs; } }); -// node_modules/ai-ctrf/dist/assess.js -var require_assess = __commonJS({ - "node_modules/ai-ctrf/dist/assess.js"(exports2) { +// node_modules/yargs/helpers/helpers.mjs +var helpers_exports = {}; +__export(helpers_exports, { + Parser: () => lib_default, + applyExtends: () => applyExtends2, + hideBin: () => hideBin +}); +var applyExtends2; +var init_helpers = __esm({ + "node_modules/yargs/helpers/helpers.mjs"() { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ASSESSMENT_CONFIGS = void 0; - exports2.filterTestsByAssessment = filterTestsByAssessment; - exports2.getAssessmentConfig = getAssessmentConfig; - exports2.getAssessmentPromptContext = getAssessmentPromptContext; - exports2.isValidAssessmentType = isValidAssessmentType; - exports2.getAssessmentLabel = getAssessmentLabel; - exports2.ASSESSMENT_CONFIGS = { - failed: { - type: "failed", - label: "Failed Tests", - description: "Analyzing failed tests", - systemPromptSuffix: "Focus on test failures and why they occurred." - }, - flaky: { - type: "flaky", - label: "Flaky Tests", - description: "Analyzing flaky tests", - systemPromptSuffix: "Focus on identifying why these tests are flaky and suggest ways to make them more stable and reliable. Use the retries and attempts data to determine patterns and possible causes of flakiness. If insights data is available, use it to understand historical patterns." - } - }; - function filterTestsByAssessment(tests, assessmentType) { - switch (assessmentType) { - case "failed": - return tests.filter((test) => test.status === "failed"); - case "flaky": - return tests.filter((test) => test.flaky === true); - default: - return tests.filter((test) => test.status === "failed"); - } - } - function getAssessmentConfig(assessmentType) { - var _a5; - return (_a5 = exports2.ASSESSMENT_CONFIGS[assessmentType]) !== null && _a5 !== void 0 ? _a5 : exports2.ASSESSMENT_CONFIGS.failed; - } - function getAssessmentPromptContext(assessmentType, testCount) { - const config = getAssessmentConfig(assessmentType); - switch (assessmentType) { - case "failed": - return `You are analyzing ${testCount} failed test${testCount !== 1 ? "s" : ""}. ${config.systemPromptSuffix}`; - case "flaky": - return `You are analyzing ${testCount} flaky test${testCount !== 1 ? "s" : ""}. ${config.systemPromptSuffix}`; - default: - return `You are analyzing ${testCount} test${testCount !== 1 ? "s" : ""}. ${config.systemPromptSuffix}`; - } - } - function isValidAssessmentType(type) { - return type in exports2.ASSESSMENT_CONFIGS; - } - function getAssessmentLabel(assessmentType) { - return getAssessmentConfig(assessmentType).label; - } + init_apply_extends(); + init_process_argv(); + init_lib2(); + init_esm(); + applyExtends2 = (config, cwd, mergeExtends) => { + return applyExtends(config, cwd, mergeExtends, esm_default); + }; } }); @@ -98269,19 +99505,16 @@ var require_common3 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.validateCtrfFile = validateCtrfFile; exports2.saveUpdatedReport = saveUpdatedReport; - exports2.ansiRegex = ansiRegex3; - exports2.stripAnsi = stripAnsi3; + exports2.ansiRegex = ansiRegex5; + exports2.stripAnsi = stripAnsi5; exports2.generateFailedTestPrompt = generateFailedTestPrompt; - exports2.generateAssessmentPromptContext = generateAssessmentPromptContext; - exports2.getAssessmentIcon = getAssessmentIcon; var fs_1 = __importDefault(__require("fs")); - var assess_1 = require_assess(); function validateCtrfFile(filePath) { - var _a5; + var _a6; try { const fileContent = fs_1.default.readFileSync(filePath, "utf8"); const jsonData = JSON.parse(fileContent); - if (((_a5 = jsonData.results) === null || _a5 === void 0 ? void 0 : _a5.summary) == null || jsonData.results.tests == null) { + if (((_a6 = jsonData.results) === null || _a6 === void 0 ? void 0 : _a6.summary) == null || jsonData.results.tests == null) { console.warn("Warning: The file does not contain valid CTRF data."); return null; } @@ -98299,18 +99532,18 @@ var require_common3 = __commonJS({ console.error("Failed to save the updated report:", error2); } } - function ansiRegex3({ onlyFirst = false } = {}) { + function ansiRegex5({ onlyFirst = false } = {}) { const pattern = [ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))" ].join("|"); return new RegExp(pattern, onlyFirst ? void 0 : "g"); } - function stripAnsi3(message) { + function stripAnsi5(message) { if (typeof message !== "string") { throw new TypeError(`Expected a \`string\`, got \`${typeof message}\``); } - return message.replace(ansiRegex3(), ""); + return message.replace(ansiRegex5(), ""); } function generateFailedTestPrompt(test, report) { return `Analyze this test failure: @@ -98327,27 +99560,6 @@ What I need: 2. The likely root cause based on the error messages and context 3. The potential impact of this failure on the system`; } - function generateAssessmentPromptContext(test, report, assessmentType) { - const assessmentConfig = (0, assess_1.getAssessmentConfig)(assessmentType); - const assessmentContext = assessmentType === "failed" ? "Please provide a human-readable failure summary that explains why you think the test might have failed and ways to fix" : assessmentType === "flaky" ? "Please analyze why this test is flaky and suggest ways to make it more stable and reliable. Pay special attention to the retries and retryAttempts properties to identify patterns in the flakiness" : `Please provide an analysis of this test (${assessmentConfig.label})`; - const insightsNote = test.insights != null ? ". Note: This test has insights data with historical metrics that may help identify patterns" : ""; - return `Report: -${JSON.stringify(test, null, 2)}. - -Tool:${report.results.tool.name}. - -${assessmentContext}${insightsNote}`; - } - function getAssessmentIcon(assessmentType) { - switch (assessmentType) { - case "failed": - return "\u274C"; - case "flaky": - return "\u{1F342}"; - default: - return "\u{1F4CB}"; - } - } } }); @@ -98393,16 +99605,696 @@ Avoid: } }); +// node_modules/openai/internal/tslib.js +var require_tslib = __commonJS({ + "node_modules/openai/internal/tslib.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.__setModuleDefault = exports2.__createBinding = void 0; + exports2.__classPrivateFieldSet = __classPrivateFieldSet2; + exports2.__classPrivateFieldGet = __classPrivateFieldGet2; + exports2.__exportStar = __exportStar; + exports2.__importStar = __importStar; + function __classPrivateFieldSet2(receiver, state4, value, kind, f6) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f6) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; + } + function __classPrivateFieldGet2(receiver, state4, kind, f6) { + if (kind === "a" && !f6) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); + } + var __createBinding = Object.create ? function(o2, m3, k7, k22) { + if (k22 === void 0) + k22 = k7; + var desc = Object.getOwnPropertyDescriptor(m3, k7); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function() { + return m3[k7]; + } + }; + } + Object.defineProperty(o2, k22, desc); + } : function(o2, m3, k7, k22) { + if (k22 === void 0) + k22 = k7; + o2[k22] = m3[k7]; + }; + exports2.__createBinding = __createBinding; + function __exportStar(m3, o2) { + for (var p2 in m3) + if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(o2, p2)) + __createBinding(o2, m3, p2); + } + var __setModuleDefault = Object.create ? function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + } : function(o2, v2) { + o2["default"] = v2; + }; + exports2.__setModuleDefault = __setModuleDefault; + var ownKeys = function(o2) { + ownKeys = Object.getOwnPropertyNames || function(o22) { + var ar = []; + for (var k7 in o22) + if (Object.prototype.hasOwnProperty.call(o22, k7)) + ar[ar.length] = k7; + return ar; + }; + return ownKeys(o2); + }; + function __importStar(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k7 = ownKeys(mod), i6 = 0; i6 < k7.length; i6++) + if (k7[i6] !== "default") + __createBinding(result, mod, k7[i6]); + } + __setModuleDefault(result, mod); + return result; + } + } +}); + +// node_modules/openai/internal/utils/uuid.js +var require_uuid = __commonJS({ + "node_modules/openai/internal/utils/uuid.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.uuid4 = void 0; + var uuid4 = function() { + const { crypto: crypto5 } = globalThis; + if (crypto5?.randomUUID) { + exports2.uuid4 = crypto5.randomUUID.bind(crypto5); + return crypto5.randomUUID(); + } + const u8 = new Uint8Array(1); + const randomByte = crypto5 ? () => crypto5.getRandomValues(u8)[0] : () => Math.random() * 255 & 255; + return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c6) => (+c6 ^ randomByte() & 15 >> +c6 / 4).toString(16)); + }; + exports2.uuid4 = uuid4; + } +}); + +// node_modules/openai/internal/errors.js +var require_errors7 = __commonJS({ + "node_modules/openai/internal/errors.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.castToError = void 0; + exports2.isAbortError = isAbortError; + function isAbortError(err) { + return typeof err === "object" && err !== null && // Spec-compliant fetch implementations + ("name" in err && err.name === "AbortError" || // Expo fetch + "message" in err && String(err.message).includes("FetchRequestCanceledException")); + } + var castToError = (err) => { + if (err instanceof Error) + return err; + if (typeof err === "object" && err !== null) { + try { + if (Object.prototype.toString.call(err) === "[object Error]") { + const error2 = new Error(err.message, err.cause ? { cause: err.cause } : {}); + if (err.stack) + error2.stack = err.stack; + if (err.cause && !error2.cause) + error2.cause = err.cause; + if (err.name) + error2.name = err.name; + return error2; + } + } catch { + } + try { + return new Error(JSON.stringify(err)); + } catch { + } + } + return new Error(err); + }; + exports2.castToError = castToError; + } +}); + +// node_modules/openai/core/error.js +var require_error2 = __commonJS({ + "node_modules/openai/core/error.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SubjectTokenProviderError = exports2.OAuthError = exports2.InvalidWebhookSignatureError = exports2.ContentFilterFinishReasonError = exports2.LengthFinishReasonError = exports2.InternalServerError = exports2.RateLimitError = exports2.UnprocessableEntityError = exports2.ConflictError = exports2.NotFoundError = exports2.PermissionDeniedError = exports2.AuthenticationError = exports2.BadRequestError = exports2.APIConnectionTimeoutError = exports2.APIConnectionError = exports2.APIUserAbortError = exports2.APIError = exports2.OpenAIError = void 0; + var errors_1 = require_errors7(); + var OpenAIError = class extends Error { + }; + exports2.OpenAIError = OpenAIError; + var APIError = class _APIError extends OpenAIError { + constructor(status, error2, message, headers) { + super(`${_APIError.makeMessage(status, error2, message)}`); + this.status = status; + this.headers = headers; + this.requestID = headers?.get("x-request-id"); + this.error = error2; + const data = error2; + this.code = data?.["code"]; + this.param = data?.["param"]; + this.type = data?.["type"]; + } + static makeMessage(status, error2, message) { + const msg = error2?.message ? typeof error2.message === "string" ? error2.message : JSON.stringify(error2.message) : error2 ? JSON.stringify(error2) : message; + if (status && msg) { + return `${status} ${msg}`; + } + if (status) { + return `${status} status code (no body)`; + } + if (msg) { + return msg; + } + return "(no status code or body)"; + } + static generate(status, errorResponse, message, headers) { + if (!status || !headers) { + return new APIConnectionError({ message, cause: (0, errors_1.castToError)(errorResponse) }); + } + const error2 = errorResponse?.["error"]; + if (status === 400) { + return new BadRequestError(status, error2, message, headers); + } + if (status === 401) { + return new AuthenticationError(status, error2, message, headers); + } + if (status === 403) { + return new PermissionDeniedError(status, error2, message, headers); + } + if (status === 404) { + return new NotFoundError(status, error2, message, headers); + } + if (status === 409) { + return new ConflictError(status, error2, message, headers); + } + if (status === 422) { + return new UnprocessableEntityError(status, error2, message, headers); + } + if (status === 429) { + return new RateLimitError(status, error2, message, headers); + } + if (status >= 500) { + return new InternalServerError(status, error2, message, headers); + } + return new _APIError(status, error2, message, headers); + } + }; + exports2.APIError = APIError; + var APIUserAbortError = class extends APIError { + constructor({ message } = {}) { + super(void 0, void 0, message || "Request was aborted.", void 0); + } + }; + exports2.APIUserAbortError = APIUserAbortError; + var APIConnectionError = class extends APIError { + constructor({ message, cause }) { + super(void 0, void 0, message || "Connection error.", void 0); + if (cause) + this.cause = cause; + } + }; + exports2.APIConnectionError = APIConnectionError; + var APIConnectionTimeoutError = class extends APIConnectionError { + constructor({ message } = {}) { + super({ message: message ?? "Request timed out." }); + } + }; + exports2.APIConnectionTimeoutError = APIConnectionTimeoutError; + var BadRequestError = class extends APIError { + }; + exports2.BadRequestError = BadRequestError; + var AuthenticationError = class extends APIError { + }; + exports2.AuthenticationError = AuthenticationError; + var PermissionDeniedError = class extends APIError { + }; + exports2.PermissionDeniedError = PermissionDeniedError; + var NotFoundError = class extends APIError { + }; + exports2.NotFoundError = NotFoundError; + var ConflictError = class extends APIError { + }; + exports2.ConflictError = ConflictError; + var UnprocessableEntityError = class extends APIError { + }; + exports2.UnprocessableEntityError = UnprocessableEntityError; + var RateLimitError = class extends APIError { + }; + exports2.RateLimitError = RateLimitError; + var InternalServerError = class extends APIError { + }; + exports2.InternalServerError = InternalServerError; + var LengthFinishReasonError = class extends OpenAIError { + constructor() { + super(`Could not parse response content as the length limit was reached`); + } + }; + exports2.LengthFinishReasonError = LengthFinishReasonError; + var ContentFilterFinishReasonError = class extends OpenAIError { + constructor() { + super(`Could not parse response content as the request was rejected by the content filter`); + } + }; + exports2.ContentFilterFinishReasonError = ContentFilterFinishReasonError; + var InvalidWebhookSignatureError = class extends Error { + constructor(message) { + super(message); + } + }; + exports2.InvalidWebhookSignatureError = InvalidWebhookSignatureError; + var OAuthError = class extends APIError { + constructor(status, error2, headers) { + let finalMessage = "OAuth2 authentication error"; + let error_code = void 0; + if (error2 && typeof error2 === "object") { + const errorData = error2; + error_code = errorData["error"]; + const description = errorData["error_description"]; + if (description && typeof description === "string") { + finalMessage = description; + } else if (error_code) { + finalMessage = error_code; + } + } + super(status, error2, finalMessage, headers); + this.error_code = error_code; + } + }; + exports2.OAuthError = OAuthError; + var SubjectTokenProviderError = class extends OpenAIError { + constructor(message, provider, cause) { + super(message); + this.provider = provider; + this.cause = cause; + } + }; + exports2.SubjectTokenProviderError = SubjectTokenProviderError; + } +}); + +// node_modules/openai/internal/utils/values.js +var require_values = __commonJS({ + "node_modules/openai/internal/utils/values.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.safeJSON = exports2.maybeCoerceBoolean = exports2.maybeCoerceFloat = exports2.maybeCoerceInteger = exports2.coerceBoolean = exports2.coerceFloat = exports2.coerceInteger = exports2.validatePositiveInteger = exports2.ensurePresent = exports2.isReadonlyArray = exports2.isArray = exports2.isAbsoluteURL = void 0; + exports2.maybeObj = maybeObj; + exports2.isEmptyObj = isEmptyObj; + exports2.hasOwn = hasOwn; + exports2.isObj = isObj; + var error_1 = require_error2(); + var startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i; + var isAbsoluteURL = (url2) => { + return startsWithSchemeRegexp.test(url2); + }; + exports2.isAbsoluteURL = isAbsoluteURL; + var isArray = (val) => (exports2.isArray = Array.isArray, (0, exports2.isArray)(val)); + exports2.isArray = isArray; + exports2.isReadonlyArray = exports2.isArray; + function maybeObj(x2) { + if (typeof x2 !== "object") { + return {}; + } + return x2 ?? {}; + } + function isEmptyObj(obj) { + if (!obj) + return true; + for (const _k2 in obj) + return false; + return true; + } + function hasOwn(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); + } + function isObj(obj) { + return obj != null && typeof obj === "object" && !Array.isArray(obj); + } + var ensurePresent = (value) => { + if (value == null) { + throw new error_1.OpenAIError(`Expected a value to be given but received ${value} instead.`); + } + return value; + }; + exports2.ensurePresent = ensurePresent; + var validatePositiveInteger = (name, n8) => { + if (typeof n8 !== "number" || !Number.isInteger(n8)) { + throw new error_1.OpenAIError(`${name} must be an integer`); + } + if (n8 < 0) { + throw new error_1.OpenAIError(`${name} must be a positive integer`); + } + return n8; + }; + exports2.validatePositiveInteger = validatePositiveInteger; + var coerceInteger = (value) => { + if (typeof value === "number") + return Math.round(value); + if (typeof value === "string") + return parseInt(value, 10); + throw new error_1.OpenAIError(`Could not coerce ${value} (type: ${typeof value}) into a number`); + }; + exports2.coerceInteger = coerceInteger; + var coerceFloat = (value) => { + if (typeof value === "number") + return value; + if (typeof value === "string") + return parseFloat(value); + throw new error_1.OpenAIError(`Could not coerce ${value} (type: ${typeof value}) into a number`); + }; + exports2.coerceFloat = coerceFloat; + var coerceBoolean = (value) => { + if (typeof value === "boolean") + return value; + if (typeof value === "string") + return value === "true"; + return Boolean(value); + }; + exports2.coerceBoolean = coerceBoolean; + var maybeCoerceInteger = (value) => { + if (value == null) { + return void 0; + } + return (0, exports2.coerceInteger)(value); + }; + exports2.maybeCoerceInteger = maybeCoerceInteger; + var maybeCoerceFloat = (value) => { + if (value == null) { + return void 0; + } + return (0, exports2.coerceFloat)(value); + }; + exports2.maybeCoerceFloat = maybeCoerceFloat; + var maybeCoerceBoolean = (value) => { + if (value == null) { + return void 0; + } + return (0, exports2.coerceBoolean)(value); + }; + exports2.maybeCoerceBoolean = maybeCoerceBoolean; + var safeJSON = (text) => { + try { + return JSON.parse(text); + } catch (err) { + return void 0; + } + }; + exports2.safeJSON = safeJSON; + } +}); + +// node_modules/openai/internal/utils/sleep.js +var require_sleep = __commonJS({ + "node_modules/openai/internal/utils/sleep.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.sleep = void 0; + var sleep = (ms2) => new Promise((resolve8) => setTimeout(resolve8, ms2)); + exports2.sleep = sleep; + } +}); + +// node_modules/openai/version.js +var require_version = __commonJS({ + "node_modules/openai/version.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.VERSION = void 0; + exports2.VERSION = "6.42.0"; + } +}); + +// node_modules/openai/internal/detect-platform.js +var require_detect_platform = __commonJS({ + "node_modules/openai/internal/detect-platform.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getPlatformHeaders = exports2.isRunningInBrowser = void 0; + var version_1 = require_version(); + var isRunningInBrowser = () => { + return ( + // @ts-ignore + typeof window !== "undefined" && // @ts-ignore + typeof window.document !== "undefined" && // @ts-ignore + typeof navigator !== "undefined" + ); + }; + exports2.isRunningInBrowser = isRunningInBrowser; + function getDetectedPlatform() { + if (typeof Deno !== "undefined" && Deno.build != null) { + return "deno"; + } + if (typeof EdgeRuntime !== "undefined") { + return "edge"; + } + if (Object.prototype.toString.call(typeof globalThis.process !== "undefined" ? globalThis.process : 0) === "[object process]") { + return "node"; + } + return "unknown"; + } + var getPlatformProperties = () => { + const detectedPlatform = getDetectedPlatform(); + if (detectedPlatform === "deno") { + return { + "X-Stainless-Lang": "js", + "X-Stainless-Package-Version": version_1.VERSION, + "X-Stainless-OS": normalizePlatform(Deno.build.os), + "X-Stainless-Arch": normalizeArch(Deno.build.arch), + "X-Stainless-Runtime": "deno", + "X-Stainless-Runtime-Version": typeof Deno.version === "string" ? Deno.version : Deno.version?.deno ?? "unknown" + }; + } + if (typeof EdgeRuntime !== "undefined") { + return { + "X-Stainless-Lang": "js", + "X-Stainless-Package-Version": version_1.VERSION, + "X-Stainless-OS": "Unknown", + "X-Stainless-Arch": `other:${EdgeRuntime}`, + "X-Stainless-Runtime": "edge", + "X-Stainless-Runtime-Version": globalThis.process.version + }; + } + if (detectedPlatform === "node") { + return { + "X-Stainless-Lang": "js", + "X-Stainless-Package-Version": version_1.VERSION, + "X-Stainless-OS": normalizePlatform(globalThis.process.platform ?? "unknown"), + "X-Stainless-Arch": normalizeArch(globalThis.process.arch ?? "unknown"), + "X-Stainless-Runtime": "node", + "X-Stainless-Runtime-Version": globalThis.process.version ?? "unknown" + }; + } + const browserInfo = getBrowserInfo(); + if (browserInfo) { + return { + "X-Stainless-Lang": "js", + "X-Stainless-Package-Version": version_1.VERSION, + "X-Stainless-OS": "Unknown", + "X-Stainless-Arch": "unknown", + "X-Stainless-Runtime": `browser:${browserInfo.browser}`, + "X-Stainless-Runtime-Version": browserInfo.version + }; + } + return { + "X-Stainless-Lang": "js", + "X-Stainless-Package-Version": version_1.VERSION, + "X-Stainless-OS": "Unknown", + "X-Stainless-Arch": "unknown", + "X-Stainless-Runtime": "unknown", + "X-Stainless-Runtime-Version": "unknown" + }; + }; + function getBrowserInfo() { + if (typeof navigator === "undefined" || !navigator) { + return null; + } + const browserPatterns = [ + { key: "edge", pattern: /Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, + { key: "ie", pattern: /MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, + { key: "ie", pattern: /Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/ }, + { key: "chrome", pattern: /Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, + { key: "firefox", pattern: /Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, + { key: "safari", pattern: /(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/ } + ]; + for (const { key, pattern } of browserPatterns) { + const match3 = pattern.exec(navigator.userAgent); + if (match3) { + const major = match3[1] || 0; + const minor = match3[2] || 0; + const patch = match3[3] || 0; + return { browser: key, version: `${major}.${minor}.${patch}` }; + } + } + return null; + } + var normalizeArch = (arch2) => { + if (arch2 === "x32") + return "x32"; + if (arch2 === "x86_64" || arch2 === "x64") + return "x64"; + if (arch2 === "arm") + return "arm"; + if (arch2 === "aarch64" || arch2 === "arm64") + return "arm64"; + if (arch2) + return `other:${arch2}`; + return "unknown"; + }; + var normalizePlatform = (platform3) => { + platform3 = platform3.toLowerCase(); + if (platform3.includes("ios")) + return "iOS"; + if (platform3 === "android") + return "Android"; + if (platform3 === "darwin") + return "MacOS"; + if (platform3 === "win32") + return "Windows"; + if (platform3 === "freebsd") + return "FreeBSD"; + if (platform3 === "openbsd") + return "OpenBSD"; + if (platform3 === "linux") + return "Linux"; + if (platform3) + return `Other:${platform3}`; + return "Unknown"; + }; + var _platformHeaders; + var getPlatformHeaders = () => { + return _platformHeaders ?? (_platformHeaders = getPlatformProperties()); + }; + exports2.getPlatformHeaders = getPlatformHeaders; + } +}); + +// node_modules/openai/internal/shims.js +var require_shims = __commonJS({ + "node_modules/openai/internal/shims.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getDefaultFetch = getDefaultFetch; + exports2.makeReadableStream = makeReadableStream; + exports2.ReadableStreamFrom = ReadableStreamFrom; + exports2.ReadableStreamToAsyncIterable = ReadableStreamToAsyncIterable; + exports2.CancelReadableStream = CancelReadableStream; + function getDefaultFetch() { + if (typeof fetch !== "undefined") { + return fetch; + } + throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`"); + } + function makeReadableStream(...args) { + const ReadableStream2 = globalThis.ReadableStream; + if (typeof ReadableStream2 === "undefined") { + throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`"); + } + return new ReadableStream2(...args); + } + function ReadableStreamFrom(iterable) { + let iter = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator](); + return makeReadableStream({ + start() { + }, + async pull(controller) { + const { done, value } = await iter.next(); + if (done) { + controller.close(); + } else { + controller.enqueue(value); + } + }, + async cancel() { + await iter.return?.(); + } + }); + } + function ReadableStreamToAsyncIterable(stream5) { + if (stream5[Symbol.asyncIterator]) + return stream5; + const reader = stream5.getReader(); + return { + async next() { + try { + const result = await reader.read(); + if (result?.done) + reader.releaseLock(); + return result; + } catch (e6) { + reader.releaseLock(); + throw e6; + } + }, + async return() { + const cancelPromise = reader.cancel(); + reader.releaseLock(); + await cancelPromise; + return { done: true, value: void 0 }; + }, + [Symbol.asyncIterator]() { + return this; + } + }; + } + async function CancelReadableStream(stream5) { + if (stream5 === null || typeof stream5 !== "object") + return; + if (stream5[Symbol.asyncIterator]) { + await stream5[Symbol.asyncIterator]().return?.(); + return; + } + const reader = stream5.getReader(); + const cancelPromise = reader.cancel(); + reader.releaseLock(); + await cancelPromise; + } + } +}); + +// node_modules/openai/internal/request-options.js +var require_request_options = __commonJS({ + "node_modules/openai/internal/request-options.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.FallbackEncoder = void 0; + var FallbackEncoder = ({ headers, body: body2 }) => { + return { + bodyHeaders: { + "content-type": "application/json" + }, + body: JSON.stringify(body2) + }; + }; + exports2.FallbackEncoder = FallbackEncoder; + } +}); + // node_modules/openai/internal/qs/formats.js var require_formats = __commonJS({ "node_modules/openai/internal/qs/formats.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RFC3986 = exports2.RFC1738 = exports2.formatters = exports2.default_format = void 0; + exports2.RFC3986 = exports2.RFC1738 = exports2.formatters = exports2.default_formatter = exports2.default_format = void 0; exports2.default_format = "RFC3986"; + var default_formatter = (v2) => String(v2); + exports2.default_formatter = default_formatter; exports2.formatters = { - RFC1738: (v8) => String(v8).replace(/%20/g, "+"), - RFC3986: (v8) => String(v8) + RFC1738: (v2) => String(v2).replace(/%20/g, "+"), + RFC3986: exports2.default_formatter }; exports2.RFC1738 = "RFC1738"; exports2.RFC3986 = "RFC3986"; @@ -98414,11 +100306,20 @@ var require_utils10 = __commonJS({ "node_modules/openai/internal/qs/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.maybe_map = exports2.combine = exports2.is_buffer = exports2.is_regexp = exports2.compact = exports2.encode = exports2.decode = exports2.assign_single_source = exports2.merge = void 0; + exports2.encode = exports2.has = void 0; + exports2.merge = merge2; + exports2.assign_single_source = assign_single_source; + exports2.decode = decode; + exports2.compact = compact; + exports2.is_regexp = is_regexp; + exports2.is_buffer = is_buffer; + exports2.combine = combine; + exports2.maybe_map = maybe_map; var formats_1 = require_formats(); - var has = Object.prototype.hasOwnProperty; - var is_array = Array.isArray; - var hex_table = (() => { + var values_1 = require_values(); + var has = (obj, key) => (exports2.has = Object.hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty), (0, exports2.has)(obj, key)); + exports2.has = has; + var hex_table = /* @__PURE__ */ (() => { const array = []; for (let i6 = 0; i6 < 256; ++i6) { array.push("%" + ((i6 < 16 ? "0" : "") + i6.toString(16)).toUpperCase()); @@ -98431,7 +100332,7 @@ var require_utils10 = __commonJS({ if (!item) continue; const obj = item.obj[item.prop]; - if (is_array(obj)) { + if ((0, values_1.isArray)(obj)) { const compacted = []; for (let j7 = 0; j7 < obj.length; ++j7) { if (typeof obj[j7] !== "undefined") { @@ -98456,10 +100357,10 @@ var require_utils10 = __commonJS({ return target; } if (typeof source !== "object") { - if (is_array(target)) { + if ((0, values_1.isArray)(target)) { target.push(source); } else if (target && typeof target === "object") { - if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) { + if (options && (options.plainObjects || options.allowPrototypes) || !(0, exports2.has)(Object.prototype, source)) { target[source] = true; } } else { @@ -98471,12 +100372,12 @@ var require_utils10 = __commonJS({ return [target].concat(source); } let mergeTarget = target; - if (is_array(target) && !is_array(source)) { + if ((0, values_1.isArray)(target) && !(0, values_1.isArray)(source)) { mergeTarget = array_to_object(target, options); } - if (is_array(target) && is_array(source)) { + if ((0, values_1.isArray)(target) && (0, values_1.isArray)(source)) { source.forEach(function(item, i6) { - if (has.call(target, i6)) { + if ((0, exports2.has)(target, i6)) { const targetItem = target[i6]; if (targetItem && typeof targetItem === "object" && item && typeof item === "object") { target[i6] = merge2(targetItem, item, options); @@ -98491,7 +100392,7 @@ var require_utils10 = __commonJS({ } return Object.keys(source).reduce(function(acc, key) { const value = source[key]; - if (has.call(acc, key)) { + if ((0, exports2.has)(acc, key)) { acc[key] = merge2(acc[key], value, options); } else { acc[key] = value; @@ -98499,14 +100400,12 @@ var require_utils10 = __commonJS({ return acc; }, mergeTarget); } - exports2.merge = merge2; function assign_single_source(target, source) { return Object.keys(source).reduce(function(acc, key) { acc[key] = source[key]; return acc; }, target); } - exports2.assign_single_source = assign_single_source; function decode(str, _3, charset) { const strWithoutPlus = str.replace(/\+/g, " "); if (charset === "iso-8859-1") { @@ -98518,9 +100417,8 @@ var require_utils10 = __commonJS({ return strWithoutPlus; } } - exports2.decode = decode; var limit = 1024; - var encode = (str, _defaultEncoder, charset, _kind, format2) => { + var encode = (str, _defaultEncoder, charset, _kind, format4) => { if (str.length === 0) { return str; } @@ -98548,7 +100446,7 @@ var require_utils10 = __commonJS({ c6 >= 48 && c6 <= 57 || // 0-9 c6 >= 65 && c6 <= 90 || // a-z c6 >= 97 && c6 <= 122 || // A-Z - format2 === formats_1.RFC1738 && (c6 === 40 || c6 === 41)) { + format4 === formats_1.RFC1738 && (c6 === 40 || c6 === 41)) { arr[arr.length] = segment.charAt(i6); continue; } @@ -98592,24 +100490,20 @@ var require_utils10 = __commonJS({ compact_queue(queue2); return value; } - exports2.compact = compact; function is_regexp(obj) { return Object.prototype.toString.call(obj) === "[object RegExp]"; } - exports2.is_regexp = is_regexp; function is_buffer(obj) { if (!obj || typeof obj !== "object") { return false; } return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); } - exports2.is_buffer = is_buffer; function combine(a6, b6) { return [].concat(a6, b6); } - exports2.combine = combine; function maybe_map(val, fn) { - if (is_array(val)) { + if ((0, values_1.isArray)(val)) { const mapped = []; for (let i6 = 0; i6 < val.length; i6 += 1) { mapped.push(fn(val[i6])); @@ -98618,7 +100512,6 @@ var require_utils10 = __commonJS({ } return fn(val); } - exports2.maybe_map = maybe_map; } }); @@ -98627,10 +100520,10 @@ var require_stringify = __commonJS({ "node_modules/openai/internal/qs/stringify.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.stringify = void 0; + exports2.stringify = stringify; var utils_1 = require_utils10(); var formats_1 = require_formats(); - var has = Object.prototype.hasOwnProperty; + var values_1 = require_values(); var array_prefix_generators = { brackets(prefix2) { return String(prefix2) + "[]"; @@ -98643,12 +100536,10 @@ var require_stringify = __commonJS({ return String(prefix2); } }; - var is_array = Array.isArray; - var push = Array.prototype.push; var push_to_array = function(arr, value_or_array) { - push.apply(arr, is_array(value_or_array) ? value_or_array : [value_or_array]); + Array.prototype.push.apply(arr, (0, values_1.isArray)(value_or_array) ? value_or_array : [value_or_array]); }; - var to_ISO = Date.prototype.toISOString; + var toISOString; var defaults4 = { addQueryPrefix: false, allowDots: false, @@ -98662,20 +100553,20 @@ var require_stringify = __commonJS({ encoder: utils_1.encode, encodeValuesOnly: false, format: formats_1.default_format, - formatter: formats_1.formatters[formats_1.default_format], + formatter: formats_1.default_formatter, /** @deprecated */ indices: false, serializeDate(date2) { - return to_ISO.call(date2); + return (toISOString ?? (toISOString = Function.prototype.call.bind(Date.prototype.toISOString)))(date2); }, skipNulls: false, strictNullHandling: false }; - function is_non_nullish_primitive(v8) { - return typeof v8 === "string" || typeof v8 === "number" || typeof v8 === "boolean" || typeof v8 === "symbol" || typeof v8 === "bigint"; + function is_non_nullish_primitive(v2) { + return typeof v2 === "string" || typeof v2 === "number" || typeof v2 === "boolean" || typeof v2 === "symbol" || typeof v2 === "bigint"; } var sentinel = {}; - function inner_stringify(object, prefix2, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter4, sort, allowDots, serializeDate, format2, formatter, encodeValuesOnly, charset, sideChannel) { + function inner_stringify(object, prefix2, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter4, sort, allowDots, serializeDate, format4, formatter, encodeValuesOnly, charset, sideChannel) { let obj = object; let tmp_sc = sideChannel; let step = 0; @@ -98698,7 +100589,7 @@ var require_stringify = __commonJS({ obj = filter4(prefix2, obj); } else if (obj instanceof Date) { obj = serializeDate?.(obj); - } else if (generateArrayPrefix === "comma" && is_array(obj)) { + } else if (generateArrayPrefix === "comma" && (0, values_1.isArray)(obj)) { obj = (0, utils_1.maybe_map)(obj, function(value) { if (value instanceof Date) { return serializeDate?.(value); @@ -98710,17 +100601,17 @@ var require_stringify = __commonJS({ if (strictNullHandling) { return encoder && !encodeValuesOnly ? ( // @ts-expect-error - encoder(prefix2, defaults4.encoder, charset, "key", format2) + encoder(prefix2, defaults4.encoder, charset, "key", format4) ) : prefix2; } obj = ""; } if (is_non_nullish_primitive(obj) || (0, utils_1.is_buffer)(obj)) { if (encoder) { - const key_value = encodeValuesOnly ? prefix2 : encoder(prefix2, defaults4.encoder, charset, "key", format2); + const key_value = encodeValuesOnly ? prefix2 : encoder(prefix2, defaults4.encoder, charset, "key", format4); return [ formatter?.(key_value) + "=" + // @ts-expect-error - formatter?.(encoder(obj, defaults4.encoder, charset, "value", format2)) + formatter?.(encoder(obj, defaults4.encoder, charset, "value", format4)) ]; } return [formatter?.(prefix2) + "=" + formatter?.(String(obj))]; @@ -98730,20 +100621,20 @@ var require_stringify = __commonJS({ return values; } let obj_keys; - if (generateArrayPrefix === "comma" && is_array(obj)) { + if (generateArrayPrefix === "comma" && (0, values_1.isArray)(obj)) { if (encodeValuesOnly && encoder) { obj = (0, utils_1.maybe_map)(obj, encoder); } obj_keys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }]; - } else if (is_array(filter4)) { + } else if ((0, values_1.isArray)(filter4)) { obj_keys = filter4; } else { const keys = Object.keys(obj); obj_keys = sort ? keys.sort(sort) : keys; } const encoded_prefix = encodeDotInKeys ? String(prefix2).replace(/\./g, "%2E") : String(prefix2); - const adjusted_prefix = commaRoundTrip && is_array(obj) && obj.length === 1 ? encoded_prefix + "[]" : encoded_prefix; - if (allowEmptyArrays && is_array(obj) && obj.length === 0) { + const adjusted_prefix = commaRoundTrip && (0, values_1.isArray)(obj) && obj.length === 1 ? encoded_prefix + "[]" : encoded_prefix; + if (allowEmptyArrays && (0, values_1.isArray)(obj) && obj.length === 0) { return adjusted_prefix + "[]"; } for (let j7 = 0; j7 < obj_keys.length; ++j7) { @@ -98756,7 +100647,7 @@ var require_stringify = __commonJS({ continue; } const encoded_key = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key; - const key_prefix = is_array(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjusted_prefix, encoded_key) : adjusted_prefix : adjusted_prefix + (allowDots ? "." + encoded_key : "[" + encoded_key + "]"); + const key_prefix = (0, values_1.isArray)(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjusted_prefix, encoded_key) : adjusted_prefix : adjusted_prefix + (allowDots ? "." + encoded_key : "[" + encoded_key + "]"); sideChannel.set(object, step); const valueSideChannel = /* @__PURE__ */ new WeakMap(); valueSideChannel.set(sentinel, sideChannel); @@ -98770,12 +100661,12 @@ var require_stringify = __commonJS({ skipNulls, encodeDotInKeys, // @ts-ignore - generateArrayPrefix === "comma" && encodeValuesOnly && is_array(obj) ? null : encoder, + generateArrayPrefix === "comma" && encodeValuesOnly && (0, values_1.isArray)(obj) ? null : encoder, filter4, sort, allowDots, serializeDate, - format2, + format4, formatter, encodeValuesOnly, charset, @@ -98798,16 +100689,16 @@ var require_stringify = __commonJS({ if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); } - let format2 = formats_1.default_format; + let format4 = formats_1.default_format; if (typeof opts.format !== "undefined") { - if (!has.call(formats_1.formatters, opts.format)) { + if (!(0, utils_1.has)(formats_1.formatters, opts.format)) { throw new TypeError("Unknown format option provided."); } - format2 = opts.format; + format4 = opts.format; } - const formatter = formats_1.formatters[format2]; + const formatter = formats_1.formatters[format4]; let filter4 = defaults4.filter; - if (typeof opts.filter === "function" || is_array(opts.filter)) { + if (typeof opts.filter === "function" || (0, values_1.isArray)(opts.filter)) { filter4 = opts.filter; } let arrayFormat; @@ -98837,7 +100728,7 @@ var require_stringify = __commonJS({ encoder: typeof opts.encoder === "function" ? opts.encoder : defaults4.encoder, encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults4.encodeValuesOnly, filter: filter4, - format: format2, + format: format4, formatter, serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults4.serializeDate, skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults4.skipNulls, @@ -98854,7 +100745,7 @@ var require_stringify = __commonJS({ if (typeof options.filter === "function") { filter4 = options.filter; obj = filter4("", obj); - } else if (is_array(options.filter)) { + } else if ((0, values_1.isArray)(options.filter)) { filter4 = options.filter; obj_keys = filter4; } @@ -98909,7419 +100800,10568 @@ var require_stringify = __commonJS({ } return joined.length > 0 ? prefix2 + joined : ""; } - exports2.stringify = stringify; } }); -// node_modules/openai/internal/qs/index.js -var require_qs = __commonJS({ - "node_modules/openai/internal/qs/index.js"(exports2) { +// node_modules/openai/internal/utils/query.js +var require_query = __commonJS({ + "node_modules/openai/internal/utils/query.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.formats = exports2.stringify = void 0; - var formats_1 = require_formats(); - var formats = { - formatters: formats_1.formatters, - RFC1738: formats_1.RFC1738, - RFC3986: formats_1.RFC3986, - default: formats_1.default_format - }; - exports2.formats = formats; - var stringify_1 = require_stringify(); - Object.defineProperty(exports2, "stringify", { enumerable: true, get: function() { - return stringify_1.stringify; - } }); + exports2.stringifyQuery = stringifyQuery; + var tslib_1 = require_tslib(); + var qs2 = tslib_1.__importStar(require_stringify()); + function stringifyQuery(query) { + return qs2.stringify(query, { arrayFormat: "brackets" }); + } } }); -// node_modules/openai/version.js -var require_version = __commonJS({ - "node_modules/openai/version.js"(exports2) { +// node_modules/openai/internal/utils/bytes.js +var require_bytes = __commonJS({ + "node_modules/openai/internal/utils/bytes.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.VERSION = void 0; - exports2.VERSION = "4.104.0"; + exports2.concatBytes = concatBytes; + exports2.encodeUTF8 = encodeUTF8; + exports2.decodeUTF8 = decodeUTF8; + function concatBytes(buffers) { + let length = 0; + for (const buffer2 of buffers) { + length += buffer2.length; + } + const output = new Uint8Array(length); + let index2 = 0; + for (const buffer2 of buffers) { + output.set(buffer2, index2); + index2 += buffer2.length; + } + return output; + } + var encodeUTF8_; + function encodeUTF8(str) { + let encoder; + return (encodeUTF8_ ?? (encoder = new globalThis.TextEncoder(), encodeUTF8_ = encoder.encode.bind(encoder)))(str); + } + var decodeUTF8_; + function decodeUTF8(bytes) { + let decoder; + return (decodeUTF8_ ?? (decoder = new globalThis.TextDecoder(), decodeUTF8_ = decoder.decode.bind(decoder)))(bytes); + } } }); -// node_modules/openai/_shims/registry.js -var require_registry = __commonJS({ - "node_modules/openai/_shims/registry.js"(exports2) { +// node_modules/openai/internal/decoders/line.js +var require_line = __commonJS({ + "node_modules/openai/internal/decoders/line.js"(exports2) { "use strict"; + var _LineDecoder_buffer; + var _LineDecoder_carriageReturnIndex; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.setShims = exports2.isFsReadStream = exports2.fileFromPath = exports2.getDefaultAgent = exports2.getMultipartRequestOptions = exports2.ReadableStream = exports2.File = exports2.Blob = exports2.FormData = exports2.Headers = exports2.Response = exports2.Request = exports2.fetch = exports2.kind = exports2.auto = void 0; - exports2.auto = false; - exports2.kind = void 0; - exports2.fetch = void 0; - exports2.Request = void 0; - exports2.Response = void 0; - exports2.Headers = void 0; - exports2.FormData = void 0; - exports2.Blob = void 0; - exports2.File = void 0; - exports2.ReadableStream = void 0; - exports2.getMultipartRequestOptions = void 0; - exports2.getDefaultAgent = void 0; - exports2.fileFromPath = void 0; - exports2.isFsReadStream = void 0; - function setShims(shims, options = { auto: false }) { - if (exports2.auto) { - throw new Error(`you must \`import 'openai/shims/${shims.kind}'\` before importing anything else from openai`); + exports2.LineDecoder = void 0; + exports2.findDoubleNewlineIndex = findDoubleNewlineIndex; + var tslib_1 = require_tslib(); + var bytes_1 = require_bytes(); + var LineDecoder = class { + constructor() { + _LineDecoder_buffer.set(this, void 0); + _LineDecoder_carriageReturnIndex.set(this, void 0); + tslib_1.__classPrivateFieldSet(this, _LineDecoder_buffer, new Uint8Array(), "f"); + tslib_1.__classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f"); } - if (exports2.kind) { - throw new Error(`can't \`import 'openai/shims/${shims.kind}'\` after \`import 'openai/shims/${exports2.kind}'\``); + decode(chunk) { + if (chunk == null) { + return []; + } + const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk) : typeof chunk === "string" ? (0, bytes_1.encodeUTF8)(chunk) : chunk; + tslib_1.__classPrivateFieldSet(this, _LineDecoder_buffer, (0, bytes_1.concatBytes)([tslib_1.__classPrivateFieldGet(this, _LineDecoder_buffer, "f"), binaryChunk]), "f"); + const lines = []; + let patternIndex; + while ((patternIndex = findNewlineIndex(tslib_1.__classPrivateFieldGet(this, _LineDecoder_buffer, "f"), tslib_1.__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f"))) != null) { + if (patternIndex.carriage && tslib_1.__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") == null) { + tslib_1.__classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, patternIndex.index, "f"); + continue; + } + if (tslib_1.__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") != null && (patternIndex.index !== tslib_1.__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") + 1 || patternIndex.carriage)) { + lines.push((0, bytes_1.decodeUTF8)(tslib_1.__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(0, tslib_1.__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") - 1))); + tslib_1.__classPrivateFieldSet(this, _LineDecoder_buffer, tslib_1.__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(tslib_1.__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f")), "f"); + tslib_1.__classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f"); + continue; + } + const endIndex = tslib_1.__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") !== null ? patternIndex.preceding - 1 : patternIndex.preceding; + const line = (0, bytes_1.decodeUTF8)(tslib_1.__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(0, endIndex)); + lines.push(line); + tslib_1.__classPrivateFieldSet(this, _LineDecoder_buffer, tslib_1.__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(patternIndex.index), "f"); + tslib_1.__classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f"); + } + return lines; } - exports2.auto = options.auto; - exports2.kind = shims.kind; - exports2.fetch = shims.fetch; - exports2.Request = shims.Request; - exports2.Response = shims.Response; - exports2.Headers = shims.Headers; - exports2.FormData = shims.FormData; - exports2.Blob = shims.Blob; - exports2.File = shims.File; - exports2.ReadableStream = shims.ReadableStream; - exports2.getMultipartRequestOptions = shims.getMultipartRequestOptions; - exports2.getDefaultAgent = shims.getDefaultAgent; - exports2.fileFromPath = shims.fileFromPath; - exports2.isFsReadStream = shims.isFsReadStream; + flush() { + if (!tslib_1.__classPrivateFieldGet(this, _LineDecoder_buffer, "f").length) { + return []; + } + return this.decode("\n"); + } + }; + exports2.LineDecoder = LineDecoder; + _LineDecoder_buffer = /* @__PURE__ */ new WeakMap(), _LineDecoder_carriageReturnIndex = /* @__PURE__ */ new WeakMap(); + LineDecoder.NEWLINE_CHARS = /* @__PURE__ */ new Set(["\n", "\r"]); + LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g; + function findNewlineIndex(buffer2, startIndex) { + const newline = 10; + const carriage = 13; + for (let i6 = startIndex ?? 0; i6 < buffer2.length; i6++) { + if (buffer2[i6] === newline) { + return { preceding: i6, index: i6 + 1, carriage: false }; + } + if (buffer2[i6] === carriage) { + return { preceding: i6, index: i6 + 1, carriage: true }; + } + } + return null; + } + function findDoubleNewlineIndex(buffer2) { + const newline = 10; + const carriage = 13; + for (let i6 = 0; i6 < buffer2.length - 1; i6++) { + if (buffer2[i6] === newline && buffer2[i6 + 1] === newline) { + return i6 + 2; + } + if (buffer2[i6] === carriage && buffer2[i6 + 1] === carriage) { + return i6 + 2; + } + if (buffer2[i6] === carriage && buffer2[i6 + 1] === newline && i6 + 3 < buffer2.length && buffer2[i6 + 2] === carriage && buffer2[i6 + 3] === newline) { + return i6 + 4; + } + } + return -1; } - exports2.setShims = setShims; } }); -// node_modules/webidl-conversions/lib/index.js -var require_lib7 = __commonJS({ - "node_modules/webidl-conversions/lib/index.js"(exports2, module) { +// node_modules/openai/internal/utils/log.js +var require_log2 = __commonJS({ + "node_modules/openai/internal/utils/log.js"(exports2) { "use strict"; - var conversions = {}; - module.exports = conversions; - function sign2(x6) { - return x6 < 0 ? -1 : 1; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.formatRequestDetails = exports2.parseLogLevel = void 0; + exports2.loggerFor = loggerFor; + var values_1 = require_values(); + var levelNumbers = { + off: 0, + error: 200, + warn: 300, + info: 400, + debug: 500 + }; + var parseLogLevel = (maybeLevel, sourceName, client2) => { + if (!maybeLevel) { + return void 0; + } + if ((0, values_1.hasOwn)(levelNumbers, maybeLevel)) { + return maybeLevel; + } + loggerFor(client2).warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers))}`); + return void 0; + }; + exports2.parseLogLevel = parseLogLevel; + function noop3() { } - function evenRound(x6) { - if (x6 % 1 === 0.5 && (x6 & 1) === 0) { - return Math.floor(x6); + function makeLogFn(fnLevel, logger8, logLevel) { + if (!logger8 || levelNumbers[fnLevel] > levelNumbers[logLevel]) { + return noop3; } else { - return Math.round(x6); + return logger8[fnLevel].bind(logger8); + } + } + var noopLogger = { + error: noop3, + warn: noop3, + info: noop3, + debug: noop3 + }; + var cachedLoggers = /* @__PURE__ */ new WeakMap(); + function loggerFor(client2) { + const logger8 = client2.logger; + const logLevel = client2.logLevel ?? "off"; + if (!logger8) { + return noopLogger; + } + const cachedLogger = cachedLoggers.get(logger8); + if (cachedLogger && cachedLogger[0] === logLevel) { + return cachedLogger[1]; + } + const levelLogger = { + error: makeLogFn("error", logger8, logLevel), + warn: makeLogFn("warn", logger8, logLevel), + info: makeLogFn("info", logger8, logLevel), + debug: makeLogFn("debug", logger8, logLevel) + }; + cachedLoggers.set(logger8, [logLevel, levelLogger]); + return levelLogger; + } + var formatRequestDetails = (details) => { + if (details.options) { + details.options = { ...details.options }; + delete details.options["headers"]; + } + if (details.headers) { + details.headers = Object.fromEntries((details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(([name, value]) => [ + name, + name.toLowerCase() === "authorization" || name.toLowerCase() === "api-key" || name.toLowerCase() === "x-api-key" || name.toLowerCase() === "cookie" || name.toLowerCase() === "set-cookie" ? "***" : value + ])); } - } - function createNumberConversion(bitLength, typeOpts) { - if (!typeOpts.unsigned) { - --bitLength; + if ("retryOfRequestLogID" in details) { + if (details.retryOfRequestLogID) { + details.retryOf = details.retryOfRequestLogID; + } + delete details.retryOfRequestLogID; } - const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength); - const upperBound = Math.pow(2, bitLength) - 1; - const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength); - const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1); - return function(V2, opts) { - if (!opts) opts = {}; - let x6 = +V2; - if (opts.enforceRange) { - if (!Number.isFinite(x6)) { - throw new TypeError("Argument is not a finite number"); + return details; + }; + exports2.formatRequestDetails = formatRequestDetails; + } +}); + +// node_modules/openai/core/streaming.js +var require_streaming = __commonJS({ + "node_modules/openai/core/streaming.js"(exports2) { + "use strict"; + var _Stream_client; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Stream = void 0; + exports2._iterSSEMessages = _iterSSEMessages; + var tslib_1 = require_tslib(); + var error_1 = require_error2(); + var shims_1 = require_shims(); + var line_1 = require_line(); + var shims_2 = require_shims(); + var errors_1 = require_errors7(); + var bytes_1 = require_bytes(); + var log_1 = require_log2(); + var error_2 = require_error2(); + var Stream3 = class _Stream { + constructor(iterator2, controller, client2) { + this.iterator = iterator2; + _Stream_client.set(this, void 0); + this.controller = controller; + tslib_1.__classPrivateFieldSet(this, _Stream_client, client2, "f"); + } + static fromSSEResponse(response, controller, client2, synthesizeEventData) { + let consumed = false; + const logger8 = client2 ? (0, log_1.loggerFor)(client2) : console; + async function* iterator2() { + if (consumed) { + throw new error_1.OpenAIError("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); } - x6 = sign2(x6) * Math.floor(Math.abs(x6)); - if (x6 < lowerBound || x6 > upperBound) { - throw new TypeError("Argument is not in byte range"); + consumed = true; + let done = false; + try { + for await (const sse of _iterSSEMessages(response, controller)) { + if (done) + continue; + if (sse.data.startsWith("[DONE]")) { + done = true; + continue; + } + if (sse.event === null || !sse.event.startsWith("thread.")) { + let data; + try { + data = JSON.parse(sse.data); + } catch (e6) { + logger8.error(`Could not parse message into JSON:`, sse.data); + logger8.error(`From chunk:`, sse.raw); + throw e6; + } + if (data && data.error) { + throw new error_2.APIError(void 0, data.error, void 0, response.headers); + } + yield synthesizeEventData ? { event: sse.event, data } : data; + } else { + let data; + try { + data = JSON.parse(sse.data); + } catch (e6) { + console.error(`Could not parse message into JSON:`, sse.data); + console.error(`From chunk:`, sse.raw); + throw e6; + } + if (sse.event == "error") { + throw new error_2.APIError(void 0, data.error, data.message, void 0); + } + yield { event: sse.event, data }; + } + } + done = true; + } catch (e6) { + if ((0, errors_1.isAbortError)(e6)) + return; + throw e6; + } finally { + if (!done) + controller.abort(); } - return x6; } - if (!isNaN(x6) && opts.clamp) { - x6 = evenRound(x6); - if (x6 < lowerBound) x6 = lowerBound; - if (x6 > upperBound) x6 = upperBound; - return x6; - } - if (!Number.isFinite(x6) || x6 === 0) { - return 0; + return new _Stream(iterator2, controller, client2); + } + /** + * Generates a Stream from a newline-separated ReadableStream + * where each item is a JSON value. + */ + static fromReadableStream(readableStream, controller, client2) { + let consumed = false; + async function* iterLines() { + const lineDecoder = new line_1.LineDecoder(); + const iter = (0, shims_2.ReadableStreamToAsyncIterable)(readableStream); + for await (const chunk of iter) { + for (const line of lineDecoder.decode(chunk)) { + yield line; + } + } + for (const line of lineDecoder.flush()) { + yield line; + } } - x6 = sign2(x6) * Math.floor(Math.abs(x6)); - x6 = x6 % moduloVal; - if (!typeOpts.unsigned && x6 >= moduloBound) { - return x6 - moduloVal; - } else if (typeOpts.unsigned) { - if (x6 < 0) { - x6 += moduloVal; - } else if (x6 === -0) { - return 0; + async function* iterator2() { + if (consumed) { + throw new error_1.OpenAIError("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); + } + consumed = true; + let done = false; + try { + for await (const line of iterLines()) { + if (done) + continue; + if (line) + yield JSON.parse(line); + } + done = true; + } catch (e6) { + if ((0, errors_1.isAbortError)(e6)) + return; + throw e6; + } finally { + if (!done) + controller.abort(); } } - return x6; - }; - } - conversions["void"] = function() { - return void 0; - }; - conversions["boolean"] = function(val) { - return !!val; - }; - conversions["byte"] = createNumberConversion(8, { unsigned: false }); - conversions["octet"] = createNumberConversion(8, { unsigned: true }); - conversions["short"] = createNumberConversion(16, { unsigned: false }); - conversions["unsigned short"] = createNumberConversion(16, { unsigned: true }); - conversions["long"] = createNumberConversion(32, { unsigned: false }); - conversions["unsigned long"] = createNumberConversion(32, { unsigned: true }); - conversions["long long"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 }); - conversions["unsigned long long"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 }); - conversions["double"] = function(V2) { - const x6 = +V2; - if (!Number.isFinite(x6)) { - throw new TypeError("Argument is not a finite floating-point value"); + return new _Stream(iterator2, controller, client2); } - return x6; - }; - conversions["unrestricted double"] = function(V2) { - const x6 = +V2; - if (isNaN(x6)) { - throw new TypeError("Argument is NaN"); + [(_Stream_client = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { + return this.iterator(); } - return x6; - }; - conversions["float"] = conversions["double"]; - conversions["unrestricted float"] = conversions["unrestricted double"]; - conversions["DOMString"] = function(V2, opts) { - if (!opts) opts = {}; - if (opts.treatNullAsEmptyString && V2 === null) { - return ""; + /** + * Splits the stream into two streams which can be + * independently read from at different speeds. + */ + tee() { + const left2 = []; + const right2 = []; + const iterator2 = this.iterator(); + const teeIterator = (queue2) => { + return { + next: () => { + if (queue2.length === 0) { + const result = iterator2.next(); + left2.push(result); + right2.push(result); + } + return queue2.shift(); + } + }; + }; + return [ + new _Stream(() => teeIterator(left2), this.controller, tslib_1.__classPrivateFieldGet(this, _Stream_client, "f")), + new _Stream(() => teeIterator(right2), this.controller, tslib_1.__classPrivateFieldGet(this, _Stream_client, "f")) + ]; + } + /** + * Converts this stream to a newline-separated ReadableStream of + * JSON stringified values in the stream + * which can be turned back into a Stream with `Stream.fromReadableStream()`. + */ + toReadableStream() { + const self2 = this; + let iter; + return (0, shims_1.makeReadableStream)({ + async start() { + iter = self2[Symbol.asyncIterator](); + }, + async pull(ctrl) { + try { + const { value, done } = await iter.next(); + if (done) + return ctrl.close(); + const bytes = (0, bytes_1.encodeUTF8)(JSON.stringify(value) + "\n"); + ctrl.enqueue(bytes); + } catch (err) { + ctrl.error(err); + } + }, + async cancel() { + await iter.return?.(); + } + }); } - return String(V2); }; - conversions["ByteString"] = function(V2, opts) { - const x6 = String(V2); - let c6 = void 0; - for (let i6 = 0; (c6 = x6.codePointAt(i6)) !== void 0; ++i6) { - if (c6 > 255) { - throw new TypeError("Argument is not a valid bytestring"); + exports2.Stream = Stream3; + async function* _iterSSEMessages(response, controller) { + if (!response.body) { + controller.abort(); + if (typeof globalThis.navigator !== "undefined" && globalThis.navigator.product === "ReactNative") { + throw new error_1.OpenAIError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`); } + throw new error_1.OpenAIError(`Attempted to iterate over a response with no body`); } - return x6; - }; - conversions["USVString"] = function(V2) { - const S = String(V2); - const n12 = S.length; - const U2 = []; - for (let i6 = 0; i6 < n12; ++i6) { - const c6 = S.charCodeAt(i6); - if (c6 < 55296 || c6 > 57343) { - U2.push(String.fromCodePoint(c6)); - } else if (56320 <= c6 && c6 <= 57343) { - U2.push(String.fromCodePoint(65533)); - } else { - if (i6 === n12 - 1) { - U2.push(String.fromCodePoint(65533)); - } else { - const d6 = S.charCodeAt(i6 + 1); - if (56320 <= d6 && d6 <= 57343) { - const a6 = c6 & 1023; - const b6 = d6 & 1023; - U2.push(String.fromCodePoint((2 << 15) + (2 << 9) * a6 + b6)); - ++i6; - } else { - U2.push(String.fromCodePoint(65533)); - } - } + const sseDecoder = new SSEDecoder(); + const lineDecoder = new line_1.LineDecoder(); + const iter = (0, shims_2.ReadableStreamToAsyncIterable)(response.body); + for await (const sseChunk of iterSSEChunks(iter)) { + for (const line of lineDecoder.decode(sseChunk)) { + const sse = sseDecoder.decode(line); + if (sse) + yield sse; } } - return U2.join(""); - }; - conversions["Date"] = function(V2, opts) { - if (!(V2 instanceof Date)) { - throw new TypeError("Argument is not a Date object"); + for (const line of lineDecoder.flush()) { + const sse = sseDecoder.decode(line); + if (sse) + yield sse; } - if (isNaN(V2)) { - return void 0; + } + async function* iterSSEChunks(iterator2) { + let data = new Uint8Array(); + for await (const chunk of iterator2) { + if (chunk == null) { + continue; + } + const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk) : typeof chunk === "string" ? (0, bytes_1.encodeUTF8)(chunk) : chunk; + let newData = new Uint8Array(data.length + binaryChunk.length); + newData.set(data); + newData.set(binaryChunk, data.length); + data = newData; + let patternIndex; + while ((patternIndex = (0, line_1.findDoubleNewlineIndex)(data)) !== -1) { + yield data.slice(0, patternIndex); + data = data.slice(patternIndex); + } } - return V2; - }; - conversions["RegExp"] = function(V2, opts) { - if (!(V2 instanceof RegExp)) { - V2 = new RegExp(V2); + if (data.length > 0) { + yield data; + } + } + var SSEDecoder = class { + constructor() { + this.event = null; + this.data = []; + this.chunks = []; + } + decode(line) { + if (line.endsWith("\r")) { + line = line.substring(0, line.length - 1); + } + if (!line) { + if (!this.event && !this.data.length) + return null; + const sse = { + event: this.event, + data: this.data.join("\n"), + raw: this.chunks + }; + this.event = null; + this.data = []; + this.chunks = []; + return sse; + } + this.chunks.push(line); + if (line.startsWith(":")) { + return null; + } + let [fieldname, _3, value] = partition2(line, ":"); + if (value.startsWith(" ")) { + value = value.substring(1); + } + if (fieldname === "event") { + this.event = value; + } else if (fieldname === "data") { + this.data.push(value); + } + return null; } - return V2; }; + function partition2(str, delimiter2) { + const index2 = str.indexOf(delimiter2); + if (index2 !== -1) { + return [str.substring(0, index2), delimiter2, str.substring(index2 + delimiter2.length)]; + } + return [str, "", ""]; + } } }); -// node_modules/whatwg-url/lib/utils.js -var require_utils11 = __commonJS({ - "node_modules/whatwg-url/lib/utils.js"(exports2, module) { +// node_modules/openai/internal/parse.js +var require_parse2 = __commonJS({ + "node_modules/openai/internal/parse.js"(exports2) { "use strict"; - module.exports.mixin = function mixin(target, source) { - const keys = Object.getOwnPropertyNames(source); - for (let i6 = 0; i6 < keys.length; ++i6) { - Object.defineProperty(target, keys[i6], Object.getOwnPropertyDescriptor(source, keys[i6])); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.defaultParseResponse = defaultParseResponse; + exports2.addRequestID = addRequestID; + var streaming_1 = require_streaming(); + var log_1 = require_log2(); + async function defaultParseResponse(client2, props) { + const { response, requestLogID, retryOfRequestLogID, startTime } = props; + const body2 = await (async () => { + if (props.options.stream) { + (0, log_1.loggerFor)(client2).debug("response", response.status, response.url, response.headers, response.body); + if (props.options.__streamClass) { + return props.options.__streamClass.fromSSEResponse(response, props.controller, client2, props.options.__synthesizeEventData); + } + return streaming_1.Stream.fromSSEResponse(response, props.controller, client2, props.options.__synthesizeEventData); + } + if (response.status === 204) { + return null; + } + if (props.options.__binaryResponse) { + return response; + } + const contentType2 = response.headers.get("content-type"); + const mediaType = contentType2?.split(";")[0]?.trim(); + const isJSON = mediaType?.includes("application/json") || mediaType?.endsWith("+json"); + if (isJSON) { + const contentLength2 = response.headers.get("content-length"); + if (contentLength2 === "0") { + return void 0; + } + const json = await response.json(); + return addRequestID(json, response); + } + const text = await response.text(); + return text; + })(); + (0, log_1.loggerFor)(client2).debug(`[${requestLogID}] response parsed`, (0, log_1.formatRequestDetails)({ + retryOfRequestLogID, + url: response.url, + status: response.status, + body: body2, + durationMs: Date.now() - startTime + })); + return body2; + } + function addRequestID(value, response) { + if (!value || typeof value !== "object" || Array.isArray(value)) { + return value; } - }; - module.exports.wrapperSymbol = /* @__PURE__ */ Symbol("wrapper"); - module.exports.implSymbol = /* @__PURE__ */ Symbol("impl"); - module.exports.wrapperForImpl = function(impl) { - return impl[module.exports.wrapperSymbol]; - }; - module.exports.implForWrapper = function(wrapper) { - return wrapper[module.exports.implSymbol]; - }; - } -}); - -// node_modules/tr46/lib/mappingTable.json -var require_mappingTable = __commonJS({ - "node_modules/tr46/lib/mappingTable.json"(exports2, module) { - module.exports = [[[0, 44], "disallowed_STD3_valid"], [[45, 46], "valid"], [[47, 47], "disallowed_STD3_valid"], [[48, 57], "valid"], [[58, 64], "disallowed_STD3_valid"], [[65, 65], "mapped", [97]], [[66, 66], "mapped", [98]], [[67, 67], "mapped", [99]], [[68, 68], "mapped", [100]], [[69, 69], "mapped", [101]], [[70, 70], "mapped", [102]], [[71, 71], "mapped", [103]], [[72, 72], "mapped", [104]], [[73, 73], "mapped", [105]], [[74, 74], "mapped", [106]], [[75, 75], "mapped", [107]], [[76, 76], "mapped", [108]], [[77, 77], "mapped", [109]], [[78, 78], "mapped", [110]], [[79, 79], "mapped", [111]], [[80, 80], "mapped", [112]], [[81, 81], "mapped", [113]], [[82, 82], "mapped", [114]], [[83, 83], "mapped", [115]], [[84, 84], "mapped", [116]], [[85, 85], "mapped", [117]], [[86, 86], "mapped", [118]], [[87, 87], "mapped", [119]], [[88, 88], "mapped", [120]], [[89, 89], "mapped", [121]], [[90, 90], "mapped", [122]], [[91, 96], "disallowed_STD3_valid"], [[97, 122], "valid"], [[123, 127], "disallowed_STD3_valid"], [[128, 159], "disallowed"], [[160, 160], "disallowed_STD3_mapped", [32]], [[161, 167], "valid", [], "NV8"], [[168, 168], "disallowed_STD3_mapped", [32, 776]], [[169, 169], "valid", [], "NV8"], [[170, 170], "mapped", [97]], [[171, 172], "valid", [], "NV8"], [[173, 173], "ignored"], [[174, 174], "valid", [], "NV8"], [[175, 175], "disallowed_STD3_mapped", [32, 772]], [[176, 177], "valid", [], "NV8"], [[178, 178], "mapped", [50]], [[179, 179], "mapped", [51]], [[180, 180], "disallowed_STD3_mapped", [32, 769]], [[181, 181], "mapped", [956]], [[182, 182], "valid", [], "NV8"], [[183, 183], "valid"], [[184, 184], "disallowed_STD3_mapped", [32, 807]], [[185, 185], "mapped", [49]], [[186, 186], "mapped", [111]], [[187, 187], "valid", [], "NV8"], [[188, 188], "mapped", [49, 8260, 52]], [[189, 189], "mapped", [49, 8260, 50]], [[190, 190], "mapped", [51, 8260, 52]], [[191, 191], "valid", [], "NV8"], [[192, 192], "mapped", [224]], [[193, 193], "mapped", [225]], [[194, 194], "mapped", [226]], [[195, 195], "mapped", [227]], [[196, 196], "mapped", [228]], [[197, 197], "mapped", [229]], [[198, 198], "mapped", [230]], [[199, 199], "mapped", [231]], [[200, 200], "mapped", [232]], [[201, 201], "mapped", [233]], [[202, 202], "mapped", [234]], [[203, 203], "mapped", [235]], [[204, 204], "mapped", [236]], [[205, 205], "mapped", [237]], [[206, 206], "mapped", [238]], [[207, 207], "mapped", [239]], [[208, 208], "mapped", [240]], [[209, 209], "mapped", [241]], [[210, 210], "mapped", [242]], [[211, 211], "mapped", [243]], [[212, 212], "mapped", [244]], [[213, 213], "mapped", [245]], [[214, 214], "mapped", [246]], [[215, 215], "valid", [], "NV8"], [[216, 216], "mapped", [248]], [[217, 217], "mapped", [249]], [[218, 218], "mapped", [250]], [[219, 219], "mapped", [251]], [[220, 220], "mapped", [252]], [[221, 221], "mapped", [253]], [[222, 222], "mapped", [254]], [[223, 223], "deviation", [115, 115]], [[224, 246], "valid"], [[247, 247], "valid", [], "NV8"], [[248, 255], "valid"], [[256, 256], "mapped", [257]], [[257, 257], "valid"], [[258, 258], "mapped", [259]], [[259, 259], "valid"], [[260, 260], "mapped", [261]], [[261, 261], "valid"], [[262, 262], "mapped", [263]], [[263, 263], "valid"], [[264, 264], "mapped", [265]], [[265, 265], "valid"], [[266, 266], "mapped", [267]], [[267, 267], "valid"], [[268, 268], "mapped", [269]], [[269, 269], "valid"], [[270, 270], "mapped", [271]], [[271, 271], "valid"], [[272, 272], "mapped", [273]], [[273, 273], "valid"], [[274, 274], "mapped", [275]], [[275, 275], "valid"], [[276, 276], "mapped", [277]], [[277, 277], "valid"], [[278, 278], "mapped", [279]], [[279, 279], "valid"], [[280, 280], "mapped", [281]], [[281, 281], "valid"], [[282, 282], "mapped", [283]], [[283, 283], "valid"], [[284, 284], "mapped", [285]], [[285, 285], "valid"], [[286, 286], "mapped", [287]], [[287, 287], "valid"], [[288, 288], "mapped", [289]], [[289, 289], "valid"], [[290, 290], "mapped", [291]], [[291, 291], "valid"], [[292, 292], "mapped", [293]], [[293, 293], "valid"], [[294, 294], "mapped", [295]], [[295, 295], "valid"], [[296, 296], "mapped", [297]], [[297, 297], "valid"], [[298, 298], "mapped", [299]], [[299, 299], "valid"], [[300, 300], "mapped", [301]], [[301, 301], "valid"], [[302, 302], "mapped", [303]], [[303, 303], "valid"], [[304, 304], "mapped", [105, 775]], [[305, 305], "valid"], [[306, 307], "mapped", [105, 106]], [[308, 308], "mapped", [309]], [[309, 309], "valid"], [[310, 310], "mapped", [311]], [[311, 312], "valid"], [[313, 313], "mapped", [314]], [[314, 314], "valid"], [[315, 315], "mapped", [316]], [[316, 316], "valid"], [[317, 317], "mapped", [318]], [[318, 318], "valid"], [[319, 320], "mapped", [108, 183]], [[321, 321], "mapped", [322]], [[322, 322], "valid"], [[323, 323], "mapped", [324]], [[324, 324], "valid"], [[325, 325], "mapped", [326]], [[326, 326], "valid"], [[327, 327], "mapped", [328]], [[328, 328], "valid"], [[329, 329], "mapped", [700, 110]], [[330, 330], "mapped", [331]], [[331, 331], "valid"], [[332, 332], "mapped", [333]], [[333, 333], "valid"], [[334, 334], "mapped", [335]], [[335, 335], "valid"], [[336, 336], "mapped", [337]], [[337, 337], "valid"], [[338, 338], "mapped", [339]], [[339, 339], "valid"], [[340, 340], "mapped", [341]], [[341, 341], "valid"], [[342, 342], "mapped", [343]], [[343, 343], "valid"], [[344, 344], "mapped", [345]], [[345, 345], "valid"], [[346, 346], "mapped", [347]], [[347, 347], "valid"], [[348, 348], "mapped", [349]], [[349, 349], "valid"], [[350, 350], "mapped", [351]], [[351, 351], "valid"], [[352, 352], "mapped", [353]], [[353, 353], "valid"], [[354, 354], "mapped", [355]], [[355, 355], "valid"], [[356, 356], "mapped", [357]], [[357, 357], "valid"], [[358, 358], "mapped", [359]], [[359, 359], "valid"], [[360, 360], "mapped", [361]], [[361, 361], "valid"], [[362, 362], "mapped", [363]], [[363, 363], "valid"], [[364, 364], "mapped", [365]], [[365, 365], "valid"], [[366, 366], "mapped", [367]], [[367, 367], "valid"], [[368, 368], "mapped", [369]], [[369, 369], "valid"], [[370, 370], "mapped", [371]], [[371, 371], "valid"], [[372, 372], "mapped", [373]], [[373, 373], "valid"], [[374, 374], "mapped", [375]], [[375, 375], "valid"], [[376, 376], "mapped", [255]], [[377, 377], "mapped", [378]], [[378, 378], "valid"], [[379, 379], "mapped", [380]], [[380, 380], "valid"], [[381, 381], "mapped", [382]], [[382, 382], "valid"], [[383, 383], "mapped", [115]], [[384, 384], "valid"], [[385, 385], "mapped", [595]], [[386, 386], "mapped", [387]], [[387, 387], "valid"], [[388, 388], "mapped", [389]], [[389, 389], "valid"], [[390, 390], "mapped", [596]], [[391, 391], "mapped", [392]], [[392, 392], "valid"], [[393, 393], "mapped", [598]], [[394, 394], "mapped", [599]], [[395, 395], "mapped", [396]], [[396, 397], "valid"], [[398, 398], "mapped", [477]], [[399, 399], "mapped", [601]], [[400, 400], "mapped", [603]], [[401, 401], "mapped", [402]], [[402, 402], "valid"], [[403, 403], "mapped", [608]], [[404, 404], "mapped", [611]], [[405, 405], "valid"], [[406, 406], "mapped", [617]], [[407, 407], "mapped", [616]], [[408, 408], "mapped", [409]], [[409, 411], "valid"], [[412, 412], "mapped", [623]], [[413, 413], "mapped", [626]], [[414, 414], "valid"], [[415, 415], "mapped", [629]], [[416, 416], "mapped", [417]], [[417, 417], "valid"], [[418, 418], "mapped", [419]], [[419, 419], "valid"], [[420, 420], "mapped", [421]], [[421, 421], "valid"], [[422, 422], "mapped", [640]], [[423, 423], "mapped", [424]], [[424, 424], "valid"], [[425, 425], "mapped", [643]], [[426, 427], "valid"], [[428, 428], "mapped", [429]], [[429, 429], "valid"], [[430, 430], "mapped", [648]], [[431, 431], "mapped", [432]], [[432, 432], "valid"], [[433, 433], "mapped", [650]], [[434, 434], "mapped", [651]], [[435, 435], "mapped", [436]], [[436, 436], "valid"], [[437, 437], "mapped", [438]], [[438, 438], "valid"], [[439, 439], "mapped", [658]], [[440, 440], "mapped", [441]], [[441, 443], "valid"], [[444, 444], "mapped", [445]], [[445, 451], "valid"], [[452, 454], "mapped", [100, 382]], [[455, 457], "mapped", [108, 106]], [[458, 460], "mapped", [110, 106]], [[461, 461], "mapped", [462]], [[462, 462], "valid"], [[463, 463], "mapped", [464]], [[464, 464], "valid"], [[465, 465], "mapped", [466]], [[466, 466], "valid"], [[467, 467], "mapped", [468]], [[468, 468], "valid"], [[469, 469], "mapped", [470]], [[470, 470], "valid"], [[471, 471], "mapped", [472]], [[472, 472], "valid"], [[473, 473], "mapped", [474]], [[474, 474], "valid"], [[475, 475], "mapped", [476]], [[476, 477], "valid"], [[478, 478], "mapped", [479]], [[479, 479], "valid"], [[480, 480], "mapped", [481]], [[481, 481], "valid"], [[482, 482], "mapped", [483]], [[483, 483], "valid"], [[484, 484], "mapped", [485]], [[485, 485], "valid"], [[486, 486], "mapped", [487]], [[487, 487], "valid"], [[488, 488], "mapped", [489]], [[489, 489], "valid"], [[490, 490], "mapped", [491]], [[491, 491], "valid"], [[492, 492], "mapped", [493]], [[493, 493], "valid"], [[494, 494], "mapped", [495]], [[495, 496], "valid"], [[497, 499], "mapped", [100, 122]], [[500, 500], "mapped", [501]], [[501, 501], "valid"], [[502, 502], "mapped", [405]], [[503, 503], "mapped", [447]], [[504, 504], "mapped", [505]], [[505, 505], "valid"], [[506, 506], "mapped", [507]], [[507, 507], "valid"], [[508, 508], "mapped", [509]], [[509, 509], "valid"], [[510, 510], "mapped", [511]], [[511, 511], "valid"], [[512, 512], "mapped", [513]], [[513, 513], "valid"], [[514, 514], "mapped", [515]], [[515, 515], "valid"], [[516, 516], "mapped", [517]], [[517, 517], "valid"], [[518, 518], "mapped", [519]], [[519, 519], "valid"], [[520, 520], "mapped", [521]], [[521, 521], "valid"], [[522, 522], "mapped", [523]], [[523, 523], "valid"], [[524, 524], "mapped", [525]], [[525, 525], "valid"], [[526, 526], "mapped", [527]], [[527, 527], "valid"], [[528, 528], "mapped", [529]], [[529, 529], "valid"], [[530, 530], "mapped", [531]], [[531, 531], "valid"], [[532, 532], "mapped", [533]], [[533, 533], "valid"], [[534, 534], "mapped", [535]], [[535, 535], "valid"], [[536, 536], "mapped", [537]], [[537, 537], "valid"], [[538, 538], "mapped", [539]], [[539, 539], "valid"], [[540, 540], "mapped", [541]], [[541, 541], "valid"], [[542, 542], "mapped", [543]], [[543, 543], "valid"], [[544, 544], "mapped", [414]], [[545, 545], "valid"], [[546, 546], "mapped", [547]], [[547, 547], "valid"], [[548, 548], "mapped", [549]], [[549, 549], "valid"], [[550, 550], "mapped", [551]], [[551, 551], "valid"], [[552, 552], "mapped", [553]], [[553, 553], "valid"], [[554, 554], "mapped", [555]], [[555, 555], "valid"], [[556, 556], "mapped", [557]], [[557, 557], "valid"], [[558, 558], "mapped", [559]], [[559, 559], "valid"], [[560, 560], "mapped", [561]], [[561, 561], "valid"], [[562, 562], "mapped", [563]], [[563, 563], "valid"], [[564, 566], "valid"], [[567, 569], "valid"], [[570, 570], "mapped", [11365]], [[571, 571], "mapped", [572]], [[572, 572], "valid"], [[573, 573], "mapped", [410]], [[574, 574], "mapped", [11366]], [[575, 576], "valid"], [[577, 577], "mapped", [578]], [[578, 578], "valid"], [[579, 579], "mapped", [384]], [[580, 580], "mapped", [649]], [[581, 581], "mapped", [652]], [[582, 582], "mapped", [583]], [[583, 583], "valid"], [[584, 584], "mapped", [585]], [[585, 585], "valid"], [[586, 586], "mapped", [587]], [[587, 587], "valid"], [[588, 588], "mapped", [589]], [[589, 589], "valid"], [[590, 590], "mapped", [591]], [[591, 591], "valid"], [[592, 680], "valid"], [[681, 685], "valid"], [[686, 687], "valid"], [[688, 688], "mapped", [104]], [[689, 689], "mapped", [614]], [[690, 690], "mapped", [106]], [[691, 691], "mapped", [114]], [[692, 692], "mapped", [633]], [[693, 693], "mapped", [635]], [[694, 694], "mapped", [641]], [[695, 695], "mapped", [119]], [[696, 696], "mapped", [121]], [[697, 705], "valid"], [[706, 709], "valid", [], "NV8"], [[710, 721], "valid"], [[722, 727], "valid", [], "NV8"], [[728, 728], "disallowed_STD3_mapped", [32, 774]], [[729, 729], "disallowed_STD3_mapped", [32, 775]], [[730, 730], "disallowed_STD3_mapped", [32, 778]], [[731, 731], "disallowed_STD3_mapped", [32, 808]], [[732, 732], "disallowed_STD3_mapped", [32, 771]], [[733, 733], "disallowed_STD3_mapped", [32, 779]], [[734, 734], "valid", [], "NV8"], [[735, 735], "valid", [], "NV8"], [[736, 736], "mapped", [611]], [[737, 737], "mapped", [108]], [[738, 738], "mapped", [115]], [[739, 739], "mapped", [120]], [[740, 740], "mapped", [661]], [[741, 745], "valid", [], "NV8"], [[746, 747], "valid", [], "NV8"], [[748, 748], "valid"], [[749, 749], "valid", [], "NV8"], [[750, 750], "valid"], [[751, 767], "valid", [], "NV8"], [[768, 831], "valid"], [[832, 832], "mapped", [768]], [[833, 833], "mapped", [769]], [[834, 834], "valid"], [[835, 835], "mapped", [787]], [[836, 836], "mapped", [776, 769]], [[837, 837], "mapped", [953]], [[838, 846], "valid"], [[847, 847], "ignored"], [[848, 855], "valid"], [[856, 860], "valid"], [[861, 863], "valid"], [[864, 865], "valid"], [[866, 866], "valid"], [[867, 879], "valid"], [[880, 880], "mapped", [881]], [[881, 881], "valid"], [[882, 882], "mapped", [883]], [[883, 883], "valid"], [[884, 884], "mapped", [697]], [[885, 885], "valid"], [[886, 886], "mapped", [887]], [[887, 887], "valid"], [[888, 889], "disallowed"], [[890, 890], "disallowed_STD3_mapped", [32, 953]], [[891, 893], "valid"], [[894, 894], "disallowed_STD3_mapped", [59]], [[895, 895], "mapped", [1011]], [[896, 899], "disallowed"], [[900, 900], "disallowed_STD3_mapped", [32, 769]], [[901, 901], "disallowed_STD3_mapped", [32, 776, 769]], [[902, 902], "mapped", [940]], [[903, 903], "mapped", [183]], [[904, 904], "mapped", [941]], [[905, 905], "mapped", [942]], [[906, 906], "mapped", [943]], [[907, 907], "disallowed"], [[908, 908], "mapped", [972]], [[909, 909], "disallowed"], [[910, 910], "mapped", [973]], [[911, 911], "mapped", [974]], [[912, 912], "valid"], [[913, 913], "mapped", [945]], [[914, 914], "mapped", [946]], [[915, 915], "mapped", [947]], [[916, 916], "mapped", [948]], [[917, 917], "mapped", [949]], [[918, 918], "mapped", [950]], [[919, 919], "mapped", [951]], [[920, 920], "mapped", [952]], [[921, 921], "mapped", [953]], [[922, 922], "mapped", [954]], [[923, 923], "mapped", [955]], [[924, 924], "mapped", [956]], [[925, 925], "mapped", [957]], [[926, 926], "mapped", [958]], [[927, 927], "mapped", [959]], [[928, 928], "mapped", [960]], [[929, 929], "mapped", [961]], [[930, 930], "disallowed"], [[931, 931], "mapped", [963]], [[932, 932], "mapped", [964]], [[933, 933], "mapped", [965]], [[934, 934], "mapped", [966]], [[935, 935], "mapped", [967]], [[936, 936], "mapped", [968]], [[937, 937], "mapped", [969]], [[938, 938], "mapped", [970]], [[939, 939], "mapped", [971]], [[940, 961], "valid"], [[962, 962], "deviation", [963]], [[963, 974], "valid"], [[975, 975], "mapped", [983]], [[976, 976], "mapped", [946]], [[977, 977], "mapped", [952]], [[978, 978], "mapped", [965]], [[979, 979], "mapped", [973]], [[980, 980], "mapped", [971]], [[981, 981], "mapped", [966]], [[982, 982], "mapped", [960]], [[983, 983], "valid"], [[984, 984], "mapped", [985]], [[985, 985], "valid"], [[986, 986], "mapped", [987]], [[987, 987], "valid"], [[988, 988], "mapped", [989]], [[989, 989], "valid"], [[990, 990], "mapped", [991]], [[991, 991], "valid"], [[992, 992], "mapped", [993]], [[993, 993], "valid"], [[994, 994], "mapped", [995]], [[995, 995], "valid"], [[996, 996], "mapped", [997]], [[997, 997], "valid"], [[998, 998], "mapped", [999]], [[999, 999], "valid"], [[1e3, 1e3], "mapped", [1001]], [[1001, 1001], "valid"], [[1002, 1002], "mapped", [1003]], [[1003, 1003], "valid"], [[1004, 1004], "mapped", [1005]], [[1005, 1005], "valid"], [[1006, 1006], "mapped", [1007]], [[1007, 1007], "valid"], [[1008, 1008], "mapped", [954]], [[1009, 1009], "mapped", [961]], [[1010, 1010], "mapped", [963]], [[1011, 1011], "valid"], [[1012, 1012], "mapped", [952]], [[1013, 1013], "mapped", [949]], [[1014, 1014], "valid", [], "NV8"], [[1015, 1015], "mapped", [1016]], [[1016, 1016], "valid"], [[1017, 1017], "mapped", [963]], [[1018, 1018], "mapped", [1019]], [[1019, 1019], "valid"], [[1020, 1020], "valid"], [[1021, 1021], "mapped", [891]], [[1022, 1022], "mapped", [892]], [[1023, 1023], "mapped", [893]], [[1024, 1024], "mapped", [1104]], [[1025, 1025], "mapped", [1105]], [[1026, 1026], "mapped", [1106]], [[1027, 1027], "mapped", [1107]], [[1028, 1028], "mapped", [1108]], [[1029, 1029], "mapped", [1109]], [[1030, 1030], "mapped", [1110]], [[1031, 1031], "mapped", [1111]], [[1032, 1032], "mapped", [1112]], [[1033, 1033], "mapped", [1113]], [[1034, 1034], "mapped", [1114]], [[1035, 1035], "mapped", [1115]], [[1036, 1036], "mapped", [1116]], [[1037, 1037], "mapped", [1117]], [[1038, 1038], "mapped", [1118]], [[1039, 1039], "mapped", [1119]], [[1040, 1040], "mapped", [1072]], [[1041, 1041], "mapped", [1073]], [[1042, 1042], "mapped", [1074]], [[1043, 1043], "mapped", [1075]], [[1044, 1044], "mapped", [1076]], [[1045, 1045], "mapped", [1077]], [[1046, 1046], "mapped", [1078]], [[1047, 1047], "mapped", [1079]], [[1048, 1048], "mapped", [1080]], [[1049, 1049], "mapped", [1081]], [[1050, 1050], "mapped", [1082]], [[1051, 1051], "mapped", [1083]], [[1052, 1052], "mapped", [1084]], [[1053, 1053], "mapped", [1085]], [[1054, 1054], "mapped", [1086]], [[1055, 1055], "mapped", [1087]], [[1056, 1056], "mapped", [1088]], [[1057, 1057], "mapped", [1089]], [[1058, 1058], "mapped", [1090]], [[1059, 1059], "mapped", [1091]], [[1060, 1060], "mapped", [1092]], [[1061, 1061], "mapped", [1093]], [[1062, 1062], "mapped", [1094]], [[1063, 1063], "mapped", [1095]], [[1064, 1064], "mapped", [1096]], [[1065, 1065], "mapped", [1097]], [[1066, 1066], "mapped", [1098]], [[1067, 1067], "mapped", [1099]], [[1068, 1068], "mapped", [1100]], [[1069, 1069], "mapped", [1101]], [[1070, 1070], "mapped", [1102]], [[1071, 1071], "mapped", [1103]], [[1072, 1103], "valid"], [[1104, 1104], "valid"], [[1105, 1116], "valid"], [[1117, 1117], "valid"], [[1118, 1119], "valid"], [[1120, 1120], "mapped", [1121]], [[1121, 1121], "valid"], [[1122, 1122], "mapped", [1123]], [[1123, 1123], "valid"], [[1124, 1124], "mapped", [1125]], [[1125, 1125], "valid"], [[1126, 1126], "mapped", [1127]], [[1127, 1127], "valid"], [[1128, 1128], "mapped", [1129]], [[1129, 1129], "valid"], [[1130, 1130], "mapped", [1131]], [[1131, 1131], "valid"], [[1132, 1132], "mapped", [1133]], [[1133, 1133], "valid"], [[1134, 1134], "mapped", [1135]], [[1135, 1135], "valid"], [[1136, 1136], "mapped", [1137]], [[1137, 1137], "valid"], [[1138, 1138], "mapped", [1139]], [[1139, 1139], "valid"], [[1140, 1140], "mapped", [1141]], [[1141, 1141], "valid"], [[1142, 1142], "mapped", [1143]], [[1143, 1143], "valid"], [[1144, 1144], "mapped", [1145]], [[1145, 1145], "valid"], [[1146, 1146], "mapped", [1147]], [[1147, 1147], "valid"], [[1148, 1148], "mapped", [1149]], [[1149, 1149], "valid"], [[1150, 1150], "mapped", [1151]], [[1151, 1151], "valid"], [[1152, 1152], "mapped", [1153]], [[1153, 1153], "valid"], [[1154, 1154], "valid", [], "NV8"], [[1155, 1158], "valid"], [[1159, 1159], "valid"], [[1160, 1161], "valid", [], "NV8"], [[1162, 1162], "mapped", [1163]], [[1163, 1163], "valid"], [[1164, 1164], "mapped", [1165]], [[1165, 1165], "valid"], [[1166, 1166], "mapped", [1167]], [[1167, 1167], "valid"], [[1168, 1168], "mapped", [1169]], [[1169, 1169], "valid"], [[1170, 1170], "mapped", [1171]], [[1171, 1171], "valid"], [[1172, 1172], "mapped", [1173]], [[1173, 1173], "valid"], [[1174, 1174], "mapped", [1175]], [[1175, 1175], "valid"], [[1176, 1176], "mapped", [1177]], [[1177, 1177], "valid"], [[1178, 1178], "mapped", [1179]], [[1179, 1179], "valid"], [[1180, 1180], "mapped", [1181]], [[1181, 1181], "valid"], [[1182, 1182], "mapped", [1183]], [[1183, 1183], "valid"], [[1184, 1184], "mapped", [1185]], [[1185, 1185], "valid"], [[1186, 1186], "mapped", [1187]], [[1187, 1187], "valid"], [[1188, 1188], "mapped", [1189]], [[1189, 1189], "valid"], [[1190, 1190], "mapped", [1191]], [[1191, 1191], "valid"], [[1192, 1192], "mapped", [1193]], [[1193, 1193], "valid"], [[1194, 1194], "mapped", [1195]], [[1195, 1195], "valid"], [[1196, 1196], "mapped", [1197]], [[1197, 1197], "valid"], [[1198, 1198], "mapped", [1199]], [[1199, 1199], "valid"], [[1200, 1200], "mapped", [1201]], [[1201, 1201], "valid"], [[1202, 1202], "mapped", [1203]], [[1203, 1203], "valid"], [[1204, 1204], "mapped", [1205]], [[1205, 1205], "valid"], [[1206, 1206], "mapped", [1207]], [[1207, 1207], "valid"], [[1208, 1208], "mapped", [1209]], [[1209, 1209], "valid"], [[1210, 1210], "mapped", [1211]], [[1211, 1211], "valid"], [[1212, 1212], "mapped", [1213]], [[1213, 1213], "valid"], [[1214, 1214], "mapped", [1215]], [[1215, 1215], "valid"], [[1216, 1216], "disallowed"], [[1217, 1217], "mapped", [1218]], [[1218, 1218], "valid"], [[1219, 1219], "mapped", [1220]], [[1220, 1220], "valid"], [[1221, 1221], "mapped", [1222]], [[1222, 1222], "valid"], [[1223, 1223], "mapped", [1224]], [[1224, 1224], "valid"], [[1225, 1225], "mapped", [1226]], [[1226, 1226], "valid"], [[1227, 1227], "mapped", [1228]], [[1228, 1228], "valid"], [[1229, 1229], "mapped", [1230]], [[1230, 1230], "valid"], [[1231, 1231], "valid"], [[1232, 1232], "mapped", [1233]], [[1233, 1233], "valid"], [[1234, 1234], "mapped", [1235]], [[1235, 1235], "valid"], [[1236, 1236], "mapped", [1237]], [[1237, 1237], "valid"], [[1238, 1238], "mapped", [1239]], [[1239, 1239], "valid"], [[1240, 1240], "mapped", [1241]], [[1241, 1241], "valid"], [[1242, 1242], "mapped", [1243]], [[1243, 1243], "valid"], [[1244, 1244], "mapped", [1245]], [[1245, 1245], "valid"], [[1246, 1246], "mapped", [1247]], [[1247, 1247], "valid"], [[1248, 1248], "mapped", [1249]], [[1249, 1249], "valid"], [[1250, 1250], "mapped", [1251]], [[1251, 1251], "valid"], [[1252, 1252], "mapped", [1253]], [[1253, 1253], "valid"], [[1254, 1254], "mapped", [1255]], [[1255, 1255], "valid"], [[1256, 1256], "mapped", [1257]], [[1257, 1257], "valid"], [[1258, 1258], "mapped", [1259]], [[1259, 1259], "valid"], [[1260, 1260], "mapped", [1261]], [[1261, 1261], "valid"], [[1262, 1262], "mapped", [1263]], [[1263, 1263], "valid"], [[1264, 1264], "mapped", [1265]], [[1265, 1265], "valid"], [[1266, 1266], "mapped", [1267]], [[1267, 1267], "valid"], [[1268, 1268], "mapped", [1269]], [[1269, 1269], "valid"], [[1270, 1270], "mapped", [1271]], [[1271, 1271], "valid"], [[1272, 1272], "mapped", [1273]], [[1273, 1273], "valid"], [[1274, 1274], "mapped", [1275]], [[1275, 1275], "valid"], [[1276, 1276], "mapped", [1277]], [[1277, 1277], "valid"], [[1278, 1278], "mapped", [1279]], [[1279, 1279], "valid"], [[1280, 1280], "mapped", [1281]], [[1281, 1281], "valid"], [[1282, 1282], "mapped", [1283]], [[1283, 1283], "valid"], [[1284, 1284], "mapped", [1285]], [[1285, 1285], "valid"], [[1286, 1286], "mapped", [1287]], [[1287, 1287], "valid"], [[1288, 1288], "mapped", [1289]], [[1289, 1289], "valid"], [[1290, 1290], "mapped", [1291]], [[1291, 1291], "valid"], [[1292, 1292], "mapped", [1293]], [[1293, 1293], "valid"], [[1294, 1294], "mapped", [1295]], [[1295, 1295], "valid"], [[1296, 1296], "mapped", [1297]], [[1297, 1297], "valid"], [[1298, 1298], "mapped", [1299]], [[1299, 1299], "valid"], [[1300, 1300], "mapped", [1301]], [[1301, 1301], "valid"], [[1302, 1302], "mapped", [1303]], [[1303, 1303], "valid"], [[1304, 1304], "mapped", [1305]], [[1305, 1305], "valid"], [[1306, 1306], "mapped", [1307]], [[1307, 1307], "valid"], [[1308, 1308], "mapped", [1309]], [[1309, 1309], "valid"], [[1310, 1310], "mapped", [1311]], [[1311, 1311], "valid"], [[1312, 1312], "mapped", [1313]], [[1313, 1313], "valid"], [[1314, 1314], "mapped", [1315]], [[1315, 1315], "valid"], [[1316, 1316], "mapped", [1317]], [[1317, 1317], "valid"], [[1318, 1318], "mapped", [1319]], [[1319, 1319], "valid"], [[1320, 1320], "mapped", [1321]], [[1321, 1321], "valid"], [[1322, 1322], "mapped", [1323]], [[1323, 1323], "valid"], [[1324, 1324], "mapped", [1325]], [[1325, 1325], "valid"], [[1326, 1326], "mapped", [1327]], [[1327, 1327], "valid"], [[1328, 1328], "disallowed"], [[1329, 1329], "mapped", [1377]], [[1330, 1330], "mapped", [1378]], [[1331, 1331], "mapped", [1379]], [[1332, 1332], "mapped", [1380]], [[1333, 1333], "mapped", [1381]], [[1334, 1334], "mapped", [1382]], [[1335, 1335], "mapped", [1383]], [[1336, 1336], "mapped", [1384]], [[1337, 1337], "mapped", [1385]], [[1338, 1338], "mapped", [1386]], [[1339, 1339], "mapped", [1387]], [[1340, 1340], "mapped", [1388]], [[1341, 1341], "mapped", [1389]], [[1342, 1342], "mapped", [1390]], [[1343, 1343], "mapped", [1391]], [[1344, 1344], "mapped", [1392]], [[1345, 1345], "mapped", [1393]], [[1346, 1346], "mapped", [1394]], [[1347, 1347], "mapped", [1395]], [[1348, 1348], "mapped", [1396]], [[1349, 1349], "mapped", [1397]], [[1350, 1350], "mapped", [1398]], [[1351, 1351], "mapped", [1399]], [[1352, 1352], "mapped", [1400]], [[1353, 1353], "mapped", [1401]], [[1354, 1354], "mapped", [1402]], [[1355, 1355], "mapped", [1403]], [[1356, 1356], "mapped", [1404]], [[1357, 1357], "mapped", [1405]], [[1358, 1358], "mapped", [1406]], [[1359, 1359], "mapped", [1407]], [[1360, 1360], "mapped", [1408]], [[1361, 1361], "mapped", [1409]], [[1362, 1362], "mapped", [1410]], [[1363, 1363], "mapped", [1411]], [[1364, 1364], "mapped", [1412]], [[1365, 1365], "mapped", [1413]], [[1366, 1366], "mapped", [1414]], [[1367, 1368], "disallowed"], [[1369, 1369], "valid"], [[1370, 1375], "valid", [], "NV8"], [[1376, 1376], "disallowed"], [[1377, 1414], "valid"], [[1415, 1415], "mapped", [1381, 1410]], [[1416, 1416], "disallowed"], [[1417, 1417], "valid", [], "NV8"], [[1418, 1418], "valid", [], "NV8"], [[1419, 1420], "disallowed"], [[1421, 1422], "valid", [], "NV8"], [[1423, 1423], "valid", [], "NV8"], [[1424, 1424], "disallowed"], [[1425, 1441], "valid"], [[1442, 1442], "valid"], [[1443, 1455], "valid"], [[1456, 1465], "valid"], [[1466, 1466], "valid"], [[1467, 1469], "valid"], [[1470, 1470], "valid", [], "NV8"], [[1471, 1471], "valid"], [[1472, 1472], "valid", [], "NV8"], [[1473, 1474], "valid"], [[1475, 1475], "valid", [], "NV8"], [[1476, 1476], "valid"], [[1477, 1477], "valid"], [[1478, 1478], "valid", [], "NV8"], [[1479, 1479], "valid"], [[1480, 1487], "disallowed"], [[1488, 1514], "valid"], [[1515, 1519], "disallowed"], [[1520, 1524], "valid"], [[1525, 1535], "disallowed"], [[1536, 1539], "disallowed"], [[1540, 1540], "disallowed"], [[1541, 1541], "disallowed"], [[1542, 1546], "valid", [], "NV8"], [[1547, 1547], "valid", [], "NV8"], [[1548, 1548], "valid", [], "NV8"], [[1549, 1551], "valid", [], "NV8"], [[1552, 1557], "valid"], [[1558, 1562], "valid"], [[1563, 1563], "valid", [], "NV8"], [[1564, 1564], "disallowed"], [[1565, 1565], "disallowed"], [[1566, 1566], "valid", [], "NV8"], [[1567, 1567], "valid", [], "NV8"], [[1568, 1568], "valid"], [[1569, 1594], "valid"], [[1595, 1599], "valid"], [[1600, 1600], "valid", [], "NV8"], [[1601, 1618], "valid"], [[1619, 1621], "valid"], [[1622, 1624], "valid"], [[1625, 1630], "valid"], [[1631, 1631], "valid"], [[1632, 1641], "valid"], [[1642, 1645], "valid", [], "NV8"], [[1646, 1647], "valid"], [[1648, 1652], "valid"], [[1653, 1653], "mapped", [1575, 1652]], [[1654, 1654], "mapped", [1608, 1652]], [[1655, 1655], "mapped", [1735, 1652]], [[1656, 1656], "mapped", [1610, 1652]], [[1657, 1719], "valid"], [[1720, 1721], "valid"], [[1722, 1726], "valid"], [[1727, 1727], "valid"], [[1728, 1742], "valid"], [[1743, 1743], "valid"], [[1744, 1747], "valid"], [[1748, 1748], "valid", [], "NV8"], [[1749, 1756], "valid"], [[1757, 1757], "disallowed"], [[1758, 1758], "valid", [], "NV8"], [[1759, 1768], "valid"], [[1769, 1769], "valid", [], "NV8"], [[1770, 1773], "valid"], [[1774, 1775], "valid"], [[1776, 1785], "valid"], [[1786, 1790], "valid"], [[1791, 1791], "valid"], [[1792, 1805], "valid", [], "NV8"], [[1806, 1806], "disallowed"], [[1807, 1807], "disallowed"], [[1808, 1836], "valid"], [[1837, 1839], "valid"], [[1840, 1866], "valid"], [[1867, 1868], "disallowed"], [[1869, 1871], "valid"], [[1872, 1901], "valid"], [[1902, 1919], "valid"], [[1920, 1968], "valid"], [[1969, 1969], "valid"], [[1970, 1983], "disallowed"], [[1984, 2037], "valid"], [[2038, 2042], "valid", [], "NV8"], [[2043, 2047], "disallowed"], [[2048, 2093], "valid"], [[2094, 2095], "disallowed"], [[2096, 2110], "valid", [], "NV8"], [[2111, 2111], "disallowed"], [[2112, 2139], "valid"], [[2140, 2141], "disallowed"], [[2142, 2142], "valid", [], "NV8"], [[2143, 2207], "disallowed"], [[2208, 2208], "valid"], [[2209, 2209], "valid"], [[2210, 2220], "valid"], [[2221, 2226], "valid"], [[2227, 2228], "valid"], [[2229, 2274], "disallowed"], [[2275, 2275], "valid"], [[2276, 2302], "valid"], [[2303, 2303], "valid"], [[2304, 2304], "valid"], [[2305, 2307], "valid"], [[2308, 2308], "valid"], [[2309, 2361], "valid"], [[2362, 2363], "valid"], [[2364, 2381], "valid"], [[2382, 2382], "valid"], [[2383, 2383], "valid"], [[2384, 2388], "valid"], [[2389, 2389], "valid"], [[2390, 2391], "valid"], [[2392, 2392], "mapped", [2325, 2364]], [[2393, 2393], "mapped", [2326, 2364]], [[2394, 2394], "mapped", [2327, 2364]], [[2395, 2395], "mapped", [2332, 2364]], [[2396, 2396], "mapped", [2337, 2364]], [[2397, 2397], "mapped", [2338, 2364]], [[2398, 2398], "mapped", [2347, 2364]], [[2399, 2399], "mapped", [2351, 2364]], [[2400, 2403], "valid"], [[2404, 2405], "valid", [], "NV8"], [[2406, 2415], "valid"], [[2416, 2416], "valid", [], "NV8"], [[2417, 2418], "valid"], [[2419, 2423], "valid"], [[2424, 2424], "valid"], [[2425, 2426], "valid"], [[2427, 2428], "valid"], [[2429, 2429], "valid"], [[2430, 2431], "valid"], [[2432, 2432], "valid"], [[2433, 2435], "valid"], [[2436, 2436], "disallowed"], [[2437, 2444], "valid"], [[2445, 2446], "disallowed"], [[2447, 2448], "valid"], [[2449, 2450], "disallowed"], [[2451, 2472], "valid"], [[2473, 2473], "disallowed"], [[2474, 2480], "valid"], [[2481, 2481], "disallowed"], [[2482, 2482], "valid"], [[2483, 2485], "disallowed"], [[2486, 2489], "valid"], [[2490, 2491], "disallowed"], [[2492, 2492], "valid"], [[2493, 2493], "valid"], [[2494, 2500], "valid"], [[2501, 2502], "disallowed"], [[2503, 2504], "valid"], [[2505, 2506], "disallowed"], [[2507, 2509], "valid"], [[2510, 2510], "valid"], [[2511, 2518], "disallowed"], [[2519, 2519], "valid"], [[2520, 2523], "disallowed"], [[2524, 2524], "mapped", [2465, 2492]], [[2525, 2525], "mapped", [2466, 2492]], [[2526, 2526], "disallowed"], [[2527, 2527], "mapped", [2479, 2492]], [[2528, 2531], "valid"], [[2532, 2533], "disallowed"], [[2534, 2545], "valid"], [[2546, 2554], "valid", [], "NV8"], [[2555, 2555], "valid", [], "NV8"], [[2556, 2560], "disallowed"], [[2561, 2561], "valid"], [[2562, 2562], "valid"], [[2563, 2563], "valid"], [[2564, 2564], "disallowed"], [[2565, 2570], "valid"], [[2571, 2574], "disallowed"], [[2575, 2576], "valid"], [[2577, 2578], "disallowed"], [[2579, 2600], "valid"], [[2601, 2601], "disallowed"], [[2602, 2608], "valid"], [[2609, 2609], "disallowed"], [[2610, 2610], "valid"], [[2611, 2611], "mapped", [2610, 2620]], [[2612, 2612], "disallowed"], [[2613, 2613], "valid"], [[2614, 2614], "mapped", [2616, 2620]], [[2615, 2615], "disallowed"], [[2616, 2617], "valid"], [[2618, 2619], "disallowed"], [[2620, 2620], "valid"], [[2621, 2621], "disallowed"], [[2622, 2626], "valid"], [[2627, 2630], "disallowed"], [[2631, 2632], "valid"], [[2633, 2634], "disallowed"], [[2635, 2637], "valid"], [[2638, 2640], "disallowed"], [[2641, 2641], "valid"], [[2642, 2648], "disallowed"], [[2649, 2649], "mapped", [2582, 2620]], [[2650, 2650], "mapped", [2583, 2620]], [[2651, 2651], "mapped", [2588, 2620]], [[2652, 2652], "valid"], [[2653, 2653], "disallowed"], [[2654, 2654], "mapped", [2603, 2620]], [[2655, 2661], "disallowed"], [[2662, 2676], "valid"], [[2677, 2677], "valid"], [[2678, 2688], "disallowed"], [[2689, 2691], "valid"], [[2692, 2692], "disallowed"], [[2693, 2699], "valid"], [[2700, 2700], "valid"], [[2701, 2701], "valid"], [[2702, 2702], "disallowed"], [[2703, 2705], "valid"], [[2706, 2706], "disallowed"], [[2707, 2728], "valid"], [[2729, 2729], "disallowed"], [[2730, 2736], "valid"], [[2737, 2737], "disallowed"], [[2738, 2739], "valid"], [[2740, 2740], "disallowed"], [[2741, 2745], "valid"], [[2746, 2747], "disallowed"], [[2748, 2757], "valid"], [[2758, 2758], "disallowed"], [[2759, 2761], "valid"], [[2762, 2762], "disallowed"], [[2763, 2765], "valid"], [[2766, 2767], "disallowed"], [[2768, 2768], "valid"], [[2769, 2783], "disallowed"], [[2784, 2784], "valid"], [[2785, 2787], "valid"], [[2788, 2789], "disallowed"], [[2790, 2799], "valid"], [[2800, 2800], "valid", [], "NV8"], [[2801, 2801], "valid", [], "NV8"], [[2802, 2808], "disallowed"], [[2809, 2809], "valid"], [[2810, 2816], "disallowed"], [[2817, 2819], "valid"], [[2820, 2820], "disallowed"], [[2821, 2828], "valid"], [[2829, 2830], "disallowed"], [[2831, 2832], "valid"], [[2833, 2834], "disallowed"], [[2835, 2856], "valid"], [[2857, 2857], "disallowed"], [[2858, 2864], "valid"], [[2865, 2865], "disallowed"], [[2866, 2867], "valid"], [[2868, 2868], "disallowed"], [[2869, 2869], "valid"], [[2870, 2873], "valid"], [[2874, 2875], "disallowed"], [[2876, 2883], "valid"], [[2884, 2884], "valid"], [[2885, 2886], "disallowed"], [[2887, 2888], "valid"], [[2889, 2890], "disallowed"], [[2891, 2893], "valid"], [[2894, 2901], "disallowed"], [[2902, 2903], "valid"], [[2904, 2907], "disallowed"], [[2908, 2908], "mapped", [2849, 2876]], [[2909, 2909], "mapped", [2850, 2876]], [[2910, 2910], "disallowed"], [[2911, 2913], "valid"], [[2914, 2915], "valid"], [[2916, 2917], "disallowed"], [[2918, 2927], "valid"], [[2928, 2928], "valid", [], "NV8"], [[2929, 2929], "valid"], [[2930, 2935], "valid", [], "NV8"], [[2936, 2945], "disallowed"], [[2946, 2947], "valid"], [[2948, 2948], "disallowed"], [[2949, 2954], "valid"], [[2955, 2957], "disallowed"], [[2958, 2960], "valid"], [[2961, 2961], "disallowed"], [[2962, 2965], "valid"], [[2966, 2968], "disallowed"], [[2969, 2970], "valid"], [[2971, 2971], "disallowed"], [[2972, 2972], "valid"], [[2973, 2973], "disallowed"], [[2974, 2975], "valid"], [[2976, 2978], "disallowed"], [[2979, 2980], "valid"], [[2981, 2983], "disallowed"], [[2984, 2986], "valid"], [[2987, 2989], "disallowed"], [[2990, 2997], "valid"], [[2998, 2998], "valid"], [[2999, 3001], "valid"], [[3002, 3005], "disallowed"], [[3006, 3010], "valid"], [[3011, 3013], "disallowed"], [[3014, 3016], "valid"], [[3017, 3017], "disallowed"], [[3018, 3021], "valid"], [[3022, 3023], "disallowed"], [[3024, 3024], "valid"], [[3025, 3030], "disallowed"], [[3031, 3031], "valid"], [[3032, 3045], "disallowed"], [[3046, 3046], "valid"], [[3047, 3055], "valid"], [[3056, 3058], "valid", [], "NV8"], [[3059, 3066], "valid", [], "NV8"], [[3067, 3071], "disallowed"], [[3072, 3072], "valid"], [[3073, 3075], "valid"], [[3076, 3076], "disallowed"], [[3077, 3084], "valid"], [[3085, 3085], "disallowed"], [[3086, 3088], "valid"], [[3089, 3089], "disallowed"], [[3090, 3112], "valid"], [[3113, 3113], "disallowed"], [[3114, 3123], "valid"], [[3124, 3124], "valid"], [[3125, 3129], "valid"], [[3130, 3132], "disallowed"], [[3133, 3133], "valid"], [[3134, 3140], "valid"], [[3141, 3141], "disallowed"], [[3142, 3144], "valid"], [[3145, 3145], "disallowed"], [[3146, 3149], "valid"], [[3150, 3156], "disallowed"], [[3157, 3158], "valid"], [[3159, 3159], "disallowed"], [[3160, 3161], "valid"], [[3162, 3162], "valid"], [[3163, 3167], "disallowed"], [[3168, 3169], "valid"], [[3170, 3171], "valid"], [[3172, 3173], "disallowed"], [[3174, 3183], "valid"], [[3184, 3191], "disallowed"], [[3192, 3199], "valid", [], "NV8"], [[3200, 3200], "disallowed"], [[3201, 3201], "valid"], [[3202, 3203], "valid"], [[3204, 3204], "disallowed"], [[3205, 3212], "valid"], [[3213, 3213], "disallowed"], [[3214, 3216], "valid"], [[3217, 3217], "disallowed"], [[3218, 3240], "valid"], [[3241, 3241], "disallowed"], [[3242, 3251], "valid"], [[3252, 3252], "disallowed"], [[3253, 3257], "valid"], [[3258, 3259], "disallowed"], [[3260, 3261], "valid"], [[3262, 3268], "valid"], [[3269, 3269], "disallowed"], [[3270, 3272], "valid"], [[3273, 3273], "disallowed"], [[3274, 3277], "valid"], [[3278, 3284], "disallowed"], [[3285, 3286], "valid"], [[3287, 3293], "disallowed"], [[3294, 3294], "valid"], [[3295, 3295], "disallowed"], [[3296, 3297], "valid"], [[3298, 3299], "valid"], [[3300, 3301], "disallowed"], [[3302, 3311], "valid"], [[3312, 3312], "disallowed"], [[3313, 3314], "valid"], [[3315, 3328], "disallowed"], [[3329, 3329], "valid"], [[3330, 3331], "valid"], [[3332, 3332], "disallowed"], [[3333, 3340], "valid"], [[3341, 3341], "disallowed"], [[3342, 3344], "valid"], [[3345, 3345], "disallowed"], [[3346, 3368], "valid"], [[3369, 3369], "valid"], [[3370, 3385], "valid"], [[3386, 3386], "valid"], [[3387, 3388], "disallowed"], [[3389, 3389], "valid"], [[3390, 3395], "valid"], [[3396, 3396], "valid"], [[3397, 3397], "disallowed"], [[3398, 3400], "valid"], [[3401, 3401], "disallowed"], [[3402, 3405], "valid"], [[3406, 3406], "valid"], [[3407, 3414], "disallowed"], [[3415, 3415], "valid"], [[3416, 3422], "disallowed"], [[3423, 3423], "valid"], [[3424, 3425], "valid"], [[3426, 3427], "valid"], [[3428, 3429], "disallowed"], [[3430, 3439], "valid"], [[3440, 3445], "valid", [], "NV8"], [[3446, 3448], "disallowed"], [[3449, 3449], "valid", [], "NV8"], [[3450, 3455], "valid"], [[3456, 3457], "disallowed"], [[3458, 3459], "valid"], [[3460, 3460], "disallowed"], [[3461, 3478], "valid"], [[3479, 3481], "disallowed"], [[3482, 3505], "valid"], [[3506, 3506], "disallowed"], [[3507, 3515], "valid"], [[3516, 3516], "disallowed"], [[3517, 3517], "valid"], [[3518, 3519], "disallowed"], [[3520, 3526], "valid"], [[3527, 3529], "disallowed"], [[3530, 3530], "valid"], [[3531, 3534], "disallowed"], [[3535, 3540], "valid"], [[3541, 3541], "disallowed"], [[3542, 3542], "valid"], [[3543, 3543], "disallowed"], [[3544, 3551], "valid"], [[3552, 3557], "disallowed"], [[3558, 3567], "valid"], [[3568, 3569], "disallowed"], [[3570, 3571], "valid"], [[3572, 3572], "valid", [], "NV8"], [[3573, 3584], "disallowed"], [[3585, 3634], "valid"], [[3635, 3635], "mapped", [3661, 3634]], [[3636, 3642], "valid"], [[3643, 3646], "disallowed"], [[3647, 3647], "valid", [], "NV8"], [[3648, 3662], "valid"], [[3663, 3663], "valid", [], "NV8"], [[3664, 3673], "valid"], [[3674, 3675], "valid", [], "NV8"], [[3676, 3712], "disallowed"], [[3713, 3714], "valid"], [[3715, 3715], "disallowed"], [[3716, 3716], "valid"], [[3717, 3718], "disallowed"], [[3719, 3720], "valid"], [[3721, 3721], "disallowed"], [[3722, 3722], "valid"], [[3723, 3724], "disallowed"], [[3725, 3725], "valid"], [[3726, 3731], "disallowed"], [[3732, 3735], "valid"], [[3736, 3736], "disallowed"], [[3737, 3743], "valid"], [[3744, 3744], "disallowed"], [[3745, 3747], "valid"], [[3748, 3748], "disallowed"], [[3749, 3749], "valid"], [[3750, 3750], "disallowed"], [[3751, 3751], "valid"], [[3752, 3753], "disallowed"], [[3754, 3755], "valid"], [[3756, 3756], "disallowed"], [[3757, 3762], "valid"], [[3763, 3763], "mapped", [3789, 3762]], [[3764, 3769], "valid"], [[3770, 3770], "disallowed"], [[3771, 3773], "valid"], [[3774, 3775], "disallowed"], [[3776, 3780], "valid"], [[3781, 3781], "disallowed"], [[3782, 3782], "valid"], [[3783, 3783], "disallowed"], [[3784, 3789], "valid"], [[3790, 3791], "disallowed"], [[3792, 3801], "valid"], [[3802, 3803], "disallowed"], [[3804, 3804], "mapped", [3755, 3737]], [[3805, 3805], "mapped", [3755, 3745]], [[3806, 3807], "valid"], [[3808, 3839], "disallowed"], [[3840, 3840], "valid"], [[3841, 3850], "valid", [], "NV8"], [[3851, 3851], "valid"], [[3852, 3852], "mapped", [3851]], [[3853, 3863], "valid", [], "NV8"], [[3864, 3865], "valid"], [[3866, 3871], "valid", [], "NV8"], [[3872, 3881], "valid"], [[3882, 3892], "valid", [], "NV8"], [[3893, 3893], "valid"], [[3894, 3894], "valid", [], "NV8"], [[3895, 3895], "valid"], [[3896, 3896], "valid", [], "NV8"], [[3897, 3897], "valid"], [[3898, 3901], "valid", [], "NV8"], [[3902, 3906], "valid"], [[3907, 3907], "mapped", [3906, 4023]], [[3908, 3911], "valid"], [[3912, 3912], "disallowed"], [[3913, 3916], "valid"], [[3917, 3917], "mapped", [3916, 4023]], [[3918, 3921], "valid"], [[3922, 3922], "mapped", [3921, 4023]], [[3923, 3926], "valid"], [[3927, 3927], "mapped", [3926, 4023]], [[3928, 3931], "valid"], [[3932, 3932], "mapped", [3931, 4023]], [[3933, 3944], "valid"], [[3945, 3945], "mapped", [3904, 4021]], [[3946, 3946], "valid"], [[3947, 3948], "valid"], [[3949, 3952], "disallowed"], [[3953, 3954], "valid"], [[3955, 3955], "mapped", [3953, 3954]], [[3956, 3956], "valid"], [[3957, 3957], "mapped", [3953, 3956]], [[3958, 3958], "mapped", [4018, 3968]], [[3959, 3959], "mapped", [4018, 3953, 3968]], [[3960, 3960], "mapped", [4019, 3968]], [[3961, 3961], "mapped", [4019, 3953, 3968]], [[3962, 3968], "valid"], [[3969, 3969], "mapped", [3953, 3968]], [[3970, 3972], "valid"], [[3973, 3973], "valid", [], "NV8"], [[3974, 3979], "valid"], [[3980, 3983], "valid"], [[3984, 3986], "valid"], [[3987, 3987], "mapped", [3986, 4023]], [[3988, 3989], "valid"], [[3990, 3990], "valid"], [[3991, 3991], "valid"], [[3992, 3992], "disallowed"], [[3993, 3996], "valid"], [[3997, 3997], "mapped", [3996, 4023]], [[3998, 4001], "valid"], [[4002, 4002], "mapped", [4001, 4023]], [[4003, 4006], "valid"], [[4007, 4007], "mapped", [4006, 4023]], [[4008, 4011], "valid"], [[4012, 4012], "mapped", [4011, 4023]], [[4013, 4013], "valid"], [[4014, 4016], "valid"], [[4017, 4023], "valid"], [[4024, 4024], "valid"], [[4025, 4025], "mapped", [3984, 4021]], [[4026, 4028], "valid"], [[4029, 4029], "disallowed"], [[4030, 4037], "valid", [], "NV8"], [[4038, 4038], "valid"], [[4039, 4044], "valid", [], "NV8"], [[4045, 4045], "disallowed"], [[4046, 4046], "valid", [], "NV8"], [[4047, 4047], "valid", [], "NV8"], [[4048, 4049], "valid", [], "NV8"], [[4050, 4052], "valid", [], "NV8"], [[4053, 4056], "valid", [], "NV8"], [[4057, 4058], "valid", [], "NV8"], [[4059, 4095], "disallowed"], [[4096, 4129], "valid"], [[4130, 4130], "valid"], [[4131, 4135], "valid"], [[4136, 4136], "valid"], [[4137, 4138], "valid"], [[4139, 4139], "valid"], [[4140, 4146], "valid"], [[4147, 4149], "valid"], [[4150, 4153], "valid"], [[4154, 4159], "valid"], [[4160, 4169], "valid"], [[4170, 4175], "valid", [], "NV8"], [[4176, 4185], "valid"], [[4186, 4249], "valid"], [[4250, 4253], "valid"], [[4254, 4255], "valid", [], "NV8"], [[4256, 4293], "disallowed"], [[4294, 4294], "disallowed"], [[4295, 4295], "mapped", [11559]], [[4296, 4300], "disallowed"], [[4301, 4301], "mapped", [11565]], [[4302, 4303], "disallowed"], [[4304, 4342], "valid"], [[4343, 4344], "valid"], [[4345, 4346], "valid"], [[4347, 4347], "valid", [], "NV8"], [[4348, 4348], "mapped", [4316]], [[4349, 4351], "valid"], [[4352, 4441], "valid", [], "NV8"], [[4442, 4446], "valid", [], "NV8"], [[4447, 4448], "disallowed"], [[4449, 4514], "valid", [], "NV8"], [[4515, 4519], "valid", [], "NV8"], [[4520, 4601], "valid", [], "NV8"], [[4602, 4607], "valid", [], "NV8"], [[4608, 4614], "valid"], [[4615, 4615], "valid"], [[4616, 4678], "valid"], [[4679, 4679], "valid"], [[4680, 4680], "valid"], [[4681, 4681], "disallowed"], [[4682, 4685], "valid"], [[4686, 4687], "disallowed"], [[4688, 4694], "valid"], [[4695, 4695], "disallowed"], [[4696, 4696], "valid"], [[4697, 4697], "disallowed"], [[4698, 4701], "valid"], [[4702, 4703], "disallowed"], [[4704, 4742], "valid"], [[4743, 4743], "valid"], [[4744, 4744], "valid"], [[4745, 4745], "disallowed"], [[4746, 4749], "valid"], [[4750, 4751], "disallowed"], [[4752, 4782], "valid"], [[4783, 4783], "valid"], [[4784, 4784], "valid"], [[4785, 4785], "disallowed"], [[4786, 4789], "valid"], [[4790, 4791], "disallowed"], [[4792, 4798], "valid"], [[4799, 4799], "disallowed"], [[4800, 4800], "valid"], [[4801, 4801], "disallowed"], [[4802, 4805], "valid"], [[4806, 4807], "disallowed"], [[4808, 4814], "valid"], [[4815, 4815], "valid"], [[4816, 4822], "valid"], [[4823, 4823], "disallowed"], [[4824, 4846], "valid"], [[4847, 4847], "valid"], [[4848, 4878], "valid"], [[4879, 4879], "valid"], [[4880, 4880], "valid"], [[4881, 4881], "disallowed"], [[4882, 4885], "valid"], [[4886, 4887], "disallowed"], [[4888, 4894], "valid"], [[4895, 4895], "valid"], [[4896, 4934], "valid"], [[4935, 4935], "valid"], [[4936, 4954], "valid"], [[4955, 4956], "disallowed"], [[4957, 4958], "valid"], [[4959, 4959], "valid"], [[4960, 4960], "valid", [], "NV8"], [[4961, 4988], "valid", [], "NV8"], [[4989, 4991], "disallowed"], [[4992, 5007], "valid"], [[5008, 5017], "valid", [], "NV8"], [[5018, 5023], "disallowed"], [[5024, 5108], "valid"], [[5109, 5109], "valid"], [[5110, 5111], "disallowed"], [[5112, 5112], "mapped", [5104]], [[5113, 5113], "mapped", [5105]], [[5114, 5114], "mapped", [5106]], [[5115, 5115], "mapped", [5107]], [[5116, 5116], "mapped", [5108]], [[5117, 5117], "mapped", [5109]], [[5118, 5119], "disallowed"], [[5120, 5120], "valid", [], "NV8"], [[5121, 5740], "valid"], [[5741, 5742], "valid", [], "NV8"], [[5743, 5750], "valid"], [[5751, 5759], "valid"], [[5760, 5760], "disallowed"], [[5761, 5786], "valid"], [[5787, 5788], "valid", [], "NV8"], [[5789, 5791], "disallowed"], [[5792, 5866], "valid"], [[5867, 5872], "valid", [], "NV8"], [[5873, 5880], "valid"], [[5881, 5887], "disallowed"], [[5888, 5900], "valid"], [[5901, 5901], "disallowed"], [[5902, 5908], "valid"], [[5909, 5919], "disallowed"], [[5920, 5940], "valid"], [[5941, 5942], "valid", [], "NV8"], [[5943, 5951], "disallowed"], [[5952, 5971], "valid"], [[5972, 5983], "disallowed"], [[5984, 5996], "valid"], [[5997, 5997], "disallowed"], [[5998, 6e3], "valid"], [[6001, 6001], "disallowed"], [[6002, 6003], "valid"], [[6004, 6015], "disallowed"], [[6016, 6067], "valid"], [[6068, 6069], "disallowed"], [[6070, 6099], "valid"], [[6100, 6102], "valid", [], "NV8"], [[6103, 6103], "valid"], [[6104, 6107], "valid", [], "NV8"], [[6108, 6108], "valid"], [[6109, 6109], "valid"], [[6110, 6111], "disallowed"], [[6112, 6121], "valid"], [[6122, 6127], "disallowed"], [[6128, 6137], "valid", [], "NV8"], [[6138, 6143], "disallowed"], [[6144, 6149], "valid", [], "NV8"], [[6150, 6150], "disallowed"], [[6151, 6154], "valid", [], "NV8"], [[6155, 6157], "ignored"], [[6158, 6158], "disallowed"], [[6159, 6159], "disallowed"], [[6160, 6169], "valid"], [[6170, 6175], "disallowed"], [[6176, 6263], "valid"], [[6264, 6271], "disallowed"], [[6272, 6313], "valid"], [[6314, 6314], "valid"], [[6315, 6319], "disallowed"], [[6320, 6389], "valid"], [[6390, 6399], "disallowed"], [[6400, 6428], "valid"], [[6429, 6430], "valid"], [[6431, 6431], "disallowed"], [[6432, 6443], "valid"], [[6444, 6447], "disallowed"], [[6448, 6459], "valid"], [[6460, 6463], "disallowed"], [[6464, 6464], "valid", [], "NV8"], [[6465, 6467], "disallowed"], [[6468, 6469], "valid", [], "NV8"], [[6470, 6509], "valid"], [[6510, 6511], "disallowed"], [[6512, 6516], "valid"], [[6517, 6527], "disallowed"], [[6528, 6569], "valid"], [[6570, 6571], "valid"], [[6572, 6575], "disallowed"], [[6576, 6601], "valid"], [[6602, 6607], "disallowed"], [[6608, 6617], "valid"], [[6618, 6618], "valid", [], "XV8"], [[6619, 6621], "disallowed"], [[6622, 6623], "valid", [], "NV8"], [[6624, 6655], "valid", [], "NV8"], [[6656, 6683], "valid"], [[6684, 6685], "disallowed"], [[6686, 6687], "valid", [], "NV8"], [[6688, 6750], "valid"], [[6751, 6751], "disallowed"], [[6752, 6780], "valid"], [[6781, 6782], "disallowed"], [[6783, 6793], "valid"], [[6794, 6799], "disallowed"], [[6800, 6809], "valid"], [[6810, 6815], "disallowed"], [[6816, 6822], "valid", [], "NV8"], [[6823, 6823], "valid"], [[6824, 6829], "valid", [], "NV8"], [[6830, 6831], "disallowed"], [[6832, 6845], "valid"], [[6846, 6846], "valid", [], "NV8"], [[6847, 6911], "disallowed"], [[6912, 6987], "valid"], [[6988, 6991], "disallowed"], [[6992, 7001], "valid"], [[7002, 7018], "valid", [], "NV8"], [[7019, 7027], "valid"], [[7028, 7036], "valid", [], "NV8"], [[7037, 7039], "disallowed"], [[7040, 7082], "valid"], [[7083, 7085], "valid"], [[7086, 7097], "valid"], [[7098, 7103], "valid"], [[7104, 7155], "valid"], [[7156, 7163], "disallowed"], [[7164, 7167], "valid", [], "NV8"], [[7168, 7223], "valid"], [[7224, 7226], "disallowed"], [[7227, 7231], "valid", [], "NV8"], [[7232, 7241], "valid"], [[7242, 7244], "disallowed"], [[7245, 7293], "valid"], [[7294, 7295], "valid", [], "NV8"], [[7296, 7359], "disallowed"], [[7360, 7367], "valid", [], "NV8"], [[7368, 7375], "disallowed"], [[7376, 7378], "valid"], [[7379, 7379], "valid", [], "NV8"], [[7380, 7410], "valid"], [[7411, 7414], "valid"], [[7415, 7415], "disallowed"], [[7416, 7417], "valid"], [[7418, 7423], "disallowed"], [[7424, 7467], "valid"], [[7468, 7468], "mapped", [97]], [[7469, 7469], "mapped", [230]], [[7470, 7470], "mapped", [98]], [[7471, 7471], "valid"], [[7472, 7472], "mapped", [100]], [[7473, 7473], "mapped", [101]], [[7474, 7474], "mapped", [477]], [[7475, 7475], "mapped", [103]], [[7476, 7476], "mapped", [104]], [[7477, 7477], "mapped", [105]], [[7478, 7478], "mapped", [106]], [[7479, 7479], "mapped", [107]], [[7480, 7480], "mapped", [108]], [[7481, 7481], "mapped", [109]], [[7482, 7482], "mapped", [110]], [[7483, 7483], "valid"], [[7484, 7484], "mapped", [111]], [[7485, 7485], "mapped", [547]], [[7486, 7486], "mapped", [112]], [[7487, 7487], "mapped", [114]], [[7488, 7488], "mapped", [116]], [[7489, 7489], "mapped", [117]], [[7490, 7490], "mapped", [119]], [[7491, 7491], "mapped", [97]], [[7492, 7492], "mapped", [592]], [[7493, 7493], "mapped", [593]], [[7494, 7494], "mapped", [7426]], [[7495, 7495], "mapped", [98]], [[7496, 7496], "mapped", [100]], [[7497, 7497], "mapped", [101]], [[7498, 7498], "mapped", [601]], [[7499, 7499], "mapped", [603]], [[7500, 7500], "mapped", [604]], [[7501, 7501], "mapped", [103]], [[7502, 7502], "valid"], [[7503, 7503], "mapped", [107]], [[7504, 7504], "mapped", [109]], [[7505, 7505], "mapped", [331]], [[7506, 7506], "mapped", [111]], [[7507, 7507], "mapped", [596]], [[7508, 7508], "mapped", [7446]], [[7509, 7509], "mapped", [7447]], [[7510, 7510], "mapped", [112]], [[7511, 7511], "mapped", [116]], [[7512, 7512], "mapped", [117]], [[7513, 7513], "mapped", [7453]], [[7514, 7514], "mapped", [623]], [[7515, 7515], "mapped", [118]], [[7516, 7516], "mapped", [7461]], [[7517, 7517], "mapped", [946]], [[7518, 7518], "mapped", [947]], [[7519, 7519], "mapped", [948]], [[7520, 7520], "mapped", [966]], [[7521, 7521], "mapped", [967]], [[7522, 7522], "mapped", [105]], [[7523, 7523], "mapped", [114]], [[7524, 7524], "mapped", [117]], [[7525, 7525], "mapped", [118]], [[7526, 7526], "mapped", [946]], [[7527, 7527], "mapped", [947]], [[7528, 7528], "mapped", [961]], [[7529, 7529], "mapped", [966]], [[7530, 7530], "mapped", [967]], [[7531, 7531], "valid"], [[7532, 7543], "valid"], [[7544, 7544], "mapped", [1085]], [[7545, 7578], "valid"], [[7579, 7579], "mapped", [594]], [[7580, 7580], "mapped", [99]], [[7581, 7581], "mapped", [597]], [[7582, 7582], "mapped", [240]], [[7583, 7583], "mapped", [604]], [[7584, 7584], "mapped", [102]], [[7585, 7585], "mapped", [607]], [[7586, 7586], "mapped", [609]], [[7587, 7587], "mapped", [613]], [[7588, 7588], "mapped", [616]], [[7589, 7589], "mapped", [617]], [[7590, 7590], "mapped", [618]], [[7591, 7591], "mapped", [7547]], [[7592, 7592], "mapped", [669]], [[7593, 7593], "mapped", [621]], [[7594, 7594], "mapped", [7557]], [[7595, 7595], "mapped", [671]], [[7596, 7596], "mapped", [625]], [[7597, 7597], "mapped", [624]], [[7598, 7598], "mapped", [626]], [[7599, 7599], "mapped", [627]], [[7600, 7600], "mapped", [628]], [[7601, 7601], "mapped", [629]], [[7602, 7602], "mapped", [632]], [[7603, 7603], "mapped", [642]], [[7604, 7604], "mapped", [643]], [[7605, 7605], "mapped", [427]], [[7606, 7606], "mapped", [649]], [[7607, 7607], "mapped", [650]], [[7608, 7608], "mapped", [7452]], [[7609, 7609], "mapped", [651]], [[7610, 7610], "mapped", [652]], [[7611, 7611], "mapped", [122]], [[7612, 7612], "mapped", [656]], [[7613, 7613], "mapped", [657]], [[7614, 7614], "mapped", [658]], [[7615, 7615], "mapped", [952]], [[7616, 7619], "valid"], [[7620, 7626], "valid"], [[7627, 7654], "valid"], [[7655, 7669], "valid"], [[7670, 7675], "disallowed"], [[7676, 7676], "valid"], [[7677, 7677], "valid"], [[7678, 7679], "valid"], [[7680, 7680], "mapped", [7681]], [[7681, 7681], "valid"], [[7682, 7682], "mapped", [7683]], [[7683, 7683], "valid"], [[7684, 7684], "mapped", [7685]], [[7685, 7685], "valid"], [[7686, 7686], "mapped", [7687]], [[7687, 7687], "valid"], [[7688, 7688], "mapped", [7689]], [[7689, 7689], "valid"], [[7690, 7690], "mapped", [7691]], [[7691, 7691], "valid"], [[7692, 7692], "mapped", [7693]], [[7693, 7693], "valid"], [[7694, 7694], "mapped", [7695]], [[7695, 7695], "valid"], [[7696, 7696], "mapped", [7697]], [[7697, 7697], "valid"], [[7698, 7698], "mapped", [7699]], [[7699, 7699], "valid"], [[7700, 7700], "mapped", [7701]], [[7701, 7701], "valid"], [[7702, 7702], "mapped", [7703]], [[7703, 7703], "valid"], [[7704, 7704], "mapped", [7705]], [[7705, 7705], "valid"], [[7706, 7706], "mapped", [7707]], [[7707, 7707], "valid"], [[7708, 7708], "mapped", [7709]], [[7709, 7709], "valid"], [[7710, 7710], "mapped", [7711]], [[7711, 7711], "valid"], [[7712, 7712], "mapped", [7713]], [[7713, 7713], "valid"], [[7714, 7714], "mapped", [7715]], [[7715, 7715], "valid"], [[7716, 7716], "mapped", [7717]], [[7717, 7717], "valid"], [[7718, 7718], "mapped", [7719]], [[7719, 7719], "valid"], [[7720, 7720], "mapped", [7721]], [[7721, 7721], "valid"], [[7722, 7722], "mapped", [7723]], [[7723, 7723], "valid"], [[7724, 7724], "mapped", [7725]], [[7725, 7725], "valid"], [[7726, 7726], "mapped", [7727]], [[7727, 7727], "valid"], [[7728, 7728], "mapped", [7729]], [[7729, 7729], "valid"], [[7730, 7730], "mapped", [7731]], [[7731, 7731], "valid"], [[7732, 7732], "mapped", [7733]], [[7733, 7733], "valid"], [[7734, 7734], "mapped", [7735]], [[7735, 7735], "valid"], [[7736, 7736], "mapped", [7737]], [[7737, 7737], "valid"], [[7738, 7738], "mapped", [7739]], [[7739, 7739], "valid"], [[7740, 7740], "mapped", [7741]], [[7741, 7741], "valid"], [[7742, 7742], "mapped", [7743]], [[7743, 7743], "valid"], [[7744, 7744], "mapped", [7745]], [[7745, 7745], "valid"], [[7746, 7746], "mapped", [7747]], [[7747, 7747], "valid"], [[7748, 7748], "mapped", [7749]], [[7749, 7749], "valid"], [[7750, 7750], "mapped", [7751]], [[7751, 7751], "valid"], [[7752, 7752], "mapped", [7753]], [[7753, 7753], "valid"], [[7754, 7754], "mapped", [7755]], [[7755, 7755], "valid"], [[7756, 7756], "mapped", [7757]], [[7757, 7757], "valid"], [[7758, 7758], "mapped", [7759]], [[7759, 7759], "valid"], [[7760, 7760], "mapped", [7761]], [[7761, 7761], "valid"], [[7762, 7762], "mapped", [7763]], [[7763, 7763], "valid"], [[7764, 7764], "mapped", [7765]], [[7765, 7765], "valid"], [[7766, 7766], "mapped", [7767]], [[7767, 7767], "valid"], [[7768, 7768], "mapped", [7769]], [[7769, 7769], "valid"], [[7770, 7770], "mapped", [7771]], [[7771, 7771], "valid"], [[7772, 7772], "mapped", [7773]], [[7773, 7773], "valid"], [[7774, 7774], "mapped", [7775]], [[7775, 7775], "valid"], [[7776, 7776], "mapped", [7777]], [[7777, 7777], "valid"], [[7778, 7778], "mapped", [7779]], [[7779, 7779], "valid"], [[7780, 7780], "mapped", [7781]], [[7781, 7781], "valid"], [[7782, 7782], "mapped", [7783]], [[7783, 7783], "valid"], [[7784, 7784], "mapped", [7785]], [[7785, 7785], "valid"], [[7786, 7786], "mapped", [7787]], [[7787, 7787], "valid"], [[7788, 7788], "mapped", [7789]], [[7789, 7789], "valid"], [[7790, 7790], "mapped", [7791]], [[7791, 7791], "valid"], [[7792, 7792], "mapped", [7793]], [[7793, 7793], "valid"], [[7794, 7794], "mapped", [7795]], [[7795, 7795], "valid"], [[7796, 7796], "mapped", [7797]], [[7797, 7797], "valid"], [[7798, 7798], "mapped", [7799]], [[7799, 7799], "valid"], [[7800, 7800], "mapped", [7801]], [[7801, 7801], "valid"], [[7802, 7802], "mapped", [7803]], [[7803, 7803], "valid"], [[7804, 7804], "mapped", [7805]], [[7805, 7805], "valid"], [[7806, 7806], "mapped", [7807]], [[7807, 7807], "valid"], [[7808, 7808], "mapped", [7809]], [[7809, 7809], "valid"], [[7810, 7810], "mapped", [7811]], [[7811, 7811], "valid"], [[7812, 7812], "mapped", [7813]], [[7813, 7813], "valid"], [[7814, 7814], "mapped", [7815]], [[7815, 7815], "valid"], [[7816, 7816], "mapped", [7817]], [[7817, 7817], "valid"], [[7818, 7818], "mapped", [7819]], [[7819, 7819], "valid"], [[7820, 7820], "mapped", [7821]], [[7821, 7821], "valid"], [[7822, 7822], "mapped", [7823]], [[7823, 7823], "valid"], [[7824, 7824], "mapped", [7825]], [[7825, 7825], "valid"], [[7826, 7826], "mapped", [7827]], [[7827, 7827], "valid"], [[7828, 7828], "mapped", [7829]], [[7829, 7833], "valid"], [[7834, 7834], "mapped", [97, 702]], [[7835, 7835], "mapped", [7777]], [[7836, 7837], "valid"], [[7838, 7838], "mapped", [115, 115]], [[7839, 7839], "valid"], [[7840, 7840], "mapped", [7841]], [[7841, 7841], "valid"], [[7842, 7842], "mapped", [7843]], [[7843, 7843], "valid"], [[7844, 7844], "mapped", [7845]], [[7845, 7845], "valid"], [[7846, 7846], "mapped", [7847]], [[7847, 7847], "valid"], [[7848, 7848], "mapped", [7849]], [[7849, 7849], "valid"], [[7850, 7850], "mapped", [7851]], [[7851, 7851], "valid"], [[7852, 7852], "mapped", [7853]], [[7853, 7853], "valid"], [[7854, 7854], "mapped", [7855]], [[7855, 7855], "valid"], [[7856, 7856], "mapped", [7857]], [[7857, 7857], "valid"], [[7858, 7858], "mapped", [7859]], [[7859, 7859], "valid"], [[7860, 7860], "mapped", [7861]], [[7861, 7861], "valid"], [[7862, 7862], "mapped", [7863]], [[7863, 7863], "valid"], [[7864, 7864], "mapped", [7865]], [[7865, 7865], "valid"], [[7866, 7866], "mapped", [7867]], [[7867, 7867], "valid"], [[7868, 7868], "mapped", [7869]], [[7869, 7869], "valid"], [[7870, 7870], "mapped", [7871]], [[7871, 7871], "valid"], [[7872, 7872], "mapped", [7873]], [[7873, 7873], "valid"], [[7874, 7874], "mapped", [7875]], [[7875, 7875], "valid"], [[7876, 7876], "mapped", [7877]], [[7877, 7877], "valid"], [[7878, 7878], "mapped", [7879]], [[7879, 7879], "valid"], [[7880, 7880], "mapped", [7881]], [[7881, 7881], "valid"], [[7882, 7882], "mapped", [7883]], [[7883, 7883], "valid"], [[7884, 7884], "mapped", [7885]], [[7885, 7885], "valid"], [[7886, 7886], "mapped", [7887]], [[7887, 7887], "valid"], [[7888, 7888], "mapped", [7889]], [[7889, 7889], "valid"], [[7890, 7890], "mapped", [7891]], [[7891, 7891], "valid"], [[7892, 7892], "mapped", [7893]], [[7893, 7893], "valid"], [[7894, 7894], "mapped", [7895]], [[7895, 7895], "valid"], [[7896, 7896], "mapped", [7897]], [[7897, 7897], "valid"], [[7898, 7898], "mapped", [7899]], [[7899, 7899], "valid"], [[7900, 7900], "mapped", [7901]], [[7901, 7901], "valid"], [[7902, 7902], "mapped", [7903]], [[7903, 7903], "valid"], [[7904, 7904], "mapped", [7905]], [[7905, 7905], "valid"], [[7906, 7906], "mapped", [7907]], [[7907, 7907], "valid"], [[7908, 7908], "mapped", [7909]], [[7909, 7909], "valid"], [[7910, 7910], "mapped", [7911]], [[7911, 7911], "valid"], [[7912, 7912], "mapped", [7913]], [[7913, 7913], "valid"], [[7914, 7914], "mapped", [7915]], [[7915, 7915], "valid"], [[7916, 7916], "mapped", [7917]], [[7917, 7917], "valid"], [[7918, 7918], "mapped", [7919]], [[7919, 7919], "valid"], [[7920, 7920], "mapped", [7921]], [[7921, 7921], "valid"], [[7922, 7922], "mapped", [7923]], [[7923, 7923], "valid"], [[7924, 7924], "mapped", [7925]], [[7925, 7925], "valid"], [[7926, 7926], "mapped", [7927]], [[7927, 7927], "valid"], [[7928, 7928], "mapped", [7929]], [[7929, 7929], "valid"], [[7930, 7930], "mapped", [7931]], [[7931, 7931], "valid"], [[7932, 7932], "mapped", [7933]], [[7933, 7933], "valid"], [[7934, 7934], "mapped", [7935]], [[7935, 7935], "valid"], [[7936, 7943], "valid"], [[7944, 7944], "mapped", [7936]], [[7945, 7945], "mapped", [7937]], [[7946, 7946], "mapped", [7938]], [[7947, 7947], "mapped", [7939]], [[7948, 7948], "mapped", [7940]], [[7949, 7949], "mapped", [7941]], [[7950, 7950], "mapped", [7942]], [[7951, 7951], "mapped", [7943]], [[7952, 7957], "valid"], [[7958, 7959], "disallowed"], [[7960, 7960], "mapped", [7952]], [[7961, 7961], "mapped", [7953]], [[7962, 7962], "mapped", [7954]], [[7963, 7963], "mapped", [7955]], [[7964, 7964], "mapped", [7956]], [[7965, 7965], "mapped", [7957]], [[7966, 7967], "disallowed"], [[7968, 7975], "valid"], [[7976, 7976], "mapped", [7968]], [[7977, 7977], "mapped", [7969]], [[7978, 7978], "mapped", [7970]], [[7979, 7979], "mapped", [7971]], [[7980, 7980], "mapped", [7972]], [[7981, 7981], "mapped", [7973]], [[7982, 7982], "mapped", [7974]], [[7983, 7983], "mapped", [7975]], [[7984, 7991], "valid"], [[7992, 7992], "mapped", [7984]], [[7993, 7993], "mapped", [7985]], [[7994, 7994], "mapped", [7986]], [[7995, 7995], "mapped", [7987]], [[7996, 7996], "mapped", [7988]], [[7997, 7997], "mapped", [7989]], [[7998, 7998], "mapped", [7990]], [[7999, 7999], "mapped", [7991]], [[8e3, 8005], "valid"], [[8006, 8007], "disallowed"], [[8008, 8008], "mapped", [8e3]], [[8009, 8009], "mapped", [8001]], [[8010, 8010], "mapped", [8002]], [[8011, 8011], "mapped", [8003]], [[8012, 8012], "mapped", [8004]], [[8013, 8013], "mapped", [8005]], [[8014, 8015], "disallowed"], [[8016, 8023], "valid"], [[8024, 8024], "disallowed"], [[8025, 8025], "mapped", [8017]], [[8026, 8026], "disallowed"], [[8027, 8027], "mapped", [8019]], [[8028, 8028], "disallowed"], [[8029, 8029], "mapped", [8021]], [[8030, 8030], "disallowed"], [[8031, 8031], "mapped", [8023]], [[8032, 8039], "valid"], [[8040, 8040], "mapped", [8032]], [[8041, 8041], "mapped", [8033]], [[8042, 8042], "mapped", [8034]], [[8043, 8043], "mapped", [8035]], [[8044, 8044], "mapped", [8036]], [[8045, 8045], "mapped", [8037]], [[8046, 8046], "mapped", [8038]], [[8047, 8047], "mapped", [8039]], [[8048, 8048], "valid"], [[8049, 8049], "mapped", [940]], [[8050, 8050], "valid"], [[8051, 8051], "mapped", [941]], [[8052, 8052], "valid"], [[8053, 8053], "mapped", [942]], [[8054, 8054], "valid"], [[8055, 8055], "mapped", [943]], [[8056, 8056], "valid"], [[8057, 8057], "mapped", [972]], [[8058, 8058], "valid"], [[8059, 8059], "mapped", [973]], [[8060, 8060], "valid"], [[8061, 8061], "mapped", [974]], [[8062, 8063], "disallowed"], [[8064, 8064], "mapped", [7936, 953]], [[8065, 8065], "mapped", [7937, 953]], [[8066, 8066], "mapped", [7938, 953]], [[8067, 8067], "mapped", [7939, 953]], [[8068, 8068], "mapped", [7940, 953]], [[8069, 8069], "mapped", [7941, 953]], [[8070, 8070], "mapped", [7942, 953]], [[8071, 8071], "mapped", [7943, 953]], [[8072, 8072], "mapped", [7936, 953]], [[8073, 8073], "mapped", [7937, 953]], [[8074, 8074], "mapped", [7938, 953]], [[8075, 8075], "mapped", [7939, 953]], [[8076, 8076], "mapped", [7940, 953]], [[8077, 8077], "mapped", [7941, 953]], [[8078, 8078], "mapped", [7942, 953]], [[8079, 8079], "mapped", [7943, 953]], [[8080, 8080], "mapped", [7968, 953]], [[8081, 8081], "mapped", [7969, 953]], [[8082, 8082], "mapped", [7970, 953]], [[8083, 8083], "mapped", [7971, 953]], [[8084, 8084], "mapped", [7972, 953]], [[8085, 8085], "mapped", [7973, 953]], [[8086, 8086], "mapped", [7974, 953]], [[8087, 8087], "mapped", [7975, 953]], [[8088, 8088], "mapped", [7968, 953]], [[8089, 8089], "mapped", [7969, 953]], [[8090, 8090], "mapped", [7970, 953]], [[8091, 8091], "mapped", [7971, 953]], [[8092, 8092], "mapped", [7972, 953]], [[8093, 8093], "mapped", [7973, 953]], [[8094, 8094], "mapped", [7974, 953]], [[8095, 8095], "mapped", [7975, 953]], [[8096, 8096], "mapped", [8032, 953]], [[8097, 8097], "mapped", [8033, 953]], [[8098, 8098], "mapped", [8034, 953]], [[8099, 8099], "mapped", [8035, 953]], [[8100, 8100], "mapped", [8036, 953]], [[8101, 8101], "mapped", [8037, 953]], [[8102, 8102], "mapped", [8038, 953]], [[8103, 8103], "mapped", [8039, 953]], [[8104, 8104], "mapped", [8032, 953]], [[8105, 8105], "mapped", [8033, 953]], [[8106, 8106], "mapped", [8034, 953]], [[8107, 8107], "mapped", [8035, 953]], [[8108, 8108], "mapped", [8036, 953]], [[8109, 8109], "mapped", [8037, 953]], [[8110, 8110], "mapped", [8038, 953]], [[8111, 8111], "mapped", [8039, 953]], [[8112, 8113], "valid"], [[8114, 8114], "mapped", [8048, 953]], [[8115, 8115], "mapped", [945, 953]], [[8116, 8116], "mapped", [940, 953]], [[8117, 8117], "disallowed"], [[8118, 8118], "valid"], [[8119, 8119], "mapped", [8118, 953]], [[8120, 8120], "mapped", [8112]], [[8121, 8121], "mapped", [8113]], [[8122, 8122], "mapped", [8048]], [[8123, 8123], "mapped", [940]], [[8124, 8124], "mapped", [945, 953]], [[8125, 8125], "disallowed_STD3_mapped", [32, 787]], [[8126, 8126], "mapped", [953]], [[8127, 8127], "disallowed_STD3_mapped", [32, 787]], [[8128, 8128], "disallowed_STD3_mapped", [32, 834]], [[8129, 8129], "disallowed_STD3_mapped", [32, 776, 834]], [[8130, 8130], "mapped", [8052, 953]], [[8131, 8131], "mapped", [951, 953]], [[8132, 8132], "mapped", [942, 953]], [[8133, 8133], "disallowed"], [[8134, 8134], "valid"], [[8135, 8135], "mapped", [8134, 953]], [[8136, 8136], "mapped", [8050]], [[8137, 8137], "mapped", [941]], [[8138, 8138], "mapped", [8052]], [[8139, 8139], "mapped", [942]], [[8140, 8140], "mapped", [951, 953]], [[8141, 8141], "disallowed_STD3_mapped", [32, 787, 768]], [[8142, 8142], "disallowed_STD3_mapped", [32, 787, 769]], [[8143, 8143], "disallowed_STD3_mapped", [32, 787, 834]], [[8144, 8146], "valid"], [[8147, 8147], "mapped", [912]], [[8148, 8149], "disallowed"], [[8150, 8151], "valid"], [[8152, 8152], "mapped", [8144]], [[8153, 8153], "mapped", [8145]], [[8154, 8154], "mapped", [8054]], [[8155, 8155], "mapped", [943]], [[8156, 8156], "disallowed"], [[8157, 8157], "disallowed_STD3_mapped", [32, 788, 768]], [[8158, 8158], "disallowed_STD3_mapped", [32, 788, 769]], [[8159, 8159], "disallowed_STD3_mapped", [32, 788, 834]], [[8160, 8162], "valid"], [[8163, 8163], "mapped", [944]], [[8164, 8167], "valid"], [[8168, 8168], "mapped", [8160]], [[8169, 8169], "mapped", [8161]], [[8170, 8170], "mapped", [8058]], [[8171, 8171], "mapped", [973]], [[8172, 8172], "mapped", [8165]], [[8173, 8173], "disallowed_STD3_mapped", [32, 776, 768]], [[8174, 8174], "disallowed_STD3_mapped", [32, 776, 769]], [[8175, 8175], "disallowed_STD3_mapped", [96]], [[8176, 8177], "disallowed"], [[8178, 8178], "mapped", [8060, 953]], [[8179, 8179], "mapped", [969, 953]], [[8180, 8180], "mapped", [974, 953]], [[8181, 8181], "disallowed"], [[8182, 8182], "valid"], [[8183, 8183], "mapped", [8182, 953]], [[8184, 8184], "mapped", [8056]], [[8185, 8185], "mapped", [972]], [[8186, 8186], "mapped", [8060]], [[8187, 8187], "mapped", [974]], [[8188, 8188], "mapped", [969, 953]], [[8189, 8189], "disallowed_STD3_mapped", [32, 769]], [[8190, 8190], "disallowed_STD3_mapped", [32, 788]], [[8191, 8191], "disallowed"], [[8192, 8202], "disallowed_STD3_mapped", [32]], [[8203, 8203], "ignored"], [[8204, 8205], "deviation", []], [[8206, 8207], "disallowed"], [[8208, 8208], "valid", [], "NV8"], [[8209, 8209], "mapped", [8208]], [[8210, 8214], "valid", [], "NV8"], [[8215, 8215], "disallowed_STD3_mapped", [32, 819]], [[8216, 8227], "valid", [], "NV8"], [[8228, 8230], "disallowed"], [[8231, 8231], "valid", [], "NV8"], [[8232, 8238], "disallowed"], [[8239, 8239], "disallowed_STD3_mapped", [32]], [[8240, 8242], "valid", [], "NV8"], [[8243, 8243], "mapped", [8242, 8242]], [[8244, 8244], "mapped", [8242, 8242, 8242]], [[8245, 8245], "valid", [], "NV8"], [[8246, 8246], "mapped", [8245, 8245]], [[8247, 8247], "mapped", [8245, 8245, 8245]], [[8248, 8251], "valid", [], "NV8"], [[8252, 8252], "disallowed_STD3_mapped", [33, 33]], [[8253, 8253], "valid", [], "NV8"], [[8254, 8254], "disallowed_STD3_mapped", [32, 773]], [[8255, 8262], "valid", [], "NV8"], [[8263, 8263], "disallowed_STD3_mapped", [63, 63]], [[8264, 8264], "disallowed_STD3_mapped", [63, 33]], [[8265, 8265], "disallowed_STD3_mapped", [33, 63]], [[8266, 8269], "valid", [], "NV8"], [[8270, 8274], "valid", [], "NV8"], [[8275, 8276], "valid", [], "NV8"], [[8277, 8278], "valid", [], "NV8"], [[8279, 8279], "mapped", [8242, 8242, 8242, 8242]], [[8280, 8286], "valid", [], "NV8"], [[8287, 8287], "disallowed_STD3_mapped", [32]], [[8288, 8288], "ignored"], [[8289, 8291], "disallowed"], [[8292, 8292], "ignored"], [[8293, 8293], "disallowed"], [[8294, 8297], "disallowed"], [[8298, 8303], "disallowed"], [[8304, 8304], "mapped", [48]], [[8305, 8305], "mapped", [105]], [[8306, 8307], "disallowed"], [[8308, 8308], "mapped", [52]], [[8309, 8309], "mapped", [53]], [[8310, 8310], "mapped", [54]], [[8311, 8311], "mapped", [55]], [[8312, 8312], "mapped", [56]], [[8313, 8313], "mapped", [57]], [[8314, 8314], "disallowed_STD3_mapped", [43]], [[8315, 8315], "mapped", [8722]], [[8316, 8316], "disallowed_STD3_mapped", [61]], [[8317, 8317], "disallowed_STD3_mapped", [40]], [[8318, 8318], "disallowed_STD3_mapped", [41]], [[8319, 8319], "mapped", [110]], [[8320, 8320], "mapped", [48]], [[8321, 8321], "mapped", [49]], [[8322, 8322], "mapped", [50]], [[8323, 8323], "mapped", [51]], [[8324, 8324], "mapped", [52]], [[8325, 8325], "mapped", [53]], [[8326, 8326], "mapped", [54]], [[8327, 8327], "mapped", [55]], [[8328, 8328], "mapped", [56]], [[8329, 8329], "mapped", [57]], [[8330, 8330], "disallowed_STD3_mapped", [43]], [[8331, 8331], "mapped", [8722]], [[8332, 8332], "disallowed_STD3_mapped", [61]], [[8333, 8333], "disallowed_STD3_mapped", [40]], [[8334, 8334], "disallowed_STD3_mapped", [41]], [[8335, 8335], "disallowed"], [[8336, 8336], "mapped", [97]], [[8337, 8337], "mapped", [101]], [[8338, 8338], "mapped", [111]], [[8339, 8339], "mapped", [120]], [[8340, 8340], "mapped", [601]], [[8341, 8341], "mapped", [104]], [[8342, 8342], "mapped", [107]], [[8343, 8343], "mapped", [108]], [[8344, 8344], "mapped", [109]], [[8345, 8345], "mapped", [110]], [[8346, 8346], "mapped", [112]], [[8347, 8347], "mapped", [115]], [[8348, 8348], "mapped", [116]], [[8349, 8351], "disallowed"], [[8352, 8359], "valid", [], "NV8"], [[8360, 8360], "mapped", [114, 115]], [[8361, 8362], "valid", [], "NV8"], [[8363, 8363], "valid", [], "NV8"], [[8364, 8364], "valid", [], "NV8"], [[8365, 8367], "valid", [], "NV8"], [[8368, 8369], "valid", [], "NV8"], [[8370, 8373], "valid", [], "NV8"], [[8374, 8376], "valid", [], "NV8"], [[8377, 8377], "valid", [], "NV8"], [[8378, 8378], "valid", [], "NV8"], [[8379, 8381], "valid", [], "NV8"], [[8382, 8382], "valid", [], "NV8"], [[8383, 8399], "disallowed"], [[8400, 8417], "valid", [], "NV8"], [[8418, 8419], "valid", [], "NV8"], [[8420, 8426], "valid", [], "NV8"], [[8427, 8427], "valid", [], "NV8"], [[8428, 8431], "valid", [], "NV8"], [[8432, 8432], "valid", [], "NV8"], [[8433, 8447], "disallowed"], [[8448, 8448], "disallowed_STD3_mapped", [97, 47, 99]], [[8449, 8449], "disallowed_STD3_mapped", [97, 47, 115]], [[8450, 8450], "mapped", [99]], [[8451, 8451], "mapped", [176, 99]], [[8452, 8452], "valid", [], "NV8"], [[8453, 8453], "disallowed_STD3_mapped", [99, 47, 111]], [[8454, 8454], "disallowed_STD3_mapped", [99, 47, 117]], [[8455, 8455], "mapped", [603]], [[8456, 8456], "valid", [], "NV8"], [[8457, 8457], "mapped", [176, 102]], [[8458, 8458], "mapped", [103]], [[8459, 8462], "mapped", [104]], [[8463, 8463], "mapped", [295]], [[8464, 8465], "mapped", [105]], [[8466, 8467], "mapped", [108]], [[8468, 8468], "valid", [], "NV8"], [[8469, 8469], "mapped", [110]], [[8470, 8470], "mapped", [110, 111]], [[8471, 8472], "valid", [], "NV8"], [[8473, 8473], "mapped", [112]], [[8474, 8474], "mapped", [113]], [[8475, 8477], "mapped", [114]], [[8478, 8479], "valid", [], "NV8"], [[8480, 8480], "mapped", [115, 109]], [[8481, 8481], "mapped", [116, 101, 108]], [[8482, 8482], "mapped", [116, 109]], [[8483, 8483], "valid", [], "NV8"], [[8484, 8484], "mapped", [122]], [[8485, 8485], "valid", [], "NV8"], [[8486, 8486], "mapped", [969]], [[8487, 8487], "valid", [], "NV8"], [[8488, 8488], "mapped", [122]], [[8489, 8489], "valid", [], "NV8"], [[8490, 8490], "mapped", [107]], [[8491, 8491], "mapped", [229]], [[8492, 8492], "mapped", [98]], [[8493, 8493], "mapped", [99]], [[8494, 8494], "valid", [], "NV8"], [[8495, 8496], "mapped", [101]], [[8497, 8497], "mapped", [102]], [[8498, 8498], "disallowed"], [[8499, 8499], "mapped", [109]], [[8500, 8500], "mapped", [111]], [[8501, 8501], "mapped", [1488]], [[8502, 8502], "mapped", [1489]], [[8503, 8503], "mapped", [1490]], [[8504, 8504], "mapped", [1491]], [[8505, 8505], "mapped", [105]], [[8506, 8506], "valid", [], "NV8"], [[8507, 8507], "mapped", [102, 97, 120]], [[8508, 8508], "mapped", [960]], [[8509, 8510], "mapped", [947]], [[8511, 8511], "mapped", [960]], [[8512, 8512], "mapped", [8721]], [[8513, 8516], "valid", [], "NV8"], [[8517, 8518], "mapped", [100]], [[8519, 8519], "mapped", [101]], [[8520, 8520], "mapped", [105]], [[8521, 8521], "mapped", [106]], [[8522, 8523], "valid", [], "NV8"], [[8524, 8524], "valid", [], "NV8"], [[8525, 8525], "valid", [], "NV8"], [[8526, 8526], "valid"], [[8527, 8527], "valid", [], "NV8"], [[8528, 8528], "mapped", [49, 8260, 55]], [[8529, 8529], "mapped", [49, 8260, 57]], [[8530, 8530], "mapped", [49, 8260, 49, 48]], [[8531, 8531], "mapped", [49, 8260, 51]], [[8532, 8532], "mapped", [50, 8260, 51]], [[8533, 8533], "mapped", [49, 8260, 53]], [[8534, 8534], "mapped", [50, 8260, 53]], [[8535, 8535], "mapped", [51, 8260, 53]], [[8536, 8536], "mapped", [52, 8260, 53]], [[8537, 8537], "mapped", [49, 8260, 54]], [[8538, 8538], "mapped", [53, 8260, 54]], [[8539, 8539], "mapped", [49, 8260, 56]], [[8540, 8540], "mapped", [51, 8260, 56]], [[8541, 8541], "mapped", [53, 8260, 56]], [[8542, 8542], "mapped", [55, 8260, 56]], [[8543, 8543], "mapped", [49, 8260]], [[8544, 8544], "mapped", [105]], [[8545, 8545], "mapped", [105, 105]], [[8546, 8546], "mapped", [105, 105, 105]], [[8547, 8547], "mapped", [105, 118]], [[8548, 8548], "mapped", [118]], [[8549, 8549], "mapped", [118, 105]], [[8550, 8550], "mapped", [118, 105, 105]], [[8551, 8551], "mapped", [118, 105, 105, 105]], [[8552, 8552], "mapped", [105, 120]], [[8553, 8553], "mapped", [120]], [[8554, 8554], "mapped", [120, 105]], [[8555, 8555], "mapped", [120, 105, 105]], [[8556, 8556], "mapped", [108]], [[8557, 8557], "mapped", [99]], [[8558, 8558], "mapped", [100]], [[8559, 8559], "mapped", [109]], [[8560, 8560], "mapped", [105]], [[8561, 8561], "mapped", [105, 105]], [[8562, 8562], "mapped", [105, 105, 105]], [[8563, 8563], "mapped", [105, 118]], [[8564, 8564], "mapped", [118]], [[8565, 8565], "mapped", [118, 105]], [[8566, 8566], "mapped", [118, 105, 105]], [[8567, 8567], "mapped", [118, 105, 105, 105]], [[8568, 8568], "mapped", [105, 120]], [[8569, 8569], "mapped", [120]], [[8570, 8570], "mapped", [120, 105]], [[8571, 8571], "mapped", [120, 105, 105]], [[8572, 8572], "mapped", [108]], [[8573, 8573], "mapped", [99]], [[8574, 8574], "mapped", [100]], [[8575, 8575], "mapped", [109]], [[8576, 8578], "valid", [], "NV8"], [[8579, 8579], "disallowed"], [[8580, 8580], "valid"], [[8581, 8584], "valid", [], "NV8"], [[8585, 8585], "mapped", [48, 8260, 51]], [[8586, 8587], "valid", [], "NV8"], [[8588, 8591], "disallowed"], [[8592, 8682], "valid", [], "NV8"], [[8683, 8691], "valid", [], "NV8"], [[8692, 8703], "valid", [], "NV8"], [[8704, 8747], "valid", [], "NV8"], [[8748, 8748], "mapped", [8747, 8747]], [[8749, 8749], "mapped", [8747, 8747, 8747]], [[8750, 8750], "valid", [], "NV8"], [[8751, 8751], "mapped", [8750, 8750]], [[8752, 8752], "mapped", [8750, 8750, 8750]], [[8753, 8799], "valid", [], "NV8"], [[8800, 8800], "disallowed_STD3_valid"], [[8801, 8813], "valid", [], "NV8"], [[8814, 8815], "disallowed_STD3_valid"], [[8816, 8945], "valid", [], "NV8"], [[8946, 8959], "valid", [], "NV8"], [[8960, 8960], "valid", [], "NV8"], [[8961, 8961], "valid", [], "NV8"], [[8962, 9e3], "valid", [], "NV8"], [[9001, 9001], "mapped", [12296]], [[9002, 9002], "mapped", [12297]], [[9003, 9082], "valid", [], "NV8"], [[9083, 9083], "valid", [], "NV8"], [[9084, 9084], "valid", [], "NV8"], [[9085, 9114], "valid", [], "NV8"], [[9115, 9166], "valid", [], "NV8"], [[9167, 9168], "valid", [], "NV8"], [[9169, 9179], "valid", [], "NV8"], [[9180, 9191], "valid", [], "NV8"], [[9192, 9192], "valid", [], "NV8"], [[9193, 9203], "valid", [], "NV8"], [[9204, 9210], "valid", [], "NV8"], [[9211, 9215], "disallowed"], [[9216, 9252], "valid", [], "NV8"], [[9253, 9254], "valid", [], "NV8"], [[9255, 9279], "disallowed"], [[9280, 9290], "valid", [], "NV8"], [[9291, 9311], "disallowed"], [[9312, 9312], "mapped", [49]], [[9313, 9313], "mapped", [50]], [[9314, 9314], "mapped", [51]], [[9315, 9315], "mapped", [52]], [[9316, 9316], "mapped", [53]], [[9317, 9317], "mapped", [54]], [[9318, 9318], "mapped", [55]], [[9319, 9319], "mapped", [56]], [[9320, 9320], "mapped", [57]], [[9321, 9321], "mapped", [49, 48]], [[9322, 9322], "mapped", [49, 49]], [[9323, 9323], "mapped", [49, 50]], [[9324, 9324], "mapped", [49, 51]], [[9325, 9325], "mapped", [49, 52]], [[9326, 9326], "mapped", [49, 53]], [[9327, 9327], "mapped", [49, 54]], [[9328, 9328], "mapped", [49, 55]], [[9329, 9329], "mapped", [49, 56]], [[9330, 9330], "mapped", [49, 57]], [[9331, 9331], "mapped", [50, 48]], [[9332, 9332], "disallowed_STD3_mapped", [40, 49, 41]], [[9333, 9333], "disallowed_STD3_mapped", [40, 50, 41]], [[9334, 9334], "disallowed_STD3_mapped", [40, 51, 41]], [[9335, 9335], "disallowed_STD3_mapped", [40, 52, 41]], [[9336, 9336], "disallowed_STD3_mapped", [40, 53, 41]], [[9337, 9337], "disallowed_STD3_mapped", [40, 54, 41]], [[9338, 9338], "disallowed_STD3_mapped", [40, 55, 41]], [[9339, 9339], "disallowed_STD3_mapped", [40, 56, 41]], [[9340, 9340], "disallowed_STD3_mapped", [40, 57, 41]], [[9341, 9341], "disallowed_STD3_mapped", [40, 49, 48, 41]], [[9342, 9342], "disallowed_STD3_mapped", [40, 49, 49, 41]], [[9343, 9343], "disallowed_STD3_mapped", [40, 49, 50, 41]], [[9344, 9344], "disallowed_STD3_mapped", [40, 49, 51, 41]], [[9345, 9345], "disallowed_STD3_mapped", [40, 49, 52, 41]], [[9346, 9346], "disallowed_STD3_mapped", [40, 49, 53, 41]], [[9347, 9347], "disallowed_STD3_mapped", [40, 49, 54, 41]], [[9348, 9348], "disallowed_STD3_mapped", [40, 49, 55, 41]], [[9349, 9349], "disallowed_STD3_mapped", [40, 49, 56, 41]], [[9350, 9350], "disallowed_STD3_mapped", [40, 49, 57, 41]], [[9351, 9351], "disallowed_STD3_mapped", [40, 50, 48, 41]], [[9352, 9371], "disallowed"], [[9372, 9372], "disallowed_STD3_mapped", [40, 97, 41]], [[9373, 9373], "disallowed_STD3_mapped", [40, 98, 41]], [[9374, 9374], "disallowed_STD3_mapped", [40, 99, 41]], [[9375, 9375], "disallowed_STD3_mapped", [40, 100, 41]], [[9376, 9376], "disallowed_STD3_mapped", [40, 101, 41]], [[9377, 9377], "disallowed_STD3_mapped", [40, 102, 41]], [[9378, 9378], "disallowed_STD3_mapped", [40, 103, 41]], [[9379, 9379], "disallowed_STD3_mapped", [40, 104, 41]], [[9380, 9380], "disallowed_STD3_mapped", [40, 105, 41]], [[9381, 9381], "disallowed_STD3_mapped", [40, 106, 41]], [[9382, 9382], "disallowed_STD3_mapped", [40, 107, 41]], [[9383, 9383], "disallowed_STD3_mapped", [40, 108, 41]], [[9384, 9384], "disallowed_STD3_mapped", [40, 109, 41]], [[9385, 9385], "disallowed_STD3_mapped", [40, 110, 41]], [[9386, 9386], "disallowed_STD3_mapped", [40, 111, 41]], [[9387, 9387], "disallowed_STD3_mapped", [40, 112, 41]], [[9388, 9388], "disallowed_STD3_mapped", [40, 113, 41]], [[9389, 9389], "disallowed_STD3_mapped", [40, 114, 41]], [[9390, 9390], "disallowed_STD3_mapped", [40, 115, 41]], [[9391, 9391], "disallowed_STD3_mapped", [40, 116, 41]], [[9392, 9392], "disallowed_STD3_mapped", [40, 117, 41]], [[9393, 9393], "disallowed_STD3_mapped", [40, 118, 41]], [[9394, 9394], "disallowed_STD3_mapped", [40, 119, 41]], [[9395, 9395], "disallowed_STD3_mapped", [40, 120, 41]], [[9396, 9396], "disallowed_STD3_mapped", [40, 121, 41]], [[9397, 9397], "disallowed_STD3_mapped", [40, 122, 41]], [[9398, 9398], "mapped", [97]], [[9399, 9399], "mapped", [98]], [[9400, 9400], "mapped", [99]], [[9401, 9401], "mapped", [100]], [[9402, 9402], "mapped", [101]], [[9403, 9403], "mapped", [102]], [[9404, 9404], "mapped", [103]], [[9405, 9405], "mapped", [104]], [[9406, 9406], "mapped", [105]], [[9407, 9407], "mapped", [106]], [[9408, 9408], "mapped", [107]], [[9409, 9409], "mapped", [108]], [[9410, 9410], "mapped", [109]], [[9411, 9411], "mapped", [110]], [[9412, 9412], "mapped", [111]], [[9413, 9413], "mapped", [112]], [[9414, 9414], "mapped", [113]], [[9415, 9415], "mapped", [114]], [[9416, 9416], "mapped", [115]], [[9417, 9417], "mapped", [116]], [[9418, 9418], "mapped", [117]], [[9419, 9419], "mapped", [118]], [[9420, 9420], "mapped", [119]], [[9421, 9421], "mapped", [120]], [[9422, 9422], "mapped", [121]], [[9423, 9423], "mapped", [122]], [[9424, 9424], "mapped", [97]], [[9425, 9425], "mapped", [98]], [[9426, 9426], "mapped", [99]], [[9427, 9427], "mapped", [100]], [[9428, 9428], "mapped", [101]], [[9429, 9429], "mapped", [102]], [[9430, 9430], "mapped", [103]], [[9431, 9431], "mapped", [104]], [[9432, 9432], "mapped", [105]], [[9433, 9433], "mapped", [106]], [[9434, 9434], "mapped", [107]], [[9435, 9435], "mapped", [108]], [[9436, 9436], "mapped", [109]], [[9437, 9437], "mapped", [110]], [[9438, 9438], "mapped", [111]], [[9439, 9439], "mapped", [112]], [[9440, 9440], "mapped", [113]], [[9441, 9441], "mapped", [114]], [[9442, 9442], "mapped", [115]], [[9443, 9443], "mapped", [116]], [[9444, 9444], "mapped", [117]], [[9445, 9445], "mapped", [118]], [[9446, 9446], "mapped", [119]], [[9447, 9447], "mapped", [120]], [[9448, 9448], "mapped", [121]], [[9449, 9449], "mapped", [122]], [[9450, 9450], "mapped", [48]], [[9451, 9470], "valid", [], "NV8"], [[9471, 9471], "valid", [], "NV8"], [[9472, 9621], "valid", [], "NV8"], [[9622, 9631], "valid", [], "NV8"], [[9632, 9711], "valid", [], "NV8"], [[9712, 9719], "valid", [], "NV8"], [[9720, 9727], "valid", [], "NV8"], [[9728, 9747], "valid", [], "NV8"], [[9748, 9749], "valid", [], "NV8"], [[9750, 9751], "valid", [], "NV8"], [[9752, 9752], "valid", [], "NV8"], [[9753, 9753], "valid", [], "NV8"], [[9754, 9839], "valid", [], "NV8"], [[9840, 9841], "valid", [], "NV8"], [[9842, 9853], "valid", [], "NV8"], [[9854, 9855], "valid", [], "NV8"], [[9856, 9865], "valid", [], "NV8"], [[9866, 9873], "valid", [], "NV8"], [[9874, 9884], "valid", [], "NV8"], [[9885, 9885], "valid", [], "NV8"], [[9886, 9887], "valid", [], "NV8"], [[9888, 9889], "valid", [], "NV8"], [[9890, 9905], "valid", [], "NV8"], [[9906, 9906], "valid", [], "NV8"], [[9907, 9916], "valid", [], "NV8"], [[9917, 9919], "valid", [], "NV8"], [[9920, 9923], "valid", [], "NV8"], [[9924, 9933], "valid", [], "NV8"], [[9934, 9934], "valid", [], "NV8"], [[9935, 9953], "valid", [], "NV8"], [[9954, 9954], "valid", [], "NV8"], [[9955, 9955], "valid", [], "NV8"], [[9956, 9959], "valid", [], "NV8"], [[9960, 9983], "valid", [], "NV8"], [[9984, 9984], "valid", [], "NV8"], [[9985, 9988], "valid", [], "NV8"], [[9989, 9989], "valid", [], "NV8"], [[9990, 9993], "valid", [], "NV8"], [[9994, 9995], "valid", [], "NV8"], [[9996, 10023], "valid", [], "NV8"], [[10024, 10024], "valid", [], "NV8"], [[10025, 10059], "valid", [], "NV8"], [[10060, 10060], "valid", [], "NV8"], [[10061, 10061], "valid", [], "NV8"], [[10062, 10062], "valid", [], "NV8"], [[10063, 10066], "valid", [], "NV8"], [[10067, 10069], "valid", [], "NV8"], [[10070, 10070], "valid", [], "NV8"], [[10071, 10071], "valid", [], "NV8"], [[10072, 10078], "valid", [], "NV8"], [[10079, 10080], "valid", [], "NV8"], [[10081, 10087], "valid", [], "NV8"], [[10088, 10101], "valid", [], "NV8"], [[10102, 10132], "valid", [], "NV8"], [[10133, 10135], "valid", [], "NV8"], [[10136, 10159], "valid", [], "NV8"], [[10160, 10160], "valid", [], "NV8"], [[10161, 10174], "valid", [], "NV8"], [[10175, 10175], "valid", [], "NV8"], [[10176, 10182], "valid", [], "NV8"], [[10183, 10186], "valid", [], "NV8"], [[10187, 10187], "valid", [], "NV8"], [[10188, 10188], "valid", [], "NV8"], [[10189, 10189], "valid", [], "NV8"], [[10190, 10191], "valid", [], "NV8"], [[10192, 10219], "valid", [], "NV8"], [[10220, 10223], "valid", [], "NV8"], [[10224, 10239], "valid", [], "NV8"], [[10240, 10495], "valid", [], "NV8"], [[10496, 10763], "valid", [], "NV8"], [[10764, 10764], "mapped", [8747, 8747, 8747, 8747]], [[10765, 10867], "valid", [], "NV8"], [[10868, 10868], "disallowed_STD3_mapped", [58, 58, 61]], [[10869, 10869], "disallowed_STD3_mapped", [61, 61]], [[10870, 10870], "disallowed_STD3_mapped", [61, 61, 61]], [[10871, 10971], "valid", [], "NV8"], [[10972, 10972], "mapped", [10973, 824]], [[10973, 11007], "valid", [], "NV8"], [[11008, 11021], "valid", [], "NV8"], [[11022, 11027], "valid", [], "NV8"], [[11028, 11034], "valid", [], "NV8"], [[11035, 11039], "valid", [], "NV8"], [[11040, 11043], "valid", [], "NV8"], [[11044, 11084], "valid", [], "NV8"], [[11085, 11087], "valid", [], "NV8"], [[11088, 11092], "valid", [], "NV8"], [[11093, 11097], "valid", [], "NV8"], [[11098, 11123], "valid", [], "NV8"], [[11124, 11125], "disallowed"], [[11126, 11157], "valid", [], "NV8"], [[11158, 11159], "disallowed"], [[11160, 11193], "valid", [], "NV8"], [[11194, 11196], "disallowed"], [[11197, 11208], "valid", [], "NV8"], [[11209, 11209], "disallowed"], [[11210, 11217], "valid", [], "NV8"], [[11218, 11243], "disallowed"], [[11244, 11247], "valid", [], "NV8"], [[11248, 11263], "disallowed"], [[11264, 11264], "mapped", [11312]], [[11265, 11265], "mapped", [11313]], [[11266, 11266], "mapped", [11314]], [[11267, 11267], "mapped", [11315]], [[11268, 11268], "mapped", [11316]], [[11269, 11269], "mapped", [11317]], [[11270, 11270], "mapped", [11318]], [[11271, 11271], "mapped", [11319]], [[11272, 11272], "mapped", [11320]], [[11273, 11273], "mapped", [11321]], [[11274, 11274], "mapped", [11322]], [[11275, 11275], "mapped", [11323]], [[11276, 11276], "mapped", [11324]], [[11277, 11277], "mapped", [11325]], [[11278, 11278], "mapped", [11326]], [[11279, 11279], "mapped", [11327]], [[11280, 11280], "mapped", [11328]], [[11281, 11281], "mapped", [11329]], [[11282, 11282], "mapped", [11330]], [[11283, 11283], "mapped", [11331]], [[11284, 11284], "mapped", [11332]], [[11285, 11285], "mapped", [11333]], [[11286, 11286], "mapped", [11334]], [[11287, 11287], "mapped", [11335]], [[11288, 11288], "mapped", [11336]], [[11289, 11289], "mapped", [11337]], [[11290, 11290], "mapped", [11338]], [[11291, 11291], "mapped", [11339]], [[11292, 11292], "mapped", [11340]], [[11293, 11293], "mapped", [11341]], [[11294, 11294], "mapped", [11342]], [[11295, 11295], "mapped", [11343]], [[11296, 11296], "mapped", [11344]], [[11297, 11297], "mapped", [11345]], [[11298, 11298], "mapped", [11346]], [[11299, 11299], "mapped", [11347]], [[11300, 11300], "mapped", [11348]], [[11301, 11301], "mapped", [11349]], [[11302, 11302], "mapped", [11350]], [[11303, 11303], "mapped", [11351]], [[11304, 11304], "mapped", [11352]], [[11305, 11305], "mapped", [11353]], [[11306, 11306], "mapped", [11354]], [[11307, 11307], "mapped", [11355]], [[11308, 11308], "mapped", [11356]], [[11309, 11309], "mapped", [11357]], [[11310, 11310], "mapped", [11358]], [[11311, 11311], "disallowed"], [[11312, 11358], "valid"], [[11359, 11359], "disallowed"], [[11360, 11360], "mapped", [11361]], [[11361, 11361], "valid"], [[11362, 11362], "mapped", [619]], [[11363, 11363], "mapped", [7549]], [[11364, 11364], "mapped", [637]], [[11365, 11366], "valid"], [[11367, 11367], "mapped", [11368]], [[11368, 11368], "valid"], [[11369, 11369], "mapped", [11370]], [[11370, 11370], "valid"], [[11371, 11371], "mapped", [11372]], [[11372, 11372], "valid"], [[11373, 11373], "mapped", [593]], [[11374, 11374], "mapped", [625]], [[11375, 11375], "mapped", [592]], [[11376, 11376], "mapped", [594]], [[11377, 11377], "valid"], [[11378, 11378], "mapped", [11379]], [[11379, 11379], "valid"], [[11380, 11380], "valid"], [[11381, 11381], "mapped", [11382]], [[11382, 11383], "valid"], [[11384, 11387], "valid"], [[11388, 11388], "mapped", [106]], [[11389, 11389], "mapped", [118]], [[11390, 11390], "mapped", [575]], [[11391, 11391], "mapped", [576]], [[11392, 11392], "mapped", [11393]], [[11393, 11393], "valid"], [[11394, 11394], "mapped", [11395]], [[11395, 11395], "valid"], [[11396, 11396], "mapped", [11397]], [[11397, 11397], "valid"], [[11398, 11398], "mapped", [11399]], [[11399, 11399], "valid"], [[11400, 11400], "mapped", [11401]], [[11401, 11401], "valid"], [[11402, 11402], "mapped", [11403]], [[11403, 11403], "valid"], [[11404, 11404], "mapped", [11405]], [[11405, 11405], "valid"], [[11406, 11406], "mapped", [11407]], [[11407, 11407], "valid"], [[11408, 11408], "mapped", [11409]], [[11409, 11409], "valid"], [[11410, 11410], "mapped", [11411]], [[11411, 11411], "valid"], [[11412, 11412], "mapped", [11413]], [[11413, 11413], "valid"], [[11414, 11414], "mapped", [11415]], [[11415, 11415], "valid"], [[11416, 11416], "mapped", [11417]], [[11417, 11417], "valid"], [[11418, 11418], "mapped", [11419]], [[11419, 11419], "valid"], [[11420, 11420], "mapped", [11421]], [[11421, 11421], "valid"], [[11422, 11422], "mapped", [11423]], [[11423, 11423], "valid"], [[11424, 11424], "mapped", [11425]], [[11425, 11425], "valid"], [[11426, 11426], "mapped", [11427]], [[11427, 11427], "valid"], [[11428, 11428], "mapped", [11429]], [[11429, 11429], "valid"], [[11430, 11430], "mapped", [11431]], [[11431, 11431], "valid"], [[11432, 11432], "mapped", [11433]], [[11433, 11433], "valid"], [[11434, 11434], "mapped", [11435]], [[11435, 11435], "valid"], [[11436, 11436], "mapped", [11437]], [[11437, 11437], "valid"], [[11438, 11438], "mapped", [11439]], [[11439, 11439], "valid"], [[11440, 11440], "mapped", [11441]], [[11441, 11441], "valid"], [[11442, 11442], "mapped", [11443]], [[11443, 11443], "valid"], [[11444, 11444], "mapped", [11445]], [[11445, 11445], "valid"], [[11446, 11446], "mapped", [11447]], [[11447, 11447], "valid"], [[11448, 11448], "mapped", [11449]], [[11449, 11449], "valid"], [[11450, 11450], "mapped", [11451]], [[11451, 11451], "valid"], [[11452, 11452], "mapped", [11453]], [[11453, 11453], "valid"], [[11454, 11454], "mapped", [11455]], [[11455, 11455], "valid"], [[11456, 11456], "mapped", [11457]], [[11457, 11457], "valid"], [[11458, 11458], "mapped", [11459]], [[11459, 11459], "valid"], [[11460, 11460], "mapped", [11461]], [[11461, 11461], "valid"], [[11462, 11462], "mapped", [11463]], [[11463, 11463], "valid"], [[11464, 11464], "mapped", [11465]], [[11465, 11465], "valid"], [[11466, 11466], "mapped", [11467]], [[11467, 11467], "valid"], [[11468, 11468], "mapped", [11469]], [[11469, 11469], "valid"], [[11470, 11470], "mapped", [11471]], [[11471, 11471], "valid"], [[11472, 11472], "mapped", [11473]], [[11473, 11473], "valid"], [[11474, 11474], "mapped", [11475]], [[11475, 11475], "valid"], [[11476, 11476], "mapped", [11477]], [[11477, 11477], "valid"], [[11478, 11478], "mapped", [11479]], [[11479, 11479], "valid"], [[11480, 11480], "mapped", [11481]], [[11481, 11481], "valid"], [[11482, 11482], "mapped", [11483]], [[11483, 11483], "valid"], [[11484, 11484], "mapped", [11485]], [[11485, 11485], "valid"], [[11486, 11486], "mapped", [11487]], [[11487, 11487], "valid"], [[11488, 11488], "mapped", [11489]], [[11489, 11489], "valid"], [[11490, 11490], "mapped", [11491]], [[11491, 11492], "valid"], [[11493, 11498], "valid", [], "NV8"], [[11499, 11499], "mapped", [11500]], [[11500, 11500], "valid"], [[11501, 11501], "mapped", [11502]], [[11502, 11505], "valid"], [[11506, 11506], "mapped", [11507]], [[11507, 11507], "valid"], [[11508, 11512], "disallowed"], [[11513, 11519], "valid", [], "NV8"], [[11520, 11557], "valid"], [[11558, 11558], "disallowed"], [[11559, 11559], "valid"], [[11560, 11564], "disallowed"], [[11565, 11565], "valid"], [[11566, 11567], "disallowed"], [[11568, 11621], "valid"], [[11622, 11623], "valid"], [[11624, 11630], "disallowed"], [[11631, 11631], "mapped", [11617]], [[11632, 11632], "valid", [], "NV8"], [[11633, 11646], "disallowed"], [[11647, 11647], "valid"], [[11648, 11670], "valid"], [[11671, 11679], "disallowed"], [[11680, 11686], "valid"], [[11687, 11687], "disallowed"], [[11688, 11694], "valid"], [[11695, 11695], "disallowed"], [[11696, 11702], "valid"], [[11703, 11703], "disallowed"], [[11704, 11710], "valid"], [[11711, 11711], "disallowed"], [[11712, 11718], "valid"], [[11719, 11719], "disallowed"], [[11720, 11726], "valid"], [[11727, 11727], "disallowed"], [[11728, 11734], "valid"], [[11735, 11735], "disallowed"], [[11736, 11742], "valid"], [[11743, 11743], "disallowed"], [[11744, 11775], "valid"], [[11776, 11799], "valid", [], "NV8"], [[11800, 11803], "valid", [], "NV8"], [[11804, 11805], "valid", [], "NV8"], [[11806, 11822], "valid", [], "NV8"], [[11823, 11823], "valid"], [[11824, 11824], "valid", [], "NV8"], [[11825, 11825], "valid", [], "NV8"], [[11826, 11835], "valid", [], "NV8"], [[11836, 11842], "valid", [], "NV8"], [[11843, 11903], "disallowed"], [[11904, 11929], "valid", [], "NV8"], [[11930, 11930], "disallowed"], [[11931, 11934], "valid", [], "NV8"], [[11935, 11935], "mapped", [27597]], [[11936, 12018], "valid", [], "NV8"], [[12019, 12019], "mapped", [40863]], [[12020, 12031], "disallowed"], [[12032, 12032], "mapped", [19968]], [[12033, 12033], "mapped", [20008]], [[12034, 12034], "mapped", [20022]], [[12035, 12035], "mapped", [20031]], [[12036, 12036], "mapped", [20057]], [[12037, 12037], "mapped", [20101]], [[12038, 12038], "mapped", [20108]], [[12039, 12039], "mapped", [20128]], [[12040, 12040], "mapped", [20154]], [[12041, 12041], "mapped", [20799]], [[12042, 12042], "mapped", [20837]], [[12043, 12043], "mapped", [20843]], [[12044, 12044], "mapped", [20866]], [[12045, 12045], "mapped", [20886]], [[12046, 12046], "mapped", [20907]], [[12047, 12047], "mapped", [20960]], [[12048, 12048], "mapped", [20981]], [[12049, 12049], "mapped", [20992]], [[12050, 12050], "mapped", [21147]], [[12051, 12051], "mapped", [21241]], [[12052, 12052], "mapped", [21269]], [[12053, 12053], "mapped", [21274]], [[12054, 12054], "mapped", [21304]], [[12055, 12055], "mapped", [21313]], [[12056, 12056], "mapped", [21340]], [[12057, 12057], "mapped", [21353]], [[12058, 12058], "mapped", [21378]], [[12059, 12059], "mapped", [21430]], [[12060, 12060], "mapped", [21448]], [[12061, 12061], "mapped", [21475]], [[12062, 12062], "mapped", [22231]], [[12063, 12063], "mapped", [22303]], [[12064, 12064], "mapped", [22763]], [[12065, 12065], "mapped", [22786]], [[12066, 12066], "mapped", [22794]], [[12067, 12067], "mapped", [22805]], [[12068, 12068], "mapped", [22823]], [[12069, 12069], "mapped", [22899]], [[12070, 12070], "mapped", [23376]], [[12071, 12071], "mapped", [23424]], [[12072, 12072], "mapped", [23544]], [[12073, 12073], "mapped", [23567]], [[12074, 12074], "mapped", [23586]], [[12075, 12075], "mapped", [23608]], [[12076, 12076], "mapped", [23662]], [[12077, 12077], "mapped", [23665]], [[12078, 12078], "mapped", [24027]], [[12079, 12079], "mapped", [24037]], [[12080, 12080], "mapped", [24049]], [[12081, 12081], "mapped", [24062]], [[12082, 12082], "mapped", [24178]], [[12083, 12083], "mapped", [24186]], [[12084, 12084], "mapped", [24191]], [[12085, 12085], "mapped", [24308]], [[12086, 12086], "mapped", [24318]], [[12087, 12087], "mapped", [24331]], [[12088, 12088], "mapped", [24339]], [[12089, 12089], "mapped", [24400]], [[12090, 12090], "mapped", [24417]], [[12091, 12091], "mapped", [24435]], [[12092, 12092], "mapped", [24515]], [[12093, 12093], "mapped", [25096]], [[12094, 12094], "mapped", [25142]], [[12095, 12095], "mapped", [25163]], [[12096, 12096], "mapped", [25903]], [[12097, 12097], "mapped", [25908]], [[12098, 12098], "mapped", [25991]], [[12099, 12099], "mapped", [26007]], [[12100, 12100], "mapped", [26020]], [[12101, 12101], "mapped", [26041]], [[12102, 12102], "mapped", [26080]], [[12103, 12103], "mapped", [26085]], [[12104, 12104], "mapped", [26352]], [[12105, 12105], "mapped", [26376]], [[12106, 12106], "mapped", [26408]], [[12107, 12107], "mapped", [27424]], [[12108, 12108], "mapped", [27490]], [[12109, 12109], "mapped", [27513]], [[12110, 12110], "mapped", [27571]], [[12111, 12111], "mapped", [27595]], [[12112, 12112], "mapped", [27604]], [[12113, 12113], "mapped", [27611]], [[12114, 12114], "mapped", [27663]], [[12115, 12115], "mapped", [27668]], [[12116, 12116], "mapped", [27700]], [[12117, 12117], "mapped", [28779]], [[12118, 12118], "mapped", [29226]], [[12119, 12119], "mapped", [29238]], [[12120, 12120], "mapped", [29243]], [[12121, 12121], "mapped", [29247]], [[12122, 12122], "mapped", [29255]], [[12123, 12123], "mapped", [29273]], [[12124, 12124], "mapped", [29275]], [[12125, 12125], "mapped", [29356]], [[12126, 12126], "mapped", [29572]], [[12127, 12127], "mapped", [29577]], [[12128, 12128], "mapped", [29916]], [[12129, 12129], "mapped", [29926]], [[12130, 12130], "mapped", [29976]], [[12131, 12131], "mapped", [29983]], [[12132, 12132], "mapped", [29992]], [[12133, 12133], "mapped", [3e4]], [[12134, 12134], "mapped", [30091]], [[12135, 12135], "mapped", [30098]], [[12136, 12136], "mapped", [30326]], [[12137, 12137], "mapped", [30333]], [[12138, 12138], "mapped", [30382]], [[12139, 12139], "mapped", [30399]], [[12140, 12140], "mapped", [30446]], [[12141, 12141], "mapped", [30683]], [[12142, 12142], "mapped", [30690]], [[12143, 12143], "mapped", [30707]], [[12144, 12144], "mapped", [31034]], [[12145, 12145], "mapped", [31160]], [[12146, 12146], "mapped", [31166]], [[12147, 12147], "mapped", [31348]], [[12148, 12148], "mapped", [31435]], [[12149, 12149], "mapped", [31481]], [[12150, 12150], "mapped", [31859]], [[12151, 12151], "mapped", [31992]], [[12152, 12152], "mapped", [32566]], [[12153, 12153], "mapped", [32593]], [[12154, 12154], "mapped", [32650]], [[12155, 12155], "mapped", [32701]], [[12156, 12156], "mapped", [32769]], [[12157, 12157], "mapped", [32780]], [[12158, 12158], "mapped", [32786]], [[12159, 12159], "mapped", [32819]], [[12160, 12160], "mapped", [32895]], [[12161, 12161], "mapped", [32905]], [[12162, 12162], "mapped", [33251]], [[12163, 12163], "mapped", [33258]], [[12164, 12164], "mapped", [33267]], [[12165, 12165], "mapped", [33276]], [[12166, 12166], "mapped", [33292]], [[12167, 12167], "mapped", [33307]], [[12168, 12168], "mapped", [33311]], [[12169, 12169], "mapped", [33390]], [[12170, 12170], "mapped", [33394]], [[12171, 12171], "mapped", [33400]], [[12172, 12172], "mapped", [34381]], [[12173, 12173], "mapped", [34411]], [[12174, 12174], "mapped", [34880]], [[12175, 12175], "mapped", [34892]], [[12176, 12176], "mapped", [34915]], [[12177, 12177], "mapped", [35198]], [[12178, 12178], "mapped", [35211]], [[12179, 12179], "mapped", [35282]], [[12180, 12180], "mapped", [35328]], [[12181, 12181], "mapped", [35895]], [[12182, 12182], "mapped", [35910]], [[12183, 12183], "mapped", [35925]], [[12184, 12184], "mapped", [35960]], [[12185, 12185], "mapped", [35997]], [[12186, 12186], "mapped", [36196]], [[12187, 12187], "mapped", [36208]], [[12188, 12188], "mapped", [36275]], [[12189, 12189], "mapped", [36523]], [[12190, 12190], "mapped", [36554]], [[12191, 12191], "mapped", [36763]], [[12192, 12192], "mapped", [36784]], [[12193, 12193], "mapped", [36789]], [[12194, 12194], "mapped", [37009]], [[12195, 12195], "mapped", [37193]], [[12196, 12196], "mapped", [37318]], [[12197, 12197], "mapped", [37324]], [[12198, 12198], "mapped", [37329]], [[12199, 12199], "mapped", [38263]], [[12200, 12200], "mapped", [38272]], [[12201, 12201], "mapped", [38428]], [[12202, 12202], "mapped", [38582]], [[12203, 12203], "mapped", [38585]], [[12204, 12204], "mapped", [38632]], [[12205, 12205], "mapped", [38737]], [[12206, 12206], "mapped", [38750]], [[12207, 12207], "mapped", [38754]], [[12208, 12208], "mapped", [38761]], [[12209, 12209], "mapped", [38859]], [[12210, 12210], "mapped", [38893]], [[12211, 12211], "mapped", [38899]], [[12212, 12212], "mapped", [38913]], [[12213, 12213], "mapped", [39080]], [[12214, 12214], "mapped", [39131]], [[12215, 12215], "mapped", [39135]], [[12216, 12216], "mapped", [39318]], [[12217, 12217], "mapped", [39321]], [[12218, 12218], "mapped", [39340]], [[12219, 12219], "mapped", [39592]], [[12220, 12220], "mapped", [39640]], [[12221, 12221], "mapped", [39647]], [[12222, 12222], "mapped", [39717]], [[12223, 12223], "mapped", [39727]], [[12224, 12224], "mapped", [39730]], [[12225, 12225], "mapped", [39740]], [[12226, 12226], "mapped", [39770]], [[12227, 12227], "mapped", [40165]], [[12228, 12228], "mapped", [40565]], [[12229, 12229], "mapped", [40575]], [[12230, 12230], "mapped", [40613]], [[12231, 12231], "mapped", [40635]], [[12232, 12232], "mapped", [40643]], [[12233, 12233], "mapped", [40653]], [[12234, 12234], "mapped", [40657]], [[12235, 12235], "mapped", [40697]], [[12236, 12236], "mapped", [40701]], [[12237, 12237], "mapped", [40718]], [[12238, 12238], "mapped", [40723]], [[12239, 12239], "mapped", [40736]], [[12240, 12240], "mapped", [40763]], [[12241, 12241], "mapped", [40778]], [[12242, 12242], "mapped", [40786]], [[12243, 12243], "mapped", [40845]], [[12244, 12244], "mapped", [40860]], [[12245, 12245], "mapped", [40864]], [[12246, 12271], "disallowed"], [[12272, 12283], "disallowed"], [[12284, 12287], "disallowed"], [[12288, 12288], "disallowed_STD3_mapped", [32]], [[12289, 12289], "valid", [], "NV8"], [[12290, 12290], "mapped", [46]], [[12291, 12292], "valid", [], "NV8"], [[12293, 12295], "valid"], [[12296, 12329], "valid", [], "NV8"], [[12330, 12333], "valid"], [[12334, 12341], "valid", [], "NV8"], [[12342, 12342], "mapped", [12306]], [[12343, 12343], "valid", [], "NV8"], [[12344, 12344], "mapped", [21313]], [[12345, 12345], "mapped", [21316]], [[12346, 12346], "mapped", [21317]], [[12347, 12347], "valid", [], "NV8"], [[12348, 12348], "valid"], [[12349, 12349], "valid", [], "NV8"], [[12350, 12350], "valid", [], "NV8"], [[12351, 12351], "valid", [], "NV8"], [[12352, 12352], "disallowed"], [[12353, 12436], "valid"], [[12437, 12438], "valid"], [[12439, 12440], "disallowed"], [[12441, 12442], "valid"], [[12443, 12443], "disallowed_STD3_mapped", [32, 12441]], [[12444, 12444], "disallowed_STD3_mapped", [32, 12442]], [[12445, 12446], "valid"], [[12447, 12447], "mapped", [12424, 12426]], [[12448, 12448], "valid", [], "NV8"], [[12449, 12542], "valid"], [[12543, 12543], "mapped", [12467, 12488]], [[12544, 12548], "disallowed"], [[12549, 12588], "valid"], [[12589, 12589], "valid"], [[12590, 12592], "disallowed"], [[12593, 12593], "mapped", [4352]], [[12594, 12594], "mapped", [4353]], [[12595, 12595], "mapped", [4522]], [[12596, 12596], "mapped", [4354]], [[12597, 12597], "mapped", [4524]], [[12598, 12598], "mapped", [4525]], [[12599, 12599], "mapped", [4355]], [[12600, 12600], "mapped", [4356]], [[12601, 12601], "mapped", [4357]], [[12602, 12602], "mapped", [4528]], [[12603, 12603], "mapped", [4529]], [[12604, 12604], "mapped", [4530]], [[12605, 12605], "mapped", [4531]], [[12606, 12606], "mapped", [4532]], [[12607, 12607], "mapped", [4533]], [[12608, 12608], "mapped", [4378]], [[12609, 12609], "mapped", [4358]], [[12610, 12610], "mapped", [4359]], [[12611, 12611], "mapped", [4360]], [[12612, 12612], "mapped", [4385]], [[12613, 12613], "mapped", [4361]], [[12614, 12614], "mapped", [4362]], [[12615, 12615], "mapped", [4363]], [[12616, 12616], "mapped", [4364]], [[12617, 12617], "mapped", [4365]], [[12618, 12618], "mapped", [4366]], [[12619, 12619], "mapped", [4367]], [[12620, 12620], "mapped", [4368]], [[12621, 12621], "mapped", [4369]], [[12622, 12622], "mapped", [4370]], [[12623, 12623], "mapped", [4449]], [[12624, 12624], "mapped", [4450]], [[12625, 12625], "mapped", [4451]], [[12626, 12626], "mapped", [4452]], [[12627, 12627], "mapped", [4453]], [[12628, 12628], "mapped", [4454]], [[12629, 12629], "mapped", [4455]], [[12630, 12630], "mapped", [4456]], [[12631, 12631], "mapped", [4457]], [[12632, 12632], "mapped", [4458]], [[12633, 12633], "mapped", [4459]], [[12634, 12634], "mapped", [4460]], [[12635, 12635], "mapped", [4461]], [[12636, 12636], "mapped", [4462]], [[12637, 12637], "mapped", [4463]], [[12638, 12638], "mapped", [4464]], [[12639, 12639], "mapped", [4465]], [[12640, 12640], "mapped", [4466]], [[12641, 12641], "mapped", [4467]], [[12642, 12642], "mapped", [4468]], [[12643, 12643], "mapped", [4469]], [[12644, 12644], "disallowed"], [[12645, 12645], "mapped", [4372]], [[12646, 12646], "mapped", [4373]], [[12647, 12647], "mapped", [4551]], [[12648, 12648], "mapped", [4552]], [[12649, 12649], "mapped", [4556]], [[12650, 12650], "mapped", [4558]], [[12651, 12651], "mapped", [4563]], [[12652, 12652], "mapped", [4567]], [[12653, 12653], "mapped", [4569]], [[12654, 12654], "mapped", [4380]], [[12655, 12655], "mapped", [4573]], [[12656, 12656], "mapped", [4575]], [[12657, 12657], "mapped", [4381]], [[12658, 12658], "mapped", [4382]], [[12659, 12659], "mapped", [4384]], [[12660, 12660], "mapped", [4386]], [[12661, 12661], "mapped", [4387]], [[12662, 12662], "mapped", [4391]], [[12663, 12663], "mapped", [4393]], [[12664, 12664], "mapped", [4395]], [[12665, 12665], "mapped", [4396]], [[12666, 12666], "mapped", [4397]], [[12667, 12667], "mapped", [4398]], [[12668, 12668], "mapped", [4399]], [[12669, 12669], "mapped", [4402]], [[12670, 12670], "mapped", [4406]], [[12671, 12671], "mapped", [4416]], [[12672, 12672], "mapped", [4423]], [[12673, 12673], "mapped", [4428]], [[12674, 12674], "mapped", [4593]], [[12675, 12675], "mapped", [4594]], [[12676, 12676], "mapped", [4439]], [[12677, 12677], "mapped", [4440]], [[12678, 12678], "mapped", [4441]], [[12679, 12679], "mapped", [4484]], [[12680, 12680], "mapped", [4485]], [[12681, 12681], "mapped", [4488]], [[12682, 12682], "mapped", [4497]], [[12683, 12683], "mapped", [4498]], [[12684, 12684], "mapped", [4500]], [[12685, 12685], "mapped", [4510]], [[12686, 12686], "mapped", [4513]], [[12687, 12687], "disallowed"], [[12688, 12689], "valid", [], "NV8"], [[12690, 12690], "mapped", [19968]], [[12691, 12691], "mapped", [20108]], [[12692, 12692], "mapped", [19977]], [[12693, 12693], "mapped", [22235]], [[12694, 12694], "mapped", [19978]], [[12695, 12695], "mapped", [20013]], [[12696, 12696], "mapped", [19979]], [[12697, 12697], "mapped", [30002]], [[12698, 12698], "mapped", [20057]], [[12699, 12699], "mapped", [19993]], [[12700, 12700], "mapped", [19969]], [[12701, 12701], "mapped", [22825]], [[12702, 12702], "mapped", [22320]], [[12703, 12703], "mapped", [20154]], [[12704, 12727], "valid"], [[12728, 12730], "valid"], [[12731, 12735], "disallowed"], [[12736, 12751], "valid", [], "NV8"], [[12752, 12771], "valid", [], "NV8"], [[12772, 12783], "disallowed"], [[12784, 12799], "valid"], [[12800, 12800], "disallowed_STD3_mapped", [40, 4352, 41]], [[12801, 12801], "disallowed_STD3_mapped", [40, 4354, 41]], [[12802, 12802], "disallowed_STD3_mapped", [40, 4355, 41]], [[12803, 12803], "disallowed_STD3_mapped", [40, 4357, 41]], [[12804, 12804], "disallowed_STD3_mapped", [40, 4358, 41]], [[12805, 12805], "disallowed_STD3_mapped", [40, 4359, 41]], [[12806, 12806], "disallowed_STD3_mapped", [40, 4361, 41]], [[12807, 12807], "disallowed_STD3_mapped", [40, 4363, 41]], [[12808, 12808], "disallowed_STD3_mapped", [40, 4364, 41]], [[12809, 12809], "disallowed_STD3_mapped", [40, 4366, 41]], [[12810, 12810], "disallowed_STD3_mapped", [40, 4367, 41]], [[12811, 12811], "disallowed_STD3_mapped", [40, 4368, 41]], [[12812, 12812], "disallowed_STD3_mapped", [40, 4369, 41]], [[12813, 12813], "disallowed_STD3_mapped", [40, 4370, 41]], [[12814, 12814], "disallowed_STD3_mapped", [40, 44032, 41]], [[12815, 12815], "disallowed_STD3_mapped", [40, 45208, 41]], [[12816, 12816], "disallowed_STD3_mapped", [40, 45796, 41]], [[12817, 12817], "disallowed_STD3_mapped", [40, 46972, 41]], [[12818, 12818], "disallowed_STD3_mapped", [40, 47560, 41]], [[12819, 12819], "disallowed_STD3_mapped", [40, 48148, 41]], [[12820, 12820], "disallowed_STD3_mapped", [40, 49324, 41]], [[12821, 12821], "disallowed_STD3_mapped", [40, 50500, 41]], [[12822, 12822], "disallowed_STD3_mapped", [40, 51088, 41]], [[12823, 12823], "disallowed_STD3_mapped", [40, 52264, 41]], [[12824, 12824], "disallowed_STD3_mapped", [40, 52852, 41]], [[12825, 12825], "disallowed_STD3_mapped", [40, 53440, 41]], [[12826, 12826], "disallowed_STD3_mapped", [40, 54028, 41]], [[12827, 12827], "disallowed_STD3_mapped", [40, 54616, 41]], [[12828, 12828], "disallowed_STD3_mapped", [40, 51452, 41]], [[12829, 12829], "disallowed_STD3_mapped", [40, 50724, 51204, 41]], [[12830, 12830], "disallowed_STD3_mapped", [40, 50724, 54980, 41]], [[12831, 12831], "disallowed"], [[12832, 12832], "disallowed_STD3_mapped", [40, 19968, 41]], [[12833, 12833], "disallowed_STD3_mapped", [40, 20108, 41]], [[12834, 12834], "disallowed_STD3_mapped", [40, 19977, 41]], [[12835, 12835], "disallowed_STD3_mapped", [40, 22235, 41]], [[12836, 12836], "disallowed_STD3_mapped", [40, 20116, 41]], [[12837, 12837], "disallowed_STD3_mapped", [40, 20845, 41]], [[12838, 12838], "disallowed_STD3_mapped", [40, 19971, 41]], [[12839, 12839], "disallowed_STD3_mapped", [40, 20843, 41]], [[12840, 12840], "disallowed_STD3_mapped", [40, 20061, 41]], [[12841, 12841], "disallowed_STD3_mapped", [40, 21313, 41]], [[12842, 12842], "disallowed_STD3_mapped", [40, 26376, 41]], [[12843, 12843], "disallowed_STD3_mapped", [40, 28779, 41]], [[12844, 12844], "disallowed_STD3_mapped", [40, 27700, 41]], [[12845, 12845], "disallowed_STD3_mapped", [40, 26408, 41]], [[12846, 12846], "disallowed_STD3_mapped", [40, 37329, 41]], [[12847, 12847], "disallowed_STD3_mapped", [40, 22303, 41]], [[12848, 12848], "disallowed_STD3_mapped", [40, 26085, 41]], [[12849, 12849], "disallowed_STD3_mapped", [40, 26666, 41]], [[12850, 12850], "disallowed_STD3_mapped", [40, 26377, 41]], [[12851, 12851], "disallowed_STD3_mapped", [40, 31038, 41]], [[12852, 12852], "disallowed_STD3_mapped", [40, 21517, 41]], [[12853, 12853], "disallowed_STD3_mapped", [40, 29305, 41]], [[12854, 12854], "disallowed_STD3_mapped", [40, 36001, 41]], [[12855, 12855], "disallowed_STD3_mapped", [40, 31069, 41]], [[12856, 12856], "disallowed_STD3_mapped", [40, 21172, 41]], [[12857, 12857], "disallowed_STD3_mapped", [40, 20195, 41]], [[12858, 12858], "disallowed_STD3_mapped", [40, 21628, 41]], [[12859, 12859], "disallowed_STD3_mapped", [40, 23398, 41]], [[12860, 12860], "disallowed_STD3_mapped", [40, 30435, 41]], [[12861, 12861], "disallowed_STD3_mapped", [40, 20225, 41]], [[12862, 12862], "disallowed_STD3_mapped", [40, 36039, 41]], [[12863, 12863], "disallowed_STD3_mapped", [40, 21332, 41]], [[12864, 12864], "disallowed_STD3_mapped", [40, 31085, 41]], [[12865, 12865], "disallowed_STD3_mapped", [40, 20241, 41]], [[12866, 12866], "disallowed_STD3_mapped", [40, 33258, 41]], [[12867, 12867], "disallowed_STD3_mapped", [40, 33267, 41]], [[12868, 12868], "mapped", [21839]], [[12869, 12869], "mapped", [24188]], [[12870, 12870], "mapped", [25991]], [[12871, 12871], "mapped", [31631]], [[12872, 12879], "valid", [], "NV8"], [[12880, 12880], "mapped", [112, 116, 101]], [[12881, 12881], "mapped", [50, 49]], [[12882, 12882], "mapped", [50, 50]], [[12883, 12883], "mapped", [50, 51]], [[12884, 12884], "mapped", [50, 52]], [[12885, 12885], "mapped", [50, 53]], [[12886, 12886], "mapped", [50, 54]], [[12887, 12887], "mapped", [50, 55]], [[12888, 12888], "mapped", [50, 56]], [[12889, 12889], "mapped", [50, 57]], [[12890, 12890], "mapped", [51, 48]], [[12891, 12891], "mapped", [51, 49]], [[12892, 12892], "mapped", [51, 50]], [[12893, 12893], "mapped", [51, 51]], [[12894, 12894], "mapped", [51, 52]], [[12895, 12895], "mapped", [51, 53]], [[12896, 12896], "mapped", [4352]], [[12897, 12897], "mapped", [4354]], [[12898, 12898], "mapped", [4355]], [[12899, 12899], "mapped", [4357]], [[12900, 12900], "mapped", [4358]], [[12901, 12901], "mapped", [4359]], [[12902, 12902], "mapped", [4361]], [[12903, 12903], "mapped", [4363]], [[12904, 12904], "mapped", [4364]], [[12905, 12905], "mapped", [4366]], [[12906, 12906], "mapped", [4367]], [[12907, 12907], "mapped", [4368]], [[12908, 12908], "mapped", [4369]], [[12909, 12909], "mapped", [4370]], [[12910, 12910], "mapped", [44032]], [[12911, 12911], "mapped", [45208]], [[12912, 12912], "mapped", [45796]], [[12913, 12913], "mapped", [46972]], [[12914, 12914], "mapped", [47560]], [[12915, 12915], "mapped", [48148]], [[12916, 12916], "mapped", [49324]], [[12917, 12917], "mapped", [50500]], [[12918, 12918], "mapped", [51088]], [[12919, 12919], "mapped", [52264]], [[12920, 12920], "mapped", [52852]], [[12921, 12921], "mapped", [53440]], [[12922, 12922], "mapped", [54028]], [[12923, 12923], "mapped", [54616]], [[12924, 12924], "mapped", [52280, 44256]], [[12925, 12925], "mapped", [51452, 51032]], [[12926, 12926], "mapped", [50864]], [[12927, 12927], "valid", [], "NV8"], [[12928, 12928], "mapped", [19968]], [[12929, 12929], "mapped", [20108]], [[12930, 12930], "mapped", [19977]], [[12931, 12931], "mapped", [22235]], [[12932, 12932], "mapped", [20116]], [[12933, 12933], "mapped", [20845]], [[12934, 12934], "mapped", [19971]], [[12935, 12935], "mapped", [20843]], [[12936, 12936], "mapped", [20061]], [[12937, 12937], "mapped", [21313]], [[12938, 12938], "mapped", [26376]], [[12939, 12939], "mapped", [28779]], [[12940, 12940], "mapped", [27700]], [[12941, 12941], "mapped", [26408]], [[12942, 12942], "mapped", [37329]], [[12943, 12943], "mapped", [22303]], [[12944, 12944], "mapped", [26085]], [[12945, 12945], "mapped", [26666]], [[12946, 12946], "mapped", [26377]], [[12947, 12947], "mapped", [31038]], [[12948, 12948], "mapped", [21517]], [[12949, 12949], "mapped", [29305]], [[12950, 12950], "mapped", [36001]], [[12951, 12951], "mapped", [31069]], [[12952, 12952], "mapped", [21172]], [[12953, 12953], "mapped", [31192]], [[12954, 12954], "mapped", [30007]], [[12955, 12955], "mapped", [22899]], [[12956, 12956], "mapped", [36969]], [[12957, 12957], "mapped", [20778]], [[12958, 12958], "mapped", [21360]], [[12959, 12959], "mapped", [27880]], [[12960, 12960], "mapped", [38917]], [[12961, 12961], "mapped", [20241]], [[12962, 12962], "mapped", [20889]], [[12963, 12963], "mapped", [27491]], [[12964, 12964], "mapped", [19978]], [[12965, 12965], "mapped", [20013]], [[12966, 12966], "mapped", [19979]], [[12967, 12967], "mapped", [24038]], [[12968, 12968], "mapped", [21491]], [[12969, 12969], "mapped", [21307]], [[12970, 12970], "mapped", [23447]], [[12971, 12971], "mapped", [23398]], [[12972, 12972], "mapped", [30435]], [[12973, 12973], "mapped", [20225]], [[12974, 12974], "mapped", [36039]], [[12975, 12975], "mapped", [21332]], [[12976, 12976], "mapped", [22812]], [[12977, 12977], "mapped", [51, 54]], [[12978, 12978], "mapped", [51, 55]], [[12979, 12979], "mapped", [51, 56]], [[12980, 12980], "mapped", [51, 57]], [[12981, 12981], "mapped", [52, 48]], [[12982, 12982], "mapped", [52, 49]], [[12983, 12983], "mapped", [52, 50]], [[12984, 12984], "mapped", [52, 51]], [[12985, 12985], "mapped", [52, 52]], [[12986, 12986], "mapped", [52, 53]], [[12987, 12987], "mapped", [52, 54]], [[12988, 12988], "mapped", [52, 55]], [[12989, 12989], "mapped", [52, 56]], [[12990, 12990], "mapped", [52, 57]], [[12991, 12991], "mapped", [53, 48]], [[12992, 12992], "mapped", [49, 26376]], [[12993, 12993], "mapped", [50, 26376]], [[12994, 12994], "mapped", [51, 26376]], [[12995, 12995], "mapped", [52, 26376]], [[12996, 12996], "mapped", [53, 26376]], [[12997, 12997], "mapped", [54, 26376]], [[12998, 12998], "mapped", [55, 26376]], [[12999, 12999], "mapped", [56, 26376]], [[13e3, 13e3], "mapped", [57, 26376]], [[13001, 13001], "mapped", [49, 48, 26376]], [[13002, 13002], "mapped", [49, 49, 26376]], [[13003, 13003], "mapped", [49, 50, 26376]], [[13004, 13004], "mapped", [104, 103]], [[13005, 13005], "mapped", [101, 114, 103]], [[13006, 13006], "mapped", [101, 118]], [[13007, 13007], "mapped", [108, 116, 100]], [[13008, 13008], "mapped", [12450]], [[13009, 13009], "mapped", [12452]], [[13010, 13010], "mapped", [12454]], [[13011, 13011], "mapped", [12456]], [[13012, 13012], "mapped", [12458]], [[13013, 13013], "mapped", [12459]], [[13014, 13014], "mapped", [12461]], [[13015, 13015], "mapped", [12463]], [[13016, 13016], "mapped", [12465]], [[13017, 13017], "mapped", [12467]], [[13018, 13018], "mapped", [12469]], [[13019, 13019], "mapped", [12471]], [[13020, 13020], "mapped", [12473]], [[13021, 13021], "mapped", [12475]], [[13022, 13022], "mapped", [12477]], [[13023, 13023], "mapped", [12479]], [[13024, 13024], "mapped", [12481]], [[13025, 13025], "mapped", [12484]], [[13026, 13026], "mapped", [12486]], [[13027, 13027], "mapped", [12488]], [[13028, 13028], "mapped", [12490]], [[13029, 13029], "mapped", [12491]], [[13030, 13030], "mapped", [12492]], [[13031, 13031], "mapped", [12493]], [[13032, 13032], "mapped", [12494]], [[13033, 13033], "mapped", [12495]], [[13034, 13034], "mapped", [12498]], [[13035, 13035], "mapped", [12501]], [[13036, 13036], "mapped", [12504]], [[13037, 13037], "mapped", [12507]], [[13038, 13038], "mapped", [12510]], [[13039, 13039], "mapped", [12511]], [[13040, 13040], "mapped", [12512]], [[13041, 13041], "mapped", [12513]], [[13042, 13042], "mapped", [12514]], [[13043, 13043], "mapped", [12516]], [[13044, 13044], "mapped", [12518]], [[13045, 13045], "mapped", [12520]], [[13046, 13046], "mapped", [12521]], [[13047, 13047], "mapped", [12522]], [[13048, 13048], "mapped", [12523]], [[13049, 13049], "mapped", [12524]], [[13050, 13050], "mapped", [12525]], [[13051, 13051], "mapped", [12527]], [[13052, 13052], "mapped", [12528]], [[13053, 13053], "mapped", [12529]], [[13054, 13054], "mapped", [12530]], [[13055, 13055], "disallowed"], [[13056, 13056], "mapped", [12450, 12497, 12540, 12488]], [[13057, 13057], "mapped", [12450, 12523, 12501, 12449]], [[13058, 13058], "mapped", [12450, 12531, 12506, 12450]], [[13059, 13059], "mapped", [12450, 12540, 12523]], [[13060, 13060], "mapped", [12452, 12491, 12531, 12464]], [[13061, 13061], "mapped", [12452, 12531, 12481]], [[13062, 13062], "mapped", [12454, 12457, 12531]], [[13063, 13063], "mapped", [12456, 12473, 12463, 12540, 12489]], [[13064, 13064], "mapped", [12456, 12540, 12459, 12540]], [[13065, 13065], "mapped", [12458, 12531, 12473]], [[13066, 13066], "mapped", [12458, 12540, 12512]], [[13067, 13067], "mapped", [12459, 12452, 12522]], [[13068, 13068], "mapped", [12459, 12521, 12483, 12488]], [[13069, 13069], "mapped", [12459, 12525, 12522, 12540]], [[13070, 13070], "mapped", [12460, 12525, 12531]], [[13071, 13071], "mapped", [12460, 12531, 12510]], [[13072, 13072], "mapped", [12462, 12460]], [[13073, 13073], "mapped", [12462, 12491, 12540]], [[13074, 13074], "mapped", [12461, 12517, 12522, 12540]], [[13075, 13075], "mapped", [12462, 12523, 12480, 12540]], [[13076, 13076], "mapped", [12461, 12525]], [[13077, 13077], "mapped", [12461, 12525, 12464, 12521, 12512]], [[13078, 13078], "mapped", [12461, 12525, 12513, 12540, 12488, 12523]], [[13079, 13079], "mapped", [12461, 12525, 12527, 12483, 12488]], [[13080, 13080], "mapped", [12464, 12521, 12512]], [[13081, 13081], "mapped", [12464, 12521, 12512, 12488, 12531]], [[13082, 13082], "mapped", [12463, 12523, 12476, 12452, 12525]], [[13083, 13083], "mapped", [12463, 12525, 12540, 12493]], [[13084, 13084], "mapped", [12465, 12540, 12473]], [[13085, 13085], "mapped", [12467, 12523, 12490]], [[13086, 13086], "mapped", [12467, 12540, 12509]], [[13087, 13087], "mapped", [12469, 12452, 12463, 12523]], [[13088, 13088], "mapped", [12469, 12531, 12481, 12540, 12512]], [[13089, 13089], "mapped", [12471, 12522, 12531, 12464]], [[13090, 13090], "mapped", [12475, 12531, 12481]], [[13091, 13091], "mapped", [12475, 12531, 12488]], [[13092, 13092], "mapped", [12480, 12540, 12473]], [[13093, 13093], "mapped", [12487, 12471]], [[13094, 13094], "mapped", [12489, 12523]], [[13095, 13095], "mapped", [12488, 12531]], [[13096, 13096], "mapped", [12490, 12494]], [[13097, 13097], "mapped", [12494, 12483, 12488]], [[13098, 13098], "mapped", [12495, 12452, 12484]], [[13099, 13099], "mapped", [12497, 12540, 12475, 12531, 12488]], [[13100, 13100], "mapped", [12497, 12540, 12484]], [[13101, 13101], "mapped", [12496, 12540, 12524, 12523]], [[13102, 13102], "mapped", [12500, 12450, 12473, 12488, 12523]], [[13103, 13103], "mapped", [12500, 12463, 12523]], [[13104, 13104], "mapped", [12500, 12467]], [[13105, 13105], "mapped", [12499, 12523]], [[13106, 13106], "mapped", [12501, 12449, 12521, 12483, 12489]], [[13107, 13107], "mapped", [12501, 12451, 12540, 12488]], [[13108, 13108], "mapped", [12502, 12483, 12471, 12455, 12523]], [[13109, 13109], "mapped", [12501, 12521, 12531]], [[13110, 13110], "mapped", [12504, 12463, 12479, 12540, 12523]], [[13111, 13111], "mapped", [12506, 12477]], [[13112, 13112], "mapped", [12506, 12491, 12498]], [[13113, 13113], "mapped", [12504, 12523, 12484]], [[13114, 13114], "mapped", [12506, 12531, 12473]], [[13115, 13115], "mapped", [12506, 12540, 12472]], [[13116, 13116], "mapped", [12505, 12540, 12479]], [[13117, 13117], "mapped", [12509, 12452, 12531, 12488]], [[13118, 13118], "mapped", [12508, 12523, 12488]], [[13119, 13119], "mapped", [12507, 12531]], [[13120, 13120], "mapped", [12509, 12531, 12489]], [[13121, 13121], "mapped", [12507, 12540, 12523]], [[13122, 13122], "mapped", [12507, 12540, 12531]], [[13123, 13123], "mapped", [12510, 12452, 12463, 12525]], [[13124, 13124], "mapped", [12510, 12452, 12523]], [[13125, 13125], "mapped", [12510, 12483, 12495]], [[13126, 13126], "mapped", [12510, 12523, 12463]], [[13127, 13127], "mapped", [12510, 12531, 12471, 12519, 12531]], [[13128, 13128], "mapped", [12511, 12463, 12525, 12531]], [[13129, 13129], "mapped", [12511, 12522]], [[13130, 13130], "mapped", [12511, 12522, 12496, 12540, 12523]], [[13131, 13131], "mapped", [12513, 12460]], [[13132, 13132], "mapped", [12513, 12460, 12488, 12531]], [[13133, 13133], "mapped", [12513, 12540, 12488, 12523]], [[13134, 13134], "mapped", [12516, 12540, 12489]], [[13135, 13135], "mapped", [12516, 12540, 12523]], [[13136, 13136], "mapped", [12518, 12450, 12531]], [[13137, 13137], "mapped", [12522, 12483, 12488, 12523]], [[13138, 13138], "mapped", [12522, 12521]], [[13139, 13139], "mapped", [12523, 12500, 12540]], [[13140, 13140], "mapped", [12523, 12540, 12502, 12523]], [[13141, 13141], "mapped", [12524, 12512]], [[13142, 13142], "mapped", [12524, 12531, 12488, 12466, 12531]], [[13143, 13143], "mapped", [12527, 12483, 12488]], [[13144, 13144], "mapped", [48, 28857]], [[13145, 13145], "mapped", [49, 28857]], [[13146, 13146], "mapped", [50, 28857]], [[13147, 13147], "mapped", [51, 28857]], [[13148, 13148], "mapped", [52, 28857]], [[13149, 13149], "mapped", [53, 28857]], [[13150, 13150], "mapped", [54, 28857]], [[13151, 13151], "mapped", [55, 28857]], [[13152, 13152], "mapped", [56, 28857]], [[13153, 13153], "mapped", [57, 28857]], [[13154, 13154], "mapped", [49, 48, 28857]], [[13155, 13155], "mapped", [49, 49, 28857]], [[13156, 13156], "mapped", [49, 50, 28857]], [[13157, 13157], "mapped", [49, 51, 28857]], [[13158, 13158], "mapped", [49, 52, 28857]], [[13159, 13159], "mapped", [49, 53, 28857]], [[13160, 13160], "mapped", [49, 54, 28857]], [[13161, 13161], "mapped", [49, 55, 28857]], [[13162, 13162], "mapped", [49, 56, 28857]], [[13163, 13163], "mapped", [49, 57, 28857]], [[13164, 13164], "mapped", [50, 48, 28857]], [[13165, 13165], "mapped", [50, 49, 28857]], [[13166, 13166], "mapped", [50, 50, 28857]], [[13167, 13167], "mapped", [50, 51, 28857]], [[13168, 13168], "mapped", [50, 52, 28857]], [[13169, 13169], "mapped", [104, 112, 97]], [[13170, 13170], "mapped", [100, 97]], [[13171, 13171], "mapped", [97, 117]], [[13172, 13172], "mapped", [98, 97, 114]], [[13173, 13173], "mapped", [111, 118]], [[13174, 13174], "mapped", [112, 99]], [[13175, 13175], "mapped", [100, 109]], [[13176, 13176], "mapped", [100, 109, 50]], [[13177, 13177], "mapped", [100, 109, 51]], [[13178, 13178], "mapped", [105, 117]], [[13179, 13179], "mapped", [24179, 25104]], [[13180, 13180], "mapped", [26157, 21644]], [[13181, 13181], "mapped", [22823, 27491]], [[13182, 13182], "mapped", [26126, 27835]], [[13183, 13183], "mapped", [26666, 24335, 20250, 31038]], [[13184, 13184], "mapped", [112, 97]], [[13185, 13185], "mapped", [110, 97]], [[13186, 13186], "mapped", [956, 97]], [[13187, 13187], "mapped", [109, 97]], [[13188, 13188], "mapped", [107, 97]], [[13189, 13189], "mapped", [107, 98]], [[13190, 13190], "mapped", [109, 98]], [[13191, 13191], "mapped", [103, 98]], [[13192, 13192], "mapped", [99, 97, 108]], [[13193, 13193], "mapped", [107, 99, 97, 108]], [[13194, 13194], "mapped", [112, 102]], [[13195, 13195], "mapped", [110, 102]], [[13196, 13196], "mapped", [956, 102]], [[13197, 13197], "mapped", [956, 103]], [[13198, 13198], "mapped", [109, 103]], [[13199, 13199], "mapped", [107, 103]], [[13200, 13200], "mapped", [104, 122]], [[13201, 13201], "mapped", [107, 104, 122]], [[13202, 13202], "mapped", [109, 104, 122]], [[13203, 13203], "mapped", [103, 104, 122]], [[13204, 13204], "mapped", [116, 104, 122]], [[13205, 13205], "mapped", [956, 108]], [[13206, 13206], "mapped", [109, 108]], [[13207, 13207], "mapped", [100, 108]], [[13208, 13208], "mapped", [107, 108]], [[13209, 13209], "mapped", [102, 109]], [[13210, 13210], "mapped", [110, 109]], [[13211, 13211], "mapped", [956, 109]], [[13212, 13212], "mapped", [109, 109]], [[13213, 13213], "mapped", [99, 109]], [[13214, 13214], "mapped", [107, 109]], [[13215, 13215], "mapped", [109, 109, 50]], [[13216, 13216], "mapped", [99, 109, 50]], [[13217, 13217], "mapped", [109, 50]], [[13218, 13218], "mapped", [107, 109, 50]], [[13219, 13219], "mapped", [109, 109, 51]], [[13220, 13220], "mapped", [99, 109, 51]], [[13221, 13221], "mapped", [109, 51]], [[13222, 13222], "mapped", [107, 109, 51]], [[13223, 13223], "mapped", [109, 8725, 115]], [[13224, 13224], "mapped", [109, 8725, 115, 50]], [[13225, 13225], "mapped", [112, 97]], [[13226, 13226], "mapped", [107, 112, 97]], [[13227, 13227], "mapped", [109, 112, 97]], [[13228, 13228], "mapped", [103, 112, 97]], [[13229, 13229], "mapped", [114, 97, 100]], [[13230, 13230], "mapped", [114, 97, 100, 8725, 115]], [[13231, 13231], "mapped", [114, 97, 100, 8725, 115, 50]], [[13232, 13232], "mapped", [112, 115]], [[13233, 13233], "mapped", [110, 115]], [[13234, 13234], "mapped", [956, 115]], [[13235, 13235], "mapped", [109, 115]], [[13236, 13236], "mapped", [112, 118]], [[13237, 13237], "mapped", [110, 118]], [[13238, 13238], "mapped", [956, 118]], [[13239, 13239], "mapped", [109, 118]], [[13240, 13240], "mapped", [107, 118]], [[13241, 13241], "mapped", [109, 118]], [[13242, 13242], "mapped", [112, 119]], [[13243, 13243], "mapped", [110, 119]], [[13244, 13244], "mapped", [956, 119]], [[13245, 13245], "mapped", [109, 119]], [[13246, 13246], "mapped", [107, 119]], [[13247, 13247], "mapped", [109, 119]], [[13248, 13248], "mapped", [107, 969]], [[13249, 13249], "mapped", [109, 969]], [[13250, 13250], "disallowed"], [[13251, 13251], "mapped", [98, 113]], [[13252, 13252], "mapped", [99, 99]], [[13253, 13253], "mapped", [99, 100]], [[13254, 13254], "mapped", [99, 8725, 107, 103]], [[13255, 13255], "disallowed"], [[13256, 13256], "mapped", [100, 98]], [[13257, 13257], "mapped", [103, 121]], [[13258, 13258], "mapped", [104, 97]], [[13259, 13259], "mapped", [104, 112]], [[13260, 13260], "mapped", [105, 110]], [[13261, 13261], "mapped", [107, 107]], [[13262, 13262], "mapped", [107, 109]], [[13263, 13263], "mapped", [107, 116]], [[13264, 13264], "mapped", [108, 109]], [[13265, 13265], "mapped", [108, 110]], [[13266, 13266], "mapped", [108, 111, 103]], [[13267, 13267], "mapped", [108, 120]], [[13268, 13268], "mapped", [109, 98]], [[13269, 13269], "mapped", [109, 105, 108]], [[13270, 13270], "mapped", [109, 111, 108]], [[13271, 13271], "mapped", [112, 104]], [[13272, 13272], "disallowed"], [[13273, 13273], "mapped", [112, 112, 109]], [[13274, 13274], "mapped", [112, 114]], [[13275, 13275], "mapped", [115, 114]], [[13276, 13276], "mapped", [115, 118]], [[13277, 13277], "mapped", [119, 98]], [[13278, 13278], "mapped", [118, 8725, 109]], [[13279, 13279], "mapped", [97, 8725, 109]], [[13280, 13280], "mapped", [49, 26085]], [[13281, 13281], "mapped", [50, 26085]], [[13282, 13282], "mapped", [51, 26085]], [[13283, 13283], "mapped", [52, 26085]], [[13284, 13284], "mapped", [53, 26085]], [[13285, 13285], "mapped", [54, 26085]], [[13286, 13286], "mapped", [55, 26085]], [[13287, 13287], "mapped", [56, 26085]], [[13288, 13288], "mapped", [57, 26085]], [[13289, 13289], "mapped", [49, 48, 26085]], [[13290, 13290], "mapped", [49, 49, 26085]], [[13291, 13291], "mapped", [49, 50, 26085]], [[13292, 13292], "mapped", [49, 51, 26085]], [[13293, 13293], "mapped", [49, 52, 26085]], [[13294, 13294], "mapped", [49, 53, 26085]], [[13295, 13295], "mapped", [49, 54, 26085]], [[13296, 13296], "mapped", [49, 55, 26085]], [[13297, 13297], "mapped", [49, 56, 26085]], [[13298, 13298], "mapped", [49, 57, 26085]], [[13299, 13299], "mapped", [50, 48, 26085]], [[13300, 13300], "mapped", [50, 49, 26085]], [[13301, 13301], "mapped", [50, 50, 26085]], [[13302, 13302], "mapped", [50, 51, 26085]], [[13303, 13303], "mapped", [50, 52, 26085]], [[13304, 13304], "mapped", [50, 53, 26085]], [[13305, 13305], "mapped", [50, 54, 26085]], [[13306, 13306], "mapped", [50, 55, 26085]], [[13307, 13307], "mapped", [50, 56, 26085]], [[13308, 13308], "mapped", [50, 57, 26085]], [[13309, 13309], "mapped", [51, 48, 26085]], [[13310, 13310], "mapped", [51, 49, 26085]], [[13311, 13311], "mapped", [103, 97, 108]], [[13312, 19893], "valid"], [[19894, 19903], "disallowed"], [[19904, 19967], "valid", [], "NV8"], [[19968, 40869], "valid"], [[40870, 40891], "valid"], [[40892, 40899], "valid"], [[40900, 40907], "valid"], [[40908, 40908], "valid"], [[40909, 40917], "valid"], [[40918, 40959], "disallowed"], [[40960, 42124], "valid"], [[42125, 42127], "disallowed"], [[42128, 42145], "valid", [], "NV8"], [[42146, 42147], "valid", [], "NV8"], [[42148, 42163], "valid", [], "NV8"], [[42164, 42164], "valid", [], "NV8"], [[42165, 42176], "valid", [], "NV8"], [[42177, 42177], "valid", [], "NV8"], [[42178, 42180], "valid", [], "NV8"], [[42181, 42181], "valid", [], "NV8"], [[42182, 42182], "valid", [], "NV8"], [[42183, 42191], "disallowed"], [[42192, 42237], "valid"], [[42238, 42239], "valid", [], "NV8"], [[42240, 42508], "valid"], [[42509, 42511], "valid", [], "NV8"], [[42512, 42539], "valid"], [[42540, 42559], "disallowed"], [[42560, 42560], "mapped", [42561]], [[42561, 42561], "valid"], [[42562, 42562], "mapped", [42563]], [[42563, 42563], "valid"], [[42564, 42564], "mapped", [42565]], [[42565, 42565], "valid"], [[42566, 42566], "mapped", [42567]], [[42567, 42567], "valid"], [[42568, 42568], "mapped", [42569]], [[42569, 42569], "valid"], [[42570, 42570], "mapped", [42571]], [[42571, 42571], "valid"], [[42572, 42572], "mapped", [42573]], [[42573, 42573], "valid"], [[42574, 42574], "mapped", [42575]], [[42575, 42575], "valid"], [[42576, 42576], "mapped", [42577]], [[42577, 42577], "valid"], [[42578, 42578], "mapped", [42579]], [[42579, 42579], "valid"], [[42580, 42580], "mapped", [42581]], [[42581, 42581], "valid"], [[42582, 42582], "mapped", [42583]], [[42583, 42583], "valid"], [[42584, 42584], "mapped", [42585]], [[42585, 42585], "valid"], [[42586, 42586], "mapped", [42587]], [[42587, 42587], "valid"], [[42588, 42588], "mapped", [42589]], [[42589, 42589], "valid"], [[42590, 42590], "mapped", [42591]], [[42591, 42591], "valid"], [[42592, 42592], "mapped", [42593]], [[42593, 42593], "valid"], [[42594, 42594], "mapped", [42595]], [[42595, 42595], "valid"], [[42596, 42596], "mapped", [42597]], [[42597, 42597], "valid"], [[42598, 42598], "mapped", [42599]], [[42599, 42599], "valid"], [[42600, 42600], "mapped", [42601]], [[42601, 42601], "valid"], [[42602, 42602], "mapped", [42603]], [[42603, 42603], "valid"], [[42604, 42604], "mapped", [42605]], [[42605, 42607], "valid"], [[42608, 42611], "valid", [], "NV8"], [[42612, 42619], "valid"], [[42620, 42621], "valid"], [[42622, 42622], "valid", [], "NV8"], [[42623, 42623], "valid"], [[42624, 42624], "mapped", [42625]], [[42625, 42625], "valid"], [[42626, 42626], "mapped", [42627]], [[42627, 42627], "valid"], [[42628, 42628], "mapped", [42629]], [[42629, 42629], "valid"], [[42630, 42630], "mapped", [42631]], [[42631, 42631], "valid"], [[42632, 42632], "mapped", [42633]], [[42633, 42633], "valid"], [[42634, 42634], "mapped", [42635]], [[42635, 42635], "valid"], [[42636, 42636], "mapped", [42637]], [[42637, 42637], "valid"], [[42638, 42638], "mapped", [42639]], [[42639, 42639], "valid"], [[42640, 42640], "mapped", [42641]], [[42641, 42641], "valid"], [[42642, 42642], "mapped", [42643]], [[42643, 42643], "valid"], [[42644, 42644], "mapped", [42645]], [[42645, 42645], "valid"], [[42646, 42646], "mapped", [42647]], [[42647, 42647], "valid"], [[42648, 42648], "mapped", [42649]], [[42649, 42649], "valid"], [[42650, 42650], "mapped", [42651]], [[42651, 42651], "valid"], [[42652, 42652], "mapped", [1098]], [[42653, 42653], "mapped", [1100]], [[42654, 42654], "valid"], [[42655, 42655], "valid"], [[42656, 42725], "valid"], [[42726, 42735], "valid", [], "NV8"], [[42736, 42737], "valid"], [[42738, 42743], "valid", [], "NV8"], [[42744, 42751], "disallowed"], [[42752, 42774], "valid", [], "NV8"], [[42775, 42778], "valid"], [[42779, 42783], "valid"], [[42784, 42785], "valid", [], "NV8"], [[42786, 42786], "mapped", [42787]], [[42787, 42787], "valid"], [[42788, 42788], "mapped", [42789]], [[42789, 42789], "valid"], [[42790, 42790], "mapped", [42791]], [[42791, 42791], "valid"], [[42792, 42792], "mapped", [42793]], [[42793, 42793], "valid"], [[42794, 42794], "mapped", [42795]], [[42795, 42795], "valid"], [[42796, 42796], "mapped", [42797]], [[42797, 42797], "valid"], [[42798, 42798], "mapped", [42799]], [[42799, 42801], "valid"], [[42802, 42802], "mapped", [42803]], [[42803, 42803], "valid"], [[42804, 42804], "mapped", [42805]], [[42805, 42805], "valid"], [[42806, 42806], "mapped", [42807]], [[42807, 42807], "valid"], [[42808, 42808], "mapped", [42809]], [[42809, 42809], "valid"], [[42810, 42810], "mapped", [42811]], [[42811, 42811], "valid"], [[42812, 42812], "mapped", [42813]], [[42813, 42813], "valid"], [[42814, 42814], "mapped", [42815]], [[42815, 42815], "valid"], [[42816, 42816], "mapped", [42817]], [[42817, 42817], "valid"], [[42818, 42818], "mapped", [42819]], [[42819, 42819], "valid"], [[42820, 42820], "mapped", [42821]], [[42821, 42821], "valid"], [[42822, 42822], "mapped", [42823]], [[42823, 42823], "valid"], [[42824, 42824], "mapped", [42825]], [[42825, 42825], "valid"], [[42826, 42826], "mapped", [42827]], [[42827, 42827], "valid"], [[42828, 42828], "mapped", [42829]], [[42829, 42829], "valid"], [[42830, 42830], "mapped", [42831]], [[42831, 42831], "valid"], [[42832, 42832], "mapped", [42833]], [[42833, 42833], "valid"], [[42834, 42834], "mapped", [42835]], [[42835, 42835], "valid"], [[42836, 42836], "mapped", [42837]], [[42837, 42837], "valid"], [[42838, 42838], "mapped", [42839]], [[42839, 42839], "valid"], [[42840, 42840], "mapped", [42841]], [[42841, 42841], "valid"], [[42842, 42842], "mapped", [42843]], [[42843, 42843], "valid"], [[42844, 42844], "mapped", [42845]], [[42845, 42845], "valid"], [[42846, 42846], "mapped", [42847]], [[42847, 42847], "valid"], [[42848, 42848], "mapped", [42849]], [[42849, 42849], "valid"], [[42850, 42850], "mapped", [42851]], [[42851, 42851], "valid"], [[42852, 42852], "mapped", [42853]], [[42853, 42853], "valid"], [[42854, 42854], "mapped", [42855]], [[42855, 42855], "valid"], [[42856, 42856], "mapped", [42857]], [[42857, 42857], "valid"], [[42858, 42858], "mapped", [42859]], [[42859, 42859], "valid"], [[42860, 42860], "mapped", [42861]], [[42861, 42861], "valid"], [[42862, 42862], "mapped", [42863]], [[42863, 42863], "valid"], [[42864, 42864], "mapped", [42863]], [[42865, 42872], "valid"], [[42873, 42873], "mapped", [42874]], [[42874, 42874], "valid"], [[42875, 42875], "mapped", [42876]], [[42876, 42876], "valid"], [[42877, 42877], "mapped", [7545]], [[42878, 42878], "mapped", [42879]], [[42879, 42879], "valid"], [[42880, 42880], "mapped", [42881]], [[42881, 42881], "valid"], [[42882, 42882], "mapped", [42883]], [[42883, 42883], "valid"], [[42884, 42884], "mapped", [42885]], [[42885, 42885], "valid"], [[42886, 42886], "mapped", [42887]], [[42887, 42888], "valid"], [[42889, 42890], "valid", [], "NV8"], [[42891, 42891], "mapped", [42892]], [[42892, 42892], "valid"], [[42893, 42893], "mapped", [613]], [[42894, 42894], "valid"], [[42895, 42895], "valid"], [[42896, 42896], "mapped", [42897]], [[42897, 42897], "valid"], [[42898, 42898], "mapped", [42899]], [[42899, 42899], "valid"], [[42900, 42901], "valid"], [[42902, 42902], "mapped", [42903]], [[42903, 42903], "valid"], [[42904, 42904], "mapped", [42905]], [[42905, 42905], "valid"], [[42906, 42906], "mapped", [42907]], [[42907, 42907], "valid"], [[42908, 42908], "mapped", [42909]], [[42909, 42909], "valid"], [[42910, 42910], "mapped", [42911]], [[42911, 42911], "valid"], [[42912, 42912], "mapped", [42913]], [[42913, 42913], "valid"], [[42914, 42914], "mapped", [42915]], [[42915, 42915], "valid"], [[42916, 42916], "mapped", [42917]], [[42917, 42917], "valid"], [[42918, 42918], "mapped", [42919]], [[42919, 42919], "valid"], [[42920, 42920], "mapped", [42921]], [[42921, 42921], "valid"], [[42922, 42922], "mapped", [614]], [[42923, 42923], "mapped", [604]], [[42924, 42924], "mapped", [609]], [[42925, 42925], "mapped", [620]], [[42926, 42927], "disallowed"], [[42928, 42928], "mapped", [670]], [[42929, 42929], "mapped", [647]], [[42930, 42930], "mapped", [669]], [[42931, 42931], "mapped", [43859]], [[42932, 42932], "mapped", [42933]], [[42933, 42933], "valid"], [[42934, 42934], "mapped", [42935]], [[42935, 42935], "valid"], [[42936, 42998], "disallowed"], [[42999, 42999], "valid"], [[43e3, 43e3], "mapped", [295]], [[43001, 43001], "mapped", [339]], [[43002, 43002], "valid"], [[43003, 43007], "valid"], [[43008, 43047], "valid"], [[43048, 43051], "valid", [], "NV8"], [[43052, 43055], "disallowed"], [[43056, 43065], "valid", [], "NV8"], [[43066, 43071], "disallowed"], [[43072, 43123], "valid"], [[43124, 43127], "valid", [], "NV8"], [[43128, 43135], "disallowed"], [[43136, 43204], "valid"], [[43205, 43213], "disallowed"], [[43214, 43215], "valid", [], "NV8"], [[43216, 43225], "valid"], [[43226, 43231], "disallowed"], [[43232, 43255], "valid"], [[43256, 43258], "valid", [], "NV8"], [[43259, 43259], "valid"], [[43260, 43260], "valid", [], "NV8"], [[43261, 43261], "valid"], [[43262, 43263], "disallowed"], [[43264, 43309], "valid"], [[43310, 43311], "valid", [], "NV8"], [[43312, 43347], "valid"], [[43348, 43358], "disallowed"], [[43359, 43359], "valid", [], "NV8"], [[43360, 43388], "valid", [], "NV8"], [[43389, 43391], "disallowed"], [[43392, 43456], "valid"], [[43457, 43469], "valid", [], "NV8"], [[43470, 43470], "disallowed"], [[43471, 43481], "valid"], [[43482, 43485], "disallowed"], [[43486, 43487], "valid", [], "NV8"], [[43488, 43518], "valid"], [[43519, 43519], "disallowed"], [[43520, 43574], "valid"], [[43575, 43583], "disallowed"], [[43584, 43597], "valid"], [[43598, 43599], "disallowed"], [[43600, 43609], "valid"], [[43610, 43611], "disallowed"], [[43612, 43615], "valid", [], "NV8"], [[43616, 43638], "valid"], [[43639, 43641], "valid", [], "NV8"], [[43642, 43643], "valid"], [[43644, 43647], "valid"], [[43648, 43714], "valid"], [[43715, 43738], "disallowed"], [[43739, 43741], "valid"], [[43742, 43743], "valid", [], "NV8"], [[43744, 43759], "valid"], [[43760, 43761], "valid", [], "NV8"], [[43762, 43766], "valid"], [[43767, 43776], "disallowed"], [[43777, 43782], "valid"], [[43783, 43784], "disallowed"], [[43785, 43790], "valid"], [[43791, 43792], "disallowed"], [[43793, 43798], "valid"], [[43799, 43807], "disallowed"], [[43808, 43814], "valid"], [[43815, 43815], "disallowed"], [[43816, 43822], "valid"], [[43823, 43823], "disallowed"], [[43824, 43866], "valid"], [[43867, 43867], "valid", [], "NV8"], [[43868, 43868], "mapped", [42791]], [[43869, 43869], "mapped", [43831]], [[43870, 43870], "mapped", [619]], [[43871, 43871], "mapped", [43858]], [[43872, 43875], "valid"], [[43876, 43877], "valid"], [[43878, 43887], "disallowed"], [[43888, 43888], "mapped", [5024]], [[43889, 43889], "mapped", [5025]], [[43890, 43890], "mapped", [5026]], [[43891, 43891], "mapped", [5027]], [[43892, 43892], "mapped", [5028]], [[43893, 43893], "mapped", [5029]], [[43894, 43894], "mapped", [5030]], [[43895, 43895], "mapped", [5031]], [[43896, 43896], "mapped", [5032]], [[43897, 43897], "mapped", [5033]], [[43898, 43898], "mapped", [5034]], [[43899, 43899], "mapped", [5035]], [[43900, 43900], "mapped", [5036]], [[43901, 43901], "mapped", [5037]], [[43902, 43902], "mapped", [5038]], [[43903, 43903], "mapped", [5039]], [[43904, 43904], "mapped", [5040]], [[43905, 43905], "mapped", [5041]], [[43906, 43906], "mapped", [5042]], [[43907, 43907], "mapped", [5043]], [[43908, 43908], "mapped", [5044]], [[43909, 43909], "mapped", [5045]], [[43910, 43910], "mapped", [5046]], [[43911, 43911], "mapped", [5047]], [[43912, 43912], "mapped", [5048]], [[43913, 43913], "mapped", [5049]], [[43914, 43914], "mapped", [5050]], [[43915, 43915], "mapped", [5051]], [[43916, 43916], "mapped", [5052]], [[43917, 43917], "mapped", [5053]], [[43918, 43918], "mapped", [5054]], [[43919, 43919], "mapped", [5055]], [[43920, 43920], "mapped", [5056]], [[43921, 43921], "mapped", [5057]], [[43922, 43922], "mapped", [5058]], [[43923, 43923], "mapped", [5059]], [[43924, 43924], "mapped", [5060]], [[43925, 43925], "mapped", [5061]], [[43926, 43926], "mapped", [5062]], [[43927, 43927], "mapped", [5063]], [[43928, 43928], "mapped", [5064]], [[43929, 43929], "mapped", [5065]], [[43930, 43930], "mapped", [5066]], [[43931, 43931], "mapped", [5067]], [[43932, 43932], "mapped", [5068]], [[43933, 43933], "mapped", [5069]], [[43934, 43934], "mapped", [5070]], [[43935, 43935], "mapped", [5071]], [[43936, 43936], "mapped", [5072]], [[43937, 43937], "mapped", [5073]], [[43938, 43938], "mapped", [5074]], [[43939, 43939], "mapped", [5075]], [[43940, 43940], "mapped", [5076]], [[43941, 43941], "mapped", [5077]], [[43942, 43942], "mapped", [5078]], [[43943, 43943], "mapped", [5079]], [[43944, 43944], "mapped", [5080]], [[43945, 43945], "mapped", [5081]], [[43946, 43946], "mapped", [5082]], [[43947, 43947], "mapped", [5083]], [[43948, 43948], "mapped", [5084]], [[43949, 43949], "mapped", [5085]], [[43950, 43950], "mapped", [5086]], [[43951, 43951], "mapped", [5087]], [[43952, 43952], "mapped", [5088]], [[43953, 43953], "mapped", [5089]], [[43954, 43954], "mapped", [5090]], [[43955, 43955], "mapped", [5091]], [[43956, 43956], "mapped", [5092]], [[43957, 43957], "mapped", [5093]], [[43958, 43958], "mapped", [5094]], [[43959, 43959], "mapped", [5095]], [[43960, 43960], "mapped", [5096]], [[43961, 43961], "mapped", [5097]], [[43962, 43962], "mapped", [5098]], [[43963, 43963], "mapped", [5099]], [[43964, 43964], "mapped", [5100]], [[43965, 43965], "mapped", [5101]], [[43966, 43966], "mapped", [5102]], [[43967, 43967], "mapped", [5103]], [[43968, 44010], "valid"], [[44011, 44011], "valid", [], "NV8"], [[44012, 44013], "valid"], [[44014, 44015], "disallowed"], [[44016, 44025], "valid"], [[44026, 44031], "disallowed"], [[44032, 55203], "valid"], [[55204, 55215], "disallowed"], [[55216, 55238], "valid", [], "NV8"], [[55239, 55242], "disallowed"], [[55243, 55291], "valid", [], "NV8"], [[55292, 55295], "disallowed"], [[55296, 57343], "disallowed"], [[57344, 63743], "disallowed"], [[63744, 63744], "mapped", [35912]], [[63745, 63745], "mapped", [26356]], [[63746, 63746], "mapped", [36554]], [[63747, 63747], "mapped", [36040]], [[63748, 63748], "mapped", [28369]], [[63749, 63749], "mapped", [20018]], [[63750, 63750], "mapped", [21477]], [[63751, 63752], "mapped", [40860]], [[63753, 63753], "mapped", [22865]], [[63754, 63754], "mapped", [37329]], [[63755, 63755], "mapped", [21895]], [[63756, 63756], "mapped", [22856]], [[63757, 63757], "mapped", [25078]], [[63758, 63758], "mapped", [30313]], [[63759, 63759], "mapped", [32645]], [[63760, 63760], "mapped", [34367]], [[63761, 63761], "mapped", [34746]], [[63762, 63762], "mapped", [35064]], [[63763, 63763], "mapped", [37007]], [[63764, 63764], "mapped", [27138]], [[63765, 63765], "mapped", [27931]], [[63766, 63766], "mapped", [28889]], [[63767, 63767], "mapped", [29662]], [[63768, 63768], "mapped", [33853]], [[63769, 63769], "mapped", [37226]], [[63770, 63770], "mapped", [39409]], [[63771, 63771], "mapped", [20098]], [[63772, 63772], "mapped", [21365]], [[63773, 63773], "mapped", [27396]], [[63774, 63774], "mapped", [29211]], [[63775, 63775], "mapped", [34349]], [[63776, 63776], "mapped", [40478]], [[63777, 63777], "mapped", [23888]], [[63778, 63778], "mapped", [28651]], [[63779, 63779], "mapped", [34253]], [[63780, 63780], "mapped", [35172]], [[63781, 63781], "mapped", [25289]], [[63782, 63782], "mapped", [33240]], [[63783, 63783], "mapped", [34847]], [[63784, 63784], "mapped", [24266]], [[63785, 63785], "mapped", [26391]], [[63786, 63786], "mapped", [28010]], [[63787, 63787], "mapped", [29436]], [[63788, 63788], "mapped", [37070]], [[63789, 63789], "mapped", [20358]], [[63790, 63790], "mapped", [20919]], [[63791, 63791], "mapped", [21214]], [[63792, 63792], "mapped", [25796]], [[63793, 63793], "mapped", [27347]], [[63794, 63794], "mapped", [29200]], [[63795, 63795], "mapped", [30439]], [[63796, 63796], "mapped", [32769]], [[63797, 63797], "mapped", [34310]], [[63798, 63798], "mapped", [34396]], [[63799, 63799], "mapped", [36335]], [[63800, 63800], "mapped", [38706]], [[63801, 63801], "mapped", [39791]], [[63802, 63802], "mapped", [40442]], [[63803, 63803], "mapped", [30860]], [[63804, 63804], "mapped", [31103]], [[63805, 63805], "mapped", [32160]], [[63806, 63806], "mapped", [33737]], [[63807, 63807], "mapped", [37636]], [[63808, 63808], "mapped", [40575]], [[63809, 63809], "mapped", [35542]], [[63810, 63810], "mapped", [22751]], [[63811, 63811], "mapped", [24324]], [[63812, 63812], "mapped", [31840]], [[63813, 63813], "mapped", [32894]], [[63814, 63814], "mapped", [29282]], [[63815, 63815], "mapped", [30922]], [[63816, 63816], "mapped", [36034]], [[63817, 63817], "mapped", [38647]], [[63818, 63818], "mapped", [22744]], [[63819, 63819], "mapped", [23650]], [[63820, 63820], "mapped", [27155]], [[63821, 63821], "mapped", [28122]], [[63822, 63822], "mapped", [28431]], [[63823, 63823], "mapped", [32047]], [[63824, 63824], "mapped", [32311]], [[63825, 63825], "mapped", [38475]], [[63826, 63826], "mapped", [21202]], [[63827, 63827], "mapped", [32907]], [[63828, 63828], "mapped", [20956]], [[63829, 63829], "mapped", [20940]], [[63830, 63830], "mapped", [31260]], [[63831, 63831], "mapped", [32190]], [[63832, 63832], "mapped", [33777]], [[63833, 63833], "mapped", [38517]], [[63834, 63834], "mapped", [35712]], [[63835, 63835], "mapped", [25295]], [[63836, 63836], "mapped", [27138]], [[63837, 63837], "mapped", [35582]], [[63838, 63838], "mapped", [20025]], [[63839, 63839], "mapped", [23527]], [[63840, 63840], "mapped", [24594]], [[63841, 63841], "mapped", [29575]], [[63842, 63842], "mapped", [30064]], [[63843, 63843], "mapped", [21271]], [[63844, 63844], "mapped", [30971]], [[63845, 63845], "mapped", [20415]], [[63846, 63846], "mapped", [24489]], [[63847, 63847], "mapped", [19981]], [[63848, 63848], "mapped", [27852]], [[63849, 63849], "mapped", [25976]], [[63850, 63850], "mapped", [32034]], [[63851, 63851], "mapped", [21443]], [[63852, 63852], "mapped", [22622]], [[63853, 63853], "mapped", [30465]], [[63854, 63854], "mapped", [33865]], [[63855, 63855], "mapped", [35498]], [[63856, 63856], "mapped", [27578]], [[63857, 63857], "mapped", [36784]], [[63858, 63858], "mapped", [27784]], [[63859, 63859], "mapped", [25342]], [[63860, 63860], "mapped", [33509]], [[63861, 63861], "mapped", [25504]], [[63862, 63862], "mapped", [30053]], [[63863, 63863], "mapped", [20142]], [[63864, 63864], "mapped", [20841]], [[63865, 63865], "mapped", [20937]], [[63866, 63866], "mapped", [26753]], [[63867, 63867], "mapped", [31975]], [[63868, 63868], "mapped", [33391]], [[63869, 63869], "mapped", [35538]], [[63870, 63870], "mapped", [37327]], [[63871, 63871], "mapped", [21237]], [[63872, 63872], "mapped", [21570]], [[63873, 63873], "mapped", [22899]], [[63874, 63874], "mapped", [24300]], [[63875, 63875], "mapped", [26053]], [[63876, 63876], "mapped", [28670]], [[63877, 63877], "mapped", [31018]], [[63878, 63878], "mapped", [38317]], [[63879, 63879], "mapped", [39530]], [[63880, 63880], "mapped", [40599]], [[63881, 63881], "mapped", [40654]], [[63882, 63882], "mapped", [21147]], [[63883, 63883], "mapped", [26310]], [[63884, 63884], "mapped", [27511]], [[63885, 63885], "mapped", [36706]], [[63886, 63886], "mapped", [24180]], [[63887, 63887], "mapped", [24976]], [[63888, 63888], "mapped", [25088]], [[63889, 63889], "mapped", [25754]], [[63890, 63890], "mapped", [28451]], [[63891, 63891], "mapped", [29001]], [[63892, 63892], "mapped", [29833]], [[63893, 63893], "mapped", [31178]], [[63894, 63894], "mapped", [32244]], [[63895, 63895], "mapped", [32879]], [[63896, 63896], "mapped", [36646]], [[63897, 63897], "mapped", [34030]], [[63898, 63898], "mapped", [36899]], [[63899, 63899], "mapped", [37706]], [[63900, 63900], "mapped", [21015]], [[63901, 63901], "mapped", [21155]], [[63902, 63902], "mapped", [21693]], [[63903, 63903], "mapped", [28872]], [[63904, 63904], "mapped", [35010]], [[63905, 63905], "mapped", [35498]], [[63906, 63906], "mapped", [24265]], [[63907, 63907], "mapped", [24565]], [[63908, 63908], "mapped", [25467]], [[63909, 63909], "mapped", [27566]], [[63910, 63910], "mapped", [31806]], [[63911, 63911], "mapped", [29557]], [[63912, 63912], "mapped", [20196]], [[63913, 63913], "mapped", [22265]], [[63914, 63914], "mapped", [23527]], [[63915, 63915], "mapped", [23994]], [[63916, 63916], "mapped", [24604]], [[63917, 63917], "mapped", [29618]], [[63918, 63918], "mapped", [29801]], [[63919, 63919], "mapped", [32666]], [[63920, 63920], "mapped", [32838]], [[63921, 63921], "mapped", [37428]], [[63922, 63922], "mapped", [38646]], [[63923, 63923], "mapped", [38728]], [[63924, 63924], "mapped", [38936]], [[63925, 63925], "mapped", [20363]], [[63926, 63926], "mapped", [31150]], [[63927, 63927], "mapped", [37300]], [[63928, 63928], "mapped", [38584]], [[63929, 63929], "mapped", [24801]], [[63930, 63930], "mapped", [20102]], [[63931, 63931], "mapped", [20698]], [[63932, 63932], "mapped", [23534]], [[63933, 63933], "mapped", [23615]], [[63934, 63934], "mapped", [26009]], [[63935, 63935], "mapped", [27138]], [[63936, 63936], "mapped", [29134]], [[63937, 63937], "mapped", [30274]], [[63938, 63938], "mapped", [34044]], [[63939, 63939], "mapped", [36988]], [[63940, 63940], "mapped", [40845]], [[63941, 63941], "mapped", [26248]], [[63942, 63942], "mapped", [38446]], [[63943, 63943], "mapped", [21129]], [[63944, 63944], "mapped", [26491]], [[63945, 63945], "mapped", [26611]], [[63946, 63946], "mapped", [27969]], [[63947, 63947], "mapped", [28316]], [[63948, 63948], "mapped", [29705]], [[63949, 63949], "mapped", [30041]], [[63950, 63950], "mapped", [30827]], [[63951, 63951], "mapped", [32016]], [[63952, 63952], "mapped", [39006]], [[63953, 63953], "mapped", [20845]], [[63954, 63954], "mapped", [25134]], [[63955, 63955], "mapped", [38520]], [[63956, 63956], "mapped", [20523]], [[63957, 63957], "mapped", [23833]], [[63958, 63958], "mapped", [28138]], [[63959, 63959], "mapped", [36650]], [[63960, 63960], "mapped", [24459]], [[63961, 63961], "mapped", [24900]], [[63962, 63962], "mapped", [26647]], [[63963, 63963], "mapped", [29575]], [[63964, 63964], "mapped", [38534]], [[63965, 63965], "mapped", [21033]], [[63966, 63966], "mapped", [21519]], [[63967, 63967], "mapped", [23653]], [[63968, 63968], "mapped", [26131]], [[63969, 63969], "mapped", [26446]], [[63970, 63970], "mapped", [26792]], [[63971, 63971], "mapped", [27877]], [[63972, 63972], "mapped", [29702]], [[63973, 63973], "mapped", [30178]], [[63974, 63974], "mapped", [32633]], [[63975, 63975], "mapped", [35023]], [[63976, 63976], "mapped", [35041]], [[63977, 63977], "mapped", [37324]], [[63978, 63978], "mapped", [38626]], [[63979, 63979], "mapped", [21311]], [[63980, 63980], "mapped", [28346]], [[63981, 63981], "mapped", [21533]], [[63982, 63982], "mapped", [29136]], [[63983, 63983], "mapped", [29848]], [[63984, 63984], "mapped", [34298]], [[63985, 63985], "mapped", [38563]], [[63986, 63986], "mapped", [40023]], [[63987, 63987], "mapped", [40607]], [[63988, 63988], "mapped", [26519]], [[63989, 63989], "mapped", [28107]], [[63990, 63990], "mapped", [33256]], [[63991, 63991], "mapped", [31435]], [[63992, 63992], "mapped", [31520]], [[63993, 63993], "mapped", [31890]], [[63994, 63994], "mapped", [29376]], [[63995, 63995], "mapped", [28825]], [[63996, 63996], "mapped", [35672]], [[63997, 63997], "mapped", [20160]], [[63998, 63998], "mapped", [33590]], [[63999, 63999], "mapped", [21050]], [[64e3, 64e3], "mapped", [20999]], [[64001, 64001], "mapped", [24230]], [[64002, 64002], "mapped", [25299]], [[64003, 64003], "mapped", [31958]], [[64004, 64004], "mapped", [23429]], [[64005, 64005], "mapped", [27934]], [[64006, 64006], "mapped", [26292]], [[64007, 64007], "mapped", [36667]], [[64008, 64008], "mapped", [34892]], [[64009, 64009], "mapped", [38477]], [[64010, 64010], "mapped", [35211]], [[64011, 64011], "mapped", [24275]], [[64012, 64012], "mapped", [20800]], [[64013, 64013], "mapped", [21952]], [[64014, 64015], "valid"], [[64016, 64016], "mapped", [22618]], [[64017, 64017], "valid"], [[64018, 64018], "mapped", [26228]], [[64019, 64020], "valid"], [[64021, 64021], "mapped", [20958]], [[64022, 64022], "mapped", [29482]], [[64023, 64023], "mapped", [30410]], [[64024, 64024], "mapped", [31036]], [[64025, 64025], "mapped", [31070]], [[64026, 64026], "mapped", [31077]], [[64027, 64027], "mapped", [31119]], [[64028, 64028], "mapped", [38742]], [[64029, 64029], "mapped", [31934]], [[64030, 64030], "mapped", [32701]], [[64031, 64031], "valid"], [[64032, 64032], "mapped", [34322]], [[64033, 64033], "valid"], [[64034, 64034], "mapped", [35576]], [[64035, 64036], "valid"], [[64037, 64037], "mapped", [36920]], [[64038, 64038], "mapped", [37117]], [[64039, 64041], "valid"], [[64042, 64042], "mapped", [39151]], [[64043, 64043], "mapped", [39164]], [[64044, 64044], "mapped", [39208]], [[64045, 64045], "mapped", [40372]], [[64046, 64046], "mapped", [37086]], [[64047, 64047], "mapped", [38583]], [[64048, 64048], "mapped", [20398]], [[64049, 64049], "mapped", [20711]], [[64050, 64050], "mapped", [20813]], [[64051, 64051], "mapped", [21193]], [[64052, 64052], "mapped", [21220]], [[64053, 64053], "mapped", [21329]], [[64054, 64054], "mapped", [21917]], [[64055, 64055], "mapped", [22022]], [[64056, 64056], "mapped", [22120]], [[64057, 64057], "mapped", [22592]], [[64058, 64058], "mapped", [22696]], [[64059, 64059], "mapped", [23652]], [[64060, 64060], "mapped", [23662]], [[64061, 64061], "mapped", [24724]], [[64062, 64062], "mapped", [24936]], [[64063, 64063], "mapped", [24974]], [[64064, 64064], "mapped", [25074]], [[64065, 64065], "mapped", [25935]], [[64066, 64066], "mapped", [26082]], [[64067, 64067], "mapped", [26257]], [[64068, 64068], "mapped", [26757]], [[64069, 64069], "mapped", [28023]], [[64070, 64070], "mapped", [28186]], [[64071, 64071], "mapped", [28450]], [[64072, 64072], "mapped", [29038]], [[64073, 64073], "mapped", [29227]], [[64074, 64074], "mapped", [29730]], [[64075, 64075], "mapped", [30865]], [[64076, 64076], "mapped", [31038]], [[64077, 64077], "mapped", [31049]], [[64078, 64078], "mapped", [31048]], [[64079, 64079], "mapped", [31056]], [[64080, 64080], "mapped", [31062]], [[64081, 64081], "mapped", [31069]], [[64082, 64082], "mapped", [31117]], [[64083, 64083], "mapped", [31118]], [[64084, 64084], "mapped", [31296]], [[64085, 64085], "mapped", [31361]], [[64086, 64086], "mapped", [31680]], [[64087, 64087], "mapped", [32244]], [[64088, 64088], "mapped", [32265]], [[64089, 64089], "mapped", [32321]], [[64090, 64090], "mapped", [32626]], [[64091, 64091], "mapped", [32773]], [[64092, 64092], "mapped", [33261]], [[64093, 64094], "mapped", [33401]], [[64095, 64095], "mapped", [33879]], [[64096, 64096], "mapped", [35088]], [[64097, 64097], "mapped", [35222]], [[64098, 64098], "mapped", [35585]], [[64099, 64099], "mapped", [35641]], [[64100, 64100], "mapped", [36051]], [[64101, 64101], "mapped", [36104]], [[64102, 64102], "mapped", [36790]], [[64103, 64103], "mapped", [36920]], [[64104, 64104], "mapped", [38627]], [[64105, 64105], "mapped", [38911]], [[64106, 64106], "mapped", [38971]], [[64107, 64107], "mapped", [24693]], [[64108, 64108], "mapped", [148206]], [[64109, 64109], "mapped", [33304]], [[64110, 64111], "disallowed"], [[64112, 64112], "mapped", [20006]], [[64113, 64113], "mapped", [20917]], [[64114, 64114], "mapped", [20840]], [[64115, 64115], "mapped", [20352]], [[64116, 64116], "mapped", [20805]], [[64117, 64117], "mapped", [20864]], [[64118, 64118], "mapped", [21191]], [[64119, 64119], "mapped", [21242]], [[64120, 64120], "mapped", [21917]], [[64121, 64121], "mapped", [21845]], [[64122, 64122], "mapped", [21913]], [[64123, 64123], "mapped", [21986]], [[64124, 64124], "mapped", [22618]], [[64125, 64125], "mapped", [22707]], [[64126, 64126], "mapped", [22852]], [[64127, 64127], "mapped", [22868]], [[64128, 64128], "mapped", [23138]], [[64129, 64129], "mapped", [23336]], [[64130, 64130], "mapped", [24274]], [[64131, 64131], "mapped", [24281]], [[64132, 64132], "mapped", [24425]], [[64133, 64133], "mapped", [24493]], [[64134, 64134], "mapped", [24792]], [[64135, 64135], "mapped", [24910]], [[64136, 64136], "mapped", [24840]], [[64137, 64137], "mapped", [24974]], [[64138, 64138], "mapped", [24928]], [[64139, 64139], "mapped", [25074]], [[64140, 64140], "mapped", [25140]], [[64141, 64141], "mapped", [25540]], [[64142, 64142], "mapped", [25628]], [[64143, 64143], "mapped", [25682]], [[64144, 64144], "mapped", [25942]], [[64145, 64145], "mapped", [26228]], [[64146, 64146], "mapped", [26391]], [[64147, 64147], "mapped", [26395]], [[64148, 64148], "mapped", [26454]], [[64149, 64149], "mapped", [27513]], [[64150, 64150], "mapped", [27578]], [[64151, 64151], "mapped", [27969]], [[64152, 64152], "mapped", [28379]], [[64153, 64153], "mapped", [28363]], [[64154, 64154], "mapped", [28450]], [[64155, 64155], "mapped", [28702]], [[64156, 64156], "mapped", [29038]], [[64157, 64157], "mapped", [30631]], [[64158, 64158], "mapped", [29237]], [[64159, 64159], "mapped", [29359]], [[64160, 64160], "mapped", [29482]], [[64161, 64161], "mapped", [29809]], [[64162, 64162], "mapped", [29958]], [[64163, 64163], "mapped", [30011]], [[64164, 64164], "mapped", [30237]], [[64165, 64165], "mapped", [30239]], [[64166, 64166], "mapped", [30410]], [[64167, 64167], "mapped", [30427]], [[64168, 64168], "mapped", [30452]], [[64169, 64169], "mapped", [30538]], [[64170, 64170], "mapped", [30528]], [[64171, 64171], "mapped", [30924]], [[64172, 64172], "mapped", [31409]], [[64173, 64173], "mapped", [31680]], [[64174, 64174], "mapped", [31867]], [[64175, 64175], "mapped", [32091]], [[64176, 64176], "mapped", [32244]], [[64177, 64177], "mapped", [32574]], [[64178, 64178], "mapped", [32773]], [[64179, 64179], "mapped", [33618]], [[64180, 64180], "mapped", [33775]], [[64181, 64181], "mapped", [34681]], [[64182, 64182], "mapped", [35137]], [[64183, 64183], "mapped", [35206]], [[64184, 64184], "mapped", [35222]], [[64185, 64185], "mapped", [35519]], [[64186, 64186], "mapped", [35576]], [[64187, 64187], "mapped", [35531]], [[64188, 64188], "mapped", [35585]], [[64189, 64189], "mapped", [35582]], [[64190, 64190], "mapped", [35565]], [[64191, 64191], "mapped", [35641]], [[64192, 64192], "mapped", [35722]], [[64193, 64193], "mapped", [36104]], [[64194, 64194], "mapped", [36664]], [[64195, 64195], "mapped", [36978]], [[64196, 64196], "mapped", [37273]], [[64197, 64197], "mapped", [37494]], [[64198, 64198], "mapped", [38524]], [[64199, 64199], "mapped", [38627]], [[64200, 64200], "mapped", [38742]], [[64201, 64201], "mapped", [38875]], [[64202, 64202], "mapped", [38911]], [[64203, 64203], "mapped", [38923]], [[64204, 64204], "mapped", [38971]], [[64205, 64205], "mapped", [39698]], [[64206, 64206], "mapped", [40860]], [[64207, 64207], "mapped", [141386]], [[64208, 64208], "mapped", [141380]], [[64209, 64209], "mapped", [144341]], [[64210, 64210], "mapped", [15261]], [[64211, 64211], "mapped", [16408]], [[64212, 64212], "mapped", [16441]], [[64213, 64213], "mapped", [152137]], [[64214, 64214], "mapped", [154832]], [[64215, 64215], "mapped", [163539]], [[64216, 64216], "mapped", [40771]], [[64217, 64217], "mapped", [40846]], [[64218, 64255], "disallowed"], [[64256, 64256], "mapped", [102, 102]], [[64257, 64257], "mapped", [102, 105]], [[64258, 64258], "mapped", [102, 108]], [[64259, 64259], "mapped", [102, 102, 105]], [[64260, 64260], "mapped", [102, 102, 108]], [[64261, 64262], "mapped", [115, 116]], [[64263, 64274], "disallowed"], [[64275, 64275], "mapped", [1396, 1398]], [[64276, 64276], "mapped", [1396, 1381]], [[64277, 64277], "mapped", [1396, 1387]], [[64278, 64278], "mapped", [1406, 1398]], [[64279, 64279], "mapped", [1396, 1389]], [[64280, 64284], "disallowed"], [[64285, 64285], "mapped", [1497, 1460]], [[64286, 64286], "valid"], [[64287, 64287], "mapped", [1522, 1463]], [[64288, 64288], "mapped", [1506]], [[64289, 64289], "mapped", [1488]], [[64290, 64290], "mapped", [1491]], [[64291, 64291], "mapped", [1492]], [[64292, 64292], "mapped", [1499]], [[64293, 64293], "mapped", [1500]], [[64294, 64294], "mapped", [1501]], [[64295, 64295], "mapped", [1512]], [[64296, 64296], "mapped", [1514]], [[64297, 64297], "disallowed_STD3_mapped", [43]], [[64298, 64298], "mapped", [1513, 1473]], [[64299, 64299], "mapped", [1513, 1474]], [[64300, 64300], "mapped", [1513, 1468, 1473]], [[64301, 64301], "mapped", [1513, 1468, 1474]], [[64302, 64302], "mapped", [1488, 1463]], [[64303, 64303], "mapped", [1488, 1464]], [[64304, 64304], "mapped", [1488, 1468]], [[64305, 64305], "mapped", [1489, 1468]], [[64306, 64306], "mapped", [1490, 1468]], [[64307, 64307], "mapped", [1491, 1468]], [[64308, 64308], "mapped", [1492, 1468]], [[64309, 64309], "mapped", [1493, 1468]], [[64310, 64310], "mapped", [1494, 1468]], [[64311, 64311], "disallowed"], [[64312, 64312], "mapped", [1496, 1468]], [[64313, 64313], "mapped", [1497, 1468]], [[64314, 64314], "mapped", [1498, 1468]], [[64315, 64315], "mapped", [1499, 1468]], [[64316, 64316], "mapped", [1500, 1468]], [[64317, 64317], "disallowed"], [[64318, 64318], "mapped", [1502, 1468]], [[64319, 64319], "disallowed"], [[64320, 64320], "mapped", [1504, 1468]], [[64321, 64321], "mapped", [1505, 1468]], [[64322, 64322], "disallowed"], [[64323, 64323], "mapped", [1507, 1468]], [[64324, 64324], "mapped", [1508, 1468]], [[64325, 64325], "disallowed"], [[64326, 64326], "mapped", [1510, 1468]], [[64327, 64327], "mapped", [1511, 1468]], [[64328, 64328], "mapped", [1512, 1468]], [[64329, 64329], "mapped", [1513, 1468]], [[64330, 64330], "mapped", [1514, 1468]], [[64331, 64331], "mapped", [1493, 1465]], [[64332, 64332], "mapped", [1489, 1471]], [[64333, 64333], "mapped", [1499, 1471]], [[64334, 64334], "mapped", [1508, 1471]], [[64335, 64335], "mapped", [1488, 1500]], [[64336, 64337], "mapped", [1649]], [[64338, 64341], "mapped", [1659]], [[64342, 64345], "mapped", [1662]], [[64346, 64349], "mapped", [1664]], [[64350, 64353], "mapped", [1658]], [[64354, 64357], "mapped", [1663]], [[64358, 64361], "mapped", [1657]], [[64362, 64365], "mapped", [1700]], [[64366, 64369], "mapped", [1702]], [[64370, 64373], "mapped", [1668]], [[64374, 64377], "mapped", [1667]], [[64378, 64381], "mapped", [1670]], [[64382, 64385], "mapped", [1671]], [[64386, 64387], "mapped", [1677]], [[64388, 64389], "mapped", [1676]], [[64390, 64391], "mapped", [1678]], [[64392, 64393], "mapped", [1672]], [[64394, 64395], "mapped", [1688]], [[64396, 64397], "mapped", [1681]], [[64398, 64401], "mapped", [1705]], [[64402, 64405], "mapped", [1711]], [[64406, 64409], "mapped", [1715]], [[64410, 64413], "mapped", [1713]], [[64414, 64415], "mapped", [1722]], [[64416, 64419], "mapped", [1723]], [[64420, 64421], "mapped", [1728]], [[64422, 64425], "mapped", [1729]], [[64426, 64429], "mapped", [1726]], [[64430, 64431], "mapped", [1746]], [[64432, 64433], "mapped", [1747]], [[64434, 64449], "valid", [], "NV8"], [[64450, 64466], "disallowed"], [[64467, 64470], "mapped", [1709]], [[64471, 64472], "mapped", [1735]], [[64473, 64474], "mapped", [1734]], [[64475, 64476], "mapped", [1736]], [[64477, 64477], "mapped", [1735, 1652]], [[64478, 64479], "mapped", [1739]], [[64480, 64481], "mapped", [1733]], [[64482, 64483], "mapped", [1737]], [[64484, 64487], "mapped", [1744]], [[64488, 64489], "mapped", [1609]], [[64490, 64491], "mapped", [1574, 1575]], [[64492, 64493], "mapped", [1574, 1749]], [[64494, 64495], "mapped", [1574, 1608]], [[64496, 64497], "mapped", [1574, 1735]], [[64498, 64499], "mapped", [1574, 1734]], [[64500, 64501], "mapped", [1574, 1736]], [[64502, 64504], "mapped", [1574, 1744]], [[64505, 64507], "mapped", [1574, 1609]], [[64508, 64511], "mapped", [1740]], [[64512, 64512], "mapped", [1574, 1580]], [[64513, 64513], "mapped", [1574, 1581]], [[64514, 64514], "mapped", [1574, 1605]], [[64515, 64515], "mapped", [1574, 1609]], [[64516, 64516], "mapped", [1574, 1610]], [[64517, 64517], "mapped", [1576, 1580]], [[64518, 64518], "mapped", [1576, 1581]], [[64519, 64519], "mapped", [1576, 1582]], [[64520, 64520], "mapped", [1576, 1605]], [[64521, 64521], "mapped", [1576, 1609]], [[64522, 64522], "mapped", [1576, 1610]], [[64523, 64523], "mapped", [1578, 1580]], [[64524, 64524], "mapped", [1578, 1581]], [[64525, 64525], "mapped", [1578, 1582]], [[64526, 64526], "mapped", [1578, 1605]], [[64527, 64527], "mapped", [1578, 1609]], [[64528, 64528], "mapped", [1578, 1610]], [[64529, 64529], "mapped", [1579, 1580]], [[64530, 64530], "mapped", [1579, 1605]], [[64531, 64531], "mapped", [1579, 1609]], [[64532, 64532], "mapped", [1579, 1610]], [[64533, 64533], "mapped", [1580, 1581]], [[64534, 64534], "mapped", [1580, 1605]], [[64535, 64535], "mapped", [1581, 1580]], [[64536, 64536], "mapped", [1581, 1605]], [[64537, 64537], "mapped", [1582, 1580]], [[64538, 64538], "mapped", [1582, 1581]], [[64539, 64539], "mapped", [1582, 1605]], [[64540, 64540], "mapped", [1587, 1580]], [[64541, 64541], "mapped", [1587, 1581]], [[64542, 64542], "mapped", [1587, 1582]], [[64543, 64543], "mapped", [1587, 1605]], [[64544, 64544], "mapped", [1589, 1581]], [[64545, 64545], "mapped", [1589, 1605]], [[64546, 64546], "mapped", [1590, 1580]], [[64547, 64547], "mapped", [1590, 1581]], [[64548, 64548], "mapped", [1590, 1582]], [[64549, 64549], "mapped", [1590, 1605]], [[64550, 64550], "mapped", [1591, 1581]], [[64551, 64551], "mapped", [1591, 1605]], [[64552, 64552], "mapped", [1592, 1605]], [[64553, 64553], "mapped", [1593, 1580]], [[64554, 64554], "mapped", [1593, 1605]], [[64555, 64555], "mapped", [1594, 1580]], [[64556, 64556], "mapped", [1594, 1605]], [[64557, 64557], "mapped", [1601, 1580]], [[64558, 64558], "mapped", [1601, 1581]], [[64559, 64559], "mapped", [1601, 1582]], [[64560, 64560], "mapped", [1601, 1605]], [[64561, 64561], "mapped", [1601, 1609]], [[64562, 64562], "mapped", [1601, 1610]], [[64563, 64563], "mapped", [1602, 1581]], [[64564, 64564], "mapped", [1602, 1605]], [[64565, 64565], "mapped", [1602, 1609]], [[64566, 64566], "mapped", [1602, 1610]], [[64567, 64567], "mapped", [1603, 1575]], [[64568, 64568], "mapped", [1603, 1580]], [[64569, 64569], "mapped", [1603, 1581]], [[64570, 64570], "mapped", [1603, 1582]], [[64571, 64571], "mapped", [1603, 1604]], [[64572, 64572], "mapped", [1603, 1605]], [[64573, 64573], "mapped", [1603, 1609]], [[64574, 64574], "mapped", [1603, 1610]], [[64575, 64575], "mapped", [1604, 1580]], [[64576, 64576], "mapped", [1604, 1581]], [[64577, 64577], "mapped", [1604, 1582]], [[64578, 64578], "mapped", [1604, 1605]], [[64579, 64579], "mapped", [1604, 1609]], [[64580, 64580], "mapped", [1604, 1610]], [[64581, 64581], "mapped", [1605, 1580]], [[64582, 64582], "mapped", [1605, 1581]], [[64583, 64583], "mapped", [1605, 1582]], [[64584, 64584], "mapped", [1605, 1605]], [[64585, 64585], "mapped", [1605, 1609]], [[64586, 64586], "mapped", [1605, 1610]], [[64587, 64587], "mapped", [1606, 1580]], [[64588, 64588], "mapped", [1606, 1581]], [[64589, 64589], "mapped", [1606, 1582]], [[64590, 64590], "mapped", [1606, 1605]], [[64591, 64591], "mapped", [1606, 1609]], [[64592, 64592], "mapped", [1606, 1610]], [[64593, 64593], "mapped", [1607, 1580]], [[64594, 64594], "mapped", [1607, 1605]], [[64595, 64595], "mapped", [1607, 1609]], [[64596, 64596], "mapped", [1607, 1610]], [[64597, 64597], "mapped", [1610, 1580]], [[64598, 64598], "mapped", [1610, 1581]], [[64599, 64599], "mapped", [1610, 1582]], [[64600, 64600], "mapped", [1610, 1605]], [[64601, 64601], "mapped", [1610, 1609]], [[64602, 64602], "mapped", [1610, 1610]], [[64603, 64603], "mapped", [1584, 1648]], [[64604, 64604], "mapped", [1585, 1648]], [[64605, 64605], "mapped", [1609, 1648]], [[64606, 64606], "disallowed_STD3_mapped", [32, 1612, 1617]], [[64607, 64607], "disallowed_STD3_mapped", [32, 1613, 1617]], [[64608, 64608], "disallowed_STD3_mapped", [32, 1614, 1617]], [[64609, 64609], "disallowed_STD3_mapped", [32, 1615, 1617]], [[64610, 64610], "disallowed_STD3_mapped", [32, 1616, 1617]], [[64611, 64611], "disallowed_STD3_mapped", [32, 1617, 1648]], [[64612, 64612], "mapped", [1574, 1585]], [[64613, 64613], "mapped", [1574, 1586]], [[64614, 64614], "mapped", [1574, 1605]], [[64615, 64615], "mapped", [1574, 1606]], [[64616, 64616], "mapped", [1574, 1609]], [[64617, 64617], "mapped", [1574, 1610]], [[64618, 64618], "mapped", [1576, 1585]], [[64619, 64619], "mapped", [1576, 1586]], [[64620, 64620], "mapped", [1576, 1605]], [[64621, 64621], "mapped", [1576, 1606]], [[64622, 64622], "mapped", [1576, 1609]], [[64623, 64623], "mapped", [1576, 1610]], [[64624, 64624], "mapped", [1578, 1585]], [[64625, 64625], "mapped", [1578, 1586]], [[64626, 64626], "mapped", [1578, 1605]], [[64627, 64627], "mapped", [1578, 1606]], [[64628, 64628], "mapped", [1578, 1609]], [[64629, 64629], "mapped", [1578, 1610]], [[64630, 64630], "mapped", [1579, 1585]], [[64631, 64631], "mapped", [1579, 1586]], [[64632, 64632], "mapped", [1579, 1605]], [[64633, 64633], "mapped", [1579, 1606]], [[64634, 64634], "mapped", [1579, 1609]], [[64635, 64635], "mapped", [1579, 1610]], [[64636, 64636], "mapped", [1601, 1609]], [[64637, 64637], "mapped", [1601, 1610]], [[64638, 64638], "mapped", [1602, 1609]], [[64639, 64639], "mapped", [1602, 1610]], [[64640, 64640], "mapped", [1603, 1575]], [[64641, 64641], "mapped", [1603, 1604]], [[64642, 64642], "mapped", [1603, 1605]], [[64643, 64643], "mapped", [1603, 1609]], [[64644, 64644], "mapped", [1603, 1610]], [[64645, 64645], "mapped", [1604, 1605]], [[64646, 64646], "mapped", [1604, 1609]], [[64647, 64647], "mapped", [1604, 1610]], [[64648, 64648], "mapped", [1605, 1575]], [[64649, 64649], "mapped", [1605, 1605]], [[64650, 64650], "mapped", [1606, 1585]], [[64651, 64651], "mapped", [1606, 1586]], [[64652, 64652], "mapped", [1606, 1605]], [[64653, 64653], "mapped", [1606, 1606]], [[64654, 64654], "mapped", [1606, 1609]], [[64655, 64655], "mapped", [1606, 1610]], [[64656, 64656], "mapped", [1609, 1648]], [[64657, 64657], "mapped", [1610, 1585]], [[64658, 64658], "mapped", [1610, 1586]], [[64659, 64659], "mapped", [1610, 1605]], [[64660, 64660], "mapped", [1610, 1606]], [[64661, 64661], "mapped", [1610, 1609]], [[64662, 64662], "mapped", [1610, 1610]], [[64663, 64663], "mapped", [1574, 1580]], [[64664, 64664], "mapped", [1574, 1581]], [[64665, 64665], "mapped", [1574, 1582]], [[64666, 64666], "mapped", [1574, 1605]], [[64667, 64667], "mapped", [1574, 1607]], [[64668, 64668], "mapped", [1576, 1580]], [[64669, 64669], "mapped", [1576, 1581]], [[64670, 64670], "mapped", [1576, 1582]], [[64671, 64671], "mapped", [1576, 1605]], [[64672, 64672], "mapped", [1576, 1607]], [[64673, 64673], "mapped", [1578, 1580]], [[64674, 64674], "mapped", [1578, 1581]], [[64675, 64675], "mapped", [1578, 1582]], [[64676, 64676], "mapped", [1578, 1605]], [[64677, 64677], "mapped", [1578, 1607]], [[64678, 64678], "mapped", [1579, 1605]], [[64679, 64679], "mapped", [1580, 1581]], [[64680, 64680], "mapped", [1580, 1605]], [[64681, 64681], "mapped", [1581, 1580]], [[64682, 64682], "mapped", [1581, 1605]], [[64683, 64683], "mapped", [1582, 1580]], [[64684, 64684], "mapped", [1582, 1605]], [[64685, 64685], "mapped", [1587, 1580]], [[64686, 64686], "mapped", [1587, 1581]], [[64687, 64687], "mapped", [1587, 1582]], [[64688, 64688], "mapped", [1587, 1605]], [[64689, 64689], "mapped", [1589, 1581]], [[64690, 64690], "mapped", [1589, 1582]], [[64691, 64691], "mapped", [1589, 1605]], [[64692, 64692], "mapped", [1590, 1580]], [[64693, 64693], "mapped", [1590, 1581]], [[64694, 64694], "mapped", [1590, 1582]], [[64695, 64695], "mapped", [1590, 1605]], [[64696, 64696], "mapped", [1591, 1581]], [[64697, 64697], "mapped", [1592, 1605]], [[64698, 64698], "mapped", [1593, 1580]], [[64699, 64699], "mapped", [1593, 1605]], [[64700, 64700], "mapped", [1594, 1580]], [[64701, 64701], "mapped", [1594, 1605]], [[64702, 64702], "mapped", [1601, 1580]], [[64703, 64703], "mapped", [1601, 1581]], [[64704, 64704], "mapped", [1601, 1582]], [[64705, 64705], "mapped", [1601, 1605]], [[64706, 64706], "mapped", [1602, 1581]], [[64707, 64707], "mapped", [1602, 1605]], [[64708, 64708], "mapped", [1603, 1580]], [[64709, 64709], "mapped", [1603, 1581]], [[64710, 64710], "mapped", [1603, 1582]], [[64711, 64711], "mapped", [1603, 1604]], [[64712, 64712], "mapped", [1603, 1605]], [[64713, 64713], "mapped", [1604, 1580]], [[64714, 64714], "mapped", [1604, 1581]], [[64715, 64715], "mapped", [1604, 1582]], [[64716, 64716], "mapped", [1604, 1605]], [[64717, 64717], "mapped", [1604, 1607]], [[64718, 64718], "mapped", [1605, 1580]], [[64719, 64719], "mapped", [1605, 1581]], [[64720, 64720], "mapped", [1605, 1582]], [[64721, 64721], "mapped", [1605, 1605]], [[64722, 64722], "mapped", [1606, 1580]], [[64723, 64723], "mapped", [1606, 1581]], [[64724, 64724], "mapped", [1606, 1582]], [[64725, 64725], "mapped", [1606, 1605]], [[64726, 64726], "mapped", [1606, 1607]], [[64727, 64727], "mapped", [1607, 1580]], [[64728, 64728], "mapped", [1607, 1605]], [[64729, 64729], "mapped", [1607, 1648]], [[64730, 64730], "mapped", [1610, 1580]], [[64731, 64731], "mapped", [1610, 1581]], [[64732, 64732], "mapped", [1610, 1582]], [[64733, 64733], "mapped", [1610, 1605]], [[64734, 64734], "mapped", [1610, 1607]], [[64735, 64735], "mapped", [1574, 1605]], [[64736, 64736], "mapped", [1574, 1607]], [[64737, 64737], "mapped", [1576, 1605]], [[64738, 64738], "mapped", [1576, 1607]], [[64739, 64739], "mapped", [1578, 1605]], [[64740, 64740], "mapped", [1578, 1607]], [[64741, 64741], "mapped", [1579, 1605]], [[64742, 64742], "mapped", [1579, 1607]], [[64743, 64743], "mapped", [1587, 1605]], [[64744, 64744], "mapped", [1587, 1607]], [[64745, 64745], "mapped", [1588, 1605]], [[64746, 64746], "mapped", [1588, 1607]], [[64747, 64747], "mapped", [1603, 1604]], [[64748, 64748], "mapped", [1603, 1605]], [[64749, 64749], "mapped", [1604, 1605]], [[64750, 64750], "mapped", [1606, 1605]], [[64751, 64751], "mapped", [1606, 1607]], [[64752, 64752], "mapped", [1610, 1605]], [[64753, 64753], "mapped", [1610, 1607]], [[64754, 64754], "mapped", [1600, 1614, 1617]], [[64755, 64755], "mapped", [1600, 1615, 1617]], [[64756, 64756], "mapped", [1600, 1616, 1617]], [[64757, 64757], "mapped", [1591, 1609]], [[64758, 64758], "mapped", [1591, 1610]], [[64759, 64759], "mapped", [1593, 1609]], [[64760, 64760], "mapped", [1593, 1610]], [[64761, 64761], "mapped", [1594, 1609]], [[64762, 64762], "mapped", [1594, 1610]], [[64763, 64763], "mapped", [1587, 1609]], [[64764, 64764], "mapped", [1587, 1610]], [[64765, 64765], "mapped", [1588, 1609]], [[64766, 64766], "mapped", [1588, 1610]], [[64767, 64767], "mapped", [1581, 1609]], [[64768, 64768], "mapped", [1581, 1610]], [[64769, 64769], "mapped", [1580, 1609]], [[64770, 64770], "mapped", [1580, 1610]], [[64771, 64771], "mapped", [1582, 1609]], [[64772, 64772], "mapped", [1582, 1610]], [[64773, 64773], "mapped", [1589, 1609]], [[64774, 64774], "mapped", [1589, 1610]], [[64775, 64775], "mapped", [1590, 1609]], [[64776, 64776], "mapped", [1590, 1610]], [[64777, 64777], "mapped", [1588, 1580]], [[64778, 64778], "mapped", [1588, 1581]], [[64779, 64779], "mapped", [1588, 1582]], [[64780, 64780], "mapped", [1588, 1605]], [[64781, 64781], "mapped", [1588, 1585]], [[64782, 64782], "mapped", [1587, 1585]], [[64783, 64783], "mapped", [1589, 1585]], [[64784, 64784], "mapped", [1590, 1585]], [[64785, 64785], "mapped", [1591, 1609]], [[64786, 64786], "mapped", [1591, 1610]], [[64787, 64787], "mapped", [1593, 1609]], [[64788, 64788], "mapped", [1593, 1610]], [[64789, 64789], "mapped", [1594, 1609]], [[64790, 64790], "mapped", [1594, 1610]], [[64791, 64791], "mapped", [1587, 1609]], [[64792, 64792], "mapped", [1587, 1610]], [[64793, 64793], "mapped", [1588, 1609]], [[64794, 64794], "mapped", [1588, 1610]], [[64795, 64795], "mapped", [1581, 1609]], [[64796, 64796], "mapped", [1581, 1610]], [[64797, 64797], "mapped", [1580, 1609]], [[64798, 64798], "mapped", [1580, 1610]], [[64799, 64799], "mapped", [1582, 1609]], [[64800, 64800], "mapped", [1582, 1610]], [[64801, 64801], "mapped", [1589, 1609]], [[64802, 64802], "mapped", [1589, 1610]], [[64803, 64803], "mapped", [1590, 1609]], [[64804, 64804], "mapped", [1590, 1610]], [[64805, 64805], "mapped", [1588, 1580]], [[64806, 64806], "mapped", [1588, 1581]], [[64807, 64807], "mapped", [1588, 1582]], [[64808, 64808], "mapped", [1588, 1605]], [[64809, 64809], "mapped", [1588, 1585]], [[64810, 64810], "mapped", [1587, 1585]], [[64811, 64811], "mapped", [1589, 1585]], [[64812, 64812], "mapped", [1590, 1585]], [[64813, 64813], "mapped", [1588, 1580]], [[64814, 64814], "mapped", [1588, 1581]], [[64815, 64815], "mapped", [1588, 1582]], [[64816, 64816], "mapped", [1588, 1605]], [[64817, 64817], "mapped", [1587, 1607]], [[64818, 64818], "mapped", [1588, 1607]], [[64819, 64819], "mapped", [1591, 1605]], [[64820, 64820], "mapped", [1587, 1580]], [[64821, 64821], "mapped", [1587, 1581]], [[64822, 64822], "mapped", [1587, 1582]], [[64823, 64823], "mapped", [1588, 1580]], [[64824, 64824], "mapped", [1588, 1581]], [[64825, 64825], "mapped", [1588, 1582]], [[64826, 64826], "mapped", [1591, 1605]], [[64827, 64827], "mapped", [1592, 1605]], [[64828, 64829], "mapped", [1575, 1611]], [[64830, 64831], "valid", [], "NV8"], [[64832, 64847], "disallowed"], [[64848, 64848], "mapped", [1578, 1580, 1605]], [[64849, 64850], "mapped", [1578, 1581, 1580]], [[64851, 64851], "mapped", [1578, 1581, 1605]], [[64852, 64852], "mapped", [1578, 1582, 1605]], [[64853, 64853], "mapped", [1578, 1605, 1580]], [[64854, 64854], "mapped", [1578, 1605, 1581]], [[64855, 64855], "mapped", [1578, 1605, 1582]], [[64856, 64857], "mapped", [1580, 1605, 1581]], [[64858, 64858], "mapped", [1581, 1605, 1610]], [[64859, 64859], "mapped", [1581, 1605, 1609]], [[64860, 64860], "mapped", [1587, 1581, 1580]], [[64861, 64861], "mapped", [1587, 1580, 1581]], [[64862, 64862], "mapped", [1587, 1580, 1609]], [[64863, 64864], "mapped", [1587, 1605, 1581]], [[64865, 64865], "mapped", [1587, 1605, 1580]], [[64866, 64867], "mapped", [1587, 1605, 1605]], [[64868, 64869], "mapped", [1589, 1581, 1581]], [[64870, 64870], "mapped", [1589, 1605, 1605]], [[64871, 64872], "mapped", [1588, 1581, 1605]], [[64873, 64873], "mapped", [1588, 1580, 1610]], [[64874, 64875], "mapped", [1588, 1605, 1582]], [[64876, 64877], "mapped", [1588, 1605, 1605]], [[64878, 64878], "mapped", [1590, 1581, 1609]], [[64879, 64880], "mapped", [1590, 1582, 1605]], [[64881, 64882], "mapped", [1591, 1605, 1581]], [[64883, 64883], "mapped", [1591, 1605, 1605]], [[64884, 64884], "mapped", [1591, 1605, 1610]], [[64885, 64885], "mapped", [1593, 1580, 1605]], [[64886, 64887], "mapped", [1593, 1605, 1605]], [[64888, 64888], "mapped", [1593, 1605, 1609]], [[64889, 64889], "mapped", [1594, 1605, 1605]], [[64890, 64890], "mapped", [1594, 1605, 1610]], [[64891, 64891], "mapped", [1594, 1605, 1609]], [[64892, 64893], "mapped", [1601, 1582, 1605]], [[64894, 64894], "mapped", [1602, 1605, 1581]], [[64895, 64895], "mapped", [1602, 1605, 1605]], [[64896, 64896], "mapped", [1604, 1581, 1605]], [[64897, 64897], "mapped", [1604, 1581, 1610]], [[64898, 64898], "mapped", [1604, 1581, 1609]], [[64899, 64900], "mapped", [1604, 1580, 1580]], [[64901, 64902], "mapped", [1604, 1582, 1605]], [[64903, 64904], "mapped", [1604, 1605, 1581]], [[64905, 64905], "mapped", [1605, 1581, 1580]], [[64906, 64906], "mapped", [1605, 1581, 1605]], [[64907, 64907], "mapped", [1605, 1581, 1610]], [[64908, 64908], "mapped", [1605, 1580, 1581]], [[64909, 64909], "mapped", [1605, 1580, 1605]], [[64910, 64910], "mapped", [1605, 1582, 1580]], [[64911, 64911], "mapped", [1605, 1582, 1605]], [[64912, 64913], "disallowed"], [[64914, 64914], "mapped", [1605, 1580, 1582]], [[64915, 64915], "mapped", [1607, 1605, 1580]], [[64916, 64916], "mapped", [1607, 1605, 1605]], [[64917, 64917], "mapped", [1606, 1581, 1605]], [[64918, 64918], "mapped", [1606, 1581, 1609]], [[64919, 64920], "mapped", [1606, 1580, 1605]], [[64921, 64921], "mapped", [1606, 1580, 1609]], [[64922, 64922], "mapped", [1606, 1605, 1610]], [[64923, 64923], "mapped", [1606, 1605, 1609]], [[64924, 64925], "mapped", [1610, 1605, 1605]], [[64926, 64926], "mapped", [1576, 1582, 1610]], [[64927, 64927], "mapped", [1578, 1580, 1610]], [[64928, 64928], "mapped", [1578, 1580, 1609]], [[64929, 64929], "mapped", [1578, 1582, 1610]], [[64930, 64930], "mapped", [1578, 1582, 1609]], [[64931, 64931], "mapped", [1578, 1605, 1610]], [[64932, 64932], "mapped", [1578, 1605, 1609]], [[64933, 64933], "mapped", [1580, 1605, 1610]], [[64934, 64934], "mapped", [1580, 1581, 1609]], [[64935, 64935], "mapped", [1580, 1605, 1609]], [[64936, 64936], "mapped", [1587, 1582, 1609]], [[64937, 64937], "mapped", [1589, 1581, 1610]], [[64938, 64938], "mapped", [1588, 1581, 1610]], [[64939, 64939], "mapped", [1590, 1581, 1610]], [[64940, 64940], "mapped", [1604, 1580, 1610]], [[64941, 64941], "mapped", [1604, 1605, 1610]], [[64942, 64942], "mapped", [1610, 1581, 1610]], [[64943, 64943], "mapped", [1610, 1580, 1610]], [[64944, 64944], "mapped", [1610, 1605, 1610]], [[64945, 64945], "mapped", [1605, 1605, 1610]], [[64946, 64946], "mapped", [1602, 1605, 1610]], [[64947, 64947], "mapped", [1606, 1581, 1610]], [[64948, 64948], "mapped", [1602, 1605, 1581]], [[64949, 64949], "mapped", [1604, 1581, 1605]], [[64950, 64950], "mapped", [1593, 1605, 1610]], [[64951, 64951], "mapped", [1603, 1605, 1610]], [[64952, 64952], "mapped", [1606, 1580, 1581]], [[64953, 64953], "mapped", [1605, 1582, 1610]], [[64954, 64954], "mapped", [1604, 1580, 1605]], [[64955, 64955], "mapped", [1603, 1605, 1605]], [[64956, 64956], "mapped", [1604, 1580, 1605]], [[64957, 64957], "mapped", [1606, 1580, 1581]], [[64958, 64958], "mapped", [1580, 1581, 1610]], [[64959, 64959], "mapped", [1581, 1580, 1610]], [[64960, 64960], "mapped", [1605, 1580, 1610]], [[64961, 64961], "mapped", [1601, 1605, 1610]], [[64962, 64962], "mapped", [1576, 1581, 1610]], [[64963, 64963], "mapped", [1603, 1605, 1605]], [[64964, 64964], "mapped", [1593, 1580, 1605]], [[64965, 64965], "mapped", [1589, 1605, 1605]], [[64966, 64966], "mapped", [1587, 1582, 1610]], [[64967, 64967], "mapped", [1606, 1580, 1610]], [[64968, 64975], "disallowed"], [[64976, 65007], "disallowed"], [[65008, 65008], "mapped", [1589, 1604, 1746]], [[65009, 65009], "mapped", [1602, 1604, 1746]], [[65010, 65010], "mapped", [1575, 1604, 1604, 1607]], [[65011, 65011], "mapped", [1575, 1603, 1576, 1585]], [[65012, 65012], "mapped", [1605, 1581, 1605, 1583]], [[65013, 65013], "mapped", [1589, 1604, 1593, 1605]], [[65014, 65014], "mapped", [1585, 1587, 1608, 1604]], [[65015, 65015], "mapped", [1593, 1604, 1610, 1607]], [[65016, 65016], "mapped", [1608, 1587, 1604, 1605]], [[65017, 65017], "mapped", [1589, 1604, 1609]], [[65018, 65018], "disallowed_STD3_mapped", [1589, 1604, 1609, 32, 1575, 1604, 1604, 1607, 32, 1593, 1604, 1610, 1607, 32, 1608, 1587, 1604, 1605]], [[65019, 65019], "disallowed_STD3_mapped", [1580, 1604, 32, 1580, 1604, 1575, 1604, 1607]], [[65020, 65020], "mapped", [1585, 1740, 1575, 1604]], [[65021, 65021], "valid", [], "NV8"], [[65022, 65023], "disallowed"], [[65024, 65039], "ignored"], [[65040, 65040], "disallowed_STD3_mapped", [44]], [[65041, 65041], "mapped", [12289]], [[65042, 65042], "disallowed"], [[65043, 65043], "disallowed_STD3_mapped", [58]], [[65044, 65044], "disallowed_STD3_mapped", [59]], [[65045, 65045], "disallowed_STD3_mapped", [33]], [[65046, 65046], "disallowed_STD3_mapped", [63]], [[65047, 65047], "mapped", [12310]], [[65048, 65048], "mapped", [12311]], [[65049, 65049], "disallowed"], [[65050, 65055], "disallowed"], [[65056, 65059], "valid"], [[65060, 65062], "valid"], [[65063, 65069], "valid"], [[65070, 65071], "valid"], [[65072, 65072], "disallowed"], [[65073, 65073], "mapped", [8212]], [[65074, 65074], "mapped", [8211]], [[65075, 65076], "disallowed_STD3_mapped", [95]], [[65077, 65077], "disallowed_STD3_mapped", [40]], [[65078, 65078], "disallowed_STD3_mapped", [41]], [[65079, 65079], "disallowed_STD3_mapped", [123]], [[65080, 65080], "disallowed_STD3_mapped", [125]], [[65081, 65081], "mapped", [12308]], [[65082, 65082], "mapped", [12309]], [[65083, 65083], "mapped", [12304]], [[65084, 65084], "mapped", [12305]], [[65085, 65085], "mapped", [12298]], [[65086, 65086], "mapped", [12299]], [[65087, 65087], "mapped", [12296]], [[65088, 65088], "mapped", [12297]], [[65089, 65089], "mapped", [12300]], [[65090, 65090], "mapped", [12301]], [[65091, 65091], "mapped", [12302]], [[65092, 65092], "mapped", [12303]], [[65093, 65094], "valid", [], "NV8"], [[65095, 65095], "disallowed_STD3_mapped", [91]], [[65096, 65096], "disallowed_STD3_mapped", [93]], [[65097, 65100], "disallowed_STD3_mapped", [32, 773]], [[65101, 65103], "disallowed_STD3_mapped", [95]], [[65104, 65104], "disallowed_STD3_mapped", [44]], [[65105, 65105], "mapped", [12289]], [[65106, 65106], "disallowed"], [[65107, 65107], "disallowed"], [[65108, 65108], "disallowed_STD3_mapped", [59]], [[65109, 65109], "disallowed_STD3_mapped", [58]], [[65110, 65110], "disallowed_STD3_mapped", [63]], [[65111, 65111], "disallowed_STD3_mapped", [33]], [[65112, 65112], "mapped", [8212]], [[65113, 65113], "disallowed_STD3_mapped", [40]], [[65114, 65114], "disallowed_STD3_mapped", [41]], [[65115, 65115], "disallowed_STD3_mapped", [123]], [[65116, 65116], "disallowed_STD3_mapped", [125]], [[65117, 65117], "mapped", [12308]], [[65118, 65118], "mapped", [12309]], [[65119, 65119], "disallowed_STD3_mapped", [35]], [[65120, 65120], "disallowed_STD3_mapped", [38]], [[65121, 65121], "disallowed_STD3_mapped", [42]], [[65122, 65122], "disallowed_STD3_mapped", [43]], [[65123, 65123], "mapped", [45]], [[65124, 65124], "disallowed_STD3_mapped", [60]], [[65125, 65125], "disallowed_STD3_mapped", [62]], [[65126, 65126], "disallowed_STD3_mapped", [61]], [[65127, 65127], "disallowed"], [[65128, 65128], "disallowed_STD3_mapped", [92]], [[65129, 65129], "disallowed_STD3_mapped", [36]], [[65130, 65130], "disallowed_STD3_mapped", [37]], [[65131, 65131], "disallowed_STD3_mapped", [64]], [[65132, 65135], "disallowed"], [[65136, 65136], "disallowed_STD3_mapped", [32, 1611]], [[65137, 65137], "mapped", [1600, 1611]], [[65138, 65138], "disallowed_STD3_mapped", [32, 1612]], [[65139, 65139], "valid"], [[65140, 65140], "disallowed_STD3_mapped", [32, 1613]], [[65141, 65141], "disallowed"], [[65142, 65142], "disallowed_STD3_mapped", [32, 1614]], [[65143, 65143], "mapped", [1600, 1614]], [[65144, 65144], "disallowed_STD3_mapped", [32, 1615]], [[65145, 65145], "mapped", [1600, 1615]], [[65146, 65146], "disallowed_STD3_mapped", [32, 1616]], [[65147, 65147], "mapped", [1600, 1616]], [[65148, 65148], "disallowed_STD3_mapped", [32, 1617]], [[65149, 65149], "mapped", [1600, 1617]], [[65150, 65150], "disallowed_STD3_mapped", [32, 1618]], [[65151, 65151], "mapped", [1600, 1618]], [[65152, 65152], "mapped", [1569]], [[65153, 65154], "mapped", [1570]], [[65155, 65156], "mapped", [1571]], [[65157, 65158], "mapped", [1572]], [[65159, 65160], "mapped", [1573]], [[65161, 65164], "mapped", [1574]], [[65165, 65166], "mapped", [1575]], [[65167, 65170], "mapped", [1576]], [[65171, 65172], "mapped", [1577]], [[65173, 65176], "mapped", [1578]], [[65177, 65180], "mapped", [1579]], [[65181, 65184], "mapped", [1580]], [[65185, 65188], "mapped", [1581]], [[65189, 65192], "mapped", [1582]], [[65193, 65194], "mapped", [1583]], [[65195, 65196], "mapped", [1584]], [[65197, 65198], "mapped", [1585]], [[65199, 65200], "mapped", [1586]], [[65201, 65204], "mapped", [1587]], [[65205, 65208], "mapped", [1588]], [[65209, 65212], "mapped", [1589]], [[65213, 65216], "mapped", [1590]], [[65217, 65220], "mapped", [1591]], [[65221, 65224], "mapped", [1592]], [[65225, 65228], "mapped", [1593]], [[65229, 65232], "mapped", [1594]], [[65233, 65236], "mapped", [1601]], [[65237, 65240], "mapped", [1602]], [[65241, 65244], "mapped", [1603]], [[65245, 65248], "mapped", [1604]], [[65249, 65252], "mapped", [1605]], [[65253, 65256], "mapped", [1606]], [[65257, 65260], "mapped", [1607]], [[65261, 65262], "mapped", [1608]], [[65263, 65264], "mapped", [1609]], [[65265, 65268], "mapped", [1610]], [[65269, 65270], "mapped", [1604, 1570]], [[65271, 65272], "mapped", [1604, 1571]], [[65273, 65274], "mapped", [1604, 1573]], [[65275, 65276], "mapped", [1604, 1575]], [[65277, 65278], "disallowed"], [[65279, 65279], "ignored"], [[65280, 65280], "disallowed"], [[65281, 65281], "disallowed_STD3_mapped", [33]], [[65282, 65282], "disallowed_STD3_mapped", [34]], [[65283, 65283], "disallowed_STD3_mapped", [35]], [[65284, 65284], "disallowed_STD3_mapped", [36]], [[65285, 65285], "disallowed_STD3_mapped", [37]], [[65286, 65286], "disallowed_STD3_mapped", [38]], [[65287, 65287], "disallowed_STD3_mapped", [39]], [[65288, 65288], "disallowed_STD3_mapped", [40]], [[65289, 65289], "disallowed_STD3_mapped", [41]], [[65290, 65290], "disallowed_STD3_mapped", [42]], [[65291, 65291], "disallowed_STD3_mapped", [43]], [[65292, 65292], "disallowed_STD3_mapped", [44]], [[65293, 65293], "mapped", [45]], [[65294, 65294], "mapped", [46]], [[65295, 65295], "disallowed_STD3_mapped", [47]], [[65296, 65296], "mapped", [48]], [[65297, 65297], "mapped", [49]], [[65298, 65298], "mapped", [50]], [[65299, 65299], "mapped", [51]], [[65300, 65300], "mapped", [52]], [[65301, 65301], "mapped", [53]], [[65302, 65302], "mapped", [54]], [[65303, 65303], "mapped", [55]], [[65304, 65304], "mapped", [56]], [[65305, 65305], "mapped", [57]], [[65306, 65306], "disallowed_STD3_mapped", [58]], [[65307, 65307], "disallowed_STD3_mapped", [59]], [[65308, 65308], "disallowed_STD3_mapped", [60]], [[65309, 65309], "disallowed_STD3_mapped", [61]], [[65310, 65310], "disallowed_STD3_mapped", [62]], [[65311, 65311], "disallowed_STD3_mapped", [63]], [[65312, 65312], "disallowed_STD3_mapped", [64]], [[65313, 65313], "mapped", [97]], [[65314, 65314], "mapped", [98]], [[65315, 65315], "mapped", [99]], [[65316, 65316], "mapped", [100]], [[65317, 65317], "mapped", [101]], [[65318, 65318], "mapped", [102]], [[65319, 65319], "mapped", [103]], [[65320, 65320], "mapped", [104]], [[65321, 65321], "mapped", [105]], [[65322, 65322], "mapped", [106]], [[65323, 65323], "mapped", [107]], [[65324, 65324], "mapped", [108]], [[65325, 65325], "mapped", [109]], [[65326, 65326], "mapped", [110]], [[65327, 65327], "mapped", [111]], [[65328, 65328], "mapped", [112]], [[65329, 65329], "mapped", [113]], [[65330, 65330], "mapped", [114]], [[65331, 65331], "mapped", [115]], [[65332, 65332], "mapped", [116]], [[65333, 65333], "mapped", [117]], [[65334, 65334], "mapped", [118]], [[65335, 65335], "mapped", [119]], [[65336, 65336], "mapped", [120]], [[65337, 65337], "mapped", [121]], [[65338, 65338], "mapped", [122]], [[65339, 65339], "disallowed_STD3_mapped", [91]], [[65340, 65340], "disallowed_STD3_mapped", [92]], [[65341, 65341], "disallowed_STD3_mapped", [93]], [[65342, 65342], "disallowed_STD3_mapped", [94]], [[65343, 65343], "disallowed_STD3_mapped", [95]], [[65344, 65344], "disallowed_STD3_mapped", [96]], [[65345, 65345], "mapped", [97]], [[65346, 65346], "mapped", [98]], [[65347, 65347], "mapped", [99]], [[65348, 65348], "mapped", [100]], [[65349, 65349], "mapped", [101]], [[65350, 65350], "mapped", [102]], [[65351, 65351], "mapped", [103]], [[65352, 65352], "mapped", [104]], [[65353, 65353], "mapped", [105]], [[65354, 65354], "mapped", [106]], [[65355, 65355], "mapped", [107]], [[65356, 65356], "mapped", [108]], [[65357, 65357], "mapped", [109]], [[65358, 65358], "mapped", [110]], [[65359, 65359], "mapped", [111]], [[65360, 65360], "mapped", [112]], [[65361, 65361], "mapped", [113]], [[65362, 65362], "mapped", [114]], [[65363, 65363], "mapped", [115]], [[65364, 65364], "mapped", [116]], [[65365, 65365], "mapped", [117]], [[65366, 65366], "mapped", [118]], [[65367, 65367], "mapped", [119]], [[65368, 65368], "mapped", [120]], [[65369, 65369], "mapped", [121]], [[65370, 65370], "mapped", [122]], [[65371, 65371], "disallowed_STD3_mapped", [123]], [[65372, 65372], "disallowed_STD3_mapped", [124]], [[65373, 65373], "disallowed_STD3_mapped", [125]], [[65374, 65374], "disallowed_STD3_mapped", [126]], [[65375, 65375], "mapped", [10629]], [[65376, 65376], "mapped", [10630]], [[65377, 65377], "mapped", [46]], [[65378, 65378], "mapped", [12300]], [[65379, 65379], "mapped", [12301]], [[65380, 65380], "mapped", [12289]], [[65381, 65381], "mapped", [12539]], [[65382, 65382], "mapped", [12530]], [[65383, 65383], "mapped", [12449]], [[65384, 65384], "mapped", [12451]], [[65385, 65385], "mapped", [12453]], [[65386, 65386], "mapped", [12455]], [[65387, 65387], "mapped", [12457]], [[65388, 65388], "mapped", [12515]], [[65389, 65389], "mapped", [12517]], [[65390, 65390], "mapped", [12519]], [[65391, 65391], "mapped", [12483]], [[65392, 65392], "mapped", [12540]], [[65393, 65393], "mapped", [12450]], [[65394, 65394], "mapped", [12452]], [[65395, 65395], "mapped", [12454]], [[65396, 65396], "mapped", [12456]], [[65397, 65397], "mapped", [12458]], [[65398, 65398], "mapped", [12459]], [[65399, 65399], "mapped", [12461]], [[65400, 65400], "mapped", [12463]], [[65401, 65401], "mapped", [12465]], [[65402, 65402], "mapped", [12467]], [[65403, 65403], "mapped", [12469]], [[65404, 65404], "mapped", [12471]], [[65405, 65405], "mapped", [12473]], [[65406, 65406], "mapped", [12475]], [[65407, 65407], "mapped", [12477]], [[65408, 65408], "mapped", [12479]], [[65409, 65409], "mapped", [12481]], [[65410, 65410], "mapped", [12484]], [[65411, 65411], "mapped", [12486]], [[65412, 65412], "mapped", [12488]], [[65413, 65413], "mapped", [12490]], [[65414, 65414], "mapped", [12491]], [[65415, 65415], "mapped", [12492]], [[65416, 65416], "mapped", [12493]], [[65417, 65417], "mapped", [12494]], [[65418, 65418], "mapped", [12495]], [[65419, 65419], "mapped", [12498]], [[65420, 65420], "mapped", [12501]], [[65421, 65421], "mapped", [12504]], [[65422, 65422], "mapped", [12507]], [[65423, 65423], "mapped", [12510]], [[65424, 65424], "mapped", [12511]], [[65425, 65425], "mapped", [12512]], [[65426, 65426], "mapped", [12513]], [[65427, 65427], "mapped", [12514]], [[65428, 65428], "mapped", [12516]], [[65429, 65429], "mapped", [12518]], [[65430, 65430], "mapped", [12520]], [[65431, 65431], "mapped", [12521]], [[65432, 65432], "mapped", [12522]], [[65433, 65433], "mapped", [12523]], [[65434, 65434], "mapped", [12524]], [[65435, 65435], "mapped", [12525]], [[65436, 65436], "mapped", [12527]], [[65437, 65437], "mapped", [12531]], [[65438, 65438], "mapped", [12441]], [[65439, 65439], "mapped", [12442]], [[65440, 65440], "disallowed"], [[65441, 65441], "mapped", [4352]], [[65442, 65442], "mapped", [4353]], [[65443, 65443], "mapped", [4522]], [[65444, 65444], "mapped", [4354]], [[65445, 65445], "mapped", [4524]], [[65446, 65446], "mapped", [4525]], [[65447, 65447], "mapped", [4355]], [[65448, 65448], "mapped", [4356]], [[65449, 65449], "mapped", [4357]], [[65450, 65450], "mapped", [4528]], [[65451, 65451], "mapped", [4529]], [[65452, 65452], "mapped", [4530]], [[65453, 65453], "mapped", [4531]], [[65454, 65454], "mapped", [4532]], [[65455, 65455], "mapped", [4533]], [[65456, 65456], "mapped", [4378]], [[65457, 65457], "mapped", [4358]], [[65458, 65458], "mapped", [4359]], [[65459, 65459], "mapped", [4360]], [[65460, 65460], "mapped", [4385]], [[65461, 65461], "mapped", [4361]], [[65462, 65462], "mapped", [4362]], [[65463, 65463], "mapped", [4363]], [[65464, 65464], "mapped", [4364]], [[65465, 65465], "mapped", [4365]], [[65466, 65466], "mapped", [4366]], [[65467, 65467], "mapped", [4367]], [[65468, 65468], "mapped", [4368]], [[65469, 65469], "mapped", [4369]], [[65470, 65470], "mapped", [4370]], [[65471, 65473], "disallowed"], [[65474, 65474], "mapped", [4449]], [[65475, 65475], "mapped", [4450]], [[65476, 65476], "mapped", [4451]], [[65477, 65477], "mapped", [4452]], [[65478, 65478], "mapped", [4453]], [[65479, 65479], "mapped", [4454]], [[65480, 65481], "disallowed"], [[65482, 65482], "mapped", [4455]], [[65483, 65483], "mapped", [4456]], [[65484, 65484], "mapped", [4457]], [[65485, 65485], "mapped", [4458]], [[65486, 65486], "mapped", [4459]], [[65487, 65487], "mapped", [4460]], [[65488, 65489], "disallowed"], [[65490, 65490], "mapped", [4461]], [[65491, 65491], "mapped", [4462]], [[65492, 65492], "mapped", [4463]], [[65493, 65493], "mapped", [4464]], [[65494, 65494], "mapped", [4465]], [[65495, 65495], "mapped", [4466]], [[65496, 65497], "disallowed"], [[65498, 65498], "mapped", [4467]], [[65499, 65499], "mapped", [4468]], [[65500, 65500], "mapped", [4469]], [[65501, 65503], "disallowed"], [[65504, 65504], "mapped", [162]], [[65505, 65505], "mapped", [163]], [[65506, 65506], "mapped", [172]], [[65507, 65507], "disallowed_STD3_mapped", [32, 772]], [[65508, 65508], "mapped", [166]], [[65509, 65509], "mapped", [165]], [[65510, 65510], "mapped", [8361]], [[65511, 65511], "disallowed"], [[65512, 65512], "mapped", [9474]], [[65513, 65513], "mapped", [8592]], [[65514, 65514], "mapped", [8593]], [[65515, 65515], "mapped", [8594]], [[65516, 65516], "mapped", [8595]], [[65517, 65517], "mapped", [9632]], [[65518, 65518], "mapped", [9675]], [[65519, 65528], "disallowed"], [[65529, 65531], "disallowed"], [[65532, 65532], "disallowed"], [[65533, 65533], "disallowed"], [[65534, 65535], "disallowed"], [[65536, 65547], "valid"], [[65548, 65548], "disallowed"], [[65549, 65574], "valid"], [[65575, 65575], "disallowed"], [[65576, 65594], "valid"], [[65595, 65595], "disallowed"], [[65596, 65597], "valid"], [[65598, 65598], "disallowed"], [[65599, 65613], "valid"], [[65614, 65615], "disallowed"], [[65616, 65629], "valid"], [[65630, 65663], "disallowed"], [[65664, 65786], "valid"], [[65787, 65791], "disallowed"], [[65792, 65794], "valid", [], "NV8"], [[65795, 65798], "disallowed"], [[65799, 65843], "valid", [], "NV8"], [[65844, 65846], "disallowed"], [[65847, 65855], "valid", [], "NV8"], [[65856, 65930], "valid", [], "NV8"], [[65931, 65932], "valid", [], "NV8"], [[65933, 65935], "disallowed"], [[65936, 65947], "valid", [], "NV8"], [[65948, 65951], "disallowed"], [[65952, 65952], "valid", [], "NV8"], [[65953, 65999], "disallowed"], [[66e3, 66044], "valid", [], "NV8"], [[66045, 66045], "valid"], [[66046, 66175], "disallowed"], [[66176, 66204], "valid"], [[66205, 66207], "disallowed"], [[66208, 66256], "valid"], [[66257, 66271], "disallowed"], [[66272, 66272], "valid"], [[66273, 66299], "valid", [], "NV8"], [[66300, 66303], "disallowed"], [[66304, 66334], "valid"], [[66335, 66335], "valid"], [[66336, 66339], "valid", [], "NV8"], [[66340, 66351], "disallowed"], [[66352, 66368], "valid"], [[66369, 66369], "valid", [], "NV8"], [[66370, 66377], "valid"], [[66378, 66378], "valid", [], "NV8"], [[66379, 66383], "disallowed"], [[66384, 66426], "valid"], [[66427, 66431], "disallowed"], [[66432, 66461], "valid"], [[66462, 66462], "disallowed"], [[66463, 66463], "valid", [], "NV8"], [[66464, 66499], "valid"], [[66500, 66503], "disallowed"], [[66504, 66511], "valid"], [[66512, 66517], "valid", [], "NV8"], [[66518, 66559], "disallowed"], [[66560, 66560], "mapped", [66600]], [[66561, 66561], "mapped", [66601]], [[66562, 66562], "mapped", [66602]], [[66563, 66563], "mapped", [66603]], [[66564, 66564], "mapped", [66604]], [[66565, 66565], "mapped", [66605]], [[66566, 66566], "mapped", [66606]], [[66567, 66567], "mapped", [66607]], [[66568, 66568], "mapped", [66608]], [[66569, 66569], "mapped", [66609]], [[66570, 66570], "mapped", [66610]], [[66571, 66571], "mapped", [66611]], [[66572, 66572], "mapped", [66612]], [[66573, 66573], "mapped", [66613]], [[66574, 66574], "mapped", [66614]], [[66575, 66575], "mapped", [66615]], [[66576, 66576], "mapped", [66616]], [[66577, 66577], "mapped", [66617]], [[66578, 66578], "mapped", [66618]], [[66579, 66579], "mapped", [66619]], [[66580, 66580], "mapped", [66620]], [[66581, 66581], "mapped", [66621]], [[66582, 66582], "mapped", [66622]], [[66583, 66583], "mapped", [66623]], [[66584, 66584], "mapped", [66624]], [[66585, 66585], "mapped", [66625]], [[66586, 66586], "mapped", [66626]], [[66587, 66587], "mapped", [66627]], [[66588, 66588], "mapped", [66628]], [[66589, 66589], "mapped", [66629]], [[66590, 66590], "mapped", [66630]], [[66591, 66591], "mapped", [66631]], [[66592, 66592], "mapped", [66632]], [[66593, 66593], "mapped", [66633]], [[66594, 66594], "mapped", [66634]], [[66595, 66595], "mapped", [66635]], [[66596, 66596], "mapped", [66636]], [[66597, 66597], "mapped", [66637]], [[66598, 66598], "mapped", [66638]], [[66599, 66599], "mapped", [66639]], [[66600, 66637], "valid"], [[66638, 66717], "valid"], [[66718, 66719], "disallowed"], [[66720, 66729], "valid"], [[66730, 66815], "disallowed"], [[66816, 66855], "valid"], [[66856, 66863], "disallowed"], [[66864, 66915], "valid"], [[66916, 66926], "disallowed"], [[66927, 66927], "valid", [], "NV8"], [[66928, 67071], "disallowed"], [[67072, 67382], "valid"], [[67383, 67391], "disallowed"], [[67392, 67413], "valid"], [[67414, 67423], "disallowed"], [[67424, 67431], "valid"], [[67432, 67583], "disallowed"], [[67584, 67589], "valid"], [[67590, 67591], "disallowed"], [[67592, 67592], "valid"], [[67593, 67593], "disallowed"], [[67594, 67637], "valid"], [[67638, 67638], "disallowed"], [[67639, 67640], "valid"], [[67641, 67643], "disallowed"], [[67644, 67644], "valid"], [[67645, 67646], "disallowed"], [[67647, 67647], "valid"], [[67648, 67669], "valid"], [[67670, 67670], "disallowed"], [[67671, 67679], "valid", [], "NV8"], [[67680, 67702], "valid"], [[67703, 67711], "valid", [], "NV8"], [[67712, 67742], "valid"], [[67743, 67750], "disallowed"], [[67751, 67759], "valid", [], "NV8"], [[67760, 67807], "disallowed"], [[67808, 67826], "valid"], [[67827, 67827], "disallowed"], [[67828, 67829], "valid"], [[67830, 67834], "disallowed"], [[67835, 67839], "valid", [], "NV8"], [[67840, 67861], "valid"], [[67862, 67865], "valid", [], "NV8"], [[67866, 67867], "valid", [], "NV8"], [[67868, 67870], "disallowed"], [[67871, 67871], "valid", [], "NV8"], [[67872, 67897], "valid"], [[67898, 67902], "disallowed"], [[67903, 67903], "valid", [], "NV8"], [[67904, 67967], "disallowed"], [[67968, 68023], "valid"], [[68024, 68027], "disallowed"], [[68028, 68029], "valid", [], "NV8"], [[68030, 68031], "valid"], [[68032, 68047], "valid", [], "NV8"], [[68048, 68049], "disallowed"], [[68050, 68095], "valid", [], "NV8"], [[68096, 68099], "valid"], [[68100, 68100], "disallowed"], [[68101, 68102], "valid"], [[68103, 68107], "disallowed"], [[68108, 68115], "valid"], [[68116, 68116], "disallowed"], [[68117, 68119], "valid"], [[68120, 68120], "disallowed"], [[68121, 68147], "valid"], [[68148, 68151], "disallowed"], [[68152, 68154], "valid"], [[68155, 68158], "disallowed"], [[68159, 68159], "valid"], [[68160, 68167], "valid", [], "NV8"], [[68168, 68175], "disallowed"], [[68176, 68184], "valid", [], "NV8"], [[68185, 68191], "disallowed"], [[68192, 68220], "valid"], [[68221, 68223], "valid", [], "NV8"], [[68224, 68252], "valid"], [[68253, 68255], "valid", [], "NV8"], [[68256, 68287], "disallowed"], [[68288, 68295], "valid"], [[68296, 68296], "valid", [], "NV8"], [[68297, 68326], "valid"], [[68327, 68330], "disallowed"], [[68331, 68342], "valid", [], "NV8"], [[68343, 68351], "disallowed"], [[68352, 68405], "valid"], [[68406, 68408], "disallowed"], [[68409, 68415], "valid", [], "NV8"], [[68416, 68437], "valid"], [[68438, 68439], "disallowed"], [[68440, 68447], "valid", [], "NV8"], [[68448, 68466], "valid"], [[68467, 68471], "disallowed"], [[68472, 68479], "valid", [], "NV8"], [[68480, 68497], "valid"], [[68498, 68504], "disallowed"], [[68505, 68508], "valid", [], "NV8"], [[68509, 68520], "disallowed"], [[68521, 68527], "valid", [], "NV8"], [[68528, 68607], "disallowed"], [[68608, 68680], "valid"], [[68681, 68735], "disallowed"], [[68736, 68736], "mapped", [68800]], [[68737, 68737], "mapped", [68801]], [[68738, 68738], "mapped", [68802]], [[68739, 68739], "mapped", [68803]], [[68740, 68740], "mapped", [68804]], [[68741, 68741], "mapped", [68805]], [[68742, 68742], "mapped", [68806]], [[68743, 68743], "mapped", [68807]], [[68744, 68744], "mapped", [68808]], [[68745, 68745], "mapped", [68809]], [[68746, 68746], "mapped", [68810]], [[68747, 68747], "mapped", [68811]], [[68748, 68748], "mapped", [68812]], [[68749, 68749], "mapped", [68813]], [[68750, 68750], "mapped", [68814]], [[68751, 68751], "mapped", [68815]], [[68752, 68752], "mapped", [68816]], [[68753, 68753], "mapped", [68817]], [[68754, 68754], "mapped", [68818]], [[68755, 68755], "mapped", [68819]], [[68756, 68756], "mapped", [68820]], [[68757, 68757], "mapped", [68821]], [[68758, 68758], "mapped", [68822]], [[68759, 68759], "mapped", [68823]], [[68760, 68760], "mapped", [68824]], [[68761, 68761], "mapped", [68825]], [[68762, 68762], "mapped", [68826]], [[68763, 68763], "mapped", [68827]], [[68764, 68764], "mapped", [68828]], [[68765, 68765], "mapped", [68829]], [[68766, 68766], "mapped", [68830]], [[68767, 68767], "mapped", [68831]], [[68768, 68768], "mapped", [68832]], [[68769, 68769], "mapped", [68833]], [[68770, 68770], "mapped", [68834]], [[68771, 68771], "mapped", [68835]], [[68772, 68772], "mapped", [68836]], [[68773, 68773], "mapped", [68837]], [[68774, 68774], "mapped", [68838]], [[68775, 68775], "mapped", [68839]], [[68776, 68776], "mapped", [68840]], [[68777, 68777], "mapped", [68841]], [[68778, 68778], "mapped", [68842]], [[68779, 68779], "mapped", [68843]], [[68780, 68780], "mapped", [68844]], [[68781, 68781], "mapped", [68845]], [[68782, 68782], "mapped", [68846]], [[68783, 68783], "mapped", [68847]], [[68784, 68784], "mapped", [68848]], [[68785, 68785], "mapped", [68849]], [[68786, 68786], "mapped", [68850]], [[68787, 68799], "disallowed"], [[68800, 68850], "valid"], [[68851, 68857], "disallowed"], [[68858, 68863], "valid", [], "NV8"], [[68864, 69215], "disallowed"], [[69216, 69246], "valid", [], "NV8"], [[69247, 69631], "disallowed"], [[69632, 69702], "valid"], [[69703, 69709], "valid", [], "NV8"], [[69710, 69713], "disallowed"], [[69714, 69733], "valid", [], "NV8"], [[69734, 69743], "valid"], [[69744, 69758], "disallowed"], [[69759, 69759], "valid"], [[69760, 69818], "valid"], [[69819, 69820], "valid", [], "NV8"], [[69821, 69821], "disallowed"], [[69822, 69825], "valid", [], "NV8"], [[69826, 69839], "disallowed"], [[69840, 69864], "valid"], [[69865, 69871], "disallowed"], [[69872, 69881], "valid"], [[69882, 69887], "disallowed"], [[69888, 69940], "valid"], [[69941, 69941], "disallowed"], [[69942, 69951], "valid"], [[69952, 69955], "valid", [], "NV8"], [[69956, 69967], "disallowed"], [[69968, 70003], "valid"], [[70004, 70005], "valid", [], "NV8"], [[70006, 70006], "valid"], [[70007, 70015], "disallowed"], [[70016, 70084], "valid"], [[70085, 70088], "valid", [], "NV8"], [[70089, 70089], "valid", [], "NV8"], [[70090, 70092], "valid"], [[70093, 70093], "valid", [], "NV8"], [[70094, 70095], "disallowed"], [[70096, 70105], "valid"], [[70106, 70106], "valid"], [[70107, 70107], "valid", [], "NV8"], [[70108, 70108], "valid"], [[70109, 70111], "valid", [], "NV8"], [[70112, 70112], "disallowed"], [[70113, 70132], "valid", [], "NV8"], [[70133, 70143], "disallowed"], [[70144, 70161], "valid"], [[70162, 70162], "disallowed"], [[70163, 70199], "valid"], [[70200, 70205], "valid", [], "NV8"], [[70206, 70271], "disallowed"], [[70272, 70278], "valid"], [[70279, 70279], "disallowed"], [[70280, 70280], "valid"], [[70281, 70281], "disallowed"], [[70282, 70285], "valid"], [[70286, 70286], "disallowed"], [[70287, 70301], "valid"], [[70302, 70302], "disallowed"], [[70303, 70312], "valid"], [[70313, 70313], "valid", [], "NV8"], [[70314, 70319], "disallowed"], [[70320, 70378], "valid"], [[70379, 70383], "disallowed"], [[70384, 70393], "valid"], [[70394, 70399], "disallowed"], [[70400, 70400], "valid"], [[70401, 70403], "valid"], [[70404, 70404], "disallowed"], [[70405, 70412], "valid"], [[70413, 70414], "disallowed"], [[70415, 70416], "valid"], [[70417, 70418], "disallowed"], [[70419, 70440], "valid"], [[70441, 70441], "disallowed"], [[70442, 70448], "valid"], [[70449, 70449], "disallowed"], [[70450, 70451], "valid"], [[70452, 70452], "disallowed"], [[70453, 70457], "valid"], [[70458, 70459], "disallowed"], [[70460, 70468], "valid"], [[70469, 70470], "disallowed"], [[70471, 70472], "valid"], [[70473, 70474], "disallowed"], [[70475, 70477], "valid"], [[70478, 70479], "disallowed"], [[70480, 70480], "valid"], [[70481, 70486], "disallowed"], [[70487, 70487], "valid"], [[70488, 70492], "disallowed"], [[70493, 70499], "valid"], [[70500, 70501], "disallowed"], [[70502, 70508], "valid"], [[70509, 70511], "disallowed"], [[70512, 70516], "valid"], [[70517, 70783], "disallowed"], [[70784, 70853], "valid"], [[70854, 70854], "valid", [], "NV8"], [[70855, 70855], "valid"], [[70856, 70863], "disallowed"], [[70864, 70873], "valid"], [[70874, 71039], "disallowed"], [[71040, 71093], "valid"], [[71094, 71095], "disallowed"], [[71096, 71104], "valid"], [[71105, 71113], "valid", [], "NV8"], [[71114, 71127], "valid", [], "NV8"], [[71128, 71133], "valid"], [[71134, 71167], "disallowed"], [[71168, 71232], "valid"], [[71233, 71235], "valid", [], "NV8"], [[71236, 71236], "valid"], [[71237, 71247], "disallowed"], [[71248, 71257], "valid"], [[71258, 71295], "disallowed"], [[71296, 71351], "valid"], [[71352, 71359], "disallowed"], [[71360, 71369], "valid"], [[71370, 71423], "disallowed"], [[71424, 71449], "valid"], [[71450, 71452], "disallowed"], [[71453, 71467], "valid"], [[71468, 71471], "disallowed"], [[71472, 71481], "valid"], [[71482, 71487], "valid", [], "NV8"], [[71488, 71839], "disallowed"], [[71840, 71840], "mapped", [71872]], [[71841, 71841], "mapped", [71873]], [[71842, 71842], "mapped", [71874]], [[71843, 71843], "mapped", [71875]], [[71844, 71844], "mapped", [71876]], [[71845, 71845], "mapped", [71877]], [[71846, 71846], "mapped", [71878]], [[71847, 71847], "mapped", [71879]], [[71848, 71848], "mapped", [71880]], [[71849, 71849], "mapped", [71881]], [[71850, 71850], "mapped", [71882]], [[71851, 71851], "mapped", [71883]], [[71852, 71852], "mapped", [71884]], [[71853, 71853], "mapped", [71885]], [[71854, 71854], "mapped", [71886]], [[71855, 71855], "mapped", [71887]], [[71856, 71856], "mapped", [71888]], [[71857, 71857], "mapped", [71889]], [[71858, 71858], "mapped", [71890]], [[71859, 71859], "mapped", [71891]], [[71860, 71860], "mapped", [71892]], [[71861, 71861], "mapped", [71893]], [[71862, 71862], "mapped", [71894]], [[71863, 71863], "mapped", [71895]], [[71864, 71864], "mapped", [71896]], [[71865, 71865], "mapped", [71897]], [[71866, 71866], "mapped", [71898]], [[71867, 71867], "mapped", [71899]], [[71868, 71868], "mapped", [71900]], [[71869, 71869], "mapped", [71901]], [[71870, 71870], "mapped", [71902]], [[71871, 71871], "mapped", [71903]], [[71872, 71913], "valid"], [[71914, 71922], "valid", [], "NV8"], [[71923, 71934], "disallowed"], [[71935, 71935], "valid"], [[71936, 72383], "disallowed"], [[72384, 72440], "valid"], [[72441, 73727], "disallowed"], [[73728, 74606], "valid"], [[74607, 74648], "valid"], [[74649, 74649], "valid"], [[74650, 74751], "disallowed"], [[74752, 74850], "valid", [], "NV8"], [[74851, 74862], "valid", [], "NV8"], [[74863, 74863], "disallowed"], [[74864, 74867], "valid", [], "NV8"], [[74868, 74868], "valid", [], "NV8"], [[74869, 74879], "disallowed"], [[74880, 75075], "valid"], [[75076, 77823], "disallowed"], [[77824, 78894], "valid"], [[78895, 82943], "disallowed"], [[82944, 83526], "valid"], [[83527, 92159], "disallowed"], [[92160, 92728], "valid"], [[92729, 92735], "disallowed"], [[92736, 92766], "valid"], [[92767, 92767], "disallowed"], [[92768, 92777], "valid"], [[92778, 92781], "disallowed"], [[92782, 92783], "valid", [], "NV8"], [[92784, 92879], "disallowed"], [[92880, 92909], "valid"], [[92910, 92911], "disallowed"], [[92912, 92916], "valid"], [[92917, 92917], "valid", [], "NV8"], [[92918, 92927], "disallowed"], [[92928, 92982], "valid"], [[92983, 92991], "valid", [], "NV8"], [[92992, 92995], "valid"], [[92996, 92997], "valid", [], "NV8"], [[92998, 93007], "disallowed"], [[93008, 93017], "valid"], [[93018, 93018], "disallowed"], [[93019, 93025], "valid", [], "NV8"], [[93026, 93026], "disallowed"], [[93027, 93047], "valid"], [[93048, 93052], "disallowed"], [[93053, 93071], "valid"], [[93072, 93951], "disallowed"], [[93952, 94020], "valid"], [[94021, 94031], "disallowed"], [[94032, 94078], "valid"], [[94079, 94094], "disallowed"], [[94095, 94111], "valid"], [[94112, 110591], "disallowed"], [[110592, 110593], "valid"], [[110594, 113663], "disallowed"], [[113664, 113770], "valid"], [[113771, 113775], "disallowed"], [[113776, 113788], "valid"], [[113789, 113791], "disallowed"], [[113792, 113800], "valid"], [[113801, 113807], "disallowed"], [[113808, 113817], "valid"], [[113818, 113819], "disallowed"], [[113820, 113820], "valid", [], "NV8"], [[113821, 113822], "valid"], [[113823, 113823], "valid", [], "NV8"], [[113824, 113827], "ignored"], [[113828, 118783], "disallowed"], [[118784, 119029], "valid", [], "NV8"], [[119030, 119039], "disallowed"], [[119040, 119078], "valid", [], "NV8"], [[119079, 119080], "disallowed"], [[119081, 119081], "valid", [], "NV8"], [[119082, 119133], "valid", [], "NV8"], [[119134, 119134], "mapped", [119127, 119141]], [[119135, 119135], "mapped", [119128, 119141]], [[119136, 119136], "mapped", [119128, 119141, 119150]], [[119137, 119137], "mapped", [119128, 119141, 119151]], [[119138, 119138], "mapped", [119128, 119141, 119152]], [[119139, 119139], "mapped", [119128, 119141, 119153]], [[119140, 119140], "mapped", [119128, 119141, 119154]], [[119141, 119154], "valid", [], "NV8"], [[119155, 119162], "disallowed"], [[119163, 119226], "valid", [], "NV8"], [[119227, 119227], "mapped", [119225, 119141]], [[119228, 119228], "mapped", [119226, 119141]], [[119229, 119229], "mapped", [119225, 119141, 119150]], [[119230, 119230], "mapped", [119226, 119141, 119150]], [[119231, 119231], "mapped", [119225, 119141, 119151]], [[119232, 119232], "mapped", [119226, 119141, 119151]], [[119233, 119261], "valid", [], "NV8"], [[119262, 119272], "valid", [], "NV8"], [[119273, 119295], "disallowed"], [[119296, 119365], "valid", [], "NV8"], [[119366, 119551], "disallowed"], [[119552, 119638], "valid", [], "NV8"], [[119639, 119647], "disallowed"], [[119648, 119665], "valid", [], "NV8"], [[119666, 119807], "disallowed"], [[119808, 119808], "mapped", [97]], [[119809, 119809], "mapped", [98]], [[119810, 119810], "mapped", [99]], [[119811, 119811], "mapped", [100]], [[119812, 119812], "mapped", [101]], [[119813, 119813], "mapped", [102]], [[119814, 119814], "mapped", [103]], [[119815, 119815], "mapped", [104]], [[119816, 119816], "mapped", [105]], [[119817, 119817], "mapped", [106]], [[119818, 119818], "mapped", [107]], [[119819, 119819], "mapped", [108]], [[119820, 119820], "mapped", [109]], [[119821, 119821], "mapped", [110]], [[119822, 119822], "mapped", [111]], [[119823, 119823], "mapped", [112]], [[119824, 119824], "mapped", [113]], [[119825, 119825], "mapped", [114]], [[119826, 119826], "mapped", [115]], [[119827, 119827], "mapped", [116]], [[119828, 119828], "mapped", [117]], [[119829, 119829], "mapped", [118]], [[119830, 119830], "mapped", [119]], [[119831, 119831], "mapped", [120]], [[119832, 119832], "mapped", [121]], [[119833, 119833], "mapped", [122]], [[119834, 119834], "mapped", [97]], [[119835, 119835], "mapped", [98]], [[119836, 119836], "mapped", [99]], [[119837, 119837], "mapped", [100]], [[119838, 119838], "mapped", [101]], [[119839, 119839], "mapped", [102]], [[119840, 119840], "mapped", [103]], [[119841, 119841], "mapped", [104]], [[119842, 119842], "mapped", [105]], [[119843, 119843], "mapped", [106]], [[119844, 119844], "mapped", [107]], [[119845, 119845], "mapped", [108]], [[119846, 119846], "mapped", [109]], [[119847, 119847], "mapped", [110]], [[119848, 119848], "mapped", [111]], [[119849, 119849], "mapped", [112]], [[119850, 119850], "mapped", [113]], [[119851, 119851], "mapped", [114]], [[119852, 119852], "mapped", [115]], [[119853, 119853], "mapped", [116]], [[119854, 119854], "mapped", [117]], [[119855, 119855], "mapped", [118]], [[119856, 119856], "mapped", [119]], [[119857, 119857], "mapped", [120]], [[119858, 119858], "mapped", [121]], [[119859, 119859], "mapped", [122]], [[119860, 119860], "mapped", [97]], [[119861, 119861], "mapped", [98]], [[119862, 119862], "mapped", [99]], [[119863, 119863], "mapped", [100]], [[119864, 119864], "mapped", [101]], [[119865, 119865], "mapped", [102]], [[119866, 119866], "mapped", [103]], [[119867, 119867], "mapped", [104]], [[119868, 119868], "mapped", [105]], [[119869, 119869], "mapped", [106]], [[119870, 119870], "mapped", [107]], [[119871, 119871], "mapped", [108]], [[119872, 119872], "mapped", [109]], [[119873, 119873], "mapped", [110]], [[119874, 119874], "mapped", [111]], [[119875, 119875], "mapped", [112]], [[119876, 119876], "mapped", [113]], [[119877, 119877], "mapped", [114]], [[119878, 119878], "mapped", [115]], [[119879, 119879], "mapped", [116]], [[119880, 119880], "mapped", [117]], [[119881, 119881], "mapped", [118]], [[119882, 119882], "mapped", [119]], [[119883, 119883], "mapped", [120]], [[119884, 119884], "mapped", [121]], [[119885, 119885], "mapped", [122]], [[119886, 119886], "mapped", [97]], [[119887, 119887], "mapped", [98]], [[119888, 119888], "mapped", [99]], [[119889, 119889], "mapped", [100]], [[119890, 119890], "mapped", [101]], [[119891, 119891], "mapped", [102]], [[119892, 119892], "mapped", [103]], [[119893, 119893], "disallowed"], [[119894, 119894], "mapped", [105]], [[119895, 119895], "mapped", [106]], [[119896, 119896], "mapped", [107]], [[119897, 119897], "mapped", [108]], [[119898, 119898], "mapped", [109]], [[119899, 119899], "mapped", [110]], [[119900, 119900], "mapped", [111]], [[119901, 119901], "mapped", [112]], [[119902, 119902], "mapped", [113]], [[119903, 119903], "mapped", [114]], [[119904, 119904], "mapped", [115]], [[119905, 119905], "mapped", [116]], [[119906, 119906], "mapped", [117]], [[119907, 119907], "mapped", [118]], [[119908, 119908], "mapped", [119]], [[119909, 119909], "mapped", [120]], [[119910, 119910], "mapped", [121]], [[119911, 119911], "mapped", [122]], [[119912, 119912], "mapped", [97]], [[119913, 119913], "mapped", [98]], [[119914, 119914], "mapped", [99]], [[119915, 119915], "mapped", [100]], [[119916, 119916], "mapped", [101]], [[119917, 119917], "mapped", [102]], [[119918, 119918], "mapped", [103]], [[119919, 119919], "mapped", [104]], [[119920, 119920], "mapped", [105]], [[119921, 119921], "mapped", [106]], [[119922, 119922], "mapped", [107]], [[119923, 119923], "mapped", [108]], [[119924, 119924], "mapped", [109]], [[119925, 119925], "mapped", [110]], [[119926, 119926], "mapped", [111]], [[119927, 119927], "mapped", [112]], [[119928, 119928], "mapped", [113]], [[119929, 119929], "mapped", [114]], [[119930, 119930], "mapped", [115]], [[119931, 119931], "mapped", [116]], [[119932, 119932], "mapped", [117]], [[119933, 119933], "mapped", [118]], [[119934, 119934], "mapped", [119]], [[119935, 119935], "mapped", [120]], [[119936, 119936], "mapped", [121]], [[119937, 119937], "mapped", [122]], [[119938, 119938], "mapped", [97]], [[119939, 119939], "mapped", [98]], [[119940, 119940], "mapped", [99]], [[119941, 119941], "mapped", [100]], [[119942, 119942], "mapped", [101]], [[119943, 119943], "mapped", [102]], [[119944, 119944], "mapped", [103]], [[119945, 119945], "mapped", [104]], [[119946, 119946], "mapped", [105]], [[119947, 119947], "mapped", [106]], [[119948, 119948], "mapped", [107]], [[119949, 119949], "mapped", [108]], [[119950, 119950], "mapped", [109]], [[119951, 119951], "mapped", [110]], [[119952, 119952], "mapped", [111]], [[119953, 119953], "mapped", [112]], [[119954, 119954], "mapped", [113]], [[119955, 119955], "mapped", [114]], [[119956, 119956], "mapped", [115]], [[119957, 119957], "mapped", [116]], [[119958, 119958], "mapped", [117]], [[119959, 119959], "mapped", [118]], [[119960, 119960], "mapped", [119]], [[119961, 119961], "mapped", [120]], [[119962, 119962], "mapped", [121]], [[119963, 119963], "mapped", [122]], [[119964, 119964], "mapped", [97]], [[119965, 119965], "disallowed"], [[119966, 119966], "mapped", [99]], [[119967, 119967], "mapped", [100]], [[119968, 119969], "disallowed"], [[119970, 119970], "mapped", [103]], [[119971, 119972], "disallowed"], [[119973, 119973], "mapped", [106]], [[119974, 119974], "mapped", [107]], [[119975, 119976], "disallowed"], [[119977, 119977], "mapped", [110]], [[119978, 119978], "mapped", [111]], [[119979, 119979], "mapped", [112]], [[119980, 119980], "mapped", [113]], [[119981, 119981], "disallowed"], [[119982, 119982], "mapped", [115]], [[119983, 119983], "mapped", [116]], [[119984, 119984], "mapped", [117]], [[119985, 119985], "mapped", [118]], [[119986, 119986], "mapped", [119]], [[119987, 119987], "mapped", [120]], [[119988, 119988], "mapped", [121]], [[119989, 119989], "mapped", [122]], [[119990, 119990], "mapped", [97]], [[119991, 119991], "mapped", [98]], [[119992, 119992], "mapped", [99]], [[119993, 119993], "mapped", [100]], [[119994, 119994], "disallowed"], [[119995, 119995], "mapped", [102]], [[119996, 119996], "disallowed"], [[119997, 119997], "mapped", [104]], [[119998, 119998], "mapped", [105]], [[119999, 119999], "mapped", [106]], [[12e4, 12e4], "mapped", [107]], [[120001, 120001], "mapped", [108]], [[120002, 120002], "mapped", [109]], [[120003, 120003], "mapped", [110]], [[120004, 120004], "disallowed"], [[120005, 120005], "mapped", [112]], [[120006, 120006], "mapped", [113]], [[120007, 120007], "mapped", [114]], [[120008, 120008], "mapped", [115]], [[120009, 120009], "mapped", [116]], [[120010, 120010], "mapped", [117]], [[120011, 120011], "mapped", [118]], [[120012, 120012], "mapped", [119]], [[120013, 120013], "mapped", [120]], [[120014, 120014], "mapped", [121]], [[120015, 120015], "mapped", [122]], [[120016, 120016], "mapped", [97]], [[120017, 120017], "mapped", [98]], [[120018, 120018], "mapped", [99]], [[120019, 120019], "mapped", [100]], [[120020, 120020], "mapped", [101]], [[120021, 120021], "mapped", [102]], [[120022, 120022], "mapped", [103]], [[120023, 120023], "mapped", [104]], [[120024, 120024], "mapped", [105]], [[120025, 120025], "mapped", [106]], [[120026, 120026], "mapped", [107]], [[120027, 120027], "mapped", [108]], [[120028, 120028], "mapped", [109]], [[120029, 120029], "mapped", [110]], [[120030, 120030], "mapped", [111]], [[120031, 120031], "mapped", [112]], [[120032, 120032], "mapped", [113]], [[120033, 120033], "mapped", [114]], [[120034, 120034], "mapped", [115]], [[120035, 120035], "mapped", [116]], [[120036, 120036], "mapped", [117]], [[120037, 120037], "mapped", [118]], [[120038, 120038], "mapped", [119]], [[120039, 120039], "mapped", [120]], [[120040, 120040], "mapped", [121]], [[120041, 120041], "mapped", [122]], [[120042, 120042], "mapped", [97]], [[120043, 120043], "mapped", [98]], [[120044, 120044], "mapped", [99]], [[120045, 120045], "mapped", [100]], [[120046, 120046], "mapped", [101]], [[120047, 120047], "mapped", [102]], [[120048, 120048], "mapped", [103]], [[120049, 120049], "mapped", [104]], [[120050, 120050], "mapped", [105]], [[120051, 120051], "mapped", [106]], [[120052, 120052], "mapped", [107]], [[120053, 120053], "mapped", [108]], [[120054, 120054], "mapped", [109]], [[120055, 120055], "mapped", [110]], [[120056, 120056], "mapped", [111]], [[120057, 120057], "mapped", [112]], [[120058, 120058], "mapped", [113]], [[120059, 120059], "mapped", [114]], [[120060, 120060], "mapped", [115]], [[120061, 120061], "mapped", [116]], [[120062, 120062], "mapped", [117]], [[120063, 120063], "mapped", [118]], [[120064, 120064], "mapped", [119]], [[120065, 120065], "mapped", [120]], [[120066, 120066], "mapped", [121]], [[120067, 120067], "mapped", [122]], [[120068, 120068], "mapped", [97]], [[120069, 120069], "mapped", [98]], [[120070, 120070], "disallowed"], [[120071, 120071], "mapped", [100]], [[120072, 120072], "mapped", [101]], [[120073, 120073], "mapped", [102]], [[120074, 120074], "mapped", [103]], [[120075, 120076], "disallowed"], [[120077, 120077], "mapped", [106]], [[120078, 120078], "mapped", [107]], [[120079, 120079], "mapped", [108]], [[120080, 120080], "mapped", [109]], [[120081, 120081], "mapped", [110]], [[120082, 120082], "mapped", [111]], [[120083, 120083], "mapped", [112]], [[120084, 120084], "mapped", [113]], [[120085, 120085], "disallowed"], [[120086, 120086], "mapped", [115]], [[120087, 120087], "mapped", [116]], [[120088, 120088], "mapped", [117]], [[120089, 120089], "mapped", [118]], [[120090, 120090], "mapped", [119]], [[120091, 120091], "mapped", [120]], [[120092, 120092], "mapped", [121]], [[120093, 120093], "disallowed"], [[120094, 120094], "mapped", [97]], [[120095, 120095], "mapped", [98]], [[120096, 120096], "mapped", [99]], [[120097, 120097], "mapped", [100]], [[120098, 120098], "mapped", [101]], [[120099, 120099], "mapped", [102]], [[120100, 120100], "mapped", [103]], [[120101, 120101], "mapped", [104]], [[120102, 120102], "mapped", [105]], [[120103, 120103], "mapped", [106]], [[120104, 120104], "mapped", [107]], [[120105, 120105], "mapped", [108]], [[120106, 120106], "mapped", [109]], [[120107, 120107], "mapped", [110]], [[120108, 120108], "mapped", [111]], [[120109, 120109], "mapped", [112]], [[120110, 120110], "mapped", [113]], [[120111, 120111], "mapped", [114]], [[120112, 120112], "mapped", [115]], [[120113, 120113], "mapped", [116]], [[120114, 120114], "mapped", [117]], [[120115, 120115], "mapped", [118]], [[120116, 120116], "mapped", [119]], [[120117, 120117], "mapped", [120]], [[120118, 120118], "mapped", [121]], [[120119, 120119], "mapped", [122]], [[120120, 120120], "mapped", [97]], [[120121, 120121], "mapped", [98]], [[120122, 120122], "disallowed"], [[120123, 120123], "mapped", [100]], [[120124, 120124], "mapped", [101]], [[120125, 120125], "mapped", [102]], [[120126, 120126], "mapped", [103]], [[120127, 120127], "disallowed"], [[120128, 120128], "mapped", [105]], [[120129, 120129], "mapped", [106]], [[120130, 120130], "mapped", [107]], [[120131, 120131], "mapped", [108]], [[120132, 120132], "mapped", [109]], [[120133, 120133], "disallowed"], [[120134, 120134], "mapped", [111]], [[120135, 120137], "disallowed"], [[120138, 120138], "mapped", [115]], [[120139, 120139], "mapped", [116]], [[120140, 120140], "mapped", [117]], [[120141, 120141], "mapped", [118]], [[120142, 120142], "mapped", [119]], [[120143, 120143], "mapped", [120]], [[120144, 120144], "mapped", [121]], [[120145, 120145], "disallowed"], [[120146, 120146], "mapped", [97]], [[120147, 120147], "mapped", [98]], [[120148, 120148], "mapped", [99]], [[120149, 120149], "mapped", [100]], [[120150, 120150], "mapped", [101]], [[120151, 120151], "mapped", [102]], [[120152, 120152], "mapped", [103]], [[120153, 120153], "mapped", [104]], [[120154, 120154], "mapped", [105]], [[120155, 120155], "mapped", [106]], [[120156, 120156], "mapped", [107]], [[120157, 120157], "mapped", [108]], [[120158, 120158], "mapped", [109]], [[120159, 120159], "mapped", [110]], [[120160, 120160], "mapped", [111]], [[120161, 120161], "mapped", [112]], [[120162, 120162], "mapped", [113]], [[120163, 120163], "mapped", [114]], [[120164, 120164], "mapped", [115]], [[120165, 120165], "mapped", [116]], [[120166, 120166], "mapped", [117]], [[120167, 120167], "mapped", [118]], [[120168, 120168], "mapped", [119]], [[120169, 120169], "mapped", [120]], [[120170, 120170], "mapped", [121]], [[120171, 120171], "mapped", [122]], [[120172, 120172], "mapped", [97]], [[120173, 120173], "mapped", [98]], [[120174, 120174], "mapped", [99]], [[120175, 120175], "mapped", [100]], [[120176, 120176], "mapped", [101]], [[120177, 120177], "mapped", [102]], [[120178, 120178], "mapped", [103]], [[120179, 120179], "mapped", [104]], [[120180, 120180], "mapped", [105]], [[120181, 120181], "mapped", [106]], [[120182, 120182], "mapped", [107]], [[120183, 120183], "mapped", [108]], [[120184, 120184], "mapped", [109]], [[120185, 120185], "mapped", [110]], [[120186, 120186], "mapped", [111]], [[120187, 120187], "mapped", [112]], [[120188, 120188], "mapped", [113]], [[120189, 120189], "mapped", [114]], [[120190, 120190], "mapped", [115]], [[120191, 120191], "mapped", [116]], [[120192, 120192], "mapped", [117]], [[120193, 120193], "mapped", [118]], [[120194, 120194], "mapped", [119]], [[120195, 120195], "mapped", [120]], [[120196, 120196], "mapped", [121]], [[120197, 120197], "mapped", [122]], [[120198, 120198], "mapped", [97]], [[120199, 120199], "mapped", [98]], [[120200, 120200], "mapped", [99]], [[120201, 120201], "mapped", [100]], [[120202, 120202], "mapped", [101]], [[120203, 120203], "mapped", [102]], [[120204, 120204], "mapped", [103]], [[120205, 120205], "mapped", [104]], [[120206, 120206], "mapped", [105]], [[120207, 120207], "mapped", [106]], [[120208, 120208], "mapped", [107]], [[120209, 120209], "mapped", [108]], [[120210, 120210], "mapped", [109]], [[120211, 120211], "mapped", [110]], [[120212, 120212], "mapped", [111]], [[120213, 120213], "mapped", [112]], [[120214, 120214], "mapped", [113]], [[120215, 120215], "mapped", [114]], [[120216, 120216], "mapped", [115]], [[120217, 120217], "mapped", [116]], [[120218, 120218], "mapped", [117]], [[120219, 120219], "mapped", [118]], [[120220, 120220], "mapped", [119]], [[120221, 120221], "mapped", [120]], [[120222, 120222], "mapped", [121]], [[120223, 120223], "mapped", [122]], [[120224, 120224], "mapped", [97]], [[120225, 120225], "mapped", [98]], [[120226, 120226], "mapped", [99]], [[120227, 120227], "mapped", [100]], [[120228, 120228], "mapped", [101]], [[120229, 120229], "mapped", [102]], [[120230, 120230], "mapped", [103]], [[120231, 120231], "mapped", [104]], [[120232, 120232], "mapped", [105]], [[120233, 120233], "mapped", [106]], [[120234, 120234], "mapped", [107]], [[120235, 120235], "mapped", [108]], [[120236, 120236], "mapped", [109]], [[120237, 120237], "mapped", [110]], [[120238, 120238], "mapped", [111]], [[120239, 120239], "mapped", [112]], [[120240, 120240], "mapped", [113]], [[120241, 120241], "mapped", [114]], [[120242, 120242], "mapped", [115]], [[120243, 120243], "mapped", [116]], [[120244, 120244], "mapped", [117]], [[120245, 120245], "mapped", [118]], [[120246, 120246], "mapped", [119]], [[120247, 120247], "mapped", [120]], [[120248, 120248], "mapped", [121]], [[120249, 120249], "mapped", [122]], [[120250, 120250], "mapped", [97]], [[120251, 120251], "mapped", [98]], [[120252, 120252], "mapped", [99]], [[120253, 120253], "mapped", [100]], [[120254, 120254], "mapped", [101]], [[120255, 120255], "mapped", [102]], [[120256, 120256], "mapped", [103]], [[120257, 120257], "mapped", [104]], [[120258, 120258], "mapped", [105]], [[120259, 120259], "mapped", [106]], [[120260, 120260], "mapped", [107]], [[120261, 120261], "mapped", [108]], [[120262, 120262], "mapped", [109]], [[120263, 120263], "mapped", [110]], [[120264, 120264], "mapped", [111]], [[120265, 120265], "mapped", [112]], [[120266, 120266], "mapped", [113]], [[120267, 120267], "mapped", [114]], [[120268, 120268], "mapped", [115]], [[120269, 120269], "mapped", [116]], [[120270, 120270], "mapped", [117]], [[120271, 120271], "mapped", [118]], [[120272, 120272], "mapped", [119]], [[120273, 120273], "mapped", [120]], [[120274, 120274], "mapped", [121]], [[120275, 120275], "mapped", [122]], [[120276, 120276], "mapped", [97]], [[120277, 120277], "mapped", [98]], [[120278, 120278], "mapped", [99]], [[120279, 120279], "mapped", [100]], [[120280, 120280], "mapped", [101]], [[120281, 120281], "mapped", [102]], [[120282, 120282], "mapped", [103]], [[120283, 120283], "mapped", [104]], [[120284, 120284], "mapped", [105]], [[120285, 120285], "mapped", [106]], [[120286, 120286], "mapped", [107]], [[120287, 120287], "mapped", [108]], [[120288, 120288], "mapped", [109]], [[120289, 120289], "mapped", [110]], [[120290, 120290], "mapped", [111]], [[120291, 120291], "mapped", [112]], [[120292, 120292], "mapped", [113]], [[120293, 120293], "mapped", [114]], [[120294, 120294], "mapped", [115]], [[120295, 120295], "mapped", [116]], [[120296, 120296], "mapped", [117]], [[120297, 120297], "mapped", [118]], [[120298, 120298], "mapped", [119]], [[120299, 120299], "mapped", [120]], [[120300, 120300], "mapped", [121]], [[120301, 120301], "mapped", [122]], [[120302, 120302], "mapped", [97]], [[120303, 120303], "mapped", [98]], [[120304, 120304], "mapped", [99]], [[120305, 120305], "mapped", [100]], [[120306, 120306], "mapped", [101]], [[120307, 120307], "mapped", [102]], [[120308, 120308], "mapped", [103]], [[120309, 120309], "mapped", [104]], [[120310, 120310], "mapped", [105]], [[120311, 120311], "mapped", [106]], [[120312, 120312], "mapped", [107]], [[120313, 120313], "mapped", [108]], [[120314, 120314], "mapped", [109]], [[120315, 120315], "mapped", [110]], [[120316, 120316], "mapped", [111]], [[120317, 120317], "mapped", [112]], [[120318, 120318], "mapped", [113]], [[120319, 120319], "mapped", [114]], [[120320, 120320], "mapped", [115]], [[120321, 120321], "mapped", [116]], [[120322, 120322], "mapped", [117]], [[120323, 120323], "mapped", [118]], [[120324, 120324], "mapped", [119]], [[120325, 120325], "mapped", [120]], [[120326, 120326], "mapped", [121]], [[120327, 120327], "mapped", [122]], [[120328, 120328], "mapped", [97]], [[120329, 120329], "mapped", [98]], [[120330, 120330], "mapped", [99]], [[120331, 120331], "mapped", [100]], [[120332, 120332], "mapped", [101]], [[120333, 120333], "mapped", [102]], [[120334, 120334], "mapped", [103]], [[120335, 120335], "mapped", [104]], [[120336, 120336], "mapped", [105]], [[120337, 120337], "mapped", [106]], [[120338, 120338], "mapped", [107]], [[120339, 120339], "mapped", [108]], [[120340, 120340], "mapped", [109]], [[120341, 120341], "mapped", [110]], [[120342, 120342], "mapped", [111]], [[120343, 120343], "mapped", [112]], [[120344, 120344], "mapped", [113]], [[120345, 120345], "mapped", [114]], [[120346, 120346], "mapped", [115]], [[120347, 120347], "mapped", [116]], [[120348, 120348], "mapped", [117]], [[120349, 120349], "mapped", [118]], [[120350, 120350], "mapped", [119]], [[120351, 120351], "mapped", [120]], [[120352, 120352], "mapped", [121]], [[120353, 120353], "mapped", [122]], [[120354, 120354], "mapped", [97]], [[120355, 120355], "mapped", [98]], [[120356, 120356], "mapped", [99]], [[120357, 120357], "mapped", [100]], [[120358, 120358], "mapped", [101]], [[120359, 120359], "mapped", [102]], [[120360, 120360], "mapped", [103]], [[120361, 120361], "mapped", [104]], [[120362, 120362], "mapped", [105]], [[120363, 120363], "mapped", [106]], [[120364, 120364], "mapped", [107]], [[120365, 120365], "mapped", [108]], [[120366, 120366], "mapped", [109]], [[120367, 120367], "mapped", [110]], [[120368, 120368], "mapped", [111]], [[120369, 120369], "mapped", [112]], [[120370, 120370], "mapped", [113]], [[120371, 120371], "mapped", [114]], [[120372, 120372], "mapped", [115]], [[120373, 120373], "mapped", [116]], [[120374, 120374], "mapped", [117]], [[120375, 120375], "mapped", [118]], [[120376, 120376], "mapped", [119]], [[120377, 120377], "mapped", [120]], [[120378, 120378], "mapped", [121]], [[120379, 120379], "mapped", [122]], [[120380, 120380], "mapped", [97]], [[120381, 120381], "mapped", [98]], [[120382, 120382], "mapped", [99]], [[120383, 120383], "mapped", [100]], [[120384, 120384], "mapped", [101]], [[120385, 120385], "mapped", [102]], [[120386, 120386], "mapped", [103]], [[120387, 120387], "mapped", [104]], [[120388, 120388], "mapped", [105]], [[120389, 120389], "mapped", [106]], [[120390, 120390], "mapped", [107]], [[120391, 120391], "mapped", [108]], [[120392, 120392], "mapped", [109]], [[120393, 120393], "mapped", [110]], [[120394, 120394], "mapped", [111]], [[120395, 120395], "mapped", [112]], [[120396, 120396], "mapped", [113]], [[120397, 120397], "mapped", [114]], [[120398, 120398], "mapped", [115]], [[120399, 120399], "mapped", [116]], [[120400, 120400], "mapped", [117]], [[120401, 120401], "mapped", [118]], [[120402, 120402], "mapped", [119]], [[120403, 120403], "mapped", [120]], [[120404, 120404], "mapped", [121]], [[120405, 120405], "mapped", [122]], [[120406, 120406], "mapped", [97]], [[120407, 120407], "mapped", [98]], [[120408, 120408], "mapped", [99]], [[120409, 120409], "mapped", [100]], [[120410, 120410], "mapped", [101]], [[120411, 120411], "mapped", [102]], [[120412, 120412], "mapped", [103]], [[120413, 120413], "mapped", [104]], [[120414, 120414], "mapped", [105]], [[120415, 120415], "mapped", [106]], [[120416, 120416], "mapped", [107]], [[120417, 120417], "mapped", [108]], [[120418, 120418], "mapped", [109]], [[120419, 120419], "mapped", [110]], [[120420, 120420], "mapped", [111]], [[120421, 120421], "mapped", [112]], [[120422, 120422], "mapped", [113]], [[120423, 120423], "mapped", [114]], [[120424, 120424], "mapped", [115]], [[120425, 120425], "mapped", [116]], [[120426, 120426], "mapped", [117]], [[120427, 120427], "mapped", [118]], [[120428, 120428], "mapped", [119]], [[120429, 120429], "mapped", [120]], [[120430, 120430], "mapped", [121]], [[120431, 120431], "mapped", [122]], [[120432, 120432], "mapped", [97]], [[120433, 120433], "mapped", [98]], [[120434, 120434], "mapped", [99]], [[120435, 120435], "mapped", [100]], [[120436, 120436], "mapped", [101]], [[120437, 120437], "mapped", [102]], [[120438, 120438], "mapped", [103]], [[120439, 120439], "mapped", [104]], [[120440, 120440], "mapped", [105]], [[120441, 120441], "mapped", [106]], [[120442, 120442], "mapped", [107]], [[120443, 120443], "mapped", [108]], [[120444, 120444], "mapped", [109]], [[120445, 120445], "mapped", [110]], [[120446, 120446], "mapped", [111]], [[120447, 120447], "mapped", [112]], [[120448, 120448], "mapped", [113]], [[120449, 120449], "mapped", [114]], [[120450, 120450], "mapped", [115]], [[120451, 120451], "mapped", [116]], [[120452, 120452], "mapped", [117]], [[120453, 120453], "mapped", [118]], [[120454, 120454], "mapped", [119]], [[120455, 120455], "mapped", [120]], [[120456, 120456], "mapped", [121]], [[120457, 120457], "mapped", [122]], [[120458, 120458], "mapped", [97]], [[120459, 120459], "mapped", [98]], [[120460, 120460], "mapped", [99]], [[120461, 120461], "mapped", [100]], [[120462, 120462], "mapped", [101]], [[120463, 120463], "mapped", [102]], [[120464, 120464], "mapped", [103]], [[120465, 120465], "mapped", [104]], [[120466, 120466], "mapped", [105]], [[120467, 120467], "mapped", [106]], [[120468, 120468], "mapped", [107]], [[120469, 120469], "mapped", [108]], [[120470, 120470], "mapped", [109]], [[120471, 120471], "mapped", [110]], [[120472, 120472], "mapped", [111]], [[120473, 120473], "mapped", [112]], [[120474, 120474], "mapped", [113]], [[120475, 120475], "mapped", [114]], [[120476, 120476], "mapped", [115]], [[120477, 120477], "mapped", [116]], [[120478, 120478], "mapped", [117]], [[120479, 120479], "mapped", [118]], [[120480, 120480], "mapped", [119]], [[120481, 120481], "mapped", [120]], [[120482, 120482], "mapped", [121]], [[120483, 120483], "mapped", [122]], [[120484, 120484], "mapped", [305]], [[120485, 120485], "mapped", [567]], [[120486, 120487], "disallowed"], [[120488, 120488], "mapped", [945]], [[120489, 120489], "mapped", [946]], [[120490, 120490], "mapped", [947]], [[120491, 120491], "mapped", [948]], [[120492, 120492], "mapped", [949]], [[120493, 120493], "mapped", [950]], [[120494, 120494], "mapped", [951]], [[120495, 120495], "mapped", [952]], [[120496, 120496], "mapped", [953]], [[120497, 120497], "mapped", [954]], [[120498, 120498], "mapped", [955]], [[120499, 120499], "mapped", [956]], [[120500, 120500], "mapped", [957]], [[120501, 120501], "mapped", [958]], [[120502, 120502], "mapped", [959]], [[120503, 120503], "mapped", [960]], [[120504, 120504], "mapped", [961]], [[120505, 120505], "mapped", [952]], [[120506, 120506], "mapped", [963]], [[120507, 120507], "mapped", [964]], [[120508, 120508], "mapped", [965]], [[120509, 120509], "mapped", [966]], [[120510, 120510], "mapped", [967]], [[120511, 120511], "mapped", [968]], [[120512, 120512], "mapped", [969]], [[120513, 120513], "mapped", [8711]], [[120514, 120514], "mapped", [945]], [[120515, 120515], "mapped", [946]], [[120516, 120516], "mapped", [947]], [[120517, 120517], "mapped", [948]], [[120518, 120518], "mapped", [949]], [[120519, 120519], "mapped", [950]], [[120520, 120520], "mapped", [951]], [[120521, 120521], "mapped", [952]], [[120522, 120522], "mapped", [953]], [[120523, 120523], "mapped", [954]], [[120524, 120524], "mapped", [955]], [[120525, 120525], "mapped", [956]], [[120526, 120526], "mapped", [957]], [[120527, 120527], "mapped", [958]], [[120528, 120528], "mapped", [959]], [[120529, 120529], "mapped", [960]], [[120530, 120530], "mapped", [961]], [[120531, 120532], "mapped", [963]], [[120533, 120533], "mapped", [964]], [[120534, 120534], "mapped", [965]], [[120535, 120535], "mapped", [966]], [[120536, 120536], "mapped", [967]], [[120537, 120537], "mapped", [968]], [[120538, 120538], "mapped", [969]], [[120539, 120539], "mapped", [8706]], [[120540, 120540], "mapped", [949]], [[120541, 120541], "mapped", [952]], [[120542, 120542], "mapped", [954]], [[120543, 120543], "mapped", [966]], [[120544, 120544], "mapped", [961]], [[120545, 120545], "mapped", [960]], [[120546, 120546], "mapped", [945]], [[120547, 120547], "mapped", [946]], [[120548, 120548], "mapped", [947]], [[120549, 120549], "mapped", [948]], [[120550, 120550], "mapped", [949]], [[120551, 120551], "mapped", [950]], [[120552, 120552], "mapped", [951]], [[120553, 120553], "mapped", [952]], [[120554, 120554], "mapped", [953]], [[120555, 120555], "mapped", [954]], [[120556, 120556], "mapped", [955]], [[120557, 120557], "mapped", [956]], [[120558, 120558], "mapped", [957]], [[120559, 120559], "mapped", [958]], [[120560, 120560], "mapped", [959]], [[120561, 120561], "mapped", [960]], [[120562, 120562], "mapped", [961]], [[120563, 120563], "mapped", [952]], [[120564, 120564], "mapped", [963]], [[120565, 120565], "mapped", [964]], [[120566, 120566], "mapped", [965]], [[120567, 120567], "mapped", [966]], [[120568, 120568], "mapped", [967]], [[120569, 120569], "mapped", [968]], [[120570, 120570], "mapped", [969]], [[120571, 120571], "mapped", [8711]], [[120572, 120572], "mapped", [945]], [[120573, 120573], "mapped", [946]], [[120574, 120574], "mapped", [947]], [[120575, 120575], "mapped", [948]], [[120576, 120576], "mapped", [949]], [[120577, 120577], "mapped", [950]], [[120578, 120578], "mapped", [951]], [[120579, 120579], "mapped", [952]], [[120580, 120580], "mapped", [953]], [[120581, 120581], "mapped", [954]], [[120582, 120582], "mapped", [955]], [[120583, 120583], "mapped", [956]], [[120584, 120584], "mapped", [957]], [[120585, 120585], "mapped", [958]], [[120586, 120586], "mapped", [959]], [[120587, 120587], "mapped", [960]], [[120588, 120588], "mapped", [961]], [[120589, 120590], "mapped", [963]], [[120591, 120591], "mapped", [964]], [[120592, 120592], "mapped", [965]], [[120593, 120593], "mapped", [966]], [[120594, 120594], "mapped", [967]], [[120595, 120595], "mapped", [968]], [[120596, 120596], "mapped", [969]], [[120597, 120597], "mapped", [8706]], [[120598, 120598], "mapped", [949]], [[120599, 120599], "mapped", [952]], [[120600, 120600], "mapped", [954]], [[120601, 120601], "mapped", [966]], [[120602, 120602], "mapped", [961]], [[120603, 120603], "mapped", [960]], [[120604, 120604], "mapped", [945]], [[120605, 120605], "mapped", [946]], [[120606, 120606], "mapped", [947]], [[120607, 120607], "mapped", [948]], [[120608, 120608], "mapped", [949]], [[120609, 120609], "mapped", [950]], [[120610, 120610], "mapped", [951]], [[120611, 120611], "mapped", [952]], [[120612, 120612], "mapped", [953]], [[120613, 120613], "mapped", [954]], [[120614, 120614], "mapped", [955]], [[120615, 120615], "mapped", [956]], [[120616, 120616], "mapped", [957]], [[120617, 120617], "mapped", [958]], [[120618, 120618], "mapped", [959]], [[120619, 120619], "mapped", [960]], [[120620, 120620], "mapped", [961]], [[120621, 120621], "mapped", [952]], [[120622, 120622], "mapped", [963]], [[120623, 120623], "mapped", [964]], [[120624, 120624], "mapped", [965]], [[120625, 120625], "mapped", [966]], [[120626, 120626], "mapped", [967]], [[120627, 120627], "mapped", [968]], [[120628, 120628], "mapped", [969]], [[120629, 120629], "mapped", [8711]], [[120630, 120630], "mapped", [945]], [[120631, 120631], "mapped", [946]], [[120632, 120632], "mapped", [947]], [[120633, 120633], "mapped", [948]], [[120634, 120634], "mapped", [949]], [[120635, 120635], "mapped", [950]], [[120636, 120636], "mapped", [951]], [[120637, 120637], "mapped", [952]], [[120638, 120638], "mapped", [953]], [[120639, 120639], "mapped", [954]], [[120640, 120640], "mapped", [955]], [[120641, 120641], "mapped", [956]], [[120642, 120642], "mapped", [957]], [[120643, 120643], "mapped", [958]], [[120644, 120644], "mapped", [959]], [[120645, 120645], "mapped", [960]], [[120646, 120646], "mapped", [961]], [[120647, 120648], "mapped", [963]], [[120649, 120649], "mapped", [964]], [[120650, 120650], "mapped", [965]], [[120651, 120651], "mapped", [966]], [[120652, 120652], "mapped", [967]], [[120653, 120653], "mapped", [968]], [[120654, 120654], "mapped", [969]], [[120655, 120655], "mapped", [8706]], [[120656, 120656], "mapped", [949]], [[120657, 120657], "mapped", [952]], [[120658, 120658], "mapped", [954]], [[120659, 120659], "mapped", [966]], [[120660, 120660], "mapped", [961]], [[120661, 120661], "mapped", [960]], [[120662, 120662], "mapped", [945]], [[120663, 120663], "mapped", [946]], [[120664, 120664], "mapped", [947]], [[120665, 120665], "mapped", [948]], [[120666, 120666], "mapped", [949]], [[120667, 120667], "mapped", [950]], [[120668, 120668], "mapped", [951]], [[120669, 120669], "mapped", [952]], [[120670, 120670], "mapped", [953]], [[120671, 120671], "mapped", [954]], [[120672, 120672], "mapped", [955]], [[120673, 120673], "mapped", [956]], [[120674, 120674], "mapped", [957]], [[120675, 120675], "mapped", [958]], [[120676, 120676], "mapped", [959]], [[120677, 120677], "mapped", [960]], [[120678, 120678], "mapped", [961]], [[120679, 120679], "mapped", [952]], [[120680, 120680], "mapped", [963]], [[120681, 120681], "mapped", [964]], [[120682, 120682], "mapped", [965]], [[120683, 120683], "mapped", [966]], [[120684, 120684], "mapped", [967]], [[120685, 120685], "mapped", [968]], [[120686, 120686], "mapped", [969]], [[120687, 120687], "mapped", [8711]], [[120688, 120688], "mapped", [945]], [[120689, 120689], "mapped", [946]], [[120690, 120690], "mapped", [947]], [[120691, 120691], "mapped", [948]], [[120692, 120692], "mapped", [949]], [[120693, 120693], "mapped", [950]], [[120694, 120694], "mapped", [951]], [[120695, 120695], "mapped", [952]], [[120696, 120696], "mapped", [953]], [[120697, 120697], "mapped", [954]], [[120698, 120698], "mapped", [955]], [[120699, 120699], "mapped", [956]], [[120700, 120700], "mapped", [957]], [[120701, 120701], "mapped", [958]], [[120702, 120702], "mapped", [959]], [[120703, 120703], "mapped", [960]], [[120704, 120704], "mapped", [961]], [[120705, 120706], "mapped", [963]], [[120707, 120707], "mapped", [964]], [[120708, 120708], "mapped", [965]], [[120709, 120709], "mapped", [966]], [[120710, 120710], "mapped", [967]], [[120711, 120711], "mapped", [968]], [[120712, 120712], "mapped", [969]], [[120713, 120713], "mapped", [8706]], [[120714, 120714], "mapped", [949]], [[120715, 120715], "mapped", [952]], [[120716, 120716], "mapped", [954]], [[120717, 120717], "mapped", [966]], [[120718, 120718], "mapped", [961]], [[120719, 120719], "mapped", [960]], [[120720, 120720], "mapped", [945]], [[120721, 120721], "mapped", [946]], [[120722, 120722], "mapped", [947]], [[120723, 120723], "mapped", [948]], [[120724, 120724], "mapped", [949]], [[120725, 120725], "mapped", [950]], [[120726, 120726], "mapped", [951]], [[120727, 120727], "mapped", [952]], [[120728, 120728], "mapped", [953]], [[120729, 120729], "mapped", [954]], [[120730, 120730], "mapped", [955]], [[120731, 120731], "mapped", [956]], [[120732, 120732], "mapped", [957]], [[120733, 120733], "mapped", [958]], [[120734, 120734], "mapped", [959]], [[120735, 120735], "mapped", [960]], [[120736, 120736], "mapped", [961]], [[120737, 120737], "mapped", [952]], [[120738, 120738], "mapped", [963]], [[120739, 120739], "mapped", [964]], [[120740, 120740], "mapped", [965]], [[120741, 120741], "mapped", [966]], [[120742, 120742], "mapped", [967]], [[120743, 120743], "mapped", [968]], [[120744, 120744], "mapped", [969]], [[120745, 120745], "mapped", [8711]], [[120746, 120746], "mapped", [945]], [[120747, 120747], "mapped", [946]], [[120748, 120748], "mapped", [947]], [[120749, 120749], "mapped", [948]], [[120750, 120750], "mapped", [949]], [[120751, 120751], "mapped", [950]], [[120752, 120752], "mapped", [951]], [[120753, 120753], "mapped", [952]], [[120754, 120754], "mapped", [953]], [[120755, 120755], "mapped", [954]], [[120756, 120756], "mapped", [955]], [[120757, 120757], "mapped", [956]], [[120758, 120758], "mapped", [957]], [[120759, 120759], "mapped", [958]], [[120760, 120760], "mapped", [959]], [[120761, 120761], "mapped", [960]], [[120762, 120762], "mapped", [961]], [[120763, 120764], "mapped", [963]], [[120765, 120765], "mapped", [964]], [[120766, 120766], "mapped", [965]], [[120767, 120767], "mapped", [966]], [[120768, 120768], "mapped", [967]], [[120769, 120769], "mapped", [968]], [[120770, 120770], "mapped", [969]], [[120771, 120771], "mapped", [8706]], [[120772, 120772], "mapped", [949]], [[120773, 120773], "mapped", [952]], [[120774, 120774], "mapped", [954]], [[120775, 120775], "mapped", [966]], [[120776, 120776], "mapped", [961]], [[120777, 120777], "mapped", [960]], [[120778, 120779], "mapped", [989]], [[120780, 120781], "disallowed"], [[120782, 120782], "mapped", [48]], [[120783, 120783], "mapped", [49]], [[120784, 120784], "mapped", [50]], [[120785, 120785], "mapped", [51]], [[120786, 120786], "mapped", [52]], [[120787, 120787], "mapped", [53]], [[120788, 120788], "mapped", [54]], [[120789, 120789], "mapped", [55]], [[120790, 120790], "mapped", [56]], [[120791, 120791], "mapped", [57]], [[120792, 120792], "mapped", [48]], [[120793, 120793], "mapped", [49]], [[120794, 120794], "mapped", [50]], [[120795, 120795], "mapped", [51]], [[120796, 120796], "mapped", [52]], [[120797, 120797], "mapped", [53]], [[120798, 120798], "mapped", [54]], [[120799, 120799], "mapped", [55]], [[120800, 120800], "mapped", [56]], [[120801, 120801], "mapped", [57]], [[120802, 120802], "mapped", [48]], [[120803, 120803], "mapped", [49]], [[120804, 120804], "mapped", [50]], [[120805, 120805], "mapped", [51]], [[120806, 120806], "mapped", [52]], [[120807, 120807], "mapped", [53]], [[120808, 120808], "mapped", [54]], [[120809, 120809], "mapped", [55]], [[120810, 120810], "mapped", [56]], [[120811, 120811], "mapped", [57]], [[120812, 120812], "mapped", [48]], [[120813, 120813], "mapped", [49]], [[120814, 120814], "mapped", [50]], [[120815, 120815], "mapped", [51]], [[120816, 120816], "mapped", [52]], [[120817, 120817], "mapped", [53]], [[120818, 120818], "mapped", [54]], [[120819, 120819], "mapped", [55]], [[120820, 120820], "mapped", [56]], [[120821, 120821], "mapped", [57]], [[120822, 120822], "mapped", [48]], [[120823, 120823], "mapped", [49]], [[120824, 120824], "mapped", [50]], [[120825, 120825], "mapped", [51]], [[120826, 120826], "mapped", [52]], [[120827, 120827], "mapped", [53]], [[120828, 120828], "mapped", [54]], [[120829, 120829], "mapped", [55]], [[120830, 120830], "mapped", [56]], [[120831, 120831], "mapped", [57]], [[120832, 121343], "valid", [], "NV8"], [[121344, 121398], "valid"], [[121399, 121402], "valid", [], "NV8"], [[121403, 121452], "valid"], [[121453, 121460], "valid", [], "NV8"], [[121461, 121461], "valid"], [[121462, 121475], "valid", [], "NV8"], [[121476, 121476], "valid"], [[121477, 121483], "valid", [], "NV8"], [[121484, 121498], "disallowed"], [[121499, 121503], "valid"], [[121504, 121504], "disallowed"], [[121505, 121519], "valid"], [[121520, 124927], "disallowed"], [[124928, 125124], "valid"], [[125125, 125126], "disallowed"], [[125127, 125135], "valid", [], "NV8"], [[125136, 125142], "valid"], [[125143, 126463], "disallowed"], [[126464, 126464], "mapped", [1575]], [[126465, 126465], "mapped", [1576]], [[126466, 126466], "mapped", [1580]], [[126467, 126467], "mapped", [1583]], [[126468, 126468], "disallowed"], [[126469, 126469], "mapped", [1608]], [[126470, 126470], "mapped", [1586]], [[126471, 126471], "mapped", [1581]], [[126472, 126472], "mapped", [1591]], [[126473, 126473], "mapped", [1610]], [[126474, 126474], "mapped", [1603]], [[126475, 126475], "mapped", [1604]], [[126476, 126476], "mapped", [1605]], [[126477, 126477], "mapped", [1606]], [[126478, 126478], "mapped", [1587]], [[126479, 126479], "mapped", [1593]], [[126480, 126480], "mapped", [1601]], [[126481, 126481], "mapped", [1589]], [[126482, 126482], "mapped", [1602]], [[126483, 126483], "mapped", [1585]], [[126484, 126484], "mapped", [1588]], [[126485, 126485], "mapped", [1578]], [[126486, 126486], "mapped", [1579]], [[126487, 126487], "mapped", [1582]], [[126488, 126488], "mapped", [1584]], [[126489, 126489], "mapped", [1590]], [[126490, 126490], "mapped", [1592]], [[126491, 126491], "mapped", [1594]], [[126492, 126492], "mapped", [1646]], [[126493, 126493], "mapped", [1722]], [[126494, 126494], "mapped", [1697]], [[126495, 126495], "mapped", [1647]], [[126496, 126496], "disallowed"], [[126497, 126497], "mapped", [1576]], [[126498, 126498], "mapped", [1580]], [[126499, 126499], "disallowed"], [[126500, 126500], "mapped", [1607]], [[126501, 126502], "disallowed"], [[126503, 126503], "mapped", [1581]], [[126504, 126504], "disallowed"], [[126505, 126505], "mapped", [1610]], [[126506, 126506], "mapped", [1603]], [[126507, 126507], "mapped", [1604]], [[126508, 126508], "mapped", [1605]], [[126509, 126509], "mapped", [1606]], [[126510, 126510], "mapped", [1587]], [[126511, 126511], "mapped", [1593]], [[126512, 126512], "mapped", [1601]], [[126513, 126513], "mapped", [1589]], [[126514, 126514], "mapped", [1602]], [[126515, 126515], "disallowed"], [[126516, 126516], "mapped", [1588]], [[126517, 126517], "mapped", [1578]], [[126518, 126518], "mapped", [1579]], [[126519, 126519], "mapped", [1582]], [[126520, 126520], "disallowed"], [[126521, 126521], "mapped", [1590]], [[126522, 126522], "disallowed"], [[126523, 126523], "mapped", [1594]], [[126524, 126529], "disallowed"], [[126530, 126530], "mapped", [1580]], [[126531, 126534], "disallowed"], [[126535, 126535], "mapped", [1581]], [[126536, 126536], "disallowed"], [[126537, 126537], "mapped", [1610]], [[126538, 126538], "disallowed"], [[126539, 126539], "mapped", [1604]], [[126540, 126540], "disallowed"], [[126541, 126541], "mapped", [1606]], [[126542, 126542], "mapped", [1587]], [[126543, 126543], "mapped", [1593]], [[126544, 126544], "disallowed"], [[126545, 126545], "mapped", [1589]], [[126546, 126546], "mapped", [1602]], [[126547, 126547], "disallowed"], [[126548, 126548], "mapped", [1588]], [[126549, 126550], "disallowed"], [[126551, 126551], "mapped", [1582]], [[126552, 126552], "disallowed"], [[126553, 126553], "mapped", [1590]], [[126554, 126554], "disallowed"], [[126555, 126555], "mapped", [1594]], [[126556, 126556], "disallowed"], [[126557, 126557], "mapped", [1722]], [[126558, 126558], "disallowed"], [[126559, 126559], "mapped", [1647]], [[126560, 126560], "disallowed"], [[126561, 126561], "mapped", [1576]], [[126562, 126562], "mapped", [1580]], [[126563, 126563], "disallowed"], [[126564, 126564], "mapped", [1607]], [[126565, 126566], "disallowed"], [[126567, 126567], "mapped", [1581]], [[126568, 126568], "mapped", [1591]], [[126569, 126569], "mapped", [1610]], [[126570, 126570], "mapped", [1603]], [[126571, 126571], "disallowed"], [[126572, 126572], "mapped", [1605]], [[126573, 126573], "mapped", [1606]], [[126574, 126574], "mapped", [1587]], [[126575, 126575], "mapped", [1593]], [[126576, 126576], "mapped", [1601]], [[126577, 126577], "mapped", [1589]], [[126578, 126578], "mapped", [1602]], [[126579, 126579], "disallowed"], [[126580, 126580], "mapped", [1588]], [[126581, 126581], "mapped", [1578]], [[126582, 126582], "mapped", [1579]], [[126583, 126583], "mapped", [1582]], [[126584, 126584], "disallowed"], [[126585, 126585], "mapped", [1590]], [[126586, 126586], "mapped", [1592]], [[126587, 126587], "mapped", [1594]], [[126588, 126588], "mapped", [1646]], [[126589, 126589], "disallowed"], [[126590, 126590], "mapped", [1697]], [[126591, 126591], "disallowed"], [[126592, 126592], "mapped", [1575]], [[126593, 126593], "mapped", [1576]], [[126594, 126594], "mapped", [1580]], [[126595, 126595], "mapped", [1583]], [[126596, 126596], "mapped", [1607]], [[126597, 126597], "mapped", [1608]], [[126598, 126598], "mapped", [1586]], [[126599, 126599], "mapped", [1581]], [[126600, 126600], "mapped", [1591]], [[126601, 126601], "mapped", [1610]], [[126602, 126602], "disallowed"], [[126603, 126603], "mapped", [1604]], [[126604, 126604], "mapped", [1605]], [[126605, 126605], "mapped", [1606]], [[126606, 126606], "mapped", [1587]], [[126607, 126607], "mapped", [1593]], [[126608, 126608], "mapped", [1601]], [[126609, 126609], "mapped", [1589]], [[126610, 126610], "mapped", [1602]], [[126611, 126611], "mapped", [1585]], [[126612, 126612], "mapped", [1588]], [[126613, 126613], "mapped", [1578]], [[126614, 126614], "mapped", [1579]], [[126615, 126615], "mapped", [1582]], [[126616, 126616], "mapped", [1584]], [[126617, 126617], "mapped", [1590]], [[126618, 126618], "mapped", [1592]], [[126619, 126619], "mapped", [1594]], [[126620, 126624], "disallowed"], [[126625, 126625], "mapped", [1576]], [[126626, 126626], "mapped", [1580]], [[126627, 126627], "mapped", [1583]], [[126628, 126628], "disallowed"], [[126629, 126629], "mapped", [1608]], [[126630, 126630], "mapped", [1586]], [[126631, 126631], "mapped", [1581]], [[126632, 126632], "mapped", [1591]], [[126633, 126633], "mapped", [1610]], [[126634, 126634], "disallowed"], [[126635, 126635], "mapped", [1604]], [[126636, 126636], "mapped", [1605]], [[126637, 126637], "mapped", [1606]], [[126638, 126638], "mapped", [1587]], [[126639, 126639], "mapped", [1593]], [[126640, 126640], "mapped", [1601]], [[126641, 126641], "mapped", [1589]], [[126642, 126642], "mapped", [1602]], [[126643, 126643], "mapped", [1585]], [[126644, 126644], "mapped", [1588]], [[126645, 126645], "mapped", [1578]], [[126646, 126646], "mapped", [1579]], [[126647, 126647], "mapped", [1582]], [[126648, 126648], "mapped", [1584]], [[126649, 126649], "mapped", [1590]], [[126650, 126650], "mapped", [1592]], [[126651, 126651], "mapped", [1594]], [[126652, 126703], "disallowed"], [[126704, 126705], "valid", [], "NV8"], [[126706, 126975], "disallowed"], [[126976, 127019], "valid", [], "NV8"], [[127020, 127023], "disallowed"], [[127024, 127123], "valid", [], "NV8"], [[127124, 127135], "disallowed"], [[127136, 127150], "valid", [], "NV8"], [[127151, 127152], "disallowed"], [[127153, 127166], "valid", [], "NV8"], [[127167, 127167], "valid", [], "NV8"], [[127168, 127168], "disallowed"], [[127169, 127183], "valid", [], "NV8"], [[127184, 127184], "disallowed"], [[127185, 127199], "valid", [], "NV8"], [[127200, 127221], "valid", [], "NV8"], [[127222, 127231], "disallowed"], [[127232, 127232], "disallowed"], [[127233, 127233], "disallowed_STD3_mapped", [48, 44]], [[127234, 127234], "disallowed_STD3_mapped", [49, 44]], [[127235, 127235], "disallowed_STD3_mapped", [50, 44]], [[127236, 127236], "disallowed_STD3_mapped", [51, 44]], [[127237, 127237], "disallowed_STD3_mapped", [52, 44]], [[127238, 127238], "disallowed_STD3_mapped", [53, 44]], [[127239, 127239], "disallowed_STD3_mapped", [54, 44]], [[127240, 127240], "disallowed_STD3_mapped", [55, 44]], [[127241, 127241], "disallowed_STD3_mapped", [56, 44]], [[127242, 127242], "disallowed_STD3_mapped", [57, 44]], [[127243, 127244], "valid", [], "NV8"], [[127245, 127247], "disallowed"], [[127248, 127248], "disallowed_STD3_mapped", [40, 97, 41]], [[127249, 127249], "disallowed_STD3_mapped", [40, 98, 41]], [[127250, 127250], "disallowed_STD3_mapped", [40, 99, 41]], [[127251, 127251], "disallowed_STD3_mapped", [40, 100, 41]], [[127252, 127252], "disallowed_STD3_mapped", [40, 101, 41]], [[127253, 127253], "disallowed_STD3_mapped", [40, 102, 41]], [[127254, 127254], "disallowed_STD3_mapped", [40, 103, 41]], [[127255, 127255], "disallowed_STD3_mapped", [40, 104, 41]], [[127256, 127256], "disallowed_STD3_mapped", [40, 105, 41]], [[127257, 127257], "disallowed_STD3_mapped", [40, 106, 41]], [[127258, 127258], "disallowed_STD3_mapped", [40, 107, 41]], [[127259, 127259], "disallowed_STD3_mapped", [40, 108, 41]], [[127260, 127260], "disallowed_STD3_mapped", [40, 109, 41]], [[127261, 127261], "disallowed_STD3_mapped", [40, 110, 41]], [[127262, 127262], "disallowed_STD3_mapped", [40, 111, 41]], [[127263, 127263], "disallowed_STD3_mapped", [40, 112, 41]], [[127264, 127264], "disallowed_STD3_mapped", [40, 113, 41]], [[127265, 127265], "disallowed_STD3_mapped", [40, 114, 41]], [[127266, 127266], "disallowed_STD3_mapped", [40, 115, 41]], [[127267, 127267], "disallowed_STD3_mapped", [40, 116, 41]], [[127268, 127268], "disallowed_STD3_mapped", [40, 117, 41]], [[127269, 127269], "disallowed_STD3_mapped", [40, 118, 41]], [[127270, 127270], "disallowed_STD3_mapped", [40, 119, 41]], [[127271, 127271], "disallowed_STD3_mapped", [40, 120, 41]], [[127272, 127272], "disallowed_STD3_mapped", [40, 121, 41]], [[127273, 127273], "disallowed_STD3_mapped", [40, 122, 41]], [[127274, 127274], "mapped", [12308, 115, 12309]], [[127275, 127275], "mapped", [99]], [[127276, 127276], "mapped", [114]], [[127277, 127277], "mapped", [99, 100]], [[127278, 127278], "mapped", [119, 122]], [[127279, 127279], "disallowed"], [[127280, 127280], "mapped", [97]], [[127281, 127281], "mapped", [98]], [[127282, 127282], "mapped", [99]], [[127283, 127283], "mapped", [100]], [[127284, 127284], "mapped", [101]], [[127285, 127285], "mapped", [102]], [[127286, 127286], "mapped", [103]], [[127287, 127287], "mapped", [104]], [[127288, 127288], "mapped", [105]], [[127289, 127289], "mapped", [106]], [[127290, 127290], "mapped", [107]], [[127291, 127291], "mapped", [108]], [[127292, 127292], "mapped", [109]], [[127293, 127293], "mapped", [110]], [[127294, 127294], "mapped", [111]], [[127295, 127295], "mapped", [112]], [[127296, 127296], "mapped", [113]], [[127297, 127297], "mapped", [114]], [[127298, 127298], "mapped", [115]], [[127299, 127299], "mapped", [116]], [[127300, 127300], "mapped", [117]], [[127301, 127301], "mapped", [118]], [[127302, 127302], "mapped", [119]], [[127303, 127303], "mapped", [120]], [[127304, 127304], "mapped", [121]], [[127305, 127305], "mapped", [122]], [[127306, 127306], "mapped", [104, 118]], [[127307, 127307], "mapped", [109, 118]], [[127308, 127308], "mapped", [115, 100]], [[127309, 127309], "mapped", [115, 115]], [[127310, 127310], "mapped", [112, 112, 118]], [[127311, 127311], "mapped", [119, 99]], [[127312, 127318], "valid", [], "NV8"], [[127319, 127319], "valid", [], "NV8"], [[127320, 127326], "valid", [], "NV8"], [[127327, 127327], "valid", [], "NV8"], [[127328, 127337], "valid", [], "NV8"], [[127338, 127338], "mapped", [109, 99]], [[127339, 127339], "mapped", [109, 100]], [[127340, 127343], "disallowed"], [[127344, 127352], "valid", [], "NV8"], [[127353, 127353], "valid", [], "NV8"], [[127354, 127354], "valid", [], "NV8"], [[127355, 127356], "valid", [], "NV8"], [[127357, 127358], "valid", [], "NV8"], [[127359, 127359], "valid", [], "NV8"], [[127360, 127369], "valid", [], "NV8"], [[127370, 127373], "valid", [], "NV8"], [[127374, 127375], "valid", [], "NV8"], [[127376, 127376], "mapped", [100, 106]], [[127377, 127386], "valid", [], "NV8"], [[127387, 127461], "disallowed"], [[127462, 127487], "valid", [], "NV8"], [[127488, 127488], "mapped", [12411, 12363]], [[127489, 127489], "mapped", [12467, 12467]], [[127490, 127490], "mapped", [12469]], [[127491, 127503], "disallowed"], [[127504, 127504], "mapped", [25163]], [[127505, 127505], "mapped", [23383]], [[127506, 127506], "mapped", [21452]], [[127507, 127507], "mapped", [12487]], [[127508, 127508], "mapped", [20108]], [[127509, 127509], "mapped", [22810]], [[127510, 127510], "mapped", [35299]], [[127511, 127511], "mapped", [22825]], [[127512, 127512], "mapped", [20132]], [[127513, 127513], "mapped", [26144]], [[127514, 127514], "mapped", [28961]], [[127515, 127515], "mapped", [26009]], [[127516, 127516], "mapped", [21069]], [[127517, 127517], "mapped", [24460]], [[127518, 127518], "mapped", [20877]], [[127519, 127519], "mapped", [26032]], [[127520, 127520], "mapped", [21021]], [[127521, 127521], "mapped", [32066]], [[127522, 127522], "mapped", [29983]], [[127523, 127523], "mapped", [36009]], [[127524, 127524], "mapped", [22768]], [[127525, 127525], "mapped", [21561]], [[127526, 127526], "mapped", [28436]], [[127527, 127527], "mapped", [25237]], [[127528, 127528], "mapped", [25429]], [[127529, 127529], "mapped", [19968]], [[127530, 127530], "mapped", [19977]], [[127531, 127531], "mapped", [36938]], [[127532, 127532], "mapped", [24038]], [[127533, 127533], "mapped", [20013]], [[127534, 127534], "mapped", [21491]], [[127535, 127535], "mapped", [25351]], [[127536, 127536], "mapped", [36208]], [[127537, 127537], "mapped", [25171]], [[127538, 127538], "mapped", [31105]], [[127539, 127539], "mapped", [31354]], [[127540, 127540], "mapped", [21512]], [[127541, 127541], "mapped", [28288]], [[127542, 127542], "mapped", [26377]], [[127543, 127543], "mapped", [26376]], [[127544, 127544], "mapped", [30003]], [[127545, 127545], "mapped", [21106]], [[127546, 127546], "mapped", [21942]], [[127547, 127551], "disallowed"], [[127552, 127552], "mapped", [12308, 26412, 12309]], [[127553, 127553], "mapped", [12308, 19977, 12309]], [[127554, 127554], "mapped", [12308, 20108, 12309]], [[127555, 127555], "mapped", [12308, 23433, 12309]], [[127556, 127556], "mapped", [12308, 28857, 12309]], [[127557, 127557], "mapped", [12308, 25171, 12309]], [[127558, 127558], "mapped", [12308, 30423, 12309]], [[127559, 127559], "mapped", [12308, 21213, 12309]], [[127560, 127560], "mapped", [12308, 25943, 12309]], [[127561, 127567], "disallowed"], [[127568, 127568], "mapped", [24471]], [[127569, 127569], "mapped", [21487]], [[127570, 127743], "disallowed"], [[127744, 127776], "valid", [], "NV8"], [[127777, 127788], "valid", [], "NV8"], [[127789, 127791], "valid", [], "NV8"], [[127792, 127797], "valid", [], "NV8"], [[127798, 127798], "valid", [], "NV8"], [[127799, 127868], "valid", [], "NV8"], [[127869, 127869], "valid", [], "NV8"], [[127870, 127871], "valid", [], "NV8"], [[127872, 127891], "valid", [], "NV8"], [[127892, 127903], "valid", [], "NV8"], [[127904, 127940], "valid", [], "NV8"], [[127941, 127941], "valid", [], "NV8"], [[127942, 127946], "valid", [], "NV8"], [[127947, 127950], "valid", [], "NV8"], [[127951, 127955], "valid", [], "NV8"], [[127956, 127967], "valid", [], "NV8"], [[127968, 127984], "valid", [], "NV8"], [[127985, 127991], "valid", [], "NV8"], [[127992, 127999], "valid", [], "NV8"], [[128e3, 128062], "valid", [], "NV8"], [[128063, 128063], "valid", [], "NV8"], [[128064, 128064], "valid", [], "NV8"], [[128065, 128065], "valid", [], "NV8"], [[128066, 128247], "valid", [], "NV8"], [[128248, 128248], "valid", [], "NV8"], [[128249, 128252], "valid", [], "NV8"], [[128253, 128254], "valid", [], "NV8"], [[128255, 128255], "valid", [], "NV8"], [[128256, 128317], "valid", [], "NV8"], [[128318, 128319], "valid", [], "NV8"], [[128320, 128323], "valid", [], "NV8"], [[128324, 128330], "valid", [], "NV8"], [[128331, 128335], "valid", [], "NV8"], [[128336, 128359], "valid", [], "NV8"], [[128360, 128377], "valid", [], "NV8"], [[128378, 128378], "disallowed"], [[128379, 128419], "valid", [], "NV8"], [[128420, 128420], "disallowed"], [[128421, 128506], "valid", [], "NV8"], [[128507, 128511], "valid", [], "NV8"], [[128512, 128512], "valid", [], "NV8"], [[128513, 128528], "valid", [], "NV8"], [[128529, 128529], "valid", [], "NV8"], [[128530, 128532], "valid", [], "NV8"], [[128533, 128533], "valid", [], "NV8"], [[128534, 128534], "valid", [], "NV8"], [[128535, 128535], "valid", [], "NV8"], [[128536, 128536], "valid", [], "NV8"], [[128537, 128537], "valid", [], "NV8"], [[128538, 128538], "valid", [], "NV8"], [[128539, 128539], "valid", [], "NV8"], [[128540, 128542], "valid", [], "NV8"], [[128543, 128543], "valid", [], "NV8"], [[128544, 128549], "valid", [], "NV8"], [[128550, 128551], "valid", [], "NV8"], [[128552, 128555], "valid", [], "NV8"], [[128556, 128556], "valid", [], "NV8"], [[128557, 128557], "valid", [], "NV8"], [[128558, 128559], "valid", [], "NV8"], [[128560, 128563], "valid", [], "NV8"], [[128564, 128564], "valid", [], "NV8"], [[128565, 128576], "valid", [], "NV8"], [[128577, 128578], "valid", [], "NV8"], [[128579, 128580], "valid", [], "NV8"], [[128581, 128591], "valid", [], "NV8"], [[128592, 128639], "valid", [], "NV8"], [[128640, 128709], "valid", [], "NV8"], [[128710, 128719], "valid", [], "NV8"], [[128720, 128720], "valid", [], "NV8"], [[128721, 128735], "disallowed"], [[128736, 128748], "valid", [], "NV8"], [[128749, 128751], "disallowed"], [[128752, 128755], "valid", [], "NV8"], [[128756, 128767], "disallowed"], [[128768, 128883], "valid", [], "NV8"], [[128884, 128895], "disallowed"], [[128896, 128980], "valid", [], "NV8"], [[128981, 129023], "disallowed"], [[129024, 129035], "valid", [], "NV8"], [[129036, 129039], "disallowed"], [[129040, 129095], "valid", [], "NV8"], [[129096, 129103], "disallowed"], [[129104, 129113], "valid", [], "NV8"], [[129114, 129119], "disallowed"], [[129120, 129159], "valid", [], "NV8"], [[129160, 129167], "disallowed"], [[129168, 129197], "valid", [], "NV8"], [[129198, 129295], "disallowed"], [[129296, 129304], "valid", [], "NV8"], [[129305, 129407], "disallowed"], [[129408, 129412], "valid", [], "NV8"], [[129413, 129471], "disallowed"], [[129472, 129472], "valid", [], "NV8"], [[129473, 131069], "disallowed"], [[131070, 131071], "disallowed"], [[131072, 173782], "valid"], [[173783, 173823], "disallowed"], [[173824, 177972], "valid"], [[177973, 177983], "disallowed"], [[177984, 178205], "valid"], [[178206, 178207], "disallowed"], [[178208, 183969], "valid"], [[183970, 194559], "disallowed"], [[194560, 194560], "mapped", [20029]], [[194561, 194561], "mapped", [20024]], [[194562, 194562], "mapped", [20033]], [[194563, 194563], "mapped", [131362]], [[194564, 194564], "mapped", [20320]], [[194565, 194565], "mapped", [20398]], [[194566, 194566], "mapped", [20411]], [[194567, 194567], "mapped", [20482]], [[194568, 194568], "mapped", [20602]], [[194569, 194569], "mapped", [20633]], [[194570, 194570], "mapped", [20711]], [[194571, 194571], "mapped", [20687]], [[194572, 194572], "mapped", [13470]], [[194573, 194573], "mapped", [132666]], [[194574, 194574], "mapped", [20813]], [[194575, 194575], "mapped", [20820]], [[194576, 194576], "mapped", [20836]], [[194577, 194577], "mapped", [20855]], [[194578, 194578], "mapped", [132380]], [[194579, 194579], "mapped", [13497]], [[194580, 194580], "mapped", [20839]], [[194581, 194581], "mapped", [20877]], [[194582, 194582], "mapped", [132427]], [[194583, 194583], "mapped", [20887]], [[194584, 194584], "mapped", [20900]], [[194585, 194585], "mapped", [20172]], [[194586, 194586], "mapped", [20908]], [[194587, 194587], "mapped", [20917]], [[194588, 194588], "mapped", [168415]], [[194589, 194589], "mapped", [20981]], [[194590, 194590], "mapped", [20995]], [[194591, 194591], "mapped", [13535]], [[194592, 194592], "mapped", [21051]], [[194593, 194593], "mapped", [21062]], [[194594, 194594], "mapped", [21106]], [[194595, 194595], "mapped", [21111]], [[194596, 194596], "mapped", [13589]], [[194597, 194597], "mapped", [21191]], [[194598, 194598], "mapped", [21193]], [[194599, 194599], "mapped", [21220]], [[194600, 194600], "mapped", [21242]], [[194601, 194601], "mapped", [21253]], [[194602, 194602], "mapped", [21254]], [[194603, 194603], "mapped", [21271]], [[194604, 194604], "mapped", [21321]], [[194605, 194605], "mapped", [21329]], [[194606, 194606], "mapped", [21338]], [[194607, 194607], "mapped", [21363]], [[194608, 194608], "mapped", [21373]], [[194609, 194611], "mapped", [21375]], [[194612, 194612], "mapped", [133676]], [[194613, 194613], "mapped", [28784]], [[194614, 194614], "mapped", [21450]], [[194615, 194615], "mapped", [21471]], [[194616, 194616], "mapped", [133987]], [[194617, 194617], "mapped", [21483]], [[194618, 194618], "mapped", [21489]], [[194619, 194619], "mapped", [21510]], [[194620, 194620], "mapped", [21662]], [[194621, 194621], "mapped", [21560]], [[194622, 194622], "mapped", [21576]], [[194623, 194623], "mapped", [21608]], [[194624, 194624], "mapped", [21666]], [[194625, 194625], "mapped", [21750]], [[194626, 194626], "mapped", [21776]], [[194627, 194627], "mapped", [21843]], [[194628, 194628], "mapped", [21859]], [[194629, 194630], "mapped", [21892]], [[194631, 194631], "mapped", [21913]], [[194632, 194632], "mapped", [21931]], [[194633, 194633], "mapped", [21939]], [[194634, 194634], "mapped", [21954]], [[194635, 194635], "mapped", [22294]], [[194636, 194636], "mapped", [22022]], [[194637, 194637], "mapped", [22295]], [[194638, 194638], "mapped", [22097]], [[194639, 194639], "mapped", [22132]], [[194640, 194640], "mapped", [20999]], [[194641, 194641], "mapped", [22766]], [[194642, 194642], "mapped", [22478]], [[194643, 194643], "mapped", [22516]], [[194644, 194644], "mapped", [22541]], [[194645, 194645], "mapped", [22411]], [[194646, 194646], "mapped", [22578]], [[194647, 194647], "mapped", [22577]], [[194648, 194648], "mapped", [22700]], [[194649, 194649], "mapped", [136420]], [[194650, 194650], "mapped", [22770]], [[194651, 194651], "mapped", [22775]], [[194652, 194652], "mapped", [22790]], [[194653, 194653], "mapped", [22810]], [[194654, 194654], "mapped", [22818]], [[194655, 194655], "mapped", [22882]], [[194656, 194656], "mapped", [136872]], [[194657, 194657], "mapped", [136938]], [[194658, 194658], "mapped", [23020]], [[194659, 194659], "mapped", [23067]], [[194660, 194660], "mapped", [23079]], [[194661, 194661], "mapped", [23e3]], [[194662, 194662], "mapped", [23142]], [[194663, 194663], "mapped", [14062]], [[194664, 194664], "disallowed"], [[194665, 194665], "mapped", [23304]], [[194666, 194667], "mapped", [23358]], [[194668, 194668], "mapped", [137672]], [[194669, 194669], "mapped", [23491]], [[194670, 194670], "mapped", [23512]], [[194671, 194671], "mapped", [23527]], [[194672, 194672], "mapped", [23539]], [[194673, 194673], "mapped", [138008]], [[194674, 194674], "mapped", [23551]], [[194675, 194675], "mapped", [23558]], [[194676, 194676], "disallowed"], [[194677, 194677], "mapped", [23586]], [[194678, 194678], "mapped", [14209]], [[194679, 194679], "mapped", [23648]], [[194680, 194680], "mapped", [23662]], [[194681, 194681], "mapped", [23744]], [[194682, 194682], "mapped", [23693]], [[194683, 194683], "mapped", [138724]], [[194684, 194684], "mapped", [23875]], [[194685, 194685], "mapped", [138726]], [[194686, 194686], "mapped", [23918]], [[194687, 194687], "mapped", [23915]], [[194688, 194688], "mapped", [23932]], [[194689, 194689], "mapped", [24033]], [[194690, 194690], "mapped", [24034]], [[194691, 194691], "mapped", [14383]], [[194692, 194692], "mapped", [24061]], [[194693, 194693], "mapped", [24104]], [[194694, 194694], "mapped", [24125]], [[194695, 194695], "mapped", [24169]], [[194696, 194696], "mapped", [14434]], [[194697, 194697], "mapped", [139651]], [[194698, 194698], "mapped", [14460]], [[194699, 194699], "mapped", [24240]], [[194700, 194700], "mapped", [24243]], [[194701, 194701], "mapped", [24246]], [[194702, 194702], "mapped", [24266]], [[194703, 194703], "mapped", [172946]], [[194704, 194704], "mapped", [24318]], [[194705, 194706], "mapped", [140081]], [[194707, 194707], "mapped", [33281]], [[194708, 194709], "mapped", [24354]], [[194710, 194710], "mapped", [14535]], [[194711, 194711], "mapped", [144056]], [[194712, 194712], "mapped", [156122]], [[194713, 194713], "mapped", [24418]], [[194714, 194714], "mapped", [24427]], [[194715, 194715], "mapped", [14563]], [[194716, 194716], "mapped", [24474]], [[194717, 194717], "mapped", [24525]], [[194718, 194718], "mapped", [24535]], [[194719, 194719], "mapped", [24569]], [[194720, 194720], "mapped", [24705]], [[194721, 194721], "mapped", [14650]], [[194722, 194722], "mapped", [14620]], [[194723, 194723], "mapped", [24724]], [[194724, 194724], "mapped", [141012]], [[194725, 194725], "mapped", [24775]], [[194726, 194726], "mapped", [24904]], [[194727, 194727], "mapped", [24908]], [[194728, 194728], "mapped", [24910]], [[194729, 194729], "mapped", [24908]], [[194730, 194730], "mapped", [24954]], [[194731, 194731], "mapped", [24974]], [[194732, 194732], "mapped", [25010]], [[194733, 194733], "mapped", [24996]], [[194734, 194734], "mapped", [25007]], [[194735, 194735], "mapped", [25054]], [[194736, 194736], "mapped", [25074]], [[194737, 194737], "mapped", [25078]], [[194738, 194738], "mapped", [25104]], [[194739, 194739], "mapped", [25115]], [[194740, 194740], "mapped", [25181]], [[194741, 194741], "mapped", [25265]], [[194742, 194742], "mapped", [25300]], [[194743, 194743], "mapped", [25424]], [[194744, 194744], "mapped", [142092]], [[194745, 194745], "mapped", [25405]], [[194746, 194746], "mapped", [25340]], [[194747, 194747], "mapped", [25448]], [[194748, 194748], "mapped", [25475]], [[194749, 194749], "mapped", [25572]], [[194750, 194750], "mapped", [142321]], [[194751, 194751], "mapped", [25634]], [[194752, 194752], "mapped", [25541]], [[194753, 194753], "mapped", [25513]], [[194754, 194754], "mapped", [14894]], [[194755, 194755], "mapped", [25705]], [[194756, 194756], "mapped", [25726]], [[194757, 194757], "mapped", [25757]], [[194758, 194758], "mapped", [25719]], [[194759, 194759], "mapped", [14956]], [[194760, 194760], "mapped", [25935]], [[194761, 194761], "mapped", [25964]], [[194762, 194762], "mapped", [143370]], [[194763, 194763], "mapped", [26083]], [[194764, 194764], "mapped", [26360]], [[194765, 194765], "mapped", [26185]], [[194766, 194766], "mapped", [15129]], [[194767, 194767], "mapped", [26257]], [[194768, 194768], "mapped", [15112]], [[194769, 194769], "mapped", [15076]], [[194770, 194770], "mapped", [20882]], [[194771, 194771], "mapped", [20885]], [[194772, 194772], "mapped", [26368]], [[194773, 194773], "mapped", [26268]], [[194774, 194774], "mapped", [32941]], [[194775, 194775], "mapped", [17369]], [[194776, 194776], "mapped", [26391]], [[194777, 194777], "mapped", [26395]], [[194778, 194778], "mapped", [26401]], [[194779, 194779], "mapped", [26462]], [[194780, 194780], "mapped", [26451]], [[194781, 194781], "mapped", [144323]], [[194782, 194782], "mapped", [15177]], [[194783, 194783], "mapped", [26618]], [[194784, 194784], "mapped", [26501]], [[194785, 194785], "mapped", [26706]], [[194786, 194786], "mapped", [26757]], [[194787, 194787], "mapped", [144493]], [[194788, 194788], "mapped", [26766]], [[194789, 194789], "mapped", [26655]], [[194790, 194790], "mapped", [26900]], [[194791, 194791], "mapped", [15261]], [[194792, 194792], "mapped", [26946]], [[194793, 194793], "mapped", [27043]], [[194794, 194794], "mapped", [27114]], [[194795, 194795], "mapped", [27304]], [[194796, 194796], "mapped", [145059]], [[194797, 194797], "mapped", [27355]], [[194798, 194798], "mapped", [15384]], [[194799, 194799], "mapped", [27425]], [[194800, 194800], "mapped", [145575]], [[194801, 194801], "mapped", [27476]], [[194802, 194802], "mapped", [15438]], [[194803, 194803], "mapped", [27506]], [[194804, 194804], "mapped", [27551]], [[194805, 194805], "mapped", [27578]], [[194806, 194806], "mapped", [27579]], [[194807, 194807], "mapped", [146061]], [[194808, 194808], "mapped", [138507]], [[194809, 194809], "mapped", [146170]], [[194810, 194810], "mapped", [27726]], [[194811, 194811], "mapped", [146620]], [[194812, 194812], "mapped", [27839]], [[194813, 194813], "mapped", [27853]], [[194814, 194814], "mapped", [27751]], [[194815, 194815], "mapped", [27926]], [[194816, 194816], "mapped", [27966]], [[194817, 194817], "mapped", [28023]], [[194818, 194818], "mapped", [27969]], [[194819, 194819], "mapped", [28009]], [[194820, 194820], "mapped", [28024]], [[194821, 194821], "mapped", [28037]], [[194822, 194822], "mapped", [146718]], [[194823, 194823], "mapped", [27956]], [[194824, 194824], "mapped", [28207]], [[194825, 194825], "mapped", [28270]], [[194826, 194826], "mapped", [15667]], [[194827, 194827], "mapped", [28363]], [[194828, 194828], "mapped", [28359]], [[194829, 194829], "mapped", [147153]], [[194830, 194830], "mapped", [28153]], [[194831, 194831], "mapped", [28526]], [[194832, 194832], "mapped", [147294]], [[194833, 194833], "mapped", [147342]], [[194834, 194834], "mapped", [28614]], [[194835, 194835], "mapped", [28729]], [[194836, 194836], "mapped", [28702]], [[194837, 194837], "mapped", [28699]], [[194838, 194838], "mapped", [15766]], [[194839, 194839], "mapped", [28746]], [[194840, 194840], "mapped", [28797]], [[194841, 194841], "mapped", [28791]], [[194842, 194842], "mapped", [28845]], [[194843, 194843], "mapped", [132389]], [[194844, 194844], "mapped", [28997]], [[194845, 194845], "mapped", [148067]], [[194846, 194846], "mapped", [29084]], [[194847, 194847], "disallowed"], [[194848, 194848], "mapped", [29224]], [[194849, 194849], "mapped", [29237]], [[194850, 194850], "mapped", [29264]], [[194851, 194851], "mapped", [149e3]], [[194852, 194852], "mapped", [29312]], [[194853, 194853], "mapped", [29333]], [[194854, 194854], "mapped", [149301]], [[194855, 194855], "mapped", [149524]], [[194856, 194856], "mapped", [29562]], [[194857, 194857], "mapped", [29579]], [[194858, 194858], "mapped", [16044]], [[194859, 194859], "mapped", [29605]], [[194860, 194861], "mapped", [16056]], [[194862, 194862], "mapped", [29767]], [[194863, 194863], "mapped", [29788]], [[194864, 194864], "mapped", [29809]], [[194865, 194865], "mapped", [29829]], [[194866, 194866], "mapped", [29898]], [[194867, 194867], "mapped", [16155]], [[194868, 194868], "mapped", [29988]], [[194869, 194869], "mapped", [150582]], [[194870, 194870], "mapped", [30014]], [[194871, 194871], "mapped", [150674]], [[194872, 194872], "mapped", [30064]], [[194873, 194873], "mapped", [139679]], [[194874, 194874], "mapped", [30224]], [[194875, 194875], "mapped", [151457]], [[194876, 194876], "mapped", [151480]], [[194877, 194877], "mapped", [151620]], [[194878, 194878], "mapped", [16380]], [[194879, 194879], "mapped", [16392]], [[194880, 194880], "mapped", [30452]], [[194881, 194881], "mapped", [151795]], [[194882, 194882], "mapped", [151794]], [[194883, 194883], "mapped", [151833]], [[194884, 194884], "mapped", [151859]], [[194885, 194885], "mapped", [30494]], [[194886, 194887], "mapped", [30495]], [[194888, 194888], "mapped", [30538]], [[194889, 194889], "mapped", [16441]], [[194890, 194890], "mapped", [30603]], [[194891, 194891], "mapped", [16454]], [[194892, 194892], "mapped", [16534]], [[194893, 194893], "mapped", [152605]], [[194894, 194894], "mapped", [30798]], [[194895, 194895], "mapped", [30860]], [[194896, 194896], "mapped", [30924]], [[194897, 194897], "mapped", [16611]], [[194898, 194898], "mapped", [153126]], [[194899, 194899], "mapped", [31062]], [[194900, 194900], "mapped", [153242]], [[194901, 194901], "mapped", [153285]], [[194902, 194902], "mapped", [31119]], [[194903, 194903], "mapped", [31211]], [[194904, 194904], "mapped", [16687]], [[194905, 194905], "mapped", [31296]], [[194906, 194906], "mapped", [31306]], [[194907, 194907], "mapped", [31311]], [[194908, 194908], "mapped", [153980]], [[194909, 194910], "mapped", [154279]], [[194911, 194911], "disallowed"], [[194912, 194912], "mapped", [16898]], [[194913, 194913], "mapped", [154539]], [[194914, 194914], "mapped", [31686]], [[194915, 194915], "mapped", [31689]], [[194916, 194916], "mapped", [16935]], [[194917, 194917], "mapped", [154752]], [[194918, 194918], "mapped", [31954]], [[194919, 194919], "mapped", [17056]], [[194920, 194920], "mapped", [31976]], [[194921, 194921], "mapped", [31971]], [[194922, 194922], "mapped", [32e3]], [[194923, 194923], "mapped", [155526]], [[194924, 194924], "mapped", [32099]], [[194925, 194925], "mapped", [17153]], [[194926, 194926], "mapped", [32199]], [[194927, 194927], "mapped", [32258]], [[194928, 194928], "mapped", [32325]], [[194929, 194929], "mapped", [17204]], [[194930, 194930], "mapped", [156200]], [[194931, 194931], "mapped", [156231]], [[194932, 194932], "mapped", [17241]], [[194933, 194933], "mapped", [156377]], [[194934, 194934], "mapped", [32634]], [[194935, 194935], "mapped", [156478]], [[194936, 194936], "mapped", [32661]], [[194937, 194937], "mapped", [32762]], [[194938, 194938], "mapped", [32773]], [[194939, 194939], "mapped", [156890]], [[194940, 194940], "mapped", [156963]], [[194941, 194941], "mapped", [32864]], [[194942, 194942], "mapped", [157096]], [[194943, 194943], "mapped", [32880]], [[194944, 194944], "mapped", [144223]], [[194945, 194945], "mapped", [17365]], [[194946, 194946], "mapped", [32946]], [[194947, 194947], "mapped", [33027]], [[194948, 194948], "mapped", [17419]], [[194949, 194949], "mapped", [33086]], [[194950, 194950], "mapped", [23221]], [[194951, 194951], "mapped", [157607]], [[194952, 194952], "mapped", [157621]], [[194953, 194953], "mapped", [144275]], [[194954, 194954], "mapped", [144284]], [[194955, 194955], "mapped", [33281]], [[194956, 194956], "mapped", [33284]], [[194957, 194957], "mapped", [36766]], [[194958, 194958], "mapped", [17515]], [[194959, 194959], "mapped", [33425]], [[194960, 194960], "mapped", [33419]], [[194961, 194961], "mapped", [33437]], [[194962, 194962], "mapped", [21171]], [[194963, 194963], "mapped", [33457]], [[194964, 194964], "mapped", [33459]], [[194965, 194965], "mapped", [33469]], [[194966, 194966], "mapped", [33510]], [[194967, 194967], "mapped", [158524]], [[194968, 194968], "mapped", [33509]], [[194969, 194969], "mapped", [33565]], [[194970, 194970], "mapped", [33635]], [[194971, 194971], "mapped", [33709]], [[194972, 194972], "mapped", [33571]], [[194973, 194973], "mapped", [33725]], [[194974, 194974], "mapped", [33767]], [[194975, 194975], "mapped", [33879]], [[194976, 194976], "mapped", [33619]], [[194977, 194977], "mapped", [33738]], [[194978, 194978], "mapped", [33740]], [[194979, 194979], "mapped", [33756]], [[194980, 194980], "mapped", [158774]], [[194981, 194981], "mapped", [159083]], [[194982, 194982], "mapped", [158933]], [[194983, 194983], "mapped", [17707]], [[194984, 194984], "mapped", [34033]], [[194985, 194985], "mapped", [34035]], [[194986, 194986], "mapped", [34070]], [[194987, 194987], "mapped", [160714]], [[194988, 194988], "mapped", [34148]], [[194989, 194989], "mapped", [159532]], [[194990, 194990], "mapped", [17757]], [[194991, 194991], "mapped", [17761]], [[194992, 194992], "mapped", [159665]], [[194993, 194993], "mapped", [159954]], [[194994, 194994], "mapped", [17771]], [[194995, 194995], "mapped", [34384]], [[194996, 194996], "mapped", [34396]], [[194997, 194997], "mapped", [34407]], [[194998, 194998], "mapped", [34409]], [[194999, 194999], "mapped", [34473]], [[195e3, 195e3], "mapped", [34440]], [[195001, 195001], "mapped", [34574]], [[195002, 195002], "mapped", [34530]], [[195003, 195003], "mapped", [34681]], [[195004, 195004], "mapped", [34600]], [[195005, 195005], "mapped", [34667]], [[195006, 195006], "mapped", [34694]], [[195007, 195007], "disallowed"], [[195008, 195008], "mapped", [34785]], [[195009, 195009], "mapped", [34817]], [[195010, 195010], "mapped", [17913]], [[195011, 195011], "mapped", [34912]], [[195012, 195012], "mapped", [34915]], [[195013, 195013], "mapped", [161383]], [[195014, 195014], "mapped", [35031]], [[195015, 195015], "mapped", [35038]], [[195016, 195016], "mapped", [17973]], [[195017, 195017], "mapped", [35066]], [[195018, 195018], "mapped", [13499]], [[195019, 195019], "mapped", [161966]], [[195020, 195020], "mapped", [162150]], [[195021, 195021], "mapped", [18110]], [[195022, 195022], "mapped", [18119]], [[195023, 195023], "mapped", [35488]], [[195024, 195024], "mapped", [35565]], [[195025, 195025], "mapped", [35722]], [[195026, 195026], "mapped", [35925]], [[195027, 195027], "mapped", [162984]], [[195028, 195028], "mapped", [36011]], [[195029, 195029], "mapped", [36033]], [[195030, 195030], "mapped", [36123]], [[195031, 195031], "mapped", [36215]], [[195032, 195032], "mapped", [163631]], [[195033, 195033], "mapped", [133124]], [[195034, 195034], "mapped", [36299]], [[195035, 195035], "mapped", [36284]], [[195036, 195036], "mapped", [36336]], [[195037, 195037], "mapped", [133342]], [[195038, 195038], "mapped", [36564]], [[195039, 195039], "mapped", [36664]], [[195040, 195040], "mapped", [165330]], [[195041, 195041], "mapped", [165357]], [[195042, 195042], "mapped", [37012]], [[195043, 195043], "mapped", [37105]], [[195044, 195044], "mapped", [37137]], [[195045, 195045], "mapped", [165678]], [[195046, 195046], "mapped", [37147]], [[195047, 195047], "mapped", [37432]], [[195048, 195048], "mapped", [37591]], [[195049, 195049], "mapped", [37592]], [[195050, 195050], "mapped", [37500]], [[195051, 195051], "mapped", [37881]], [[195052, 195052], "mapped", [37909]], [[195053, 195053], "mapped", [166906]], [[195054, 195054], "mapped", [38283]], [[195055, 195055], "mapped", [18837]], [[195056, 195056], "mapped", [38327]], [[195057, 195057], "mapped", [167287]], [[195058, 195058], "mapped", [18918]], [[195059, 195059], "mapped", [38595]], [[195060, 195060], "mapped", [23986]], [[195061, 195061], "mapped", [38691]], [[195062, 195062], "mapped", [168261]], [[195063, 195063], "mapped", [168474]], [[195064, 195064], "mapped", [19054]], [[195065, 195065], "mapped", [19062]], [[195066, 195066], "mapped", [38880]], [[195067, 195067], "mapped", [168970]], [[195068, 195068], "mapped", [19122]], [[195069, 195069], "mapped", [169110]], [[195070, 195071], "mapped", [38923]], [[195072, 195072], "mapped", [38953]], [[195073, 195073], "mapped", [169398]], [[195074, 195074], "mapped", [39138]], [[195075, 195075], "mapped", [19251]], [[195076, 195076], "mapped", [39209]], [[195077, 195077], "mapped", [39335]], [[195078, 195078], "mapped", [39362]], [[195079, 195079], "mapped", [39422]], [[195080, 195080], "mapped", [19406]], [[195081, 195081], "mapped", [170800]], [[195082, 195082], "mapped", [39698]], [[195083, 195083], "mapped", [4e4]], [[195084, 195084], "mapped", [40189]], [[195085, 195085], "mapped", [19662]], [[195086, 195086], "mapped", [19693]], [[195087, 195087], "mapped", [40295]], [[195088, 195088], "mapped", [172238]], [[195089, 195089], "mapped", [19704]], [[195090, 195090], "mapped", [172293]], [[195091, 195091], "mapped", [172558]], [[195092, 195092], "mapped", [172689]], [[195093, 195093], "mapped", [40635]], [[195094, 195094], "mapped", [19798]], [[195095, 195095], "mapped", [40697]], [[195096, 195096], "mapped", [40702]], [[195097, 195097], "mapped", [40709]], [[195098, 195098], "mapped", [40719]], [[195099, 195099], "mapped", [40726]], [[195100, 195100], "mapped", [40763]], [[195101, 195101], "mapped", [173568]], [[195102, 196605], "disallowed"], [[196606, 196607], "disallowed"], [[196608, 262141], "disallowed"], [[262142, 262143], "disallowed"], [[262144, 327677], "disallowed"], [[327678, 327679], "disallowed"], [[327680, 393213], "disallowed"], [[393214, 393215], "disallowed"], [[393216, 458749], "disallowed"], [[458750, 458751], "disallowed"], [[458752, 524285], "disallowed"], [[524286, 524287], "disallowed"], [[524288, 589821], "disallowed"], [[589822, 589823], "disallowed"], [[589824, 655357], "disallowed"], [[655358, 655359], "disallowed"], [[655360, 720893], "disallowed"], [[720894, 720895], "disallowed"], [[720896, 786429], "disallowed"], [[786430, 786431], "disallowed"], [[786432, 851965], "disallowed"], [[851966, 851967], "disallowed"], [[851968, 917501], "disallowed"], [[917502, 917503], "disallowed"], [[917504, 917504], "disallowed"], [[917505, 917505], "disallowed"], [[917506, 917535], "disallowed"], [[917536, 917631], "disallowed"], [[917632, 917759], "disallowed"], [[917760, 917999], "ignored"], [[918e3, 983037], "disallowed"], [[983038, 983039], "disallowed"], [[983040, 1048573], "disallowed"], [[1048574, 1048575], "disallowed"], [[1048576, 1114109], "disallowed"], [[1114110, 1114111], "disallowed"]]; + return Object.defineProperty(value, "_request_id", { + value: response.headers.get("x-request-id"), + enumerable: false + }); + } } }); -// node_modules/tr46/index.js -var require_tr46 = __commonJS({ - "node_modules/tr46/index.js"(exports2, module) { +// node_modules/openai/core/api-promise.js +var require_api_promise = __commonJS({ + "node_modules/openai/core/api-promise.js"(exports2) { "use strict"; - var punycode = __require("punycode"); - var mappingTable = require_mappingTable(); - var PROCESSING_OPTIONS = { - TRANSITIONAL: 0, - NONTRANSITIONAL: 1 - }; - function normalize4(str) { - return str.split("\0").map(function(s6) { - return s6.normalize("NFC"); - }).join("\0"); - } - function findStatus(val) { - var start = 0; - var end = mappingTable.length - 1; - while (start <= end) { - var mid = Math.floor((start + end) / 2); - var target = mappingTable[mid]; - if (target[0][0] <= val && target[0][1] >= val) { - return target; - } else if (target[0][0] > val) { - end = mid - 1; - } else { - start = mid + 1; - } + var _APIPromise_client; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.APIPromise = void 0; + var tslib_1 = require_tslib(); + var parse_1 = require_parse2(); + var APIPromise = class _APIPromise extends Promise { + constructor(client2, responsePromise, parseResponse = parse_1.defaultParseResponse) { + super((resolve8) => { + resolve8(null); + }); + this.responsePromise = responsePromise; + this.parseResponse = parseResponse; + _APIPromise_client.set(this, void 0); + tslib_1.__classPrivateFieldSet(this, _APIPromise_client, client2, "f"); } - return null; - } - var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; - function countSymbols(string) { - return string.replace(regexAstralSymbols, "_").length; - } - function mapChars(domain_name, useSTD3, processing_option) { - var hasError = false; - var processed = ""; - var len = countSymbols(domain_name); - for (var i6 = 0; i6 < len; ++i6) { - var codePoint = domain_name.codePointAt(i6); - var status = findStatus(codePoint); - switch (status[1]) { - case "disallowed": - hasError = true; - processed += String.fromCodePoint(codePoint); - break; - case "ignored": - break; - case "mapped": - processed += String.fromCodePoint.apply(String, status[2]); - break; - case "deviation": - if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) { - processed += String.fromCodePoint.apply(String, status[2]); - } else { - processed += String.fromCodePoint(codePoint); - } - break; - case "valid": - processed += String.fromCodePoint(codePoint); - break; - case "disallowed_STD3_mapped": - if (useSTD3) { - hasError = true; - processed += String.fromCodePoint(codePoint); - } else { - processed += String.fromCodePoint.apply(String, status[2]); - } - break; - case "disallowed_STD3_valid": - if (useSTD3) { - hasError = true; - } - processed += String.fromCodePoint(codePoint); - break; - } + _thenUnwrap(transform2) { + return new _APIPromise(tslib_1.__classPrivateFieldGet(this, _APIPromise_client, "f"), this.responsePromise, async (client2, props) => (0, parse_1.addRequestID)(transform2(await this.parseResponse(client2, props), props), props.response)); } - return { - string: processed, - error: hasError - }; - } - var combiningMarksRegex = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/; - function validateLabel(label, processing_option) { - if (label.substr(0, 4) === "xn--") { - label = punycode.toUnicode(label); - processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL; + /** + * Gets the raw `Response` instance instead of parsing the response + * data. + * + * If you want to parse the response body but still get the `Response` + * instance, you can use {@link withResponse()}. + * + * 👋 Getting the wrong TypeScript type for `Response`? + * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]` + * to your `tsconfig.json`. + */ + asResponse() { + return this.responsePromise.then((p2) => p2.response); } - var error2 = false; - if (normalize4(label) !== label || label[3] === "-" && label[4] === "-" || label[0] === "-" || label[label.length - 1] === "-" || label.indexOf(".") !== -1 || label.search(combiningMarksRegex) === 0) { - error2 = true; + /** + * Gets the parsed response data, the raw `Response` instance and the ID of the request, + * returned via the X-Request-ID header which is useful for debugging requests and reporting + * issues to OpenAI. + * + * If you just want to get the raw `Response` instance without parsing it, + * you can use {@link asResponse()}. + * + * 👋 Getting the wrong TypeScript type for `Response`? + * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]` + * to your `tsconfig.json`. + */ + async withResponse() { + const [data, response] = await Promise.all([this.parse(), this.asResponse()]); + return { data, response, request_id: response.headers.get("x-request-id") }; } - var len = countSymbols(label); - for (var i6 = 0; i6 < len; ++i6) { - var status = findStatus(label.codePointAt(i6)); - if (processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid" || processing === PROCESSING_OPTIONS.NONTRANSITIONAL && status[1] !== "valid" && status[1] !== "deviation") { - error2 = true; - break; + parse() { + if (!this.parsedPromise) { + this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(tslib_1.__classPrivateFieldGet(this, _APIPromise_client, "f"), data)); } + return this.parsedPromise; } - return { - label, - error: error2 - }; - } - function processing(domain_name, useSTD3, processing_option) { - var result = mapChars(domain_name, useSTD3, processing_option); - result.string = normalize4(result.string); - var labels = result.string.split("."); - for (var i6 = 0; i6 < labels.length; ++i6) { - try { - var validation = validateLabel(labels[i6]); - labels[i6] = validation.label; - result.error = result.error || validation.error; - } catch (e6) { - result.error = true; - } + then(onfulfilled, onrejected) { + return this.parse().then(onfulfilled, onrejected); } - return { - string: labels.join("."), - error: result.error - }; - } - module.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) { - var result = processing(domain_name, useSTD3, processing_option); - var labels = result.string.split("."); - labels = labels.map(function(l6) { - try { - return punycode.toASCII(l6); - } catch (e6) { - result.error = true; - return l6; - } - }); - if (verifyDnsLength) { - var total = labels.slice(0, labels.length - 1).join(".").length; - if (total.length > 253 || total.length === 0) { - result.error = true; - } - for (var i6 = 0; i6 < labels.length; ++i6) { - if (labels.length > 63 || labels.length === 0) { - result.error = true; - break; - } - } + catch(onrejected) { + return this.parse().catch(onrejected); + } + finally(onfinally) { + return this.parse().finally(onfinally); } - if (result.error) return null; - return labels.join("."); - }; - module.exports.toUnicode = function(domain_name, useSTD3) { - var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL); - return { - domain: result.string, - error: result.error - }; }; - module.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS; + exports2.APIPromise = APIPromise; + _APIPromise_client = /* @__PURE__ */ new WeakMap(); } }); -// node_modules/whatwg-url/lib/url-state-machine.js -var require_url_state_machine = __commonJS({ - "node_modules/whatwg-url/lib/url-state-machine.js"(exports2, module) { +// node_modules/openai/core/pagination.js +var require_pagination = __commonJS({ + "node_modules/openai/core/pagination.js"(exports2) { "use strict"; - var punycode = __require("punycode"); - var tr46 = require_tr46(); - var specialSchemes = { - ftp: 21, - file: null, - gopher: 70, - http: 80, - https: 443, - ws: 80, - wss: 443 - }; - var failure = /* @__PURE__ */ Symbol("failure"); - function countSymbols(str) { - return punycode.ucs2.decode(str).length; - } - function at2(input, idx) { - const c6 = input[idx]; - return isNaN(c6) ? void 0 : String.fromCodePoint(c6); - } - function isASCIIDigit(c6) { - return c6 >= 48 && c6 <= 57; - } - function isASCIIAlpha(c6) { - return c6 >= 65 && c6 <= 90 || c6 >= 97 && c6 <= 122; - } - function isASCIIAlphanumeric(c6) { - return isASCIIAlpha(c6) || isASCIIDigit(c6); - } - function isASCIIHex(c6) { - return isASCIIDigit(c6) || c6 >= 65 && c6 <= 70 || c6 >= 97 && c6 <= 102; - } - function isSingleDot(buffer2) { - return buffer2 === "." || buffer2.toLowerCase() === "%2e"; - } - function isDoubleDot(buffer2) { - buffer2 = buffer2.toLowerCase(); - return buffer2 === ".." || buffer2 === "%2e." || buffer2 === ".%2e" || buffer2 === "%2e%2e"; - } - function isWindowsDriveLetterCodePoints(cp1, cp2) { - return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124); - } - function isWindowsDriveLetterString(string) { - return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); - } - function isNormalizedWindowsDriveLetterString(string) { - return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; - } - function containsForbiddenHostCodePoint(string) { - return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1; - } - function containsForbiddenHostCodePointExcludingPercent(string) { - return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1; - } - function isSpecialScheme(scheme) { - return specialSchemes[scheme] !== void 0; - } - function isSpecial(url2) { - return isSpecialScheme(url2.scheme); - } - function defaultPort(scheme) { - return specialSchemes[scheme]; - } - function percentEncode(c6) { - let hex = c6.toString(16).toUpperCase(); - if (hex.length === 1) { - hex = "0" + hex; + var _AbstractPage_client; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.NextCursorPage = exports2.ConversationCursorPage = exports2.CursorPage = exports2.Page = exports2.PagePromise = exports2.AbstractPage = void 0; + var tslib_1 = require_tslib(); + var error_1 = require_error2(); + var parse_1 = require_parse2(); + var api_promise_1 = require_api_promise(); + var values_1 = require_values(); + var AbstractPage = class { + constructor(client2, response, body2, options) { + _AbstractPage_client.set(this, void 0); + tslib_1.__classPrivateFieldSet(this, _AbstractPage_client, client2, "f"); + this.options = options; + this.response = response; + this.body = body2; } - return "%" + hex; - } - function utf8PercentEncode(c6) { - const buf = new Buffer(c6); - let str = ""; - for (let i6 = 0; i6 < buf.length; ++i6) { - str += percentEncode(buf[i6]); + hasNextPage() { + const items = this.getPaginatedItems(); + if (!items.length) + return false; + return this.nextPageRequestOptions() != null; } - return str; - } - function utf8PercentDecode(str) { - const input = new Buffer(str); - const output = []; - for (let i6 = 0; i6 < input.length; ++i6) { - if (input[i6] !== 37) { - output.push(input[i6]); - } else if (input[i6] === 37 && isASCIIHex(input[i6 + 1]) && isASCIIHex(input[i6 + 2])) { - output.push(parseInt(input.slice(i6 + 1, i6 + 3).toString(), 16)); - i6 += 2; - } else { - output.push(input[i6]); + async getNextPage() { + const nextOptions = this.nextPageRequestOptions(); + if (!nextOptions) { + throw new error_1.OpenAIError("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`."); } + return await tslib_1.__classPrivateFieldGet(this, _AbstractPage_client, "f").requestAPIList(this.constructor, nextOptions); } - return new Buffer(output).toString(); - } - function isC0ControlPercentEncode(c6) { - return c6 <= 31 || c6 > 126; - } - var extraPathPercentEncodeSet = /* @__PURE__ */ new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]); - function isPathPercentEncode(c6) { - return isC0ControlPercentEncode(c6) || extraPathPercentEncodeSet.has(c6); - } - var extraUserinfoPercentEncodeSet = /* @__PURE__ */ new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]); - function isUserinfoPercentEncode(c6) { - return isPathPercentEncode(c6) || extraUserinfoPercentEncodeSet.has(c6); - } - function percentEncodeChar(c6, encodeSetPredicate) { - const cStr = String.fromCodePoint(c6); - if (encodeSetPredicate(c6)) { - return utf8PercentEncode(cStr); - } - return cStr; - } - function parseIPv4Number(input) { - let R2 = 10; - if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { - input = input.substring(2); - R2 = 16; - } else if (input.length >= 2 && input.charAt(0) === "0") { - input = input.substring(1); - R2 = 8; + async *iterPages() { + let page = this; + yield page; + while (page.hasNextPage()) { + page = await page.getNextPage(); + yield page; + } } - if (input === "") { - return 0; + async *[(_AbstractPage_client = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { + for await (const page of this.iterPages()) { + for (const item of page.getPaginatedItems()) { + yield item; + } + } } - const regex = R2 === 10 ? /[^0-9]/ : R2 === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/; - if (regex.test(input)) { - return failure; + }; + exports2.AbstractPage = AbstractPage; + var PagePromise = class extends api_promise_1.APIPromise { + constructor(client2, request2, Page2) { + super(client2, request2, async (client3, props) => new Page2(client3, props.response, await (0, parse_1.defaultParseResponse)(client3, props), props.options)); } - return parseInt(input, R2); - } - function parseIPv4(input) { - const parts = input.split("."); - if (parts[parts.length - 1] === "") { - if (parts.length > 1) { - parts.pop(); + /** + * Allow auto-paginating iteration on an unawaited list call, eg: + * + * for await (const item of client.items.list()) { + * console.log(item) + * } + */ + async *[Symbol.asyncIterator]() { + const page = await this; + for await (const item of page) { + yield item; } } - if (parts.length > 4) { - return input; + }; + exports2.PagePromise = PagePromise; + var Page = class extends AbstractPage { + constructor(client2, response, body2, options) { + super(client2, response, body2, options); + this.data = body2.data || []; + this.object = body2.object; } - const numbers = []; - for (const part of parts) { - if (part === "") { - return input; - } - const n12 = parseIPv4Number(part); - if (n12 === failure) { - return input; - } - numbers.push(n12); + getPaginatedItems() { + return this.data ?? []; } - for (let i6 = 0; i6 < numbers.length - 1; ++i6) { - if (numbers[i6] > 255) { - return failure; - } + nextPageRequestOptions() { + return null; } - if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) { - return failure; + }; + exports2.Page = Page; + var CursorPage = class extends AbstractPage { + constructor(client2, response, body2, options) { + super(client2, response, body2, options); + this.data = body2.data || []; + this.has_more = body2.has_more || false; } - let ipv4 = numbers.pop(); - let counter = 0; - for (const n12 of numbers) { - ipv4 += n12 * Math.pow(256, 3 - counter); - ++counter; + getPaginatedItems() { + return this.data ?? []; } - return ipv4; - } - function serializeIPv4(address) { - let output = ""; - let n12 = address; - for (let i6 = 1; i6 <= 4; ++i6) { - output = String(n12 % 256) + output; - if (i6 !== 4) { - output = "." + output; + hasNextPage() { + if (this.has_more === false) { + return false; } - n12 = Math.floor(n12 / 256); + return super.hasNextPage(); } - return output; - } - function parseIPv6(input) { - const address = [0, 0, 0, 0, 0, 0, 0, 0]; - let pieceIndex = 0; - let compress2 = null; - let pointer = 0; - input = punycode.ucs2.decode(input); - if (input[pointer] === 58) { - if (input[pointer + 1] !== 58) { - return failure; + nextPageRequestOptions() { + const data = this.getPaginatedItems(); + const id = data[data.length - 1]?.id; + if (!id) { + return null; } - pointer += 2; - ++pieceIndex; - compress2 = pieceIndex; + return { + ...this.options, + query: { + ...(0, values_1.maybeObj)(this.options.query), + after: id + } + }; } - while (pointer < input.length) { - if (pieceIndex === 8) { - return failure; + }; + exports2.CursorPage = CursorPage; + var ConversationCursorPage = class extends AbstractPage { + constructor(client2, response, body2, options) { + super(client2, response, body2, options); + this.data = body2.data || []; + this.has_more = body2.has_more || false; + this.last_id = body2.last_id || ""; + } + getPaginatedItems() { + return this.data ?? []; + } + hasNextPage() { + if (this.has_more === false) { + return false; } - if (input[pointer] === 58) { - if (compress2 !== null) { - return failure; + return super.hasNextPage(); + } + nextPageRequestOptions() { + const cursor = this.last_id; + if (!cursor) { + return null; + } + return { + ...this.options, + query: { + ...(0, values_1.maybeObj)(this.options.query), + after: cursor } - ++pointer; - ++pieceIndex; - compress2 = pieceIndex; - continue; + }; + } + }; + exports2.ConversationCursorPage = ConversationCursorPage; + var NextCursorPage = class extends AbstractPage { + constructor(client2, response, body2, options) { + super(client2, response, body2, options); + this.data = body2.data || []; + this.has_more = body2.has_more || false; + this.next = body2.next || null; + } + getPaginatedItems() { + return this.data ?? []; + } + hasNextPage() { + if (this.has_more === false) { + return false; } - let value = 0; - let length = 0; - while (length < 4 && isASCIIHex(input[pointer])) { - value = value * 16 + parseInt(at2(input, pointer), 16); - ++pointer; - ++length; + return super.hasNextPage(); + } + nextPageRequestOptions() { + const cursor = this.next; + if (!cursor) { + return null; } - if (input[pointer] === 46) { - if (length === 0) { - return failure; + return { + ...this.options, + query: { + ...(0, values_1.maybeObj)(this.options.query), + after: cursor } - pointer -= length; - if (pieceIndex > 6) { - return failure; + }; + } + }; + exports2.NextCursorPage = NextCursorPage; + } +}); + +// node_modules/openai/auth/workload-identity-auth.js +var require_workload_identity_auth = __commonJS({ + "node_modules/openai/auth/workload-identity-auth.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.WorkloadIdentityAuth = void 0; + var tslib_1 = require_tslib(); + var Shims = tslib_1.__importStar(require_shims()); + var error_1 = require_error2(); + var SUBJECT_TOKEN_TYPES = { + jwt: "urn:ietf:params:oauth:token-type:jwt", + id: "urn:ietf:params:oauth:token-type:id_token" + }; + var TOKEN_EXCHANGE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:token-exchange"; + var WorkloadIdentityAuth = class { + constructor(config, fetch4) { + this.cachedToken = null; + this.refreshPromise = null; + this.tokenExchangeUrl = "https://auth.openai.com/oauth/token"; + this.config = config; + this.fetch = fetch4 ?? Shims.getDefaultFetch(); + } + async getToken() { + if (!this.cachedToken || this.isTokenExpired(this.cachedToken)) { + if (this.refreshPromise) { + return await this.refreshPromise; } - let numbersSeen = 0; - while (input[pointer] !== void 0) { - let ipv4Piece = null; - if (numbersSeen > 0) { - if (input[pointer] === 46 && numbersSeen < 4) { - ++pointer; - } else { - return failure; - } - } - if (!isASCIIDigit(input[pointer])) { - return failure; - } - while (isASCIIDigit(input[pointer])) { - const number = parseInt(at2(input, pointer)); - if (ipv4Piece === null) { - ipv4Piece = number; - } else if (ipv4Piece === 0) { - return failure; - } else { - ipv4Piece = ipv4Piece * 10 + number; - } - if (ipv4Piece > 255) { - return failure; - } - ++pointer; - } - address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; - ++numbersSeen; - if (numbersSeen === 2 || numbersSeen === 4) { - ++pieceIndex; - } + this.refreshPromise = this.refreshToken(); + try { + const token = await this.refreshPromise; + return token; + } finally { + this.refreshPromise = null; } - if (numbersSeen !== 4) { - return failure; + } + if (this.needsRefresh(this.cachedToken) && !this.refreshPromise) { + this.refreshPromise = this.refreshToken().finally(() => { + this.refreshPromise = null; + }); + } + return this.cachedToken.token; + } + async refreshToken() { + const subjectToken = await this.config.provider.getToken(); + const body2 = { + grant_type: TOKEN_EXCHANGE_GRANT_TYPE, + subject_token: subjectToken, + subject_token_type: SUBJECT_TOKEN_TYPES[this.config.provider.tokenType], + identity_provider_id: this.config.identityProviderId, + service_account_id: this.config.serviceAccountId + }; + if (this.config.clientId) { + body2["client_id"] = this.config.clientId; + } + const response = await this.fetch(this.tokenExchangeUrl, { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(body2) + }); + if (!response.ok) { + const errorText = await response.text(); + let body3 = void 0; + try { + body3 = JSON.parse(errorText); + } catch { } - break; - } else if (input[pointer] === 58) { - ++pointer; - if (input[pointer] === void 0) { - return failure; + if (response.status === 400 || response.status === 401 || response.status === 403) { + throw new error_1.OAuthError(response.status, body3, response.headers); } - } else if (input[pointer] !== void 0) { - return failure; + throw error_1.APIError.generate(response.status, body3, `Token exchange failed with status ${response.status}`, response.headers); } - address[pieceIndex] = value; - ++pieceIndex; + const tokenResponse = await response.json(); + const expiresIn = tokenResponse.expires_in || 3600; + const expiresAt = Date.now() + expiresIn * 1e3; + this.cachedToken = { + token: tokenResponse.access_token, + expiresAt + }; + return tokenResponse.access_token; } - if (compress2 !== null) { - let swaps = pieceIndex - compress2; - pieceIndex = 7; - while (pieceIndex !== 0 && swaps > 0) { - const temp = address[compress2 + swaps - 1]; - address[compress2 + swaps - 1] = address[pieceIndex]; - address[pieceIndex] = temp; - --pieceIndex; - --swaps; - } - } else if (compress2 === null && pieceIndex !== 8) { - return failure; + isTokenExpired(cachedToken) { + return Date.now() >= cachedToken.expiresAt; } - return address; + needsRefresh(cachedToken) { + const bufferSeconds = this.config.refreshBufferSeconds ?? 1200; + const bufferMs = bufferSeconds * 1e3; + return Date.now() >= cachedToken.expiresAt - bufferMs; + } + invalidateToken() { + this.cachedToken = null; + this.refreshPromise = null; + } + }; + exports2.WorkloadIdentityAuth = WorkloadIdentityAuth; + } +}); + +// node_modules/openai/internal/uploads.js +var require_uploads = __commonJS({ + "node_modules/openai/internal/uploads.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createForm = exports2.multipartFormRequestOptions = exports2.maybeMultipartFormRequestOptions = exports2.isAsyncIterable = exports2.checkFileSupport = void 0; + exports2.makeFile = makeFile; + exports2.getName = getName; + var shims_1 = require_shims(); + var checkFileSupport = () => { + if (typeof File === "undefined") { + const { process: process5 } = globalThis; + const isOldNode = typeof process5?.versions?.node === "string" && parseInt(process5.versions.node.split(".")) < 20; + throw new Error("`File` is not defined as a global, which is required for file uploads." + (isOldNode ? " Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`." : "")); + } + }; + exports2.checkFileSupport = checkFileSupport; + function makeFile(fileBits, fileName, options) { + (0, exports2.checkFileSupport)(); + return new File(fileBits, fileName ?? "unknown_file", options); } - function serializeIPv6(address) { - let output = ""; - const seqResult = findLongestZeroSequence(address); - const compress2 = seqResult.idx; - let ignore0 = false; - for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { - if (ignore0 && address[pieceIndex] === 0) { - continue; - } else if (ignore0) { - ignore0 = false; - } - if (compress2 === pieceIndex) { - const separator = pieceIndex === 0 ? "::" : ":"; - output += separator; - ignore0 = true; - continue; - } - output += address[pieceIndex].toString(16); - if (pieceIndex !== 7) { - output += ":"; - } - } - return output; + function getName(value) { + return (typeof value === "object" && value !== null && ("name" in value && value.name && String(value.name) || "url" in value && value.url && String(value.url) || "filename" in value && value.filename && String(value.filename) || "path" in value && value.path && String(value.path)) || "").split(/[\\/]/).pop() || void 0; } - function parseHost(input, isSpecialArg) { - if (input[0] === "[") { - if (input[input.length - 1] !== "]") { - return failure; + var isAsyncIterable2 = (value) => value != null && typeof value === "object" && typeof value[Symbol.asyncIterator] === "function"; + exports2.isAsyncIterable = isAsyncIterable2; + var maybeMultipartFormRequestOptions = async (opts, fetch4) => { + if (!hasUploadableValue(opts.body)) + return opts; + return { ...opts, body: await (0, exports2.createForm)(opts.body, fetch4) }; + }; + exports2.maybeMultipartFormRequestOptions = maybeMultipartFormRequestOptions; + var multipartFormRequestOptions = async (opts, fetch4) => { + return { ...opts, body: await (0, exports2.createForm)(opts.body, fetch4) }; + }; + exports2.multipartFormRequestOptions = multipartFormRequestOptions; + var supportsFormDataMap = /* @__PURE__ */ new WeakMap(); + function supportsFormData(fetchObject) { + const fetch4 = typeof fetchObject === "function" ? fetchObject : fetchObject.fetch; + const cached = supportsFormDataMap.get(fetch4); + if (cached) + return cached; + const promise = (async () => { + try { + const FetchResponse = "Response" in fetch4 ? fetch4.Response : (await fetch4("data:,")).constructor; + const data = new FormData(); + if (data.toString() === await new FetchResponse(data).text()) { + return false; + } + return true; + } catch { + return true; } - return parseIPv6(input.substring(1, input.length - 1)); + })(); + supportsFormDataMap.set(fetch4, promise); + return promise; + } + var createForm = async (body2, fetch4) => { + if (!await supportsFormData(fetch4)) { + throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class."); } - if (!isSpecialArg) { - return parseOpaqueHost(input); + const form = new FormData(); + await Promise.all(Object.entries(body2 || {}).map(([key, value]) => addFormValue(form, key, value))); + return form; + }; + exports2.createForm = createForm; + var isNamedBlob = (value) => value instanceof Blob && "name" in value; + var isUploadable = (value) => typeof value === "object" && value !== null && (value instanceof Response || (0, exports2.isAsyncIterable)(value) || isNamedBlob(value)); + var hasUploadableValue = (value) => { + if (isUploadable(value)) + return true; + if (Array.isArray(value)) + return value.some(hasUploadableValue); + if (value && typeof value === "object") { + for (const k7 in value) { + if (hasUploadableValue(value[k7])) + return true; + } } - const domain = utf8PercentDecode(input); - const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false); - if (asciiDomain === null) { - return failure; + return false; + }; + var addFormValue = async (form, key, value) => { + if (value === void 0) + return; + if (value == null) { + throw new TypeError(`Received null for "${key}"; to pass null in FormData, you must use the string 'null'`); } - if (containsForbiddenHostCodePoint(asciiDomain)) { - return failure; + if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { + form.append(key, String(value)); + } else if (value instanceof Response) { + form.append(key, makeFile([await value.blob()], getName(value))); + } else if ((0, exports2.isAsyncIterable)(value)) { + form.append(key, makeFile([await new Response((0, shims_1.ReadableStreamFrom)(value)).blob()], getName(value))); + } else if (isNamedBlob(value)) { + form.append(key, value, getName(value)); + } else if (Array.isArray(value)) { + await Promise.all(value.map((entry) => addFormValue(form, key + "[]", entry))); + } else if (typeof value === "object") { + await Promise.all(Object.entries(value).map(([name, prop]) => addFormValue(form, `${key}[${name}]`, prop))); + } else { + throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value} instead`); } - const ipv4Host = parseIPv4(asciiDomain); - if (typeof ipv4Host === "number" || ipv4Host === failure) { - return ipv4Host; + }; + } +}); + +// node_modules/openai/internal/to-file.js +var require_to_file = __commonJS({ + "node_modules/openai/internal/to-file.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.toFile = toFile; + var uploads_1 = require_uploads(); + var uploads_2 = require_uploads(); + var isBlobLike = (value) => value != null && typeof value === "object" && typeof value.size === "number" && typeof value.type === "string" && typeof value.text === "function" && typeof value.slice === "function" && typeof value.arrayBuffer === "function"; + var isFileLike = (value) => value != null && typeof value === "object" && typeof value.name === "string" && typeof value.lastModified === "number" && isBlobLike(value); + var isResponseLike = (value) => value != null && typeof value === "object" && typeof value.url === "string" && typeof value.blob === "function"; + async function toFile(value, name, options) { + (0, uploads_2.checkFileSupport)(); + value = await value; + if (isFileLike(value)) { + if (value instanceof File) { + return value; + } + return (0, uploads_1.makeFile)([await value.arrayBuffer()], value.name); } - return asciiDomain; - } - function parseOpaqueHost(input) { - if (containsForbiddenHostCodePointExcludingPercent(input)) { - return failure; + if (isResponseLike(value)) { + const blob = await value.blob(); + name || (name = new URL(value.url).pathname.split(/[\\/]/).pop()); + return (0, uploads_1.makeFile)(await getBytes(blob), name, options); } - let output = ""; - const decoded = punycode.ucs2.decode(input); - for (let i6 = 0; i6 < decoded.length; ++i6) { - output += percentEncodeChar(decoded[i6], isC0ControlPercentEncode); + const parts = await getBytes(value); + name || (name = (0, uploads_1.getName)(value)); + if (!options?.type) { + const type = parts.find((part) => typeof part === "object" && "type" in part && part.type); + if (typeof type === "string") { + options = { ...options, type }; + } } - return output; + return (0, uploads_1.makeFile)(parts, name, options); } - function findLongestZeroSequence(arr) { - let maxIdx = null; - let maxLen = 1; - let currStart = null; - let currLen = 0; - for (let i6 = 0; i6 < arr.length; ++i6) { - if (arr[i6] !== 0) { - if (currLen > maxLen) { - maxIdx = currStart; - maxLen = currLen; - } - currStart = null; - currLen = 0; - } else { - if (currStart === null) { - currStart = i6; - } - ++currLen; + async function getBytes(value) { + let parts = []; + if (typeof value === "string" || ArrayBuffer.isView(value) || // includes Uint8Array, Buffer, etc. + value instanceof ArrayBuffer) { + parts.push(value); + } else if (isBlobLike(value)) { + parts.push(value instanceof Blob ? value : await value.arrayBuffer()); + } else if ((0, uploads_1.isAsyncIterable)(value)) { + for await (const chunk of value) { + parts.push(...await getBytes(chunk)); } + } else { + const constructor = value?.constructor?.name; + throw new Error(`Unexpected data type: ${typeof value}${constructor ? `; constructor: ${constructor}` : ""}${propsForError(value)}`); } - if (currLen > maxLen) { - maxIdx = currStart; - maxLen = currLen; - } - return { - idx: maxIdx, - len: maxLen - }; + return parts; } - function serializeHost(host) { - if (typeof host === "number") { - return serializeIPv4(host); + function propsForError(value) { + if (typeof value !== "object" || value === null) + return ""; + const props = Object.getOwnPropertyNames(value); + return `; props: [${props.map((p2) => `"${p2}"`).join(", ")}]`; + } + } +}); + +// node_modules/openai/core/uploads.js +var require_uploads2 = __commonJS({ + "node_modules/openai/core/uploads.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.toFile = void 0; + var to_file_1 = require_to_file(); + Object.defineProperty(exports2, "toFile", { enumerable: true, get: function() { + return to_file_1.toFile; + } }); + } +}); + +// node_modules/openai/core/resource.js +var require_resource = __commonJS({ + "node_modules/openai/core/resource.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.APIResource = void 0; + var APIResource = class { + constructor(client2) { + this._client = client2; } - if (host instanceof Array) { - return "[" + serializeIPv6(host) + "]"; + }; + exports2.APIResource = APIResource; + } +}); + +// node_modules/openai/internal/utils/path.js +var require_path2 = __commonJS({ + "node_modules/openai/internal/utils/path.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.path = exports2.createPathTagFunction = void 0; + exports2.encodeURIPath = encodeURIPath; + var error_1 = require_error2(); + function encodeURIPath(str) { + return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent); + } + var EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null)); + var createPathTagFunction = (pathEncoder = encodeURIPath) => function path10(statics, ...params) { + if (statics.length === 1) + return statics[0]; + let postPath = false; + const invalidSegments = []; + const path11 = statics.reduce((previousValue, currentValue, index2) => { + if (/[?#]/.test(currentValue)) { + postPath = true; + } + const value = params[index2]; + let encoded = (postPath ? encodeURIComponent : pathEncoder)("" + value); + if (index2 !== params.length && (value == null || typeof value === "object" && // handle values from other realms + value.toString === Object.getPrototypeOf(Object.getPrototypeOf(value.hasOwnProperty ?? EMPTY) ?? EMPTY)?.toString)) { + encoded = value + ""; + invalidSegments.push({ + start: previousValue.length + currentValue.length, + length: encoded.length, + error: `Value of type ${Object.prototype.toString.call(value).slice(8, -1)} is not a valid path parameter` + }); + } + return previousValue + currentValue + (index2 === params.length ? "" : encoded); + }, ""); + const pathOnly = path11.split(/[?#]/, 1)[0]; + const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi; + let match3; + while ((match3 = invalidSegmentPattern.exec(pathOnly)) !== null) { + invalidSegments.push({ + start: match3.index, + length: match3[0].length, + error: `Value "${match3[0]}" can't be safely passed as a path parameter` + }); } - return host; - } - function trimControlChars(url2) { - return url2.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, ""); - } - function trimTabAndNewline(url2) { - return url2.replace(/\u0009|\u000A|\u000D/g, ""); - } - function shortenPath(url2) { - const path10 = url2.path; - if (path10.length === 0) { - return; + invalidSegments.sort((a6, b6) => a6.start - b6.start); + if (invalidSegments.length > 0) { + let lastEnd = 0; + const underline = invalidSegments.reduce((acc, segment) => { + const spaces = " ".repeat(segment.start - lastEnd); + const arrows = "^".repeat(segment.length); + lastEnd = segment.start + segment.length; + return acc + spaces + arrows; + }, ""); + throw new error_1.OpenAIError(`Path parameters result in path with invalid segments: +${invalidSegments.map((e6) => e6.error).join("\n")} +${path11} +${underline}`); } - if (url2.scheme === "file" && path10.length === 1 && isNormalizedWindowsDriveLetter(path10[0])) { - return; + return path11; + }; + exports2.createPathTagFunction = createPathTagFunction; + exports2.path = (0, exports2.createPathTagFunction)(encodeURIPath); + } +}); + +// node_modules/openai/resources/chat/completions/messages.js +var require_messages = __commonJS({ + "node_modules/openai/resources/chat/completions/messages.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Messages = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Messages2 = class extends resource_1.APIResource { + /** + * Get the messages in a stored chat completion. Only Chat Completions that have + * been created with the `store` parameter set to `true` will be returned. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const chatCompletionStoreMessage of client.chat.completions.messages.list( + * 'completion_id', + * )) { + * // ... + * } + * ``` + */ + list(completionID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/chat/completions/${completionID}/messages`, pagination_1.CursorPage, { query, ...options, __security: { bearerAuth: true } }); } - path10.pop(); + }; + exports2.Messages = Messages2; + } +}); + +// node_modules/openai/error.js +var require_error3 = __commonJS({ + "node_modules/openai/error.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var tslib_1 = require_tslib(); + tslib_1.__exportStar(require_error2(), exports2); + } +}); + +// node_modules/openai/lib/parser.js +var require_parser3 = __commonJS({ + "node_modules/openai/lib/parser.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isChatCompletionFunctionTool = isChatCompletionFunctionTool; + exports2.makeParseableResponseFormat = makeParseableResponseFormat; + exports2.makeParseableTextFormat = makeParseableTextFormat; + exports2.isAutoParsableResponseFormat = isAutoParsableResponseFormat; + exports2.makeParseableTool = makeParseableTool; + exports2.isAutoParsableTool = isAutoParsableTool; + exports2.maybeParseChatCompletion = maybeParseChatCompletion; + exports2.parseChatCompletion = parseChatCompletion; + exports2.shouldParseToolCall = shouldParseToolCall; + exports2.hasAutoParseableInput = hasAutoParseableInput; + exports2.assertToolCallsAreChatCompletionFunctionToolCalls = assertToolCallsAreChatCompletionFunctionToolCalls; + exports2.validateInputTools = validateInputTools; + var error_1 = require_error3(); + function isChatCompletionFunctionTool(tool) { + return tool !== void 0 && "function" in tool && tool.function !== void 0; } - function includesCredentials(url2) { - return url2.username !== "" || url2.password !== ""; + function makeParseableResponseFormat(response_format, parser3) { + const obj = { ...response_format }; + Object.defineProperties(obj, { + $brand: { + value: "auto-parseable-response-format", + enumerable: false + }, + $parseRaw: { + value: parser3, + enumerable: false + } + }); + return obj; } - function cannotHaveAUsernamePasswordPort(url2) { - return url2.host === null || url2.host === "" || url2.cannotBeABaseURL || url2.scheme === "file"; + function makeParseableTextFormat(response_format, parser3) { + const obj = { ...response_format }; + Object.defineProperties(obj, { + $brand: { + value: "auto-parseable-response-format", + enumerable: false + }, + $parseRaw: { + value: parser3, + enumerable: false + } + }); + return obj; } - function isNormalizedWindowsDriveLetter(string) { - return /^[A-Za-z]:$/.test(string); + function isAutoParsableResponseFormat(response_format) { + return response_format?.["$brand"] === "auto-parseable-response-format"; } - function URLStateMachine(input, base, encodingOverride, url2, stateOverride) { - this.pointer = 0; - this.input = input; - this.base = base || null; - this.encodingOverride = encodingOverride || "utf-8"; - this.stateOverride = stateOverride; - this.url = url2; - this.failure = false; - this.parseError = false; - if (!this.url) { - this.url = { - scheme: "", - username: "", - password: "", - host: null, - port: null, - path: [], - query: null, - fragment: null, - cannotBeABaseURL: false + function makeParseableTool(tool, { parser: parser3, callback }) { + const obj = { ...tool }; + Object.defineProperties(obj, { + $brand: { + value: "auto-parseable-tool", + enumerable: false + }, + $parseRaw: { + value: parser3, + enumerable: false + }, + $callback: { + value: callback, + enumerable: false + } + }); + return obj; + } + function isAutoParsableTool(tool) { + return tool?.["$brand"] === "auto-parseable-tool"; + } + function maybeParseChatCompletion(completion2, params) { + if (!params || !hasAutoParseableInput(params)) { + return { + ...completion2, + choices: completion2.choices.map((choice) => { + assertToolCallsAreChatCompletionFunctionToolCalls(choice.message.tool_calls); + return { + ...choice, + message: { + ...choice.message, + parsed: null, + ...choice.message.tool_calls ? { + tool_calls: choice.message.tool_calls + } : void 0 + } + }; + }) }; - const res2 = trimControlChars(this.input); - if (res2 !== this.input) { - this.parseError = true; + } + return parseChatCompletion(completion2, params); + } + function parseChatCompletion(completion2, params) { + const choices = completion2.choices.map((choice) => { + if (choice.finish_reason === "length") { + throw new error_1.LengthFinishReasonError(); } - this.input = res2; + if (choice.finish_reason === "content_filter") { + throw new error_1.ContentFilterFinishReasonError(); + } + assertToolCallsAreChatCompletionFunctionToolCalls(choice.message.tool_calls); + return { + ...choice, + message: { + ...choice.message, + ...choice.message.tool_calls ? { + tool_calls: choice.message.tool_calls?.map((toolCall) => parseToolCall(params, toolCall)) ?? void 0 + } : void 0, + parsed: choice.message.content && !choice.message.refusal ? parseResponseFormat(params, choice.message.content) : null + } + }; + }); + return { ...completion2, choices }; + } + function parseResponseFormat(params, content) { + if (params.response_format?.type !== "json_schema") { + return null; } - const res = trimTabAndNewline(this.input); - if (res !== this.input) { - this.parseError = true; + if (params.response_format?.type === "json_schema") { + if ("$parseRaw" in params.response_format) { + const response_format = params.response_format; + return response_format.$parseRaw(content); + } + return JSON.parse(content); } - this.input = res; - this.state = stateOverride || "scheme start"; - this.buffer = ""; - this.atFlag = false; - this.arrFlag = false; - this.passwordTokenSeenFlag = false; - this.input = punycode.ucs2.decode(this.input); - for (; this.pointer <= this.input.length; ++this.pointer) { - const c6 = this.input[this.pointer]; - const cStr = isNaN(c6) ? void 0 : String.fromCodePoint(c6); - const ret = this["parse " + this.state](c6, cStr); - if (!ret) { - break; - } else if (ret === failure) { - this.failure = true; - break; + return null; + } + function parseToolCall(params, toolCall) { + const inputTool = params.tools?.find((inputTool2) => isChatCompletionFunctionTool(inputTool2) && inputTool2.function?.name === toolCall.function.name); + return { + ...toolCall, + function: { + ...toolCall.function, + parsed_arguments: isAutoParsableTool(inputTool) ? inputTool.$parseRaw(toolCall.function.arguments) : inputTool?.function.strict ? JSON.parse(toolCall.function.arguments) : null } + }; + } + function shouldParseToolCall(params, toolCall) { + if (!params || !("tools" in params) || !params.tools) { + return false; } + const inputTool = params.tools?.find((inputTool2) => isChatCompletionFunctionTool(inputTool2) && inputTool2.function?.name === toolCall.function.name); + return isChatCompletionFunctionTool(inputTool) && (isAutoParsableTool(inputTool) || inputTool?.function.strict || false); } - URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c6, cStr) { - if (isASCIIAlpha(c6)) { - this.buffer += cStr.toLowerCase(); - this.state = "scheme"; - } else if (!this.stateOverride) { - this.state = "no scheme"; - --this.pointer; - } else { - this.parseError = true; - return failure; + function hasAutoParseableInput(params) { + if (isAutoParsableResponseFormat(params.response_format)) { + return true; } - return true; - }; - URLStateMachine.prototype["parse scheme"] = function parseScheme(c6, cStr) { - if (isASCIIAlphanumeric(c6) || c6 === 43 || c6 === 45 || c6 === 46) { - this.buffer += cStr.toLowerCase(); - } else if (c6 === 58) { - if (this.stateOverride) { - if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { - return false; - } - if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { - return false; - } - if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { - return false; - } - if (this.url.scheme === "file" && (this.url.host === "" || this.url.host === null)) { - return false; - } + return params.tools?.some((t) => isAutoParsableTool(t) || t.type === "function" && t.function.strict === true) ?? false; + } + function assertToolCallsAreChatCompletionFunctionToolCalls(toolCalls) { + for (const toolCall of toolCalls || []) { + if (toolCall.type !== "function") { + throw new error_1.OpenAIError(`Currently only \`function\` tool calls are supported; Received \`${toolCall.type}\``); } - this.url.scheme = this.buffer; - this.buffer = ""; - if (this.stateOverride) { - return false; + } + } + function validateInputTools(tools) { + for (const tool of tools ?? []) { + if (tool.type !== "function") { + throw new error_1.OpenAIError(`Currently only \`function\` tool types support auto-parsing; Received \`${tool.type}\``); } - if (this.url.scheme === "file") { - if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) { - this.parseError = true; - } - this.state = "file"; - } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { - this.state = "special relative or authority"; - } else if (isSpecial(this.url)) { - this.state = "special authority slashes"; - } else if (this.input[this.pointer + 1] === 47) { - this.state = "path or authority"; - ++this.pointer; - } else { - this.url.cannotBeABaseURL = true; - this.url.path.push(""); - this.state = "cannot-be-a-base-URL path"; + if (tool.function.strict !== true) { + throw new error_1.OpenAIError(`The \`${tool.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`); } - } else if (!this.stateOverride) { - this.buffer = ""; - this.state = "no scheme"; - this.pointer = -1; - } else { - this.parseError = true; - return failure; } - return true; + } + } +}); + +// node_modules/openai/lib/chatCompletionUtils.js +var require_chatCompletionUtils = __commonJS({ + "node_modules/openai/lib/chatCompletionUtils.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isToolMessage = exports2.isAssistantMessage = void 0; + exports2.isPresent = isPresent; + var isAssistantMessage = (message) => { + return message?.role === "assistant"; }; - URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c6) { - if (this.base === null || this.base.cannotBeABaseURL && c6 !== 35) { - return failure; - } else if (this.base.cannotBeABaseURL && c6 === 35) { - this.url.scheme = this.base.scheme; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.url.cannotBeABaseURL = true; - this.state = "fragment"; - } else if (this.base.scheme === "file") { - this.state = "file"; - --this.pointer; - } else { - this.state = "relative"; - --this.pointer; - } - return true; + exports2.isAssistantMessage = isAssistantMessage; + var isToolMessage = (message) => { + return message?.role === "tool"; }; - URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c6) { - if (c6 === 47 && this.input[this.pointer + 1] === 47) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "relative"; - --this.pointer; + exports2.isToolMessage = isToolMessage; + function isPresent(obj) { + return obj != null; + } + } +}); + +// node_modules/openai/lib/EventStream.js +var require_EventStream = __commonJS({ + "node_modules/openai/lib/EventStream.js"(exports2) { + "use strict"; + var _EventStream_instances; + var _EventStream_connectedPromise; + var _EventStream_resolveConnectedPromise; + var _EventStream_rejectConnectedPromise; + var _EventStream_endPromise; + var _EventStream_resolveEndPromise; + var _EventStream_rejectEndPromise; + var _EventStream_listeners; + var _EventStream_ended; + var _EventStream_errored; + var _EventStream_aborted; + var _EventStream_catchingPromiseCreated; + var _EventStream_handleError; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.EventStream = void 0; + var tslib_1 = require_tslib(); + var error_1 = require_error3(); + var EventStream = class { + constructor() { + _EventStream_instances.add(this); + this.controller = new AbortController(); + _EventStream_connectedPromise.set(this, void 0); + _EventStream_resolveConnectedPromise.set(this, () => { + }); + _EventStream_rejectConnectedPromise.set(this, () => { + }); + _EventStream_endPromise.set(this, void 0); + _EventStream_resolveEndPromise.set(this, () => { + }); + _EventStream_rejectEndPromise.set(this, () => { + }); + _EventStream_listeners.set(this, {}); + _EventStream_ended.set(this, false); + _EventStream_errored.set(this, false); + _EventStream_aborted.set(this, false); + _EventStream_catchingPromiseCreated.set(this, false); + tslib_1.__classPrivateFieldSet(this, _EventStream_connectedPromise, new Promise((resolve8, reject2) => { + tslib_1.__classPrivateFieldSet(this, _EventStream_resolveConnectedPromise, resolve8, "f"); + tslib_1.__classPrivateFieldSet(this, _EventStream_rejectConnectedPromise, reject2, "f"); + }), "f"); + tslib_1.__classPrivateFieldSet(this, _EventStream_endPromise, new Promise((resolve8, reject2) => { + tslib_1.__classPrivateFieldSet(this, _EventStream_resolveEndPromise, resolve8, "f"); + tslib_1.__classPrivateFieldSet(this, _EventStream_rejectEndPromise, reject2, "f"); + }), "f"); + tslib_1.__classPrivateFieldGet(this, _EventStream_connectedPromise, "f").catch(() => { + }); + tslib_1.__classPrivateFieldGet(this, _EventStream_endPromise, "f").catch(() => { + }); } - return true; - }; - URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c6) { - if (c6 === 47) { - this.state = "authority"; - } else { - this.state = "path"; - --this.pointer; + _run(executor) { + setTimeout(() => { + executor().then(() => { + this._emitFinal(); + this._emit("end"); + }, tslib_1.__classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_handleError).bind(this)); + }, 0); } - return true; - }; - URLStateMachine.prototype["parse relative"] = function parseRelative(c6) { - this.url.scheme = this.base.scheme; - if (isNaN(c6)) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - } else if (c6 === 47) { - this.state = "relative slash"; - } else if (c6 === 63) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = ""; - this.state = "query"; - } else if (c6 === 35) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.state = "fragment"; - } else if (isSpecial(this.url) && c6 === 92) { - this.parseError = true; - this.state = "relative slash"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(0, this.base.path.length - 1); - this.state = "path"; - --this.pointer; + _connected() { + if (this.ended) + return; + tslib_1.__classPrivateFieldGet(this, _EventStream_resolveConnectedPromise, "f").call(this); + this._emit("connect"); } - return true; - }; - URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c6) { - if (isSpecial(this.url) && (c6 === 47 || c6 === 92)) { - if (c6 === 92) { - this.parseError = true; - } - this.state = "special authority ignore slashes"; - } else if (c6 === 47) { - this.state = "authority"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.state = "path"; - --this.pointer; + get ended() { + return tslib_1.__classPrivateFieldGet(this, _EventStream_ended, "f"); } - return true; - }; - URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c6) { - if (c6 === 47 && this.input[this.pointer + 1] === 47) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "special authority ignore slashes"; - --this.pointer; + get errored() { + return tslib_1.__classPrivateFieldGet(this, _EventStream_errored, "f"); } - return true; - }; - URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c6) { - if (c6 !== 47 && c6 !== 92) { - this.state = "authority"; - --this.pointer; - } else { - this.parseError = true; + get aborted() { + return tslib_1.__classPrivateFieldGet(this, _EventStream_aborted, "f"); } - return true; - }; - URLStateMachine.prototype["parse authority"] = function parseAuthority(c6, cStr) { - if (c6 === 64) { - this.parseError = true; - if (this.atFlag) { - this.buffer = "%40" + this.buffer; - } - this.atFlag = true; - const len = countSymbols(this.buffer); - for (let pointer = 0; pointer < len; ++pointer) { - const codePoint = this.buffer.codePointAt(pointer); - if (codePoint === 58 && !this.passwordTokenSeenFlag) { - this.passwordTokenSeenFlag = true; - continue; - } - const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode); - if (this.passwordTokenSeenFlag) { - this.url.password += encodedCodePoints; - } else { - this.url.username += encodedCodePoints; - } - } - this.buffer = ""; - } else if (isNaN(c6) || c6 === 47 || c6 === 63 || c6 === 35 || isSpecial(this.url) && c6 === 92) { - if (this.atFlag && this.buffer === "") { - this.parseError = true; - return failure; - } - this.pointer -= countSymbols(this.buffer) + 1; - this.buffer = ""; - this.state = "host"; - } else { - this.buffer += cStr; + abort() { + this.controller.abort(); } - return true; - }; - URLStateMachine.prototype["parse hostname"] = URLStateMachine.prototype["parse host"] = function parseHostName(c6, cStr) { - if (this.stateOverride && this.url.scheme === "file") { - --this.pointer; - this.state = "file host"; - } else if (c6 === 58 && !this.arrFlag) { - if (this.buffer === "") { - this.parseError = true; - return failure; - } - const host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - this.url.host = host; - this.buffer = ""; - this.state = "port"; - if (this.stateOverride === "hostname") { - return false; - } - } else if (isNaN(c6) || c6 === 47 || c6 === 63 || c6 === 35 || isSpecial(this.url) && c6 === 92) { - --this.pointer; - if (isSpecial(this.url) && this.buffer === "") { - this.parseError = true; - return failure; - } else if (this.stateOverride && this.buffer === "" && (includesCredentials(this.url) || this.url.port !== null)) { - this.parseError = true; - return false; - } - const host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - this.url.host = host; - this.buffer = ""; - this.state = "path start"; - if (this.stateOverride) { - return false; - } - } else { - if (c6 === 91) { - this.arrFlag = true; - } else if (c6 === 93) { - this.arrFlag = false; - } - this.buffer += cStr; + /** + * Adds the listener function to the end of the listeners array for the event. + * No checks are made to see if the listener has already been added. Multiple calls passing + * the same combination of event and listener will result in the listener being added, and + * called, multiple times. + * @returns this ChatCompletionStream, so that calls can be chained + */ + on(event, listener) { + const listeners = tslib_1.__classPrivateFieldGet(this, _EventStream_listeners, "f")[event] || (tslib_1.__classPrivateFieldGet(this, _EventStream_listeners, "f")[event] = []); + listeners.push({ listener }); + return this; } - return true; - }; - URLStateMachine.prototype["parse port"] = function parsePort(c6, cStr) { - if (isASCIIDigit(c6)) { - this.buffer += cStr; - } else if (isNaN(c6) || c6 === 47 || c6 === 63 || c6 === 35 || isSpecial(this.url) && c6 === 92 || this.stateOverride) { - if (this.buffer !== "") { - const port = parseInt(this.buffer); - if (port > Math.pow(2, 16) - 1) { - this.parseError = true; - return failure; - } - this.url.port = port === defaultPort(this.url.scheme) ? null : port; - this.buffer = ""; - } - if (this.stateOverride) { - return false; - } - this.state = "path start"; - --this.pointer; - } else { - this.parseError = true; - return failure; + /** + * Removes the specified listener from the listener array for the event. + * off() will remove, at most, one instance of a listener from the listener array. If any single + * listener has been added multiple times to the listener array for the specified event, then + * off() must be called multiple times to remove each instance. + * @returns this ChatCompletionStream, so that calls can be chained + */ + off(event, listener) { + const listeners = tslib_1.__classPrivateFieldGet(this, _EventStream_listeners, "f")[event]; + if (!listeners) + return this; + const index2 = listeners.findIndex((l3) => l3.listener === listener); + if (index2 >= 0) + listeners.splice(index2, 1); + return this; } - return true; - }; - var fileOtherwiseCodePoints = /* @__PURE__ */ new Set([47, 92, 63, 35]); - URLStateMachine.prototype["parse file"] = function parseFile(c6) { - this.url.scheme = "file"; - if (c6 === 47 || c6 === 92) { - if (c6 === 92) { - this.parseError = true; - } - this.state = "file slash"; - } else if (this.base !== null && this.base.scheme === "file") { - if (isNaN(c6)) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - } else if (c6 === 63) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = ""; - this.state = "query"; - } else if (c6 === 35) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.state = "fragment"; - } else { - if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points - !isWindowsDriveLetterCodePoints(c6, this.input[this.pointer + 1]) || this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points - !fileOtherwiseCodePoints.has(this.input[this.pointer + 2])) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - shortenPath(this.url); - } else { - this.parseError = true; - } - this.state = "path"; - --this.pointer; - } - } else { - this.state = "path"; - --this.pointer; + /** + * Adds a one-time listener function for the event. The next time the event is triggered, + * this listener is removed and then invoked. + * @returns this ChatCompletionStream, so that calls can be chained + */ + once(event, listener) { + const listeners = tslib_1.__classPrivateFieldGet(this, _EventStream_listeners, "f")[event] || (tslib_1.__classPrivateFieldGet(this, _EventStream_listeners, "f")[event] = []); + listeners.push({ listener, once: true }); + return this; } - return true; - }; - URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c6) { - if (c6 === 47 || c6 === 92) { - if (c6 === 92) { - this.parseError = true; - } - this.state = "file host"; - } else { - if (this.base !== null && this.base.scheme === "file") { - if (isNormalizedWindowsDriveLetterString(this.base.path[0])) { - this.url.path.push(this.base.path[0]); - } else { - this.url.host = this.base.host; - } - } - this.state = "path"; - --this.pointer; + /** + * This is similar to `.once()`, but returns a Promise that resolves the next time + * the event is triggered, instead of calling a listener callback. + * @returns a Promise that resolves the next time given event is triggered, + * or rejects if an error is emitted. (If you request the 'error' event, + * returns a promise that resolves with the error). + * + * Example: + * + * const message = await stream.emitted('message') // rejects if the stream errors + */ + emitted(event) { + return new Promise((resolve8, reject2) => { + tslib_1.__classPrivateFieldSet(this, _EventStream_catchingPromiseCreated, true, "f"); + if (event !== "error") + this.once("error", reject2); + this.once(event, resolve8); + }); } - return true; - }; - URLStateMachine.prototype["parse file host"] = function parseFileHost(c6, cStr) { - if (isNaN(c6) || c6 === 47 || c6 === 92 || c6 === 63 || c6 === 35) { - --this.pointer; - if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { - this.parseError = true; - this.state = "path"; - } else if (this.buffer === "") { - this.url.host = ""; - if (this.stateOverride) { - return false; - } - this.state = "path start"; - } else { - let host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - if (host === "localhost") { - host = ""; - } - this.url.host = host; - if (this.stateOverride) { - return false; - } - this.buffer = ""; - this.state = "path start"; - } - } else { - this.buffer += cStr; + async done() { + tslib_1.__classPrivateFieldSet(this, _EventStream_catchingPromiseCreated, true, "f"); + await tslib_1.__classPrivateFieldGet(this, _EventStream_endPromise, "f"); } - return true; - }; - URLStateMachine.prototype["parse path start"] = function parsePathStart(c6) { - if (isSpecial(this.url)) { - if (c6 === 92) { - this.parseError = true; - } - this.state = "path"; - if (c6 !== 47 && c6 !== 92) { - --this.pointer; + _emit(event, ...args) { + if (tslib_1.__classPrivateFieldGet(this, _EventStream_ended, "f")) { + return; } - } else if (!this.stateOverride && c6 === 63) { - this.url.query = ""; - this.state = "query"; - } else if (!this.stateOverride && c6 === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } else if (c6 !== void 0) { - this.state = "path"; - if (c6 !== 47) { - --this.pointer; + if (event === "end") { + tslib_1.__classPrivateFieldSet(this, _EventStream_ended, true, "f"); + tslib_1.__classPrivateFieldGet(this, _EventStream_resolveEndPromise, "f").call(this); } - } - return true; - }; - URLStateMachine.prototype["parse path"] = function parsePath(c6) { - if (isNaN(c6) || c6 === 47 || isSpecial(this.url) && c6 === 92 || !this.stateOverride && (c6 === 63 || c6 === 35)) { - if (isSpecial(this.url) && c6 === 92) { - this.parseError = true; + const listeners = tslib_1.__classPrivateFieldGet(this, _EventStream_listeners, "f")[event]; + if (listeners) { + tslib_1.__classPrivateFieldGet(this, _EventStream_listeners, "f")[event] = listeners.filter((l3) => !l3.once); + listeners.forEach(({ listener }) => listener(...args)); } - if (isDoubleDot(this.buffer)) { - shortenPath(this.url); - if (c6 !== 47 && !(isSpecial(this.url) && c6 === 92)) { - this.url.path.push(""); - } - } else if (isSingleDot(this.buffer) && c6 !== 47 && !(isSpecial(this.url) && c6 === 92)) { - this.url.path.push(""); - } else if (!isSingleDot(this.buffer)) { - if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { - if (this.url.host !== "" && this.url.host !== null) { - this.parseError = true; - this.url.host = ""; - } - this.buffer = this.buffer[0] + ":"; + if (event === "abort") { + const error2 = args[0]; + if (!tslib_1.__classPrivateFieldGet(this, _EventStream_catchingPromiseCreated, "f") && !listeners?.length) { + Promise.reject(error2); } - this.url.path.push(this.buffer); + tslib_1.__classPrivateFieldGet(this, _EventStream_rejectConnectedPromise, "f").call(this, error2); + tslib_1.__classPrivateFieldGet(this, _EventStream_rejectEndPromise, "f").call(this, error2); + this._emit("end"); + return; } - this.buffer = ""; - if (this.url.scheme === "file" && (c6 === void 0 || c6 === 63 || c6 === 35)) { - while (this.url.path.length > 1 && this.url.path[0] === "") { - this.parseError = true; - this.url.path.shift(); + if (event === "error") { + const error2 = args[0]; + if (!tslib_1.__classPrivateFieldGet(this, _EventStream_catchingPromiseCreated, "f") && !listeners?.length) { + Promise.reject(error2); } + tslib_1.__classPrivateFieldGet(this, _EventStream_rejectConnectedPromise, "f").call(this, error2); + tslib_1.__classPrivateFieldGet(this, _EventStream_rejectEndPromise, "f").call(this, error2); + this._emit("end"); } - if (c6 === 63) { - this.url.query = ""; - this.state = "query"; - } - if (c6 === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - if (c6 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - this.buffer += percentEncodeChar(c6, isPathPercentEncode); } - return true; - }; - URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c6) { - if (c6 === 63) { - this.url.query = ""; - this.state = "query"; - } else if (c6 === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } else { - if (!isNaN(c6) && c6 !== 37) { - this.parseError = true; - } - if (c6 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - if (!isNaN(c6)) { - this.url.path[0] = this.url.path[0] + percentEncodeChar(c6, isC0ControlPercentEncode); - } + _emitFinal() { } - return true; }; - URLStateMachine.prototype["parse query"] = function parseQuery(c6, cStr) { - if (isNaN(c6) || !this.stateOverride && c6 === 35) { - if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { - this.encodingOverride = "utf-8"; - } - const buffer2 = new Buffer(this.buffer); - for (let i6 = 0; i6 < buffer2.length; ++i6) { - if (buffer2[i6] < 33 || buffer2[i6] > 126 || buffer2[i6] === 34 || buffer2[i6] === 35 || buffer2[i6] === 60 || buffer2[i6] === 62) { - this.url.query += percentEncode(buffer2[i6]); - } else { - this.url.query += String.fromCodePoint(buffer2[i6]); - } - } - this.buffer = ""; - if (c6 === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - if (c6 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - this.buffer += cStr; + exports2.EventStream = EventStream; + _EventStream_connectedPromise = /* @__PURE__ */ new WeakMap(), _EventStream_resolveConnectedPromise = /* @__PURE__ */ new WeakMap(), _EventStream_rejectConnectedPromise = /* @__PURE__ */ new WeakMap(), _EventStream_endPromise = /* @__PURE__ */ new WeakMap(), _EventStream_resolveEndPromise = /* @__PURE__ */ new WeakMap(), _EventStream_rejectEndPromise = /* @__PURE__ */ new WeakMap(), _EventStream_listeners = /* @__PURE__ */ new WeakMap(), _EventStream_ended = /* @__PURE__ */ new WeakMap(), _EventStream_errored = /* @__PURE__ */ new WeakMap(), _EventStream_aborted = /* @__PURE__ */ new WeakMap(), _EventStream_catchingPromiseCreated = /* @__PURE__ */ new WeakMap(), _EventStream_instances = /* @__PURE__ */ new WeakSet(), _EventStream_handleError = function _EventStream_handleError2(error2) { + tslib_1.__classPrivateFieldSet(this, _EventStream_errored, true, "f"); + if (error2 instanceof Error && error2.name === "AbortError") { + error2 = new error_1.APIUserAbortError(); } - return true; - }; - URLStateMachine.prototype["parse fragment"] = function parseFragment(c6) { - if (isNaN(c6)) { - } else if (c6 === 0) { - this.parseError = true; - } else { - if (c6 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - this.url.fragment += percentEncodeChar(c6, isC0ControlPercentEncode); + if (error2 instanceof error_1.APIUserAbortError) { + tslib_1.__classPrivateFieldSet(this, _EventStream_aborted, true, "f"); + return this._emit("abort", error2); } - return true; - }; - function serializeURL(url2, excludeFragment) { - let output = url2.scheme + ":"; - if (url2.host !== null) { - output += "//"; - if (url2.username !== "" || url2.password !== "") { - output += url2.username; - if (url2.password !== "") { - output += ":" + url2.password; - } - output += "@"; - } - output += serializeHost(url2.host); - if (url2.port !== null) { - output += ":" + url2.port; - } - } else if (url2.host === null && url2.scheme === "file") { - output += "//"; - } - if (url2.cannotBeABaseURL) { - output += url2.path[0]; - } else { - for (const string of url2.path) { - output += "/" + string; - } - } - if (url2.query !== null) { - output += "?" + url2.query; - } - if (!excludeFragment && url2.fragment !== null) { - output += "#" + url2.fragment; - } - return output; - } - function serializeOrigin(tuple) { - let result = tuple.scheme + "://"; - result += serializeHost(tuple.host); - if (tuple.port !== null) { - result += ":" + tuple.port; - } - return result; - } - module.exports.serializeURL = serializeURL; - module.exports.serializeURLOrigin = function(url2) { - switch (url2.scheme) { - case "blob": - try { - return module.exports.serializeURLOrigin(module.exports.parseURL(url2.path[0])); - } catch (e6) { - return "null"; - } - case "ftp": - case "gopher": - case "http": - case "https": - case "ws": - case "wss": - return serializeOrigin({ - scheme: url2.scheme, - host: url2.host, - port: url2.port - }); - case "file": - return "file://"; - default: - return "null"; - } - }; - module.exports.basicURLParse = function(input, options) { - if (options === void 0) { - options = {}; - } - const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); - if (usm.failure) { - return "failure"; - } - return usm.url; - }; - module.exports.setTheUsername = function(url2, username) { - url2.username = ""; - const decoded = punycode.ucs2.decode(username); - for (let i6 = 0; i6 < decoded.length; ++i6) { - url2.username += percentEncodeChar(decoded[i6], isUserinfoPercentEncode); + if (error2 instanceof error_1.OpenAIError) { + return this._emit("error", error2); } - }; - module.exports.setThePassword = function(url2, password) { - url2.password = ""; - const decoded = punycode.ucs2.decode(password); - for (let i6 = 0; i6 < decoded.length; ++i6) { - url2.password += percentEncodeChar(decoded[i6], isUserinfoPercentEncode); + if (error2 instanceof Error) { + const openAIError = new error_1.OpenAIError(error2.message); + openAIError.cause = error2; + return this._emit("error", openAIError); } + return this._emit("error", new error_1.OpenAIError(String(error2))); }; - module.exports.serializeHost = serializeHost; - module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; - module.exports.serializeInteger = function(integer) { - return String(integer); - }; - module.exports.parseURL = function(input, options) { - if (options === void 0) { - options = {}; + } +}); + +// node_modules/openai/lib/RunnableFunction.js +var require_RunnableFunction = __commonJS({ + "node_modules/openai/lib/RunnableFunction.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ParsingToolFunction = void 0; + exports2.isRunnableFunctionWithParse = isRunnableFunctionWithParse; + function isRunnableFunctionWithParse(fn) { + return typeof fn.parse === "function"; + } + var ParsingToolFunction = class { + constructor(input) { + this.type = "function"; + this.function = input; } - return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); }; + exports2.ParsingToolFunction = ParsingToolFunction; } }); -// node_modules/whatwg-url/lib/URL-impl.js -var require_URL_impl = __commonJS({ - "node_modules/whatwg-url/lib/URL-impl.js"(exports2) { +// node_modules/openai/lib/AbstractChatCompletionRunner.js +var require_AbstractChatCompletionRunner = __commonJS({ + "node_modules/openai/lib/AbstractChatCompletionRunner.js"(exports2) { "use strict"; - var usm = require_url_state_machine(); - exports2.implementation = class URLImpl { - constructor(constructorArgs) { - const url2 = constructorArgs[0]; - const base = constructorArgs[1]; - let parsedBase = null; - if (base !== void 0) { - parsedBase = usm.basicURLParse(base); - if (parsedBase === "failure") { - throw new TypeError("Invalid base URL"); - } - } - const parsedURL = usm.basicURLParse(url2, { baseURL: parsedBase }); - if (parsedURL === "failure") { - throw new TypeError("Invalid URL"); - } - this._url = parsedURL; + var _AbstractChatCompletionRunner_instances; + var _AbstractChatCompletionRunner_getFinalContent; + var _AbstractChatCompletionRunner_getFinalMessage; + var _AbstractChatCompletionRunner_getFinalFunctionToolCall; + var _AbstractChatCompletionRunner_getFinalFunctionToolCallResult; + var _AbstractChatCompletionRunner_calculateTotalUsage; + var _AbstractChatCompletionRunner_validateParams; + var _AbstractChatCompletionRunner_stringifyFunctionCallResult; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AbstractChatCompletionRunner = void 0; + var tslib_1 = require_tslib(); + var error_1 = require_error3(); + var parser_1 = require_parser3(); + var chatCompletionUtils_1 = require_chatCompletionUtils(); + var EventStream_1 = require_EventStream(); + var RunnableFunction_1 = require_RunnableFunction(); + var DEFAULT_MAX_CHAT_COMPLETIONS = 10; + var AbstractChatCompletionRunner = class extends EventStream_1.EventStream { + constructor() { + super(...arguments); + _AbstractChatCompletionRunner_instances.add(this); + this._chatCompletions = []; + this.messages = []; } - get href() { - return usm.serializeURL(this._url); + _addChatCompletion(chatCompletion) { + this._chatCompletions.push(chatCompletion); + this._emit("chatCompletion", chatCompletion); + const message = chatCompletion.choices[0]?.message; + if (message) + this._addMessage(message); + return chatCompletion; } - set href(v8) { - const parsedURL = usm.basicURLParse(v8); - if (parsedURL === "failure") { - throw new TypeError("Invalid URL"); + _addMessage(message, emit = true) { + if (!("content" in message)) + message.content = null; + this.messages.push(message); + if (emit) { + this._emit("message", message); + if ((0, chatCompletionUtils_1.isToolMessage)(message) && message.content) { + this._emit("functionToolCallResult", message.content); + } else if ((0, chatCompletionUtils_1.isAssistantMessage)(message) && message.tool_calls) { + for (const tool_call of message.tool_calls) { + if (tool_call.type === "function") { + this._emit("functionToolCall", tool_call.function); + } + } + } } - this._url = parsedURL; - } - get origin() { - return usm.serializeURLOrigin(this._url); - } - get protocol() { - return this._url.scheme + ":"; } - set protocol(v8) { - usm.basicURLParse(v8 + ":", { url: this._url, stateOverride: "scheme start" }); - } - get username() { - return this._url.username; + /** + * @returns a promise that resolves with the final ChatCompletion, or rejects + * if an error occurred or the stream ended prematurely without producing a ChatCompletion. + */ + async finalChatCompletion() { + await this.done(); + const completion2 = this._chatCompletions[this._chatCompletions.length - 1]; + if (!completion2) + throw new error_1.OpenAIError("stream ended without producing a ChatCompletion"); + return completion2; } - set username(v8) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - usm.setTheUsername(this._url, v8); + /** + * @returns a promise that resolves with the content of the final ChatCompletionMessage, or rejects + * if an error occurred or the stream ended prematurely without producing a ChatCompletionMessage. + */ + async finalContent() { + await this.done(); + return tslib_1.__classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalContent).call(this); } - get password() { - return this._url.password; + /** + * @returns a promise that resolves with the the final assistant ChatCompletionMessage response, + * or rejects if an error occurred or the stream ended prematurely without producing a ChatCompletionMessage. + */ + async finalMessage() { + await this.done(); + return tslib_1.__classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this); } - set password(v8) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - usm.setThePassword(this._url, v8); + /** + * @returns a promise that resolves with the content of the final FunctionCall, or rejects + * if an error occurred or the stream ended prematurely without producing a ChatCompletionMessage. + */ + async finalFunctionToolCall() { + await this.done(); + return tslib_1.__classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCall).call(this); } - get host() { - const url2 = this._url; - if (url2.host === null) { - return ""; - } - if (url2.port === null) { - return usm.serializeHost(url2.host); - } - return usm.serializeHost(url2.host) + ":" + usm.serializeInteger(url2.port); + async finalFunctionToolCallResult() { + await this.done(); + return tslib_1.__classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCallResult).call(this); } - set host(v8) { - if (this._url.cannotBeABaseURL) { - return; - } - usm.basicURLParse(v8, { url: this._url, stateOverride: "host" }); + async totalUsage() { + await this.done(); + return tslib_1.__classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_calculateTotalUsage).call(this); } - get hostname() { - if (this._url.host === null) { - return ""; - } - return usm.serializeHost(this._url.host); + allChatCompletions() { + return [...this._chatCompletions]; } - set hostname(v8) { - if (this._url.cannotBeABaseURL) { - return; + _emitFinal() { + const completion2 = this._chatCompletions[this._chatCompletions.length - 1]; + if (completion2) + this._emit("finalChatCompletion", completion2); + const finalMessage = tslib_1.__classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this); + if (finalMessage) + this._emit("finalMessage", finalMessage); + const finalContent = tslib_1.__classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalContent).call(this); + if (finalContent) + this._emit("finalContent", finalContent); + const finalFunctionCall = tslib_1.__classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCall).call(this); + if (finalFunctionCall) + this._emit("finalFunctionToolCall", finalFunctionCall); + const finalFunctionCallResult = tslib_1.__classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionToolCallResult).call(this); + if (finalFunctionCallResult != null) + this._emit("finalFunctionToolCallResult", finalFunctionCallResult); + if (this._chatCompletions.some((c6) => c6.usage)) { + this._emit("totalUsage", tslib_1.__classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_calculateTotalUsage).call(this)); } - usm.basicURLParse(v8, { url: this._url, stateOverride: "hostname" }); } - get port() { - if (this._url.port === null) { - return ""; + async _createChatCompletion(client2, params, options) { + const signal = options?.signal; + if (signal) { + if (signal.aborted) + this.controller.abort(); + signal.addEventListener("abort", () => this.controller.abort()); } - return usm.serializeInteger(this._url.port); + tslib_1.__classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_validateParams).call(this, params); + const chatCompletion = await client2.chat.completions.create({ ...params, stream: false }, { ...options, signal: this.controller.signal }); + this._connected(); + return this._addChatCompletion((0, parser_1.parseChatCompletion)(chatCompletion, params)); } - set port(v8) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - if (v8 === "") { - this._url.port = null; - } else { - usm.basicURLParse(v8, { url: this._url, stateOverride: "port" }); + async _runChatCompletion(client2, params, options) { + for (const message of params.messages) { + this._addMessage(message, false); } + return await this._createChatCompletion(client2, params, options); } - get pathname() { - if (this._url.cannotBeABaseURL) { - return this._url.path[0]; + async _runTools(client2, params, options) { + const role = "tool"; + const { tool_choice = "auto", stream: stream5, ...restParams } = params; + const singleFunctionToCall = typeof tool_choice !== "string" && tool_choice.type === "function" && tool_choice?.function?.name; + const { maxChatCompletions = DEFAULT_MAX_CHAT_COMPLETIONS } = options || {}; + const inputTools = params.tools.map((tool) => { + if ((0, parser_1.isAutoParsableTool)(tool)) { + if (!tool.$callback) { + throw new error_1.OpenAIError("Tool given to `.runTools()` that does not have an associated function"); + } + return { + type: "function", + function: { + function: tool.$callback, + name: tool.function.name, + description: tool.function.description || "", + parameters: tool.function.parameters, + parse: tool.$parseRaw, + strict: true + } + }; + } + return tool; + }); + const functionsByName = {}; + for (const f6 of inputTools) { + if (f6.type === "function") { + functionsByName[f6.function.name || f6.function.function.name] = f6.function; + } } - if (this._url.path.length === 0) { - return ""; + const tools = "tools" in params ? inputTools.map((t) => t.type === "function" ? { + type: "function", + function: { + name: t.function.name || t.function.function.name, + parameters: t.function.parameters, + description: t.function.description, + strict: t.function.strict + } + } : t) : void 0; + for (const message of params.messages) { + this._addMessage(message, false); } - return "/" + this._url.path.join("/"); - } - set pathname(v8) { - if (this._url.cannotBeABaseURL) { - return; + for (let i6 = 0; i6 < maxChatCompletions; ++i6) { + const chatCompletion = await this._createChatCompletion(client2, { + ...restParams, + tool_choice, + tools, + messages: [...this.messages] + }, options); + const message = chatCompletion.choices[0]?.message; + if (!message) { + throw new error_1.OpenAIError(`missing message in ChatCompletion response`); + } + if (!message.tool_calls?.length) { + return; + } + for (const tool_call of message.tool_calls) { + if (tool_call.type !== "function") + continue; + const tool_call_id = tool_call.id; + const { name, arguments: args } = tool_call.function; + const fn = functionsByName[name]; + if (!fn) { + const content2 = `Invalid tool_call: ${JSON.stringify(name)}. Available options are: ${Object.keys(functionsByName).map((name2) => JSON.stringify(name2)).join(", ")}. Please try again`; + this._addMessage({ role, tool_call_id, content: content2 }); + continue; + } else if (singleFunctionToCall && singleFunctionToCall !== name) { + const content2 = `Invalid tool_call: ${JSON.stringify(name)}. ${JSON.stringify(singleFunctionToCall)} requested. Please try again`; + this._addMessage({ role, tool_call_id, content: content2 }); + continue; + } + let parsed; + try { + parsed = (0, RunnableFunction_1.isRunnableFunctionWithParse)(fn) ? await fn.parse(args) : args; + } catch (error2) { + const content2 = error2 instanceof Error ? error2.message : String(error2); + this._addMessage({ role, tool_call_id, content: content2 }); + continue; + } + const rawContent2 = await fn.function(parsed, this); + const content = tslib_1.__classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_stringifyFunctionCallResult).call(this, rawContent2); + this._addMessage({ role, tool_call_id, content }); + if (singleFunctionToCall) { + return; + } + } } - this._url.path = []; - usm.basicURLParse(v8, { url: this._url, stateOverride: "path start" }); + return; } - get search() { - if (this._url.query === null || this._url.query === "") { - return ""; + }; + exports2.AbstractChatCompletionRunner = AbstractChatCompletionRunner; + _AbstractChatCompletionRunner_instances = /* @__PURE__ */ new WeakSet(), _AbstractChatCompletionRunner_getFinalContent = function _AbstractChatCompletionRunner_getFinalContent2() { + return tslib_1.__classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this).content ?? null; + }, _AbstractChatCompletionRunner_getFinalMessage = function _AbstractChatCompletionRunner_getFinalMessage2() { + let i6 = this.messages.length; + while (i6-- > 0) { + const message = this.messages[i6]; + if ((0, chatCompletionUtils_1.isAssistantMessage)(message)) { + const ret = { + ...message, + content: message.content ?? null, + refusal: message.refusal ?? null + }; + return ret; } - return "?" + this._url.query; } - set search(v8) { - const url2 = this._url; - if (v8 === "") { - url2.query = null; - return; + throw new error_1.OpenAIError("stream ended without producing a ChatCompletionMessage with role=assistant"); + }, _AbstractChatCompletionRunner_getFinalFunctionToolCall = function _AbstractChatCompletionRunner_getFinalFunctionToolCall2() { + for (let i6 = this.messages.length - 1; i6 >= 0; i6--) { + const message = this.messages[i6]; + if ((0, chatCompletionUtils_1.isAssistantMessage)(message) && message?.tool_calls?.length) { + return message.tool_calls.filter((x2) => x2.type === "function").at(-1)?.function; } - const input = v8[0] === "?" ? v8.substring(1) : v8; - url2.query = ""; - usm.basicURLParse(input, { url: url2, stateOverride: "query" }); } - get hash() { - if (this._url.fragment === null || this._url.fragment === "") { - return ""; + return; + }, _AbstractChatCompletionRunner_getFinalFunctionToolCallResult = function _AbstractChatCompletionRunner_getFinalFunctionToolCallResult2() { + for (let i6 = this.messages.length - 1; i6 >= 0; i6--) { + const message = this.messages[i6]; + if ((0, chatCompletionUtils_1.isToolMessage)(message) && message.content != null && typeof message.content === "string" && this.messages.some((x2) => x2.role === "assistant" && x2.tool_calls?.some((y) => y.type === "function" && y.id === message.tool_call_id))) { + return message.content; } - return "#" + this._url.fragment; } - set hash(v8) { - if (v8 === "") { - this._url.fragment = null; - return; + return; + }, _AbstractChatCompletionRunner_calculateTotalUsage = function _AbstractChatCompletionRunner_calculateTotalUsage2() { + const total = { + completion_tokens: 0, + prompt_tokens: 0, + total_tokens: 0 + }; + for (const { usage: usage2 } of this._chatCompletions) { + if (usage2) { + total.completion_tokens += usage2.completion_tokens; + total.prompt_tokens += usage2.prompt_tokens; + total.total_tokens += usage2.total_tokens; } - const input = v8[0] === "#" ? v8.substring(1) : v8; - this._url.fragment = ""; - usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); } - toJSON() { - return this.href; + return total; + }, _AbstractChatCompletionRunner_validateParams = function _AbstractChatCompletionRunner_validateParams2(params) { + if (params.n != null && params.n > 1) { + throw new error_1.OpenAIError("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly."); } + }, _AbstractChatCompletionRunner_stringifyFunctionCallResult = function _AbstractChatCompletionRunner_stringifyFunctionCallResult2(rawContent2) { + return typeof rawContent2 === "string" ? rawContent2 : rawContent2 === void 0 ? "undefined" : JSON.stringify(rawContent2); }; } }); -// node_modules/whatwg-url/lib/URL.js -var require_URL = __commonJS({ - "node_modules/whatwg-url/lib/URL.js"(exports2, module) { +// node_modules/openai/lib/ChatCompletionRunner.js +var require_ChatCompletionRunner = __commonJS({ + "node_modules/openai/lib/ChatCompletionRunner.js"(exports2) { "use strict"; - var conversions = require_lib7(); - var utils = require_utils11(); - var Impl = require_URL_impl(); - var impl = utils.implSymbol; - function URL3(url2) { - if (!this || this[impl] || !(this instanceof URL3)) { - throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function."); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ChatCompletionRunner = void 0; + var AbstractChatCompletionRunner_1 = require_AbstractChatCompletionRunner(); + var chatCompletionUtils_1 = require_chatCompletionUtils(); + var ChatCompletionRunner = class _ChatCompletionRunner extends AbstractChatCompletionRunner_1.AbstractChatCompletionRunner { + static runTools(client2, params, options) { + const runner = new _ChatCompletionRunner(); + const opts = { + ...options, + headers: { ...options?.headers, "X-Stainless-Helper-Method": "runTools" } + }; + runner._run(() => runner._runTools(client2, params, opts)); + return runner; } - if (arguments.length < 1) { - throw new TypeError("Failed to construct 'URL': 1 argument required, but only " + arguments.length + " present."); + _addMessage(message, emit = true) { + super._addMessage(message, emit); + if ((0, chatCompletionUtils_1.isAssistantMessage)(message) && message.content) { + this._emit("content", message.content); + } } - const args = []; - for (let i6 = 0; i6 < arguments.length && i6 < 2; ++i6) { - args[i6] = arguments[i6]; + }; + exports2.ChatCompletionRunner = ChatCompletionRunner; + } +}); + +// node_modules/openai/_vendor/partial-json-parser/parser.js +var require_parser4 = __commonJS({ + "node_modules/openai/_vendor/partial-json-parser/parser.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MalformedJSON = exports2.PartialJSON = exports2.partialParse = void 0; + var STR = 1; + var NUM = 2; + var ARR = 4; + var OBJ = 8; + var NULL = 16; + var BOOL = 32; + var NAN = 64; + var INFINITY = 128; + var MINUS_INFINITY = 256; + var INF = INFINITY | MINUS_INFINITY; + var SPECIAL = NULL | BOOL | INF | NAN; + var ATOM = STR | NUM | SPECIAL; + var COLLECTION = ARR | OBJ; + var ALL = ATOM | COLLECTION; + var Allow = { + STR, + NUM, + ARR, + OBJ, + NULL, + BOOL, + NAN, + INFINITY, + MINUS_INFINITY, + INF, + SPECIAL, + ATOM, + COLLECTION, + ALL + }; + var PartialJSON = class extends Error { + }; + exports2.PartialJSON = PartialJSON; + var MalformedJSON = class extends Error { + }; + exports2.MalformedJSON = MalformedJSON; + function parseJSON(jsonString, allowPartial = Allow.ALL) { + if (typeof jsonString !== "string") { + throw new TypeError(`expecting str, got ${typeof jsonString}`); } - args[0] = conversions["USVString"](args[0]); - if (args[1] !== void 0) { - args[1] = conversions["USVString"](args[1]); + if (!jsonString.trim()) { + throw new Error(`${jsonString} is empty`); } - module.exports.setup(this, args); + return _parseJSON(jsonString.trim(), allowPartial); } - URL3.prototype.toJSON = function toJSON() { - if (!this || !module.exports.is(this)) { - throw new TypeError("Illegal invocation"); - } - const args = []; - for (let i6 = 0; i6 < arguments.length && i6 < 0; ++i6) { - args[i6] = arguments[i6]; - } - return this[impl].toJSON.apply(this[impl], args); - }; - Object.defineProperty(URL3.prototype, "href", { - get() { - return this[impl].href; - }, - set(V2) { - V2 = conversions["USVString"](V2); - this[impl].href = V2; - }, - enumerable: true, - configurable: true - }); - URL3.prototype.toString = function() { - if (!this || !module.exports.is(this)) { - throw new TypeError("Illegal invocation"); - } - return this.href; - }; - Object.defineProperty(URL3.prototype, "origin", { - get() { - return this[impl].origin; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL3.prototype, "protocol", { - get() { - return this[impl].protocol; - }, - set(V2) { - V2 = conversions["USVString"](V2); - this[impl].protocol = V2; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL3.prototype, "username", { - get() { - return this[impl].username; - }, - set(V2) { - V2 = conversions["USVString"](V2); - this[impl].username = V2; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL3.prototype, "password", { - get() { - return this[impl].password; - }, - set(V2) { - V2 = conversions["USVString"](V2); - this[impl].password = V2; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL3.prototype, "host", { - get() { - return this[impl].host; - }, - set(V2) { - V2 = conversions["USVString"](V2); - this[impl].host = V2; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL3.prototype, "hostname", { - get() { - return this[impl].hostname; - }, - set(V2) { - V2 = conversions["USVString"](V2); - this[impl].hostname = V2; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL3.prototype, "port", { - get() { - return this[impl].port; - }, - set(V2) { - V2 = conversions["USVString"](V2); - this[impl].port = V2; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL3.prototype, "pathname", { - get() { - return this[impl].pathname; - }, - set(V2) { - V2 = conversions["USVString"](V2); - this[impl].pathname = V2; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL3.prototype, "search", { - get() { - return this[impl].search; - }, - set(V2) { - V2 = conversions["USVString"](V2); - this[impl].search = V2; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL3.prototype, "hash", { - get() { - return this[impl].hash; - }, - set(V2) { - V2 = conversions["USVString"](V2); - this[impl].hash = V2; - }, - enumerable: true, - configurable: true - }); - module.exports = { - is(obj) { - return !!obj && obj[impl] instanceof Impl.implementation; - }, - create(constructorArgs, privateData) { - let obj = Object.create(URL3.prototype); - this.setup(obj, constructorArgs, privateData); + var _parseJSON = (jsonString, allow) => { + const length = jsonString.length; + let index2 = 0; + const markPartialJSON = (msg) => { + throw new PartialJSON(`${msg} at position ${index2}`); + }; + const throwMalformedError = (msg) => { + throw new MalformedJSON(`${msg} at position ${index2}`); + }; + const parseAny = () => { + skipBlank(); + if (index2 >= length) + markPartialJSON("Unexpected end of input"); + if (jsonString[index2] === '"') + return parseStr(); + if (jsonString[index2] === "{") + return parseObj(); + if (jsonString[index2] === "[") + return parseArr(); + if (jsonString.substring(index2, index2 + 4) === "null" || Allow.NULL & allow && length - index2 < 4 && "null".startsWith(jsonString.substring(index2))) { + index2 += 4; + return null; + } + if (jsonString.substring(index2, index2 + 4) === "true" || Allow.BOOL & allow && length - index2 < 4 && "true".startsWith(jsonString.substring(index2))) { + index2 += 4; + return true; + } + if (jsonString.substring(index2, index2 + 5) === "false" || Allow.BOOL & allow && length - index2 < 5 && "false".startsWith(jsonString.substring(index2))) { + index2 += 5; + return false; + } + if (jsonString.substring(index2, index2 + 8) === "Infinity" || Allow.INFINITY & allow && length - index2 < 8 && "Infinity".startsWith(jsonString.substring(index2))) { + index2 += 8; + return Infinity; + } + if (jsonString.substring(index2, index2 + 9) === "-Infinity" || Allow.MINUS_INFINITY & allow && 1 < length - index2 && length - index2 < 9 && "-Infinity".startsWith(jsonString.substring(index2))) { + index2 += 9; + return -Infinity; + } + if (jsonString.substring(index2, index2 + 3) === "NaN" || Allow.NAN & allow && length - index2 < 3 && "NaN".startsWith(jsonString.substring(index2))) { + index2 += 3; + return NaN; + } + return parseNum(); + }; + const parseStr = () => { + const start = index2; + let escape5 = false; + index2++; + while (index2 < length && (jsonString[index2] !== '"' || escape5 && jsonString[index2 - 1] === "\\")) { + escape5 = jsonString[index2] === "\\" ? !escape5 : false; + index2++; + } + if (jsonString.charAt(index2) == '"') { + try { + return JSON.parse(jsonString.substring(start, ++index2 - Number(escape5))); + } catch (e6) { + throwMalformedError(String(e6)); + } + } else if (Allow.STR & allow) { + try { + return JSON.parse(jsonString.substring(start, index2 - Number(escape5)) + '"'); + } catch (e6) { + return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf("\\")) + '"'); + } + } + markPartialJSON("Unterminated string literal"); + }; + const parseObj = () => { + index2++; + skipBlank(); + const obj = {}; + try { + while (jsonString[index2] !== "}") { + skipBlank(); + if (index2 >= length && Allow.OBJ & allow) + return obj; + const key = parseStr(); + skipBlank(); + index2++; + try { + const value = parseAny(); + Object.defineProperty(obj, key, { value, writable: true, enumerable: true, configurable: true }); + } catch (e6) { + if (Allow.OBJ & allow) + return obj; + else + throw e6; + } + skipBlank(); + if (jsonString[index2] === ",") + index2++; + } + } catch (e6) { + if (Allow.OBJ & allow) + return obj; + else + markPartialJSON("Expected '}' at end of object"); + } + index2++; return obj; - }, - setup(obj, constructorArgs, privateData) { - if (!privateData) privateData = {}; - privateData.wrapper = obj; - obj[impl] = new Impl.implementation(constructorArgs, privateData); - obj[impl][utils.wrapperSymbol] = obj; - }, - interface: URL3, - expose: { - Window: { URL: URL3 }, - Worker: { URL: URL3 } - } + }; + const parseArr = () => { + index2++; + const arr = []; + try { + while (jsonString[index2] !== "]") { + arr.push(parseAny()); + skipBlank(); + if (jsonString[index2] === ",") { + index2++; + } + } + } catch (e6) { + if (Allow.ARR & allow) { + return arr; + } + markPartialJSON("Expected ']' at end of array"); + } + index2++; + return arr; + }; + const parseNum = () => { + if (index2 === 0) { + if (jsonString === "-" && Allow.NUM & allow) + markPartialJSON("Not sure what '-' is"); + try { + return JSON.parse(jsonString); + } catch (e6) { + if (Allow.NUM & allow) { + try { + if ("." === jsonString[jsonString.length - 1]) + return JSON.parse(jsonString.substring(0, jsonString.lastIndexOf("."))); + return JSON.parse(jsonString.substring(0, jsonString.lastIndexOf("e"))); + } catch (e7) { + } + } + throwMalformedError(String(e6)); + } + } + const start = index2; + if (jsonString[index2] === "-") + index2++; + while (jsonString[index2] && !",]}".includes(jsonString[index2])) + index2++; + if (index2 == length && !(Allow.NUM & allow)) + markPartialJSON("Unterminated number literal"); + try { + return JSON.parse(jsonString.substring(start, index2)); + } catch (e6) { + if (jsonString.substring(start, index2) === "-" && Allow.NUM & allow) + markPartialJSON("Not sure what '-' is"); + try { + return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf("e"))); + } catch (e7) { + throwMalformedError(String(e7)); + } + } + }; + const skipBlank = () => { + while (index2 < length && " \n\r ".includes(jsonString[index2])) { + index2++; + } + }; + return parseAny(); }; + var partialParse = (input) => parseJSON(input, Allow.ALL ^ Allow.NUM); + exports2.partialParse = partialParse; } }); -// node_modules/whatwg-url/lib/public-api.js -var require_public_api = __commonJS({ - "node_modules/whatwg-url/lib/public-api.js"(exports2) { +// node_modules/openai/streaming.js +var require_streaming2 = __commonJS({ + "node_modules/openai/streaming.js"(exports2) { "use strict"; - exports2.URL = require_URL().interface; - exports2.serializeURL = require_url_state_machine().serializeURL; - exports2.serializeURLOrigin = require_url_state_machine().serializeURLOrigin; - exports2.basicURLParse = require_url_state_machine().basicURLParse; - exports2.setTheUsername = require_url_state_machine().setTheUsername; - exports2.setThePassword = require_url_state_machine().setThePassword; - exports2.serializeHost = require_url_state_machine().serializeHost; - exports2.serializeInteger = require_url_state_machine().serializeInteger; - exports2.parseURL = require_url_state_machine().parseURL; + Object.defineProperty(exports2, "__esModule", { value: true }); + var tslib_1 = require_tslib(); + tslib_1.__exportStar(require_streaming(), exports2); } }); -// node_modules/node-fetch/lib/index.mjs -var lib_exports2 = {}; -__export(lib_exports2, { - AbortError: () => AbortError3, - FetchError: () => FetchError, - Headers: () => Headers3, - Request: () => Request2, - Response: () => Response, - default: () => lib_default -}); -import Stream2 from "stream"; -import http3 from "http"; -import Url from "url"; -import https3 from "https"; -import zlib2 from "zlib"; -function FetchError(message, type, systemError) { - Error.call(this, message); - this.message = message; - this.type = type; - if (systemError) { - this.code = this.errno = systemError.code; - } - Error.captureStackTrace(this, this.constructor); -} -function Body(body2) { - var _this = this; - var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref$size = _ref.size; - let size = _ref$size === void 0 ? 0 : _ref$size; - var _ref$timeout = _ref.timeout; - let timeout2 = _ref$timeout === void 0 ? 0 : _ref$timeout; - if (body2 == null) { - body2 = null; - } else if (isURLSearchParams(body2)) { - body2 = Buffer.from(body2.toString()); - } else if (isBlob2(body2)) ; - else if (Buffer.isBuffer(body2)) ; - else if (Object.prototype.toString.call(body2) === "[object ArrayBuffer]") { - body2 = Buffer.from(body2); - } else if (ArrayBuffer.isView(body2)) { - body2 = Buffer.from(body2.buffer, body2.byteOffset, body2.byteLength); - } else if (body2 instanceof Stream2) ; - else { - body2 = Buffer.from(String(body2)); - } - this[INTERNALS] = { - body: body2, - disturbed: false, - error: null - }; - this.size = size; - this.timeout = timeout2; - if (body2 instanceof Stream2) { - body2.on("error", function(err) { - const error2 = err.name === "AbortError" ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, "system", err); - _this[INTERNALS].error = error2; - }); - } -} -function consumeBody() { - var _this4 = this; - if (this[INTERNALS].disturbed) { - return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); - } - this[INTERNALS].disturbed = true; - if (this[INTERNALS].error) { - return Body.Promise.reject(this[INTERNALS].error); - } - let body2 = this.body; - if (body2 === null) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - if (isBlob2(body2)) { - body2 = body2.stream(); - } - if (Buffer.isBuffer(body2)) { - return Body.Promise.resolve(body2); - } - if (!(body2 instanceof Stream2)) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - let accum = []; - let accumBytes = 0; - let abort = false; - return new Body.Promise(function(resolve4, reject2) { - let resTimeout; - if (_this4.timeout) { - resTimeout = setTimeout(function() { - abort = true; - reject2(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, "body-timeout")); - }, _this4.timeout); - } - body2.on("error", function(err) { - if (err.name === "AbortError") { - abort = true; - reject2(err); - } else { - reject2(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, "system", err)); +// node_modules/openai/lib/ChatCompletionStream.js +var require_ChatCompletionStream = __commonJS({ + "node_modules/openai/lib/ChatCompletionStream.js"(exports2) { + "use strict"; + var _ChatCompletionStream_instances; + var _ChatCompletionStream_params; + var _ChatCompletionStream_choiceEventStates; + var _ChatCompletionStream_currentChatCompletionSnapshot; + var _ChatCompletionStream_beginRequest; + var _ChatCompletionStream_getChoiceEventState; + var _ChatCompletionStream_addChunk; + var _ChatCompletionStream_emitToolCallDoneEvent; + var _ChatCompletionStream_emitContentDoneEvents; + var _ChatCompletionStream_endRequest; + var _ChatCompletionStream_getAutoParseableResponseFormat; + var _ChatCompletionStream_accumulateChatCompletion; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ChatCompletionStream = void 0; + var tslib_1 = require_tslib(); + var parser_1 = require_parser4(); + var error_1 = require_error3(); + var parser_2 = require_parser3(); + var streaming_1 = require_streaming2(); + var AbstractChatCompletionRunner_1 = require_AbstractChatCompletionRunner(); + var ChatCompletionStream = class _ChatCompletionStream extends AbstractChatCompletionRunner_1.AbstractChatCompletionRunner { + constructor(params) { + super(); + _ChatCompletionStream_instances.add(this); + _ChatCompletionStream_params.set(this, void 0); + _ChatCompletionStream_choiceEventStates.set(this, void 0); + _ChatCompletionStream_currentChatCompletionSnapshot.set(this, void 0); + tslib_1.__classPrivateFieldSet(this, _ChatCompletionStream_params, params, "f"); + tslib_1.__classPrivateFieldSet(this, _ChatCompletionStream_choiceEventStates, [], "f"); } - }); - body2.on("data", function(chunk) { - if (abort || chunk === null) { - return; + get currentChatCompletionSnapshot() { + return tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); } - if (_this4.size && accumBytes + chunk.length > _this4.size) { - abort = true; - reject2(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, "max-size")); - return; + /** + * Intended for use on the frontend, consuming a stream produced with + * `.toReadableStream()` on the backend. + * + * Note that messages sent to the model do not appear in `.on('message')` + * in this context. + */ + static fromReadableStream(stream5) { + const runner = new _ChatCompletionStream(null); + runner._run(() => runner._fromReadableStream(stream5)); + return runner; } - accumBytes += chunk.length; - accum.push(chunk); - }); - body2.on("end", function() { - if (abort) { - return; + static createChatCompletion(client2, params, options) { + const runner = new _ChatCompletionStream(params); + runner._run(() => runner._runChatCompletion(client2, { ...params, stream: true }, { ...options, headers: { ...options?.headers, "X-Stainless-Helper-Method": "stream" } })); + return runner; } - clearTimeout(resTimeout); - try { - resolve4(Buffer.concat(accum, accumBytes)); - } catch (err) { - reject2(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err)); + async _createChatCompletion(client2, params, options) { + super._createChatCompletion; + const signal = options?.signal; + if (signal) { + if (signal.aborted) + this.controller.abort(); + signal.addEventListener("abort", () => this.controller.abort()); + } + tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this); + const stream5 = await client2.chat.completions.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }); + this._connected(); + for await (const chunk of stream5) { + tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_addChunk).call(this, chunk); + } + if (stream5.controller.signal?.aborted) { + throw new error_1.APIUserAbortError(); + } + return this._addChatCompletion(tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); } - }); - }); -} -function convertBody(buffer2, headers) { - if (typeof convert !== "function") { - throw new Error("The package `encoding` must be installed to use the textConverted() function"); - } - const ct2 = headers.get("content-type"); - let charset = "utf-8"; - let res, str; - if (ct2) { - res = /charset=([^;]*)/i.exec(ct2); - } - str = buffer2.slice(0, 1024).toString(); - if (!res && str) { - res = / 1 && arguments[1] !== void 0 ? arguments[1] : "key+value"; - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === "key" ? function(k7) { - return k7.toLowerCase(); - } : kind === "value" ? function(k7) { - return headers[MAP][k7].join(", "); - } : function(k7) { - return [k7.toLowerCase(), headers[MAP][k7].join(", ")]; - }); -} -function createHeadersIterator(target, kind) { - const iterator2 = Object.create(HeadersIteratorPrototype); - iterator2[INTERNAL] = { - target, - kind, - index: 0 - }; - return iterator2; -} -function exportNodeCompatibleHeaders(headers) { - const obj = Object.assign({ __proto__: null }, headers[MAP]); - const hostHeaderKey = find(headers[MAP], "Host"); - if (hostHeaderKey !== void 0) { - obj[hostHeaderKey] = obj[hostHeaderKey][0]; - } - return obj; -} -function createHeadersLenient(obj) { - const headers = new Headers3(); - for (const name of Object.keys(obj)) { - if (invalidTokenRegex.test(name)) { - continue; - } - if (Array.isArray(obj[name])) { - for (const val of obj[name]) { - if (invalidHeaderCharRegex.test(val)) { - continue; + async _fromReadableStream(readableStream, options) { + const signal = options?.signal; + if (signal) { + if (signal.aborted) + this.controller.abort(); + signal.addEventListener("abort", () => this.controller.abort()); } - if (headers[MAP][name] === void 0) { - headers[MAP][name] = [val]; - } else { - headers[MAP][name].push(val); + tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this); + this._connected(); + const stream5 = streaming_1.Stream.fromReadableStream(readableStream, this.controller); + let chatId; + for await (const chunk of stream5) { + if (chatId && chatId !== chunk.id) { + this._addChatCompletion(tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); + } + tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_addChunk).call(this, chunk); + chatId = chunk.id; } + if (stream5.controller.signal?.aborted) { + throw new error_1.APIUserAbortError(); + } + return this._addChatCompletion(tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); } - } else if (!invalidHeaderCharRegex.test(obj[name])) { - headers[MAP][name] = [obj[name]]; - } - } - return headers; -} -function parseURL(urlStr) { - if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { - urlStr = new URL2(urlStr).toString(); - } - return parse_url(urlStr); -} -function isRequest(input) { - return typeof input === "object" && typeof input[INTERNALS$2] === "object"; -} -function isAbortSignal(signal) { - const proto = signal && typeof signal === "object" && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === "AbortSignal"); -} -function getNodeRequestOptions(request3) { - const parsedURL = request3[INTERNALS$2].parsedURL; - const headers = new Headers3(request3[INTERNALS$2].headers); - if (!headers.has("Accept")) { - headers.set("Accept", "*/*"); - } - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError("Only absolute URLs are supported"); - } - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError("Only HTTP(S) protocols are supported"); - } - if (request3.signal && request3.body instanceof Stream2.Readable && !streamDestructionSupported) { - throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8"); - } - let contentLengthValue = null; - if (request3.body == null && /^(POST|PUT)$/i.test(request3.method)) { - contentLengthValue = "0"; - } - if (request3.body != null) { - const totalBytes = getTotalBytes(request3); - if (typeof totalBytes === "number") { - contentLengthValue = String(totalBytes); - } - } - if (contentLengthValue) { - headers.set("Content-Length", contentLengthValue); - } - if (!headers.has("User-Agent")) { - headers.set("User-Agent", "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"); - } - if (request3.compress && !headers.has("Accept-Encoding")) { - headers.set("Accept-Encoding", "gzip,deflate"); - } - let agent = request3.agent; - if (typeof agent === "function") { - agent = agent(parsedURL); - } - return Object.assign({}, parsedURL, { - method: request3.method, - headers: exportNodeCompatibleHeaders(headers), - agent - }); -} -function AbortError3(message) { - Error.call(this, message); - this.type = "aborted"; - this.message = message; - Error.captureStackTrace(this, this.constructor); -} -function fetch3(url2, opts) { - if (!fetch3.Promise) { - throw new Error("native promise missing, set fetch.Promise to your favorite alternative"); - } - Body.Promise = fetch3.Promise; - return new fetch3.Promise(function(resolve4, reject2) { - const request3 = new Request2(url2, opts); - const options = getNodeRequestOptions(request3); - const send = (options.protocol === "https:" ? https3 : http3).request; - const signal = request3.signal; - let response = null; - const abort = function abort2() { - let error2 = new AbortError3("The user aborted a request."); - reject2(error2); - if (request3.body && request3.body instanceof Stream2.Readable) { - destroyStream(request3.body, error2); - } - if (!response || !response.body) return; - response.body.emit("error", error2); - }; - if (signal && signal.aborted) { - abort(); - return; - } - const abortAndFinalize = function abortAndFinalize2() { - abort(); - finalize(); - }; - const req = send(options); - let reqTimeout; - if (signal) { - signal.addEventListener("abort", abortAndFinalize); - } - function finalize() { - req.abort(); - if (signal) signal.removeEventListener("abort", abortAndFinalize); - clearTimeout(reqTimeout); - } - if (request3.timeout) { - req.once("socket", function(socket) { - reqTimeout = setTimeout(function() { - reject2(new FetchError(`network timeout at: ${request3.url}`, "request-timeout")); - finalize(); - }, request3.timeout); - }); - } - req.on("error", function(err) { - reject2(new FetchError(`request to ${request3.url} failed, reason: ${err.message}`, "system", err)); - if (response && response.body) { - destroyStream(response.body, err); - } - finalize(); - }); - fixResponseChunkedTransferBadEnding(req, function(err) { - if (signal && signal.aborted) { - return; - } - if (response && response.body) { - destroyStream(response.body, err); - } - }); - if (parseInt(process.version.substring(1)) < 14) { - req.on("socket", function(s6) { - s6.addListener("close", function(hadError) { - const hasDataListener = s6.listenerCount("data") > 0; - if (response && hasDataListener && !hadError && !(signal && signal.aborted)) { - const err = new Error("Premature close"); - err.code = "ERR_STREAM_PREMATURE_CLOSE"; - response.body.emit("error", err); + [(_ChatCompletionStream_params = /* @__PURE__ */ new WeakMap(), _ChatCompletionStream_choiceEventStates = /* @__PURE__ */ new WeakMap(), _ChatCompletionStream_currentChatCompletionSnapshot = /* @__PURE__ */ new WeakMap(), _ChatCompletionStream_instances = /* @__PURE__ */ new WeakSet(), _ChatCompletionStream_beginRequest = function _ChatCompletionStream_beginRequest2() { + if (this.ended) + return; + tslib_1.__classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, void 0, "f"); + }, _ChatCompletionStream_getChoiceEventState = function _ChatCompletionStream_getChoiceEventState2(choice) { + let state4 = tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index]; + if (state4) { + return state4; + } + state4 = { + content_done: false, + refusal_done: false, + logprobs_content_done: false, + logprobs_refusal_done: false, + done_tool_calls: /* @__PURE__ */ new Set(), + current_tool_call_index: null + }; + tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index] = state4; + return state4; + }, _ChatCompletionStream_addChunk = function _ChatCompletionStream_addChunk2(chunk) { + if (this.ended) + return; + const completion2 = tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_accumulateChatCompletion).call(this, chunk); + this._emit("chunk", chunk, completion2); + for (const choice of chunk.choices) { + const choiceSnapshot = completion2.choices[choice.index]; + if (choice.delta.content != null && choiceSnapshot.message?.role === "assistant" && choiceSnapshot.message?.content) { + this._emit("content", choice.delta.content, choiceSnapshot.message.content); + this._emit("content.delta", { + delta: choice.delta.content, + snapshot: choiceSnapshot.message.content, + parsed: choiceSnapshot.message.parsed + }); } - }); - }); - } - req.on("response", function(res) { - clearTimeout(reqTimeout); - const headers = createHeadersLenient(res.headers); - if (fetch3.isRedirect(res.statusCode)) { - const location = headers.get("Location"); - let locationURL = null; - try { - locationURL = location === null ? null : new URL$1(location, request3.url).toString(); - } catch (err) { - if (request3.redirect !== "manual") { - reject2(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, "invalid-redirect")); - finalize(); - return; + if (choice.delta.refusal != null && choiceSnapshot.message?.role === "assistant" && choiceSnapshot.message?.refusal) { + this._emit("refusal.delta", { + delta: choice.delta.refusal, + snapshot: choiceSnapshot.message.refusal + }); } - } - switch (request3.redirect) { - case "error": - reject2(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request3.url}`, "no-redirect")); - finalize(); - return; - case "manual": - if (locationURL !== null) { - try { - headers.set("Location", locationURL); - } catch (err) { - reject2(err); + if (choice.logprobs?.content != null && choiceSnapshot.message?.role === "assistant") { + this._emit("logprobs.content.delta", { + content: choice.logprobs?.content, + snapshot: choiceSnapshot.logprobs?.content ?? [] + }); + } + if (choice.logprobs?.refusal != null && choiceSnapshot.message?.role === "assistant") { + this._emit("logprobs.refusal.delta", { + refusal: choice.logprobs?.refusal, + snapshot: choiceSnapshot.logprobs?.refusal ?? [] + }); + } + const state4 = tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); + if (choiceSnapshot.finish_reason) { + tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitContentDoneEvents).call(this, choiceSnapshot); + if (state4.current_tool_call_index != null) { + tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitToolCallDoneEvent).call(this, choiceSnapshot, state4.current_tool_call_index); + } + } + for (const toolCall of choice.delta.tool_calls ?? []) { + if (state4.current_tool_call_index !== toolCall.index) { + tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitContentDoneEvents).call(this, choiceSnapshot); + if (state4.current_tool_call_index != null) { + tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitToolCallDoneEvent).call(this, choiceSnapshot, state4.current_tool_call_index); } } - break; - case "follow": - if (locationURL === null) { - break; + state4.current_tool_call_index = toolCall.index; + } + for (const toolCallDelta of choice.delta.tool_calls ?? []) { + const toolCallSnapshot = choiceSnapshot.message.tool_calls?.[toolCallDelta.index]; + if (!toolCallSnapshot?.type) { + continue; } - if (request3.counter >= request3.follow) { - reject2(new FetchError(`maximum redirect reached at: ${request3.url}`, "max-redirect")); - finalize(); - return; + if (toolCallSnapshot?.type === "function") { + this._emit("tool_calls.function.arguments.delta", { + name: toolCallSnapshot.function?.name, + index: toolCallDelta.index, + arguments: toolCallSnapshot.function.arguments, + parsed_arguments: toolCallSnapshot.function.parsed_arguments, + arguments_delta: toolCallDelta.function?.arguments ?? "" + }); + } else { + assertNever(toolCallSnapshot?.type); } - const requestOpts = { - headers: new Headers3(request3.headers), - follow: request3.follow, - counter: request3.counter + 1, - agent: request3.agent, - compress: request3.compress, - method: request3.method, - body: request3.body, - signal: request3.signal, - timeout: request3.timeout, - size: request3.size - }; - if (!isDomainOrSubdomain(request3.url, locationURL) || !isSameProtocol(request3.url, locationURL)) { - for (const name of ["authorization", "www-authenticate", "cookie", "cookie2"]) { - requestOpts.headers.delete(name); + } + } + }, _ChatCompletionStream_emitToolCallDoneEvent = function _ChatCompletionStream_emitToolCallDoneEvent2(choiceSnapshot, toolCallIndex) { + const state4 = tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); + if (state4.done_tool_calls.has(toolCallIndex)) { + return; + } + const toolCallSnapshot = choiceSnapshot.message.tool_calls?.[toolCallIndex]; + if (!toolCallSnapshot) { + throw new Error("no tool call snapshot"); + } + if (!toolCallSnapshot.type) { + throw new Error("tool call snapshot missing `type`"); + } + if (toolCallSnapshot.type === "function") { + const inputTool = tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.tools?.find((tool) => (0, parser_2.isChatCompletionFunctionTool)(tool) && tool.function.name === toolCallSnapshot.function.name); + this._emit("tool_calls.function.arguments.done", { + name: toolCallSnapshot.function.name, + index: toolCallIndex, + arguments: toolCallSnapshot.function.arguments, + parsed_arguments: (0, parser_2.isAutoParsableTool)(inputTool) ? inputTool.$parseRaw(toolCallSnapshot.function.arguments) : inputTool?.function.strict ? JSON.parse(toolCallSnapshot.function.arguments) : null + }); + } else { + assertNever(toolCallSnapshot.type); + } + }, _ChatCompletionStream_emitContentDoneEvents = function _ChatCompletionStream_emitContentDoneEvents2(choiceSnapshot) { + const state4 = tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); + if (choiceSnapshot.message.content && !state4.content_done) { + state4.content_done = true; + const responseFormat = tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getAutoParseableResponseFormat).call(this); + this._emit("content.done", { + content: choiceSnapshot.message.content, + parsed: responseFormat ? responseFormat.$parseRaw(choiceSnapshot.message.content) : null + }); + } + if (choiceSnapshot.message.refusal && !state4.refusal_done) { + state4.refusal_done = true; + this._emit("refusal.done", { refusal: choiceSnapshot.message.refusal }); + } + if (choiceSnapshot.logprobs?.content && !state4.logprobs_content_done) { + state4.logprobs_content_done = true; + this._emit("logprobs.content.done", { content: choiceSnapshot.logprobs.content }); + } + if (choiceSnapshot.logprobs?.refusal && !state4.logprobs_refusal_done) { + state4.logprobs_refusal_done = true; + this._emit("logprobs.refusal.done", { refusal: choiceSnapshot.logprobs.refusal }); + } + }, _ChatCompletionStream_endRequest = function _ChatCompletionStream_endRequest2() { + if (this.ended) { + throw new error_1.OpenAIError(`stream has ended, this shouldn't happen`); + } + const snapshot2 = tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); + if (!snapshot2) { + throw new error_1.OpenAIError(`request ended without sending any chunks`); + } + tslib_1.__classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, void 0, "f"); + tslib_1.__classPrivateFieldSet(this, _ChatCompletionStream_choiceEventStates, [], "f"); + return finalizeChatCompletion(snapshot2, tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")); + }, _ChatCompletionStream_getAutoParseableResponseFormat = function _ChatCompletionStream_getAutoParseableResponseFormat2() { + const responseFormat = tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.response_format; + if ((0, parser_2.isAutoParsableResponseFormat)(responseFormat)) { + return responseFormat; + } + return null; + }, _ChatCompletionStream_accumulateChatCompletion = function _ChatCompletionStream_accumulateChatCompletion2(chunk) { + var _a6, _b3, _c7, _d2; + let snapshot2 = tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); + const { choices, ...rest } = chunk; + if (!snapshot2) { + snapshot2 = tslib_1.__classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, { + ...rest, + choices: [] + }, "f"); + } else { + Object.assign(snapshot2, rest); + } + for (const { delta, finish_reason, index: index2, logprobs = null, ...other } of chunk.choices) { + let choice = snapshot2.choices[index2]; + if (!choice) { + choice = snapshot2.choices[index2] = { finish_reason, index: index2, message: {}, logprobs, ...other }; + } + if (logprobs) { + if (!choice.logprobs) { + choice.logprobs = Object.assign({}, logprobs); + } else { + const { content: content2, refusal: refusal3, ...rest3 } = logprobs; + assertIsEmpty(rest3); + Object.assign(choice.logprobs, rest3); + if (content2) { + (_a6 = choice.logprobs).content ?? (_a6.content = []); + choice.logprobs.content.push(...content2); + } + if (refusal3) { + (_b3 = choice.logprobs).refusal ?? (_b3.refusal = []); + choice.logprobs.refusal.push(...refusal3); } } - if (res.statusCode !== 303 && request3.body && getTotalBytes(request3) === null) { - reject2(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect")); - finalize(); - return; + } + if (finish_reason) { + choice.finish_reason = finish_reason; + if (tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_params, "f") && (0, parser_2.hasAutoParseableInput)(tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_params, "f"))) { + if (finish_reason === "length") { + throw new error_1.LengthFinishReasonError(); + } + if (finish_reason === "content_filter") { + throw new error_1.ContentFilterFinishReasonError(); + } } - if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request3.method === "POST") { - requestOpts.method = "GET"; - requestOpts.body = void 0; - requestOpts.headers.delete("content-length"); + } + Object.assign(choice, other); + if (!delta) + continue; + const { content, refusal: refusal2, function_call, role, tool_calls, ...rest2 } = delta; + assertIsEmpty(rest2); + Object.assign(choice.message, rest2); + if (refusal2) { + choice.message.refusal = (choice.message.refusal || "") + refusal2; + } + if (role) + choice.message.role = role; + if (function_call) { + if (!choice.message.function_call) { + choice.message.function_call = function_call; + } else { + if (function_call.name) + choice.message.function_call.name = function_call.name; + if (function_call.arguments) { + (_c7 = choice.message.function_call).arguments ?? (_c7.arguments = ""); + choice.message.function_call.arguments += function_call.arguments; + } } - resolve4(fetch3(new Request2(locationURL, requestOpts))); - finalize(); - return; + } + if (content) { + choice.message.content = (choice.message.content || "") + content; + if (!choice.message.refusal && tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getAutoParseableResponseFormat).call(this)) { + choice.message.parsed = (0, parser_1.partialParse)(choice.message.content); + } + } + if (tool_calls) { + if (!choice.message.tool_calls) + choice.message.tool_calls = []; + for (const { index: index3, id, type, function: fn, ...rest3 } of tool_calls) { + const tool_call = (_d2 = choice.message.tool_calls)[index3] ?? (_d2[index3] = {}); + Object.assign(tool_call, rest3); + if (id) + tool_call.id = id; + if (type) + tool_call.type = type; + if (fn) + tool_call.function ?? (tool_call.function = { name: fn.name ?? "", arguments: "" }); + if (fn?.name) + tool_call.function.name = fn.name; + if (fn?.arguments) { + tool_call.function.arguments += fn.arguments; + if ((0, parser_2.shouldParseToolCall)(tslib_1.__classPrivateFieldGet(this, _ChatCompletionStream_params, "f"), tool_call)) { + tool_call.function.parsed_arguments = (0, parser_1.partialParse)(tool_call.function.arguments); + } + } + } + } } - } - res.once("end", function() { - if (signal) signal.removeEventListener("abort", abortAndFinalize); - }); - let body2 = res.pipe(new PassThrough$1()); - const response_options = { - url: request3.url, - status: res.statusCode, - statusText: res.statusMessage, - headers, - size: request3.size, - timeout: request3.timeout, - counter: request3.counter - }; - const codings = headers.get("Content-Encoding"); - if (!request3.compress || request3.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response(body2, response_options); - resolve4(response); - return; - } - const zlibOptions = { - flush: zlib2.Z_SYNC_FLUSH, - finishFlush: zlib2.Z_SYNC_FLUSH - }; - if (codings == "gzip" || codings == "x-gzip") { - body2 = body2.pipe(zlib2.createGunzip(zlibOptions)); - response = new Response(body2, response_options); - resolve4(response); - return; - } - if (codings == "deflate" || codings == "x-deflate") { - const raw = res.pipe(new PassThrough$1()); - raw.once("data", function(chunk) { - if ((chunk[0] & 15) === 8) { - body2 = body2.pipe(zlib2.createInflate()); + return snapshot2; + }, Symbol.asyncIterator)]() { + const pushQueue = []; + const readQueue = []; + let done = false; + this.on("chunk", (chunk) => { + const reader = readQueue.shift(); + if (reader) { + reader.resolve(chunk); } else { - body2 = body2.pipe(zlib2.createInflateRaw()); + pushQueue.push(chunk); } - response = new Response(body2, response_options); - resolve4(response); }); - raw.on("end", function() { - if (!response) { - response = new Response(body2, response_options); - resolve4(response); + this.on("end", () => { + done = true; + for (const reader of readQueue) { + reader.resolve(void 0); } + readQueue.length = 0; }); - return; + this.on("abort", (err) => { + done = true; + for (const reader of readQueue) { + reader.reject(err); + } + readQueue.length = 0; + }); + this.on("error", (err) => { + done = true; + for (const reader of readQueue) { + reader.reject(err); + } + readQueue.length = 0; + }); + return { + next: async () => { + if (!pushQueue.length) { + if (done) { + return { value: void 0, done: true }; + } + return new Promise((resolve8, reject2) => readQueue.push({ resolve: resolve8, reject: reject2 })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true }); + } + const chunk = pushQueue.shift(); + return { value: chunk, done: false }; + }, + return: async () => { + this.abort(); + return { value: void 0, done: true }; + } + }; } - if (codings == "br" && typeof zlib2.createBrotliDecompress === "function") { - body2 = body2.pipe(zlib2.createBrotliDecompress()); - response = new Response(body2, response_options); - resolve4(response); - return; + toReadableStream() { + const stream5 = new streaming_1.Stream(this[Symbol.asyncIterator].bind(this), this.controller); + return stream5.toReadableStream(); } - response = new Response(body2, response_options); - resolve4(response); - }); - writeToStream(req, request3); - }); -} -function fixResponseChunkedTransferBadEnding(request3, errorCallback) { - let socket; - request3.on("socket", function(s6) { - socket = s6; - }); - request3.on("response", function(response) { - const headers = response.headers; - if (headers["transfer-encoding"] === "chunked" && !headers["content-length"]) { - response.once("close", function(hadError) { - const hasDataListener = socket && socket.listenerCount("data") > 0; - if (hasDataListener && !hadError) { - const err = new Error("Premature close"); - err.code = "ERR_STREAM_PREMATURE_CLOSE"; - errorCallback(err); - } - }); + }; + exports2.ChatCompletionStream = ChatCompletionStream; + function finalizeChatCompletion(snapshot2, params) { + const { id, choices, created, model, system_fingerprint, ...rest } = snapshot2; + const completion2 = { + ...rest, + id, + choices: choices.map(({ message, finish_reason, index: index2, logprobs, ...choiceRest }) => { + if (!finish_reason) { + throw new error_1.OpenAIError(`missing finish_reason for choice ${index2}`); + } + const { content = null, function_call, tool_calls, ...messageRest } = message; + const role = message.role; + if (!role) { + throw new error_1.OpenAIError(`missing role for choice ${index2}`); + } + if (function_call) { + const { arguments: args, name } = function_call; + if (args == null) { + throw new error_1.OpenAIError(`missing function_call.arguments for choice ${index2}`); + } + if (!name) { + throw new error_1.OpenAIError(`missing function_call.name for choice ${index2}`); + } + return { + ...choiceRest, + message: { + content, + function_call: { arguments: args, name }, + role, + refusal: message.refusal ?? null + }, + finish_reason, + index: index2, + logprobs + }; + } + if (tool_calls) { + return { + ...choiceRest, + index: index2, + finish_reason, + logprobs, + message: { + ...messageRest, + role, + content, + refusal: message.refusal ?? null, + tool_calls: tool_calls.map((tool_call, i6) => { + const { function: fn, type, id: id2, ...toolRest } = tool_call; + const { arguments: args, name, ...fnRest } = fn || {}; + if (id2 == null) { + throw new error_1.OpenAIError(`missing choices[${index2}].tool_calls[${i6}].id +${str(snapshot2)}`); + } + if (type == null) { + throw new error_1.OpenAIError(`missing choices[${index2}].tool_calls[${i6}].type +${str(snapshot2)}`); + } + if (name == null) { + throw new error_1.OpenAIError(`missing choices[${index2}].tool_calls[${i6}].function.name +${str(snapshot2)}`); + } + if (args == null) { + throw new error_1.OpenAIError(`missing choices[${index2}].tool_calls[${i6}].function.arguments +${str(snapshot2)}`); + } + return { ...toolRest, id: id2, type, function: { ...fnRest, name, arguments: args } }; + }) + } + }; + } + return { + ...choiceRest, + message: { ...messageRest, content, role, refusal: message.refusal ?? null }, + finish_reason, + index: index2, + logprobs + }; + }), + created, + model, + object: "chat.completion", + ...system_fingerprint ? { system_fingerprint } : {} + }; + return (0, parser_2.maybeParseChatCompletion)(completion2, params); + } + function str(x2) { + return JSON.stringify(x2); + } + function assertIsEmpty(obj) { + return; + } + function assertNever(_x) { } - }); -} -function destroyStream(stream5, err) { - if (stream5.destroy) { - stream5.destroy(err); - } else { - stream5.emit("error", err); - stream5.end(); } -} -var import_whatwg_url, Readable5, BUFFER2, TYPE, Blob2, convert, INTERNALS, PassThrough3, invalidTokenRegex, invalidHeaderCharRegex, MAP, Headers3, INTERNAL, HeadersIteratorPrototype, INTERNALS$1, STATUS_CODES, Response, INTERNALS$2, URL2, parse_url, format_url, streamDestructionSupported, Request2, URL$1, PassThrough$1, isDomainOrSubdomain, isSameProtocol, lib_default; -var init_lib = __esm({ - "node_modules/node-fetch/lib/index.mjs"() { +}); + +// node_modules/openai/lib/ChatCompletionStreamingRunner.js +var require_ChatCompletionStreamingRunner = __commonJS({ + "node_modules/openai/lib/ChatCompletionStreamingRunner.js"(exports2) { "use strict"; - import_whatwg_url = __toESM(require_public_api(), 1); - Readable5 = Stream2.Readable; - BUFFER2 = /* @__PURE__ */ Symbol("buffer"); - TYPE = /* @__PURE__ */ Symbol("type"); - Blob2 = class _Blob { - constructor() { - this[TYPE] = ""; - const blobParts = arguments[0]; - const options = arguments[1]; - const buffers = []; - let size = 0; - if (blobParts) { - const a6 = blobParts; - const length = Number(a6.length); - for (let i6 = 0; i6 < length; i6++) { - const element = a6[i6]; - let buffer2; - if (element instanceof Buffer) { - buffer2 = element; - } else if (ArrayBuffer.isView(element)) { - buffer2 = Buffer.from(element.buffer, element.byteOffset, element.byteLength); - } else if (element instanceof ArrayBuffer) { - buffer2 = Buffer.from(element); - } else if (element instanceof _Blob) { - buffer2 = element[BUFFER2]; - } else { - buffer2 = Buffer.from(typeof element === "string" ? element : String(element)); - } - size += buffer2.length; - buffers.push(buffer2); - } - } - this[BUFFER2] = Buffer.concat(buffers); - let type = options && options.type !== void 0 && String(options.type).toLowerCase(); - if (type && !/[^\u0020-\u007E]/.test(type)) { - this[TYPE] = type; - } - } - get size() { - return this[BUFFER2].length; - } - get type() { - return this[TYPE]; - } - text() { - return Promise.resolve(this[BUFFER2].toString()); - } - arrayBuffer() { - const buf = this[BUFFER2]; - const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - return Promise.resolve(ab); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ChatCompletionStreamingRunner = void 0; + var ChatCompletionStream_1 = require_ChatCompletionStream(); + var ChatCompletionStreamingRunner = class _ChatCompletionStreamingRunner extends ChatCompletionStream_1.ChatCompletionStream { + static fromReadableStream(stream5) { + const runner = new _ChatCompletionStreamingRunner(null); + runner._run(() => runner._fromReadableStream(stream5)); + return runner; } - stream() { - const readable = new Readable5(); - readable._read = function() { + static runTools(client2, params, options) { + const runner = new _ChatCompletionStreamingRunner( + // @ts-expect-error TODO these types are incompatible + params + ); + const opts = { + ...options, + headers: { ...options?.headers, "X-Stainless-Helper-Method": "runTools" } }; - readable.push(this[BUFFER2]); - readable.push(null); - return readable; + runner._run(() => runner._runTools(client2, params, opts)); + return runner; } - toString() { - return "[object Blob]"; + }; + exports2.ChatCompletionStreamingRunner = ChatCompletionStreamingRunner; + } +}); + +// node_modules/openai/resources/chat/completions/completions.js +var require_completions = __commonJS({ + "node_modules/openai/resources/chat/completions/completions.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ChatCompletionRunner = exports2.ChatCompletionStream = exports2.ParsingToolFunction = exports2.ChatCompletionStreamingRunner = exports2.Completions = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var MessagesAPI = tslib_1.__importStar(require_messages()); + var messages_1 = require_messages(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var ChatCompletionRunner_1 = require_ChatCompletionRunner(); + var ChatCompletionStreamingRunner_1 = require_ChatCompletionStreamingRunner(); + var ChatCompletionStream_1 = require_ChatCompletionStream(); + var parser_1 = require_parser3(); + var Completions = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.messages = new MessagesAPI.Messages(this._client); } - slice() { - const size = this.size; - const start = arguments[0]; - const end = arguments[1]; - let relativeStart, relativeEnd; - if (start === void 0) { - relativeStart = 0; - } else if (start < 0) { - relativeStart = Math.max(size + start, 0); - } else { - relativeStart = Math.min(start, size); - } - if (end === void 0) { - relativeEnd = size; - } else if (end < 0) { - relativeEnd = Math.max(size + end, 0); - } else { - relativeEnd = Math.min(end, size); - } - const span = Math.max(relativeEnd - relativeStart, 0); - const buffer2 = this[BUFFER2]; - const slicedBuffer = buffer2.slice(relativeStart, relativeStart + span); - const blob = new _Blob([], { type: arguments[2] }); - blob[BUFFER2] = slicedBuffer; - return blob; + create(body2, options) { + return this._client.post("/chat/completions", { + body: body2, + ...options, + stream: body2.stream ?? false, + __security: { bearerAuth: true } + }); } - }; - Object.defineProperties(Blob2.prototype, { - size: { enumerable: true }, - type: { enumerable: true }, - slice: { enumerable: true } - }); - Object.defineProperty(Blob2.prototype, Symbol.toStringTag, { - value: "Blob", - writable: false, - enumerable: false, - configurable: true - }); - FetchError.prototype = Object.create(Error.prototype); - FetchError.prototype.constructor = FetchError; - FetchError.prototype.name = "FetchError"; - try { - convert = __require("encoding").convert; - } catch (e6) { - } - INTERNALS = /* @__PURE__ */ Symbol("Body internals"); - PassThrough3 = Stream2.PassThrough; - Body.prototype = { - get body() { - return this[INTERNALS].body; - }, - get bodyUsed() { - return this[INTERNALS].disturbed; - }, /** - * Decode response as ArrayBuffer + * Get a stored chat completion. Only Chat Completions that have been created with + * the `store` parameter set to `true` will be returned. * - * @return Promise + * @example + * ```ts + * const chatCompletion = + * await client.chat.completions.retrieve('completion_id'); + * ``` */ - arrayBuffer() { - return consumeBody.call(this).then(function(buf) { - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + retrieve(completionID, options) { + return this._client.get((0, path_1.path)`/chat/completions/${completionID}`, { + ...options, + __security: { bearerAuth: true } }); - }, + } /** - * Return raw response as Blob + * Modify a stored chat completion. Only Chat Completions that have been created + * with the `store` parameter set to `true` can be modified. Currently, the only + * supported modification is to update the `metadata` field. * - * @return Promise + * @example + * ```ts + * const chatCompletion = await client.chat.completions.update( + * 'completion_id', + * { metadata: { foo: 'string' } }, + * ); + * ``` */ - blob() { - let ct2 = this.headers && this.headers.get("content-type") || ""; - return consumeBody.call(this).then(function(buf) { - return Object.assign( - // Prevent copying - new Blob2([], { - type: ct2.toLowerCase() - }), - { - [BUFFER2]: buf - } - ); + update(completionID, body2, options) { + return this._client.post((0, path_1.path)`/chat/completions/${completionID}`, { + body: body2, + ...options, + __security: { bearerAuth: true } }); - }, + } /** - * Decode response as json + * List stored Chat Completions. Only Chat Completions that have been stored with + * the `store` parameter set to `true` will be returned. * - * @return Promise + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const chatCompletion of client.chat.completions.list()) { + * // ... + * } + * ``` */ - json() { - var _this2 = this; - return consumeBody.call(this).then(function(buffer2) { - try { - return JSON.parse(buffer2.toString()); - } catch (err) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, "invalid-json")); - } + list(query = {}, options) { + return this._client.getAPIList("/chat/completions", pagination_1.CursorPage, { + query, + ...options, + __security: { bearerAuth: true } }); - }, + } /** - * Decode response as text + * Delete a stored chat completion. Only Chat Completions that have been created + * with the `store` parameter set to `true` can be deleted. * - * @return Promise + * @example + * ```ts + * const chatCompletionDeleted = + * await client.chat.completions.delete('completion_id'); + * ``` */ - text() { - return consumeBody.call(this).then(function(buffer2) { - return buffer2.toString(); + delete(completionID, options) { + return this._client.delete((0, path_1.path)`/chat/completions/${completionID}`, { + ...options, + __security: { bearerAuth: true } }); - }, - /** - * Decode response as buffer (non-spec api) - * - * @return Promise - */ - buffer() { - return consumeBody.call(this); - }, + } + parse(body2, options) { + (0, parser_1.validateInputTools)(body2.tools); + return this._client.chat.completions.create(body2, { + ...options, + headers: { + ...options?.headers, + "X-Stainless-Helper-Method": "chat.completions.parse" + } + })._thenUnwrap((completion2) => (0, parser_1.parseChatCompletion)(completion2, body2)); + } + runTools(body2, options) { + if (body2.stream) { + return ChatCompletionStreamingRunner_1.ChatCompletionStreamingRunner.runTools(this._client, body2, options); + } + return ChatCompletionRunner_1.ChatCompletionRunner.runTools(this._client, body2, options); + } /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return Promise + * Creates a chat completion stream */ - textConverted() { - var _this3 = this; - return consumeBody.call(this).then(function(buffer2) { - return convertBody(buffer2, _this3.headers); - }); + stream(body2, options) { + return ChatCompletionStream_1.ChatCompletionStream.createChatCompletion(this._client, body2, options); } }; - Object.defineProperties(Body.prototype, { - body: { enumerable: true }, - bodyUsed: { enumerable: true }, - arrayBuffer: { enumerable: true }, - blob: { enumerable: true }, - json: { enumerable: true }, - text: { enumerable: true } - }); - Body.mixIn = function(proto) { - for (const name of Object.getOwnPropertyNames(Body.prototype)) { - if (!(name in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); - } + exports2.Completions = Completions; + var ChatCompletionStreamingRunner_2 = require_ChatCompletionStreamingRunner(); + Object.defineProperty(exports2, "ChatCompletionStreamingRunner", { enumerable: true, get: function() { + return ChatCompletionStreamingRunner_2.ChatCompletionStreamingRunner; + } }); + var RunnableFunction_1 = require_RunnableFunction(); + Object.defineProperty(exports2, "ParsingToolFunction", { enumerable: true, get: function() { + return RunnableFunction_1.ParsingToolFunction; + } }); + var ChatCompletionStream_2 = require_ChatCompletionStream(); + Object.defineProperty(exports2, "ChatCompletionStream", { enumerable: true, get: function() { + return ChatCompletionStream_2.ChatCompletionStream; + } }); + var ChatCompletionRunner_2 = require_ChatCompletionRunner(); + Object.defineProperty(exports2, "ChatCompletionRunner", { enumerable: true, get: function() { + return ChatCompletionRunner_2.ChatCompletionRunner; + } }); + Completions.Messages = messages_1.Messages; + } +}); + +// node_modules/openai/resources/chat/chat.js +var require_chat = __commonJS({ + "node_modules/openai/resources/chat/chat.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Chat = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var CompletionsAPI = tslib_1.__importStar(require_completions()); + var completions_1 = require_completions(); + var Chat = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.completions = new CompletionsAPI.Completions(this._client); } }; - Body.Promise = global.Promise; - invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/; - invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/; - MAP = /* @__PURE__ */ Symbol("map"); - Headers3 = class _Headers { + exports2.Chat = Chat; + Chat.Completions = completions_1.Completions; + } +}); + +// node_modules/openai/resources/chat/completions/index.js +var require_completions2 = __commonJS({ + "node_modules/openai/resources/chat/completions/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Messages = exports2.Completions = void 0; + var tslib_1 = require_tslib(); + var completions_1 = require_completions(); + Object.defineProperty(exports2, "Completions", { enumerable: true, get: function() { + return completions_1.Completions; + } }); + tslib_1.__exportStar(require_completions(), exports2); + var messages_1 = require_messages(); + Object.defineProperty(exports2, "Messages", { enumerable: true, get: function() { + return messages_1.Messages; + } }); + } +}); + +// node_modules/openai/resources/chat/index.js +var require_chat2 = __commonJS({ + "node_modules/openai/resources/chat/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Completions = exports2.Chat = void 0; + var chat_1 = require_chat(); + Object.defineProperty(exports2, "Chat", { enumerable: true, get: function() { + return chat_1.Chat; + } }); + var index_1 = require_completions2(); + Object.defineProperty(exports2, "Completions", { enumerable: true, get: function() { + return index_1.Completions; + } }); + } +}); + +// node_modules/openai/resources/shared.js +var require_shared = __commonJS({ + "node_modules/openai/resources/shared.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/openai/resources/admin/organization/admin-api-keys.js +var require_admin_api_keys = __commonJS({ + "node_modules/openai/resources/admin/organization/admin-api-keys.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminAPIKeys = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var AdminAPIKeys = class extends resource_1.APIResource { /** - * Headers class + * Create an organization admin API key * - * @param Object headers Response headers - * @return Void + * @example + * ```ts + * const adminAPIKey = + * await client.admin.organization.adminAPIKeys.create({ + * name: 'New Admin Key', + * }); + * ``` */ - constructor() { - let init = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0; - this[MAP] = /* @__PURE__ */ Object.create(null); - if (init instanceof _Headers) { - const rawHeaders = init.raw(); - const headerNames = Object.keys(rawHeaders); - for (const headerName of headerNames) { - for (const value of rawHeaders[headerName]) { - this.append(headerName, value); - } - } - return; - } - if (init == null) ; - else if (typeof init === "object") { - const method = init[Symbol.iterator]; - if (method != null) { - if (typeof method !== "function") { - throw new TypeError("Header pairs must be iterable"); - } - const pairs = []; - for (const pair of init) { - if (typeof pair !== "object" || typeof pair[Symbol.iterator] !== "function") { - throw new TypeError("Each header pair must be iterable"); - } - pairs.push(Array.from(pair)); - } - for (const pair of pairs) { - if (pair.length !== 2) { - throw new TypeError("Each header pair must be a name/value tuple"); - } - this.append(pair[0], pair[1]); - } - } else { - for (const key of Object.keys(init)) { - const value = init[key]; - this.append(key, value); - } - } - } else { - throw new TypeError("Provided initializer must be an object"); - } + create(body2, options) { + return this._client.post("/organization/admin_api_keys", { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } /** - * Return combined header value given name + * Retrieve a single organization API key * - * @param String name Header name - * @return Mixed + * @example + * ```ts + * const adminAPIKey = + * await client.admin.organization.adminAPIKeys.retrieve( + * 'key_id', + * ); + * ``` */ - get(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key === void 0) { - return null; - } - return this[MAP][key].join(", "); + retrieve(keyID, options) { + return this._client.get((0, path_1.path)`/organization/admin_api_keys/${keyID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } /** - * Iterate over all headers + * List organization API keys * - * @param Function callback Executed for each item with parameters (value, name, thisArg) - * @param Boolean thisArg `this` context for callback function - * @return Void + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const adminAPIKey of client.admin.organization.adminAPIKeys.list()) { + * // ... + * } + * ``` */ - forEach(callback) { - let thisArg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0; - let pairs = getHeaders(this); - let i6 = 0; - while (i6 < pairs.length) { - var _pairs$i = pairs[i6]; - const name = _pairs$i[0], value = _pairs$i[1]; - callback.call(thisArg, value, name, this); - pairs = getHeaders(this); - i6++; - } + list(query = {}, options) { + return this._client.getAPIList("/organization/admin_api_keys", pagination_1.CursorPage, { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } /** - * Overwrite header values given name + * Delete an organization admin API key * - * @param String name Header name - * @param String value Header value - * @return Void + * @example + * ```ts + * const adminAPIKey = + * await client.admin.organization.adminAPIKeys.delete( + * 'key_id', + * ); + * ``` */ - set(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - this[MAP][key !== void 0 ? key : name] = [value]; + delete(keyID, options) { + return this._client.delete((0, path_1.path)`/organization/admin_api_keys/${keyID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } + }; + exports2.AdminAPIKeys = AdminAPIKeys; + } +}); + +// node_modules/openai/resources/admin/organization/audit-logs.js +var require_audit_logs = __commonJS({ + "node_modules/openai/resources/admin/organization/audit-logs.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AuditLogs = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var AuditLogs = class extends resource_1.APIResource { /** - * Append a value onto existing header + * List user actions and configuration changes within this organization. * - * @param String name Header name - * @param String value Header value - * @return Void + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const auditLogListResponse of client.admin.organization.auditLogs.list()) { + * // ... + * } + * ``` */ - append(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - if (key !== void 0) { - this[MAP][key].push(value); - } else { - this[MAP][name] = [value]; - } + list(query = {}, options) { + return this._client.getAPIList("/organization/audit_logs", pagination_1.ConversationCursorPage, { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } + }; + exports2.AuditLogs = AuditLogs; + } +}); + +// node_modules/openai/resources/admin/organization/certificates.js +var require_certificates = __commonJS({ + "node_modules/openai/resources/admin/organization/certificates.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Certificates = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Certificates = class extends resource_1.APIResource { /** - * Check for header name existence + * Upload a certificate to the organization. This does **not** automatically + * activate the certificate. * - * @param String name Header name - * @return Boolean + * Organizations can upload up to 50 certificates. + * + * @example + * ```ts + * const certificate = + * await client.admin.organization.certificates.create({ + * certificate: 'certificate', + * }); + * ``` */ - has(name) { - name = `${name}`; - validateName(name); - return find(this[MAP], name) !== void 0; + create(body2, options) { + return this._client.post("/organization/certificates", { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } /** - * Delete all header values given name + * Get a certificate that has been uploaded to the organization. * - * @param String name Header name - * @return Void + * You can get a certificate regardless of whether it is active or not. + * + * @example + * ```ts + * const certificate = + * await client.admin.organization.certificates.retrieve( + * 'certificate_id', + * ); + * ``` */ - delete(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key !== void 0) { - delete this[MAP][key]; - } + retrieve(certificateID, query = {}, options) { + return this._client.get((0, path_1.path)`/organization/certificates/${certificateID}`, { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } /** - * Return raw headers (non-spec api) + * Modify a certificate. Note that only the name can be modified. * - * @return Object + * @example + * ```ts + * const certificate = + * await client.admin.organization.certificates.update( + * 'certificate_id', + * ); + * ``` */ - raw() { - return this[MAP]; + update(certificateID, body2, options) { + return this._client.post((0, path_1.path)`/organization/certificates/${certificateID}`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } /** - * Get an iterator on keys. + * List uploaded certificates for this organization. * - * @return Iterator + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const certificateListResponse of client.admin.organization.certificates.list()) { + * // ... + * } + * ``` */ - keys() { - return createHeadersIterator(this, "key"); + list(query = {}, options) { + return this._client.getAPIList("/organization/certificates", pagination_1.ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } /** - * Get an iterator on values. + * Delete a certificate from the organization. * - * @return Iterator + * The certificate must be inactive for the organization and all projects. + * + * @example + * ```ts + * const certificate = + * await client.admin.organization.certificates.delete( + * 'certificate_id', + * ); + * ``` */ - values() { - return createHeadersIterator(this, "value"); + delete(certificateID, options) { + return this._client.delete((0, path_1.path)`/organization/certificates/${certificateID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } /** - * Get an iterator on entries. + * Activate certificates at the organization level. * - * This is the default iterator of the Headers object. + * You can atomically and idempotently activate up to 10 certificates at a time. * - * @return Iterator + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const certificateActivateResponse of client.admin.organization.certificates.activate( + * { certificate_ids: ['cert_abc'] }, + * )) { + * // ... + * } + * ``` */ - [Symbol.iterator]() { - return createHeadersIterator(this, "key+value"); - } - }; - Headers3.prototype.entries = Headers3.prototype[Symbol.iterator]; - Object.defineProperty(Headers3.prototype, Symbol.toStringTag, { - value: "Headers", - writable: false, - enumerable: false, - configurable: true - }); - Object.defineProperties(Headers3.prototype, { - get: { enumerable: true }, - forEach: { enumerable: true }, - set: { enumerable: true }, - append: { enumerable: true }, - has: { enumerable: true }, - delete: { enumerable: true }, - keys: { enumerable: true }, - values: { enumerable: true }, - entries: { enumerable: true } - }); - INTERNAL = /* @__PURE__ */ Symbol("internal"); - HeadersIteratorPrototype = Object.setPrototypeOf({ - next() { - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError("Value of `this` is not a HeadersIterator"); - } - var _INTERNAL = this[INTERNAL]; - const target = _INTERNAL.target, kind = _INTERNAL.kind, index2 = _INTERNAL.index; - const values = getHeaders(target, kind); - const len = values.length; - if (index2 >= len) { - return { - value: void 0, - done: true - }; - } - this[INTERNAL].index = index2 + 1; - return { - value: values[index2], - done: false - }; - } - }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); - Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: "HeadersIterator", - writable: false, - enumerable: false, - configurable: true - }); - INTERNALS$1 = /* @__PURE__ */ Symbol("Response internals"); - STATUS_CODES = http3.STATUS_CODES; - Response = class _Response { - constructor() { - let body2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null; - let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - Body.call(this, body2, opts); - const status = opts.status || 200; - const headers = new Headers3(opts.headers); - if (body2 != null && !headers.has("Content-Type")) { - const contentType2 = extractContentType(body2); - if (contentType2) { - headers.append("Content-Type", contentType2); - } - } - this[INTERNALS$1] = { - url: opts.url, - status, - statusText: opts.statusText || STATUS_CODES[status], - headers, - counter: opts.counter - }; + activate(body2, options) { + return this._client.getAPIList("/organization/certificates/activate", pagination_1.Page, { + body: body2, + method: "post", + ...options, + __security: { adminAPIKeyAuth: true } + }); } - get url() { - return this[INTERNALS$1].url || ""; + /** + * Deactivate certificates at the organization level. + * + * You can atomically and idempotently deactivate up to 10 certificates at a time. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const certificateDeactivateResponse of client.admin.organization.certificates.deactivate( + * { certificate_ids: ['cert_abc'] }, + * )) { + * // ... + * } + * ``` + */ + deactivate(body2, options) { + return this._client.getAPIList("/organization/certificates/deactivate", pagination_1.Page, { body: body2, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); } - get status() { - return this[INTERNALS$1].status; + }; + exports2.Certificates = Certificates; + } +}); + +// node_modules/openai/resources/admin/organization/data-retention.js +var require_data_retention = __commonJS({ + "node_modules/openai/resources/admin/organization/data-retention.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DataRetention = void 0; + var resource_1 = require_resource(); + var DataRetention = class extends resource_1.APIResource { + /** + * Retrieves organization data retention controls. + * + * @example + * ```ts + * const organizationDataRetention = + * await client.admin.organization.dataRetention.retrieve(); + * ``` + */ + retrieve(options) { + return this._client.get("/organization/data_retention", { + ...options, + __security: { adminAPIKeyAuth: true } + }); } /** - * Convenience property representing if the request ended normally + * Updates organization data retention controls. + * + * @example + * ```ts + * const organizationDataRetention = + * await client.admin.organization.dataRetention.update({ + * retention_type: 'zero_data_retention', + * }); + * ``` */ - get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; + update(body2, options) { + return this._client.post("/organization/data_retention", { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - get redirected() { - return this[INTERNALS$1].counter > 0; + }; + exports2.DataRetention = DataRetention; + } +}); + +// node_modules/openai/resources/admin/organization/invites.js +var require_invites = __commonJS({ + "node_modules/openai/resources/admin/organization/invites.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Invites = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Invites = class extends resource_1.APIResource { + /** + * Create an invite for a user to the organization. The invite must be accepted by + * the user before they have access to the organization. + * + * @example + * ```ts + * const invite = + * await client.admin.organization.invites.create({ + * email: 'email', + * role: 'reader', + * }); + * ``` + */ + create(body2, options) { + return this._client.post("/organization/invites", { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - get statusText() { - return this[INTERNALS$1].statusText; + /** + * Retrieves an invite. + * + * @example + * ```ts + * const invite = + * await client.admin.organization.invites.retrieve( + * 'invite_id', + * ); + * ``` + */ + retrieve(inviteID, options) { + return this._client.get((0, path_1.path)`/organization/invites/${inviteID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - get headers() { - return this[INTERNALS$1].headers; + /** + * Returns a list of invites in the organization. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const invite of client.admin.organization.invites.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/organization/invites", pagination_1.ConversationCursorPage, { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } /** - * Clone this response + * Delete an invite. If the invite has already been accepted, it cannot be deleted. * - * @return Response + * @example + * ```ts + * const invite = + * await client.admin.organization.invites.delete( + * 'invite_id', + * ); + * ``` */ - clone() { - return new _Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok, - redirected: this.redirected + delete(inviteID, options) { + return this._client.delete((0, path_1.path)`/organization/invites/${inviteID}`, { + ...options, + __security: { adminAPIKeyAuth: true } }); } }; - Body.mixIn(Response.prototype); - Object.defineProperties(Response.prototype, { - url: { enumerable: true }, - status: { enumerable: true }, - ok: { enumerable: true }, - redirected: { enumerable: true }, - statusText: { enumerable: true }, - headers: { enumerable: true }, - clone: { enumerable: true } - }); - Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: "Response", - writable: false, - enumerable: false, - configurable: true - }); - INTERNALS$2 = /* @__PURE__ */ Symbol("Request internals"); - URL2 = Url.URL || import_whatwg_url.default.URL; - parse_url = Url.parse; - format_url = Url.format; - streamDestructionSupported = "destroy" in Stream2.Readable.prototype; - Request2 = class _Request { - constructor(input) { - let init = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - let parsedURL; - if (!isRequest(input)) { - if (input && input.href) { - parsedURL = parseURL(input.href); - } else { - parsedURL = parseURL(`${input}`); - } - input = {}; - } else { - parsedURL = parseURL(input.url); - } - let method = init.method || input.method || "GET"; - method = method.toUpperCase(); - if ((init.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) { - throw new TypeError("Request with GET/HEAD method cannot have body"); - } - let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; - Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 + exports2.Invites = Invites; + } +}); + +// node_modules/openai/resources/admin/organization/roles.js +var require_roles = __commonJS({ + "node_modules/openai/resources/admin/organization/roles.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Roles = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Roles = class extends resource_1.APIResource { + /** + * Creates a custom role for the organization. + * + * @example + * ```ts + * const role = await client.admin.organization.roles.create({ + * permissions: ['string'], + * role_name: 'role_name', + * }); + * ``` + */ + create(body2, options) { + return this._client.post("/organization/roles", { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } }); - const headers = new Headers3(init.headers || input.headers || {}); - if (inputBody != null && !headers.has("Content-Type")) { - const contentType2 = extractContentType(inputBody); - if (contentType2) { - headers.append("Content-Type", contentType2); - } - } - let signal = isRequest(input) ? input.signal : null; - if ("signal" in init) signal = init.signal; - if (signal != null && !isAbortSignal(signal)) { - throw new TypeError("Expected signal to be an instanceof AbortSignal"); - } - this[INTERNALS$2] = { - method, - redirect: init.redirect || input.redirect || "follow", - headers, - parsedURL, - signal - }; - this.follow = init.follow !== void 0 ? init.follow : input.follow !== void 0 ? input.follow : 20; - this.compress = init.compress !== void 0 ? init.compress : input.compress !== void 0 ? input.compress : true; - this.counter = init.counter || input.counter || 0; - this.agent = init.agent || input.agent; - } - get method() { - return this[INTERNALS$2].method; - } - get url() { - return format_url(this[INTERNALS$2].parsedURL); } - get headers() { - return this[INTERNALS$2].headers; + /** + * Retrieves an organization role. + * + * @example + * ```ts + * const role = await client.admin.organization.roles.retrieve( + * 'role_id', + * ); + * ``` + */ + retrieve(roleID, options) { + return this._client.get((0, path_1.path)`/organization/roles/${roleID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - get redirect() { - return this[INTERNALS$2].redirect; + /** + * Updates an existing organization role. + * + * @example + * ```ts + * const role = await client.admin.organization.roles.update( + * 'role_id', + * ); + * ``` + */ + update(roleID, body2, options) { + return this._client.post((0, path_1.path)`/organization/roles/${roleID}`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - get signal() { - return this[INTERNALS$2].signal; + /** + * Lists the roles configured for the organization. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const role of client.admin.organization.roles.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/organization/roles", pagination_1.NextCursorPage, { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } /** - * Clone this request + * Deletes a custom role from the organization. * - * @return Request + * @example + * ```ts + * const role = await client.admin.organization.roles.delete( + * 'role_id', + * ); + * ``` */ - clone() { - return new _Request(this); + delete(roleID, options) { + return this._client.delete((0, path_1.path)`/organization/roles/${roleID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } }; - Body.mixIn(Request2.prototype); - Object.defineProperty(Request2.prototype, Symbol.toStringTag, { - value: "Request", - writable: false, - enumerable: false, - configurable: true - }); - Object.defineProperties(Request2.prototype, { - method: { enumerable: true }, - url: { enumerable: true }, - headers: { enumerable: true }, - redirect: { enumerable: true }, - clone: { enumerable: true }, - signal: { enumerable: true } - }); - AbortError3.prototype = Object.create(Error.prototype); - AbortError3.prototype.constructor = AbortError3; - AbortError3.prototype.name = "AbortError"; - URL$1 = Url.URL || import_whatwg_url.default.URL; - PassThrough$1 = Stream2.PassThrough; - isDomainOrSubdomain = function isDomainOrSubdomain2(destination, original) { - const orig = new URL$1(original).hostname; - const dest = new URL$1(destination).hostname; - return orig === dest || orig[orig.length - dest.length - 1] === "." && orig.endsWith(dest); - }; - isSameProtocol = function isSameProtocol2(destination, original) { - const orig = new URL$1(original).protocol; - const dest = new URL$1(destination).protocol; - return orig === dest; - }; - fetch3.isRedirect = function(code) { - return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; - }; - fetch3.Promise = global.Promise; - lib_default = fetch3; + exports2.Roles = Roles; } }); -// node_modules/web-streams-polyfill/dist/ponyfill.js -var require_ponyfill = __commonJS({ - "node_modules/web-streams-polyfill/dist/ponyfill.js"(exports2, module) { +// node_modules/openai/resources/admin/organization/spend-alerts.js +var require_spend_alerts = __commonJS({ + "node_modules/openai/resources/admin/organization/spend-alerts.js"(exports2) { "use strict"; - !(function(e6, t6) { - "object" == typeof exports2 && "undefined" != typeof module ? t6(exports2) : "function" == typeof define && define.amd ? define(["exports"], t6) : t6((e6 = "undefined" != typeof globalThis ? globalThis : e6 || self).WebStreamsPolyfill = {}); - })(exports2, (function(e6) { - "use strict"; - const t6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? Symbol : (e7) => `Symbol(${e7})`; - function r6() { + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SpendAlerts = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var SpendAlerts = class extends resource_1.APIResource { + /** + * Creates an organization spend alert. + * + * @example + * ```ts + * const organizationSpendAlert = + * await client.admin.organization.spendAlerts.create({ + * currency: 'USD', + * interval: 'month', + * notification_channel: { + * recipients: ['string'], + * type: 'email', + * }, + * threshold_amount: 0, + * }); + * ``` + */ + create(body2, options) { + return this._client.post("/organization/spend_alerts", { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function o6(e7) { - return "object" == typeof e7 && null !== e7 || "function" == typeof e7; + /** + * Updates an organization spend alert. + * + * @example + * ```ts + * const organizationSpendAlert = + * await client.admin.organization.spendAlerts.update( + * 'alert_id', + * { + * currency: 'USD', + * interval: 'month', + * notification_channel: { + * recipients: ['string'], + * type: 'email', + * }, + * threshold_amount: 0, + * }, + * ); + * ``` + */ + update(alertID, body2, options) { + return this._client.post((0, path_1.path)`/organization/spend_alerts/${alertID}`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - const n12 = r6; - function a6(e7, t7) { - try { - Object.defineProperty(e7, "name", { value: t7, configurable: true }); - } catch (e8) { - } + /** + * Lists organization spend alerts. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const organizationSpendAlert of client.admin.organization.spendAlerts.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/organization/spend_alerts", pagination_1.ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } - const i6 = Promise, l6 = Promise.prototype.then, s6 = Promise.resolve.bind(i6), u6 = Promise.reject.bind(i6); - function c6(e7) { - return new i6(e7); + /** + * Deletes an organization spend alert. + * + * @example + * ```ts + * const organizationSpendAlertDeleted = + * await client.admin.organization.spendAlerts.delete( + * 'alert_id', + * ); + * ``` + */ + delete(alertID, options) { + return this._client.delete((0, path_1.path)`/organization/spend_alerts/${alertID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function d6(e7) { - return s6(e7); + }; + exports2.SpendAlerts = SpendAlerts; + } +}); + +// node_modules/openai/resources/admin/organization/usage.js +var require_usage = __commonJS({ + "node_modules/openai/resources/admin/organization/usage.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Usage = void 0; + var resource_1 = require_resource(); + var Usage = class extends resource_1.APIResource { + /** + * Get audio speeches usage details for the organization. + * + * @example + * ```ts + * const response = + * await client.admin.organization.usage.audioSpeeches({ + * start_time: 0, + * }); + * ``` + */ + audioSpeeches(query, options) { + return this._client.get("/organization/usage/audio_speeches", { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function f6(e7) { - return u6(e7); + /** + * Get audio transcriptions usage details for the organization. + * + * @example + * ```ts + * const response = + * await client.admin.organization.usage.audioTranscriptions( + * { start_time: 0 }, + * ); + * ``` + */ + audioTranscriptions(query, options) { + return this._client.get("/organization/usage/audio_transcriptions", { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function b6(e7, t7, r7) { - return l6.call(e7, t7, r7); + /** + * Get code interpreter sessions usage details for the organization. + * + * @example + * ```ts + * const response = + * await client.admin.organization.usage.codeInterpreterSessions( + * { start_time: 0 }, + * ); + * ``` + */ + codeInterpreterSessions(query, options) { + return this._client.get("/organization/usage/code_interpreter_sessions", { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function h6(e7, t7, r7) { - b6(b6(e7, t7, r7), void 0, n12); + /** + * Get completions usage details for the organization. + * + * @example + * ```ts + * const response = + * await client.admin.organization.usage.completions({ + * start_time: 0, + * }); + * ``` + */ + completions(query, options) { + return this._client.get("/organization/usage/completions", { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function _3(e7, t7) { - h6(e7, t7); + /** + * Get costs details for the organization. + * + * @example + * ```ts + * const response = + * await client.admin.organization.usage.costs({ + * start_time: 0, + * }); + * ``` + */ + costs(query, options) { + return this._client.get("/organization/costs", { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function p6(e7, t7) { - h6(e7, void 0, t7); + /** + * Get embeddings usage details for the organization. + * + * @example + * ```ts + * const response = + * await client.admin.organization.usage.embeddings({ + * start_time: 0, + * }); + * ``` + */ + embeddings(query, options) { + return this._client.get("/organization/usage/embeddings", { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function m6(e7, t7, r7) { - return b6(e7, t7, r7); + /** + * Get file search calls usage details for the organization. + * + * @example + * ```ts + * const response = + * await client.admin.organization.usage.fileSearchCalls({ + * start_time: 0, + * }); + * ``` + */ + fileSearchCalls(query, options) { + return this._client.get("/organization/usage/file_search_calls", { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function y2(e7) { - b6(e7, void 0, n12); + /** + * Get images usage details for the organization. + * + * @example + * ```ts + * const response = + * await client.admin.organization.usage.images({ + * start_time: 0, + * }); + * ``` + */ + images(query, options) { + return this._client.get("/organization/usage/images", { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - let g6 = (e7) => { - if ("function" == typeof queueMicrotask) g6 = queueMicrotask; - else { - const e8 = d6(void 0); - g6 = (t7) => b6(e8, t7); - } - return g6(e7); - }; - function S(e7, t7, r7) { - if ("function" != typeof e7) throw new TypeError("Argument is not a function"); - return Function.prototype.apply.call(e7, t7, r7); + /** + * Get moderations usage details for the organization. + * + * @example + * ```ts + * const response = + * await client.admin.organization.usage.moderations({ + * start_time: 0, + * }); + * ``` + */ + moderations(query, options) { + return this._client.get("/organization/usage/moderations", { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function w5(e7, t7, r7) { - try { - return d6(S(e7, t7, r7)); - } catch (e8) { - return f6(e8); - } + /** + * Get vector stores usage details for the organization. + * + * @example + * ```ts + * const response = + * await client.admin.organization.usage.vectorStores({ + * start_time: 0, + * }); + * ``` + */ + vectorStores(query, options) { + return this._client.get("/organization/usage/vector_stores", { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - class v8 { - constructor() { - this._cursor = 0, this._size = 0, this._front = { _elements: [], _next: void 0 }, this._back = this._front, this._cursor = 0, this._size = 0; - } - get length() { - return this._size; - } - push(e7) { - const t7 = this._back; - let r7 = t7; - 16383 === t7._elements.length && (r7 = { _elements: [], _next: void 0 }), t7._elements.push(e7), r7 !== t7 && (this._back = r7, t7._next = r7), ++this._size; - } - shift() { - const e7 = this._front; - let t7 = e7; - const r7 = this._cursor; - let o7 = r7 + 1; - const n13 = e7._elements, a7 = n13[r7]; - return 16384 === o7 && (t7 = e7._next, o7 = 0), --this._size, this._cursor = o7, e7 !== t7 && (this._front = t7), n13[r7] = void 0, a7; - } - forEach(e7) { - let t7 = this._cursor, r7 = this._front, o7 = r7._elements; - for (; !(t7 === o7.length && void 0 === r7._next || t7 === o7.length && (r7 = r7._next, o7 = r7._elements, t7 = 0, 0 === o7.length)); ) e7(o7[t7]), ++t7; - } - peek() { - const e7 = this._front, t7 = this._cursor; - return e7._elements[t7]; - } + /** + * Get web search calls usage details for the organization. + * + * @example + * ```ts + * const response = + * await client.admin.organization.usage.webSearchCalls({ + * start_time: 0, + * }); + * ``` + */ + webSearchCalls(query, options) { + return this._client.get("/organization/usage/web_search_calls", { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - const R2 = t6("[[AbortSteps]]"), T2 = t6("[[ErrorSteps]]"), q7 = t6("[[CancelSteps]]"), C3 = t6("[[PullSteps]]"), P2 = t6("[[ReleaseSteps]]"); - function E2(e7, t7) { - e7._ownerReadableStream = t7, t7._reader = e7, "readable" === t7._state ? B3(e7) : "closed" === t7._state ? (function(e8) { - B3(e8), z2(e8); - })(e7) : A3(e7, t7._storedError); + }; + exports2.Usage = Usage; + } +}); + +// node_modules/openai/resources/admin/organization/groups/roles.js +var require_roles2 = __commonJS({ + "node_modules/openai/resources/admin/organization/groups/roles.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Roles = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Roles = class extends resource_1.APIResource { + /** + * Assigns an organization role to a group within the organization. + * + * @example + * ```ts + * const role = + * await client.admin.organization.groups.roles.create( + * 'group_id', + * { role_id: 'role_id' }, + * ); + * ``` + */ + create(groupID, body2, options) { + return this._client.post((0, path_1.path)`/organization/groups/${groupID}/roles`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function W2(e7, t7) { - return Xt2(e7._ownerReadableStream, t7); + /** + * Retrieves an organization role assigned to a group. + * + * @example + * ```ts + * const role = + * await client.admin.organization.groups.roles.retrieve( + * 'role_id', + * { group_id: 'group_id' }, + * ); + * ``` + */ + retrieve(roleID, params, options) { + const { group_id } = params; + return this._client.get((0, path_1.path)`/organization/groups/${group_id}/roles/${roleID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function O2(e7) { - const t7 = e7._ownerReadableStream; - "readable" === t7._state ? j7(e7, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")) : (function(e8, t8) { - A3(e8, t8); - })(e7, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")), t7._readableStreamController[P2](), t7._reader = void 0, e7._ownerReadableStream = void 0; + /** + * Lists the organization roles assigned to a group within the organization. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const roleListResponse of client.admin.organization.groups.roles.list( + * 'group_id', + * )) { + * // ... + * } + * ``` + */ + list(groupID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/organization/groups/${groupID}/roles`, pagination_1.NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } - function k7(e7) { - return new TypeError("Cannot " + e7 + " a stream using a released reader"); + /** + * Unassigns an organization role from a group within the organization. + * + * @example + * ```ts + * const role = + * await client.admin.organization.groups.roles.delete( + * 'role_id', + * { group_id: 'group_id' }, + * ); + * ``` + */ + delete(roleID, params, options) { + const { group_id } = params; + return this._client.delete((0, path_1.path)`/organization/groups/${group_id}/roles/${roleID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function B3(e7) { - e7._closedPromise = c6(((t7, r7) => { - e7._closedPromise_resolve = t7, e7._closedPromise_reject = r7; - })); + }; + exports2.Roles = Roles; + } +}); + +// node_modules/openai/resources/admin/organization/groups/users.js +var require_users = __commonJS({ + "node_modules/openai/resources/admin/organization/groups/users.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Users = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Users = class extends resource_1.APIResource { + /** + * Adds a user to a group. + * + * @example + * ```ts + * const user = + * await client.admin.organization.groups.users.create( + * 'group_id', + * { user_id: 'user_id' }, + * ); + * ``` + */ + create(groupID, body2, options) { + return this._client.post((0, path_1.path)`/organization/groups/${groupID}/users`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function A3(e7, t7) { - B3(e7), j7(e7, t7); + /** + * Retrieves a user in a group. + * + * @example + * ```ts + * const user = + * await client.admin.organization.groups.users.retrieve( + * 'user_id', + * { group_id: 'group_id' }, + * ); + * ``` + */ + retrieve(userID, params, options) { + const { group_id } = params; + return this._client.get((0, path_1.path)`/organization/groups/${group_id}/users/${userID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function j7(e7, t7) { - void 0 !== e7._closedPromise_reject && (y2(e7._closedPromise), e7._closedPromise_reject(t7), e7._closedPromise_resolve = void 0, e7._closedPromise_reject = void 0); + /** + * Lists the users assigned to a group. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const organizationGroupUser of client.admin.organization.groups.users.list( + * 'group_id', + * )) { + * // ... + * } + * ``` + */ + list(groupID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/organization/groups/${groupID}/users`, pagination_1.NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } - function z2(e7) { - void 0 !== e7._closedPromise_resolve && (e7._closedPromise_resolve(void 0), e7._closedPromise_resolve = void 0, e7._closedPromise_reject = void 0); + /** + * Removes a user from a group. + * + * @example + * ```ts + * const user = + * await client.admin.organization.groups.users.delete( + * 'user_id', + * { group_id: 'group_id' }, + * ); + * ``` + */ + delete(userID, params, options) { + const { group_id } = params; + return this._client.delete((0, path_1.path)`/organization/groups/${group_id}/users/${userID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - const L2 = Number.isFinite || function(e7) { - return "number" == typeof e7 && isFinite(e7); - }, F3 = Math.trunc || function(e7) { - return e7 < 0 ? Math.ceil(e7) : Math.floor(e7); - }; - function D3(e7, t7) { - if (void 0 !== e7 && ("object" != typeof (r7 = e7) && "function" != typeof r7)) throw new TypeError(`${t7} is not an object.`); - var r7; + }; + exports2.Users = Users; + } +}); + +// node_modules/openai/resources/admin/organization/groups/groups.js +var require_groups = __commonJS({ + "node_modules/openai/resources/admin/organization/groups/groups.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Groups = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var RolesAPI = tslib_1.__importStar(require_roles2()); + var roles_1 = require_roles2(); + var UsersAPI = tslib_1.__importStar(require_users()); + var users_1 = require_users(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Groups = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.users = new UsersAPI.Users(this._client); + this.roles = new RolesAPI.Roles(this._client); } - function I3(e7, t7) { - if ("function" != typeof e7) throw new TypeError(`${t7} is not a function.`); + /** + * Creates a new group in the organization. + * + * @example + * ```ts + * const group = await client.admin.organization.groups.create( + * { name: 'x' }, + * ); + * ``` + */ + create(body2, options) { + return this._client.post("/organization/groups", { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function $(e7, t7) { - if (!/* @__PURE__ */ (function(e8) { - return "object" == typeof e8 && null !== e8 || "function" == typeof e8; - })(e7)) throw new TypeError(`${t7} is not an object.`); + /** + * Retrieves a group. + * + * @example + * ```ts + * const group = + * await client.admin.organization.groups.retrieve( + * 'group_id', + * ); + * ``` + */ + retrieve(groupID, options) { + return this._client.get((0, path_1.path)`/organization/groups/${groupID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function M2(e7, t7, r7) { - if (void 0 === e7) throw new TypeError(`Parameter ${t7} is required in '${r7}'.`); + /** + * Updates a group's information. + * + * @example + * ```ts + * const group = await client.admin.organization.groups.update( + * 'group_id', + * { name: 'x' }, + * ); + * ``` + */ + update(groupID, body2, options) { + return this._client.post((0, path_1.path)`/organization/groups/${groupID}`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Y2(e7, t7, r7) { - if (void 0 === e7) throw new TypeError(`${t7} is required in '${r7}'.`); + /** + * Lists all groups in the organization. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const group of client.admin.organization.groups.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/organization/groups", pagination_1.NextCursorPage, { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Q2(e7) { - return Number(e7); + /** + * Deletes a group from the organization. + * + * @example + * ```ts + * const group = await client.admin.organization.groups.delete( + * 'group_id', + * ); + * ``` + */ + delete(groupID, options) { + return this._client.delete((0, path_1.path)`/organization/groups/${groupID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function N2(e7) { - return 0 === e7 ? 0 : e7; + }; + exports2.Groups = Groups; + Groups.Users = users_1.Users; + Groups.Roles = roles_1.Roles; + } +}); + +// node_modules/openai/resources/admin/organization/projects/api-keys.js +var require_api_keys = __commonJS({ + "node_modules/openai/resources/admin/organization/projects/api-keys.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.APIKeys = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var APIKeys = class extends resource_1.APIResource { + /** + * Retrieves an API key in the project. + * + * @example + * ```ts + * const projectAPIKey = + * await client.admin.organization.projects.apiKeys.retrieve( + * 'api_key_id', + * { project_id: 'project_id' }, + * ); + * ``` + */ + retrieve(apiKeyID, params, options) { + const { project_id } = params; + return this._client.get((0, path_1.path)`/organization/projects/${project_id}/api_keys/${apiKeyID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function x6(e7, t7) { - const r7 = Number.MAX_SAFE_INTEGER; - let o7 = Number(e7); - if (o7 = N2(o7), !L2(o7)) throw new TypeError(`${t7} is not a finite number`); - if (o7 = (function(e8) { - return N2(F3(e8)); - })(o7), o7 < 0 || o7 > r7) throw new TypeError(`${t7} is outside the accepted range of 0 to ${r7}, inclusive`); - return L2(o7) && 0 !== o7 ? o7 : 0; - } - function H3(e7) { - if (!o6(e7)) return false; - if ("function" != typeof e7.getReader) return false; - try { - return "boolean" == typeof e7.locked; - } catch (e8) { - return false; - } + /** + * Returns a list of API keys in the project. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const projectAPIKey of client.admin.organization.projects.apiKeys.list( + * 'project_id', + * )) { + * // ... + * } + * ``` + */ + list(projectID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/organization/projects/${projectID}/api_keys`, pagination_1.ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } - function V2(e7) { - if (!o6(e7)) return false; - if ("function" != typeof e7.getWriter) return false; - try { - return "boolean" == typeof e7.locked; - } catch (e8) { - return false; - } + /** + * Deletes an API key from the project. + * + * Returns confirmation of the key deletion, or an error if the key belonged to a + * service account. + * + * @example + * ```ts + * const apiKey = + * await client.admin.organization.projects.apiKeys.delete( + * 'api_key_id', + * { project_id: 'project_id' }, + * ); + * ``` + */ + delete(apiKeyID, params, options) { + const { project_id } = params; + return this._client.delete((0, path_1.path)`/organization/projects/${project_id}/api_keys/${apiKeyID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function U2(e7, t7) { - if (!Ut2(e7)) throw new TypeError(`${t7} is not a ReadableStream.`); + }; + exports2.APIKeys = APIKeys; + } +}); + +// node_modules/openai/resources/admin/organization/projects/certificates.js +var require_certificates2 = __commonJS({ + "node_modules/openai/resources/admin/organization/projects/certificates.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Certificates = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Certificates = class extends resource_1.APIResource { + /** + * List certificates for this project. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const certificateListResponse of client.admin.organization.projects.certificates.list( + * 'project_id', + * )) { + * // ... + * } + * ``` + */ + list(projectID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/organization/projects/${projectID}/certificates`, pagination_1.ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } - function G3(e7, t7) { - e7._reader._readRequests.push(t7); + /** + * Activate certificates at the project level. + * + * You can atomically and idempotently activate up to 10 certificates at a time. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const certificateActivateResponse of client.admin.organization.projects.certificates.activate( + * 'project_id', + * { certificate_ids: ['cert_abc'] }, + * )) { + * // ... + * } + * ``` + */ + activate(projectID, body2, options) { + return this._client.getAPIList((0, path_1.path)`/organization/projects/${projectID}/certificates/activate`, pagination_1.Page, { body: body2, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); } - function X2(e7, t7, r7) { - const o7 = e7._reader._readRequests.shift(); - r7 ? o7._closeSteps() : o7._chunkSteps(t7); + /** + * Deactivate certificates at the project level. You can atomically and + * idempotently deactivate up to 10 certificates at a time. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const certificateDeactivateResponse of client.admin.organization.projects.certificates.deactivate( + * 'project_id', + * { certificate_ids: ['cert_abc'] }, + * )) { + * // ... + * } + * ``` + */ + deactivate(projectID, body2, options) { + return this._client.getAPIList((0, path_1.path)`/organization/projects/${projectID}/certificates/deactivate`, pagination_1.Page, { body: body2, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); } - function J2(e7) { - return e7._reader._readRequests.length; + }; + exports2.Certificates = Certificates; + } +}); + +// node_modules/openai/resources/admin/organization/projects/data-retention.js +var require_data_retention2 = __commonJS({ + "node_modules/openai/resources/admin/organization/projects/data-retention.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DataRetention = void 0; + var resource_1 = require_resource(); + var path_1 = require_path2(); + var DataRetention = class extends resource_1.APIResource { + /** + * Retrieves project data retention controls. + * + * @example + * ```ts + * const projectDataRetention = + * await client.admin.organization.projects.dataRetention.retrieve( + * 'project_id', + * ); + * ``` + */ + retrieve(projectID, options) { + return this._client.get((0, path_1.path)`/organization/projects/${projectID}/data_retention`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function K2(e7) { - const t7 = e7._reader; - return void 0 !== t7 && !!Z(t7); + /** + * Updates project data retention controls. + * + * @example + * ```ts + * const projectDataRetention = + * await client.admin.organization.projects.dataRetention.update( + * 'project_id', + * { retention_type: 'organization_default' }, + * ); + * ``` + */ + update(projectID, body2, options) { + return this._client.post((0, path_1.path)`/organization/projects/${projectID}/data_retention`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - class ReadableStreamDefaultReader { - constructor(e7) { - if (M2(e7, 1, "ReadableStreamDefaultReader"), U2(e7, "First parameter"), Gt2(e7)) throw new TypeError("This stream has already been locked for exclusive reading by another reader"); - E2(this, e7), this._readRequests = new v8(); - } - get closed() { - return Z(this) ? this._closedPromise : f6(te2("closed")); - } - cancel(e7) { - return Z(this) ? void 0 === this._ownerReadableStream ? f6(k7("cancel")) : W2(this, e7) : f6(te2("cancel")); - } - read() { - if (!Z(this)) return f6(te2("read")); - if (void 0 === this._ownerReadableStream) return f6(k7("read from")); - let e7, t7; - const r7 = c6(((r8, o7) => { - e7 = r8, t7 = o7; - })); - return (function(e8, t8) { - const r8 = e8._ownerReadableStream; - r8._disturbed = true, "closed" === r8._state ? t8._closeSteps() : "errored" === r8._state ? t8._errorSteps(r8._storedError) : r8._readableStreamController[C3](t8); - })(this, { _chunkSteps: (t8) => e7({ value: t8, done: false }), _closeSteps: () => e7({ value: void 0, done: true }), _errorSteps: (e8) => t7(e8) }), r7; - } - releaseLock() { - if (!Z(this)) throw te2("releaseLock"); - void 0 !== this._ownerReadableStream && (function(e7) { - O2(e7); - const t7 = new TypeError("Reader was released"); - ee2(e7, t7); - })(this); - } + }; + exports2.DataRetention = DataRetention; + } +}); + +// node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.js +var require_hosted_tool_permissions = __commonJS({ + "node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.HostedToolPermissions = void 0; + var resource_1 = require_resource(); + var path_1 = require_path2(); + var HostedToolPermissions = class extends resource_1.APIResource { + /** + * Returns hosted tool permissions for a project. + * + * @example + * ```ts + * const projectHostedToolPermissions = + * await client.admin.organization.projects.hostedToolPermissions.retrieve( + * 'project_id', + * ); + * ``` + */ + retrieve(projectID, options) { + return this._client.get((0, path_1.path)`/organization/projects/${projectID}/hosted_tool_permissions`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Z(e7) { - return !!o6(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_readRequests") && e7 instanceof ReadableStreamDefaultReader); + /** + * Updates hosted tool permissions for a project. + * + * @example + * ```ts + * const projectHostedToolPermissions = + * await client.admin.organization.projects.hostedToolPermissions.update( + * 'project_id', + * ); + * ``` + */ + update(projectID, body2, options) { + return this._client.post((0, path_1.path)`/organization/projects/${projectID}/hosted_tool_permissions`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function ee2(e7, t7) { - const r7 = e7._readRequests; - e7._readRequests = new v8(), r7.forEach(((e8) => { - e8._errorSteps(t7); - })); + }; + exports2.HostedToolPermissions = HostedToolPermissions; + } +}); + +// node_modules/openai/resources/admin/organization/projects/model-permissions.js +var require_model_permissions = __commonJS({ + "node_modules/openai/resources/admin/organization/projects/model-permissions.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ModelPermissions = void 0; + var resource_1 = require_resource(); + var path_1 = require_path2(); + var ModelPermissions = class extends resource_1.APIResource { + /** + * Returns model permissions for a project. + * + * @example + * ```ts + * const projectModelPermissions = + * await client.admin.organization.projects.modelPermissions.retrieve( + * 'project_id', + * ); + * ``` + */ + retrieve(projectID, options) { + return this._client.get((0, path_1.path)`/organization/projects/${projectID}/model_permissions`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function te2(e7) { - return new TypeError(`ReadableStreamDefaultReader.prototype.${e7} can only be used on a ReadableStreamDefaultReader`); + /** + * Updates model permissions for a project. + * + * @example + * ```ts + * const projectModelPermissions = + * await client.admin.organization.projects.modelPermissions.update( + * 'project_id', + * { mode: 'allow_list', model_ids: ['string'] }, + * ); + * ``` + */ + update(projectID, body2, options) { + return this._client.post((0, path_1.path)`/organization/projects/${projectID}/model_permissions`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - Object.defineProperties(ReadableStreamDefaultReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), a6(ReadableStreamDefaultReader.prototype.cancel, "cancel"), a6(ReadableStreamDefaultReader.prototype.read, "read"), a6(ReadableStreamDefaultReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof t6.toStringTag && Object.defineProperty(ReadableStreamDefaultReader.prototype, t6.toStringTag, { value: "ReadableStreamDefaultReader", configurable: true }); - class re2 { - constructor(e7, t7) { - this._ongoingPromise = void 0, this._isFinished = false, this._reader = e7, this._preventCancel = t7; - } - next() { - const e7 = () => this._nextSteps(); - return this._ongoingPromise = this._ongoingPromise ? m6(this._ongoingPromise, e7, e7) : e7(), this._ongoingPromise; - } - return(e7) { - const t7 = () => this._returnSteps(e7); - return this._ongoingPromise ? m6(this._ongoingPromise, t7, t7) : t7(); - } - _nextSteps() { - if (this._isFinished) return Promise.resolve({ value: void 0, done: true }); - const e7 = this._reader; - return void 0 === e7 ? f6(k7("iterate")) : b6(e7.read(), ((e8) => { - var t7; - return this._ongoingPromise = void 0, e8.done && (this._isFinished = true, null === (t7 = this._reader) || void 0 === t7 || t7.releaseLock(), this._reader = void 0), e8; - }), ((e8) => { - var t7; - throw this._ongoingPromise = void 0, this._isFinished = true, null === (t7 = this._reader) || void 0 === t7 || t7.releaseLock(), this._reader = void 0, e8; - })); - } - _returnSteps(e7) { - if (this._isFinished) return Promise.resolve({ value: e7, done: true }); - this._isFinished = true; - const t7 = this._reader; - if (void 0 === t7) return f6(k7("finish iterating")); - if (this._reader = void 0, !this._preventCancel) { - const r7 = t7.cancel(e7); - return t7.releaseLock(), m6(r7, (() => ({ value: e7, done: true }))); - } - return t7.releaseLock(), d6({ value: e7, done: true }); - } + /** + * Deletes model permissions for a project. + * + * @example + * ```ts + * const projectModelPermissionsDeleted = + * await client.admin.organization.projects.modelPermissions.delete( + * 'project_id', + * ); + * ``` + */ + delete(projectID, options) { + return this._client.delete((0, path_1.path)`/organization/projects/${projectID}/model_permissions`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - const oe2 = { next() { - return ne2(this) ? this._asyncIteratorImpl.next() : f6(ae2("next")); - }, return(e7) { - return ne2(this) ? this._asyncIteratorImpl.return(e7) : f6(ae2("return")); - } }; - function ne2(e7) { - if (!o6(e7)) return false; - if (!Object.prototype.hasOwnProperty.call(e7, "_asyncIteratorImpl")) return false; - try { - return e7._asyncIteratorImpl instanceof re2; - } catch (e8) { - return false; - } + }; + exports2.ModelPermissions = ModelPermissions; + } +}); + +// node_modules/openai/resources/admin/organization/projects/rate-limits.js +var require_rate_limits = __commonJS({ + "node_modules/openai/resources/admin/organization/projects/rate-limits.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.RateLimits = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var RateLimits = class extends resource_1.APIResource { + /** + * Returns the rate limits per model for a project. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const projectRateLimit of client.admin.organization.projects.rateLimits.listRateLimits( + * 'project_id', + * )) { + * // ... + * } + * ``` + */ + listRateLimits(projectID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/organization/projects/${projectID}/rate_limits`, pagination_1.ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } - function ae2(e7) { - return new TypeError(`ReadableStreamAsyncIterator.${e7} can only be used on a ReadableSteamAsyncIterator`); + /** + * Updates a project rate limit. + * + * @example + * ```ts + * const projectRateLimit = + * await client.admin.organization.projects.rateLimits.updateRateLimit( + * 'rate_limit_id', + * { project_id: 'project_id' }, + * ); + * ``` + */ + updateRateLimit(rateLimitID, params, options) { + const { project_id, ...body2 } = params; + return this._client.post((0, path_1.path)`/organization/projects/${project_id}/rate_limits/${rateLimitID}`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - "symbol" == typeof t6.asyncIterator && Object.defineProperty(oe2, t6.asyncIterator, { value() { - return this; - }, writable: true, configurable: true }); - const ie2 = Number.isNaN || function(e7) { - return e7 != e7; - }; - function le2(e7, t7, r7, o7, n13) { - new Uint8Array(e7).set(new Uint8Array(r7, o7, n13), t7); + }; + exports2.RateLimits = RateLimits; + } +}); + +// node_modules/openai/resources/admin/organization/projects/roles.js +var require_roles3 = __commonJS({ + "node_modules/openai/resources/admin/organization/projects/roles.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Roles = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Roles = class extends resource_1.APIResource { + /** + * Creates a custom role for a project. + * + * @example + * ```ts + * const role = + * await client.admin.organization.projects.roles.create( + * 'project_id', + * { permissions: ['string'], role_name: 'role_name' }, + * ); + * ``` + */ + create(projectID, body2, options) { + return this._client.post((0, path_1.path)`/projects/${projectID}/roles`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function se2(e7) { - const t7 = (function(e8, t8, r7) { - if (e8.slice) return e8.slice(t8, r7); - const o7 = r7 - t8, n13 = new ArrayBuffer(o7); - return le2(n13, 0, e8, t8, o7), n13; - })(e7.buffer, e7.byteOffset, e7.byteOffset + e7.byteLength); - return new Uint8Array(t7); + /** + * Retrieves a project role. + * + * @example + * ```ts + * const role = + * await client.admin.organization.projects.roles.retrieve( + * 'role_id', + * { project_id: 'project_id' }, + * ); + * ``` + */ + retrieve(roleID, params, options) { + const { project_id } = params; + return this._client.get((0, path_1.path)`/projects/${project_id}/roles/${roleID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function ue2(e7) { - const t7 = e7._queue.shift(); - return e7._queueTotalSize -= t7.size, e7._queueTotalSize < 0 && (e7._queueTotalSize = 0), t7.value; + /** + * Updates an existing project role. + * + * @example + * ```ts + * const role = + * await client.admin.organization.projects.roles.update( + * 'role_id', + * { project_id: 'project_id' }, + * ); + * ``` + */ + update(roleID, params, options) { + const { project_id, ...body2 } = params; + return this._client.post((0, path_1.path)`/projects/${project_id}/roles/${roleID}`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function ce2(e7, t7, r7) { - if ("number" != typeof (o7 = r7) || ie2(o7) || o7 < 0 || r7 === 1 / 0) throw new RangeError("Size must be a finite, non-NaN, non-negative number."); - var o7; - e7._queue.push({ value: t7, size: r7 }), e7._queueTotalSize += r7; + /** + * Lists the roles configured for a project. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const role of client.admin.organization.projects.roles.list( + * 'project_id', + * )) { + * // ... + * } + * ``` + */ + list(projectID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/projects/${projectID}/roles`, pagination_1.NextCursorPage, { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function de2(e7) { - e7._queue = new v8(), e7._queueTotalSize = 0; + /** + * Deletes a custom role from a project. + * + * @example + * ```ts + * const role = + * await client.admin.organization.projects.roles.delete( + * 'role_id', + * { project_id: 'project_id' }, + * ); + * ``` + */ + delete(roleID, params, options) { + const { project_id } = params; + return this._client.delete((0, path_1.path)`/projects/${project_id}/roles/${roleID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - class ReadableStreamBYOBRequest { - constructor() { - throw new TypeError("Illegal constructor"); - } - get view() { - if (!be2(this)) throw Ae2("view"); - return this._view; - } - respond(e7) { - if (!be2(this)) throw Ae2("respond"); - if (M2(e7, 1, "respond"), e7 = x6(e7, "First parameter"), void 0 === this._associatedReadableByteStreamController) throw new TypeError("This BYOB request has been invalidated"); - this._view.buffer, (function(e8, t7) { - const r7 = e8._pendingPullIntos.peek(); - if ("closed" === e8._controlledReadableByteStream._state) { - if (0 !== t7) throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream"); - } else { - if (0 === t7) throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream"); - if (r7.bytesFilled + t7 > r7.byteLength) throw new RangeError("bytesWritten out of range"); - } - r7.buffer = r7.buffer, Ce2(e8, t7); - })(this._associatedReadableByteStreamController, e7); - } - respondWithNewView(e7) { - if (!be2(this)) throw Ae2("respondWithNewView"); - if (M2(e7, 1, "respondWithNewView"), !ArrayBuffer.isView(e7)) throw new TypeError("You can only respond with array buffer views"); - if (void 0 === this._associatedReadableByteStreamController) throw new TypeError("This BYOB request has been invalidated"); - e7.buffer, (function(e8, t7) { - const r7 = e8._pendingPullIntos.peek(); - if ("closed" === e8._controlledReadableByteStream._state) { - if (0 !== t7.byteLength) throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream"); - } else if (0 === t7.byteLength) throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream"); - if (r7.byteOffset + r7.bytesFilled !== t7.byteOffset) throw new RangeError("The region specified by view does not match byobRequest"); - if (r7.bufferByteLength !== t7.buffer.byteLength) throw new RangeError("The buffer of view has different capacity than byobRequest"); - if (r7.bytesFilled + t7.byteLength > r7.byteLength) throw new RangeError("The region specified by view is larger than byobRequest"); - const o7 = t7.byteLength; - r7.buffer = t7.buffer, Ce2(e8, o7); - })(this._associatedReadableByteStreamController, e7); - } + }; + exports2.Roles = Roles; + } +}); + +// node_modules/openai/resources/admin/organization/projects/service-accounts.js +var require_service_accounts = __commonJS({ + "node_modules/openai/resources/admin/organization/projects/service-accounts.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ServiceAccounts = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var ServiceAccounts = class extends resource_1.APIResource { + /** + * Creates a new service account in the project. This also returns an unredacted + * API key for the service account. + * + * @example + * ```ts + * const serviceAccount = + * await client.admin.organization.projects.serviceAccounts.create( + * 'project_id', + * { name: 'name' }, + * ); + * ``` + */ + create(projectID, body2, options) { + return this._client.post((0, path_1.path)`/organization/projects/${projectID}/service_accounts`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - Object.defineProperties(ReadableStreamBYOBRequest.prototype, { respond: { enumerable: true }, respondWithNewView: { enumerable: true }, view: { enumerable: true } }), a6(ReadableStreamBYOBRequest.prototype.respond, "respond"), a6(ReadableStreamBYOBRequest.prototype.respondWithNewView, "respondWithNewView"), "symbol" == typeof t6.toStringTag && Object.defineProperty(ReadableStreamBYOBRequest.prototype, t6.toStringTag, { value: "ReadableStreamBYOBRequest", configurable: true }); - class ReadableByteStreamController { - constructor() { - throw new TypeError("Illegal constructor"); - } - get byobRequest() { - if (!fe2(this)) throw je2("byobRequest"); - return (function(e7) { - if (null === e7._byobRequest && e7._pendingPullIntos.length > 0) { - const t7 = e7._pendingPullIntos.peek(), r7 = new Uint8Array(t7.buffer, t7.byteOffset + t7.bytesFilled, t7.byteLength - t7.bytesFilled), o7 = Object.create(ReadableStreamBYOBRequest.prototype); - !(function(e8, t8, r8) { - e8._associatedReadableByteStreamController = t8, e8._view = r8; - })(o7, e7, r7), e7._byobRequest = o7; - } - return e7._byobRequest; - })(this); - } - get desiredSize() { - if (!fe2(this)) throw je2("desiredSize"); - return ke2(this); - } - close() { - if (!fe2(this)) throw je2("close"); - if (this._closeRequested) throw new TypeError("The stream has already been closed; do not close it again!"); - const e7 = this._controlledReadableByteStream._state; - if ("readable" !== e7) throw new TypeError(`The stream (in ${e7} state) is not in the readable state and cannot be closed`); - !(function(e8) { - const t7 = e8._controlledReadableByteStream; - if (e8._closeRequested || "readable" !== t7._state) return; - if (e8._queueTotalSize > 0) return void (e8._closeRequested = true); - if (e8._pendingPullIntos.length > 0) { - if (e8._pendingPullIntos.peek().bytesFilled > 0) { - const t8 = new TypeError("Insufficient bytes to fill elements in the given buffer"); - throw We2(e8, t8), t8; - } - } - Ee2(e8), Jt2(t7); - })(this); - } - enqueue(e7) { - if (!fe2(this)) throw je2("enqueue"); - if (M2(e7, 1, "enqueue"), !ArrayBuffer.isView(e7)) throw new TypeError("chunk must be an array buffer view"); - if (0 === e7.byteLength) throw new TypeError("chunk must have non-zero byteLength"); - if (0 === e7.buffer.byteLength) throw new TypeError("chunk's buffer must have non-zero byteLength"); - if (this._closeRequested) throw new TypeError("stream is closed or draining"); - const t7 = this._controlledReadableByteStream._state; - if ("readable" !== t7) throw new TypeError(`The stream (in ${t7} state) is not in the readable state and cannot be enqueued to`); - !(function(e8, t8) { - const r7 = e8._controlledReadableByteStream; - if (e8._closeRequested || "readable" !== r7._state) return; - const o7 = t8.buffer, n13 = t8.byteOffset, a7 = t8.byteLength, i7 = o7; - if (e8._pendingPullIntos.length > 0) { - const t9 = e8._pendingPullIntos.peek(); - t9.buffer, 0, Te2(e8), t9.buffer = t9.buffer, "none" === t9.readerType && Se2(e8, t9); - } - if (K2(r7)) if ((function(e9) { - const t9 = e9._controlledReadableByteStream._reader; - for (; t9._readRequests.length > 0; ) { - if (0 === e9._queueTotalSize) return; - Oe2(e9, t9._readRequests.shift()); - } - })(e8), 0 === J2(r7)) ye2(e8, i7, n13, a7); - else { - e8._pendingPullIntos.length > 0 && Pe2(e8); - X2(r7, new Uint8Array(i7, n13, a7), false); - } - else Fe2(r7) ? (ye2(e8, i7, n13, a7), qe2(e8)) : ye2(e8, i7, n13, a7); - he2(e8); - })(this, e7); - } - error(e7) { - if (!fe2(this)) throw je2("error"); - We2(this, e7); - } - [q7](e7) { - _e7(this), de2(this); - const t7 = this._cancelAlgorithm(e7); - return Ee2(this), t7; - } - [C3](e7) { - const t7 = this._controlledReadableByteStream; - if (this._queueTotalSize > 0) return void Oe2(this, e7); - const r7 = this._autoAllocateChunkSize; - if (void 0 !== r7) { - let t8; - try { - t8 = new ArrayBuffer(r7); - } catch (t9) { - return void e7._errorSteps(t9); - } - const o7 = { buffer: t8, bufferByteLength: r7, byteOffset: 0, byteLength: r7, bytesFilled: 0, elementSize: 1, viewConstructor: Uint8Array, readerType: "default" }; - this._pendingPullIntos.push(o7); - } - G3(t7, e7), he2(this); - } - [P2]() { - if (this._pendingPullIntos.length > 0) { - const e7 = this._pendingPullIntos.peek(); - e7.readerType = "none", this._pendingPullIntos = new v8(), this._pendingPullIntos.push(e7); - } - } + /** + * Retrieves a service account in the project. + * + * @example + * ```ts + * const projectServiceAccount = + * await client.admin.organization.projects.serviceAccounts.retrieve( + * 'service_account_id', + * { project_id: 'project_id' }, + * ); + * ``` + */ + retrieve(serviceAccountID, params, options) { + const { project_id } = params; + return this._client.get((0, path_1.path)`/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function fe2(e7) { - return !!o6(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_controlledReadableByteStream") && e7 instanceof ReadableByteStreamController); + /** + * Updates a service account in the project. + * + * @example + * ```ts + * const projectServiceAccount = + * await client.admin.organization.projects.serviceAccounts.update( + * 'service_account_id', + * { project_id: 'project_id' }, + * ); + * ``` + */ + update(serviceAccountID, params, options) { + const { project_id, ...body2 } = params; + return this._client.post((0, path_1.path)`/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { body: body2, ...options, __security: { adminAPIKeyAuth: true } }); } - function be2(e7) { - return !!o6(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_associatedReadableByteStreamController") && e7 instanceof ReadableStreamBYOBRequest); + /** + * Returns a list of service accounts in the project. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const projectServiceAccount of client.admin.organization.projects.serviceAccounts.list( + * 'project_id', + * )) { + * // ... + * } + * ``` + */ + list(projectID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/organization/projects/${projectID}/service_accounts`, pagination_1.ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } - function he2(e7) { - const t7 = (function(e8) { - const t8 = e8._controlledReadableByteStream; - if ("readable" !== t8._state) return false; - if (e8._closeRequested) return false; - if (!e8._started) return false; - if (K2(t8) && J2(t8) > 0) return true; - if (Fe2(t8) && Le2(t8) > 0) return true; - if (ke2(e8) > 0) return true; - return false; - })(e7); - if (!t7) return; - if (e7._pulling) return void (e7._pullAgain = true); - e7._pulling = true; - h6(e7._pullAlgorithm(), (() => (e7._pulling = false, e7._pullAgain && (e7._pullAgain = false, he2(e7)), null)), ((t8) => (We2(e7, t8), null))); + /** + * Deletes a service account from the project. + * + * Returns confirmation of service account deletion, or an error if the project is + * archived (archived projects have no service accounts). + * + * @example + * ```ts + * const serviceAccount = + * await client.admin.organization.projects.serviceAccounts.delete( + * 'service_account_id', + * { project_id: 'project_id' }, + * ); + * ``` + */ + delete(serviceAccountID, params, options) { + const { project_id } = params; + return this._client.delete((0, path_1.path)`/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { ...options, __security: { adminAPIKeyAuth: true } }); } - function _e7(e7) { - Te2(e7), e7._pendingPullIntos = new v8(); + }; + exports2.ServiceAccounts = ServiceAccounts; + } +}); + +// node_modules/openai/resources/admin/organization/projects/spend-alerts.js +var require_spend_alerts2 = __commonJS({ + "node_modules/openai/resources/admin/organization/projects/spend-alerts.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SpendAlerts = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var SpendAlerts = class extends resource_1.APIResource { + /** + * Creates a project spend alert. + * + * @example + * ```ts + * const projectSpendAlert = + * await client.admin.organization.projects.spendAlerts.create( + * 'project_id', + * { + * currency: 'USD', + * interval: 'month', + * notification_channel: { + * recipients: ['string'], + * type: 'email', + * }, + * threshold_amount: 0, + * }, + * ); + * ``` + */ + create(projectID, body2, options) { + return this._client.post((0, path_1.path)`/organization/projects/${projectID}/spend_alerts`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function pe2(e7, t7) { - let r7 = false; - "closed" === e7._state && (r7 = true); - const o7 = me2(t7); - "default" === t7.readerType ? X2(e7, o7, r7) : (function(e8, t8, r8) { - const o8 = e8._reader._readIntoRequests.shift(); - r8 ? o8._closeSteps(t8) : o8._chunkSteps(t8); - })(e7, o7, r7); + /** + * Updates a project spend alert. + * + * @example + * ```ts + * const projectSpendAlert = + * await client.admin.organization.projects.spendAlerts.update( + * 'alert_id', + * { + * project_id: 'project_id', + * currency: 'USD', + * interval: 'month', + * notification_channel: { + * recipients: ['string'], + * type: 'email', + * }, + * threshold_amount: 0, + * }, + * ); + * ``` + */ + update(alertID, params, options) { + const { project_id, ...body2 } = params; + return this._client.post((0, path_1.path)`/organization/projects/${project_id}/spend_alerts/${alertID}`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function me2(e7) { - const t7 = e7.bytesFilled, r7 = e7.elementSize; - return new e7.viewConstructor(e7.buffer, e7.byteOffset, t7 / r7); + /** + * Lists project spend alerts. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const projectSpendAlert of client.admin.organization.projects.spendAlerts.list( + * 'project_id', + * )) { + * // ... + * } + * ``` + */ + list(projectID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/organization/projects/${projectID}/spend_alerts`, pagination_1.ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } - function ye2(e7, t7, r7, o7) { - e7._queue.push({ buffer: t7, byteOffset: r7, byteLength: o7 }), e7._queueTotalSize += o7; + /** + * Deletes a project spend alert. + * + * @example + * ```ts + * const projectSpendAlertDeleted = + * await client.admin.organization.projects.spendAlerts.delete( + * 'alert_id', + * { project_id: 'project_id' }, + * ); + * ``` + */ + delete(alertID, params, options) { + const { project_id } = params; + return this._client.delete((0, path_1.path)`/organization/projects/${project_id}/spend_alerts/${alertID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function ge2(e7, t7, r7, o7) { - let n13; - try { - n13 = t7.slice(r7, r7 + o7); - } catch (t8) { - throw We2(e7, t8), t8; - } - ye2(e7, n13, 0, o7); + }; + exports2.SpendAlerts = SpendAlerts; + } +}); + +// node_modules/openai/resources/admin/organization/projects/groups/roles.js +var require_roles4 = __commonJS({ + "node_modules/openai/resources/admin/organization/projects/groups/roles.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Roles = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Roles = class extends resource_1.APIResource { + /** + * Assigns a project role to a group within a project. + * + * @example + * ```ts + * const role = + * await client.admin.organization.projects.groups.roles.create( + * 'group_id', + * { project_id: 'project_id', role_id: 'role_id' }, + * ); + * ``` + */ + create(groupID, params, options) { + const { project_id, ...body2 } = params; + return this._client.post((0, path_1.path)`/projects/${project_id}/groups/${groupID}/roles`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Se2(e7, t7) { - t7.bytesFilled > 0 && ge2(e7, t7.buffer, t7.byteOffset, t7.bytesFilled), Pe2(e7); + /** + * Retrieves a project role assigned to a group. + * + * @example + * ```ts + * const role = + * await client.admin.organization.projects.groups.roles.retrieve( + * 'role_id', + * { project_id: 'project_id', group_id: 'group_id' }, + * ); + * ``` + */ + retrieve(roleID, params, options) { + const { project_id, group_id } = params; + return this._client.get((0, path_1.path)`/projects/${project_id}/groups/${group_id}/roles/${roleID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function we2(e7, t7) { - const r7 = t7.elementSize, o7 = t7.bytesFilled - t7.bytesFilled % r7, n13 = Math.min(e7._queueTotalSize, t7.byteLength - t7.bytesFilled), a7 = t7.bytesFilled + n13, i7 = a7 - a7 % r7; - let l7 = n13, s7 = false; - i7 > o7 && (l7 = i7 - t7.bytesFilled, s7 = true); - const u7 = e7._queue; - for (; l7 > 0; ) { - const r8 = u7.peek(), o8 = Math.min(l7, r8.byteLength), n14 = t7.byteOffset + t7.bytesFilled; - le2(t7.buffer, n14, r8.buffer, r8.byteOffset, o8), r8.byteLength === o8 ? u7.shift() : (r8.byteOffset += o8, r8.byteLength -= o8), e7._queueTotalSize -= o8, ve2(e7, o8, t7), l7 -= o8; - } - return s7; + /** + * Lists the project roles assigned to a group within a project. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const roleListResponse of client.admin.organization.projects.groups.roles.list( + * 'group_id', + * { project_id: 'project_id' }, + * )) { + * // ... + * } + * ``` + */ + list(groupID, params, options) { + const { project_id, ...query } = params; + return this._client.getAPIList((0, path_1.path)`/projects/${project_id}/groups/${groupID}/roles`, pagination_1.NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } - function ve2(e7, t7, r7) { - r7.bytesFilled += t7; + /** + * Unassigns a project role from a group within a project. + * + * @example + * ```ts + * const role = + * await client.admin.organization.projects.groups.roles.delete( + * 'role_id', + * { project_id: 'project_id', group_id: 'group_id' }, + * ); + * ``` + */ + delete(roleID, params, options) { + const { project_id, group_id } = params; + return this._client.delete((0, path_1.path)`/projects/${project_id}/groups/${group_id}/roles/${roleID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Re2(e7) { - 0 === e7._queueTotalSize && e7._closeRequested ? (Ee2(e7), Jt2(e7._controlledReadableByteStream)) : he2(e7); + }; + exports2.Roles = Roles; + } +}); + +// node_modules/openai/resources/admin/organization/projects/groups/groups.js +var require_groups2 = __commonJS({ + "node_modules/openai/resources/admin/organization/projects/groups/groups.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Groups = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var RolesAPI = tslib_1.__importStar(require_roles4()); + var roles_1 = require_roles4(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Groups = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.roles = new RolesAPI.Roles(this._client); } - function Te2(e7) { - null !== e7._byobRequest && (e7._byobRequest._associatedReadableByteStreamController = void 0, e7._byobRequest._view = null, e7._byobRequest = null); + /** + * Grants a group access to a project. + * + * @example + * ```ts + * const projectGroup = + * await client.admin.organization.projects.groups.create( + * 'project_id', + * { group_id: 'group_id', role: 'role' }, + * ); + * ``` + */ + create(projectID, body2, options) { + return this._client.post((0, path_1.path)`/organization/projects/${projectID}/groups`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function qe2(e7) { - for (; e7._pendingPullIntos.length > 0; ) { - if (0 === e7._queueTotalSize) return; - const t7 = e7._pendingPullIntos.peek(); - we2(e7, t7) && (Pe2(e7), pe2(e7._controlledReadableByteStream, t7)); - } + /** + * Retrieves a project's group. + * + * @example + * ```ts + * const projectGroup = + * await client.admin.organization.projects.groups.retrieve( + * 'group_id', + * { project_id: 'project_id' }, + * ); + * ``` + */ + retrieve(groupID, params, options) { + const { project_id, ...query } = params; + return this._client.get((0, path_1.path)`/organization/projects/${project_id}/groups/${groupID}`, { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Ce2(e7, t7) { - const r7 = e7._pendingPullIntos.peek(); - Te2(e7); - "closed" === e7._controlledReadableByteStream._state ? (function(e8, t8) { - "none" === t8.readerType && Pe2(e8); - const r8 = e8._controlledReadableByteStream; - if (Fe2(r8)) for (; Le2(r8) > 0; ) pe2(r8, Pe2(e8)); - })(e7, r7) : (function(e8, t8, r8) { - if (ve2(0, t8, r8), "none" === r8.readerType) return Se2(e8, r8), void qe2(e8); - if (r8.bytesFilled < r8.elementSize) return; - Pe2(e8); - const o7 = r8.bytesFilled % r8.elementSize; - if (o7 > 0) { - const t9 = r8.byteOffset + r8.bytesFilled; - ge2(e8, r8.buffer, t9 - o7, o7); - } - r8.bytesFilled -= o7, pe2(e8._controlledReadableByteStream, r8), qe2(e8); - })(e7, t7, r7), he2(e7); + /** + * Lists the groups that have access to a project. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const projectGroup of client.admin.organization.projects.groups.list( + * 'project_id', + * )) { + * // ... + * } + * ``` + */ + list(projectID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/organization/projects/${projectID}/groups`, pagination_1.NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } - function Pe2(e7) { - return e7._pendingPullIntos.shift(); + /** + * Revokes a group's access to a project. + * + * @example + * ```ts + * const group = + * await client.admin.organization.projects.groups.delete( + * 'group_id', + * { project_id: 'project_id' }, + * ); + * ``` + */ + delete(groupID, params, options) { + const { project_id } = params; + return this._client.delete((0, path_1.path)`/organization/projects/${project_id}/groups/${groupID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Ee2(e7) { - e7._pullAlgorithm = void 0, e7._cancelAlgorithm = void 0; + }; + exports2.Groups = Groups; + Groups.Roles = roles_1.Roles; + } +}); + +// node_modules/openai/resources/admin/organization/projects/users/roles.js +var require_roles5 = __commonJS({ + "node_modules/openai/resources/admin/organization/projects/users/roles.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Roles = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Roles = class extends resource_1.APIResource { + /** + * Assigns a project role to a user within a project. + * + * @example + * ```ts + * const role = + * await client.admin.organization.projects.users.roles.create( + * 'user_id', + * { project_id: 'project_id', role_id: 'role_id' }, + * ); + * ``` + */ + create(userID, params, options) { + const { project_id, ...body2 } = params; + return this._client.post((0, path_1.path)`/projects/${project_id}/users/${userID}/roles`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function We2(e7, t7) { - const r7 = e7._controlledReadableByteStream; - "readable" === r7._state && (_e7(e7), de2(e7), Ee2(e7), Kt2(r7, t7)); + /** + * Retrieves a project role assigned to a user. + * + * @example + * ```ts + * const role = + * await client.admin.organization.projects.users.roles.retrieve( + * 'role_id', + * { project_id: 'project_id', user_id: 'user_id' }, + * ); + * ``` + */ + retrieve(roleID, params, options) { + const { project_id, user_id } = params; + return this._client.get((0, path_1.path)`/projects/${project_id}/users/${user_id}/roles/${roleID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Oe2(e7, t7) { - const r7 = e7._queue.shift(); - e7._queueTotalSize -= r7.byteLength, Re2(e7); - const o7 = new Uint8Array(r7.buffer, r7.byteOffset, r7.byteLength); - t7._chunkSteps(o7); + /** + * Lists the project roles assigned to a user within a project. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const roleListResponse of client.admin.organization.projects.users.roles.list( + * 'user_id', + * { project_id: 'project_id' }, + * )) { + * // ... + * } + * ``` + */ + list(userID, params, options) { + const { project_id, ...query } = params; + return this._client.getAPIList((0, path_1.path)`/projects/${project_id}/users/${userID}/roles`, pagination_1.NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } - function ke2(e7) { - const t7 = e7._controlledReadableByteStream._state; - return "errored" === t7 ? null : "closed" === t7 ? 0 : e7._strategyHWM - e7._queueTotalSize; - } - function Be2(e7, t7, r7) { - const o7 = Object.create(ReadableByteStreamController.prototype); - let n13, a7, i7; - n13 = void 0 !== t7.start ? () => t7.start(o7) : () => { - }, a7 = void 0 !== t7.pull ? () => t7.pull(o7) : () => d6(void 0), i7 = void 0 !== t7.cancel ? (e8) => t7.cancel(e8) : () => d6(void 0); - const l7 = t7.autoAllocateChunkSize; - if (0 === l7) throw new TypeError("autoAllocateChunkSize must be greater than 0"); - !(function(e8, t8, r8, o8, n14, a8, i8) { - t8._controlledReadableByteStream = e8, t8._pullAgain = false, t8._pulling = false, t8._byobRequest = null, t8._queue = t8._queueTotalSize = void 0, de2(t8), t8._closeRequested = false, t8._started = false, t8._strategyHWM = a8, t8._pullAlgorithm = o8, t8._cancelAlgorithm = n14, t8._autoAllocateChunkSize = i8, t8._pendingPullIntos = new v8(), e8._readableStreamController = t8, h6(d6(r8()), (() => (t8._started = true, he2(t8), null)), ((e9) => (We2(t8, e9), null))); - })(e7, o7, n13, a7, i7, r7, l7); + /** + * Unassigns a project role from a user within a project. + * + * @example + * ```ts + * const role = + * await client.admin.organization.projects.users.roles.delete( + * 'role_id', + * { project_id: 'project_id', user_id: 'user_id' }, + * ); + * ``` + */ + delete(roleID, params, options) { + const { project_id, user_id } = params; + return this._client.delete((0, path_1.path)`/projects/${project_id}/users/${user_id}/roles/${roleID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Ae2(e7) { - return new TypeError(`ReadableStreamBYOBRequest.prototype.${e7} can only be used on a ReadableStreamBYOBRequest`); + }; + exports2.Roles = Roles; + } +}); + +// node_modules/openai/resources/admin/organization/projects/users/users.js +var require_users2 = __commonJS({ + "node_modules/openai/resources/admin/organization/projects/users/users.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Users = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var RolesAPI = tslib_1.__importStar(require_roles5()); + var roles_1 = require_roles5(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Users = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.roles = new RolesAPI.Roles(this._client); } - function je2(e7) { - return new TypeError(`ReadableByteStreamController.prototype.${e7} can only be used on a ReadableByteStreamController`); + /** + * Adds a user to the project. Users must already be members of the organization to + * be added to a project. + * + * @example + * ```ts + * const projectUser = + * await client.admin.organization.projects.users.create( + * 'project_id', + * { role: 'role' }, + * ); + * ``` + */ + create(projectID, body2, options) { + return this._client.post((0, path_1.path)`/organization/projects/${projectID}/users`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function ze2(e7, t7) { - e7._reader._readIntoRequests.push(t7); + /** + * Retrieves a user in the project. + * + * @example + * ```ts + * const projectUser = + * await client.admin.organization.projects.users.retrieve( + * 'user_id', + * { project_id: 'project_id' }, + * ); + * ``` + */ + retrieve(userID, params, options) { + const { project_id } = params; + return this._client.get((0, path_1.path)`/organization/projects/${project_id}/users/${userID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Le2(e7) { - return e7._reader._readIntoRequests.length; + /** + * Modifies a user's role in the project. + * + * @example + * ```ts + * const projectUser = + * await client.admin.organization.projects.users.update( + * 'user_id', + * { project_id: 'project_id' }, + * ); + * ``` + */ + update(userID, params, options) { + const { project_id, ...body2 } = params; + return this._client.post((0, path_1.path)`/organization/projects/${project_id}/users/${userID}`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Fe2(e7) { - const t7 = e7._reader; - return void 0 !== t7 && !!De2(t7); + /** + * Returns a list of users in the project. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const projectUser of client.admin.organization.projects.users.list( + * 'project_id', + * )) { + * // ... + * } + * ``` + */ + list(projectID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/organization/projects/${projectID}/users`, pagination_1.ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } - Object.defineProperties(ReadableByteStreamController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, byobRequest: { enumerable: true }, desiredSize: { enumerable: true } }), a6(ReadableByteStreamController.prototype.close, "close"), a6(ReadableByteStreamController.prototype.enqueue, "enqueue"), a6(ReadableByteStreamController.prototype.error, "error"), "symbol" == typeof t6.toStringTag && Object.defineProperty(ReadableByteStreamController.prototype, t6.toStringTag, { value: "ReadableByteStreamController", configurable: true }); - class ReadableStreamBYOBReader { - constructor(e7) { - if (M2(e7, 1, "ReadableStreamBYOBReader"), U2(e7, "First parameter"), Gt2(e7)) throw new TypeError("This stream has already been locked for exclusive reading by another reader"); - if (!fe2(e7._readableStreamController)) throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source"); - E2(this, e7), this._readIntoRequests = new v8(); - } - get closed() { - return De2(this) ? this._closedPromise : f6($e2("closed")); - } - cancel(e7) { - return De2(this) ? void 0 === this._ownerReadableStream ? f6(k7("cancel")) : W2(this, e7) : f6($e2("cancel")); - } - read(e7) { - if (!De2(this)) return f6($e2("read")); - if (!ArrayBuffer.isView(e7)) return f6(new TypeError("view must be an array buffer view")); - if (0 === e7.byteLength) return f6(new TypeError("view must have non-zero byteLength")); - if (0 === e7.buffer.byteLength) return f6(new TypeError("view's buffer must have non-zero byteLength")); - if (e7.buffer, void 0 === this._ownerReadableStream) return f6(k7("read from")); - let t7, r7; - const o7 = c6(((e8, o8) => { - t7 = e8, r7 = o8; - })); - return (function(e8, t8, r8) { - const o8 = e8._ownerReadableStream; - o8._disturbed = true, "errored" === o8._state ? r8._errorSteps(o8._storedError) : (function(e9, t9, r9) { - const o9 = e9._controlledReadableByteStream; - let n13 = 1; - t9.constructor !== DataView && (n13 = t9.constructor.BYTES_PER_ELEMENT); - const a7 = t9.constructor, i7 = t9.buffer, l7 = { buffer: i7, bufferByteLength: i7.byteLength, byteOffset: t9.byteOffset, byteLength: t9.byteLength, bytesFilled: 0, elementSize: n13, viewConstructor: a7, readerType: "byob" }; - if (e9._pendingPullIntos.length > 0) return e9._pendingPullIntos.push(l7), void ze2(o9, r9); - if ("closed" !== o9._state) { - if (e9._queueTotalSize > 0) { - if (we2(e9, l7)) { - const t10 = me2(l7); - return Re2(e9), void r9._chunkSteps(t10); - } - if (e9._closeRequested) { - const t10 = new TypeError("Insufficient bytes to fill elements in the given buffer"); - return We2(e9, t10), void r9._errorSteps(t10); - } - } - e9._pendingPullIntos.push(l7), ze2(o9, r9), he2(e9); - } else { - const e10 = new a7(l7.buffer, l7.byteOffset, 0); - r9._closeSteps(e10); - } - })(o8._readableStreamController, t8, r8); - })(this, e7, { _chunkSteps: (e8) => t7({ value: e8, done: false }), _closeSteps: (e8) => t7({ value: e8, done: true }), _errorSteps: (e8) => r7(e8) }), o7; - } - releaseLock() { - if (!De2(this)) throw $e2("releaseLock"); - void 0 !== this._ownerReadableStream && (function(e7) { - O2(e7); - const t7 = new TypeError("Reader was released"); - Ie2(e7, t7); - })(this); - } + /** + * Deletes a user from the project. + * + * Returns confirmation of project user deletion, or an error if the project is + * archived (archived projects have no users). + * + * @example + * ```ts + * const user = + * await client.admin.organization.projects.users.delete( + * 'user_id', + * { project_id: 'project_id' }, + * ); + * ``` + */ + delete(userID, params, options) { + const { project_id } = params; + return this._client.delete((0, path_1.path)`/organization/projects/${project_id}/users/${userID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function De2(e7) { - return !!o6(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_readIntoRequests") && e7 instanceof ReadableStreamBYOBReader); + }; + exports2.Users = Users; + Users.Roles = roles_1.Roles; + } +}); + +// node_modules/openai/resources/admin/organization/projects/projects.js +var require_projects = __commonJS({ + "node_modules/openai/resources/admin/organization/projects/projects.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Projects = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var APIKeysAPI = tslib_1.__importStar(require_api_keys()); + var api_keys_1 = require_api_keys(); + var CertificatesAPI = tslib_1.__importStar(require_certificates2()); + var certificates_1 = require_certificates2(); + var DataRetentionAPI = tslib_1.__importStar(require_data_retention2()); + var data_retention_1 = require_data_retention2(); + var HostedToolPermissionsAPI = tslib_1.__importStar(require_hosted_tool_permissions()); + var hosted_tool_permissions_1 = require_hosted_tool_permissions(); + var ModelPermissionsAPI = tslib_1.__importStar(require_model_permissions()); + var model_permissions_1 = require_model_permissions(); + var RateLimitsAPI = tslib_1.__importStar(require_rate_limits()); + var rate_limits_1 = require_rate_limits(); + var RolesAPI = tslib_1.__importStar(require_roles3()); + var roles_1 = require_roles3(); + var ServiceAccountsAPI = tslib_1.__importStar(require_service_accounts()); + var service_accounts_1 = require_service_accounts(); + var SpendAlertsAPI = tslib_1.__importStar(require_spend_alerts2()); + var spend_alerts_1 = require_spend_alerts2(); + var GroupsAPI = tslib_1.__importStar(require_groups2()); + var groups_1 = require_groups2(); + var UsersAPI = tslib_1.__importStar(require_users2()); + var users_1 = require_users2(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Projects = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.users = new UsersAPI.Users(this._client); + this.serviceAccounts = new ServiceAccountsAPI.ServiceAccounts(this._client); + this.apiKeys = new APIKeysAPI.APIKeys(this._client); + this.rateLimits = new RateLimitsAPI.RateLimits(this._client); + this.modelPermissions = new ModelPermissionsAPI.ModelPermissions(this._client); + this.hostedToolPermissions = new HostedToolPermissionsAPI.HostedToolPermissions(this._client); + this.groups = new GroupsAPI.Groups(this._client); + this.roles = new RolesAPI.Roles(this._client); + this.dataRetention = new DataRetentionAPI.DataRetention(this._client); + this.spendAlerts = new SpendAlertsAPI.SpendAlerts(this._client); + this.certificates = new CertificatesAPI.Certificates(this._client); + } + /** + * Create a new project in the organization. Projects can be created and archived, + * but cannot be deleted. + * + * @example + * ```ts + * const project = + * await client.admin.organization.projects.create({ + * name: 'name', + * }); + * ``` + */ + create(body2, options) { + return this._client.post("/organization/projects", { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Ie2(e7, t7) { - const r7 = e7._readIntoRequests; - e7._readIntoRequests = new v8(), r7.forEach(((e8) => { - e8._errorSteps(t7); - })); + /** + * Retrieves a project. + * + * @example + * ```ts + * const project = + * await client.admin.organization.projects.retrieve( + * 'project_id', + * ); + * ``` + */ + retrieve(projectID, options) { + return this._client.get((0, path_1.path)`/organization/projects/${projectID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function $e2(e7) { - return new TypeError(`ReadableStreamBYOBReader.prototype.${e7} can only be used on a ReadableStreamBYOBReader`); + /** + * Modifies a project in the organization. + * + * @example + * ```ts + * const project = + * await client.admin.organization.projects.update( + * 'project_id', + * ); + * ``` + */ + update(projectID, body2, options) { + return this._client.post((0, path_1.path)`/organization/projects/${projectID}`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Me2(e7, t7) { - const { highWaterMark: r7 } = e7; - if (void 0 === r7) return t7; - if (ie2(r7) || r7 < 0) throw new RangeError("Invalid highWaterMark"); - return r7; + /** + * Returns a list of projects. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const project of client.admin.organization.projects.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/organization/projects", pagination_1.ConversationCursorPage, { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Ye2(e7) { - const { size: t7 } = e7; - return t7 || (() => 1); + /** + * Archives a project in the organization. Archived projects cannot be used or + * updated. + * + * @example + * ```ts + * const project = + * await client.admin.organization.projects.archive( + * 'project_id', + * ); + * ``` + */ + archive(projectID, options) { + return this._client.post((0, path_1.path)`/organization/projects/${projectID}/archive`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Qe2(e7, t7) { - D3(e7, t7); - const r7 = null == e7 ? void 0 : e7.highWaterMark, o7 = null == e7 ? void 0 : e7.size; - return { highWaterMark: void 0 === r7 ? void 0 : Q2(r7), size: void 0 === o7 ? void 0 : Ne2(o7, `${t7} has member 'size' that`) }; + }; + exports2.Projects = Projects; + Projects.Users = users_1.Users; + Projects.ServiceAccounts = service_accounts_1.ServiceAccounts; + Projects.APIKeys = api_keys_1.APIKeys; + Projects.RateLimits = rate_limits_1.RateLimits; + Projects.ModelPermissions = model_permissions_1.ModelPermissions; + Projects.HostedToolPermissions = hosted_tool_permissions_1.HostedToolPermissions; + Projects.Groups = groups_1.Groups; + Projects.Roles = roles_1.Roles; + Projects.DataRetention = data_retention_1.DataRetention; + Projects.SpendAlerts = spend_alerts_1.SpendAlerts; + Projects.Certificates = certificates_1.Certificates; + } +}); + +// node_modules/openai/resources/admin/organization/users/roles.js +var require_roles6 = __commonJS({ + "node_modules/openai/resources/admin/organization/users/roles.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Roles = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Roles = class extends resource_1.APIResource { + /** + * Assigns an organization role to a user within the organization. + * + * @example + * ```ts + * const role = + * await client.admin.organization.users.roles.create( + * 'user_id', + * { role_id: 'role_id' }, + * ); + * ``` + */ + create(userID, body2, options) { + return this._client.post((0, path_1.path)`/organization/users/${userID}/roles`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Ne2(e7, t7) { - return I3(e7, t7), (t8) => Q2(e7(t8)); + /** + * Retrieves an organization role assigned to a user. + * + * @example + * ```ts + * const role = + * await client.admin.organization.users.roles.retrieve( + * 'role_id', + * { user_id: 'user_id' }, + * ); + * ``` + */ + retrieve(roleID, params, options) { + const { user_id } = params; + return this._client.get((0, path_1.path)`/organization/users/${user_id}/roles/${roleID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function xe2(e7, t7, r7) { - return I3(e7, r7), (r8) => w5(e7, t7, [r8]); + /** + * Lists the organization roles assigned to a user within the organization. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const roleListResponse of client.admin.organization.users.roles.list( + * 'user_id', + * )) { + * // ... + * } + * ``` + */ + list(userID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/organization/users/${userID}/roles`, pagination_1.NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); } - function He2(e7, t7, r7) { - return I3(e7, r7), () => w5(e7, t7, []); + /** + * Unassigns an organization role from a user within the organization. + * + * @example + * ```ts + * const role = + * await client.admin.organization.users.roles.delete( + * 'role_id', + * { user_id: 'user_id' }, + * ); + * ``` + */ + delete(roleID, params, options) { + const { user_id } = params; + return this._client.delete((0, path_1.path)`/organization/users/${user_id}/roles/${roleID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Ve2(e7, t7, r7) { - return I3(e7, r7), (r8) => S(e7, t7, [r8]); + }; + exports2.Roles = Roles; + } +}); + +// node_modules/openai/resources/admin/organization/users/users.js +var require_users3 = __commonJS({ + "node_modules/openai/resources/admin/organization/users/users.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Users = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var RolesAPI = tslib_1.__importStar(require_roles6()); + var roles_1 = require_roles6(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Users = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.roles = new RolesAPI.Roles(this._client); } - function Ue2(e7, t7, r7) { - return I3(e7, r7), (r8, o7) => w5(e7, t7, [r8, o7]); + /** + * Retrieves a user by their identifier. + * + * @example + * ```ts + * const organizationUser = + * await client.admin.organization.users.retrieve('user_id'); + * ``` + */ + retrieve(userID, options) { + return this._client.get((0, path_1.path)`/organization/users/${userID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - Object.defineProperties(ReadableStreamBYOBReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), a6(ReadableStreamBYOBReader.prototype.cancel, "cancel"), a6(ReadableStreamBYOBReader.prototype.read, "read"), a6(ReadableStreamBYOBReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof t6.toStringTag && Object.defineProperty(ReadableStreamBYOBReader.prototype, t6.toStringTag, { value: "ReadableStreamBYOBReader", configurable: true }); - const Ge2 = "function" == typeof AbortController; - class WritableStream { - constructor(e7 = {}, t7 = {}) { - void 0 === e7 ? e7 = null : $(e7, "First parameter"); - const r7 = Qe2(t7, "Second parameter"), o7 = (function(e8, t8) { - D3(e8, t8); - const r8 = null == e8 ? void 0 : e8.abort, o8 = null == e8 ? void 0 : e8.close, n14 = null == e8 ? void 0 : e8.start, a8 = null == e8 ? void 0 : e8.type, i7 = null == e8 ? void 0 : e8.write; - return { abort: void 0 === r8 ? void 0 : xe2(r8, e8, `${t8} has member 'abort' that`), close: void 0 === o8 ? void 0 : He2(o8, e8, `${t8} has member 'close' that`), start: void 0 === n14 ? void 0 : Ve2(n14, e8, `${t8} has member 'start' that`), write: void 0 === i7 ? void 0 : Ue2(i7, e8, `${t8} has member 'write' that`), type: a8 }; - })(e7, "First parameter"); - var n13; - (n13 = this)._state = "writable", n13._storedError = void 0, n13._writer = void 0, n13._writableStreamController = void 0, n13._writeRequests = new v8(), n13._inFlightWriteRequest = void 0, n13._closeRequest = void 0, n13._inFlightCloseRequest = void 0, n13._pendingAbortRequest = void 0, n13._backpressure = false; - if (void 0 !== o7.type) throw new RangeError("Invalid type is specified"); - const a7 = Ye2(r7); - !(function(e8, t8, r8, o8) { - const n14 = Object.create(WritableStreamDefaultController.prototype); - let a8, i7, l7, s7; - a8 = void 0 !== t8.start ? () => t8.start(n14) : () => { - }; - i7 = void 0 !== t8.write ? (e9) => t8.write(e9, n14) : () => d6(void 0); - l7 = void 0 !== t8.close ? () => t8.close() : () => d6(void 0); - s7 = void 0 !== t8.abort ? (e9) => t8.abort(e9) : () => d6(void 0); - !(function(e9, t9, r9, o9, n15, a9, i8, l8) { - t9._controlledWritableStream = e9, e9._writableStreamController = t9, t9._queue = void 0, t9._queueTotalSize = void 0, de2(t9), t9._abortReason = void 0, t9._abortController = (function() { - if (Ge2) return new AbortController(); - })(), t9._started = false, t9._strategySizeAlgorithm = l8, t9._strategyHWM = i8, t9._writeAlgorithm = o9, t9._closeAlgorithm = n15, t9._abortAlgorithm = a9; - const s8 = ht2(t9); - at2(e9, s8); - const u7 = r9(); - h6(d6(u7), (() => (t9._started = true, ft2(t9), null)), ((r10) => (t9._started = true, et2(e9, r10), null))); - })(e8, n14, a8, i7, l7, s7, r8, o8); - })(this, o7, Me2(r7, 1), a7); - } - get locked() { - if (!Xe2(this)) throw pt2("locked"); - return Je2(this); - } - abort(e7) { - return Xe2(this) ? Je2(this) ? f6(new TypeError("Cannot abort a stream that already has a writer")) : Ke2(this, e7) : f6(pt2("abort")); - } - close() { - return Xe2(this) ? Je2(this) ? f6(new TypeError("Cannot close a stream that already has a writer")) : ot2(this) ? f6(new TypeError("Cannot close an already-closing stream")) : Ze2(this) : f6(pt2("close")); - } - getWriter() { - if (!Xe2(this)) throw pt2("getWriter"); - return new WritableStreamDefaultWriter(this); - } + /** + * Modifies a user's role in the organization. + * + * @example + * ```ts + * const organizationUser = + * await client.admin.organization.users.update('user_id'); + * ``` + */ + update(userID, body2, options) { + return this._client.post((0, path_1.path)`/organization/users/${userID}`, { + body: body2, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Xe2(e7) { - return !!o6(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_writableStreamController") && e7 instanceof WritableStream); + /** + * Lists all of the users in the organization. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const organizationUser of client.admin.organization.users.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/organization/users", pagination_1.ConversationCursorPage, { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Je2(e7) { - return void 0 !== e7._writer; + /** + * Deletes a user from the organization. + * + * @example + * ```ts + * const user = await client.admin.organization.users.delete( + * 'user_id', + * ); + * ``` + */ + delete(userID, options) { + return this._client.delete((0, path_1.path)`/organization/users/${userID}`, { + ...options, + __security: { adminAPIKeyAuth: true } + }); } - function Ke2(e7, t7) { - var r7; - if ("closed" === e7._state || "errored" === e7._state) return d6(void 0); - e7._writableStreamController._abortReason = t7, null === (r7 = e7._writableStreamController._abortController) || void 0 === r7 || r7.abort(t7); - const o7 = e7._state; - if ("closed" === o7 || "errored" === o7) return d6(void 0); - if (void 0 !== e7._pendingAbortRequest) return e7._pendingAbortRequest._promise; - let n13 = false; - "erroring" === o7 && (n13 = true, t7 = void 0); - const a7 = c6(((r8, o8) => { - e7._pendingAbortRequest = { _promise: void 0, _resolve: r8, _reject: o8, _reason: t7, _wasAlreadyErroring: n13 }; - })); - return e7._pendingAbortRequest._promise = a7, n13 || tt2(e7, t7), a7; - } - function Ze2(e7) { - const t7 = e7._state; - if ("closed" === t7 || "errored" === t7) return f6(new TypeError(`The stream (in ${t7} state) is not in the writable state and cannot be closed`)); - const r7 = c6(((t8, r8) => { - const o8 = { _resolve: t8, _reject: r8 }; - e7._closeRequest = o8; - })), o7 = e7._writer; - var n13; - return void 0 !== o7 && e7._backpressure && "writable" === t7 && Et2(o7), ce2(n13 = e7._writableStreamController, st2, 0), ft2(n13), r7; - } - function et2(e7, t7) { - "writable" !== e7._state ? rt2(e7) : tt2(e7, t7); - } - function tt2(e7, t7) { - const r7 = e7._writableStreamController; - e7._state = "erroring", e7._storedError = t7; - const o7 = e7._writer; - void 0 !== o7 && lt2(o7, t7), !(function(e8) { - if (void 0 === e8._inFlightWriteRequest && void 0 === e8._inFlightCloseRequest) return false; - return true; - })(e7) && r7._started && rt2(e7); - } - function rt2(e7) { - e7._state = "errored", e7._writableStreamController[T2](); - const t7 = e7._storedError; - if (e7._writeRequests.forEach(((e8) => { - e8._reject(t7); - })), e7._writeRequests = new v8(), void 0 === e7._pendingAbortRequest) return void nt2(e7); - const r7 = e7._pendingAbortRequest; - if (e7._pendingAbortRequest = void 0, r7._wasAlreadyErroring) return r7._reject(t7), void nt2(e7); - h6(e7._writableStreamController[R2](r7._reason), (() => (r7._resolve(), nt2(e7), null)), ((t8) => (r7._reject(t8), nt2(e7), null))); - } - function ot2(e7) { - return void 0 !== e7._closeRequest || void 0 !== e7._inFlightCloseRequest; - } - function nt2(e7) { - void 0 !== e7._closeRequest && (e7._closeRequest._reject(e7._storedError), e7._closeRequest = void 0); - const t7 = e7._writer; - void 0 !== t7 && vt2(t7, e7._storedError); + }; + exports2.Users = Users; + Users.Roles = roles_1.Roles; + } +}); + +// node_modules/openai/resources/admin/organization/organization.js +var require_organization = __commonJS({ + "node_modules/openai/resources/admin/organization/organization.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Organization = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var AdminAPIKeysAPI = tslib_1.__importStar(require_admin_api_keys()); + var admin_api_keys_1 = require_admin_api_keys(); + var AuditLogsAPI = tslib_1.__importStar(require_audit_logs()); + var audit_logs_1 = require_audit_logs(); + var CertificatesAPI = tslib_1.__importStar(require_certificates()); + var certificates_1 = require_certificates(); + var DataRetentionAPI = tslib_1.__importStar(require_data_retention()); + var data_retention_1 = require_data_retention(); + var InvitesAPI = tslib_1.__importStar(require_invites()); + var invites_1 = require_invites(); + var RolesAPI = tslib_1.__importStar(require_roles()); + var roles_1 = require_roles(); + var SpendAlertsAPI = tslib_1.__importStar(require_spend_alerts()); + var spend_alerts_1 = require_spend_alerts(); + var UsageAPI = tslib_1.__importStar(require_usage()); + var usage_1 = require_usage(); + var GroupsAPI = tslib_1.__importStar(require_groups()); + var groups_1 = require_groups(); + var ProjectsAPI = tslib_1.__importStar(require_projects()); + var projects_1 = require_projects(); + var UsersAPI = tslib_1.__importStar(require_users3()); + var users_1 = require_users3(); + var Organization = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.auditLogs = new AuditLogsAPI.AuditLogs(this._client); + this.adminAPIKeys = new AdminAPIKeysAPI.AdminAPIKeys(this._client); + this.usage = new UsageAPI.Usage(this._client); + this.invites = new InvitesAPI.Invites(this._client); + this.users = new UsersAPI.Users(this._client); + this.groups = new GroupsAPI.Groups(this._client); + this.roles = new RolesAPI.Roles(this._client); + this.dataRetention = new DataRetentionAPI.DataRetention(this._client); + this.spendAlerts = new SpendAlertsAPI.SpendAlerts(this._client); + this.certificates = new CertificatesAPI.Certificates(this._client); + this.projects = new ProjectsAPI.Projects(this._client); + } + }; + exports2.Organization = Organization; + Organization.AuditLogs = audit_logs_1.AuditLogs; + Organization.AdminAPIKeys = admin_api_keys_1.AdminAPIKeys; + Organization.Usage = usage_1.Usage; + Organization.Invites = invites_1.Invites; + Organization.Users = users_1.Users; + Organization.Groups = groups_1.Groups; + Organization.Roles = roles_1.Roles; + Organization.DataRetention = data_retention_1.DataRetention; + Organization.SpendAlerts = spend_alerts_1.SpendAlerts; + Organization.Certificates = certificates_1.Certificates; + Organization.Projects = projects_1.Projects; + } +}); + +// node_modules/openai/resources/admin/admin.js +var require_admin = __commonJS({ + "node_modules/openai/resources/admin/admin.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Admin = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var OrganizationAPI = tslib_1.__importStar(require_organization()); + var organization_1 = require_organization(); + var Admin = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.organization = new OrganizationAPI.Organization(this._client); } - function at2(e7, t7) { - const r7 = e7._writer; - void 0 !== r7 && t7 !== e7._backpressure && (t7 ? (function(e8) { - Tt2(e8); - })(r7) : Et2(r7)), e7._backpressure = t7; + }; + exports2.Admin = Admin; + Admin.Organization = organization_1.Organization; + } +}); + +// node_modules/openai/internal/headers.js +var require_headers4 = __commonJS({ + "node_modules/openai/internal/headers.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isEmptyHeaders = exports2.buildHeaders = void 0; + var values_1 = require_values(); + var brand_privateNullableHeaders = /* @__PURE__ */ Symbol("brand.privateNullableHeaders"); + function* iterateHeaders(headers) { + if (!headers) + return; + if (brand_privateNullableHeaders in headers) { + const { values, nulls } = headers; + yield* values.entries(); + for (const name of nulls) { + yield [name, null]; + } + return; } - Object.defineProperties(WritableStream.prototype, { abort: { enumerable: true }, close: { enumerable: true }, getWriter: { enumerable: true }, locked: { enumerable: true } }), a6(WritableStream.prototype.abort, "abort"), a6(WritableStream.prototype.close, "close"), a6(WritableStream.prototype.getWriter, "getWriter"), "symbol" == typeof t6.toStringTag && Object.defineProperty(WritableStream.prototype, t6.toStringTag, { value: "WritableStream", configurable: true }); - class WritableStreamDefaultWriter { - constructor(e7) { - if (M2(e7, 1, "WritableStreamDefaultWriter"), (function(e8, t8) { - if (!Xe2(e8)) throw new TypeError(`${t8} is not a WritableStream.`); - })(e7, "First parameter"), Je2(e7)) throw new TypeError("This stream has already been locked for exclusive writing by another writer"); - this._ownerWritableStream = e7, e7._writer = this; - const t7 = e7._state; - if ("writable" === t7) !ot2(e7) && e7._backpressure ? Tt2(this) : Ct2(this), St2(this); - else if ("erroring" === t7) qt2(this, e7._storedError), St2(this); - else if ("closed" === t7) Ct2(this), St2(r7 = this), Rt2(r7); - else { - const t8 = e7._storedError; - qt2(this, t8), wt2(this, t8); + let shouldClear = false; + let iter; + if (headers instanceof Headers) { + iter = headers.entries(); + } else if ((0, values_1.isReadonlyArray)(headers)) { + iter = headers; + } else { + shouldClear = true; + iter = Object.entries(headers ?? {}); + } + for (let row of iter) { + const name = row[0]; + if (typeof name !== "string") + throw new TypeError("expected header name to be a string"); + const values = (0, values_1.isReadonlyArray)(row[1]) ? row[1] : [row[1]]; + let didClear = false; + for (const value of values) { + if (value === void 0) + continue; + if (shouldClear && !didClear) { + didClear = true; + yield [name, null]; } - var r7; - } - get closed() { - return it2(this) ? this._closedPromise : f6(yt2("closed")); - } - get desiredSize() { - if (!it2(this)) throw yt2("desiredSize"); - if (void 0 === this._ownerWritableStream) throw gt2("desiredSize"); - return (function(e7) { - const t7 = e7._ownerWritableStream, r7 = t7._state; - if ("errored" === r7 || "erroring" === r7) return null; - if ("closed" === r7) return 0; - return dt2(t7._writableStreamController); - })(this); - } - get ready() { - return it2(this) ? this._readyPromise : f6(yt2("ready")); - } - abort(e7) { - return it2(this) ? void 0 === this._ownerWritableStream ? f6(gt2("abort")) : (function(e8, t7) { - return Ke2(e8._ownerWritableStream, t7); - })(this, e7) : f6(yt2("abort")); - } - close() { - if (!it2(this)) return f6(yt2("close")); - const e7 = this._ownerWritableStream; - return void 0 === e7 ? f6(gt2("close")) : ot2(e7) ? f6(new TypeError("Cannot close an already-closing stream")) : Ze2(this._ownerWritableStream); - } - releaseLock() { - if (!it2(this)) throw yt2("releaseLock"); - void 0 !== this._ownerWritableStream && (function(e7) { - const t7 = e7._ownerWritableStream, r7 = new TypeError("Writer was released and can no longer be used to monitor the stream's closedness"); - lt2(e7, r7), (function(e8, t8) { - "pending" === e8._closedPromiseState ? vt2(e8, t8) : (function(e9, t9) { - wt2(e9, t9); - })(e8, t8); - })(e7, r7), t7._writer = void 0, e7._ownerWritableStream = void 0; - })(this); - } - write(e7) { - return it2(this) ? void 0 === this._ownerWritableStream ? f6(gt2("write to")) : (function(e8, t7) { - const r7 = e8._ownerWritableStream, o7 = r7._writableStreamController, n13 = (function(e9, t8) { - try { - return e9._strategySizeAlgorithm(t8); - } catch (t9) { - return bt2(e9, t9), 1; - } - })(o7, t7); - if (r7 !== e8._ownerWritableStream) return f6(gt2("write to")); - const a7 = r7._state; - if ("errored" === a7) return f6(r7._storedError); - if (ot2(r7) || "closed" === a7) return f6(new TypeError("The stream is closing or closed and cannot be written to")); - if ("erroring" === a7) return f6(r7._storedError); - const i7 = (function(e9) { - return c6(((t8, r8) => { - const o8 = { _resolve: t8, _reject: r8 }; - e9._writeRequests.push(o8); - })); - })(r7); - return (function(e9, t8, r8) { - try { - ce2(e9, t8, r8); - } catch (t9) { - return void bt2(e9, t9); - } - const o8 = e9._controlledWritableStream; - if (!ot2(o8) && "writable" === o8._state) { - at2(o8, ht2(e9)); - } - ft2(e9); - })(o7, t7, n13), i7; - })(this, e7) : f6(yt2("write")); + yield [name, value]; } } - function it2(e7) { - return !!o6(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_ownerWritableStream") && e7 instanceof WritableStreamDefaultWriter); + } + var buildHeaders = (newHeaders) => { + const targetHeaders = new Headers(); + const nullHeaders = /* @__PURE__ */ new Set(); + for (const headers of newHeaders) { + const seenHeaders = /* @__PURE__ */ new Set(); + for (const [name, value] of iterateHeaders(headers)) { + const lowerName = name.toLowerCase(); + if (!seenHeaders.has(lowerName)) { + targetHeaders.delete(name); + seenHeaders.add(lowerName); + } + if (value === null) { + targetHeaders.delete(name); + nullHeaders.add(lowerName); + } else { + targetHeaders.append(name, value); + nullHeaders.delete(lowerName); + } + } } - function lt2(e7, t7) { - "pending" === e7._readyPromiseState ? Pt2(e7, t7) : (function(e8, t8) { - qt2(e8, t8); - })(e7, t7); + return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders }; + }; + exports2.buildHeaders = buildHeaders; + var isEmptyHeaders = (headers) => { + for (const _3 of iterateHeaders(headers)) + return false; + return true; + }; + exports2.isEmptyHeaders = isEmptyHeaders; + } +}); + +// node_modules/openai/resources/audio/speech.js +var require_speech = __commonJS({ + "node_modules/openai/resources/audio/speech.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Speech = void 0; + var resource_1 = require_resource(); + var headers_1 = require_headers4(); + var Speech = class extends resource_1.APIResource { + /** + * Generates audio from the input text. + * + * Returns the audio file content, or a stream of audio events. + * + * @example + * ```ts + * const speech = await client.audio.speech.create({ + * input: 'input', + * model: 'tts-1', + * voice: 'alloy', + * }); + * + * const content = await speech.blob(); + * console.log(content); + * ``` + */ + create(body2, options) { + return this._client.post("/audio/speech", { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ Accept: "application/octet-stream" }, options?.headers]), + __security: { bearerAuth: true }, + __binaryResponse: true + }); } - Object.defineProperties(WritableStreamDefaultWriter.prototype, { abort: { enumerable: true }, close: { enumerable: true }, releaseLock: { enumerable: true }, write: { enumerable: true }, closed: { enumerable: true }, desiredSize: { enumerable: true }, ready: { enumerable: true } }), a6(WritableStreamDefaultWriter.prototype.abort, "abort"), a6(WritableStreamDefaultWriter.prototype.close, "close"), a6(WritableStreamDefaultWriter.prototype.releaseLock, "releaseLock"), a6(WritableStreamDefaultWriter.prototype.write, "write"), "symbol" == typeof t6.toStringTag && Object.defineProperty(WritableStreamDefaultWriter.prototype, t6.toStringTag, { value: "WritableStreamDefaultWriter", configurable: true }); - const st2 = {}; - class WritableStreamDefaultController { - constructor() { - throw new TypeError("Illegal constructor"); - } - get abortReason() { - if (!ut2(this)) throw mt2("abortReason"); - return this._abortReason; - } - get signal() { - if (!ut2(this)) throw mt2("signal"); - if (void 0 === this._abortController) throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported"); - return this._abortController.signal; - } - error(e7) { - if (!ut2(this)) throw mt2("error"); - "writable" === this._controlledWritableStream._state && _t3(this, e7); - } - [R2](e7) { - const t7 = this._abortAlgorithm(e7); - return ct2(this), t7; - } - [T2]() { - de2(this); - } + }; + exports2.Speech = Speech; + } +}); + +// node_modules/openai/resources/audio/transcriptions.js +var require_transcriptions = __commonJS({ + "node_modules/openai/resources/audio/transcriptions.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Transcriptions = void 0; + var resource_1 = require_resource(); + var uploads_1 = require_uploads(); + var Transcriptions = class extends resource_1.APIResource { + create(body2, options) { + return this._client.post("/audio/transcriptions", (0, uploads_1.multipartFormRequestOptions)({ + body: body2, + ...options, + stream: body2.stream ?? false, + __metadata: { model: body2.model }, + __security: { bearerAuth: true } + }, this._client)); } - function ut2(e7) { - return !!o6(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_controlledWritableStream") && e7 instanceof WritableStreamDefaultController); + }; + exports2.Transcriptions = Transcriptions; + } +}); + +// node_modules/openai/resources/audio/translations.js +var require_translations = __commonJS({ + "node_modules/openai/resources/audio/translations.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Translations = void 0; + var resource_1 = require_resource(); + var uploads_1 = require_uploads(); + var Translations = class extends resource_1.APIResource { + create(body2, options) { + return this._client.post("/audio/translations", (0, uploads_1.multipartFormRequestOptions)({ body: body2, ...options, __metadata: { model: body2.model }, __security: { bearerAuth: true } }, this._client)); } - function ct2(e7) { - e7._writeAlgorithm = void 0, e7._closeAlgorithm = void 0, e7._abortAlgorithm = void 0, e7._strategySizeAlgorithm = void 0; + }; + exports2.Translations = Translations; + } +}); + +// node_modules/openai/resources/audio/audio.js +var require_audio = __commonJS({ + "node_modules/openai/resources/audio/audio.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Audio = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var SpeechAPI = tslib_1.__importStar(require_speech()); + var speech_1 = require_speech(); + var TranscriptionsAPI = tslib_1.__importStar(require_transcriptions()); + var transcriptions_1 = require_transcriptions(); + var TranslationsAPI = tslib_1.__importStar(require_translations()); + var translations_1 = require_translations(); + var Audio = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.transcriptions = new TranscriptionsAPI.Transcriptions(this._client); + this.translations = new TranslationsAPI.Translations(this._client); + this.speech = new SpeechAPI.Speech(this._client); } - function dt2(e7) { - return e7._strategyHWM - e7._queueTotalSize; + }; + exports2.Audio = Audio; + Audio.Transcriptions = transcriptions_1.Transcriptions; + Audio.Translations = translations_1.Translations; + Audio.Speech = speech_1.Speech; + } +}); + +// node_modules/openai/resources/batches.js +var require_batches = __commonJS({ + "node_modules/openai/resources/batches.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Batches = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Batches = class extends resource_1.APIResource { + /** + * Creates and executes a batch from an uploaded file of requests + */ + create(body2, options) { + return this._client.post("/batches", { body: body2, ...options, __security: { bearerAuth: true } }); } - function ft2(e7) { - const t7 = e7._controlledWritableStream; - if (!e7._started) return; - if (void 0 !== t7._inFlightWriteRequest) return; - if ("erroring" === t7._state) return void rt2(t7); - if (0 === e7._queue.length) return; - const r7 = e7._queue.peek().value; - r7 === st2 ? (function(e8) { - const t8 = e8._controlledWritableStream; - (function(e9) { - e9._inFlightCloseRequest = e9._closeRequest, e9._closeRequest = void 0; - })(t8), ue2(e8); - const r8 = e8._closeAlgorithm(); - ct2(e8), h6(r8, (() => ((function(e9) { - e9._inFlightCloseRequest._resolve(void 0), e9._inFlightCloseRequest = void 0, "erroring" === e9._state && (e9._storedError = void 0, void 0 !== e9._pendingAbortRequest && (e9._pendingAbortRequest._resolve(), e9._pendingAbortRequest = void 0)), e9._state = "closed"; - const t9 = e9._writer; - void 0 !== t9 && Rt2(t9); - })(t8), null)), ((e9) => ((function(e10, t9) { - e10._inFlightCloseRequest._reject(t9), e10._inFlightCloseRequest = void 0, void 0 !== e10._pendingAbortRequest && (e10._pendingAbortRequest._reject(t9), e10._pendingAbortRequest = void 0), et2(e10, t9); - })(t8, e9), null))); - })(e7) : (function(e8, t8) { - const r8 = e8._controlledWritableStream; - !(function(e9) { - e9._inFlightWriteRequest = e9._writeRequests.shift(); - })(r8); - h6(e8._writeAlgorithm(t8), (() => { - !(function(e9) { - e9._inFlightWriteRequest._resolve(void 0), e9._inFlightWriteRequest = void 0; - })(r8); - const t9 = r8._state; - if (ue2(e8), !ot2(r8) && "writable" === t9) { - const t10 = ht2(e8); - at2(r8, t10); - } - return ft2(e8), null; - }), ((t9) => ("writable" === r8._state && ct2(e8), (function(e9, t10) { - e9._inFlightWriteRequest._reject(t10), e9._inFlightWriteRequest = void 0, et2(e9, t10); - })(r8, t9), null))); - })(e7, r7); + /** + * Retrieves a batch. + */ + retrieve(batchID, options) { + return this._client.get((0, path_1.path)`/batches/${batchID}`, { ...options, __security: { bearerAuth: true } }); } - function bt2(e7, t7) { - "writable" === e7._controlledWritableStream._state && _t3(e7, t7); + /** + * List your organization's batches. + */ + list(query = {}, options) { + return this._client.getAPIList("/batches", pagination_1.CursorPage, { + query, + ...options, + __security: { bearerAuth: true } + }); } - function ht2(e7) { - return dt2(e7) <= 0; + /** + * Cancels an in-progress batch. The batch will be in status `cancelling` for up to + * 10 minutes, before changing to `cancelled`, where it will have partial results + * (if any) available in the output file. + */ + cancel(batchID, options) { + return this._client.post((0, path_1.path)`/batches/${batchID}/cancel`, { + ...options, + __security: { bearerAuth: true } + }); } - function _t3(e7, t7) { - const r7 = e7._controlledWritableStream; - ct2(e7), tt2(r7, t7); + }; + exports2.Batches = Batches; + } +}); + +// node_modules/openai/resources/beta/assistants.js +var require_assistants = __commonJS({ + "node_modules/openai/resources/beta/assistants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Assistants = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var headers_1 = require_headers4(); + var path_1 = require_path2(); + var Assistants = class extends resource_1.APIResource { + /** + * Create an assistant with a model and instructions. + * + * @deprecated + */ + create(body2, options) { + return this._client.post("/assistants", { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function pt2(e7) { - return new TypeError(`WritableStream.prototype.${e7} can only be used on a WritableStream`); + /** + * Retrieves an assistant. + * + * @deprecated + */ + retrieve(assistantID, options) { + return this._client.get((0, path_1.path)`/assistants/${assistantID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function mt2(e7) { - return new TypeError(`WritableStreamDefaultController.prototype.${e7} can only be used on a WritableStreamDefaultController`); + /** + * Modifies an assistant. + * + * @deprecated + */ + update(assistantID, body2, options) { + return this._client.post((0, path_1.path)`/assistants/${assistantID}`, { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function yt2(e7) { - return new TypeError(`WritableStreamDefaultWriter.prototype.${e7} can only be used on a WritableStreamDefaultWriter`); + /** + * Returns a list of assistants. + * + * @deprecated + */ + list(query = {}, options) { + return this._client.getAPIList("/assistants", pagination_1.CursorPage, { + query, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function gt2(e7) { - return new TypeError("Cannot " + e7 + " a stream using a released writer"); + /** + * Delete an assistant. + * + * @deprecated + */ + delete(assistantID, options) { + return this._client.delete((0, path_1.path)`/assistants/${assistantID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function St2(e7) { - e7._closedPromise = c6(((t7, r7) => { - e7._closedPromise_resolve = t7, e7._closedPromise_reject = r7, e7._closedPromiseState = "pending"; - })); + }; + exports2.Assistants = Assistants; + } +}); + +// node_modules/openai/resources/beta/realtime/sessions.js +var require_sessions = __commonJS({ + "node_modules/openai/resources/beta/realtime/sessions.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Sessions = void 0; + var resource_1 = require_resource(); + var headers_1 = require_headers4(); + var Sessions = class extends resource_1.APIResource { + /** + * Create an ephemeral API token for use in client-side applications with the + * Realtime API. Can be configured with the same session parameters as the + * `session.update` client event. + * + * It responds with a session object, plus a `client_secret` key which contains a + * usable ephemeral API token that can be used to authenticate browser clients for + * the Realtime API. + * + * @example + * ```ts + * const session = + * await client.beta.realtime.sessions.create(); + * ``` + */ + create(body2, options) { + return this._client.post("/realtime/sessions", { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function wt2(e7, t7) { - St2(e7), vt2(e7, t7); + }; + exports2.Sessions = Sessions; + } +}); + +// node_modules/openai/resources/beta/realtime/transcription-sessions.js +var require_transcription_sessions = __commonJS({ + "node_modules/openai/resources/beta/realtime/transcription-sessions.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.TranscriptionSessions = void 0; + var resource_1 = require_resource(); + var headers_1 = require_headers4(); + var TranscriptionSessions = class extends resource_1.APIResource { + /** + * Create an ephemeral API token for use in client-side applications with the + * Realtime API specifically for realtime transcriptions. Can be configured with + * the same session parameters as the `transcription_session.update` client event. + * + * It responds with a session object, plus a `client_secret` key which contains a + * usable ephemeral API token that can be used to authenticate browser clients for + * the Realtime API. + * + * @example + * ```ts + * const transcriptionSession = + * await client.beta.realtime.transcriptionSessions.create(); + * ``` + */ + create(body2, options) { + return this._client.post("/realtime/transcription_sessions", { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function vt2(e7, t7) { - void 0 !== e7._closedPromise_reject && (y2(e7._closedPromise), e7._closedPromise_reject(t7), e7._closedPromise_resolve = void 0, e7._closedPromise_reject = void 0, e7._closedPromiseState = "rejected"); + }; + exports2.TranscriptionSessions = TranscriptionSessions; + } +}); + +// node_modules/openai/resources/beta/realtime/realtime.js +var require_realtime = __commonJS({ + "node_modules/openai/resources/beta/realtime/realtime.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Realtime = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var SessionsAPI = tslib_1.__importStar(require_sessions()); + var sessions_1 = require_sessions(); + var TranscriptionSessionsAPI = tslib_1.__importStar(require_transcription_sessions()); + var transcription_sessions_1 = require_transcription_sessions(); + var Realtime = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.sessions = new SessionsAPI.Sessions(this._client); + this.transcriptionSessions = new TranscriptionSessionsAPI.TranscriptionSessions(this._client); } - function Rt2(e7) { - void 0 !== e7._closedPromise_resolve && (e7._closedPromise_resolve(void 0), e7._closedPromise_resolve = void 0, e7._closedPromise_reject = void 0, e7._closedPromiseState = "resolved"); + }; + exports2.Realtime = Realtime; + Realtime.Sessions = sessions_1.Sessions; + Realtime.TranscriptionSessions = transcription_sessions_1.TranscriptionSessions; + } +}); + +// node_modules/openai/resources/beta/chatkit/sessions.js +var require_sessions2 = __commonJS({ + "node_modules/openai/resources/beta/chatkit/sessions.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Sessions = void 0; + var resource_1 = require_resource(); + var headers_1 = require_headers4(); + var path_1 = require_path2(); + var Sessions = class extends resource_1.APIResource { + /** + * Create a ChatKit session. + * + * @example + * ```ts + * const chatSession = + * await client.beta.chatkit.sessions.create({ + * user: 'x', + * workflow: { id: 'id' }, + * }); + * ``` + */ + create(body2, options) { + return this._client.post("/chatkit/sessions", { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function Tt2(e7) { - e7._readyPromise = c6(((t7, r7) => { - e7._readyPromise_resolve = t7, e7._readyPromise_reject = r7; - })), e7._readyPromiseState = "pending"; + /** + * Cancel an active ChatKit session and return its most recent metadata. + * + * Cancelling prevents new requests from using the issued client secret. + * + * @example + * ```ts + * const chatSession = + * await client.beta.chatkit.sessions.cancel('cksess_123'); + * ``` + */ + cancel(sessionID, options) { + return this._client.post((0, path_1.path)`/chatkit/sessions/${sessionID}/cancel`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function qt2(e7, t7) { - Tt2(e7), Pt2(e7, t7); + }; + exports2.Sessions = Sessions; + } +}); + +// node_modules/openai/resources/beta/chatkit/threads.js +var require_threads = __commonJS({ + "node_modules/openai/resources/beta/chatkit/threads.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Threads = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var headers_1 = require_headers4(); + var path_1 = require_path2(); + var Threads = class extends resource_1.APIResource { + /** + * Retrieve a ChatKit thread by its identifier. + * + * @example + * ```ts + * const chatkitThread = + * await client.beta.chatkit.threads.retrieve('cthr_123'); + * ``` + */ + retrieve(threadID, options) { + return this._client.get((0, path_1.path)`/chatkit/threads/${threadID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function Ct2(e7) { - Tt2(e7), Et2(e7); + /** + * List ChatKit threads with optional pagination and user filters. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const chatkitThread of client.beta.chatkit.threads.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/chatkit/threads", pagination_1.ConversationCursorPage, { + query, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function Pt2(e7, t7) { - void 0 !== e7._readyPromise_reject && (y2(e7._readyPromise), e7._readyPromise_reject(t7), e7._readyPromise_resolve = void 0, e7._readyPromise_reject = void 0, e7._readyPromiseState = "rejected"); + /** + * Delete a ChatKit thread along with its items and stored attachments. + * + * @example + * ```ts + * const thread = await client.beta.chatkit.threads.delete( + * 'cthr_123', + * ); + * ``` + */ + delete(threadID, options) { + return this._client.delete((0, path_1.path)`/chatkit/threads/${threadID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function Et2(e7) { - void 0 !== e7._readyPromise_resolve && (e7._readyPromise_resolve(void 0), e7._readyPromise_resolve = void 0, e7._readyPromise_reject = void 0, e7._readyPromiseState = "fulfilled"); + /** + * List items that belong to a ChatKit thread. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const thread of client.beta.chatkit.threads.listItems( + * 'cthr_123', + * )) { + * // ... + * } + * ``` + */ + listItems(threadID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/chatkit/threads/${threadID}/items`, pagination_1.ConversationCursorPage, { + query, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]), + __security: { bearerAuth: true } + }); } - Object.defineProperties(WritableStreamDefaultController.prototype, { abortReason: { enumerable: true }, signal: { enumerable: true }, error: { enumerable: true } }), "symbol" == typeof t6.toStringTag && Object.defineProperty(WritableStreamDefaultController.prototype, t6.toStringTag, { value: "WritableStreamDefaultController", configurable: true }); - const Wt2 = "undefined" != typeof DOMException ? DOMException : void 0; - const Ot2 = (function(e7) { - if ("function" != typeof e7 && "object" != typeof e7) return false; - try { - return new e7(), true; - } catch (e8) { - return false; - } - })(Wt2) ? Wt2 : (function() { - const e7 = function(e8, t7) { - this.message = e8 || "", this.name = t7 || "Error", Error.captureStackTrace && Error.captureStackTrace(this, this.constructor); - }; - return e7.prototype = Object.create(Error.prototype), Object.defineProperty(e7.prototype, "constructor", { value: e7, writable: true, configurable: true }), e7; - })(); - function kt2(e7, t7, r7, o7, n13, a7) { - const i7 = e7.getReader(), l7 = t7.getWriter(); - Ut2(e7) && (e7._disturbed = true); - let s7, u7, p7, S2 = false, w6 = false, v9 = "readable", R3 = "writable", T3 = false, q8 = false; - const C4 = c6(((e8) => { - p7 = e8; - })); - let P3 = Promise.resolve(void 0); - return c6(((E3, W3) => { - let O3; - function k8() { - if (S2) return; - const e8 = c6(((e9, t8) => { - !(function r8(o8) { - o8 ? e9() : b6((function() { - if (S2) return d6(true); - return b6(l7.ready, (() => b6(i7.read(), ((e10) => !!e10.done || (P3 = l7.write(e10.value), y2(P3), false))))); - })(), r8, t8); - })(false); - })); - y2(e8); - } - function B4() { - return v9 = "closed", r7 ? L3() : z3((() => (Xe2(t7) && (T3 = ot2(t7), R3 = t7._state), T3 || "closed" === R3 ? d6(void 0) : "erroring" === R3 || "errored" === R3 ? f6(u7) : (T3 = true, l7.close()))), false, void 0), null; - } - function A4(e8) { - return S2 || (v9 = "errored", s7 = e8, o7 ? L3(true, e8) : z3((() => l7.abort(e8)), true, e8)), null; - } - function j8(e8) { - return w6 || (R3 = "errored", u7 = e8, n13 ? L3(true, e8) : z3((() => i7.cancel(e8)), true, e8)), null; - } - if (void 0 !== a7 && (O3 = () => { - const e8 = void 0 !== a7.reason ? a7.reason : new Ot2("Aborted", "AbortError"), t8 = []; - o7 || t8.push((() => "writable" === R3 ? l7.abort(e8) : d6(void 0))), n13 || t8.push((() => "readable" === v9 ? i7.cancel(e8) : d6(void 0))), z3((() => Promise.all(t8.map(((e9) => e9())))), true, e8); - }, a7.aborted ? O3() : a7.addEventListener("abort", O3)), Ut2(e7) && (v9 = e7._state, s7 = e7._storedError), Xe2(t7) && (R3 = t7._state, u7 = t7._storedError, T3 = ot2(t7)), Ut2(e7) && Xe2(t7) && (q8 = true, p7()), "errored" === v9) A4(s7); - else if ("erroring" === R3 || "errored" === R3) j8(u7); - else if ("closed" === v9) B4(); - else if (T3 || "closed" === R3) { - const e8 = new TypeError("the destination writable stream closed before all data could be piped to it"); - n13 ? L3(true, e8) : z3((() => i7.cancel(e8)), true, e8); - } - function z3(e8, t8, r8) { - function o8() { - return "writable" !== R3 || T3 ? n14() : _3((function() { - let e9; - return d6((function t9() { - if (e9 !== P3) return e9 = P3, m6(P3, t9, t9); - })()); - })(), n14), null; - } - function n14() { - return e8 ? h6(e8(), (() => F4(t8, r8)), ((e9) => F4(true, e9))) : F4(t8, r8), null; - } - S2 || (S2 = true, q8 ? o8() : _3(C4, o8)); - } - function L3(e8, t8) { - z3(void 0, e8, t8); - } - function F4(e8, t8) { - return w6 = true, l7.releaseLock(), i7.releaseLock(), void 0 !== a7 && a7.removeEventListener("abort", O3), e8 ? W3(t8) : E3(void 0), null; - } - S2 || (h6(i7.closed, B4, A4), h6(l7.closed, (function() { - return w6 || (R3 = "closed"), null; - }), j8)), q8 ? k8() : g6((() => { - q8 = true, p7(), k8(); - })); - })); + }; + exports2.Threads = Threads; + } +}); + +// node_modules/openai/resources/beta/chatkit/chatkit.js +var require_chatkit = __commonJS({ + "node_modules/openai/resources/beta/chatkit/chatkit.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ChatKit = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var SessionsAPI = tslib_1.__importStar(require_sessions2()); + var sessions_1 = require_sessions2(); + var ThreadsAPI = tslib_1.__importStar(require_threads()); + var threads_1 = require_threads(); + var ChatKit = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.sessions = new SessionsAPI.Sessions(this._client); + this.threads = new ThreadsAPI.Threads(this._client); } - function Bt2(e7, t7) { - return (function(e8) { - try { - return e8.getReader({ mode: "byob" }).releaseLock(), true; - } catch (e9) { - return false; - } - })(e7) ? (function(e8) { - let t8, r7, o7, n13, a7, i7 = e8.getReader(), l7 = false, s7 = false, u7 = false, f7 = false, b7 = false, _4 = false; - const m7 = c6(((e9) => { - a7 = e9; - })); - function y3(e9) { - p6(e9.closed, ((t9) => (e9 !== i7 || (o7.error(t9), n13.error(t9), b7 && _4 || a7(void 0)), null))); - } - function g7() { - l7 && (i7.releaseLock(), i7 = e8.getReader(), y3(i7), l7 = false), h6(i7.read(), ((e9) => { - var t9, r8; - if (u7 = false, f7 = false, e9.done) return b7 || o7.close(), _4 || n13.close(), null === (t9 = o7.byobRequest) || void 0 === t9 || t9.respond(0), null === (r8 = n13.byobRequest) || void 0 === r8 || r8.respond(0), b7 && _4 || a7(void 0), null; - const l8 = e9.value, c7 = l8; - let d7 = l8; - if (!b7 && !_4) try { - d7 = se2(l8); - } catch (e10) { - return o7.error(e10), n13.error(e10), a7(i7.cancel(e10)), null; - } - return b7 || o7.enqueue(c7), _4 || n13.enqueue(d7), s7 = false, u7 ? w6() : f7 && v9(), null; - }), (() => (s7 = false, null))); - } - function S2(t9, r8) { - l7 || (i7.releaseLock(), i7 = e8.getReader({ mode: "byob" }), y3(i7), l7 = true); - const c7 = r8 ? n13 : o7, d7 = r8 ? o7 : n13; - h6(i7.read(t9), ((e9) => { - var t10; - u7 = false, f7 = false; - const o8 = r8 ? _4 : b7, n14 = r8 ? b7 : _4; - if (e9.done) { - o8 || c7.close(), n14 || d7.close(); - const r9 = e9.value; - return void 0 !== r9 && (o8 || c7.byobRequest.respondWithNewView(r9), n14 || null === (t10 = d7.byobRequest) || void 0 === t10 || t10.respond(0)), o8 && n14 || a7(void 0), null; - } - const l8 = e9.value; - if (n14) o8 || c7.byobRequest.respondWithNewView(l8); - else { - let e10; - try { - e10 = se2(l8); - } catch (e11) { - return c7.error(e11), d7.error(e11), a7(i7.cancel(e11)), null; - } - o8 || c7.byobRequest.respondWithNewView(l8), d7.enqueue(e10); - } - return s7 = false, u7 ? w6() : f7 && v9(), null; - }), (() => (s7 = false, null))); - } - function w6() { - if (s7) return u7 = true, d6(void 0); - s7 = true; - const e9 = o7.byobRequest; - return null === e9 ? g7() : S2(e9.view, false), d6(void 0); - } - function v9() { - if (s7) return f7 = true, d6(void 0); - s7 = true; - const e9 = n13.byobRequest; - return null === e9 ? g7() : S2(e9.view, true), d6(void 0); - } - function R3(e9) { - if (b7 = true, t8 = e9, _4) { - const e10 = [t8, r7], o8 = i7.cancel(e10); - a7(o8); - } - return m7; - } - function T3(e9) { - if (_4 = true, r7 = e9, b7) { - const e10 = [t8, r7], o8 = i7.cancel(e10); - a7(o8); - } - return m7; - } - const q8 = new ReadableStream2({ type: "bytes", start(e9) { - o7 = e9; - }, pull: w6, cancel: R3 }), C4 = new ReadableStream2({ type: "bytes", start(e9) { - n13 = e9; - }, pull: v9, cancel: T3 }); - return y3(i7), [q8, C4]; - })(e7) : (function(e8, t8) { - const r7 = e8.getReader(); - let o7, n13, a7, i7, l7, s7 = false, u7 = false, f7 = false, b7 = false; - const _4 = c6(((e9) => { - l7 = e9; - })); - function m7() { - return s7 ? (u7 = true, d6(void 0)) : (s7 = true, h6(r7.read(), ((e9) => { - if (u7 = false, e9.done) return f7 || a7.close(), b7 || i7.close(), f7 && b7 || l7(void 0), null; - const t9 = e9.value, r8 = t9, o8 = t9; - return f7 || a7.enqueue(r8), b7 || i7.enqueue(o8), s7 = false, u7 && m7(), null; - }), (() => (s7 = false, null))), d6(void 0)); - } - function y3(e9) { - if (f7 = true, o7 = e9, b7) { - const e10 = [o7, n13], t9 = r7.cancel(e10); - l7(t9); - } - return _4; - } - function g7(e9) { - if (b7 = true, n13 = e9, f7) { - const e10 = [o7, n13], t9 = r7.cancel(e10); - l7(t9); - } - return _4; - } - const S2 = new ReadableStream2({ start(e9) { - a7 = e9; - }, pull: m7, cancel: y3 }), w6 = new ReadableStream2({ start(e9) { - i7 = e9; - }, pull: m7, cancel: g7 }); - return p6(r7.closed, ((e9) => (a7.error(e9), i7.error(e9), f7 && b7 || l7(void 0), null))), [S2, w6]; - })(e7); + }; + exports2.ChatKit = ChatKit; + ChatKit.Sessions = sessions_1.Sessions; + ChatKit.Threads = threads_1.Threads; + } +}); + +// node_modules/openai/resources/beta/threads/messages.js +var require_messages2 = __commonJS({ + "node_modules/openai/resources/beta/threads/messages.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Messages = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var headers_1 = require_headers4(); + var path_1 = require_path2(); + var Messages2 = class extends resource_1.APIResource { + /** + * Create a message. + * + * @deprecated The Assistants API is deprecated in favor of the Responses API + */ + create(threadID, body2, options) { + return this._client.post((0, path_1.path)`/threads/${threadID}/messages`, { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - class ReadableStreamDefaultController { - constructor() { - throw new TypeError("Illegal constructor"); - } - get desiredSize() { - if (!At2(this)) throw $t("desiredSize"); - return Ft2(this); - } - close() { - if (!At2(this)) throw $t("close"); - if (!Dt2(this)) throw new TypeError("The stream is not in a state that permits close"); - !(function(e7) { - if (!Dt2(e7)) return; - const t7 = e7._controlledReadableStream; - e7._closeRequested = true, 0 === e7._queue.length && (zt2(e7), Jt2(t7)); - })(this); - } - enqueue(e7) { - if (!At2(this)) throw $t("enqueue"); - if (!Dt2(this)) throw new TypeError("The stream is not in a state that permits enqueue"); - return (function(e8, t7) { - if (!Dt2(e8)) return; - const r7 = e8._controlledReadableStream; - if (Gt2(r7) && J2(r7) > 0) X2(r7, t7, false); - else { - let r8; - try { - r8 = e8._strategySizeAlgorithm(t7); - } catch (t8) { - throw Lt2(e8, t8), t8; - } - try { - ce2(e8, t7, r8); - } catch (t8) { - throw Lt2(e8, t8), t8; - } - } - jt2(e8); - })(this, e7); - } - error(e7) { - if (!At2(this)) throw $t("error"); - Lt2(this, e7); - } - [q7](e7) { - de2(this); - const t7 = this._cancelAlgorithm(e7); - return zt2(this), t7; - } - [C3](e7) { - const t7 = this._controlledReadableStream; - if (this._queue.length > 0) { - const r7 = ue2(this); - this._closeRequested && 0 === this._queue.length ? (zt2(this), Jt2(t7)) : jt2(this), e7._chunkSteps(r7); - } else G3(t7, e7), jt2(this); - } - [P2]() { - } + /** + * Retrieve a message. + * + * @deprecated The Assistants API is deprecated in favor of the Responses API + */ + retrieve(messageID, params, options) { + const { thread_id } = params; + return this._client.get((0, path_1.path)`/threads/${thread_id}/messages/${messageID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function At2(e7) { - return !!o6(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_controlledReadableStream") && e7 instanceof ReadableStreamDefaultController); + /** + * Modifies a message. + * + * @deprecated The Assistants API is deprecated in favor of the Responses API + */ + update(messageID, params, options) { + const { thread_id, ...body2 } = params; + return this._client.post((0, path_1.path)`/threads/${thread_id}/messages/${messageID}`, { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function jt2(e7) { - const t7 = (function(e8) { - const t8 = e8._controlledReadableStream; - if (!Dt2(e8)) return false; - if (!e8._started) return false; - if (Gt2(t8) && J2(t8) > 0) return true; - if (Ft2(e8) > 0) return true; - return false; - })(e7); - if (!t7) return; - if (e7._pulling) return void (e7._pullAgain = true); - e7._pulling = true; - h6(e7._pullAlgorithm(), (() => (e7._pulling = false, e7._pullAgain && (e7._pullAgain = false, jt2(e7)), null)), ((t8) => (Lt2(e7, t8), null))); + /** + * Returns a list of messages for a given thread. + * + * @deprecated The Assistants API is deprecated in favor of the Responses API + */ + list(threadID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/threads/${threadID}/messages`, pagination_1.CursorPage, { + query, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function zt2(e7) { - e7._pullAlgorithm = void 0, e7._cancelAlgorithm = void 0, e7._strategySizeAlgorithm = void 0; + /** + * Deletes a message. + * + * @deprecated The Assistants API is deprecated in favor of the Responses API + */ + delete(messageID, params, options) { + const { thread_id } = params; + return this._client.delete((0, path_1.path)`/threads/${thread_id}/messages/${messageID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function Lt2(e7, t7) { - const r7 = e7._controlledReadableStream; - "readable" === r7._state && (de2(e7), zt2(e7), Kt2(r7, t7)); + }; + exports2.Messages = Messages2; + } +}); + +// node_modules/openai/resources/beta/threads/runs/steps.js +var require_steps = __commonJS({ + "node_modules/openai/resources/beta/threads/runs/steps.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Steps = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var headers_1 = require_headers4(); + var path_1 = require_path2(); + var Steps = class extends resource_1.APIResource { + /** + * Retrieves a run step. + * + * @deprecated The Assistants API is deprecated in favor of the Responses API + */ + retrieve(stepID, params, options) { + const { thread_id, run_id, ...query } = params; + return this._client.get((0, path_1.path)`/threads/${thread_id}/runs/${run_id}/steps/${stepID}`, { + query, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function Ft2(e7) { - const t7 = e7._controlledReadableStream._state; - return "errored" === t7 ? null : "closed" === t7 ? 0 : e7._strategyHWM - e7._queueTotalSize; + /** + * Returns a list of run steps belonging to a run. + * + * @deprecated The Assistants API is deprecated in favor of the Responses API + */ + list(runID, params, options) { + const { thread_id, ...query } = params; + return this._client.getAPIList((0, path_1.path)`/threads/${thread_id}/runs/${runID}/steps`, pagination_1.CursorPage, { + query, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - function Dt2(e7) { - return !e7._closeRequested && "readable" === e7._controlledReadableStream._state; + }; + exports2.Steps = Steps; + } +}); + +// node_modules/openai/internal/utils/base64.js +var require_base642 = __commonJS({ + "node_modules/openai/internal/utils/base64.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.toFloat32Array = exports2.fromBase64 = exports2.toBase64 = void 0; + var error_1 = require_error2(); + var bytes_1 = require_bytes(); + var toBase643 = (data) => { + if (!data) + return ""; + if (typeof globalThis.Buffer !== "undefined") { + return globalThis.Buffer.from(data).toString("base64"); } - function It2(e7, t7, r7, o7) { - const n13 = Object.create(ReadableStreamDefaultController.prototype); - let a7, i7, l7; - a7 = void 0 !== t7.start ? () => t7.start(n13) : () => { - }, i7 = void 0 !== t7.pull ? () => t7.pull(n13) : () => d6(void 0), l7 = void 0 !== t7.cancel ? (e8) => t7.cancel(e8) : () => d6(void 0), (function(e8, t8, r8, o8, n14, a8, i8) { - t8._controlledReadableStream = e8, t8._queue = void 0, t8._queueTotalSize = void 0, de2(t8), t8._started = false, t8._closeRequested = false, t8._pullAgain = false, t8._pulling = false, t8._strategySizeAlgorithm = i8, t8._strategyHWM = a8, t8._pullAlgorithm = o8, t8._cancelAlgorithm = n14, e8._readableStreamController = t8, h6(d6(r8()), (() => (t8._started = true, jt2(t8), null)), ((e9) => (Lt2(t8, e9), null))); - })(e7, n13, a7, i7, l7, r7, o7); + if (typeof data === "string") { + data = (0, bytes_1.encodeUTF8)(data); } - function $t(e7) { - return new TypeError(`ReadableStreamDefaultController.prototype.${e7} can only be used on a ReadableStreamDefaultController`); + if (typeof btoa !== "undefined") { + return btoa(String.fromCharCode.apply(null, data)); } - function Mt2(e7, t7, r7) { - return I3(e7, r7), (r8) => w5(e7, t7, [r8]); + throw new error_1.OpenAIError("Cannot generate base64 string; Expected `Buffer` or `btoa` to be defined"); + }; + exports2.toBase64 = toBase643; + var fromBase643 = (str) => { + if (typeof globalThis.Buffer !== "undefined") { + const buf = globalThis.Buffer.from(str, "base64"); + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); } - function Yt2(e7, t7, r7) { - return I3(e7, r7), (r8) => w5(e7, t7, [r8]); + if (typeof atob !== "undefined") { + const bstr = atob(str); + const buf = new Uint8Array(bstr.length); + for (let i6 = 0; i6 < bstr.length; i6++) { + buf[i6] = bstr.charCodeAt(i6); + } + return buf; } - function Qt2(e7, t7, r7) { - return I3(e7, r7), (r8) => S(e7, t7, [r8]); + throw new error_1.OpenAIError("Cannot decode base64 string; Expected `Buffer` or `atob` to be defined"); + }; + exports2.fromBase64 = fromBase643; + var toFloat32Array = (base64Str) => { + if (typeof Buffer !== "undefined") { + const buf = Buffer.from(base64Str, "base64"); + return Array.from(new Float32Array(buf.buffer, buf.byteOffset, buf.length / Float32Array.BYTES_PER_ELEMENT)); + } else { + const binaryStr = atob(base64Str); + const len = binaryStr.length; + const bytes = new Uint8Array(len); + for (let i6 = 0; i6 < len; i6++) { + bytes[i6] = binaryStr.charCodeAt(i6); + } + return Array.from(new Float32Array(bytes.buffer)); } - function Nt2(e7, t7) { - if ("bytes" !== (e7 = `${e7}`)) throw new TypeError(`${t7} '${e7}' is not a valid enumeration value for ReadableStreamType`); - return e7; + }; + exports2.toFloat32Array = toFloat32Array; + } +}); + +// node_modules/openai/internal/utils/env.js +var require_env = __commonJS({ + "node_modules/openai/internal/utils/env.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.readEnv = void 0; + var readEnv = (env3) => { + if (typeof globalThis.process !== "undefined") { + return globalThis.process.env?.[env3]?.trim() || void 0; } - function xt2(e7, t7) { - if ("byob" !== (e7 = `${e7}`)) throw new TypeError(`${t7} '${e7}' is not a valid enumeration value for ReadableStreamReaderMode`); - return e7; + if (typeof globalThis.Deno !== "undefined") { + return globalThis.Deno.env?.get?.(env3)?.trim() || void 0; } - function Ht2(e7, t7) { - D3(e7, t7); - const r7 = null == e7 ? void 0 : e7.preventAbort, o7 = null == e7 ? void 0 : e7.preventCancel, n13 = null == e7 ? void 0 : e7.preventClose, a7 = null == e7 ? void 0 : e7.signal; - return void 0 !== a7 && (function(e8, t8) { - if (!(function(e9) { - if ("object" != typeof e9 || null === e9) return false; - try { - return "boolean" == typeof e9.aborted; - } catch (e10) { - return false; - } - })(e8)) throw new TypeError(`${t8} is not an AbortSignal.`); - })(a7, `${t7} has member 'signal' that`), { preventAbort: Boolean(r7), preventCancel: Boolean(o7), preventClose: Boolean(n13), signal: a7 }; + return void 0; + }; + exports2.readEnv = readEnv; + } +}); + +// node_modules/openai/internal/utils.js +var require_utils11 = __commonJS({ + "node_modules/openai/internal/utils.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var tslib_1 = require_tslib(); + tslib_1.__exportStar(require_values(), exports2); + tslib_1.__exportStar(require_base642(), exports2); + tslib_1.__exportStar(require_env(), exports2); + tslib_1.__exportStar(require_log2(), exports2); + tslib_1.__exportStar(require_uuid(), exports2); + tslib_1.__exportStar(require_sleep(), exports2); + tslib_1.__exportStar(require_query(), exports2); + } +}); + +// node_modules/openai/lib/AssistantStream.js +var require_AssistantStream = __commonJS({ + "node_modules/openai/lib/AssistantStream.js"(exports2) { + "use strict"; + var _AssistantStream_instances; + var _a6; + var _AssistantStream_events; + var _AssistantStream_runStepSnapshots; + var _AssistantStream_messageSnapshots; + var _AssistantStream_messageSnapshot; + var _AssistantStream_finalRun; + var _AssistantStream_currentContentIndex; + var _AssistantStream_currentContent; + var _AssistantStream_currentToolCallIndex; + var _AssistantStream_currentToolCall; + var _AssistantStream_currentEvent; + var _AssistantStream_currentRunSnapshot; + var _AssistantStream_currentRunStepSnapshot; + var _AssistantStream_addEvent; + var _AssistantStream_endRequest; + var _AssistantStream_handleMessage; + var _AssistantStream_handleRunStep; + var _AssistantStream_handleEvent; + var _AssistantStream_accumulateRunStep; + var _AssistantStream_accumulateMessage; + var _AssistantStream_accumulateContent; + var _AssistantStream_handleRun; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AssistantStream = void 0; + var tslib_1 = require_tslib(); + var streaming_1 = require_streaming2(); + var error_1 = require_error3(); + var EventStream_1 = require_EventStream(); + var utils_1 = require_utils11(); + var AssistantStream = class extends EventStream_1.EventStream { + constructor() { + super(...arguments); + _AssistantStream_instances.add(this); + _AssistantStream_events.set(this, []); + _AssistantStream_runStepSnapshots.set(this, {}); + _AssistantStream_messageSnapshots.set(this, {}); + _AssistantStream_messageSnapshot.set(this, void 0); + _AssistantStream_finalRun.set(this, void 0); + _AssistantStream_currentContentIndex.set(this, void 0); + _AssistantStream_currentContent.set(this, void 0); + _AssistantStream_currentToolCallIndex.set(this, void 0); + _AssistantStream_currentToolCall.set(this, void 0); + _AssistantStream_currentEvent.set(this, void 0); + _AssistantStream_currentRunSnapshot.set(this, void 0); + _AssistantStream_currentRunStepSnapshot.set(this, void 0); } - function Vt2(e7, t7) { - D3(e7, t7); - const r7 = null == e7 ? void 0 : e7.readable; - Y2(r7, "readable", "ReadableWritablePair"), (function(e8, t8) { - if (!H3(e8)) throw new TypeError(`${t8} is not a ReadableStream.`); - })(r7, `${t7} has member 'readable' that`); - const o7 = null == e7 ? void 0 : e7.writable; - return Y2(o7, "writable", "ReadableWritablePair"), (function(e8, t8) { - if (!V2(e8)) throw new TypeError(`${t8} is not a WritableStream.`); - })(o7, `${t7} has member 'writable' that`), { readable: r7, writable: o7 }; - } - Object.defineProperties(ReadableStreamDefaultController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, desiredSize: { enumerable: true } }), a6(ReadableStreamDefaultController.prototype.close, "close"), a6(ReadableStreamDefaultController.prototype.enqueue, "enqueue"), a6(ReadableStreamDefaultController.prototype.error, "error"), "symbol" == typeof t6.toStringTag && Object.defineProperty(ReadableStreamDefaultController.prototype, t6.toStringTag, { value: "ReadableStreamDefaultController", configurable: true }); - class ReadableStream2 { - constructor(e7 = {}, t7 = {}) { - void 0 === e7 ? e7 = null : $(e7, "First parameter"); - const r7 = Qe2(t7, "Second parameter"), o7 = (function(e8, t8) { - D3(e8, t8); - const r8 = e8, o8 = null == r8 ? void 0 : r8.autoAllocateChunkSize, n14 = null == r8 ? void 0 : r8.cancel, a7 = null == r8 ? void 0 : r8.pull, i7 = null == r8 ? void 0 : r8.start, l7 = null == r8 ? void 0 : r8.type; - return { autoAllocateChunkSize: void 0 === o8 ? void 0 : x6(o8, `${t8} has member 'autoAllocateChunkSize' that`), cancel: void 0 === n14 ? void 0 : Mt2(n14, r8, `${t8} has member 'cancel' that`), pull: void 0 === a7 ? void 0 : Yt2(a7, r8, `${t8} has member 'pull' that`), start: void 0 === i7 ? void 0 : Qt2(i7, r8, `${t8} has member 'start' that`), type: void 0 === l7 ? void 0 : Nt2(l7, `${t8} has member 'type' that`) }; - })(e7, "First parameter"); - var n13; - if ((n13 = this)._state = "readable", n13._reader = void 0, n13._storedError = void 0, n13._disturbed = false, "bytes" === o7.type) { - if (void 0 !== r7.size) throw new RangeError("The strategy for a byte stream cannot have a size function"); - Be2(this, o7, Me2(r7, 0)); + [(_AssistantStream_events = /* @__PURE__ */ new WeakMap(), _AssistantStream_runStepSnapshots = /* @__PURE__ */ new WeakMap(), _AssistantStream_messageSnapshots = /* @__PURE__ */ new WeakMap(), _AssistantStream_messageSnapshot = /* @__PURE__ */ new WeakMap(), _AssistantStream_finalRun = /* @__PURE__ */ new WeakMap(), _AssistantStream_currentContentIndex = /* @__PURE__ */ new WeakMap(), _AssistantStream_currentContent = /* @__PURE__ */ new WeakMap(), _AssistantStream_currentToolCallIndex = /* @__PURE__ */ new WeakMap(), _AssistantStream_currentToolCall = /* @__PURE__ */ new WeakMap(), _AssistantStream_currentEvent = /* @__PURE__ */ new WeakMap(), _AssistantStream_currentRunSnapshot = /* @__PURE__ */ new WeakMap(), _AssistantStream_currentRunStepSnapshot = /* @__PURE__ */ new WeakMap(), _AssistantStream_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { + const pushQueue = []; + const readQueue = []; + let done = false; + this.on("event", (event) => { + const reader = readQueue.shift(); + if (reader) { + reader.resolve(event); } else { - const e8 = Ye2(r7); - It2(this, o7, Me2(r7, 1), e8); + pushQueue.push(event); } + }); + this.on("end", () => { + done = true; + for (const reader of readQueue) { + reader.resolve(void 0); + } + readQueue.length = 0; + }); + this.on("abort", (err) => { + done = true; + for (const reader of readQueue) { + reader.reject(err); + } + readQueue.length = 0; + }); + this.on("error", (err) => { + done = true; + for (const reader of readQueue) { + reader.reject(err); + } + readQueue.length = 0; + }); + return { + next: async () => { + if (!pushQueue.length) { + if (done) { + return { value: void 0, done: true }; + } + return new Promise((resolve8, reject2) => readQueue.push({ resolve: resolve8, reject: reject2 })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true }); + } + const chunk = pushQueue.shift(); + return { value: chunk, done: false }; + }, + return: async () => { + this.abort(); + return { value: void 0, done: true }; + } + }; + } + static fromReadableStream(stream5) { + const runner = new _a6(); + runner._run(() => runner._fromReadableStream(stream5)); + return runner; + } + async _fromReadableStream(readableStream, options) { + const signal = options?.signal; + if (signal) { + if (signal.aborted) + this.controller.abort(); + signal.addEventListener("abort", () => this.controller.abort()); } - get locked() { - if (!Ut2(this)) throw Zt2("locked"); - return Gt2(this); - } - cancel(e7) { - return Ut2(this) ? Gt2(this) ? f6(new TypeError("Cannot cancel a stream that already has a reader")) : Xt2(this, e7) : f6(Zt2("cancel")); - } - getReader(e7) { - if (!Ut2(this)) throw Zt2("getReader"); - return void 0 === (function(e8, t7) { - D3(e8, t7); - const r7 = null == e8 ? void 0 : e8.mode; - return { mode: void 0 === r7 ? void 0 : xt2(r7, `${t7} has member 'mode' that`) }; - })(e7, "First parameter").mode ? new ReadableStreamDefaultReader(this) : (function(e8) { - return new ReadableStreamBYOBReader(e8); - })(this); + this._connected(); + const stream5 = streaming_1.Stream.fromReadableStream(readableStream, this.controller); + for await (const event of stream5) { + tslib_1.__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); } - pipeThrough(e7, t7 = {}) { - if (!H3(this)) throw Zt2("pipeThrough"); - M2(e7, 1, "pipeThrough"); - const r7 = Vt2(e7, "First parameter"), o7 = Ht2(t7, "Second parameter"); - if (this.locked) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream"); - if (r7.writable.locked) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream"); - return y2(kt2(this, r7.writable, o7.preventClose, o7.preventAbort, o7.preventCancel, o7.signal)), r7.readable; + if (stream5.controller.signal?.aborted) { + throw new error_1.APIUserAbortError(); } - pipeTo(e7, t7 = {}) { - if (!H3(this)) return f6(Zt2("pipeTo")); - if (void 0 === e7) return f6("Parameter 1 is required in 'pipeTo'."); - if (!V2(e7)) return f6(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream")); - let r7; - try { - r7 = Ht2(t7, "Second parameter"); - } catch (e8) { - return f6(e8); - } - return this.locked ? f6(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")) : e7.locked ? f6(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")) : kt2(this, e7, r7.preventClose, r7.preventAbort, r7.preventCancel, r7.signal); + return this._addRun(tslib_1.__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); + } + toReadableStream() { + const stream5 = new streaming_1.Stream(this[Symbol.asyncIterator].bind(this), this.controller); + return stream5.toReadableStream(); + } + static createToolAssistantStream(runId, runs, params, options) { + const runner = new _a6(); + runner._run(() => runner._runToolAssistantStream(runId, runs, params, { + ...options, + headers: { ...options?.headers, "X-Stainless-Helper-Method": "stream" } + })); + return runner; + } + async _createToolAssistantStream(run2, runId, params, options) { + const signal = options?.signal; + if (signal) { + if (signal.aborted) + this.controller.abort(); + signal.addEventListener("abort", () => this.controller.abort()); } - tee() { - if (!H3(this)) throw Zt2("tee"); - if (this.locked) throw new TypeError("Cannot tee a stream that already has a reader"); - return Bt2(this); + const body2 = { ...params, stream: true }; + const stream5 = await run2.submitToolOutputs(runId, body2, { + ...options, + signal: this.controller.signal + }); + this._connected(); + for await (const event of stream5) { + tslib_1.__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); } - values(e7) { - if (!H3(this)) throw Zt2("values"); - return (function(e8, t7) { - const r7 = e8.getReader(), o7 = new re2(r7, t7), n13 = Object.create(oe2); - return n13._asyncIteratorImpl = o7, n13; - })(this, (function(e8, t7) { - D3(e8, t7); - const r7 = null == e8 ? void 0 : e8.preventCancel; - return { preventCancel: Boolean(r7) }; - })(e7, "First parameter").preventCancel); + if (stream5.controller.signal?.aborted) { + throw new error_1.APIUserAbortError(); } + return this._addRun(tslib_1.__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); } - function Ut2(e7) { - return !!o6(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_readableStreamController") && e7 instanceof ReadableStream2); + static createThreadAssistantStream(params, thread, options) { + const runner = new _a6(); + runner._run(() => runner._threadAssistantStream(params, thread, { + ...options, + headers: { ...options?.headers, "X-Stainless-Helper-Method": "stream" } + })); + return runner; } - function Gt2(e7) { - return void 0 !== e7._reader; + static createAssistantStream(threadId, runs, params, options) { + const runner = new _a6(); + runner._run(() => runner._runAssistantStream(threadId, runs, params, { + ...options, + headers: { ...options?.headers, "X-Stainless-Helper-Method": "stream" } + })); + return runner; } - function Xt2(e7, t7) { - if (e7._disturbed = true, "closed" === e7._state) return d6(void 0); - if ("errored" === e7._state) return f6(e7._storedError); - Jt2(e7); - const o7 = e7._reader; - if (void 0 !== o7 && De2(o7)) { - const e8 = o7._readIntoRequests; - o7._readIntoRequests = new v8(), e8.forEach(((e9) => { - e9._closeSteps(void 0); - })); - } - return m6(e7._readableStreamController[q7](t7), r6); + currentEvent() { + return tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentEvent, "f"); } - function Jt2(e7) { - e7._state = "closed"; - const t7 = e7._reader; - if (void 0 !== t7 && (z2(t7), Z(t7))) { - const e8 = t7._readRequests; - t7._readRequests = new v8(), e8.forEach(((e9) => { - e9._closeSteps(); - })); - } + currentRun() { + return tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentRunSnapshot, "f"); } - function Kt2(e7, t7) { - e7._state = "errored", e7._storedError = t7; - const r7 = e7._reader; - void 0 !== r7 && (j7(r7, t7), Z(r7) ? ee2(r7, t7) : Ie2(r7, t7)); + currentMessageSnapshot() { + return tslib_1.__classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f"); } - function Zt2(e7) { - return new TypeError(`ReadableStream.prototype.${e7} can only be used on a ReadableStream`); + currentRunStepSnapshot() { + return tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentRunStepSnapshot, "f"); } - function er(e7, t7) { - D3(e7, t7); - const r7 = null == e7 ? void 0 : e7.highWaterMark; - return Y2(r7, "highWaterMark", "QueuingStrategyInit"), { highWaterMark: Q2(r7) }; + async finalRunSteps() { + await this.done(); + return Object.values(tslib_1.__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")); } - Object.defineProperties(ReadableStream2.prototype, { cancel: { enumerable: true }, getReader: { enumerable: true }, pipeThrough: { enumerable: true }, pipeTo: { enumerable: true }, tee: { enumerable: true }, values: { enumerable: true }, locked: { enumerable: true } }), a6(ReadableStream2.prototype.cancel, "cancel"), a6(ReadableStream2.prototype.getReader, "getReader"), a6(ReadableStream2.prototype.pipeThrough, "pipeThrough"), a6(ReadableStream2.prototype.pipeTo, "pipeTo"), a6(ReadableStream2.prototype.tee, "tee"), a6(ReadableStream2.prototype.values, "values"), "symbol" == typeof t6.toStringTag && Object.defineProperty(ReadableStream2.prototype, t6.toStringTag, { value: "ReadableStream", configurable: true }), "symbol" == typeof t6.asyncIterator && Object.defineProperty(ReadableStream2.prototype, t6.asyncIterator, { value: ReadableStream2.prototype.values, writable: true, configurable: true }); - const tr = (e7) => e7.byteLength; - a6(tr, "size"); - class ByteLengthQueuingStrategy { - constructor(e7) { - M2(e7, 1, "ByteLengthQueuingStrategy"), e7 = er(e7, "First parameter"), this._byteLengthQueuingStrategyHighWaterMark = e7.highWaterMark; - } - get highWaterMark() { - if (!or(this)) throw rr("highWaterMark"); - return this._byteLengthQueuingStrategyHighWaterMark; - } - get size() { - if (!or(this)) throw rr("size"); - return tr; - } - } - function rr(e7) { - return new TypeError(`ByteLengthQueuingStrategy.prototype.${e7} can only be used on a ByteLengthQueuingStrategy`); - } - function or(e7) { - return !!o6(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_byteLengthQueuingStrategyHighWaterMark") && e7 instanceof ByteLengthQueuingStrategy); - } - Object.defineProperties(ByteLengthQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), "symbol" == typeof t6.toStringTag && Object.defineProperty(ByteLengthQueuingStrategy.prototype, t6.toStringTag, { value: "ByteLengthQueuingStrategy", configurable: true }); - const nr = () => 1; - a6(nr, "size"); - class CountQueuingStrategy { - constructor(e7) { - M2(e7, 1, "CountQueuingStrategy"), e7 = er(e7, "First parameter"), this._countQueuingStrategyHighWaterMark = e7.highWaterMark; - } - get highWaterMark() { - if (!ir(this)) throw ar("highWaterMark"); - return this._countQueuingStrategyHighWaterMark; - } - get size() { - if (!ir(this)) throw ar("size"); - return nr; - } - } - function ar(e7) { - return new TypeError(`CountQueuingStrategy.prototype.${e7} can only be used on a CountQueuingStrategy`); - } - function ir(e7) { - return !!o6(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_countQueuingStrategyHighWaterMark") && e7 instanceof CountQueuingStrategy); - } - function lr(e7, t7, r7) { - return I3(e7, r7), (r8) => w5(e7, t7, [r8]); - } - function sr(e7, t7, r7) { - return I3(e7, r7), (r8) => S(e7, t7, [r8]); + async finalMessages() { + await this.done(); + return Object.values(tslib_1.__classPrivateFieldGet(this, _AssistantStream_messageSnapshots, "f")); } - function ur(e7, t7, r7) { - return I3(e7, r7), (r8, o7) => w5(e7, t7, [r8, o7]); + async finalRun() { + await this.done(); + if (!tslib_1.__classPrivateFieldGet(this, _AssistantStream_finalRun, "f")) + throw Error("Final run was not received."); + return tslib_1.__classPrivateFieldGet(this, _AssistantStream_finalRun, "f"); } - Object.defineProperties(CountQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), "symbol" == typeof t6.toStringTag && Object.defineProperty(CountQueuingStrategy.prototype, t6.toStringTag, { value: "CountQueuingStrategy", configurable: true }); - class TransformStream2 { - constructor(e7 = {}, t7 = {}, r7 = {}) { - void 0 === e7 && (e7 = null); - const o7 = Qe2(t7, "Second parameter"), n13 = Qe2(r7, "Third parameter"), a7 = (function(e8, t8) { - D3(e8, t8); - const r8 = null == e8 ? void 0 : e8.flush, o8 = null == e8 ? void 0 : e8.readableType, n14 = null == e8 ? void 0 : e8.start, a8 = null == e8 ? void 0 : e8.transform, i8 = null == e8 ? void 0 : e8.writableType; - return { flush: void 0 === r8 ? void 0 : lr(r8, e8, `${t8} has member 'flush' that`), readableType: o8, start: void 0 === n14 ? void 0 : sr(n14, e8, `${t8} has member 'start' that`), transform: void 0 === a8 ? void 0 : ur(a8, e8, `${t8} has member 'transform' that`), writableType: i8 }; - })(e7, "First parameter"); - if (void 0 !== a7.readableType) throw new RangeError("Invalid readableType specified"); - if (void 0 !== a7.writableType) throw new RangeError("Invalid writableType specified"); - const i7 = Me2(n13, 0), l7 = Ye2(n13), s7 = Me2(o7, 1), u7 = Ye2(o7); - let b7; - !(function(e8, t8, r8, o8, n14, a8) { - function i8() { - return t8; - } - function l8(t9) { - return (function(e9, t10) { - const r9 = e9._transformStreamController; - if (e9._backpressure) { - return m6(e9._backpressureChangePromise, (() => { - if ("erroring" === (Xe2(e9._writable) ? e9._writable._state : e9._writableState)) throw Xe2(e9._writable) ? e9._writable._storedError : e9._writableStoredError; - return mr(r9, t10); - })); - } - return mr(r9, t10); - })(e8, t9); - } - function s8(t9) { - return (function(e9, t10) { - return dr(e9, t10), d6(void 0); - })(e8, t9); - } - function u8() { - return (function(e9) { - const t9 = e9._transformStreamController, r9 = t9._flushAlgorithm(); - return _r3(t9), m6(r9, (() => { - if ("errored" === e9._readableState) throw e9._readableStoredError; - Sr(e9) && wr(e9); - }), ((t10) => { - throw dr(e9, t10), e9._readableStoredError; - })); - })(e8); - } - function c7() { - return (function(e9) { - return br(e9, false), e9._backpressureChangePromise; - })(e8); - } - function f7(t9) { - return fr(e8, t9), d6(void 0); - } - e8._writableState = "writable", e8._writableStoredError = void 0, e8._writableHasInFlightOperation = false, e8._writableStarted = false, e8._writable = (function(e9, t9, r9, o9, n15, a9, i9) { - return new WritableStream({ start(r10) { - e9._writableController = r10; - try { - const t10 = r10.signal; - void 0 !== t10 && t10.addEventListener("abort", (() => { - "writable" === e9._writableState && (e9._writableState = "erroring", t10.reason && (e9._writableStoredError = t10.reason)); - })); - } catch (e10) { - } - return m6(t9(), (() => (e9._writableStarted = true, Pr(e9), null)), ((t10) => { - throw e9._writableStarted = true, Tr(e9, t10), t10; - })); - }, write: (t10) => ((function(e10) { - e10._writableHasInFlightOperation = true; - })(e9), m6(r9(t10), (() => ((function(e10) { - e10._writableHasInFlightOperation = false; - })(e9), Pr(e9), null)), ((t11) => { - throw (function(e10, t12) { - e10._writableHasInFlightOperation = false, Tr(e10, t12); - })(e9, t11), t11; - }))), close: () => ((function(e10) { - e10._writableHasInFlightOperation = true; - })(e9), m6(o9(), (() => ((function(e10) { - e10._writableHasInFlightOperation = false; - "erroring" === e10._writableState && (e10._writableStoredError = void 0); - e10._writableState = "closed"; - })(e9), null)), ((t10) => { - throw (function(e10, t11) { - e10._writableHasInFlightOperation = false, e10._writableState, Tr(e10, t11); - })(e9, t10), t10; - }))), abort: (t10) => (e9._writableState = "errored", e9._writableStoredError = t10, n15(t10)) }, { highWaterMark: a9, size: i9 }); - })(e8, i8, l8, u8, s8, r8, o8), e8._readableState = "readable", e8._readableStoredError = void 0, e8._readableCloseRequested = false, e8._readablePulling = false, e8._readable = (function(e9, t9, r9, o9, n15, a9) { - return new ReadableStream2({ start: (r10) => (e9._readableController = r10, t9().catch(((t10) => { - vr(e9, t10); - }))), pull: () => (e9._readablePulling = true, r9().catch(((t10) => { - vr(e9, t10); - }))), cancel: (t10) => (e9._readableState = "closed", o9(t10)) }, { highWaterMark: n15, size: a9 }); - })(e8, i8, c7, f7, n14, a8), e8._backpressure = void 0, e8._backpressureChangePromise = void 0, e8._backpressureChangePromise_resolve = void 0, br(e8, true), e8._transformStreamController = void 0; - })(this, c6(((e8) => { - b7 = e8; - })), s7, u7, i7, l7), (function(e8, t8) { - const r8 = Object.create(TransformStreamDefaultController.prototype); - let o8, n14; - o8 = void 0 !== t8.transform ? (e9) => t8.transform(e9, r8) : (e9) => { - try { - return pr(r8, e9), d6(void 0); - } catch (e10) { - return f6(e10); - } - }; - n14 = void 0 !== t8.flush ? () => t8.flush(r8) : () => d6(void 0); - !(function(e9, t9, r9, o9) { - t9._controlledTransformStream = e9, e9._transformStreamController = t9, t9._transformAlgorithm = r9, t9._flushAlgorithm = o9; - })(e8, r8, o8, n14); - })(this, a7), void 0 !== a7.start ? b7(a7.start(this._transformStreamController)) : b7(void 0); + async _createThreadAssistantStream(thread, params, options) { + const signal = options?.signal; + if (signal) { + if (signal.aborted) + this.controller.abort(); + signal.addEventListener("abort", () => this.controller.abort()); } - get readable() { - if (!cr(this)) throw gr("readable"); - return this._readable; + const body2 = { ...params, stream: true }; + const stream5 = await thread.createAndRun(body2, { ...options, signal: this.controller.signal }); + this._connected(); + for await (const event of stream5) { + tslib_1.__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); } - get writable() { - if (!cr(this)) throw gr("writable"); - return this._writable; + if (stream5.controller.signal?.aborted) { + throw new error_1.APIUserAbortError(); } + return this._addRun(tslib_1.__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); } - function cr(e7) { - return !!o6(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_transformStreamController") && e7 instanceof TransformStream2); - } - function dr(e7, t7) { - vr(e7, t7), fr(e7, t7); - } - function fr(e7, t7) { - _r3(e7._transformStreamController), (function(e8, t8) { - e8._writableController.error(t8); - "writable" === e8._writableState && qr(e8, t8); - })(e7, t7), e7._backpressure && br(e7, false); - } - function br(e7, t7) { - void 0 !== e7._backpressureChangePromise && e7._backpressureChangePromise_resolve(), e7._backpressureChangePromise = c6(((t8) => { - e7._backpressureChangePromise_resolve = t8; - })), e7._backpressure = t7; - } - Object.defineProperties(TransformStream2.prototype, { readable: { enumerable: true }, writable: { enumerable: true } }), "symbol" == typeof t6.toStringTag && Object.defineProperty(TransformStream2.prototype, t6.toStringTag, { value: "TransformStream", configurable: true }); - class TransformStreamDefaultController { - constructor() { - throw new TypeError("Illegal constructor"); - } - get desiredSize() { - if (!hr(this)) throw yr("desiredSize"); - return Rr(this._controlledTransformStream); - } - enqueue(e7) { - if (!hr(this)) throw yr("enqueue"); - pr(this, e7); + async _createAssistantStream(run2, threadId, params, options) { + const signal = options?.signal; + if (signal) { + if (signal.aborted) + this.controller.abort(); + signal.addEventListener("abort", () => this.controller.abort()); } - error(e7) { - if (!hr(this)) throw yr("error"); - var t7; - t7 = e7, dr(this._controlledTransformStream, t7); + const body2 = { ...params, stream: true }; + const stream5 = await run2.create(threadId, body2, { ...options, signal: this.controller.signal }); + this._connected(); + for await (const event of stream5) { + tslib_1.__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); } - terminate() { - if (!hr(this)) throw yr("terminate"); - !(function(e7) { - const t7 = e7._controlledTransformStream; - Sr(t7) && wr(t7); - const r7 = new TypeError("TransformStream terminated"); - fr(t7, r7); - })(this); + if (stream5.controller.signal?.aborted) { + throw new error_1.APIUserAbortError(); } + return this._addRun(tslib_1.__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); } - function hr(e7) { - return !!o6(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_controlledTransformStream") && e7 instanceof TransformStreamDefaultController); - } - function _r3(e7) { - e7._transformAlgorithm = void 0, e7._flushAlgorithm = void 0; - } - function pr(e7, t7) { - const r7 = e7._controlledTransformStream; - if (!Sr(r7)) throw new TypeError("Readable side is not in a state that permits enqueue"); - try { - !(function(e8, t8) { - e8._readablePulling = false; - try { - e8._readableController.enqueue(t8); - } catch (t9) { - throw vr(e8, t9), t9; + static accumulateDelta(acc, delta) { + for (const [key, deltaValue] of Object.entries(delta)) { + if (!acc.hasOwnProperty(key)) { + acc[key] = deltaValue; + continue; + } + let accValue = acc[key]; + if (accValue === null || accValue === void 0) { + acc[key] = deltaValue; + continue; + } + if (key === "index" || key === "type") { + acc[key] = deltaValue; + continue; + } + if (typeof accValue === "string" && typeof deltaValue === "string") { + accValue += deltaValue; + } else if (typeof accValue === "number" && typeof deltaValue === "number") { + accValue += deltaValue; + } else if ((0, utils_1.isObj)(accValue) && (0, utils_1.isObj)(deltaValue)) { + accValue = this.accumulateDelta(accValue, deltaValue); + } else if (Array.isArray(accValue) && Array.isArray(deltaValue)) { + if (accValue.every((x2) => typeof x2 === "string" || typeof x2 === "number")) { + accValue.push(...deltaValue); + continue; } - })(r7, t7); - } catch (e8) { - throw fr(r7, e8), r7._readableStoredError; + for (const deltaEntry of deltaValue) { + if (!(0, utils_1.isObj)(deltaEntry)) { + throw new Error(`Expected array delta entry to be an object but got: ${deltaEntry}`); + } + const index2 = deltaEntry["index"]; + if (index2 == null) { + console.error(deltaEntry); + throw new Error("Expected array delta entry to have an `index` property"); + } + if (typeof index2 !== "number") { + throw new Error(`Expected array delta entry \`index\` property to be a number but got ${index2}`); + } + const accEntry = accValue[index2]; + if (accEntry == null) { + accValue.push(deltaEntry); + } else { + accValue[index2] = this.accumulateDelta(accEntry, deltaEntry); + } + } + continue; + } else { + throw Error(`Unhandled record type: ${key}, deltaValue: ${deltaValue}, accValue: ${accValue}`); + } + acc[key] = accValue; } - const o7 = (function(e8) { - return !(function(e9) { - if (!Sr(e9)) return false; - if (e9._readablePulling) return true; - if (Rr(e9) > 0) return true; - return false; - })(e8); - })(r7); - o7 !== r7._backpressure && br(r7, true); - } - function mr(e7, t7) { - return m6(e7._transformAlgorithm(t7), void 0, ((t8) => { - throw dr(e7._controlledTransformStream, t8), t8; - })); - } - function yr(e7) { - return new TypeError(`TransformStreamDefaultController.prototype.${e7} can only be used on a TransformStreamDefaultController`); - } - function gr(e7) { - return new TypeError(`TransformStream.prototype.${e7} can only be used on a TransformStream`); + return acc; } - function Sr(e7) { - return !e7._readableCloseRequested && "readable" === e7._readableState; + _addRun(run2) { + return run2; } - function wr(e7) { - e7._readableState = "closed", e7._readableCloseRequested = true, e7._readableController.close(); + async _threadAssistantStream(params, thread, options) { + return await this._createThreadAssistantStream(thread, params, options); } - function vr(e7, t7) { - "readable" === e7._readableState && (e7._readableState = "errored", e7._readableStoredError = t7), e7._readableController.error(t7); + async _runAssistantStream(threadId, runs, params, options) { + return await this._createAssistantStream(runs, threadId, params, options); } - function Rr(e7) { - return e7._readableController.desiredSize; + async _runToolAssistantStream(runId, runs, params, options) { + return await this._createToolAssistantStream(runs, runId, params, options); } - function Tr(e7, t7) { - "writable" !== e7._writableState ? Cr2(e7) : qr(e7, t7); + }; + exports2.AssistantStream = AssistantStream; + _a6 = AssistantStream, _AssistantStream_addEvent = function _AssistantStream_addEvent2(event) { + if (this.ended) + return; + tslib_1.__classPrivateFieldSet(this, _AssistantStream_currentEvent, event, "f"); + tslib_1.__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_handleEvent).call(this, event); + switch (event.event) { + case "thread.created": + break; + case "thread.run.created": + case "thread.run.queued": + case "thread.run.in_progress": + case "thread.run.requires_action": + case "thread.run.completed": + case "thread.run.incomplete": + case "thread.run.failed": + case "thread.run.cancelling": + case "thread.run.cancelled": + case "thread.run.expired": + tslib_1.__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_handleRun).call(this, event); + break; + case "thread.run.step.created": + case "thread.run.step.in_progress": + case "thread.run.step.delta": + case "thread.run.step.completed": + case "thread.run.step.failed": + case "thread.run.step.cancelled": + case "thread.run.step.expired": + tslib_1.__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_handleRunStep).call(this, event); + break; + case "thread.message.created": + case "thread.message.in_progress": + case "thread.message.delta": + case "thread.message.completed": + case "thread.message.incomplete": + tslib_1.__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_handleMessage).call(this, event); + break; + case "error": + throw new Error("Encountered an error event in event processing - errors should be processed earlier"); + default: + assertNever(event); } - function qr(e7, t7) { - e7._writableState = "erroring", e7._writableStoredError = t7, !(function(e8) { - return e8._writableHasInFlightOperation; - })(e7) && e7._writableStarted && Cr2(e7); + }, _AssistantStream_endRequest = function _AssistantStream_endRequest2() { + if (this.ended) { + throw new error_1.OpenAIError(`stream has ended, this shouldn't happen`); } - function Cr2(e7) { - e7._writableState = "errored"; + if (!tslib_1.__classPrivateFieldGet(this, _AssistantStream_finalRun, "f")) + throw Error("Final run has not been received"); + return tslib_1.__classPrivateFieldGet(this, _AssistantStream_finalRun, "f"); + }, _AssistantStream_handleMessage = function _AssistantStream_handleMessage2(event) { + const [accumulatedMessage, newContent] = tslib_1.__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_accumulateMessage).call(this, event, tslib_1.__classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); + tslib_1.__classPrivateFieldSet(this, _AssistantStream_messageSnapshot, accumulatedMessage, "f"); + tslib_1.__classPrivateFieldGet(this, _AssistantStream_messageSnapshots, "f")[accumulatedMessage.id] = accumulatedMessage; + for (const content of newContent) { + const snapshotContent = accumulatedMessage.content[content.index]; + if (snapshotContent?.type == "text") { + this._emit("textCreated", snapshotContent.text); + } } - function Pr(e7) { - "erroring" === e7._writableState && Cr2(e7); + switch (event.event) { + case "thread.message.created": + this._emit("messageCreated", event.data); + break; + case "thread.message.in_progress": + break; + case "thread.message.delta": + this._emit("messageDelta", event.data.delta, accumulatedMessage); + if (event.data.delta.content) { + for (const content of event.data.delta.content) { + if (content.type == "text" && content.text) { + let textDelta = content.text; + let snapshot2 = accumulatedMessage.content[content.index]; + if (snapshot2 && snapshot2.type == "text") { + this._emit("textDelta", textDelta, snapshot2.text); + } else { + throw Error("The snapshot associated with this text delta is not text or missing"); + } + } + if (content.index != tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentContentIndex, "f")) { + if (tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentContent, "f")) { + switch (tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentContent, "f").type) { + case "text": + this._emit("textDone", tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentContent, "f").text, tslib_1.__classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); + break; + case "image_file": + this._emit("imageFileDone", tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentContent, "f").image_file, tslib_1.__classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); + break; + } + } + tslib_1.__classPrivateFieldSet(this, _AssistantStream_currentContentIndex, content.index, "f"); + } + tslib_1.__classPrivateFieldSet(this, _AssistantStream_currentContent, accumulatedMessage.content[content.index], "f"); + } + } + break; + case "thread.message.completed": + case "thread.message.incomplete": + if (tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentContentIndex, "f") !== void 0) { + const currentContent = event.data.content[tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentContentIndex, "f")]; + if (currentContent) { + switch (currentContent.type) { + case "image_file": + this._emit("imageFileDone", currentContent.image_file, tslib_1.__classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); + break; + case "text": + this._emit("textDone", currentContent.text, tslib_1.__classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); + break; + } + } + } + if (tslib_1.__classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")) { + this._emit("messageDone", event.data); + } + tslib_1.__classPrivateFieldSet(this, _AssistantStream_messageSnapshot, void 0, "f"); } - Object.defineProperties(TransformStreamDefaultController.prototype, { enqueue: { enumerable: true }, error: { enumerable: true }, terminate: { enumerable: true }, desiredSize: { enumerable: true } }), a6(TransformStreamDefaultController.prototype.enqueue, "enqueue"), a6(TransformStreamDefaultController.prototype.error, "error"), a6(TransformStreamDefaultController.prototype.terminate, "terminate"), "symbol" == typeof t6.toStringTag && Object.defineProperty(TransformStreamDefaultController.prototype, t6.toStringTag, { value: "TransformStreamDefaultController", configurable: true }), e6.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy, e6.CountQueuingStrategy = CountQueuingStrategy, e6.ReadableByteStreamController = ReadableByteStreamController, e6.ReadableStream = ReadableStream2, e6.ReadableStreamBYOBReader = ReadableStreamBYOBReader, e6.ReadableStreamBYOBRequest = ReadableStreamBYOBRequest, e6.ReadableStreamDefaultController = ReadableStreamDefaultController, e6.ReadableStreamDefaultReader = ReadableStreamDefaultReader, e6.TransformStream = TransformStream2, e6.TransformStreamDefaultController = TransformStreamDefaultController, e6.WritableStream = WritableStream, e6.WritableStreamDefaultController = WritableStreamDefaultController, e6.WritableStreamDefaultWriter = WritableStreamDefaultWriter, Object.defineProperty(e6, "__esModule", { value: true }); - })); - } -}); - -// node_modules/formdata-node/lib/cjs/isFunction.js -var require_isFunction2 = __commonJS({ - "node_modules/formdata-node/lib/cjs/isFunction.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isFunction = void 0; - var isFunction2 = (value) => typeof value === "function"; - exports2.isFunction = isFunction2; - } -}); - -// node_modules/formdata-node/lib/cjs/blobHelpers.js -var require_blobHelpers = __commonJS({ - "node_modules/formdata-node/lib/cjs/blobHelpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.sliceBlob = exports2.consumeBlobParts = void 0; - var isFunction_1 = require_isFunction2(); - var CHUNK_SIZE = 65536; - async function* clonePart(part) { - const end = part.byteOffset + part.byteLength; - let position = part.byteOffset; - while (position !== end) { - const size = Math.min(end - position, CHUNK_SIZE); - const chunk = part.buffer.slice(position, position + size); - position += chunk.byteLength; - yield new Uint8Array(chunk); + }, _AssistantStream_handleRunStep = function _AssistantStream_handleRunStep2(event) { + const accumulatedRunStep = tslib_1.__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_accumulateRunStep).call(this, event); + tslib_1.__classPrivateFieldSet(this, _AssistantStream_currentRunStepSnapshot, accumulatedRunStep, "f"); + switch (event.event) { + case "thread.run.step.created": + this._emit("runStepCreated", event.data); + break; + case "thread.run.step.delta": + const delta = event.data.delta; + if (delta.step_details && delta.step_details.type == "tool_calls" && delta.step_details.tool_calls && accumulatedRunStep.step_details.type == "tool_calls") { + for (const toolCall of delta.step_details.tool_calls) { + if (toolCall.index == tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentToolCallIndex, "f")) { + this._emit("toolCallDelta", toolCall, accumulatedRunStep.step_details.tool_calls[toolCall.index]); + } else { + if (tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")) { + this._emit("toolCallDone", tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")); + } + tslib_1.__classPrivateFieldSet(this, _AssistantStream_currentToolCallIndex, toolCall.index, "f"); + tslib_1.__classPrivateFieldSet(this, _AssistantStream_currentToolCall, accumulatedRunStep.step_details.tool_calls[toolCall.index], "f"); + if (tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")) + this._emit("toolCallCreated", tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")); + } + } + } + this._emit("runStepDelta", event.data.delta, accumulatedRunStep); + break; + case "thread.run.step.completed": + case "thread.run.step.failed": + case "thread.run.step.cancelled": + case "thread.run.step.expired": + tslib_1.__classPrivateFieldSet(this, _AssistantStream_currentRunStepSnapshot, void 0, "f"); + const details = event.data.step_details; + if (details.type == "tool_calls") { + if (tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")) { + this._emit("toolCallDone", tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")); + tslib_1.__classPrivateFieldSet(this, _AssistantStream_currentToolCall, void 0, "f"); + } + } + this._emit("runStepDone", event.data, accumulatedRunStep); + break; + case "thread.run.step.in_progress": + break; } - } - async function* consumeNodeBlob(blob) { - let position = 0; - while (position !== blob.size) { - const chunk = blob.slice(position, Math.min(blob.size, position + CHUNK_SIZE)); - const buffer2 = await chunk.arrayBuffer(); - position += buffer2.byteLength; - yield new Uint8Array(buffer2); + }, _AssistantStream_handleEvent = function _AssistantStream_handleEvent2(event) { + tslib_1.__classPrivateFieldGet(this, _AssistantStream_events, "f").push(event); + this._emit("event", event); + }, _AssistantStream_accumulateRunStep = function _AssistantStream_accumulateRunStep2(event) { + switch (event.event) { + case "thread.run.step.created": + tslib_1.__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[event.data.id] = event.data; + return event.data; + case "thread.run.step.delta": + let snapshot2 = tslib_1.__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[event.data.id]; + if (!snapshot2) { + throw Error("Received a RunStepDelta before creation of a snapshot"); + } + let data = event.data; + if (data.delta) { + const accumulated = _a6.accumulateDelta(snapshot2, data.delta); + tslib_1.__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[event.data.id] = accumulated; + } + return tslib_1.__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[event.data.id]; + case "thread.run.step.completed": + case "thread.run.step.failed": + case "thread.run.step.cancelled": + case "thread.run.step.expired": + case "thread.run.step.in_progress": + tslib_1.__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[event.data.id] = event.data; + break; } - } - async function* consumeBlobParts(parts, clone2 = false) { - for (const part of parts) { - if (ArrayBuffer.isView(part)) { - if (clone2) { - yield* clonePart(part); + if (tslib_1.__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[event.data.id]) + return tslib_1.__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[event.data.id]; + throw new Error("No snapshot available"); + }, _AssistantStream_accumulateMessage = function _AssistantStream_accumulateMessage2(event, snapshot2) { + let newContent = []; + switch (event.event) { + case "thread.message.created": + return [event.data, newContent]; + case "thread.message.delta": + if (!snapshot2) { + throw Error("Received a delta with no existing snapshot (there should be one from message creation)"); + } + let data = event.data; + if (data.delta.content) { + for (const contentElement of data.delta.content) { + if (contentElement.index in snapshot2.content) { + let currentContent = snapshot2.content[contentElement.index]; + snapshot2.content[contentElement.index] = tslib_1.__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_accumulateContent).call(this, contentElement, currentContent); + } else { + snapshot2.content[contentElement.index] = contentElement; + newContent.push(contentElement); + } + } + } + return [snapshot2, newContent]; + case "thread.message.in_progress": + case "thread.message.completed": + case "thread.message.incomplete": + if (snapshot2) { + return [snapshot2, newContent]; } else { - yield part; + throw Error("Received thread message event with no existing snapshot"); } - } else if ((0, isFunction_1.isFunction)(part.stream)) { - yield* part.stream(); - } else { - yield* consumeNodeBlob(part); - } } - } - exports2.consumeBlobParts = consumeBlobParts; - function* sliceBlob(blobParts, blobSize, start = 0, end) { - end !== null && end !== void 0 ? end : end = blobSize; - let relativeStart = start < 0 ? Math.max(blobSize + start, 0) : Math.min(start, blobSize); - let relativeEnd = end < 0 ? Math.max(blobSize + end, 0) : Math.min(end, blobSize); - const span = Math.max(relativeEnd - relativeStart, 0); - let added = 0; - for (const part of blobParts) { - if (added >= span) { + throw Error("Tried to accumulate a non-message event"); + }, _AssistantStream_accumulateContent = function _AssistantStream_accumulateContent2(contentElement, currentContent) { + return _a6.accumulateDelta(currentContent, contentElement); + }, _AssistantStream_handleRun = function _AssistantStream_handleRun2(event) { + tslib_1.__classPrivateFieldSet(this, _AssistantStream_currentRunSnapshot, event.data, "f"); + switch (event.event) { + case "thread.run.created": break; - } - const partSize = ArrayBuffer.isView(part) ? part.byteLength : part.size; - if (relativeStart && partSize <= relativeStart) { - relativeStart -= partSize; - relativeEnd -= partSize; - } else { - let chunk; - if (ArrayBuffer.isView(part)) { - chunk = part.subarray(relativeStart, Math.min(partSize, relativeEnd)); - added += chunk.byteLength; - } else { - chunk = part.slice(relativeStart, Math.min(partSize, relativeEnd)); - added += chunk.size; + case "thread.run.queued": + break; + case "thread.run.in_progress": + break; + case "thread.run.requires_action": + case "thread.run.cancelled": + case "thread.run.failed": + case "thread.run.completed": + case "thread.run.expired": + case "thread.run.incomplete": + tslib_1.__classPrivateFieldSet(this, _AssistantStream_finalRun, event.data, "f"); + if (tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")) { + this._emit("toolCallDone", tslib_1.__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")); + tslib_1.__classPrivateFieldSet(this, _AssistantStream_currentToolCall, void 0, "f"); } - relativeEnd -= partSize; - relativeStart = 0; - yield chunk; - } + break; + case "thread.run.cancelling": + break; } + }; + function assertNever(_x) { } - exports2.sliceBlob = sliceBlob; } }); -// node_modules/formdata-node/lib/cjs/Blob.js -var require_Blob = __commonJS({ - "node_modules/formdata-node/lib/cjs/Blob.js"(exports2) { +// node_modules/openai/resources/beta/threads/runs/runs.js +var require_runs = __commonJS({ + "node_modules/openai/resources/beta/threads/runs/runs.js"(exports2) { "use strict"; - var __classPrivateFieldGet = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); - }; - var __classPrivateFieldSet = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; - }; - var _Blob_parts; - var _Blob_type; - var _Blob_size; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Blob = void 0; - var web_streams_polyfill_1 = require_ponyfill(); - var isFunction_1 = require_isFunction2(); - var blobHelpers_1 = require_blobHelpers(); - var Blob3 = class _Blob { - constructor(blobParts = [], options = {}) { - _Blob_parts.set(this, []); - _Blob_type.set(this, ""); - _Blob_size.set(this, 0); - options !== null && options !== void 0 ? options : options = {}; - if (typeof blobParts !== "object" || blobParts === null) { - throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence."); - } - if (!(0, isFunction_1.isFunction)(blobParts[Symbol.iterator])) { - throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property."); - } - if (typeof options !== "object" && !(0, isFunction_1.isFunction)(options)) { - throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary."); - } - const encoder = new TextEncoder(); - for (const raw of blobParts) { - let part; - if (ArrayBuffer.isView(raw)) { - part = new Uint8Array(raw.buffer.slice(raw.byteOffset, raw.byteOffset + raw.byteLength)); - } else if (raw instanceof ArrayBuffer) { - part = new Uint8Array(raw.slice(0)); - } else if (raw instanceof _Blob) { - part = raw; - } else { - part = encoder.encode(String(raw)); - } - __classPrivateFieldSet(this, _Blob_size, __classPrivateFieldGet(this, _Blob_size, "f") + (ArrayBuffer.isView(part) ? part.byteLength : part.size), "f"); - __classPrivateFieldGet(this, _Blob_parts, "f").push(part); - } - const type = options.type === void 0 ? "" : String(options.type); - __classPrivateFieldSet(this, _Blob_type, /^[\x20-\x7E]*$/.test(type) ? type : "", "f"); + exports2.Runs = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var StepsAPI = tslib_1.__importStar(require_steps()); + var steps_1 = require_steps(); + var pagination_1 = require_pagination(); + var headers_1 = require_headers4(); + var AssistantStream_1 = require_AssistantStream(); + var sleep_1 = require_sleep(); + var path_1 = require_path2(); + var Runs = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.steps = new StepsAPI.Steps(this._client); } - static [(_Blob_parts = /* @__PURE__ */ new WeakMap(), _Blob_type = /* @__PURE__ */ new WeakMap(), _Blob_size = /* @__PURE__ */ new WeakMap(), Symbol.hasInstance)](value) { - return Boolean(value && typeof value === "object" && (0, isFunction_1.isFunction)(value.constructor) && ((0, isFunction_1.isFunction)(value.stream) || (0, isFunction_1.isFunction)(value.arrayBuffer)) && /^(Blob|File)$/.test(value[Symbol.toStringTag])); + create(threadID, params, options) { + const { include: include2, ...body2 } = params; + return this._client.post((0, path_1.path)`/threads/${threadID}/runs`, { + query: { include: include2 }, + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + stream: params.stream ?? false, + __synthesizeEventData: true, + __security: { bearerAuth: true } + }); } - get type() { - return __classPrivateFieldGet(this, _Blob_type, "f"); + /** + * Retrieves a run. + * + * @deprecated The Assistants API is deprecated in favor of the Responses API + */ + retrieve(runID, params, options) { + const { thread_id } = params; + return this._client.get((0, path_1.path)`/threads/${thread_id}/runs/${runID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - get size() { - return __classPrivateFieldGet(this, _Blob_size, "f"); + /** + * Modifies a run. + * + * @deprecated The Assistants API is deprecated in favor of the Responses API + */ + update(runID, params, options) { + const { thread_id, ...body2 } = params; + return this._client.post((0, path_1.path)`/threads/${thread_id}/runs/${runID}`, { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - slice(start, end, contentType2) { - return new _Blob((0, blobHelpers_1.sliceBlob)(__classPrivateFieldGet(this, _Blob_parts, "f"), this.size, start, end), { - type: contentType2 + /** + * Returns a list of runs belonging to a thread. + * + * @deprecated The Assistants API is deprecated in favor of the Responses API + */ + list(threadID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/threads/${threadID}/runs`, pagination_1.CursorPage, { + query, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } }); } - async text() { - const decoder = new TextDecoder(); - let result = ""; - for await (const chunk of (0, blobHelpers_1.consumeBlobParts)(__classPrivateFieldGet(this, _Blob_parts, "f"))) { - result += decoder.decode(chunk, { stream: true }); - } - result += decoder.decode(); - return result; + /** + * Cancels a run that is `in_progress`. + * + * @deprecated The Assistants API is deprecated in favor of the Responses API + */ + cancel(runID, params, options) { + const { thread_id } = params; + return this._client.post((0, path_1.path)`/threads/${thread_id}/runs/${runID}/cancel`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - async arrayBuffer() { - const view = new Uint8Array(this.size); - let offset = 0; - for await (const chunk of (0, blobHelpers_1.consumeBlobParts)(__classPrivateFieldGet(this, _Blob_parts, "f"))) { - view.set(chunk, offset); - offset += chunk.length; - } - return view.buffer; + /** + * A helper to create a run an poll for a terminal state. More information on Run + * lifecycles can be found here: + * https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps + */ + async createAndPoll(threadId, body2, options) { + const run2 = await this.create(threadId, body2, options); + return await this.poll(run2.id, { thread_id: threadId }, options); } - stream() { - const iterator2 = (0, blobHelpers_1.consumeBlobParts)(__classPrivateFieldGet(this, _Blob_parts, "f"), true); - return new web_streams_polyfill_1.ReadableStream({ - async pull(controller) { - const { value, done } = await iterator2.next(); - if (done) { - return queueMicrotask(() => controller.close()); - } - controller.enqueue(value); - }, - async cancel() { - await iterator2.return(); + /** + * Create a Run stream + * + * @deprecated use `stream` instead + */ + createAndStream(threadId, body2, options) { + return AssistantStream_1.AssistantStream.createAssistantStream(threadId, this._client.beta.threads.runs, body2, options); + } + /** + * A helper to poll a run status until it reaches a terminal state. More + * information on Run lifecycles can be found here: + * https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps + */ + async poll(runId, params, options) { + const headers = (0, headers_1.buildHeaders)([ + options?.headers, + { + "X-Stainless-Poll-Helper": "true", + "X-Stainless-Custom-Poll-Interval": options?.pollIntervalMs?.toString() ?? void 0 + } + ]); + while (true) { + const { data: run2, response } = await this.retrieve(runId, params, { + ...options, + headers: { ...options?.headers, ...headers } + }).withResponse(); + switch (run2.status) { + //If we are in any sort of intermediate state we poll + case "queued": + case "in_progress": + case "cancelling": + let sleepInterval = 5e3; + if (options?.pollIntervalMs) { + sleepInterval = options.pollIntervalMs; + } else { + const headerInterval = response.headers.get("openai-poll-after-ms"); + if (headerInterval) { + const headerIntervalMs = parseInt(headerInterval); + if (!isNaN(headerIntervalMs)) { + sleepInterval = headerIntervalMs; + } + } + } + await (0, sleep_1.sleep)(sleepInterval); + break; + //We return the run in any terminal state. + case "requires_action": + case "incomplete": + case "cancelled": + case "completed": + case "failed": + case "expired": + return run2; } + } + } + /** + * Create a Run stream + */ + stream(threadId, body2, options) { + return AssistantStream_1.AssistantStream.createAssistantStream(threadId, this._client.beta.threads.runs, body2, options); + } + submitToolOutputs(runID, params, options) { + const { thread_id, ...body2 } = params; + return this._client.post((0, path_1.path)`/threads/${thread_id}/runs/${runID}/submit_tool_outputs`, { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + stream: params.stream ?? false, + __synthesizeEventData: true, + __security: { bearerAuth: true } }); } - get [Symbol.toStringTag]() { - return "Blob"; + /** + * A helper to submit a tool output to a run and poll for a terminal run state. + * More information on Run lifecycles can be found here: + * https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps + */ + async submitToolOutputsAndPoll(runId, params, options) { + const run2 = await this.submitToolOutputs(runId, params, options); + return await this.poll(run2.id, params, options); + } + /** + * Submit the tool outputs from a previous run and stream the run to a terminal + * state. More information on Run lifecycles can be found here: + * https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps + */ + submitToolOutputsStream(runId, params, options) { + return AssistantStream_1.AssistantStream.createToolAssistantStream(runId, this._client.beta.threads.runs, params, options); } }; - exports2.Blob = Blob3; - Object.defineProperties(Blob3.prototype, { - type: { enumerable: true }, - size: { enumerable: true }, - slice: { enumerable: true }, - stream: { enumerable: true }, - text: { enumerable: true }, - arrayBuffer: { enumerable: true } - }); + exports2.Runs = Runs; + Runs.Steps = steps_1.Steps; } }); -// node_modules/formdata-node/lib/cjs/File.js -var require_File = __commonJS({ - "node_modules/formdata-node/lib/cjs/File.js"(exports2) { +// node_modules/openai/resources/beta/threads/threads.js +var require_threads2 = __commonJS({ + "node_modules/openai/resources/beta/threads/threads.js"(exports2) { "use strict"; - var __classPrivateFieldSet = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; - }; - var __classPrivateFieldGet = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); - }; - var _File_name; - var _File_lastModified; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.File = void 0; - var Blob_1 = require_Blob(); - var File2 = class extends Blob_1.Blob { - constructor(fileBits, name, options = {}) { - super(fileBits, options); - _File_name.set(this, void 0); - _File_lastModified.set(this, 0); - if (arguments.length < 2) { - throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`); - } - __classPrivateFieldSet(this, _File_name, String(name), "f"); - const lastModified = options.lastModified === void 0 ? Date.now() : Number(options.lastModified); - if (!Number.isNaN(lastModified)) { - __classPrivateFieldSet(this, _File_lastModified, lastModified, "f"); - } + exports2.Threads = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var MessagesAPI = tslib_1.__importStar(require_messages2()); + var messages_1 = require_messages2(); + var RunsAPI = tslib_1.__importStar(require_runs()); + var runs_1 = require_runs(); + var headers_1 = require_headers4(); + var AssistantStream_1 = require_AssistantStream(); + var path_1 = require_path2(); + var Threads = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.runs = new RunsAPI.Runs(this._client); + this.messages = new MessagesAPI.Messages(this._client); } - static [(_File_name = /* @__PURE__ */ new WeakMap(), _File_lastModified = /* @__PURE__ */ new WeakMap(), Symbol.hasInstance)](value) { - return value instanceof Blob_1.Blob && value[Symbol.toStringTag] === "File" && typeof value.name === "string"; + /** + * Create a thread. + * + * @deprecated The Assistants API is deprecated in favor of the Responses API + */ + create(body2 = {}, options) { + return this._client.post("/threads", { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - get name() { - return __classPrivateFieldGet(this, _File_name, "f"); + /** + * Retrieves a thread. + * + * @deprecated The Assistants API is deprecated in favor of the Responses API + */ + retrieve(threadID, options) { + return this._client.get((0, path_1.path)`/threads/${threadID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - get lastModified() { - return __classPrivateFieldGet(this, _File_lastModified, "f"); + /** + * Modifies a thread. + * + * @deprecated The Assistants API is deprecated in favor of the Responses API + */ + update(threadID, body2, options) { + return this._client.post((0, path_1.path)`/threads/${threadID}`, { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - get webkitRelativePath() { - return ""; + /** + * Delete a thread. + * + * @deprecated The Assistants API is deprecated in favor of the Responses API + */ + delete(threadID, options) { + return this._client.delete((0, path_1.path)`/threads/${threadID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - get [Symbol.toStringTag]() { - return "File"; + createAndRun(body2, options) { + return this._client.post("/threads/runs", { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + stream: body2.stream ?? false, + __synthesizeEventData: true, + __security: { bearerAuth: true } + }); + } + /** + * A helper to create a thread, start a run and then poll for a terminal state. + * More information on Run lifecycles can be found here: + * https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps + */ + async createAndRunPoll(body2, options) { + const run2 = await this.createAndRun(body2, options); + return await this.runs.poll(run2.id, { thread_id: run2.thread_id }, options); + } + /** + * Create a thread and stream the run back + */ + createAndRunStream(body2, options) { + return AssistantStream_1.AssistantStream.createThreadAssistantStream(body2, this._client.beta.threads, options); } }; - exports2.File = File2; + exports2.Threads = Threads; + Threads.Runs = runs_1.Runs; + Threads.Messages = messages_1.Messages; } }); -// node_modules/formdata-node/lib/cjs/isFile.js -var require_isFile = __commonJS({ - "node_modules/formdata-node/lib/cjs/isFile.js"(exports2) { +// node_modules/openai/resources/beta/beta.js +var require_beta = __commonJS({ + "node_modules/openai/resources/beta/beta.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isFile = void 0; - var File_1 = require_File(); - var isFile = (value) => value instanceof File_1.File; - exports2.isFile = isFile; + exports2.Beta = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var AssistantsAPI = tslib_1.__importStar(require_assistants()); + var assistants_1 = require_assistants(); + var RealtimeAPI = tslib_1.__importStar(require_realtime()); + var realtime_1 = require_realtime(); + var ChatKitAPI = tslib_1.__importStar(require_chatkit()); + var chatkit_1 = require_chatkit(); + var ThreadsAPI = tslib_1.__importStar(require_threads2()); + var threads_1 = require_threads2(); + var Beta = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.realtime = new RealtimeAPI.Realtime(this._client); + this.chatkit = new ChatKitAPI.ChatKit(this._client); + this.assistants = new AssistantsAPI.Assistants(this._client); + this.threads = new ThreadsAPI.Threads(this._client); + } + }; + exports2.Beta = Beta; + Beta.Realtime = realtime_1.Realtime; + Beta.ChatKit = chatkit_1.ChatKit; + Beta.Assistants = assistants_1.Assistants; + Beta.Threads = threads_1.Threads; } }); -// node_modules/formdata-node/lib/cjs/isBlob.js -var require_isBlob = __commonJS({ - "node_modules/formdata-node/lib/cjs/isBlob.js"(exports2) { +// node_modules/openai/resources/completions.js +var require_completions3 = __commonJS({ + "node_modules/openai/resources/completions.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isBlob = void 0; - var Blob_1 = require_Blob(); - var isBlob3 = (value) => value instanceof Blob_1.Blob; - exports2.isBlob = isBlob3; + exports2.Completions = void 0; + var resource_1 = require_resource(); + var Completions = class extends resource_1.APIResource { + create(body2, options) { + return this._client.post("/completions", { + body: body2, + ...options, + stream: body2.stream ?? false, + __security: { bearerAuth: true } + }); + } + }; + exports2.Completions = Completions; } }); -// node_modules/formdata-node/lib/cjs/deprecateConstructorEntries.js -var require_deprecateConstructorEntries = __commonJS({ - "node_modules/formdata-node/lib/cjs/deprecateConstructorEntries.js"(exports2) { +// node_modules/openai/resources/containers/files/content.js +var require_content = __commonJS({ + "node_modules/openai/resources/containers/files/content.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.deprecateConstructorEntries = void 0; - var util_1 = __require("util"); - exports2.deprecateConstructorEntries = (0, util_1.deprecate)(() => { - }, 'Constructor "entries" argument is not spec-compliant and will be removed in next major release.'); + exports2.Content = void 0; + var resource_1 = require_resource(); + var headers_1 = require_headers4(); + var path_1 = require_path2(); + var Content = class extends resource_1.APIResource { + /** + * Retrieve Container File Content + */ + retrieve(fileID, params, options) { + const { container_id } = params; + return this._client.get((0, path_1.path)`/containers/${container_id}/files/${fileID}/content`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ Accept: "application/binary" }, options?.headers]), + __security: { bearerAuth: true }, + __binaryResponse: true + }); + } + }; + exports2.Content = Content; } }); -// node_modules/formdata-node/lib/cjs/FormData.js -var require_FormData = __commonJS({ - "node_modules/formdata-node/lib/cjs/FormData.js"(exports2) { +// node_modules/openai/resources/containers/files/files.js +var require_files = __commonJS({ + "node_modules/openai/resources/containers/files/files.js"(exports2) { "use strict"; - var __classPrivateFieldGet = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); - }; - var _FormData_instances; - var _FormData_entries; - var _FormData_setEntry; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.FormData = void 0; - var util_1 = __require("util"); - var File_1 = require_File(); - var isFile_1 = require_isFile(); - var isBlob_1 = require_isBlob(); - var isFunction_1 = require_isFunction2(); - var deprecateConstructorEntries_1 = require_deprecateConstructorEntries(); - var FormData2 = class { - constructor(entries) { - _FormData_instances.add(this); - _FormData_entries.set(this, /* @__PURE__ */ new Map()); - if (entries) { - (0, deprecateConstructorEntries_1.deprecateConstructorEntries)(); - entries.forEach(({ name, value, fileName }) => this.append(name, value, fileName)); - } + exports2.Files = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var ContentAPI = tslib_1.__importStar(require_content()); + var content_1 = require_content(); + var pagination_1 = require_pagination(); + var headers_1 = require_headers4(); + var uploads_1 = require_uploads(); + var path_1 = require_path2(); + var Files = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.content = new ContentAPI.Content(this._client); } - static [(_FormData_entries = /* @__PURE__ */ new WeakMap(), _FormData_instances = /* @__PURE__ */ new WeakSet(), Symbol.hasInstance)](value) { - return Boolean(value && (0, isFunction_1.isFunction)(value.constructor) && value[Symbol.toStringTag] === "FormData" && (0, isFunction_1.isFunction)(value.append) && (0, isFunction_1.isFunction)(value.set) && (0, isFunction_1.isFunction)(value.get) && (0, isFunction_1.isFunction)(value.getAll) && (0, isFunction_1.isFunction)(value.has) && (0, isFunction_1.isFunction)(value.delete) && (0, isFunction_1.isFunction)(value.entries) && (0, isFunction_1.isFunction)(value.values) && (0, isFunction_1.isFunction)(value.keys) && (0, isFunction_1.isFunction)(value[Symbol.iterator]) && (0, isFunction_1.isFunction)(value.forEach)); + /** + * Create a Container File + * + * You can send either a multipart/form-data request with the raw file content, or + * a JSON request with a file ID. + */ + create(containerID, body2, options) { + return this._client.post((0, path_1.path)`/containers/${containerID}/files`, (0, uploads_1.maybeMultipartFormRequestOptions)({ body: body2, ...options, __security: { bearerAuth: true } }, this._client)); } - append(name, value, fileName) { - __classPrivateFieldGet(this, _FormData_instances, "m", _FormData_setEntry).call(this, { - name, - fileName, - append: true, - rawValue: value, - argsLength: arguments.length + /** + * Retrieve Container File + */ + retrieve(fileID, params, options) { + const { container_id } = params; + return this._client.get((0, path_1.path)`/containers/${container_id}/files/${fileID}`, { + ...options, + __security: { bearerAuth: true } }); } - set(name, value, fileName) { - __classPrivateFieldGet(this, _FormData_instances, "m", _FormData_setEntry).call(this, { - name, - fileName, - append: false, - rawValue: value, - argsLength: arguments.length + /** + * List Container files + */ + list(containerID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/containers/${containerID}/files`, pagination_1.CursorPage, { + query, + ...options, + __security: { bearerAuth: true } }); } - get(name) { - const field = __classPrivateFieldGet(this, _FormData_entries, "f").get(String(name)); - if (!field) { - return null; - } - return field[0]; - } - getAll(name) { - const field = __classPrivateFieldGet(this, _FormData_entries, "f").get(String(name)); - if (!field) { - return []; - } - return field.slice(); + /** + * Delete Container File + */ + delete(fileID, params, options) { + const { container_id } = params; + return this._client.delete((0, path_1.path)`/containers/${container_id}/files/${fileID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ Accept: "*/*" }, options?.headers]), + __security: { bearerAuth: true } + }); } - has(name) { - return __classPrivateFieldGet(this, _FormData_entries, "f").has(String(name)); + }; + exports2.Files = Files; + Files.Content = content_1.Content; + } +}); + +// node_modules/openai/resources/containers/containers.js +var require_containers = __commonJS({ + "node_modules/openai/resources/containers/containers.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Containers = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var FilesAPI = tslib_1.__importStar(require_files()); + var files_1 = require_files(); + var pagination_1 = require_pagination(); + var headers_1 = require_headers4(); + var path_1 = require_path2(); + var Containers = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.files = new FilesAPI.Files(this._client); } - delete(name) { - __classPrivateFieldGet(this, _FormData_entries, "f").delete(String(name)); + /** + * Create Container + */ + create(body2, options) { + return this._client.post("/containers", { body: body2, ...options, __security: { bearerAuth: true } }); } - *keys() { - for (const key of __classPrivateFieldGet(this, _FormData_entries, "f").keys()) { - yield key; - } + /** + * Retrieve Container + */ + retrieve(containerID, options) { + return this._client.get((0, path_1.path)`/containers/${containerID}`, { + ...options, + __security: { bearerAuth: true } + }); } - *entries() { - for (const name of this.keys()) { - const values = this.getAll(name); - for (const value of values) { - yield [name, value]; - } - } + /** + * List Containers + */ + list(query = {}, options) { + return this._client.getAPIList("/containers", pagination_1.CursorPage, { + query, + ...options, + __security: { bearerAuth: true } + }); } - *values() { - for (const [, value] of this) { - yield value; - } + /** + * Delete Container + */ + delete(containerID, options) { + return this._client.delete((0, path_1.path)`/containers/${containerID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ Accept: "*/*" }, options?.headers]), + __security: { bearerAuth: true } + }); } - [(_FormData_setEntry = function _FormData_setEntry2({ name, rawValue, append, fileName, argsLength }) { - const methodName = append ? "append" : "set"; - if (argsLength < 2) { - throw new TypeError(`Failed to execute '${methodName}' on 'FormData': 2 arguments required, but only ${argsLength} present.`); - } - name = String(name); - let value; - if ((0, isFile_1.isFile)(rawValue)) { - value = fileName === void 0 ? rawValue : new File_1.File([rawValue], fileName, { - type: rawValue.type, - lastModified: rawValue.lastModified - }); - } else if ((0, isBlob_1.isBlob)(rawValue)) { - value = new File_1.File([rawValue], fileName === void 0 ? "blob" : fileName, { - type: rawValue.type - }); - } else if (fileName) { - throw new TypeError(`Failed to execute '${methodName}' on 'FormData': parameter 2 is not of type 'Blob'.`); - } else { - value = String(rawValue); - } - const values = __classPrivateFieldGet(this, _FormData_entries, "f").get(name); - if (!values) { - return void __classPrivateFieldGet(this, _FormData_entries, "f").set(name, [value]); - } - if (!append) { - return void __classPrivateFieldGet(this, _FormData_entries, "f").set(name, [value]); - } - values.push(value); - }, Symbol.iterator)]() { - return this.entries(); + }; + exports2.Containers = Containers; + Containers.Files = files_1.Files; + } +}); + +// node_modules/openai/resources/conversations/items.js +var require_items = __commonJS({ + "node_modules/openai/resources/conversations/items.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Items = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Items = class extends resource_1.APIResource { + /** + * Create items in a conversation with the given ID. + */ + create(conversationID, params, options) { + const { include: include2, ...body2 } = params; + return this._client.post((0, path_1.path)`/conversations/${conversationID}/items`, { + query: { include: include2 }, + body: body2, + ...options, + __security: { bearerAuth: true } + }); } - forEach(callback, thisArg) { - for (const [name, value] of this) { - callback.call(thisArg, value, name, this); - } + /** + * Get a single item from a conversation with the given IDs. + */ + retrieve(itemID, params, options) { + const { conversation_id, ...query } = params; + return this._client.get((0, path_1.path)`/conversations/${conversation_id}/items/${itemID}`, { + query, + ...options, + __security: { bearerAuth: true } + }); } - get [Symbol.toStringTag]() { - return "FormData"; + /** + * List all items for a conversation with the given ID. + */ + list(conversationID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/conversations/${conversationID}/items`, pagination_1.ConversationCursorPage, { query, ...options, __security: { bearerAuth: true } }); } - [util_1.inspect.custom]() { - return this[Symbol.toStringTag]; + /** + * Delete an item from a conversation with the given IDs. + */ + delete(itemID, params, options) { + const { conversation_id } = params; + return this._client.delete((0, path_1.path)`/conversations/${conversation_id}/items/${itemID}`, { + ...options, + __security: { bearerAuth: true } + }); } }; - exports2.FormData = FormData2; + exports2.Items = Items; } }); -// node_modules/formdata-node/lib/cjs/index.js -var require_cjs = __commonJS({ - "node_modules/formdata-node/lib/cjs/index.js"(exports2) { +// node_modules/openai/resources/conversations/conversations.js +var require_conversations = __commonJS({ + "node_modules/openai/resources/conversations/conversations.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - Object.defineProperty(o6, k22, { enumerable: true, get: function() { - return m6[k7]; - } }); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __exportStar = exports2 && exports2.__exportStar || function(m6, exports3) { - for (var p6 in m6) if (p6 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p6)) __createBinding(exports3, m6, p6); - }; Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar(require_FormData(), exports2); - __exportStar(require_Blob(), exports2); - __exportStar(require_File(), exports2); + exports2.Conversations = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var ItemsAPI = tslib_1.__importStar(require_items()); + var items_1 = require_items(); + var path_1 = require_path2(); + var Conversations = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.items = new ItemsAPI.Items(this._client); + } + /** + * Create a conversation. + */ + create(body2 = {}, options) { + return this._client.post("/conversations", { body: body2, ...options, __security: { bearerAuth: true } }); + } + /** + * Get a conversation + */ + retrieve(conversationID, options) { + return this._client.get((0, path_1.path)`/conversations/${conversationID}`, { + ...options, + __security: { bearerAuth: true } + }); + } + /** + * Update a conversation + */ + update(conversationID, body2, options) { + return this._client.post((0, path_1.path)`/conversations/${conversationID}`, { + body: body2, + ...options, + __security: { bearerAuth: true } + }); + } + /** + * Delete a conversation. Items in the conversation will not be deleted. + */ + delete(conversationID, options) { + return this._client.delete((0, path_1.path)`/conversations/${conversationID}`, { + ...options, + __security: { bearerAuth: true } + }); + } + }; + exports2.Conversations = Conversations; + Conversations.Items = items_1.Items; } }); -// node_modules/humanize-ms/index.js -var require_humanize_ms = __commonJS({ - "node_modules/humanize-ms/index.js"(exports2, module) { +// node_modules/openai/resources/embeddings.js +var require_embeddings = __commonJS({ + "node_modules/openai/resources/embeddings.js"(exports2) { "use strict"; - var util3 = __require("util"); - var ms2 = require_ms(); - module.exports = function(t6) { - if (typeof t6 === "number") return t6; - var r6 = ms2(t6); - if (r6 === void 0) { - var err = new Error(util3.format("humanize-ms(%j) result undefined", t6)); - console.warn(err.stack); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Embeddings = void 0; + var resource_1 = require_resource(); + var utils_1 = require_utils11(); + var Embeddings = class extends resource_1.APIResource { + /** + * Creates an embedding vector representing the input text. + * + * @example + * ```ts + * const createEmbeddingResponse = + * await client.embeddings.create({ + * input: 'The quick brown fox jumped over the lazy dog', + * model: 'text-embedding-3-small', + * }); + * ``` + */ + create(body2, options) { + const hasUserProvidedEncodingFormat = !!body2.encoding_format; + let encoding_format = hasUserProvidedEncodingFormat ? body2.encoding_format : "base64"; + if (hasUserProvidedEncodingFormat) { + (0, utils_1.loggerFor)(this._client).debug("embeddings/user defined encoding_format:", body2.encoding_format); + } + const response = this._client.post("/embeddings", { + body: { + ...body2, + encoding_format + }, + ...options, + __security: { bearerAuth: true } + }); + if (hasUserProvidedEncodingFormat) { + return response; + } + (0, utils_1.loggerFor)(this._client).debug("embeddings/decoding base64 embeddings from base64"); + return response._thenUnwrap((response2) => { + if (response2 && response2.data) { + response2.data.forEach((embeddingBase64Obj) => { + const embeddingBase64Str = embeddingBase64Obj.embedding; + embeddingBase64Obj.embedding = (0, utils_1.toFloat32Array)(embeddingBase64Str); + }); + } + return response2; + }); } - return r6; }; + exports2.Embeddings = Embeddings; } }); -// node_modules/agentkeepalive/lib/constants.js -var require_constants10 = __commonJS({ - "node_modules/agentkeepalive/lib/constants.js"(exports2, module) { +// node_modules/openai/resources/evals/runs/output-items.js +var require_output_items = __commonJS({ + "node_modules/openai/resources/evals/runs/output-items.js"(exports2) { "use strict"; - module.exports = { - // agent - CURRENT_ID: /* @__PURE__ */ Symbol("agentkeepalive#currentId"), - CREATE_ID: /* @__PURE__ */ Symbol("agentkeepalive#createId"), - INIT_SOCKET: /* @__PURE__ */ Symbol("agentkeepalive#initSocket"), - CREATE_HTTPS_CONNECTION: /* @__PURE__ */ Symbol("agentkeepalive#createHttpsConnection"), - // socket - SOCKET_CREATED_TIME: /* @__PURE__ */ Symbol("agentkeepalive#socketCreatedTime"), - SOCKET_NAME: /* @__PURE__ */ Symbol("agentkeepalive#socketName"), - SOCKET_REQUEST_COUNT: /* @__PURE__ */ Symbol("agentkeepalive#socketRequestCount"), - SOCKET_REQUEST_FINISHED_COUNT: /* @__PURE__ */ Symbol("agentkeepalive#socketRequestFinishedCount") + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OutputItems = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var OutputItems = class extends resource_1.APIResource { + /** + * Get an evaluation run output item by ID. + */ + retrieve(outputItemID, params, options) { + const { eval_id, run_id } = params; + return this._client.get((0, path_1.path)`/evals/${eval_id}/runs/${run_id}/output_items/${outputItemID}`, { + ...options, + __security: { bearerAuth: true } + }); + } + /** + * Get a list of output items for an evaluation run. + */ + list(runID, params, options) { + const { eval_id, ...query } = params; + return this._client.getAPIList((0, path_1.path)`/evals/${eval_id}/runs/${runID}/output_items`, pagination_1.CursorPage, { query, ...options, __security: { bearerAuth: true } }); + } }; + exports2.OutputItems = OutputItems; } }); -// node_modules/agentkeepalive/lib/agent.js -var require_agent2 = __commonJS({ - "node_modules/agentkeepalive/lib/agent.js"(exports2, module) { +// node_modules/openai/resources/evals/runs/runs.js +var require_runs2 = __commonJS({ + "node_modules/openai/resources/evals/runs/runs.js"(exports2) { "use strict"; - var OriginalAgent = __require("http").Agent; - var ms2 = require_humanize_ms(); - var debug2 = __require("util").debuglog("agentkeepalive"); - var { - INIT_SOCKET, - CURRENT_ID, - CREATE_ID, - SOCKET_CREATED_TIME, - SOCKET_NAME, - SOCKET_REQUEST_COUNT, - SOCKET_REQUEST_FINISHED_COUNT - } = require_constants10(); - var defaultTimeoutListenerCount = 1; - var majorVersion = parseInt(process.version.split(".", 1)[0].substring(1)); - if (majorVersion >= 11 && majorVersion <= 12) { - defaultTimeoutListenerCount = 2; - } else if (majorVersion >= 13) { - defaultTimeoutListenerCount = 3; - } - function deprecate(message) { - console.log("[agentkeepalive:deprecated] %s", message); - } - var Agent3 = class extends OriginalAgent { - constructor(options) { - options = options || {}; - options.keepAlive = options.keepAlive !== false; - if (options.freeSocketTimeout === void 0) { - options.freeSocketTimeout = 4e3; - } - if (options.keepAliveTimeout) { - deprecate("options.keepAliveTimeout is deprecated, please use options.freeSocketTimeout instead"); - options.freeSocketTimeout = options.keepAliveTimeout; - delete options.keepAliveTimeout; - } - if (options.freeSocketKeepAliveTimeout) { - deprecate("options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead"); - options.freeSocketTimeout = options.freeSocketKeepAliveTimeout; - delete options.freeSocketKeepAliveTimeout; - } - if (options.timeout === void 0) { - options.timeout = Math.max(options.freeSocketTimeout * 2, 8e3); - } - options.timeout = ms2(options.timeout); - options.freeSocketTimeout = ms2(options.freeSocketTimeout); - options.socketActiveTTL = options.socketActiveTTL ? ms2(options.socketActiveTTL) : 0; - super(options); - this[CURRENT_ID] = 0; - this.createSocketCount = 0; - this.createSocketCountLastCheck = 0; - this.createSocketErrorCount = 0; - this.createSocketErrorCountLastCheck = 0; - this.closeSocketCount = 0; - this.closeSocketCountLastCheck = 0; - this.errorSocketCount = 0; - this.errorSocketCountLastCheck = 0; - this.requestCount = 0; - this.requestCountLastCheck = 0; - this.timeoutSocketCount = 0; - this.timeoutSocketCountLastCheck = 0; - this.on("free", (socket) => { - const timeout2 = this.calcSocketTimeout(socket); - if (timeout2 > 0 && socket.timeout !== timeout2) { - socket.setTimeout(timeout2); - } - }); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Runs = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var OutputItemsAPI = tslib_1.__importStar(require_output_items()); + var output_items_1 = require_output_items(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Runs = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.outputItems = new OutputItemsAPI.OutputItems(this._client); } - get freeSocketKeepAliveTimeout() { - deprecate("agent.freeSocketKeepAliveTimeout is deprecated, please use agent.options.freeSocketTimeout instead"); - return this.options.freeSocketTimeout; + /** + * Kicks off a new run for a given evaluation, specifying the data source, and what + * model configuration to use to test. The datasource will be validated against the + * schema specified in the config of the evaluation. + */ + create(evalID, body2, options) { + return this._client.post((0, path_1.path)`/evals/${evalID}/runs`, { + body: body2, + ...options, + __security: { bearerAuth: true } + }); } - get timeout() { - deprecate("agent.timeout is deprecated, please use agent.options.timeout instead"); - return this.options.timeout; + /** + * Get an evaluation run by ID. + */ + retrieve(runID, params, options) { + const { eval_id } = params; + return this._client.get((0, path_1.path)`/evals/${eval_id}/runs/${runID}`, { + ...options, + __security: { bearerAuth: true } + }); } - get socketActiveTTL() { - deprecate("agent.socketActiveTTL is deprecated, please use agent.options.socketActiveTTL instead"); - return this.options.socketActiveTTL; + /** + * Get a list of runs for an evaluation. + */ + list(evalID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/evals/${evalID}/runs`, pagination_1.CursorPage, { + query, + ...options, + __security: { bearerAuth: true } + }); } - calcSocketTimeout(socket) { - let freeSocketTimeout = this.options.freeSocketTimeout; - const socketActiveTTL = this.options.socketActiveTTL; - if (socketActiveTTL) { - const aliveTime = Date.now() - socket[SOCKET_CREATED_TIME]; - const diff = socketActiveTTL - aliveTime; - if (diff <= 0) { - return diff; - } - if (freeSocketTimeout && diff < freeSocketTimeout) { - freeSocketTimeout = diff; - } - } - if (freeSocketTimeout) { - const customFreeSocketTimeout = socket.freeSocketTimeout || socket.freeSocketKeepAliveTimeout; - return customFreeSocketTimeout || freeSocketTimeout; - } + /** + * Delete an eval run. + */ + delete(runID, params, options) { + const { eval_id } = params; + return this._client.delete((0, path_1.path)`/evals/${eval_id}/runs/${runID}`, { + ...options, + __security: { bearerAuth: true } + }); } - keepSocketAlive(socket) { - const result = super.keepSocketAlive(socket); - if (!result) return result; - const customTimeout = this.calcSocketTimeout(socket); - if (typeof customTimeout === "undefined") { - return true; - } - if (customTimeout <= 0) { - debug2( - "%s(requests: %s, finished: %s) free but need to destroy by TTL, request count %s, diff is %s", - socket[SOCKET_NAME], - socket[SOCKET_REQUEST_COUNT], - socket[SOCKET_REQUEST_FINISHED_COUNT], - customTimeout - ); - return false; - } - if (socket.timeout !== customTimeout) { - socket.setTimeout(customTimeout); - } - return true; + /** + * Cancel an ongoing evaluation run. + */ + cancel(runID, params, options) { + const { eval_id } = params; + return this._client.post((0, path_1.path)`/evals/${eval_id}/runs/${runID}`, { + ...options, + __security: { bearerAuth: true } + }); } - // only call on addRequest - reuseSocket(...args) { - super.reuseSocket(...args); - const socket = args[0]; - const req = args[1]; - req.reusedSocket = true; - const agentTimeout = this.options.timeout; - if (getSocketTimeout(socket) !== agentTimeout) { - socket.setTimeout(agentTimeout); - debug2("%s reset timeout to %sms", socket[SOCKET_NAME], agentTimeout); - } - socket[SOCKET_REQUEST_COUNT]++; - debug2( - "%s(requests: %s, finished: %s) reuse on addRequest, timeout %sms", - socket[SOCKET_NAME], - socket[SOCKET_REQUEST_COUNT], - socket[SOCKET_REQUEST_FINISHED_COUNT], - getSocketTimeout(socket) - ); + }; + exports2.Runs = Runs; + Runs.OutputItems = output_items_1.OutputItems; + } +}); + +// node_modules/openai/resources/evals/evals.js +var require_evals = __commonJS({ + "node_modules/openai/resources/evals/evals.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Evals = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var RunsAPI = tslib_1.__importStar(require_runs2()); + var runs_1 = require_runs2(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Evals = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.runs = new RunsAPI.Runs(this._client); } - [CREATE_ID]() { - const id = this[CURRENT_ID]++; - if (this[CURRENT_ID] === Number.MAX_SAFE_INTEGER) this[CURRENT_ID] = 0; - return id; + /** + * Create the structure of an evaluation that can be used to test a model's + * performance. An evaluation is a set of testing criteria and the config for a + * data source, which dictates the schema of the data used in the evaluation. After + * creating an evaluation, you can run it on different models and model parameters. + * We support several types of graders and datasources. For more information, see + * the [Evals guide](https://platform.openai.com/docs/guides/evals). + */ + create(body2, options) { + return this._client.post("/evals", { body: body2, ...options, __security: { bearerAuth: true } }); } - [INIT_SOCKET](socket, options) { - if (options.timeout) { - const timeout2 = getSocketTimeout(socket); - if (!timeout2) { - socket.setTimeout(options.timeout); - } - } - if (this.options.keepAlive) { - socket.setNoDelay(true); - } - this.createSocketCount++; - if (this.options.socketActiveTTL) { - socket[SOCKET_CREATED_TIME] = Date.now(); - } - socket[SOCKET_NAME] = `sock[${this[CREATE_ID]()}#${options._agentKey}]`.split("-----BEGIN", 1)[0]; - socket[SOCKET_REQUEST_COUNT] = 1; - socket[SOCKET_REQUEST_FINISHED_COUNT] = 0; - installListeners(this, socket, options); + /** + * Get an evaluation by ID. + */ + retrieve(evalID, options) { + return this._client.get((0, path_1.path)`/evals/${evalID}`, { ...options, __security: { bearerAuth: true } }); } - createConnection(options, oncreate) { - let called = false; - const onNewCreate = (err, socket) => { - if (called) return; - called = true; - if (err) { - this.createSocketErrorCount++; - return oncreate(err); - } - this[INIT_SOCKET](socket, options); - oncreate(err, socket); - }; - const newSocket = super.createConnection(options, onNewCreate); - if (newSocket) onNewCreate(null, newSocket); - return newSocket; + /** + * Update certain properties of an evaluation. + */ + update(evalID, body2, options) { + return this._client.post((0, path_1.path)`/evals/${evalID}`, { body: body2, ...options, __security: { bearerAuth: true } }); } - get statusChanged() { - const changed = this.createSocketCount !== this.createSocketCountLastCheck || this.createSocketErrorCount !== this.createSocketErrorCountLastCheck || this.closeSocketCount !== this.closeSocketCountLastCheck || this.errorSocketCount !== this.errorSocketCountLastCheck || this.timeoutSocketCount !== this.timeoutSocketCountLastCheck || this.requestCount !== this.requestCountLastCheck; - if (changed) { - this.createSocketCountLastCheck = this.createSocketCount; - this.createSocketErrorCountLastCheck = this.createSocketErrorCount; - this.closeSocketCountLastCheck = this.closeSocketCount; - this.errorSocketCountLastCheck = this.errorSocketCount; - this.timeoutSocketCountLastCheck = this.timeoutSocketCount; - this.requestCountLastCheck = this.requestCount; - } - return changed; + /** + * List evaluations for a project. + */ + list(query = {}, options) { + return this._client.getAPIList("/evals", pagination_1.CursorPage, { + query, + ...options, + __security: { bearerAuth: true } + }); } - getCurrentStatus() { - return { - createSocketCount: this.createSocketCount, - createSocketErrorCount: this.createSocketErrorCount, - closeSocketCount: this.closeSocketCount, - errorSocketCount: this.errorSocketCount, - timeoutSocketCount: this.timeoutSocketCount, - requestCount: this.requestCount, - freeSockets: inspect2(this.freeSockets), - sockets: inspect2(this.sockets), - requests: inspect2(this.requests) - }; + /** + * Delete an evaluation. + */ + delete(evalID, options) { + return this._client.delete((0, path_1.path)`/evals/${evalID}`, { ...options, __security: { bearerAuth: true } }); } }; - function getSocketTimeout(socket) { - return socket.timeout || socket._idleTimeout; - } - function installListeners(agent, socket, options) { - debug2("%s create, timeout %sms", socket[SOCKET_NAME], getSocketTimeout(socket)); - function onFree() { - if (!socket._httpMessage && socket[SOCKET_REQUEST_COUNT] === 1) return; - socket[SOCKET_REQUEST_FINISHED_COUNT]++; - agent.requestCount++; - debug2( - "%s(requests: %s, finished: %s) free", - socket[SOCKET_NAME], - socket[SOCKET_REQUEST_COUNT], - socket[SOCKET_REQUEST_FINISHED_COUNT] - ); - const name = agent.getName(options); - if (socket.writable && agent.requests[name] && agent.requests[name].length) { - socket[SOCKET_REQUEST_COUNT]++; - debug2( - "%s(requests: %s, finished: %s) will be reuse on agent free event", - socket[SOCKET_NAME], - socket[SOCKET_REQUEST_COUNT], - socket[SOCKET_REQUEST_FINISHED_COUNT] - ); - } + exports2.Evals = Evals; + Evals.Runs = runs_1.Runs; + } +}); + +// node_modules/openai/resources/files.js +var require_files2 = __commonJS({ + "node_modules/openai/resources/files.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Files = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var headers_1 = require_headers4(); + var sleep_1 = require_sleep(); + var error_1 = require_error3(); + var uploads_1 = require_uploads(); + var path_1 = require_path2(); + var Files = class extends resource_1.APIResource { + /** + * Upload a file that can be used across various endpoints. Individual files can be + * up to 512 MB, and each project can store up to 2.5 TB of files in total. There + * is no organization-wide storage limit. Uploads to this endpoint are rate-limited + * to 1,000 requests per minute per authenticated user. + * + * - The Assistants API supports files up to 2 million tokens and of specific file + * types. See the + * [Assistants Tools guide](https://platform.openai.com/docs/assistants/tools) + * for details. + * - The Fine-tuning API only supports `.jsonl` files. The input also has certain + * required formats for fine-tuning + * [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input) + * or + * [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) + * models. + * - The Batch API only supports `.jsonl` files up to 200 MB in size. The input + * also has a specific required + * [format](https://platform.openai.com/docs/api-reference/batch/request-input). + * - For Retrieval or `file_search` ingestion, upload files here first. If you need + * to attach multiple uploaded files to the same vector store, use + * [`/vector_stores/{vector_store_id}/file_batches`](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch) + * instead of attaching them one by one. Vector store attachment has separate + * limits from file upload, including 2,000 attached files per minute per + * organization. + * + * Please [contact us](https://help.openai.com/) if you need to increase these + * storage limits. + */ + create(body2, options) { + return this._client.post("/files", (0, uploads_1.multipartFormRequestOptions)({ body: body2, ...options, __security: { bearerAuth: true } }, this._client)); } - socket.on("free", onFree); - function onClose(isError3) { - debug2( - "%s(requests: %s, finished: %s) close, isError: %s", - socket[SOCKET_NAME], - socket[SOCKET_REQUEST_COUNT], - socket[SOCKET_REQUEST_FINISHED_COUNT], - isError3 - ); - agent.closeSocketCount++; + /** + * Returns information about a specific file. + */ + retrieve(fileID, options) { + return this._client.get((0, path_1.path)`/files/${fileID}`, { ...options, __security: { bearerAuth: true } }); } - socket.on("close", onClose); - function onTimeout() { - const listenerCount = socket.listeners("timeout").length; - const timeout2 = getSocketTimeout(socket); - const req = socket._httpMessage; - const reqTimeoutListenerCount = req && req.listeners("timeout").length || 0; - debug2( - "%s(requests: %s, finished: %s) timeout after %sms, listeners %s, defaultTimeoutListenerCount %s, hasHttpRequest %s, HttpRequest timeoutListenerCount %s", - socket[SOCKET_NAME], - socket[SOCKET_REQUEST_COUNT], - socket[SOCKET_REQUEST_FINISHED_COUNT], - timeout2, - listenerCount, - defaultTimeoutListenerCount, - !!req, - reqTimeoutListenerCount - ); - if (debug2.enabled) { - debug2("timeout listeners: %s", socket.listeners("timeout").map((f6) => f6.name).join(", ")); - } - agent.timeoutSocketCount++; - const name = agent.getName(options); - if (agent.freeSockets[name] && agent.freeSockets[name].indexOf(socket) !== -1) { - socket.destroy(); - agent.removeSocket(socket, options); - debug2("%s is free, destroy quietly", socket[SOCKET_NAME]); - } else { - if (reqTimeoutListenerCount === 0) { - const error2 = new Error("Socket timeout"); - error2.code = "ERR_SOCKET_TIMEOUT"; - error2.timeout = timeout2; - socket.destroy(error2); - agent.removeSocket(socket, options); - debug2("%s destroy with timeout error", socket[SOCKET_NAME]); - } - } + /** + * Returns a list of files. + */ + list(query = {}, options) { + return this._client.getAPIList("/files", pagination_1.CursorPage, { + query, + ...options, + __security: { bearerAuth: true } + }); } - socket.on("timeout", onTimeout); - function onError(err) { - const listenerCount = socket.listeners("error").length; - debug2( - "%s(requests: %s, finished: %s) error: %s, listenerCount: %s", - socket[SOCKET_NAME], - socket[SOCKET_REQUEST_COUNT], - socket[SOCKET_REQUEST_FINISHED_COUNT], - err, - listenerCount - ); - agent.errorSocketCount++; - if (listenerCount === 1) { - debug2("%s emit uncaught error event", socket[SOCKET_NAME]); - socket.removeListener("error", onError); - socket.emit("error", err); - } + /** + * Delete a file and remove it from all vector stores. + */ + delete(fileID, options) { + return this._client.delete((0, path_1.path)`/files/${fileID}`, { ...options, __security: { bearerAuth: true } }); } - socket.on("error", onError); - function onRemove() { - debug2( - "%s(requests: %s, finished: %s) agentRemove", - socket[SOCKET_NAME], - socket[SOCKET_REQUEST_COUNT], - socket[SOCKET_REQUEST_FINISHED_COUNT] - ); - socket.removeListener("close", onClose); - socket.removeListener("error", onError); - socket.removeListener("free", onFree); - socket.removeListener("timeout", onTimeout); - socket.removeListener("agentRemove", onRemove); + /** + * Returns the contents of the specified file. + */ + content(fileID, options) { + return this._client.get((0, path_1.path)`/files/${fileID}/content`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ Accept: "application/binary" }, options?.headers]), + __security: { bearerAuth: true }, + __binaryResponse: true + }); } - socket.on("agentRemove", onRemove); - } - module.exports = Agent3; - function inspect2(obj) { - const res = {}; - for (const key in obj) { - res[key] = obj[key].length; + /** + * Waits for the given file to be processed, default timeout is 30 mins. + */ + async waitForProcessing(id, { pollInterval = 5e3, maxWait = 30 * 60 * 1e3 } = {}) { + const TERMINAL_STATES = /* @__PURE__ */ new Set(["processed", "error", "deleted"]); + const start = Date.now(); + let file = await this.retrieve(id); + while (!file.status || !TERMINAL_STATES.has(file.status)) { + await (0, sleep_1.sleep)(pollInterval); + file = await this.retrieve(id); + if (Date.now() - start > maxWait) { + throw new error_1.APIConnectionTimeoutError({ + message: `Giving up on waiting for file ${id} to finish processing after ${maxWait} milliseconds.` + }); + } + } + return file; } - return res; - } + }; + exports2.Files = Files; } }); -// node_modules/agentkeepalive/lib/https_agent.js -var require_https_agent = __commonJS({ - "node_modules/agentkeepalive/lib/https_agent.js"(exports2, module) { +// node_modules/openai/resources/fine-tuning/methods.js +var require_methods2 = __commonJS({ + "node_modules/openai/resources/fine-tuning/methods.js"(exports2) { "use strict"; - var OriginalHttpsAgent = __require("https").Agent; - var HttpAgent = require_agent2(); - var { - INIT_SOCKET, - CREATE_HTTPS_CONNECTION - } = require_constants10(); - var HttpsAgent = class extends HttpAgent { - constructor(options) { - super(options); - this.defaultPort = 443; - this.protocol = "https:"; - this.maxCachedSessions = this.options.maxCachedSessions; - if (this.maxCachedSessions === void 0) { - this.maxCachedSessions = 100; - } - this._sessionCache = { - map: {}, - list: [] - }; - } - createConnection(options, oncreate) { - const socket = this[CREATE_HTTPS_CONNECTION](options, oncreate); - this[INIT_SOCKET](socket, options); - return socket; - } + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Methods = void 0; + var resource_1 = require_resource(); + var Methods = class extends resource_1.APIResource { }; - HttpsAgent.prototype[CREATE_HTTPS_CONNECTION] = OriginalHttpsAgent.prototype.createConnection; - [ - "getName", - "_getSession", - "_cacheSession", - // https://github.com/nodejs/node/pull/4982 - "_evictSession" - ].forEach(function(method) { - if (typeof OriginalHttpsAgent.prototype[method] === "function") { - HttpsAgent.prototype[method] = OriginalHttpsAgent.prototype[method]; - } - }); - module.exports = HttpsAgent; + exports2.Methods = Methods; } }); -// node_modules/agentkeepalive/index.js -var require_agentkeepalive = __commonJS({ - "node_modules/agentkeepalive/index.js"(exports2, module) { +// node_modules/openai/resources/fine-tuning/alpha/graders.js +var require_graders = __commonJS({ + "node_modules/openai/resources/fine-tuning/alpha/graders.js"(exports2) { "use strict"; - var HttpAgent = require_agent2(); - module.exports = HttpAgent; - module.exports.HttpAgent = HttpAgent; - module.exports.HttpsAgent = require_https_agent(); - module.exports.constants = require_constants10(); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Graders = void 0; + var resource_1 = require_resource(); + var Graders = class extends resource_1.APIResource { + /** + * Run a grader. + * + * @example + * ```ts + * const response = await client.fineTuning.alpha.graders.run({ + * grader: { + * input: 'input', + * name: 'name', + * operation: 'eq', + * reference: 'reference', + * type: 'string_check', + * }, + * model_sample: 'model_sample', + * }); + * ``` + */ + run(body2, options) { + return this._client.post("/fine_tuning/alpha/graders/run", { + body: body2, + ...options, + __security: { bearerAuth: true } + }); + } + /** + * Validate a grader. + * + * @example + * ```ts + * const response = + * await client.fineTuning.alpha.graders.validate({ + * grader: { + * input: 'input', + * name: 'name', + * operation: 'eq', + * reference: 'reference', + * type: 'string_check', + * }, + * }); + * ``` + */ + validate(body2, options) { + return this._client.post("/fine_tuning/alpha/graders/validate", { + body: body2, + ...options, + __security: { bearerAuth: true } + }); + } + }; + exports2.Graders = Graders; } }); -// node_modules/form-data-encoder/lib/cjs/util/createBoundary.js -var require_createBoundary = __commonJS({ - "node_modules/form-data-encoder/lib/cjs/util/createBoundary.js"(exports2) { +// node_modules/openai/resources/fine-tuning/alpha/alpha.js +var require_alpha = __commonJS({ + "node_modules/openai/resources/fine-tuning/alpha/alpha.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - var alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"; - function createBoundary() { - let size = 16; - let res = ""; - while (size--) { - res += alphabet[Math.random() * alphabet.length << 0]; + exports2.Alpha = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var GradersAPI = tslib_1.__importStar(require_graders()); + var graders_1 = require_graders(); + var Alpha = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.graders = new GradersAPI.Graders(this._client); } - return res; - } - exports2.default = createBoundary; + }; + exports2.Alpha = Alpha; + Alpha.Graders = graders_1.Graders; } }); -// node_modules/form-data-encoder/lib/cjs/util/isPlainObject.js -var require_isPlainObject2 = __commonJS({ - "node_modules/form-data-encoder/lib/cjs/util/isPlainObject.js"(exports2) { +// node_modules/openai/resources/fine-tuning/checkpoints/permissions.js +var require_permissions = __commonJS({ + "node_modules/openai/resources/fine-tuning/checkpoints/permissions.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - var getType = (value) => Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); - function isPlainObject3(value) { - if (getType(value) !== "object") { - return false; + exports2.Permissions = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Permissions = class extends resource_1.APIResource { + /** + * **NOTE:** Calling this endpoint requires an [admin API key](../admin-api-keys). + * + * This enables organization owners to share fine-tuned models with other projects + * in their organization. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const permissionCreateResponse of client.fineTuning.checkpoints.permissions.create( + * 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd', + * { project_ids: ['string'] }, + * )) { + * // ... + * } + * ``` + */ + create(fineTunedModelCheckpoint, body2, options) { + return this._client.getAPIList((0, path_1.path)`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, pagination_1.Page, { body: body2, method: "post", ...options, __security: { adminAPIKeyAuth: true } }); } - const pp = Object.getPrototypeOf(value); - if (pp === null || pp === void 0) { - return true; + /** + * **NOTE:** This endpoint requires an [admin API key](../admin-api-keys). + * + * Organization owners can use this endpoint to view all permissions for a + * fine-tuned model checkpoint. + * + * @deprecated Retrieve is deprecated. Please swap to the paginated list method instead. + */ + retrieve(fineTunedModelCheckpoint, query = {}, options) { + return this._client.get((0, path_1.path)`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, { + query, + ...options, + __security: { adminAPIKeyAuth: true } + }); } - const Ctor = pp.constructor && pp.constructor.toString(); - return Ctor === Object.toString(); - } - exports2.default = isPlainObject3; + /** + * **NOTE:** This endpoint requires an [admin API key](../admin-api-keys). + * + * Organization owners can use this endpoint to view all permissions for a + * fine-tuned model checkpoint. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const permissionListResponse of client.fineTuning.checkpoints.permissions.list( + * 'ft-AF1WoRqd3aJAHsqc9NY7iL8F', + * )) { + * // ... + * } + * ``` + */ + list(fineTunedModelCheckpoint, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, pagination_1.ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } }); + } + /** + * **NOTE:** This endpoint requires an [admin API key](../admin-api-keys). + * + * Organization owners can use this endpoint to delete a permission for a + * fine-tuned model checkpoint. + * + * @example + * ```ts + * const permission = + * await client.fineTuning.checkpoints.permissions.delete( + * 'cp_zc4Q7MP6XxulcVzj4MZdwsAB', + * { + * fine_tuned_model_checkpoint: + * 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd', + * }, + * ); + * ``` + */ + delete(permissionID, params, options) { + const { fine_tuned_model_checkpoint } = params; + return this._client.delete((0, path_1.path)`/fine_tuning/checkpoints/${fine_tuned_model_checkpoint}/permissions/${permissionID}`, { ...options, __security: { adminAPIKeyAuth: true } }); + } + }; + exports2.Permissions = Permissions; } }); -// node_modules/form-data-encoder/lib/cjs/util/normalizeValue.js -var require_normalizeValue = __commonJS({ - "node_modules/form-data-encoder/lib/cjs/util/normalizeValue.js"(exports2) { +// node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.js +var require_checkpoints = __commonJS({ + "node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - var normalizeValue = (value) => String(value).replace(/\r|\n/g, (match3, i6, str) => { - if (match3 === "\r" && str[i6 + 1] !== "\n" || match3 === "\n" && str[i6 - 1] !== "\r") { - return "\r\n"; + exports2.Checkpoints = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var PermissionsAPI = tslib_1.__importStar(require_permissions()); + var permissions_1 = require_permissions(); + var Checkpoints = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.permissions = new PermissionsAPI.Permissions(this._client); } - return match3; - }); - exports2.default = normalizeValue; + }; + exports2.Checkpoints = Checkpoints; + Checkpoints.Permissions = permissions_1.Permissions; } }); -// node_modules/form-data-encoder/lib/cjs/util/escapeName.js -var require_escapeName = __commonJS({ - "node_modules/form-data-encoder/lib/cjs/util/escapeName.js"(exports2) { +// node_modules/openai/resources/fine-tuning/jobs/checkpoints.js +var require_checkpoints2 = __commonJS({ + "node_modules/openai/resources/fine-tuning/jobs/checkpoints.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - var escapeName = (name) => String(name).replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/"/g, "%22"); - exports2.default = escapeName; + exports2.Checkpoints = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Checkpoints = class extends resource_1.APIResource { + /** + * List checkpoints for a fine-tuning job. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const fineTuningJobCheckpoint of client.fineTuning.jobs.checkpoints.list( + * 'ft-AF1WoRqd3aJAHsqc9NY7iL8F', + * )) { + * // ... + * } + * ``` + */ + list(fineTuningJobID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, pagination_1.CursorPage, { query, ...options, __security: { bearerAuth: true } }); + } + }; + exports2.Checkpoints = Checkpoints; } }); -// node_modules/form-data-encoder/lib/cjs/util/isFunction.js -var require_isFunction3 = __commonJS({ - "node_modules/form-data-encoder/lib/cjs/util/isFunction.js"(exports2) { +// node_modules/openai/resources/fine-tuning/jobs/jobs.js +var require_jobs = __commonJS({ + "node_modules/openai/resources/fine-tuning/jobs/jobs.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - var isFunction2 = (value) => typeof value === "function"; - exports2.default = isFunction2; + exports2.Jobs = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var CheckpointsAPI = tslib_1.__importStar(require_checkpoints2()); + var checkpoints_1 = require_checkpoints2(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Jobs = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.checkpoints = new CheckpointsAPI.Checkpoints(this._client); + } + /** + * Creates a fine-tuning job which begins the process of creating a new model from + * a given dataset. + * + * Response includes details of the enqueued job including job status and the name + * of the fine-tuned models once complete. + * + * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/model-optimization) + * + * @example + * ```ts + * const fineTuningJob = await client.fineTuning.jobs.create({ + * model: 'gpt-4o-mini', + * training_file: 'file-abc123', + * }); + * ``` + */ + create(body2, options) { + return this._client.post("/fine_tuning/jobs", { body: body2, ...options, __security: { bearerAuth: true } }); + } + /** + * Get info about a fine-tuning job. + * + * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/model-optimization) + * + * @example + * ```ts + * const fineTuningJob = await client.fineTuning.jobs.retrieve( + * 'ft-AF1WoRqd3aJAHsqc9NY7iL8F', + * ); + * ``` + */ + retrieve(fineTuningJobID, options) { + return this._client.get((0, path_1.path)`/fine_tuning/jobs/${fineTuningJobID}`, { + ...options, + __security: { bearerAuth: true } + }); + } + /** + * List your organization's fine-tuning jobs + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const fineTuningJob of client.fineTuning.jobs.list()) { + * // ... + * } + * ``` + */ + list(query = {}, options) { + return this._client.getAPIList("/fine_tuning/jobs", pagination_1.CursorPage, { + query, + ...options, + __security: { bearerAuth: true } + }); + } + /** + * Immediately cancel a fine-tune job. + * + * @example + * ```ts + * const fineTuningJob = await client.fineTuning.jobs.cancel( + * 'ft-AF1WoRqd3aJAHsqc9NY7iL8F', + * ); + * ``` + */ + cancel(fineTuningJobID, options) { + return this._client.post((0, path_1.path)`/fine_tuning/jobs/${fineTuningJobID}/cancel`, { + ...options, + __security: { bearerAuth: true } + }); + } + /** + * Get status updates for a fine-tuning job. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const fineTuningJobEvent of client.fineTuning.jobs.listEvents( + * 'ft-AF1WoRqd3aJAHsqc9NY7iL8F', + * )) { + * // ... + * } + * ``` + */ + listEvents(fineTuningJobID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/fine_tuning/jobs/${fineTuningJobID}/events`, pagination_1.CursorPage, { query, ...options, __security: { bearerAuth: true } }); + } + /** + * Pause a fine-tune job. + * + * @example + * ```ts + * const fineTuningJob = await client.fineTuning.jobs.pause( + * 'ft-AF1WoRqd3aJAHsqc9NY7iL8F', + * ); + * ``` + */ + pause(fineTuningJobID, options) { + return this._client.post((0, path_1.path)`/fine_tuning/jobs/${fineTuningJobID}/pause`, { + ...options, + __security: { bearerAuth: true } + }); + } + /** + * Resume a fine-tune job. + * + * @example + * ```ts + * const fineTuningJob = await client.fineTuning.jobs.resume( + * 'ft-AF1WoRqd3aJAHsqc9NY7iL8F', + * ); + * ``` + */ + resume(fineTuningJobID, options) { + return this._client.post((0, path_1.path)`/fine_tuning/jobs/${fineTuningJobID}/resume`, { + ...options, + __security: { bearerAuth: true } + }); + } + }; + exports2.Jobs = Jobs; + Jobs.Checkpoints = checkpoints_1.Checkpoints; } }); -// node_modules/form-data-encoder/lib/cjs/util/isFileLike.js -var require_isFileLike = __commonJS({ - "node_modules/form-data-encoder/lib/cjs/util/isFileLike.js"(exports2) { +// node_modules/openai/resources/fine-tuning/fine-tuning.js +var require_fine_tuning = __commonJS({ + "node_modules/openai/resources/fine-tuning/fine-tuning.js"(exports2) { "use strict"; - var __importDefault = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isFileLike = void 0; - var isFunction_1 = __importDefault(require_isFunction3()); - var isFileLike = (value) => Boolean(value && typeof value === "object" && (0, isFunction_1.default)(value.constructor) && value[Symbol.toStringTag] === "File" && (0, isFunction_1.default)(value.stream) && value.name != null && value.size != null && value.lastModified != null); - exports2.isFileLike = isFileLike; + exports2.FineTuning = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var MethodsAPI = tslib_1.__importStar(require_methods2()); + var methods_1 = require_methods2(); + var AlphaAPI = tslib_1.__importStar(require_alpha()); + var alpha_1 = require_alpha(); + var CheckpointsAPI = tslib_1.__importStar(require_checkpoints()); + var checkpoints_1 = require_checkpoints(); + var JobsAPI = tslib_1.__importStar(require_jobs()); + var jobs_1 = require_jobs(); + var FineTuning = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.methods = new MethodsAPI.Methods(this._client); + this.jobs = new JobsAPI.Jobs(this._client); + this.checkpoints = new CheckpointsAPI.Checkpoints(this._client); + this.alpha = new AlphaAPI.Alpha(this._client); + } + }; + exports2.FineTuning = FineTuning; + FineTuning.Methods = methods_1.Methods; + FineTuning.Jobs = jobs_1.Jobs; + FineTuning.Checkpoints = checkpoints_1.Checkpoints; + FineTuning.Alpha = alpha_1.Alpha; } }); -// node_modules/form-data-encoder/lib/cjs/util/isFormData.js -var require_isFormData = __commonJS({ - "node_modules/form-data-encoder/lib/cjs/util/isFormData.js"(exports2) { +// node_modules/openai/resources/graders/grader-models.js +var require_grader_models = __commonJS({ + "node_modules/openai/resources/graders/grader-models.js"(exports2) { "use strict"; - var __importDefault = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isFormDataLike = exports2.isFormData = void 0; - var isFunction_1 = __importDefault(require_isFunction3()); - var isFormData = (value) => Boolean(value && (0, isFunction_1.default)(value.constructor) && value[Symbol.toStringTag] === "FormData" && (0, isFunction_1.default)(value.append) && (0, isFunction_1.default)(value.getAll) && (0, isFunction_1.default)(value.entries) && (0, isFunction_1.default)(value[Symbol.iterator])); - exports2.isFormData = isFormData; - exports2.isFormDataLike = exports2.isFormData; + exports2.GraderModels = void 0; + var resource_1 = require_resource(); + var GraderModels = class extends resource_1.APIResource { + }; + exports2.GraderModels = GraderModels; } }); -// node_modules/form-data-encoder/lib/cjs/FormDataEncoder.js -var require_FormDataEncoder = __commonJS({ - "node_modules/form-data-encoder/lib/cjs/FormDataEncoder.js"(exports2) { +// node_modules/openai/resources/graders/graders.js +var require_graders2 = __commonJS({ + "node_modules/openai/resources/graders/graders.js"(exports2) { "use strict"; - var __classPrivateFieldSet = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; - }; - var __classPrivateFieldGet = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); - }; - var __importDefault = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - var _FormDataEncoder_instances; - var _FormDataEncoder_CRLF; - var _FormDataEncoder_CRLF_BYTES; - var _FormDataEncoder_CRLF_BYTES_LENGTH; - var _FormDataEncoder_DASHES; - var _FormDataEncoder_encoder; - var _FormDataEncoder_footer; - var _FormDataEncoder_form; - var _FormDataEncoder_options; - var _FormDataEncoder_getFieldHeader; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Encoder = exports2.FormDataEncoder = void 0; - var createBoundary_1 = __importDefault(require_createBoundary()); - var isPlainObject_1 = __importDefault(require_isPlainObject2()); - var normalizeValue_1 = __importDefault(require_normalizeValue()); - var escapeName_1 = __importDefault(require_escapeName()); - var isFileLike_1 = require_isFileLike(); - var isFormData_1 = require_isFormData(); - var defaultOptions4 = { - enableAdditionalHeaders: false - }; - var FormDataEncoder = class { - constructor(form, boundaryOrOptions, options) { - _FormDataEncoder_instances.add(this); - _FormDataEncoder_CRLF.set(this, "\r\n"); - _FormDataEncoder_CRLF_BYTES.set(this, void 0); - _FormDataEncoder_CRLF_BYTES_LENGTH.set(this, void 0); - _FormDataEncoder_DASHES.set(this, "-".repeat(2)); - _FormDataEncoder_encoder.set(this, new TextEncoder()); - _FormDataEncoder_footer.set(this, void 0); - _FormDataEncoder_form.set(this, void 0); - _FormDataEncoder_options.set(this, void 0); - if (!(0, isFormData_1.isFormData)(form)) { - throw new TypeError("Expected first argument to be a FormData instance."); - } - let boundary; - if ((0, isPlainObject_1.default)(boundaryOrOptions)) { - options = boundaryOrOptions; - } else { - boundary = boundaryOrOptions; - } - if (!boundary) { - boundary = (0, createBoundary_1.default)(); - } - if (typeof boundary !== "string") { - throw new TypeError("Expected boundary argument to be a string."); - } - if (options && !(0, isPlainObject_1.default)(options)) { - throw new TypeError("Expected options argument to be an object."); - } - __classPrivateFieldSet(this, _FormDataEncoder_form, form, "f"); - __classPrivateFieldSet(this, _FormDataEncoder_options, { ...defaultOptions4, ...options }, "f"); - __classPrivateFieldSet(this, _FormDataEncoder_CRLF_BYTES, __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode(__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f")), "f"); - __classPrivateFieldSet(this, _FormDataEncoder_CRLF_BYTES_LENGTH, __classPrivateFieldGet(this, _FormDataEncoder_CRLF_BYTES, "f").byteLength, "f"); - this.boundary = `form-data-boundary-${boundary}`; - this.contentType = `multipart/form-data; boundary=${this.boundary}`; - __classPrivateFieldSet(this, _FormDataEncoder_footer, __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode(`${__classPrivateFieldGet(this, _FormDataEncoder_DASHES, "f")}${this.boundary}${__classPrivateFieldGet(this, _FormDataEncoder_DASHES, "f")}${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f").repeat(2)}`), "f"); - this.contentLength = String(this.getContentLength()); - this.headers = Object.freeze({ - "Content-Type": this.contentType, - "Content-Length": this.contentLength - }); - Object.defineProperties(this, { - boundary: { writable: false, configurable: false }, - contentType: { writable: false, configurable: false }, - contentLength: { writable: false, configurable: false }, - headers: { writable: false, configurable: false } - }); - } - getContentLength() { - let length = 0; - for (const [name, raw] of __classPrivateFieldGet(this, _FormDataEncoder_form, "f")) { - const value = (0, isFileLike_1.isFileLike)(raw) ? raw : __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode((0, normalizeValue_1.default)(raw)); - length += __classPrivateFieldGet(this, _FormDataEncoder_instances, "m", _FormDataEncoder_getFieldHeader).call(this, name, value).byteLength; - length += (0, isFileLike_1.isFileLike)(value) ? value.size : value.byteLength; - length += __classPrivateFieldGet(this, _FormDataEncoder_CRLF_BYTES_LENGTH, "f"); - } - return length + __classPrivateFieldGet(this, _FormDataEncoder_footer, "f").byteLength; - } - *values() { - for (const [name, raw] of __classPrivateFieldGet(this, _FormDataEncoder_form, "f").entries()) { - const value = (0, isFileLike_1.isFileLike)(raw) ? raw : __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode((0, normalizeValue_1.default)(raw)); - yield __classPrivateFieldGet(this, _FormDataEncoder_instances, "m", _FormDataEncoder_getFieldHeader).call(this, name, value); - yield value; - yield __classPrivateFieldGet(this, _FormDataEncoder_CRLF_BYTES, "f"); - } - yield __classPrivateFieldGet(this, _FormDataEncoder_footer, "f"); - } - async *encode() { - for (const part of this.values()) { - if ((0, isFileLike_1.isFileLike)(part)) { - yield* part.stream(); - } else { - yield part; - } - } - } - [(_FormDataEncoder_CRLF = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_CRLF_BYTES = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_CRLF_BYTES_LENGTH = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_DASHES = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_encoder = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_footer = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_form = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_options = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_instances = /* @__PURE__ */ new WeakSet(), _FormDataEncoder_getFieldHeader = function _FormDataEncoder_getFieldHeader2(name, value) { - let header = ""; - header += `${__classPrivateFieldGet(this, _FormDataEncoder_DASHES, "f")}${this.boundary}${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f")}`; - header += `Content-Disposition: form-data; name="${(0, escapeName_1.default)(name)}"`; - if ((0, isFileLike_1.isFileLike)(value)) { - header += `; filename="${(0, escapeName_1.default)(value.name)}"${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f")}`; - header += `Content-Type: ${value.type || "application/octet-stream"}`; - } - if (__classPrivateFieldGet(this, _FormDataEncoder_options, "f").enableAdditionalHeaders === true) { - header += `${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f")}Content-Length: ${(0, isFileLike_1.isFileLike)(value) ? value.size : value.byteLength}`; - } - return __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode(`${header}${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f").repeat(2)}`); - }, Symbol.iterator)]() { - return this.values(); - } - [Symbol.asyncIterator]() { - return this.encode(); + exports2.Graders = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var GraderModelsAPI = tslib_1.__importStar(require_grader_models()); + var grader_models_1 = require_grader_models(); + var Graders = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.graderModels = new GraderModelsAPI.GraderModels(this._client); } }; - exports2.FormDataEncoder = FormDataEncoder; - exports2.Encoder = FormDataEncoder; + exports2.Graders = Graders; + Graders.GraderModels = grader_models_1.GraderModels; } }); -// node_modules/form-data-encoder/lib/cjs/FileLike.js -var require_FileLike = __commonJS({ - "node_modules/form-data-encoder/lib/cjs/FileLike.js"(exports2) { +// node_modules/openai/resources/images.js +var require_images = __commonJS({ + "node_modules/openai/resources/images.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Images = void 0; + var resource_1 = require_resource(); + var uploads_1 = require_uploads(); + var Images = class extends resource_1.APIResource { + /** + * Creates a variation of a given image. This endpoint only supports `dall-e-2`. + * + * @example + * ```ts + * const imagesResponse = await client.images.createVariation({ + * image: fs.createReadStream('otter.png'), + * }); + * ``` + */ + createVariation(body2, options) { + return this._client.post("/images/variations", (0, uploads_1.multipartFormRequestOptions)({ body: body2, ...options, __security: { bearerAuth: true } }, this._client)); + } + edit(body2, options) { + return this._client.post("/images/edits", (0, uploads_1.multipartFormRequestOptions)({ body: body2, ...options, stream: body2.stream ?? false, __security: { bearerAuth: true } }, this._client)); + } + generate(body2, options) { + return this._client.post("/images/generations", { + body: body2, + ...options, + stream: body2.stream ?? false, + __security: { bearerAuth: true } + }); + } + }; + exports2.Images = Images; } }); -// node_modules/form-data-encoder/lib/cjs/FormDataLike.js -var require_FormDataLike = __commonJS({ - "node_modules/form-data-encoder/lib/cjs/FormDataLike.js"(exports2) { +// node_modules/openai/resources/models.js +var require_models = __commonJS({ + "node_modules/openai/resources/models.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Models = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var Models = class extends resource_1.APIResource { + /** + * Retrieves a model instance, providing basic information about the model such as + * the owner and permissioning. + */ + retrieve(model, options) { + return this._client.get((0, path_1.path)`/models/${model}`, { ...options, __security: { bearerAuth: true } }); + } + /** + * Lists the currently available models, and provides basic information about each + * one such as the owner and availability. + */ + list(options) { + return this._client.getAPIList("/models", pagination_1.Page, { ...options, __security: { bearerAuth: true } }); + } + /** + * Delete a fine-tuned model. You must have the Owner role in your organization to + * delete a model. + */ + delete(model, options) { + return this._client.delete((0, path_1.path)`/models/${model}`, { ...options, __security: { bearerAuth: true } }); + } + }; + exports2.Models = Models; } }); -// node_modules/form-data-encoder/lib/cjs/index.js -var require_cjs2 = __commonJS({ - "node_modules/form-data-encoder/lib/cjs/index.js"(exports2) { +// node_modules/openai/resources/moderations.js +var require_moderations = __commonJS({ + "node_modules/openai/resources/moderations.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - Object.defineProperty(o6, k22, { enumerable: true, get: function() { - return m6[k7]; - } }); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __exportStar = exports2 && exports2.__exportStar || function(m6, exports3) { - for (var p6 in m6) if (p6 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p6)) __createBinding(exports3, m6, p6); - }; Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar(require_FormDataEncoder(), exports2); - __exportStar(require_FileLike(), exports2); - __exportStar(require_FormDataLike(), exports2); - __exportStar(require_isFileLike(), exports2); - __exportStar(require_isFormData(), exports2); + exports2.Moderations = void 0; + var resource_1 = require_resource(); + var Moderations = class extends resource_1.APIResource { + /** + * Classifies if text and/or image inputs are potentially harmful. Learn more in + * the [moderation guide](https://platform.openai.com/docs/guides/moderation). + */ + create(body2, options) { + return this._client.post("/moderations", { body: body2, ...options, __security: { bearerAuth: true } }); + } + }; + exports2.Moderations = Moderations; } }); -// node_modules/openai/_shims/MultipartBody.js -var require_MultipartBody = __commonJS({ - "node_modules/openai/_shims/MultipartBody.js"(exports2) { +// node_modules/openai/resources/realtime/calls.js +var require_calls = __commonJS({ + "node_modules/openai/resources/realtime/calls.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MultipartBody = void 0; - var MultipartBody = class { - constructor(body2) { - this.body = body2; + exports2.Calls = void 0; + var resource_1 = require_resource(); + var headers_1 = require_headers4(); + var path_1 = require_path2(); + var Calls = class extends resource_1.APIResource { + /** + * Accept an incoming SIP call and configure the realtime session that will handle + * it. + * + * @example + * ```ts + * await client.realtime.calls.accept('call_id', { + * type: 'realtime', + * }); + * ``` + */ + accept(callID, body2, options) { + return this._client.post((0, path_1.path)`/realtime/calls/${callID}/accept`, { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ Accept: "*/*" }, options?.headers]), + __security: { bearerAuth: true } + }); } - get [Symbol.toStringTag]() { - return "MultipartBody"; + /** + * End an active Realtime API call, whether it was initiated over SIP or WebRTC. + * + * @example + * ```ts + * await client.realtime.calls.hangup('call_id'); + * ``` + */ + hangup(callID, options) { + return this._client.post((0, path_1.path)`/realtime/calls/${callID}/hangup`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ Accept: "*/*" }, options?.headers]), + __security: { bearerAuth: true } + }); + } + /** + * Transfer an active SIP call to a new destination using the SIP REFER verb. + * + * @example + * ```ts + * await client.realtime.calls.refer('call_id', { + * target_uri: 'tel:+14155550123', + * }); + * ``` + */ + refer(callID, body2, options) { + return this._client.post((0, path_1.path)`/realtime/calls/${callID}/refer`, { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ Accept: "*/*" }, options?.headers]), + __security: { bearerAuth: true } + }); + } + /** + * Decline an incoming SIP call by returning a SIP status code to the caller. + * + * @example + * ```ts + * await client.realtime.calls.reject('call_id'); + * ``` + */ + reject(callID, body2 = {}, options) { + return this._client.post((0, path_1.path)`/realtime/calls/${callID}/reject`, { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ Accept: "*/*" }, options?.headers]), + __security: { bearerAuth: true } + }); } }; - exports2.MultipartBody = MultipartBody; + exports2.Calls = Calls; } }); -// node_modules/node-domexception/index.js -var require_node_domexception = __commonJS({ - "node_modules/node-domexception/index.js"(exports2, module) { +// node_modules/openai/resources/realtime/client-secrets.js +var require_client_secrets = __commonJS({ + "node_modules/openai/resources/realtime/client-secrets.js"(exports2) { "use strict"; - if (!globalThis.DOMException) { - try { - const { MessageChannel } = __require("worker_threads"), port = new MessageChannel().port1, ab = new ArrayBuffer(); - port.postMessage(ab, [ab, ab]); - } catch (err) { - err.constructor.name === "DOMException" && (globalThis.DOMException = err.constructor); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ClientSecrets = void 0; + var resource_1 = require_resource(); + var ClientSecrets = class extends resource_1.APIResource { + /** + * Create a Realtime client secret with an associated session configuration. + * + * Client secrets are short-lived tokens that can be passed to a client app, such + * as a web frontend or mobile client, which grants access to the Realtime API + * without leaking your main API key. You can configure a custom TTL for each + * client secret. + * + * You can also attach session configuration options to the client secret, which + * will be applied to any sessions created using that client secret, but these can + * also be overridden by the client connection. + * + * [Learn more about authentication with client secrets over WebRTC](https://platform.openai.com/docs/guides/realtime-webrtc). + * + * Returns the created client secret and the effective session object. The client + * secret is a string that looks like `ek_1234`. + * + * @example + * ```ts + * const clientSecret = + * await client.realtime.clientSecrets.create(); + * ``` + */ + create(body2, options) { + return this._client.post("/realtime/client_secrets", { + body: body2, + ...options, + __security: { bearerAuth: true } + }); } - } - module.exports = globalThis.DOMException; + }; + exports2.ClientSecrets = ClientSecrets; } }); -// node_modules/formdata-node/lib/cjs/isPlainObject.js -var require_isPlainObject3 = __commonJS({ - "node_modules/formdata-node/lib/cjs/isPlainObject.js"(exports2) { +// node_modules/openai/resources/realtime/realtime.js +var require_realtime2 = __commonJS({ + "node_modules/openai/resources/realtime/realtime.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - var getType = (value) => Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); - function isPlainObject3(value) { - if (getType(value) !== "object") { - return false; - } - const pp = Object.getPrototypeOf(value); - if (pp === null || pp === void 0) { - return true; + exports2.Realtime = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var CallsAPI = tslib_1.__importStar(require_calls()); + var calls_1 = require_calls(); + var ClientSecretsAPI = tslib_1.__importStar(require_client_secrets()); + var client_secrets_1 = require_client_secrets(); + var Realtime = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.clientSecrets = new ClientSecretsAPI.ClientSecrets(this._client); + this.calls = new CallsAPI.Calls(this._client); } - const Ctor = pp.constructor && pp.constructor.toString(); - return Ctor === Object.toString(); - } - exports2.default = isPlainObject3; + }; + exports2.Realtime = Realtime; + Realtime.ClientSecrets = client_secrets_1.ClientSecrets; + Realtime.Calls = calls_1.Calls; } }); -// node_modules/formdata-node/lib/cjs/fileFromPath.js -var require_fileFromPath = __commonJS({ - "node_modules/formdata-node/lib/cjs/fileFromPath.js"(exports2) { +// node_modules/openai/lib/ResponsesParser.js +var require_ResponsesParser = __commonJS({ + "node_modules/openai/lib/ResponsesParser.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - Object.defineProperty(o6, k22, { enumerable: true, get: function() { - return m6[k7]; - } }); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __exportStar = exports2 && exports2.__exportStar || function(m6, exports3) { - for (var p6 in m6) if (p6 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p6)) __createBinding(exports3, m6, p6); - }; - var __classPrivateFieldSet = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; - }; - var __classPrivateFieldGet = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); - }; - var __importDefault = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - var _FileFromPath_path; - var _FileFromPath_start; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.fileFromPath = exports2.fileFromPathSync = void 0; - var fs_1 = __require("fs"); - var path_1 = __require("path"); - var node_domexception_1 = __importDefault(require_node_domexception()); - var File_1 = require_File(); - var isPlainObject_1 = __importDefault(require_isPlainObject3()); - __exportStar(require_isFile(), exports2); - var MESSAGE = "The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired."; - var FileFromPath = class _FileFromPath { - constructor(input) { - _FileFromPath_path.set(this, void 0); - _FileFromPath_start.set(this, void 0); - __classPrivateFieldSet(this, _FileFromPath_path, input.path, "f"); - __classPrivateFieldSet(this, _FileFromPath_start, input.start || 0, "f"); - this.name = (0, path_1.basename)(__classPrivateFieldGet(this, _FileFromPath_path, "f")); - this.size = input.size; - this.lastModified = input.lastModified; - } - slice(start, end) { - return new _FileFromPath({ - path: __classPrivateFieldGet(this, _FileFromPath_path, "f"), - lastModified: this.lastModified, - size: end - start, - start - }); + exports2.maybeParseResponse = maybeParseResponse; + exports2.parseResponse = parseResponse; + exports2.hasAutoParseableInput = hasAutoParseableInput; + exports2.makeParseableResponseTool = makeParseableResponseTool; + exports2.isAutoParsableTool = isAutoParsableTool; + exports2.shouldParseToolCall = shouldParseToolCall; + exports2.validateInputTools = validateInputTools; + exports2.addOutputText = addOutputText; + var error_1 = require_error3(); + var parser_1 = require_parser3(); + function maybeParseResponse(response, params) { + if (!params || !hasAutoParseableInput(params)) { + return { + ...response, + output_parsed: null, + output: response.output.map((item) => { + if (item.type === "function_call") { + return { + ...item, + parsed_arguments: null + }; + } + if (item.type === "message") { + return { + ...item, + content: item.content.map((content) => ({ + ...content, + parsed: null + })) + }; + } else { + return item; + } + }) + }; } - async *stream() { - const { mtimeMs } = await fs_1.promises.stat(__classPrivateFieldGet(this, _FileFromPath_path, "f")); - if (mtimeMs > this.lastModified) { - throw new node_domexception_1.default(MESSAGE, "NotReadableError"); + return parseResponse(response, params); + } + function parseResponse(response, params) { + const output = response.output.map((item) => { + if (item.type === "function_call") { + return { + ...item, + parsed_arguments: parseToolCall(params, item) + }; } - if (this.size) { - yield* (0, fs_1.createReadStream)(__classPrivateFieldGet(this, _FileFromPath_path, "f"), { - start: __classPrivateFieldGet(this, _FileFromPath_start, "f"), - end: __classPrivateFieldGet(this, _FileFromPath_start, "f") + this.size - 1 + if (item.type === "message") { + const content = item.content.map((content2) => { + if (content2.type === "output_text") { + return { + ...content2, + parsed: parseTextFormat(params, content2.text) + }; + } + return content2; }); + return { + ...item, + content + }; } + return item; + }); + const parsed = Object.assign({}, response, { output }); + if (!Object.getOwnPropertyDescriptor(response, "output_text")) { + addOutputText(parsed); } - get [(_FileFromPath_path = /* @__PURE__ */ new WeakMap(), _FileFromPath_start = /* @__PURE__ */ new WeakMap(), Symbol.toStringTag)]() { - return "File"; + Object.defineProperty(parsed, "output_parsed", { + enumerable: true, + get() { + for (const output2 of parsed.output) { + if (output2.type !== "message") { + continue; + } + for (const content of output2.content) { + if (content.type === "output_text" && content.parsed !== null) { + return content.parsed; + } + } + } + return null; + } + }); + return parsed; + } + function parseTextFormat(params, content) { + if (params.text?.format?.type !== "json_schema") { + return null; } - }; - function createFileFromPath(path10, { mtimeMs, size }, filenameOrOptions, options = {}) { - let filename; - if ((0, isPlainObject_1.default)(filenameOrOptions)) { - [options, filename] = [filenameOrOptions, void 0]; - } else { - filename = filenameOrOptions; + if ("$parseRaw" in params.text?.format) { + const text_format = params.text?.format; + return text_format.$parseRaw(content); } - const file = new FileFromPath({ path: path10, size, lastModified: mtimeMs }); - if (!filename) { - filename = file.name; + return JSON.parse(content); + } + function hasAutoParseableInput(params) { + if ((0, parser_1.isAutoParsableResponseFormat)(params.text?.format)) { + return true; } - return new File_1.File([file], filename, { - ...options, - lastModified: file.lastModified - }); + return false; } - function fileFromPathSync(path10, filenameOrOptions, options = {}) { - const stats = (0, fs_1.statSync)(path10); - return createFileFromPath(path10, stats, filenameOrOptions, options); + function makeParseableResponseTool(tool, { parser: parser3, callback }) { + const obj = { ...tool }; + Object.defineProperties(obj, { + $brand: { + value: "auto-parseable-tool", + enumerable: false + }, + $parseRaw: { + value: parser3, + enumerable: false + }, + $callback: { + value: callback, + enumerable: false + } + }); + return obj; } - exports2.fileFromPathSync = fileFromPathSync; - async function fileFromPath(path10, filenameOrOptions, options) { - const stats = await fs_1.promises.stat(path10); - return createFileFromPath(path10, stats, filenameOrOptions, options); + function isAutoParsableTool(tool) { + return tool?.["$brand"] === "auto-parseable-tool"; } - exports2.fileFromPath = fileFromPath; - } -}); - -// node_modules/openai/_shims/node-runtime.js -var require_node_runtime = __commonJS({ - "node_modules/openai/_shims/node-runtime.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; - } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); - } - __setModuleDefault(result, mod); - return result; - }; - var __importDefault = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRuntime = void 0; - var nf = __importStar((init_lib(), __toCommonJS(lib_exports2))); - var fd = __importStar(require_cjs()); - var agentkeepalive_1 = __importDefault(require_agentkeepalive()); - var abort_controller_1 = require_abort_controller(); - var node_fs_1 = __require("fs"); - var form_data_encoder_1 = require_cjs2(); - var node_stream_1 = __require("stream"); - var MultipartBody_1 = require_MultipartBody(); - var web_1 = __require("stream/web"); - var fileFromPathWarned = false; - async function fileFromPath(path10, ...args) { - const { fileFromPath: _fileFromPath } = await Promise.resolve().then(() => __importStar(require_fileFromPath())); - if (!fileFromPathWarned) { - console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path10)}) instead`); - fileFromPathWarned = true; - } - return await _fileFromPath(path10, ...args); + function getInputToolByName(input_tools, name) { + return input_tools.find((tool) => tool.type === "function" && tool.name === name); } - var defaultHttpAgent = new agentkeepalive_1.default({ keepAlive: true, timeout: 5 * 60 * 1e3 }); - var defaultHttpsAgent = new agentkeepalive_1.default.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1e3 }); - async function getMultipartRequestOptions(form, opts) { - const encoder = new form_data_encoder_1.FormDataEncoder(form); - const readable = node_stream_1.Readable.from(encoder); - const body2 = new MultipartBody_1.MultipartBody(readable); - const headers = { - ...opts.headers, - ...encoder.headers, - "Content-Length": encoder.contentLength + function parseToolCall(params, toolCall) { + const inputTool = getInputToolByName(params.tools ?? [], toolCall.name); + return { + ...toolCall, + ...toolCall, + parsed_arguments: isAutoParsableTool(inputTool) ? inputTool.$parseRaw(toolCall.arguments) : inputTool?.strict ? JSON.parse(toolCall.arguments) : null }; - return { ...opts, body: body2, headers }; } - function getRuntime() { - if (typeof AbortController === "undefined") { - globalThis.AbortController = abort_controller_1.AbortController; + function shouldParseToolCall(params, toolCall) { + if (!params) { + return false; } - return { - kind: "node", - fetch: nf.default, - Request: nf.Request, - Response: nf.Response, - Headers: nf.Headers, - FormData: fd.FormData, - Blob: fd.Blob, - File: fd.File, - ReadableStream: web_1.ReadableStream, - getMultipartRequestOptions, - getDefaultAgent: (url2) => url2.startsWith("https") ? defaultHttpsAgent : defaultHttpAgent, - fileFromPath, - isFsReadStream: (value) => value instanceof node_fs_1.ReadStream - }; + const inputTool = getInputToolByName(params.tools ?? [], toolCall.name); + return isAutoParsableTool(inputTool) || inputTool?.strict || false; } - exports2.getRuntime = getRuntime; - } -}); - -// node_modules/openai/_shims/auto/runtime-node.js -var require_runtime_node = __commonJS({ - "node_modules/openai/_shims/auto/runtime-node.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + function validateInputTools(tools) { + for (const tool of tools ?? []) { + if (tool.type !== "function") { + throw new error_1.OpenAIError(`Currently only \`function\` tool types support auto-parsing; Received \`${tool.type}\``); + } + if (tool.function.strict !== true) { + throw new error_1.OpenAIError(`The \`${tool.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`); + } } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __exportStar = exports2 && exports2.__exportStar || function(m6, exports3) { - for (var p6 in m6) if (p6 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p6)) __createBinding(exports3, m6, p6); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar(require_node_runtime(), exports2); - } -}); - -// node_modules/openai/_shims/index.js -var require_shims = __commonJS({ - "node_modules/openai/_shims/index.js"(exports2) { - "use strict"; - var shims = require_registry(); - var auto2 = require_runtime_node(); - exports2.init = () => { - if (!shims.kind) shims.setShims(auto2.getRuntime(), { auto: true }); - }; - for (const property of Object.keys(shims)) { - Object.defineProperty(exports2, property, { - get() { - return shims[property]; + } + function addOutputText(rsp) { + const texts = []; + for (const output of rsp.output) { + if (output.type !== "message") { + continue; } - }); + for (const content of output.content) { + if (content.type === "output_text") { + texts.push(content.text); + } + } + } + rsp.output_text = texts.join(""); } - exports2.init(); } }); -// node_modules/openai/error.js -var require_error2 = __commonJS({ - "node_modules/openai/error.js"(exports2) { +// node_modules/openai/lib/responses/ResponseStream.js +var require_ResponseStream = __commonJS({ + "node_modules/openai/lib/responses/ResponseStream.js"(exports2) { "use strict"; + var _ResponseStream_instances; + var _ResponseStream_params; + var _ResponseStream_currentResponseSnapshot; + var _ResponseStream_finalResponse; + var _ResponseStream_beginRequest; + var _ResponseStream_addEvent; + var _ResponseStream_endRequest; + var _ResponseStream_accumulateResponse; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ContentFilterFinishReasonError = exports2.LengthFinishReasonError = exports2.InternalServerError = exports2.RateLimitError = exports2.UnprocessableEntityError = exports2.ConflictError = exports2.NotFoundError = exports2.PermissionDeniedError = exports2.AuthenticationError = exports2.BadRequestError = exports2.APIConnectionTimeoutError = exports2.APIConnectionError = exports2.APIUserAbortError = exports2.APIError = exports2.OpenAIError = void 0; - var core_1 = require_core2(); - var OpenAIError = class extends Error { - }; - exports2.OpenAIError = OpenAIError; - var APIError = class _APIError extends OpenAIError { - constructor(status, error2, message, headers) { - super(`${_APIError.makeMessage(status, error2, message)}`); - this.status = status; - this.headers = headers; - this.request_id = headers?.["x-request-id"]; - this.error = error2; - const data = error2; - this.code = data?.["code"]; - this.param = data?.["param"]; - this.type = data?.["type"]; + exports2.ResponseStream = void 0; + var tslib_1 = require_tslib(); + var error_1 = require_error3(); + var EventStream_1 = require_EventStream(); + var ResponsesParser_1 = require_ResponsesParser(); + var ResponseStream = class _ResponseStream extends EventStream_1.EventStream { + constructor(params) { + super(); + _ResponseStream_instances.add(this); + _ResponseStream_params.set(this, void 0); + _ResponseStream_currentResponseSnapshot.set(this, void 0); + _ResponseStream_finalResponse.set(this, void 0); + tslib_1.__classPrivateFieldSet(this, _ResponseStream_params, params, "f"); } - static makeMessage(status, error2, message) { - const msg = error2?.message ? typeof error2.message === "string" ? error2.message : JSON.stringify(error2.message) : error2 ? JSON.stringify(error2) : message; - if (status && msg) { - return `${status} ${msg}`; - } - if (status) { - return `${status} status code (no body)`; - } - if (msg) { - return msg; - } - return "(no status code or body)"; + static createResponse(client2, params, options) { + const runner = new _ResponseStream(params); + runner._run(() => runner._createOrRetrieveResponse(client2, params, { + ...options, + headers: { ...options?.headers, "X-Stainless-Helper-Method": "stream" } + })); + return runner; } - static generate(status, errorResponse, message, headers) { - if (!status || !headers) { - return new APIConnectionError({ message, cause: (0, core_1.castToError)(errorResponse) }); + async _createOrRetrieveResponse(client2, params, options) { + const signal = options?.signal; + if (signal) { + if (signal.aborted) + this.controller.abort(); + signal.addEventListener("abort", () => this.controller.abort()); } - const error2 = errorResponse?.["error"]; - if (status === 400) { - return new BadRequestError(status, error2, message, headers); + tslib_1.__classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_beginRequest).call(this); + let stream5; + let starting_after = null; + if ("response_id" in params) { + stream5 = await client2.responses.retrieve(params.response_id, { stream: true }, { ...options, signal: this.controller.signal, stream: true }); + starting_after = params.starting_after ?? null; + } else { + stream5 = await client2.responses.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }); } - if (status === 401) { - return new AuthenticationError(status, error2, message, headers); + this._connected(); + for await (const event of stream5) { + tslib_1.__classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_addEvent).call(this, event, starting_after); } - if (status === 403) { - return new PermissionDeniedError(status, error2, message, headers); + if (stream5.controller.signal?.aborted) { + throw new error_1.APIUserAbortError(); } - if (status === 404) { - return new NotFoundError(status, error2, message, headers); + return tslib_1.__classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this); + } + [(_ResponseStream_params = /* @__PURE__ */ new WeakMap(), _ResponseStream_currentResponseSnapshot = /* @__PURE__ */ new WeakMap(), _ResponseStream_finalResponse = /* @__PURE__ */ new WeakMap(), _ResponseStream_instances = /* @__PURE__ */ new WeakSet(), _ResponseStream_beginRequest = function _ResponseStream_beginRequest2() { + if (this.ended) + return; + tslib_1.__classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, void 0, "f"); + }, _ResponseStream_addEvent = function _ResponseStream_addEvent2(event, starting_after) { + if (this.ended) + return; + const maybeEmit = (name, event2) => { + if (starting_after == null || event2.sequence_number > starting_after) { + this._emit(name, event2); + } + }; + const response = tslib_1.__classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_accumulateResponse).call(this, event); + maybeEmit("event", event); + switch (event.type) { + case "response.output_text.delta": { + const output = response.output[event.output_index]; + if (!output) { + throw new error_1.OpenAIError(`missing output at index ${event.output_index}`); + } + if (output.type === "message") { + const content = output.content[event.content_index]; + if (!content) { + throw new error_1.OpenAIError(`missing content at index ${event.content_index}`); + } + if (content.type !== "output_text") { + throw new error_1.OpenAIError(`expected content to be 'output_text', got ${content.type}`); + } + maybeEmit("response.output_text.delta", { + ...event, + snapshot: content.text + }); + } + break; + } + case "response.function_call_arguments.delta": { + const output = response.output[event.output_index]; + if (!output) { + throw new error_1.OpenAIError(`missing output at index ${event.output_index}`); + } + if (output.type === "function_call") { + maybeEmit("response.function_call_arguments.delta", { + ...event, + snapshot: output.arguments + }); + } + break; + } + default: + maybeEmit(event.type, event); + break; } - if (status === 409) { - return new ConflictError(status, error2, message, headers); + }, _ResponseStream_endRequest = function _ResponseStream_endRequest2() { + if (this.ended) { + throw new error_1.OpenAIError(`stream has ended, this shouldn't happen`); } - if (status === 422) { - return new UnprocessableEntityError(status, error2, message, headers); + const snapshot2 = tslib_1.__classPrivateFieldGet(this, _ResponseStream_currentResponseSnapshot, "f"); + if (!snapshot2) { + throw new error_1.OpenAIError(`request ended without sending any events`); } - if (status === 429) { - return new RateLimitError(status, error2, message, headers); + tslib_1.__classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, void 0, "f"); + const parsedResponse = finalizeResponse(snapshot2, tslib_1.__classPrivateFieldGet(this, _ResponseStream_params, "f")); + tslib_1.__classPrivateFieldSet(this, _ResponseStream_finalResponse, parsedResponse, "f"); + return parsedResponse; + }, _ResponseStream_accumulateResponse = function _ResponseStream_accumulateResponse2(event) { + let snapshot2 = tslib_1.__classPrivateFieldGet(this, _ResponseStream_currentResponseSnapshot, "f"); + if (!snapshot2) { + if (event.type !== "response.created") { + throw new error_1.OpenAIError(`When snapshot hasn't been set yet, expected 'response.created' event, got ${event.type}`); + } + snapshot2 = tslib_1.__classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, event.response, "f"); + return snapshot2; } - if (status >= 500) { - return new InternalServerError(status, error2, message, headers); + switch (event.type) { + case "response.output_item.added": { + snapshot2.output.push(event.item); + break; + } + case "response.content_part.added": { + const output = snapshot2.output[event.output_index]; + if (!output) { + throw new error_1.OpenAIError(`missing output at index ${event.output_index}`); + } + const type = output.type; + const part = event.part; + if (type === "message" && part.type !== "reasoning_text") { + output.content.push(part); + } else if (type === "reasoning" && part.type === "reasoning_text") { + if (!output.content) { + output.content = []; + } + output.content.push(part); + } + break; + } + case "response.output_text.delta": { + const output = snapshot2.output[event.output_index]; + if (!output) { + throw new error_1.OpenAIError(`missing output at index ${event.output_index}`); + } + if (output.type === "message") { + const content = output.content[event.content_index]; + if (!content) { + throw new error_1.OpenAIError(`missing content at index ${event.content_index}`); + } + if (content.type !== "output_text") { + throw new error_1.OpenAIError(`expected content to be 'output_text', got ${content.type}`); + } + content.text += event.delta; + } + break; + } + case "response.function_call_arguments.delta": { + const output = snapshot2.output[event.output_index]; + if (!output) { + throw new error_1.OpenAIError(`missing output at index ${event.output_index}`); + } + if (output.type === "function_call") { + output.arguments += event.delta; + } + break; + } + case "response.reasoning_text.delta": { + const output = snapshot2.output[event.output_index]; + if (!output) { + throw new error_1.OpenAIError(`missing output at index ${event.output_index}`); + } + if (output.type === "reasoning") { + const content = output.content?.[event.content_index]; + if (!content) { + throw new error_1.OpenAIError(`missing content at index ${event.content_index}`); + } + if (content.type !== "reasoning_text") { + throw new error_1.OpenAIError(`expected content to be 'reasoning_text', got ${content.type}`); + } + content.text += event.delta; + } + break; + } + case "response.completed": { + tslib_1.__classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, event.response, "f"); + break; + } } - return new _APIError(status, error2, message, headers); - } - }; - exports2.APIError = APIError; - var APIUserAbortError = class extends APIError { - constructor({ message } = {}) { - super(void 0, void 0, message || "Request was aborted.", void 0); - } - }; - exports2.APIUserAbortError = APIUserAbortError; - var APIConnectionError = class extends APIError { - constructor({ message, cause }) { - super(void 0, void 0, message || "Connection error.", void 0); - if (cause) - this.cause = cause; + return snapshot2; + }, Symbol.asyncIterator)]() { + const pushQueue = []; + const readQueue = []; + let done = false; + this.on("event", (event) => { + const reader = readQueue.shift(); + if (reader) { + reader.resolve(event); + } else { + pushQueue.push(event); + } + }); + this.on("end", () => { + done = true; + for (const reader of readQueue) { + reader.resolve(void 0); + } + readQueue.length = 0; + }); + this.on("abort", (err) => { + done = true; + for (const reader of readQueue) { + reader.reject(err); + } + readQueue.length = 0; + }); + this.on("error", (err) => { + done = true; + for (const reader of readQueue) { + reader.reject(err); + } + readQueue.length = 0; + }); + return { + next: async () => { + if (!pushQueue.length) { + if (done) { + return { value: void 0, done: true }; + } + return new Promise((resolve8, reject2) => readQueue.push({ resolve: resolve8, reject: reject2 })).then((event2) => event2 ? { value: event2, done: false } : { value: void 0, done: true }); + } + const event = pushQueue.shift(); + return { value: event, done: false }; + }, + return: async () => { + this.abort(); + return { value: void 0, done: true }; + } + }; } - }; - exports2.APIConnectionError = APIConnectionError; - var APIConnectionTimeoutError = class extends APIConnectionError { - constructor({ message } = {}) { - super({ message: message ?? "Request timed out." }); + /** + * @returns a promise that resolves with the final Response, or rejects + * if an error occurred or the stream ended prematurely without producing a REsponse. + */ + async finalResponse() { + await this.done(); + const response = tslib_1.__classPrivateFieldGet(this, _ResponseStream_finalResponse, "f"); + if (!response) + throw new error_1.OpenAIError("stream ended without producing a ChatCompletion"); + return response; } }; - exports2.APIConnectionTimeoutError = APIConnectionTimeoutError; - var BadRequestError = class extends APIError { - }; - exports2.BadRequestError = BadRequestError; - var AuthenticationError = class extends APIError { - }; - exports2.AuthenticationError = AuthenticationError; - var PermissionDeniedError = class extends APIError { - }; - exports2.PermissionDeniedError = PermissionDeniedError; - var NotFoundError = class extends APIError { - }; - exports2.NotFoundError = NotFoundError; - var ConflictError = class extends APIError { - }; - exports2.ConflictError = ConflictError; - var UnprocessableEntityError = class extends APIError { - }; - exports2.UnprocessableEntityError = UnprocessableEntityError; - var RateLimitError = class extends APIError { - }; - exports2.RateLimitError = RateLimitError; - var InternalServerError = class extends APIError { - }; - exports2.InternalServerError = InternalServerError; - var LengthFinishReasonError = class extends OpenAIError { - constructor() { - super(`Could not parse response content as the length limit was reached`); + exports2.ResponseStream = ResponseStream; + function finalizeResponse(snapshot2, params) { + return (0, ResponsesParser_1.maybeParseResponse)(snapshot2, params); + } + } +}); + +// node_modules/openai/resources/responses/input-items.js +var require_input_items = __commonJS({ + "node_modules/openai/resources/responses/input-items.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.InputItems = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var path_1 = require_path2(); + var InputItems = class extends resource_1.APIResource { + /** + * Returns a list of input items for a given response. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const responseItem of client.responses.inputItems.list( + * 'response_id', + * )) { + * // ... + * } + * ``` + */ + list(responseID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/responses/${responseID}/input_items`, pagination_1.CursorPage, { query, ...options, __security: { bearerAuth: true } }); } }; - exports2.LengthFinishReasonError = LengthFinishReasonError; - var ContentFilterFinishReasonError = class extends OpenAIError { - constructor() { - super(`Could not parse response content as the request was rejected by the content filter`); + exports2.InputItems = InputItems; + } +}); + +// node_modules/openai/resources/responses/input-tokens.js +var require_input_tokens = __commonJS({ + "node_modules/openai/resources/responses/input-tokens.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.InputTokens = void 0; + var resource_1 = require_resource(); + var InputTokens = class extends resource_1.APIResource { + /** + * Returns input token counts of the request. + * + * Returns an object with `object` set to `response.input_tokens` and an + * `input_tokens` count. + * + * @example + * ```ts + * const response = await client.responses.inputTokens.count(); + * ``` + */ + count(body2 = {}, options) { + return this._client.post("/responses/input_tokens", { + body: body2, + ...options, + __security: { bearerAuth: true } + }); } }; - exports2.ContentFilterFinishReasonError = ContentFilterFinishReasonError; + exports2.InputTokens = InputTokens; } }); -// node_modules/openai/internal/decoders/line.js -var require_line = __commonJS({ - "node_modules/openai/internal/decoders/line.js"(exports2) { +// node_modules/openai/resources/responses/responses.js +var require_responses = __commonJS({ + "node_modules/openai/resources/responses/responses.js"(exports2) { "use strict"; - var __classPrivateFieldSet = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; - }; - var __classPrivateFieldGet = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); - }; - var _LineDecoder_carriageReturnIndex; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.findDoubleNewlineIndex = exports2.LineDecoder = void 0; - var error_1 = require_error2(); - var LineDecoder = class { + exports2.Responses = void 0; + var tslib_1 = require_tslib(); + var ResponsesParser_1 = require_ResponsesParser(); + var ResponseStream_1 = require_ResponseStream(); + var resource_1 = require_resource(); + var InputItemsAPI = tslib_1.__importStar(require_input_items()); + var input_items_1 = require_input_items(); + var InputTokensAPI = tslib_1.__importStar(require_input_tokens()); + var input_tokens_1 = require_input_tokens(); + var headers_1 = require_headers4(); + var path_1 = require_path2(); + var Responses = class extends resource_1.APIResource { constructor() { - _LineDecoder_carriageReturnIndex.set(this, void 0); - this.buffer = new Uint8Array(); - __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f"); + super(...arguments); + this.inputItems = new InputItemsAPI.InputItems(this._client); + this.inputTokens = new InputTokensAPI.InputTokens(this._client); } - decode(chunk) { - if (chunk == null) { - return []; - } - const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk) : typeof chunk === "string" ? new TextEncoder().encode(chunk) : chunk; - let newData = new Uint8Array(this.buffer.length + binaryChunk.length); - newData.set(this.buffer); - newData.set(binaryChunk, this.buffer.length); - this.buffer = newData; - const lines = []; - let patternIndex; - while ((patternIndex = findNewlineIndex(this.buffer, __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f"))) != null) { - if (patternIndex.carriage && __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") == null) { - __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, patternIndex.index, "f"); - continue; - } - if (__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") != null && (patternIndex.index !== __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") + 1 || patternIndex.carriage)) { - lines.push(this.decodeText(this.buffer.slice(0, __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") - 1))); - this.buffer = this.buffer.slice(__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f")); - __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f"); - continue; + create(body2, options) { + return this._client.post("/responses", { + body: body2, + ...options, + stream: body2.stream ?? false, + __security: { bearerAuth: true } + })._thenUnwrap((rsp) => { + if ("object" in rsp && rsp.object === "response") { + (0, ResponsesParser_1.addOutputText)(rsp); } - const endIndex = __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") !== null ? patternIndex.preceding - 1 : patternIndex.preceding; - const line = this.decodeText(this.buffer.slice(0, endIndex)); - lines.push(line); - this.buffer = this.buffer.slice(patternIndex.index); - __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f"); - } - return lines; + return rsp; + }); } - decodeText(bytes) { - if (bytes == null) - return ""; - if (typeof bytes === "string") - return bytes; - if (typeof Buffer !== "undefined") { - if (bytes instanceof Buffer) { - return bytes.toString(); - } - if (bytes instanceof Uint8Array) { - return Buffer.from(bytes).toString(); - } - throw new error_1.OpenAIError(`Unexpected: received non-Uint8Array (${bytes.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`); - } - if (typeof TextDecoder !== "undefined") { - if (bytes instanceof Uint8Array || bytes instanceof ArrayBuffer) { - this.textDecoder ?? (this.textDecoder = new TextDecoder("utf8")); - return this.textDecoder.decode(bytes); + retrieve(responseID, query = {}, options) { + return this._client.get((0, path_1.path)`/responses/${responseID}`, { + query, + ...options, + stream: query?.stream ?? false, + __security: { bearerAuth: true } + })._thenUnwrap((rsp) => { + if ("object" in rsp && rsp.object === "response") { + (0, ResponsesParser_1.addOutputText)(rsp); } - throw new error_1.OpenAIError(`Unexpected: received non-Uint8Array/ArrayBuffer (${bytes.constructor.name}) in a web platform. Please report this error.`); - } - throw new error_1.OpenAIError(`Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.`); + return rsp; + }); } - flush() { - if (!this.buffer.length) { - return []; - } - return this.decode("\n"); + /** + * Deletes a model response with the given ID. + * + * @example + * ```ts + * await client.responses.delete( + * 'resp_677efb5139a88190b512bc3fef8e535d', + * ); + * ``` + */ + delete(responseID, options) { + return this._client.delete((0, path_1.path)`/responses/${responseID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ Accept: "*/*" }, options?.headers]), + __security: { bearerAuth: true } + }); } - }; - exports2.LineDecoder = LineDecoder; - _LineDecoder_carriageReturnIndex = /* @__PURE__ */ new WeakMap(); - LineDecoder.NEWLINE_CHARS = /* @__PURE__ */ new Set(["\n", "\r"]); - LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g; - function findNewlineIndex(buffer2, startIndex) { - const newline = 10; - const carriage = 13; - for (let i6 = startIndex ?? 0; i6 < buffer2.length; i6++) { - if (buffer2[i6] === newline) { - return { preceding: i6, index: i6 + 1, carriage: false }; - } - if (buffer2[i6] === carriage) { - return { preceding: i6, index: i6 + 1, carriage: true }; - } + parse(body2, options) { + return this._client.responses.create(body2, options)._thenUnwrap((response) => (0, ResponsesParser_1.parseResponse)(response, body2)); } - return null; - } - function findDoubleNewlineIndex(buffer2) { - const newline = 10; - const carriage = 13; - for (let i6 = 0; i6 < buffer2.length - 1; i6++) { - if (buffer2[i6] === newline && buffer2[i6 + 1] === newline) { - return i6 + 2; - } - if (buffer2[i6] === carriage && buffer2[i6 + 1] === carriage) { - return i6 + 2; - } - if (buffer2[i6] === carriage && buffer2[i6 + 1] === newline && i6 + 3 < buffer2.length && buffer2[i6 + 2] === carriage && buffer2[i6 + 3] === newline) { - return i6 + 4; - } + /** + * Creates a model response stream + */ + stream(body2, options) { + return ResponseStream_1.ResponseStream.createResponse(this._client, body2, options); } - return -1; - } - exports2.findDoubleNewlineIndex = findDoubleNewlineIndex; + /** + * Cancels a model response with the given ID. Only responses created with the + * `background` parameter set to `true` can be cancelled. + * [Learn more](https://platform.openai.com/docs/guides/background). + * + * @example + * ```ts + * const response = await client.responses.cancel( + * 'resp_677efb5139a88190b512bc3fef8e535d', + * ); + * ``` + */ + cancel(responseID, options) { + return this._client.post((0, path_1.path)`/responses/${responseID}/cancel`, { + ...options, + __security: { bearerAuth: true } + }); + } + /** + * Compact a conversation. Returns a compacted response object. + * + * Learn when and how to compact long-running conversations in the + * [conversation state guide](https://platform.openai.com/docs/guides/conversation-state#managing-the-context-window). + * For ZDR-compatible compaction details, see + * [Compaction (advanced)](https://platform.openai.com/docs/guides/conversation-state#compaction-advanced). + * + * @example + * ```ts + * const compactedResponse = await client.responses.compact({ + * model: 'gpt-5.4', + * }); + * ``` + */ + compact(body2, options) { + return this._client.post("/responses/compact", { body: body2, ...options, __security: { bearerAuth: true } }); + } + }; + exports2.Responses = Responses; + Responses.InputItems = input_items_1.InputItems; + Responses.InputTokens = input_tokens_1.InputTokens; } }); -// node_modules/openai/internal/stream-utils.js -var require_stream_utils = __commonJS({ - "node_modules/openai/internal/stream-utils.js"(exports2) { +// node_modules/openai/resources/skills/content.js +var require_content2 = __commonJS({ + "node_modules/openai/resources/skills/content.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ReadableStreamToAsyncIterable = void 0; - function ReadableStreamToAsyncIterable(stream5) { - if (stream5[Symbol.asyncIterator]) - return stream5; - const reader = stream5.getReader(); - return { - async next() { - try { - const result = await reader.read(); - if (result?.done) - reader.releaseLock(); - return result; - } catch (e6) { - reader.releaseLock(); - throw e6; - } - }, - async return() { - const cancelPromise = reader.cancel(); - reader.releaseLock(); - await cancelPromise; - return { done: true, value: void 0 }; - }, - [Symbol.asyncIterator]() { - return this; - } - }; - } - exports2.ReadableStreamToAsyncIterable = ReadableStreamToAsyncIterable; + exports2.Content = void 0; + var resource_1 = require_resource(); + var headers_1 = require_headers4(); + var path_1 = require_path2(); + var Content = class extends resource_1.APIResource { + /** + * Download a skill zip bundle by its ID. + */ + retrieve(skillID, options) { + return this._client.get((0, path_1.path)`/skills/${skillID}/content`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ Accept: "application/binary" }, options?.headers]), + __security: { bearerAuth: true }, + __binaryResponse: true + }); + } + }; + exports2.Content = Content; } }); -// node_modules/openai/streaming.js -var require_streaming = __commonJS({ - "node_modules/openai/streaming.js"(exports2) { +// node_modules/openai/resources/skills/versions/content.js +var require_content3 = __commonJS({ + "node_modules/openai/resources/skills/versions/content.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2._iterSSEMessages = exports2.Stream = void 0; - var index_1 = require_shims(); - var error_1 = require_error2(); - var line_1 = require_line(); - var stream_utils_1 = require_stream_utils(); - var core_1 = require_core2(); - var error_2 = require_error2(); - var Stream3 = class _Stream { - constructor(iterator2, controller) { - this.iterator = iterator2; - this.controller = controller; - } - static fromSSEResponse(response, controller) { - let consumed = false; - async function* iterator2() { - if (consumed) { - throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); - } - consumed = true; - let done = false; - try { - for await (const sse of _iterSSEMessages(response, controller)) { - if (done) - continue; - if (sse.data.startsWith("[DONE]")) { - done = true; - continue; - } - if (sse.event === null || sse.event.startsWith("response.") || sse.event.startsWith("transcript.")) { - let data; - try { - data = JSON.parse(sse.data); - } catch (e6) { - console.error(`Could not parse message into JSON:`, sse.data); - console.error(`From chunk:`, sse.raw); - throw e6; - } - if (data && data.error) { - throw new error_2.APIError(void 0, data.error, void 0, (0, core_1.createResponseHeaders)(response.headers)); - } - yield data; - } else { - let data; - try { - data = JSON.parse(sse.data); - } catch (e6) { - console.error(`Could not parse message into JSON:`, sse.data); - console.error(`From chunk:`, sse.raw); - throw e6; - } - if (sse.event == "error") { - throw new error_2.APIError(void 0, data.error, data.message, void 0); - } - yield { event: sse.event, data }; - } - } - done = true; - } catch (e6) { - if (e6 instanceof Error && e6.name === "AbortError") - return; - throw e6; - } finally { - if (!done) - controller.abort(); - } - } - return new _Stream(iterator2, controller); - } + exports2.Content = void 0; + var resource_1 = require_resource(); + var headers_1 = require_headers4(); + var path_1 = require_path2(); + var Content = class extends resource_1.APIResource { /** - * Generates a Stream from a newline-separated ReadableStream - * where each item is a JSON value. + * Download a skill version zip bundle. */ - static fromReadableStream(readableStream, controller) { - let consumed = false; - async function* iterLines() { - const lineDecoder = new line_1.LineDecoder(); - const iter = (0, stream_utils_1.ReadableStreamToAsyncIterable)(readableStream); - for await (const chunk of iter) { - for (const line of lineDecoder.decode(chunk)) { - yield line; - } - } - for (const line of lineDecoder.flush()) { - yield line; - } - } - async function* iterator2() { - if (consumed) { - throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); - } - consumed = true; - let done = false; - try { - for await (const line of iterLines()) { - if (done) - continue; - if (line) - yield JSON.parse(line); - } - done = true; - } catch (e6) { - if (e6 instanceof Error && e6.name === "AbortError") - return; - throw e6; - } finally { - if (!done) - controller.abort(); - } - } - return new _Stream(iterator2, controller); + retrieve(version3, params, options) { + const { skill_id } = params; + return this._client.get((0, path_1.path)`/skills/${skill_id}/versions/${version3}/content`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ Accept: "application/binary" }, options?.headers]), + __security: { bearerAuth: true }, + __binaryResponse: true + }); } - [Symbol.asyncIterator]() { - return this.iterator(); + }; + exports2.Content = Content; + } +}); + +// node_modules/openai/resources/skills/versions/versions.js +var require_versions = __commonJS({ + "node_modules/openai/resources/skills/versions/versions.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Versions = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var ContentAPI = tslib_1.__importStar(require_content3()); + var content_1 = require_content3(); + var pagination_1 = require_pagination(); + var uploads_1 = require_uploads(); + var path_1 = require_path2(); + var Versions = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.content = new ContentAPI.Content(this._client); } /** - * Splits the stream into two streams which can be - * independently read from at different speeds. + * Create a new immutable skill version. */ - tee() { - const left = []; - const right = []; - const iterator2 = this.iterator(); - const teeIterator = (queue2) => { - return { - next: () => { - if (queue2.length === 0) { - const result = iterator2.next(); - left.push(result); - right.push(result); - } - return queue2.shift(); - } - }; - }; - return [ - new _Stream(() => teeIterator(left), this.controller), - new _Stream(() => teeIterator(right), this.controller) - ]; + create(skillID, body2 = {}, options) { + return this._client.post((0, path_1.path)`/skills/${skillID}/versions`, (0, uploads_1.maybeMultipartFormRequestOptions)({ body: body2, ...options, __security: { bearerAuth: true } }, this._client)); } /** - * Converts this stream to a newline-separated ReadableStream of - * JSON stringified values in the stream - * which can be turned back into a Stream with `Stream.fromReadableStream()`. + * Get a specific skill version. */ - toReadableStream() { - const self2 = this; - let iter; - const encoder = new TextEncoder(); - return new index_1.ReadableStream({ - async start() { - iter = self2[Symbol.asyncIterator](); - }, - async pull(ctrl) { - try { - const { value, done } = await iter.next(); - if (done) - return ctrl.close(); - const bytes = encoder.encode(JSON.stringify(value) + "\n"); - ctrl.enqueue(bytes); - } catch (err) { - ctrl.error(err); - } - }, - async cancel() { - await iter.return?.(); - } + retrieve(version3, params, options) { + const { skill_id } = params; + return this._client.get((0, path_1.path)`/skills/${skill_id}/versions/${version3}`, { + ...options, + __security: { bearerAuth: true } }); } - }; - exports2.Stream = Stream3; - async function* _iterSSEMessages(response, controller) { - if (!response.body) { - controller.abort(); - throw new error_1.OpenAIError(`Attempted to iterate over a response with no body`); - } - const sseDecoder = new SSEDecoder(); - const lineDecoder = new line_1.LineDecoder(); - const iter = (0, stream_utils_1.ReadableStreamToAsyncIterable)(response.body); - for await (const sseChunk of iterSSEChunks(iter)) { - for (const line of lineDecoder.decode(sseChunk)) { - const sse = sseDecoder.decode(line); - if (sse) - yield sse; - } - } - for (const line of lineDecoder.flush()) { - const sse = sseDecoder.decode(line); - if (sse) - yield sse; - } - } - exports2._iterSSEMessages = _iterSSEMessages; - async function* iterSSEChunks(iterator2) { - let data = new Uint8Array(); - for await (const chunk of iterator2) { - if (chunk == null) { - continue; - } - const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk) : typeof chunk === "string" ? new TextEncoder().encode(chunk) : chunk; - let newData = new Uint8Array(data.length + binaryChunk.length); - newData.set(data); - newData.set(binaryChunk, data.length); - data = newData; - let patternIndex; - while ((patternIndex = (0, line_1.findDoubleNewlineIndex)(data)) !== -1) { - yield data.slice(0, patternIndex); - data = data.slice(patternIndex); - } - } - if (data.length > 0) { - yield data; - } - } - var SSEDecoder = class { - constructor() { - this.event = null; - this.data = []; - this.chunks = []; + /** + * List skill versions for a skill. + */ + list(skillID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/skills/${skillID}/versions`, pagination_1.CursorPage, { + query, + ...options, + __security: { bearerAuth: true } + }); } - decode(line) { - if (line.endsWith("\r")) { - line = line.substring(0, line.length - 1); - } - if (!line) { - if (!this.event && !this.data.length) - return null; - const sse = { - event: this.event, - data: this.data.join("\n"), - raw: this.chunks - }; - this.event = null; - this.data = []; - this.chunks = []; - return sse; - } - this.chunks.push(line); - if (line.startsWith(":")) { - return null; - } - let [fieldname, _3, value] = partition2(line, ":"); - if (value.startsWith(" ")) { - value = value.substring(1); - } - if (fieldname === "event") { - this.event = value; - } else if (fieldname === "data") { - this.data.push(value); - } - return null; + /** + * Delete a skill version. + */ + delete(version3, params, options) { + const { skill_id } = params; + return this._client.delete((0, path_1.path)`/skills/${skill_id}/versions/${version3}`, { + ...options, + __security: { bearerAuth: true } + }); } }; - function partition2(str, delimiter2) { - const index2 = str.indexOf(delimiter2); - if (index2 !== -1) { - return [str.substring(0, index2), delimiter2, str.substring(index2 + delimiter2.length)]; - } - return [str, "", ""]; - } + exports2.Versions = Versions; + Versions.Content = content_1.Content; } }); -// node_modules/openai/uploads.js -var require_uploads = __commonJS({ - "node_modules/openai/uploads.js"(exports2) { +// node_modules/openai/resources/skills/skills.js +var require_skills = __commonJS({ + "node_modules/openai/resources/skills/skills.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createForm = exports2.multipartFormRequestOptions = exports2.maybeMultipartFormRequestOptions = exports2.isMultipartBody = exports2.toFile = exports2.isUploadable = exports2.isBlobLike = exports2.isFileLike = exports2.isResponseLike = exports2.fileFromPath = void 0; - var index_1 = require_shims(); - var index_2 = require_shims(); - Object.defineProperty(exports2, "fileFromPath", { enumerable: true, get: function() { - return index_2.fileFromPath; - } }); - var isResponseLike = (value) => value != null && typeof value === "object" && typeof value.url === "string" && typeof value.blob === "function"; - exports2.isResponseLike = isResponseLike; - var isFileLike = (value) => value != null && typeof value === "object" && typeof value.name === "string" && typeof value.lastModified === "number" && (0, exports2.isBlobLike)(value); - exports2.isFileLike = isFileLike; - var isBlobLike = (value) => value != null && typeof value === "object" && typeof value.size === "number" && typeof value.type === "string" && typeof value.text === "function" && typeof value.slice === "function" && typeof value.arrayBuffer === "function"; - exports2.isBlobLike = isBlobLike; - var isUploadable = (value) => { - return (0, exports2.isFileLike)(value) || (0, exports2.isResponseLike)(value) || (0, index_1.isFsReadStream)(value); - }; - exports2.isUploadable = isUploadable; - async function toFile(value, name, options) { - value = await value; - if ((0, exports2.isFileLike)(value)) { - return value; - } - if ((0, exports2.isResponseLike)(value)) { - const blob = await value.blob(); - name || (name = new URL(value.url).pathname.split(/[\\/]/).pop() ?? "unknown_file"); - const data = (0, exports2.isBlobLike)(blob) ? [await blob.arrayBuffer()] : [blob]; - return new index_1.File(data, name, options); + exports2.Skills = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var ContentAPI = tslib_1.__importStar(require_content2()); + var content_1 = require_content2(); + var VersionsAPI = tslib_1.__importStar(require_versions()); + var versions_1 = require_versions(); + var pagination_1 = require_pagination(); + var uploads_1 = require_uploads(); + var path_1 = require_path2(); + var Skills = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.content = new ContentAPI.Content(this._client); + this.versions = new VersionsAPI.Versions(this._client); } - const bits = await getBytes(value); - name || (name = getName(value) ?? "unknown_file"); - if (!options?.type) { - const type = bits[0]?.type; - if (typeof type === "string") { - options = { ...options, type }; - } + /** + * Create a new skill. + */ + create(body2 = {}, options) { + return this._client.post("/skills", (0, uploads_1.maybeMultipartFormRequestOptions)({ body: body2, ...options, __security: { bearerAuth: true } }, this._client)); } - return new index_1.File(bits, name, options); - } - exports2.toFile = toFile; - async function getBytes(value) { - let parts = []; - if (typeof value === "string" || ArrayBuffer.isView(value) || // includes Uint8Array, Buffer, etc. - value instanceof ArrayBuffer) { - parts.push(value); - } else if ((0, exports2.isBlobLike)(value)) { - parts.push(await value.arrayBuffer()); - } else if (isAsyncIterableIterator(value)) { - for await (const chunk of value) { - parts.push(chunk); - } - } else { - throw new Error(`Unexpected data type: ${typeof value}; constructor: ${value?.constructor?.name}; props: ${propsForError(value)}`); + /** + * Get a skill by its ID. + */ + retrieve(skillID, options) { + return this._client.get((0, path_1.path)`/skills/${skillID}`, { ...options, __security: { bearerAuth: true } }); } - return parts; - } - function propsForError(value) { - const props = Object.getOwnPropertyNames(value); - return `[${props.map((p6) => `"${p6}"`).join(", ")}]`; - } - function getName(value) { - return getStringFromMaybeBuffer(value.name) || getStringFromMaybeBuffer(value.filename) || // For fs.ReadStream - getStringFromMaybeBuffer(value.path)?.split(/[\\/]/).pop(); - } - var getStringFromMaybeBuffer = (x6) => { - if (typeof x6 === "string") - return x6; - if (typeof Buffer !== "undefined" && x6 instanceof Buffer) - return String(x6); - return void 0; - }; - var isAsyncIterableIterator = (value) => value != null && typeof value === "object" && typeof value[Symbol.asyncIterator] === "function"; - var isMultipartBody = (body2) => body2 && typeof body2 === "object" && body2.body && body2[Symbol.toStringTag] === "MultipartBody"; - exports2.isMultipartBody = isMultipartBody; - var maybeMultipartFormRequestOptions = async (opts) => { - if (!hasUploadableValue(opts.body)) - return opts; - const form = await (0, exports2.createForm)(opts.body); - return (0, index_1.getMultipartRequestOptions)(form, opts); - }; - exports2.maybeMultipartFormRequestOptions = maybeMultipartFormRequestOptions; - var multipartFormRequestOptions = async (opts) => { - const form = await (0, exports2.createForm)(opts.body); - return (0, index_1.getMultipartRequestOptions)(form, opts); - }; - exports2.multipartFormRequestOptions = multipartFormRequestOptions; - var createForm = async (body2) => { - const form = new index_1.FormData(); - await Promise.all(Object.entries(body2 || {}).map(([key, value]) => addFormValue(form, key, value))); - return form; - }; - exports2.createForm = createForm; - var hasUploadableValue = (value) => { - if ((0, exports2.isUploadable)(value)) - return true; - if (Array.isArray(value)) - return value.some(hasUploadableValue); - if (value && typeof value === "object") { - for (const k7 in value) { - if (hasUploadableValue(value[k7])) - return true; - } + /** + * Update the default version pointer for a skill. + */ + update(skillID, body2, options) { + return this._client.post((0, path_1.path)`/skills/${skillID}`, { + body: body2, + ...options, + __security: { bearerAuth: true } + }); } - return false; - }; - var addFormValue = async (form, key, value) => { - if (value === void 0) - return; - if (value == null) { - throw new TypeError(`Received null for "${key}"; to pass null in FormData, you must use the string 'null'`); + /** + * List all skills for the current project. + */ + list(query = {}, options) { + return this._client.getAPIList("/skills", pagination_1.CursorPage, { + query, + ...options, + __security: { bearerAuth: true } + }); } - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { - form.append(key, String(value)); - } else if ((0, exports2.isUploadable)(value)) { - const file = await toFile(value); - form.append(key, file); - } else if (Array.isArray(value)) { - await Promise.all(value.map((entry) => addFormValue(form, key + "[]", entry))); - } else if (typeof value === "object") { - await Promise.all(Object.entries(value).map(([name, prop]) => addFormValue(form, `${key}[${name}]`, prop))); - } else { - throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value} instead`); + /** + * Delete a skill by its ID. + */ + delete(skillID, options) { + return this._client.delete((0, path_1.path)`/skills/${skillID}`, { ...options, __security: { bearerAuth: true } }); } }; + exports2.Skills = Skills; + Skills.Content = content_1.Content; + Skills.Versions = versions_1.Versions; } }); -// node_modules/openai/core.js -var require_core2 = __commonJS({ - "node_modules/openai/core.js"(exports2) { +// node_modules/openai/resources/uploads/parts.js +var require_parts = __commonJS({ + "node_modules/openai/resources/uploads/parts.js"(exports2) { "use strict"; - var __classPrivateFieldSet = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; - }; - var __classPrivateFieldGet = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); - }; - var _AbstractPage_client; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isObj = exports2.toFloat32Array = exports2.toBase64 = exports2.getHeader = exports2.getRequiredHeader = exports2.isHeadersProtocol = exports2.isRunningInBrowser = exports2.debug = exports2.hasOwn = exports2.isEmptyObj = exports2.maybeCoerceBoolean = exports2.maybeCoerceFloat = exports2.maybeCoerceInteger = exports2.coerceBoolean = exports2.coerceFloat = exports2.coerceInteger = exports2.readEnv = exports2.ensurePresent = exports2.castToError = exports2.sleep = exports2.safeJSON = exports2.isRequestOptions = exports2.createResponseHeaders = exports2.PagePromise = exports2.AbstractPage = exports2.APIClient = exports2.APIPromise = exports2.createForm = exports2.multipartFormRequestOptions = exports2.maybeMultipartFormRequestOptions = void 0; - var version_1 = require_version(); - var streaming_1 = require_streaming(); - var error_1 = require_error2(); - var index_1 = require_shims(); - (0, index_1.init)(); + exports2.Parts = void 0; + var resource_1 = require_resource(); var uploads_1 = require_uploads(); - var uploads_2 = require_uploads(); - Object.defineProperty(exports2, "maybeMultipartFormRequestOptions", { enumerable: true, get: function() { - return uploads_2.maybeMultipartFormRequestOptions; - } }); - Object.defineProperty(exports2, "multipartFormRequestOptions", { enumerable: true, get: function() { - return uploads_2.multipartFormRequestOptions; - } }); - Object.defineProperty(exports2, "createForm", { enumerable: true, get: function() { - return uploads_2.createForm; - } }); - async function defaultParseResponse(props) { - const { response } = props; - if (props.options.stream) { - debug2("response", response.status, response.url, response.headers, response.body); - if (props.options.__streamClass) { - return props.options.__streamClass.fromSSEResponse(response, props.controller); - } - return streaming_1.Stream.fromSSEResponse(response, props.controller); - } - if (response.status === 204) { - return null; - } - if (props.options.__binaryResponse) { - return response; - } - const contentType2 = response.headers.get("content-type"); - const mediaType = contentType2?.split(";")[0]?.trim(); - const isJSON = mediaType?.includes("application/json") || mediaType?.endsWith("+json"); - if (isJSON) { - const json = await response.json(); - debug2("response", response.status, response.url, response.headers, json); - return _addRequestID(json, response); - } - const text = await response.text(); - debug2("response", response.status, response.url, response.headers, text); - return text; - } - function _addRequestID(value, response) { - if (!value || typeof value !== "object" || Array.isArray(value)) { - return value; - } - return Object.defineProperty(value, "_request_id", { - value: response.headers.get("x-request-id"), - enumerable: false - }); - } - var APIPromise = class _APIPromise extends Promise { - constructor(responsePromise, parseResponse = defaultParseResponse) { - super((resolve4) => { - resolve4(null); - }); - this.responsePromise = responsePromise; - this.parseResponse = parseResponse; + var path_1 = require_path2(); + var Parts = class extends resource_1.APIResource { + /** + * Adds a + * [Part](https://platform.openai.com/docs/api-reference/uploads/part-object) to an + * [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object. + * A Part represents a chunk of bytes from the file you are trying to upload. + * + * Each Part can be at most 64 MB, and you can add Parts until you hit the Upload + * maximum of 8 GB. + * + * It is possible to add multiple Parts in parallel. You can decide the intended + * order of the Parts when you + * [complete the Upload](https://platform.openai.com/docs/api-reference/uploads/complete). + */ + create(uploadID, body2, options) { + return this._client.post((0, path_1.path)`/uploads/${uploadID}/parts`, (0, uploads_1.multipartFormRequestOptions)({ body: body2, ...options, __security: { bearerAuth: true } }, this._client)); } - _thenUnwrap(transform2) { - return new _APIPromise(this.responsePromise, async (props) => _addRequestID(transform2(await this.parseResponse(props), props), props.response)); + }; + exports2.Parts = Parts; + } +}); + +// node_modules/openai/resources/uploads/uploads.js +var require_uploads3 = __commonJS({ + "node_modules/openai/resources/uploads/uploads.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Uploads = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var PartsAPI = tslib_1.__importStar(require_parts()); + var parts_1 = require_parts(); + var path_1 = require_path2(); + var Uploads = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.parts = new PartsAPI.Parts(this._client); } /** - * Gets the raw `Response` instance instead of parsing the response - * data. + * Creates an intermediate + * [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object + * that you can add + * [Parts](https://platform.openai.com/docs/api-reference/uploads/part-object) to. + * Currently, an Upload can accept at most 8 GB in total and expires after an hour + * after you create it. * - * If you want to parse the response body but still get the `Response` - * instance, you can use {@link withResponse()}. + * Once you complete the Upload, we will create a + * [File](https://platform.openai.com/docs/api-reference/files/object) object that + * contains all the parts you uploaded. This File is usable in the rest of our + * platform as a regular File object. * - * 👋 Getting the wrong TypeScript type for `Response`? - * Try setting `"moduleResolution": "NodeNext"` if you can, - * or add one of these imports before your first `import … from 'openai'`: - * - `import 'openai/shims/node'` (if you're running on Node) - * - `import 'openai/shims/web'` (otherwise) + * For certain `purpose` values, the correct `mime_type` must be specified. Please + * refer to documentation for the + * [supported MIME types for your use case](https://platform.openai.com/docs/assistants/tools/file-search#supported-files). + * + * For guidance on the proper filename extensions for each purpose, please follow + * the documentation on + * [creating a File](https://platform.openai.com/docs/api-reference/files/create). + * + * Returns the Upload object with status `pending`. */ - asResponse() { - return this.responsePromise.then((p6) => p6.response); + create(body2, options) { + return this._client.post("/uploads", { body: body2, ...options, __security: { bearerAuth: true } }); } /** - * Gets the parsed response data, the raw `Response` instance and the ID of the request, - * returned via the X-Request-ID header which is useful for debugging requests and reporting - * issues to OpenAI. + * Cancels the Upload. No Parts may be added after an Upload is cancelled. * - * If you just want to get the raw `Response` instance without parsing it, - * you can use {@link asResponse()}. + * Returns the Upload object with status `cancelled`. + */ + cancel(uploadID, options) { + return this._client.post((0, path_1.path)`/uploads/${uploadID}/cancel`, { + ...options, + __security: { bearerAuth: true } + }); + } + /** + * Completes the + * [Upload](https://platform.openai.com/docs/api-reference/uploads/object). * + * Within the returned Upload object, there is a nested + * [File](https://platform.openai.com/docs/api-reference/files/object) object that + * is ready to use in the rest of the platform. * - * 👋 Getting the wrong TypeScript type for `Response`? - * Try setting `"moduleResolution": "NodeNext"` if you can, - * or add one of these imports before your first `import … from 'openai'`: - * - `import 'openai/shims/node'` (if you're running on Node) - * - `import 'openai/shims/web'` (otherwise) + * You can specify the order of the Parts by passing in an ordered list of the Part + * IDs. + * + * The number of bytes uploaded upon completion must match the number of bytes + * initially specified when creating the Upload object. No Parts may be added after + * an Upload is completed. Returns the Upload object with status `completed`, + * including an additional `file` property containing the created usable File + * object. */ - async withResponse() { - const [data, response] = await Promise.all([this.parse(), this.asResponse()]); - return { data, response, request_id: response.headers.get("x-request-id") }; + complete(uploadID, body2, options) { + return this._client.post((0, path_1.path)`/uploads/${uploadID}/complete`, { + body: body2, + ...options, + __security: { bearerAuth: true } + }); } - parse() { - if (!this.parsedPromise) { - this.parsedPromise = this.responsePromise.then(this.parseResponse); + }; + exports2.Uploads = Uploads; + Uploads.Parts = parts_1.Parts; + } +}); + +// node_modules/openai/lib/Util.js +var require_Util = __commonJS({ + "node_modules/openai/lib/Util.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.allSettledWithThrow = void 0; + var allSettledWithThrow = async (promises4) => { + const results = await Promise.allSettled(promises4); + const rejected = results.filter((result) => result.status === "rejected"); + if (rejected.length) { + for (const result of rejected) { + console.error(result.reason); } - return this.parsedPromise; - } - then(onfulfilled, onrejected) { - return this.parse().then(onfulfilled, onrejected); - } - catch(onrejected) { - return this.parse().catch(onrejected); + throw new Error(`${rejected.length} promise(s) failed - see the above errors`); } - finally(onfinally) { - return this.parse().finally(onfinally); + const values = []; + for (const result of results) { + if (result.status === "fulfilled") { + values.push(result.value); + } } + return values; }; - exports2.APIPromise = APIPromise; - var APIClient = class { - constructor({ - baseURL, - maxRetries = 2, - timeout: timeout2 = 6e5, - // 10 minutes - httpAgent, - fetch: overriddenFetch - }) { - this.baseURL = baseURL; - this.maxRetries = validatePositiveInteger("maxRetries", maxRetries); - this.timeout = validatePositiveInteger("timeout", timeout2); - this.httpAgent = httpAgent; - this.fetch = overriddenFetch ?? index_1.fetch; - } - authHeaders(opts) { - return {}; - } + exports2.allSettledWithThrow = allSettledWithThrow; + } +}); + +// node_modules/openai/resources/vector-stores/file-batches.js +var require_file_batches = __commonJS({ + "node_modules/openai/resources/vector-stores/file-batches.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.FileBatches = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var headers_1 = require_headers4(); + var sleep_1 = require_sleep(); + var Util_1 = require_Util(); + var path_1 = require_path2(); + var FileBatches = class extends resource_1.APIResource { /** - * Override this to add your own default headers, for example: - * - * { - * ...super.defaultHeaders(), - * Authorization: 'Bearer 123', - * } + * Create a vector store file batch. */ - defaultHeaders(opts) { - return { - Accept: "application/json", - "Content-Type": "application/json", - "User-Agent": this.getUserAgent(), - ...getPlatformHeaders(), - ...this.authHeaders(opts) - }; + create(vectorStoreID, body2, options) { + return this._client.post((0, path_1.path)`/vector_stores/${vectorStoreID}/file_batches`, { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } /** - * Override this to add your own headers validation: + * Retrieves a vector store file batch. */ - validateHeaders(headers, customHeaders) { - } - defaultIdempotencyKey() { - return `stainless-node-retry-${uuid4()}`; - } - get(path10, opts) { - return this.methodRequest("get", path10, opts); - } - post(path10, opts) { - return this.methodRequest("post", path10, opts); - } - patch(path10, opts) { - return this.methodRequest("patch", path10, opts); - } - put(path10, opts) { - return this.methodRequest("put", path10, opts); + retrieve(batchID, params, options) { + const { vector_store_id } = params; + return this._client.get((0, path_1.path)`/vector_stores/${vector_store_id}/file_batches/${batchID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - delete(path10, opts) { - return this.methodRequest("delete", path10, opts); + /** + * Cancel a vector store file batch. This attempts to cancel the processing of + * files in this batch as soon as possible. + */ + cancel(batchID, params, options) { + const { vector_store_id } = params; + return this._client.post((0, path_1.path)`/vector_stores/${vector_store_id}/file_batches/${batchID}/cancel`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - methodRequest(method, path10, opts) { - return this.request(Promise.resolve(opts).then(async (opts2) => { - const body2 = opts2 && (0, uploads_1.isBlobLike)(opts2?.body) ? new DataView(await opts2.body.arrayBuffer()) : opts2?.body instanceof DataView ? opts2.body : opts2?.body instanceof ArrayBuffer ? new DataView(opts2.body) : opts2 && ArrayBuffer.isView(opts2?.body) ? new DataView(opts2.body.buffer) : opts2?.body; - return { method, path: path10, ...opts2, body: body2 }; - })); + /** + * Create a vector store batch and poll until all files have been processed. + */ + async createAndPoll(vectorStoreId, body2, options) { + const batch = await this.create(vectorStoreId, body2); + return await this.poll(vectorStoreId, batch.id, options); } - getAPIList(path10, Page, opts) { - return this.requestAPIList(Page, { method: "get", path: path10, ...opts }); + /** + * Returns a list of vector store files in a batch. + */ + listFiles(batchID, params, options) { + const { vector_store_id, ...query } = params; + return this._client.getAPIList((0, path_1.path)`/vector_stores/${vector_store_id}/file_batches/${batchID}/files`, pagination_1.CursorPage, { + query, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - calculateContentLength(body2) { - if (typeof body2 === "string") { - if (typeof Buffer !== "undefined") { - return Buffer.byteLength(body2, "utf8").toString(); + /** + * Wait for the given file batch to be processed. + * + * Note: this will return even if one of the files failed to process, you need to + * check batch.file_counts.failed_count to handle this case. + */ + async poll(vectorStoreID, batchID, options) { + const headers = (0, headers_1.buildHeaders)([ + options?.headers, + { + "X-Stainless-Poll-Helper": "true", + "X-Stainless-Custom-Poll-Interval": options?.pollIntervalMs?.toString() ?? void 0 } - if (typeof TextEncoder !== "undefined") { - const encoder = new TextEncoder(); - const encoded = encoder.encode(body2); - return encoded.length.toString(); + ]); + while (true) { + const { data: batch, response } = await this.retrieve(batchID, { vector_store_id: vectorStoreID }, { + ...options, + headers + }).withResponse(); + switch (batch.status) { + case "in_progress": + let sleepInterval = 5e3; + if (options?.pollIntervalMs) { + sleepInterval = options.pollIntervalMs; + } else { + const headerInterval = response.headers.get("openai-poll-after-ms"); + if (headerInterval) { + const headerIntervalMs = parseInt(headerInterval); + if (!isNaN(headerIntervalMs)) { + sleepInterval = headerIntervalMs; + } + } + } + await (0, sleep_1.sleep)(sleepInterval); + break; + case "failed": + case "cancelled": + case "completed": + return batch; } - } else if (ArrayBuffer.isView(body2)) { - return body2.byteLength.toString(); } - return null; } - buildRequest(inputOptions, { retryCount = 0 } = {}) { - const options = { ...inputOptions }; - const { method, path: path10, query, headers = {} } = options; - const body2 = ArrayBuffer.isView(options.body) || options.__binaryRequest && typeof options.body === "string" ? options.body : (0, uploads_1.isMultipartBody)(options.body) ? options.body.body : options.body ? JSON.stringify(options.body, null, 2) : null; - const contentLength2 = this.calculateContentLength(body2); - const url2 = this.buildURL(path10, query); - if ("timeout" in options) - validatePositiveInteger("timeout", options.timeout); - options.timeout = options.timeout ?? this.timeout; - const httpAgent = options.httpAgent ?? this.httpAgent ?? (0, index_1.getDefaultAgent)(url2); - const minAgentTimeout = options.timeout + 1e3; - if (typeof httpAgent?.options?.timeout === "number" && minAgentTimeout > (httpAgent.options.timeout ?? 0)) { - httpAgent.options.timeout = minAgentTimeout; + /** + * Uploads the given files concurrently and then creates a vector store file batch. + * + * The concurrency limit is configurable using the `maxConcurrency` parameter. + */ + async uploadAndPoll(vectorStoreId, { files, fileIds = [] }, options) { + if (files == null || files.length == 0) { + throw new Error(`No \`files\` provided to process. If you've already uploaded files you should use \`.createAndPoll()\` instead`); } - if (this.idempotencyHeader && method !== "get") { - if (!inputOptions.idempotencyKey) - inputOptions.idempotencyKey = this.defaultIdempotencyKey(); - headers[this.idempotencyHeader] = inputOptions.idempotencyKey; + const configuredConcurrency = options?.maxConcurrency ?? 5; + const concurrencyLimit = Math.min(configuredConcurrency, files.length); + const client2 = this._client; + const fileIterator = files.values(); + const allFileIds = [...fileIds]; + async function processFiles(iterator2) { + for (let item of iterator2) { + const fileObj = await client2.files.create({ file: item, purpose: "assistants" }, options); + allFileIds.push(fileObj.id); + } } - const reqHeaders = this.buildHeaders({ options, headers, contentLength: contentLength2, retryCount }); - const req = { - method, - ...body2 && { body: body2 }, - headers: reqHeaders, - ...httpAgent && { agent: httpAgent }, - // @ts-ignore node-fetch uses a custom AbortSignal type that is - // not compatible with standard web types - signal: options.signal ?? null - }; - return { req, url: url2, timeout: options.timeout }; + const workers = Array(concurrencyLimit).fill(fileIterator).map(processFiles); + await (0, Util_1.allSettledWithThrow)(workers); + return await this.createAndPoll(vectorStoreId, { + file_ids: allFileIds + }); } - buildHeaders({ options, headers, contentLength: contentLength2, retryCount }) { - const reqHeaders = {}; - if (contentLength2) { - reqHeaders["content-length"] = contentLength2; - } - const defaultHeaders = this.defaultHeaders(options); - applyHeadersMut(reqHeaders, defaultHeaders); - applyHeadersMut(reqHeaders, headers); - if ((0, uploads_1.isMultipartBody)(options.body) && index_1.kind !== "node") { - delete reqHeaders["content-type"]; - } - if ((0, exports2.getHeader)(defaultHeaders, "x-stainless-retry-count") === void 0 && (0, exports2.getHeader)(headers, "x-stainless-retry-count") === void 0) { - reqHeaders["x-stainless-retry-count"] = String(retryCount); - } - if ((0, exports2.getHeader)(defaultHeaders, "x-stainless-timeout") === void 0 && (0, exports2.getHeader)(headers, "x-stainless-timeout") === void 0 && options.timeout) { - reqHeaders["x-stainless-timeout"] = String(Math.trunc(options.timeout / 1e3)); - } - this.validateHeaders(reqHeaders, headers); - return reqHeaders; + }; + exports2.FileBatches = FileBatches; + } +}); + +// node_modules/openai/resources/vector-stores/files.js +var require_files3 = __commonJS({ + "node_modules/openai/resources/vector-stores/files.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Files = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var headers_1 = require_headers4(); + var utils_1 = require_utils11(); + var path_1 = require_path2(); + var Files = class extends resource_1.APIResource { + /** + * Create a vector store file by attaching a + * [File](https://platform.openai.com/docs/api-reference/files) to a + * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object). + */ + create(vectorStoreID, body2, options) { + return this._client.post((0, path_1.path)`/vector_stores/${vectorStoreID}/files`, { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } /** - * Used as a callback for mutating the given `FinalRequestOptions` object. + * Retrieves a vector store file. */ - async prepareOptions(options) { + retrieve(fileID, params, options) { + const { vector_store_id } = params; + return this._client.get((0, path_1.path)`/vector_stores/${vector_store_id}/files/${fileID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } /** - * Used as a callback for mutating the given `RequestInit` object. - * - * This is useful for cases where you want to add certain headers based off of - * the request properties, e.g. `method` or `url`. + * Update attributes on a vector store file. */ - async prepareRequest(request3, { url: url2, options }) { + update(fileID, params, options) { + const { vector_store_id, ...body2 } = params; + return this._client.post((0, path_1.path)`/vector_stores/${vector_store_id}/files/${fileID}`, { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - parseHeaders(headers) { - return !headers ? {} : Symbol.iterator in headers ? Object.fromEntries(Array.from(headers).map((header) => [...header])) : { ...headers }; + /** + * Returns a list of vector store files. + */ + list(vectorStoreID, query = {}, options) { + return this._client.getAPIList((0, path_1.path)`/vector_stores/${vectorStoreID}/files`, pagination_1.CursorPage, { + query, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - makeStatusError(status, error2, message, headers) { - return error_1.APIError.generate(status, error2, message, headers); + /** + * Delete a vector store file. This will remove the file from the vector store but + * the file itself will not be deleted. To delete the file, use the + * [delete file](https://platform.openai.com/docs/api-reference/files/delete) + * endpoint. + */ + delete(fileID, params, options) { + const { vector_store_id } = params; + return this._client.delete((0, path_1.path)`/vector_stores/${vector_store_id}/files/${fileID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); } - request(options, remainingRetries = null) { - return new APIPromise(this.makeRequest(options, remainingRetries)); + /** + * Attach a file to the given vector store and wait for it to be processed. + */ + async createAndPoll(vectorStoreId, body2, options) { + const file = await this.create(vectorStoreId, body2, options); + return await this.poll(vectorStoreId, file.id, options); } - async makeRequest(optionsInput, retriesRemaining) { - const options = await optionsInput; - const maxRetries = options.maxRetries ?? this.maxRetries; - if (retriesRemaining == null) { - retriesRemaining = maxRetries; - } - await this.prepareOptions(options); - const { req, url: url2, timeout: timeout2 } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining }); - await this.prepareRequest(req, { url: url2, options }); - debug2("request", url2, options, req.headers); - if (options.signal?.aborted) { - throw new error_1.APIUserAbortError(); - } - const controller = new AbortController(); - const response = await this.fetchWithTimeout(url2, req, timeout2, controller).catch(exports2.castToError); - if (response instanceof Error) { - if (options.signal?.aborted) { - throw new error_1.APIUserAbortError(); - } - if (retriesRemaining) { - return this.retryRequest(options, retriesRemaining); + /** + * Wait for the vector store file to finish processing. + * + * Note: this will return even if the file failed to process, you need to check + * file.last_error and file.status to handle these cases + */ + async poll(vectorStoreID, fileID, options) { + const headers = (0, headers_1.buildHeaders)([ + options?.headers, + { + "X-Stainless-Poll-Helper": "true", + "X-Stainless-Custom-Poll-Interval": options?.pollIntervalMs?.toString() ?? void 0 } - if (response.name === "AbortError") { - throw new error_1.APIConnectionTimeoutError(); + ]); + while (true) { + const fileResponse = await this.retrieve(fileID, { + vector_store_id: vectorStoreID + }, { ...options, headers }).withResponse(); + const file = fileResponse.data; + switch (file.status) { + case "in_progress": + let sleepInterval = 5e3; + if (options?.pollIntervalMs) { + sleepInterval = options.pollIntervalMs; + } else { + const headerInterval = fileResponse.response.headers.get("openai-poll-after-ms"); + if (headerInterval) { + const headerIntervalMs = parseInt(headerInterval); + if (!isNaN(headerIntervalMs)) { + sleepInterval = headerIntervalMs; + } + } + } + await (0, utils_1.sleep)(sleepInterval); + break; + case "failed": + case "completed": + return file; } - throw new error_1.APIConnectionError({ cause: response }); } - const responseHeaders = (0, exports2.createResponseHeaders)(response.headers); - if (!response.ok) { - if (retriesRemaining && this.shouldRetry(response)) { - const retryMessage2 = `retrying, ${retriesRemaining} attempts remaining`; - debug2(`response (error; ${retryMessage2})`, response.status, url2, responseHeaders); - return this.retryRequest(options, retriesRemaining, responseHeaders); + } + /** + * Upload a file to the `files` API and then attach it to the given vector store. + * + * Note the file will be asynchronously processed (you can use the alternative + * polling helper method to wait for processing to complete). + */ + async upload(vectorStoreId, file, options) { + const fileInfo = await this._client.files.create({ file, purpose: "assistants" }, options); + return this.create(vectorStoreId, { file_id: fileInfo.id }, options); + } + /** + * Add a file to a vector store and poll until processing is complete. + */ + async uploadAndPoll(vectorStoreId, file, options) { + const fileInfo = await this.upload(vectorStoreId, file, options); + return await this.poll(vectorStoreId, fileInfo.id, options); + } + /** + * Retrieve the parsed contents of a vector store file. + */ + content(fileID, params, options) { + const { vector_store_id } = params; + return this._client.getAPIList((0, path_1.path)`/vector_stores/${vector_store_id}/files/${fileID}/content`, pagination_1.Page, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); + } + }; + exports2.Files = Files; + } +}); + +// node_modules/openai/resources/vector-stores/vector-stores.js +var require_vector_stores = __commonJS({ + "node_modules/openai/resources/vector-stores/vector-stores.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.VectorStores = void 0; + var tslib_1 = require_tslib(); + var resource_1 = require_resource(); + var FileBatchesAPI = tslib_1.__importStar(require_file_batches()); + var file_batches_1 = require_file_batches(); + var FilesAPI = tslib_1.__importStar(require_files3()); + var files_1 = require_files3(); + var pagination_1 = require_pagination(); + var headers_1 = require_headers4(); + var path_1 = require_path2(); + var VectorStores = class extends resource_1.APIResource { + constructor() { + super(...arguments); + this.files = new FilesAPI.Files(this._client); + this.fileBatches = new FileBatchesAPI.FileBatches(this._client); + } + /** + * Create a vector store. + */ + create(body2, options) { + return this._client.post("/vector_stores", { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); + } + /** + * Retrieves a vector store. + */ + retrieve(vectorStoreID, options) { + return this._client.get((0, path_1.path)`/vector_stores/${vectorStoreID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); + } + /** + * Modifies a vector store. + */ + update(vectorStoreID, body2, options) { + return this._client.post((0, path_1.path)`/vector_stores/${vectorStoreID}`, { + body: body2, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); + } + /** + * Returns a list of vector stores. + */ + list(query = {}, options) { + return this._client.getAPIList("/vector_stores", pagination_1.CursorPage, { + query, + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); + } + /** + * Delete a vector store. + */ + delete(vectorStoreID, options) { + return this._client.delete((0, path_1.path)`/vector_stores/${vectorStoreID}`, { + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); + } + /** + * Search a vector store for relevant chunks based on a query and file attributes + * filter. + */ + search(vectorStoreID, body2, options) { + return this._client.getAPIList((0, path_1.path)`/vector_stores/${vectorStoreID}/search`, pagination_1.Page, { + body: body2, + method: "post", + ...options, + headers: (0, headers_1.buildHeaders)([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]), + __security: { bearerAuth: true } + }); + } + }; + exports2.VectorStores = VectorStores; + VectorStores.Files = files_1.Files; + VectorStores.FileBatches = file_batches_1.FileBatches; + } +}); + +// node_modules/openai/resources/videos.js +var require_videos = __commonJS({ + "node_modules/openai/resources/videos.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Videos = void 0; + var resource_1 = require_resource(); + var pagination_1 = require_pagination(); + var headers_1 = require_headers4(); + var uploads_1 = require_uploads(); + var path_1 = require_path2(); + var Videos = class extends resource_1.APIResource { + /** + * Create a new video generation job from a prompt and optional reference assets. + */ + create(body2, options) { + return this._client.post("/videos", (0, uploads_1.multipartFormRequestOptions)({ body: body2, ...options, __security: { bearerAuth: true } }, this._client)); + } + /** + * Fetch the latest metadata for a generated video. + */ + retrieve(videoID, options) { + return this._client.get((0, path_1.path)`/videos/${videoID}`, { ...options, __security: { bearerAuth: true } }); + } + /** + * List recently generated videos for the current project. + */ + list(query = {}, options) { + return this._client.getAPIList("/videos", pagination_1.ConversationCursorPage, { + query, + ...options, + __security: { bearerAuth: true } + }); + } + /** + * Permanently delete a completed or failed video and its stored assets. + */ + delete(videoID, options) { + return this._client.delete((0, path_1.path)`/videos/${videoID}`, { ...options, __security: { bearerAuth: true } }); + } + /** + * Create a character from an uploaded video. + */ + createCharacter(body2, options) { + return this._client.post("/videos/characters", (0, uploads_1.multipartFormRequestOptions)({ body: body2, ...options, __security: { bearerAuth: true } }, this._client)); + } + /** + * Download the generated video bytes or a derived preview asset. + * + * Streams the rendered video content for the specified video job. + */ + downloadContent(videoID, query = {}, options) { + return this._client.get((0, path_1.path)`/videos/${videoID}/content`, { + query, + ...options, + headers: (0, headers_1.buildHeaders)([{ Accept: "application/binary" }, options?.headers]), + __security: { bearerAuth: true }, + __binaryResponse: true + }); + } + /** + * Create a new video generation job by editing a source video or existing + * generated video. + */ + edit(body2, options) { + return this._client.post("/videos/edits", (0, uploads_1.multipartFormRequestOptions)({ body: body2, ...options, __security: { bearerAuth: true } }, this._client)); + } + /** + * Create an extension of a completed video. + */ + extend(body2, options) { + return this._client.post("/videos/extensions", (0, uploads_1.multipartFormRequestOptions)({ body: body2, ...options, __security: { bearerAuth: true } }, this._client)); + } + /** + * Fetch a character. + */ + getCharacter(characterID, options) { + return this._client.get((0, path_1.path)`/videos/characters/${characterID}`, { + ...options, + __security: { bearerAuth: true } + }); + } + /** + * Create a remix of a completed video using a refreshed prompt. + */ + remix(videoID, body2, options) { + return this._client.post((0, path_1.path)`/videos/${videoID}/remix`, (0, uploads_1.maybeMultipartFormRequestOptions)({ body: body2, ...options, __security: { bearerAuth: true } }, this._client)); + } + }; + exports2.Videos = Videos; + } +}); + +// node_modules/openai/resources/webhooks/webhooks.js +var require_webhooks = __commonJS({ + "node_modules/openai/resources/webhooks/webhooks.js"(exports2) { + "use strict"; + var _Webhooks_instances; + var _Webhooks_validateSecret; + var _Webhooks_getRequiredHeader; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Webhooks = void 0; + var tslib_1 = require_tslib(); + var error_1 = require_error3(); + var resource_1 = require_resource(); + var headers_1 = require_headers4(); + var Webhooks = class extends resource_1.APIResource { + constructor() { + super(...arguments); + _Webhooks_instances.add(this); + } + /** + * Validates that the given payload was sent by OpenAI and parses the payload. + */ + async unwrap(payload, headers, secret = this._client.webhookSecret, tolerance = 300) { + await this.verifySignature(payload, headers, secret, tolerance); + return JSON.parse(payload); + } + /** + * Validates whether or not the webhook payload was sent by OpenAI. + * + * An error will be raised if the webhook payload was not sent by OpenAI. + * + * @param payload - The webhook payload + * @param headers - The webhook headers + * @param secret - The webhook secret (optional, will use client secret if not provided) + * @param tolerance - Maximum age of the webhook in seconds (default: 300 = 5 minutes) + */ + async verifySignature(payload, headers, secret = this._client.webhookSecret, tolerance = 300) { + if (typeof crypto === "undefined" || typeof crypto.subtle.importKey !== "function" || typeof crypto.subtle.verify !== "function") { + throw new Error("Webhook signature verification is only supported when the `crypto` global is defined"); + } + tslib_1.__classPrivateFieldGet(this, _Webhooks_instances, "m", _Webhooks_validateSecret).call(this, secret); + const headersObj = (0, headers_1.buildHeaders)([headers]).values; + const signatureHeader = tslib_1.__classPrivateFieldGet(this, _Webhooks_instances, "m", _Webhooks_getRequiredHeader).call(this, headersObj, "webhook-signature"); + const timestamp = tslib_1.__classPrivateFieldGet(this, _Webhooks_instances, "m", _Webhooks_getRequiredHeader).call(this, headersObj, "webhook-timestamp"); + const webhookId = tslib_1.__classPrivateFieldGet(this, _Webhooks_instances, "m", _Webhooks_getRequiredHeader).call(this, headersObj, "webhook-id"); + const timestampSeconds = parseInt(timestamp, 10); + if (isNaN(timestampSeconds)) { + throw new error_1.InvalidWebhookSignatureError("Invalid webhook timestamp format"); + } + const nowSeconds = Math.floor(Date.now() / 1e3); + if (nowSeconds - timestampSeconds > tolerance) { + throw new error_1.InvalidWebhookSignatureError("Webhook timestamp is too old"); + } + if (timestampSeconds > nowSeconds + tolerance) { + throw new error_1.InvalidWebhookSignatureError("Webhook timestamp is too new"); + } + const signatures = signatureHeader.split(" ").map((part) => part.startsWith("v1,") ? part.substring(3) : part); + const decodedSecret = secret.startsWith("whsec_") ? Buffer.from(secret.replace("whsec_", ""), "base64") : Buffer.from(secret, "utf-8"); + const signedPayload = webhookId ? `${webhookId}.${timestamp}.${payload}` : `${timestamp}.${payload}`; + const key = await crypto.subtle.importKey("raw", decodedSecret, { name: "HMAC", hash: "SHA-256" }, false, ["verify"]); + for (const signature of signatures) { + try { + const signatureBytes = Buffer.from(signature, "base64"); + const isValid = await crypto.subtle.verify("HMAC", key, signatureBytes, new TextEncoder().encode(signedPayload)); + if (isValid) { + return; + } + } catch { + continue; } - const errText = await response.text().catch((e6) => (0, exports2.castToError)(e6).message); - const errJSON = (0, exports2.safeJSON)(errText); - const errMessage = errJSON ? void 0 : errText; - const retryMessage = retriesRemaining ? `(error; no more retries left)` : `(error; not retryable)`; - debug2(`response (error; ${retryMessage})`, response.status, url2, responseHeaders, errMessage); - const err = this.makeStatusError(response.status, errJSON, errMessage, responseHeaders); - throw err; } - return { response, options, controller }; + throw new error_1.InvalidWebhookSignatureError("The given webhook signature does not match the expected signature"); } - requestAPIList(Page, options) { - const request3 = this.makeRequest(options, null); - return new PagePromise(this, request3, Page); + }; + exports2.Webhooks = Webhooks; + _Webhooks_instances = /* @__PURE__ */ new WeakSet(), _Webhooks_validateSecret = function _Webhooks_validateSecret2(secret) { + if (typeof secret !== "string" || secret.length === 0) { + throw new Error(`The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function`); } - buildURL(path10, query) { - const url2 = isAbsoluteURL(path10) ? new URL(path10) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path10.startsWith("/") ? path10.slice(1) : path10)); + }, _Webhooks_getRequiredHeader = function _Webhooks_getRequiredHeader2(headers, name) { + if (!headers) { + throw new Error(`Headers are required`); + } + const value = headers.get(name); + if (value === null || value === void 0) { + throw new Error(`Missing required header: ${name}`); + } + return value; + }; + } +}); + +// node_modules/openai/resources/webhooks/index.js +var require_webhooks2 = __commonJS({ + "node_modules/openai/resources/webhooks/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var tslib_1 = require_tslib(); + tslib_1.__exportStar(require_webhooks(), exports2); + } +}); + +// node_modules/openai/resources/webhooks.js +var require_webhooks3 = __commonJS({ + "node_modules/openai/resources/webhooks.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var tslib_1 = require_tslib(); + tslib_1.__exportStar(require_webhooks2(), exports2); + } +}); + +// node_modules/openai/resources/index.js +var require_resources = __commonJS({ + "node_modules/openai/resources/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Webhooks = exports2.Videos = exports2.VectorStores = exports2.Uploads = exports2.Skills = exports2.Responses = exports2.Realtime = exports2.Moderations = exports2.Models = exports2.Images = exports2.Graders = exports2.FineTuning = exports2.Files = exports2.Evals = exports2.Embeddings = exports2.Conversations = exports2.Containers = exports2.Completions = exports2.Beta = exports2.Batches = exports2.Audio = exports2.Admin = void 0; + var tslib_1 = require_tslib(); + tslib_1.__exportStar(require_chat2(), exports2); + tslib_1.__exportStar(require_shared(), exports2); + var admin_1 = require_admin(); + Object.defineProperty(exports2, "Admin", { enumerable: true, get: function() { + return admin_1.Admin; + } }); + var audio_1 = require_audio(); + Object.defineProperty(exports2, "Audio", { enumerable: true, get: function() { + return audio_1.Audio; + } }); + var batches_1 = require_batches(); + Object.defineProperty(exports2, "Batches", { enumerable: true, get: function() { + return batches_1.Batches; + } }); + var beta_1 = require_beta(); + Object.defineProperty(exports2, "Beta", { enumerable: true, get: function() { + return beta_1.Beta; + } }); + var completions_1 = require_completions3(); + Object.defineProperty(exports2, "Completions", { enumerable: true, get: function() { + return completions_1.Completions; + } }); + var containers_1 = require_containers(); + Object.defineProperty(exports2, "Containers", { enumerable: true, get: function() { + return containers_1.Containers; + } }); + var conversations_1 = require_conversations(); + Object.defineProperty(exports2, "Conversations", { enumerable: true, get: function() { + return conversations_1.Conversations; + } }); + var embeddings_1 = require_embeddings(); + Object.defineProperty(exports2, "Embeddings", { enumerable: true, get: function() { + return embeddings_1.Embeddings; + } }); + var evals_1 = require_evals(); + Object.defineProperty(exports2, "Evals", { enumerable: true, get: function() { + return evals_1.Evals; + } }); + var files_1 = require_files2(); + Object.defineProperty(exports2, "Files", { enumerable: true, get: function() { + return files_1.Files; + } }); + var fine_tuning_1 = require_fine_tuning(); + Object.defineProperty(exports2, "FineTuning", { enumerable: true, get: function() { + return fine_tuning_1.FineTuning; + } }); + var graders_1 = require_graders2(); + Object.defineProperty(exports2, "Graders", { enumerable: true, get: function() { + return graders_1.Graders; + } }); + var images_1 = require_images(); + Object.defineProperty(exports2, "Images", { enumerable: true, get: function() { + return images_1.Images; + } }); + var models_1 = require_models(); + Object.defineProperty(exports2, "Models", { enumerable: true, get: function() { + return models_1.Models; + } }); + var moderations_1 = require_moderations(); + Object.defineProperty(exports2, "Moderations", { enumerable: true, get: function() { + return moderations_1.Moderations; + } }); + var realtime_1 = require_realtime2(); + Object.defineProperty(exports2, "Realtime", { enumerable: true, get: function() { + return realtime_1.Realtime; + } }); + var responses_1 = require_responses(); + Object.defineProperty(exports2, "Responses", { enumerable: true, get: function() { + return responses_1.Responses; + } }); + var skills_1 = require_skills(); + Object.defineProperty(exports2, "Skills", { enumerable: true, get: function() { + return skills_1.Skills; + } }); + var uploads_1 = require_uploads3(); + Object.defineProperty(exports2, "Uploads", { enumerable: true, get: function() { + return uploads_1.Uploads; + } }); + var vector_stores_1 = require_vector_stores(); + Object.defineProperty(exports2, "VectorStores", { enumerable: true, get: function() { + return vector_stores_1.VectorStores; + } }); + var videos_1 = require_videos(); + Object.defineProperty(exports2, "Videos", { enumerable: true, get: function() { + return videos_1.Videos; + } }); + var webhooks_1 = require_webhooks3(); + Object.defineProperty(exports2, "Webhooks", { enumerable: true, get: function() { + return webhooks_1.Webhooks; + } }); + } +}); + +// node_modules/openai/client.js +var require_client2 = __commonJS({ + "node_modules/openai/client.js"(exports2) { + "use strict"; + var _OpenAI_instances; + var _a6; + var _OpenAI_encoder; + var _OpenAI_baseURLOverridden; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OpenAI = void 0; + var tslib_1 = require_tslib(); + var uuid_1 = require_uuid(); + var values_1 = require_values(); + var sleep_1 = require_sleep(); + var errors_1 = require_errors7(); + var detect_platform_1 = require_detect_platform(); + var Shims = tslib_1.__importStar(require_shims()); + var Opts = tslib_1.__importStar(require_request_options()); + var query_1 = require_query(); + var version_1 = require_version(); + var Errors = tslib_1.__importStar(require_error2()); + var Pagination = tslib_1.__importStar(require_pagination()); + var workload_identity_auth_1 = require_workload_identity_auth(); + var error_1 = require_error2(); + var Uploads = tslib_1.__importStar(require_uploads2()); + var API = tslib_1.__importStar(require_resources()); + var api_promise_1 = require_api_promise(); + var batches_1 = require_batches(); + var completions_1 = require_completions3(); + var embeddings_1 = require_embeddings(); + var files_1 = require_files2(); + var images_1 = require_images(); + var models_1 = require_models(); + var moderations_1 = require_moderations(); + var videos_1 = require_videos(); + var admin_1 = require_admin(); + var audio_1 = require_audio(); + var beta_1 = require_beta(); + var chat_1 = require_chat(); + var containers_1 = require_containers(); + var conversations_1 = require_conversations(); + var evals_1 = require_evals(); + var fine_tuning_1 = require_fine_tuning(); + var graders_1 = require_graders2(); + var realtime_1 = require_realtime2(); + var responses_1 = require_responses(); + var skills_1 = require_skills(); + var uploads_1 = require_uploads3(); + var vector_stores_1 = require_vector_stores(); + var webhooks_1 = require_webhooks(); + var detect_platform_2 = require_detect_platform(); + var headers_1 = require_headers4(); + var env_1 = require_env(); + var log_1 = require_log2(); + var values_2 = require_values(); + var WORKLOAD_IDENTITY_API_KEY_PLACEHOLDER = "workload-identity-auth"; + var OpenAI = class { + /** + * API Client for interfacing with the OpenAI API. + * + * @param {string | null | undefined} [opts.apiKey=process.env['OPENAI_API_KEY'] ?? null] + * @param {string | null | undefined} [opts.adminAPIKey=process.env['OPENAI_ADMIN_KEY'] ?? null] + * @param {string | null | undefined} [opts.organization=process.env['OPENAI_ORG_ID'] ?? null] + * @param {string | null | undefined} [opts.project=process.env['OPENAI_PROJECT_ID'] ?? null] + * @param {string | null | undefined} [opts.webhookSecret=process.env['OPENAI_WEBHOOK_SECRET'] ?? null] + * @param {string} [opts.baseURL=process.env['OPENAI_BASE_URL'] ?? https://api.openai.com/v1] - Override the default base URL for the API. + * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out. + * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls. + * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation. + * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request. + * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API. + * @param {Record} opts.defaultQuery - Default query parameters to include with every request to the API. + * @param {boolean} [opts.dangerouslyAllowBrowser=false] - By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers. + */ + constructor({ baseURL = (0, env_1.readEnv)("OPENAI_BASE_URL"), apiKey = (0, env_1.readEnv)("OPENAI_API_KEY") ?? null, adminAPIKey = (0, env_1.readEnv)("OPENAI_ADMIN_KEY") ?? null, organization = (0, env_1.readEnv)("OPENAI_ORG_ID") ?? null, project = (0, env_1.readEnv)("OPENAI_PROJECT_ID") ?? null, webhookSecret = (0, env_1.readEnv)("OPENAI_WEBHOOK_SECRET") ?? null, workloadIdentity, ...opts } = {}) { + _OpenAI_instances.add(this); + _OpenAI_encoder.set(this, void 0); + this.completions = new API.Completions(this); + this.chat = new API.Chat(this); + this.embeddings = new API.Embeddings(this); + this.files = new API.Files(this); + this.images = new API.Images(this); + this.audio = new API.Audio(this); + this.moderations = new API.Moderations(this); + this.models = new API.Models(this); + this.fineTuning = new API.FineTuning(this); + this.graders = new API.Graders(this); + this.vectorStores = new API.VectorStores(this); + this.webhooks = new API.Webhooks(this); + this.beta = new API.Beta(this); + this.batches = new API.Batches(this); + this.uploads = new API.Uploads(this); + this.admin = new API.Admin(this); + this.responses = new API.Responses(this); + this.realtime = new API.Realtime(this); + this.conversations = new API.Conversations(this); + this.evals = new API.Evals(this); + this.containers = new API.Containers(this); + this.skills = new API.Skills(this); + this.videos = new API.Videos(this); + const options = { + apiKey, + adminAPIKey, + organization, + project, + webhookSecret, + workloadIdentity, + ...opts, + baseURL: baseURL || `https://api.openai.com/v1` + }; + if (apiKey && workloadIdentity) { + throw new Errors.OpenAIError("The `apiKey` and `workloadIdentity` options are mutually exclusive"); + } + if (!apiKey && !adminAPIKey && !workloadIdentity) { + throw new Errors.OpenAIError("Missing credentials. Please pass an `apiKey`, `workloadIdentity`, `adminAPIKey`, or set the `OPENAI_API_KEY` or `OPENAI_ADMIN_KEY` environment variable."); + } + if (!options.dangerouslyAllowBrowser && (0, detect_platform_2.isRunningInBrowser)()) { + throw new Errors.OpenAIError("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew OpenAI({ apiKey, dangerouslyAllowBrowser: true });\n\nhttps://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety\n"); + } + this.baseURL = options.baseURL; + this.timeout = options.timeout ?? _a6.DEFAULT_TIMEOUT; + this.logger = options.logger ?? console; + const defaultLogLevel = "warn"; + this.logLevel = defaultLogLevel; + this.logLevel = (0, log_1.parseLogLevel)(options.logLevel, "ClientOptions.logLevel", this) ?? (0, log_1.parseLogLevel)((0, env_1.readEnv)("OPENAI_LOG"), "process.env['OPENAI_LOG']", this) ?? defaultLogLevel; + this.fetchOptions = options.fetchOptions; + this.maxRetries = options.maxRetries ?? 2; + this.fetch = options.fetch ?? Shims.getDefaultFetch(); + tslib_1.__classPrivateFieldSet(this, _OpenAI_encoder, Opts.FallbackEncoder, "f"); + const customHeadersEnv = (0, env_1.readEnv)("OPENAI_CUSTOM_HEADERS"); + if (customHeadersEnv) { + const parsed = {}; + for (const line of customHeadersEnv.split("\n")) { + const colon = line.indexOf(":"); + if (colon >= 0) { + parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim(); + } + } + options.defaultHeaders = (0, headers_1.buildHeaders)([parsed, options.defaultHeaders]); + } + this._options = options; + if (workloadIdentity) { + this._workloadIdentityAuth = new workload_identity_auth_1.WorkloadIdentityAuth(workloadIdentity, this.fetch); + } + this.apiKey = typeof apiKey === "string" ? apiKey : null; + this.adminAPIKey = adminAPIKey; + this.organization = organization; + this.project = project; + this.webhookSecret = webhookSecret; + } + /** + * Create a new client instance re-using the same options given to the current client with optional overriding. + */ + withOptions(options) { + const client2 = new this.constructor({ + ...this._options, + baseURL: this.baseURL, + maxRetries: this.maxRetries, + timeout: this.timeout, + logger: this.logger, + logLevel: this.logLevel, + fetch: this.fetch, + fetchOptions: this.fetchOptions, + apiKey: this._options.apiKey, + adminAPIKey: this.adminAPIKey, + workloadIdentity: this._options.workloadIdentity, + organization: this.organization, + project: this.project, + webhookSecret: this.webhookSecret, + ...options + }); + return client2; + } + defaultQuery() { + return this._options.defaultQuery; + } + validateHeaders({ values, nulls }, schemes = { + bearerAuth: true, + adminAPIKeyAuth: true + }) { + if (values.get("authorization") || values.get("api-key")) { + return; + } + if (nulls.has("authorization") || nulls.has("api-key")) { + return; + } + if (this._workloadIdentityAuth && schemes.bearerAuth) { + return; + } + throw new Error('Could not resolve authentication method. Expected either apiKey or adminAPIKey to be set. Or for one of the "Authorization" or "api-key" headers to be explicitly omitted'); + } + async authHeaders(opts, schemes = { + bearerAuth: true, + adminAPIKeyAuth: true + }) { + return (0, headers_1.buildHeaders)([ + schemes.bearerAuth ? await this.bearerAuth(opts) : null, + schemes.adminAPIKeyAuth ? await this.adminAPIKeyAuth(opts) : null + ]); + } + async bearerAuth(opts) { + if (this._workloadIdentityAuth) { + return (0, headers_1.buildHeaders)([{ Authorization: `Bearer ${await this._workloadIdentityAuth.getToken()}` }]); + } + if (this.apiKey == null) { + return void 0; + } + return (0, headers_1.buildHeaders)([{ Authorization: `Bearer ${this.apiKey}` }]); + } + async adminAPIKeyAuth(opts) { + if (this.adminAPIKey == null) { + return void 0; + } + return (0, headers_1.buildHeaders)([{ Authorization: `Bearer ${this.adminAPIKey}` }]); + } + stringifyQuery(query) { + return (0, query_1.stringifyQuery)(query); + } + getUserAgent() { + return `${this.constructor.name}/JS ${version_1.VERSION}`; + } + defaultIdempotencyKey() { + return `stainless-node-retry-${(0, uuid_1.uuid4)()}`; + } + makeStatusError(status, error2, message, headers) { + return Errors.APIError.generate(status, error2, message, headers); + } + async _callApiKey() { + const apiKey = this._options.apiKey; + if (typeof apiKey !== "function") + return false; + let token; + try { + token = await apiKey(); + } catch (err) { + if (err instanceof Errors.OpenAIError) + throw err; + throw new Errors.OpenAIError( + `Failed to get token from 'apiKey' function: ${err.message}`, + // @ts-ignore + { cause: err } + ); + } + if (typeof token !== "string" || !token) { + throw new Errors.OpenAIError(`Expected 'apiKey' function argument to return a string but it returned ${token}`); + } + this.apiKey = token; + return true; + } + buildURL(path10, query, defaultBaseURL) { + const baseURL = !tslib_1.__classPrivateFieldGet(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL; + const url2 = (0, values_1.isAbsoluteURL)(path10) ? new URL(path10) : new URL(baseURL + (baseURL.endsWith("/") && path10.startsWith("/") ? path10.slice(1) : path10)); const defaultQuery = this.defaultQuery(); - if (!isEmptyObj(defaultQuery)) { - query = { ...defaultQuery, ...query }; + const pathQuery = Object.fromEntries(url2.searchParams); + if (!(0, values_2.isEmptyObj)(defaultQuery) || !(0, values_2.isEmptyObj)(pathQuery)) { + query = { ...pathQuery, ...defaultQuery, ...query }; } if (typeof query === "object" && query && !Array.isArray(query)) { url2.search = this.stringifyQuery(query); } return url2.toString(); } - stringifyQuery(query) { - return Object.entries(query).filter(([_3, value]) => typeof value !== "undefined").map(([key, value]) => { - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { - return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`; + /** + * Used as a callback for mutating the given `FinalRequestOptions` object. + */ + async prepareOptions(options) { + const security = options.__security ?? { bearerAuth: true }; + if (security.bearerAuth) { + await this._callApiKey(); + } + } + /** + * Used as a callback for mutating the given `RequestInit` object. + * + * This is useful for cases where you want to add certain headers based off of + * the request properties, e.g. `method` or `url`. + */ + async prepareRequest(request2, { url: url2, options }) { + } + get(path10, opts) { + return this.methodRequest("get", path10, opts); + } + post(path10, opts) { + return this.methodRequest("post", path10, opts); + } + patch(path10, opts) { + return this.methodRequest("patch", path10, opts); + } + put(path10, opts) { + return this.methodRequest("put", path10, opts); + } + delete(path10, opts) { + return this.methodRequest("delete", path10, opts); + } + methodRequest(method, path10, opts) { + return this.request(Promise.resolve(opts).then((opts2) => { + return { method, path: path10, ...opts2 }; + })); + } + request(options, remainingRetries = null) { + return new api_promise_1.APIPromise(this, this.makeRequest(options, remainingRetries, void 0)); + } + async makeRequest(optionsInput, retriesRemaining, retryOfRequestLogID) { + const options = await optionsInput; + const maxRetries = options.maxRetries ?? this.maxRetries; + if (retriesRemaining == null) { + retriesRemaining = maxRetries; + } + await this.prepareOptions(options); + const { req, url: url2, timeout: timeout2 } = await this.buildRequest(options, { + retryCount: maxRetries - retriesRemaining + }); + await this.prepareRequest(req, { url: url2, options }); + const requestLogID = "log_" + (Math.random() * (1 << 24) | 0).toString(16).padStart(6, "0"); + const retryLogStr = retryOfRequestLogID === void 0 ? "" : `, retryOf: ${retryOfRequestLogID}`; + const startTime = Date.now(); + (0, log_1.loggerFor)(this).debug(`[${requestLogID}] sending request`, (0, log_1.formatRequestDetails)({ + retryOfRequestLogID, + method: options.method, + url: url2, + options, + headers: req.headers + })); + if (options.signal?.aborted) { + throw new Errors.APIUserAbortError(); + } + const security = options.__security ?? { bearerAuth: true }; + const controller = new AbortController(); + const response = await this.fetchWithAuth(url2, req, timeout2, controller, security).catch(errors_1.castToError); + const headersTime = Date.now(); + if (response instanceof globalThis.Error) { + const retryMessage = `retrying, ${retriesRemaining} attempts remaining`; + if (options.signal?.aborted) { + throw new Errors.APIUserAbortError(); } - if (value === null) { - return `${encodeURIComponent(key)}=`; + const isTimeout = (0, errors_1.isAbortError)(response) || /timed? ?out/i.test(String(response) + ("cause" in response ? String(response.cause) : "")); + if (retriesRemaining) { + (0, log_1.loggerFor)(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - ${retryMessage}`); + (0, log_1.loggerFor)(this).debug(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (${retryMessage})`, (0, log_1.formatRequestDetails)({ + retryOfRequestLogID, + url: url2, + durationMs: headersTime - startTime, + message: response.message + })); + return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID); + } + (0, log_1.loggerFor)(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - error; no more retries left`); + (0, log_1.loggerFor)(this).debug(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (error; no more retries left)`, (0, log_1.formatRequestDetails)({ + retryOfRequestLogID, + url: url2, + durationMs: headersTime - startTime, + message: response.message + })); + if (response instanceof error_1.OAuthError || response instanceof error_1.SubjectTokenProviderError) { + throw response; } - throw new error_1.OpenAIError(`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`); - }).join("&"); + if (isTimeout) { + throw new Errors.APIConnectionTimeoutError(); + } + throw new Errors.APIConnectionError({ + message: getConnectionErrorMessage(response), + cause: response + }); + } + const specialHeaders = [...response.headers.entries()].filter(([name]) => name === "x-request-id").map(([name, value]) => ", " + name + ": " + JSON.stringify(value)).join(""); + const responseInfo = `[${requestLogID}${retryLogStr}${specialHeaders}] ${req.method} ${url2} ${response.ok ? "succeeded" : "failed"} with status ${response.status} in ${headersTime - startTime}ms`; + if (!response.ok) { + if (response.status === 401 && this._workloadIdentityAuth && security.bearerAuth && !options.__metadata?.["hasStreamingBody"] && !options.__metadata?.["workloadIdentityTokenRefreshed"]) { + await Shims.CancelReadableStream(response.body); + this._workloadIdentityAuth.invalidateToken(); + return this.makeRequest({ + ...options, + __metadata: { + ...options.__metadata, + workloadIdentityTokenRefreshed: true + } + }, retriesRemaining, retryOfRequestLogID ?? requestLogID); + } + const shouldRetry = await this.shouldRetry(response); + if (retriesRemaining && shouldRetry) { + const retryMessage2 = `retrying, ${retriesRemaining} attempts remaining`; + await Shims.CancelReadableStream(response.body); + (0, log_1.loggerFor)(this).info(`${responseInfo} - ${retryMessage2}`); + (0, log_1.loggerFor)(this).debug(`[${requestLogID}] response error (${retryMessage2})`, (0, log_1.formatRequestDetails)({ + retryOfRequestLogID, + url: response.url, + status: response.status, + headers: response.headers, + durationMs: headersTime - startTime + })); + return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID, response.headers); + } + const retryMessage = shouldRetry ? `error; no more retries left` : `error; not retryable`; + (0, log_1.loggerFor)(this).info(`${responseInfo} - ${retryMessage}`); + const errText = await response.text().catch((err2) => (0, errors_1.castToError)(err2).message); + const errJSON = (0, values_1.safeJSON)(errText); + const errMessage = errJSON ? void 0 : errText; + (0, log_1.loggerFor)(this).debug(`[${requestLogID}] response error (${retryMessage})`, (0, log_1.formatRequestDetails)({ + retryOfRequestLogID, + url: response.url, + status: response.status, + headers: response.headers, + message: errMessage, + durationMs: Date.now() - startTime + })); + const err = this.makeStatusError(response.status, errJSON, errMessage, response.headers); + throw err; + } + (0, log_1.loggerFor)(this).info(responseInfo); + (0, log_1.loggerFor)(this).debug(`[${requestLogID}] response start`, (0, log_1.formatRequestDetails)({ + retryOfRequestLogID, + url: response.url, + status: response.status, + headers: response.headers, + durationMs: headersTime - startTime + })); + return { response, options, controller, requestLogID, retryOfRequestLogID, startTime }; + } + getAPIList(path10, Page, opts) { + return this.requestAPIList(Page, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path10, ...opts2 })) : { method: "get", path: path10, ...opts }); + } + requestAPIList(Page, options) { + const request2 = this.makeRequest(options, null, void 0); + return new Pagination.PagePromise(this, request2, Page); + } + async fetchWithAuth(url2, init, timeout2, controller, schemes = { + bearerAuth: true, + adminAPIKeyAuth: true + }) { + if (this._workloadIdentityAuth && schemes.bearerAuth) { + const headers = init.headers; + const authHeader = headers.get("Authorization"); + if (!authHeader || authHeader === `Bearer ${WORKLOAD_IDENTITY_API_KEY_PLACEHOLDER}`) { + const token = await this._workloadIdentityAuth.getToken(); + headers.set("Authorization", `Bearer ${token}`); + } + } + const response = await this.fetchWithTimeout(url2, init, timeout2, controller); + return response; } async fetchWithTimeout(url2, init, ms2, controller) { - const { signal, ...options } = init || {}; + const { signal, method, ...options } = init || {}; + const abort = this._makeAbort(controller); if (signal) - signal.addEventListener("abort", () => controller.abort()); - const timeout2 = setTimeout(() => controller.abort(), ms2); + signal.addEventListener("abort", abort, { once: true }); + const timeout2 = setTimeout(abort, ms2); + const isReadableBody = globalThis.ReadableStream && options.body instanceof globalThis.ReadableStream || typeof options.body === "object" && options.body !== null && Symbol.asyncIterator in options.body; const fetchOptions = { signal: controller.signal, + ...isReadableBody ? { duplex: "half" } : {}, + method: "GET", ...options }; - if (fetchOptions.method) { - fetchOptions.method = fetchOptions.method.toUpperCase(); + if (method) { + fetchOptions.method = method.toUpperCase(); + } + try { + return await this.fetch.call(void 0, url2, fetchOptions); + } finally { + clearTimeout(timeout2); } - return ( - // use undefined this binding; fetch errors if bound to something else in browser/cloudflare - this.fetch.call(void 0, url2, fetchOptions).finally(() => { - clearTimeout(timeout2); - }) - ); } - shouldRetry(response) { + async shouldRetry(response) { const shouldRetryHeader = response.headers.get("x-should-retry"); if (shouldRetryHeader === "true") return true; @@ -106337,16 +111377,16 @@ var require_core2 = __commonJS({ return true; return false; } - async retryRequest(options, retriesRemaining, responseHeaders) { + async retryRequest(options, retriesRemaining, requestLogID, responseHeaders) { let timeoutMillis; - const retryAfterMillisHeader = responseHeaders?.["retry-after-ms"]; + const retryAfterMillisHeader = responseHeaders?.get("retry-after-ms"); if (retryAfterMillisHeader) { const timeoutMs = parseFloat(retryAfterMillisHeader); if (!Number.isNaN(timeoutMs)) { timeoutMillis = timeoutMs; } } - const retryAfterHeader = responseHeaders?.["retry-after"]; + const retryAfterHeader = responseHeaders?.get("retry-after"); if (retryAfterHeader && !timeoutMillis) { const timeoutSeconds = parseFloat(retryAfterHeader); if (!Number.isNaN(timeoutSeconds)) { @@ -106355,12 +111395,12 @@ var require_core2 = __commonJS({ timeoutMillis = Date.parse(retryAfterHeader) - Date.now(); } } - if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1e3)) { + if (timeoutMillis === void 0) { const maxRetries = options.maxRetries ?? this.maxRetries; timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries); } - await (0, exports2.sleep)(timeoutMillis); - return this.makeRequest(options, retriesRemaining - 1); + await (0, sleep_1.sleep)(timeoutMillis); + return this.makeRequest(options, retriesRemaining - 1, requestLogID); } calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries) { const initialRetryDelay = 0.5; @@ -106370,6952 +111410,6488 @@ var require_core2 = __commonJS({ const jitter = 1 - Math.random() * 0.25; return sleepSeconds * jitter * 1e3; } - getUserAgent() { - return `${this.constructor.name}/JS ${version_1.VERSION}`; - } - }; - exports2.APIClient = APIClient; - var AbstractPage = class { - constructor(client2, response, body2, options) { - _AbstractPage_client.set(this, void 0); - __classPrivateFieldSet(this, _AbstractPage_client, client2, "f"); - this.options = options; - this.response = response; - this.body = body2; - } - hasNextPage() { - const items = this.getPaginatedItems(); - if (!items.length) - return false; - return this.nextPageInfo() != null; - } - async getNextPage() { - const nextInfo = this.nextPageInfo(); - if (!nextInfo) { - throw new error_1.OpenAIError("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`."); - } - const nextOptions = { ...this.options }; - if ("params" in nextInfo && typeof nextOptions.query === "object") { - nextOptions.query = { ...nextOptions.query, ...nextInfo.params }; - } else if ("url" in nextInfo) { - const params = [...Object.entries(nextOptions.query || {}), ...nextInfo.url.searchParams.entries()]; - for (const [key, value] of params) { - nextInfo.url.searchParams.set(key, value); - } - nextOptions.query = void 0; - nextOptions.path = nextInfo.url.toString(); + async buildRequest(inputOptions, { retryCount = 0 } = {}) { + const options = { ...inputOptions }; + const { method, path: path10, query, defaultBaseURL } = options; + const url2 = this.buildURL(path10, query, defaultBaseURL); + if ("timeout" in options) + (0, values_1.validatePositiveInteger)("timeout", options.timeout); + options.timeout = options.timeout ?? this.timeout; + const { bodyHeaders, body: body2, isStreamingBody } = this.buildBody({ options }); + if (isStreamingBody) { + inputOptions.__metadata = { + ...inputOptions.__metadata, + hasStreamingBody: true + }; } - return await __classPrivateFieldGet(this, _AbstractPage_client, "f").requestAPIList(this.constructor, nextOptions); + const reqHeaders = await this.buildHeaders({ options: inputOptions, method, bodyHeaders, retryCount }); + const req = { + method, + headers: reqHeaders, + ...options.signal && { signal: options.signal }, + ...globalThis.ReadableStream && body2 instanceof globalThis.ReadableStream && { duplex: "half" }, + ...body2 && { body: body2 }, + ...this.fetchOptions ?? {}, + ...options.fetchOptions ?? {} + }; + return { req, url: url2, timeout: options.timeout }; } - async *iterPages() { - let page = this; - yield page; - while (page.hasNextPage()) { - page = await page.getNextPage(); - yield page; + async buildHeaders({ options, method, bodyHeaders, retryCount }) { + let idempotencyHeaders = {}; + if (this.idempotencyHeader && method !== "get") { + if (!options.idempotencyKey) + options.idempotencyKey = this.defaultIdempotencyKey(); + idempotencyHeaders[this.idempotencyHeader] = options.idempotencyKey; } + const headers = (0, headers_1.buildHeaders)([ + idempotencyHeaders, + { + Accept: "application/json", + "User-Agent": this.getUserAgent(), + "X-Stainless-Retry-Count": String(retryCount), + ...options.timeout ? { "X-Stainless-Timeout": String(Math.trunc(options.timeout / 1e3)) } : {}, + ...(0, detect_platform_1.getPlatformHeaders)(), + "OpenAI-Organization": this.organization, + "OpenAI-Project": this.project + }, + await this.authHeaders(options, options.__security ?? { bearerAuth: true }), + this._options.defaultHeaders, + bodyHeaders, + options.headers + ]); + this.validateHeaders(headers, options.__security ?? { bearerAuth: true }); + return headers.values; } - async *[(_AbstractPage_client = /* @__PURE__ */ new WeakMap(), Symbol.asyncIterator)]() { - for await (const page of this.iterPages()) { - for (const item of page.getPaginatedItems()) { - yield item; - } + _makeAbort(controller) { + return () => controller.abort(); + } + buildBody({ options: { body: body2, headers: rawHeaders } }) { + if (!body2) { + return { bodyHeaders: void 0, body: void 0, isStreamingBody: false }; + } + const headers = (0, headers_1.buildHeaders)([rawHeaders]); + const isReadableStream4 = typeof globalThis.ReadableStream !== "undefined" && body2 instanceof globalThis.ReadableStream; + const isRetryableBody = !isReadableStream4 && (typeof body2 === "string" || body2 instanceof ArrayBuffer || ArrayBuffer.isView(body2) || typeof globalThis.Blob !== "undefined" && body2 instanceof globalThis.Blob || body2 instanceof URLSearchParams || body2 instanceof FormData); + if ( + // Pass raw type verbatim + ArrayBuffer.isView(body2) || body2 instanceof ArrayBuffer || body2 instanceof DataView || typeof body2 === "string" && // Preserve legacy string encoding behavior for now + headers.values.has("content-type") || // `Blob` is superset of `File` + globalThis.Blob && body2 instanceof globalThis.Blob || // `FormData` -> `multipart/form-data` + body2 instanceof FormData || // `URLSearchParams` -> `application/x-www-form-urlencoded` + body2 instanceof URLSearchParams || // Send chunked stream (each chunk has own `length`) + isReadableStream4 + ) { + return { bodyHeaders: void 0, body: body2, isStreamingBody: !isRetryableBody }; + } else if (typeof body2 === "object" && (Symbol.asyncIterator in body2 || Symbol.iterator in body2 && "next" in body2 && typeof body2.next === "function")) { + return { + bodyHeaders: void 0, + body: Shims.ReadableStreamFrom(body2), + isStreamingBody: true + }; + } else if (typeof body2 === "object" && headers.values.get("content-type") === "application/x-www-form-urlencoded") { + return { + bodyHeaders: { "content-type": "application/x-www-form-urlencoded" }, + body: this.stringifyQuery(body2), + isStreamingBody: false + }; + } else { + return { ...tslib_1.__classPrivateFieldGet(this, _OpenAI_encoder, "f").call(this, { body: body2, headers }), isStreamingBody: false }; } } }; - exports2.AbstractPage = AbstractPage; - var PagePromise = class extends APIPromise { - constructor(client2, request3, Page) { - super(request3, async (props) => new Page(client2, props.response, await defaultParseResponse(props), props.options)); + exports2.OpenAI = OpenAI; + _a6 = OpenAI, _OpenAI_encoder = /* @__PURE__ */ new WeakMap(), _OpenAI_instances = /* @__PURE__ */ new WeakSet(), _OpenAI_baseURLOverridden = function _OpenAI_baseURLOverridden2() { + return this.baseURL !== "https://api.openai.com/v1"; + }; + OpenAI.OpenAI = _a6; + OpenAI.DEFAULT_TIMEOUT = 6e5; + OpenAI.OpenAIError = Errors.OpenAIError; + OpenAI.APIError = Errors.APIError; + OpenAI.APIConnectionError = Errors.APIConnectionError; + OpenAI.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError; + OpenAI.APIUserAbortError = Errors.APIUserAbortError; + OpenAI.NotFoundError = Errors.NotFoundError; + OpenAI.ConflictError = Errors.ConflictError; + OpenAI.RateLimitError = Errors.RateLimitError; + OpenAI.BadRequestError = Errors.BadRequestError; + OpenAI.AuthenticationError = Errors.AuthenticationError; + OpenAI.InternalServerError = Errors.InternalServerError; + OpenAI.PermissionDeniedError = Errors.PermissionDeniedError; + OpenAI.UnprocessableEntityError = Errors.UnprocessableEntityError; + OpenAI.InvalidWebhookSignatureError = Errors.InvalidWebhookSignatureError; + OpenAI.toFile = Uploads.toFile; + OpenAI.Completions = completions_1.Completions; + OpenAI.Chat = chat_1.Chat; + OpenAI.Embeddings = embeddings_1.Embeddings; + OpenAI.Files = files_1.Files; + OpenAI.Images = images_1.Images; + OpenAI.Audio = audio_1.Audio; + OpenAI.Moderations = moderations_1.Moderations; + OpenAI.Models = models_1.Models; + OpenAI.FineTuning = fine_tuning_1.FineTuning; + OpenAI.Graders = graders_1.Graders; + OpenAI.VectorStores = vector_stores_1.VectorStores; + OpenAI.Webhooks = webhooks_1.Webhooks; + OpenAI.Beta = beta_1.Beta; + OpenAI.Batches = batches_1.Batches; + OpenAI.Uploads = uploads_1.Uploads; + OpenAI.Admin = admin_1.Admin; + OpenAI.Responses = responses_1.Responses; + OpenAI.Realtime = realtime_1.Realtime; + OpenAI.Conversations = conversations_1.Conversations; + OpenAI.Evals = evals_1.Evals; + OpenAI.Containers = containers_1.Containers; + OpenAI.Skills = skills_1.Skills; + OpenAI.Videos = videos_1.Videos; + function getConnectionErrorMessage(error2) { + if (isUndiciDispatcherVersionMismatchError(error2)) { + return `Connection error. This may be caused by passing an undici dispatcher, such as ProxyAgent, that is incompatible with the fetch implementation. If you are using undici's ProxyAgent, pass the fetch implementation from the same undici package: import { fetch, ProxyAgent } from 'undici'; new OpenAI({ fetch, fetchOptions: { dispatcher: new ProxyAgent(...) } });`; + } + return void 0; + } + function isUndiciDispatcherVersionMismatchError(error2) { + let current = error2; + for (let i6 = 0; i6 < 8 && current && typeof current === "object"; i6++) { + const err = current; + if (err.code === "UND_ERR_INVALID_ARG" && typeof err.message === "string" && err.message.includes("invalid onRequestStart method")) { + return true; + } + current = err.cause; } + return false; + } + } +}); + +// node_modules/openai/azure.js +var require_azure = __commonJS({ + "node_modules/openai/azure.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AzureOpenAI = void 0; + var tslib_1 = require_tslib(); + var headers_1 = require_headers4(); + var Errors = tslib_1.__importStar(require_error3()); + var utils_1 = require_utils11(); + var client_1 = require_client2(); + var AzureOpenAI = class extends client_1.OpenAI { /** - * Allow auto-paginating iteration on an unawaited list call, eg: + * API Client for interfacing with the Azure OpenAI API. * - * for await (const item of client.items.list()) { - * console.log(item) - * } + * @param {string | undefined} [opts.apiVersion=process.env['OPENAI_API_VERSION'] ?? undefined] + * @param {string | undefined} [opts.endpoint=process.env['AZURE_OPENAI_ENDPOINT'] ?? undefined] - Your Azure endpoint, including the resource, e.g. `https://example-resource.azure.openai.com/` + * @param {string | undefined} [opts.apiKey=process.env['AZURE_OPENAI_API_KEY'] ?? undefined] + * @param {string | undefined} opts.deployment - A model deployment, if given, sets the base client URL to include `/deployments/{deployment}`. + * @param {string | null | undefined} [opts.organization=process.env['OPENAI_ORG_ID'] ?? null] + * @param {string} [opts.baseURL=process.env['OPENAI_BASE_URL']] - Sets the base URL for the API, e.g. `https://example-resource.azure.openai.com/openai/`. + * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out. + * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections. + * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation. + * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request. + * @param {Headers} opts.defaultHeaders - Default headers to include with every request to the API. + * @param {DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API. + * @param {boolean} [opts.dangerouslyAllowBrowser=false] - By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers. */ - async *[Symbol.asyncIterator]() { - const page = await this; - for await (const item of page) { - yield item; + constructor({ baseURL = (0, utils_1.readEnv)("OPENAI_BASE_URL"), apiKey = (0, utils_1.readEnv)("AZURE_OPENAI_API_KEY"), apiVersion = (0, utils_1.readEnv)("OPENAI_API_VERSION"), endpoint: endpoint2, deployment, azureADTokenProvider, dangerouslyAllowBrowser, ...opts } = {}) { + if (!apiVersion) { + throw new Errors.OpenAIError("The OPENAI_API_VERSION environment variable is missing or empty; either provide it, or instantiate the AzureOpenAI client with an apiVersion option, like new AzureOpenAI({ apiVersion: 'My API Version' })."); } - } - }; - exports2.PagePromise = PagePromise; - var createResponseHeaders = (headers) => { - return new Proxy(Object.fromEntries( - // @ts-ignore - headers.entries() - ), { - get(target, name) { - const key = name.toString(); - return target[key.toLowerCase()] || target[key]; + if (typeof azureADTokenProvider === "function") { + dangerouslyAllowBrowser = true; } - }); - }; - exports2.createResponseHeaders = createResponseHeaders; - var requestOptionsKeys = { - method: true, - path: true, - query: true, - body: true, - headers: true, - maxRetries: true, - stream: true, - timeout: true, - httpAgent: true, - signal: true, - idempotencyKey: true, - __metadata: true, - __binaryRequest: true, - __binaryResponse: true, - __streamClass: true - }; - var isRequestOptions = (obj) => { - return typeof obj === "object" && obj !== null && !isEmptyObj(obj) && Object.keys(obj).every((k7) => hasOwn(requestOptionsKeys, k7)); - }; - exports2.isRequestOptions = isRequestOptions; - var getPlatformProperties = () => { - if (typeof Deno !== "undefined" && Deno.build != null) { - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": version_1.VERSION, - "X-Stainless-OS": normalizePlatform(Deno.build.os), - "X-Stainless-Arch": normalizeArch(Deno.build.arch), - "X-Stainless-Runtime": "deno", - "X-Stainless-Runtime-Version": typeof Deno.version === "string" ? Deno.version : Deno.version?.deno ?? "unknown" - }; - } - if (typeof EdgeRuntime !== "undefined") { - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": version_1.VERSION, - "X-Stainless-OS": "Unknown", - "X-Stainless-Arch": `other:${EdgeRuntime}`, - "X-Stainless-Runtime": "edge", - "X-Stainless-Runtime-Version": process.version - }; - } - if (Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]") { - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": version_1.VERSION, - "X-Stainless-OS": normalizePlatform(process.platform), - "X-Stainless-Arch": normalizeArch(process.arch), - "X-Stainless-Runtime": "node", - "X-Stainless-Runtime-Version": process.version - }; - } - const browserInfo = getBrowserInfo(); - if (browserInfo) { - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": version_1.VERSION, - "X-Stainless-OS": "Unknown", - "X-Stainless-Arch": "unknown", - "X-Stainless-Runtime": `browser:${browserInfo.browser}`, - "X-Stainless-Runtime-Version": browserInfo.version - }; - } - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": version_1.VERSION, - "X-Stainless-OS": "Unknown", - "X-Stainless-Arch": "unknown", - "X-Stainless-Runtime": "unknown", - "X-Stainless-Runtime-Version": "unknown" - }; - }; - function getBrowserInfo() { - if (typeof navigator === "undefined" || !navigator) { - return null; - } - const browserPatterns = [ - { key: "edge", pattern: /Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: "ie", pattern: /MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: "ie", pattern: /Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: "chrome", pattern: /Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: "firefox", pattern: /Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: "safari", pattern: /(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/ } - ]; - for (const { key, pattern } of browserPatterns) { - const match3 = pattern.exec(navigator.userAgent); - if (match3) { - const major = match3[1] || 0; - const minor = match3[2] || 0; - const patch = match3[3] || 0; - return { browser: key, version: `${major}.${minor}.${patch}` }; + if (!azureADTokenProvider && !apiKey) { + throw new Errors.OpenAIError("Missing credentials. Please pass one of `apiKey` and `azureADTokenProvider`, or set the `AZURE_OPENAI_API_KEY` environment variable."); } - } - return null; - } - var normalizeArch = (arch2) => { - if (arch2 === "x32") - return "x32"; - if (arch2 === "x86_64" || arch2 === "x64") - return "x64"; - if (arch2 === "arm") - return "arm"; - if (arch2 === "aarch64" || arch2 === "arm64") - return "arm64"; - if (arch2) - return `other:${arch2}`; - return "unknown"; - }; - var normalizePlatform = (platform3) => { - platform3 = platform3.toLowerCase(); - if (platform3.includes("ios")) - return "iOS"; - if (platform3 === "android") - return "Android"; - if (platform3 === "darwin") - return "MacOS"; - if (platform3 === "win32") - return "Windows"; - if (platform3 === "freebsd") - return "FreeBSD"; - if (platform3 === "openbsd") - return "OpenBSD"; - if (platform3 === "linux") - return "Linux"; - if (platform3) - return `Other:${platform3}`; - return "Unknown"; - }; - var _platformHeaders; - var getPlatformHeaders = () => { - return _platformHeaders ?? (_platformHeaders = getPlatformProperties()); - }; - var safeJSON = (text) => { - try { - return JSON.parse(text); - } catch (err) { - return void 0; - } - }; - exports2.safeJSON = safeJSON; - var startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i; - var isAbsoluteURL = (url2) => { - return startsWithSchemeRegexp.test(url2); - }; - var sleep = (ms2) => new Promise((resolve4) => setTimeout(resolve4, ms2)); - exports2.sleep = sleep; - var validatePositiveInteger = (name, n12) => { - if (typeof n12 !== "number" || !Number.isInteger(n12)) { - throw new error_1.OpenAIError(`${name} must be an integer`); - } - if (n12 < 0) { - throw new error_1.OpenAIError(`${name} must be a positive integer`); - } - return n12; - }; - var castToError = (err) => { - if (err instanceof Error) - return err; - if (typeof err === "object" && err !== null) { - try { - return new Error(JSON.stringify(err)); - } catch { + if (azureADTokenProvider && apiKey) { + throw new Errors.OpenAIError("The `apiKey` and `azureADTokenProvider` arguments are mutually exclusive; only one can be passed at a time."); } + opts.defaultQuery = { ...opts.defaultQuery, "api-version": apiVersion }; + if (!baseURL) { + if (!endpoint2) { + endpoint2 = process.env["AZURE_OPENAI_ENDPOINT"]; + } + if (!endpoint2) { + throw new Errors.OpenAIError("Must provide one of the `baseURL` or `endpoint` arguments, or the `AZURE_OPENAI_ENDPOINT` environment variable"); + } + baseURL = `${endpoint2}/openai`; + } else { + if (endpoint2) { + throw new Errors.OpenAIError("baseURL and endpoint are mutually exclusive"); + } + } + super({ + apiKey: azureADTokenProvider ?? apiKey, + baseURL, + ...opts, + ...dangerouslyAllowBrowser !== void 0 ? { dangerouslyAllowBrowser } : {} + }); + this.apiVersion = ""; + this.apiVersion = apiVersion; + this.deploymentName = deployment; } - return new Error(err); - }; - exports2.castToError = castToError; - var ensurePresent = (value) => { - if (value == null) - throw new error_1.OpenAIError(`Expected a value to be given but received ${value} instead.`); - return value; - }; - exports2.ensurePresent = ensurePresent; - var readEnv = (env2) => { - if (typeof process !== "undefined") { - return process.env?.[env2]?.trim() ?? void 0; - } - if (typeof Deno !== "undefined") { - return Deno.env?.get?.(env2)?.trim(); - } - return void 0; - }; - exports2.readEnv = readEnv; - var coerceInteger = (value) => { - if (typeof value === "number") - return Math.round(value); - if (typeof value === "string") - return parseInt(value, 10); - throw new error_1.OpenAIError(`Could not coerce ${value} (type: ${typeof value}) into a number`); - }; - exports2.coerceInteger = coerceInteger; - var coerceFloat = (value) => { - if (typeof value === "number") - return value; - if (typeof value === "string") - return parseFloat(value); - throw new error_1.OpenAIError(`Could not coerce ${value} (type: ${typeof value}) into a number`); - }; - exports2.coerceFloat = coerceFloat; - var coerceBoolean = (value) => { - if (typeof value === "boolean") - return value; - if (typeof value === "string") - return value === "true"; - return Boolean(value); - }; - exports2.coerceBoolean = coerceBoolean; - var maybeCoerceInteger = (value) => { - if (value === void 0) { - return void 0; + async buildRequest(options, props = {}) { + if (_deployments_endpoints.has(options.path) && options.method === "post" && options.body !== void 0) { + if (!(0, utils_1.isObj)(options.body)) { + throw new Error("Expected request body to be an object"); + } + const model = this.deploymentName || options.body["model"] || options.__metadata?.["model"]; + if (model !== void 0 && !this.baseURL.includes("/deployments")) { + options.path = `/deployments/${model}${options.path}`; + } + } + return super.buildRequest(options, props); } - return (0, exports2.coerceInteger)(value); - }; - exports2.maybeCoerceInteger = maybeCoerceInteger; - var maybeCoerceFloat = (value) => { - if (value === void 0) { - return void 0; + async authHeaders(opts, schemes) { + const security = schemes ?? { bearerAuth: true, adminAPIKeyAuth: true }; + if (security.bearerAuth && typeof this._options.apiKey === "string") { + return (0, headers_1.buildHeaders)([{ "api-key": this.apiKey }]); + } + return super.authHeaders(opts, security); } - return (0, exports2.coerceFloat)(value); }; - exports2.maybeCoerceFloat = maybeCoerceFloat; - var maybeCoerceBoolean = (value) => { - if (value === void 0) { - return void 0; + exports2.AzureOpenAI = AzureOpenAI; + var _deployments_endpoints = /* @__PURE__ */ new Set([ + "/completions", + "/chat/completions", + "/embeddings", + "/audio/transcriptions", + "/audio/translations", + "/audio/speech", + "/images/generations", + "/batches", + "/images/edits" + ]); + } +}); + +// node_modules/openai/bedrock.js +var require_bedrock = __commonJS({ + "node_modules/openai/bedrock.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BedrockOpenAI = void 0; + var tslib_1 = require_tslib(); + var Errors = tslib_1.__importStar(require_error3()); + var client_1 = require_client2(); + var headers_1 = require_headers4(); + var utils_1 = require_utils11(); + var ResponsesParser_1 = require_ResponsesParser(); + var API = tslib_1.__importStar(require_resources()); + function deriveBedrockBaseURL(awsRegion) { + const region = awsRegion?.trim(); + if (!region) { + throw new Errors.OpenAIError("Must provide one of the `baseURL` or `awsRegion` arguments, or set the `AWS_BEDROCK_BASE_URL`, `AWS_REGION`, or `AWS_DEFAULT_REGION` environment variable."); } - return (0, exports2.coerceBoolean)(value); - }; - exports2.maybeCoerceBoolean = maybeCoerceBoolean; - function isEmptyObj(obj) { - if (!obj) - return true; - for (const _k2 in obj) - return false; - return true; - } - exports2.isEmptyObj = isEmptyObj; - function hasOwn(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); + return `https://bedrock-mantle.${region}.api.aws/openai/v1`; } - exports2.hasOwn = hasOwn; - function applyHeadersMut(targetHeaders, newHeaders) { - for (const k7 in newHeaders) { - if (!hasOwn(newHeaders, k7)) - continue; - const lowerKey = k7.toLowerCase(); - if (!lowerKey) - continue; - const val = newHeaders[k7]; - if (val === null) { - delete targetHeaders[lowerKey]; - } else if (val !== void 0) { - targetHeaders[lowerKey] = val; - } + function normalizeBedrockBaseURL(baseURL) { + const url2 = new URL(baseURL); + const responsesMatch = url2.pathname.match(/\/responses(?:\/.*)?$/); + if (responsesMatch?.index !== void 0) { + url2.pathname = url2.pathname.slice(0, responsesMatch.index) || "/"; } + return url2.toString().replace(/\/$/, ""); } - var SENSITIVE_HEADERS = /* @__PURE__ */ new Set(["authorization", "api-key"]); - function debug2(action5, ...args) { - if (typeof process !== "undefined" && process?.env?.["DEBUG"] === "true") { - const modifiedArgs = args.map((arg) => { - if (!arg) { - return arg; - } - if (arg["headers"]) { - const modifiedArg2 = { ...arg, headers: { ...arg["headers"] } }; - for (const header in arg["headers"]) { - if (SENSITIVE_HEADERS.has(header.toLowerCase())) { - modifiedArg2["headers"][header] = "REDACTED"; - } - } - return modifiedArg2; - } - let modifiedArg = null; - for (const header in arg) { - if (SENSITIVE_HEADERS.has(header.toLowerCase())) { - modifiedArg ?? (modifiedArg = { ...arg }); - modifiedArg[header] = "REDACTED"; - } - } - return modifiedArg ?? arg; - }); - console.log(`OpenAI:DEBUG:${action5}`, ...modifiedArgs); + function addBedrockOutputText(response) { + if (!Object.getOwnPropertyDescriptor(response, "output_text")) { + (0, ResponsesParser_1.addOutputText)(response); } + return response; } - exports2.debug = debug2; - var uuid4 = () => { - return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c6) => { - const r6 = Math.random() * 16 | 0; - const v8 = c6 === "x" ? r6 : r6 & 3 | 8; - return v8.toString(16); + function restoreBedrockStreamOutputText(responses) { + const stream5 = responses.stream.bind(responses); + responses.stream = ((body2, options) => { + const responseStream = stream5(body2, options); + const finalResponse = responseStream.finalResponse.bind(responseStream); + responseStream.finalResponse = async () => addBedrockOutputText(await finalResponse()); + return responseStream; }); - }; - var isRunningInBrowser = () => { - return ( - // @ts-ignore - typeof window !== "undefined" && // @ts-ignore - typeof window.document !== "undefined" && // @ts-ignore - typeof navigator !== "undefined" - ); - }; - exports2.isRunningInBrowser = isRunningInBrowser; - var isHeadersProtocol = (headers) => { - return typeof headers?.get === "function"; - }; - exports2.isHeadersProtocol = isHeadersProtocol; - var getRequiredHeader = (headers, header) => { - const foundHeader = (0, exports2.getHeader)(headers, header); - if (foundHeader === void 0) { - throw new Error(`Could not find ${header} header`); + return responses; + } + var BedrockOpenAI = class extends client_1.OpenAI { + /** + * API Client for interfacing with Amazon Bedrock's OpenAI-compatible endpoint. + * + * @param {string | null | undefined} [opts.apiKey=process.env['AWS_BEARER_TOKEN_BEDROCK'] ?? null] + * @param {string | null | undefined} [opts.baseURL=process.env['AWS_BEDROCK_BASE_URL'] ?? derived from opts.awsRegion or AWS_REGION/AWS_DEFAULT_REGION] + * @param {string | undefined} [opts.awsRegion=process.env['AWS_REGION'] ?? process.env['AWS_DEFAULT_REGION'] ?? undefined] + * @param {ApiKeySetter | undefined} opts.bedrockTokenProvider - A function that returns a Bedrock bearer token and is invoked before each request. + */ + constructor({ baseURL = (0, utils_1.readEnv)("AWS_BEDROCK_BASE_URL"), apiKey, awsRegion = (0, utils_1.readEnv)("AWS_REGION") ?? (0, utils_1.readEnv)("AWS_DEFAULT_REGION"), bedrockTokenProvider, adminAPIKey, workloadIdentity, ...opts } = {}) { + if (adminAPIKey || workloadIdentity) { + throw new Errors.OpenAIError("BedrockOpenAI only supports Bedrock bearer token authentication."); + } + if (apiKey === void 0 && !bedrockTokenProvider) { + apiKey = (0, utils_1.readEnv)("AWS_BEARER_TOKEN_BEDROCK") ?? null; + } + if (typeof apiKey === "function") { + throw new Errors.OpenAIError("Pass refreshable Bedrock credentials via `bedrockTokenProvider`, not `apiKey`."); + } + if (apiKey && bedrockTokenProvider) { + throw new Errors.OpenAIError("The `apiKey` and `bedrockTokenProvider` arguments are mutually exclusive; only one can be passed at a time."); + } + if (!apiKey && !bedrockTokenProvider) { + throw new Errors.OpenAIError("Missing credentials. Please pass an `apiKey` or `bedrockTokenProvider`, or set the `AWS_BEARER_TOKEN_BEDROCK` environment variable."); + } + const configuredBaseURL = baseURL?.trim() ? baseURL : deriveBedrockBaseURL(awsRegion); + super({ + apiKey: bedrockTokenProvider ?? apiKey, + adminAPIKey: null, + baseURL: normalizeBedrockBaseURL(configuredBaseURL), + ...opts + }); + this.bedrockTokenProvider = bedrockTokenProvider; + this.responses = restoreBedrockStreamOutputText(new API.Responses(this)); } - return foundHeader; - }; - exports2.getRequiredHeader = getRequiredHeader; - var getHeader = (headers, header) => { - const lowerCasedHeader = header.toLowerCase(); - if ((0, exports2.isHeadersProtocol)(headers)) { - const intercapsHeader = header[0]?.toUpperCase() + header.substring(1).replace(/([^\w])(\w)/g, (_m5, g1, g22) => g1 + g22.toUpperCase()); - for (const key of [header, lowerCasedHeader, header.toUpperCase(), intercapsHeader]) { - const value = headers.get(key); - if (value) { - return value; - } + async prepareOptions(options) { + const security = options.__security ?? { bearerAuth: true }; + if (security.adminAPIKeyAuth && !security.bearerAuth) { + await this._callApiKey(); } + await super.prepareOptions(options); } - for (const [key, value] of Object.entries(headers)) { - if (key.toLowerCase() === lowerCasedHeader) { - if (Array.isArray(value)) { - if (value.length <= 1) - return value[0]; - console.warn(`Received ${value.length} entries for the ${header} header, using the first entry.`); - return value[0]; - } - return value; + async authHeaders(opts, schemes) { + const security = schemes ?? { bearerAuth: true, adminAPIKeyAuth: true }; + if ((security.bearerAuth || security.adminAPIKeyAuth) && this.apiKey !== null) { + return (0, headers_1.buildHeaders)([{ Authorization: `Bearer ${this.apiKey}` }]); } + return super.authHeaders(opts, security); } - return void 0; - }; - exports2.getHeader = getHeader; - var toBase642 = (str) => { - if (!str) - return ""; - if (typeof Buffer !== "undefined") { - return Buffer.from(str).toString("base64"); - } - if (typeof btoa !== "undefined") { - return btoa(str); - } - throw new error_1.OpenAIError("Cannot generate b64 string; Expected `Buffer` or `btoa` to be defined"); - }; - exports2.toBase64 = toBase642; - var toFloat32Array = (base64Str) => { - if (typeof Buffer !== "undefined") { - const buf = Buffer.from(base64Str, "base64"); - return Array.from(new Float32Array(buf.buffer, buf.byteOffset, buf.length / Float32Array.BYTES_PER_ELEMENT)); - } else { - const binaryStr = atob(base64Str); - const len = binaryStr.length; - const bytes = new Uint8Array(len); - for (let i6 = 0; i6 < len; i6++) { - bytes[i6] = binaryStr.charCodeAt(i6); - } - return Array.from(new Float32Array(bytes.buffer)); + withOptions(options) { + const bedrockTokenProvider = options.apiKey !== void 0 ? void 0 : options.bedrockTokenProvider ?? this.bedrockTokenProvider; + return super.withOptions({ + ...options, + ...bedrockTokenProvider ? { apiKey: void 0, bedrockTokenProvider } : {} + }); } }; - exports2.toFloat32Array = toFloat32Array; - function isObj(obj) { - return obj != null && typeof obj === "object" && !Array.isArray(obj); - } - exports2.isObj = isObj; + exports2.BedrockOpenAI = BedrockOpenAI; } }); -// node_modules/openai/pagination.js -var require_pagination = __commonJS({ - "node_modules/openai/pagination.js"(exports2) { +// node_modules/openai/index.js +var require_openai = __commonJS({ + "node_modules/openai/index.js"(exports2, module) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CursorPage = exports2.Page = void 0; - var core_1 = require_core2(); - var Page = class extends core_1.AbstractPage { - constructor(client2, response, body2, options) { - super(client2, response, body2, options); - this.data = body2.data || []; - this.object = body2.object; - } - getPaginatedItems() { - return this.data ?? []; - } - // @deprecated Please use `nextPageInfo()` instead - /** - * This page represents a response that isn't actually paginated at the API level - * so there will never be any next page params. - */ - nextPageParams() { - return null; - } - nextPageInfo() { - return null; - } - }; - exports2.Page = Page; - var CursorPage = class extends core_1.AbstractPage { - constructor(client2, response, body2, options) { - super(client2, response, body2, options); - this.data = body2.data || []; - this.has_more = body2.has_more || false; - } - getPaginatedItems() { - return this.data ?? []; - } - hasNextPage() { - if (this.has_more === false) { - return false; - } - return super.hasNextPage(); - } - // @deprecated Please use `nextPageInfo()` instead - nextPageParams() { - const info2 = this.nextPageInfo(); - if (!info2) - return null; - if ("params" in info2) - return info2.params; - const params = Object.fromEntries(info2.url.searchParams); - if (!Object.keys(params).length) - return null; - return params; - } - nextPageInfo() { - const data = this.getPaginatedItems(); - if (!data.length) { - return null; - } - const id = data[data.length - 1]?.id; - if (!id) { - return null; - } - return { params: { after: id } }; - } + exports2 = module.exports = function(...args) { + return new exports2.default(...args); }; - exports2.CursorPage = CursorPage; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BedrockOpenAI = exports2.AzureOpenAI = exports2.SubjectTokenProviderError = exports2.OAuthError = exports2.InvalidWebhookSignatureError = exports2.UnprocessableEntityError = exports2.PermissionDeniedError = exports2.InternalServerError = exports2.AuthenticationError = exports2.BadRequestError = exports2.RateLimitError = exports2.ConflictError = exports2.NotFoundError = exports2.APIUserAbortError = exports2.APIConnectionTimeoutError = exports2.APIConnectionError = exports2.APIError = exports2.OpenAIError = exports2.PagePromise = exports2.OpenAI = exports2.APIPromise = exports2.toFile = exports2.default = void 0; + var client_1 = require_client2(); + Object.defineProperty(exports2, "default", { enumerable: true, get: function() { + return client_1.OpenAI; + } }); + var uploads_1 = require_uploads2(); + Object.defineProperty(exports2, "toFile", { enumerable: true, get: function() { + return uploads_1.toFile; + } }); + var api_promise_1 = require_api_promise(); + Object.defineProperty(exports2, "APIPromise", { enumerable: true, get: function() { + return api_promise_1.APIPromise; + } }); + var client_2 = require_client2(); + Object.defineProperty(exports2, "OpenAI", { enumerable: true, get: function() { + return client_2.OpenAI; + } }); + var pagination_1 = require_pagination(); + Object.defineProperty(exports2, "PagePromise", { enumerable: true, get: function() { + return pagination_1.PagePromise; + } }); + var error_1 = require_error2(); + Object.defineProperty(exports2, "OpenAIError", { enumerable: true, get: function() { + return error_1.OpenAIError; + } }); + Object.defineProperty(exports2, "APIError", { enumerable: true, get: function() { + return error_1.APIError; + } }); + Object.defineProperty(exports2, "APIConnectionError", { enumerable: true, get: function() { + return error_1.APIConnectionError; + } }); + Object.defineProperty(exports2, "APIConnectionTimeoutError", { enumerable: true, get: function() { + return error_1.APIConnectionTimeoutError; + } }); + Object.defineProperty(exports2, "APIUserAbortError", { enumerable: true, get: function() { + return error_1.APIUserAbortError; + } }); + Object.defineProperty(exports2, "NotFoundError", { enumerable: true, get: function() { + return error_1.NotFoundError; + } }); + Object.defineProperty(exports2, "ConflictError", { enumerable: true, get: function() { + return error_1.ConflictError; + } }); + Object.defineProperty(exports2, "RateLimitError", { enumerable: true, get: function() { + return error_1.RateLimitError; + } }); + Object.defineProperty(exports2, "BadRequestError", { enumerable: true, get: function() { + return error_1.BadRequestError; + } }); + Object.defineProperty(exports2, "AuthenticationError", { enumerable: true, get: function() { + return error_1.AuthenticationError; + } }); + Object.defineProperty(exports2, "InternalServerError", { enumerable: true, get: function() { + return error_1.InternalServerError; + } }); + Object.defineProperty(exports2, "PermissionDeniedError", { enumerable: true, get: function() { + return error_1.PermissionDeniedError; + } }); + Object.defineProperty(exports2, "UnprocessableEntityError", { enumerable: true, get: function() { + return error_1.UnprocessableEntityError; + } }); + Object.defineProperty(exports2, "InvalidWebhookSignatureError", { enumerable: true, get: function() { + return error_1.InvalidWebhookSignatureError; + } }); + Object.defineProperty(exports2, "OAuthError", { enumerable: true, get: function() { + return error_1.OAuthError; + } }); + Object.defineProperty(exports2, "SubjectTokenProviderError", { enumerable: true, get: function() { + return error_1.SubjectTokenProviderError; + } }); + var azure_1 = require_azure(); + Object.defineProperty(exports2, "AzureOpenAI", { enumerable: true, get: function() { + return azure_1.AzureOpenAI; + } }); + var bedrock_1 = require_bedrock(); + Object.defineProperty(exports2, "BedrockOpenAI", { enumerable: true, get: function() { + return bedrock_1.BedrockOpenAI; + } }); } }); -// node_modules/openai/resource.js -var require_resource = __commonJS({ - "node_modules/openai/resource.js"(exports2) { +// node_modules/@anthropic-ai/sdk/version.js +var require_version2 = __commonJS({ + "node_modules/@anthropic-ai/sdk/version.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.APIResource = void 0; - var APIResource = class { - constructor(client2) { - this._client = client2; - } - }; - exports2.APIResource = APIResource; + exports2.VERSION = void 0; + exports2.VERSION = "0.27.3"; } }); -// node_modules/openai/resources/chat/completions/messages.js -var require_messages = __commonJS({ - "node_modules/openai/resources/chat/completions/messages.js"(exports2) { +// node_modules/@anthropic-ai/sdk/_shims/registry.js +var require_registry = __commonJS({ + "node_modules/@anthropic-ai/sdk/_shims/registry.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ChatCompletionStoreMessagesPage = exports2.Messages = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var completions_1 = require_completions(); - Object.defineProperty(exports2, "ChatCompletionStoreMessagesPage", { enumerable: true, get: function() { - return completions_1.ChatCompletionStoreMessagesPage; - } }); - var Messages2 = class extends resource_1.APIResource { - list(completionId, query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list(completionId, {}, query); - } - return this._client.getAPIList(`/chat/completions/${completionId}/messages`, completions_1.ChatCompletionStoreMessagesPage, { query, ...options }); + exports2.setShims = exports2.isFsReadStream = exports2.fileFromPath = exports2.getDefaultAgent = exports2.getMultipartRequestOptions = exports2.ReadableStream = exports2.File = exports2.Blob = exports2.FormData = exports2.Headers = exports2.Response = exports2.Request = exports2.fetch = exports2.kind = exports2.auto = void 0; + exports2.auto = false; + exports2.kind = void 0; + exports2.fetch = void 0; + exports2.Request = void 0; + exports2.Response = void 0; + exports2.Headers = void 0; + exports2.FormData = void 0; + exports2.Blob = void 0; + exports2.File = void 0; + exports2.ReadableStream = void 0; + exports2.getMultipartRequestOptions = void 0; + exports2.getDefaultAgent = void 0; + exports2.fileFromPath = void 0; + exports2.isFsReadStream = void 0; + function setShims(shims, options = { auto: false }) { + if (exports2.auto) { + throw new Error(`you must \`import '@anthropic-ai/sdk/shims/${shims.kind}'\` before importing anything else from @anthropic-ai/sdk`); } - }; - exports2.Messages = Messages2; + if (exports2.kind) { + throw new Error(`can't \`import '@anthropic-ai/sdk/shims/${shims.kind}'\` after \`import '@anthropic-ai/sdk/shims/${exports2.kind}'\``); + } + exports2.auto = options.auto; + exports2.kind = shims.kind; + exports2.fetch = shims.fetch; + exports2.Request = shims.Request; + exports2.Response = shims.Response; + exports2.Headers = shims.Headers; + exports2.FormData = shims.FormData; + exports2.Blob = shims.Blob; + exports2.File = shims.File; + exports2.ReadableStream = shims.ReadableStream; + exports2.getMultipartRequestOptions = shims.getMultipartRequestOptions; + exports2.getDefaultAgent = shims.getDefaultAgent; + exports2.fileFromPath = shims.fileFromPath; + exports2.isFsReadStream = shims.isFsReadStream; + } + exports2.setShims = setShims; } }); -// node_modules/openai/resources/chat/completions/completions.js -var require_completions = __commonJS({ - "node_modules/openai/resources/chat/completions/completions.js"(exports2) { +// node_modules/webidl-conversions/lib/index.js +var require_lib7 = __commonJS({ + "node_modules/webidl-conversions/lib/index.js"(exports2, module) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + var conversions = {}; + module.exports = conversions; + function sign2(x2) { + return x2 < 0 ? -1 : 1; + } + function evenRound(x2) { + if (x2 % 1 === 0.5 && (x2 & 1) === 0) { + return Math.floor(x2); + } else { + return Math.round(x2); } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + } + function createNumberConversion(bitLength, typeOpts) { + if (!typeOpts.unsigned) { + --bitLength; } - __setModuleDefault(result, mod); - return result; + const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength); + const upperBound = Math.pow(2, bitLength) - 1; + const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength); + const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1); + return function(V2, opts) { + if (!opts) opts = {}; + let x2 = +V2; + if (opts.enforceRange) { + if (!Number.isFinite(x2)) { + throw new TypeError("Argument is not a finite number"); + } + x2 = sign2(x2) * Math.floor(Math.abs(x2)); + if (x2 < lowerBound || x2 > upperBound) { + throw new TypeError("Argument is not in byte range"); + } + return x2; + } + if (!isNaN(x2) && opts.clamp) { + x2 = evenRound(x2); + if (x2 < lowerBound) x2 = lowerBound; + if (x2 > upperBound) x2 = upperBound; + return x2; + } + if (!Number.isFinite(x2) || x2 === 0) { + return 0; + } + x2 = sign2(x2) * Math.floor(Math.abs(x2)); + x2 = x2 % moduloVal; + if (!typeOpts.unsigned && x2 >= moduloBound) { + return x2 - moduloVal; + } else if (typeOpts.unsigned) { + if (x2 < 0) { + x2 += moduloVal; + } else if (x2 === -0) { + return 0; + } + } + return x2; + }; + } + conversions["void"] = function() { + return void 0; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ChatCompletionStoreMessagesPage = exports2.ChatCompletionsPage = exports2.Completions = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var MessagesAPI = __importStar(require_messages()); - var messages_1 = require_messages(); - var pagination_1 = require_pagination(); - var Completions = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.messages = new MessagesAPI.Messages(this._client); - } - create(body2, options) { - return this._client.post("/chat/completions", { body: body2, ...options, stream: body2.stream ?? false }); + conversions["boolean"] = function(val) { + return !!val; + }; + conversions["byte"] = createNumberConversion(8, { unsigned: false }); + conversions["octet"] = createNumberConversion(8, { unsigned: true }); + conversions["short"] = createNumberConversion(16, { unsigned: false }); + conversions["unsigned short"] = createNumberConversion(16, { unsigned: true }); + conversions["long"] = createNumberConversion(32, { unsigned: false }); + conversions["unsigned long"] = createNumberConversion(32, { unsigned: true }); + conversions["long long"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 }); + conversions["unsigned long long"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 }); + conversions["double"] = function(V2) { + const x2 = +V2; + if (!Number.isFinite(x2)) { + throw new TypeError("Argument is not a finite floating-point value"); } - /** - * Get a stored chat completion. Only Chat Completions that have been created with - * the `store` parameter set to `true` will be returned. - * - * @example - * ```ts - * const chatCompletion = - * await client.chat.completions.retrieve('completion_id'); - * ``` - */ - retrieve(completionId, options) { - return this._client.get(`/chat/completions/${completionId}`, options); + return x2; + }; + conversions["unrestricted double"] = function(V2) { + const x2 = +V2; + if (isNaN(x2)) { + throw new TypeError("Argument is NaN"); } - /** - * Modify a stored chat completion. Only Chat Completions that have been created - * with the `store` parameter set to `true` can be modified. Currently, the only - * supported modification is to update the `metadata` field. - * - * @example - * ```ts - * const chatCompletion = await client.chat.completions.update( - * 'completion_id', - * { metadata: { foo: 'string' } }, - * ); - * ``` - */ - update(completionId, body2, options) { - return this._client.post(`/chat/completions/${completionId}`, { body: body2, ...options }); + return x2; + }; + conversions["float"] = conversions["double"]; + conversions["unrestricted float"] = conversions["unrestricted double"]; + conversions["DOMString"] = function(V2, opts) { + if (!opts) opts = {}; + if (opts.treatNullAsEmptyString && V2 === null) { + return ""; } - list(query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list({}, query); + return String(V2); + }; + conversions["ByteString"] = function(V2, opts) { + const x2 = String(V2); + let c6 = void 0; + for (let i6 = 0; (c6 = x2.codePointAt(i6)) !== void 0; ++i6) { + if (c6 > 255) { + throw new TypeError("Argument is not a valid bytestring"); } - return this._client.getAPIList("/chat/completions", ChatCompletionsPage, { query, ...options }); - } - /** - * Delete a stored chat completion. Only Chat Completions that have been created - * with the `store` parameter set to `true` can be deleted. - * - * @example - * ```ts - * const chatCompletionDeleted = - * await client.chat.completions.del('completion_id'); - * ``` - */ - del(completionId, options) { - return this._client.delete(`/chat/completions/${completionId}`, options); } + return x2; }; - exports2.Completions = Completions; - var ChatCompletionsPage = class extends pagination_1.CursorPage { - }; - exports2.ChatCompletionsPage = ChatCompletionsPage; - var ChatCompletionStoreMessagesPage = class extends pagination_1.CursorPage { + conversions["USVString"] = function(V2) { + const S = String(V2); + const n8 = S.length; + const U2 = []; + for (let i6 = 0; i6 < n8; ++i6) { + const c6 = S.charCodeAt(i6); + if (c6 < 55296 || c6 > 57343) { + U2.push(String.fromCodePoint(c6)); + } else if (56320 <= c6 && c6 <= 57343) { + U2.push(String.fromCodePoint(65533)); + } else { + if (i6 === n8 - 1) { + U2.push(String.fromCodePoint(65533)); + } else { + const d6 = S.charCodeAt(i6 + 1); + if (56320 <= d6 && d6 <= 57343) { + const a6 = c6 & 1023; + const b6 = d6 & 1023; + U2.push(String.fromCodePoint((2 << 15) + (2 << 9) * a6 + b6)); + ++i6; + } else { + U2.push(String.fromCodePoint(65533)); + } + } + } + } + return U2.join(""); }; - exports2.ChatCompletionStoreMessagesPage = ChatCompletionStoreMessagesPage; - Completions.ChatCompletionsPage = ChatCompletionsPage; - Completions.Messages = messages_1.Messages; - } -}); - -// node_modules/openai/resources/chat/chat.js -var require_chat = __commonJS({ - "node_modules/openai/resources/chat/chat.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + conversions["Date"] = function(V2, opts) { + if (!(V2 instanceof Date)) { + throw new TypeError("Argument is not a Date object"); } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + if (isNaN(V2)) { + return void 0; } - __setModuleDefault(result, mod); - return result; + return V2; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Chat = void 0; - var resource_1 = require_resource(); - var CompletionsAPI = __importStar(require_completions()); - var completions_1 = require_completions(); - var Chat = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.completions = new CompletionsAPI.Completions(this._client); + conversions["RegExp"] = function(V2, opts) { + if (!(V2 instanceof RegExp)) { + V2 = new RegExp(V2); } + return V2; }; - exports2.Chat = Chat; - Chat.Completions = completions_1.Completions; - Chat.ChatCompletionsPage = completions_1.ChatCompletionsPage; - } -}); - -// node_modules/openai/resources/chat/completions/index.js -var require_completions2 = __commonJS({ - "node_modules/openai/resources/chat/completions/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Messages = exports2.Completions = exports2.ChatCompletionsPage = exports2.ChatCompletionStoreMessagesPage = void 0; - var completions_1 = require_completions(); - Object.defineProperty(exports2, "ChatCompletionStoreMessagesPage", { enumerable: true, get: function() { - return completions_1.ChatCompletionStoreMessagesPage; - } }); - Object.defineProperty(exports2, "ChatCompletionsPage", { enumerable: true, get: function() { - return completions_1.ChatCompletionsPage; - } }); - Object.defineProperty(exports2, "Completions", { enumerable: true, get: function() { - return completions_1.Completions; - } }); - var messages_1 = require_messages(); - Object.defineProperty(exports2, "Messages", { enumerable: true, get: function() { - return messages_1.Messages; - } }); - } -}); - -// node_modules/openai/resources/chat/index.js -var require_chat2 = __commonJS({ - "node_modules/openai/resources/chat/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Completions = exports2.ChatCompletionsPage = exports2.ChatCompletionStoreMessagesPage = exports2.Chat = void 0; - var chat_1 = require_chat(); - Object.defineProperty(exports2, "Chat", { enumerable: true, get: function() { - return chat_1.Chat; - } }); - var index_1 = require_completions2(); - Object.defineProperty(exports2, "ChatCompletionStoreMessagesPage", { enumerable: true, get: function() { - return index_1.ChatCompletionStoreMessagesPage; - } }); - Object.defineProperty(exports2, "ChatCompletionsPage", { enumerable: true, get: function() { - return index_1.ChatCompletionsPage; - } }); - Object.defineProperty(exports2, "Completions", { enumerable: true, get: function() { - return index_1.Completions; - } }); - } -}); - -// node_modules/openai/resources/shared.js -var require_shared = __commonJS({ - "node_modules/openai/resources/shared.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); } }); -// node_modules/openai/resources/audio/speech.js -var require_speech = __commonJS({ - "node_modules/openai/resources/audio/speech.js"(exports2) { +// node_modules/whatwg-url/lib/utils.js +var require_utils12 = __commonJS({ + "node_modules/whatwg-url/lib/utils.js"(exports2, module) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Speech = void 0; - var resource_1 = require_resource(); - var Speech = class extends resource_1.APIResource { - /** - * Generates audio from the input text. - * - * @example - * ```ts - * const speech = await client.audio.speech.create({ - * input: 'input', - * model: 'string', - * voice: 'ash', - * }); - * - * const content = await speech.blob(); - * console.log(content); - * ``` - */ - create(body2, options) { - return this._client.post("/audio/speech", { - body: body2, - ...options, - headers: { Accept: "application/octet-stream", ...options?.headers }, - __binaryResponse: true - }); + module.exports.mixin = function mixin3(target, source) { + const keys = Object.getOwnPropertyNames(source); + for (let i6 = 0; i6 < keys.length; ++i6) { + Object.defineProperty(target, keys[i6], Object.getOwnPropertyDescriptor(source, keys[i6])); } }; - exports2.Speech = Speech; - } -}); - -// node_modules/openai/resources/audio/transcriptions.js -var require_transcriptions = __commonJS({ - "node_modules/openai/resources/audio/transcriptions.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; - } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); - } - __setModuleDefault(result, mod); - return result; + module.exports.wrapperSymbol = /* @__PURE__ */ Symbol("wrapper"); + module.exports.implSymbol = /* @__PURE__ */ Symbol("impl"); + module.exports.wrapperForImpl = function(impl) { + return impl[module.exports.wrapperSymbol]; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Transcriptions = void 0; - var resource_1 = require_resource(); - var Core = __importStar(require_core2()); - var Transcriptions = class extends resource_1.APIResource { - create(body2, options) { - return this._client.post("/audio/transcriptions", Core.multipartFormRequestOptions({ - body: body2, - ...options, - stream: body2.stream ?? false, - __metadata: { model: body2.model } - })); - } + module.exports.implForWrapper = function(wrapper) { + return wrapper[module.exports.implSymbol]; }; - exports2.Transcriptions = Transcriptions; } }); -// node_modules/openai/resources/audio/translations.js -var require_translations = __commonJS({ - "node_modules/openai/resources/audio/translations.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; - } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Translations = void 0; - var resource_1 = require_resource(); - var Core = __importStar(require_core2()); - var Translations = class extends resource_1.APIResource { - create(body2, options) { - return this._client.post("/audio/translations", Core.multipartFormRequestOptions({ body: body2, ...options, __metadata: { model: body2.model } })); - } - }; - exports2.Translations = Translations; +// node_modules/tr46/lib/mappingTable.json +var require_mappingTable = __commonJS({ + "node_modules/tr46/lib/mappingTable.json"(exports2, module) { + module.exports = [[[0, 44], "disallowed_STD3_valid"], [[45, 46], "valid"], [[47, 47], "disallowed_STD3_valid"], [[48, 57], "valid"], [[58, 64], "disallowed_STD3_valid"], [[65, 65], "mapped", [97]], [[66, 66], "mapped", [98]], [[67, 67], "mapped", [99]], [[68, 68], "mapped", [100]], [[69, 69], "mapped", [101]], [[70, 70], "mapped", [102]], [[71, 71], "mapped", [103]], [[72, 72], "mapped", [104]], [[73, 73], "mapped", [105]], [[74, 74], "mapped", [106]], [[75, 75], "mapped", [107]], [[76, 76], "mapped", [108]], [[77, 77], "mapped", [109]], [[78, 78], "mapped", [110]], [[79, 79], "mapped", [111]], [[80, 80], "mapped", [112]], [[81, 81], "mapped", [113]], [[82, 82], "mapped", [114]], [[83, 83], "mapped", [115]], [[84, 84], "mapped", [116]], [[85, 85], "mapped", [117]], [[86, 86], "mapped", [118]], [[87, 87], "mapped", [119]], [[88, 88], "mapped", [120]], [[89, 89], "mapped", [121]], [[90, 90], "mapped", [122]], [[91, 96], "disallowed_STD3_valid"], [[97, 122], "valid"], [[123, 127], "disallowed_STD3_valid"], [[128, 159], "disallowed"], [[160, 160], "disallowed_STD3_mapped", [32]], [[161, 167], "valid", [], "NV8"], [[168, 168], "disallowed_STD3_mapped", [32, 776]], [[169, 169], "valid", [], "NV8"], [[170, 170], "mapped", [97]], [[171, 172], "valid", [], "NV8"], [[173, 173], "ignored"], [[174, 174], "valid", [], "NV8"], [[175, 175], "disallowed_STD3_mapped", [32, 772]], [[176, 177], "valid", [], "NV8"], [[178, 178], "mapped", [50]], [[179, 179], "mapped", [51]], [[180, 180], "disallowed_STD3_mapped", [32, 769]], [[181, 181], "mapped", [956]], [[182, 182], "valid", [], "NV8"], [[183, 183], "valid"], [[184, 184], "disallowed_STD3_mapped", [32, 807]], [[185, 185], "mapped", [49]], [[186, 186], "mapped", [111]], [[187, 187], "valid", [], "NV8"], [[188, 188], "mapped", [49, 8260, 52]], [[189, 189], "mapped", [49, 8260, 50]], [[190, 190], "mapped", [51, 8260, 52]], [[191, 191], "valid", [], "NV8"], [[192, 192], "mapped", [224]], [[193, 193], "mapped", [225]], [[194, 194], "mapped", [226]], [[195, 195], "mapped", [227]], [[196, 196], "mapped", [228]], [[197, 197], "mapped", [229]], [[198, 198], "mapped", [230]], [[199, 199], "mapped", [231]], [[200, 200], "mapped", [232]], [[201, 201], "mapped", [233]], [[202, 202], "mapped", [234]], [[203, 203], "mapped", [235]], [[204, 204], "mapped", [236]], [[205, 205], "mapped", [237]], [[206, 206], "mapped", [238]], [[207, 207], "mapped", [239]], [[208, 208], "mapped", [240]], [[209, 209], "mapped", [241]], [[210, 210], "mapped", [242]], [[211, 211], "mapped", [243]], [[212, 212], "mapped", [244]], [[213, 213], "mapped", [245]], [[214, 214], "mapped", [246]], [[215, 215], "valid", [], "NV8"], [[216, 216], "mapped", [248]], [[217, 217], "mapped", [249]], [[218, 218], "mapped", [250]], [[219, 219], "mapped", [251]], [[220, 220], "mapped", [252]], [[221, 221], "mapped", [253]], [[222, 222], "mapped", [254]], [[223, 223], "deviation", [115, 115]], [[224, 246], "valid"], [[247, 247], "valid", [], "NV8"], [[248, 255], "valid"], [[256, 256], "mapped", [257]], [[257, 257], "valid"], [[258, 258], "mapped", [259]], [[259, 259], "valid"], [[260, 260], "mapped", [261]], [[261, 261], "valid"], [[262, 262], "mapped", [263]], [[263, 263], "valid"], [[264, 264], "mapped", [265]], [[265, 265], "valid"], [[266, 266], "mapped", [267]], [[267, 267], "valid"], [[268, 268], "mapped", [269]], [[269, 269], "valid"], [[270, 270], "mapped", [271]], [[271, 271], "valid"], [[272, 272], "mapped", [273]], [[273, 273], "valid"], [[274, 274], "mapped", [275]], [[275, 275], "valid"], [[276, 276], "mapped", [277]], [[277, 277], "valid"], [[278, 278], "mapped", [279]], [[279, 279], "valid"], [[280, 280], "mapped", [281]], [[281, 281], "valid"], [[282, 282], "mapped", [283]], [[283, 283], "valid"], [[284, 284], "mapped", [285]], [[285, 285], "valid"], [[286, 286], "mapped", [287]], [[287, 287], "valid"], [[288, 288], "mapped", [289]], [[289, 289], "valid"], [[290, 290], "mapped", [291]], [[291, 291], "valid"], [[292, 292], "mapped", [293]], [[293, 293], "valid"], [[294, 294], "mapped", [295]], [[295, 295], "valid"], [[296, 296], "mapped", [297]], [[297, 297], "valid"], [[298, 298], "mapped", [299]], [[299, 299], "valid"], [[300, 300], "mapped", [301]], [[301, 301], "valid"], [[302, 302], "mapped", [303]], [[303, 303], "valid"], [[304, 304], "mapped", [105, 775]], [[305, 305], "valid"], [[306, 307], "mapped", [105, 106]], [[308, 308], "mapped", [309]], [[309, 309], "valid"], [[310, 310], "mapped", [311]], [[311, 312], "valid"], [[313, 313], "mapped", [314]], [[314, 314], "valid"], [[315, 315], "mapped", [316]], [[316, 316], "valid"], [[317, 317], "mapped", [318]], [[318, 318], "valid"], [[319, 320], "mapped", [108, 183]], [[321, 321], "mapped", [322]], [[322, 322], "valid"], [[323, 323], "mapped", [324]], [[324, 324], "valid"], [[325, 325], "mapped", [326]], [[326, 326], "valid"], [[327, 327], "mapped", [328]], [[328, 328], "valid"], [[329, 329], "mapped", [700, 110]], [[330, 330], "mapped", [331]], [[331, 331], "valid"], [[332, 332], "mapped", [333]], [[333, 333], "valid"], [[334, 334], "mapped", [335]], [[335, 335], "valid"], [[336, 336], "mapped", [337]], [[337, 337], "valid"], [[338, 338], "mapped", [339]], [[339, 339], "valid"], [[340, 340], "mapped", [341]], [[341, 341], "valid"], [[342, 342], "mapped", [343]], [[343, 343], "valid"], [[344, 344], "mapped", [345]], [[345, 345], "valid"], [[346, 346], "mapped", [347]], [[347, 347], "valid"], [[348, 348], "mapped", [349]], [[349, 349], "valid"], [[350, 350], "mapped", [351]], [[351, 351], "valid"], [[352, 352], "mapped", [353]], [[353, 353], "valid"], [[354, 354], "mapped", [355]], [[355, 355], "valid"], [[356, 356], "mapped", [357]], [[357, 357], "valid"], [[358, 358], "mapped", [359]], [[359, 359], "valid"], [[360, 360], "mapped", [361]], [[361, 361], "valid"], [[362, 362], "mapped", [363]], [[363, 363], "valid"], [[364, 364], "mapped", [365]], [[365, 365], "valid"], [[366, 366], "mapped", [367]], [[367, 367], "valid"], [[368, 368], "mapped", [369]], [[369, 369], "valid"], [[370, 370], "mapped", [371]], [[371, 371], "valid"], [[372, 372], "mapped", [373]], [[373, 373], "valid"], [[374, 374], "mapped", [375]], [[375, 375], "valid"], [[376, 376], "mapped", [255]], [[377, 377], "mapped", [378]], [[378, 378], "valid"], [[379, 379], "mapped", [380]], [[380, 380], "valid"], [[381, 381], "mapped", [382]], [[382, 382], "valid"], [[383, 383], "mapped", [115]], [[384, 384], "valid"], [[385, 385], "mapped", [595]], [[386, 386], "mapped", [387]], [[387, 387], "valid"], [[388, 388], "mapped", [389]], [[389, 389], "valid"], [[390, 390], "mapped", [596]], [[391, 391], "mapped", [392]], [[392, 392], "valid"], [[393, 393], "mapped", [598]], [[394, 394], "mapped", [599]], [[395, 395], "mapped", [396]], [[396, 397], "valid"], [[398, 398], "mapped", [477]], [[399, 399], "mapped", [601]], [[400, 400], "mapped", [603]], [[401, 401], "mapped", [402]], [[402, 402], "valid"], [[403, 403], "mapped", [608]], [[404, 404], "mapped", [611]], [[405, 405], "valid"], [[406, 406], "mapped", [617]], [[407, 407], "mapped", [616]], [[408, 408], "mapped", [409]], [[409, 411], "valid"], [[412, 412], "mapped", [623]], [[413, 413], "mapped", [626]], [[414, 414], "valid"], [[415, 415], "mapped", [629]], [[416, 416], "mapped", [417]], [[417, 417], "valid"], [[418, 418], "mapped", [419]], [[419, 419], "valid"], [[420, 420], "mapped", [421]], [[421, 421], "valid"], [[422, 422], "mapped", [640]], [[423, 423], "mapped", [424]], [[424, 424], "valid"], [[425, 425], "mapped", [643]], [[426, 427], "valid"], [[428, 428], "mapped", [429]], [[429, 429], "valid"], [[430, 430], "mapped", [648]], [[431, 431], "mapped", [432]], [[432, 432], "valid"], [[433, 433], "mapped", [650]], [[434, 434], "mapped", [651]], [[435, 435], "mapped", [436]], [[436, 436], "valid"], [[437, 437], "mapped", [438]], [[438, 438], "valid"], [[439, 439], "mapped", [658]], [[440, 440], "mapped", [441]], [[441, 443], "valid"], [[444, 444], "mapped", [445]], [[445, 451], "valid"], [[452, 454], "mapped", [100, 382]], [[455, 457], "mapped", [108, 106]], [[458, 460], "mapped", [110, 106]], [[461, 461], "mapped", [462]], [[462, 462], "valid"], [[463, 463], "mapped", [464]], [[464, 464], "valid"], [[465, 465], "mapped", [466]], [[466, 466], "valid"], [[467, 467], "mapped", [468]], [[468, 468], "valid"], [[469, 469], "mapped", [470]], [[470, 470], "valid"], [[471, 471], "mapped", [472]], [[472, 472], "valid"], [[473, 473], "mapped", [474]], [[474, 474], "valid"], [[475, 475], "mapped", [476]], [[476, 477], "valid"], [[478, 478], "mapped", [479]], [[479, 479], "valid"], [[480, 480], "mapped", [481]], [[481, 481], "valid"], [[482, 482], "mapped", [483]], [[483, 483], "valid"], [[484, 484], "mapped", [485]], [[485, 485], "valid"], [[486, 486], "mapped", [487]], [[487, 487], "valid"], [[488, 488], "mapped", [489]], [[489, 489], "valid"], [[490, 490], "mapped", [491]], [[491, 491], "valid"], [[492, 492], "mapped", [493]], [[493, 493], "valid"], [[494, 494], "mapped", [495]], [[495, 496], "valid"], [[497, 499], "mapped", [100, 122]], [[500, 500], "mapped", [501]], [[501, 501], "valid"], [[502, 502], "mapped", [405]], [[503, 503], "mapped", [447]], [[504, 504], "mapped", [505]], [[505, 505], "valid"], [[506, 506], "mapped", [507]], [[507, 507], "valid"], [[508, 508], "mapped", [509]], [[509, 509], "valid"], [[510, 510], "mapped", [511]], [[511, 511], "valid"], [[512, 512], "mapped", [513]], [[513, 513], "valid"], [[514, 514], "mapped", [515]], [[515, 515], "valid"], [[516, 516], "mapped", [517]], [[517, 517], "valid"], [[518, 518], "mapped", [519]], [[519, 519], "valid"], [[520, 520], "mapped", [521]], [[521, 521], "valid"], [[522, 522], "mapped", [523]], [[523, 523], "valid"], [[524, 524], "mapped", [525]], [[525, 525], "valid"], [[526, 526], "mapped", [527]], [[527, 527], "valid"], [[528, 528], "mapped", [529]], [[529, 529], "valid"], [[530, 530], "mapped", [531]], [[531, 531], "valid"], [[532, 532], "mapped", [533]], [[533, 533], "valid"], [[534, 534], "mapped", [535]], [[535, 535], "valid"], [[536, 536], "mapped", [537]], [[537, 537], "valid"], [[538, 538], "mapped", [539]], [[539, 539], "valid"], [[540, 540], "mapped", [541]], [[541, 541], "valid"], [[542, 542], "mapped", [543]], [[543, 543], "valid"], [[544, 544], "mapped", [414]], [[545, 545], "valid"], [[546, 546], "mapped", [547]], [[547, 547], "valid"], [[548, 548], "mapped", [549]], [[549, 549], "valid"], [[550, 550], "mapped", [551]], [[551, 551], "valid"], [[552, 552], "mapped", [553]], [[553, 553], "valid"], [[554, 554], "mapped", [555]], [[555, 555], "valid"], [[556, 556], "mapped", [557]], [[557, 557], "valid"], [[558, 558], "mapped", [559]], [[559, 559], "valid"], [[560, 560], "mapped", [561]], [[561, 561], "valid"], [[562, 562], "mapped", [563]], [[563, 563], "valid"], [[564, 566], "valid"], [[567, 569], "valid"], [[570, 570], "mapped", [11365]], [[571, 571], "mapped", [572]], [[572, 572], "valid"], [[573, 573], "mapped", [410]], [[574, 574], "mapped", [11366]], [[575, 576], "valid"], [[577, 577], "mapped", [578]], [[578, 578], "valid"], [[579, 579], "mapped", [384]], [[580, 580], "mapped", [649]], [[581, 581], "mapped", [652]], [[582, 582], "mapped", [583]], [[583, 583], "valid"], [[584, 584], "mapped", [585]], [[585, 585], "valid"], [[586, 586], "mapped", [587]], [[587, 587], "valid"], [[588, 588], "mapped", [589]], [[589, 589], "valid"], [[590, 590], "mapped", [591]], [[591, 591], "valid"], [[592, 680], "valid"], [[681, 685], "valid"], [[686, 687], "valid"], [[688, 688], "mapped", [104]], [[689, 689], "mapped", [614]], [[690, 690], "mapped", [106]], [[691, 691], "mapped", [114]], [[692, 692], "mapped", [633]], [[693, 693], "mapped", [635]], [[694, 694], "mapped", [641]], [[695, 695], "mapped", [119]], [[696, 696], "mapped", [121]], [[697, 705], "valid"], [[706, 709], "valid", [], "NV8"], [[710, 721], "valid"], [[722, 727], "valid", [], "NV8"], [[728, 728], "disallowed_STD3_mapped", [32, 774]], [[729, 729], "disallowed_STD3_mapped", [32, 775]], [[730, 730], "disallowed_STD3_mapped", [32, 778]], [[731, 731], "disallowed_STD3_mapped", [32, 808]], [[732, 732], "disallowed_STD3_mapped", [32, 771]], [[733, 733], "disallowed_STD3_mapped", [32, 779]], [[734, 734], "valid", [], "NV8"], [[735, 735], "valid", [], "NV8"], [[736, 736], "mapped", [611]], [[737, 737], "mapped", [108]], [[738, 738], "mapped", [115]], [[739, 739], "mapped", [120]], [[740, 740], "mapped", [661]], [[741, 745], "valid", [], "NV8"], [[746, 747], "valid", [], "NV8"], [[748, 748], "valid"], [[749, 749], "valid", [], "NV8"], [[750, 750], "valid"], [[751, 767], "valid", [], "NV8"], [[768, 831], "valid"], [[832, 832], "mapped", [768]], [[833, 833], "mapped", [769]], [[834, 834], "valid"], [[835, 835], "mapped", [787]], [[836, 836], "mapped", [776, 769]], [[837, 837], "mapped", [953]], [[838, 846], "valid"], [[847, 847], "ignored"], [[848, 855], "valid"], [[856, 860], "valid"], [[861, 863], "valid"], [[864, 865], "valid"], [[866, 866], "valid"], [[867, 879], "valid"], [[880, 880], "mapped", [881]], [[881, 881], "valid"], [[882, 882], "mapped", [883]], [[883, 883], "valid"], [[884, 884], "mapped", [697]], [[885, 885], "valid"], [[886, 886], "mapped", [887]], [[887, 887], "valid"], [[888, 889], "disallowed"], [[890, 890], "disallowed_STD3_mapped", [32, 953]], [[891, 893], "valid"], [[894, 894], "disallowed_STD3_mapped", [59]], [[895, 895], "mapped", [1011]], [[896, 899], "disallowed"], [[900, 900], "disallowed_STD3_mapped", [32, 769]], [[901, 901], "disallowed_STD3_mapped", [32, 776, 769]], [[902, 902], "mapped", [940]], [[903, 903], "mapped", [183]], [[904, 904], "mapped", [941]], [[905, 905], "mapped", [942]], [[906, 906], "mapped", [943]], [[907, 907], "disallowed"], [[908, 908], "mapped", [972]], [[909, 909], "disallowed"], [[910, 910], "mapped", [973]], [[911, 911], "mapped", [974]], [[912, 912], "valid"], [[913, 913], "mapped", [945]], [[914, 914], "mapped", [946]], [[915, 915], "mapped", [947]], [[916, 916], "mapped", [948]], [[917, 917], "mapped", [949]], [[918, 918], "mapped", [950]], [[919, 919], "mapped", [951]], [[920, 920], "mapped", [952]], [[921, 921], "mapped", [953]], [[922, 922], "mapped", [954]], [[923, 923], "mapped", [955]], [[924, 924], "mapped", [956]], [[925, 925], "mapped", [957]], [[926, 926], "mapped", [958]], [[927, 927], "mapped", [959]], [[928, 928], "mapped", [960]], [[929, 929], "mapped", [961]], [[930, 930], "disallowed"], [[931, 931], "mapped", [963]], [[932, 932], "mapped", [964]], [[933, 933], "mapped", [965]], [[934, 934], "mapped", [966]], [[935, 935], "mapped", [967]], [[936, 936], "mapped", [968]], [[937, 937], "mapped", [969]], [[938, 938], "mapped", [970]], [[939, 939], "mapped", [971]], [[940, 961], "valid"], [[962, 962], "deviation", [963]], [[963, 974], "valid"], [[975, 975], "mapped", [983]], [[976, 976], "mapped", [946]], [[977, 977], "mapped", [952]], [[978, 978], "mapped", [965]], [[979, 979], "mapped", [973]], [[980, 980], "mapped", [971]], [[981, 981], "mapped", [966]], [[982, 982], "mapped", [960]], [[983, 983], "valid"], [[984, 984], "mapped", [985]], [[985, 985], "valid"], [[986, 986], "mapped", [987]], [[987, 987], "valid"], [[988, 988], "mapped", [989]], [[989, 989], "valid"], [[990, 990], "mapped", [991]], [[991, 991], "valid"], [[992, 992], "mapped", [993]], [[993, 993], "valid"], [[994, 994], "mapped", [995]], [[995, 995], "valid"], [[996, 996], "mapped", [997]], [[997, 997], "valid"], [[998, 998], "mapped", [999]], [[999, 999], "valid"], [[1e3, 1e3], "mapped", [1001]], [[1001, 1001], "valid"], [[1002, 1002], "mapped", [1003]], [[1003, 1003], "valid"], [[1004, 1004], "mapped", [1005]], [[1005, 1005], "valid"], [[1006, 1006], "mapped", [1007]], [[1007, 1007], "valid"], [[1008, 1008], "mapped", [954]], [[1009, 1009], "mapped", [961]], [[1010, 1010], "mapped", [963]], [[1011, 1011], "valid"], [[1012, 1012], "mapped", [952]], [[1013, 1013], "mapped", [949]], [[1014, 1014], "valid", [], "NV8"], [[1015, 1015], "mapped", [1016]], [[1016, 1016], "valid"], [[1017, 1017], "mapped", [963]], [[1018, 1018], "mapped", [1019]], [[1019, 1019], "valid"], [[1020, 1020], "valid"], [[1021, 1021], "mapped", [891]], [[1022, 1022], "mapped", [892]], [[1023, 1023], "mapped", [893]], [[1024, 1024], "mapped", [1104]], [[1025, 1025], "mapped", [1105]], [[1026, 1026], "mapped", [1106]], [[1027, 1027], "mapped", [1107]], [[1028, 1028], "mapped", [1108]], [[1029, 1029], "mapped", [1109]], [[1030, 1030], "mapped", [1110]], [[1031, 1031], "mapped", [1111]], [[1032, 1032], "mapped", [1112]], [[1033, 1033], "mapped", [1113]], [[1034, 1034], "mapped", [1114]], [[1035, 1035], "mapped", [1115]], [[1036, 1036], "mapped", [1116]], [[1037, 1037], "mapped", [1117]], [[1038, 1038], "mapped", [1118]], [[1039, 1039], "mapped", [1119]], [[1040, 1040], "mapped", [1072]], [[1041, 1041], "mapped", [1073]], [[1042, 1042], "mapped", [1074]], [[1043, 1043], "mapped", [1075]], [[1044, 1044], "mapped", [1076]], [[1045, 1045], "mapped", [1077]], [[1046, 1046], "mapped", [1078]], [[1047, 1047], "mapped", [1079]], [[1048, 1048], "mapped", [1080]], [[1049, 1049], "mapped", [1081]], [[1050, 1050], "mapped", [1082]], [[1051, 1051], "mapped", [1083]], [[1052, 1052], "mapped", [1084]], [[1053, 1053], "mapped", [1085]], [[1054, 1054], "mapped", [1086]], [[1055, 1055], "mapped", [1087]], [[1056, 1056], "mapped", [1088]], [[1057, 1057], "mapped", [1089]], [[1058, 1058], "mapped", [1090]], [[1059, 1059], "mapped", [1091]], [[1060, 1060], "mapped", [1092]], [[1061, 1061], "mapped", [1093]], [[1062, 1062], "mapped", [1094]], [[1063, 1063], "mapped", [1095]], [[1064, 1064], "mapped", [1096]], [[1065, 1065], "mapped", [1097]], [[1066, 1066], "mapped", [1098]], [[1067, 1067], "mapped", [1099]], [[1068, 1068], "mapped", [1100]], [[1069, 1069], "mapped", [1101]], [[1070, 1070], "mapped", [1102]], [[1071, 1071], "mapped", [1103]], [[1072, 1103], "valid"], [[1104, 1104], "valid"], [[1105, 1116], "valid"], [[1117, 1117], "valid"], [[1118, 1119], "valid"], [[1120, 1120], "mapped", [1121]], [[1121, 1121], "valid"], [[1122, 1122], "mapped", [1123]], [[1123, 1123], "valid"], [[1124, 1124], "mapped", [1125]], [[1125, 1125], "valid"], [[1126, 1126], "mapped", [1127]], [[1127, 1127], "valid"], [[1128, 1128], "mapped", [1129]], [[1129, 1129], "valid"], [[1130, 1130], "mapped", [1131]], [[1131, 1131], "valid"], [[1132, 1132], "mapped", [1133]], [[1133, 1133], "valid"], [[1134, 1134], "mapped", [1135]], [[1135, 1135], "valid"], [[1136, 1136], "mapped", [1137]], [[1137, 1137], "valid"], [[1138, 1138], "mapped", [1139]], [[1139, 1139], "valid"], [[1140, 1140], "mapped", [1141]], [[1141, 1141], "valid"], [[1142, 1142], "mapped", [1143]], [[1143, 1143], "valid"], [[1144, 1144], "mapped", [1145]], [[1145, 1145], "valid"], [[1146, 1146], "mapped", [1147]], [[1147, 1147], "valid"], [[1148, 1148], "mapped", [1149]], [[1149, 1149], "valid"], [[1150, 1150], "mapped", [1151]], [[1151, 1151], "valid"], [[1152, 1152], "mapped", [1153]], [[1153, 1153], "valid"], [[1154, 1154], "valid", [], "NV8"], [[1155, 1158], "valid"], [[1159, 1159], "valid"], [[1160, 1161], "valid", [], "NV8"], [[1162, 1162], "mapped", [1163]], [[1163, 1163], "valid"], [[1164, 1164], "mapped", [1165]], [[1165, 1165], "valid"], [[1166, 1166], "mapped", [1167]], [[1167, 1167], "valid"], [[1168, 1168], "mapped", [1169]], [[1169, 1169], "valid"], [[1170, 1170], "mapped", [1171]], [[1171, 1171], "valid"], [[1172, 1172], "mapped", [1173]], [[1173, 1173], "valid"], [[1174, 1174], "mapped", [1175]], [[1175, 1175], "valid"], [[1176, 1176], "mapped", [1177]], [[1177, 1177], "valid"], [[1178, 1178], "mapped", [1179]], [[1179, 1179], "valid"], [[1180, 1180], "mapped", [1181]], [[1181, 1181], "valid"], [[1182, 1182], "mapped", [1183]], [[1183, 1183], "valid"], [[1184, 1184], "mapped", [1185]], [[1185, 1185], "valid"], [[1186, 1186], "mapped", [1187]], [[1187, 1187], "valid"], [[1188, 1188], "mapped", [1189]], [[1189, 1189], "valid"], [[1190, 1190], "mapped", [1191]], [[1191, 1191], "valid"], [[1192, 1192], "mapped", [1193]], [[1193, 1193], "valid"], [[1194, 1194], "mapped", [1195]], [[1195, 1195], "valid"], [[1196, 1196], "mapped", [1197]], [[1197, 1197], "valid"], [[1198, 1198], "mapped", [1199]], [[1199, 1199], "valid"], [[1200, 1200], "mapped", [1201]], [[1201, 1201], "valid"], [[1202, 1202], "mapped", [1203]], [[1203, 1203], "valid"], [[1204, 1204], "mapped", [1205]], [[1205, 1205], "valid"], [[1206, 1206], "mapped", [1207]], [[1207, 1207], "valid"], [[1208, 1208], "mapped", [1209]], [[1209, 1209], "valid"], [[1210, 1210], "mapped", [1211]], [[1211, 1211], "valid"], [[1212, 1212], "mapped", [1213]], [[1213, 1213], "valid"], [[1214, 1214], "mapped", [1215]], [[1215, 1215], "valid"], [[1216, 1216], "disallowed"], [[1217, 1217], "mapped", [1218]], [[1218, 1218], "valid"], [[1219, 1219], "mapped", [1220]], [[1220, 1220], "valid"], [[1221, 1221], "mapped", [1222]], [[1222, 1222], "valid"], [[1223, 1223], "mapped", [1224]], [[1224, 1224], "valid"], [[1225, 1225], "mapped", [1226]], [[1226, 1226], "valid"], [[1227, 1227], "mapped", [1228]], [[1228, 1228], "valid"], [[1229, 1229], "mapped", [1230]], [[1230, 1230], "valid"], [[1231, 1231], "valid"], [[1232, 1232], "mapped", [1233]], [[1233, 1233], "valid"], [[1234, 1234], "mapped", [1235]], [[1235, 1235], "valid"], [[1236, 1236], "mapped", [1237]], [[1237, 1237], "valid"], [[1238, 1238], "mapped", [1239]], [[1239, 1239], "valid"], [[1240, 1240], "mapped", [1241]], [[1241, 1241], "valid"], [[1242, 1242], "mapped", [1243]], [[1243, 1243], "valid"], [[1244, 1244], "mapped", [1245]], [[1245, 1245], "valid"], [[1246, 1246], "mapped", [1247]], [[1247, 1247], "valid"], [[1248, 1248], "mapped", [1249]], [[1249, 1249], "valid"], [[1250, 1250], "mapped", [1251]], [[1251, 1251], "valid"], [[1252, 1252], "mapped", [1253]], [[1253, 1253], "valid"], [[1254, 1254], "mapped", [1255]], [[1255, 1255], "valid"], [[1256, 1256], "mapped", [1257]], [[1257, 1257], "valid"], [[1258, 1258], "mapped", [1259]], [[1259, 1259], "valid"], [[1260, 1260], "mapped", [1261]], [[1261, 1261], "valid"], [[1262, 1262], "mapped", [1263]], [[1263, 1263], "valid"], [[1264, 1264], "mapped", [1265]], [[1265, 1265], "valid"], [[1266, 1266], "mapped", [1267]], [[1267, 1267], "valid"], [[1268, 1268], "mapped", [1269]], [[1269, 1269], "valid"], [[1270, 1270], "mapped", [1271]], [[1271, 1271], "valid"], [[1272, 1272], "mapped", [1273]], [[1273, 1273], "valid"], [[1274, 1274], "mapped", [1275]], [[1275, 1275], "valid"], [[1276, 1276], "mapped", [1277]], [[1277, 1277], "valid"], [[1278, 1278], "mapped", [1279]], [[1279, 1279], "valid"], [[1280, 1280], "mapped", [1281]], [[1281, 1281], "valid"], [[1282, 1282], "mapped", [1283]], [[1283, 1283], "valid"], [[1284, 1284], "mapped", [1285]], [[1285, 1285], "valid"], [[1286, 1286], "mapped", [1287]], [[1287, 1287], "valid"], [[1288, 1288], "mapped", [1289]], [[1289, 1289], "valid"], [[1290, 1290], "mapped", [1291]], [[1291, 1291], "valid"], [[1292, 1292], "mapped", [1293]], [[1293, 1293], "valid"], [[1294, 1294], "mapped", [1295]], [[1295, 1295], "valid"], [[1296, 1296], "mapped", [1297]], [[1297, 1297], "valid"], [[1298, 1298], "mapped", [1299]], [[1299, 1299], "valid"], [[1300, 1300], "mapped", [1301]], [[1301, 1301], "valid"], [[1302, 1302], "mapped", [1303]], [[1303, 1303], "valid"], [[1304, 1304], "mapped", [1305]], [[1305, 1305], "valid"], [[1306, 1306], "mapped", [1307]], [[1307, 1307], "valid"], [[1308, 1308], "mapped", [1309]], [[1309, 1309], "valid"], [[1310, 1310], "mapped", [1311]], [[1311, 1311], "valid"], [[1312, 1312], "mapped", [1313]], [[1313, 1313], "valid"], [[1314, 1314], "mapped", [1315]], [[1315, 1315], "valid"], [[1316, 1316], "mapped", [1317]], [[1317, 1317], "valid"], [[1318, 1318], "mapped", [1319]], [[1319, 1319], "valid"], [[1320, 1320], "mapped", [1321]], [[1321, 1321], "valid"], [[1322, 1322], "mapped", [1323]], [[1323, 1323], "valid"], [[1324, 1324], "mapped", [1325]], [[1325, 1325], "valid"], [[1326, 1326], "mapped", [1327]], [[1327, 1327], "valid"], [[1328, 1328], "disallowed"], [[1329, 1329], "mapped", [1377]], [[1330, 1330], "mapped", [1378]], [[1331, 1331], "mapped", [1379]], [[1332, 1332], "mapped", [1380]], [[1333, 1333], "mapped", [1381]], [[1334, 1334], "mapped", [1382]], [[1335, 1335], "mapped", [1383]], [[1336, 1336], "mapped", [1384]], [[1337, 1337], "mapped", [1385]], [[1338, 1338], "mapped", [1386]], [[1339, 1339], "mapped", [1387]], [[1340, 1340], "mapped", [1388]], [[1341, 1341], "mapped", [1389]], [[1342, 1342], "mapped", [1390]], [[1343, 1343], "mapped", [1391]], [[1344, 1344], "mapped", [1392]], [[1345, 1345], "mapped", [1393]], [[1346, 1346], "mapped", [1394]], [[1347, 1347], "mapped", [1395]], [[1348, 1348], "mapped", [1396]], [[1349, 1349], "mapped", [1397]], [[1350, 1350], "mapped", [1398]], [[1351, 1351], "mapped", [1399]], [[1352, 1352], "mapped", [1400]], [[1353, 1353], "mapped", [1401]], [[1354, 1354], "mapped", [1402]], [[1355, 1355], "mapped", [1403]], [[1356, 1356], "mapped", [1404]], [[1357, 1357], "mapped", [1405]], [[1358, 1358], "mapped", [1406]], [[1359, 1359], "mapped", [1407]], [[1360, 1360], "mapped", [1408]], [[1361, 1361], "mapped", [1409]], [[1362, 1362], "mapped", [1410]], [[1363, 1363], "mapped", [1411]], [[1364, 1364], "mapped", [1412]], [[1365, 1365], "mapped", [1413]], [[1366, 1366], "mapped", [1414]], [[1367, 1368], "disallowed"], [[1369, 1369], "valid"], [[1370, 1375], "valid", [], "NV8"], [[1376, 1376], "disallowed"], [[1377, 1414], "valid"], [[1415, 1415], "mapped", [1381, 1410]], [[1416, 1416], "disallowed"], [[1417, 1417], "valid", [], "NV8"], [[1418, 1418], "valid", [], "NV8"], [[1419, 1420], "disallowed"], [[1421, 1422], "valid", [], "NV8"], [[1423, 1423], "valid", [], "NV8"], [[1424, 1424], "disallowed"], [[1425, 1441], "valid"], [[1442, 1442], "valid"], [[1443, 1455], "valid"], [[1456, 1465], "valid"], [[1466, 1466], "valid"], [[1467, 1469], "valid"], [[1470, 1470], "valid", [], "NV8"], [[1471, 1471], "valid"], [[1472, 1472], "valid", [], "NV8"], [[1473, 1474], "valid"], [[1475, 1475], "valid", [], "NV8"], [[1476, 1476], "valid"], [[1477, 1477], "valid"], [[1478, 1478], "valid", [], "NV8"], [[1479, 1479], "valid"], [[1480, 1487], "disallowed"], [[1488, 1514], "valid"], [[1515, 1519], "disallowed"], [[1520, 1524], "valid"], [[1525, 1535], "disallowed"], [[1536, 1539], "disallowed"], [[1540, 1540], "disallowed"], [[1541, 1541], "disallowed"], [[1542, 1546], "valid", [], "NV8"], [[1547, 1547], "valid", [], "NV8"], [[1548, 1548], "valid", [], "NV8"], [[1549, 1551], "valid", [], "NV8"], [[1552, 1557], "valid"], [[1558, 1562], "valid"], [[1563, 1563], "valid", [], "NV8"], [[1564, 1564], "disallowed"], [[1565, 1565], "disallowed"], [[1566, 1566], "valid", [], "NV8"], [[1567, 1567], "valid", [], "NV8"], [[1568, 1568], "valid"], [[1569, 1594], "valid"], [[1595, 1599], "valid"], [[1600, 1600], "valid", [], "NV8"], [[1601, 1618], "valid"], [[1619, 1621], "valid"], [[1622, 1624], "valid"], [[1625, 1630], "valid"], [[1631, 1631], "valid"], [[1632, 1641], "valid"], [[1642, 1645], "valid", [], "NV8"], [[1646, 1647], "valid"], [[1648, 1652], "valid"], [[1653, 1653], "mapped", [1575, 1652]], [[1654, 1654], "mapped", [1608, 1652]], [[1655, 1655], "mapped", [1735, 1652]], [[1656, 1656], "mapped", [1610, 1652]], [[1657, 1719], "valid"], [[1720, 1721], "valid"], [[1722, 1726], "valid"], [[1727, 1727], "valid"], [[1728, 1742], "valid"], [[1743, 1743], "valid"], [[1744, 1747], "valid"], [[1748, 1748], "valid", [], "NV8"], [[1749, 1756], "valid"], [[1757, 1757], "disallowed"], [[1758, 1758], "valid", [], "NV8"], [[1759, 1768], "valid"], [[1769, 1769], "valid", [], "NV8"], [[1770, 1773], "valid"], [[1774, 1775], "valid"], [[1776, 1785], "valid"], [[1786, 1790], "valid"], [[1791, 1791], "valid"], [[1792, 1805], "valid", [], "NV8"], [[1806, 1806], "disallowed"], [[1807, 1807], "disallowed"], [[1808, 1836], "valid"], [[1837, 1839], "valid"], [[1840, 1866], "valid"], [[1867, 1868], "disallowed"], [[1869, 1871], "valid"], [[1872, 1901], "valid"], [[1902, 1919], "valid"], [[1920, 1968], "valid"], [[1969, 1969], "valid"], [[1970, 1983], "disallowed"], [[1984, 2037], "valid"], [[2038, 2042], "valid", [], "NV8"], [[2043, 2047], "disallowed"], [[2048, 2093], "valid"], [[2094, 2095], "disallowed"], [[2096, 2110], "valid", [], "NV8"], [[2111, 2111], "disallowed"], [[2112, 2139], "valid"], [[2140, 2141], "disallowed"], [[2142, 2142], "valid", [], "NV8"], [[2143, 2207], "disallowed"], [[2208, 2208], "valid"], [[2209, 2209], "valid"], [[2210, 2220], "valid"], [[2221, 2226], "valid"], [[2227, 2228], "valid"], [[2229, 2274], "disallowed"], [[2275, 2275], "valid"], [[2276, 2302], "valid"], [[2303, 2303], "valid"], [[2304, 2304], "valid"], [[2305, 2307], "valid"], [[2308, 2308], "valid"], [[2309, 2361], "valid"], [[2362, 2363], "valid"], [[2364, 2381], "valid"], [[2382, 2382], "valid"], [[2383, 2383], "valid"], [[2384, 2388], "valid"], [[2389, 2389], "valid"], [[2390, 2391], "valid"], [[2392, 2392], "mapped", [2325, 2364]], [[2393, 2393], "mapped", [2326, 2364]], [[2394, 2394], "mapped", [2327, 2364]], [[2395, 2395], "mapped", [2332, 2364]], [[2396, 2396], "mapped", [2337, 2364]], [[2397, 2397], "mapped", [2338, 2364]], [[2398, 2398], "mapped", [2347, 2364]], [[2399, 2399], "mapped", [2351, 2364]], [[2400, 2403], "valid"], [[2404, 2405], "valid", [], "NV8"], [[2406, 2415], "valid"], [[2416, 2416], "valid", [], "NV8"], [[2417, 2418], "valid"], [[2419, 2423], "valid"], [[2424, 2424], "valid"], [[2425, 2426], "valid"], [[2427, 2428], "valid"], [[2429, 2429], "valid"], [[2430, 2431], "valid"], [[2432, 2432], "valid"], [[2433, 2435], "valid"], [[2436, 2436], "disallowed"], [[2437, 2444], "valid"], [[2445, 2446], "disallowed"], [[2447, 2448], "valid"], [[2449, 2450], "disallowed"], [[2451, 2472], "valid"], [[2473, 2473], "disallowed"], [[2474, 2480], "valid"], [[2481, 2481], "disallowed"], [[2482, 2482], "valid"], [[2483, 2485], "disallowed"], [[2486, 2489], "valid"], [[2490, 2491], "disallowed"], [[2492, 2492], "valid"], [[2493, 2493], "valid"], [[2494, 2500], "valid"], [[2501, 2502], "disallowed"], [[2503, 2504], "valid"], [[2505, 2506], "disallowed"], [[2507, 2509], "valid"], [[2510, 2510], "valid"], [[2511, 2518], "disallowed"], [[2519, 2519], "valid"], [[2520, 2523], "disallowed"], [[2524, 2524], "mapped", [2465, 2492]], [[2525, 2525], "mapped", [2466, 2492]], [[2526, 2526], "disallowed"], [[2527, 2527], "mapped", [2479, 2492]], [[2528, 2531], "valid"], [[2532, 2533], "disallowed"], [[2534, 2545], "valid"], [[2546, 2554], "valid", [], "NV8"], [[2555, 2555], "valid", [], "NV8"], [[2556, 2560], "disallowed"], [[2561, 2561], "valid"], [[2562, 2562], "valid"], [[2563, 2563], "valid"], [[2564, 2564], "disallowed"], [[2565, 2570], "valid"], [[2571, 2574], "disallowed"], [[2575, 2576], "valid"], [[2577, 2578], "disallowed"], [[2579, 2600], "valid"], [[2601, 2601], "disallowed"], [[2602, 2608], "valid"], [[2609, 2609], "disallowed"], [[2610, 2610], "valid"], [[2611, 2611], "mapped", [2610, 2620]], [[2612, 2612], "disallowed"], [[2613, 2613], "valid"], [[2614, 2614], "mapped", [2616, 2620]], [[2615, 2615], "disallowed"], [[2616, 2617], "valid"], [[2618, 2619], "disallowed"], [[2620, 2620], "valid"], [[2621, 2621], "disallowed"], [[2622, 2626], "valid"], [[2627, 2630], "disallowed"], [[2631, 2632], "valid"], [[2633, 2634], "disallowed"], [[2635, 2637], "valid"], [[2638, 2640], "disallowed"], [[2641, 2641], "valid"], [[2642, 2648], "disallowed"], [[2649, 2649], "mapped", [2582, 2620]], [[2650, 2650], "mapped", [2583, 2620]], [[2651, 2651], "mapped", [2588, 2620]], [[2652, 2652], "valid"], [[2653, 2653], "disallowed"], [[2654, 2654], "mapped", [2603, 2620]], [[2655, 2661], "disallowed"], [[2662, 2676], "valid"], [[2677, 2677], "valid"], [[2678, 2688], "disallowed"], [[2689, 2691], "valid"], [[2692, 2692], "disallowed"], [[2693, 2699], "valid"], [[2700, 2700], "valid"], [[2701, 2701], "valid"], [[2702, 2702], "disallowed"], [[2703, 2705], "valid"], [[2706, 2706], "disallowed"], [[2707, 2728], "valid"], [[2729, 2729], "disallowed"], [[2730, 2736], "valid"], [[2737, 2737], "disallowed"], [[2738, 2739], "valid"], [[2740, 2740], "disallowed"], [[2741, 2745], "valid"], [[2746, 2747], "disallowed"], [[2748, 2757], "valid"], [[2758, 2758], "disallowed"], [[2759, 2761], "valid"], [[2762, 2762], "disallowed"], [[2763, 2765], "valid"], [[2766, 2767], "disallowed"], [[2768, 2768], "valid"], [[2769, 2783], "disallowed"], [[2784, 2784], "valid"], [[2785, 2787], "valid"], [[2788, 2789], "disallowed"], [[2790, 2799], "valid"], [[2800, 2800], "valid", [], "NV8"], [[2801, 2801], "valid", [], "NV8"], [[2802, 2808], "disallowed"], [[2809, 2809], "valid"], [[2810, 2816], "disallowed"], [[2817, 2819], "valid"], [[2820, 2820], "disallowed"], [[2821, 2828], "valid"], [[2829, 2830], "disallowed"], [[2831, 2832], "valid"], [[2833, 2834], "disallowed"], [[2835, 2856], "valid"], [[2857, 2857], "disallowed"], [[2858, 2864], "valid"], [[2865, 2865], "disallowed"], [[2866, 2867], "valid"], [[2868, 2868], "disallowed"], [[2869, 2869], "valid"], [[2870, 2873], "valid"], [[2874, 2875], "disallowed"], [[2876, 2883], "valid"], [[2884, 2884], "valid"], [[2885, 2886], "disallowed"], [[2887, 2888], "valid"], [[2889, 2890], "disallowed"], [[2891, 2893], "valid"], [[2894, 2901], "disallowed"], [[2902, 2903], "valid"], [[2904, 2907], "disallowed"], [[2908, 2908], "mapped", [2849, 2876]], [[2909, 2909], "mapped", [2850, 2876]], [[2910, 2910], "disallowed"], [[2911, 2913], "valid"], [[2914, 2915], "valid"], [[2916, 2917], "disallowed"], [[2918, 2927], "valid"], [[2928, 2928], "valid", [], "NV8"], [[2929, 2929], "valid"], [[2930, 2935], "valid", [], "NV8"], [[2936, 2945], "disallowed"], [[2946, 2947], "valid"], [[2948, 2948], "disallowed"], [[2949, 2954], "valid"], [[2955, 2957], "disallowed"], [[2958, 2960], "valid"], [[2961, 2961], "disallowed"], [[2962, 2965], "valid"], [[2966, 2968], "disallowed"], [[2969, 2970], "valid"], [[2971, 2971], "disallowed"], [[2972, 2972], "valid"], [[2973, 2973], "disallowed"], [[2974, 2975], "valid"], [[2976, 2978], "disallowed"], [[2979, 2980], "valid"], [[2981, 2983], "disallowed"], [[2984, 2986], "valid"], [[2987, 2989], "disallowed"], [[2990, 2997], "valid"], [[2998, 2998], "valid"], [[2999, 3001], "valid"], [[3002, 3005], "disallowed"], [[3006, 3010], "valid"], [[3011, 3013], "disallowed"], [[3014, 3016], "valid"], [[3017, 3017], "disallowed"], [[3018, 3021], "valid"], [[3022, 3023], "disallowed"], [[3024, 3024], "valid"], [[3025, 3030], "disallowed"], [[3031, 3031], "valid"], [[3032, 3045], "disallowed"], [[3046, 3046], "valid"], [[3047, 3055], "valid"], [[3056, 3058], "valid", [], "NV8"], [[3059, 3066], "valid", [], "NV8"], [[3067, 3071], "disallowed"], [[3072, 3072], "valid"], [[3073, 3075], "valid"], [[3076, 3076], "disallowed"], [[3077, 3084], "valid"], [[3085, 3085], "disallowed"], [[3086, 3088], "valid"], [[3089, 3089], "disallowed"], [[3090, 3112], "valid"], [[3113, 3113], "disallowed"], [[3114, 3123], "valid"], [[3124, 3124], "valid"], [[3125, 3129], "valid"], [[3130, 3132], "disallowed"], [[3133, 3133], "valid"], [[3134, 3140], "valid"], [[3141, 3141], "disallowed"], [[3142, 3144], "valid"], [[3145, 3145], "disallowed"], [[3146, 3149], "valid"], [[3150, 3156], "disallowed"], [[3157, 3158], "valid"], [[3159, 3159], "disallowed"], [[3160, 3161], "valid"], [[3162, 3162], "valid"], [[3163, 3167], "disallowed"], [[3168, 3169], "valid"], [[3170, 3171], "valid"], [[3172, 3173], "disallowed"], [[3174, 3183], "valid"], [[3184, 3191], "disallowed"], [[3192, 3199], "valid", [], "NV8"], [[3200, 3200], "disallowed"], [[3201, 3201], "valid"], [[3202, 3203], "valid"], [[3204, 3204], "disallowed"], [[3205, 3212], "valid"], [[3213, 3213], "disallowed"], [[3214, 3216], "valid"], [[3217, 3217], "disallowed"], [[3218, 3240], "valid"], [[3241, 3241], "disallowed"], [[3242, 3251], "valid"], [[3252, 3252], "disallowed"], [[3253, 3257], "valid"], [[3258, 3259], "disallowed"], [[3260, 3261], "valid"], [[3262, 3268], "valid"], [[3269, 3269], "disallowed"], [[3270, 3272], "valid"], [[3273, 3273], "disallowed"], [[3274, 3277], "valid"], [[3278, 3284], "disallowed"], [[3285, 3286], "valid"], [[3287, 3293], "disallowed"], [[3294, 3294], "valid"], [[3295, 3295], "disallowed"], [[3296, 3297], "valid"], [[3298, 3299], "valid"], [[3300, 3301], "disallowed"], [[3302, 3311], "valid"], [[3312, 3312], "disallowed"], [[3313, 3314], "valid"], [[3315, 3328], "disallowed"], [[3329, 3329], "valid"], [[3330, 3331], "valid"], [[3332, 3332], "disallowed"], [[3333, 3340], "valid"], [[3341, 3341], "disallowed"], [[3342, 3344], "valid"], [[3345, 3345], "disallowed"], [[3346, 3368], "valid"], [[3369, 3369], "valid"], [[3370, 3385], "valid"], [[3386, 3386], "valid"], [[3387, 3388], "disallowed"], [[3389, 3389], "valid"], [[3390, 3395], "valid"], [[3396, 3396], "valid"], [[3397, 3397], "disallowed"], [[3398, 3400], "valid"], [[3401, 3401], "disallowed"], [[3402, 3405], "valid"], [[3406, 3406], "valid"], [[3407, 3414], "disallowed"], [[3415, 3415], "valid"], [[3416, 3422], "disallowed"], [[3423, 3423], "valid"], [[3424, 3425], "valid"], [[3426, 3427], "valid"], [[3428, 3429], "disallowed"], [[3430, 3439], "valid"], [[3440, 3445], "valid", [], "NV8"], [[3446, 3448], "disallowed"], [[3449, 3449], "valid", [], "NV8"], [[3450, 3455], "valid"], [[3456, 3457], "disallowed"], [[3458, 3459], "valid"], [[3460, 3460], "disallowed"], [[3461, 3478], "valid"], [[3479, 3481], "disallowed"], [[3482, 3505], "valid"], [[3506, 3506], "disallowed"], [[3507, 3515], "valid"], [[3516, 3516], "disallowed"], [[3517, 3517], "valid"], [[3518, 3519], "disallowed"], [[3520, 3526], "valid"], [[3527, 3529], "disallowed"], [[3530, 3530], "valid"], [[3531, 3534], "disallowed"], [[3535, 3540], "valid"], [[3541, 3541], "disallowed"], [[3542, 3542], "valid"], [[3543, 3543], "disallowed"], [[3544, 3551], "valid"], [[3552, 3557], "disallowed"], [[3558, 3567], "valid"], [[3568, 3569], "disallowed"], [[3570, 3571], "valid"], [[3572, 3572], "valid", [], "NV8"], [[3573, 3584], "disallowed"], [[3585, 3634], "valid"], [[3635, 3635], "mapped", [3661, 3634]], [[3636, 3642], "valid"], [[3643, 3646], "disallowed"], [[3647, 3647], "valid", [], "NV8"], [[3648, 3662], "valid"], [[3663, 3663], "valid", [], "NV8"], [[3664, 3673], "valid"], [[3674, 3675], "valid", [], "NV8"], [[3676, 3712], "disallowed"], [[3713, 3714], "valid"], [[3715, 3715], "disallowed"], [[3716, 3716], "valid"], [[3717, 3718], "disallowed"], [[3719, 3720], "valid"], [[3721, 3721], "disallowed"], [[3722, 3722], "valid"], [[3723, 3724], "disallowed"], [[3725, 3725], "valid"], [[3726, 3731], "disallowed"], [[3732, 3735], "valid"], [[3736, 3736], "disallowed"], [[3737, 3743], "valid"], [[3744, 3744], "disallowed"], [[3745, 3747], "valid"], [[3748, 3748], "disallowed"], [[3749, 3749], "valid"], [[3750, 3750], "disallowed"], [[3751, 3751], "valid"], [[3752, 3753], "disallowed"], [[3754, 3755], "valid"], [[3756, 3756], "disallowed"], [[3757, 3762], "valid"], [[3763, 3763], "mapped", [3789, 3762]], [[3764, 3769], "valid"], [[3770, 3770], "disallowed"], [[3771, 3773], "valid"], [[3774, 3775], "disallowed"], [[3776, 3780], "valid"], [[3781, 3781], "disallowed"], [[3782, 3782], "valid"], [[3783, 3783], "disallowed"], [[3784, 3789], "valid"], [[3790, 3791], "disallowed"], [[3792, 3801], "valid"], [[3802, 3803], "disallowed"], [[3804, 3804], "mapped", [3755, 3737]], [[3805, 3805], "mapped", [3755, 3745]], [[3806, 3807], "valid"], [[3808, 3839], "disallowed"], [[3840, 3840], "valid"], [[3841, 3850], "valid", [], "NV8"], [[3851, 3851], "valid"], [[3852, 3852], "mapped", [3851]], [[3853, 3863], "valid", [], "NV8"], [[3864, 3865], "valid"], [[3866, 3871], "valid", [], "NV8"], [[3872, 3881], "valid"], [[3882, 3892], "valid", [], "NV8"], [[3893, 3893], "valid"], [[3894, 3894], "valid", [], "NV8"], [[3895, 3895], "valid"], [[3896, 3896], "valid", [], "NV8"], [[3897, 3897], "valid"], [[3898, 3901], "valid", [], "NV8"], [[3902, 3906], "valid"], [[3907, 3907], "mapped", [3906, 4023]], [[3908, 3911], "valid"], [[3912, 3912], "disallowed"], [[3913, 3916], "valid"], [[3917, 3917], "mapped", [3916, 4023]], [[3918, 3921], "valid"], [[3922, 3922], "mapped", [3921, 4023]], [[3923, 3926], "valid"], [[3927, 3927], "mapped", [3926, 4023]], [[3928, 3931], "valid"], [[3932, 3932], "mapped", [3931, 4023]], [[3933, 3944], "valid"], [[3945, 3945], "mapped", [3904, 4021]], [[3946, 3946], "valid"], [[3947, 3948], "valid"], [[3949, 3952], "disallowed"], [[3953, 3954], "valid"], [[3955, 3955], "mapped", [3953, 3954]], [[3956, 3956], "valid"], [[3957, 3957], "mapped", [3953, 3956]], [[3958, 3958], "mapped", [4018, 3968]], [[3959, 3959], "mapped", [4018, 3953, 3968]], [[3960, 3960], "mapped", [4019, 3968]], [[3961, 3961], "mapped", [4019, 3953, 3968]], [[3962, 3968], "valid"], [[3969, 3969], "mapped", [3953, 3968]], [[3970, 3972], "valid"], [[3973, 3973], "valid", [], "NV8"], [[3974, 3979], "valid"], [[3980, 3983], "valid"], [[3984, 3986], "valid"], [[3987, 3987], "mapped", [3986, 4023]], [[3988, 3989], "valid"], [[3990, 3990], "valid"], [[3991, 3991], "valid"], [[3992, 3992], "disallowed"], [[3993, 3996], "valid"], [[3997, 3997], "mapped", [3996, 4023]], [[3998, 4001], "valid"], [[4002, 4002], "mapped", [4001, 4023]], [[4003, 4006], "valid"], [[4007, 4007], "mapped", [4006, 4023]], [[4008, 4011], "valid"], [[4012, 4012], "mapped", [4011, 4023]], [[4013, 4013], "valid"], [[4014, 4016], "valid"], [[4017, 4023], "valid"], [[4024, 4024], "valid"], [[4025, 4025], "mapped", [3984, 4021]], [[4026, 4028], "valid"], [[4029, 4029], "disallowed"], [[4030, 4037], "valid", [], "NV8"], [[4038, 4038], "valid"], [[4039, 4044], "valid", [], "NV8"], [[4045, 4045], "disallowed"], [[4046, 4046], "valid", [], "NV8"], [[4047, 4047], "valid", [], "NV8"], [[4048, 4049], "valid", [], "NV8"], [[4050, 4052], "valid", [], "NV8"], [[4053, 4056], "valid", [], "NV8"], [[4057, 4058], "valid", [], "NV8"], [[4059, 4095], "disallowed"], [[4096, 4129], "valid"], [[4130, 4130], "valid"], [[4131, 4135], "valid"], [[4136, 4136], "valid"], [[4137, 4138], "valid"], [[4139, 4139], "valid"], [[4140, 4146], "valid"], [[4147, 4149], "valid"], [[4150, 4153], "valid"], [[4154, 4159], "valid"], [[4160, 4169], "valid"], [[4170, 4175], "valid", [], "NV8"], [[4176, 4185], "valid"], [[4186, 4249], "valid"], [[4250, 4253], "valid"], [[4254, 4255], "valid", [], "NV8"], [[4256, 4293], "disallowed"], [[4294, 4294], "disallowed"], [[4295, 4295], "mapped", [11559]], [[4296, 4300], "disallowed"], [[4301, 4301], "mapped", [11565]], [[4302, 4303], "disallowed"], [[4304, 4342], "valid"], [[4343, 4344], "valid"], [[4345, 4346], "valid"], [[4347, 4347], "valid", [], "NV8"], [[4348, 4348], "mapped", [4316]], [[4349, 4351], "valid"], [[4352, 4441], "valid", [], "NV8"], [[4442, 4446], "valid", [], "NV8"], [[4447, 4448], "disallowed"], [[4449, 4514], "valid", [], "NV8"], [[4515, 4519], "valid", [], "NV8"], [[4520, 4601], "valid", [], "NV8"], [[4602, 4607], "valid", [], "NV8"], [[4608, 4614], "valid"], [[4615, 4615], "valid"], [[4616, 4678], "valid"], [[4679, 4679], "valid"], [[4680, 4680], "valid"], [[4681, 4681], "disallowed"], [[4682, 4685], "valid"], [[4686, 4687], "disallowed"], [[4688, 4694], "valid"], [[4695, 4695], "disallowed"], [[4696, 4696], "valid"], [[4697, 4697], "disallowed"], [[4698, 4701], "valid"], [[4702, 4703], "disallowed"], [[4704, 4742], "valid"], [[4743, 4743], "valid"], [[4744, 4744], "valid"], [[4745, 4745], "disallowed"], [[4746, 4749], "valid"], [[4750, 4751], "disallowed"], [[4752, 4782], "valid"], [[4783, 4783], "valid"], [[4784, 4784], "valid"], [[4785, 4785], "disallowed"], [[4786, 4789], "valid"], [[4790, 4791], "disallowed"], [[4792, 4798], "valid"], [[4799, 4799], "disallowed"], [[4800, 4800], "valid"], [[4801, 4801], "disallowed"], [[4802, 4805], "valid"], [[4806, 4807], "disallowed"], [[4808, 4814], "valid"], [[4815, 4815], "valid"], [[4816, 4822], "valid"], [[4823, 4823], "disallowed"], [[4824, 4846], "valid"], [[4847, 4847], "valid"], [[4848, 4878], "valid"], [[4879, 4879], "valid"], [[4880, 4880], "valid"], [[4881, 4881], "disallowed"], [[4882, 4885], "valid"], [[4886, 4887], "disallowed"], [[4888, 4894], "valid"], [[4895, 4895], "valid"], [[4896, 4934], "valid"], [[4935, 4935], "valid"], [[4936, 4954], "valid"], [[4955, 4956], "disallowed"], [[4957, 4958], "valid"], [[4959, 4959], "valid"], [[4960, 4960], "valid", [], "NV8"], [[4961, 4988], "valid", [], "NV8"], [[4989, 4991], "disallowed"], [[4992, 5007], "valid"], [[5008, 5017], "valid", [], "NV8"], [[5018, 5023], "disallowed"], [[5024, 5108], "valid"], [[5109, 5109], "valid"], [[5110, 5111], "disallowed"], [[5112, 5112], "mapped", [5104]], [[5113, 5113], "mapped", [5105]], [[5114, 5114], "mapped", [5106]], [[5115, 5115], "mapped", [5107]], [[5116, 5116], "mapped", [5108]], [[5117, 5117], "mapped", [5109]], [[5118, 5119], "disallowed"], [[5120, 5120], "valid", [], "NV8"], [[5121, 5740], "valid"], [[5741, 5742], "valid", [], "NV8"], [[5743, 5750], "valid"], [[5751, 5759], "valid"], [[5760, 5760], "disallowed"], [[5761, 5786], "valid"], [[5787, 5788], "valid", [], "NV8"], [[5789, 5791], "disallowed"], [[5792, 5866], "valid"], [[5867, 5872], "valid", [], "NV8"], [[5873, 5880], "valid"], [[5881, 5887], "disallowed"], [[5888, 5900], "valid"], [[5901, 5901], "disallowed"], [[5902, 5908], "valid"], [[5909, 5919], "disallowed"], [[5920, 5940], "valid"], [[5941, 5942], "valid", [], "NV8"], [[5943, 5951], "disallowed"], [[5952, 5971], "valid"], [[5972, 5983], "disallowed"], [[5984, 5996], "valid"], [[5997, 5997], "disallowed"], [[5998, 6e3], "valid"], [[6001, 6001], "disallowed"], [[6002, 6003], "valid"], [[6004, 6015], "disallowed"], [[6016, 6067], "valid"], [[6068, 6069], "disallowed"], [[6070, 6099], "valid"], [[6100, 6102], "valid", [], "NV8"], [[6103, 6103], "valid"], [[6104, 6107], "valid", [], "NV8"], [[6108, 6108], "valid"], [[6109, 6109], "valid"], [[6110, 6111], "disallowed"], [[6112, 6121], "valid"], [[6122, 6127], "disallowed"], [[6128, 6137], "valid", [], "NV8"], [[6138, 6143], "disallowed"], [[6144, 6149], "valid", [], "NV8"], [[6150, 6150], "disallowed"], [[6151, 6154], "valid", [], "NV8"], [[6155, 6157], "ignored"], [[6158, 6158], "disallowed"], [[6159, 6159], "disallowed"], [[6160, 6169], "valid"], [[6170, 6175], "disallowed"], [[6176, 6263], "valid"], [[6264, 6271], "disallowed"], [[6272, 6313], "valid"], [[6314, 6314], "valid"], [[6315, 6319], "disallowed"], [[6320, 6389], "valid"], [[6390, 6399], "disallowed"], [[6400, 6428], "valid"], [[6429, 6430], "valid"], [[6431, 6431], "disallowed"], [[6432, 6443], "valid"], [[6444, 6447], "disallowed"], [[6448, 6459], "valid"], [[6460, 6463], "disallowed"], [[6464, 6464], "valid", [], "NV8"], [[6465, 6467], "disallowed"], [[6468, 6469], "valid", [], "NV8"], [[6470, 6509], "valid"], [[6510, 6511], "disallowed"], [[6512, 6516], "valid"], [[6517, 6527], "disallowed"], [[6528, 6569], "valid"], [[6570, 6571], "valid"], [[6572, 6575], "disallowed"], [[6576, 6601], "valid"], [[6602, 6607], "disallowed"], [[6608, 6617], "valid"], [[6618, 6618], "valid", [], "XV8"], [[6619, 6621], "disallowed"], [[6622, 6623], "valid", [], "NV8"], [[6624, 6655], "valid", [], "NV8"], [[6656, 6683], "valid"], [[6684, 6685], "disallowed"], [[6686, 6687], "valid", [], "NV8"], [[6688, 6750], "valid"], [[6751, 6751], "disallowed"], [[6752, 6780], "valid"], [[6781, 6782], "disallowed"], [[6783, 6793], "valid"], [[6794, 6799], "disallowed"], [[6800, 6809], "valid"], [[6810, 6815], "disallowed"], [[6816, 6822], "valid", [], "NV8"], [[6823, 6823], "valid"], [[6824, 6829], "valid", [], "NV8"], [[6830, 6831], "disallowed"], [[6832, 6845], "valid"], [[6846, 6846], "valid", [], "NV8"], [[6847, 6911], "disallowed"], [[6912, 6987], "valid"], [[6988, 6991], "disallowed"], [[6992, 7001], "valid"], [[7002, 7018], "valid", [], "NV8"], [[7019, 7027], "valid"], [[7028, 7036], "valid", [], "NV8"], [[7037, 7039], "disallowed"], [[7040, 7082], "valid"], [[7083, 7085], "valid"], [[7086, 7097], "valid"], [[7098, 7103], "valid"], [[7104, 7155], "valid"], [[7156, 7163], "disallowed"], [[7164, 7167], "valid", [], "NV8"], [[7168, 7223], "valid"], [[7224, 7226], "disallowed"], [[7227, 7231], "valid", [], "NV8"], [[7232, 7241], "valid"], [[7242, 7244], "disallowed"], [[7245, 7293], "valid"], [[7294, 7295], "valid", [], "NV8"], [[7296, 7359], "disallowed"], [[7360, 7367], "valid", [], "NV8"], [[7368, 7375], "disallowed"], [[7376, 7378], "valid"], [[7379, 7379], "valid", [], "NV8"], [[7380, 7410], "valid"], [[7411, 7414], "valid"], [[7415, 7415], "disallowed"], [[7416, 7417], "valid"], [[7418, 7423], "disallowed"], [[7424, 7467], "valid"], [[7468, 7468], "mapped", [97]], [[7469, 7469], "mapped", [230]], [[7470, 7470], "mapped", [98]], [[7471, 7471], "valid"], [[7472, 7472], "mapped", [100]], [[7473, 7473], "mapped", [101]], [[7474, 7474], "mapped", [477]], [[7475, 7475], "mapped", [103]], [[7476, 7476], "mapped", [104]], [[7477, 7477], "mapped", [105]], [[7478, 7478], "mapped", [106]], [[7479, 7479], "mapped", [107]], [[7480, 7480], "mapped", [108]], [[7481, 7481], "mapped", [109]], [[7482, 7482], "mapped", [110]], [[7483, 7483], "valid"], [[7484, 7484], "mapped", [111]], [[7485, 7485], "mapped", [547]], [[7486, 7486], "mapped", [112]], [[7487, 7487], "mapped", [114]], [[7488, 7488], "mapped", [116]], [[7489, 7489], "mapped", [117]], [[7490, 7490], "mapped", [119]], [[7491, 7491], "mapped", [97]], [[7492, 7492], "mapped", [592]], [[7493, 7493], "mapped", [593]], [[7494, 7494], "mapped", [7426]], [[7495, 7495], "mapped", [98]], [[7496, 7496], "mapped", [100]], [[7497, 7497], "mapped", [101]], [[7498, 7498], "mapped", [601]], [[7499, 7499], "mapped", [603]], [[7500, 7500], "mapped", [604]], [[7501, 7501], "mapped", [103]], [[7502, 7502], "valid"], [[7503, 7503], "mapped", [107]], [[7504, 7504], "mapped", [109]], [[7505, 7505], "mapped", [331]], [[7506, 7506], "mapped", [111]], [[7507, 7507], "mapped", [596]], [[7508, 7508], "mapped", [7446]], [[7509, 7509], "mapped", [7447]], [[7510, 7510], "mapped", [112]], [[7511, 7511], "mapped", [116]], [[7512, 7512], "mapped", [117]], [[7513, 7513], "mapped", [7453]], [[7514, 7514], "mapped", [623]], [[7515, 7515], "mapped", [118]], [[7516, 7516], "mapped", [7461]], [[7517, 7517], "mapped", [946]], [[7518, 7518], "mapped", [947]], [[7519, 7519], "mapped", [948]], [[7520, 7520], "mapped", [966]], [[7521, 7521], "mapped", [967]], [[7522, 7522], "mapped", [105]], [[7523, 7523], "mapped", [114]], [[7524, 7524], "mapped", [117]], [[7525, 7525], "mapped", [118]], [[7526, 7526], "mapped", [946]], [[7527, 7527], "mapped", [947]], [[7528, 7528], "mapped", [961]], [[7529, 7529], "mapped", [966]], [[7530, 7530], "mapped", [967]], [[7531, 7531], "valid"], [[7532, 7543], "valid"], [[7544, 7544], "mapped", [1085]], [[7545, 7578], "valid"], [[7579, 7579], "mapped", [594]], [[7580, 7580], "mapped", [99]], [[7581, 7581], "mapped", [597]], [[7582, 7582], "mapped", [240]], [[7583, 7583], "mapped", [604]], [[7584, 7584], "mapped", [102]], [[7585, 7585], "mapped", [607]], [[7586, 7586], "mapped", [609]], [[7587, 7587], "mapped", [613]], [[7588, 7588], "mapped", [616]], [[7589, 7589], "mapped", [617]], [[7590, 7590], "mapped", [618]], [[7591, 7591], "mapped", [7547]], [[7592, 7592], "mapped", [669]], [[7593, 7593], "mapped", [621]], [[7594, 7594], "mapped", [7557]], [[7595, 7595], "mapped", [671]], [[7596, 7596], "mapped", [625]], [[7597, 7597], "mapped", [624]], [[7598, 7598], "mapped", [626]], [[7599, 7599], "mapped", [627]], [[7600, 7600], "mapped", [628]], [[7601, 7601], "mapped", [629]], [[7602, 7602], "mapped", [632]], [[7603, 7603], "mapped", [642]], [[7604, 7604], "mapped", [643]], [[7605, 7605], "mapped", [427]], [[7606, 7606], "mapped", [649]], [[7607, 7607], "mapped", [650]], [[7608, 7608], "mapped", [7452]], [[7609, 7609], "mapped", [651]], [[7610, 7610], "mapped", [652]], [[7611, 7611], "mapped", [122]], [[7612, 7612], "mapped", [656]], [[7613, 7613], "mapped", [657]], [[7614, 7614], "mapped", [658]], [[7615, 7615], "mapped", [952]], [[7616, 7619], "valid"], [[7620, 7626], "valid"], [[7627, 7654], "valid"], [[7655, 7669], "valid"], [[7670, 7675], "disallowed"], [[7676, 7676], "valid"], [[7677, 7677], "valid"], [[7678, 7679], "valid"], [[7680, 7680], "mapped", [7681]], [[7681, 7681], "valid"], [[7682, 7682], "mapped", [7683]], [[7683, 7683], "valid"], [[7684, 7684], "mapped", [7685]], [[7685, 7685], "valid"], [[7686, 7686], "mapped", [7687]], [[7687, 7687], "valid"], [[7688, 7688], "mapped", [7689]], [[7689, 7689], "valid"], [[7690, 7690], "mapped", [7691]], [[7691, 7691], "valid"], [[7692, 7692], "mapped", [7693]], [[7693, 7693], "valid"], [[7694, 7694], "mapped", [7695]], [[7695, 7695], "valid"], [[7696, 7696], "mapped", [7697]], [[7697, 7697], "valid"], [[7698, 7698], "mapped", [7699]], [[7699, 7699], "valid"], [[7700, 7700], "mapped", [7701]], [[7701, 7701], "valid"], [[7702, 7702], "mapped", [7703]], [[7703, 7703], "valid"], [[7704, 7704], "mapped", [7705]], [[7705, 7705], "valid"], [[7706, 7706], "mapped", [7707]], [[7707, 7707], "valid"], [[7708, 7708], "mapped", [7709]], [[7709, 7709], "valid"], [[7710, 7710], "mapped", [7711]], [[7711, 7711], "valid"], [[7712, 7712], "mapped", [7713]], [[7713, 7713], "valid"], [[7714, 7714], "mapped", [7715]], [[7715, 7715], "valid"], [[7716, 7716], "mapped", [7717]], [[7717, 7717], "valid"], [[7718, 7718], "mapped", [7719]], [[7719, 7719], "valid"], [[7720, 7720], "mapped", [7721]], [[7721, 7721], "valid"], [[7722, 7722], "mapped", [7723]], [[7723, 7723], "valid"], [[7724, 7724], "mapped", [7725]], [[7725, 7725], "valid"], [[7726, 7726], "mapped", [7727]], [[7727, 7727], "valid"], [[7728, 7728], "mapped", [7729]], [[7729, 7729], "valid"], [[7730, 7730], "mapped", [7731]], [[7731, 7731], "valid"], [[7732, 7732], "mapped", [7733]], [[7733, 7733], "valid"], [[7734, 7734], "mapped", [7735]], [[7735, 7735], "valid"], [[7736, 7736], "mapped", [7737]], [[7737, 7737], "valid"], [[7738, 7738], "mapped", [7739]], [[7739, 7739], "valid"], [[7740, 7740], "mapped", [7741]], [[7741, 7741], "valid"], [[7742, 7742], "mapped", [7743]], [[7743, 7743], "valid"], [[7744, 7744], "mapped", [7745]], [[7745, 7745], "valid"], [[7746, 7746], "mapped", [7747]], [[7747, 7747], "valid"], [[7748, 7748], "mapped", [7749]], [[7749, 7749], "valid"], [[7750, 7750], "mapped", [7751]], [[7751, 7751], "valid"], [[7752, 7752], "mapped", [7753]], [[7753, 7753], "valid"], [[7754, 7754], "mapped", [7755]], [[7755, 7755], "valid"], [[7756, 7756], "mapped", [7757]], [[7757, 7757], "valid"], [[7758, 7758], "mapped", [7759]], [[7759, 7759], "valid"], [[7760, 7760], "mapped", [7761]], [[7761, 7761], "valid"], [[7762, 7762], "mapped", [7763]], [[7763, 7763], "valid"], [[7764, 7764], "mapped", [7765]], [[7765, 7765], "valid"], [[7766, 7766], "mapped", [7767]], [[7767, 7767], "valid"], [[7768, 7768], "mapped", [7769]], [[7769, 7769], "valid"], [[7770, 7770], "mapped", [7771]], [[7771, 7771], "valid"], [[7772, 7772], "mapped", [7773]], [[7773, 7773], "valid"], [[7774, 7774], "mapped", [7775]], [[7775, 7775], "valid"], [[7776, 7776], "mapped", [7777]], [[7777, 7777], "valid"], [[7778, 7778], "mapped", [7779]], [[7779, 7779], "valid"], [[7780, 7780], "mapped", [7781]], [[7781, 7781], "valid"], [[7782, 7782], "mapped", [7783]], [[7783, 7783], "valid"], [[7784, 7784], "mapped", [7785]], [[7785, 7785], "valid"], [[7786, 7786], "mapped", [7787]], [[7787, 7787], "valid"], [[7788, 7788], "mapped", [7789]], [[7789, 7789], "valid"], [[7790, 7790], "mapped", [7791]], [[7791, 7791], "valid"], [[7792, 7792], "mapped", [7793]], [[7793, 7793], "valid"], [[7794, 7794], "mapped", [7795]], [[7795, 7795], "valid"], [[7796, 7796], "mapped", [7797]], [[7797, 7797], "valid"], [[7798, 7798], "mapped", [7799]], [[7799, 7799], "valid"], [[7800, 7800], "mapped", [7801]], [[7801, 7801], "valid"], [[7802, 7802], "mapped", [7803]], [[7803, 7803], "valid"], [[7804, 7804], "mapped", [7805]], [[7805, 7805], "valid"], [[7806, 7806], "mapped", [7807]], [[7807, 7807], "valid"], [[7808, 7808], "mapped", [7809]], [[7809, 7809], "valid"], [[7810, 7810], "mapped", [7811]], [[7811, 7811], "valid"], [[7812, 7812], "mapped", [7813]], [[7813, 7813], "valid"], [[7814, 7814], "mapped", [7815]], [[7815, 7815], "valid"], [[7816, 7816], "mapped", [7817]], [[7817, 7817], "valid"], [[7818, 7818], "mapped", [7819]], [[7819, 7819], "valid"], [[7820, 7820], "mapped", [7821]], [[7821, 7821], "valid"], [[7822, 7822], "mapped", [7823]], [[7823, 7823], "valid"], [[7824, 7824], "mapped", [7825]], [[7825, 7825], "valid"], [[7826, 7826], "mapped", [7827]], [[7827, 7827], "valid"], [[7828, 7828], "mapped", [7829]], [[7829, 7833], "valid"], [[7834, 7834], "mapped", [97, 702]], [[7835, 7835], "mapped", [7777]], [[7836, 7837], "valid"], [[7838, 7838], "mapped", [115, 115]], [[7839, 7839], "valid"], [[7840, 7840], "mapped", [7841]], [[7841, 7841], "valid"], [[7842, 7842], "mapped", [7843]], [[7843, 7843], "valid"], [[7844, 7844], "mapped", [7845]], [[7845, 7845], "valid"], [[7846, 7846], "mapped", [7847]], [[7847, 7847], "valid"], [[7848, 7848], "mapped", [7849]], [[7849, 7849], "valid"], [[7850, 7850], "mapped", [7851]], [[7851, 7851], "valid"], [[7852, 7852], "mapped", [7853]], [[7853, 7853], "valid"], [[7854, 7854], "mapped", [7855]], [[7855, 7855], "valid"], [[7856, 7856], "mapped", [7857]], [[7857, 7857], "valid"], [[7858, 7858], "mapped", [7859]], [[7859, 7859], "valid"], [[7860, 7860], "mapped", [7861]], [[7861, 7861], "valid"], [[7862, 7862], "mapped", [7863]], [[7863, 7863], "valid"], [[7864, 7864], "mapped", [7865]], [[7865, 7865], "valid"], [[7866, 7866], "mapped", [7867]], [[7867, 7867], "valid"], [[7868, 7868], "mapped", [7869]], [[7869, 7869], "valid"], [[7870, 7870], "mapped", [7871]], [[7871, 7871], "valid"], [[7872, 7872], "mapped", [7873]], [[7873, 7873], "valid"], [[7874, 7874], "mapped", [7875]], [[7875, 7875], "valid"], [[7876, 7876], "mapped", [7877]], [[7877, 7877], "valid"], [[7878, 7878], "mapped", [7879]], [[7879, 7879], "valid"], [[7880, 7880], "mapped", [7881]], [[7881, 7881], "valid"], [[7882, 7882], "mapped", [7883]], [[7883, 7883], "valid"], [[7884, 7884], "mapped", [7885]], [[7885, 7885], "valid"], [[7886, 7886], "mapped", [7887]], [[7887, 7887], "valid"], [[7888, 7888], "mapped", [7889]], [[7889, 7889], "valid"], [[7890, 7890], "mapped", [7891]], [[7891, 7891], "valid"], [[7892, 7892], "mapped", [7893]], [[7893, 7893], "valid"], [[7894, 7894], "mapped", [7895]], [[7895, 7895], "valid"], [[7896, 7896], "mapped", [7897]], [[7897, 7897], "valid"], [[7898, 7898], "mapped", [7899]], [[7899, 7899], "valid"], [[7900, 7900], "mapped", [7901]], [[7901, 7901], "valid"], [[7902, 7902], "mapped", [7903]], [[7903, 7903], "valid"], [[7904, 7904], "mapped", [7905]], [[7905, 7905], "valid"], [[7906, 7906], "mapped", [7907]], [[7907, 7907], "valid"], [[7908, 7908], "mapped", [7909]], [[7909, 7909], "valid"], [[7910, 7910], "mapped", [7911]], [[7911, 7911], "valid"], [[7912, 7912], "mapped", [7913]], [[7913, 7913], "valid"], [[7914, 7914], "mapped", [7915]], [[7915, 7915], "valid"], [[7916, 7916], "mapped", [7917]], [[7917, 7917], "valid"], [[7918, 7918], "mapped", [7919]], [[7919, 7919], "valid"], [[7920, 7920], "mapped", [7921]], [[7921, 7921], "valid"], [[7922, 7922], "mapped", [7923]], [[7923, 7923], "valid"], [[7924, 7924], "mapped", [7925]], [[7925, 7925], "valid"], [[7926, 7926], "mapped", [7927]], [[7927, 7927], "valid"], [[7928, 7928], "mapped", [7929]], [[7929, 7929], "valid"], [[7930, 7930], "mapped", [7931]], [[7931, 7931], "valid"], [[7932, 7932], "mapped", [7933]], [[7933, 7933], "valid"], [[7934, 7934], "mapped", [7935]], [[7935, 7935], "valid"], [[7936, 7943], "valid"], [[7944, 7944], "mapped", [7936]], [[7945, 7945], "mapped", [7937]], [[7946, 7946], "mapped", [7938]], [[7947, 7947], "mapped", [7939]], [[7948, 7948], "mapped", [7940]], [[7949, 7949], "mapped", [7941]], [[7950, 7950], "mapped", [7942]], [[7951, 7951], "mapped", [7943]], [[7952, 7957], "valid"], [[7958, 7959], "disallowed"], [[7960, 7960], "mapped", [7952]], [[7961, 7961], "mapped", [7953]], [[7962, 7962], "mapped", [7954]], [[7963, 7963], "mapped", [7955]], [[7964, 7964], "mapped", [7956]], [[7965, 7965], "mapped", [7957]], [[7966, 7967], "disallowed"], [[7968, 7975], "valid"], [[7976, 7976], "mapped", [7968]], [[7977, 7977], "mapped", [7969]], [[7978, 7978], "mapped", [7970]], [[7979, 7979], "mapped", [7971]], [[7980, 7980], "mapped", [7972]], [[7981, 7981], "mapped", [7973]], [[7982, 7982], "mapped", [7974]], [[7983, 7983], "mapped", [7975]], [[7984, 7991], "valid"], [[7992, 7992], "mapped", [7984]], [[7993, 7993], "mapped", [7985]], [[7994, 7994], "mapped", [7986]], [[7995, 7995], "mapped", [7987]], [[7996, 7996], "mapped", [7988]], [[7997, 7997], "mapped", [7989]], [[7998, 7998], "mapped", [7990]], [[7999, 7999], "mapped", [7991]], [[8e3, 8005], "valid"], [[8006, 8007], "disallowed"], [[8008, 8008], "mapped", [8e3]], [[8009, 8009], "mapped", [8001]], [[8010, 8010], "mapped", [8002]], [[8011, 8011], "mapped", [8003]], [[8012, 8012], "mapped", [8004]], [[8013, 8013], "mapped", [8005]], [[8014, 8015], "disallowed"], [[8016, 8023], "valid"], [[8024, 8024], "disallowed"], [[8025, 8025], "mapped", [8017]], [[8026, 8026], "disallowed"], [[8027, 8027], "mapped", [8019]], [[8028, 8028], "disallowed"], [[8029, 8029], "mapped", [8021]], [[8030, 8030], "disallowed"], [[8031, 8031], "mapped", [8023]], [[8032, 8039], "valid"], [[8040, 8040], "mapped", [8032]], [[8041, 8041], "mapped", [8033]], [[8042, 8042], "mapped", [8034]], [[8043, 8043], "mapped", [8035]], [[8044, 8044], "mapped", [8036]], [[8045, 8045], "mapped", [8037]], [[8046, 8046], "mapped", [8038]], [[8047, 8047], "mapped", [8039]], [[8048, 8048], "valid"], [[8049, 8049], "mapped", [940]], [[8050, 8050], "valid"], [[8051, 8051], "mapped", [941]], [[8052, 8052], "valid"], [[8053, 8053], "mapped", [942]], [[8054, 8054], "valid"], [[8055, 8055], "mapped", [943]], [[8056, 8056], "valid"], [[8057, 8057], "mapped", [972]], [[8058, 8058], "valid"], [[8059, 8059], "mapped", [973]], [[8060, 8060], "valid"], [[8061, 8061], "mapped", [974]], [[8062, 8063], "disallowed"], [[8064, 8064], "mapped", [7936, 953]], [[8065, 8065], "mapped", [7937, 953]], [[8066, 8066], "mapped", [7938, 953]], [[8067, 8067], "mapped", [7939, 953]], [[8068, 8068], "mapped", [7940, 953]], [[8069, 8069], "mapped", [7941, 953]], [[8070, 8070], "mapped", [7942, 953]], [[8071, 8071], "mapped", [7943, 953]], [[8072, 8072], "mapped", [7936, 953]], [[8073, 8073], "mapped", [7937, 953]], [[8074, 8074], "mapped", [7938, 953]], [[8075, 8075], "mapped", [7939, 953]], [[8076, 8076], "mapped", [7940, 953]], [[8077, 8077], "mapped", [7941, 953]], [[8078, 8078], "mapped", [7942, 953]], [[8079, 8079], "mapped", [7943, 953]], [[8080, 8080], "mapped", [7968, 953]], [[8081, 8081], "mapped", [7969, 953]], [[8082, 8082], "mapped", [7970, 953]], [[8083, 8083], "mapped", [7971, 953]], [[8084, 8084], "mapped", [7972, 953]], [[8085, 8085], "mapped", [7973, 953]], [[8086, 8086], "mapped", [7974, 953]], [[8087, 8087], "mapped", [7975, 953]], [[8088, 8088], "mapped", [7968, 953]], [[8089, 8089], "mapped", [7969, 953]], [[8090, 8090], "mapped", [7970, 953]], [[8091, 8091], "mapped", [7971, 953]], [[8092, 8092], "mapped", [7972, 953]], [[8093, 8093], "mapped", [7973, 953]], [[8094, 8094], "mapped", [7974, 953]], [[8095, 8095], "mapped", [7975, 953]], [[8096, 8096], "mapped", [8032, 953]], [[8097, 8097], "mapped", [8033, 953]], [[8098, 8098], "mapped", [8034, 953]], [[8099, 8099], "mapped", [8035, 953]], [[8100, 8100], "mapped", [8036, 953]], [[8101, 8101], "mapped", [8037, 953]], [[8102, 8102], "mapped", [8038, 953]], [[8103, 8103], "mapped", [8039, 953]], [[8104, 8104], "mapped", [8032, 953]], [[8105, 8105], "mapped", [8033, 953]], [[8106, 8106], "mapped", [8034, 953]], [[8107, 8107], "mapped", [8035, 953]], [[8108, 8108], "mapped", [8036, 953]], [[8109, 8109], "mapped", [8037, 953]], [[8110, 8110], "mapped", [8038, 953]], [[8111, 8111], "mapped", [8039, 953]], [[8112, 8113], "valid"], [[8114, 8114], "mapped", [8048, 953]], [[8115, 8115], "mapped", [945, 953]], [[8116, 8116], "mapped", [940, 953]], [[8117, 8117], "disallowed"], [[8118, 8118], "valid"], [[8119, 8119], "mapped", [8118, 953]], [[8120, 8120], "mapped", [8112]], [[8121, 8121], "mapped", [8113]], [[8122, 8122], "mapped", [8048]], [[8123, 8123], "mapped", [940]], [[8124, 8124], "mapped", [945, 953]], [[8125, 8125], "disallowed_STD3_mapped", [32, 787]], [[8126, 8126], "mapped", [953]], [[8127, 8127], "disallowed_STD3_mapped", [32, 787]], [[8128, 8128], "disallowed_STD3_mapped", [32, 834]], [[8129, 8129], "disallowed_STD3_mapped", [32, 776, 834]], [[8130, 8130], "mapped", [8052, 953]], [[8131, 8131], "mapped", [951, 953]], [[8132, 8132], "mapped", [942, 953]], [[8133, 8133], "disallowed"], [[8134, 8134], "valid"], [[8135, 8135], "mapped", [8134, 953]], [[8136, 8136], "mapped", [8050]], [[8137, 8137], "mapped", [941]], [[8138, 8138], "mapped", [8052]], [[8139, 8139], "mapped", [942]], [[8140, 8140], "mapped", [951, 953]], [[8141, 8141], "disallowed_STD3_mapped", [32, 787, 768]], [[8142, 8142], "disallowed_STD3_mapped", [32, 787, 769]], [[8143, 8143], "disallowed_STD3_mapped", [32, 787, 834]], [[8144, 8146], "valid"], [[8147, 8147], "mapped", [912]], [[8148, 8149], "disallowed"], [[8150, 8151], "valid"], [[8152, 8152], "mapped", [8144]], [[8153, 8153], "mapped", [8145]], [[8154, 8154], "mapped", [8054]], [[8155, 8155], "mapped", [943]], [[8156, 8156], "disallowed"], [[8157, 8157], "disallowed_STD3_mapped", [32, 788, 768]], [[8158, 8158], "disallowed_STD3_mapped", [32, 788, 769]], [[8159, 8159], "disallowed_STD3_mapped", [32, 788, 834]], [[8160, 8162], "valid"], [[8163, 8163], "mapped", [944]], [[8164, 8167], "valid"], [[8168, 8168], "mapped", [8160]], [[8169, 8169], "mapped", [8161]], [[8170, 8170], "mapped", [8058]], [[8171, 8171], "mapped", [973]], [[8172, 8172], "mapped", [8165]], [[8173, 8173], "disallowed_STD3_mapped", [32, 776, 768]], [[8174, 8174], "disallowed_STD3_mapped", [32, 776, 769]], [[8175, 8175], "disallowed_STD3_mapped", [96]], [[8176, 8177], "disallowed"], [[8178, 8178], "mapped", [8060, 953]], [[8179, 8179], "mapped", [969, 953]], [[8180, 8180], "mapped", [974, 953]], [[8181, 8181], "disallowed"], [[8182, 8182], "valid"], [[8183, 8183], "mapped", [8182, 953]], [[8184, 8184], "mapped", [8056]], [[8185, 8185], "mapped", [972]], [[8186, 8186], "mapped", [8060]], [[8187, 8187], "mapped", [974]], [[8188, 8188], "mapped", [969, 953]], [[8189, 8189], "disallowed_STD3_mapped", [32, 769]], [[8190, 8190], "disallowed_STD3_mapped", [32, 788]], [[8191, 8191], "disallowed"], [[8192, 8202], "disallowed_STD3_mapped", [32]], [[8203, 8203], "ignored"], [[8204, 8205], "deviation", []], [[8206, 8207], "disallowed"], [[8208, 8208], "valid", [], "NV8"], [[8209, 8209], "mapped", [8208]], [[8210, 8214], "valid", [], "NV8"], [[8215, 8215], "disallowed_STD3_mapped", [32, 819]], [[8216, 8227], "valid", [], "NV8"], [[8228, 8230], "disallowed"], [[8231, 8231], "valid", [], "NV8"], [[8232, 8238], "disallowed"], [[8239, 8239], "disallowed_STD3_mapped", [32]], [[8240, 8242], "valid", [], "NV8"], [[8243, 8243], "mapped", [8242, 8242]], [[8244, 8244], "mapped", [8242, 8242, 8242]], [[8245, 8245], "valid", [], "NV8"], [[8246, 8246], "mapped", [8245, 8245]], [[8247, 8247], "mapped", [8245, 8245, 8245]], [[8248, 8251], "valid", [], "NV8"], [[8252, 8252], "disallowed_STD3_mapped", [33, 33]], [[8253, 8253], "valid", [], "NV8"], [[8254, 8254], "disallowed_STD3_mapped", [32, 773]], [[8255, 8262], "valid", [], "NV8"], [[8263, 8263], "disallowed_STD3_mapped", [63, 63]], [[8264, 8264], "disallowed_STD3_mapped", [63, 33]], [[8265, 8265], "disallowed_STD3_mapped", [33, 63]], [[8266, 8269], "valid", [], "NV8"], [[8270, 8274], "valid", [], "NV8"], [[8275, 8276], "valid", [], "NV8"], [[8277, 8278], "valid", [], "NV8"], [[8279, 8279], "mapped", [8242, 8242, 8242, 8242]], [[8280, 8286], "valid", [], "NV8"], [[8287, 8287], "disallowed_STD3_mapped", [32]], [[8288, 8288], "ignored"], [[8289, 8291], "disallowed"], [[8292, 8292], "ignored"], [[8293, 8293], "disallowed"], [[8294, 8297], "disallowed"], [[8298, 8303], "disallowed"], [[8304, 8304], "mapped", [48]], [[8305, 8305], "mapped", [105]], [[8306, 8307], "disallowed"], [[8308, 8308], "mapped", [52]], [[8309, 8309], "mapped", [53]], [[8310, 8310], "mapped", [54]], [[8311, 8311], "mapped", [55]], [[8312, 8312], "mapped", [56]], [[8313, 8313], "mapped", [57]], [[8314, 8314], "disallowed_STD3_mapped", [43]], [[8315, 8315], "mapped", [8722]], [[8316, 8316], "disallowed_STD3_mapped", [61]], [[8317, 8317], "disallowed_STD3_mapped", [40]], [[8318, 8318], "disallowed_STD3_mapped", [41]], [[8319, 8319], "mapped", [110]], [[8320, 8320], "mapped", [48]], [[8321, 8321], "mapped", [49]], [[8322, 8322], "mapped", [50]], [[8323, 8323], "mapped", [51]], [[8324, 8324], "mapped", [52]], [[8325, 8325], "mapped", [53]], [[8326, 8326], "mapped", [54]], [[8327, 8327], "mapped", [55]], [[8328, 8328], "mapped", [56]], [[8329, 8329], "mapped", [57]], [[8330, 8330], "disallowed_STD3_mapped", [43]], [[8331, 8331], "mapped", [8722]], [[8332, 8332], "disallowed_STD3_mapped", [61]], [[8333, 8333], "disallowed_STD3_mapped", [40]], [[8334, 8334], "disallowed_STD3_mapped", [41]], [[8335, 8335], "disallowed"], [[8336, 8336], "mapped", [97]], [[8337, 8337], "mapped", [101]], [[8338, 8338], "mapped", [111]], [[8339, 8339], "mapped", [120]], [[8340, 8340], "mapped", [601]], [[8341, 8341], "mapped", [104]], [[8342, 8342], "mapped", [107]], [[8343, 8343], "mapped", [108]], [[8344, 8344], "mapped", [109]], [[8345, 8345], "mapped", [110]], [[8346, 8346], "mapped", [112]], [[8347, 8347], "mapped", [115]], [[8348, 8348], "mapped", [116]], [[8349, 8351], "disallowed"], [[8352, 8359], "valid", [], "NV8"], [[8360, 8360], "mapped", [114, 115]], [[8361, 8362], "valid", [], "NV8"], [[8363, 8363], "valid", [], "NV8"], [[8364, 8364], "valid", [], "NV8"], [[8365, 8367], "valid", [], "NV8"], [[8368, 8369], "valid", [], "NV8"], [[8370, 8373], "valid", [], "NV8"], [[8374, 8376], "valid", [], "NV8"], [[8377, 8377], "valid", [], "NV8"], [[8378, 8378], "valid", [], "NV8"], [[8379, 8381], "valid", [], "NV8"], [[8382, 8382], "valid", [], "NV8"], [[8383, 8399], "disallowed"], [[8400, 8417], "valid", [], "NV8"], [[8418, 8419], "valid", [], "NV8"], [[8420, 8426], "valid", [], "NV8"], [[8427, 8427], "valid", [], "NV8"], [[8428, 8431], "valid", [], "NV8"], [[8432, 8432], "valid", [], "NV8"], [[8433, 8447], "disallowed"], [[8448, 8448], "disallowed_STD3_mapped", [97, 47, 99]], [[8449, 8449], "disallowed_STD3_mapped", [97, 47, 115]], [[8450, 8450], "mapped", [99]], [[8451, 8451], "mapped", [176, 99]], [[8452, 8452], "valid", [], "NV8"], [[8453, 8453], "disallowed_STD3_mapped", [99, 47, 111]], [[8454, 8454], "disallowed_STD3_mapped", [99, 47, 117]], [[8455, 8455], "mapped", [603]], [[8456, 8456], "valid", [], "NV8"], [[8457, 8457], "mapped", [176, 102]], [[8458, 8458], "mapped", [103]], [[8459, 8462], "mapped", [104]], [[8463, 8463], "mapped", [295]], [[8464, 8465], "mapped", [105]], [[8466, 8467], "mapped", [108]], [[8468, 8468], "valid", [], "NV8"], [[8469, 8469], "mapped", [110]], [[8470, 8470], "mapped", [110, 111]], [[8471, 8472], "valid", [], "NV8"], [[8473, 8473], "mapped", [112]], [[8474, 8474], "mapped", [113]], [[8475, 8477], "mapped", [114]], [[8478, 8479], "valid", [], "NV8"], [[8480, 8480], "mapped", [115, 109]], [[8481, 8481], "mapped", [116, 101, 108]], [[8482, 8482], "mapped", [116, 109]], [[8483, 8483], "valid", [], "NV8"], [[8484, 8484], "mapped", [122]], [[8485, 8485], "valid", [], "NV8"], [[8486, 8486], "mapped", [969]], [[8487, 8487], "valid", [], "NV8"], [[8488, 8488], "mapped", [122]], [[8489, 8489], "valid", [], "NV8"], [[8490, 8490], "mapped", [107]], [[8491, 8491], "mapped", [229]], [[8492, 8492], "mapped", [98]], [[8493, 8493], "mapped", [99]], [[8494, 8494], "valid", [], "NV8"], [[8495, 8496], "mapped", [101]], [[8497, 8497], "mapped", [102]], [[8498, 8498], "disallowed"], [[8499, 8499], "mapped", [109]], [[8500, 8500], "mapped", [111]], [[8501, 8501], "mapped", [1488]], [[8502, 8502], "mapped", [1489]], [[8503, 8503], "mapped", [1490]], [[8504, 8504], "mapped", [1491]], [[8505, 8505], "mapped", [105]], [[8506, 8506], "valid", [], "NV8"], [[8507, 8507], "mapped", [102, 97, 120]], [[8508, 8508], "mapped", [960]], [[8509, 8510], "mapped", [947]], [[8511, 8511], "mapped", [960]], [[8512, 8512], "mapped", [8721]], [[8513, 8516], "valid", [], "NV8"], [[8517, 8518], "mapped", [100]], [[8519, 8519], "mapped", [101]], [[8520, 8520], "mapped", [105]], [[8521, 8521], "mapped", [106]], [[8522, 8523], "valid", [], "NV8"], [[8524, 8524], "valid", [], "NV8"], [[8525, 8525], "valid", [], "NV8"], [[8526, 8526], "valid"], [[8527, 8527], "valid", [], "NV8"], [[8528, 8528], "mapped", [49, 8260, 55]], [[8529, 8529], "mapped", [49, 8260, 57]], [[8530, 8530], "mapped", [49, 8260, 49, 48]], [[8531, 8531], "mapped", [49, 8260, 51]], [[8532, 8532], "mapped", [50, 8260, 51]], [[8533, 8533], "mapped", [49, 8260, 53]], [[8534, 8534], "mapped", [50, 8260, 53]], [[8535, 8535], "mapped", [51, 8260, 53]], [[8536, 8536], "mapped", [52, 8260, 53]], [[8537, 8537], "mapped", [49, 8260, 54]], [[8538, 8538], "mapped", [53, 8260, 54]], [[8539, 8539], "mapped", [49, 8260, 56]], [[8540, 8540], "mapped", [51, 8260, 56]], [[8541, 8541], "mapped", [53, 8260, 56]], [[8542, 8542], "mapped", [55, 8260, 56]], [[8543, 8543], "mapped", [49, 8260]], [[8544, 8544], "mapped", [105]], [[8545, 8545], "mapped", [105, 105]], [[8546, 8546], "mapped", [105, 105, 105]], [[8547, 8547], "mapped", [105, 118]], [[8548, 8548], "mapped", [118]], [[8549, 8549], "mapped", [118, 105]], [[8550, 8550], "mapped", [118, 105, 105]], [[8551, 8551], "mapped", [118, 105, 105, 105]], [[8552, 8552], "mapped", [105, 120]], [[8553, 8553], "mapped", [120]], [[8554, 8554], "mapped", [120, 105]], [[8555, 8555], "mapped", [120, 105, 105]], [[8556, 8556], "mapped", [108]], [[8557, 8557], "mapped", [99]], [[8558, 8558], "mapped", [100]], [[8559, 8559], "mapped", [109]], [[8560, 8560], "mapped", [105]], [[8561, 8561], "mapped", [105, 105]], [[8562, 8562], "mapped", [105, 105, 105]], [[8563, 8563], "mapped", [105, 118]], [[8564, 8564], "mapped", [118]], [[8565, 8565], "mapped", [118, 105]], [[8566, 8566], "mapped", [118, 105, 105]], [[8567, 8567], "mapped", [118, 105, 105, 105]], [[8568, 8568], "mapped", [105, 120]], [[8569, 8569], "mapped", [120]], [[8570, 8570], "mapped", [120, 105]], [[8571, 8571], "mapped", [120, 105, 105]], [[8572, 8572], "mapped", [108]], [[8573, 8573], "mapped", [99]], [[8574, 8574], "mapped", [100]], [[8575, 8575], "mapped", [109]], [[8576, 8578], "valid", [], "NV8"], [[8579, 8579], "disallowed"], [[8580, 8580], "valid"], [[8581, 8584], "valid", [], "NV8"], [[8585, 8585], "mapped", [48, 8260, 51]], [[8586, 8587], "valid", [], "NV8"], [[8588, 8591], "disallowed"], [[8592, 8682], "valid", [], "NV8"], [[8683, 8691], "valid", [], "NV8"], [[8692, 8703], "valid", [], "NV8"], [[8704, 8747], "valid", [], "NV8"], [[8748, 8748], "mapped", [8747, 8747]], [[8749, 8749], "mapped", [8747, 8747, 8747]], [[8750, 8750], "valid", [], "NV8"], [[8751, 8751], "mapped", [8750, 8750]], [[8752, 8752], "mapped", [8750, 8750, 8750]], [[8753, 8799], "valid", [], "NV8"], [[8800, 8800], "disallowed_STD3_valid"], [[8801, 8813], "valid", [], "NV8"], [[8814, 8815], "disallowed_STD3_valid"], [[8816, 8945], "valid", [], "NV8"], [[8946, 8959], "valid", [], "NV8"], [[8960, 8960], "valid", [], "NV8"], [[8961, 8961], "valid", [], "NV8"], [[8962, 9e3], "valid", [], "NV8"], [[9001, 9001], "mapped", [12296]], [[9002, 9002], "mapped", [12297]], [[9003, 9082], "valid", [], "NV8"], [[9083, 9083], "valid", [], "NV8"], [[9084, 9084], "valid", [], "NV8"], [[9085, 9114], "valid", [], "NV8"], [[9115, 9166], "valid", [], "NV8"], [[9167, 9168], "valid", [], "NV8"], [[9169, 9179], "valid", [], "NV8"], [[9180, 9191], "valid", [], "NV8"], [[9192, 9192], "valid", [], "NV8"], [[9193, 9203], "valid", [], "NV8"], [[9204, 9210], "valid", [], "NV8"], [[9211, 9215], "disallowed"], [[9216, 9252], "valid", [], "NV8"], [[9253, 9254], "valid", [], "NV8"], [[9255, 9279], "disallowed"], [[9280, 9290], "valid", [], "NV8"], [[9291, 9311], "disallowed"], [[9312, 9312], "mapped", [49]], [[9313, 9313], "mapped", [50]], [[9314, 9314], "mapped", [51]], [[9315, 9315], "mapped", [52]], [[9316, 9316], "mapped", [53]], [[9317, 9317], "mapped", [54]], [[9318, 9318], "mapped", [55]], [[9319, 9319], "mapped", [56]], [[9320, 9320], "mapped", [57]], [[9321, 9321], "mapped", [49, 48]], [[9322, 9322], "mapped", [49, 49]], [[9323, 9323], "mapped", [49, 50]], [[9324, 9324], "mapped", [49, 51]], [[9325, 9325], "mapped", [49, 52]], [[9326, 9326], "mapped", [49, 53]], [[9327, 9327], "mapped", [49, 54]], [[9328, 9328], "mapped", [49, 55]], [[9329, 9329], "mapped", [49, 56]], [[9330, 9330], "mapped", [49, 57]], [[9331, 9331], "mapped", [50, 48]], [[9332, 9332], "disallowed_STD3_mapped", [40, 49, 41]], [[9333, 9333], "disallowed_STD3_mapped", [40, 50, 41]], [[9334, 9334], "disallowed_STD3_mapped", [40, 51, 41]], [[9335, 9335], "disallowed_STD3_mapped", [40, 52, 41]], [[9336, 9336], "disallowed_STD3_mapped", [40, 53, 41]], [[9337, 9337], "disallowed_STD3_mapped", [40, 54, 41]], [[9338, 9338], "disallowed_STD3_mapped", [40, 55, 41]], [[9339, 9339], "disallowed_STD3_mapped", [40, 56, 41]], [[9340, 9340], "disallowed_STD3_mapped", [40, 57, 41]], [[9341, 9341], "disallowed_STD3_mapped", [40, 49, 48, 41]], [[9342, 9342], "disallowed_STD3_mapped", [40, 49, 49, 41]], [[9343, 9343], "disallowed_STD3_mapped", [40, 49, 50, 41]], [[9344, 9344], "disallowed_STD3_mapped", [40, 49, 51, 41]], [[9345, 9345], "disallowed_STD3_mapped", [40, 49, 52, 41]], [[9346, 9346], "disallowed_STD3_mapped", [40, 49, 53, 41]], [[9347, 9347], "disallowed_STD3_mapped", [40, 49, 54, 41]], [[9348, 9348], "disallowed_STD3_mapped", [40, 49, 55, 41]], [[9349, 9349], "disallowed_STD3_mapped", [40, 49, 56, 41]], [[9350, 9350], "disallowed_STD3_mapped", [40, 49, 57, 41]], [[9351, 9351], "disallowed_STD3_mapped", [40, 50, 48, 41]], [[9352, 9371], "disallowed"], [[9372, 9372], "disallowed_STD3_mapped", [40, 97, 41]], [[9373, 9373], "disallowed_STD3_mapped", [40, 98, 41]], [[9374, 9374], "disallowed_STD3_mapped", [40, 99, 41]], [[9375, 9375], "disallowed_STD3_mapped", [40, 100, 41]], [[9376, 9376], "disallowed_STD3_mapped", [40, 101, 41]], [[9377, 9377], "disallowed_STD3_mapped", [40, 102, 41]], [[9378, 9378], "disallowed_STD3_mapped", [40, 103, 41]], [[9379, 9379], "disallowed_STD3_mapped", [40, 104, 41]], [[9380, 9380], "disallowed_STD3_mapped", [40, 105, 41]], [[9381, 9381], "disallowed_STD3_mapped", [40, 106, 41]], [[9382, 9382], "disallowed_STD3_mapped", [40, 107, 41]], [[9383, 9383], "disallowed_STD3_mapped", [40, 108, 41]], [[9384, 9384], "disallowed_STD3_mapped", [40, 109, 41]], [[9385, 9385], "disallowed_STD3_mapped", [40, 110, 41]], [[9386, 9386], "disallowed_STD3_mapped", [40, 111, 41]], [[9387, 9387], "disallowed_STD3_mapped", [40, 112, 41]], [[9388, 9388], "disallowed_STD3_mapped", [40, 113, 41]], [[9389, 9389], "disallowed_STD3_mapped", [40, 114, 41]], [[9390, 9390], "disallowed_STD3_mapped", [40, 115, 41]], [[9391, 9391], "disallowed_STD3_mapped", [40, 116, 41]], [[9392, 9392], "disallowed_STD3_mapped", [40, 117, 41]], [[9393, 9393], "disallowed_STD3_mapped", [40, 118, 41]], [[9394, 9394], "disallowed_STD3_mapped", [40, 119, 41]], [[9395, 9395], "disallowed_STD3_mapped", [40, 120, 41]], [[9396, 9396], "disallowed_STD3_mapped", [40, 121, 41]], [[9397, 9397], "disallowed_STD3_mapped", [40, 122, 41]], [[9398, 9398], "mapped", [97]], [[9399, 9399], "mapped", [98]], [[9400, 9400], "mapped", [99]], [[9401, 9401], "mapped", [100]], [[9402, 9402], "mapped", [101]], [[9403, 9403], "mapped", [102]], [[9404, 9404], "mapped", [103]], [[9405, 9405], "mapped", [104]], [[9406, 9406], "mapped", [105]], [[9407, 9407], "mapped", [106]], [[9408, 9408], "mapped", [107]], [[9409, 9409], "mapped", [108]], [[9410, 9410], "mapped", [109]], [[9411, 9411], "mapped", [110]], [[9412, 9412], "mapped", [111]], [[9413, 9413], "mapped", [112]], [[9414, 9414], "mapped", [113]], [[9415, 9415], "mapped", [114]], [[9416, 9416], "mapped", [115]], [[9417, 9417], "mapped", [116]], [[9418, 9418], "mapped", [117]], [[9419, 9419], "mapped", [118]], [[9420, 9420], "mapped", [119]], [[9421, 9421], "mapped", [120]], [[9422, 9422], "mapped", [121]], [[9423, 9423], "mapped", [122]], [[9424, 9424], "mapped", [97]], [[9425, 9425], "mapped", [98]], [[9426, 9426], "mapped", [99]], [[9427, 9427], "mapped", [100]], [[9428, 9428], "mapped", [101]], [[9429, 9429], "mapped", [102]], [[9430, 9430], "mapped", [103]], [[9431, 9431], "mapped", [104]], [[9432, 9432], "mapped", [105]], [[9433, 9433], "mapped", [106]], [[9434, 9434], "mapped", [107]], [[9435, 9435], "mapped", [108]], [[9436, 9436], "mapped", [109]], [[9437, 9437], "mapped", [110]], [[9438, 9438], "mapped", [111]], [[9439, 9439], "mapped", [112]], [[9440, 9440], "mapped", [113]], [[9441, 9441], "mapped", [114]], [[9442, 9442], "mapped", [115]], [[9443, 9443], "mapped", [116]], [[9444, 9444], "mapped", [117]], [[9445, 9445], "mapped", [118]], [[9446, 9446], "mapped", [119]], [[9447, 9447], "mapped", [120]], [[9448, 9448], "mapped", [121]], [[9449, 9449], "mapped", [122]], [[9450, 9450], "mapped", [48]], [[9451, 9470], "valid", [], "NV8"], [[9471, 9471], "valid", [], "NV8"], [[9472, 9621], "valid", [], "NV8"], [[9622, 9631], "valid", [], "NV8"], [[9632, 9711], "valid", [], "NV8"], [[9712, 9719], "valid", [], "NV8"], [[9720, 9727], "valid", [], "NV8"], [[9728, 9747], "valid", [], "NV8"], [[9748, 9749], "valid", [], "NV8"], [[9750, 9751], "valid", [], "NV8"], [[9752, 9752], "valid", [], "NV8"], [[9753, 9753], "valid", [], "NV8"], [[9754, 9839], "valid", [], "NV8"], [[9840, 9841], "valid", [], "NV8"], [[9842, 9853], "valid", [], "NV8"], [[9854, 9855], "valid", [], "NV8"], [[9856, 9865], "valid", [], "NV8"], [[9866, 9873], "valid", [], "NV8"], [[9874, 9884], "valid", [], "NV8"], [[9885, 9885], "valid", [], "NV8"], [[9886, 9887], "valid", [], "NV8"], [[9888, 9889], "valid", [], "NV8"], [[9890, 9905], "valid", [], "NV8"], [[9906, 9906], "valid", [], "NV8"], [[9907, 9916], "valid", [], "NV8"], [[9917, 9919], "valid", [], "NV8"], [[9920, 9923], "valid", [], "NV8"], [[9924, 9933], "valid", [], "NV8"], [[9934, 9934], "valid", [], "NV8"], [[9935, 9953], "valid", [], "NV8"], [[9954, 9954], "valid", [], "NV8"], [[9955, 9955], "valid", [], "NV8"], [[9956, 9959], "valid", [], "NV8"], [[9960, 9983], "valid", [], "NV8"], [[9984, 9984], "valid", [], "NV8"], [[9985, 9988], "valid", [], "NV8"], [[9989, 9989], "valid", [], "NV8"], [[9990, 9993], "valid", [], "NV8"], [[9994, 9995], "valid", [], "NV8"], [[9996, 10023], "valid", [], "NV8"], [[10024, 10024], "valid", [], "NV8"], [[10025, 10059], "valid", [], "NV8"], [[10060, 10060], "valid", [], "NV8"], [[10061, 10061], "valid", [], "NV8"], [[10062, 10062], "valid", [], "NV8"], [[10063, 10066], "valid", [], "NV8"], [[10067, 10069], "valid", [], "NV8"], [[10070, 10070], "valid", [], "NV8"], [[10071, 10071], "valid", [], "NV8"], [[10072, 10078], "valid", [], "NV8"], [[10079, 10080], "valid", [], "NV8"], [[10081, 10087], "valid", [], "NV8"], [[10088, 10101], "valid", [], "NV8"], [[10102, 10132], "valid", [], "NV8"], [[10133, 10135], "valid", [], "NV8"], [[10136, 10159], "valid", [], "NV8"], [[10160, 10160], "valid", [], "NV8"], [[10161, 10174], "valid", [], "NV8"], [[10175, 10175], "valid", [], "NV8"], [[10176, 10182], "valid", [], "NV8"], [[10183, 10186], "valid", [], "NV8"], [[10187, 10187], "valid", [], "NV8"], [[10188, 10188], "valid", [], "NV8"], [[10189, 10189], "valid", [], "NV8"], [[10190, 10191], "valid", [], "NV8"], [[10192, 10219], "valid", [], "NV8"], [[10220, 10223], "valid", [], "NV8"], [[10224, 10239], "valid", [], "NV8"], [[10240, 10495], "valid", [], "NV8"], [[10496, 10763], "valid", [], "NV8"], [[10764, 10764], "mapped", [8747, 8747, 8747, 8747]], [[10765, 10867], "valid", [], "NV8"], [[10868, 10868], "disallowed_STD3_mapped", [58, 58, 61]], [[10869, 10869], "disallowed_STD3_mapped", [61, 61]], [[10870, 10870], "disallowed_STD3_mapped", [61, 61, 61]], [[10871, 10971], "valid", [], "NV8"], [[10972, 10972], "mapped", [10973, 824]], [[10973, 11007], "valid", [], "NV8"], [[11008, 11021], "valid", [], "NV8"], [[11022, 11027], "valid", [], "NV8"], [[11028, 11034], "valid", [], "NV8"], [[11035, 11039], "valid", [], "NV8"], [[11040, 11043], "valid", [], "NV8"], [[11044, 11084], "valid", [], "NV8"], [[11085, 11087], "valid", [], "NV8"], [[11088, 11092], "valid", [], "NV8"], [[11093, 11097], "valid", [], "NV8"], [[11098, 11123], "valid", [], "NV8"], [[11124, 11125], "disallowed"], [[11126, 11157], "valid", [], "NV8"], [[11158, 11159], "disallowed"], [[11160, 11193], "valid", [], "NV8"], [[11194, 11196], "disallowed"], [[11197, 11208], "valid", [], "NV8"], [[11209, 11209], "disallowed"], [[11210, 11217], "valid", [], "NV8"], [[11218, 11243], "disallowed"], [[11244, 11247], "valid", [], "NV8"], [[11248, 11263], "disallowed"], [[11264, 11264], "mapped", [11312]], [[11265, 11265], "mapped", [11313]], [[11266, 11266], "mapped", [11314]], [[11267, 11267], "mapped", [11315]], [[11268, 11268], "mapped", [11316]], [[11269, 11269], "mapped", [11317]], [[11270, 11270], "mapped", [11318]], [[11271, 11271], "mapped", [11319]], [[11272, 11272], "mapped", [11320]], [[11273, 11273], "mapped", [11321]], [[11274, 11274], "mapped", [11322]], [[11275, 11275], "mapped", [11323]], [[11276, 11276], "mapped", [11324]], [[11277, 11277], "mapped", [11325]], [[11278, 11278], "mapped", [11326]], [[11279, 11279], "mapped", [11327]], [[11280, 11280], "mapped", [11328]], [[11281, 11281], "mapped", [11329]], [[11282, 11282], "mapped", [11330]], [[11283, 11283], "mapped", [11331]], [[11284, 11284], "mapped", [11332]], [[11285, 11285], "mapped", [11333]], [[11286, 11286], "mapped", [11334]], [[11287, 11287], "mapped", [11335]], [[11288, 11288], "mapped", [11336]], [[11289, 11289], "mapped", [11337]], [[11290, 11290], "mapped", [11338]], [[11291, 11291], "mapped", [11339]], [[11292, 11292], "mapped", [11340]], [[11293, 11293], "mapped", [11341]], [[11294, 11294], "mapped", [11342]], [[11295, 11295], "mapped", [11343]], [[11296, 11296], "mapped", [11344]], [[11297, 11297], "mapped", [11345]], [[11298, 11298], "mapped", [11346]], [[11299, 11299], "mapped", [11347]], [[11300, 11300], "mapped", [11348]], [[11301, 11301], "mapped", [11349]], [[11302, 11302], "mapped", [11350]], [[11303, 11303], "mapped", [11351]], [[11304, 11304], "mapped", [11352]], [[11305, 11305], "mapped", [11353]], [[11306, 11306], "mapped", [11354]], [[11307, 11307], "mapped", [11355]], [[11308, 11308], "mapped", [11356]], [[11309, 11309], "mapped", [11357]], [[11310, 11310], "mapped", [11358]], [[11311, 11311], "disallowed"], [[11312, 11358], "valid"], [[11359, 11359], "disallowed"], [[11360, 11360], "mapped", [11361]], [[11361, 11361], "valid"], [[11362, 11362], "mapped", [619]], [[11363, 11363], "mapped", [7549]], [[11364, 11364], "mapped", [637]], [[11365, 11366], "valid"], [[11367, 11367], "mapped", [11368]], [[11368, 11368], "valid"], [[11369, 11369], "mapped", [11370]], [[11370, 11370], "valid"], [[11371, 11371], "mapped", [11372]], [[11372, 11372], "valid"], [[11373, 11373], "mapped", [593]], [[11374, 11374], "mapped", [625]], [[11375, 11375], "mapped", [592]], [[11376, 11376], "mapped", [594]], [[11377, 11377], "valid"], [[11378, 11378], "mapped", [11379]], [[11379, 11379], "valid"], [[11380, 11380], "valid"], [[11381, 11381], "mapped", [11382]], [[11382, 11383], "valid"], [[11384, 11387], "valid"], [[11388, 11388], "mapped", [106]], [[11389, 11389], "mapped", [118]], [[11390, 11390], "mapped", [575]], [[11391, 11391], "mapped", [576]], [[11392, 11392], "mapped", [11393]], [[11393, 11393], "valid"], [[11394, 11394], "mapped", [11395]], [[11395, 11395], "valid"], [[11396, 11396], "mapped", [11397]], [[11397, 11397], "valid"], [[11398, 11398], "mapped", [11399]], [[11399, 11399], "valid"], [[11400, 11400], "mapped", [11401]], [[11401, 11401], "valid"], [[11402, 11402], "mapped", [11403]], [[11403, 11403], "valid"], [[11404, 11404], "mapped", [11405]], [[11405, 11405], "valid"], [[11406, 11406], "mapped", [11407]], [[11407, 11407], "valid"], [[11408, 11408], "mapped", [11409]], [[11409, 11409], "valid"], [[11410, 11410], "mapped", [11411]], [[11411, 11411], "valid"], [[11412, 11412], "mapped", [11413]], [[11413, 11413], "valid"], [[11414, 11414], "mapped", [11415]], [[11415, 11415], "valid"], [[11416, 11416], "mapped", [11417]], [[11417, 11417], "valid"], [[11418, 11418], "mapped", [11419]], [[11419, 11419], "valid"], [[11420, 11420], "mapped", [11421]], [[11421, 11421], "valid"], [[11422, 11422], "mapped", [11423]], [[11423, 11423], "valid"], [[11424, 11424], "mapped", [11425]], [[11425, 11425], "valid"], [[11426, 11426], "mapped", [11427]], [[11427, 11427], "valid"], [[11428, 11428], "mapped", [11429]], [[11429, 11429], "valid"], [[11430, 11430], "mapped", [11431]], [[11431, 11431], "valid"], [[11432, 11432], "mapped", [11433]], [[11433, 11433], "valid"], [[11434, 11434], "mapped", [11435]], [[11435, 11435], "valid"], [[11436, 11436], "mapped", [11437]], [[11437, 11437], "valid"], [[11438, 11438], "mapped", [11439]], [[11439, 11439], "valid"], [[11440, 11440], "mapped", [11441]], [[11441, 11441], "valid"], [[11442, 11442], "mapped", [11443]], [[11443, 11443], "valid"], [[11444, 11444], "mapped", [11445]], [[11445, 11445], "valid"], [[11446, 11446], "mapped", [11447]], [[11447, 11447], "valid"], [[11448, 11448], "mapped", [11449]], [[11449, 11449], "valid"], [[11450, 11450], "mapped", [11451]], [[11451, 11451], "valid"], [[11452, 11452], "mapped", [11453]], [[11453, 11453], "valid"], [[11454, 11454], "mapped", [11455]], [[11455, 11455], "valid"], [[11456, 11456], "mapped", [11457]], [[11457, 11457], "valid"], [[11458, 11458], "mapped", [11459]], [[11459, 11459], "valid"], [[11460, 11460], "mapped", [11461]], [[11461, 11461], "valid"], [[11462, 11462], "mapped", [11463]], [[11463, 11463], "valid"], [[11464, 11464], "mapped", [11465]], [[11465, 11465], "valid"], [[11466, 11466], "mapped", [11467]], [[11467, 11467], "valid"], [[11468, 11468], "mapped", [11469]], [[11469, 11469], "valid"], [[11470, 11470], "mapped", [11471]], [[11471, 11471], "valid"], [[11472, 11472], "mapped", [11473]], [[11473, 11473], "valid"], [[11474, 11474], "mapped", [11475]], [[11475, 11475], "valid"], [[11476, 11476], "mapped", [11477]], [[11477, 11477], "valid"], [[11478, 11478], "mapped", [11479]], [[11479, 11479], "valid"], [[11480, 11480], "mapped", [11481]], [[11481, 11481], "valid"], [[11482, 11482], "mapped", [11483]], [[11483, 11483], "valid"], [[11484, 11484], "mapped", [11485]], [[11485, 11485], "valid"], [[11486, 11486], "mapped", [11487]], [[11487, 11487], "valid"], [[11488, 11488], "mapped", [11489]], [[11489, 11489], "valid"], [[11490, 11490], "mapped", [11491]], [[11491, 11492], "valid"], [[11493, 11498], "valid", [], "NV8"], [[11499, 11499], "mapped", [11500]], [[11500, 11500], "valid"], [[11501, 11501], "mapped", [11502]], [[11502, 11505], "valid"], [[11506, 11506], "mapped", [11507]], [[11507, 11507], "valid"], [[11508, 11512], "disallowed"], [[11513, 11519], "valid", [], "NV8"], [[11520, 11557], "valid"], [[11558, 11558], "disallowed"], [[11559, 11559], "valid"], [[11560, 11564], "disallowed"], [[11565, 11565], "valid"], [[11566, 11567], "disallowed"], [[11568, 11621], "valid"], [[11622, 11623], "valid"], [[11624, 11630], "disallowed"], [[11631, 11631], "mapped", [11617]], [[11632, 11632], "valid", [], "NV8"], [[11633, 11646], "disallowed"], [[11647, 11647], "valid"], [[11648, 11670], "valid"], [[11671, 11679], "disallowed"], [[11680, 11686], "valid"], [[11687, 11687], "disallowed"], [[11688, 11694], "valid"], [[11695, 11695], "disallowed"], [[11696, 11702], "valid"], [[11703, 11703], "disallowed"], [[11704, 11710], "valid"], [[11711, 11711], "disallowed"], [[11712, 11718], "valid"], [[11719, 11719], "disallowed"], [[11720, 11726], "valid"], [[11727, 11727], "disallowed"], [[11728, 11734], "valid"], [[11735, 11735], "disallowed"], [[11736, 11742], "valid"], [[11743, 11743], "disallowed"], [[11744, 11775], "valid"], [[11776, 11799], "valid", [], "NV8"], [[11800, 11803], "valid", [], "NV8"], [[11804, 11805], "valid", [], "NV8"], [[11806, 11822], "valid", [], "NV8"], [[11823, 11823], "valid"], [[11824, 11824], "valid", [], "NV8"], [[11825, 11825], "valid", [], "NV8"], [[11826, 11835], "valid", [], "NV8"], [[11836, 11842], "valid", [], "NV8"], [[11843, 11903], "disallowed"], [[11904, 11929], "valid", [], "NV8"], [[11930, 11930], "disallowed"], [[11931, 11934], "valid", [], "NV8"], [[11935, 11935], "mapped", [27597]], [[11936, 12018], "valid", [], "NV8"], [[12019, 12019], "mapped", [40863]], [[12020, 12031], "disallowed"], [[12032, 12032], "mapped", [19968]], [[12033, 12033], "mapped", [20008]], [[12034, 12034], "mapped", [20022]], [[12035, 12035], "mapped", [20031]], [[12036, 12036], "mapped", [20057]], [[12037, 12037], "mapped", [20101]], [[12038, 12038], "mapped", [20108]], [[12039, 12039], "mapped", [20128]], [[12040, 12040], "mapped", [20154]], [[12041, 12041], "mapped", [20799]], [[12042, 12042], "mapped", [20837]], [[12043, 12043], "mapped", [20843]], [[12044, 12044], "mapped", [20866]], [[12045, 12045], "mapped", [20886]], [[12046, 12046], "mapped", [20907]], [[12047, 12047], "mapped", [20960]], [[12048, 12048], "mapped", [20981]], [[12049, 12049], "mapped", [20992]], [[12050, 12050], "mapped", [21147]], [[12051, 12051], "mapped", [21241]], [[12052, 12052], "mapped", [21269]], [[12053, 12053], "mapped", [21274]], [[12054, 12054], "mapped", [21304]], [[12055, 12055], "mapped", [21313]], [[12056, 12056], "mapped", [21340]], [[12057, 12057], "mapped", [21353]], [[12058, 12058], "mapped", [21378]], [[12059, 12059], "mapped", [21430]], [[12060, 12060], "mapped", [21448]], [[12061, 12061], "mapped", [21475]], [[12062, 12062], "mapped", [22231]], [[12063, 12063], "mapped", [22303]], [[12064, 12064], "mapped", [22763]], [[12065, 12065], "mapped", [22786]], [[12066, 12066], "mapped", [22794]], [[12067, 12067], "mapped", [22805]], [[12068, 12068], "mapped", [22823]], [[12069, 12069], "mapped", [22899]], [[12070, 12070], "mapped", [23376]], [[12071, 12071], "mapped", [23424]], [[12072, 12072], "mapped", [23544]], [[12073, 12073], "mapped", [23567]], [[12074, 12074], "mapped", [23586]], [[12075, 12075], "mapped", [23608]], [[12076, 12076], "mapped", [23662]], [[12077, 12077], "mapped", [23665]], [[12078, 12078], "mapped", [24027]], [[12079, 12079], "mapped", [24037]], [[12080, 12080], "mapped", [24049]], [[12081, 12081], "mapped", [24062]], [[12082, 12082], "mapped", [24178]], [[12083, 12083], "mapped", [24186]], [[12084, 12084], "mapped", [24191]], [[12085, 12085], "mapped", [24308]], [[12086, 12086], "mapped", [24318]], [[12087, 12087], "mapped", [24331]], [[12088, 12088], "mapped", [24339]], [[12089, 12089], "mapped", [24400]], [[12090, 12090], "mapped", [24417]], [[12091, 12091], "mapped", [24435]], [[12092, 12092], "mapped", [24515]], [[12093, 12093], "mapped", [25096]], [[12094, 12094], "mapped", [25142]], [[12095, 12095], "mapped", [25163]], [[12096, 12096], "mapped", [25903]], [[12097, 12097], "mapped", [25908]], [[12098, 12098], "mapped", [25991]], [[12099, 12099], "mapped", [26007]], [[12100, 12100], "mapped", [26020]], [[12101, 12101], "mapped", [26041]], [[12102, 12102], "mapped", [26080]], [[12103, 12103], "mapped", [26085]], [[12104, 12104], "mapped", [26352]], [[12105, 12105], "mapped", [26376]], [[12106, 12106], "mapped", [26408]], [[12107, 12107], "mapped", [27424]], [[12108, 12108], "mapped", [27490]], [[12109, 12109], "mapped", [27513]], [[12110, 12110], "mapped", [27571]], [[12111, 12111], "mapped", [27595]], [[12112, 12112], "mapped", [27604]], [[12113, 12113], "mapped", [27611]], [[12114, 12114], "mapped", [27663]], [[12115, 12115], "mapped", [27668]], [[12116, 12116], "mapped", [27700]], [[12117, 12117], "mapped", [28779]], [[12118, 12118], "mapped", [29226]], [[12119, 12119], "mapped", [29238]], [[12120, 12120], "mapped", [29243]], [[12121, 12121], "mapped", [29247]], [[12122, 12122], "mapped", [29255]], [[12123, 12123], "mapped", [29273]], [[12124, 12124], "mapped", [29275]], [[12125, 12125], "mapped", [29356]], [[12126, 12126], "mapped", [29572]], [[12127, 12127], "mapped", [29577]], [[12128, 12128], "mapped", [29916]], [[12129, 12129], "mapped", [29926]], [[12130, 12130], "mapped", [29976]], [[12131, 12131], "mapped", [29983]], [[12132, 12132], "mapped", [29992]], [[12133, 12133], "mapped", [3e4]], [[12134, 12134], "mapped", [30091]], [[12135, 12135], "mapped", [30098]], [[12136, 12136], "mapped", [30326]], [[12137, 12137], "mapped", [30333]], [[12138, 12138], "mapped", [30382]], [[12139, 12139], "mapped", [30399]], [[12140, 12140], "mapped", [30446]], [[12141, 12141], "mapped", [30683]], [[12142, 12142], "mapped", [30690]], [[12143, 12143], "mapped", [30707]], [[12144, 12144], "mapped", [31034]], [[12145, 12145], "mapped", [31160]], [[12146, 12146], "mapped", [31166]], [[12147, 12147], "mapped", [31348]], [[12148, 12148], "mapped", [31435]], [[12149, 12149], "mapped", [31481]], [[12150, 12150], "mapped", [31859]], [[12151, 12151], "mapped", [31992]], [[12152, 12152], "mapped", [32566]], [[12153, 12153], "mapped", [32593]], [[12154, 12154], "mapped", [32650]], [[12155, 12155], "mapped", [32701]], [[12156, 12156], "mapped", [32769]], [[12157, 12157], "mapped", [32780]], [[12158, 12158], "mapped", [32786]], [[12159, 12159], "mapped", [32819]], [[12160, 12160], "mapped", [32895]], [[12161, 12161], "mapped", [32905]], [[12162, 12162], "mapped", [33251]], [[12163, 12163], "mapped", [33258]], [[12164, 12164], "mapped", [33267]], [[12165, 12165], "mapped", [33276]], [[12166, 12166], "mapped", [33292]], [[12167, 12167], "mapped", [33307]], [[12168, 12168], "mapped", [33311]], [[12169, 12169], "mapped", [33390]], [[12170, 12170], "mapped", [33394]], [[12171, 12171], "mapped", [33400]], [[12172, 12172], "mapped", [34381]], [[12173, 12173], "mapped", [34411]], [[12174, 12174], "mapped", [34880]], [[12175, 12175], "mapped", [34892]], [[12176, 12176], "mapped", [34915]], [[12177, 12177], "mapped", [35198]], [[12178, 12178], "mapped", [35211]], [[12179, 12179], "mapped", [35282]], [[12180, 12180], "mapped", [35328]], [[12181, 12181], "mapped", [35895]], [[12182, 12182], "mapped", [35910]], [[12183, 12183], "mapped", [35925]], [[12184, 12184], "mapped", [35960]], [[12185, 12185], "mapped", [35997]], [[12186, 12186], "mapped", [36196]], [[12187, 12187], "mapped", [36208]], [[12188, 12188], "mapped", [36275]], [[12189, 12189], "mapped", [36523]], [[12190, 12190], "mapped", [36554]], [[12191, 12191], "mapped", [36763]], [[12192, 12192], "mapped", [36784]], [[12193, 12193], "mapped", [36789]], [[12194, 12194], "mapped", [37009]], [[12195, 12195], "mapped", [37193]], [[12196, 12196], "mapped", [37318]], [[12197, 12197], "mapped", [37324]], [[12198, 12198], "mapped", [37329]], [[12199, 12199], "mapped", [38263]], [[12200, 12200], "mapped", [38272]], [[12201, 12201], "mapped", [38428]], [[12202, 12202], "mapped", [38582]], [[12203, 12203], "mapped", [38585]], [[12204, 12204], "mapped", [38632]], [[12205, 12205], "mapped", [38737]], [[12206, 12206], "mapped", [38750]], [[12207, 12207], "mapped", [38754]], [[12208, 12208], "mapped", [38761]], [[12209, 12209], "mapped", [38859]], [[12210, 12210], "mapped", [38893]], [[12211, 12211], "mapped", [38899]], [[12212, 12212], "mapped", [38913]], [[12213, 12213], "mapped", [39080]], [[12214, 12214], "mapped", [39131]], [[12215, 12215], "mapped", [39135]], [[12216, 12216], "mapped", [39318]], [[12217, 12217], "mapped", [39321]], [[12218, 12218], "mapped", [39340]], [[12219, 12219], "mapped", [39592]], [[12220, 12220], "mapped", [39640]], [[12221, 12221], "mapped", [39647]], [[12222, 12222], "mapped", [39717]], [[12223, 12223], "mapped", [39727]], [[12224, 12224], "mapped", [39730]], [[12225, 12225], "mapped", [39740]], [[12226, 12226], "mapped", [39770]], [[12227, 12227], "mapped", [40165]], [[12228, 12228], "mapped", [40565]], [[12229, 12229], "mapped", [40575]], [[12230, 12230], "mapped", [40613]], [[12231, 12231], "mapped", [40635]], [[12232, 12232], "mapped", [40643]], [[12233, 12233], "mapped", [40653]], [[12234, 12234], "mapped", [40657]], [[12235, 12235], "mapped", [40697]], [[12236, 12236], "mapped", [40701]], [[12237, 12237], "mapped", [40718]], [[12238, 12238], "mapped", [40723]], [[12239, 12239], "mapped", [40736]], [[12240, 12240], "mapped", [40763]], [[12241, 12241], "mapped", [40778]], [[12242, 12242], "mapped", [40786]], [[12243, 12243], "mapped", [40845]], [[12244, 12244], "mapped", [40860]], [[12245, 12245], "mapped", [40864]], [[12246, 12271], "disallowed"], [[12272, 12283], "disallowed"], [[12284, 12287], "disallowed"], [[12288, 12288], "disallowed_STD3_mapped", [32]], [[12289, 12289], "valid", [], "NV8"], [[12290, 12290], "mapped", [46]], [[12291, 12292], "valid", [], "NV8"], [[12293, 12295], "valid"], [[12296, 12329], "valid", [], "NV8"], [[12330, 12333], "valid"], [[12334, 12341], "valid", [], "NV8"], [[12342, 12342], "mapped", [12306]], [[12343, 12343], "valid", [], "NV8"], [[12344, 12344], "mapped", [21313]], [[12345, 12345], "mapped", [21316]], [[12346, 12346], "mapped", [21317]], [[12347, 12347], "valid", [], "NV8"], [[12348, 12348], "valid"], [[12349, 12349], "valid", [], "NV8"], [[12350, 12350], "valid", [], "NV8"], [[12351, 12351], "valid", [], "NV8"], [[12352, 12352], "disallowed"], [[12353, 12436], "valid"], [[12437, 12438], "valid"], [[12439, 12440], "disallowed"], [[12441, 12442], "valid"], [[12443, 12443], "disallowed_STD3_mapped", [32, 12441]], [[12444, 12444], "disallowed_STD3_mapped", [32, 12442]], [[12445, 12446], "valid"], [[12447, 12447], "mapped", [12424, 12426]], [[12448, 12448], "valid", [], "NV8"], [[12449, 12542], "valid"], [[12543, 12543], "mapped", [12467, 12488]], [[12544, 12548], "disallowed"], [[12549, 12588], "valid"], [[12589, 12589], "valid"], [[12590, 12592], "disallowed"], [[12593, 12593], "mapped", [4352]], [[12594, 12594], "mapped", [4353]], [[12595, 12595], "mapped", [4522]], [[12596, 12596], "mapped", [4354]], [[12597, 12597], "mapped", [4524]], [[12598, 12598], "mapped", [4525]], [[12599, 12599], "mapped", [4355]], [[12600, 12600], "mapped", [4356]], [[12601, 12601], "mapped", [4357]], [[12602, 12602], "mapped", [4528]], [[12603, 12603], "mapped", [4529]], [[12604, 12604], "mapped", [4530]], [[12605, 12605], "mapped", [4531]], [[12606, 12606], "mapped", [4532]], [[12607, 12607], "mapped", [4533]], [[12608, 12608], "mapped", [4378]], [[12609, 12609], "mapped", [4358]], [[12610, 12610], "mapped", [4359]], [[12611, 12611], "mapped", [4360]], [[12612, 12612], "mapped", [4385]], [[12613, 12613], "mapped", [4361]], [[12614, 12614], "mapped", [4362]], [[12615, 12615], "mapped", [4363]], [[12616, 12616], "mapped", [4364]], [[12617, 12617], "mapped", [4365]], [[12618, 12618], "mapped", [4366]], [[12619, 12619], "mapped", [4367]], [[12620, 12620], "mapped", [4368]], [[12621, 12621], "mapped", [4369]], [[12622, 12622], "mapped", [4370]], [[12623, 12623], "mapped", [4449]], [[12624, 12624], "mapped", [4450]], [[12625, 12625], "mapped", [4451]], [[12626, 12626], "mapped", [4452]], [[12627, 12627], "mapped", [4453]], [[12628, 12628], "mapped", [4454]], [[12629, 12629], "mapped", [4455]], [[12630, 12630], "mapped", [4456]], [[12631, 12631], "mapped", [4457]], [[12632, 12632], "mapped", [4458]], [[12633, 12633], "mapped", [4459]], [[12634, 12634], "mapped", [4460]], [[12635, 12635], "mapped", [4461]], [[12636, 12636], "mapped", [4462]], [[12637, 12637], "mapped", [4463]], [[12638, 12638], "mapped", [4464]], [[12639, 12639], "mapped", [4465]], [[12640, 12640], "mapped", [4466]], [[12641, 12641], "mapped", [4467]], [[12642, 12642], "mapped", [4468]], [[12643, 12643], "mapped", [4469]], [[12644, 12644], "disallowed"], [[12645, 12645], "mapped", [4372]], [[12646, 12646], "mapped", [4373]], [[12647, 12647], "mapped", [4551]], [[12648, 12648], "mapped", [4552]], [[12649, 12649], "mapped", [4556]], [[12650, 12650], "mapped", [4558]], [[12651, 12651], "mapped", [4563]], [[12652, 12652], "mapped", [4567]], [[12653, 12653], "mapped", [4569]], [[12654, 12654], "mapped", [4380]], [[12655, 12655], "mapped", [4573]], [[12656, 12656], "mapped", [4575]], [[12657, 12657], "mapped", [4381]], [[12658, 12658], "mapped", [4382]], [[12659, 12659], "mapped", [4384]], [[12660, 12660], "mapped", [4386]], [[12661, 12661], "mapped", [4387]], [[12662, 12662], "mapped", [4391]], [[12663, 12663], "mapped", [4393]], [[12664, 12664], "mapped", [4395]], [[12665, 12665], "mapped", [4396]], [[12666, 12666], "mapped", [4397]], [[12667, 12667], "mapped", [4398]], [[12668, 12668], "mapped", [4399]], [[12669, 12669], "mapped", [4402]], [[12670, 12670], "mapped", [4406]], [[12671, 12671], "mapped", [4416]], [[12672, 12672], "mapped", [4423]], [[12673, 12673], "mapped", [4428]], [[12674, 12674], "mapped", [4593]], [[12675, 12675], "mapped", [4594]], [[12676, 12676], "mapped", [4439]], [[12677, 12677], "mapped", [4440]], [[12678, 12678], "mapped", [4441]], [[12679, 12679], "mapped", [4484]], [[12680, 12680], "mapped", [4485]], [[12681, 12681], "mapped", [4488]], [[12682, 12682], "mapped", [4497]], [[12683, 12683], "mapped", [4498]], [[12684, 12684], "mapped", [4500]], [[12685, 12685], "mapped", [4510]], [[12686, 12686], "mapped", [4513]], [[12687, 12687], "disallowed"], [[12688, 12689], "valid", [], "NV8"], [[12690, 12690], "mapped", [19968]], [[12691, 12691], "mapped", [20108]], [[12692, 12692], "mapped", [19977]], [[12693, 12693], "mapped", [22235]], [[12694, 12694], "mapped", [19978]], [[12695, 12695], "mapped", [20013]], [[12696, 12696], "mapped", [19979]], [[12697, 12697], "mapped", [30002]], [[12698, 12698], "mapped", [20057]], [[12699, 12699], "mapped", [19993]], [[12700, 12700], "mapped", [19969]], [[12701, 12701], "mapped", [22825]], [[12702, 12702], "mapped", [22320]], [[12703, 12703], "mapped", [20154]], [[12704, 12727], "valid"], [[12728, 12730], "valid"], [[12731, 12735], "disallowed"], [[12736, 12751], "valid", [], "NV8"], [[12752, 12771], "valid", [], "NV8"], [[12772, 12783], "disallowed"], [[12784, 12799], "valid"], [[12800, 12800], "disallowed_STD3_mapped", [40, 4352, 41]], [[12801, 12801], "disallowed_STD3_mapped", [40, 4354, 41]], [[12802, 12802], "disallowed_STD3_mapped", [40, 4355, 41]], [[12803, 12803], "disallowed_STD3_mapped", [40, 4357, 41]], [[12804, 12804], "disallowed_STD3_mapped", [40, 4358, 41]], [[12805, 12805], "disallowed_STD3_mapped", [40, 4359, 41]], [[12806, 12806], "disallowed_STD3_mapped", [40, 4361, 41]], [[12807, 12807], "disallowed_STD3_mapped", [40, 4363, 41]], [[12808, 12808], "disallowed_STD3_mapped", [40, 4364, 41]], [[12809, 12809], "disallowed_STD3_mapped", [40, 4366, 41]], [[12810, 12810], "disallowed_STD3_mapped", [40, 4367, 41]], [[12811, 12811], "disallowed_STD3_mapped", [40, 4368, 41]], [[12812, 12812], "disallowed_STD3_mapped", [40, 4369, 41]], [[12813, 12813], "disallowed_STD3_mapped", [40, 4370, 41]], [[12814, 12814], "disallowed_STD3_mapped", [40, 44032, 41]], [[12815, 12815], "disallowed_STD3_mapped", [40, 45208, 41]], [[12816, 12816], "disallowed_STD3_mapped", [40, 45796, 41]], [[12817, 12817], "disallowed_STD3_mapped", [40, 46972, 41]], [[12818, 12818], "disallowed_STD3_mapped", [40, 47560, 41]], [[12819, 12819], "disallowed_STD3_mapped", [40, 48148, 41]], [[12820, 12820], "disallowed_STD3_mapped", [40, 49324, 41]], [[12821, 12821], "disallowed_STD3_mapped", [40, 50500, 41]], [[12822, 12822], "disallowed_STD3_mapped", [40, 51088, 41]], [[12823, 12823], "disallowed_STD3_mapped", [40, 52264, 41]], [[12824, 12824], "disallowed_STD3_mapped", [40, 52852, 41]], [[12825, 12825], "disallowed_STD3_mapped", [40, 53440, 41]], [[12826, 12826], "disallowed_STD3_mapped", [40, 54028, 41]], [[12827, 12827], "disallowed_STD3_mapped", [40, 54616, 41]], [[12828, 12828], "disallowed_STD3_mapped", [40, 51452, 41]], [[12829, 12829], "disallowed_STD3_mapped", [40, 50724, 51204, 41]], [[12830, 12830], "disallowed_STD3_mapped", [40, 50724, 54980, 41]], [[12831, 12831], "disallowed"], [[12832, 12832], "disallowed_STD3_mapped", [40, 19968, 41]], [[12833, 12833], "disallowed_STD3_mapped", [40, 20108, 41]], [[12834, 12834], "disallowed_STD3_mapped", [40, 19977, 41]], [[12835, 12835], "disallowed_STD3_mapped", [40, 22235, 41]], [[12836, 12836], "disallowed_STD3_mapped", [40, 20116, 41]], [[12837, 12837], "disallowed_STD3_mapped", [40, 20845, 41]], [[12838, 12838], "disallowed_STD3_mapped", [40, 19971, 41]], [[12839, 12839], "disallowed_STD3_mapped", [40, 20843, 41]], [[12840, 12840], "disallowed_STD3_mapped", [40, 20061, 41]], [[12841, 12841], "disallowed_STD3_mapped", [40, 21313, 41]], [[12842, 12842], "disallowed_STD3_mapped", [40, 26376, 41]], [[12843, 12843], "disallowed_STD3_mapped", [40, 28779, 41]], [[12844, 12844], "disallowed_STD3_mapped", [40, 27700, 41]], [[12845, 12845], "disallowed_STD3_mapped", [40, 26408, 41]], [[12846, 12846], "disallowed_STD3_mapped", [40, 37329, 41]], [[12847, 12847], "disallowed_STD3_mapped", [40, 22303, 41]], [[12848, 12848], "disallowed_STD3_mapped", [40, 26085, 41]], [[12849, 12849], "disallowed_STD3_mapped", [40, 26666, 41]], [[12850, 12850], "disallowed_STD3_mapped", [40, 26377, 41]], [[12851, 12851], "disallowed_STD3_mapped", [40, 31038, 41]], [[12852, 12852], "disallowed_STD3_mapped", [40, 21517, 41]], [[12853, 12853], "disallowed_STD3_mapped", [40, 29305, 41]], [[12854, 12854], "disallowed_STD3_mapped", [40, 36001, 41]], [[12855, 12855], "disallowed_STD3_mapped", [40, 31069, 41]], [[12856, 12856], "disallowed_STD3_mapped", [40, 21172, 41]], [[12857, 12857], "disallowed_STD3_mapped", [40, 20195, 41]], [[12858, 12858], "disallowed_STD3_mapped", [40, 21628, 41]], [[12859, 12859], "disallowed_STD3_mapped", [40, 23398, 41]], [[12860, 12860], "disallowed_STD3_mapped", [40, 30435, 41]], [[12861, 12861], "disallowed_STD3_mapped", [40, 20225, 41]], [[12862, 12862], "disallowed_STD3_mapped", [40, 36039, 41]], [[12863, 12863], "disallowed_STD3_mapped", [40, 21332, 41]], [[12864, 12864], "disallowed_STD3_mapped", [40, 31085, 41]], [[12865, 12865], "disallowed_STD3_mapped", [40, 20241, 41]], [[12866, 12866], "disallowed_STD3_mapped", [40, 33258, 41]], [[12867, 12867], "disallowed_STD3_mapped", [40, 33267, 41]], [[12868, 12868], "mapped", [21839]], [[12869, 12869], "mapped", [24188]], [[12870, 12870], "mapped", [25991]], [[12871, 12871], "mapped", [31631]], [[12872, 12879], "valid", [], "NV8"], [[12880, 12880], "mapped", [112, 116, 101]], [[12881, 12881], "mapped", [50, 49]], [[12882, 12882], "mapped", [50, 50]], [[12883, 12883], "mapped", [50, 51]], [[12884, 12884], "mapped", [50, 52]], [[12885, 12885], "mapped", [50, 53]], [[12886, 12886], "mapped", [50, 54]], [[12887, 12887], "mapped", [50, 55]], [[12888, 12888], "mapped", [50, 56]], [[12889, 12889], "mapped", [50, 57]], [[12890, 12890], "mapped", [51, 48]], [[12891, 12891], "mapped", [51, 49]], [[12892, 12892], "mapped", [51, 50]], [[12893, 12893], "mapped", [51, 51]], [[12894, 12894], "mapped", [51, 52]], [[12895, 12895], "mapped", [51, 53]], [[12896, 12896], "mapped", [4352]], [[12897, 12897], "mapped", [4354]], [[12898, 12898], "mapped", [4355]], [[12899, 12899], "mapped", [4357]], [[12900, 12900], "mapped", [4358]], [[12901, 12901], "mapped", [4359]], [[12902, 12902], "mapped", [4361]], [[12903, 12903], "mapped", [4363]], [[12904, 12904], "mapped", [4364]], [[12905, 12905], "mapped", [4366]], [[12906, 12906], "mapped", [4367]], [[12907, 12907], "mapped", [4368]], [[12908, 12908], "mapped", [4369]], [[12909, 12909], "mapped", [4370]], [[12910, 12910], "mapped", [44032]], [[12911, 12911], "mapped", [45208]], [[12912, 12912], "mapped", [45796]], [[12913, 12913], "mapped", [46972]], [[12914, 12914], "mapped", [47560]], [[12915, 12915], "mapped", [48148]], [[12916, 12916], "mapped", [49324]], [[12917, 12917], "mapped", [50500]], [[12918, 12918], "mapped", [51088]], [[12919, 12919], "mapped", [52264]], [[12920, 12920], "mapped", [52852]], [[12921, 12921], "mapped", [53440]], [[12922, 12922], "mapped", [54028]], [[12923, 12923], "mapped", [54616]], [[12924, 12924], "mapped", [52280, 44256]], [[12925, 12925], "mapped", [51452, 51032]], [[12926, 12926], "mapped", [50864]], [[12927, 12927], "valid", [], "NV8"], [[12928, 12928], "mapped", [19968]], [[12929, 12929], "mapped", [20108]], [[12930, 12930], "mapped", [19977]], [[12931, 12931], "mapped", [22235]], [[12932, 12932], "mapped", [20116]], [[12933, 12933], "mapped", [20845]], [[12934, 12934], "mapped", [19971]], [[12935, 12935], "mapped", [20843]], [[12936, 12936], "mapped", [20061]], [[12937, 12937], "mapped", [21313]], [[12938, 12938], "mapped", [26376]], [[12939, 12939], "mapped", [28779]], [[12940, 12940], "mapped", [27700]], [[12941, 12941], "mapped", [26408]], [[12942, 12942], "mapped", [37329]], [[12943, 12943], "mapped", [22303]], [[12944, 12944], "mapped", [26085]], [[12945, 12945], "mapped", [26666]], [[12946, 12946], "mapped", [26377]], [[12947, 12947], "mapped", [31038]], [[12948, 12948], "mapped", [21517]], [[12949, 12949], "mapped", [29305]], [[12950, 12950], "mapped", [36001]], [[12951, 12951], "mapped", [31069]], [[12952, 12952], "mapped", [21172]], [[12953, 12953], "mapped", [31192]], [[12954, 12954], "mapped", [30007]], [[12955, 12955], "mapped", [22899]], [[12956, 12956], "mapped", [36969]], [[12957, 12957], "mapped", [20778]], [[12958, 12958], "mapped", [21360]], [[12959, 12959], "mapped", [27880]], [[12960, 12960], "mapped", [38917]], [[12961, 12961], "mapped", [20241]], [[12962, 12962], "mapped", [20889]], [[12963, 12963], "mapped", [27491]], [[12964, 12964], "mapped", [19978]], [[12965, 12965], "mapped", [20013]], [[12966, 12966], "mapped", [19979]], [[12967, 12967], "mapped", [24038]], [[12968, 12968], "mapped", [21491]], [[12969, 12969], "mapped", [21307]], [[12970, 12970], "mapped", [23447]], [[12971, 12971], "mapped", [23398]], [[12972, 12972], "mapped", [30435]], [[12973, 12973], "mapped", [20225]], [[12974, 12974], "mapped", [36039]], [[12975, 12975], "mapped", [21332]], [[12976, 12976], "mapped", [22812]], [[12977, 12977], "mapped", [51, 54]], [[12978, 12978], "mapped", [51, 55]], [[12979, 12979], "mapped", [51, 56]], [[12980, 12980], "mapped", [51, 57]], [[12981, 12981], "mapped", [52, 48]], [[12982, 12982], "mapped", [52, 49]], [[12983, 12983], "mapped", [52, 50]], [[12984, 12984], "mapped", [52, 51]], [[12985, 12985], "mapped", [52, 52]], [[12986, 12986], "mapped", [52, 53]], [[12987, 12987], "mapped", [52, 54]], [[12988, 12988], "mapped", [52, 55]], [[12989, 12989], "mapped", [52, 56]], [[12990, 12990], "mapped", [52, 57]], [[12991, 12991], "mapped", [53, 48]], [[12992, 12992], "mapped", [49, 26376]], [[12993, 12993], "mapped", [50, 26376]], [[12994, 12994], "mapped", [51, 26376]], [[12995, 12995], "mapped", [52, 26376]], [[12996, 12996], "mapped", [53, 26376]], [[12997, 12997], "mapped", [54, 26376]], [[12998, 12998], "mapped", [55, 26376]], [[12999, 12999], "mapped", [56, 26376]], [[13e3, 13e3], "mapped", [57, 26376]], [[13001, 13001], "mapped", [49, 48, 26376]], [[13002, 13002], "mapped", [49, 49, 26376]], [[13003, 13003], "mapped", [49, 50, 26376]], [[13004, 13004], "mapped", [104, 103]], [[13005, 13005], "mapped", [101, 114, 103]], [[13006, 13006], "mapped", [101, 118]], [[13007, 13007], "mapped", [108, 116, 100]], [[13008, 13008], "mapped", [12450]], [[13009, 13009], "mapped", [12452]], [[13010, 13010], "mapped", [12454]], [[13011, 13011], "mapped", [12456]], [[13012, 13012], "mapped", [12458]], [[13013, 13013], "mapped", [12459]], [[13014, 13014], "mapped", [12461]], [[13015, 13015], "mapped", [12463]], [[13016, 13016], "mapped", [12465]], [[13017, 13017], "mapped", [12467]], [[13018, 13018], "mapped", [12469]], [[13019, 13019], "mapped", [12471]], [[13020, 13020], "mapped", [12473]], [[13021, 13021], "mapped", [12475]], [[13022, 13022], "mapped", [12477]], [[13023, 13023], "mapped", [12479]], [[13024, 13024], "mapped", [12481]], [[13025, 13025], "mapped", [12484]], [[13026, 13026], "mapped", [12486]], [[13027, 13027], "mapped", [12488]], [[13028, 13028], "mapped", [12490]], [[13029, 13029], "mapped", [12491]], [[13030, 13030], "mapped", [12492]], [[13031, 13031], "mapped", [12493]], [[13032, 13032], "mapped", [12494]], [[13033, 13033], "mapped", [12495]], [[13034, 13034], "mapped", [12498]], [[13035, 13035], "mapped", [12501]], [[13036, 13036], "mapped", [12504]], [[13037, 13037], "mapped", [12507]], [[13038, 13038], "mapped", [12510]], [[13039, 13039], "mapped", [12511]], [[13040, 13040], "mapped", [12512]], [[13041, 13041], "mapped", [12513]], [[13042, 13042], "mapped", [12514]], [[13043, 13043], "mapped", [12516]], [[13044, 13044], "mapped", [12518]], [[13045, 13045], "mapped", [12520]], [[13046, 13046], "mapped", [12521]], [[13047, 13047], "mapped", [12522]], [[13048, 13048], "mapped", [12523]], [[13049, 13049], "mapped", [12524]], [[13050, 13050], "mapped", [12525]], [[13051, 13051], "mapped", [12527]], [[13052, 13052], "mapped", [12528]], [[13053, 13053], "mapped", [12529]], [[13054, 13054], "mapped", [12530]], [[13055, 13055], "disallowed"], [[13056, 13056], "mapped", [12450, 12497, 12540, 12488]], [[13057, 13057], "mapped", [12450, 12523, 12501, 12449]], [[13058, 13058], "mapped", [12450, 12531, 12506, 12450]], [[13059, 13059], "mapped", [12450, 12540, 12523]], [[13060, 13060], "mapped", [12452, 12491, 12531, 12464]], [[13061, 13061], "mapped", [12452, 12531, 12481]], [[13062, 13062], "mapped", [12454, 12457, 12531]], [[13063, 13063], "mapped", [12456, 12473, 12463, 12540, 12489]], [[13064, 13064], "mapped", [12456, 12540, 12459, 12540]], [[13065, 13065], "mapped", [12458, 12531, 12473]], [[13066, 13066], "mapped", [12458, 12540, 12512]], [[13067, 13067], "mapped", [12459, 12452, 12522]], [[13068, 13068], "mapped", [12459, 12521, 12483, 12488]], [[13069, 13069], "mapped", [12459, 12525, 12522, 12540]], [[13070, 13070], "mapped", [12460, 12525, 12531]], [[13071, 13071], "mapped", [12460, 12531, 12510]], [[13072, 13072], "mapped", [12462, 12460]], [[13073, 13073], "mapped", [12462, 12491, 12540]], [[13074, 13074], "mapped", [12461, 12517, 12522, 12540]], [[13075, 13075], "mapped", [12462, 12523, 12480, 12540]], [[13076, 13076], "mapped", [12461, 12525]], [[13077, 13077], "mapped", [12461, 12525, 12464, 12521, 12512]], [[13078, 13078], "mapped", [12461, 12525, 12513, 12540, 12488, 12523]], [[13079, 13079], "mapped", [12461, 12525, 12527, 12483, 12488]], [[13080, 13080], "mapped", [12464, 12521, 12512]], [[13081, 13081], "mapped", [12464, 12521, 12512, 12488, 12531]], [[13082, 13082], "mapped", [12463, 12523, 12476, 12452, 12525]], [[13083, 13083], "mapped", [12463, 12525, 12540, 12493]], [[13084, 13084], "mapped", [12465, 12540, 12473]], [[13085, 13085], "mapped", [12467, 12523, 12490]], [[13086, 13086], "mapped", [12467, 12540, 12509]], [[13087, 13087], "mapped", [12469, 12452, 12463, 12523]], [[13088, 13088], "mapped", [12469, 12531, 12481, 12540, 12512]], [[13089, 13089], "mapped", [12471, 12522, 12531, 12464]], [[13090, 13090], "mapped", [12475, 12531, 12481]], [[13091, 13091], "mapped", [12475, 12531, 12488]], [[13092, 13092], "mapped", [12480, 12540, 12473]], [[13093, 13093], "mapped", [12487, 12471]], [[13094, 13094], "mapped", [12489, 12523]], [[13095, 13095], "mapped", [12488, 12531]], [[13096, 13096], "mapped", [12490, 12494]], [[13097, 13097], "mapped", [12494, 12483, 12488]], [[13098, 13098], "mapped", [12495, 12452, 12484]], [[13099, 13099], "mapped", [12497, 12540, 12475, 12531, 12488]], [[13100, 13100], "mapped", [12497, 12540, 12484]], [[13101, 13101], "mapped", [12496, 12540, 12524, 12523]], [[13102, 13102], "mapped", [12500, 12450, 12473, 12488, 12523]], [[13103, 13103], "mapped", [12500, 12463, 12523]], [[13104, 13104], "mapped", [12500, 12467]], [[13105, 13105], "mapped", [12499, 12523]], [[13106, 13106], "mapped", [12501, 12449, 12521, 12483, 12489]], [[13107, 13107], "mapped", [12501, 12451, 12540, 12488]], [[13108, 13108], "mapped", [12502, 12483, 12471, 12455, 12523]], [[13109, 13109], "mapped", [12501, 12521, 12531]], [[13110, 13110], "mapped", [12504, 12463, 12479, 12540, 12523]], [[13111, 13111], "mapped", [12506, 12477]], [[13112, 13112], "mapped", [12506, 12491, 12498]], [[13113, 13113], "mapped", [12504, 12523, 12484]], [[13114, 13114], "mapped", [12506, 12531, 12473]], [[13115, 13115], "mapped", [12506, 12540, 12472]], [[13116, 13116], "mapped", [12505, 12540, 12479]], [[13117, 13117], "mapped", [12509, 12452, 12531, 12488]], [[13118, 13118], "mapped", [12508, 12523, 12488]], [[13119, 13119], "mapped", [12507, 12531]], [[13120, 13120], "mapped", [12509, 12531, 12489]], [[13121, 13121], "mapped", [12507, 12540, 12523]], [[13122, 13122], "mapped", [12507, 12540, 12531]], [[13123, 13123], "mapped", [12510, 12452, 12463, 12525]], [[13124, 13124], "mapped", [12510, 12452, 12523]], [[13125, 13125], "mapped", [12510, 12483, 12495]], [[13126, 13126], "mapped", [12510, 12523, 12463]], [[13127, 13127], "mapped", [12510, 12531, 12471, 12519, 12531]], [[13128, 13128], "mapped", [12511, 12463, 12525, 12531]], [[13129, 13129], "mapped", [12511, 12522]], [[13130, 13130], "mapped", [12511, 12522, 12496, 12540, 12523]], [[13131, 13131], "mapped", [12513, 12460]], [[13132, 13132], "mapped", [12513, 12460, 12488, 12531]], [[13133, 13133], "mapped", [12513, 12540, 12488, 12523]], [[13134, 13134], "mapped", [12516, 12540, 12489]], [[13135, 13135], "mapped", [12516, 12540, 12523]], [[13136, 13136], "mapped", [12518, 12450, 12531]], [[13137, 13137], "mapped", [12522, 12483, 12488, 12523]], [[13138, 13138], "mapped", [12522, 12521]], [[13139, 13139], "mapped", [12523, 12500, 12540]], [[13140, 13140], "mapped", [12523, 12540, 12502, 12523]], [[13141, 13141], "mapped", [12524, 12512]], [[13142, 13142], "mapped", [12524, 12531, 12488, 12466, 12531]], [[13143, 13143], "mapped", [12527, 12483, 12488]], [[13144, 13144], "mapped", [48, 28857]], [[13145, 13145], "mapped", [49, 28857]], [[13146, 13146], "mapped", [50, 28857]], [[13147, 13147], "mapped", [51, 28857]], [[13148, 13148], "mapped", [52, 28857]], [[13149, 13149], "mapped", [53, 28857]], [[13150, 13150], "mapped", [54, 28857]], [[13151, 13151], "mapped", [55, 28857]], [[13152, 13152], "mapped", [56, 28857]], [[13153, 13153], "mapped", [57, 28857]], [[13154, 13154], "mapped", [49, 48, 28857]], [[13155, 13155], "mapped", [49, 49, 28857]], [[13156, 13156], "mapped", [49, 50, 28857]], [[13157, 13157], "mapped", [49, 51, 28857]], [[13158, 13158], "mapped", [49, 52, 28857]], [[13159, 13159], "mapped", [49, 53, 28857]], [[13160, 13160], "mapped", [49, 54, 28857]], [[13161, 13161], "mapped", [49, 55, 28857]], [[13162, 13162], "mapped", [49, 56, 28857]], [[13163, 13163], "mapped", [49, 57, 28857]], [[13164, 13164], "mapped", [50, 48, 28857]], [[13165, 13165], "mapped", [50, 49, 28857]], [[13166, 13166], "mapped", [50, 50, 28857]], [[13167, 13167], "mapped", [50, 51, 28857]], [[13168, 13168], "mapped", [50, 52, 28857]], [[13169, 13169], "mapped", [104, 112, 97]], [[13170, 13170], "mapped", [100, 97]], [[13171, 13171], "mapped", [97, 117]], [[13172, 13172], "mapped", [98, 97, 114]], [[13173, 13173], "mapped", [111, 118]], [[13174, 13174], "mapped", [112, 99]], [[13175, 13175], "mapped", [100, 109]], [[13176, 13176], "mapped", [100, 109, 50]], [[13177, 13177], "mapped", [100, 109, 51]], [[13178, 13178], "mapped", [105, 117]], [[13179, 13179], "mapped", [24179, 25104]], [[13180, 13180], "mapped", [26157, 21644]], [[13181, 13181], "mapped", [22823, 27491]], [[13182, 13182], "mapped", [26126, 27835]], [[13183, 13183], "mapped", [26666, 24335, 20250, 31038]], [[13184, 13184], "mapped", [112, 97]], [[13185, 13185], "mapped", [110, 97]], [[13186, 13186], "mapped", [956, 97]], [[13187, 13187], "mapped", [109, 97]], [[13188, 13188], "mapped", [107, 97]], [[13189, 13189], "mapped", [107, 98]], [[13190, 13190], "mapped", [109, 98]], [[13191, 13191], "mapped", [103, 98]], [[13192, 13192], "mapped", [99, 97, 108]], [[13193, 13193], "mapped", [107, 99, 97, 108]], [[13194, 13194], "mapped", [112, 102]], [[13195, 13195], "mapped", [110, 102]], [[13196, 13196], "mapped", [956, 102]], [[13197, 13197], "mapped", [956, 103]], [[13198, 13198], "mapped", [109, 103]], [[13199, 13199], "mapped", [107, 103]], [[13200, 13200], "mapped", [104, 122]], [[13201, 13201], "mapped", [107, 104, 122]], [[13202, 13202], "mapped", [109, 104, 122]], [[13203, 13203], "mapped", [103, 104, 122]], [[13204, 13204], "mapped", [116, 104, 122]], [[13205, 13205], "mapped", [956, 108]], [[13206, 13206], "mapped", [109, 108]], [[13207, 13207], "mapped", [100, 108]], [[13208, 13208], "mapped", [107, 108]], [[13209, 13209], "mapped", [102, 109]], [[13210, 13210], "mapped", [110, 109]], [[13211, 13211], "mapped", [956, 109]], [[13212, 13212], "mapped", [109, 109]], [[13213, 13213], "mapped", [99, 109]], [[13214, 13214], "mapped", [107, 109]], [[13215, 13215], "mapped", [109, 109, 50]], [[13216, 13216], "mapped", [99, 109, 50]], [[13217, 13217], "mapped", [109, 50]], [[13218, 13218], "mapped", [107, 109, 50]], [[13219, 13219], "mapped", [109, 109, 51]], [[13220, 13220], "mapped", [99, 109, 51]], [[13221, 13221], "mapped", [109, 51]], [[13222, 13222], "mapped", [107, 109, 51]], [[13223, 13223], "mapped", [109, 8725, 115]], [[13224, 13224], "mapped", [109, 8725, 115, 50]], [[13225, 13225], "mapped", [112, 97]], [[13226, 13226], "mapped", [107, 112, 97]], [[13227, 13227], "mapped", [109, 112, 97]], [[13228, 13228], "mapped", [103, 112, 97]], [[13229, 13229], "mapped", [114, 97, 100]], [[13230, 13230], "mapped", [114, 97, 100, 8725, 115]], [[13231, 13231], "mapped", [114, 97, 100, 8725, 115, 50]], [[13232, 13232], "mapped", [112, 115]], [[13233, 13233], "mapped", [110, 115]], [[13234, 13234], "mapped", [956, 115]], [[13235, 13235], "mapped", [109, 115]], [[13236, 13236], "mapped", [112, 118]], [[13237, 13237], "mapped", [110, 118]], [[13238, 13238], "mapped", [956, 118]], [[13239, 13239], "mapped", [109, 118]], [[13240, 13240], "mapped", [107, 118]], [[13241, 13241], "mapped", [109, 118]], [[13242, 13242], "mapped", [112, 119]], [[13243, 13243], "mapped", [110, 119]], [[13244, 13244], "mapped", [956, 119]], [[13245, 13245], "mapped", [109, 119]], [[13246, 13246], "mapped", [107, 119]], [[13247, 13247], "mapped", [109, 119]], [[13248, 13248], "mapped", [107, 969]], [[13249, 13249], "mapped", [109, 969]], [[13250, 13250], "disallowed"], [[13251, 13251], "mapped", [98, 113]], [[13252, 13252], "mapped", [99, 99]], [[13253, 13253], "mapped", [99, 100]], [[13254, 13254], "mapped", [99, 8725, 107, 103]], [[13255, 13255], "disallowed"], [[13256, 13256], "mapped", [100, 98]], [[13257, 13257], "mapped", [103, 121]], [[13258, 13258], "mapped", [104, 97]], [[13259, 13259], "mapped", [104, 112]], [[13260, 13260], "mapped", [105, 110]], [[13261, 13261], "mapped", [107, 107]], [[13262, 13262], "mapped", [107, 109]], [[13263, 13263], "mapped", [107, 116]], [[13264, 13264], "mapped", [108, 109]], [[13265, 13265], "mapped", [108, 110]], [[13266, 13266], "mapped", [108, 111, 103]], [[13267, 13267], "mapped", [108, 120]], [[13268, 13268], "mapped", [109, 98]], [[13269, 13269], "mapped", [109, 105, 108]], [[13270, 13270], "mapped", [109, 111, 108]], [[13271, 13271], "mapped", [112, 104]], [[13272, 13272], "disallowed"], [[13273, 13273], "mapped", [112, 112, 109]], [[13274, 13274], "mapped", [112, 114]], [[13275, 13275], "mapped", [115, 114]], [[13276, 13276], "mapped", [115, 118]], [[13277, 13277], "mapped", [119, 98]], [[13278, 13278], "mapped", [118, 8725, 109]], [[13279, 13279], "mapped", [97, 8725, 109]], [[13280, 13280], "mapped", [49, 26085]], [[13281, 13281], "mapped", [50, 26085]], [[13282, 13282], "mapped", [51, 26085]], [[13283, 13283], "mapped", [52, 26085]], [[13284, 13284], "mapped", [53, 26085]], [[13285, 13285], "mapped", [54, 26085]], [[13286, 13286], "mapped", [55, 26085]], [[13287, 13287], "mapped", [56, 26085]], [[13288, 13288], "mapped", [57, 26085]], [[13289, 13289], "mapped", [49, 48, 26085]], [[13290, 13290], "mapped", [49, 49, 26085]], [[13291, 13291], "mapped", [49, 50, 26085]], [[13292, 13292], "mapped", [49, 51, 26085]], [[13293, 13293], "mapped", [49, 52, 26085]], [[13294, 13294], "mapped", [49, 53, 26085]], [[13295, 13295], "mapped", [49, 54, 26085]], [[13296, 13296], "mapped", [49, 55, 26085]], [[13297, 13297], "mapped", [49, 56, 26085]], [[13298, 13298], "mapped", [49, 57, 26085]], [[13299, 13299], "mapped", [50, 48, 26085]], [[13300, 13300], "mapped", [50, 49, 26085]], [[13301, 13301], "mapped", [50, 50, 26085]], [[13302, 13302], "mapped", [50, 51, 26085]], [[13303, 13303], "mapped", [50, 52, 26085]], [[13304, 13304], "mapped", [50, 53, 26085]], [[13305, 13305], "mapped", [50, 54, 26085]], [[13306, 13306], "mapped", [50, 55, 26085]], [[13307, 13307], "mapped", [50, 56, 26085]], [[13308, 13308], "mapped", [50, 57, 26085]], [[13309, 13309], "mapped", [51, 48, 26085]], [[13310, 13310], "mapped", [51, 49, 26085]], [[13311, 13311], "mapped", [103, 97, 108]], [[13312, 19893], "valid"], [[19894, 19903], "disallowed"], [[19904, 19967], "valid", [], "NV8"], [[19968, 40869], "valid"], [[40870, 40891], "valid"], [[40892, 40899], "valid"], [[40900, 40907], "valid"], [[40908, 40908], "valid"], [[40909, 40917], "valid"], [[40918, 40959], "disallowed"], [[40960, 42124], "valid"], [[42125, 42127], "disallowed"], [[42128, 42145], "valid", [], "NV8"], [[42146, 42147], "valid", [], "NV8"], [[42148, 42163], "valid", [], "NV8"], [[42164, 42164], "valid", [], "NV8"], [[42165, 42176], "valid", [], "NV8"], [[42177, 42177], "valid", [], "NV8"], [[42178, 42180], "valid", [], "NV8"], [[42181, 42181], "valid", [], "NV8"], [[42182, 42182], "valid", [], "NV8"], [[42183, 42191], "disallowed"], [[42192, 42237], "valid"], [[42238, 42239], "valid", [], "NV8"], [[42240, 42508], "valid"], [[42509, 42511], "valid", [], "NV8"], [[42512, 42539], "valid"], [[42540, 42559], "disallowed"], [[42560, 42560], "mapped", [42561]], [[42561, 42561], "valid"], [[42562, 42562], "mapped", [42563]], [[42563, 42563], "valid"], [[42564, 42564], "mapped", [42565]], [[42565, 42565], "valid"], [[42566, 42566], "mapped", [42567]], [[42567, 42567], "valid"], [[42568, 42568], "mapped", [42569]], [[42569, 42569], "valid"], [[42570, 42570], "mapped", [42571]], [[42571, 42571], "valid"], [[42572, 42572], "mapped", [42573]], [[42573, 42573], "valid"], [[42574, 42574], "mapped", [42575]], [[42575, 42575], "valid"], [[42576, 42576], "mapped", [42577]], [[42577, 42577], "valid"], [[42578, 42578], "mapped", [42579]], [[42579, 42579], "valid"], [[42580, 42580], "mapped", [42581]], [[42581, 42581], "valid"], [[42582, 42582], "mapped", [42583]], [[42583, 42583], "valid"], [[42584, 42584], "mapped", [42585]], [[42585, 42585], "valid"], [[42586, 42586], "mapped", [42587]], [[42587, 42587], "valid"], [[42588, 42588], "mapped", [42589]], [[42589, 42589], "valid"], [[42590, 42590], "mapped", [42591]], [[42591, 42591], "valid"], [[42592, 42592], "mapped", [42593]], [[42593, 42593], "valid"], [[42594, 42594], "mapped", [42595]], [[42595, 42595], "valid"], [[42596, 42596], "mapped", [42597]], [[42597, 42597], "valid"], [[42598, 42598], "mapped", [42599]], [[42599, 42599], "valid"], [[42600, 42600], "mapped", [42601]], [[42601, 42601], "valid"], [[42602, 42602], "mapped", [42603]], [[42603, 42603], "valid"], [[42604, 42604], "mapped", [42605]], [[42605, 42607], "valid"], [[42608, 42611], "valid", [], "NV8"], [[42612, 42619], "valid"], [[42620, 42621], "valid"], [[42622, 42622], "valid", [], "NV8"], [[42623, 42623], "valid"], [[42624, 42624], "mapped", [42625]], [[42625, 42625], "valid"], [[42626, 42626], "mapped", [42627]], [[42627, 42627], "valid"], [[42628, 42628], "mapped", [42629]], [[42629, 42629], "valid"], [[42630, 42630], "mapped", [42631]], [[42631, 42631], "valid"], [[42632, 42632], "mapped", [42633]], [[42633, 42633], "valid"], [[42634, 42634], "mapped", [42635]], [[42635, 42635], "valid"], [[42636, 42636], "mapped", [42637]], [[42637, 42637], "valid"], [[42638, 42638], "mapped", [42639]], [[42639, 42639], "valid"], [[42640, 42640], "mapped", [42641]], [[42641, 42641], "valid"], [[42642, 42642], "mapped", [42643]], [[42643, 42643], "valid"], [[42644, 42644], "mapped", [42645]], [[42645, 42645], "valid"], [[42646, 42646], "mapped", [42647]], [[42647, 42647], "valid"], [[42648, 42648], "mapped", [42649]], [[42649, 42649], "valid"], [[42650, 42650], "mapped", [42651]], [[42651, 42651], "valid"], [[42652, 42652], "mapped", [1098]], [[42653, 42653], "mapped", [1100]], [[42654, 42654], "valid"], [[42655, 42655], "valid"], [[42656, 42725], "valid"], [[42726, 42735], "valid", [], "NV8"], [[42736, 42737], "valid"], [[42738, 42743], "valid", [], "NV8"], [[42744, 42751], "disallowed"], [[42752, 42774], "valid", [], "NV8"], [[42775, 42778], "valid"], [[42779, 42783], "valid"], [[42784, 42785], "valid", [], "NV8"], [[42786, 42786], "mapped", [42787]], [[42787, 42787], "valid"], [[42788, 42788], "mapped", [42789]], [[42789, 42789], "valid"], [[42790, 42790], "mapped", [42791]], [[42791, 42791], "valid"], [[42792, 42792], "mapped", [42793]], [[42793, 42793], "valid"], [[42794, 42794], "mapped", [42795]], [[42795, 42795], "valid"], [[42796, 42796], "mapped", [42797]], [[42797, 42797], "valid"], [[42798, 42798], "mapped", [42799]], [[42799, 42801], "valid"], [[42802, 42802], "mapped", [42803]], [[42803, 42803], "valid"], [[42804, 42804], "mapped", [42805]], [[42805, 42805], "valid"], [[42806, 42806], "mapped", [42807]], [[42807, 42807], "valid"], [[42808, 42808], "mapped", [42809]], [[42809, 42809], "valid"], [[42810, 42810], "mapped", [42811]], [[42811, 42811], "valid"], [[42812, 42812], "mapped", [42813]], [[42813, 42813], "valid"], [[42814, 42814], "mapped", [42815]], [[42815, 42815], "valid"], [[42816, 42816], "mapped", [42817]], [[42817, 42817], "valid"], [[42818, 42818], "mapped", [42819]], [[42819, 42819], "valid"], [[42820, 42820], "mapped", [42821]], [[42821, 42821], "valid"], [[42822, 42822], "mapped", [42823]], [[42823, 42823], "valid"], [[42824, 42824], "mapped", [42825]], [[42825, 42825], "valid"], [[42826, 42826], "mapped", [42827]], [[42827, 42827], "valid"], [[42828, 42828], "mapped", [42829]], [[42829, 42829], "valid"], [[42830, 42830], "mapped", [42831]], [[42831, 42831], "valid"], [[42832, 42832], "mapped", [42833]], [[42833, 42833], "valid"], [[42834, 42834], "mapped", [42835]], [[42835, 42835], "valid"], [[42836, 42836], "mapped", [42837]], [[42837, 42837], "valid"], [[42838, 42838], "mapped", [42839]], [[42839, 42839], "valid"], [[42840, 42840], "mapped", [42841]], [[42841, 42841], "valid"], [[42842, 42842], "mapped", [42843]], [[42843, 42843], "valid"], [[42844, 42844], "mapped", [42845]], [[42845, 42845], "valid"], [[42846, 42846], "mapped", [42847]], [[42847, 42847], "valid"], [[42848, 42848], "mapped", [42849]], [[42849, 42849], "valid"], [[42850, 42850], "mapped", [42851]], [[42851, 42851], "valid"], [[42852, 42852], "mapped", [42853]], [[42853, 42853], "valid"], [[42854, 42854], "mapped", [42855]], [[42855, 42855], "valid"], [[42856, 42856], "mapped", [42857]], [[42857, 42857], "valid"], [[42858, 42858], "mapped", [42859]], [[42859, 42859], "valid"], [[42860, 42860], "mapped", [42861]], [[42861, 42861], "valid"], [[42862, 42862], "mapped", [42863]], [[42863, 42863], "valid"], [[42864, 42864], "mapped", [42863]], [[42865, 42872], "valid"], [[42873, 42873], "mapped", [42874]], [[42874, 42874], "valid"], [[42875, 42875], "mapped", [42876]], [[42876, 42876], "valid"], [[42877, 42877], "mapped", [7545]], [[42878, 42878], "mapped", [42879]], [[42879, 42879], "valid"], [[42880, 42880], "mapped", [42881]], [[42881, 42881], "valid"], [[42882, 42882], "mapped", [42883]], [[42883, 42883], "valid"], [[42884, 42884], "mapped", [42885]], [[42885, 42885], "valid"], [[42886, 42886], "mapped", [42887]], [[42887, 42888], "valid"], [[42889, 42890], "valid", [], "NV8"], [[42891, 42891], "mapped", [42892]], [[42892, 42892], "valid"], [[42893, 42893], "mapped", [613]], [[42894, 42894], "valid"], [[42895, 42895], "valid"], [[42896, 42896], "mapped", [42897]], [[42897, 42897], "valid"], [[42898, 42898], "mapped", [42899]], [[42899, 42899], "valid"], [[42900, 42901], "valid"], [[42902, 42902], "mapped", [42903]], [[42903, 42903], "valid"], [[42904, 42904], "mapped", [42905]], [[42905, 42905], "valid"], [[42906, 42906], "mapped", [42907]], [[42907, 42907], "valid"], [[42908, 42908], "mapped", [42909]], [[42909, 42909], "valid"], [[42910, 42910], "mapped", [42911]], [[42911, 42911], "valid"], [[42912, 42912], "mapped", [42913]], [[42913, 42913], "valid"], [[42914, 42914], "mapped", [42915]], [[42915, 42915], "valid"], [[42916, 42916], "mapped", [42917]], [[42917, 42917], "valid"], [[42918, 42918], "mapped", [42919]], [[42919, 42919], "valid"], [[42920, 42920], "mapped", [42921]], [[42921, 42921], "valid"], [[42922, 42922], "mapped", [614]], [[42923, 42923], "mapped", [604]], [[42924, 42924], "mapped", [609]], [[42925, 42925], "mapped", [620]], [[42926, 42927], "disallowed"], [[42928, 42928], "mapped", [670]], [[42929, 42929], "mapped", [647]], [[42930, 42930], "mapped", [669]], [[42931, 42931], "mapped", [43859]], [[42932, 42932], "mapped", [42933]], [[42933, 42933], "valid"], [[42934, 42934], "mapped", [42935]], [[42935, 42935], "valid"], [[42936, 42998], "disallowed"], [[42999, 42999], "valid"], [[43e3, 43e3], "mapped", [295]], [[43001, 43001], "mapped", [339]], [[43002, 43002], "valid"], [[43003, 43007], "valid"], [[43008, 43047], "valid"], [[43048, 43051], "valid", [], "NV8"], [[43052, 43055], "disallowed"], [[43056, 43065], "valid", [], "NV8"], [[43066, 43071], "disallowed"], [[43072, 43123], "valid"], [[43124, 43127], "valid", [], "NV8"], [[43128, 43135], "disallowed"], [[43136, 43204], "valid"], [[43205, 43213], "disallowed"], [[43214, 43215], "valid", [], "NV8"], [[43216, 43225], "valid"], [[43226, 43231], "disallowed"], [[43232, 43255], "valid"], [[43256, 43258], "valid", [], "NV8"], [[43259, 43259], "valid"], [[43260, 43260], "valid", [], "NV8"], [[43261, 43261], "valid"], [[43262, 43263], "disallowed"], [[43264, 43309], "valid"], [[43310, 43311], "valid", [], "NV8"], [[43312, 43347], "valid"], [[43348, 43358], "disallowed"], [[43359, 43359], "valid", [], "NV8"], [[43360, 43388], "valid", [], "NV8"], [[43389, 43391], "disallowed"], [[43392, 43456], "valid"], [[43457, 43469], "valid", [], "NV8"], [[43470, 43470], "disallowed"], [[43471, 43481], "valid"], [[43482, 43485], "disallowed"], [[43486, 43487], "valid", [], "NV8"], [[43488, 43518], "valid"], [[43519, 43519], "disallowed"], [[43520, 43574], "valid"], [[43575, 43583], "disallowed"], [[43584, 43597], "valid"], [[43598, 43599], "disallowed"], [[43600, 43609], "valid"], [[43610, 43611], "disallowed"], [[43612, 43615], "valid", [], "NV8"], [[43616, 43638], "valid"], [[43639, 43641], "valid", [], "NV8"], [[43642, 43643], "valid"], [[43644, 43647], "valid"], [[43648, 43714], "valid"], [[43715, 43738], "disallowed"], [[43739, 43741], "valid"], [[43742, 43743], "valid", [], "NV8"], [[43744, 43759], "valid"], [[43760, 43761], "valid", [], "NV8"], [[43762, 43766], "valid"], [[43767, 43776], "disallowed"], [[43777, 43782], "valid"], [[43783, 43784], "disallowed"], [[43785, 43790], "valid"], [[43791, 43792], "disallowed"], [[43793, 43798], "valid"], [[43799, 43807], "disallowed"], [[43808, 43814], "valid"], [[43815, 43815], "disallowed"], [[43816, 43822], "valid"], [[43823, 43823], "disallowed"], [[43824, 43866], "valid"], [[43867, 43867], "valid", [], "NV8"], [[43868, 43868], "mapped", [42791]], [[43869, 43869], "mapped", [43831]], [[43870, 43870], "mapped", [619]], [[43871, 43871], "mapped", [43858]], [[43872, 43875], "valid"], [[43876, 43877], "valid"], [[43878, 43887], "disallowed"], [[43888, 43888], "mapped", [5024]], [[43889, 43889], "mapped", [5025]], [[43890, 43890], "mapped", [5026]], [[43891, 43891], "mapped", [5027]], [[43892, 43892], "mapped", [5028]], [[43893, 43893], "mapped", [5029]], [[43894, 43894], "mapped", [5030]], [[43895, 43895], "mapped", [5031]], [[43896, 43896], "mapped", [5032]], [[43897, 43897], "mapped", [5033]], [[43898, 43898], "mapped", [5034]], [[43899, 43899], "mapped", [5035]], [[43900, 43900], "mapped", [5036]], [[43901, 43901], "mapped", [5037]], [[43902, 43902], "mapped", [5038]], [[43903, 43903], "mapped", [5039]], [[43904, 43904], "mapped", [5040]], [[43905, 43905], "mapped", [5041]], [[43906, 43906], "mapped", [5042]], [[43907, 43907], "mapped", [5043]], [[43908, 43908], "mapped", [5044]], [[43909, 43909], "mapped", [5045]], [[43910, 43910], "mapped", [5046]], [[43911, 43911], "mapped", [5047]], [[43912, 43912], "mapped", [5048]], [[43913, 43913], "mapped", [5049]], [[43914, 43914], "mapped", [5050]], [[43915, 43915], "mapped", [5051]], [[43916, 43916], "mapped", [5052]], [[43917, 43917], "mapped", [5053]], [[43918, 43918], "mapped", [5054]], [[43919, 43919], "mapped", [5055]], [[43920, 43920], "mapped", [5056]], [[43921, 43921], "mapped", [5057]], [[43922, 43922], "mapped", [5058]], [[43923, 43923], "mapped", [5059]], [[43924, 43924], "mapped", [5060]], [[43925, 43925], "mapped", [5061]], [[43926, 43926], "mapped", [5062]], [[43927, 43927], "mapped", [5063]], [[43928, 43928], "mapped", [5064]], [[43929, 43929], "mapped", [5065]], [[43930, 43930], "mapped", [5066]], [[43931, 43931], "mapped", [5067]], [[43932, 43932], "mapped", [5068]], [[43933, 43933], "mapped", [5069]], [[43934, 43934], "mapped", [5070]], [[43935, 43935], "mapped", [5071]], [[43936, 43936], "mapped", [5072]], [[43937, 43937], "mapped", [5073]], [[43938, 43938], "mapped", [5074]], [[43939, 43939], "mapped", [5075]], [[43940, 43940], "mapped", [5076]], [[43941, 43941], "mapped", [5077]], [[43942, 43942], "mapped", [5078]], [[43943, 43943], "mapped", [5079]], [[43944, 43944], "mapped", [5080]], [[43945, 43945], "mapped", [5081]], [[43946, 43946], "mapped", [5082]], [[43947, 43947], "mapped", [5083]], [[43948, 43948], "mapped", [5084]], [[43949, 43949], "mapped", [5085]], [[43950, 43950], "mapped", [5086]], [[43951, 43951], "mapped", [5087]], [[43952, 43952], "mapped", [5088]], [[43953, 43953], "mapped", [5089]], [[43954, 43954], "mapped", [5090]], [[43955, 43955], "mapped", [5091]], [[43956, 43956], "mapped", [5092]], [[43957, 43957], "mapped", [5093]], [[43958, 43958], "mapped", [5094]], [[43959, 43959], "mapped", [5095]], [[43960, 43960], "mapped", [5096]], [[43961, 43961], "mapped", [5097]], [[43962, 43962], "mapped", [5098]], [[43963, 43963], "mapped", [5099]], [[43964, 43964], "mapped", [5100]], [[43965, 43965], "mapped", [5101]], [[43966, 43966], "mapped", [5102]], [[43967, 43967], "mapped", [5103]], [[43968, 44010], "valid"], [[44011, 44011], "valid", [], "NV8"], [[44012, 44013], "valid"], [[44014, 44015], "disallowed"], [[44016, 44025], "valid"], [[44026, 44031], "disallowed"], [[44032, 55203], "valid"], [[55204, 55215], "disallowed"], [[55216, 55238], "valid", [], "NV8"], [[55239, 55242], "disallowed"], [[55243, 55291], "valid", [], "NV8"], [[55292, 55295], "disallowed"], [[55296, 57343], "disallowed"], [[57344, 63743], "disallowed"], [[63744, 63744], "mapped", [35912]], [[63745, 63745], "mapped", [26356]], [[63746, 63746], "mapped", [36554]], [[63747, 63747], "mapped", [36040]], [[63748, 63748], "mapped", [28369]], [[63749, 63749], "mapped", [20018]], [[63750, 63750], "mapped", [21477]], [[63751, 63752], "mapped", [40860]], [[63753, 63753], "mapped", [22865]], [[63754, 63754], "mapped", [37329]], [[63755, 63755], "mapped", [21895]], [[63756, 63756], "mapped", [22856]], [[63757, 63757], "mapped", [25078]], [[63758, 63758], "mapped", [30313]], [[63759, 63759], "mapped", [32645]], [[63760, 63760], "mapped", [34367]], [[63761, 63761], "mapped", [34746]], [[63762, 63762], "mapped", [35064]], [[63763, 63763], "mapped", [37007]], [[63764, 63764], "mapped", [27138]], [[63765, 63765], "mapped", [27931]], [[63766, 63766], "mapped", [28889]], [[63767, 63767], "mapped", [29662]], [[63768, 63768], "mapped", [33853]], [[63769, 63769], "mapped", [37226]], [[63770, 63770], "mapped", [39409]], [[63771, 63771], "mapped", [20098]], [[63772, 63772], "mapped", [21365]], [[63773, 63773], "mapped", [27396]], [[63774, 63774], "mapped", [29211]], [[63775, 63775], "mapped", [34349]], [[63776, 63776], "mapped", [40478]], [[63777, 63777], "mapped", [23888]], [[63778, 63778], "mapped", [28651]], [[63779, 63779], "mapped", [34253]], [[63780, 63780], "mapped", [35172]], [[63781, 63781], "mapped", [25289]], [[63782, 63782], "mapped", [33240]], [[63783, 63783], "mapped", [34847]], [[63784, 63784], "mapped", [24266]], [[63785, 63785], "mapped", [26391]], [[63786, 63786], "mapped", [28010]], [[63787, 63787], "mapped", [29436]], [[63788, 63788], "mapped", [37070]], [[63789, 63789], "mapped", [20358]], [[63790, 63790], "mapped", [20919]], [[63791, 63791], "mapped", [21214]], [[63792, 63792], "mapped", [25796]], [[63793, 63793], "mapped", [27347]], [[63794, 63794], "mapped", [29200]], [[63795, 63795], "mapped", [30439]], [[63796, 63796], "mapped", [32769]], [[63797, 63797], "mapped", [34310]], [[63798, 63798], "mapped", [34396]], [[63799, 63799], "mapped", [36335]], [[63800, 63800], "mapped", [38706]], [[63801, 63801], "mapped", [39791]], [[63802, 63802], "mapped", [40442]], [[63803, 63803], "mapped", [30860]], [[63804, 63804], "mapped", [31103]], [[63805, 63805], "mapped", [32160]], [[63806, 63806], "mapped", [33737]], [[63807, 63807], "mapped", [37636]], [[63808, 63808], "mapped", [40575]], [[63809, 63809], "mapped", [35542]], [[63810, 63810], "mapped", [22751]], [[63811, 63811], "mapped", [24324]], [[63812, 63812], "mapped", [31840]], [[63813, 63813], "mapped", [32894]], [[63814, 63814], "mapped", [29282]], [[63815, 63815], "mapped", [30922]], [[63816, 63816], "mapped", [36034]], [[63817, 63817], "mapped", [38647]], [[63818, 63818], "mapped", [22744]], [[63819, 63819], "mapped", [23650]], [[63820, 63820], "mapped", [27155]], [[63821, 63821], "mapped", [28122]], [[63822, 63822], "mapped", [28431]], [[63823, 63823], "mapped", [32047]], [[63824, 63824], "mapped", [32311]], [[63825, 63825], "mapped", [38475]], [[63826, 63826], "mapped", [21202]], [[63827, 63827], "mapped", [32907]], [[63828, 63828], "mapped", [20956]], [[63829, 63829], "mapped", [20940]], [[63830, 63830], "mapped", [31260]], [[63831, 63831], "mapped", [32190]], [[63832, 63832], "mapped", [33777]], [[63833, 63833], "mapped", [38517]], [[63834, 63834], "mapped", [35712]], [[63835, 63835], "mapped", [25295]], [[63836, 63836], "mapped", [27138]], [[63837, 63837], "mapped", [35582]], [[63838, 63838], "mapped", [20025]], [[63839, 63839], "mapped", [23527]], [[63840, 63840], "mapped", [24594]], [[63841, 63841], "mapped", [29575]], [[63842, 63842], "mapped", [30064]], [[63843, 63843], "mapped", [21271]], [[63844, 63844], "mapped", [30971]], [[63845, 63845], "mapped", [20415]], [[63846, 63846], "mapped", [24489]], [[63847, 63847], "mapped", [19981]], [[63848, 63848], "mapped", [27852]], [[63849, 63849], "mapped", [25976]], [[63850, 63850], "mapped", [32034]], [[63851, 63851], "mapped", [21443]], [[63852, 63852], "mapped", [22622]], [[63853, 63853], "mapped", [30465]], [[63854, 63854], "mapped", [33865]], [[63855, 63855], "mapped", [35498]], [[63856, 63856], "mapped", [27578]], [[63857, 63857], "mapped", [36784]], [[63858, 63858], "mapped", [27784]], [[63859, 63859], "mapped", [25342]], [[63860, 63860], "mapped", [33509]], [[63861, 63861], "mapped", [25504]], [[63862, 63862], "mapped", [30053]], [[63863, 63863], "mapped", [20142]], [[63864, 63864], "mapped", [20841]], [[63865, 63865], "mapped", [20937]], [[63866, 63866], "mapped", [26753]], [[63867, 63867], "mapped", [31975]], [[63868, 63868], "mapped", [33391]], [[63869, 63869], "mapped", [35538]], [[63870, 63870], "mapped", [37327]], [[63871, 63871], "mapped", [21237]], [[63872, 63872], "mapped", [21570]], [[63873, 63873], "mapped", [22899]], [[63874, 63874], "mapped", [24300]], [[63875, 63875], "mapped", [26053]], [[63876, 63876], "mapped", [28670]], [[63877, 63877], "mapped", [31018]], [[63878, 63878], "mapped", [38317]], [[63879, 63879], "mapped", [39530]], [[63880, 63880], "mapped", [40599]], [[63881, 63881], "mapped", [40654]], [[63882, 63882], "mapped", [21147]], [[63883, 63883], "mapped", [26310]], [[63884, 63884], "mapped", [27511]], [[63885, 63885], "mapped", [36706]], [[63886, 63886], "mapped", [24180]], [[63887, 63887], "mapped", [24976]], [[63888, 63888], "mapped", [25088]], [[63889, 63889], "mapped", [25754]], [[63890, 63890], "mapped", [28451]], [[63891, 63891], "mapped", [29001]], [[63892, 63892], "mapped", [29833]], [[63893, 63893], "mapped", [31178]], [[63894, 63894], "mapped", [32244]], [[63895, 63895], "mapped", [32879]], [[63896, 63896], "mapped", [36646]], [[63897, 63897], "mapped", [34030]], [[63898, 63898], "mapped", [36899]], [[63899, 63899], "mapped", [37706]], [[63900, 63900], "mapped", [21015]], [[63901, 63901], "mapped", [21155]], [[63902, 63902], "mapped", [21693]], [[63903, 63903], "mapped", [28872]], [[63904, 63904], "mapped", [35010]], [[63905, 63905], "mapped", [35498]], [[63906, 63906], "mapped", [24265]], [[63907, 63907], "mapped", [24565]], [[63908, 63908], "mapped", [25467]], [[63909, 63909], "mapped", [27566]], [[63910, 63910], "mapped", [31806]], [[63911, 63911], "mapped", [29557]], [[63912, 63912], "mapped", [20196]], [[63913, 63913], "mapped", [22265]], [[63914, 63914], "mapped", [23527]], [[63915, 63915], "mapped", [23994]], [[63916, 63916], "mapped", [24604]], [[63917, 63917], "mapped", [29618]], [[63918, 63918], "mapped", [29801]], [[63919, 63919], "mapped", [32666]], [[63920, 63920], "mapped", [32838]], [[63921, 63921], "mapped", [37428]], [[63922, 63922], "mapped", [38646]], [[63923, 63923], "mapped", [38728]], [[63924, 63924], "mapped", [38936]], [[63925, 63925], "mapped", [20363]], [[63926, 63926], "mapped", [31150]], [[63927, 63927], "mapped", [37300]], [[63928, 63928], "mapped", [38584]], [[63929, 63929], "mapped", [24801]], [[63930, 63930], "mapped", [20102]], [[63931, 63931], "mapped", [20698]], [[63932, 63932], "mapped", [23534]], [[63933, 63933], "mapped", [23615]], [[63934, 63934], "mapped", [26009]], [[63935, 63935], "mapped", [27138]], [[63936, 63936], "mapped", [29134]], [[63937, 63937], "mapped", [30274]], [[63938, 63938], "mapped", [34044]], [[63939, 63939], "mapped", [36988]], [[63940, 63940], "mapped", [40845]], [[63941, 63941], "mapped", [26248]], [[63942, 63942], "mapped", [38446]], [[63943, 63943], "mapped", [21129]], [[63944, 63944], "mapped", [26491]], [[63945, 63945], "mapped", [26611]], [[63946, 63946], "mapped", [27969]], [[63947, 63947], "mapped", [28316]], [[63948, 63948], "mapped", [29705]], [[63949, 63949], "mapped", [30041]], [[63950, 63950], "mapped", [30827]], [[63951, 63951], "mapped", [32016]], [[63952, 63952], "mapped", [39006]], [[63953, 63953], "mapped", [20845]], [[63954, 63954], "mapped", [25134]], [[63955, 63955], "mapped", [38520]], [[63956, 63956], "mapped", [20523]], [[63957, 63957], "mapped", [23833]], [[63958, 63958], "mapped", [28138]], [[63959, 63959], "mapped", [36650]], [[63960, 63960], "mapped", [24459]], [[63961, 63961], "mapped", [24900]], [[63962, 63962], "mapped", [26647]], [[63963, 63963], "mapped", [29575]], [[63964, 63964], "mapped", [38534]], [[63965, 63965], "mapped", [21033]], [[63966, 63966], "mapped", [21519]], [[63967, 63967], "mapped", [23653]], [[63968, 63968], "mapped", [26131]], [[63969, 63969], "mapped", [26446]], [[63970, 63970], "mapped", [26792]], [[63971, 63971], "mapped", [27877]], [[63972, 63972], "mapped", [29702]], [[63973, 63973], "mapped", [30178]], [[63974, 63974], "mapped", [32633]], [[63975, 63975], "mapped", [35023]], [[63976, 63976], "mapped", [35041]], [[63977, 63977], "mapped", [37324]], [[63978, 63978], "mapped", [38626]], [[63979, 63979], "mapped", [21311]], [[63980, 63980], "mapped", [28346]], [[63981, 63981], "mapped", [21533]], [[63982, 63982], "mapped", [29136]], [[63983, 63983], "mapped", [29848]], [[63984, 63984], "mapped", [34298]], [[63985, 63985], "mapped", [38563]], [[63986, 63986], "mapped", [40023]], [[63987, 63987], "mapped", [40607]], [[63988, 63988], "mapped", [26519]], [[63989, 63989], "mapped", [28107]], [[63990, 63990], "mapped", [33256]], [[63991, 63991], "mapped", [31435]], [[63992, 63992], "mapped", [31520]], [[63993, 63993], "mapped", [31890]], [[63994, 63994], "mapped", [29376]], [[63995, 63995], "mapped", [28825]], [[63996, 63996], "mapped", [35672]], [[63997, 63997], "mapped", [20160]], [[63998, 63998], "mapped", [33590]], [[63999, 63999], "mapped", [21050]], [[64e3, 64e3], "mapped", [20999]], [[64001, 64001], "mapped", [24230]], [[64002, 64002], "mapped", [25299]], [[64003, 64003], "mapped", [31958]], [[64004, 64004], "mapped", [23429]], [[64005, 64005], "mapped", [27934]], [[64006, 64006], "mapped", [26292]], [[64007, 64007], "mapped", [36667]], [[64008, 64008], "mapped", [34892]], [[64009, 64009], "mapped", [38477]], [[64010, 64010], "mapped", [35211]], [[64011, 64011], "mapped", [24275]], [[64012, 64012], "mapped", [20800]], [[64013, 64013], "mapped", [21952]], [[64014, 64015], "valid"], [[64016, 64016], "mapped", [22618]], [[64017, 64017], "valid"], [[64018, 64018], "mapped", [26228]], [[64019, 64020], "valid"], [[64021, 64021], "mapped", [20958]], [[64022, 64022], "mapped", [29482]], [[64023, 64023], "mapped", [30410]], [[64024, 64024], "mapped", [31036]], [[64025, 64025], "mapped", [31070]], [[64026, 64026], "mapped", [31077]], [[64027, 64027], "mapped", [31119]], [[64028, 64028], "mapped", [38742]], [[64029, 64029], "mapped", [31934]], [[64030, 64030], "mapped", [32701]], [[64031, 64031], "valid"], [[64032, 64032], "mapped", [34322]], [[64033, 64033], "valid"], [[64034, 64034], "mapped", [35576]], [[64035, 64036], "valid"], [[64037, 64037], "mapped", [36920]], [[64038, 64038], "mapped", [37117]], [[64039, 64041], "valid"], [[64042, 64042], "mapped", [39151]], [[64043, 64043], "mapped", [39164]], [[64044, 64044], "mapped", [39208]], [[64045, 64045], "mapped", [40372]], [[64046, 64046], "mapped", [37086]], [[64047, 64047], "mapped", [38583]], [[64048, 64048], "mapped", [20398]], [[64049, 64049], "mapped", [20711]], [[64050, 64050], "mapped", [20813]], [[64051, 64051], "mapped", [21193]], [[64052, 64052], "mapped", [21220]], [[64053, 64053], "mapped", [21329]], [[64054, 64054], "mapped", [21917]], [[64055, 64055], "mapped", [22022]], [[64056, 64056], "mapped", [22120]], [[64057, 64057], "mapped", [22592]], [[64058, 64058], "mapped", [22696]], [[64059, 64059], "mapped", [23652]], [[64060, 64060], "mapped", [23662]], [[64061, 64061], "mapped", [24724]], [[64062, 64062], "mapped", [24936]], [[64063, 64063], "mapped", [24974]], [[64064, 64064], "mapped", [25074]], [[64065, 64065], "mapped", [25935]], [[64066, 64066], "mapped", [26082]], [[64067, 64067], "mapped", [26257]], [[64068, 64068], "mapped", [26757]], [[64069, 64069], "mapped", [28023]], [[64070, 64070], "mapped", [28186]], [[64071, 64071], "mapped", [28450]], [[64072, 64072], "mapped", [29038]], [[64073, 64073], "mapped", [29227]], [[64074, 64074], "mapped", [29730]], [[64075, 64075], "mapped", [30865]], [[64076, 64076], "mapped", [31038]], [[64077, 64077], "mapped", [31049]], [[64078, 64078], "mapped", [31048]], [[64079, 64079], "mapped", [31056]], [[64080, 64080], "mapped", [31062]], [[64081, 64081], "mapped", [31069]], [[64082, 64082], "mapped", [31117]], [[64083, 64083], "mapped", [31118]], [[64084, 64084], "mapped", [31296]], [[64085, 64085], "mapped", [31361]], [[64086, 64086], "mapped", [31680]], [[64087, 64087], "mapped", [32244]], [[64088, 64088], "mapped", [32265]], [[64089, 64089], "mapped", [32321]], [[64090, 64090], "mapped", [32626]], [[64091, 64091], "mapped", [32773]], [[64092, 64092], "mapped", [33261]], [[64093, 64094], "mapped", [33401]], [[64095, 64095], "mapped", [33879]], [[64096, 64096], "mapped", [35088]], [[64097, 64097], "mapped", [35222]], [[64098, 64098], "mapped", [35585]], [[64099, 64099], "mapped", [35641]], [[64100, 64100], "mapped", [36051]], [[64101, 64101], "mapped", [36104]], [[64102, 64102], "mapped", [36790]], [[64103, 64103], "mapped", [36920]], [[64104, 64104], "mapped", [38627]], [[64105, 64105], "mapped", [38911]], [[64106, 64106], "mapped", [38971]], [[64107, 64107], "mapped", [24693]], [[64108, 64108], "mapped", [148206]], [[64109, 64109], "mapped", [33304]], [[64110, 64111], "disallowed"], [[64112, 64112], "mapped", [20006]], [[64113, 64113], "mapped", [20917]], [[64114, 64114], "mapped", [20840]], [[64115, 64115], "mapped", [20352]], [[64116, 64116], "mapped", [20805]], [[64117, 64117], "mapped", [20864]], [[64118, 64118], "mapped", [21191]], [[64119, 64119], "mapped", [21242]], [[64120, 64120], "mapped", [21917]], [[64121, 64121], "mapped", [21845]], [[64122, 64122], "mapped", [21913]], [[64123, 64123], "mapped", [21986]], [[64124, 64124], "mapped", [22618]], [[64125, 64125], "mapped", [22707]], [[64126, 64126], "mapped", [22852]], [[64127, 64127], "mapped", [22868]], [[64128, 64128], "mapped", [23138]], [[64129, 64129], "mapped", [23336]], [[64130, 64130], "mapped", [24274]], [[64131, 64131], "mapped", [24281]], [[64132, 64132], "mapped", [24425]], [[64133, 64133], "mapped", [24493]], [[64134, 64134], "mapped", [24792]], [[64135, 64135], "mapped", [24910]], [[64136, 64136], "mapped", [24840]], [[64137, 64137], "mapped", [24974]], [[64138, 64138], "mapped", [24928]], [[64139, 64139], "mapped", [25074]], [[64140, 64140], "mapped", [25140]], [[64141, 64141], "mapped", [25540]], [[64142, 64142], "mapped", [25628]], [[64143, 64143], "mapped", [25682]], [[64144, 64144], "mapped", [25942]], [[64145, 64145], "mapped", [26228]], [[64146, 64146], "mapped", [26391]], [[64147, 64147], "mapped", [26395]], [[64148, 64148], "mapped", [26454]], [[64149, 64149], "mapped", [27513]], [[64150, 64150], "mapped", [27578]], [[64151, 64151], "mapped", [27969]], [[64152, 64152], "mapped", [28379]], [[64153, 64153], "mapped", [28363]], [[64154, 64154], "mapped", [28450]], [[64155, 64155], "mapped", [28702]], [[64156, 64156], "mapped", [29038]], [[64157, 64157], "mapped", [30631]], [[64158, 64158], "mapped", [29237]], [[64159, 64159], "mapped", [29359]], [[64160, 64160], "mapped", [29482]], [[64161, 64161], "mapped", [29809]], [[64162, 64162], "mapped", [29958]], [[64163, 64163], "mapped", [30011]], [[64164, 64164], "mapped", [30237]], [[64165, 64165], "mapped", [30239]], [[64166, 64166], "mapped", [30410]], [[64167, 64167], "mapped", [30427]], [[64168, 64168], "mapped", [30452]], [[64169, 64169], "mapped", [30538]], [[64170, 64170], "mapped", [30528]], [[64171, 64171], "mapped", [30924]], [[64172, 64172], "mapped", [31409]], [[64173, 64173], "mapped", [31680]], [[64174, 64174], "mapped", [31867]], [[64175, 64175], "mapped", [32091]], [[64176, 64176], "mapped", [32244]], [[64177, 64177], "mapped", [32574]], [[64178, 64178], "mapped", [32773]], [[64179, 64179], "mapped", [33618]], [[64180, 64180], "mapped", [33775]], [[64181, 64181], "mapped", [34681]], [[64182, 64182], "mapped", [35137]], [[64183, 64183], "mapped", [35206]], [[64184, 64184], "mapped", [35222]], [[64185, 64185], "mapped", [35519]], [[64186, 64186], "mapped", [35576]], [[64187, 64187], "mapped", [35531]], [[64188, 64188], "mapped", [35585]], [[64189, 64189], "mapped", [35582]], [[64190, 64190], "mapped", [35565]], [[64191, 64191], "mapped", [35641]], [[64192, 64192], "mapped", [35722]], [[64193, 64193], "mapped", [36104]], [[64194, 64194], "mapped", [36664]], [[64195, 64195], "mapped", [36978]], [[64196, 64196], "mapped", [37273]], [[64197, 64197], "mapped", [37494]], [[64198, 64198], "mapped", [38524]], [[64199, 64199], "mapped", [38627]], [[64200, 64200], "mapped", [38742]], [[64201, 64201], "mapped", [38875]], [[64202, 64202], "mapped", [38911]], [[64203, 64203], "mapped", [38923]], [[64204, 64204], "mapped", [38971]], [[64205, 64205], "mapped", [39698]], [[64206, 64206], "mapped", [40860]], [[64207, 64207], "mapped", [141386]], [[64208, 64208], "mapped", [141380]], [[64209, 64209], "mapped", [144341]], [[64210, 64210], "mapped", [15261]], [[64211, 64211], "mapped", [16408]], [[64212, 64212], "mapped", [16441]], [[64213, 64213], "mapped", [152137]], [[64214, 64214], "mapped", [154832]], [[64215, 64215], "mapped", [163539]], [[64216, 64216], "mapped", [40771]], [[64217, 64217], "mapped", [40846]], [[64218, 64255], "disallowed"], [[64256, 64256], "mapped", [102, 102]], [[64257, 64257], "mapped", [102, 105]], [[64258, 64258], "mapped", [102, 108]], [[64259, 64259], "mapped", [102, 102, 105]], [[64260, 64260], "mapped", [102, 102, 108]], [[64261, 64262], "mapped", [115, 116]], [[64263, 64274], "disallowed"], [[64275, 64275], "mapped", [1396, 1398]], [[64276, 64276], "mapped", [1396, 1381]], [[64277, 64277], "mapped", [1396, 1387]], [[64278, 64278], "mapped", [1406, 1398]], [[64279, 64279], "mapped", [1396, 1389]], [[64280, 64284], "disallowed"], [[64285, 64285], "mapped", [1497, 1460]], [[64286, 64286], "valid"], [[64287, 64287], "mapped", [1522, 1463]], [[64288, 64288], "mapped", [1506]], [[64289, 64289], "mapped", [1488]], [[64290, 64290], "mapped", [1491]], [[64291, 64291], "mapped", [1492]], [[64292, 64292], "mapped", [1499]], [[64293, 64293], "mapped", [1500]], [[64294, 64294], "mapped", [1501]], [[64295, 64295], "mapped", [1512]], [[64296, 64296], "mapped", [1514]], [[64297, 64297], "disallowed_STD3_mapped", [43]], [[64298, 64298], "mapped", [1513, 1473]], [[64299, 64299], "mapped", [1513, 1474]], [[64300, 64300], "mapped", [1513, 1468, 1473]], [[64301, 64301], "mapped", [1513, 1468, 1474]], [[64302, 64302], "mapped", [1488, 1463]], [[64303, 64303], "mapped", [1488, 1464]], [[64304, 64304], "mapped", [1488, 1468]], [[64305, 64305], "mapped", [1489, 1468]], [[64306, 64306], "mapped", [1490, 1468]], [[64307, 64307], "mapped", [1491, 1468]], [[64308, 64308], "mapped", [1492, 1468]], [[64309, 64309], "mapped", [1493, 1468]], [[64310, 64310], "mapped", [1494, 1468]], [[64311, 64311], "disallowed"], [[64312, 64312], "mapped", [1496, 1468]], [[64313, 64313], "mapped", [1497, 1468]], [[64314, 64314], "mapped", [1498, 1468]], [[64315, 64315], "mapped", [1499, 1468]], [[64316, 64316], "mapped", [1500, 1468]], [[64317, 64317], "disallowed"], [[64318, 64318], "mapped", [1502, 1468]], [[64319, 64319], "disallowed"], [[64320, 64320], "mapped", [1504, 1468]], [[64321, 64321], "mapped", [1505, 1468]], [[64322, 64322], "disallowed"], [[64323, 64323], "mapped", [1507, 1468]], [[64324, 64324], "mapped", [1508, 1468]], [[64325, 64325], "disallowed"], [[64326, 64326], "mapped", [1510, 1468]], [[64327, 64327], "mapped", [1511, 1468]], [[64328, 64328], "mapped", [1512, 1468]], [[64329, 64329], "mapped", [1513, 1468]], [[64330, 64330], "mapped", [1514, 1468]], [[64331, 64331], "mapped", [1493, 1465]], [[64332, 64332], "mapped", [1489, 1471]], [[64333, 64333], "mapped", [1499, 1471]], [[64334, 64334], "mapped", [1508, 1471]], [[64335, 64335], "mapped", [1488, 1500]], [[64336, 64337], "mapped", [1649]], [[64338, 64341], "mapped", [1659]], [[64342, 64345], "mapped", [1662]], [[64346, 64349], "mapped", [1664]], [[64350, 64353], "mapped", [1658]], [[64354, 64357], "mapped", [1663]], [[64358, 64361], "mapped", [1657]], [[64362, 64365], "mapped", [1700]], [[64366, 64369], "mapped", [1702]], [[64370, 64373], "mapped", [1668]], [[64374, 64377], "mapped", [1667]], [[64378, 64381], "mapped", [1670]], [[64382, 64385], "mapped", [1671]], [[64386, 64387], "mapped", [1677]], [[64388, 64389], "mapped", [1676]], [[64390, 64391], "mapped", [1678]], [[64392, 64393], "mapped", [1672]], [[64394, 64395], "mapped", [1688]], [[64396, 64397], "mapped", [1681]], [[64398, 64401], "mapped", [1705]], [[64402, 64405], "mapped", [1711]], [[64406, 64409], "mapped", [1715]], [[64410, 64413], "mapped", [1713]], [[64414, 64415], "mapped", [1722]], [[64416, 64419], "mapped", [1723]], [[64420, 64421], "mapped", [1728]], [[64422, 64425], "mapped", [1729]], [[64426, 64429], "mapped", [1726]], [[64430, 64431], "mapped", [1746]], [[64432, 64433], "mapped", [1747]], [[64434, 64449], "valid", [], "NV8"], [[64450, 64466], "disallowed"], [[64467, 64470], "mapped", [1709]], [[64471, 64472], "mapped", [1735]], [[64473, 64474], "mapped", [1734]], [[64475, 64476], "mapped", [1736]], [[64477, 64477], "mapped", [1735, 1652]], [[64478, 64479], "mapped", [1739]], [[64480, 64481], "mapped", [1733]], [[64482, 64483], "mapped", [1737]], [[64484, 64487], "mapped", [1744]], [[64488, 64489], "mapped", [1609]], [[64490, 64491], "mapped", [1574, 1575]], [[64492, 64493], "mapped", [1574, 1749]], [[64494, 64495], "mapped", [1574, 1608]], [[64496, 64497], "mapped", [1574, 1735]], [[64498, 64499], "mapped", [1574, 1734]], [[64500, 64501], "mapped", [1574, 1736]], [[64502, 64504], "mapped", [1574, 1744]], [[64505, 64507], "mapped", [1574, 1609]], [[64508, 64511], "mapped", [1740]], [[64512, 64512], "mapped", [1574, 1580]], [[64513, 64513], "mapped", [1574, 1581]], [[64514, 64514], "mapped", [1574, 1605]], [[64515, 64515], "mapped", [1574, 1609]], [[64516, 64516], "mapped", [1574, 1610]], [[64517, 64517], "mapped", [1576, 1580]], [[64518, 64518], "mapped", [1576, 1581]], [[64519, 64519], "mapped", [1576, 1582]], [[64520, 64520], "mapped", [1576, 1605]], [[64521, 64521], "mapped", [1576, 1609]], [[64522, 64522], "mapped", [1576, 1610]], [[64523, 64523], "mapped", [1578, 1580]], [[64524, 64524], "mapped", [1578, 1581]], [[64525, 64525], "mapped", [1578, 1582]], [[64526, 64526], "mapped", [1578, 1605]], [[64527, 64527], "mapped", [1578, 1609]], [[64528, 64528], "mapped", [1578, 1610]], [[64529, 64529], "mapped", [1579, 1580]], [[64530, 64530], "mapped", [1579, 1605]], [[64531, 64531], "mapped", [1579, 1609]], [[64532, 64532], "mapped", [1579, 1610]], [[64533, 64533], "mapped", [1580, 1581]], [[64534, 64534], "mapped", [1580, 1605]], [[64535, 64535], "mapped", [1581, 1580]], [[64536, 64536], "mapped", [1581, 1605]], [[64537, 64537], "mapped", [1582, 1580]], [[64538, 64538], "mapped", [1582, 1581]], [[64539, 64539], "mapped", [1582, 1605]], [[64540, 64540], "mapped", [1587, 1580]], [[64541, 64541], "mapped", [1587, 1581]], [[64542, 64542], "mapped", [1587, 1582]], [[64543, 64543], "mapped", [1587, 1605]], [[64544, 64544], "mapped", [1589, 1581]], [[64545, 64545], "mapped", [1589, 1605]], [[64546, 64546], "mapped", [1590, 1580]], [[64547, 64547], "mapped", [1590, 1581]], [[64548, 64548], "mapped", [1590, 1582]], [[64549, 64549], "mapped", [1590, 1605]], [[64550, 64550], "mapped", [1591, 1581]], [[64551, 64551], "mapped", [1591, 1605]], [[64552, 64552], "mapped", [1592, 1605]], [[64553, 64553], "mapped", [1593, 1580]], [[64554, 64554], "mapped", [1593, 1605]], [[64555, 64555], "mapped", [1594, 1580]], [[64556, 64556], "mapped", [1594, 1605]], [[64557, 64557], "mapped", [1601, 1580]], [[64558, 64558], "mapped", [1601, 1581]], [[64559, 64559], "mapped", [1601, 1582]], [[64560, 64560], "mapped", [1601, 1605]], [[64561, 64561], "mapped", [1601, 1609]], [[64562, 64562], "mapped", [1601, 1610]], [[64563, 64563], "mapped", [1602, 1581]], [[64564, 64564], "mapped", [1602, 1605]], [[64565, 64565], "mapped", [1602, 1609]], [[64566, 64566], "mapped", [1602, 1610]], [[64567, 64567], "mapped", [1603, 1575]], [[64568, 64568], "mapped", [1603, 1580]], [[64569, 64569], "mapped", [1603, 1581]], [[64570, 64570], "mapped", [1603, 1582]], [[64571, 64571], "mapped", [1603, 1604]], [[64572, 64572], "mapped", [1603, 1605]], [[64573, 64573], "mapped", [1603, 1609]], [[64574, 64574], "mapped", [1603, 1610]], [[64575, 64575], "mapped", [1604, 1580]], [[64576, 64576], "mapped", [1604, 1581]], [[64577, 64577], "mapped", [1604, 1582]], [[64578, 64578], "mapped", [1604, 1605]], [[64579, 64579], "mapped", [1604, 1609]], [[64580, 64580], "mapped", [1604, 1610]], [[64581, 64581], "mapped", [1605, 1580]], [[64582, 64582], "mapped", [1605, 1581]], [[64583, 64583], "mapped", [1605, 1582]], [[64584, 64584], "mapped", [1605, 1605]], [[64585, 64585], "mapped", [1605, 1609]], [[64586, 64586], "mapped", [1605, 1610]], [[64587, 64587], "mapped", [1606, 1580]], [[64588, 64588], "mapped", [1606, 1581]], [[64589, 64589], "mapped", [1606, 1582]], [[64590, 64590], "mapped", [1606, 1605]], [[64591, 64591], "mapped", [1606, 1609]], [[64592, 64592], "mapped", [1606, 1610]], [[64593, 64593], "mapped", [1607, 1580]], [[64594, 64594], "mapped", [1607, 1605]], [[64595, 64595], "mapped", [1607, 1609]], [[64596, 64596], "mapped", [1607, 1610]], [[64597, 64597], "mapped", [1610, 1580]], [[64598, 64598], "mapped", [1610, 1581]], [[64599, 64599], "mapped", [1610, 1582]], [[64600, 64600], "mapped", [1610, 1605]], [[64601, 64601], "mapped", [1610, 1609]], [[64602, 64602], "mapped", [1610, 1610]], [[64603, 64603], "mapped", [1584, 1648]], [[64604, 64604], "mapped", [1585, 1648]], [[64605, 64605], "mapped", [1609, 1648]], [[64606, 64606], "disallowed_STD3_mapped", [32, 1612, 1617]], [[64607, 64607], "disallowed_STD3_mapped", [32, 1613, 1617]], [[64608, 64608], "disallowed_STD3_mapped", [32, 1614, 1617]], [[64609, 64609], "disallowed_STD3_mapped", [32, 1615, 1617]], [[64610, 64610], "disallowed_STD3_mapped", [32, 1616, 1617]], [[64611, 64611], "disallowed_STD3_mapped", [32, 1617, 1648]], [[64612, 64612], "mapped", [1574, 1585]], [[64613, 64613], "mapped", [1574, 1586]], [[64614, 64614], "mapped", [1574, 1605]], [[64615, 64615], "mapped", [1574, 1606]], [[64616, 64616], "mapped", [1574, 1609]], [[64617, 64617], "mapped", [1574, 1610]], [[64618, 64618], "mapped", [1576, 1585]], [[64619, 64619], "mapped", [1576, 1586]], [[64620, 64620], "mapped", [1576, 1605]], [[64621, 64621], "mapped", [1576, 1606]], [[64622, 64622], "mapped", [1576, 1609]], [[64623, 64623], "mapped", [1576, 1610]], [[64624, 64624], "mapped", [1578, 1585]], [[64625, 64625], "mapped", [1578, 1586]], [[64626, 64626], "mapped", [1578, 1605]], [[64627, 64627], "mapped", [1578, 1606]], [[64628, 64628], "mapped", [1578, 1609]], [[64629, 64629], "mapped", [1578, 1610]], [[64630, 64630], "mapped", [1579, 1585]], [[64631, 64631], "mapped", [1579, 1586]], [[64632, 64632], "mapped", [1579, 1605]], [[64633, 64633], "mapped", [1579, 1606]], [[64634, 64634], "mapped", [1579, 1609]], [[64635, 64635], "mapped", [1579, 1610]], [[64636, 64636], "mapped", [1601, 1609]], [[64637, 64637], "mapped", [1601, 1610]], [[64638, 64638], "mapped", [1602, 1609]], [[64639, 64639], "mapped", [1602, 1610]], [[64640, 64640], "mapped", [1603, 1575]], [[64641, 64641], "mapped", [1603, 1604]], [[64642, 64642], "mapped", [1603, 1605]], [[64643, 64643], "mapped", [1603, 1609]], [[64644, 64644], "mapped", [1603, 1610]], [[64645, 64645], "mapped", [1604, 1605]], [[64646, 64646], "mapped", [1604, 1609]], [[64647, 64647], "mapped", [1604, 1610]], [[64648, 64648], "mapped", [1605, 1575]], [[64649, 64649], "mapped", [1605, 1605]], [[64650, 64650], "mapped", [1606, 1585]], [[64651, 64651], "mapped", [1606, 1586]], [[64652, 64652], "mapped", [1606, 1605]], [[64653, 64653], "mapped", [1606, 1606]], [[64654, 64654], "mapped", [1606, 1609]], [[64655, 64655], "mapped", [1606, 1610]], [[64656, 64656], "mapped", [1609, 1648]], [[64657, 64657], "mapped", [1610, 1585]], [[64658, 64658], "mapped", [1610, 1586]], [[64659, 64659], "mapped", [1610, 1605]], [[64660, 64660], "mapped", [1610, 1606]], [[64661, 64661], "mapped", [1610, 1609]], [[64662, 64662], "mapped", [1610, 1610]], [[64663, 64663], "mapped", [1574, 1580]], [[64664, 64664], "mapped", [1574, 1581]], [[64665, 64665], "mapped", [1574, 1582]], [[64666, 64666], "mapped", [1574, 1605]], [[64667, 64667], "mapped", [1574, 1607]], [[64668, 64668], "mapped", [1576, 1580]], [[64669, 64669], "mapped", [1576, 1581]], [[64670, 64670], "mapped", [1576, 1582]], [[64671, 64671], "mapped", [1576, 1605]], [[64672, 64672], "mapped", [1576, 1607]], [[64673, 64673], "mapped", [1578, 1580]], [[64674, 64674], "mapped", [1578, 1581]], [[64675, 64675], "mapped", [1578, 1582]], [[64676, 64676], "mapped", [1578, 1605]], [[64677, 64677], "mapped", [1578, 1607]], [[64678, 64678], "mapped", [1579, 1605]], [[64679, 64679], "mapped", [1580, 1581]], [[64680, 64680], "mapped", [1580, 1605]], [[64681, 64681], "mapped", [1581, 1580]], [[64682, 64682], "mapped", [1581, 1605]], [[64683, 64683], "mapped", [1582, 1580]], [[64684, 64684], "mapped", [1582, 1605]], [[64685, 64685], "mapped", [1587, 1580]], [[64686, 64686], "mapped", [1587, 1581]], [[64687, 64687], "mapped", [1587, 1582]], [[64688, 64688], "mapped", [1587, 1605]], [[64689, 64689], "mapped", [1589, 1581]], [[64690, 64690], "mapped", [1589, 1582]], [[64691, 64691], "mapped", [1589, 1605]], [[64692, 64692], "mapped", [1590, 1580]], [[64693, 64693], "mapped", [1590, 1581]], [[64694, 64694], "mapped", [1590, 1582]], [[64695, 64695], "mapped", [1590, 1605]], [[64696, 64696], "mapped", [1591, 1581]], [[64697, 64697], "mapped", [1592, 1605]], [[64698, 64698], "mapped", [1593, 1580]], [[64699, 64699], "mapped", [1593, 1605]], [[64700, 64700], "mapped", [1594, 1580]], [[64701, 64701], "mapped", [1594, 1605]], [[64702, 64702], "mapped", [1601, 1580]], [[64703, 64703], "mapped", [1601, 1581]], [[64704, 64704], "mapped", [1601, 1582]], [[64705, 64705], "mapped", [1601, 1605]], [[64706, 64706], "mapped", [1602, 1581]], [[64707, 64707], "mapped", [1602, 1605]], [[64708, 64708], "mapped", [1603, 1580]], [[64709, 64709], "mapped", [1603, 1581]], [[64710, 64710], "mapped", [1603, 1582]], [[64711, 64711], "mapped", [1603, 1604]], [[64712, 64712], "mapped", [1603, 1605]], [[64713, 64713], "mapped", [1604, 1580]], [[64714, 64714], "mapped", [1604, 1581]], [[64715, 64715], "mapped", [1604, 1582]], [[64716, 64716], "mapped", [1604, 1605]], [[64717, 64717], "mapped", [1604, 1607]], [[64718, 64718], "mapped", [1605, 1580]], [[64719, 64719], "mapped", [1605, 1581]], [[64720, 64720], "mapped", [1605, 1582]], [[64721, 64721], "mapped", [1605, 1605]], [[64722, 64722], "mapped", [1606, 1580]], [[64723, 64723], "mapped", [1606, 1581]], [[64724, 64724], "mapped", [1606, 1582]], [[64725, 64725], "mapped", [1606, 1605]], [[64726, 64726], "mapped", [1606, 1607]], [[64727, 64727], "mapped", [1607, 1580]], [[64728, 64728], "mapped", [1607, 1605]], [[64729, 64729], "mapped", [1607, 1648]], [[64730, 64730], "mapped", [1610, 1580]], [[64731, 64731], "mapped", [1610, 1581]], [[64732, 64732], "mapped", [1610, 1582]], [[64733, 64733], "mapped", [1610, 1605]], [[64734, 64734], "mapped", [1610, 1607]], [[64735, 64735], "mapped", [1574, 1605]], [[64736, 64736], "mapped", [1574, 1607]], [[64737, 64737], "mapped", [1576, 1605]], [[64738, 64738], "mapped", [1576, 1607]], [[64739, 64739], "mapped", [1578, 1605]], [[64740, 64740], "mapped", [1578, 1607]], [[64741, 64741], "mapped", [1579, 1605]], [[64742, 64742], "mapped", [1579, 1607]], [[64743, 64743], "mapped", [1587, 1605]], [[64744, 64744], "mapped", [1587, 1607]], [[64745, 64745], "mapped", [1588, 1605]], [[64746, 64746], "mapped", [1588, 1607]], [[64747, 64747], "mapped", [1603, 1604]], [[64748, 64748], "mapped", [1603, 1605]], [[64749, 64749], "mapped", [1604, 1605]], [[64750, 64750], "mapped", [1606, 1605]], [[64751, 64751], "mapped", [1606, 1607]], [[64752, 64752], "mapped", [1610, 1605]], [[64753, 64753], "mapped", [1610, 1607]], [[64754, 64754], "mapped", [1600, 1614, 1617]], [[64755, 64755], "mapped", [1600, 1615, 1617]], [[64756, 64756], "mapped", [1600, 1616, 1617]], [[64757, 64757], "mapped", [1591, 1609]], [[64758, 64758], "mapped", [1591, 1610]], [[64759, 64759], "mapped", [1593, 1609]], [[64760, 64760], "mapped", [1593, 1610]], [[64761, 64761], "mapped", [1594, 1609]], [[64762, 64762], "mapped", [1594, 1610]], [[64763, 64763], "mapped", [1587, 1609]], [[64764, 64764], "mapped", [1587, 1610]], [[64765, 64765], "mapped", [1588, 1609]], [[64766, 64766], "mapped", [1588, 1610]], [[64767, 64767], "mapped", [1581, 1609]], [[64768, 64768], "mapped", [1581, 1610]], [[64769, 64769], "mapped", [1580, 1609]], [[64770, 64770], "mapped", [1580, 1610]], [[64771, 64771], "mapped", [1582, 1609]], [[64772, 64772], "mapped", [1582, 1610]], [[64773, 64773], "mapped", [1589, 1609]], [[64774, 64774], "mapped", [1589, 1610]], [[64775, 64775], "mapped", [1590, 1609]], [[64776, 64776], "mapped", [1590, 1610]], [[64777, 64777], "mapped", [1588, 1580]], [[64778, 64778], "mapped", [1588, 1581]], [[64779, 64779], "mapped", [1588, 1582]], [[64780, 64780], "mapped", [1588, 1605]], [[64781, 64781], "mapped", [1588, 1585]], [[64782, 64782], "mapped", [1587, 1585]], [[64783, 64783], "mapped", [1589, 1585]], [[64784, 64784], "mapped", [1590, 1585]], [[64785, 64785], "mapped", [1591, 1609]], [[64786, 64786], "mapped", [1591, 1610]], [[64787, 64787], "mapped", [1593, 1609]], [[64788, 64788], "mapped", [1593, 1610]], [[64789, 64789], "mapped", [1594, 1609]], [[64790, 64790], "mapped", [1594, 1610]], [[64791, 64791], "mapped", [1587, 1609]], [[64792, 64792], "mapped", [1587, 1610]], [[64793, 64793], "mapped", [1588, 1609]], [[64794, 64794], "mapped", [1588, 1610]], [[64795, 64795], "mapped", [1581, 1609]], [[64796, 64796], "mapped", [1581, 1610]], [[64797, 64797], "mapped", [1580, 1609]], [[64798, 64798], "mapped", [1580, 1610]], [[64799, 64799], "mapped", [1582, 1609]], [[64800, 64800], "mapped", [1582, 1610]], [[64801, 64801], "mapped", [1589, 1609]], [[64802, 64802], "mapped", [1589, 1610]], [[64803, 64803], "mapped", [1590, 1609]], [[64804, 64804], "mapped", [1590, 1610]], [[64805, 64805], "mapped", [1588, 1580]], [[64806, 64806], "mapped", [1588, 1581]], [[64807, 64807], "mapped", [1588, 1582]], [[64808, 64808], "mapped", [1588, 1605]], [[64809, 64809], "mapped", [1588, 1585]], [[64810, 64810], "mapped", [1587, 1585]], [[64811, 64811], "mapped", [1589, 1585]], [[64812, 64812], "mapped", [1590, 1585]], [[64813, 64813], "mapped", [1588, 1580]], [[64814, 64814], "mapped", [1588, 1581]], [[64815, 64815], "mapped", [1588, 1582]], [[64816, 64816], "mapped", [1588, 1605]], [[64817, 64817], "mapped", [1587, 1607]], [[64818, 64818], "mapped", [1588, 1607]], [[64819, 64819], "mapped", [1591, 1605]], [[64820, 64820], "mapped", [1587, 1580]], [[64821, 64821], "mapped", [1587, 1581]], [[64822, 64822], "mapped", [1587, 1582]], [[64823, 64823], "mapped", [1588, 1580]], [[64824, 64824], "mapped", [1588, 1581]], [[64825, 64825], "mapped", [1588, 1582]], [[64826, 64826], "mapped", [1591, 1605]], [[64827, 64827], "mapped", [1592, 1605]], [[64828, 64829], "mapped", [1575, 1611]], [[64830, 64831], "valid", [], "NV8"], [[64832, 64847], "disallowed"], [[64848, 64848], "mapped", [1578, 1580, 1605]], [[64849, 64850], "mapped", [1578, 1581, 1580]], [[64851, 64851], "mapped", [1578, 1581, 1605]], [[64852, 64852], "mapped", [1578, 1582, 1605]], [[64853, 64853], "mapped", [1578, 1605, 1580]], [[64854, 64854], "mapped", [1578, 1605, 1581]], [[64855, 64855], "mapped", [1578, 1605, 1582]], [[64856, 64857], "mapped", [1580, 1605, 1581]], [[64858, 64858], "mapped", [1581, 1605, 1610]], [[64859, 64859], "mapped", [1581, 1605, 1609]], [[64860, 64860], "mapped", [1587, 1581, 1580]], [[64861, 64861], "mapped", [1587, 1580, 1581]], [[64862, 64862], "mapped", [1587, 1580, 1609]], [[64863, 64864], "mapped", [1587, 1605, 1581]], [[64865, 64865], "mapped", [1587, 1605, 1580]], [[64866, 64867], "mapped", [1587, 1605, 1605]], [[64868, 64869], "mapped", [1589, 1581, 1581]], [[64870, 64870], "mapped", [1589, 1605, 1605]], [[64871, 64872], "mapped", [1588, 1581, 1605]], [[64873, 64873], "mapped", [1588, 1580, 1610]], [[64874, 64875], "mapped", [1588, 1605, 1582]], [[64876, 64877], "mapped", [1588, 1605, 1605]], [[64878, 64878], "mapped", [1590, 1581, 1609]], [[64879, 64880], "mapped", [1590, 1582, 1605]], [[64881, 64882], "mapped", [1591, 1605, 1581]], [[64883, 64883], "mapped", [1591, 1605, 1605]], [[64884, 64884], "mapped", [1591, 1605, 1610]], [[64885, 64885], "mapped", [1593, 1580, 1605]], [[64886, 64887], "mapped", [1593, 1605, 1605]], [[64888, 64888], "mapped", [1593, 1605, 1609]], [[64889, 64889], "mapped", [1594, 1605, 1605]], [[64890, 64890], "mapped", [1594, 1605, 1610]], [[64891, 64891], "mapped", [1594, 1605, 1609]], [[64892, 64893], "mapped", [1601, 1582, 1605]], [[64894, 64894], "mapped", [1602, 1605, 1581]], [[64895, 64895], "mapped", [1602, 1605, 1605]], [[64896, 64896], "mapped", [1604, 1581, 1605]], [[64897, 64897], "mapped", [1604, 1581, 1610]], [[64898, 64898], "mapped", [1604, 1581, 1609]], [[64899, 64900], "mapped", [1604, 1580, 1580]], [[64901, 64902], "mapped", [1604, 1582, 1605]], [[64903, 64904], "mapped", [1604, 1605, 1581]], [[64905, 64905], "mapped", [1605, 1581, 1580]], [[64906, 64906], "mapped", [1605, 1581, 1605]], [[64907, 64907], "mapped", [1605, 1581, 1610]], [[64908, 64908], "mapped", [1605, 1580, 1581]], [[64909, 64909], "mapped", [1605, 1580, 1605]], [[64910, 64910], "mapped", [1605, 1582, 1580]], [[64911, 64911], "mapped", [1605, 1582, 1605]], [[64912, 64913], "disallowed"], [[64914, 64914], "mapped", [1605, 1580, 1582]], [[64915, 64915], "mapped", [1607, 1605, 1580]], [[64916, 64916], "mapped", [1607, 1605, 1605]], [[64917, 64917], "mapped", [1606, 1581, 1605]], [[64918, 64918], "mapped", [1606, 1581, 1609]], [[64919, 64920], "mapped", [1606, 1580, 1605]], [[64921, 64921], "mapped", [1606, 1580, 1609]], [[64922, 64922], "mapped", [1606, 1605, 1610]], [[64923, 64923], "mapped", [1606, 1605, 1609]], [[64924, 64925], "mapped", [1610, 1605, 1605]], [[64926, 64926], "mapped", [1576, 1582, 1610]], [[64927, 64927], "mapped", [1578, 1580, 1610]], [[64928, 64928], "mapped", [1578, 1580, 1609]], [[64929, 64929], "mapped", [1578, 1582, 1610]], [[64930, 64930], "mapped", [1578, 1582, 1609]], [[64931, 64931], "mapped", [1578, 1605, 1610]], [[64932, 64932], "mapped", [1578, 1605, 1609]], [[64933, 64933], "mapped", [1580, 1605, 1610]], [[64934, 64934], "mapped", [1580, 1581, 1609]], [[64935, 64935], "mapped", [1580, 1605, 1609]], [[64936, 64936], "mapped", [1587, 1582, 1609]], [[64937, 64937], "mapped", [1589, 1581, 1610]], [[64938, 64938], "mapped", [1588, 1581, 1610]], [[64939, 64939], "mapped", [1590, 1581, 1610]], [[64940, 64940], "mapped", [1604, 1580, 1610]], [[64941, 64941], "mapped", [1604, 1605, 1610]], [[64942, 64942], "mapped", [1610, 1581, 1610]], [[64943, 64943], "mapped", [1610, 1580, 1610]], [[64944, 64944], "mapped", [1610, 1605, 1610]], [[64945, 64945], "mapped", [1605, 1605, 1610]], [[64946, 64946], "mapped", [1602, 1605, 1610]], [[64947, 64947], "mapped", [1606, 1581, 1610]], [[64948, 64948], "mapped", [1602, 1605, 1581]], [[64949, 64949], "mapped", [1604, 1581, 1605]], [[64950, 64950], "mapped", [1593, 1605, 1610]], [[64951, 64951], "mapped", [1603, 1605, 1610]], [[64952, 64952], "mapped", [1606, 1580, 1581]], [[64953, 64953], "mapped", [1605, 1582, 1610]], [[64954, 64954], "mapped", [1604, 1580, 1605]], [[64955, 64955], "mapped", [1603, 1605, 1605]], [[64956, 64956], "mapped", [1604, 1580, 1605]], [[64957, 64957], "mapped", [1606, 1580, 1581]], [[64958, 64958], "mapped", [1580, 1581, 1610]], [[64959, 64959], "mapped", [1581, 1580, 1610]], [[64960, 64960], "mapped", [1605, 1580, 1610]], [[64961, 64961], "mapped", [1601, 1605, 1610]], [[64962, 64962], "mapped", [1576, 1581, 1610]], [[64963, 64963], "mapped", [1603, 1605, 1605]], [[64964, 64964], "mapped", [1593, 1580, 1605]], [[64965, 64965], "mapped", [1589, 1605, 1605]], [[64966, 64966], "mapped", [1587, 1582, 1610]], [[64967, 64967], "mapped", [1606, 1580, 1610]], [[64968, 64975], "disallowed"], [[64976, 65007], "disallowed"], [[65008, 65008], "mapped", [1589, 1604, 1746]], [[65009, 65009], "mapped", [1602, 1604, 1746]], [[65010, 65010], "mapped", [1575, 1604, 1604, 1607]], [[65011, 65011], "mapped", [1575, 1603, 1576, 1585]], [[65012, 65012], "mapped", [1605, 1581, 1605, 1583]], [[65013, 65013], "mapped", [1589, 1604, 1593, 1605]], [[65014, 65014], "mapped", [1585, 1587, 1608, 1604]], [[65015, 65015], "mapped", [1593, 1604, 1610, 1607]], [[65016, 65016], "mapped", [1608, 1587, 1604, 1605]], [[65017, 65017], "mapped", [1589, 1604, 1609]], [[65018, 65018], "disallowed_STD3_mapped", [1589, 1604, 1609, 32, 1575, 1604, 1604, 1607, 32, 1593, 1604, 1610, 1607, 32, 1608, 1587, 1604, 1605]], [[65019, 65019], "disallowed_STD3_mapped", [1580, 1604, 32, 1580, 1604, 1575, 1604, 1607]], [[65020, 65020], "mapped", [1585, 1740, 1575, 1604]], [[65021, 65021], "valid", [], "NV8"], [[65022, 65023], "disallowed"], [[65024, 65039], "ignored"], [[65040, 65040], "disallowed_STD3_mapped", [44]], [[65041, 65041], "mapped", [12289]], [[65042, 65042], "disallowed"], [[65043, 65043], "disallowed_STD3_mapped", [58]], [[65044, 65044], "disallowed_STD3_mapped", [59]], [[65045, 65045], "disallowed_STD3_mapped", [33]], [[65046, 65046], "disallowed_STD3_mapped", [63]], [[65047, 65047], "mapped", [12310]], [[65048, 65048], "mapped", [12311]], [[65049, 65049], "disallowed"], [[65050, 65055], "disallowed"], [[65056, 65059], "valid"], [[65060, 65062], "valid"], [[65063, 65069], "valid"], [[65070, 65071], "valid"], [[65072, 65072], "disallowed"], [[65073, 65073], "mapped", [8212]], [[65074, 65074], "mapped", [8211]], [[65075, 65076], "disallowed_STD3_mapped", [95]], [[65077, 65077], "disallowed_STD3_mapped", [40]], [[65078, 65078], "disallowed_STD3_mapped", [41]], [[65079, 65079], "disallowed_STD3_mapped", [123]], [[65080, 65080], "disallowed_STD3_mapped", [125]], [[65081, 65081], "mapped", [12308]], [[65082, 65082], "mapped", [12309]], [[65083, 65083], "mapped", [12304]], [[65084, 65084], "mapped", [12305]], [[65085, 65085], "mapped", [12298]], [[65086, 65086], "mapped", [12299]], [[65087, 65087], "mapped", [12296]], [[65088, 65088], "mapped", [12297]], [[65089, 65089], "mapped", [12300]], [[65090, 65090], "mapped", [12301]], [[65091, 65091], "mapped", [12302]], [[65092, 65092], "mapped", [12303]], [[65093, 65094], "valid", [], "NV8"], [[65095, 65095], "disallowed_STD3_mapped", [91]], [[65096, 65096], "disallowed_STD3_mapped", [93]], [[65097, 65100], "disallowed_STD3_mapped", [32, 773]], [[65101, 65103], "disallowed_STD3_mapped", [95]], [[65104, 65104], "disallowed_STD3_mapped", [44]], [[65105, 65105], "mapped", [12289]], [[65106, 65106], "disallowed"], [[65107, 65107], "disallowed"], [[65108, 65108], "disallowed_STD3_mapped", [59]], [[65109, 65109], "disallowed_STD3_mapped", [58]], [[65110, 65110], "disallowed_STD3_mapped", [63]], [[65111, 65111], "disallowed_STD3_mapped", [33]], [[65112, 65112], "mapped", [8212]], [[65113, 65113], "disallowed_STD3_mapped", [40]], [[65114, 65114], "disallowed_STD3_mapped", [41]], [[65115, 65115], "disallowed_STD3_mapped", [123]], [[65116, 65116], "disallowed_STD3_mapped", [125]], [[65117, 65117], "mapped", [12308]], [[65118, 65118], "mapped", [12309]], [[65119, 65119], "disallowed_STD3_mapped", [35]], [[65120, 65120], "disallowed_STD3_mapped", [38]], [[65121, 65121], "disallowed_STD3_mapped", [42]], [[65122, 65122], "disallowed_STD3_mapped", [43]], [[65123, 65123], "mapped", [45]], [[65124, 65124], "disallowed_STD3_mapped", [60]], [[65125, 65125], "disallowed_STD3_mapped", [62]], [[65126, 65126], "disallowed_STD3_mapped", [61]], [[65127, 65127], "disallowed"], [[65128, 65128], "disallowed_STD3_mapped", [92]], [[65129, 65129], "disallowed_STD3_mapped", [36]], [[65130, 65130], "disallowed_STD3_mapped", [37]], [[65131, 65131], "disallowed_STD3_mapped", [64]], [[65132, 65135], "disallowed"], [[65136, 65136], "disallowed_STD3_mapped", [32, 1611]], [[65137, 65137], "mapped", [1600, 1611]], [[65138, 65138], "disallowed_STD3_mapped", [32, 1612]], [[65139, 65139], "valid"], [[65140, 65140], "disallowed_STD3_mapped", [32, 1613]], [[65141, 65141], "disallowed"], [[65142, 65142], "disallowed_STD3_mapped", [32, 1614]], [[65143, 65143], "mapped", [1600, 1614]], [[65144, 65144], "disallowed_STD3_mapped", [32, 1615]], [[65145, 65145], "mapped", [1600, 1615]], [[65146, 65146], "disallowed_STD3_mapped", [32, 1616]], [[65147, 65147], "mapped", [1600, 1616]], [[65148, 65148], "disallowed_STD3_mapped", [32, 1617]], [[65149, 65149], "mapped", [1600, 1617]], [[65150, 65150], "disallowed_STD3_mapped", [32, 1618]], [[65151, 65151], "mapped", [1600, 1618]], [[65152, 65152], "mapped", [1569]], [[65153, 65154], "mapped", [1570]], [[65155, 65156], "mapped", [1571]], [[65157, 65158], "mapped", [1572]], [[65159, 65160], "mapped", [1573]], [[65161, 65164], "mapped", [1574]], [[65165, 65166], "mapped", [1575]], [[65167, 65170], "mapped", [1576]], [[65171, 65172], "mapped", [1577]], [[65173, 65176], "mapped", [1578]], [[65177, 65180], "mapped", [1579]], [[65181, 65184], "mapped", [1580]], [[65185, 65188], "mapped", [1581]], [[65189, 65192], "mapped", [1582]], [[65193, 65194], "mapped", [1583]], [[65195, 65196], "mapped", [1584]], [[65197, 65198], "mapped", [1585]], [[65199, 65200], "mapped", [1586]], [[65201, 65204], "mapped", [1587]], [[65205, 65208], "mapped", [1588]], [[65209, 65212], "mapped", [1589]], [[65213, 65216], "mapped", [1590]], [[65217, 65220], "mapped", [1591]], [[65221, 65224], "mapped", [1592]], [[65225, 65228], "mapped", [1593]], [[65229, 65232], "mapped", [1594]], [[65233, 65236], "mapped", [1601]], [[65237, 65240], "mapped", [1602]], [[65241, 65244], "mapped", [1603]], [[65245, 65248], "mapped", [1604]], [[65249, 65252], "mapped", [1605]], [[65253, 65256], "mapped", [1606]], [[65257, 65260], "mapped", [1607]], [[65261, 65262], "mapped", [1608]], [[65263, 65264], "mapped", [1609]], [[65265, 65268], "mapped", [1610]], [[65269, 65270], "mapped", [1604, 1570]], [[65271, 65272], "mapped", [1604, 1571]], [[65273, 65274], "mapped", [1604, 1573]], [[65275, 65276], "mapped", [1604, 1575]], [[65277, 65278], "disallowed"], [[65279, 65279], "ignored"], [[65280, 65280], "disallowed"], [[65281, 65281], "disallowed_STD3_mapped", [33]], [[65282, 65282], "disallowed_STD3_mapped", [34]], [[65283, 65283], "disallowed_STD3_mapped", [35]], [[65284, 65284], "disallowed_STD3_mapped", [36]], [[65285, 65285], "disallowed_STD3_mapped", [37]], [[65286, 65286], "disallowed_STD3_mapped", [38]], [[65287, 65287], "disallowed_STD3_mapped", [39]], [[65288, 65288], "disallowed_STD3_mapped", [40]], [[65289, 65289], "disallowed_STD3_mapped", [41]], [[65290, 65290], "disallowed_STD3_mapped", [42]], [[65291, 65291], "disallowed_STD3_mapped", [43]], [[65292, 65292], "disallowed_STD3_mapped", [44]], [[65293, 65293], "mapped", [45]], [[65294, 65294], "mapped", [46]], [[65295, 65295], "disallowed_STD3_mapped", [47]], [[65296, 65296], "mapped", [48]], [[65297, 65297], "mapped", [49]], [[65298, 65298], "mapped", [50]], [[65299, 65299], "mapped", [51]], [[65300, 65300], "mapped", [52]], [[65301, 65301], "mapped", [53]], [[65302, 65302], "mapped", [54]], [[65303, 65303], "mapped", [55]], [[65304, 65304], "mapped", [56]], [[65305, 65305], "mapped", [57]], [[65306, 65306], "disallowed_STD3_mapped", [58]], [[65307, 65307], "disallowed_STD3_mapped", [59]], [[65308, 65308], "disallowed_STD3_mapped", [60]], [[65309, 65309], "disallowed_STD3_mapped", [61]], [[65310, 65310], "disallowed_STD3_mapped", [62]], [[65311, 65311], "disallowed_STD3_mapped", [63]], [[65312, 65312], "disallowed_STD3_mapped", [64]], [[65313, 65313], "mapped", [97]], [[65314, 65314], "mapped", [98]], [[65315, 65315], "mapped", [99]], [[65316, 65316], "mapped", [100]], [[65317, 65317], "mapped", [101]], [[65318, 65318], "mapped", [102]], [[65319, 65319], "mapped", [103]], [[65320, 65320], "mapped", [104]], [[65321, 65321], "mapped", [105]], [[65322, 65322], "mapped", [106]], [[65323, 65323], "mapped", [107]], [[65324, 65324], "mapped", [108]], [[65325, 65325], "mapped", [109]], [[65326, 65326], "mapped", [110]], [[65327, 65327], "mapped", [111]], [[65328, 65328], "mapped", [112]], [[65329, 65329], "mapped", [113]], [[65330, 65330], "mapped", [114]], [[65331, 65331], "mapped", [115]], [[65332, 65332], "mapped", [116]], [[65333, 65333], "mapped", [117]], [[65334, 65334], "mapped", [118]], [[65335, 65335], "mapped", [119]], [[65336, 65336], "mapped", [120]], [[65337, 65337], "mapped", [121]], [[65338, 65338], "mapped", [122]], [[65339, 65339], "disallowed_STD3_mapped", [91]], [[65340, 65340], "disallowed_STD3_mapped", [92]], [[65341, 65341], "disallowed_STD3_mapped", [93]], [[65342, 65342], "disallowed_STD3_mapped", [94]], [[65343, 65343], "disallowed_STD3_mapped", [95]], [[65344, 65344], "disallowed_STD3_mapped", [96]], [[65345, 65345], "mapped", [97]], [[65346, 65346], "mapped", [98]], [[65347, 65347], "mapped", [99]], [[65348, 65348], "mapped", [100]], [[65349, 65349], "mapped", [101]], [[65350, 65350], "mapped", [102]], [[65351, 65351], "mapped", [103]], [[65352, 65352], "mapped", [104]], [[65353, 65353], "mapped", [105]], [[65354, 65354], "mapped", [106]], [[65355, 65355], "mapped", [107]], [[65356, 65356], "mapped", [108]], [[65357, 65357], "mapped", [109]], [[65358, 65358], "mapped", [110]], [[65359, 65359], "mapped", [111]], [[65360, 65360], "mapped", [112]], [[65361, 65361], "mapped", [113]], [[65362, 65362], "mapped", [114]], [[65363, 65363], "mapped", [115]], [[65364, 65364], "mapped", [116]], [[65365, 65365], "mapped", [117]], [[65366, 65366], "mapped", [118]], [[65367, 65367], "mapped", [119]], [[65368, 65368], "mapped", [120]], [[65369, 65369], "mapped", [121]], [[65370, 65370], "mapped", [122]], [[65371, 65371], "disallowed_STD3_mapped", [123]], [[65372, 65372], "disallowed_STD3_mapped", [124]], [[65373, 65373], "disallowed_STD3_mapped", [125]], [[65374, 65374], "disallowed_STD3_mapped", [126]], [[65375, 65375], "mapped", [10629]], [[65376, 65376], "mapped", [10630]], [[65377, 65377], "mapped", [46]], [[65378, 65378], "mapped", [12300]], [[65379, 65379], "mapped", [12301]], [[65380, 65380], "mapped", [12289]], [[65381, 65381], "mapped", [12539]], [[65382, 65382], "mapped", [12530]], [[65383, 65383], "mapped", [12449]], [[65384, 65384], "mapped", [12451]], [[65385, 65385], "mapped", [12453]], [[65386, 65386], "mapped", [12455]], [[65387, 65387], "mapped", [12457]], [[65388, 65388], "mapped", [12515]], [[65389, 65389], "mapped", [12517]], [[65390, 65390], "mapped", [12519]], [[65391, 65391], "mapped", [12483]], [[65392, 65392], "mapped", [12540]], [[65393, 65393], "mapped", [12450]], [[65394, 65394], "mapped", [12452]], [[65395, 65395], "mapped", [12454]], [[65396, 65396], "mapped", [12456]], [[65397, 65397], "mapped", [12458]], [[65398, 65398], "mapped", [12459]], [[65399, 65399], "mapped", [12461]], [[65400, 65400], "mapped", [12463]], [[65401, 65401], "mapped", [12465]], [[65402, 65402], "mapped", [12467]], [[65403, 65403], "mapped", [12469]], [[65404, 65404], "mapped", [12471]], [[65405, 65405], "mapped", [12473]], [[65406, 65406], "mapped", [12475]], [[65407, 65407], "mapped", [12477]], [[65408, 65408], "mapped", [12479]], [[65409, 65409], "mapped", [12481]], [[65410, 65410], "mapped", [12484]], [[65411, 65411], "mapped", [12486]], [[65412, 65412], "mapped", [12488]], [[65413, 65413], "mapped", [12490]], [[65414, 65414], "mapped", [12491]], [[65415, 65415], "mapped", [12492]], [[65416, 65416], "mapped", [12493]], [[65417, 65417], "mapped", [12494]], [[65418, 65418], "mapped", [12495]], [[65419, 65419], "mapped", [12498]], [[65420, 65420], "mapped", [12501]], [[65421, 65421], "mapped", [12504]], [[65422, 65422], "mapped", [12507]], [[65423, 65423], "mapped", [12510]], [[65424, 65424], "mapped", [12511]], [[65425, 65425], "mapped", [12512]], [[65426, 65426], "mapped", [12513]], [[65427, 65427], "mapped", [12514]], [[65428, 65428], "mapped", [12516]], [[65429, 65429], "mapped", [12518]], [[65430, 65430], "mapped", [12520]], [[65431, 65431], "mapped", [12521]], [[65432, 65432], "mapped", [12522]], [[65433, 65433], "mapped", [12523]], [[65434, 65434], "mapped", [12524]], [[65435, 65435], "mapped", [12525]], [[65436, 65436], "mapped", [12527]], [[65437, 65437], "mapped", [12531]], [[65438, 65438], "mapped", [12441]], [[65439, 65439], "mapped", [12442]], [[65440, 65440], "disallowed"], [[65441, 65441], "mapped", [4352]], [[65442, 65442], "mapped", [4353]], [[65443, 65443], "mapped", [4522]], [[65444, 65444], "mapped", [4354]], [[65445, 65445], "mapped", [4524]], [[65446, 65446], "mapped", [4525]], [[65447, 65447], "mapped", [4355]], [[65448, 65448], "mapped", [4356]], [[65449, 65449], "mapped", [4357]], [[65450, 65450], "mapped", [4528]], [[65451, 65451], "mapped", [4529]], [[65452, 65452], "mapped", [4530]], [[65453, 65453], "mapped", [4531]], [[65454, 65454], "mapped", [4532]], [[65455, 65455], "mapped", [4533]], [[65456, 65456], "mapped", [4378]], [[65457, 65457], "mapped", [4358]], [[65458, 65458], "mapped", [4359]], [[65459, 65459], "mapped", [4360]], [[65460, 65460], "mapped", [4385]], [[65461, 65461], "mapped", [4361]], [[65462, 65462], "mapped", [4362]], [[65463, 65463], "mapped", [4363]], [[65464, 65464], "mapped", [4364]], [[65465, 65465], "mapped", [4365]], [[65466, 65466], "mapped", [4366]], [[65467, 65467], "mapped", [4367]], [[65468, 65468], "mapped", [4368]], [[65469, 65469], "mapped", [4369]], [[65470, 65470], "mapped", [4370]], [[65471, 65473], "disallowed"], [[65474, 65474], "mapped", [4449]], [[65475, 65475], "mapped", [4450]], [[65476, 65476], "mapped", [4451]], [[65477, 65477], "mapped", [4452]], [[65478, 65478], "mapped", [4453]], [[65479, 65479], "mapped", [4454]], [[65480, 65481], "disallowed"], [[65482, 65482], "mapped", [4455]], [[65483, 65483], "mapped", [4456]], [[65484, 65484], "mapped", [4457]], [[65485, 65485], "mapped", [4458]], [[65486, 65486], "mapped", [4459]], [[65487, 65487], "mapped", [4460]], [[65488, 65489], "disallowed"], [[65490, 65490], "mapped", [4461]], [[65491, 65491], "mapped", [4462]], [[65492, 65492], "mapped", [4463]], [[65493, 65493], "mapped", [4464]], [[65494, 65494], "mapped", [4465]], [[65495, 65495], "mapped", [4466]], [[65496, 65497], "disallowed"], [[65498, 65498], "mapped", [4467]], [[65499, 65499], "mapped", [4468]], [[65500, 65500], "mapped", [4469]], [[65501, 65503], "disallowed"], [[65504, 65504], "mapped", [162]], [[65505, 65505], "mapped", [163]], [[65506, 65506], "mapped", [172]], [[65507, 65507], "disallowed_STD3_mapped", [32, 772]], [[65508, 65508], "mapped", [166]], [[65509, 65509], "mapped", [165]], [[65510, 65510], "mapped", [8361]], [[65511, 65511], "disallowed"], [[65512, 65512], "mapped", [9474]], [[65513, 65513], "mapped", [8592]], [[65514, 65514], "mapped", [8593]], [[65515, 65515], "mapped", [8594]], [[65516, 65516], "mapped", [8595]], [[65517, 65517], "mapped", [9632]], [[65518, 65518], "mapped", [9675]], [[65519, 65528], "disallowed"], [[65529, 65531], "disallowed"], [[65532, 65532], "disallowed"], [[65533, 65533], "disallowed"], [[65534, 65535], "disallowed"], [[65536, 65547], "valid"], [[65548, 65548], "disallowed"], [[65549, 65574], "valid"], [[65575, 65575], "disallowed"], [[65576, 65594], "valid"], [[65595, 65595], "disallowed"], [[65596, 65597], "valid"], [[65598, 65598], "disallowed"], [[65599, 65613], "valid"], [[65614, 65615], "disallowed"], [[65616, 65629], "valid"], [[65630, 65663], "disallowed"], [[65664, 65786], "valid"], [[65787, 65791], "disallowed"], [[65792, 65794], "valid", [], "NV8"], [[65795, 65798], "disallowed"], [[65799, 65843], "valid", [], "NV8"], [[65844, 65846], "disallowed"], [[65847, 65855], "valid", [], "NV8"], [[65856, 65930], "valid", [], "NV8"], [[65931, 65932], "valid", [], "NV8"], [[65933, 65935], "disallowed"], [[65936, 65947], "valid", [], "NV8"], [[65948, 65951], "disallowed"], [[65952, 65952], "valid", [], "NV8"], [[65953, 65999], "disallowed"], [[66e3, 66044], "valid", [], "NV8"], [[66045, 66045], "valid"], [[66046, 66175], "disallowed"], [[66176, 66204], "valid"], [[66205, 66207], "disallowed"], [[66208, 66256], "valid"], [[66257, 66271], "disallowed"], [[66272, 66272], "valid"], [[66273, 66299], "valid", [], "NV8"], [[66300, 66303], "disallowed"], [[66304, 66334], "valid"], [[66335, 66335], "valid"], [[66336, 66339], "valid", [], "NV8"], [[66340, 66351], "disallowed"], [[66352, 66368], "valid"], [[66369, 66369], "valid", [], "NV8"], [[66370, 66377], "valid"], [[66378, 66378], "valid", [], "NV8"], [[66379, 66383], "disallowed"], [[66384, 66426], "valid"], [[66427, 66431], "disallowed"], [[66432, 66461], "valid"], [[66462, 66462], "disallowed"], [[66463, 66463], "valid", [], "NV8"], [[66464, 66499], "valid"], [[66500, 66503], "disallowed"], [[66504, 66511], "valid"], [[66512, 66517], "valid", [], "NV8"], [[66518, 66559], "disallowed"], [[66560, 66560], "mapped", [66600]], [[66561, 66561], "mapped", [66601]], [[66562, 66562], "mapped", [66602]], [[66563, 66563], "mapped", [66603]], [[66564, 66564], "mapped", [66604]], [[66565, 66565], "mapped", [66605]], [[66566, 66566], "mapped", [66606]], [[66567, 66567], "mapped", [66607]], [[66568, 66568], "mapped", [66608]], [[66569, 66569], "mapped", [66609]], [[66570, 66570], "mapped", [66610]], [[66571, 66571], "mapped", [66611]], [[66572, 66572], "mapped", [66612]], [[66573, 66573], "mapped", [66613]], [[66574, 66574], "mapped", [66614]], [[66575, 66575], "mapped", [66615]], [[66576, 66576], "mapped", [66616]], [[66577, 66577], "mapped", [66617]], [[66578, 66578], "mapped", [66618]], [[66579, 66579], "mapped", [66619]], [[66580, 66580], "mapped", [66620]], [[66581, 66581], "mapped", [66621]], [[66582, 66582], "mapped", [66622]], [[66583, 66583], "mapped", [66623]], [[66584, 66584], "mapped", [66624]], [[66585, 66585], "mapped", [66625]], [[66586, 66586], "mapped", [66626]], [[66587, 66587], "mapped", [66627]], [[66588, 66588], "mapped", [66628]], [[66589, 66589], "mapped", [66629]], [[66590, 66590], "mapped", [66630]], [[66591, 66591], "mapped", [66631]], [[66592, 66592], "mapped", [66632]], [[66593, 66593], "mapped", [66633]], [[66594, 66594], "mapped", [66634]], [[66595, 66595], "mapped", [66635]], [[66596, 66596], "mapped", [66636]], [[66597, 66597], "mapped", [66637]], [[66598, 66598], "mapped", [66638]], [[66599, 66599], "mapped", [66639]], [[66600, 66637], "valid"], [[66638, 66717], "valid"], [[66718, 66719], "disallowed"], [[66720, 66729], "valid"], [[66730, 66815], "disallowed"], [[66816, 66855], "valid"], [[66856, 66863], "disallowed"], [[66864, 66915], "valid"], [[66916, 66926], "disallowed"], [[66927, 66927], "valid", [], "NV8"], [[66928, 67071], "disallowed"], [[67072, 67382], "valid"], [[67383, 67391], "disallowed"], [[67392, 67413], "valid"], [[67414, 67423], "disallowed"], [[67424, 67431], "valid"], [[67432, 67583], "disallowed"], [[67584, 67589], "valid"], [[67590, 67591], "disallowed"], [[67592, 67592], "valid"], [[67593, 67593], "disallowed"], [[67594, 67637], "valid"], [[67638, 67638], "disallowed"], [[67639, 67640], "valid"], [[67641, 67643], "disallowed"], [[67644, 67644], "valid"], [[67645, 67646], "disallowed"], [[67647, 67647], "valid"], [[67648, 67669], "valid"], [[67670, 67670], "disallowed"], [[67671, 67679], "valid", [], "NV8"], [[67680, 67702], "valid"], [[67703, 67711], "valid", [], "NV8"], [[67712, 67742], "valid"], [[67743, 67750], "disallowed"], [[67751, 67759], "valid", [], "NV8"], [[67760, 67807], "disallowed"], [[67808, 67826], "valid"], [[67827, 67827], "disallowed"], [[67828, 67829], "valid"], [[67830, 67834], "disallowed"], [[67835, 67839], "valid", [], "NV8"], [[67840, 67861], "valid"], [[67862, 67865], "valid", [], "NV8"], [[67866, 67867], "valid", [], "NV8"], [[67868, 67870], "disallowed"], [[67871, 67871], "valid", [], "NV8"], [[67872, 67897], "valid"], [[67898, 67902], "disallowed"], [[67903, 67903], "valid", [], "NV8"], [[67904, 67967], "disallowed"], [[67968, 68023], "valid"], [[68024, 68027], "disallowed"], [[68028, 68029], "valid", [], "NV8"], [[68030, 68031], "valid"], [[68032, 68047], "valid", [], "NV8"], [[68048, 68049], "disallowed"], [[68050, 68095], "valid", [], "NV8"], [[68096, 68099], "valid"], [[68100, 68100], "disallowed"], [[68101, 68102], "valid"], [[68103, 68107], "disallowed"], [[68108, 68115], "valid"], [[68116, 68116], "disallowed"], [[68117, 68119], "valid"], [[68120, 68120], "disallowed"], [[68121, 68147], "valid"], [[68148, 68151], "disallowed"], [[68152, 68154], "valid"], [[68155, 68158], "disallowed"], [[68159, 68159], "valid"], [[68160, 68167], "valid", [], "NV8"], [[68168, 68175], "disallowed"], [[68176, 68184], "valid", [], "NV8"], [[68185, 68191], "disallowed"], [[68192, 68220], "valid"], [[68221, 68223], "valid", [], "NV8"], [[68224, 68252], "valid"], [[68253, 68255], "valid", [], "NV8"], [[68256, 68287], "disallowed"], [[68288, 68295], "valid"], [[68296, 68296], "valid", [], "NV8"], [[68297, 68326], "valid"], [[68327, 68330], "disallowed"], [[68331, 68342], "valid", [], "NV8"], [[68343, 68351], "disallowed"], [[68352, 68405], "valid"], [[68406, 68408], "disallowed"], [[68409, 68415], "valid", [], "NV8"], [[68416, 68437], "valid"], [[68438, 68439], "disallowed"], [[68440, 68447], "valid", [], "NV8"], [[68448, 68466], "valid"], [[68467, 68471], "disallowed"], [[68472, 68479], "valid", [], "NV8"], [[68480, 68497], "valid"], [[68498, 68504], "disallowed"], [[68505, 68508], "valid", [], "NV8"], [[68509, 68520], "disallowed"], [[68521, 68527], "valid", [], "NV8"], [[68528, 68607], "disallowed"], [[68608, 68680], "valid"], [[68681, 68735], "disallowed"], [[68736, 68736], "mapped", [68800]], [[68737, 68737], "mapped", [68801]], [[68738, 68738], "mapped", [68802]], [[68739, 68739], "mapped", [68803]], [[68740, 68740], "mapped", [68804]], [[68741, 68741], "mapped", [68805]], [[68742, 68742], "mapped", [68806]], [[68743, 68743], "mapped", [68807]], [[68744, 68744], "mapped", [68808]], [[68745, 68745], "mapped", [68809]], [[68746, 68746], "mapped", [68810]], [[68747, 68747], "mapped", [68811]], [[68748, 68748], "mapped", [68812]], [[68749, 68749], "mapped", [68813]], [[68750, 68750], "mapped", [68814]], [[68751, 68751], "mapped", [68815]], [[68752, 68752], "mapped", [68816]], [[68753, 68753], "mapped", [68817]], [[68754, 68754], "mapped", [68818]], [[68755, 68755], "mapped", [68819]], [[68756, 68756], "mapped", [68820]], [[68757, 68757], "mapped", [68821]], [[68758, 68758], "mapped", [68822]], [[68759, 68759], "mapped", [68823]], [[68760, 68760], "mapped", [68824]], [[68761, 68761], "mapped", [68825]], [[68762, 68762], "mapped", [68826]], [[68763, 68763], "mapped", [68827]], [[68764, 68764], "mapped", [68828]], [[68765, 68765], "mapped", [68829]], [[68766, 68766], "mapped", [68830]], [[68767, 68767], "mapped", [68831]], [[68768, 68768], "mapped", [68832]], [[68769, 68769], "mapped", [68833]], [[68770, 68770], "mapped", [68834]], [[68771, 68771], "mapped", [68835]], [[68772, 68772], "mapped", [68836]], [[68773, 68773], "mapped", [68837]], [[68774, 68774], "mapped", [68838]], [[68775, 68775], "mapped", [68839]], [[68776, 68776], "mapped", [68840]], [[68777, 68777], "mapped", [68841]], [[68778, 68778], "mapped", [68842]], [[68779, 68779], "mapped", [68843]], [[68780, 68780], "mapped", [68844]], [[68781, 68781], "mapped", [68845]], [[68782, 68782], "mapped", [68846]], [[68783, 68783], "mapped", [68847]], [[68784, 68784], "mapped", [68848]], [[68785, 68785], "mapped", [68849]], [[68786, 68786], "mapped", [68850]], [[68787, 68799], "disallowed"], [[68800, 68850], "valid"], [[68851, 68857], "disallowed"], [[68858, 68863], "valid", [], "NV8"], [[68864, 69215], "disallowed"], [[69216, 69246], "valid", [], "NV8"], [[69247, 69631], "disallowed"], [[69632, 69702], "valid"], [[69703, 69709], "valid", [], "NV8"], [[69710, 69713], "disallowed"], [[69714, 69733], "valid", [], "NV8"], [[69734, 69743], "valid"], [[69744, 69758], "disallowed"], [[69759, 69759], "valid"], [[69760, 69818], "valid"], [[69819, 69820], "valid", [], "NV8"], [[69821, 69821], "disallowed"], [[69822, 69825], "valid", [], "NV8"], [[69826, 69839], "disallowed"], [[69840, 69864], "valid"], [[69865, 69871], "disallowed"], [[69872, 69881], "valid"], [[69882, 69887], "disallowed"], [[69888, 69940], "valid"], [[69941, 69941], "disallowed"], [[69942, 69951], "valid"], [[69952, 69955], "valid", [], "NV8"], [[69956, 69967], "disallowed"], [[69968, 70003], "valid"], [[70004, 70005], "valid", [], "NV8"], [[70006, 70006], "valid"], [[70007, 70015], "disallowed"], [[70016, 70084], "valid"], [[70085, 70088], "valid", [], "NV8"], [[70089, 70089], "valid", [], "NV8"], [[70090, 70092], "valid"], [[70093, 70093], "valid", [], "NV8"], [[70094, 70095], "disallowed"], [[70096, 70105], "valid"], [[70106, 70106], "valid"], [[70107, 70107], "valid", [], "NV8"], [[70108, 70108], "valid"], [[70109, 70111], "valid", [], "NV8"], [[70112, 70112], "disallowed"], [[70113, 70132], "valid", [], "NV8"], [[70133, 70143], "disallowed"], [[70144, 70161], "valid"], [[70162, 70162], "disallowed"], [[70163, 70199], "valid"], [[70200, 70205], "valid", [], "NV8"], [[70206, 70271], "disallowed"], [[70272, 70278], "valid"], [[70279, 70279], "disallowed"], [[70280, 70280], "valid"], [[70281, 70281], "disallowed"], [[70282, 70285], "valid"], [[70286, 70286], "disallowed"], [[70287, 70301], "valid"], [[70302, 70302], "disallowed"], [[70303, 70312], "valid"], [[70313, 70313], "valid", [], "NV8"], [[70314, 70319], "disallowed"], [[70320, 70378], "valid"], [[70379, 70383], "disallowed"], [[70384, 70393], "valid"], [[70394, 70399], "disallowed"], [[70400, 70400], "valid"], [[70401, 70403], "valid"], [[70404, 70404], "disallowed"], [[70405, 70412], "valid"], [[70413, 70414], "disallowed"], [[70415, 70416], "valid"], [[70417, 70418], "disallowed"], [[70419, 70440], "valid"], [[70441, 70441], "disallowed"], [[70442, 70448], "valid"], [[70449, 70449], "disallowed"], [[70450, 70451], "valid"], [[70452, 70452], "disallowed"], [[70453, 70457], "valid"], [[70458, 70459], "disallowed"], [[70460, 70468], "valid"], [[70469, 70470], "disallowed"], [[70471, 70472], "valid"], [[70473, 70474], "disallowed"], [[70475, 70477], "valid"], [[70478, 70479], "disallowed"], [[70480, 70480], "valid"], [[70481, 70486], "disallowed"], [[70487, 70487], "valid"], [[70488, 70492], "disallowed"], [[70493, 70499], "valid"], [[70500, 70501], "disallowed"], [[70502, 70508], "valid"], [[70509, 70511], "disallowed"], [[70512, 70516], "valid"], [[70517, 70783], "disallowed"], [[70784, 70853], "valid"], [[70854, 70854], "valid", [], "NV8"], [[70855, 70855], "valid"], [[70856, 70863], "disallowed"], [[70864, 70873], "valid"], [[70874, 71039], "disallowed"], [[71040, 71093], "valid"], [[71094, 71095], "disallowed"], [[71096, 71104], "valid"], [[71105, 71113], "valid", [], "NV8"], [[71114, 71127], "valid", [], "NV8"], [[71128, 71133], "valid"], [[71134, 71167], "disallowed"], [[71168, 71232], "valid"], [[71233, 71235], "valid", [], "NV8"], [[71236, 71236], "valid"], [[71237, 71247], "disallowed"], [[71248, 71257], "valid"], [[71258, 71295], "disallowed"], [[71296, 71351], "valid"], [[71352, 71359], "disallowed"], [[71360, 71369], "valid"], [[71370, 71423], "disallowed"], [[71424, 71449], "valid"], [[71450, 71452], "disallowed"], [[71453, 71467], "valid"], [[71468, 71471], "disallowed"], [[71472, 71481], "valid"], [[71482, 71487], "valid", [], "NV8"], [[71488, 71839], "disallowed"], [[71840, 71840], "mapped", [71872]], [[71841, 71841], "mapped", [71873]], [[71842, 71842], "mapped", [71874]], [[71843, 71843], "mapped", [71875]], [[71844, 71844], "mapped", [71876]], [[71845, 71845], "mapped", [71877]], [[71846, 71846], "mapped", [71878]], [[71847, 71847], "mapped", [71879]], [[71848, 71848], "mapped", [71880]], [[71849, 71849], "mapped", [71881]], [[71850, 71850], "mapped", [71882]], [[71851, 71851], "mapped", [71883]], [[71852, 71852], "mapped", [71884]], [[71853, 71853], "mapped", [71885]], [[71854, 71854], "mapped", [71886]], [[71855, 71855], "mapped", [71887]], [[71856, 71856], "mapped", [71888]], [[71857, 71857], "mapped", [71889]], [[71858, 71858], "mapped", [71890]], [[71859, 71859], "mapped", [71891]], [[71860, 71860], "mapped", [71892]], [[71861, 71861], "mapped", [71893]], [[71862, 71862], "mapped", [71894]], [[71863, 71863], "mapped", [71895]], [[71864, 71864], "mapped", [71896]], [[71865, 71865], "mapped", [71897]], [[71866, 71866], "mapped", [71898]], [[71867, 71867], "mapped", [71899]], [[71868, 71868], "mapped", [71900]], [[71869, 71869], "mapped", [71901]], [[71870, 71870], "mapped", [71902]], [[71871, 71871], "mapped", [71903]], [[71872, 71913], "valid"], [[71914, 71922], "valid", [], "NV8"], [[71923, 71934], "disallowed"], [[71935, 71935], "valid"], [[71936, 72383], "disallowed"], [[72384, 72440], "valid"], [[72441, 73727], "disallowed"], [[73728, 74606], "valid"], [[74607, 74648], "valid"], [[74649, 74649], "valid"], [[74650, 74751], "disallowed"], [[74752, 74850], "valid", [], "NV8"], [[74851, 74862], "valid", [], "NV8"], [[74863, 74863], "disallowed"], [[74864, 74867], "valid", [], "NV8"], [[74868, 74868], "valid", [], "NV8"], [[74869, 74879], "disallowed"], [[74880, 75075], "valid"], [[75076, 77823], "disallowed"], [[77824, 78894], "valid"], [[78895, 82943], "disallowed"], [[82944, 83526], "valid"], [[83527, 92159], "disallowed"], [[92160, 92728], "valid"], [[92729, 92735], "disallowed"], [[92736, 92766], "valid"], [[92767, 92767], "disallowed"], [[92768, 92777], "valid"], [[92778, 92781], "disallowed"], [[92782, 92783], "valid", [], "NV8"], [[92784, 92879], "disallowed"], [[92880, 92909], "valid"], [[92910, 92911], "disallowed"], [[92912, 92916], "valid"], [[92917, 92917], "valid", [], "NV8"], [[92918, 92927], "disallowed"], [[92928, 92982], "valid"], [[92983, 92991], "valid", [], "NV8"], [[92992, 92995], "valid"], [[92996, 92997], "valid", [], "NV8"], [[92998, 93007], "disallowed"], [[93008, 93017], "valid"], [[93018, 93018], "disallowed"], [[93019, 93025], "valid", [], "NV8"], [[93026, 93026], "disallowed"], [[93027, 93047], "valid"], [[93048, 93052], "disallowed"], [[93053, 93071], "valid"], [[93072, 93951], "disallowed"], [[93952, 94020], "valid"], [[94021, 94031], "disallowed"], [[94032, 94078], "valid"], [[94079, 94094], "disallowed"], [[94095, 94111], "valid"], [[94112, 110591], "disallowed"], [[110592, 110593], "valid"], [[110594, 113663], "disallowed"], [[113664, 113770], "valid"], [[113771, 113775], "disallowed"], [[113776, 113788], "valid"], [[113789, 113791], "disallowed"], [[113792, 113800], "valid"], [[113801, 113807], "disallowed"], [[113808, 113817], "valid"], [[113818, 113819], "disallowed"], [[113820, 113820], "valid", [], "NV8"], [[113821, 113822], "valid"], [[113823, 113823], "valid", [], "NV8"], [[113824, 113827], "ignored"], [[113828, 118783], "disallowed"], [[118784, 119029], "valid", [], "NV8"], [[119030, 119039], "disallowed"], [[119040, 119078], "valid", [], "NV8"], [[119079, 119080], "disallowed"], [[119081, 119081], "valid", [], "NV8"], [[119082, 119133], "valid", [], "NV8"], [[119134, 119134], "mapped", [119127, 119141]], [[119135, 119135], "mapped", [119128, 119141]], [[119136, 119136], "mapped", [119128, 119141, 119150]], [[119137, 119137], "mapped", [119128, 119141, 119151]], [[119138, 119138], "mapped", [119128, 119141, 119152]], [[119139, 119139], "mapped", [119128, 119141, 119153]], [[119140, 119140], "mapped", [119128, 119141, 119154]], [[119141, 119154], "valid", [], "NV8"], [[119155, 119162], "disallowed"], [[119163, 119226], "valid", [], "NV8"], [[119227, 119227], "mapped", [119225, 119141]], [[119228, 119228], "mapped", [119226, 119141]], [[119229, 119229], "mapped", [119225, 119141, 119150]], [[119230, 119230], "mapped", [119226, 119141, 119150]], [[119231, 119231], "mapped", [119225, 119141, 119151]], [[119232, 119232], "mapped", [119226, 119141, 119151]], [[119233, 119261], "valid", [], "NV8"], [[119262, 119272], "valid", [], "NV8"], [[119273, 119295], "disallowed"], [[119296, 119365], "valid", [], "NV8"], [[119366, 119551], "disallowed"], [[119552, 119638], "valid", [], "NV8"], [[119639, 119647], "disallowed"], [[119648, 119665], "valid", [], "NV8"], [[119666, 119807], "disallowed"], [[119808, 119808], "mapped", [97]], [[119809, 119809], "mapped", [98]], [[119810, 119810], "mapped", [99]], [[119811, 119811], "mapped", [100]], [[119812, 119812], "mapped", [101]], [[119813, 119813], "mapped", [102]], [[119814, 119814], "mapped", [103]], [[119815, 119815], "mapped", [104]], [[119816, 119816], "mapped", [105]], [[119817, 119817], "mapped", [106]], [[119818, 119818], "mapped", [107]], [[119819, 119819], "mapped", [108]], [[119820, 119820], "mapped", [109]], [[119821, 119821], "mapped", [110]], [[119822, 119822], "mapped", [111]], [[119823, 119823], "mapped", [112]], [[119824, 119824], "mapped", [113]], [[119825, 119825], "mapped", [114]], [[119826, 119826], "mapped", [115]], [[119827, 119827], "mapped", [116]], [[119828, 119828], "mapped", [117]], [[119829, 119829], "mapped", [118]], [[119830, 119830], "mapped", [119]], [[119831, 119831], "mapped", [120]], [[119832, 119832], "mapped", [121]], [[119833, 119833], "mapped", [122]], [[119834, 119834], "mapped", [97]], [[119835, 119835], "mapped", [98]], [[119836, 119836], "mapped", [99]], [[119837, 119837], "mapped", [100]], [[119838, 119838], "mapped", [101]], [[119839, 119839], "mapped", [102]], [[119840, 119840], "mapped", [103]], [[119841, 119841], "mapped", [104]], [[119842, 119842], "mapped", [105]], [[119843, 119843], "mapped", [106]], [[119844, 119844], "mapped", [107]], [[119845, 119845], "mapped", [108]], [[119846, 119846], "mapped", [109]], [[119847, 119847], "mapped", [110]], [[119848, 119848], "mapped", [111]], [[119849, 119849], "mapped", [112]], [[119850, 119850], "mapped", [113]], [[119851, 119851], "mapped", [114]], [[119852, 119852], "mapped", [115]], [[119853, 119853], "mapped", [116]], [[119854, 119854], "mapped", [117]], [[119855, 119855], "mapped", [118]], [[119856, 119856], "mapped", [119]], [[119857, 119857], "mapped", [120]], [[119858, 119858], "mapped", [121]], [[119859, 119859], "mapped", [122]], [[119860, 119860], "mapped", [97]], [[119861, 119861], "mapped", [98]], [[119862, 119862], "mapped", [99]], [[119863, 119863], "mapped", [100]], [[119864, 119864], "mapped", [101]], [[119865, 119865], "mapped", [102]], [[119866, 119866], "mapped", [103]], [[119867, 119867], "mapped", [104]], [[119868, 119868], "mapped", [105]], [[119869, 119869], "mapped", [106]], [[119870, 119870], "mapped", [107]], [[119871, 119871], "mapped", [108]], [[119872, 119872], "mapped", [109]], [[119873, 119873], "mapped", [110]], [[119874, 119874], "mapped", [111]], [[119875, 119875], "mapped", [112]], [[119876, 119876], "mapped", [113]], [[119877, 119877], "mapped", [114]], [[119878, 119878], "mapped", [115]], [[119879, 119879], "mapped", [116]], [[119880, 119880], "mapped", [117]], [[119881, 119881], "mapped", [118]], [[119882, 119882], "mapped", [119]], [[119883, 119883], "mapped", [120]], [[119884, 119884], "mapped", [121]], [[119885, 119885], "mapped", [122]], [[119886, 119886], "mapped", [97]], [[119887, 119887], "mapped", [98]], [[119888, 119888], "mapped", [99]], [[119889, 119889], "mapped", [100]], [[119890, 119890], "mapped", [101]], [[119891, 119891], "mapped", [102]], [[119892, 119892], "mapped", [103]], [[119893, 119893], "disallowed"], [[119894, 119894], "mapped", [105]], [[119895, 119895], "mapped", [106]], [[119896, 119896], "mapped", [107]], [[119897, 119897], "mapped", [108]], [[119898, 119898], "mapped", [109]], [[119899, 119899], "mapped", [110]], [[119900, 119900], "mapped", [111]], [[119901, 119901], "mapped", [112]], [[119902, 119902], "mapped", [113]], [[119903, 119903], "mapped", [114]], [[119904, 119904], "mapped", [115]], [[119905, 119905], "mapped", [116]], [[119906, 119906], "mapped", [117]], [[119907, 119907], "mapped", [118]], [[119908, 119908], "mapped", [119]], [[119909, 119909], "mapped", [120]], [[119910, 119910], "mapped", [121]], [[119911, 119911], "mapped", [122]], [[119912, 119912], "mapped", [97]], [[119913, 119913], "mapped", [98]], [[119914, 119914], "mapped", [99]], [[119915, 119915], "mapped", [100]], [[119916, 119916], "mapped", [101]], [[119917, 119917], "mapped", [102]], [[119918, 119918], "mapped", [103]], [[119919, 119919], "mapped", [104]], [[119920, 119920], "mapped", [105]], [[119921, 119921], "mapped", [106]], [[119922, 119922], "mapped", [107]], [[119923, 119923], "mapped", [108]], [[119924, 119924], "mapped", [109]], [[119925, 119925], "mapped", [110]], [[119926, 119926], "mapped", [111]], [[119927, 119927], "mapped", [112]], [[119928, 119928], "mapped", [113]], [[119929, 119929], "mapped", [114]], [[119930, 119930], "mapped", [115]], [[119931, 119931], "mapped", [116]], [[119932, 119932], "mapped", [117]], [[119933, 119933], "mapped", [118]], [[119934, 119934], "mapped", [119]], [[119935, 119935], "mapped", [120]], [[119936, 119936], "mapped", [121]], [[119937, 119937], "mapped", [122]], [[119938, 119938], "mapped", [97]], [[119939, 119939], "mapped", [98]], [[119940, 119940], "mapped", [99]], [[119941, 119941], "mapped", [100]], [[119942, 119942], "mapped", [101]], [[119943, 119943], "mapped", [102]], [[119944, 119944], "mapped", [103]], [[119945, 119945], "mapped", [104]], [[119946, 119946], "mapped", [105]], [[119947, 119947], "mapped", [106]], [[119948, 119948], "mapped", [107]], [[119949, 119949], "mapped", [108]], [[119950, 119950], "mapped", [109]], [[119951, 119951], "mapped", [110]], [[119952, 119952], "mapped", [111]], [[119953, 119953], "mapped", [112]], [[119954, 119954], "mapped", [113]], [[119955, 119955], "mapped", [114]], [[119956, 119956], "mapped", [115]], [[119957, 119957], "mapped", [116]], [[119958, 119958], "mapped", [117]], [[119959, 119959], "mapped", [118]], [[119960, 119960], "mapped", [119]], [[119961, 119961], "mapped", [120]], [[119962, 119962], "mapped", [121]], [[119963, 119963], "mapped", [122]], [[119964, 119964], "mapped", [97]], [[119965, 119965], "disallowed"], [[119966, 119966], "mapped", [99]], [[119967, 119967], "mapped", [100]], [[119968, 119969], "disallowed"], [[119970, 119970], "mapped", [103]], [[119971, 119972], "disallowed"], [[119973, 119973], "mapped", [106]], [[119974, 119974], "mapped", [107]], [[119975, 119976], "disallowed"], [[119977, 119977], "mapped", [110]], [[119978, 119978], "mapped", [111]], [[119979, 119979], "mapped", [112]], [[119980, 119980], "mapped", [113]], [[119981, 119981], "disallowed"], [[119982, 119982], "mapped", [115]], [[119983, 119983], "mapped", [116]], [[119984, 119984], "mapped", [117]], [[119985, 119985], "mapped", [118]], [[119986, 119986], "mapped", [119]], [[119987, 119987], "mapped", [120]], [[119988, 119988], "mapped", [121]], [[119989, 119989], "mapped", [122]], [[119990, 119990], "mapped", [97]], [[119991, 119991], "mapped", [98]], [[119992, 119992], "mapped", [99]], [[119993, 119993], "mapped", [100]], [[119994, 119994], "disallowed"], [[119995, 119995], "mapped", [102]], [[119996, 119996], "disallowed"], [[119997, 119997], "mapped", [104]], [[119998, 119998], "mapped", [105]], [[119999, 119999], "mapped", [106]], [[12e4, 12e4], "mapped", [107]], [[120001, 120001], "mapped", [108]], [[120002, 120002], "mapped", [109]], [[120003, 120003], "mapped", [110]], [[120004, 120004], "disallowed"], [[120005, 120005], "mapped", [112]], [[120006, 120006], "mapped", [113]], [[120007, 120007], "mapped", [114]], [[120008, 120008], "mapped", [115]], [[120009, 120009], "mapped", [116]], [[120010, 120010], "mapped", [117]], [[120011, 120011], "mapped", [118]], [[120012, 120012], "mapped", [119]], [[120013, 120013], "mapped", [120]], [[120014, 120014], "mapped", [121]], [[120015, 120015], "mapped", [122]], [[120016, 120016], "mapped", [97]], [[120017, 120017], "mapped", [98]], [[120018, 120018], "mapped", [99]], [[120019, 120019], "mapped", [100]], [[120020, 120020], "mapped", [101]], [[120021, 120021], "mapped", [102]], [[120022, 120022], "mapped", [103]], [[120023, 120023], "mapped", [104]], [[120024, 120024], "mapped", [105]], [[120025, 120025], "mapped", [106]], [[120026, 120026], "mapped", [107]], [[120027, 120027], "mapped", [108]], [[120028, 120028], "mapped", [109]], [[120029, 120029], "mapped", [110]], [[120030, 120030], "mapped", [111]], [[120031, 120031], "mapped", [112]], [[120032, 120032], "mapped", [113]], [[120033, 120033], "mapped", [114]], [[120034, 120034], "mapped", [115]], [[120035, 120035], "mapped", [116]], [[120036, 120036], "mapped", [117]], [[120037, 120037], "mapped", [118]], [[120038, 120038], "mapped", [119]], [[120039, 120039], "mapped", [120]], [[120040, 120040], "mapped", [121]], [[120041, 120041], "mapped", [122]], [[120042, 120042], "mapped", [97]], [[120043, 120043], "mapped", [98]], [[120044, 120044], "mapped", [99]], [[120045, 120045], "mapped", [100]], [[120046, 120046], "mapped", [101]], [[120047, 120047], "mapped", [102]], [[120048, 120048], "mapped", [103]], [[120049, 120049], "mapped", [104]], [[120050, 120050], "mapped", [105]], [[120051, 120051], "mapped", [106]], [[120052, 120052], "mapped", [107]], [[120053, 120053], "mapped", [108]], [[120054, 120054], "mapped", [109]], [[120055, 120055], "mapped", [110]], [[120056, 120056], "mapped", [111]], [[120057, 120057], "mapped", [112]], [[120058, 120058], "mapped", [113]], [[120059, 120059], "mapped", [114]], [[120060, 120060], "mapped", [115]], [[120061, 120061], "mapped", [116]], [[120062, 120062], "mapped", [117]], [[120063, 120063], "mapped", [118]], [[120064, 120064], "mapped", [119]], [[120065, 120065], "mapped", [120]], [[120066, 120066], "mapped", [121]], [[120067, 120067], "mapped", [122]], [[120068, 120068], "mapped", [97]], [[120069, 120069], "mapped", [98]], [[120070, 120070], "disallowed"], [[120071, 120071], "mapped", [100]], [[120072, 120072], "mapped", [101]], [[120073, 120073], "mapped", [102]], [[120074, 120074], "mapped", [103]], [[120075, 120076], "disallowed"], [[120077, 120077], "mapped", [106]], [[120078, 120078], "mapped", [107]], [[120079, 120079], "mapped", [108]], [[120080, 120080], "mapped", [109]], [[120081, 120081], "mapped", [110]], [[120082, 120082], "mapped", [111]], [[120083, 120083], "mapped", [112]], [[120084, 120084], "mapped", [113]], [[120085, 120085], "disallowed"], [[120086, 120086], "mapped", [115]], [[120087, 120087], "mapped", [116]], [[120088, 120088], "mapped", [117]], [[120089, 120089], "mapped", [118]], [[120090, 120090], "mapped", [119]], [[120091, 120091], "mapped", [120]], [[120092, 120092], "mapped", [121]], [[120093, 120093], "disallowed"], [[120094, 120094], "mapped", [97]], [[120095, 120095], "mapped", [98]], [[120096, 120096], "mapped", [99]], [[120097, 120097], "mapped", [100]], [[120098, 120098], "mapped", [101]], [[120099, 120099], "mapped", [102]], [[120100, 120100], "mapped", [103]], [[120101, 120101], "mapped", [104]], [[120102, 120102], "mapped", [105]], [[120103, 120103], "mapped", [106]], [[120104, 120104], "mapped", [107]], [[120105, 120105], "mapped", [108]], [[120106, 120106], "mapped", [109]], [[120107, 120107], "mapped", [110]], [[120108, 120108], "mapped", [111]], [[120109, 120109], "mapped", [112]], [[120110, 120110], "mapped", [113]], [[120111, 120111], "mapped", [114]], [[120112, 120112], "mapped", [115]], [[120113, 120113], "mapped", [116]], [[120114, 120114], "mapped", [117]], [[120115, 120115], "mapped", [118]], [[120116, 120116], "mapped", [119]], [[120117, 120117], "mapped", [120]], [[120118, 120118], "mapped", [121]], [[120119, 120119], "mapped", [122]], [[120120, 120120], "mapped", [97]], [[120121, 120121], "mapped", [98]], [[120122, 120122], "disallowed"], [[120123, 120123], "mapped", [100]], [[120124, 120124], "mapped", [101]], [[120125, 120125], "mapped", [102]], [[120126, 120126], "mapped", [103]], [[120127, 120127], "disallowed"], [[120128, 120128], "mapped", [105]], [[120129, 120129], "mapped", [106]], [[120130, 120130], "mapped", [107]], [[120131, 120131], "mapped", [108]], [[120132, 120132], "mapped", [109]], [[120133, 120133], "disallowed"], [[120134, 120134], "mapped", [111]], [[120135, 120137], "disallowed"], [[120138, 120138], "mapped", [115]], [[120139, 120139], "mapped", [116]], [[120140, 120140], "mapped", [117]], [[120141, 120141], "mapped", [118]], [[120142, 120142], "mapped", [119]], [[120143, 120143], "mapped", [120]], [[120144, 120144], "mapped", [121]], [[120145, 120145], "disallowed"], [[120146, 120146], "mapped", [97]], [[120147, 120147], "mapped", [98]], [[120148, 120148], "mapped", [99]], [[120149, 120149], "mapped", [100]], [[120150, 120150], "mapped", [101]], [[120151, 120151], "mapped", [102]], [[120152, 120152], "mapped", [103]], [[120153, 120153], "mapped", [104]], [[120154, 120154], "mapped", [105]], [[120155, 120155], "mapped", [106]], [[120156, 120156], "mapped", [107]], [[120157, 120157], "mapped", [108]], [[120158, 120158], "mapped", [109]], [[120159, 120159], "mapped", [110]], [[120160, 120160], "mapped", [111]], [[120161, 120161], "mapped", [112]], [[120162, 120162], "mapped", [113]], [[120163, 120163], "mapped", [114]], [[120164, 120164], "mapped", [115]], [[120165, 120165], "mapped", [116]], [[120166, 120166], "mapped", [117]], [[120167, 120167], "mapped", [118]], [[120168, 120168], "mapped", [119]], [[120169, 120169], "mapped", [120]], [[120170, 120170], "mapped", [121]], [[120171, 120171], "mapped", [122]], [[120172, 120172], "mapped", [97]], [[120173, 120173], "mapped", [98]], [[120174, 120174], "mapped", [99]], [[120175, 120175], "mapped", [100]], [[120176, 120176], "mapped", [101]], [[120177, 120177], "mapped", [102]], [[120178, 120178], "mapped", [103]], [[120179, 120179], "mapped", [104]], [[120180, 120180], "mapped", [105]], [[120181, 120181], "mapped", [106]], [[120182, 120182], "mapped", [107]], [[120183, 120183], "mapped", [108]], [[120184, 120184], "mapped", [109]], [[120185, 120185], "mapped", [110]], [[120186, 120186], "mapped", [111]], [[120187, 120187], "mapped", [112]], [[120188, 120188], "mapped", [113]], [[120189, 120189], "mapped", [114]], [[120190, 120190], "mapped", [115]], [[120191, 120191], "mapped", [116]], [[120192, 120192], "mapped", [117]], [[120193, 120193], "mapped", [118]], [[120194, 120194], "mapped", [119]], [[120195, 120195], "mapped", [120]], [[120196, 120196], "mapped", [121]], [[120197, 120197], "mapped", [122]], [[120198, 120198], "mapped", [97]], [[120199, 120199], "mapped", [98]], [[120200, 120200], "mapped", [99]], [[120201, 120201], "mapped", [100]], [[120202, 120202], "mapped", [101]], [[120203, 120203], "mapped", [102]], [[120204, 120204], "mapped", [103]], [[120205, 120205], "mapped", [104]], [[120206, 120206], "mapped", [105]], [[120207, 120207], "mapped", [106]], [[120208, 120208], "mapped", [107]], [[120209, 120209], "mapped", [108]], [[120210, 120210], "mapped", [109]], [[120211, 120211], "mapped", [110]], [[120212, 120212], "mapped", [111]], [[120213, 120213], "mapped", [112]], [[120214, 120214], "mapped", [113]], [[120215, 120215], "mapped", [114]], [[120216, 120216], "mapped", [115]], [[120217, 120217], "mapped", [116]], [[120218, 120218], "mapped", [117]], [[120219, 120219], "mapped", [118]], [[120220, 120220], "mapped", [119]], [[120221, 120221], "mapped", [120]], [[120222, 120222], "mapped", [121]], [[120223, 120223], "mapped", [122]], [[120224, 120224], "mapped", [97]], [[120225, 120225], "mapped", [98]], [[120226, 120226], "mapped", [99]], [[120227, 120227], "mapped", [100]], [[120228, 120228], "mapped", [101]], [[120229, 120229], "mapped", [102]], [[120230, 120230], "mapped", [103]], [[120231, 120231], "mapped", [104]], [[120232, 120232], "mapped", [105]], [[120233, 120233], "mapped", [106]], [[120234, 120234], "mapped", [107]], [[120235, 120235], "mapped", [108]], [[120236, 120236], "mapped", [109]], [[120237, 120237], "mapped", [110]], [[120238, 120238], "mapped", [111]], [[120239, 120239], "mapped", [112]], [[120240, 120240], "mapped", [113]], [[120241, 120241], "mapped", [114]], [[120242, 120242], "mapped", [115]], [[120243, 120243], "mapped", [116]], [[120244, 120244], "mapped", [117]], [[120245, 120245], "mapped", [118]], [[120246, 120246], "mapped", [119]], [[120247, 120247], "mapped", [120]], [[120248, 120248], "mapped", [121]], [[120249, 120249], "mapped", [122]], [[120250, 120250], "mapped", [97]], [[120251, 120251], "mapped", [98]], [[120252, 120252], "mapped", [99]], [[120253, 120253], "mapped", [100]], [[120254, 120254], "mapped", [101]], [[120255, 120255], "mapped", [102]], [[120256, 120256], "mapped", [103]], [[120257, 120257], "mapped", [104]], [[120258, 120258], "mapped", [105]], [[120259, 120259], "mapped", [106]], [[120260, 120260], "mapped", [107]], [[120261, 120261], "mapped", [108]], [[120262, 120262], "mapped", [109]], [[120263, 120263], "mapped", [110]], [[120264, 120264], "mapped", [111]], [[120265, 120265], "mapped", [112]], [[120266, 120266], "mapped", [113]], [[120267, 120267], "mapped", [114]], [[120268, 120268], "mapped", [115]], [[120269, 120269], "mapped", [116]], [[120270, 120270], "mapped", [117]], [[120271, 120271], "mapped", [118]], [[120272, 120272], "mapped", [119]], [[120273, 120273], "mapped", [120]], [[120274, 120274], "mapped", [121]], [[120275, 120275], "mapped", [122]], [[120276, 120276], "mapped", [97]], [[120277, 120277], "mapped", [98]], [[120278, 120278], "mapped", [99]], [[120279, 120279], "mapped", [100]], [[120280, 120280], "mapped", [101]], [[120281, 120281], "mapped", [102]], [[120282, 120282], "mapped", [103]], [[120283, 120283], "mapped", [104]], [[120284, 120284], "mapped", [105]], [[120285, 120285], "mapped", [106]], [[120286, 120286], "mapped", [107]], [[120287, 120287], "mapped", [108]], [[120288, 120288], "mapped", [109]], [[120289, 120289], "mapped", [110]], [[120290, 120290], "mapped", [111]], [[120291, 120291], "mapped", [112]], [[120292, 120292], "mapped", [113]], [[120293, 120293], "mapped", [114]], [[120294, 120294], "mapped", [115]], [[120295, 120295], "mapped", [116]], [[120296, 120296], "mapped", [117]], [[120297, 120297], "mapped", [118]], [[120298, 120298], "mapped", [119]], [[120299, 120299], "mapped", [120]], [[120300, 120300], "mapped", [121]], [[120301, 120301], "mapped", [122]], [[120302, 120302], "mapped", [97]], [[120303, 120303], "mapped", [98]], [[120304, 120304], "mapped", [99]], [[120305, 120305], "mapped", [100]], [[120306, 120306], "mapped", [101]], [[120307, 120307], "mapped", [102]], [[120308, 120308], "mapped", [103]], [[120309, 120309], "mapped", [104]], [[120310, 120310], "mapped", [105]], [[120311, 120311], "mapped", [106]], [[120312, 120312], "mapped", [107]], [[120313, 120313], "mapped", [108]], [[120314, 120314], "mapped", [109]], [[120315, 120315], "mapped", [110]], [[120316, 120316], "mapped", [111]], [[120317, 120317], "mapped", [112]], [[120318, 120318], "mapped", [113]], [[120319, 120319], "mapped", [114]], [[120320, 120320], "mapped", [115]], [[120321, 120321], "mapped", [116]], [[120322, 120322], "mapped", [117]], [[120323, 120323], "mapped", [118]], [[120324, 120324], "mapped", [119]], [[120325, 120325], "mapped", [120]], [[120326, 120326], "mapped", [121]], [[120327, 120327], "mapped", [122]], [[120328, 120328], "mapped", [97]], [[120329, 120329], "mapped", [98]], [[120330, 120330], "mapped", [99]], [[120331, 120331], "mapped", [100]], [[120332, 120332], "mapped", [101]], [[120333, 120333], "mapped", [102]], [[120334, 120334], "mapped", [103]], [[120335, 120335], "mapped", [104]], [[120336, 120336], "mapped", [105]], [[120337, 120337], "mapped", [106]], [[120338, 120338], "mapped", [107]], [[120339, 120339], "mapped", [108]], [[120340, 120340], "mapped", [109]], [[120341, 120341], "mapped", [110]], [[120342, 120342], "mapped", [111]], [[120343, 120343], "mapped", [112]], [[120344, 120344], "mapped", [113]], [[120345, 120345], "mapped", [114]], [[120346, 120346], "mapped", [115]], [[120347, 120347], "mapped", [116]], [[120348, 120348], "mapped", [117]], [[120349, 120349], "mapped", [118]], [[120350, 120350], "mapped", [119]], [[120351, 120351], "mapped", [120]], [[120352, 120352], "mapped", [121]], [[120353, 120353], "mapped", [122]], [[120354, 120354], "mapped", [97]], [[120355, 120355], "mapped", [98]], [[120356, 120356], "mapped", [99]], [[120357, 120357], "mapped", [100]], [[120358, 120358], "mapped", [101]], [[120359, 120359], "mapped", [102]], [[120360, 120360], "mapped", [103]], [[120361, 120361], "mapped", [104]], [[120362, 120362], "mapped", [105]], [[120363, 120363], "mapped", [106]], [[120364, 120364], "mapped", [107]], [[120365, 120365], "mapped", [108]], [[120366, 120366], "mapped", [109]], [[120367, 120367], "mapped", [110]], [[120368, 120368], "mapped", [111]], [[120369, 120369], "mapped", [112]], [[120370, 120370], "mapped", [113]], [[120371, 120371], "mapped", [114]], [[120372, 120372], "mapped", [115]], [[120373, 120373], "mapped", [116]], [[120374, 120374], "mapped", [117]], [[120375, 120375], "mapped", [118]], [[120376, 120376], "mapped", [119]], [[120377, 120377], "mapped", [120]], [[120378, 120378], "mapped", [121]], [[120379, 120379], "mapped", [122]], [[120380, 120380], "mapped", [97]], [[120381, 120381], "mapped", [98]], [[120382, 120382], "mapped", [99]], [[120383, 120383], "mapped", [100]], [[120384, 120384], "mapped", [101]], [[120385, 120385], "mapped", [102]], [[120386, 120386], "mapped", [103]], [[120387, 120387], "mapped", [104]], [[120388, 120388], "mapped", [105]], [[120389, 120389], "mapped", [106]], [[120390, 120390], "mapped", [107]], [[120391, 120391], "mapped", [108]], [[120392, 120392], "mapped", [109]], [[120393, 120393], "mapped", [110]], [[120394, 120394], "mapped", [111]], [[120395, 120395], "mapped", [112]], [[120396, 120396], "mapped", [113]], [[120397, 120397], "mapped", [114]], [[120398, 120398], "mapped", [115]], [[120399, 120399], "mapped", [116]], [[120400, 120400], "mapped", [117]], [[120401, 120401], "mapped", [118]], [[120402, 120402], "mapped", [119]], [[120403, 120403], "mapped", [120]], [[120404, 120404], "mapped", [121]], [[120405, 120405], "mapped", [122]], [[120406, 120406], "mapped", [97]], [[120407, 120407], "mapped", [98]], [[120408, 120408], "mapped", [99]], [[120409, 120409], "mapped", [100]], [[120410, 120410], "mapped", [101]], [[120411, 120411], "mapped", [102]], [[120412, 120412], "mapped", [103]], [[120413, 120413], "mapped", [104]], [[120414, 120414], "mapped", [105]], [[120415, 120415], "mapped", [106]], [[120416, 120416], "mapped", [107]], [[120417, 120417], "mapped", [108]], [[120418, 120418], "mapped", [109]], [[120419, 120419], "mapped", [110]], [[120420, 120420], "mapped", [111]], [[120421, 120421], "mapped", [112]], [[120422, 120422], "mapped", [113]], [[120423, 120423], "mapped", [114]], [[120424, 120424], "mapped", [115]], [[120425, 120425], "mapped", [116]], [[120426, 120426], "mapped", [117]], [[120427, 120427], "mapped", [118]], [[120428, 120428], "mapped", [119]], [[120429, 120429], "mapped", [120]], [[120430, 120430], "mapped", [121]], [[120431, 120431], "mapped", [122]], [[120432, 120432], "mapped", [97]], [[120433, 120433], "mapped", [98]], [[120434, 120434], "mapped", [99]], [[120435, 120435], "mapped", [100]], [[120436, 120436], "mapped", [101]], [[120437, 120437], "mapped", [102]], [[120438, 120438], "mapped", [103]], [[120439, 120439], "mapped", [104]], [[120440, 120440], "mapped", [105]], [[120441, 120441], "mapped", [106]], [[120442, 120442], "mapped", [107]], [[120443, 120443], "mapped", [108]], [[120444, 120444], "mapped", [109]], [[120445, 120445], "mapped", [110]], [[120446, 120446], "mapped", [111]], [[120447, 120447], "mapped", [112]], [[120448, 120448], "mapped", [113]], [[120449, 120449], "mapped", [114]], [[120450, 120450], "mapped", [115]], [[120451, 120451], "mapped", [116]], [[120452, 120452], "mapped", [117]], [[120453, 120453], "mapped", [118]], [[120454, 120454], "mapped", [119]], [[120455, 120455], "mapped", [120]], [[120456, 120456], "mapped", [121]], [[120457, 120457], "mapped", [122]], [[120458, 120458], "mapped", [97]], [[120459, 120459], "mapped", [98]], [[120460, 120460], "mapped", [99]], [[120461, 120461], "mapped", [100]], [[120462, 120462], "mapped", [101]], [[120463, 120463], "mapped", [102]], [[120464, 120464], "mapped", [103]], [[120465, 120465], "mapped", [104]], [[120466, 120466], "mapped", [105]], [[120467, 120467], "mapped", [106]], [[120468, 120468], "mapped", [107]], [[120469, 120469], "mapped", [108]], [[120470, 120470], "mapped", [109]], [[120471, 120471], "mapped", [110]], [[120472, 120472], "mapped", [111]], [[120473, 120473], "mapped", [112]], [[120474, 120474], "mapped", [113]], [[120475, 120475], "mapped", [114]], [[120476, 120476], "mapped", [115]], [[120477, 120477], "mapped", [116]], [[120478, 120478], "mapped", [117]], [[120479, 120479], "mapped", [118]], [[120480, 120480], "mapped", [119]], [[120481, 120481], "mapped", [120]], [[120482, 120482], "mapped", [121]], [[120483, 120483], "mapped", [122]], [[120484, 120484], "mapped", [305]], [[120485, 120485], "mapped", [567]], [[120486, 120487], "disallowed"], [[120488, 120488], "mapped", [945]], [[120489, 120489], "mapped", [946]], [[120490, 120490], "mapped", [947]], [[120491, 120491], "mapped", [948]], [[120492, 120492], "mapped", [949]], [[120493, 120493], "mapped", [950]], [[120494, 120494], "mapped", [951]], [[120495, 120495], "mapped", [952]], [[120496, 120496], "mapped", [953]], [[120497, 120497], "mapped", [954]], [[120498, 120498], "mapped", [955]], [[120499, 120499], "mapped", [956]], [[120500, 120500], "mapped", [957]], [[120501, 120501], "mapped", [958]], [[120502, 120502], "mapped", [959]], [[120503, 120503], "mapped", [960]], [[120504, 120504], "mapped", [961]], [[120505, 120505], "mapped", [952]], [[120506, 120506], "mapped", [963]], [[120507, 120507], "mapped", [964]], [[120508, 120508], "mapped", [965]], [[120509, 120509], "mapped", [966]], [[120510, 120510], "mapped", [967]], [[120511, 120511], "mapped", [968]], [[120512, 120512], "mapped", [969]], [[120513, 120513], "mapped", [8711]], [[120514, 120514], "mapped", [945]], [[120515, 120515], "mapped", [946]], [[120516, 120516], "mapped", [947]], [[120517, 120517], "mapped", [948]], [[120518, 120518], "mapped", [949]], [[120519, 120519], "mapped", [950]], [[120520, 120520], "mapped", [951]], [[120521, 120521], "mapped", [952]], [[120522, 120522], "mapped", [953]], [[120523, 120523], "mapped", [954]], [[120524, 120524], "mapped", [955]], [[120525, 120525], "mapped", [956]], [[120526, 120526], "mapped", [957]], [[120527, 120527], "mapped", [958]], [[120528, 120528], "mapped", [959]], [[120529, 120529], "mapped", [960]], [[120530, 120530], "mapped", [961]], [[120531, 120532], "mapped", [963]], [[120533, 120533], "mapped", [964]], [[120534, 120534], "mapped", [965]], [[120535, 120535], "mapped", [966]], [[120536, 120536], "mapped", [967]], [[120537, 120537], "mapped", [968]], [[120538, 120538], "mapped", [969]], [[120539, 120539], "mapped", [8706]], [[120540, 120540], "mapped", [949]], [[120541, 120541], "mapped", [952]], [[120542, 120542], "mapped", [954]], [[120543, 120543], "mapped", [966]], [[120544, 120544], "mapped", [961]], [[120545, 120545], "mapped", [960]], [[120546, 120546], "mapped", [945]], [[120547, 120547], "mapped", [946]], [[120548, 120548], "mapped", [947]], [[120549, 120549], "mapped", [948]], [[120550, 120550], "mapped", [949]], [[120551, 120551], "mapped", [950]], [[120552, 120552], "mapped", [951]], [[120553, 120553], "mapped", [952]], [[120554, 120554], "mapped", [953]], [[120555, 120555], "mapped", [954]], [[120556, 120556], "mapped", [955]], [[120557, 120557], "mapped", [956]], [[120558, 120558], "mapped", [957]], [[120559, 120559], "mapped", [958]], [[120560, 120560], "mapped", [959]], [[120561, 120561], "mapped", [960]], [[120562, 120562], "mapped", [961]], [[120563, 120563], "mapped", [952]], [[120564, 120564], "mapped", [963]], [[120565, 120565], "mapped", [964]], [[120566, 120566], "mapped", [965]], [[120567, 120567], "mapped", [966]], [[120568, 120568], "mapped", [967]], [[120569, 120569], "mapped", [968]], [[120570, 120570], "mapped", [969]], [[120571, 120571], "mapped", [8711]], [[120572, 120572], "mapped", [945]], [[120573, 120573], "mapped", [946]], [[120574, 120574], "mapped", [947]], [[120575, 120575], "mapped", [948]], [[120576, 120576], "mapped", [949]], [[120577, 120577], "mapped", [950]], [[120578, 120578], "mapped", [951]], [[120579, 120579], "mapped", [952]], [[120580, 120580], "mapped", [953]], [[120581, 120581], "mapped", [954]], [[120582, 120582], "mapped", [955]], [[120583, 120583], "mapped", [956]], [[120584, 120584], "mapped", [957]], [[120585, 120585], "mapped", [958]], [[120586, 120586], "mapped", [959]], [[120587, 120587], "mapped", [960]], [[120588, 120588], "mapped", [961]], [[120589, 120590], "mapped", [963]], [[120591, 120591], "mapped", [964]], [[120592, 120592], "mapped", [965]], [[120593, 120593], "mapped", [966]], [[120594, 120594], "mapped", [967]], [[120595, 120595], "mapped", [968]], [[120596, 120596], "mapped", [969]], [[120597, 120597], "mapped", [8706]], [[120598, 120598], "mapped", [949]], [[120599, 120599], "mapped", [952]], [[120600, 120600], "mapped", [954]], [[120601, 120601], "mapped", [966]], [[120602, 120602], "mapped", [961]], [[120603, 120603], "mapped", [960]], [[120604, 120604], "mapped", [945]], [[120605, 120605], "mapped", [946]], [[120606, 120606], "mapped", [947]], [[120607, 120607], "mapped", [948]], [[120608, 120608], "mapped", [949]], [[120609, 120609], "mapped", [950]], [[120610, 120610], "mapped", [951]], [[120611, 120611], "mapped", [952]], [[120612, 120612], "mapped", [953]], [[120613, 120613], "mapped", [954]], [[120614, 120614], "mapped", [955]], [[120615, 120615], "mapped", [956]], [[120616, 120616], "mapped", [957]], [[120617, 120617], "mapped", [958]], [[120618, 120618], "mapped", [959]], [[120619, 120619], "mapped", [960]], [[120620, 120620], "mapped", [961]], [[120621, 120621], "mapped", [952]], [[120622, 120622], "mapped", [963]], [[120623, 120623], "mapped", [964]], [[120624, 120624], "mapped", [965]], [[120625, 120625], "mapped", [966]], [[120626, 120626], "mapped", [967]], [[120627, 120627], "mapped", [968]], [[120628, 120628], "mapped", [969]], [[120629, 120629], "mapped", [8711]], [[120630, 120630], "mapped", [945]], [[120631, 120631], "mapped", [946]], [[120632, 120632], "mapped", [947]], [[120633, 120633], "mapped", [948]], [[120634, 120634], "mapped", [949]], [[120635, 120635], "mapped", [950]], [[120636, 120636], "mapped", [951]], [[120637, 120637], "mapped", [952]], [[120638, 120638], "mapped", [953]], [[120639, 120639], "mapped", [954]], [[120640, 120640], "mapped", [955]], [[120641, 120641], "mapped", [956]], [[120642, 120642], "mapped", [957]], [[120643, 120643], "mapped", [958]], [[120644, 120644], "mapped", [959]], [[120645, 120645], "mapped", [960]], [[120646, 120646], "mapped", [961]], [[120647, 120648], "mapped", [963]], [[120649, 120649], "mapped", [964]], [[120650, 120650], "mapped", [965]], [[120651, 120651], "mapped", [966]], [[120652, 120652], "mapped", [967]], [[120653, 120653], "mapped", [968]], [[120654, 120654], "mapped", [969]], [[120655, 120655], "mapped", [8706]], [[120656, 120656], "mapped", [949]], [[120657, 120657], "mapped", [952]], [[120658, 120658], "mapped", [954]], [[120659, 120659], "mapped", [966]], [[120660, 120660], "mapped", [961]], [[120661, 120661], "mapped", [960]], [[120662, 120662], "mapped", [945]], [[120663, 120663], "mapped", [946]], [[120664, 120664], "mapped", [947]], [[120665, 120665], "mapped", [948]], [[120666, 120666], "mapped", [949]], [[120667, 120667], "mapped", [950]], [[120668, 120668], "mapped", [951]], [[120669, 120669], "mapped", [952]], [[120670, 120670], "mapped", [953]], [[120671, 120671], "mapped", [954]], [[120672, 120672], "mapped", [955]], [[120673, 120673], "mapped", [956]], [[120674, 120674], "mapped", [957]], [[120675, 120675], "mapped", [958]], [[120676, 120676], "mapped", [959]], [[120677, 120677], "mapped", [960]], [[120678, 120678], "mapped", [961]], [[120679, 120679], "mapped", [952]], [[120680, 120680], "mapped", [963]], [[120681, 120681], "mapped", [964]], [[120682, 120682], "mapped", [965]], [[120683, 120683], "mapped", [966]], [[120684, 120684], "mapped", [967]], [[120685, 120685], "mapped", [968]], [[120686, 120686], "mapped", [969]], [[120687, 120687], "mapped", [8711]], [[120688, 120688], "mapped", [945]], [[120689, 120689], "mapped", [946]], [[120690, 120690], "mapped", [947]], [[120691, 120691], "mapped", [948]], [[120692, 120692], "mapped", [949]], [[120693, 120693], "mapped", [950]], [[120694, 120694], "mapped", [951]], [[120695, 120695], "mapped", [952]], [[120696, 120696], "mapped", [953]], [[120697, 120697], "mapped", [954]], [[120698, 120698], "mapped", [955]], [[120699, 120699], "mapped", [956]], [[120700, 120700], "mapped", [957]], [[120701, 120701], "mapped", [958]], [[120702, 120702], "mapped", [959]], [[120703, 120703], "mapped", [960]], [[120704, 120704], "mapped", [961]], [[120705, 120706], "mapped", [963]], [[120707, 120707], "mapped", [964]], [[120708, 120708], "mapped", [965]], [[120709, 120709], "mapped", [966]], [[120710, 120710], "mapped", [967]], [[120711, 120711], "mapped", [968]], [[120712, 120712], "mapped", [969]], [[120713, 120713], "mapped", [8706]], [[120714, 120714], "mapped", [949]], [[120715, 120715], "mapped", [952]], [[120716, 120716], "mapped", [954]], [[120717, 120717], "mapped", [966]], [[120718, 120718], "mapped", [961]], [[120719, 120719], "mapped", [960]], [[120720, 120720], "mapped", [945]], [[120721, 120721], "mapped", [946]], [[120722, 120722], "mapped", [947]], [[120723, 120723], "mapped", [948]], [[120724, 120724], "mapped", [949]], [[120725, 120725], "mapped", [950]], [[120726, 120726], "mapped", [951]], [[120727, 120727], "mapped", [952]], [[120728, 120728], "mapped", [953]], [[120729, 120729], "mapped", [954]], [[120730, 120730], "mapped", [955]], [[120731, 120731], "mapped", [956]], [[120732, 120732], "mapped", [957]], [[120733, 120733], "mapped", [958]], [[120734, 120734], "mapped", [959]], [[120735, 120735], "mapped", [960]], [[120736, 120736], "mapped", [961]], [[120737, 120737], "mapped", [952]], [[120738, 120738], "mapped", [963]], [[120739, 120739], "mapped", [964]], [[120740, 120740], "mapped", [965]], [[120741, 120741], "mapped", [966]], [[120742, 120742], "mapped", [967]], [[120743, 120743], "mapped", [968]], [[120744, 120744], "mapped", [969]], [[120745, 120745], "mapped", [8711]], [[120746, 120746], "mapped", [945]], [[120747, 120747], "mapped", [946]], [[120748, 120748], "mapped", [947]], [[120749, 120749], "mapped", [948]], [[120750, 120750], "mapped", [949]], [[120751, 120751], "mapped", [950]], [[120752, 120752], "mapped", [951]], [[120753, 120753], "mapped", [952]], [[120754, 120754], "mapped", [953]], [[120755, 120755], "mapped", [954]], [[120756, 120756], "mapped", [955]], [[120757, 120757], "mapped", [956]], [[120758, 120758], "mapped", [957]], [[120759, 120759], "mapped", [958]], [[120760, 120760], "mapped", [959]], [[120761, 120761], "mapped", [960]], [[120762, 120762], "mapped", [961]], [[120763, 120764], "mapped", [963]], [[120765, 120765], "mapped", [964]], [[120766, 120766], "mapped", [965]], [[120767, 120767], "mapped", [966]], [[120768, 120768], "mapped", [967]], [[120769, 120769], "mapped", [968]], [[120770, 120770], "mapped", [969]], [[120771, 120771], "mapped", [8706]], [[120772, 120772], "mapped", [949]], [[120773, 120773], "mapped", [952]], [[120774, 120774], "mapped", [954]], [[120775, 120775], "mapped", [966]], [[120776, 120776], "mapped", [961]], [[120777, 120777], "mapped", [960]], [[120778, 120779], "mapped", [989]], [[120780, 120781], "disallowed"], [[120782, 120782], "mapped", [48]], [[120783, 120783], "mapped", [49]], [[120784, 120784], "mapped", [50]], [[120785, 120785], "mapped", [51]], [[120786, 120786], "mapped", [52]], [[120787, 120787], "mapped", [53]], [[120788, 120788], "mapped", [54]], [[120789, 120789], "mapped", [55]], [[120790, 120790], "mapped", [56]], [[120791, 120791], "mapped", [57]], [[120792, 120792], "mapped", [48]], [[120793, 120793], "mapped", [49]], [[120794, 120794], "mapped", [50]], [[120795, 120795], "mapped", [51]], [[120796, 120796], "mapped", [52]], [[120797, 120797], "mapped", [53]], [[120798, 120798], "mapped", [54]], [[120799, 120799], "mapped", [55]], [[120800, 120800], "mapped", [56]], [[120801, 120801], "mapped", [57]], [[120802, 120802], "mapped", [48]], [[120803, 120803], "mapped", [49]], [[120804, 120804], "mapped", [50]], [[120805, 120805], "mapped", [51]], [[120806, 120806], "mapped", [52]], [[120807, 120807], "mapped", [53]], [[120808, 120808], "mapped", [54]], [[120809, 120809], "mapped", [55]], [[120810, 120810], "mapped", [56]], [[120811, 120811], "mapped", [57]], [[120812, 120812], "mapped", [48]], [[120813, 120813], "mapped", [49]], [[120814, 120814], "mapped", [50]], [[120815, 120815], "mapped", [51]], [[120816, 120816], "mapped", [52]], [[120817, 120817], "mapped", [53]], [[120818, 120818], "mapped", [54]], [[120819, 120819], "mapped", [55]], [[120820, 120820], "mapped", [56]], [[120821, 120821], "mapped", [57]], [[120822, 120822], "mapped", [48]], [[120823, 120823], "mapped", [49]], [[120824, 120824], "mapped", [50]], [[120825, 120825], "mapped", [51]], [[120826, 120826], "mapped", [52]], [[120827, 120827], "mapped", [53]], [[120828, 120828], "mapped", [54]], [[120829, 120829], "mapped", [55]], [[120830, 120830], "mapped", [56]], [[120831, 120831], "mapped", [57]], [[120832, 121343], "valid", [], "NV8"], [[121344, 121398], "valid"], [[121399, 121402], "valid", [], "NV8"], [[121403, 121452], "valid"], [[121453, 121460], "valid", [], "NV8"], [[121461, 121461], "valid"], [[121462, 121475], "valid", [], "NV8"], [[121476, 121476], "valid"], [[121477, 121483], "valid", [], "NV8"], [[121484, 121498], "disallowed"], [[121499, 121503], "valid"], [[121504, 121504], "disallowed"], [[121505, 121519], "valid"], [[121520, 124927], "disallowed"], [[124928, 125124], "valid"], [[125125, 125126], "disallowed"], [[125127, 125135], "valid", [], "NV8"], [[125136, 125142], "valid"], [[125143, 126463], "disallowed"], [[126464, 126464], "mapped", [1575]], [[126465, 126465], "mapped", [1576]], [[126466, 126466], "mapped", [1580]], [[126467, 126467], "mapped", [1583]], [[126468, 126468], "disallowed"], [[126469, 126469], "mapped", [1608]], [[126470, 126470], "mapped", [1586]], [[126471, 126471], "mapped", [1581]], [[126472, 126472], "mapped", [1591]], [[126473, 126473], "mapped", [1610]], [[126474, 126474], "mapped", [1603]], [[126475, 126475], "mapped", [1604]], [[126476, 126476], "mapped", [1605]], [[126477, 126477], "mapped", [1606]], [[126478, 126478], "mapped", [1587]], [[126479, 126479], "mapped", [1593]], [[126480, 126480], "mapped", [1601]], [[126481, 126481], "mapped", [1589]], [[126482, 126482], "mapped", [1602]], [[126483, 126483], "mapped", [1585]], [[126484, 126484], "mapped", [1588]], [[126485, 126485], "mapped", [1578]], [[126486, 126486], "mapped", [1579]], [[126487, 126487], "mapped", [1582]], [[126488, 126488], "mapped", [1584]], [[126489, 126489], "mapped", [1590]], [[126490, 126490], "mapped", [1592]], [[126491, 126491], "mapped", [1594]], [[126492, 126492], "mapped", [1646]], [[126493, 126493], "mapped", [1722]], [[126494, 126494], "mapped", [1697]], [[126495, 126495], "mapped", [1647]], [[126496, 126496], "disallowed"], [[126497, 126497], "mapped", [1576]], [[126498, 126498], "mapped", [1580]], [[126499, 126499], "disallowed"], [[126500, 126500], "mapped", [1607]], [[126501, 126502], "disallowed"], [[126503, 126503], "mapped", [1581]], [[126504, 126504], "disallowed"], [[126505, 126505], "mapped", [1610]], [[126506, 126506], "mapped", [1603]], [[126507, 126507], "mapped", [1604]], [[126508, 126508], "mapped", [1605]], [[126509, 126509], "mapped", [1606]], [[126510, 126510], "mapped", [1587]], [[126511, 126511], "mapped", [1593]], [[126512, 126512], "mapped", [1601]], [[126513, 126513], "mapped", [1589]], [[126514, 126514], "mapped", [1602]], [[126515, 126515], "disallowed"], [[126516, 126516], "mapped", [1588]], [[126517, 126517], "mapped", [1578]], [[126518, 126518], "mapped", [1579]], [[126519, 126519], "mapped", [1582]], [[126520, 126520], "disallowed"], [[126521, 126521], "mapped", [1590]], [[126522, 126522], "disallowed"], [[126523, 126523], "mapped", [1594]], [[126524, 126529], "disallowed"], [[126530, 126530], "mapped", [1580]], [[126531, 126534], "disallowed"], [[126535, 126535], "mapped", [1581]], [[126536, 126536], "disallowed"], [[126537, 126537], "mapped", [1610]], [[126538, 126538], "disallowed"], [[126539, 126539], "mapped", [1604]], [[126540, 126540], "disallowed"], [[126541, 126541], "mapped", [1606]], [[126542, 126542], "mapped", [1587]], [[126543, 126543], "mapped", [1593]], [[126544, 126544], "disallowed"], [[126545, 126545], "mapped", [1589]], [[126546, 126546], "mapped", [1602]], [[126547, 126547], "disallowed"], [[126548, 126548], "mapped", [1588]], [[126549, 126550], "disallowed"], [[126551, 126551], "mapped", [1582]], [[126552, 126552], "disallowed"], [[126553, 126553], "mapped", [1590]], [[126554, 126554], "disallowed"], [[126555, 126555], "mapped", [1594]], [[126556, 126556], "disallowed"], [[126557, 126557], "mapped", [1722]], [[126558, 126558], "disallowed"], [[126559, 126559], "mapped", [1647]], [[126560, 126560], "disallowed"], [[126561, 126561], "mapped", [1576]], [[126562, 126562], "mapped", [1580]], [[126563, 126563], "disallowed"], [[126564, 126564], "mapped", [1607]], [[126565, 126566], "disallowed"], [[126567, 126567], "mapped", [1581]], [[126568, 126568], "mapped", [1591]], [[126569, 126569], "mapped", [1610]], [[126570, 126570], "mapped", [1603]], [[126571, 126571], "disallowed"], [[126572, 126572], "mapped", [1605]], [[126573, 126573], "mapped", [1606]], [[126574, 126574], "mapped", [1587]], [[126575, 126575], "mapped", [1593]], [[126576, 126576], "mapped", [1601]], [[126577, 126577], "mapped", [1589]], [[126578, 126578], "mapped", [1602]], [[126579, 126579], "disallowed"], [[126580, 126580], "mapped", [1588]], [[126581, 126581], "mapped", [1578]], [[126582, 126582], "mapped", [1579]], [[126583, 126583], "mapped", [1582]], [[126584, 126584], "disallowed"], [[126585, 126585], "mapped", [1590]], [[126586, 126586], "mapped", [1592]], [[126587, 126587], "mapped", [1594]], [[126588, 126588], "mapped", [1646]], [[126589, 126589], "disallowed"], [[126590, 126590], "mapped", [1697]], [[126591, 126591], "disallowed"], [[126592, 126592], "mapped", [1575]], [[126593, 126593], "mapped", [1576]], [[126594, 126594], "mapped", [1580]], [[126595, 126595], "mapped", [1583]], [[126596, 126596], "mapped", [1607]], [[126597, 126597], "mapped", [1608]], [[126598, 126598], "mapped", [1586]], [[126599, 126599], "mapped", [1581]], [[126600, 126600], "mapped", [1591]], [[126601, 126601], "mapped", [1610]], [[126602, 126602], "disallowed"], [[126603, 126603], "mapped", [1604]], [[126604, 126604], "mapped", [1605]], [[126605, 126605], "mapped", [1606]], [[126606, 126606], "mapped", [1587]], [[126607, 126607], "mapped", [1593]], [[126608, 126608], "mapped", [1601]], [[126609, 126609], "mapped", [1589]], [[126610, 126610], "mapped", [1602]], [[126611, 126611], "mapped", [1585]], [[126612, 126612], "mapped", [1588]], [[126613, 126613], "mapped", [1578]], [[126614, 126614], "mapped", [1579]], [[126615, 126615], "mapped", [1582]], [[126616, 126616], "mapped", [1584]], [[126617, 126617], "mapped", [1590]], [[126618, 126618], "mapped", [1592]], [[126619, 126619], "mapped", [1594]], [[126620, 126624], "disallowed"], [[126625, 126625], "mapped", [1576]], [[126626, 126626], "mapped", [1580]], [[126627, 126627], "mapped", [1583]], [[126628, 126628], "disallowed"], [[126629, 126629], "mapped", [1608]], [[126630, 126630], "mapped", [1586]], [[126631, 126631], "mapped", [1581]], [[126632, 126632], "mapped", [1591]], [[126633, 126633], "mapped", [1610]], [[126634, 126634], "disallowed"], [[126635, 126635], "mapped", [1604]], [[126636, 126636], "mapped", [1605]], [[126637, 126637], "mapped", [1606]], [[126638, 126638], "mapped", [1587]], [[126639, 126639], "mapped", [1593]], [[126640, 126640], "mapped", [1601]], [[126641, 126641], "mapped", [1589]], [[126642, 126642], "mapped", [1602]], [[126643, 126643], "mapped", [1585]], [[126644, 126644], "mapped", [1588]], [[126645, 126645], "mapped", [1578]], [[126646, 126646], "mapped", [1579]], [[126647, 126647], "mapped", [1582]], [[126648, 126648], "mapped", [1584]], [[126649, 126649], "mapped", [1590]], [[126650, 126650], "mapped", [1592]], [[126651, 126651], "mapped", [1594]], [[126652, 126703], "disallowed"], [[126704, 126705], "valid", [], "NV8"], [[126706, 126975], "disallowed"], [[126976, 127019], "valid", [], "NV8"], [[127020, 127023], "disallowed"], [[127024, 127123], "valid", [], "NV8"], [[127124, 127135], "disallowed"], [[127136, 127150], "valid", [], "NV8"], [[127151, 127152], "disallowed"], [[127153, 127166], "valid", [], "NV8"], [[127167, 127167], "valid", [], "NV8"], [[127168, 127168], "disallowed"], [[127169, 127183], "valid", [], "NV8"], [[127184, 127184], "disallowed"], [[127185, 127199], "valid", [], "NV8"], [[127200, 127221], "valid", [], "NV8"], [[127222, 127231], "disallowed"], [[127232, 127232], "disallowed"], [[127233, 127233], "disallowed_STD3_mapped", [48, 44]], [[127234, 127234], "disallowed_STD3_mapped", [49, 44]], [[127235, 127235], "disallowed_STD3_mapped", [50, 44]], [[127236, 127236], "disallowed_STD3_mapped", [51, 44]], [[127237, 127237], "disallowed_STD3_mapped", [52, 44]], [[127238, 127238], "disallowed_STD3_mapped", [53, 44]], [[127239, 127239], "disallowed_STD3_mapped", [54, 44]], [[127240, 127240], "disallowed_STD3_mapped", [55, 44]], [[127241, 127241], "disallowed_STD3_mapped", [56, 44]], [[127242, 127242], "disallowed_STD3_mapped", [57, 44]], [[127243, 127244], "valid", [], "NV8"], [[127245, 127247], "disallowed"], [[127248, 127248], "disallowed_STD3_mapped", [40, 97, 41]], [[127249, 127249], "disallowed_STD3_mapped", [40, 98, 41]], [[127250, 127250], "disallowed_STD3_mapped", [40, 99, 41]], [[127251, 127251], "disallowed_STD3_mapped", [40, 100, 41]], [[127252, 127252], "disallowed_STD3_mapped", [40, 101, 41]], [[127253, 127253], "disallowed_STD3_mapped", [40, 102, 41]], [[127254, 127254], "disallowed_STD3_mapped", [40, 103, 41]], [[127255, 127255], "disallowed_STD3_mapped", [40, 104, 41]], [[127256, 127256], "disallowed_STD3_mapped", [40, 105, 41]], [[127257, 127257], "disallowed_STD3_mapped", [40, 106, 41]], [[127258, 127258], "disallowed_STD3_mapped", [40, 107, 41]], [[127259, 127259], "disallowed_STD3_mapped", [40, 108, 41]], [[127260, 127260], "disallowed_STD3_mapped", [40, 109, 41]], [[127261, 127261], "disallowed_STD3_mapped", [40, 110, 41]], [[127262, 127262], "disallowed_STD3_mapped", [40, 111, 41]], [[127263, 127263], "disallowed_STD3_mapped", [40, 112, 41]], [[127264, 127264], "disallowed_STD3_mapped", [40, 113, 41]], [[127265, 127265], "disallowed_STD3_mapped", [40, 114, 41]], [[127266, 127266], "disallowed_STD3_mapped", [40, 115, 41]], [[127267, 127267], "disallowed_STD3_mapped", [40, 116, 41]], [[127268, 127268], "disallowed_STD3_mapped", [40, 117, 41]], [[127269, 127269], "disallowed_STD3_mapped", [40, 118, 41]], [[127270, 127270], "disallowed_STD3_mapped", [40, 119, 41]], [[127271, 127271], "disallowed_STD3_mapped", [40, 120, 41]], [[127272, 127272], "disallowed_STD3_mapped", [40, 121, 41]], [[127273, 127273], "disallowed_STD3_mapped", [40, 122, 41]], [[127274, 127274], "mapped", [12308, 115, 12309]], [[127275, 127275], "mapped", [99]], [[127276, 127276], "mapped", [114]], [[127277, 127277], "mapped", [99, 100]], [[127278, 127278], "mapped", [119, 122]], [[127279, 127279], "disallowed"], [[127280, 127280], "mapped", [97]], [[127281, 127281], "mapped", [98]], [[127282, 127282], "mapped", [99]], [[127283, 127283], "mapped", [100]], [[127284, 127284], "mapped", [101]], [[127285, 127285], "mapped", [102]], [[127286, 127286], "mapped", [103]], [[127287, 127287], "mapped", [104]], [[127288, 127288], "mapped", [105]], [[127289, 127289], "mapped", [106]], [[127290, 127290], "mapped", [107]], [[127291, 127291], "mapped", [108]], [[127292, 127292], "mapped", [109]], [[127293, 127293], "mapped", [110]], [[127294, 127294], "mapped", [111]], [[127295, 127295], "mapped", [112]], [[127296, 127296], "mapped", [113]], [[127297, 127297], "mapped", [114]], [[127298, 127298], "mapped", [115]], [[127299, 127299], "mapped", [116]], [[127300, 127300], "mapped", [117]], [[127301, 127301], "mapped", [118]], [[127302, 127302], "mapped", [119]], [[127303, 127303], "mapped", [120]], [[127304, 127304], "mapped", [121]], [[127305, 127305], "mapped", [122]], [[127306, 127306], "mapped", [104, 118]], [[127307, 127307], "mapped", [109, 118]], [[127308, 127308], "mapped", [115, 100]], [[127309, 127309], "mapped", [115, 115]], [[127310, 127310], "mapped", [112, 112, 118]], [[127311, 127311], "mapped", [119, 99]], [[127312, 127318], "valid", [], "NV8"], [[127319, 127319], "valid", [], "NV8"], [[127320, 127326], "valid", [], "NV8"], [[127327, 127327], "valid", [], "NV8"], [[127328, 127337], "valid", [], "NV8"], [[127338, 127338], "mapped", [109, 99]], [[127339, 127339], "mapped", [109, 100]], [[127340, 127343], "disallowed"], [[127344, 127352], "valid", [], "NV8"], [[127353, 127353], "valid", [], "NV8"], [[127354, 127354], "valid", [], "NV8"], [[127355, 127356], "valid", [], "NV8"], [[127357, 127358], "valid", [], "NV8"], [[127359, 127359], "valid", [], "NV8"], [[127360, 127369], "valid", [], "NV8"], [[127370, 127373], "valid", [], "NV8"], [[127374, 127375], "valid", [], "NV8"], [[127376, 127376], "mapped", [100, 106]], [[127377, 127386], "valid", [], "NV8"], [[127387, 127461], "disallowed"], [[127462, 127487], "valid", [], "NV8"], [[127488, 127488], "mapped", [12411, 12363]], [[127489, 127489], "mapped", [12467, 12467]], [[127490, 127490], "mapped", [12469]], [[127491, 127503], "disallowed"], [[127504, 127504], "mapped", [25163]], [[127505, 127505], "mapped", [23383]], [[127506, 127506], "mapped", [21452]], [[127507, 127507], "mapped", [12487]], [[127508, 127508], "mapped", [20108]], [[127509, 127509], "mapped", [22810]], [[127510, 127510], "mapped", [35299]], [[127511, 127511], "mapped", [22825]], [[127512, 127512], "mapped", [20132]], [[127513, 127513], "mapped", [26144]], [[127514, 127514], "mapped", [28961]], [[127515, 127515], "mapped", [26009]], [[127516, 127516], "mapped", [21069]], [[127517, 127517], "mapped", [24460]], [[127518, 127518], "mapped", [20877]], [[127519, 127519], "mapped", [26032]], [[127520, 127520], "mapped", [21021]], [[127521, 127521], "mapped", [32066]], [[127522, 127522], "mapped", [29983]], [[127523, 127523], "mapped", [36009]], [[127524, 127524], "mapped", [22768]], [[127525, 127525], "mapped", [21561]], [[127526, 127526], "mapped", [28436]], [[127527, 127527], "mapped", [25237]], [[127528, 127528], "mapped", [25429]], [[127529, 127529], "mapped", [19968]], [[127530, 127530], "mapped", [19977]], [[127531, 127531], "mapped", [36938]], [[127532, 127532], "mapped", [24038]], [[127533, 127533], "mapped", [20013]], [[127534, 127534], "mapped", [21491]], [[127535, 127535], "mapped", [25351]], [[127536, 127536], "mapped", [36208]], [[127537, 127537], "mapped", [25171]], [[127538, 127538], "mapped", [31105]], [[127539, 127539], "mapped", [31354]], [[127540, 127540], "mapped", [21512]], [[127541, 127541], "mapped", [28288]], [[127542, 127542], "mapped", [26377]], [[127543, 127543], "mapped", [26376]], [[127544, 127544], "mapped", [30003]], [[127545, 127545], "mapped", [21106]], [[127546, 127546], "mapped", [21942]], [[127547, 127551], "disallowed"], [[127552, 127552], "mapped", [12308, 26412, 12309]], [[127553, 127553], "mapped", [12308, 19977, 12309]], [[127554, 127554], "mapped", [12308, 20108, 12309]], [[127555, 127555], "mapped", [12308, 23433, 12309]], [[127556, 127556], "mapped", [12308, 28857, 12309]], [[127557, 127557], "mapped", [12308, 25171, 12309]], [[127558, 127558], "mapped", [12308, 30423, 12309]], [[127559, 127559], "mapped", [12308, 21213, 12309]], [[127560, 127560], "mapped", [12308, 25943, 12309]], [[127561, 127567], "disallowed"], [[127568, 127568], "mapped", [24471]], [[127569, 127569], "mapped", [21487]], [[127570, 127743], "disallowed"], [[127744, 127776], "valid", [], "NV8"], [[127777, 127788], "valid", [], "NV8"], [[127789, 127791], "valid", [], "NV8"], [[127792, 127797], "valid", [], "NV8"], [[127798, 127798], "valid", [], "NV8"], [[127799, 127868], "valid", [], "NV8"], [[127869, 127869], "valid", [], "NV8"], [[127870, 127871], "valid", [], "NV8"], [[127872, 127891], "valid", [], "NV8"], [[127892, 127903], "valid", [], "NV8"], [[127904, 127940], "valid", [], "NV8"], [[127941, 127941], "valid", [], "NV8"], [[127942, 127946], "valid", [], "NV8"], [[127947, 127950], "valid", [], "NV8"], [[127951, 127955], "valid", [], "NV8"], [[127956, 127967], "valid", [], "NV8"], [[127968, 127984], "valid", [], "NV8"], [[127985, 127991], "valid", [], "NV8"], [[127992, 127999], "valid", [], "NV8"], [[128e3, 128062], "valid", [], "NV8"], [[128063, 128063], "valid", [], "NV8"], [[128064, 128064], "valid", [], "NV8"], [[128065, 128065], "valid", [], "NV8"], [[128066, 128247], "valid", [], "NV8"], [[128248, 128248], "valid", [], "NV8"], [[128249, 128252], "valid", [], "NV8"], [[128253, 128254], "valid", [], "NV8"], [[128255, 128255], "valid", [], "NV8"], [[128256, 128317], "valid", [], "NV8"], [[128318, 128319], "valid", [], "NV8"], [[128320, 128323], "valid", [], "NV8"], [[128324, 128330], "valid", [], "NV8"], [[128331, 128335], "valid", [], "NV8"], [[128336, 128359], "valid", [], "NV8"], [[128360, 128377], "valid", [], "NV8"], [[128378, 128378], "disallowed"], [[128379, 128419], "valid", [], "NV8"], [[128420, 128420], "disallowed"], [[128421, 128506], "valid", [], "NV8"], [[128507, 128511], "valid", [], "NV8"], [[128512, 128512], "valid", [], "NV8"], [[128513, 128528], "valid", [], "NV8"], [[128529, 128529], "valid", [], "NV8"], [[128530, 128532], "valid", [], "NV8"], [[128533, 128533], "valid", [], "NV8"], [[128534, 128534], "valid", [], "NV8"], [[128535, 128535], "valid", [], "NV8"], [[128536, 128536], "valid", [], "NV8"], [[128537, 128537], "valid", [], "NV8"], [[128538, 128538], "valid", [], "NV8"], [[128539, 128539], "valid", [], "NV8"], [[128540, 128542], "valid", [], "NV8"], [[128543, 128543], "valid", [], "NV8"], [[128544, 128549], "valid", [], "NV8"], [[128550, 128551], "valid", [], "NV8"], [[128552, 128555], "valid", [], "NV8"], [[128556, 128556], "valid", [], "NV8"], [[128557, 128557], "valid", [], "NV8"], [[128558, 128559], "valid", [], "NV8"], [[128560, 128563], "valid", [], "NV8"], [[128564, 128564], "valid", [], "NV8"], [[128565, 128576], "valid", [], "NV8"], [[128577, 128578], "valid", [], "NV8"], [[128579, 128580], "valid", [], "NV8"], [[128581, 128591], "valid", [], "NV8"], [[128592, 128639], "valid", [], "NV8"], [[128640, 128709], "valid", [], "NV8"], [[128710, 128719], "valid", [], "NV8"], [[128720, 128720], "valid", [], "NV8"], [[128721, 128735], "disallowed"], [[128736, 128748], "valid", [], "NV8"], [[128749, 128751], "disallowed"], [[128752, 128755], "valid", [], "NV8"], [[128756, 128767], "disallowed"], [[128768, 128883], "valid", [], "NV8"], [[128884, 128895], "disallowed"], [[128896, 128980], "valid", [], "NV8"], [[128981, 129023], "disallowed"], [[129024, 129035], "valid", [], "NV8"], [[129036, 129039], "disallowed"], [[129040, 129095], "valid", [], "NV8"], [[129096, 129103], "disallowed"], [[129104, 129113], "valid", [], "NV8"], [[129114, 129119], "disallowed"], [[129120, 129159], "valid", [], "NV8"], [[129160, 129167], "disallowed"], [[129168, 129197], "valid", [], "NV8"], [[129198, 129295], "disallowed"], [[129296, 129304], "valid", [], "NV8"], [[129305, 129407], "disallowed"], [[129408, 129412], "valid", [], "NV8"], [[129413, 129471], "disallowed"], [[129472, 129472], "valid", [], "NV8"], [[129473, 131069], "disallowed"], [[131070, 131071], "disallowed"], [[131072, 173782], "valid"], [[173783, 173823], "disallowed"], [[173824, 177972], "valid"], [[177973, 177983], "disallowed"], [[177984, 178205], "valid"], [[178206, 178207], "disallowed"], [[178208, 183969], "valid"], [[183970, 194559], "disallowed"], [[194560, 194560], "mapped", [20029]], [[194561, 194561], "mapped", [20024]], [[194562, 194562], "mapped", [20033]], [[194563, 194563], "mapped", [131362]], [[194564, 194564], "mapped", [20320]], [[194565, 194565], "mapped", [20398]], [[194566, 194566], "mapped", [20411]], [[194567, 194567], "mapped", [20482]], [[194568, 194568], "mapped", [20602]], [[194569, 194569], "mapped", [20633]], [[194570, 194570], "mapped", [20711]], [[194571, 194571], "mapped", [20687]], [[194572, 194572], "mapped", [13470]], [[194573, 194573], "mapped", [132666]], [[194574, 194574], "mapped", [20813]], [[194575, 194575], "mapped", [20820]], [[194576, 194576], "mapped", [20836]], [[194577, 194577], "mapped", [20855]], [[194578, 194578], "mapped", [132380]], [[194579, 194579], "mapped", [13497]], [[194580, 194580], "mapped", [20839]], [[194581, 194581], "mapped", [20877]], [[194582, 194582], "mapped", [132427]], [[194583, 194583], "mapped", [20887]], [[194584, 194584], "mapped", [20900]], [[194585, 194585], "mapped", [20172]], [[194586, 194586], "mapped", [20908]], [[194587, 194587], "mapped", [20917]], [[194588, 194588], "mapped", [168415]], [[194589, 194589], "mapped", [20981]], [[194590, 194590], "mapped", [20995]], [[194591, 194591], "mapped", [13535]], [[194592, 194592], "mapped", [21051]], [[194593, 194593], "mapped", [21062]], [[194594, 194594], "mapped", [21106]], [[194595, 194595], "mapped", [21111]], [[194596, 194596], "mapped", [13589]], [[194597, 194597], "mapped", [21191]], [[194598, 194598], "mapped", [21193]], [[194599, 194599], "mapped", [21220]], [[194600, 194600], "mapped", [21242]], [[194601, 194601], "mapped", [21253]], [[194602, 194602], "mapped", [21254]], [[194603, 194603], "mapped", [21271]], [[194604, 194604], "mapped", [21321]], [[194605, 194605], "mapped", [21329]], [[194606, 194606], "mapped", [21338]], [[194607, 194607], "mapped", [21363]], [[194608, 194608], "mapped", [21373]], [[194609, 194611], "mapped", [21375]], [[194612, 194612], "mapped", [133676]], [[194613, 194613], "mapped", [28784]], [[194614, 194614], "mapped", [21450]], [[194615, 194615], "mapped", [21471]], [[194616, 194616], "mapped", [133987]], [[194617, 194617], "mapped", [21483]], [[194618, 194618], "mapped", [21489]], [[194619, 194619], "mapped", [21510]], [[194620, 194620], "mapped", [21662]], [[194621, 194621], "mapped", [21560]], [[194622, 194622], "mapped", [21576]], [[194623, 194623], "mapped", [21608]], [[194624, 194624], "mapped", [21666]], [[194625, 194625], "mapped", [21750]], [[194626, 194626], "mapped", [21776]], [[194627, 194627], "mapped", [21843]], [[194628, 194628], "mapped", [21859]], [[194629, 194630], "mapped", [21892]], [[194631, 194631], "mapped", [21913]], [[194632, 194632], "mapped", [21931]], [[194633, 194633], "mapped", [21939]], [[194634, 194634], "mapped", [21954]], [[194635, 194635], "mapped", [22294]], [[194636, 194636], "mapped", [22022]], [[194637, 194637], "mapped", [22295]], [[194638, 194638], "mapped", [22097]], [[194639, 194639], "mapped", [22132]], [[194640, 194640], "mapped", [20999]], [[194641, 194641], "mapped", [22766]], [[194642, 194642], "mapped", [22478]], [[194643, 194643], "mapped", [22516]], [[194644, 194644], "mapped", [22541]], [[194645, 194645], "mapped", [22411]], [[194646, 194646], "mapped", [22578]], [[194647, 194647], "mapped", [22577]], [[194648, 194648], "mapped", [22700]], [[194649, 194649], "mapped", [136420]], [[194650, 194650], "mapped", [22770]], [[194651, 194651], "mapped", [22775]], [[194652, 194652], "mapped", [22790]], [[194653, 194653], "mapped", [22810]], [[194654, 194654], "mapped", [22818]], [[194655, 194655], "mapped", [22882]], [[194656, 194656], "mapped", [136872]], [[194657, 194657], "mapped", [136938]], [[194658, 194658], "mapped", [23020]], [[194659, 194659], "mapped", [23067]], [[194660, 194660], "mapped", [23079]], [[194661, 194661], "mapped", [23e3]], [[194662, 194662], "mapped", [23142]], [[194663, 194663], "mapped", [14062]], [[194664, 194664], "disallowed"], [[194665, 194665], "mapped", [23304]], [[194666, 194667], "mapped", [23358]], [[194668, 194668], "mapped", [137672]], [[194669, 194669], "mapped", [23491]], [[194670, 194670], "mapped", [23512]], [[194671, 194671], "mapped", [23527]], [[194672, 194672], "mapped", [23539]], [[194673, 194673], "mapped", [138008]], [[194674, 194674], "mapped", [23551]], [[194675, 194675], "mapped", [23558]], [[194676, 194676], "disallowed"], [[194677, 194677], "mapped", [23586]], [[194678, 194678], "mapped", [14209]], [[194679, 194679], "mapped", [23648]], [[194680, 194680], "mapped", [23662]], [[194681, 194681], "mapped", [23744]], [[194682, 194682], "mapped", [23693]], [[194683, 194683], "mapped", [138724]], [[194684, 194684], "mapped", [23875]], [[194685, 194685], "mapped", [138726]], [[194686, 194686], "mapped", [23918]], [[194687, 194687], "mapped", [23915]], [[194688, 194688], "mapped", [23932]], [[194689, 194689], "mapped", [24033]], [[194690, 194690], "mapped", [24034]], [[194691, 194691], "mapped", [14383]], [[194692, 194692], "mapped", [24061]], [[194693, 194693], "mapped", [24104]], [[194694, 194694], "mapped", [24125]], [[194695, 194695], "mapped", [24169]], [[194696, 194696], "mapped", [14434]], [[194697, 194697], "mapped", [139651]], [[194698, 194698], "mapped", [14460]], [[194699, 194699], "mapped", [24240]], [[194700, 194700], "mapped", [24243]], [[194701, 194701], "mapped", [24246]], [[194702, 194702], "mapped", [24266]], [[194703, 194703], "mapped", [172946]], [[194704, 194704], "mapped", [24318]], [[194705, 194706], "mapped", [140081]], [[194707, 194707], "mapped", [33281]], [[194708, 194709], "mapped", [24354]], [[194710, 194710], "mapped", [14535]], [[194711, 194711], "mapped", [144056]], [[194712, 194712], "mapped", [156122]], [[194713, 194713], "mapped", [24418]], [[194714, 194714], "mapped", [24427]], [[194715, 194715], "mapped", [14563]], [[194716, 194716], "mapped", [24474]], [[194717, 194717], "mapped", [24525]], [[194718, 194718], "mapped", [24535]], [[194719, 194719], "mapped", [24569]], [[194720, 194720], "mapped", [24705]], [[194721, 194721], "mapped", [14650]], [[194722, 194722], "mapped", [14620]], [[194723, 194723], "mapped", [24724]], [[194724, 194724], "mapped", [141012]], [[194725, 194725], "mapped", [24775]], [[194726, 194726], "mapped", [24904]], [[194727, 194727], "mapped", [24908]], [[194728, 194728], "mapped", [24910]], [[194729, 194729], "mapped", [24908]], [[194730, 194730], "mapped", [24954]], [[194731, 194731], "mapped", [24974]], [[194732, 194732], "mapped", [25010]], [[194733, 194733], "mapped", [24996]], [[194734, 194734], "mapped", [25007]], [[194735, 194735], "mapped", [25054]], [[194736, 194736], "mapped", [25074]], [[194737, 194737], "mapped", [25078]], [[194738, 194738], "mapped", [25104]], [[194739, 194739], "mapped", [25115]], [[194740, 194740], "mapped", [25181]], [[194741, 194741], "mapped", [25265]], [[194742, 194742], "mapped", [25300]], [[194743, 194743], "mapped", [25424]], [[194744, 194744], "mapped", [142092]], [[194745, 194745], "mapped", [25405]], [[194746, 194746], "mapped", [25340]], [[194747, 194747], "mapped", [25448]], [[194748, 194748], "mapped", [25475]], [[194749, 194749], "mapped", [25572]], [[194750, 194750], "mapped", [142321]], [[194751, 194751], "mapped", [25634]], [[194752, 194752], "mapped", [25541]], [[194753, 194753], "mapped", [25513]], [[194754, 194754], "mapped", [14894]], [[194755, 194755], "mapped", [25705]], [[194756, 194756], "mapped", [25726]], [[194757, 194757], "mapped", [25757]], [[194758, 194758], "mapped", [25719]], [[194759, 194759], "mapped", [14956]], [[194760, 194760], "mapped", [25935]], [[194761, 194761], "mapped", [25964]], [[194762, 194762], "mapped", [143370]], [[194763, 194763], "mapped", [26083]], [[194764, 194764], "mapped", [26360]], [[194765, 194765], "mapped", [26185]], [[194766, 194766], "mapped", [15129]], [[194767, 194767], "mapped", [26257]], [[194768, 194768], "mapped", [15112]], [[194769, 194769], "mapped", [15076]], [[194770, 194770], "mapped", [20882]], [[194771, 194771], "mapped", [20885]], [[194772, 194772], "mapped", [26368]], [[194773, 194773], "mapped", [26268]], [[194774, 194774], "mapped", [32941]], [[194775, 194775], "mapped", [17369]], [[194776, 194776], "mapped", [26391]], [[194777, 194777], "mapped", [26395]], [[194778, 194778], "mapped", [26401]], [[194779, 194779], "mapped", [26462]], [[194780, 194780], "mapped", [26451]], [[194781, 194781], "mapped", [144323]], [[194782, 194782], "mapped", [15177]], [[194783, 194783], "mapped", [26618]], [[194784, 194784], "mapped", [26501]], [[194785, 194785], "mapped", [26706]], [[194786, 194786], "mapped", [26757]], [[194787, 194787], "mapped", [144493]], [[194788, 194788], "mapped", [26766]], [[194789, 194789], "mapped", [26655]], [[194790, 194790], "mapped", [26900]], [[194791, 194791], "mapped", [15261]], [[194792, 194792], "mapped", [26946]], [[194793, 194793], "mapped", [27043]], [[194794, 194794], "mapped", [27114]], [[194795, 194795], "mapped", [27304]], [[194796, 194796], "mapped", [145059]], [[194797, 194797], "mapped", [27355]], [[194798, 194798], "mapped", [15384]], [[194799, 194799], "mapped", [27425]], [[194800, 194800], "mapped", [145575]], [[194801, 194801], "mapped", [27476]], [[194802, 194802], "mapped", [15438]], [[194803, 194803], "mapped", [27506]], [[194804, 194804], "mapped", [27551]], [[194805, 194805], "mapped", [27578]], [[194806, 194806], "mapped", [27579]], [[194807, 194807], "mapped", [146061]], [[194808, 194808], "mapped", [138507]], [[194809, 194809], "mapped", [146170]], [[194810, 194810], "mapped", [27726]], [[194811, 194811], "mapped", [146620]], [[194812, 194812], "mapped", [27839]], [[194813, 194813], "mapped", [27853]], [[194814, 194814], "mapped", [27751]], [[194815, 194815], "mapped", [27926]], [[194816, 194816], "mapped", [27966]], [[194817, 194817], "mapped", [28023]], [[194818, 194818], "mapped", [27969]], [[194819, 194819], "mapped", [28009]], [[194820, 194820], "mapped", [28024]], [[194821, 194821], "mapped", [28037]], [[194822, 194822], "mapped", [146718]], [[194823, 194823], "mapped", [27956]], [[194824, 194824], "mapped", [28207]], [[194825, 194825], "mapped", [28270]], [[194826, 194826], "mapped", [15667]], [[194827, 194827], "mapped", [28363]], [[194828, 194828], "mapped", [28359]], [[194829, 194829], "mapped", [147153]], [[194830, 194830], "mapped", [28153]], [[194831, 194831], "mapped", [28526]], [[194832, 194832], "mapped", [147294]], [[194833, 194833], "mapped", [147342]], [[194834, 194834], "mapped", [28614]], [[194835, 194835], "mapped", [28729]], [[194836, 194836], "mapped", [28702]], [[194837, 194837], "mapped", [28699]], [[194838, 194838], "mapped", [15766]], [[194839, 194839], "mapped", [28746]], [[194840, 194840], "mapped", [28797]], [[194841, 194841], "mapped", [28791]], [[194842, 194842], "mapped", [28845]], [[194843, 194843], "mapped", [132389]], [[194844, 194844], "mapped", [28997]], [[194845, 194845], "mapped", [148067]], [[194846, 194846], "mapped", [29084]], [[194847, 194847], "disallowed"], [[194848, 194848], "mapped", [29224]], [[194849, 194849], "mapped", [29237]], [[194850, 194850], "mapped", [29264]], [[194851, 194851], "mapped", [149e3]], [[194852, 194852], "mapped", [29312]], [[194853, 194853], "mapped", [29333]], [[194854, 194854], "mapped", [149301]], [[194855, 194855], "mapped", [149524]], [[194856, 194856], "mapped", [29562]], [[194857, 194857], "mapped", [29579]], [[194858, 194858], "mapped", [16044]], [[194859, 194859], "mapped", [29605]], [[194860, 194861], "mapped", [16056]], [[194862, 194862], "mapped", [29767]], [[194863, 194863], "mapped", [29788]], [[194864, 194864], "mapped", [29809]], [[194865, 194865], "mapped", [29829]], [[194866, 194866], "mapped", [29898]], [[194867, 194867], "mapped", [16155]], [[194868, 194868], "mapped", [29988]], [[194869, 194869], "mapped", [150582]], [[194870, 194870], "mapped", [30014]], [[194871, 194871], "mapped", [150674]], [[194872, 194872], "mapped", [30064]], [[194873, 194873], "mapped", [139679]], [[194874, 194874], "mapped", [30224]], [[194875, 194875], "mapped", [151457]], [[194876, 194876], "mapped", [151480]], [[194877, 194877], "mapped", [151620]], [[194878, 194878], "mapped", [16380]], [[194879, 194879], "mapped", [16392]], [[194880, 194880], "mapped", [30452]], [[194881, 194881], "mapped", [151795]], [[194882, 194882], "mapped", [151794]], [[194883, 194883], "mapped", [151833]], [[194884, 194884], "mapped", [151859]], [[194885, 194885], "mapped", [30494]], [[194886, 194887], "mapped", [30495]], [[194888, 194888], "mapped", [30538]], [[194889, 194889], "mapped", [16441]], [[194890, 194890], "mapped", [30603]], [[194891, 194891], "mapped", [16454]], [[194892, 194892], "mapped", [16534]], [[194893, 194893], "mapped", [152605]], [[194894, 194894], "mapped", [30798]], [[194895, 194895], "mapped", [30860]], [[194896, 194896], "mapped", [30924]], [[194897, 194897], "mapped", [16611]], [[194898, 194898], "mapped", [153126]], [[194899, 194899], "mapped", [31062]], [[194900, 194900], "mapped", [153242]], [[194901, 194901], "mapped", [153285]], [[194902, 194902], "mapped", [31119]], [[194903, 194903], "mapped", [31211]], [[194904, 194904], "mapped", [16687]], [[194905, 194905], "mapped", [31296]], [[194906, 194906], "mapped", [31306]], [[194907, 194907], "mapped", [31311]], [[194908, 194908], "mapped", [153980]], [[194909, 194910], "mapped", [154279]], [[194911, 194911], "disallowed"], [[194912, 194912], "mapped", [16898]], [[194913, 194913], "mapped", [154539]], [[194914, 194914], "mapped", [31686]], [[194915, 194915], "mapped", [31689]], [[194916, 194916], "mapped", [16935]], [[194917, 194917], "mapped", [154752]], [[194918, 194918], "mapped", [31954]], [[194919, 194919], "mapped", [17056]], [[194920, 194920], "mapped", [31976]], [[194921, 194921], "mapped", [31971]], [[194922, 194922], "mapped", [32e3]], [[194923, 194923], "mapped", [155526]], [[194924, 194924], "mapped", [32099]], [[194925, 194925], "mapped", [17153]], [[194926, 194926], "mapped", [32199]], [[194927, 194927], "mapped", [32258]], [[194928, 194928], "mapped", [32325]], [[194929, 194929], "mapped", [17204]], [[194930, 194930], "mapped", [156200]], [[194931, 194931], "mapped", [156231]], [[194932, 194932], "mapped", [17241]], [[194933, 194933], "mapped", [156377]], [[194934, 194934], "mapped", [32634]], [[194935, 194935], "mapped", [156478]], [[194936, 194936], "mapped", [32661]], [[194937, 194937], "mapped", [32762]], [[194938, 194938], "mapped", [32773]], [[194939, 194939], "mapped", [156890]], [[194940, 194940], "mapped", [156963]], [[194941, 194941], "mapped", [32864]], [[194942, 194942], "mapped", [157096]], [[194943, 194943], "mapped", [32880]], [[194944, 194944], "mapped", [144223]], [[194945, 194945], "mapped", [17365]], [[194946, 194946], "mapped", [32946]], [[194947, 194947], "mapped", [33027]], [[194948, 194948], "mapped", [17419]], [[194949, 194949], "mapped", [33086]], [[194950, 194950], "mapped", [23221]], [[194951, 194951], "mapped", [157607]], [[194952, 194952], "mapped", [157621]], [[194953, 194953], "mapped", [144275]], [[194954, 194954], "mapped", [144284]], [[194955, 194955], "mapped", [33281]], [[194956, 194956], "mapped", [33284]], [[194957, 194957], "mapped", [36766]], [[194958, 194958], "mapped", [17515]], [[194959, 194959], "mapped", [33425]], [[194960, 194960], "mapped", [33419]], [[194961, 194961], "mapped", [33437]], [[194962, 194962], "mapped", [21171]], [[194963, 194963], "mapped", [33457]], [[194964, 194964], "mapped", [33459]], [[194965, 194965], "mapped", [33469]], [[194966, 194966], "mapped", [33510]], [[194967, 194967], "mapped", [158524]], [[194968, 194968], "mapped", [33509]], [[194969, 194969], "mapped", [33565]], [[194970, 194970], "mapped", [33635]], [[194971, 194971], "mapped", [33709]], [[194972, 194972], "mapped", [33571]], [[194973, 194973], "mapped", [33725]], [[194974, 194974], "mapped", [33767]], [[194975, 194975], "mapped", [33879]], [[194976, 194976], "mapped", [33619]], [[194977, 194977], "mapped", [33738]], [[194978, 194978], "mapped", [33740]], [[194979, 194979], "mapped", [33756]], [[194980, 194980], "mapped", [158774]], [[194981, 194981], "mapped", [159083]], [[194982, 194982], "mapped", [158933]], [[194983, 194983], "mapped", [17707]], [[194984, 194984], "mapped", [34033]], [[194985, 194985], "mapped", [34035]], [[194986, 194986], "mapped", [34070]], [[194987, 194987], "mapped", [160714]], [[194988, 194988], "mapped", [34148]], [[194989, 194989], "mapped", [159532]], [[194990, 194990], "mapped", [17757]], [[194991, 194991], "mapped", [17761]], [[194992, 194992], "mapped", [159665]], [[194993, 194993], "mapped", [159954]], [[194994, 194994], "mapped", [17771]], [[194995, 194995], "mapped", [34384]], [[194996, 194996], "mapped", [34396]], [[194997, 194997], "mapped", [34407]], [[194998, 194998], "mapped", [34409]], [[194999, 194999], "mapped", [34473]], [[195e3, 195e3], "mapped", [34440]], [[195001, 195001], "mapped", [34574]], [[195002, 195002], "mapped", [34530]], [[195003, 195003], "mapped", [34681]], [[195004, 195004], "mapped", [34600]], [[195005, 195005], "mapped", [34667]], [[195006, 195006], "mapped", [34694]], [[195007, 195007], "disallowed"], [[195008, 195008], "mapped", [34785]], [[195009, 195009], "mapped", [34817]], [[195010, 195010], "mapped", [17913]], [[195011, 195011], "mapped", [34912]], [[195012, 195012], "mapped", [34915]], [[195013, 195013], "mapped", [161383]], [[195014, 195014], "mapped", [35031]], [[195015, 195015], "mapped", [35038]], [[195016, 195016], "mapped", [17973]], [[195017, 195017], "mapped", [35066]], [[195018, 195018], "mapped", [13499]], [[195019, 195019], "mapped", [161966]], [[195020, 195020], "mapped", [162150]], [[195021, 195021], "mapped", [18110]], [[195022, 195022], "mapped", [18119]], [[195023, 195023], "mapped", [35488]], [[195024, 195024], "mapped", [35565]], [[195025, 195025], "mapped", [35722]], [[195026, 195026], "mapped", [35925]], [[195027, 195027], "mapped", [162984]], [[195028, 195028], "mapped", [36011]], [[195029, 195029], "mapped", [36033]], [[195030, 195030], "mapped", [36123]], [[195031, 195031], "mapped", [36215]], [[195032, 195032], "mapped", [163631]], [[195033, 195033], "mapped", [133124]], [[195034, 195034], "mapped", [36299]], [[195035, 195035], "mapped", [36284]], [[195036, 195036], "mapped", [36336]], [[195037, 195037], "mapped", [133342]], [[195038, 195038], "mapped", [36564]], [[195039, 195039], "mapped", [36664]], [[195040, 195040], "mapped", [165330]], [[195041, 195041], "mapped", [165357]], [[195042, 195042], "mapped", [37012]], [[195043, 195043], "mapped", [37105]], [[195044, 195044], "mapped", [37137]], [[195045, 195045], "mapped", [165678]], [[195046, 195046], "mapped", [37147]], [[195047, 195047], "mapped", [37432]], [[195048, 195048], "mapped", [37591]], [[195049, 195049], "mapped", [37592]], [[195050, 195050], "mapped", [37500]], [[195051, 195051], "mapped", [37881]], [[195052, 195052], "mapped", [37909]], [[195053, 195053], "mapped", [166906]], [[195054, 195054], "mapped", [38283]], [[195055, 195055], "mapped", [18837]], [[195056, 195056], "mapped", [38327]], [[195057, 195057], "mapped", [167287]], [[195058, 195058], "mapped", [18918]], [[195059, 195059], "mapped", [38595]], [[195060, 195060], "mapped", [23986]], [[195061, 195061], "mapped", [38691]], [[195062, 195062], "mapped", [168261]], [[195063, 195063], "mapped", [168474]], [[195064, 195064], "mapped", [19054]], [[195065, 195065], "mapped", [19062]], [[195066, 195066], "mapped", [38880]], [[195067, 195067], "mapped", [168970]], [[195068, 195068], "mapped", [19122]], [[195069, 195069], "mapped", [169110]], [[195070, 195071], "mapped", [38923]], [[195072, 195072], "mapped", [38953]], [[195073, 195073], "mapped", [169398]], [[195074, 195074], "mapped", [39138]], [[195075, 195075], "mapped", [19251]], [[195076, 195076], "mapped", [39209]], [[195077, 195077], "mapped", [39335]], [[195078, 195078], "mapped", [39362]], [[195079, 195079], "mapped", [39422]], [[195080, 195080], "mapped", [19406]], [[195081, 195081], "mapped", [170800]], [[195082, 195082], "mapped", [39698]], [[195083, 195083], "mapped", [4e4]], [[195084, 195084], "mapped", [40189]], [[195085, 195085], "mapped", [19662]], [[195086, 195086], "mapped", [19693]], [[195087, 195087], "mapped", [40295]], [[195088, 195088], "mapped", [172238]], [[195089, 195089], "mapped", [19704]], [[195090, 195090], "mapped", [172293]], [[195091, 195091], "mapped", [172558]], [[195092, 195092], "mapped", [172689]], [[195093, 195093], "mapped", [40635]], [[195094, 195094], "mapped", [19798]], [[195095, 195095], "mapped", [40697]], [[195096, 195096], "mapped", [40702]], [[195097, 195097], "mapped", [40709]], [[195098, 195098], "mapped", [40719]], [[195099, 195099], "mapped", [40726]], [[195100, 195100], "mapped", [40763]], [[195101, 195101], "mapped", [173568]], [[195102, 196605], "disallowed"], [[196606, 196607], "disallowed"], [[196608, 262141], "disallowed"], [[262142, 262143], "disallowed"], [[262144, 327677], "disallowed"], [[327678, 327679], "disallowed"], [[327680, 393213], "disallowed"], [[393214, 393215], "disallowed"], [[393216, 458749], "disallowed"], [[458750, 458751], "disallowed"], [[458752, 524285], "disallowed"], [[524286, 524287], "disallowed"], [[524288, 589821], "disallowed"], [[589822, 589823], "disallowed"], [[589824, 655357], "disallowed"], [[655358, 655359], "disallowed"], [[655360, 720893], "disallowed"], [[720894, 720895], "disallowed"], [[720896, 786429], "disallowed"], [[786430, 786431], "disallowed"], [[786432, 851965], "disallowed"], [[851966, 851967], "disallowed"], [[851968, 917501], "disallowed"], [[917502, 917503], "disallowed"], [[917504, 917504], "disallowed"], [[917505, 917505], "disallowed"], [[917506, 917535], "disallowed"], [[917536, 917631], "disallowed"], [[917632, 917759], "disallowed"], [[917760, 917999], "ignored"], [[918e3, 983037], "disallowed"], [[983038, 983039], "disallowed"], [[983040, 1048573], "disallowed"], [[1048574, 1048575], "disallowed"], [[1048576, 1114109], "disallowed"], [[1114110, 1114111], "disallowed"]]; } }); -// node_modules/openai/resources/audio/audio.js -var require_audio = __commonJS({ - "node_modules/openai/resources/audio/audio.js"(exports2) { +// node_modules/tr46/index.js +var require_tr46 = __commonJS({ + "node_modules/tr46/index.js"(exports2, module) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + var punycode = __require("punycode"); + var mappingTable = require_mappingTable(); + var PROCESSING_OPTIONS = { + TRANSITIONAL: 0, + NONTRANSITIONAL: 1 + }; + function normalize5(str) { + return str.split("\0").map(function(s) { + return s.normalize("NFC"); + }).join("\0"); + } + function findStatus(val) { + var start = 0; + var end = mappingTable.length - 1; + while (start <= end) { + var mid = Math.floor((start + end) / 2); + var target = mappingTable[mid]; + if (target[0][0] <= val && target[0][1] >= val) { + return target; + } else if (target[0][0] > val) { + end = mid - 1; + } else { + start = mid + 1; + } } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + return null; + } + var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; + function countSymbols(string) { + return string.replace(regexAstralSymbols, "_").length; + } + function mapChars(domain_name, useSTD3, processing_option) { + var hasError = false; + var processed = ""; + var len = countSymbols(domain_name); + for (var i6 = 0; i6 < len; ++i6) { + var codePoint = domain_name.codePointAt(i6); + var status = findStatus(codePoint); + switch (status[1]) { + case "disallowed": + hasError = true; + processed += String.fromCodePoint(codePoint); + break; + case "ignored": + break; + case "mapped": + processed += String.fromCodePoint.apply(String, status[2]); + break; + case "deviation": + if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) { + processed += String.fromCodePoint.apply(String, status[2]); + } else { + processed += String.fromCodePoint(codePoint); + } + break; + case "valid": + processed += String.fromCodePoint(codePoint); + break; + case "disallowed_STD3_mapped": + if (useSTD3) { + hasError = true; + processed += String.fromCodePoint(codePoint); + } else { + processed += String.fromCodePoint.apply(String, status[2]); + } + break; + case "disallowed_STD3_valid": + if (useSTD3) { + hasError = true; + } + processed += String.fromCodePoint(codePoint); + break; + } } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Audio = void 0; - var resource_1 = require_resource(); - var SpeechAPI = __importStar(require_speech()); - var speech_1 = require_speech(); - var TranscriptionsAPI = __importStar(require_transcriptions()); - var transcriptions_1 = require_transcriptions(); - var TranslationsAPI = __importStar(require_translations()); - var translations_1 = require_translations(); - var Audio = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.transcriptions = new TranscriptionsAPI.Transcriptions(this._client); - this.translations = new TranslationsAPI.Translations(this._client); - this.speech = new SpeechAPI.Speech(this._client); + return { + string: processed, + error: hasError + }; + } + var combiningMarksRegex = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/; + function validateLabel(label, processing_option) { + if (label.substr(0, 4) === "xn--") { + label = punycode.toUnicode(label); + processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL; } - }; - exports2.Audio = Audio; - Audio.Transcriptions = transcriptions_1.Transcriptions; - Audio.Translations = translations_1.Translations; - Audio.Speech = speech_1.Speech; - } -}); - -// node_modules/openai/resources/batches.js -var require_batches = __commonJS({ - "node_modules/openai/resources/batches.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.BatchesPage = exports2.Batches = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var pagination_1 = require_pagination(); - var Batches = class extends resource_1.APIResource { - /** - * Creates and executes a batch from an uploaded file of requests - */ - create(body2, options) { - return this._client.post("/batches", { body: body2, ...options }); + var error2 = false; + if (normalize5(label) !== label || label[3] === "-" && label[4] === "-" || label[0] === "-" || label[label.length - 1] === "-" || label.indexOf(".") !== -1 || label.search(combiningMarksRegex) === 0) { + error2 = true; } - /** - * Retrieves a batch. - */ - retrieve(batchId, options) { - return this._client.get(`/batches/${batchId}`, options); + var len = countSymbols(label); + for (var i6 = 0; i6 < len; ++i6) { + var status = findStatus(label.codePointAt(i6)); + if (processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid" || processing === PROCESSING_OPTIONS.NONTRANSITIONAL && status[1] !== "valid" && status[1] !== "deviation") { + error2 = true; + break; + } } - list(query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list({}, query); + return { + label, + error: error2 + }; + } + function processing(domain_name, useSTD3, processing_option) { + var result = mapChars(domain_name, useSTD3, processing_option); + result.string = normalize5(result.string); + var labels = result.string.split("."); + for (var i6 = 0; i6 < labels.length; ++i6) { + try { + var validation2 = validateLabel(labels[i6]); + labels[i6] = validation2.label; + result.error = result.error || validation2.error; + } catch (e6) { + result.error = true; } - return this._client.getAPIList("/batches", BatchesPage, { query, ...options }); } - /** - * Cancels an in-progress batch. The batch will be in status `cancelling` for up to - * 10 minutes, before changing to `cancelled`, where it will have partial results - * (if any) available in the output file. - */ - cancel(batchId, options) { - return this._client.post(`/batches/${batchId}/cancel`, options); + return { + string: labels.join("."), + error: result.error + }; + } + module.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) { + var result = processing(domain_name, useSTD3, processing_option); + var labels = result.string.split("."); + labels = labels.map(function(l3) { + try { + return punycode.toASCII(l3); + } catch (e6) { + result.error = true; + return l3; + } + }); + if (verifyDnsLength) { + var total = labels.slice(0, labels.length - 1).join(".").length; + if (total.length > 253 || total.length === 0) { + result.error = true; + } + for (var i6 = 0; i6 < labels.length; ++i6) { + if (labels.length > 63 || labels.length === 0) { + result.error = true; + break; + } + } } + if (result.error) return null; + return labels.join("."); }; - exports2.Batches = Batches; - var BatchesPage = class extends pagination_1.CursorPage { + module.exports.toUnicode = function(domain_name, useSTD3) { + var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL); + return { + domain: result.string, + error: result.error + }; }; - exports2.BatchesPage = BatchesPage; - Batches.BatchesPage = BatchesPage; + module.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS; } }); -// node_modules/openai/lib/EventStream.js -var require_EventStream = __commonJS({ - "node_modules/openai/lib/EventStream.js"(exports2) { +// node_modules/whatwg-url/lib/url-state-machine.js +var require_url_state_machine = __commonJS({ + "node_modules/whatwg-url/lib/url-state-machine.js"(exports2, module) { "use strict"; - var __classPrivateFieldSet = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; - }; - var __classPrivateFieldGet = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); + var punycode = __require("punycode"); + var tr46 = require_tr46(); + var specialSchemes = { + ftp: 21, + file: null, + gopher: 70, + http: 80, + https: 443, + ws: 80, + wss: 443 }; - var _EventStream_instances; - var _EventStream_connectedPromise; - var _EventStream_resolveConnectedPromise; - var _EventStream_rejectConnectedPromise; - var _EventStream_endPromise; - var _EventStream_resolveEndPromise; - var _EventStream_rejectEndPromise; - var _EventStream_listeners; - var _EventStream_ended; - var _EventStream_errored; - var _EventStream_aborted; - var _EventStream_catchingPromiseCreated; - var _EventStream_handleError; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.EventStream = void 0; - var error_1 = require_error2(); - var EventStream = class { - constructor() { - _EventStream_instances.add(this); - this.controller = new AbortController(); - _EventStream_connectedPromise.set(this, void 0); - _EventStream_resolveConnectedPromise.set(this, () => { - }); - _EventStream_rejectConnectedPromise.set(this, () => { - }); - _EventStream_endPromise.set(this, void 0); - _EventStream_resolveEndPromise.set(this, () => { - }); - _EventStream_rejectEndPromise.set(this, () => { - }); - _EventStream_listeners.set(this, {}); - _EventStream_ended.set(this, false); - _EventStream_errored.set(this, false); - _EventStream_aborted.set(this, false); - _EventStream_catchingPromiseCreated.set(this, false); - __classPrivateFieldSet(this, _EventStream_connectedPromise, new Promise((resolve4, reject2) => { - __classPrivateFieldSet(this, _EventStream_resolveConnectedPromise, resolve4, "f"); - __classPrivateFieldSet(this, _EventStream_rejectConnectedPromise, reject2, "f"); - }), "f"); - __classPrivateFieldSet(this, _EventStream_endPromise, new Promise((resolve4, reject2) => { - __classPrivateFieldSet(this, _EventStream_resolveEndPromise, resolve4, "f"); - __classPrivateFieldSet(this, _EventStream_rejectEndPromise, reject2, "f"); - }), "f"); - __classPrivateFieldGet(this, _EventStream_connectedPromise, "f").catch(() => { - }); - __classPrivateFieldGet(this, _EventStream_endPromise, "f").catch(() => { - }); - } - _run(executor) { - setTimeout(() => { - executor().then(() => { - this._emitFinal(); - this._emit("end"); - }, __classPrivateFieldGet(this, _EventStream_instances, "m", _EventStream_handleError).bind(this)); - }, 0); - } - _connected() { - if (this.ended) - return; - __classPrivateFieldGet(this, _EventStream_resolveConnectedPromise, "f").call(this); - this._emit("connect"); - } - get ended() { - return __classPrivateFieldGet(this, _EventStream_ended, "f"); + var failure = /* @__PURE__ */ Symbol("failure"); + function countSymbols(str) { + return punycode.ucs2.decode(str).length; + } + function at2(input, idx) { + const c6 = input[idx]; + return isNaN(c6) ? void 0 : String.fromCodePoint(c6); + } + function isASCIIDigit(c6) { + return c6 >= 48 && c6 <= 57; + } + function isASCIIAlpha(c6) { + return c6 >= 65 && c6 <= 90 || c6 >= 97 && c6 <= 122; + } + function isASCIIAlphanumeric(c6) { + return isASCIIAlpha(c6) || isASCIIDigit(c6); + } + function isASCIIHex(c6) { + return isASCIIDigit(c6) || c6 >= 65 && c6 <= 70 || c6 >= 97 && c6 <= 102; + } + function isSingleDot(buffer2) { + return buffer2 === "." || buffer2.toLowerCase() === "%2e"; + } + function isDoubleDot(buffer2) { + buffer2 = buffer2.toLowerCase(); + return buffer2 === ".." || buffer2 === "%2e." || buffer2 === ".%2e" || buffer2 === "%2e%2e"; + } + function isWindowsDriveLetterCodePoints(cp1, cp2) { + return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124); + } + function isWindowsDriveLetterString(string) { + return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); + } + function isNormalizedWindowsDriveLetterString(string) { + return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; + } + function containsForbiddenHostCodePoint(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1; + } + function containsForbiddenHostCodePointExcludingPercent(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1; + } + function isSpecialScheme(scheme) { + return specialSchemes[scheme] !== void 0; + } + function isSpecial(url2) { + return isSpecialScheme(url2.scheme); + } + function defaultPort(scheme) { + return specialSchemes[scheme]; + } + function percentEncode(c6) { + let hex = c6.toString(16).toUpperCase(); + if (hex.length === 1) { + hex = "0" + hex; } - get errored() { - return __classPrivateFieldGet(this, _EventStream_errored, "f"); + return "%" + hex; + } + function utf8PercentEncode(c6) { + const buf = new Buffer(c6); + let str = ""; + for (let i6 = 0; i6 < buf.length; ++i6) { + str += percentEncode(buf[i6]); } - get aborted() { - return __classPrivateFieldGet(this, _EventStream_aborted, "f"); + return str; + } + function utf8PercentDecode(str) { + const input = new Buffer(str); + const output = []; + for (let i6 = 0; i6 < input.length; ++i6) { + if (input[i6] !== 37) { + output.push(input[i6]); + } else if (input[i6] === 37 && isASCIIHex(input[i6 + 1]) && isASCIIHex(input[i6 + 2])) { + output.push(parseInt(input.slice(i6 + 1, i6 + 3).toString(), 16)); + i6 += 2; + } else { + output.push(input[i6]); + } } - abort() { - this.controller.abort(); + return new Buffer(output).toString(); + } + function isC0ControlPercentEncode(c6) { + return c6 <= 31 || c6 > 126; + } + var extraPathPercentEncodeSet = /* @__PURE__ */ new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]); + function isPathPercentEncode(c6) { + return isC0ControlPercentEncode(c6) || extraPathPercentEncodeSet.has(c6); + } + var extraUserinfoPercentEncodeSet = /* @__PURE__ */ new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]); + function isUserinfoPercentEncode(c6) { + return isPathPercentEncode(c6) || extraUserinfoPercentEncodeSet.has(c6); + } + function percentEncodeChar(c6, encodeSetPredicate) { + const cStr = String.fromCodePoint(c6); + if (encodeSetPredicate(c6)) { + return utf8PercentEncode(cStr); } - /** - * Adds the listener function to the end of the listeners array for the event. - * No checks are made to see if the listener has already been added. Multiple calls passing - * the same combination of event and listener will result in the listener being added, and - * called, multiple times. - * @returns this ChatCompletionStream, so that calls can be chained - */ - on(event, listener) { - const listeners = __classPrivateFieldGet(this, _EventStream_listeners, "f")[event] || (__classPrivateFieldGet(this, _EventStream_listeners, "f")[event] = []); - listeners.push({ listener }); - return this; + return cStr; + } + function parseIPv4Number(input) { + let R2 = 10; + if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { + input = input.substring(2); + R2 = 16; + } else if (input.length >= 2 && input.charAt(0) === "0") { + input = input.substring(1); + R2 = 8; } - /** - * Removes the specified listener from the listener array for the event. - * off() will remove, at most, one instance of a listener from the listener array. If any single - * listener has been added multiple times to the listener array for the specified event, then - * off() must be called multiple times to remove each instance. - * @returns this ChatCompletionStream, so that calls can be chained - */ - off(event, listener) { - const listeners = __classPrivateFieldGet(this, _EventStream_listeners, "f")[event]; - if (!listeners) - return this; - const index2 = listeners.findIndex((l6) => l6.listener === listener); - if (index2 >= 0) - listeners.splice(index2, 1); - return this; + if (input === "") { + return 0; } - /** - * Adds a one-time listener function for the event. The next time the event is triggered, - * this listener is removed and then invoked. - * @returns this ChatCompletionStream, so that calls can be chained - */ - once(event, listener) { - const listeners = __classPrivateFieldGet(this, _EventStream_listeners, "f")[event] || (__classPrivateFieldGet(this, _EventStream_listeners, "f")[event] = []); - listeners.push({ listener, once: true }); - return this; + const regex3 = R2 === 10 ? /[^0-9]/ : R2 === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/; + if (regex3.test(input)) { + return failure; } - /** - * This is similar to `.once()`, but returns a Promise that resolves the next time - * the event is triggered, instead of calling a listener callback. - * @returns a Promise that resolves the next time given event is triggered, - * or rejects if an error is emitted. (If you request the 'error' event, - * returns a promise that resolves with the error). - * - * Example: - * - * const message = await stream.emitted('message') // rejects if the stream errors - */ - emitted(event) { - return new Promise((resolve4, reject2) => { - __classPrivateFieldSet(this, _EventStream_catchingPromiseCreated, true, "f"); - if (event !== "error") - this.once("error", reject2); - this.once(event, resolve4); - }); + return parseInt(input, R2); + } + function parseIPv4(input) { + const parts = input.split("."); + if (parts[parts.length - 1] === "") { + if (parts.length > 1) { + parts.pop(); + } } - async done() { - __classPrivateFieldSet(this, _EventStream_catchingPromiseCreated, true, "f"); - await __classPrivateFieldGet(this, _EventStream_endPromise, "f"); + if (parts.length > 4) { + return input; } - _emit(event, ...args) { - if (__classPrivateFieldGet(this, _EventStream_ended, "f")) { - return; - } - if (event === "end") { - __classPrivateFieldSet(this, _EventStream_ended, true, "f"); - __classPrivateFieldGet(this, _EventStream_resolveEndPromise, "f").call(this); - } - const listeners = __classPrivateFieldGet(this, _EventStream_listeners, "f")[event]; - if (listeners) { - __classPrivateFieldGet(this, _EventStream_listeners, "f")[event] = listeners.filter((l6) => !l6.once); - listeners.forEach(({ listener }) => listener(...args)); - } - if (event === "abort") { - const error2 = args[0]; - if (!__classPrivateFieldGet(this, _EventStream_catchingPromiseCreated, "f") && !listeners?.length) { - Promise.reject(error2); - } - __classPrivateFieldGet(this, _EventStream_rejectConnectedPromise, "f").call(this, error2); - __classPrivateFieldGet(this, _EventStream_rejectEndPromise, "f").call(this, error2); - this._emit("end"); - return; + const numbers = []; + for (const part of parts) { + if (part === "") { + return input; } - if (event === "error") { - const error2 = args[0]; - if (!__classPrivateFieldGet(this, _EventStream_catchingPromiseCreated, "f") && !listeners?.length) { - Promise.reject(error2); - } - __classPrivateFieldGet(this, _EventStream_rejectConnectedPromise, "f").call(this, error2); - __classPrivateFieldGet(this, _EventStream_rejectEndPromise, "f").call(this, error2); - this._emit("end"); + const n8 = parseIPv4Number(part); + if (n8 === failure) { + return input; } + numbers.push(n8); } - _emitFinal() { - } - }; - exports2.EventStream = EventStream; - _EventStream_connectedPromise = /* @__PURE__ */ new WeakMap(), _EventStream_resolveConnectedPromise = /* @__PURE__ */ new WeakMap(), _EventStream_rejectConnectedPromise = /* @__PURE__ */ new WeakMap(), _EventStream_endPromise = /* @__PURE__ */ new WeakMap(), _EventStream_resolveEndPromise = /* @__PURE__ */ new WeakMap(), _EventStream_rejectEndPromise = /* @__PURE__ */ new WeakMap(), _EventStream_listeners = /* @__PURE__ */ new WeakMap(), _EventStream_ended = /* @__PURE__ */ new WeakMap(), _EventStream_errored = /* @__PURE__ */ new WeakMap(), _EventStream_aborted = /* @__PURE__ */ new WeakMap(), _EventStream_catchingPromiseCreated = /* @__PURE__ */ new WeakMap(), _EventStream_instances = /* @__PURE__ */ new WeakSet(), _EventStream_handleError = function _EventStream_handleError2(error2) { - __classPrivateFieldSet(this, _EventStream_errored, true, "f"); - if (error2 instanceof Error && error2.name === "AbortError") { - error2 = new error_1.APIUserAbortError(); + for (let i6 = 0; i6 < numbers.length - 1; ++i6) { + if (numbers[i6] > 255) { + return failure; + } } - if (error2 instanceof error_1.APIUserAbortError) { - __classPrivateFieldSet(this, _EventStream_aborted, true, "f"); - return this._emit("abort", error2); + if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) { + return failure; } - if (error2 instanceof error_1.OpenAIError) { - return this._emit("error", error2); + let ipv4 = numbers.pop(); + let counter = 0; + for (const n8 of numbers) { + ipv4 += n8 * Math.pow(256, 3 - counter); + ++counter; } - if (error2 instanceof Error) { - const openAIError = new error_1.OpenAIError(error2.message); - openAIError.cause = error2; - return this._emit("error", openAIError); - } - return this._emit("error", new error_1.OpenAIError(String(error2))); - }; - } -}); - -// node_modules/openai/lib/AssistantStream.js -var require_AssistantStream = __commonJS({ - "node_modules/openai/lib/AssistantStream.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; - } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + return ipv4; + } + function serializeIPv4(address) { + let output = ""; + let n8 = address; + for (let i6 = 1; i6 <= 4; ++i6) { + output = String(n8 % 256) + output; + if (i6 !== 4) { + output = "." + output; + } + n8 = Math.floor(n8 / 256); } - __setModuleDefault(result, mod); - return result; - }; - var __classPrivateFieldGet = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); - }; - var __classPrivateFieldSet = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; - }; - var _AssistantStream_instances; - var _AssistantStream_events; - var _AssistantStream_runStepSnapshots; - var _AssistantStream_messageSnapshots; - var _AssistantStream_messageSnapshot; - var _AssistantStream_finalRun; - var _AssistantStream_currentContentIndex; - var _AssistantStream_currentContent; - var _AssistantStream_currentToolCallIndex; - var _AssistantStream_currentToolCall; - var _AssistantStream_currentEvent; - var _AssistantStream_currentRunSnapshot; - var _AssistantStream_currentRunStepSnapshot; - var _AssistantStream_addEvent; - var _AssistantStream_endRequest; - var _AssistantStream_handleMessage; - var _AssistantStream_handleRunStep; - var _AssistantStream_handleEvent; - var _AssistantStream_accumulateRunStep; - var _AssistantStream_accumulateMessage; - var _AssistantStream_accumulateContent; - var _AssistantStream_handleRun; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AssistantStream = void 0; - var Core = __importStar(require_core2()); - var streaming_1 = require_streaming(); - var error_1 = require_error2(); - var EventStream_1 = require_EventStream(); - var AssistantStream = class _AssistantStream extends EventStream_1.EventStream { - constructor() { - super(...arguments); - _AssistantStream_instances.add(this); - _AssistantStream_events.set(this, []); - _AssistantStream_runStepSnapshots.set(this, {}); - _AssistantStream_messageSnapshots.set(this, {}); - _AssistantStream_messageSnapshot.set(this, void 0); - _AssistantStream_finalRun.set(this, void 0); - _AssistantStream_currentContentIndex.set(this, void 0); - _AssistantStream_currentContent.set(this, void 0); - _AssistantStream_currentToolCallIndex.set(this, void 0); - _AssistantStream_currentToolCall.set(this, void 0); - _AssistantStream_currentEvent.set(this, void 0); - _AssistantStream_currentRunSnapshot.set(this, void 0); - _AssistantStream_currentRunStepSnapshot.set(this, void 0); + return output; + } + function parseIPv6(input) { + const address = [0, 0, 0, 0, 0, 0, 0, 0]; + let pieceIndex = 0; + let compress2 = null; + let pointer = 0; + input = punycode.ucs2.decode(input); + if (input[pointer] === 58) { + if (input[pointer + 1] !== 58) { + return failure; + } + pointer += 2; + ++pieceIndex; + compress2 = pieceIndex; } - [(_AssistantStream_events = /* @__PURE__ */ new WeakMap(), _AssistantStream_runStepSnapshots = /* @__PURE__ */ new WeakMap(), _AssistantStream_messageSnapshots = /* @__PURE__ */ new WeakMap(), _AssistantStream_messageSnapshot = /* @__PURE__ */ new WeakMap(), _AssistantStream_finalRun = /* @__PURE__ */ new WeakMap(), _AssistantStream_currentContentIndex = /* @__PURE__ */ new WeakMap(), _AssistantStream_currentContent = /* @__PURE__ */ new WeakMap(), _AssistantStream_currentToolCallIndex = /* @__PURE__ */ new WeakMap(), _AssistantStream_currentToolCall = /* @__PURE__ */ new WeakMap(), _AssistantStream_currentEvent = /* @__PURE__ */ new WeakMap(), _AssistantStream_currentRunSnapshot = /* @__PURE__ */ new WeakMap(), _AssistantStream_currentRunStepSnapshot = /* @__PURE__ */ new WeakMap(), _AssistantStream_instances = /* @__PURE__ */ new WeakSet(), Symbol.asyncIterator)]() { - const pushQueue = []; - const readQueue = []; - let done = false; - this.on("event", (event) => { - const reader = readQueue.shift(); - if (reader) { - reader.resolve(event); - } else { - pushQueue.push(event); - } - }); - this.on("end", () => { - done = true; - for (const reader of readQueue) { - reader.resolve(void 0); + while (pointer < input.length) { + if (pieceIndex === 8) { + return failure; + } + if (input[pointer] === 58) { + if (compress2 !== null) { + return failure; } - readQueue.length = 0; - }); - this.on("abort", (err) => { - done = true; - for (const reader of readQueue) { - reader.reject(err); + ++pointer; + ++pieceIndex; + compress2 = pieceIndex; + continue; + } + let value = 0; + let length = 0; + while (length < 4 && isASCIIHex(input[pointer])) { + value = value * 16 + parseInt(at2(input, pointer), 16); + ++pointer; + ++length; + } + if (input[pointer] === 46) { + if (length === 0) { + return failure; } - readQueue.length = 0; - }); - this.on("error", (err) => { - done = true; - for (const reader of readQueue) { - reader.reject(err); + pointer -= length; + if (pieceIndex > 6) { + return failure; } - readQueue.length = 0; - }); - return { - next: async () => { - if (!pushQueue.length) { - if (done) { - return { value: void 0, done: true }; + let numbersSeen = 0; + while (input[pointer] !== void 0) { + let ipv4Piece = null; + if (numbersSeen > 0) { + if (input[pointer] === 46 && numbersSeen < 4) { + ++pointer; + } else { + return failure; } - return new Promise((resolve4, reject2) => readQueue.push({ resolve: resolve4, reject: reject2 })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true }); } - const chunk = pushQueue.shift(); - return { value: chunk, done: false }; - }, - return: async () => { - this.abort(); - return { value: void 0, done: true }; + if (!isASCIIDigit(input[pointer])) { + return failure; + } + while (isASCIIDigit(input[pointer])) { + const number = parseInt(at2(input, pointer)); + if (ipv4Piece === null) { + ipv4Piece = number; + } else if (ipv4Piece === 0) { + return failure; + } else { + ipv4Piece = ipv4Piece * 10 + number; + } + if (ipv4Piece > 255) { + return failure; + } + ++pointer; + } + address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; + ++numbersSeen; + if (numbersSeen === 2 || numbersSeen === 4) { + ++pieceIndex; + } } - }; - } - static fromReadableStream(stream5) { - const runner = new _AssistantStream(); - runner._run(() => runner._fromReadableStream(stream5)); - return runner; - } - async _fromReadableStream(readableStream, options) { - const signal = options?.signal; - if (signal) { - if (signal.aborted) - this.controller.abort(); - signal.addEventListener("abort", () => this.controller.abort()); - } - this._connected(); - const stream5 = streaming_1.Stream.fromReadableStream(readableStream, this.controller); - for await (const event of stream5) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); - } - if (stream5.controller.signal?.aborted) { - throw new error_1.APIUserAbortError(); + if (numbersSeen !== 4) { + return failure; + } + break; + } else if (input[pointer] === 58) { + ++pointer; + if (input[pointer] === void 0) { + return failure; + } + } else if (input[pointer] !== void 0) { + return failure; } - return this._addRun(__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); - } - toReadableStream() { - const stream5 = new streaming_1.Stream(this[Symbol.asyncIterator].bind(this), this.controller); - return stream5.toReadableStream(); + address[pieceIndex] = value; + ++pieceIndex; } - static createToolAssistantStream(threadId, runId, runs, params, options) { - const runner = new _AssistantStream(); - runner._run(() => runner._runToolAssistantStream(threadId, runId, runs, params, { - ...options, - headers: { ...options?.headers, "X-Stainless-Helper-Method": "stream" } - })); - return runner; + if (compress2 !== null) { + let swaps = pieceIndex - compress2; + pieceIndex = 7; + while (pieceIndex !== 0 && swaps > 0) { + const temp = address[compress2 + swaps - 1]; + address[compress2 + swaps - 1] = address[pieceIndex]; + address[pieceIndex] = temp; + --pieceIndex; + --swaps; + } + } else if (compress2 === null && pieceIndex !== 8) { + return failure; } - async _createToolAssistantStream(run2, threadId, runId, params, options) { - const signal = options?.signal; - if (signal) { - if (signal.aborted) - this.controller.abort(); - signal.addEventListener("abort", () => this.controller.abort()); + return address; + } + function serializeIPv6(address) { + let output = ""; + const seqResult = findLongestZeroSequence(address); + const compress2 = seqResult.idx; + let ignore0 = false; + for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { + if (ignore0 && address[pieceIndex] === 0) { + continue; + } else if (ignore0) { + ignore0 = false; } - const body2 = { ...params, stream: true }; - const stream5 = await run2.submitToolOutputs(threadId, runId, body2, { - ...options, - signal: this.controller.signal - }); - this._connected(); - for await (const event of stream5) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); + if (compress2 === pieceIndex) { + const separator = pieceIndex === 0 ? "::" : ":"; + output += separator; + ignore0 = true; + continue; } - if (stream5.controller.signal?.aborted) { - throw new error_1.APIUserAbortError(); + output += address[pieceIndex].toString(16); + if (pieceIndex !== 7) { + output += ":"; } - return this._addRun(__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); - } - static createThreadAssistantStream(params, thread, options) { - const runner = new _AssistantStream(); - runner._run(() => runner._threadAssistantStream(params, thread, { - ...options, - headers: { ...options?.headers, "X-Stainless-Helper-Method": "stream" } - })); - return runner; - } - static createAssistantStream(threadId, runs, params, options) { - const runner = new _AssistantStream(); - runner._run(() => runner._runAssistantStream(threadId, runs, params, { - ...options, - headers: { ...options?.headers, "X-Stainless-Helper-Method": "stream" } - })); - return runner; - } - currentEvent() { - return __classPrivateFieldGet(this, _AssistantStream_currentEvent, "f"); - } - currentRun() { - return __classPrivateFieldGet(this, _AssistantStream_currentRunSnapshot, "f"); } - currentMessageSnapshot() { - return __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f"); + return output; + } + function parseHost(input, isSpecialArg) { + if (input[0] === "[") { + if (input[input.length - 1] !== "]") { + return failure; + } + return parseIPv6(input.substring(1, input.length - 1)); } - currentRunStepSnapshot() { - return __classPrivateFieldGet(this, _AssistantStream_currentRunStepSnapshot, "f"); + if (!isSpecialArg) { + return parseOpaqueHost(input); } - async finalRunSteps() { - await this.done(); - return Object.values(__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")); + const domain = utf8PercentDecode(input); + const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false); + if (asciiDomain === null) { + return failure; } - async finalMessages() { - await this.done(); - return Object.values(__classPrivateFieldGet(this, _AssistantStream_messageSnapshots, "f")); + if (containsForbiddenHostCodePoint(asciiDomain)) { + return failure; } - async finalRun() { - await this.done(); - if (!__classPrivateFieldGet(this, _AssistantStream_finalRun, "f")) - throw Error("Final run was not received."); - return __classPrivateFieldGet(this, _AssistantStream_finalRun, "f"); + const ipv4Host = parseIPv4(asciiDomain); + if (typeof ipv4Host === "number" || ipv4Host === failure) { + return ipv4Host; } - async _createThreadAssistantStream(thread, params, options) { - const signal = options?.signal; - if (signal) { - if (signal.aborted) - this.controller.abort(); - signal.addEventListener("abort", () => this.controller.abort()); - } - const body2 = { ...params, stream: true }; - const stream5 = await thread.createAndRun(body2, { ...options, signal: this.controller.signal }); - this._connected(); - for await (const event of stream5) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); - } - if (stream5.controller.signal?.aborted) { - throw new error_1.APIUserAbortError(); - } - return this._addRun(__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); + return asciiDomain; + } + function parseOpaqueHost(input) { + if (containsForbiddenHostCodePointExcludingPercent(input)) { + return failure; } - async _createAssistantStream(run2, threadId, params, options) { - const signal = options?.signal; - if (signal) { - if (signal.aborted) - this.controller.abort(); - signal.addEventListener("abort", () => this.controller.abort()); - } - const body2 = { ...params, stream: true }; - const stream5 = await run2.create(threadId, body2, { ...options, signal: this.controller.signal }); - this._connected(); - for await (const event of stream5) { - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_addEvent).call(this, event); - } - if (stream5.controller.signal?.aborted) { - throw new error_1.APIUserAbortError(); - } - return this._addRun(__classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_endRequest).call(this)); + let output = ""; + const decoded = punycode.ucs2.decode(input); + for (let i6 = 0; i6 < decoded.length; ++i6) { + output += percentEncodeChar(decoded[i6], isC0ControlPercentEncode); } - static accumulateDelta(acc, delta) { - for (const [key, deltaValue] of Object.entries(delta)) { - if (!acc.hasOwnProperty(key)) { - acc[key] = deltaValue; - continue; - } - let accValue = acc[key]; - if (accValue === null || accValue === void 0) { - acc[key] = deltaValue; - continue; - } - if (key === "index" || key === "type") { - acc[key] = deltaValue; - continue; + return output; + } + function findLongestZeroSequence(arr) { + let maxIdx = null; + let maxLen = 1; + let currStart = null; + let currLen = 0; + for (let i6 = 0; i6 < arr.length; ++i6) { + if (arr[i6] !== 0) { + if (currLen > maxLen) { + maxIdx = currStart; + maxLen = currLen; } - if (typeof accValue === "string" && typeof deltaValue === "string") { - accValue += deltaValue; - } else if (typeof accValue === "number" && typeof deltaValue === "number") { - accValue += deltaValue; - } else if (Core.isObj(accValue) && Core.isObj(deltaValue)) { - accValue = this.accumulateDelta(accValue, deltaValue); - } else if (Array.isArray(accValue) && Array.isArray(deltaValue)) { - if (accValue.every((x6) => typeof x6 === "string" || typeof x6 === "number")) { - accValue.push(...deltaValue); - continue; - } - for (const deltaEntry of deltaValue) { - if (!Core.isObj(deltaEntry)) { - throw new Error(`Expected array delta entry to be an object but got: ${deltaEntry}`); - } - const index2 = deltaEntry["index"]; - if (index2 == null) { - console.error(deltaEntry); - throw new Error("Expected array delta entry to have an `index` property"); - } - if (typeof index2 !== "number") { - throw new Error(`Expected array delta entry \`index\` property to be a number but got ${index2}`); - } - const accEntry = accValue[index2]; - if (accEntry == null) { - accValue.push(deltaEntry); - } else { - accValue[index2] = this.accumulateDelta(accEntry, deltaEntry); - } - } - continue; - } else { - throw Error(`Unhandled record type: ${key}, deltaValue: ${deltaValue}, accValue: ${accValue}`); + currStart = null; + currLen = 0; + } else { + if (currStart === null) { + currStart = i6; } - acc[key] = accValue; + ++currLen; } - return acc; } - _addRun(run2) { - return run2; - } - async _threadAssistantStream(params, thread, options) { - return await this._createThreadAssistantStream(thread, params, options); + if (currLen > maxLen) { + maxIdx = currStart; + maxLen = currLen; } - async _runAssistantStream(threadId, runs, params, options) { - return await this._createAssistantStream(runs, threadId, params, options); + return { + idx: maxIdx, + len: maxLen + }; + } + function serializeHost(host) { + if (typeof host === "number") { + return serializeIPv4(host); } - async _runToolAssistantStream(threadId, runId, runs, params, options) { - return await this._createToolAssistantStream(runs, threadId, runId, params, options); + if (host instanceof Array) { + return "[" + serializeIPv6(host) + "]"; } - }; - exports2.AssistantStream = AssistantStream; - _AssistantStream_addEvent = function _AssistantStream_addEvent2(event) { - if (this.ended) + return host; + } + function trimControlChars(url2) { + return url2.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, ""); + } + function trimTabAndNewline(url2) { + return url2.replace(/\u0009|\u000A|\u000D/g, ""); + } + function shortenPath(url2) { + const path10 = url2.path; + if (path10.length === 0) { return; - __classPrivateFieldSet(this, _AssistantStream_currentEvent, event, "f"); - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_handleEvent).call(this, event); - switch (event.event) { - case "thread.created": - break; - case "thread.run.created": - case "thread.run.queued": - case "thread.run.in_progress": - case "thread.run.requires_action": - case "thread.run.completed": - case "thread.run.incomplete": - case "thread.run.failed": - case "thread.run.cancelling": - case "thread.run.cancelled": - case "thread.run.expired": - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_handleRun).call(this, event); - break; - case "thread.run.step.created": - case "thread.run.step.in_progress": - case "thread.run.step.delta": - case "thread.run.step.completed": - case "thread.run.step.failed": - case "thread.run.step.cancelled": - case "thread.run.step.expired": - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_handleRunStep).call(this, event); - break; - case "thread.message.created": - case "thread.message.in_progress": - case "thread.message.delta": - case "thread.message.completed": - case "thread.message.incomplete": - __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_handleMessage).call(this, event); - break; - case "error": - throw new Error("Encountered an error event in event processing - errors should be processed earlier"); - default: - assertNever(event); } - }, _AssistantStream_endRequest = function _AssistantStream_endRequest2() { - if (this.ended) { - throw new error_1.OpenAIError(`stream has ended, this shouldn't happen`); + if (url2.scheme === "file" && path10.length === 1 && isNormalizedWindowsDriveLetter(path10[0])) { + return; } - if (!__classPrivateFieldGet(this, _AssistantStream_finalRun, "f")) - throw Error("Final run has not been received"); - return __classPrivateFieldGet(this, _AssistantStream_finalRun, "f"); - }, _AssistantStream_handleMessage = function _AssistantStream_handleMessage2(event) { - const [accumulatedMessage, newContent] = __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_accumulateMessage).call(this, event, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); - __classPrivateFieldSet(this, _AssistantStream_messageSnapshot, accumulatedMessage, "f"); - __classPrivateFieldGet(this, _AssistantStream_messageSnapshots, "f")[accumulatedMessage.id] = accumulatedMessage; - for (const content of newContent) { - const snapshotContent = accumulatedMessage.content[content.index]; - if (snapshotContent?.type == "text") { - this._emit("textCreated", snapshotContent.text); + path10.pop(); + } + function includesCredentials(url2) { + return url2.username !== "" || url2.password !== ""; + } + function cannotHaveAUsernamePasswordPort(url2) { + return url2.host === null || url2.host === "" || url2.cannotBeABaseURL || url2.scheme === "file"; + } + function isNormalizedWindowsDriveLetter(string) { + return /^[A-Za-z]:$/.test(string); + } + function URLStateMachine(input, base, encodingOverride, url2, stateOverride) { + this.pointer = 0; + this.input = input; + this.base = base || null; + this.encodingOverride = encodingOverride || "utf-8"; + this.stateOverride = stateOverride; + this.url = url2; + this.failure = false; + this.parseError = false; + if (!this.url) { + this.url = { + scheme: "", + username: "", + password: "", + host: null, + port: null, + path: [], + query: null, + fragment: null, + cannotBeABaseURL: false + }; + const res2 = trimControlChars(this.input); + if (res2 !== this.input) { + this.parseError = true; } + this.input = res2; } - switch (event.event) { - case "thread.message.created": - this._emit("messageCreated", event.data); - break; - case "thread.message.in_progress": - break; - case "thread.message.delta": - this._emit("messageDelta", event.data.delta, accumulatedMessage); - if (event.data.delta.content) { - for (const content of event.data.delta.content) { - if (content.type == "text" && content.text) { - let textDelta = content.text; - let snapshot2 = accumulatedMessage.content[content.index]; - if (snapshot2 && snapshot2.type == "text") { - this._emit("textDelta", textDelta, snapshot2.text); - } else { - throw Error("The snapshot associated with this text delta is not text or missing"); - } - } - if (content.index != __classPrivateFieldGet(this, _AssistantStream_currentContentIndex, "f")) { - if (__classPrivateFieldGet(this, _AssistantStream_currentContent, "f")) { - switch (__classPrivateFieldGet(this, _AssistantStream_currentContent, "f").type) { - case "text": - this._emit("textDone", __classPrivateFieldGet(this, _AssistantStream_currentContent, "f").text, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); - break; - case "image_file": - this._emit("imageFileDone", __classPrivateFieldGet(this, _AssistantStream_currentContent, "f").image_file, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); - break; - } - } - __classPrivateFieldSet(this, _AssistantStream_currentContentIndex, content.index, "f"); - } - __classPrivateFieldSet(this, _AssistantStream_currentContent, accumulatedMessage.content[content.index], "f"); - } - } - break; - case "thread.message.completed": - case "thread.message.incomplete": - if (__classPrivateFieldGet(this, _AssistantStream_currentContentIndex, "f") !== void 0) { - const currentContent = event.data.content[__classPrivateFieldGet(this, _AssistantStream_currentContentIndex, "f")]; - if (currentContent) { - switch (currentContent.type) { - case "image_file": - this._emit("imageFileDone", currentContent.image_file, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); - break; - case "text": - this._emit("textDone", currentContent.text, __classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")); - break; - } - } - } - if (__classPrivateFieldGet(this, _AssistantStream_messageSnapshot, "f")) { - this._emit("messageDone", event.data); - } - __classPrivateFieldSet(this, _AssistantStream_messageSnapshot, void 0, "f"); + const res = trimTabAndNewline(this.input); + if (res !== this.input) { + this.parseError = true; } - }, _AssistantStream_handleRunStep = function _AssistantStream_handleRunStep2(event) { - const accumulatedRunStep = __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_accumulateRunStep).call(this, event); - __classPrivateFieldSet(this, _AssistantStream_currentRunStepSnapshot, accumulatedRunStep, "f"); - switch (event.event) { - case "thread.run.step.created": - this._emit("runStepCreated", event.data); - break; - case "thread.run.step.delta": - const delta = event.data.delta; - if (delta.step_details && delta.step_details.type == "tool_calls" && delta.step_details.tool_calls && accumulatedRunStep.step_details.type == "tool_calls") { - for (const toolCall of delta.step_details.tool_calls) { - if (toolCall.index == __classPrivateFieldGet(this, _AssistantStream_currentToolCallIndex, "f")) { - this._emit("toolCallDelta", toolCall, accumulatedRunStep.step_details.tool_calls[toolCall.index]); - } else { - if (__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")) { - this._emit("toolCallDone", __classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")); - } - __classPrivateFieldSet(this, _AssistantStream_currentToolCallIndex, toolCall.index, "f"); - __classPrivateFieldSet(this, _AssistantStream_currentToolCall, accumulatedRunStep.step_details.tool_calls[toolCall.index], "f"); - if (__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")) - this._emit("toolCallCreated", __classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")); - } - } - } - this._emit("runStepDelta", event.data.delta, accumulatedRunStep); - break; - case "thread.run.step.completed": - case "thread.run.step.failed": - case "thread.run.step.cancelled": - case "thread.run.step.expired": - __classPrivateFieldSet(this, _AssistantStream_currentRunStepSnapshot, void 0, "f"); - const details = event.data.step_details; - if (details.type == "tool_calls") { - if (__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")) { - this._emit("toolCallDone", __classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")); - __classPrivateFieldSet(this, _AssistantStream_currentToolCall, void 0, "f"); - } - } - this._emit("runStepDone", event.data, accumulatedRunStep); + this.input = res; + this.state = stateOverride || "scheme start"; + this.buffer = ""; + this.atFlag = false; + this.arrFlag = false; + this.passwordTokenSeenFlag = false; + this.input = punycode.ucs2.decode(this.input); + for (; this.pointer <= this.input.length; ++this.pointer) { + const c6 = this.input[this.pointer]; + const cStr = isNaN(c6) ? void 0 : String.fromCodePoint(c6); + const ret = this["parse " + this.state](c6, cStr); + if (!ret) { break; - case "thread.run.step.in_progress": + } else if (ret === failure) { + this.failure = true; break; + } } - }, _AssistantStream_handleEvent = function _AssistantStream_handleEvent2(event) { - __classPrivateFieldGet(this, _AssistantStream_events, "f").push(event); - this._emit("event", event); - }, _AssistantStream_accumulateRunStep = function _AssistantStream_accumulateRunStep2(event) { - switch (event.event) { - case "thread.run.step.created": - __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[event.data.id] = event.data; - return event.data; - case "thread.run.step.delta": - let snapshot2 = __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[event.data.id]; - if (!snapshot2) { - throw Error("Received a RunStepDelta before creation of a snapshot"); + } + URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c6, cStr) { + if (isASCIIAlpha(c6)) { + this.buffer += cStr.toLowerCase(); + this.state = "scheme"; + } else if (!this.stateOverride) { + this.state = "no scheme"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + return true; + }; + URLStateMachine.prototype["parse scheme"] = function parseScheme(c6, cStr) { + if (isASCIIAlphanumeric(c6) || c6 === 43 || c6 === 45 || c6 === 46) { + this.buffer += cStr.toLowerCase(); + } else if (c6 === 58) { + if (this.stateOverride) { + if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { + return false; } - let data = event.data; - if (data.delta) { - const accumulated = AssistantStream.accumulateDelta(snapshot2, data.delta); - __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[event.data.id] = accumulated; + if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { + return false; } - return __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[event.data.id]; - case "thread.run.step.completed": - case "thread.run.step.failed": - case "thread.run.step.cancelled": - case "thread.run.step.expired": - case "thread.run.step.in_progress": - __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[event.data.id] = event.data; - break; - } - if (__classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[event.data.id]) - return __classPrivateFieldGet(this, _AssistantStream_runStepSnapshots, "f")[event.data.id]; - throw new Error("No snapshot available"); - }, _AssistantStream_accumulateMessage = function _AssistantStream_accumulateMessage2(event, snapshot2) { - let newContent = []; - switch (event.event) { - case "thread.message.created": - return [event.data, newContent]; - case "thread.message.delta": - if (!snapshot2) { - throw Error("Received a delta with no existing snapshot (there should be one from message creation)"); + if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { + return false; } - let data = event.data; - if (data.delta.content) { - for (const contentElement of data.delta.content) { - if (contentElement.index in snapshot2.content) { - let currentContent = snapshot2.content[contentElement.index]; - snapshot2.content[contentElement.index] = __classPrivateFieldGet(this, _AssistantStream_instances, "m", _AssistantStream_accumulateContent).call(this, contentElement, currentContent); - } else { - snapshot2.content[contentElement.index] = contentElement; - newContent.push(contentElement); - } - } + if (this.url.scheme === "file" && (this.url.host === "" || this.url.host === null)) { + return false; } - return [snapshot2, newContent]; - case "thread.message.in_progress": - case "thread.message.completed": - case "thread.message.incomplete": - if (snapshot2) { - return [snapshot2, newContent]; - } else { - throw Error("Received thread message event with no existing snapshot"); + } + this.url.scheme = this.buffer; + this.buffer = ""; + if (this.stateOverride) { + return false; + } + if (this.url.scheme === "file") { + if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) { + this.parseError = true; } + this.state = "file"; + } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { + this.state = "special relative or authority"; + } else if (isSpecial(this.url)) { + this.state = "special authority slashes"; + } else if (this.input[this.pointer + 1] === 47) { + this.state = "path or authority"; + ++this.pointer; + } else { + this.url.cannotBeABaseURL = true; + this.url.path.push(""); + this.state = "cannot-be-a-base-URL path"; + } + } else if (!this.stateOverride) { + this.buffer = ""; + this.state = "no scheme"; + this.pointer = -1; + } else { + this.parseError = true; + return failure; } - throw Error("Tried to accumulate a non-message event"); - }, _AssistantStream_accumulateContent = function _AssistantStream_accumulateContent2(contentElement, currentContent) { - return AssistantStream.accumulateDelta(currentContent, contentElement); - }, _AssistantStream_handleRun = function _AssistantStream_handleRun2(event) { - __classPrivateFieldSet(this, _AssistantStream_currentRunSnapshot, event.data, "f"); - switch (event.event) { - case "thread.run.created": - break; - case "thread.run.queued": - break; - case "thread.run.in_progress": - break; - case "thread.run.requires_action": - case "thread.run.cancelled": - case "thread.run.failed": - case "thread.run.completed": - case "thread.run.expired": - __classPrivateFieldSet(this, _AssistantStream_finalRun, event.data, "f"); - if (__classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")) { - this._emit("toolCallDone", __classPrivateFieldGet(this, _AssistantStream_currentToolCall, "f")); - __classPrivateFieldSet(this, _AssistantStream_currentToolCall, void 0, "f"); - } - break; - case "thread.run.cancelling": - break; + return true; + }; + URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c6) { + if (this.base === null || this.base.cannotBeABaseURL && c6 !== 35) { + return failure; + } else if (this.base.cannotBeABaseURL && c6 === 35) { + this.url.scheme = this.base.scheme; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.url.cannotBeABaseURL = true; + this.state = "fragment"; + } else if (this.base.scheme === "file") { + this.state = "file"; + --this.pointer; + } else { + this.state = "relative"; + --this.pointer; } + return true; }; - function assertNever(_x) { - } - } -}); - -// node_modules/openai/resources/beta/assistants.js -var require_assistants = __commonJS({ - "node_modules/openai/resources/beta/assistants.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AssistantsPage = exports2.Assistants = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var pagination_1 = require_pagination(); - var AssistantStream_1 = require_AssistantStream(); - var Assistants = class extends resource_1.APIResource { - /** - * Create an assistant with a model and instructions. - * - * @example - * ```ts - * const assistant = await client.beta.assistants.create({ - * model: 'gpt-4o', - * }); - * ``` - */ - create(body2, options) { - return this._client.post("/assistants", { - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c6) { + if (c6 === 47 && this.input[this.pointer + 1] === 47) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "relative"; + --this.pointer; } - /** - * Retrieves an assistant. - * - * @example - * ```ts - * const assistant = await client.beta.assistants.retrieve( - * 'assistant_id', - * ); - * ``` - */ - retrieve(assistantId, options) { - return this._client.get(`/assistants/${assistantId}`, { - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + return true; + }; + URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c6) { + if (c6 === 47) { + this.state = "authority"; + } else { + this.state = "path"; + --this.pointer; } - /** - * Modifies an assistant. - * - * @example - * ```ts - * const assistant = await client.beta.assistants.update( - * 'assistant_id', - * ); - * ``` - */ - update(assistantId, body2, options) { - return this._client.post(`/assistants/${assistantId}`, { - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + return true; + }; + URLStateMachine.prototype["parse relative"] = function parseRelative(c6) { + this.url.scheme = this.base.scheme; + if (isNaN(c6)) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + } else if (c6 === 47) { + this.state = "relative slash"; + } else if (c6 === 63) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = ""; + this.state = "query"; + } else if (c6 === 35) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else if (isSpecial(this.url) && c6 === 92) { + this.parseError = true; + this.state = "relative slash"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(0, this.base.path.length - 1); + this.state = "path"; + --this.pointer; } - list(query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list({}, query); + return true; + }; + URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c6) { + if (isSpecial(this.url) && (c6 === 47 || c6 === 92)) { + if (c6 === 92) { + this.parseError = true; } - return this._client.getAPIList("/assistants", AssistantsPage, { - query, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); - } - /** - * Delete an assistant. - * - * @example - * ```ts - * const assistantDeleted = await client.beta.assistants.del( - * 'assistant_id', - * ); - * ``` - */ - del(assistantId, options) { - return this._client.delete(`/assistants/${assistantId}`, { - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + this.state = "special authority ignore slashes"; + } else if (c6 === 47) { + this.state = "authority"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.state = "path"; + --this.pointer; } + return true; }; - exports2.Assistants = Assistants; - var AssistantsPage = class extends pagination_1.CursorPage { - }; - exports2.AssistantsPage = AssistantsPage; - Assistants.AssistantsPage = AssistantsPage; - } -}); - -// node_modules/openai/lib/RunnableFunction.js -var require_RunnableFunction = __commonJS({ - "node_modules/openai/lib/RunnableFunction.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ParsingToolFunction = exports2.ParsingFunction = exports2.isRunnableFunctionWithParse = void 0; - function isRunnableFunctionWithParse(fn) { - return typeof fn.parse === "function"; - } - exports2.isRunnableFunctionWithParse = isRunnableFunctionWithParse; - var ParsingFunction = class { - constructor(input) { - this.function = input.function; - this.parse = input.parse; - this.parameters = input.parameters; - this.description = input.description; - this.name = input.name; + URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c6) { + if (c6 === 47 && this.input[this.pointer + 1] === 47) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "special authority ignore slashes"; + --this.pointer; } + return true; }; - exports2.ParsingFunction = ParsingFunction; - var ParsingToolFunction = class { - constructor(input) { - this.type = "function"; - this.function = input; + URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c6) { + if (c6 !== 47 && c6 !== 92) { + this.state = "authority"; + --this.pointer; + } else { + this.parseError = true; } + return true; }; - exports2.ParsingToolFunction = ParsingToolFunction; - } -}); - -// node_modules/openai/lib/chatCompletionUtils.js -var require_chatCompletionUtils = __commonJS({ - "node_modules/openai/lib/chatCompletionUtils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isPresent = exports2.isToolMessage = exports2.isFunctionMessage = exports2.isAssistantMessage = void 0; - var isAssistantMessage = (message) => { - return message?.role === "assistant"; - }; - exports2.isAssistantMessage = isAssistantMessage; - var isFunctionMessage = (message) => { - return message?.role === "function"; - }; - exports2.isFunctionMessage = isFunctionMessage; - var isToolMessage = (message) => { - return message?.role === "tool"; - }; - exports2.isToolMessage = isToolMessage; - function isPresent(obj) { - return obj != null; - } - exports2.isPresent = isPresent; - } -}); - -// node_modules/openai/lib/parser.js -var require_parser3 = __commonJS({ - "node_modules/openai/lib/parser.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.validateInputTools = exports2.hasAutoParseableInput = exports2.shouldParseToolCall = exports2.parseChatCompletion = exports2.maybeParseChatCompletion = exports2.isAutoParsableTool = exports2.makeParseableTool = exports2.isAutoParsableResponseFormat = exports2.makeParseableTextFormat = exports2.makeParseableResponseFormat = void 0; - var error_1 = require_error2(); - function makeParseableResponseFormat(response_format, parser2) { - const obj = { ...response_format }; - Object.defineProperties(obj, { - $brand: { - value: "auto-parseable-response-format", - enumerable: false - }, - $parseRaw: { - value: parser2, - enumerable: false + URLStateMachine.prototype["parse authority"] = function parseAuthority(c6, cStr) { + if (c6 === 64) { + this.parseError = true; + if (this.atFlag) { + this.buffer = "%40" + this.buffer; } - }); - return obj; - } - exports2.makeParseableResponseFormat = makeParseableResponseFormat; - function makeParseableTextFormat(response_format, parser2) { - const obj = { ...response_format }; - Object.defineProperties(obj, { - $brand: { - value: "auto-parseable-response-format", - enumerable: false - }, - $parseRaw: { - value: parser2, - enumerable: false + this.atFlag = true; + const len = countSymbols(this.buffer); + for (let pointer = 0; pointer < len; ++pointer) { + const codePoint = this.buffer.codePointAt(pointer); + if (codePoint === 58 && !this.passwordTokenSeenFlag) { + this.passwordTokenSeenFlag = true; + continue; + } + const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode); + if (this.passwordTokenSeenFlag) { + this.url.password += encodedCodePoints; + } else { + this.url.username += encodedCodePoints; + } } - }); - return obj; - } - exports2.makeParseableTextFormat = makeParseableTextFormat; - function isAutoParsableResponseFormat(response_format) { - return response_format?.["$brand"] === "auto-parseable-response-format"; - } - exports2.isAutoParsableResponseFormat = isAutoParsableResponseFormat; - function makeParseableTool(tool, { parser: parser2, callback }) { - const obj = { ...tool }; - Object.defineProperties(obj, { - $brand: { - value: "auto-parseable-tool", - enumerable: false - }, - $parseRaw: { - value: parser2, - enumerable: false - }, - $callback: { - value: callback, - enumerable: false + this.buffer = ""; + } else if (isNaN(c6) || c6 === 47 || c6 === 63 || c6 === 35 || isSpecial(this.url) && c6 === 92) { + if (this.atFlag && this.buffer === "") { + this.parseError = true; + return failure; } - }); - return obj; - } - exports2.makeParseableTool = makeParseableTool; - function isAutoParsableTool(tool) { - return tool?.["$brand"] === "auto-parseable-tool"; - } - exports2.isAutoParsableTool = isAutoParsableTool; - function maybeParseChatCompletion(completion, params) { - if (!params || !hasAutoParseableInput(params)) { - return { - ...completion, - choices: completion.choices.map((choice) => ({ - ...choice, - message: { - ...choice.message, - parsed: null, - ...choice.message.tool_calls ? { - tool_calls: choice.message.tool_calls - } : void 0 - } - })) - }; + this.pointer -= countSymbols(this.buffer) + 1; + this.buffer = ""; + this.state = "host"; + } else { + this.buffer += cStr; } - return parseChatCompletion(completion, params); - } - exports2.maybeParseChatCompletion = maybeParseChatCompletion; - function parseChatCompletion(completion, params) { - const choices = completion.choices.map((choice) => { - if (choice.finish_reason === "length") { - throw new error_1.LengthFinishReasonError(); + return true; + }; + URLStateMachine.prototype["parse hostname"] = URLStateMachine.prototype["parse host"] = function parseHostName(c6, cStr) { + if (this.stateOverride && this.url.scheme === "file") { + --this.pointer; + this.state = "file host"; + } else if (c6 === 58 && !this.arrFlag) { + if (this.buffer === "") { + this.parseError = true; + return failure; } - if (choice.finish_reason === "content_filter") { - throw new error_1.ContentFilterFinishReasonError(); + const host = parseHost(this.buffer, isSpecial(this.url)); + if (host === failure) { + return failure; } - return { - ...choice, - message: { - ...choice.message, - ...choice.message.tool_calls ? { - tool_calls: choice.message.tool_calls?.map((toolCall) => parseToolCall(params, toolCall)) ?? void 0 - } : void 0, - parsed: choice.message.content && !choice.message.refusal ? parseResponseFormat(params, choice.message.content) : null - } - }; - }); - return { ...completion, choices }; - } - exports2.parseChatCompletion = parseChatCompletion; - function parseResponseFormat(params, content) { - if (params.response_format?.type !== "json_schema") { - return null; - } - if (params.response_format?.type === "json_schema") { - if ("$parseRaw" in params.response_format) { - const response_format = params.response_format; - return response_format.$parseRaw(content); + this.url.host = host; + this.buffer = ""; + this.state = "port"; + if (this.stateOverride === "hostname") { + return false; } - return JSON.parse(content); - } - return null; - } - function parseToolCall(params, toolCall) { - const inputTool = params.tools?.find((inputTool2) => inputTool2.function?.name === toolCall.function.name); - return { - ...toolCall, - function: { - ...toolCall.function, - parsed_arguments: isAutoParsableTool(inputTool) ? inputTool.$parseRaw(toolCall.function.arguments) : inputTool?.function.strict ? JSON.parse(toolCall.function.arguments) : null + } else if (isNaN(c6) || c6 === 47 || c6 === 63 || c6 === 35 || isSpecial(this.url) && c6 === 92) { + --this.pointer; + if (isSpecial(this.url) && this.buffer === "") { + this.parseError = true; + return failure; + } else if (this.stateOverride && this.buffer === "" && (includesCredentials(this.url) || this.url.port !== null)) { + this.parseError = true; + return false; } - }; - } - function shouldParseToolCall(params, toolCall) { - if (!params) { - return false; - } - const inputTool = params.tools?.find((inputTool2) => inputTool2.function?.name === toolCall.function.name); - return isAutoParsableTool(inputTool) || inputTool?.function.strict || false; - } - exports2.shouldParseToolCall = shouldParseToolCall; - function hasAutoParseableInput(params) { - if (isAutoParsableResponseFormat(params.response_format)) { - return true; - } - return params.tools?.some((t6) => isAutoParsableTool(t6) || t6.type === "function" && t6.function.strict === true) ?? false; - } - exports2.hasAutoParseableInput = hasAutoParseableInput; - function validateInputTools(tools) { - for (const tool of tools ?? []) { - if (tool.type !== "function") { - throw new error_1.OpenAIError(`Currently only \`function\` tool types support auto-parsing; Received \`${tool.type}\``); + const host = parseHost(this.buffer, isSpecial(this.url)); + if (host === failure) { + return failure; } - if (tool.function.strict !== true) { - throw new error_1.OpenAIError(`The \`${tool.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`); + this.url.host = host; + this.buffer = ""; + this.state = "path start"; + if (this.stateOverride) { + return false; + } + } else { + if (c6 === 91) { + this.arrFlag = true; + } else if (c6 === 93) { + this.arrFlag = false; } + this.buffer += cStr; } - } - exports2.validateInputTools = validateInputTools; - } -}); - -// node_modules/openai/lib/AbstractChatCompletionRunner.js -var require_AbstractChatCompletionRunner = __commonJS({ - "node_modules/openai/lib/AbstractChatCompletionRunner.js"(exports2) { - "use strict"; - var __classPrivateFieldGet = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); + return true; }; - var _AbstractChatCompletionRunner_instances; - var _AbstractChatCompletionRunner_getFinalContent; - var _AbstractChatCompletionRunner_getFinalMessage; - var _AbstractChatCompletionRunner_getFinalFunctionCall; - var _AbstractChatCompletionRunner_getFinalFunctionCallResult; - var _AbstractChatCompletionRunner_calculateTotalUsage; - var _AbstractChatCompletionRunner_validateParams; - var _AbstractChatCompletionRunner_stringifyFunctionCallResult; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AbstractChatCompletionRunner = void 0; - var error_1 = require_error2(); - var RunnableFunction_1 = require_RunnableFunction(); - var chatCompletionUtils_1 = require_chatCompletionUtils(); - var EventStream_1 = require_EventStream(); - var parser_1 = require_parser3(); - var DEFAULT_MAX_CHAT_COMPLETIONS = 10; - var AbstractChatCompletionRunner = class extends EventStream_1.EventStream { - constructor() { - super(...arguments); - _AbstractChatCompletionRunner_instances.add(this); - this._chatCompletions = []; - this.messages = []; - } - _addChatCompletion(chatCompletion) { - this._chatCompletions.push(chatCompletion); - this._emit("chatCompletion", chatCompletion); - const message = chatCompletion.choices[0]?.message; - if (message) - this._addMessage(message); - return chatCompletion; - } - _addMessage(message, emit = true) { - if (!("content" in message)) - message.content = null; - this.messages.push(message); - if (emit) { - this._emit("message", message); - if (((0, chatCompletionUtils_1.isFunctionMessage)(message) || (0, chatCompletionUtils_1.isToolMessage)(message)) && message.content) { - this._emit("functionCallResult", message.content); - } else if ((0, chatCompletionUtils_1.isAssistantMessage)(message) && message.function_call) { - this._emit("functionCall", message.function_call); - } else if ((0, chatCompletionUtils_1.isAssistantMessage)(message) && message.tool_calls) { - for (const tool_call of message.tool_calls) { - if (tool_call.type === "function") { - this._emit("functionCall", tool_call.function); - } - } + URLStateMachine.prototype["parse port"] = function parsePort(c6, cStr) { + if (isASCIIDigit(c6)) { + this.buffer += cStr; + } else if (isNaN(c6) || c6 === 47 || c6 === 63 || c6 === 35 || isSpecial(this.url) && c6 === 92 || this.stateOverride) { + if (this.buffer !== "") { + const port = parseInt(this.buffer); + if (port > Math.pow(2, 16) - 1) { + this.parseError = true; + return failure; } + this.url.port = port === defaultPort(this.url.scheme) ? null : port; + this.buffer = ""; } - } - /** - * @returns a promise that resolves with the final ChatCompletion, or rejects - * if an error occurred or the stream ended prematurely without producing a ChatCompletion. - */ - async finalChatCompletion() { - await this.done(); - const completion = this._chatCompletions[this._chatCompletions.length - 1]; - if (!completion) - throw new error_1.OpenAIError("stream ended without producing a ChatCompletion"); - return completion; - } - /** - * @returns a promise that resolves with the content of the final ChatCompletionMessage, or rejects - * if an error occurred or the stream ended prematurely without producing a ChatCompletionMessage. - */ - async finalContent() { - await this.done(); - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalContent).call(this); - } - /** - * @returns a promise that resolves with the the final assistant ChatCompletionMessage response, - * or rejects if an error occurred or the stream ended prematurely without producing a ChatCompletionMessage. - */ - async finalMessage() { - await this.done(); - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this); - } - /** - * @returns a promise that resolves with the content of the final FunctionCall, or rejects - * if an error occurred or the stream ended prematurely without producing a ChatCompletionMessage. - */ - async finalFunctionCall() { - await this.done(); - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionCall).call(this); - } - async finalFunctionCallResult() { - await this.done(); - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionCallResult).call(this); - } - async totalUsage() { - await this.done(); - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_calculateTotalUsage).call(this); - } - allChatCompletions() { - return [...this._chatCompletions]; - } - _emitFinal() { - const completion = this._chatCompletions[this._chatCompletions.length - 1]; - if (completion) - this._emit("finalChatCompletion", completion); - const finalMessage = __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this); - if (finalMessage) - this._emit("finalMessage", finalMessage); - const finalContent = __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalContent).call(this); - if (finalContent) - this._emit("finalContent", finalContent); - const finalFunctionCall = __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionCall).call(this); - if (finalFunctionCall) - this._emit("finalFunctionCall", finalFunctionCall); - const finalFunctionCallResult = __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionCallResult).call(this); - if (finalFunctionCallResult != null) - this._emit("finalFunctionCallResult", finalFunctionCallResult); - if (this._chatCompletions.some((c6) => c6.usage)) { - this._emit("totalUsage", __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_calculateTotalUsage).call(this)); + if (this.stateOverride) { + return false; } + this.state = "path start"; + --this.pointer; + } else { + this.parseError = true; + return failure; } - async _createChatCompletion(client2, params, options) { - const signal = options?.signal; - if (signal) { - if (signal.aborted) - this.controller.abort(); - signal.addEventListener("abort", () => this.controller.abort()); + return true; + }; + var fileOtherwiseCodePoints = /* @__PURE__ */ new Set([47, 92, 63, 35]); + URLStateMachine.prototype["parse file"] = function parseFile(c6) { + this.url.scheme = "file"; + if (c6 === 47 || c6 === 92) { + if (c6 === 92) { + this.parseError = true; } - __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_validateParams).call(this, params); - const chatCompletion = await client2.chat.completions.create({ ...params, stream: false }, { ...options, signal: this.controller.signal }); - this._connected(); - return this._addChatCompletion((0, parser_1.parseChatCompletion)(chatCompletion, params)); - } - async _runChatCompletion(client2, params, options) { - for (const message of params.messages) { - this._addMessage(message, false); + this.state = "file slash"; + } else if (this.base !== null && this.base.scheme === "file") { + if (isNaN(c6)) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + } else if (c6 === 63) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = ""; + this.state = "query"; + } else if (c6 === 35) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else { + if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points + !isWindowsDriveLetterCodePoints(c6, this.input[this.pointer + 1]) || this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points + !fileOtherwiseCodePoints.has(this.input[this.pointer + 2])) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + shortenPath(this.url); + } else { + this.parseError = true; + } + this.state = "path"; + --this.pointer; } - return await this._createChatCompletion(client2, params, options); + } else { + this.state = "path"; + --this.pointer; } - async _runFunctions(client2, params, options) { - const role = "function"; - const { function_call = "auto", stream: stream5, ...restParams } = params; - const singleFunctionToCall = typeof function_call !== "string" && function_call?.name; - const { maxChatCompletions = DEFAULT_MAX_CHAT_COMPLETIONS } = options || {}; - const functionsByName = {}; - for (const f6 of params.functions) { - functionsByName[f6.name || f6.function.name] = f6; + return true; + }; + URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c6) { + if (c6 === 47 || c6 === 92) { + if (c6 === 92) { + this.parseError = true; } - const functions = params.functions.map((f6) => ({ - name: f6.name || f6.function.name, - parameters: f6.parameters, - description: f6.description - })); - for (const message of params.messages) { - this._addMessage(message, false); + this.state = "file host"; + } else { + if (this.base !== null && this.base.scheme === "file") { + if (isNormalizedWindowsDriveLetterString(this.base.path[0])) { + this.url.path.push(this.base.path[0]); + } else { + this.url.host = this.base.host; + } } - for (let i6 = 0; i6 < maxChatCompletions; ++i6) { - const chatCompletion = await this._createChatCompletion(client2, { - ...restParams, - function_call, - functions, - messages: [...this.messages] - }, options); - const message = chatCompletion.choices[0]?.message; - if (!message) { - throw new error_1.OpenAIError(`missing message in ChatCompletion response`); + this.state = "path"; + --this.pointer; + } + return true; + }; + URLStateMachine.prototype["parse file host"] = function parseFileHost(c6, cStr) { + if (isNaN(c6) || c6 === 47 || c6 === 92 || c6 === 63 || c6 === 35) { + --this.pointer; + if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { + this.parseError = true; + this.state = "path"; + } else if (this.buffer === "") { + this.url.host = ""; + if (this.stateOverride) { + return false; } - if (!message.function_call) - return; - const { name, arguments: args } = message.function_call; - const fn = functionsByName[name]; - if (!fn) { - const content2 = `Invalid function_call: ${JSON.stringify(name)}. Available options are: ${functions.map((f6) => JSON.stringify(f6.name)).join(", ")}. Please try again`; - this._addMessage({ role, name, content: content2 }); - continue; - } else if (singleFunctionToCall && singleFunctionToCall !== name) { - const content2 = `Invalid function_call: ${JSON.stringify(name)}. ${JSON.stringify(singleFunctionToCall)} requested. Please try again`; - this._addMessage({ role, name, content: content2 }); - continue; + this.state = "path start"; + } else { + let host = parseHost(this.buffer, isSpecial(this.url)); + if (host === failure) { + return failure; } - let parsed; - try { - parsed = (0, RunnableFunction_1.isRunnableFunctionWithParse)(fn) ? await fn.parse(args) : args; - } catch (error2) { - this._addMessage({ - role, - name, - content: error2 instanceof Error ? error2.message : String(error2) - }); - continue; + if (host === "localhost") { + host = ""; } - const rawContent2 = await fn.function(parsed, this); - const content = __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_stringifyFunctionCallResult).call(this, rawContent2); - this._addMessage({ role, name, content }); - if (singleFunctionToCall) - return; + this.url.host = host; + if (this.stateOverride) { + return false; + } + this.buffer = ""; + this.state = "path start"; } + } else { + this.buffer += cStr; } - async _runTools(client2, params, options) { - const role = "tool"; - const { tool_choice = "auto", stream: stream5, ...restParams } = params; - const singleFunctionToCall = typeof tool_choice !== "string" && tool_choice?.function?.name; - const { maxChatCompletions = DEFAULT_MAX_CHAT_COMPLETIONS } = options || {}; - const inputTools = params.tools.map((tool) => { - if ((0, parser_1.isAutoParsableTool)(tool)) { - if (!tool.$callback) { - throw new error_1.OpenAIError("Tool given to `.runTools()` that does not have an associated function"); - } - return { - type: "function", - function: { - function: tool.$callback, - name: tool.function.name, - description: tool.function.description || "", - parameters: tool.function.parameters, - parse: tool.$parseRaw, - strict: true - } - }; - } - return tool; - }); - const functionsByName = {}; - for (const f6 of inputTools) { - if (f6.type === "function") { - functionsByName[f6.function.name || f6.function.function.name] = f6.function; - } + return true; + }; + URLStateMachine.prototype["parse path start"] = function parsePathStart(c6) { + if (isSpecial(this.url)) { + if (c6 === 92) { + this.parseError = true; } - const tools = "tools" in params ? inputTools.map((t6) => t6.type === "function" ? { - type: "function", - function: { - name: t6.function.name || t6.function.function.name, - parameters: t6.function.parameters, - description: t6.function.description, - strict: t6.function.strict - } - } : t6) : void 0; - for (const message of params.messages) { - this._addMessage(message, false); + this.state = "path"; + if (c6 !== 47 && c6 !== 92) { + --this.pointer; } - for (let i6 = 0; i6 < maxChatCompletions; ++i6) { - const chatCompletion = await this._createChatCompletion(client2, { - ...restParams, - tool_choice, - tools, - messages: [...this.messages] - }, options); - const message = chatCompletion.choices[0]?.message; - if (!message) { - throw new error_1.OpenAIError(`missing message in ChatCompletion response`); - } - if (!message.tool_calls?.length) { - return; + } else if (!this.stateOverride && c6 === 63) { + this.url.query = ""; + this.state = "query"; + } else if (!this.stateOverride && c6 === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (c6 !== void 0) { + this.state = "path"; + if (c6 !== 47) { + --this.pointer; + } + } + return true; + }; + URLStateMachine.prototype["parse path"] = function parsePath(c6) { + if (isNaN(c6) || c6 === 47 || isSpecial(this.url) && c6 === 92 || !this.stateOverride && (c6 === 63 || c6 === 35)) { + if (isSpecial(this.url) && c6 === 92) { + this.parseError = true; + } + if (isDoubleDot(this.buffer)) { + shortenPath(this.url); + if (c6 !== 47 && !(isSpecial(this.url) && c6 === 92)) { + this.url.path.push(""); } - for (const tool_call of message.tool_calls) { - if (tool_call.type !== "function") - continue; - const tool_call_id = tool_call.id; - const { name, arguments: args } = tool_call.function; - const fn = functionsByName[name]; - if (!fn) { - const content2 = `Invalid tool_call: ${JSON.stringify(name)}. Available options are: ${Object.keys(functionsByName).map((name2) => JSON.stringify(name2)).join(", ")}. Please try again`; - this._addMessage({ role, tool_call_id, content: content2 }); - continue; - } else if (singleFunctionToCall && singleFunctionToCall !== name) { - const content2 = `Invalid tool_call: ${JSON.stringify(name)}. ${JSON.stringify(singleFunctionToCall)} requested. Please try again`; - this._addMessage({ role, tool_call_id, content: content2 }); - continue; - } - let parsed; - try { - parsed = (0, RunnableFunction_1.isRunnableFunctionWithParse)(fn) ? await fn.parse(args) : args; - } catch (error2) { - const content2 = error2 instanceof Error ? error2.message : String(error2); - this._addMessage({ role, tool_call_id, content: content2 }); - continue; - } - const rawContent2 = await fn.function(parsed, this); - const content = __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_stringifyFunctionCallResult).call(this, rawContent2); - this._addMessage({ role, tool_call_id, content }); - if (singleFunctionToCall) { - return; + } else if (isSingleDot(this.buffer) && c6 !== 47 && !(isSpecial(this.url) && c6 === 92)) { + this.url.path.push(""); + } else if (!isSingleDot(this.buffer)) { + if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { + if (this.url.host !== "" && this.url.host !== null) { + this.parseError = true; + this.url.host = ""; } + this.buffer = this.buffer[0] + ":"; } + this.url.path.push(this.buffer); } - return; + this.buffer = ""; + if (this.url.scheme === "file" && (c6 === void 0 || c6 === 63 || c6 === 35)) { + while (this.url.path.length > 1 && this.url.path[0] === "") { + this.parseError = true; + this.url.path.shift(); + } + } + if (c6 === 63) { + this.url.query = ""; + this.state = "query"; + } + if (c6 === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + if (c6 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + this.buffer += percentEncodeChar(c6, isPathPercentEncode); } + return true; }; - exports2.AbstractChatCompletionRunner = AbstractChatCompletionRunner; - _AbstractChatCompletionRunner_instances = /* @__PURE__ */ new WeakSet(), _AbstractChatCompletionRunner_getFinalContent = function _AbstractChatCompletionRunner_getFinalContent2() { - return __classPrivateFieldGet(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this).content ?? null; - }, _AbstractChatCompletionRunner_getFinalMessage = function _AbstractChatCompletionRunner_getFinalMessage2() { - let i6 = this.messages.length; - while (i6-- > 0) { - const message = this.messages[i6]; - if ((0, chatCompletionUtils_1.isAssistantMessage)(message)) { - const { function_call, ...rest } = message; - const ret = { - ...rest, - content: message.content ?? null, - refusal: message.refusal ?? null - }; - if (function_call) { - ret.function_call = function_call; - } - return ret; + URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c6) { + if (c6 === 63) { + this.url.query = ""; + this.state = "query"; + } else if (c6 === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } else { + if (!isNaN(c6) && c6 !== 37) { + this.parseError = true; + } + if (c6 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + if (!isNaN(c6)) { + this.url.path[0] = this.url.path[0] + percentEncodeChar(c6, isC0ControlPercentEncode); } } - throw new error_1.OpenAIError("stream ended without producing a ChatCompletionMessage with role=assistant"); - }, _AbstractChatCompletionRunner_getFinalFunctionCall = function _AbstractChatCompletionRunner_getFinalFunctionCall2() { - for (let i6 = this.messages.length - 1; i6 >= 0; i6--) { - const message = this.messages[i6]; - if ((0, chatCompletionUtils_1.isAssistantMessage)(message) && message?.function_call) { - return message.function_call; + return true; + }; + URLStateMachine.prototype["parse query"] = function parseQuery(c6, cStr) { + if (isNaN(c6) || !this.stateOverride && c6 === 35) { + if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { + this.encodingOverride = "utf-8"; } - if ((0, chatCompletionUtils_1.isAssistantMessage)(message) && message?.tool_calls?.length) { - return message.tool_calls.at(-1)?.function; + const buffer2 = new Buffer(this.buffer); + for (let i6 = 0; i6 < buffer2.length; ++i6) { + if (buffer2[i6] < 33 || buffer2[i6] > 126 || buffer2[i6] === 34 || buffer2[i6] === 35 || buffer2[i6] === 60 || buffer2[i6] === 62) { + this.url.query += percentEncode(buffer2[i6]); + } else { + this.url.query += String.fromCodePoint(buffer2[i6]); + } + } + this.buffer = ""; + if (c6 === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + if (c6 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; } + this.buffer += cStr; } - return; - }, _AbstractChatCompletionRunner_getFinalFunctionCallResult = function _AbstractChatCompletionRunner_getFinalFunctionCallResult2() { - for (let i6 = this.messages.length - 1; i6 >= 0; i6--) { - const message = this.messages[i6]; - if ((0, chatCompletionUtils_1.isFunctionMessage)(message) && message.content != null) { - return message.content; + return true; + }; + URLStateMachine.prototype["parse fragment"] = function parseFragment(c6) { + if (isNaN(c6)) { + } else if (c6 === 0) { + this.parseError = true; + } else { + if (c6 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; } - if ((0, chatCompletionUtils_1.isToolMessage)(message) && message.content != null && typeof message.content === "string" && this.messages.some((x6) => x6.role === "assistant" && x6.tool_calls?.some((y2) => y2.type === "function" && y2.id === message.tool_call_id))) { - return message.content; + this.url.fragment += percentEncodeChar(c6, isC0ControlPercentEncode); + } + return true; + }; + function serializeURL(url2, excludeFragment) { + let output = url2.scheme + ":"; + if (url2.host !== null) { + output += "//"; + if (url2.username !== "" || url2.password !== "") { + output += url2.username; + if (url2.password !== "") { + output += ":" + url2.password; + } + output += "@"; + } + output += serializeHost(url2.host); + if (url2.port !== null) { + output += ":" + url2.port; } + } else if (url2.host === null && url2.scheme === "file") { + output += "//"; } - return; - }, _AbstractChatCompletionRunner_calculateTotalUsage = function _AbstractChatCompletionRunner_calculateTotalUsage2() { - const total = { - completion_tokens: 0, - prompt_tokens: 0, - total_tokens: 0 - }; - for (const { usage } of this._chatCompletions) { - if (usage) { - total.completion_tokens += usage.completion_tokens; - total.prompt_tokens += usage.prompt_tokens; - total.total_tokens += usage.total_tokens; + if (url2.cannotBeABaseURL) { + output += url2.path[0]; + } else { + for (const string of url2.path) { + output += "/" + string; } } - return total; - }, _AbstractChatCompletionRunner_validateParams = function _AbstractChatCompletionRunner_validateParams2(params) { - if (params.n != null && params.n > 1) { - throw new error_1.OpenAIError("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly."); + if (url2.query !== null) { + output += "?" + url2.query; + } + if (!excludeFragment && url2.fragment !== null) { + output += "#" + url2.fragment; + } + return output; + } + function serializeOrigin(tuple) { + let result = tuple.scheme + "://"; + result += serializeHost(tuple.host); + if (tuple.port !== null) { + result += ":" + tuple.port; + } + return result; + } + module.exports.serializeURL = serializeURL; + module.exports.serializeURLOrigin = function(url2) { + switch (url2.scheme) { + case "blob": + try { + return module.exports.serializeURLOrigin(module.exports.parseURL(url2.path[0])); + } catch (e6) { + return "null"; + } + case "ftp": + case "gopher": + case "http": + case "https": + case "ws": + case "wss": + return serializeOrigin({ + scheme: url2.scheme, + host: url2.host, + port: url2.port + }); + case "file": + return "file://"; + default: + return "null"; } - }, _AbstractChatCompletionRunner_stringifyFunctionCallResult = function _AbstractChatCompletionRunner_stringifyFunctionCallResult2(rawContent2) { - return typeof rawContent2 === "string" ? rawContent2 : rawContent2 === void 0 ? "undefined" : JSON.stringify(rawContent2); }; - } -}); - -// node_modules/openai/lib/ChatCompletionRunner.js -var require_ChatCompletionRunner = __commonJS({ - "node_modules/openai/lib/ChatCompletionRunner.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ChatCompletionRunner = void 0; - var AbstractChatCompletionRunner_1 = require_AbstractChatCompletionRunner(); - var chatCompletionUtils_1 = require_chatCompletionUtils(); - var ChatCompletionRunner = class _ChatCompletionRunner extends AbstractChatCompletionRunner_1.AbstractChatCompletionRunner { - /** @deprecated - please use `runTools` instead. */ - static runFunctions(client2, params, options) { - const runner = new _ChatCompletionRunner(); - const opts = { - ...options, - headers: { ...options?.headers, "X-Stainless-Helper-Method": "runFunctions" } - }; - runner._run(() => runner._runFunctions(client2, params, opts)); - return runner; + module.exports.basicURLParse = function(input, options) { + if (options === void 0) { + options = {}; } - static runTools(client2, params, options) { - const runner = new _ChatCompletionRunner(); - const opts = { - ...options, - headers: { ...options?.headers, "X-Stainless-Helper-Method": "runTools" } - }; - runner._run(() => runner._runTools(client2, params, opts)); - return runner; + const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); + if (usm.failure) { + return "failure"; } - _addMessage(message, emit = true) { - super._addMessage(message, emit); - if ((0, chatCompletionUtils_1.isAssistantMessage)(message) && message.content) { - this._emit("content", message.content); - } + return usm.url; + }; + module.exports.setTheUsername = function(url2, username) { + url2.username = ""; + const decoded = punycode.ucs2.decode(username); + for (let i6 = 0; i6 < decoded.length; ++i6) { + url2.username += percentEncodeChar(decoded[i6], isUserinfoPercentEncode); } }; - exports2.ChatCompletionRunner = ChatCompletionRunner; + module.exports.setThePassword = function(url2, password) { + url2.password = ""; + const decoded = punycode.ucs2.decode(password); + for (let i6 = 0; i6 < decoded.length; ++i6) { + url2.password += percentEncodeChar(decoded[i6], isUserinfoPercentEncode); + } + }; + module.exports.serializeHost = serializeHost; + module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; + module.exports.serializeInteger = function(integer) { + return String(integer); + }; + module.exports.parseURL = function(input, options) { + if (options === void 0) { + options = {}; + } + return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); + }; } }); -// node_modules/openai/_vendor/partial-json-parser/parser.js -var require_parser4 = __commonJS({ - "node_modules/openai/_vendor/partial-json-parser/parser.js"(exports2) { +// node_modules/whatwg-url/lib/URL-impl.js +var require_URL_impl = __commonJS({ + "node_modules/whatwg-url/lib/URL-impl.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MalformedJSON = exports2.PartialJSON = exports2.partialParse = void 0; - var STR = 1; - var NUM = 2; - var ARR = 4; - var OBJ = 8; - var NULL = 16; - var BOOL = 32; - var NAN = 64; - var INFINITY = 128; - var MINUS_INFINITY = 256; - var INF = INFINITY | MINUS_INFINITY; - var SPECIAL = NULL | BOOL | INF | NAN; - var ATOM = STR | NUM | SPECIAL; - var COLLECTION = ARR | OBJ; - var ALL = ATOM | COLLECTION; - var Allow = { - STR, - NUM, - ARR, - OBJ, - NULL, - BOOL, - NAN, - INFINITY, - MINUS_INFINITY, - INF, - SPECIAL, - ATOM, - COLLECTION, - ALL - }; - var PartialJSON = class extends Error { - }; - exports2.PartialJSON = PartialJSON; - var MalformedJSON = class extends Error { - }; - exports2.MalformedJSON = MalformedJSON; - function parseJSON(jsonString, allowPartial = Allow.ALL) { - if (typeof jsonString !== "string") { - throw new TypeError(`expecting str, got ${typeof jsonString}`); + var usm = require_url_state_machine(); + exports2.implementation = class URLImpl { + constructor(constructorArgs) { + const url2 = constructorArgs[0]; + const base = constructorArgs[1]; + let parsedBase = null; + if (base !== void 0) { + parsedBase = usm.basicURLParse(base); + if (parsedBase === "failure") { + throw new TypeError("Invalid base URL"); + } + } + const parsedURL = usm.basicURLParse(url2, { baseURL: parsedBase }); + if (parsedURL === "failure") { + throw new TypeError("Invalid URL"); + } + this._url = parsedURL; } - if (!jsonString.trim()) { - throw new Error(`${jsonString} is empty`); + get href() { + return usm.serializeURL(this._url); } - return _parseJSON(jsonString.trim(), allowPartial); - } - var _parseJSON = (jsonString, allow) => { - const length = jsonString.length; - let index2 = 0; - const markPartialJSON = (msg) => { - throw new PartialJSON(`${msg} at position ${index2}`); - }; - const throwMalformedError = (msg) => { - throw new MalformedJSON(`${msg} at position ${index2}`); - }; - const parseAny = () => { - skipBlank(); - if (index2 >= length) - markPartialJSON("Unexpected end of input"); - if (jsonString[index2] === '"') - return parseStr(); - if (jsonString[index2] === "{") - return parseObj(); - if (jsonString[index2] === "[") - return parseArr(); - if (jsonString.substring(index2, index2 + 4) === "null" || Allow.NULL & allow && length - index2 < 4 && "null".startsWith(jsonString.substring(index2))) { - index2 += 4; - return null; + set href(v2) { + const parsedURL = usm.basicURLParse(v2); + if (parsedURL === "failure") { + throw new TypeError("Invalid URL"); } - if (jsonString.substring(index2, index2 + 4) === "true" || Allow.BOOL & allow && length - index2 < 4 && "true".startsWith(jsonString.substring(index2))) { - index2 += 4; - return true; + this._url = parsedURL; + } + get origin() { + return usm.serializeURLOrigin(this._url); + } + get protocol() { + return this._url.scheme + ":"; + } + set protocol(v2) { + usm.basicURLParse(v2 + ":", { url: this._url, stateOverride: "scheme start" }); + } + get username() { + return this._url.username; + } + set username(v2) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; } - if (jsonString.substring(index2, index2 + 5) === "false" || Allow.BOOL & allow && length - index2 < 5 && "false".startsWith(jsonString.substring(index2))) { - index2 += 5; - return false; + usm.setTheUsername(this._url, v2); + } + get password() { + return this._url.password; + } + set password(v2) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; } - if (jsonString.substring(index2, index2 + 8) === "Infinity" || Allow.INFINITY & allow && length - index2 < 8 && "Infinity".startsWith(jsonString.substring(index2))) { - index2 += 8; - return Infinity; + usm.setThePassword(this._url, v2); + } + get host() { + const url2 = this._url; + if (url2.host === null) { + return ""; } - if (jsonString.substring(index2, index2 + 9) === "-Infinity" || Allow.MINUS_INFINITY & allow && 1 < length - index2 && length - index2 < 9 && "-Infinity".startsWith(jsonString.substring(index2))) { - index2 += 9; - return -Infinity; + if (url2.port === null) { + return usm.serializeHost(url2.host); } - if (jsonString.substring(index2, index2 + 3) === "NaN" || Allow.NAN & allow && length - index2 < 3 && "NaN".startsWith(jsonString.substring(index2))) { - index2 += 3; - return NaN; + return usm.serializeHost(url2.host) + ":" + usm.serializeInteger(url2.port); + } + set host(v2) { + if (this._url.cannotBeABaseURL) { + return; } - return parseNum(); - }; - const parseStr = () => { - const start = index2; - let escape5 = false; - index2++; - while (index2 < length && (jsonString[index2] !== '"' || escape5 && jsonString[index2 - 1] === "\\")) { - escape5 = jsonString[index2] === "\\" ? !escape5 : false; - index2++; + usm.basicURLParse(v2, { url: this._url, stateOverride: "host" }); + } + get hostname() { + if (this._url.host === null) { + return ""; } - if (jsonString.charAt(index2) == '"') { - try { - return JSON.parse(jsonString.substring(start, ++index2 - Number(escape5))); - } catch (e6) { - throwMalformedError(String(e6)); - } - } else if (Allow.STR & allow) { - try { - return JSON.parse(jsonString.substring(start, index2 - Number(escape5)) + '"'); - } catch (e6) { - return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf("\\")) + '"'); - } + return usm.serializeHost(this._url.host); + } + set hostname(v2) { + if (this._url.cannotBeABaseURL) { + return; } - markPartialJSON("Unterminated string literal"); - }; - const parseObj = () => { - index2++; - skipBlank(); - const obj = {}; - try { - while (jsonString[index2] !== "}") { - skipBlank(); - if (index2 >= length && Allow.OBJ & allow) - return obj; - const key = parseStr(); - skipBlank(); - index2++; - try { - const value = parseAny(); - Object.defineProperty(obj, key, { value, writable: true, enumerable: true, configurable: true }); - } catch (e6) { - if (Allow.OBJ & allow) - return obj; - else - throw e6; - } - skipBlank(); - if (jsonString[index2] === ",") - index2++; - } - } catch (e6) { - if (Allow.OBJ & allow) - return obj; - else - markPartialJSON("Expected '}' at end of object"); + usm.basicURLParse(v2, { url: this._url, stateOverride: "hostname" }); + } + get port() { + if (this._url.port === null) { + return ""; } - index2++; - return obj; - }; - const parseArr = () => { - index2++; - const arr = []; - try { - while (jsonString[index2] !== "]") { - arr.push(parseAny()); - skipBlank(); - if (jsonString[index2] === ",") { - index2++; - } - } - } catch (e6) { - if (Allow.ARR & allow) { - return arr; - } - markPartialJSON("Expected ']' at end of array"); + return usm.serializeInteger(this._url.port); + } + set port(v2) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; } - index2++; - return arr; - }; - const parseNum = () => { - if (index2 === 0) { - if (jsonString === "-" && Allow.NUM & allow) - markPartialJSON("Not sure what '-' is"); - try { - return JSON.parse(jsonString); - } catch (e6) { - if (Allow.NUM & allow) { - try { - if ("." === jsonString[jsonString.length - 1]) - return JSON.parse(jsonString.substring(0, jsonString.lastIndexOf("."))); - return JSON.parse(jsonString.substring(0, jsonString.lastIndexOf("e"))); - } catch (e7) { - } - } - throwMalformedError(String(e6)); - } + if (v2 === "") { + this._url.port = null; + } else { + usm.basicURLParse(v2, { url: this._url, stateOverride: "port" }); } - const start = index2; - if (jsonString[index2] === "-") - index2++; - while (jsonString[index2] && !",]}".includes(jsonString[index2])) - index2++; - if (index2 == length && !(Allow.NUM & allow)) - markPartialJSON("Unterminated number literal"); - try { - return JSON.parse(jsonString.substring(start, index2)); - } catch (e6) { - if (jsonString.substring(start, index2) === "-" && Allow.NUM & allow) - markPartialJSON("Not sure what '-' is"); - try { - return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf("e"))); - } catch (e7) { - throwMalformedError(String(e7)); - } + } + get pathname() { + if (this._url.cannotBeABaseURL) { + return this._url.path[0]; } - }; - const skipBlank = () => { - while (index2 < length && " \n\r ".includes(jsonString[index2])) { - index2++; + if (this._url.path.length === 0) { + return ""; } - }; - return parseAny(); - }; - var partialParse = (input) => parseJSON(input, Allow.ALL ^ Allow.NUM); - exports2.partialParse = partialParse; - } -}); - -// node_modules/openai/lib/ChatCompletionStream.js -var require_ChatCompletionStream = __commonJS({ - "node_modules/openai/lib/ChatCompletionStream.js"(exports2) { - "use strict"; - var __classPrivateFieldSet = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; - }; - var __classPrivateFieldGet = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { - if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); - }; - var _ChatCompletionStream_instances; - var _ChatCompletionStream_params; - var _ChatCompletionStream_choiceEventStates; - var _ChatCompletionStream_currentChatCompletionSnapshot; - var _ChatCompletionStream_beginRequest; - var _ChatCompletionStream_getChoiceEventState; - var _ChatCompletionStream_addChunk; - var _ChatCompletionStream_emitToolCallDoneEvent; - var _ChatCompletionStream_emitContentDoneEvents; - var _ChatCompletionStream_endRequest; - var _ChatCompletionStream_getAutoParseableResponseFormat; - var _ChatCompletionStream_accumulateChatCompletion; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ChatCompletionStream = void 0; - var error_1 = require_error2(); - var AbstractChatCompletionRunner_1 = require_AbstractChatCompletionRunner(); - var streaming_1 = require_streaming(); - var parser_1 = require_parser3(); - var parser_2 = require_parser4(); - var ChatCompletionStream = class _ChatCompletionStream extends AbstractChatCompletionRunner_1.AbstractChatCompletionRunner { - constructor(params) { - super(); - _ChatCompletionStream_instances.add(this); - _ChatCompletionStream_params.set(this, void 0); - _ChatCompletionStream_choiceEventStates.set(this, void 0); - _ChatCompletionStream_currentChatCompletionSnapshot.set(this, void 0); - __classPrivateFieldSet(this, _ChatCompletionStream_params, params, "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_choiceEventStates, [], "f"); + return "/" + this._url.path.join("/"); + } + set pathname(v2) { + if (this._url.cannotBeABaseURL) { + return; + } + this._url.path = []; + usm.basicURLParse(v2, { url: this._url, stateOverride: "path start" }); + } + get search() { + if (this._url.query === null || this._url.query === "") { + return ""; + } + return "?" + this._url.query; + } + set search(v2) { + const url2 = this._url; + if (v2 === "") { + url2.query = null; + return; + } + const input = v2[0] === "?" ? v2.substring(1) : v2; + url2.query = ""; + usm.basicURLParse(input, { url: url2, stateOverride: "query" }); + } + get hash() { + if (this._url.fragment === null || this._url.fragment === "") { + return ""; + } + return "#" + this._url.fragment; + } + set hash(v2) { + if (v2 === "") { + this._url.fragment = null; + return; + } + const input = v2[0] === "#" ? v2.substring(1) : v2; + this._url.fragment = ""; + usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); + } + toJSON() { + return this.href; + } + }; + } +}); + +// node_modules/whatwg-url/lib/URL.js +var require_URL = __commonJS({ + "node_modules/whatwg-url/lib/URL.js"(exports2, module) { + "use strict"; + var conversions = require_lib7(); + var utils = require_utils12(); + var Impl = require_URL_impl(); + var impl = utils.implSymbol; + function URL3(url2) { + if (!this || this[impl] || !(this instanceof URL3)) { + throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function."); + } + if (arguments.length < 1) { + throw new TypeError("Failed to construct 'URL': 1 argument required, but only " + arguments.length + " present."); + } + const args = []; + for (let i6 = 0; i6 < arguments.length && i6 < 2; ++i6) { + args[i6] = arguments[i6]; + } + args[0] = conversions["USVString"](args[0]); + if (args[1] !== void 0) { + args[1] = conversions["USVString"](args[1]); + } + module.exports.setup(this, args); + } + URL3.prototype.toJSON = function toJSON() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + const args = []; + for (let i6 = 0; i6 < arguments.length && i6 < 0; ++i6) { + args[i6] = arguments[i6]; + } + return this[impl].toJSON.apply(this[impl], args); + }; + Object.defineProperty(URL3.prototype, "href", { + get() { + return this[impl].href; + }, + set(V2) { + V2 = conversions["USVString"](V2); + this[impl].href = V2; + }, + enumerable: true, + configurable: true + }); + URL3.prototype.toString = function() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + return this.href; + }; + Object.defineProperty(URL3.prototype, "origin", { + get() { + return this[impl].origin; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(URL3.prototype, "protocol", { + get() { + return this[impl].protocol; + }, + set(V2) { + V2 = conversions["USVString"](V2); + this[impl].protocol = V2; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(URL3.prototype, "username", { + get() { + return this[impl].username; + }, + set(V2) { + V2 = conversions["USVString"](V2); + this[impl].username = V2; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(URL3.prototype, "password", { + get() { + return this[impl].password; + }, + set(V2) { + V2 = conversions["USVString"](V2); + this[impl].password = V2; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(URL3.prototype, "host", { + get() { + return this[impl].host; + }, + set(V2) { + V2 = conversions["USVString"](V2); + this[impl].host = V2; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(URL3.prototype, "hostname", { + get() { + return this[impl].hostname; + }, + set(V2) { + V2 = conversions["USVString"](V2); + this[impl].hostname = V2; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(URL3.prototype, "port", { + get() { + return this[impl].port; + }, + set(V2) { + V2 = conversions["USVString"](V2); + this[impl].port = V2; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(URL3.prototype, "pathname", { + get() { + return this[impl].pathname; + }, + set(V2) { + V2 = conversions["USVString"](V2); + this[impl].pathname = V2; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(URL3.prototype, "search", { + get() { + return this[impl].search; + }, + set(V2) { + V2 = conversions["USVString"](V2); + this[impl].search = V2; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(URL3.prototype, "hash", { + get() { + return this[impl].hash; + }, + set(V2) { + V2 = conversions["USVString"](V2); + this[impl].hash = V2; + }, + enumerable: true, + configurable: true + }); + module.exports = { + is(obj) { + return !!obj && obj[impl] instanceof Impl.implementation; + }, + create(constructorArgs, privateData) { + let obj = Object.create(URL3.prototype); + this.setup(obj, constructorArgs, privateData); + return obj; + }, + setup(obj, constructorArgs, privateData) { + if (!privateData) privateData = {}; + privateData.wrapper = obj; + obj[impl] = new Impl.implementation(constructorArgs, privateData); + obj[impl][utils.wrapperSymbol] = obj; + }, + interface: URL3, + expose: { + Window: { URL: URL3 }, + Worker: { URL: URL3 } + } + }; + } +}); + +// node_modules/whatwg-url/lib/public-api.js +var require_public_api = __commonJS({ + "node_modules/whatwg-url/lib/public-api.js"(exports2) { + "use strict"; + exports2.URL = require_URL().interface; + exports2.serializeURL = require_url_state_machine().serializeURL; + exports2.serializeURLOrigin = require_url_state_machine().serializeURLOrigin; + exports2.basicURLParse = require_url_state_machine().basicURLParse; + exports2.setTheUsername = require_url_state_machine().setTheUsername; + exports2.setThePassword = require_url_state_machine().setThePassword; + exports2.serializeHost = require_url_state_machine().serializeHost; + exports2.serializeInteger = require_url_state_machine().serializeInteger; + exports2.parseURL = require_url_state_machine().parseURL; + } +}); + +// node_modules/node-fetch/lib/index.mjs +var lib_exports2 = {}; +__export(lib_exports2, { + AbortError: () => AbortError3, + FetchError: () => FetchError, + Headers: () => Headers3, + Request: () => Request, + Response: () => Response2, + default: () => lib_default2 +}); +import Stream2 from "stream"; +import http3 from "http"; +import Url from "url"; +import https3 from "https"; +import zlib2 from "zlib"; +function FetchError(message, type, systemError) { + Error.call(this, message); + this.message = message; + this.type = type; + if (systemError) { + this.code = this.errno = systemError.code; + } + Error.captureStackTrace(this, this.constructor); +} +function Body(body2) { + var _this = this; + var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref$size = _ref.size; + let size = _ref$size === void 0 ? 0 : _ref$size; + var _ref$timeout = _ref.timeout; + let timeout2 = _ref$timeout === void 0 ? 0 : _ref$timeout; + if (body2 == null) { + body2 = null; + } else if (isURLSearchParams(body2)) { + body2 = Buffer.from(body2.toString()); + } else if (isBlob2(body2)) ; + else if (Buffer.isBuffer(body2)) ; + else if (Object.prototype.toString.call(body2) === "[object ArrayBuffer]") { + body2 = Buffer.from(body2); + } else if (ArrayBuffer.isView(body2)) { + body2 = Buffer.from(body2.buffer, body2.byteOffset, body2.byteLength); + } else if (body2 instanceof Stream2) ; + else { + body2 = Buffer.from(String(body2)); + } + this[INTERNALS] = { + body: body2, + disturbed: false, + error: null + }; + this.size = size; + this.timeout = timeout2; + if (body2 instanceof Stream2) { + body2.on("error", function(err) { + const error2 = err.name === "AbortError" ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, "system", err); + _this[INTERNALS].error = error2; + }); + } +} +function consumeBody() { + var _this4 = this; + if (this[INTERNALS].disturbed) { + return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); + } + this[INTERNALS].disturbed = true; + if (this[INTERNALS].error) { + return Body.Promise.reject(this[INTERNALS].error); + } + let body2 = this.body; + if (body2 === null) { + return Body.Promise.resolve(Buffer.alloc(0)); + } + if (isBlob2(body2)) { + body2 = body2.stream(); + } + if (Buffer.isBuffer(body2)) { + return Body.Promise.resolve(body2); + } + if (!(body2 instanceof Stream2)) { + return Body.Promise.resolve(Buffer.alloc(0)); + } + let accum = []; + let accumBytes = 0; + let abort = false; + return new Body.Promise(function(resolve8, reject2) { + let resTimeout; + if (_this4.timeout) { + resTimeout = setTimeout(function() { + abort = true; + reject2(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, "body-timeout")); + }, _this4.timeout); + } + body2.on("error", function(err) { + if (err.name === "AbortError") { + abort = true; + reject2(err); + } else { + reject2(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, "system", err)); + } + }); + body2.on("data", function(chunk) { + if (abort || chunk === null) { + return; + } + if (_this4.size && accumBytes + chunk.length > _this4.size) { + abort = true; + reject2(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, "max-size")); + return; + } + accumBytes += chunk.length; + accum.push(chunk); + }); + body2.on("end", function() { + if (abort) { + return; + } + clearTimeout(resTimeout); + try { + resolve8(Buffer.concat(accum, accumBytes)); + } catch (err) { + reject2(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err)); + } + }); + }); +} +function convertBody(buffer2, headers) { + if (typeof convert !== "function") { + throw new Error("The package `encoding` must be installed to use the textConverted() function"); + } + const ct2 = headers.get("content-type"); + let charset = "utf-8"; + let res, str; + if (ct2) { + res = /charset=([^;]*)/i.exec(ct2); + } + str = buffer2.slice(0, 1024).toString(); + if (!res && str) { + res = / 1 && arguments[1] !== void 0 ? arguments[1] : "key+value"; + const keys = Object.keys(headers[MAP]).sort(); + return keys.map(kind === "key" ? function(k7) { + return k7.toLowerCase(); + } : kind === "value" ? function(k7) { + return headers[MAP][k7].join(", "); + } : function(k7) { + return [k7.toLowerCase(), headers[MAP][k7].join(", ")]; + }); +} +function createHeadersIterator(target, kind) { + const iterator2 = Object.create(HeadersIteratorPrototype); + iterator2[INTERNAL] = { + target, + kind, + index: 0 + }; + return iterator2; +} +function exportNodeCompatibleHeaders(headers) { + const obj = Object.assign({ __proto__: null }, headers[MAP]); + const hostHeaderKey = find(headers[MAP], "Host"); + if (hostHeaderKey !== void 0) { + obj[hostHeaderKey] = obj[hostHeaderKey][0]; + } + return obj; +} +function createHeadersLenient(obj) { + const headers = new Headers3(); + for (const name of Object.keys(obj)) { + if (invalidTokenRegex.test(name)) { + continue; + } + if (Array.isArray(obj[name])) { + for (const val of obj[name]) { + if (invalidHeaderCharRegex.test(val)) { + continue; + } + if (headers[MAP][name] === void 0) { + headers[MAP][name] = [val]; + } else { + headers[MAP][name].push(val); + } + } + } else if (!invalidHeaderCharRegex.test(obj[name])) { + headers[MAP][name] = [obj[name]]; + } + } + return headers; +} +function parseURL(urlStr) { + if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { + urlStr = new URL2(urlStr).toString(); + } + return parse_url(urlStr); +} +function isRequest(input) { + return typeof input === "object" && typeof input[INTERNALS$2] === "object"; +} +function isAbortSignal(signal) { + const proto = signal && typeof signal === "object" && Object.getPrototypeOf(signal); + return !!(proto && proto.constructor.name === "AbortSignal"); +} +function getNodeRequestOptions(request2) { + const parsedURL = request2[INTERNALS$2].parsedURL; + const headers = new Headers3(request2[INTERNALS$2].headers); + if (!headers.has("Accept")) { + headers.set("Accept", "*/*"); + } + if (!parsedURL.protocol || !parsedURL.hostname) { + throw new TypeError("Only absolute URLs are supported"); + } + if (!/^https?:$/.test(parsedURL.protocol)) { + throw new TypeError("Only HTTP(S) protocols are supported"); + } + if (request2.signal && request2.body instanceof Stream2.Readable && !streamDestructionSupported) { + throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8"); + } + let contentLengthValue = null; + if (request2.body == null && /^(POST|PUT)$/i.test(request2.method)) { + contentLengthValue = "0"; + } + if (request2.body != null) { + const totalBytes = getTotalBytes(request2); + if (typeof totalBytes === "number") { + contentLengthValue = String(totalBytes); + } + } + if (contentLengthValue) { + headers.set("Content-Length", contentLengthValue); + } + if (!headers.has("User-Agent")) { + headers.set("User-Agent", "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"); + } + if (request2.compress && !headers.has("Accept-Encoding")) { + headers.set("Accept-Encoding", "gzip,deflate"); + } + let agent = request2.agent; + if (typeof agent === "function") { + agent = agent(parsedURL); + } + return Object.assign({}, parsedURL, { + method: request2.method, + headers: exportNodeCompatibleHeaders(headers), + agent + }); +} +function AbortError3(message) { + Error.call(this, message); + this.type = "aborted"; + this.message = message; + Error.captureStackTrace(this, this.constructor); +} +function fetch3(url2, opts) { + if (!fetch3.Promise) { + throw new Error("native promise missing, set fetch.Promise to your favorite alternative"); + } + Body.Promise = fetch3.Promise; + return new fetch3.Promise(function(resolve8, reject2) { + const request2 = new Request(url2, opts); + const options = getNodeRequestOptions(request2); + const send = (options.protocol === "https:" ? https3 : http3).request; + const signal = request2.signal; + let response = null; + const abort = function abort2() { + let error2 = new AbortError3("The user aborted a request."); + reject2(error2); + if (request2.body && request2.body instanceof Stream2.Readable) { + destroyStream(request2.body, error2); + } + if (!response || !response.body) return; + response.body.emit("error", error2); + }; + if (signal && signal.aborted) { + abort(); + return; + } + const abortAndFinalize = function abortAndFinalize2() { + abort(); + finalize(); + }; + const req = send(options); + let reqTimeout; + if (signal) { + signal.addEventListener("abort", abortAndFinalize); + } + function finalize() { + req.abort(); + if (signal) signal.removeEventListener("abort", abortAndFinalize); + clearTimeout(reqTimeout); + } + if (request2.timeout) { + req.once("socket", function(socket) { + reqTimeout = setTimeout(function() { + reject2(new FetchError(`network timeout at: ${request2.url}`, "request-timeout")); + finalize(); + }, request2.timeout); + }); + } + req.on("error", function(err) { + reject2(new FetchError(`request to ${request2.url} failed, reason: ${err.message}`, "system", err)); + if (response && response.body) { + destroyStream(response.body, err); + } + finalize(); + }); + fixResponseChunkedTransferBadEnding(req, function(err) { + if (signal && signal.aborted) { + return; + } + if (response && response.body) { + destroyStream(response.body, err); + } + }); + if (parseInt(process.version.substring(1)) < 14) { + req.on("socket", function(s) { + s.addListener("close", function(hadError) { + const hasDataListener = s.listenerCount("data") > 0; + if (response && hasDataListener && !hadError && !(signal && signal.aborted)) { + const err = new Error("Premature close"); + err.code = "ERR_STREAM_PREMATURE_CLOSE"; + response.body.emit("error", err); + } + }); + }); + } + req.on("response", function(res) { + clearTimeout(reqTimeout); + const headers = createHeadersLenient(res.headers); + if (fetch3.isRedirect(res.statusCode)) { + const location = headers.get("Location"); + let locationURL = null; + try { + locationURL = location === null ? null : new URL$1(location, request2.url).toString(); + } catch (err) { + if (request2.redirect !== "manual") { + reject2(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, "invalid-redirect")); + finalize(); + return; + } + } + switch (request2.redirect) { + case "error": + reject2(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request2.url}`, "no-redirect")); + finalize(); + return; + case "manual": + if (locationURL !== null) { + try { + headers.set("Location", locationURL); + } catch (err) { + reject2(err); + } + } + break; + case "follow": + if (locationURL === null) { + break; + } + if (request2.counter >= request2.follow) { + reject2(new FetchError(`maximum redirect reached at: ${request2.url}`, "max-redirect")); + finalize(); + return; + } + const requestOpts = { + headers: new Headers3(request2.headers), + follow: request2.follow, + counter: request2.counter + 1, + agent: request2.agent, + compress: request2.compress, + method: request2.method, + body: request2.body, + signal: request2.signal, + timeout: request2.timeout, + size: request2.size + }; + if (!isDomainOrSubdomain(request2.url, locationURL) || !isSameProtocol(request2.url, locationURL)) { + for (const name of ["authorization", "www-authenticate", "cookie", "cookie2"]) { + requestOpts.headers.delete(name); + } + } + if (res.statusCode !== 303 && request2.body && getTotalBytes(request2) === null) { + reject2(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect")); + finalize(); + return; + } + if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request2.method === "POST") { + requestOpts.method = "GET"; + requestOpts.body = void 0; + requestOpts.headers.delete("content-length"); + } + resolve8(fetch3(new Request(locationURL, requestOpts))); + finalize(); + return; + } + } + res.once("end", function() { + if (signal) signal.removeEventListener("abort", abortAndFinalize); + }); + let body2 = res.pipe(new PassThrough$1()); + const response_options = { + url: request2.url, + status: res.statusCode, + statusText: res.statusMessage, + headers, + size: request2.size, + timeout: request2.timeout, + counter: request2.counter + }; + const codings = headers.get("Content-Encoding"); + if (!request2.compress || request2.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) { + response = new Response2(body2, response_options); + resolve8(response); + return; + } + const zlibOptions = { + flush: zlib2.Z_SYNC_FLUSH, + finishFlush: zlib2.Z_SYNC_FLUSH + }; + if (codings == "gzip" || codings == "x-gzip") { + body2 = body2.pipe(zlib2.createGunzip(zlibOptions)); + response = new Response2(body2, response_options); + resolve8(response); + return; + } + if (codings == "deflate" || codings == "x-deflate") { + const raw = res.pipe(new PassThrough$1()); + raw.once("data", function(chunk) { + if ((chunk[0] & 15) === 8) { + body2 = body2.pipe(zlib2.createInflate()); + } else { + body2 = body2.pipe(zlib2.createInflateRaw()); + } + response = new Response2(body2, response_options); + resolve8(response); + }); + raw.on("end", function() { + if (!response) { + response = new Response2(body2, response_options); + resolve8(response); + } + }); + return; + } + if (codings == "br" && typeof zlib2.createBrotliDecompress === "function") { + body2 = body2.pipe(zlib2.createBrotliDecompress()); + response = new Response2(body2, response_options); + resolve8(response); + return; + } + response = new Response2(body2, response_options); + resolve8(response); + }); + writeToStream(req, request2); + }); +} +function fixResponseChunkedTransferBadEnding(request2, errorCallback) { + let socket; + request2.on("socket", function(s) { + socket = s; + }); + request2.on("response", function(response) { + const headers = response.headers; + if (headers["transfer-encoding"] === "chunked" && !headers["content-length"]) { + response.once("close", function(hadError) { + const hasDataListener = socket && socket.listenerCount("data") > 0; + if (hasDataListener && !hadError) { + const err = new Error("Premature close"); + err.code = "ERR_STREAM_PREMATURE_CLOSE"; + errorCallback(err); + } + }); + } + }); +} +function destroyStream(stream5, err) { + if (stream5.destroy) { + stream5.destroy(err); + } else { + stream5.emit("error", err); + stream5.end(); + } +} +var import_whatwg_url, Readable5, BUFFER2, TYPE, Blob2, convert, INTERNALS, PassThrough3, invalidTokenRegex, invalidHeaderCharRegex, MAP, Headers3, INTERNAL, HeadersIteratorPrototype, INTERNALS$1, STATUS_CODES, Response2, INTERNALS$2, URL2, parse_url, format_url, streamDestructionSupported, Request, URL$1, PassThrough$1, isDomainOrSubdomain, isSameProtocol, lib_default2; +var init_lib4 = __esm({ + "node_modules/node-fetch/lib/index.mjs"() { + "use strict"; + import_whatwg_url = __toESM(require_public_api(), 1); + Readable5 = Stream2.Readable; + BUFFER2 = /* @__PURE__ */ Symbol("buffer"); + TYPE = /* @__PURE__ */ Symbol("type"); + Blob2 = class _Blob { + constructor() { + this[TYPE] = ""; + const blobParts = arguments[0]; + const options = arguments[1]; + const buffers = []; + let size = 0; + if (blobParts) { + const a6 = blobParts; + const length = Number(a6.length); + for (let i6 = 0; i6 < length; i6++) { + const element = a6[i6]; + let buffer2; + if (element instanceof Buffer) { + buffer2 = element; + } else if (ArrayBuffer.isView(element)) { + buffer2 = Buffer.from(element.buffer, element.byteOffset, element.byteLength); + } else if (element instanceof ArrayBuffer) { + buffer2 = Buffer.from(element); + } else if (element instanceof _Blob) { + buffer2 = element[BUFFER2]; + } else { + buffer2 = Buffer.from(typeof element === "string" ? element : String(element)); + } + size += buffer2.length; + buffers.push(buffer2); + } + } + this[BUFFER2] = Buffer.concat(buffers); + let type = options && options.type !== void 0 && String(options.type).toLowerCase(); + if (type && !/[^\u0020-\u007E]/.test(type)) { + this[TYPE] = type; + } + } + get size() { + return this[BUFFER2].length; + } + get type() { + return this[TYPE]; + } + text() { + return Promise.resolve(this[BUFFER2].toString()); + } + arrayBuffer() { + const buf = this[BUFFER2]; + const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + return Promise.resolve(ab); + } + stream() { + const readable = new Readable5(); + readable._read = function() { + }; + readable.push(this[BUFFER2]); + readable.push(null); + return readable; + } + toString() { + return "[object Blob]"; + } + slice() { + const size = this.size; + const start = arguments[0]; + const end = arguments[1]; + let relativeStart, relativeEnd; + if (start === void 0) { + relativeStart = 0; + } else if (start < 0) { + relativeStart = Math.max(size + start, 0); + } else { + relativeStart = Math.min(start, size); + } + if (end === void 0) { + relativeEnd = size; + } else if (end < 0) { + relativeEnd = Math.max(size + end, 0); + } else { + relativeEnd = Math.min(end, size); + } + const span = Math.max(relativeEnd - relativeStart, 0); + const buffer2 = this[BUFFER2]; + const slicedBuffer = buffer2.slice(relativeStart, relativeStart + span); + const blob = new _Blob([], { type: arguments[2] }); + blob[BUFFER2] = slicedBuffer; + return blob; + } + }; + Object.defineProperties(Blob2.prototype, { + size: { enumerable: true }, + type: { enumerable: true }, + slice: { enumerable: true } + }); + Object.defineProperty(Blob2.prototype, Symbol.toStringTag, { + value: "Blob", + writable: false, + enumerable: false, + configurable: true + }); + FetchError.prototype = Object.create(Error.prototype); + FetchError.prototype.constructor = FetchError; + FetchError.prototype.name = "FetchError"; + try { + convert = __require("encoding").convert; + } catch (e6) { + } + INTERNALS = /* @__PURE__ */ Symbol("Body internals"); + PassThrough3 = Stream2.PassThrough; + Body.prototype = { + get body() { + return this[INTERNALS].body; + }, + get bodyUsed() { + return this[INTERNALS].disturbed; + }, + /** + * Decode response as ArrayBuffer + * + * @return Promise + */ + arrayBuffer() { + return consumeBody.call(this).then(function(buf) { + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + }); + }, + /** + * Return raw response as Blob + * + * @return Promise + */ + blob() { + let ct2 = this.headers && this.headers.get("content-type") || ""; + return consumeBody.call(this).then(function(buf) { + return Object.assign( + // Prevent copying + new Blob2([], { + type: ct2.toLowerCase() + }), + { + [BUFFER2]: buf + } + ); + }); + }, + /** + * Decode response as json + * + * @return Promise + */ + json() { + var _this2 = this; + return consumeBody.call(this).then(function(buffer2) { + try { + return JSON.parse(buffer2.toString()); + } catch (err) { + return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, "invalid-json")); + } + }); + }, + /** + * Decode response as text + * + * @return Promise + */ + text() { + return consumeBody.call(this).then(function(buffer2) { + return buffer2.toString(); + }); + }, + /** + * Decode response as buffer (non-spec api) + * + * @return Promise + */ + buffer() { + return consumeBody.call(this); + }, + /** + * Decode response as text, while automatically detecting the encoding and + * trying to decode to UTF-8 (non-spec api) + * + * @return Promise + */ + textConverted() { + var _this3 = this; + return consumeBody.call(this).then(function(buffer2) { + return convertBody(buffer2, _this3.headers); + }); + } + }; + Object.defineProperties(Body.prototype, { + body: { enumerable: true }, + bodyUsed: { enumerable: true }, + arrayBuffer: { enumerable: true }, + blob: { enumerable: true }, + json: { enumerable: true }, + text: { enumerable: true } + }); + Body.mixIn = function(proto) { + for (const name of Object.getOwnPropertyNames(Body.prototype)) { + if (!(name in proto)) { + const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); + Object.defineProperty(proto, name, desc); + } + } + }; + Body.Promise = global.Promise; + invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/; + invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/; + MAP = /* @__PURE__ */ Symbol("map"); + Headers3 = class _Headers { + /** + * Headers class + * + * @param Object headers Response headers + * @return Void + */ + constructor() { + let init = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0; + this[MAP] = /* @__PURE__ */ Object.create(null); + if (init instanceof _Headers) { + const rawHeaders = init.raw(); + const headerNames = Object.keys(rawHeaders); + for (const headerName of headerNames) { + for (const value of rawHeaders[headerName]) { + this.append(headerName, value); + } + } + return; + } + if (init == null) ; + else if (typeof init === "object") { + const method = init[Symbol.iterator]; + if (method != null) { + if (typeof method !== "function") { + throw new TypeError("Header pairs must be iterable"); + } + const pairs = []; + for (const pair of init) { + if (typeof pair !== "object" || typeof pair[Symbol.iterator] !== "function") { + throw new TypeError("Each header pair must be iterable"); + } + pairs.push(Array.from(pair)); + } + for (const pair of pairs) { + if (pair.length !== 2) { + throw new TypeError("Each header pair must be a name/value tuple"); + } + this.append(pair[0], pair[1]); + } + } else { + for (const key of Object.keys(init)) { + const value = init[key]; + this.append(key, value); + } + } + } else { + throw new TypeError("Provided initializer must be an object"); + } + } + /** + * Return combined header value given name + * + * @param String name Header name + * @return Mixed + */ + get(name) { + name = `${name}`; + validateName(name); + const key = find(this[MAP], name); + if (key === void 0) { + return null; + } + return this[MAP][key].join(", "); + } + /** + * Iterate over all headers + * + * @param Function callback Executed for each item with parameters (value, name, thisArg) + * @param Boolean thisArg `this` context for callback function + * @return Void + */ + forEach(callback) { + let thisArg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0; + let pairs = getHeaders(this); + let i6 = 0; + while (i6 < pairs.length) { + var _pairs$i = pairs[i6]; + const name = _pairs$i[0], value = _pairs$i[1]; + callback.call(thisArg, value, name, this); + pairs = getHeaders(this); + i6++; + } + } + /** + * Overwrite header values given name + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + set(name, value) { + name = `${name}`; + value = `${value}`; + validateName(name); + validateValue(value); + const key = find(this[MAP], name); + this[MAP][key !== void 0 ? key : name] = [value]; + } + /** + * Append a value onto existing header + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + append(name, value) { + name = `${name}`; + value = `${value}`; + validateName(name); + validateValue(value); + const key = find(this[MAP], name); + if (key !== void 0) { + this[MAP][key].push(value); + } else { + this[MAP][name] = [value]; + } + } + /** + * Check for header name existence + * + * @param String name Header name + * @return Boolean + */ + has(name) { + name = `${name}`; + validateName(name); + return find(this[MAP], name) !== void 0; + } + /** + * Delete all header values given name + * + * @param String name Header name + * @return Void + */ + delete(name) { + name = `${name}`; + validateName(name); + const key = find(this[MAP], name); + if (key !== void 0) { + delete this[MAP][key]; + } + } + /** + * Return raw headers (non-spec api) + * + * @return Object + */ + raw() { + return this[MAP]; + } + /** + * Get an iterator on keys. + * + * @return Iterator + */ + keys() { + return createHeadersIterator(this, "key"); + } + /** + * Get an iterator on values. + * + * @return Iterator + */ + values() { + return createHeadersIterator(this, "value"); + } + /** + * Get an iterator on entries. + * + * This is the default iterator of the Headers object. + * + * @return Iterator + */ + [Symbol.iterator]() { + return createHeadersIterator(this, "key+value"); + } + }; + Headers3.prototype.entries = Headers3.prototype[Symbol.iterator]; + Object.defineProperty(Headers3.prototype, Symbol.toStringTag, { + value: "Headers", + writable: false, + enumerable: false, + configurable: true + }); + Object.defineProperties(Headers3.prototype, { + get: { enumerable: true }, + forEach: { enumerable: true }, + set: { enumerable: true }, + append: { enumerable: true }, + has: { enumerable: true }, + delete: { enumerable: true }, + keys: { enumerable: true }, + values: { enumerable: true }, + entries: { enumerable: true } + }); + INTERNAL = /* @__PURE__ */ Symbol("internal"); + HeadersIteratorPrototype = Object.setPrototypeOf({ + next() { + if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { + throw new TypeError("Value of `this` is not a HeadersIterator"); + } + var _INTERNAL = this[INTERNAL]; + const target = _INTERNAL.target, kind = _INTERNAL.kind, index2 = _INTERNAL.index; + const values = getHeaders(target, kind); + const len = values.length; + if (index2 >= len) { + return { + value: void 0, + done: true + }; + } + this[INTERNAL].index = index2 + 1; + return { + value: values[index2], + done: false + }; + } + }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); + Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { + value: "HeadersIterator", + writable: false, + enumerable: false, + configurable: true + }); + INTERNALS$1 = /* @__PURE__ */ Symbol("Response internals"); + STATUS_CODES = http3.STATUS_CODES; + Response2 = class _Response { + constructor() { + let body2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null; + let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + Body.call(this, body2, opts); + const status = opts.status || 200; + const headers = new Headers3(opts.headers); + if (body2 != null && !headers.has("Content-Type")) { + const contentType2 = extractContentType(body2); + if (contentType2) { + headers.append("Content-Type", contentType2); + } + } + this[INTERNALS$1] = { + url: opts.url, + status, + statusText: opts.statusText || STATUS_CODES[status], + headers, + counter: opts.counter + }; } - get currentChatCompletionSnapshot() { - return __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); + get url() { + return this[INTERNALS$1].url || ""; + } + get status() { + return this[INTERNALS$1].status; } /** - * Intended for use on the frontend, consuming a stream produced with - * `.toReadableStream()` on the backend. - * - * Note that messages sent to the model do not appear in `.on('message')` - * in this context. + * Convenience property representing if the request ended normally */ - static fromReadableStream(stream5) { - const runner = new _ChatCompletionStream(null); - runner._run(() => runner._fromReadableStream(stream5)); - return runner; + get ok() { + return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; } - static createChatCompletion(client2, params, options) { - const runner = new _ChatCompletionStream(params); - runner._run(() => runner._runChatCompletion(client2, { ...params, stream: true }, { ...options, headers: { ...options?.headers, "X-Stainless-Helper-Method": "stream" } })); - return runner; + get redirected() { + return this[INTERNALS$1].counter > 0; } - async _createChatCompletion(client2, params, options) { - super._createChatCompletion; - const signal = options?.signal; - if (signal) { - if (signal.aborted) - this.controller.abort(); - signal.addEventListener("abort", () => this.controller.abort()); - } - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this); - const stream5 = await client2.chat.completions.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }); - this._connected(); - for await (const chunk of stream5) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_addChunk).call(this, chunk); - } - if (stream5.controller.signal?.aborted) { - throw new error_1.APIUserAbortError(); - } - return this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); + get statusText() { + return this[INTERNALS$1].statusText; } - async _fromReadableStream(readableStream, options) { - const signal = options?.signal; - if (signal) { - if (signal.aborted) - this.controller.abort(); - signal.addEventListener("abort", () => this.controller.abort()); + get headers() { + return this[INTERNALS$1].headers; + } + /** + * Clone this response + * + * @return Response + */ + clone() { + return new _Response(clone(this), { + url: this.url, + status: this.status, + statusText: this.statusText, + headers: this.headers, + ok: this.ok, + redirected: this.redirected + }); + } + }; + Body.mixIn(Response2.prototype); + Object.defineProperties(Response2.prototype, { + url: { enumerable: true }, + status: { enumerable: true }, + ok: { enumerable: true }, + redirected: { enumerable: true }, + statusText: { enumerable: true }, + headers: { enumerable: true }, + clone: { enumerable: true } + }); + Object.defineProperty(Response2.prototype, Symbol.toStringTag, { + value: "Response", + writable: false, + enumerable: false, + configurable: true + }); + INTERNALS$2 = /* @__PURE__ */ Symbol("Request internals"); + URL2 = Url.URL || import_whatwg_url.default.URL; + parse_url = Url.parse; + format_url = Url.format; + streamDestructionSupported = "destroy" in Stream2.Readable.prototype; + Request = class _Request { + constructor(input) { + let init = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + let parsedURL; + if (!isRequest(input)) { + if (input && input.href) { + parsedURL = parseURL(input.href); + } else { + parsedURL = parseURL(`${input}`); + } + input = {}; + } else { + parsedURL = parseURL(input.url); } - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this); - this._connected(); - const stream5 = streaming_1.Stream.fromReadableStream(readableStream, this.controller); - let chatId; - for await (const chunk of stream5) { - if (chatId && chatId !== chunk.id) { - this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); + let method = init.method || input.method || "GET"; + method = method.toUpperCase(); + if ((init.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) { + throw new TypeError("Request with GET/HEAD method cannot have body"); + } + let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; + Body.call(this, inputBody, { + timeout: init.timeout || input.timeout || 0, + size: init.size || input.size || 0 + }); + const headers = new Headers3(init.headers || input.headers || {}); + if (inputBody != null && !headers.has("Content-Type")) { + const contentType2 = extractContentType(inputBody); + if (contentType2) { + headers.append("Content-Type", contentType2); } - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_addChunk).call(this, chunk); - chatId = chunk.id; } - if (stream5.controller.signal?.aborted) { - throw new error_1.APIUserAbortError(); + let signal = isRequest(input) ? input.signal : null; + if ("signal" in init) signal = init.signal; + if (signal != null && !isAbortSignal(signal)) { + throw new TypeError("Expected signal to be an instanceof AbortSignal"); } - return this._addChatCompletion(__classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this)); + this[INTERNALS$2] = { + method, + redirect: init.redirect || input.redirect || "follow", + headers, + parsedURL, + signal + }; + this.follow = init.follow !== void 0 ? init.follow : input.follow !== void 0 ? input.follow : 20; + this.compress = init.compress !== void 0 ? init.compress : input.compress !== void 0 ? input.compress : true; + this.counter = init.counter || input.counter || 0; + this.agent = init.agent || input.agent; } - [(_ChatCompletionStream_params = /* @__PURE__ */ new WeakMap(), _ChatCompletionStream_choiceEventStates = /* @__PURE__ */ new WeakMap(), _ChatCompletionStream_currentChatCompletionSnapshot = /* @__PURE__ */ new WeakMap(), _ChatCompletionStream_instances = /* @__PURE__ */ new WeakSet(), _ChatCompletionStream_beginRequest = function _ChatCompletionStream_beginRequest2() { - if (this.ended) - return; - __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, void 0, "f"); - }, _ChatCompletionStream_getChoiceEventState = function _ChatCompletionStream_getChoiceEventState2(choice) { - let state4 = __classPrivateFieldGet(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index]; - if (state4) { - return state4; + get method() { + return this[INTERNALS$2].method; + } + get url() { + return format_url(this[INTERNALS$2].parsedURL); + } + get headers() { + return this[INTERNALS$2].headers; + } + get redirect() { + return this[INTERNALS$2].redirect; + } + get signal() { + return this[INTERNALS$2].signal; + } + /** + * Clone this request + * + * @return Request + */ + clone() { + return new _Request(this); + } + }; + Body.mixIn(Request.prototype); + Object.defineProperty(Request.prototype, Symbol.toStringTag, { + value: "Request", + writable: false, + enumerable: false, + configurable: true + }); + Object.defineProperties(Request.prototype, { + method: { enumerable: true }, + url: { enumerable: true }, + headers: { enumerable: true }, + redirect: { enumerable: true }, + clone: { enumerable: true }, + signal: { enumerable: true } + }); + AbortError3.prototype = Object.create(Error.prototype); + AbortError3.prototype.constructor = AbortError3; + AbortError3.prototype.name = "AbortError"; + URL$1 = Url.URL || import_whatwg_url.default.URL; + PassThrough$1 = Stream2.PassThrough; + isDomainOrSubdomain = function isDomainOrSubdomain2(destination, original) { + const orig = new URL$1(original).hostname; + const dest = new URL$1(destination).hostname; + return orig === dest || orig[orig.length - dest.length - 1] === "." && orig.endsWith(dest); + }; + isSameProtocol = function isSameProtocol2(destination, original) { + const orig = new URL$1(original).protocol; + const dest = new URL$1(destination).protocol; + return orig === dest; + }; + fetch3.isRedirect = function(code) { + return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; + }; + fetch3.Promise = global.Promise; + lib_default2 = fetch3; + } +}); + +// node_modules/web-streams-polyfill/dist/ponyfill.js +var require_ponyfill = __commonJS({ + "node_modules/web-streams-polyfill/dist/ponyfill.js"(exports2, module) { + "use strict"; + !(function(e6, t) { + "object" == typeof exports2 && "undefined" != typeof module ? t(exports2) : "function" == typeof define && define.amd ? define(["exports"], t) : t((e6 = "undefined" != typeof globalThis ? globalThis : e6 || self).WebStreamsPolyfill = {}); + })(exports2, (function(e6) { + "use strict"; + const t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? Symbol : (e7) => `Symbol(${e7})`; + function r6() { + } + function o2(e7) { + return "object" == typeof e7 && null !== e7 || "function" == typeof e7; + } + const n8 = r6; + function a6(e7, t2) { + try { + Object.defineProperty(e7, "name", { value: t2, configurable: true }); + } catch (e8) { } - state4 = { - content_done: false, - refusal_done: false, - logprobs_content_done: false, - logprobs_refusal_done: false, - done_tool_calls: /* @__PURE__ */ new Set(), - current_tool_call_index: null - }; - __classPrivateFieldGet(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index] = state4; - return state4; - }, _ChatCompletionStream_addChunk = function _ChatCompletionStream_addChunk2(chunk) { - if (this.ended) - return; - const completion = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_accumulateChatCompletion).call(this, chunk); - this._emit("chunk", chunk, completion); - for (const choice of chunk.choices) { - const choiceSnapshot = completion.choices[choice.index]; - if (choice.delta.content != null && choiceSnapshot.message?.role === "assistant" && choiceSnapshot.message?.content) { - this._emit("content", choice.delta.content, choiceSnapshot.message.content); - this._emit("content.delta", { - delta: choice.delta.content, - snapshot: choiceSnapshot.message.content, - parsed: choiceSnapshot.message.parsed - }); - } - if (choice.delta.refusal != null && choiceSnapshot.message?.role === "assistant" && choiceSnapshot.message?.refusal) { - this._emit("refusal.delta", { - delta: choice.delta.refusal, - snapshot: choiceSnapshot.message.refusal - }); - } - if (choice.logprobs?.content != null && choiceSnapshot.message?.role === "assistant") { - this._emit("logprobs.content.delta", { - content: choice.logprobs?.content, - snapshot: choiceSnapshot.logprobs?.content ?? [] - }); - } - if (choice.logprobs?.refusal != null && choiceSnapshot.message?.role === "assistant") { - this._emit("logprobs.refusal.delta", { - refusal: choice.logprobs?.refusal, - snapshot: choiceSnapshot.logprobs?.refusal ?? [] - }); - } - const state4 = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); - if (choiceSnapshot.finish_reason) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitContentDoneEvents).call(this, choiceSnapshot); - if (state4.current_tool_call_index != null) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitToolCallDoneEvent).call(this, choiceSnapshot, state4.current_tool_call_index); - } - } - for (const toolCall of choice.delta.tool_calls ?? []) { - if (state4.current_tool_call_index !== toolCall.index) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitContentDoneEvents).call(this, choiceSnapshot); - if (state4.current_tool_call_index != null) { - __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_emitToolCallDoneEvent).call(this, choiceSnapshot, state4.current_tool_call_index); - } - } - state4.current_tool_call_index = toolCall.index; - } - for (const toolCallDelta of choice.delta.tool_calls ?? []) { - const toolCallSnapshot = choiceSnapshot.message.tool_calls?.[toolCallDelta.index]; - if (!toolCallSnapshot?.type) { - continue; - } - if (toolCallSnapshot?.type === "function") { - this._emit("tool_calls.function.arguments.delta", { - name: toolCallSnapshot.function?.name, - index: toolCallDelta.index, - arguments: toolCallSnapshot.function.arguments, - parsed_arguments: toolCallSnapshot.function.parsed_arguments, - arguments_delta: toolCallDelta.function?.arguments ?? "" - }); - } else { - assertNever(toolCallSnapshot?.type); - } - } + } + const i6 = Promise, l3 = Promise.prototype.then, s = Promise.resolve.bind(i6), u = Promise.reject.bind(i6); + function c6(e7) { + return new i6(e7); + } + function d6(e7) { + return s(e7); + } + function f6(e7) { + return u(e7); + } + function b6(e7, t2, r7) { + return l3.call(e7, t2, r7); + } + function h6(e7, t2, r7) { + b6(b6(e7, t2, r7), void 0, n8); + } + function _3(e7, t2) { + h6(e7, t2); + } + function p2(e7, t2) { + h6(e7, void 0, t2); + } + function m3(e7, t2, r7) { + return b6(e7, t2, r7); + } + function y(e7) { + b6(e7, void 0, n8); + } + let g6 = (e7) => { + if ("function" == typeof queueMicrotask) g6 = queueMicrotask; + else { + const e8 = d6(void 0); + g6 = (t2) => b6(e8, t2); } - }, _ChatCompletionStream_emitToolCallDoneEvent = function _ChatCompletionStream_emitToolCallDoneEvent2(choiceSnapshot, toolCallIndex) { - const state4 = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); - if (state4.done_tool_calls.has(toolCallIndex)) { - return; + return g6(e7); + }; + function S(e7, t2, r7) { + if ("function" != typeof e7) throw new TypeError("Argument is not a function"); + return Function.prototype.apply.call(e7, t2, r7); + } + function w(e7, t2, r7) { + try { + return d6(S(e7, t2, r7)); + } catch (e8) { + return f6(e8); } - const toolCallSnapshot = choiceSnapshot.message.tool_calls?.[toolCallIndex]; - if (!toolCallSnapshot) { - throw new Error("no tool call snapshot"); + } + class v2 { + constructor() { + this._cursor = 0, this._size = 0, this._front = { _elements: [], _next: void 0 }, this._back = this._front, this._cursor = 0, this._size = 0; } - if (!toolCallSnapshot.type) { - throw new Error("tool call snapshot missing `type`"); + get length() { + return this._size; } - if (toolCallSnapshot.type === "function") { - const inputTool = __classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.tools?.find((tool) => tool.type === "function" && tool.function.name === toolCallSnapshot.function.name); - this._emit("tool_calls.function.arguments.done", { - name: toolCallSnapshot.function.name, - index: toolCallIndex, - arguments: toolCallSnapshot.function.arguments, - parsed_arguments: (0, parser_1.isAutoParsableTool)(inputTool) ? inputTool.$parseRaw(toolCallSnapshot.function.arguments) : inputTool?.function.strict ? JSON.parse(toolCallSnapshot.function.arguments) : null - }); - } else { - assertNever(toolCallSnapshot.type); + push(e7) { + const t2 = this._back; + let r7 = t2; + 16383 === t2._elements.length && (r7 = { _elements: [], _next: void 0 }), t2._elements.push(e7), r7 !== t2 && (this._back = r7, t2._next = r7), ++this._size; } - }, _ChatCompletionStream_emitContentDoneEvents = function _ChatCompletionStream_emitContentDoneEvents2(choiceSnapshot) { - const state4 = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot); - if (choiceSnapshot.message.content && !state4.content_done) { - state4.content_done = true; - const responseFormat = __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getAutoParseableResponseFormat).call(this); - this._emit("content.done", { - content: choiceSnapshot.message.content, - parsed: responseFormat ? responseFormat.$parseRaw(choiceSnapshot.message.content) : null - }); + shift() { + const e7 = this._front; + let t2 = e7; + const r7 = this._cursor; + let o3 = r7 + 1; + const n9 = e7._elements, a7 = n9[r7]; + return 16384 === o3 && (t2 = e7._next, o3 = 0), --this._size, this._cursor = o3, e7 !== t2 && (this._front = t2), n9[r7] = void 0, a7; } - if (choiceSnapshot.message.refusal && !state4.refusal_done) { - state4.refusal_done = true; - this._emit("refusal.done", { refusal: choiceSnapshot.message.refusal }); + forEach(e7) { + let t2 = this._cursor, r7 = this._front, o3 = r7._elements; + for (; !(t2 === o3.length && void 0 === r7._next || t2 === o3.length && (r7 = r7._next, o3 = r7._elements, t2 = 0, 0 === o3.length)); ) e7(o3[t2]), ++t2; } - if (choiceSnapshot.logprobs?.content && !state4.logprobs_content_done) { - state4.logprobs_content_done = true; - this._emit("logprobs.content.done", { content: choiceSnapshot.logprobs.content }); + peek() { + const e7 = this._front, t2 = this._cursor; + return e7._elements[t2]; } - if (choiceSnapshot.logprobs?.refusal && !state4.logprobs_refusal_done) { - state4.logprobs_refusal_done = true; - this._emit("logprobs.refusal.done", { refusal: choiceSnapshot.logprobs.refusal }); + } + const R2 = t("[[AbortSteps]]"), T2 = t("[[ErrorSteps]]"), q3 = t("[[CancelSteps]]"), C2 = t("[[PullSteps]]"), P2 = t("[[ReleaseSteps]]"); + function E(e7, t2) { + e7._ownerReadableStream = t2, t2._reader = e7, "readable" === t2._state ? B2(e7) : "closed" === t2._state ? (function(e8) { + B2(e8), z(e8); + })(e7) : A2(e7, t2._storedError); + } + function W2(e7, t2) { + return Xt2(e7._ownerReadableStream, t2); + } + function O2(e7) { + const t2 = e7._ownerReadableStream; + "readable" === t2._state ? j7(e7, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")) : (function(e8, t3) { + A2(e8, t3); + })(e7, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")), t2._readableStreamController[P2](), t2._reader = void 0, e7._ownerReadableStream = void 0; + } + function k7(e7) { + return new TypeError("Cannot " + e7 + " a stream using a released reader"); + } + function B2(e7) { + e7._closedPromise = c6(((t2, r7) => { + e7._closedPromise_resolve = t2, e7._closedPromise_reject = r7; + })); + } + function A2(e7, t2) { + B2(e7), j7(e7, t2); + } + function j7(e7, t2) { + void 0 !== e7._closedPromise_reject && (y(e7._closedPromise), e7._closedPromise_reject(t2), e7._closedPromise_resolve = void 0, e7._closedPromise_reject = void 0); + } + function z(e7) { + void 0 !== e7._closedPromise_resolve && (e7._closedPromise_resolve(void 0), e7._closedPromise_resolve = void 0, e7._closedPromise_reject = void 0); + } + const L2 = Number.isFinite || function(e7) { + return "number" == typeof e7 && isFinite(e7); + }, F2 = Math.trunc || function(e7) { + return e7 < 0 ? Math.ceil(e7) : Math.floor(e7); + }; + function D2(e7, t2) { + if (void 0 !== e7 && ("object" != typeof (r7 = e7) && "function" != typeof r7)) throw new TypeError(`${t2} is not an object.`); + var r7; + } + function I2(e7, t2) { + if ("function" != typeof e7) throw new TypeError(`${t2} is not a function.`); + } + function $(e7, t2) { + if (!/* @__PURE__ */ (function(e8) { + return "object" == typeof e8 && null !== e8 || "function" == typeof e8; + })(e7)) throw new TypeError(`${t2} is not an object.`); + } + function M2(e7, t2, r7) { + if (void 0 === e7) throw new TypeError(`Parameter ${t2} is required in '${r7}'.`); + } + function Y2(e7, t2, r7) { + if (void 0 === e7) throw new TypeError(`${t2} is required in '${r7}'.`); + } + function Q2(e7) { + return Number(e7); + } + function N2(e7) { + return 0 === e7 ? 0 : e7; + } + function x2(e7, t2) { + const r7 = Number.MAX_SAFE_INTEGER; + let o3 = Number(e7); + if (o3 = N2(o3), !L2(o3)) throw new TypeError(`${t2} is not a finite number`); + if (o3 = (function(e8) { + return N2(F2(e8)); + })(o3), o3 < 0 || o3 > r7) throw new TypeError(`${t2} is outside the accepted range of 0 to ${r7}, inclusive`); + return L2(o3) && 0 !== o3 ? o3 : 0; + } + function H2(e7) { + if (!o2(e7)) return false; + if ("function" != typeof e7.getReader) return false; + try { + return "boolean" == typeof e7.locked; + } catch (e8) { + return false; } - }, _ChatCompletionStream_endRequest = function _ChatCompletionStream_endRequest2() { - if (this.ended) { - throw new error_1.OpenAIError(`stream has ended, this shouldn't happen`); + } + function V2(e7) { + if (!o2(e7)) return false; + if ("function" != typeof e7.getWriter) return false; + try { + return "boolean" == typeof e7.locked; + } catch (e8) { + return false; } - const snapshot2 = __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); - if (!snapshot2) { - throw new error_1.OpenAIError(`request ended without sending any chunks`); + } + function U2(e7, t2) { + if (!Ut2(e7)) throw new TypeError(`${t2} is not a ReadableStream.`); + } + function G2(e7, t2) { + e7._reader._readRequests.push(t2); + } + function X2(e7, t2, r7) { + const o3 = e7._reader._readRequests.shift(); + r7 ? o3._closeSteps() : o3._chunkSteps(t2); + } + function J(e7) { + return e7._reader._readRequests.length; + } + function K2(e7) { + const t2 = e7._reader; + return void 0 !== t2 && !!Z(t2); + } + class ReadableStreamDefaultReader { + constructor(e7) { + if (M2(e7, 1, "ReadableStreamDefaultReader"), U2(e7, "First parameter"), Gt2(e7)) throw new TypeError("This stream has already been locked for exclusive reading by another reader"); + E(this, e7), this._readRequests = new v2(); } - __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, void 0, "f"); - __classPrivateFieldSet(this, _ChatCompletionStream_choiceEventStates, [], "f"); - return finalizeChatCompletion(snapshot2, __classPrivateFieldGet(this, _ChatCompletionStream_params, "f")); - }, _ChatCompletionStream_getAutoParseableResponseFormat = function _ChatCompletionStream_getAutoParseableResponseFormat2() { - const responseFormat = __classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.response_format; - if ((0, parser_1.isAutoParsableResponseFormat)(responseFormat)) { - return responseFormat; + get closed() { + return Z(this) ? this._closedPromise : f6(te2("closed")); } - return null; - }, _ChatCompletionStream_accumulateChatCompletion = function _ChatCompletionStream_accumulateChatCompletion2(chunk) { - var _a5, _b2, _c6, _d2; - let snapshot2 = __classPrivateFieldGet(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f"); - const { choices, ...rest } = chunk; - if (!snapshot2) { - snapshot2 = __classPrivateFieldSet(this, _ChatCompletionStream_currentChatCompletionSnapshot, { - ...rest, - choices: [] - }, "f"); - } else { - Object.assign(snapshot2, rest); + cancel(e7) { + return Z(this) ? void 0 === this._ownerReadableStream ? f6(k7("cancel")) : W2(this, e7) : f6(te2("cancel")); } - for (const { delta, finish_reason, index: index2, logprobs = null, ...other } of chunk.choices) { - let choice = snapshot2.choices[index2]; - if (!choice) { - choice = snapshot2.choices[index2] = { finish_reason, index: index2, message: {}, logprobs, ...other }; - } - if (logprobs) { - if (!choice.logprobs) { - choice.logprobs = Object.assign({}, logprobs); - } else { - const { content: content2, refusal: refusal2, ...rest3 } = logprobs; - assertIsEmpty(rest3); - Object.assign(choice.logprobs, rest3); - if (content2) { - (_a5 = choice.logprobs).content ?? (_a5.content = []); - choice.logprobs.content.push(...content2); - } - if (refusal2) { - (_b2 = choice.logprobs).refusal ?? (_b2.refusal = []); - choice.logprobs.refusal.push(...refusal2); - } - } - } - if (finish_reason) { - choice.finish_reason = finish_reason; - if (__classPrivateFieldGet(this, _ChatCompletionStream_params, "f") && (0, parser_1.hasAutoParseableInput)(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f"))) { - if (finish_reason === "length") { - throw new error_1.LengthFinishReasonError(); - } - if (finish_reason === "content_filter") { - throw new error_1.ContentFilterFinishReasonError(); - } - } - } - Object.assign(choice, other); - if (!delta) - continue; - const { content, refusal, function_call, role, tool_calls, ...rest2 } = delta; - assertIsEmpty(rest2); - Object.assign(choice.message, rest2); - if (refusal) { - choice.message.refusal = (choice.message.refusal || "") + refusal; - } - if (role) - choice.message.role = role; - if (function_call) { - if (!choice.message.function_call) { - choice.message.function_call = function_call; - } else { - if (function_call.name) - choice.message.function_call.name = function_call.name; - if (function_call.arguments) { - (_c6 = choice.message.function_call).arguments ?? (_c6.arguments = ""); - choice.message.function_call.arguments += function_call.arguments; - } - } - } - if (content) { - choice.message.content = (choice.message.content || "") + content; - if (!choice.message.refusal && __classPrivateFieldGet(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getAutoParseableResponseFormat).call(this)) { - choice.message.parsed = (0, parser_2.partialParse)(choice.message.content); - } - } - if (tool_calls) { - if (!choice.message.tool_calls) - choice.message.tool_calls = []; - for (const { index: index3, id, type, function: fn, ...rest3 } of tool_calls) { - const tool_call = (_d2 = choice.message.tool_calls)[index3] ?? (_d2[index3] = {}); - Object.assign(tool_call, rest3); - if (id) - tool_call.id = id; - if (type) - tool_call.type = type; - if (fn) - tool_call.function ?? (tool_call.function = { name: fn.name ?? "", arguments: "" }); - if (fn?.name) - tool_call.function.name = fn.name; - if (fn?.arguments) { - tool_call.function.arguments += fn.arguments; - if ((0, parser_1.shouldParseToolCall)(__classPrivateFieldGet(this, _ChatCompletionStream_params, "f"), tool_call)) { - tool_call.function.parsed_arguments = (0, parser_2.partialParse)(tool_call.function.arguments); - } - } - } - } + read() { + if (!Z(this)) return f6(te2("read")); + if (void 0 === this._ownerReadableStream) return f6(k7("read from")); + let e7, t2; + const r7 = c6(((r8, o3) => { + e7 = r8, t2 = o3; + })); + return (function(e8, t3) { + const r8 = e8._ownerReadableStream; + r8._disturbed = true, "closed" === r8._state ? t3._closeSteps() : "errored" === r8._state ? t3._errorSteps(r8._storedError) : r8._readableStreamController[C2](t3); + })(this, { _chunkSteps: (t3) => e7({ value: t3, done: false }), _closeSteps: () => e7({ value: void 0, done: true }), _errorSteps: (e8) => t2(e8) }), r7; + } + releaseLock() { + if (!Z(this)) throw te2("releaseLock"); + void 0 !== this._ownerReadableStream && (function(e7) { + O2(e7); + const t2 = new TypeError("Reader was released"); + ee2(e7, t2); + })(this); } - return snapshot2; - }, Symbol.asyncIterator)]() { - const pushQueue = []; - const readQueue = []; - let done = false; - this.on("chunk", (chunk) => { - const reader = readQueue.shift(); - if (reader) { - reader.resolve(chunk); - } else { - pushQueue.push(chunk); - } - }); - this.on("end", () => { - done = true; - for (const reader of readQueue) { - reader.resolve(void 0); - } - readQueue.length = 0; - }); - this.on("abort", (err) => { - done = true; - for (const reader of readQueue) { - reader.reject(err); - } - readQueue.length = 0; - }); - this.on("error", (err) => { - done = true; - for (const reader of readQueue) { - reader.reject(err); - } - readQueue.length = 0; - }); - return { - next: async () => { - if (!pushQueue.length) { - if (done) { - return { value: void 0, done: true }; - } - return new Promise((resolve4, reject2) => readQueue.push({ resolve: resolve4, reject: reject2 })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true }); - } - const chunk = pushQueue.shift(); - return { value: chunk, done: false }; - }, - return: async () => { - this.abort(); - return { value: void 0, done: true }; - } - }; - } - toReadableStream() { - const stream5 = new streaming_1.Stream(this[Symbol.asyncIterator].bind(this), this.controller); - return stream5.toReadableStream(); } - }; - exports2.ChatCompletionStream = ChatCompletionStream; - function finalizeChatCompletion(snapshot2, params) { - const { id, choices, created, model, system_fingerprint, ...rest } = snapshot2; - const completion = { - ...rest, - id, - choices: choices.map(({ message, finish_reason, index: index2, logprobs, ...choiceRest }) => { - if (!finish_reason) { - throw new error_1.OpenAIError(`missing finish_reason for choice ${index2}`); - } - const { content = null, function_call, tool_calls, ...messageRest } = message; - const role = message.role; - if (!role) { - throw new error_1.OpenAIError(`missing role for choice ${index2}`); - } - if (function_call) { - const { arguments: args, name } = function_call; - if (args == null) { - throw new error_1.OpenAIError(`missing function_call.arguments for choice ${index2}`); - } - if (!name) { - throw new error_1.OpenAIError(`missing function_call.name for choice ${index2}`); - } - return { - ...choiceRest, - message: { - content, - function_call: { arguments: args, name }, - role, - refusal: message.refusal ?? null - }, - finish_reason, - index: index2, - logprobs - }; - } - if (tool_calls) { - return { - ...choiceRest, - index: index2, - finish_reason, - logprobs, - message: { - ...messageRest, - role, - content, - refusal: message.refusal ?? null, - tool_calls: tool_calls.map((tool_call, i6) => { - const { function: fn, type, id: id2, ...toolRest } = tool_call; - const { arguments: args, name, ...fnRest } = fn || {}; - if (id2 == null) { - throw new error_1.OpenAIError(`missing choices[${index2}].tool_calls[${i6}].id -${str(snapshot2)}`); - } - if (type == null) { - throw new error_1.OpenAIError(`missing choices[${index2}].tool_calls[${i6}].type -${str(snapshot2)}`); - } - if (name == null) { - throw new error_1.OpenAIError(`missing choices[${index2}].tool_calls[${i6}].function.name -${str(snapshot2)}`); - } - if (args == null) { - throw new error_1.OpenAIError(`missing choices[${index2}].tool_calls[${i6}].function.arguments -${str(snapshot2)}`); - } - return { ...toolRest, id: id2, type, function: { ...fnRest, name, arguments: args } }; - }) - } - }; - } - return { - ...choiceRest, - message: { ...messageRest, content, role, refusal: message.refusal ?? null }, - finish_reason, - index: index2, - logprobs - }; - }), - created, - model, - object: "chat.completion", - ...system_fingerprint ? { system_fingerprint } : {} - }; - return (0, parser_1.maybeParseChatCompletion)(completion, params); - } - function str(x6) { - return JSON.stringify(x6); - } - function assertIsEmpty(obj) { - return; - } - function assertNever(_x) { - } - } -}); - -// node_modules/openai/lib/ChatCompletionStreamingRunner.js -var require_ChatCompletionStreamingRunner = __commonJS({ - "node_modules/openai/lib/ChatCompletionStreamingRunner.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ChatCompletionStreamingRunner = void 0; - var ChatCompletionStream_1 = require_ChatCompletionStream(); - var ChatCompletionStreamingRunner = class _ChatCompletionStreamingRunner extends ChatCompletionStream_1.ChatCompletionStream { - static fromReadableStream(stream5) { - const runner = new _ChatCompletionStreamingRunner(null); - runner._run(() => runner._fromReadableStream(stream5)); - return runner; + function Z(e7) { + return !!o2(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_readRequests") && e7 instanceof ReadableStreamDefaultReader); } - /** @deprecated - please use `runTools` instead. */ - static runFunctions(client2, params, options) { - const runner = new _ChatCompletionStreamingRunner(null); - const opts = { - ...options, - headers: { ...options?.headers, "X-Stainless-Helper-Method": "runFunctions" } - }; - runner._run(() => runner._runFunctions(client2, params, opts)); - return runner; + function ee2(e7, t2) { + const r7 = e7._readRequests; + e7._readRequests = new v2(), r7.forEach(((e8) => { + e8._errorSteps(t2); + })); } - static runTools(client2, params, options) { - const runner = new _ChatCompletionStreamingRunner( - // @ts-expect-error TODO these types are incompatible - params - ); - const opts = { - ...options, - headers: { ...options?.headers, "X-Stainless-Helper-Method": "runTools" } - }; - runner._run(() => runner._runTools(client2, params, opts)); - return runner; + function te2(e7) { + return new TypeError(`ReadableStreamDefaultReader.prototype.${e7} can only be used on a ReadableStreamDefaultReader`); } - }; - exports2.ChatCompletionStreamingRunner = ChatCompletionStreamingRunner; - } -}); - -// node_modules/openai/resources/beta/chat/completions.js -var require_completions3 = __commonJS({ - "node_modules/openai/resources/beta/chat/completions.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Completions = exports2.ChatCompletionRunner = exports2.ChatCompletionStream = exports2.ParsingToolFunction = exports2.ParsingFunction = exports2.ChatCompletionStreamingRunner = void 0; - var resource_1 = require_resource(); - var ChatCompletionRunner_1 = require_ChatCompletionRunner(); - var ChatCompletionStreamingRunner_1 = require_ChatCompletionStreamingRunner(); - var ChatCompletionStream_1 = require_ChatCompletionStream(); - var parser_1 = require_parser3(); - var ChatCompletionStreamingRunner_2 = require_ChatCompletionStreamingRunner(); - Object.defineProperty(exports2, "ChatCompletionStreamingRunner", { enumerable: true, get: function() { - return ChatCompletionStreamingRunner_2.ChatCompletionStreamingRunner; - } }); - var RunnableFunction_1 = require_RunnableFunction(); - Object.defineProperty(exports2, "ParsingFunction", { enumerable: true, get: function() { - return RunnableFunction_1.ParsingFunction; - } }); - Object.defineProperty(exports2, "ParsingToolFunction", { enumerable: true, get: function() { - return RunnableFunction_1.ParsingToolFunction; - } }); - var ChatCompletionStream_2 = require_ChatCompletionStream(); - Object.defineProperty(exports2, "ChatCompletionStream", { enumerable: true, get: function() { - return ChatCompletionStream_2.ChatCompletionStream; - } }); - var ChatCompletionRunner_2 = require_ChatCompletionRunner(); - Object.defineProperty(exports2, "ChatCompletionRunner", { enumerable: true, get: function() { - return ChatCompletionRunner_2.ChatCompletionRunner; - } }); - var Completions = class extends resource_1.APIResource { - parse(body2, options) { - (0, parser_1.validateInputTools)(body2.tools); - return this._client.chat.completions.create(body2, { - ...options, - headers: { - ...options?.headers, - "X-Stainless-Helper-Method": "beta.chat.completions.parse" + Object.defineProperties(ReadableStreamDefaultReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), a6(ReadableStreamDefaultReader.prototype.cancel, "cancel"), a6(ReadableStreamDefaultReader.prototype.read, "read"), a6(ReadableStreamDefaultReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof t.toStringTag && Object.defineProperty(ReadableStreamDefaultReader.prototype, t.toStringTag, { value: "ReadableStreamDefaultReader", configurable: true }); + class re2 { + constructor(e7, t2) { + this._ongoingPromise = void 0, this._isFinished = false, this._reader = e7, this._preventCancel = t2; + } + next() { + const e7 = () => this._nextSteps(); + return this._ongoingPromise = this._ongoingPromise ? m3(this._ongoingPromise, e7, e7) : e7(), this._ongoingPromise; + } + return(e7) { + const t2 = () => this._returnSteps(e7); + return this._ongoingPromise ? m3(this._ongoingPromise, t2, t2) : t2(); + } + _nextSteps() { + if (this._isFinished) return Promise.resolve({ value: void 0, done: true }); + const e7 = this._reader; + return void 0 === e7 ? f6(k7("iterate")) : b6(e7.read(), ((e8) => { + var t2; + return this._ongoingPromise = void 0, e8.done && (this._isFinished = true, null === (t2 = this._reader) || void 0 === t2 || t2.releaseLock(), this._reader = void 0), e8; + }), ((e8) => { + var t2; + throw this._ongoingPromise = void 0, this._isFinished = true, null === (t2 = this._reader) || void 0 === t2 || t2.releaseLock(), this._reader = void 0, e8; + })); + } + _returnSteps(e7) { + if (this._isFinished) return Promise.resolve({ value: e7, done: true }); + this._isFinished = true; + const t2 = this._reader; + if (void 0 === t2) return f6(k7("finish iterating")); + if (this._reader = void 0, !this._preventCancel) { + const r7 = t2.cancel(e7); + return t2.releaseLock(), m3(r7, (() => ({ value: e7, done: true }))); } - })._thenUnwrap((completion) => (0, parser_1.parseChatCompletion)(completion, body2)); - } - runFunctions(body2, options) { - if (body2.stream) { - return ChatCompletionStreamingRunner_1.ChatCompletionStreamingRunner.runFunctions(this._client, body2, options); + return t2.releaseLock(), d6({ value: e7, done: true }); } - return ChatCompletionRunner_1.ChatCompletionRunner.runFunctions(this._client, body2, options); } - runTools(body2, options) { - if (body2.stream) { - return ChatCompletionStreamingRunner_1.ChatCompletionStreamingRunner.runTools(this._client, body2, options); + const oe2 = { next() { + return ne2(this) ? this._asyncIteratorImpl.next() : f6(ae2("next")); + }, return(e7) { + return ne2(this) ? this._asyncIteratorImpl.return(e7) : f6(ae2("return")); + } }; + function ne2(e7) { + if (!o2(e7)) return false; + if (!Object.prototype.hasOwnProperty.call(e7, "_asyncIteratorImpl")) return false; + try { + return e7._asyncIteratorImpl instanceof re2; + } catch (e8) { + return false; } - return ChatCompletionRunner_1.ChatCompletionRunner.runTools(this._client, body2, options); } - /** - * Creates a chat completion stream - */ - stream(body2, options) { - return ChatCompletionStream_1.ChatCompletionStream.createChatCompletion(this._client, body2, options); + function ae2(e7) { + return new TypeError(`ReadableStreamAsyncIterator.${e7} can only be used on a ReadableSteamAsyncIterator`); } - }; - exports2.Completions = Completions; - } -}); - -// node_modules/openai/resources/beta/chat/chat.js -var require_chat3 = __commonJS({ - "node_modules/openai/resources/beta/chat/chat.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + "symbol" == typeof t.asyncIterator && Object.defineProperty(oe2, t.asyncIterator, { value() { + return this; + }, writable: true, configurable: true }); + const ie2 = Number.isNaN || function(e7) { + return e7 != e7; + }; + function le2(e7, t2, r7, o3, n9) { + new Uint8Array(e7).set(new Uint8Array(r7, o3, n9), t2); } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + function se2(e7) { + const t2 = (function(e8, t3, r7) { + if (e8.slice) return e8.slice(t3, r7); + const o3 = r7 - t3, n9 = new ArrayBuffer(o3); + return le2(n9, 0, e8, t3, o3), n9; + })(e7.buffer, e7.byteOffset, e7.byteOffset + e7.byteLength); + return new Uint8Array(t2); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Chat = void 0; - var resource_1 = require_resource(); - var CompletionsAPI = __importStar(require_completions3()); - var Chat = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.completions = new CompletionsAPI.Completions(this._client); + function ue2(e7) { + const t2 = e7._queue.shift(); + return e7._queueTotalSize -= t2.size, e7._queueTotalSize < 0 && (e7._queueTotalSize = 0), t2.value; } - }; - exports2.Chat = Chat; - (function(Chat2) { - Chat2.Completions = CompletionsAPI.Completions; - })(Chat = exports2.Chat || (exports2.Chat = {})); - } -}); - -// node_modules/openai/resources/beta/realtime/sessions.js -var require_sessions = __commonJS({ - "node_modules/openai/resources/beta/realtime/sessions.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Sessions = void 0; - var resource_1 = require_resource(); - var Sessions = class extends resource_1.APIResource { - /** - * Create an ephemeral API token for use in client-side applications with the - * Realtime API. Can be configured with the same session parameters as the - * `session.update` client event. - * - * It responds with a session object, plus a `client_secret` key which contains a - * usable ephemeral API token that can be used to authenticate browser clients for - * the Realtime API. - * - * @example - * ```ts - * const session = - * await client.beta.realtime.sessions.create(); - * ``` - */ - create(body2, options) { - return this._client.post("/realtime/sessions", { - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + function ce2(e7, t2, r7) { + if ("number" != typeof (o3 = r7) || ie2(o3) || o3 < 0 || r7 === 1 / 0) throw new RangeError("Size must be a finite, non-NaN, non-negative number."); + var o3; + e7._queue.push({ value: t2, size: r7 }), e7._queueTotalSize += r7; } - }; - exports2.Sessions = Sessions; - } -}); - -// node_modules/openai/resources/beta/realtime/transcription-sessions.js -var require_transcription_sessions = __commonJS({ - "node_modules/openai/resources/beta/realtime/transcription-sessions.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.TranscriptionSessions = void 0; - var resource_1 = require_resource(); - var TranscriptionSessions = class extends resource_1.APIResource { - /** - * Create an ephemeral API token for use in client-side applications with the - * Realtime API specifically for realtime transcriptions. Can be configured with - * the same session parameters as the `transcription_session.update` client event. - * - * It responds with a session object, plus a `client_secret` key which contains a - * usable ephemeral API token that can be used to authenticate browser clients for - * the Realtime API. - * - * @example - * ```ts - * const transcriptionSession = - * await client.beta.realtime.transcriptionSessions.create(); - * ``` - */ - create(body2, options) { - return this._client.post("/realtime/transcription_sessions", { - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + function de2(e7) { + e7._queue = new v2(), e7._queueTotalSize = 0; } - }; - exports2.TranscriptionSessions = TranscriptionSessions; - } -}); - -// node_modules/openai/resources/beta/realtime/realtime.js -var require_realtime = __commonJS({ - "node_modules/openai/resources/beta/realtime/realtime.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + class ReadableStreamBYOBRequest { + constructor() { + throw new TypeError("Illegal constructor"); + } + get view() { + if (!be2(this)) throw Ae2("view"); + return this._view; + } + respond(e7) { + if (!be2(this)) throw Ae2("respond"); + if (M2(e7, 1, "respond"), e7 = x2(e7, "First parameter"), void 0 === this._associatedReadableByteStreamController) throw new TypeError("This BYOB request has been invalidated"); + this._view.buffer, (function(e8, t2) { + const r7 = e8._pendingPullIntos.peek(); + if ("closed" === e8._controlledReadableByteStream._state) { + if (0 !== t2) throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream"); + } else { + if (0 === t2) throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream"); + if (r7.bytesFilled + t2 > r7.byteLength) throw new RangeError("bytesWritten out of range"); + } + r7.buffer = r7.buffer, Ce2(e8, t2); + })(this._associatedReadableByteStreamController, e7); + } + respondWithNewView(e7) { + if (!be2(this)) throw Ae2("respondWithNewView"); + if (M2(e7, 1, "respondWithNewView"), !ArrayBuffer.isView(e7)) throw new TypeError("You can only respond with array buffer views"); + if (void 0 === this._associatedReadableByteStreamController) throw new TypeError("This BYOB request has been invalidated"); + e7.buffer, (function(e8, t2) { + const r7 = e8._pendingPullIntos.peek(); + if ("closed" === e8._controlledReadableByteStream._state) { + if (0 !== t2.byteLength) throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream"); + } else if (0 === t2.byteLength) throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream"); + if (r7.byteOffset + r7.bytesFilled !== t2.byteOffset) throw new RangeError("The region specified by view does not match byobRequest"); + if (r7.bufferByteLength !== t2.buffer.byteLength) throw new RangeError("The buffer of view has different capacity than byobRequest"); + if (r7.bytesFilled + t2.byteLength > r7.byteLength) throw new RangeError("The region specified by view is larger than byobRequest"); + const o3 = t2.byteLength; + r7.buffer = t2.buffer, Ce2(e8, o3); + })(this._associatedReadableByteStreamController, e7); + } } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + Object.defineProperties(ReadableStreamBYOBRequest.prototype, { respond: { enumerable: true }, respondWithNewView: { enumerable: true }, view: { enumerable: true } }), a6(ReadableStreamBYOBRequest.prototype.respond, "respond"), a6(ReadableStreamBYOBRequest.prototype.respondWithNewView, "respondWithNewView"), "symbol" == typeof t.toStringTag && Object.defineProperty(ReadableStreamBYOBRequest.prototype, t.toStringTag, { value: "ReadableStreamBYOBRequest", configurable: true }); + class ReadableByteStreamController { + constructor() { + throw new TypeError("Illegal constructor"); + } + get byobRequest() { + if (!fe2(this)) throw je2("byobRequest"); + return (function(e7) { + if (null === e7._byobRequest && e7._pendingPullIntos.length > 0) { + const t2 = e7._pendingPullIntos.peek(), r7 = new Uint8Array(t2.buffer, t2.byteOffset + t2.bytesFilled, t2.byteLength - t2.bytesFilled), o3 = Object.create(ReadableStreamBYOBRequest.prototype); + !(function(e8, t3, r8) { + e8._associatedReadableByteStreamController = t3, e8._view = r8; + })(o3, e7, r7), e7._byobRequest = o3; + } + return e7._byobRequest; + })(this); + } + get desiredSize() { + if (!fe2(this)) throw je2("desiredSize"); + return ke2(this); + } + close() { + if (!fe2(this)) throw je2("close"); + if (this._closeRequested) throw new TypeError("The stream has already been closed; do not close it again!"); + const e7 = this._controlledReadableByteStream._state; + if ("readable" !== e7) throw new TypeError(`The stream (in ${e7} state) is not in the readable state and cannot be closed`); + !(function(e8) { + const t2 = e8._controlledReadableByteStream; + if (e8._closeRequested || "readable" !== t2._state) return; + if (e8._queueTotalSize > 0) return void (e8._closeRequested = true); + if (e8._pendingPullIntos.length > 0) { + if (e8._pendingPullIntos.peek().bytesFilled > 0) { + const t3 = new TypeError("Insufficient bytes to fill elements in the given buffer"); + throw We2(e8, t3), t3; + } + } + Ee2(e8), Jt2(t2); + })(this); + } + enqueue(e7) { + if (!fe2(this)) throw je2("enqueue"); + if (M2(e7, 1, "enqueue"), !ArrayBuffer.isView(e7)) throw new TypeError("chunk must be an array buffer view"); + if (0 === e7.byteLength) throw new TypeError("chunk must have non-zero byteLength"); + if (0 === e7.buffer.byteLength) throw new TypeError("chunk's buffer must have non-zero byteLength"); + if (this._closeRequested) throw new TypeError("stream is closed or draining"); + const t2 = this._controlledReadableByteStream._state; + if ("readable" !== t2) throw new TypeError(`The stream (in ${t2} state) is not in the readable state and cannot be enqueued to`); + !(function(e8, t3) { + const r7 = e8._controlledReadableByteStream; + if (e8._closeRequested || "readable" !== r7._state) return; + const o3 = t3.buffer, n9 = t3.byteOffset, a7 = t3.byteLength, i7 = o3; + if (e8._pendingPullIntos.length > 0) { + const t4 = e8._pendingPullIntos.peek(); + t4.buffer, 0, Te2(e8), t4.buffer = t4.buffer, "none" === t4.readerType && Se2(e8, t4); + } + if (K2(r7)) if ((function(e9) { + const t4 = e9._controlledReadableByteStream._reader; + for (; t4._readRequests.length > 0; ) { + if (0 === e9._queueTotalSize) return; + Oe2(e9, t4._readRequests.shift()); + } + })(e8), 0 === J(r7)) ye2(e8, i7, n9, a7); + else { + e8._pendingPullIntos.length > 0 && Pe2(e8); + X2(r7, new Uint8Array(i7, n9, a7), false); + } + else Fe2(r7) ? (ye2(e8, i7, n9, a7), qe2(e8)) : ye2(e8, i7, n9, a7); + he2(e8); + })(this, e7); + } + error(e7) { + if (!fe2(this)) throw je2("error"); + We2(this, e7); + } + [q3](e7) { + _e7(this), de2(this); + const t2 = this._cancelAlgorithm(e7); + return Ee2(this), t2; + } + [C2](e7) { + const t2 = this._controlledReadableByteStream; + if (this._queueTotalSize > 0) return void Oe2(this, e7); + const r7 = this._autoAllocateChunkSize; + if (void 0 !== r7) { + let t3; + try { + t3 = new ArrayBuffer(r7); + } catch (t4) { + return void e7._errorSteps(t4); + } + const o3 = { buffer: t3, bufferByteLength: r7, byteOffset: 0, byteLength: r7, bytesFilled: 0, elementSize: 1, viewConstructor: Uint8Array, readerType: "default" }; + this._pendingPullIntos.push(o3); + } + G2(t2, e7), he2(this); + } + [P2]() { + if (this._pendingPullIntos.length > 0) { + const e7 = this._pendingPullIntos.peek(); + e7.readerType = "none", this._pendingPullIntos = new v2(), this._pendingPullIntos.push(e7); + } + } } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Realtime = void 0; - var resource_1 = require_resource(); - var SessionsAPI = __importStar(require_sessions()); - var sessions_1 = require_sessions(); - var TranscriptionSessionsAPI = __importStar(require_transcription_sessions()); - var transcription_sessions_1 = require_transcription_sessions(); - var Realtime = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.sessions = new SessionsAPI.Sessions(this._client); - this.transcriptionSessions = new TranscriptionSessionsAPI.TranscriptionSessions(this._client); + function fe2(e7) { + return !!o2(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_controlledReadableByteStream") && e7 instanceof ReadableByteStreamController); } - }; - exports2.Realtime = Realtime; - Realtime.Sessions = sessions_1.Sessions; - Realtime.TranscriptionSessions = transcription_sessions_1.TranscriptionSessions; - } -}); - -// node_modules/openai/resources/beta/threads/messages.js -var require_messages2 = __commonJS({ - "node_modules/openai/resources/beta/threads/messages.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MessagesPage = exports2.Messages = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var pagination_1 = require_pagination(); - var Messages2 = class extends resource_1.APIResource { - /** - * Create a message. - * - * @deprecated The Assistants API is deprecated in favor of the Responses API - */ - create(threadId, body2, options) { - return this._client.post(`/threads/${threadId}/messages`, { - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + function be2(e7) { + return !!o2(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_associatedReadableByteStreamController") && e7 instanceof ReadableStreamBYOBRequest); + } + function he2(e7) { + const t2 = (function(e8) { + const t3 = e8._controlledReadableByteStream; + if ("readable" !== t3._state) return false; + if (e8._closeRequested) return false; + if (!e8._started) return false; + if (K2(t3) && J(t3) > 0) return true; + if (Fe2(t3) && Le2(t3) > 0) return true; + if (ke2(e8) > 0) return true; + return false; + })(e7); + if (!t2) return; + if (e7._pulling) return void (e7._pullAgain = true); + e7._pulling = true; + h6(e7._pullAlgorithm(), (() => (e7._pulling = false, e7._pullAgain && (e7._pullAgain = false, he2(e7)), null)), ((t3) => (We2(e7, t3), null))); } - /** - * Retrieve a message. - * - * @deprecated The Assistants API is deprecated in favor of the Responses API - */ - retrieve(threadId, messageId, options) { - return this._client.get(`/threads/${threadId}/messages/${messageId}`, { - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + function _e7(e7) { + Te2(e7), e7._pendingPullIntos = new v2(); } - /** - * Modifies a message. - * - * @deprecated The Assistants API is deprecated in favor of the Responses API - */ - update(threadId, messageId, body2, options) { - return this._client.post(`/threads/${threadId}/messages/${messageId}`, { - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + function pe2(e7, t2) { + let r7 = false; + "closed" === e7._state && (r7 = true); + const o3 = me2(t2); + "default" === t2.readerType ? X2(e7, o3, r7) : (function(e8, t3, r8) { + const o4 = e8._reader._readIntoRequests.shift(); + r8 ? o4._closeSteps(t3) : o4._chunkSteps(t3); + })(e7, o3, r7); + } + function me2(e7) { + const t2 = e7.bytesFilled, r7 = e7.elementSize; + return new e7.viewConstructor(e7.buffer, e7.byteOffset, t2 / r7); + } + function ye2(e7, t2, r7, o3) { + e7._queue.push({ buffer: t2, byteOffset: r7, byteLength: o3 }), e7._queueTotalSize += o3; } - list(threadId, query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list(threadId, {}, query); + function ge2(e7, t2, r7, o3) { + let n9; + try { + n9 = t2.slice(r7, r7 + o3); + } catch (t3) { + throw We2(e7, t3), t3; } - return this._client.getAPIList(`/threads/${threadId}/messages`, MessagesPage, { - query, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + ye2(e7, n9, 0, o3); } - /** - * Deletes a message. - * - * @deprecated The Assistants API is deprecated in favor of the Responses API - */ - del(threadId, messageId, options) { - return this._client.delete(`/threads/${threadId}/messages/${messageId}`, { - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + function Se2(e7, t2) { + t2.bytesFilled > 0 && ge2(e7, t2.buffer, t2.byteOffset, t2.bytesFilled), Pe2(e7); } - }; - exports2.Messages = Messages2; - var MessagesPage = class extends pagination_1.CursorPage { - }; - exports2.MessagesPage = MessagesPage; - Messages2.MessagesPage = MessagesPage; - } -}); - -// node_modules/openai/resources/beta/threads/runs/steps.js -var require_steps = __commonJS({ - "node_modules/openai/resources/beta/threads/runs/steps.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RunStepsPage = exports2.Steps = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var pagination_1 = require_pagination(); - var Steps = class extends resource_1.APIResource { - retrieve(threadId, runId, stepId, query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.retrieve(threadId, runId, stepId, {}, query); + function we2(e7, t2) { + const r7 = t2.elementSize, o3 = t2.bytesFilled - t2.bytesFilled % r7, n9 = Math.min(e7._queueTotalSize, t2.byteLength - t2.bytesFilled), a7 = t2.bytesFilled + n9, i7 = a7 - a7 % r7; + let l4 = n9, s2 = false; + i7 > o3 && (l4 = i7 - t2.bytesFilled, s2 = true); + const u2 = e7._queue; + for (; l4 > 0; ) { + const r8 = u2.peek(), o4 = Math.min(l4, r8.byteLength), n10 = t2.byteOffset + t2.bytesFilled; + le2(t2.buffer, n10, r8.buffer, r8.byteOffset, o4), r8.byteLength === o4 ? u2.shift() : (r8.byteOffset += o4, r8.byteLength -= o4), e7._queueTotalSize -= o4, ve2(e7, o4, t2), l4 -= o4; } - return this._client.get(`/threads/${threadId}/runs/${runId}/steps/${stepId}`, { - query, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + return s2; + } + function ve2(e7, t2, r7) { + r7.bytesFilled += t2; + } + function Re2(e7) { + 0 === e7._queueTotalSize && e7._closeRequested ? (Ee2(e7), Jt2(e7._controlledReadableByteStream)) : he2(e7); + } + function Te2(e7) { + null !== e7._byobRequest && (e7._byobRequest._associatedReadableByteStreamController = void 0, e7._byobRequest._view = null, e7._byobRequest = null); } - list(threadId, runId, query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list(threadId, runId, {}, query); + function qe2(e7) { + for (; e7._pendingPullIntos.length > 0; ) { + if (0 === e7._queueTotalSize) return; + const t2 = e7._pendingPullIntos.peek(); + we2(e7, t2) && (Pe2(e7), pe2(e7._controlledReadableByteStream, t2)); } - return this._client.getAPIList(`/threads/${threadId}/runs/${runId}/steps`, RunStepsPage, { - query, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); } - }; - exports2.Steps = Steps; - var RunStepsPage = class extends pagination_1.CursorPage { - }; - exports2.RunStepsPage = RunStepsPage; - Steps.RunStepsPage = RunStepsPage; - } -}); - -// node_modules/openai/resources/beta/threads/runs/runs.js -var require_runs = __commonJS({ - "node_modules/openai/resources/beta/threads/runs/runs.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + function Ce2(e7, t2) { + const r7 = e7._pendingPullIntos.peek(); + Te2(e7); + "closed" === e7._controlledReadableByteStream._state ? (function(e8, t3) { + "none" === t3.readerType && Pe2(e8); + const r8 = e8._controlledReadableByteStream; + if (Fe2(r8)) for (; Le2(r8) > 0; ) pe2(r8, Pe2(e8)); + })(e7, r7) : (function(e8, t3, r8) { + if (ve2(0, t3, r8), "none" === r8.readerType) return Se2(e8, r8), void qe2(e8); + if (r8.bytesFilled < r8.elementSize) return; + Pe2(e8); + const o3 = r8.bytesFilled % r8.elementSize; + if (o3 > 0) { + const t4 = r8.byteOffset + r8.bytesFilled; + ge2(e8, r8.buffer, t4 - o3, o3); + } + r8.bytesFilled -= o3, pe2(e8._controlledReadableByteStream, r8), qe2(e8); + })(e7, t2, r7), he2(e7); } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + function Pe2(e7) { + return e7._pendingPullIntos.shift(); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RunsPage = exports2.Runs = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var AssistantStream_1 = require_AssistantStream(); - var core_2 = require_core2(); - var StepsAPI = __importStar(require_steps()); - var steps_1 = require_steps(); - var pagination_1 = require_pagination(); - var Runs = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.steps = new StepsAPI.Steps(this._client); + function Ee2(e7) { + e7._pullAlgorithm = void 0, e7._cancelAlgorithm = void 0; } - create(threadId, params, options) { - const { include: include2, ...body2 } = params; - return this._client.post(`/threads/${threadId}/runs`, { - query: { include: include2 }, - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers }, - stream: params.stream ?? false - }); + function We2(e7, t2) { + const r7 = e7._controlledReadableByteStream; + "readable" === r7._state && (_e7(e7), de2(e7), Ee2(e7), Kt2(r7, t2)); } - /** - * Retrieves a run. - * - * @deprecated The Assistants API is deprecated in favor of the Responses API - */ - retrieve(threadId, runId, options) { - return this._client.get(`/threads/${threadId}/runs/${runId}`, { - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + function Oe2(e7, t2) { + const r7 = e7._queue.shift(); + e7._queueTotalSize -= r7.byteLength, Re2(e7); + const o3 = new Uint8Array(r7.buffer, r7.byteOffset, r7.byteLength); + t2._chunkSteps(o3); } - /** - * Modifies a run. - * - * @deprecated The Assistants API is deprecated in favor of the Responses API - */ - update(threadId, runId, body2, options) { - return this._client.post(`/threads/${threadId}/runs/${runId}`, { - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + function ke2(e7) { + const t2 = e7._controlledReadableByteStream._state; + return "errored" === t2 ? null : "closed" === t2 ? 0 : e7._strategyHWM - e7._queueTotalSize; + } + function Be2(e7, t2, r7) { + const o3 = Object.create(ReadableByteStreamController.prototype); + let n9, a7, i7; + n9 = void 0 !== t2.start ? () => t2.start(o3) : () => { + }, a7 = void 0 !== t2.pull ? () => t2.pull(o3) : () => d6(void 0), i7 = void 0 !== t2.cancel ? (e8) => t2.cancel(e8) : () => d6(void 0); + const l4 = t2.autoAllocateChunkSize; + if (0 === l4) throw new TypeError("autoAllocateChunkSize must be greater than 0"); + !(function(e8, t3, r8, o4, n10, a8, i8) { + t3._controlledReadableByteStream = e8, t3._pullAgain = false, t3._pulling = false, t3._byobRequest = null, t3._queue = t3._queueTotalSize = void 0, de2(t3), t3._closeRequested = false, t3._started = false, t3._strategyHWM = a8, t3._pullAlgorithm = o4, t3._cancelAlgorithm = n10, t3._autoAllocateChunkSize = i8, t3._pendingPullIntos = new v2(), e8._readableStreamController = t3, h6(d6(r8()), (() => (t3._started = true, he2(t3), null)), ((e9) => (We2(t3, e9), null))); + })(e7, o3, n9, a7, i7, r7, l4); } - list(threadId, query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list(threadId, {}, query); - } - return this._client.getAPIList(`/threads/${threadId}/runs`, RunsPage, { - query, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + function Ae2(e7) { + return new TypeError(`ReadableStreamBYOBRequest.prototype.${e7} can only be used on a ReadableStreamBYOBRequest`); } - /** - * Cancels a run that is `in_progress`. - * - * @deprecated The Assistants API is deprecated in favor of the Responses API - */ - cancel(threadId, runId, options) { - return this._client.post(`/threads/${threadId}/runs/${runId}/cancel`, { - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + function je2(e7) { + return new TypeError(`ReadableByteStreamController.prototype.${e7} can only be used on a ReadableByteStreamController`); } - /** - * A helper to create a run an poll for a terminal state. More information on Run - * lifecycles can be found here: - * https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps - */ - async createAndPoll(threadId, body2, options) { - const run2 = await this.create(threadId, body2, options); - return await this.poll(threadId, run2.id, options); + function ze2(e7, t2) { + e7._reader._readIntoRequests.push(t2); } - /** - * Create a Run stream - * - * @deprecated use `stream` instead - */ - createAndStream(threadId, body2, options) { - return AssistantStream_1.AssistantStream.createAssistantStream(threadId, this._client.beta.threads.runs, body2, options); + function Le2(e7) { + return e7._reader._readIntoRequests.length; } - /** - * A helper to poll a run status until it reaches a terminal state. More - * information on Run lifecycles can be found here: - * https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps - */ - async poll(threadId, runId, options) { - const headers = { ...options?.headers, "X-Stainless-Poll-Helper": "true" }; - if (options?.pollIntervalMs) { - headers["X-Stainless-Custom-Poll-Interval"] = options.pollIntervalMs.toString(); + function Fe2(e7) { + const t2 = e7._reader; + return void 0 !== t2 && !!De2(t2); + } + Object.defineProperties(ReadableByteStreamController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, byobRequest: { enumerable: true }, desiredSize: { enumerable: true } }), a6(ReadableByteStreamController.prototype.close, "close"), a6(ReadableByteStreamController.prototype.enqueue, "enqueue"), a6(ReadableByteStreamController.prototype.error, "error"), "symbol" == typeof t.toStringTag && Object.defineProperty(ReadableByteStreamController.prototype, t.toStringTag, { value: "ReadableByteStreamController", configurable: true }); + class ReadableStreamBYOBReader { + constructor(e7) { + if (M2(e7, 1, "ReadableStreamBYOBReader"), U2(e7, "First parameter"), Gt2(e7)) throw new TypeError("This stream has already been locked for exclusive reading by another reader"); + if (!fe2(e7._readableStreamController)) throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source"); + E(this, e7), this._readIntoRequests = new v2(); } - while (true) { - const { data: run2, response } = await this.retrieve(threadId, runId, { - ...options, - headers: { ...options?.headers, ...headers } - }).withResponse(); - switch (run2.status) { - //If we are in any sort of intermediate state we poll - case "queued": - case "in_progress": - case "cancelling": - let sleepInterval = 5e3; - if (options?.pollIntervalMs) { - sleepInterval = options.pollIntervalMs; - } else { - const headerInterval = response.headers.get("openai-poll-after-ms"); - if (headerInterval) { - const headerIntervalMs = parseInt(headerInterval); - if (!isNaN(headerIntervalMs)) { - sleepInterval = headerIntervalMs; + get closed() { + return De2(this) ? this._closedPromise : f6($e2("closed")); + } + cancel(e7) { + return De2(this) ? void 0 === this._ownerReadableStream ? f6(k7("cancel")) : W2(this, e7) : f6($e2("cancel")); + } + read(e7) { + if (!De2(this)) return f6($e2("read")); + if (!ArrayBuffer.isView(e7)) return f6(new TypeError("view must be an array buffer view")); + if (0 === e7.byteLength) return f6(new TypeError("view must have non-zero byteLength")); + if (0 === e7.buffer.byteLength) return f6(new TypeError("view's buffer must have non-zero byteLength")); + if (e7.buffer, void 0 === this._ownerReadableStream) return f6(k7("read from")); + let t2, r7; + const o3 = c6(((e8, o4) => { + t2 = e8, r7 = o4; + })); + return (function(e8, t3, r8) { + const o4 = e8._ownerReadableStream; + o4._disturbed = true, "errored" === o4._state ? r8._errorSteps(o4._storedError) : (function(e9, t4, r9) { + const o5 = e9._controlledReadableByteStream; + let n9 = 1; + t4.constructor !== DataView && (n9 = t4.constructor.BYTES_PER_ELEMENT); + const a7 = t4.constructor, i7 = t4.buffer, l4 = { buffer: i7, bufferByteLength: i7.byteLength, byteOffset: t4.byteOffset, byteLength: t4.byteLength, bytesFilled: 0, elementSize: n9, viewConstructor: a7, readerType: "byob" }; + if (e9._pendingPullIntos.length > 0) return e9._pendingPullIntos.push(l4), void ze2(o5, r9); + if ("closed" !== o5._state) { + if (e9._queueTotalSize > 0) { + if (we2(e9, l4)) { + const t5 = me2(l4); + return Re2(e9), void r9._chunkSteps(t5); + } + if (e9._closeRequested) { + const t5 = new TypeError("Insufficient bytes to fill elements in the given buffer"); + return We2(e9, t5), void r9._errorSteps(t5); } } + e9._pendingPullIntos.push(l4), ze2(o5, r9), he2(e9); + } else { + const e10 = new a7(l4.buffer, l4.byteOffset, 0); + r9._closeSteps(e10); } - await (0, core_2.sleep)(sleepInterval); - break; - //We return the run in any terminal state. - case "requires_action": - case "incomplete": - case "cancelled": - case "completed": - case "failed": - case "expired": - return run2; - } + })(o4._readableStreamController, t3, r8); + })(this, e7, { _chunkSteps: (e8) => t2({ value: e8, done: false }), _closeSteps: (e8) => t2({ value: e8, done: true }), _errorSteps: (e8) => r7(e8) }), o3; + } + releaseLock() { + if (!De2(this)) throw $e2("releaseLock"); + void 0 !== this._ownerReadableStream && (function(e7) { + O2(e7); + const t2 = new TypeError("Reader was released"); + Ie2(e7, t2); + })(this); } } - /** - * Create a Run stream - */ - stream(threadId, body2, options) { - return AssistantStream_1.AssistantStream.createAssistantStream(threadId, this._client.beta.threads.runs, body2, options); - } - submitToolOutputs(threadId, runId, body2, options) { - return this._client.post(`/threads/${threadId}/runs/${runId}/submit_tool_outputs`, { - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers }, - stream: body2.stream ?? false - }); + function De2(e7) { + return !!o2(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_readIntoRequests") && e7 instanceof ReadableStreamBYOBReader); } - /** - * A helper to submit a tool output to a run and poll for a terminal run state. - * More information on Run lifecycles can be found here: - * https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps - */ - async submitToolOutputsAndPoll(threadId, runId, body2, options) { - const run2 = await this.submitToolOutputs(threadId, runId, body2, options); - return await this.poll(threadId, run2.id, options); + function Ie2(e7, t2) { + const r7 = e7._readIntoRequests; + e7._readIntoRequests = new v2(), r7.forEach(((e8) => { + e8._errorSteps(t2); + })); } - /** - * Submit the tool outputs from a previous run and stream the run to a terminal - * state. More information on Run lifecycles can be found here: - * https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps - */ - submitToolOutputsStream(threadId, runId, body2, options) { - return AssistantStream_1.AssistantStream.createToolAssistantStream(threadId, runId, this._client.beta.threads.runs, body2, options); + function $e2(e7) { + return new TypeError(`ReadableStreamBYOBReader.prototype.${e7} can only be used on a ReadableStreamBYOBReader`); } - }; - exports2.Runs = Runs; - var RunsPage = class extends pagination_1.CursorPage { - }; - exports2.RunsPage = RunsPage; - Runs.RunsPage = RunsPage; - Runs.Steps = steps_1.Steps; - Runs.RunStepsPage = steps_1.RunStepsPage; - } -}); - -// node_modules/openai/resources/beta/threads/threads.js -var require_threads = __commonJS({ - "node_modules/openai/resources/beta/threads/threads.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + function Me2(e7, t2) { + const { highWaterMark: r7 } = e7; + if (void 0 === r7) return t2; + if (ie2(r7) || r7 < 0) throw new RangeError("Invalid highWaterMark"); + return r7; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + function Ye2(e7) { + const { size: t2 } = e7; + return t2 || (() => 1); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Threads = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var AssistantStream_1 = require_AssistantStream(); - var MessagesAPI = __importStar(require_messages2()); - var messages_1 = require_messages2(); - var RunsAPI = __importStar(require_runs()); - var runs_1 = require_runs(); - var Threads = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.runs = new RunsAPI.Runs(this._client); - this.messages = new MessagesAPI.Messages(this._client); + function Qe2(e7, t2) { + D2(e7, t2); + const r7 = null == e7 ? void 0 : e7.highWaterMark, o3 = null == e7 ? void 0 : e7.size; + return { highWaterMark: void 0 === r7 ? void 0 : Q2(r7), size: void 0 === o3 ? void 0 : Ne2(o3, `${t2} has member 'size' that`) }; } - create(body2 = {}, options) { - if ((0, core_1.isRequestOptions)(body2)) { - return this.create({}, body2); - } - return this._client.post("/threads", { - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + function Ne2(e7, t2) { + return I2(e7, t2), (t3) => Q2(e7(t3)); } - /** - * Retrieves a thread. - * - * @deprecated The Assistants API is deprecated in favor of the Responses API - */ - retrieve(threadId, options) { - return this._client.get(`/threads/${threadId}`, { - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + function xe2(e7, t2, r7) { + return I2(e7, r7), (r8) => w(e7, t2, [r8]); } - /** - * Modifies a thread. - * - * @deprecated The Assistants API is deprecated in favor of the Responses API - */ - update(threadId, body2, options) { - return this._client.post(`/threads/${threadId}`, { - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + function He2(e7, t2, r7) { + return I2(e7, r7), () => w(e7, t2, []); } - /** - * Delete a thread. - * - * @deprecated The Assistants API is deprecated in favor of the Responses API - */ - del(threadId, options) { - return this._client.delete(`/threads/${threadId}`, { - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); + function Ve2(e7, t2, r7) { + return I2(e7, r7), (r8) => S(e7, t2, [r8]); } - createAndRun(body2, options) { - return this._client.post("/threads/runs", { - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers }, - stream: body2.stream ?? false - }); + function Ue2(e7, t2, r7) { + return I2(e7, r7), (r8, o3) => w(e7, t2, [r8, o3]); } - /** - * A helper to create a thread, start a run and then poll for a terminal state. - * More information on Run lifecycles can be found here: - * https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps - */ - async createAndRunPoll(body2, options) { - const run2 = await this.createAndRun(body2, options); - return await this.runs.poll(run2.thread_id, run2.id, options); + Object.defineProperties(ReadableStreamBYOBReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), a6(ReadableStreamBYOBReader.prototype.cancel, "cancel"), a6(ReadableStreamBYOBReader.prototype.read, "read"), a6(ReadableStreamBYOBReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof t.toStringTag && Object.defineProperty(ReadableStreamBYOBReader.prototype, t.toStringTag, { value: "ReadableStreamBYOBReader", configurable: true }); + const Ge2 = "function" == typeof AbortController; + class WritableStream { + constructor(e7 = {}, t2 = {}) { + void 0 === e7 ? e7 = null : $(e7, "First parameter"); + const r7 = Qe2(t2, "Second parameter"), o3 = (function(e8, t3) { + D2(e8, t3); + const r8 = null == e8 ? void 0 : e8.abort, o4 = null == e8 ? void 0 : e8.close, n10 = null == e8 ? void 0 : e8.start, a8 = null == e8 ? void 0 : e8.type, i7 = null == e8 ? void 0 : e8.write; + return { abort: void 0 === r8 ? void 0 : xe2(r8, e8, `${t3} has member 'abort' that`), close: void 0 === o4 ? void 0 : He2(o4, e8, `${t3} has member 'close' that`), start: void 0 === n10 ? void 0 : Ve2(n10, e8, `${t3} has member 'start' that`), write: void 0 === i7 ? void 0 : Ue2(i7, e8, `${t3} has member 'write' that`), type: a8 }; + })(e7, "First parameter"); + var n9; + (n9 = this)._state = "writable", n9._storedError = void 0, n9._writer = void 0, n9._writableStreamController = void 0, n9._writeRequests = new v2(), n9._inFlightWriteRequest = void 0, n9._closeRequest = void 0, n9._inFlightCloseRequest = void 0, n9._pendingAbortRequest = void 0, n9._backpressure = false; + if (void 0 !== o3.type) throw new RangeError("Invalid type is specified"); + const a7 = Ye2(r7); + !(function(e8, t3, r8, o4) { + const n10 = Object.create(WritableStreamDefaultController.prototype); + let a8, i7, l4, s2; + a8 = void 0 !== t3.start ? () => t3.start(n10) : () => { + }; + i7 = void 0 !== t3.write ? (e9) => t3.write(e9, n10) : () => d6(void 0); + l4 = void 0 !== t3.close ? () => t3.close() : () => d6(void 0); + s2 = void 0 !== t3.abort ? (e9) => t3.abort(e9) : () => d6(void 0); + !(function(e9, t4, r9, o5, n11, a9, i8, l5) { + t4._controlledWritableStream = e9, e9._writableStreamController = t4, t4._queue = void 0, t4._queueTotalSize = void 0, de2(t4), t4._abortReason = void 0, t4._abortController = (function() { + if (Ge2) return new AbortController(); + })(), t4._started = false, t4._strategySizeAlgorithm = l5, t4._strategyHWM = i8, t4._writeAlgorithm = o5, t4._closeAlgorithm = n11, t4._abortAlgorithm = a9; + const s3 = ht2(t4); + at2(e9, s3); + const u2 = r9(); + h6(d6(u2), (() => (t4._started = true, ft2(t4), null)), ((r10) => (t4._started = true, et2(e9, r10), null))); + })(e8, n10, a8, i7, l4, s2, r8, o4); + })(this, o3, Me2(r7, 1), a7); + } + get locked() { + if (!Xe2(this)) throw pt2("locked"); + return Je2(this); + } + abort(e7) { + return Xe2(this) ? Je2(this) ? f6(new TypeError("Cannot abort a stream that already has a writer")) : Ke2(this, e7) : f6(pt2("abort")); + } + close() { + return Xe2(this) ? Je2(this) ? f6(new TypeError("Cannot close a stream that already has a writer")) : ot2(this) ? f6(new TypeError("Cannot close an already-closing stream")) : Ze2(this) : f6(pt2("close")); + } + getWriter() { + if (!Xe2(this)) throw pt2("getWriter"); + return new WritableStreamDefaultWriter(this); + } } - /** - * Create a thread and stream the run back - */ - createAndRunStream(body2, options) { - return AssistantStream_1.AssistantStream.createThreadAssistantStream(body2, this._client.beta.threads, options); + function Xe2(e7) { + return !!o2(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_writableStreamController") && e7 instanceof WritableStream); } - }; - exports2.Threads = Threads; - Threads.Runs = runs_1.Runs; - Threads.RunsPage = runs_1.RunsPage; - Threads.Messages = messages_1.Messages; - Threads.MessagesPage = messages_1.MessagesPage; - } -}); - -// node_modules/openai/resources/beta/beta.js -var require_beta = __commonJS({ - "node_modules/openai/resources/beta/beta.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + function Je2(e7) { + return void 0 !== e7._writer; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + function Ke2(e7, t2) { + var r7; + if ("closed" === e7._state || "errored" === e7._state) return d6(void 0); + e7._writableStreamController._abortReason = t2, null === (r7 = e7._writableStreamController._abortController) || void 0 === r7 || r7.abort(t2); + const o3 = e7._state; + if ("closed" === o3 || "errored" === o3) return d6(void 0); + if (void 0 !== e7._pendingAbortRequest) return e7._pendingAbortRequest._promise; + let n9 = false; + "erroring" === o3 && (n9 = true, t2 = void 0); + const a7 = c6(((r8, o4) => { + e7._pendingAbortRequest = { _promise: void 0, _resolve: r8, _reject: o4, _reason: t2, _wasAlreadyErroring: n9 }; + })); + return e7._pendingAbortRequest._promise = a7, n9 || tt2(e7, t2), a7; } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Beta = void 0; - var resource_1 = require_resource(); - var AssistantsAPI = __importStar(require_assistants()); - var ChatAPI = __importStar(require_chat3()); - var assistants_1 = require_assistants(); - var RealtimeAPI = __importStar(require_realtime()); - var realtime_1 = require_realtime(); - var ThreadsAPI = __importStar(require_threads()); - var threads_1 = require_threads(); - var chat_1 = require_chat3(); - var Beta = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.realtime = new RealtimeAPI.Realtime(this._client); - this.chat = new ChatAPI.Chat(this._client); - this.assistants = new AssistantsAPI.Assistants(this._client); - this.threads = new ThreadsAPI.Threads(this._client); + function Ze2(e7) { + const t2 = e7._state; + if ("closed" === t2 || "errored" === t2) return f6(new TypeError(`The stream (in ${t2} state) is not in the writable state and cannot be closed`)); + const r7 = c6(((t3, r8) => { + const o4 = { _resolve: t3, _reject: r8 }; + e7._closeRequest = o4; + })), o3 = e7._writer; + var n9; + return void 0 !== o3 && e7._backpressure && "writable" === t2 && Et2(o3), ce2(n9 = e7._writableStreamController, st2, 0), ft2(n9), r7; + } + function et2(e7, t2) { + "writable" !== e7._state ? rt2(e7) : tt2(e7, t2); + } + function tt2(e7, t2) { + const r7 = e7._writableStreamController; + e7._state = "erroring", e7._storedError = t2; + const o3 = e7._writer; + void 0 !== o3 && lt2(o3, t2), !(function(e8) { + if (void 0 === e8._inFlightWriteRequest && void 0 === e8._inFlightCloseRequest) return false; + return true; + })(e7) && r7._started && rt2(e7); } - }; - exports2.Beta = Beta; - Beta.Realtime = realtime_1.Realtime; - Beta.Assistants = assistants_1.Assistants; - Beta.AssistantsPage = assistants_1.AssistantsPage; - Beta.Threads = threads_1.Threads; - } -}); - -// node_modules/openai/resources/completions.js -var require_completions4 = __commonJS({ - "node_modules/openai/resources/completions.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Completions = void 0; - var resource_1 = require_resource(); - var Completions = class extends resource_1.APIResource { - create(body2, options) { - return this._client.post("/completions", { body: body2, ...options, stream: body2.stream ?? false }); + function rt2(e7) { + e7._state = "errored", e7._writableStreamController[T2](); + const t2 = e7._storedError; + if (e7._writeRequests.forEach(((e8) => { + e8._reject(t2); + })), e7._writeRequests = new v2(), void 0 === e7._pendingAbortRequest) return void nt2(e7); + const r7 = e7._pendingAbortRequest; + if (e7._pendingAbortRequest = void 0, r7._wasAlreadyErroring) return r7._reject(t2), void nt2(e7); + h6(e7._writableStreamController[R2](r7._reason), (() => (r7._resolve(), nt2(e7), null)), ((t3) => (r7._reject(t3), nt2(e7), null))); } - }; - exports2.Completions = Completions; - } -}); - -// node_modules/openai/resources/containers/files/content.js -var require_content = __commonJS({ - "node_modules/openai/resources/containers/files/content.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Content = void 0; - var resource_1 = require_resource(); - var Content = class extends resource_1.APIResource { - /** - * Retrieve Container File Content - */ - retrieve(containerId, fileId, options) { - return this._client.get(`/containers/${containerId}/files/${fileId}/content`, { - ...options, - headers: { Accept: "application/binary", ...options?.headers }, - __binaryResponse: true - }); + function ot2(e7) { + return void 0 !== e7._closeRequest || void 0 !== e7._inFlightCloseRequest; } - }; - exports2.Content = Content; - } -}); - -// node_modules/openai/resources/containers/files/files.js -var require_files = __commonJS({ - "node_modules/openai/resources/containers/files/files.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + function nt2(e7) { + void 0 !== e7._closeRequest && (e7._closeRequest._reject(e7._storedError), e7._closeRequest = void 0); + const t2 = e7._writer; + void 0 !== t2 && vt2(t2, e7._storedError); } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + function at2(e7, t2) { + const r7 = e7._writer; + void 0 !== r7 && t2 !== e7._backpressure && (t2 ? (function(e8) { + Tt2(e8); + })(r7) : Et2(r7)), e7._backpressure = t2; } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.FileListResponsesPage = exports2.Files = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var Core = __importStar(require_core2()); - var ContentAPI = __importStar(require_content()); - var content_1 = require_content(); - var pagination_1 = require_pagination(); - var Files = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.content = new ContentAPI.Content(this._client); + Object.defineProperties(WritableStream.prototype, { abort: { enumerable: true }, close: { enumerable: true }, getWriter: { enumerable: true }, locked: { enumerable: true } }), a6(WritableStream.prototype.abort, "abort"), a6(WritableStream.prototype.close, "close"), a6(WritableStream.prototype.getWriter, "getWriter"), "symbol" == typeof t.toStringTag && Object.defineProperty(WritableStream.prototype, t.toStringTag, { value: "WritableStream", configurable: true }); + class WritableStreamDefaultWriter { + constructor(e7) { + if (M2(e7, 1, "WritableStreamDefaultWriter"), (function(e8, t3) { + if (!Xe2(e8)) throw new TypeError(`${t3} is not a WritableStream.`); + })(e7, "First parameter"), Je2(e7)) throw new TypeError("This stream has already been locked for exclusive writing by another writer"); + this._ownerWritableStream = e7, e7._writer = this; + const t2 = e7._state; + if ("writable" === t2) !ot2(e7) && e7._backpressure ? Tt2(this) : Ct2(this), St2(this); + else if ("erroring" === t2) qt2(this, e7._storedError), St2(this); + else if ("closed" === t2) Ct2(this), St2(r7 = this), Rt2(r7); + else { + const t3 = e7._storedError; + qt2(this, t3), wt2(this, t3); + } + var r7; + } + get closed() { + return it2(this) ? this._closedPromise : f6(yt2("closed")); + } + get desiredSize() { + if (!it2(this)) throw yt2("desiredSize"); + if (void 0 === this._ownerWritableStream) throw gt2("desiredSize"); + return (function(e7) { + const t2 = e7._ownerWritableStream, r7 = t2._state; + if ("errored" === r7 || "erroring" === r7) return null; + if ("closed" === r7) return 0; + return dt2(t2._writableStreamController); + })(this); + } + get ready() { + return it2(this) ? this._readyPromise : f6(yt2("ready")); + } + abort(e7) { + return it2(this) ? void 0 === this._ownerWritableStream ? f6(gt2("abort")) : (function(e8, t2) { + return Ke2(e8._ownerWritableStream, t2); + })(this, e7) : f6(yt2("abort")); + } + close() { + if (!it2(this)) return f6(yt2("close")); + const e7 = this._ownerWritableStream; + return void 0 === e7 ? f6(gt2("close")) : ot2(e7) ? f6(new TypeError("Cannot close an already-closing stream")) : Ze2(this._ownerWritableStream); + } + releaseLock() { + if (!it2(this)) throw yt2("releaseLock"); + void 0 !== this._ownerWritableStream && (function(e7) { + const t2 = e7._ownerWritableStream, r7 = new TypeError("Writer was released and can no longer be used to monitor the stream's closedness"); + lt2(e7, r7), (function(e8, t3) { + "pending" === e8._closedPromiseState ? vt2(e8, t3) : (function(e9, t4) { + wt2(e9, t4); + })(e8, t3); + })(e7, r7), t2._writer = void 0, e7._ownerWritableStream = void 0; + })(this); + } + write(e7) { + return it2(this) ? void 0 === this._ownerWritableStream ? f6(gt2("write to")) : (function(e8, t2) { + const r7 = e8._ownerWritableStream, o3 = r7._writableStreamController, n9 = (function(e9, t3) { + try { + return e9._strategySizeAlgorithm(t3); + } catch (t4) { + return bt2(e9, t4), 1; + } + })(o3, t2); + if (r7 !== e8._ownerWritableStream) return f6(gt2("write to")); + const a7 = r7._state; + if ("errored" === a7) return f6(r7._storedError); + if (ot2(r7) || "closed" === a7) return f6(new TypeError("The stream is closing or closed and cannot be written to")); + if ("erroring" === a7) return f6(r7._storedError); + const i7 = (function(e9) { + return c6(((t3, r8) => { + const o4 = { _resolve: t3, _reject: r8 }; + e9._writeRequests.push(o4); + })); + })(r7); + return (function(e9, t3, r8) { + try { + ce2(e9, t3, r8); + } catch (t4) { + return void bt2(e9, t4); + } + const o4 = e9._controlledWritableStream; + if (!ot2(o4) && "writable" === o4._state) { + at2(o4, ht2(e9)); + } + ft2(e9); + })(o3, t2, n9), i7; + })(this, e7) : f6(yt2("write")); + } } - /** - * Create a Container File - * - * You can send either a multipart/form-data request with the raw file content, or - * a JSON request with a file ID. - */ - create(containerId, body2, options) { - return this._client.post(`/containers/${containerId}/files`, Core.multipartFormRequestOptions({ body: body2, ...options })); + function it2(e7) { + return !!o2(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_ownerWritableStream") && e7 instanceof WritableStreamDefaultWriter); } - /** - * Retrieve Container File - */ - retrieve(containerId, fileId, options) { - return this._client.get(`/containers/${containerId}/files/${fileId}`, options); + function lt2(e7, t2) { + "pending" === e7._readyPromiseState ? Pt2(e7, t2) : (function(e8, t3) { + qt2(e8, t3); + })(e7, t2); } - list(containerId, query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list(containerId, {}, query); + Object.defineProperties(WritableStreamDefaultWriter.prototype, { abort: { enumerable: true }, close: { enumerable: true }, releaseLock: { enumerable: true }, write: { enumerable: true }, closed: { enumerable: true }, desiredSize: { enumerable: true }, ready: { enumerable: true } }), a6(WritableStreamDefaultWriter.prototype.abort, "abort"), a6(WritableStreamDefaultWriter.prototype.close, "close"), a6(WritableStreamDefaultWriter.prototype.releaseLock, "releaseLock"), a6(WritableStreamDefaultWriter.prototype.write, "write"), "symbol" == typeof t.toStringTag && Object.defineProperty(WritableStreamDefaultWriter.prototype, t.toStringTag, { value: "WritableStreamDefaultWriter", configurable: true }); + const st2 = {}; + class WritableStreamDefaultController { + constructor() { + throw new TypeError("Illegal constructor"); + } + get abortReason() { + if (!ut2(this)) throw mt2("abortReason"); + return this._abortReason; + } + get signal() { + if (!ut2(this)) throw mt2("signal"); + if (void 0 === this._abortController) throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported"); + return this._abortController.signal; + } + error(e7) { + if (!ut2(this)) throw mt2("error"); + "writable" === this._controlledWritableStream._state && _t3(this, e7); + } + [R2](e7) { + const t2 = this._abortAlgorithm(e7); + return ct2(this), t2; + } + [T2]() { + de2(this); } - return this._client.getAPIList(`/containers/${containerId}/files`, FileListResponsesPage, { - query, - ...options - }); - } - /** - * Delete Container File - */ - del(containerId, fileId, options) { - return this._client.delete(`/containers/${containerId}/files/${fileId}`, { - ...options, - headers: { Accept: "*/*", ...options?.headers } - }); } - }; - exports2.Files = Files; - var FileListResponsesPage = class extends pagination_1.CursorPage { - }; - exports2.FileListResponsesPage = FileListResponsesPage; - Files.FileListResponsesPage = FileListResponsesPage; - Files.Content = content_1.Content; - } -}); - -// node_modules/openai/resources/containers/containers.js -var require_containers = __commonJS({ - "node_modules/openai/resources/containers/containers.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + function ut2(e7) { + return !!o2(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_controlledWritableStream") && e7 instanceof WritableStreamDefaultController); } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + function ct2(e7) { + e7._writeAlgorithm = void 0, e7._closeAlgorithm = void 0, e7._abortAlgorithm = void 0, e7._strategySizeAlgorithm = void 0; } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ContainerListResponsesPage = exports2.Containers = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var FilesAPI = __importStar(require_files()); - var files_1 = require_files(); - var pagination_1 = require_pagination(); - var Containers = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.files = new FilesAPI.Files(this._client); + function dt2(e7) { + return e7._strategyHWM - e7._queueTotalSize; } - /** - * Create Container - */ - create(body2, options) { - return this._client.post("/containers", { body: body2, ...options }); + function ft2(e7) { + const t2 = e7._controlledWritableStream; + if (!e7._started) return; + if (void 0 !== t2._inFlightWriteRequest) return; + if ("erroring" === t2._state) return void rt2(t2); + if (0 === e7._queue.length) return; + const r7 = e7._queue.peek().value; + r7 === st2 ? (function(e8) { + const t3 = e8._controlledWritableStream; + (function(e9) { + e9._inFlightCloseRequest = e9._closeRequest, e9._closeRequest = void 0; + })(t3), ue2(e8); + const r8 = e8._closeAlgorithm(); + ct2(e8), h6(r8, (() => ((function(e9) { + e9._inFlightCloseRequest._resolve(void 0), e9._inFlightCloseRequest = void 0, "erroring" === e9._state && (e9._storedError = void 0, void 0 !== e9._pendingAbortRequest && (e9._pendingAbortRequest._resolve(), e9._pendingAbortRequest = void 0)), e9._state = "closed"; + const t4 = e9._writer; + void 0 !== t4 && Rt2(t4); + })(t3), null)), ((e9) => ((function(e10, t4) { + e10._inFlightCloseRequest._reject(t4), e10._inFlightCloseRequest = void 0, void 0 !== e10._pendingAbortRequest && (e10._pendingAbortRequest._reject(t4), e10._pendingAbortRequest = void 0), et2(e10, t4); + })(t3, e9), null))); + })(e7) : (function(e8, t3) { + const r8 = e8._controlledWritableStream; + !(function(e9) { + e9._inFlightWriteRequest = e9._writeRequests.shift(); + })(r8); + h6(e8._writeAlgorithm(t3), (() => { + !(function(e9) { + e9._inFlightWriteRequest._resolve(void 0), e9._inFlightWriteRequest = void 0; + })(r8); + const t4 = r8._state; + if (ue2(e8), !ot2(r8) && "writable" === t4) { + const t5 = ht2(e8); + at2(r8, t5); + } + return ft2(e8), null; + }), ((t4) => ("writable" === r8._state && ct2(e8), (function(e9, t5) { + e9._inFlightWriteRequest._reject(t5), e9._inFlightWriteRequest = void 0, et2(e9, t5); + })(r8, t4), null))); + })(e7, r7); } - /** - * Retrieve Container - */ - retrieve(containerId, options) { - return this._client.get(`/containers/${containerId}`, options); + function bt2(e7, t2) { + "writable" === e7._controlledWritableStream._state && _t3(e7, t2); } - list(query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list({}, query); - } - return this._client.getAPIList("/containers", ContainerListResponsesPage, { query, ...options }); + function ht2(e7) { + return dt2(e7) <= 0; } - /** - * Delete Container - */ - del(containerId, options) { - return this._client.delete(`/containers/${containerId}`, { - ...options, - headers: { Accept: "*/*", ...options?.headers } - }); + function _t3(e7, t2) { + const r7 = e7._controlledWritableStream; + ct2(e7), tt2(r7, t2); } - }; - exports2.Containers = Containers; - var ContainerListResponsesPage = class extends pagination_1.CursorPage { - }; - exports2.ContainerListResponsesPage = ContainerListResponsesPage; - Containers.ContainerListResponsesPage = ContainerListResponsesPage; - Containers.Files = files_1.Files; - Containers.FileListResponsesPage = files_1.FileListResponsesPage; - } -}); - -// node_modules/openai/resources/embeddings.js -var require_embeddings = __commonJS({ - "node_modules/openai/resources/embeddings.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + function pt2(e7) { + return new TypeError(`WritableStream.prototype.${e7} can only be used on a WritableStream`); } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + function mt2(e7) { + return new TypeError(`WritableStreamDefaultController.prototype.${e7} can only be used on a WritableStreamDefaultController`); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Embeddings = void 0; - var resource_1 = require_resource(); - var Core = __importStar(require_core2()); - var Embeddings = class extends resource_1.APIResource { - /** - * Creates an embedding vector representing the input text. - * - * @example - * ```ts - * const createEmbeddingResponse = - * await client.embeddings.create({ - * input: 'The quick brown fox jumped over the lazy dog', - * model: 'text-embedding-3-small', - * }); - * ``` - */ - create(body2, options) { - const hasUserProvidedEncodingFormat = !!body2.encoding_format; - let encoding_format = hasUserProvidedEncodingFormat ? body2.encoding_format : "base64"; - if (hasUserProvidedEncodingFormat) { - Core.debug("Request", "User defined encoding_format:", body2.encoding_format); - } - const response = this._client.post("/embeddings", { - body: { - ...body2, - encoding_format - }, - ...options - }); - if (hasUserProvidedEncodingFormat) { - return response; - } - Core.debug("response", "Decoding base64 embeddings to float32 array"); - return response._thenUnwrap((response2) => { - if (response2 && response2.data) { - response2.data.forEach((embeddingBase64Obj) => { - const embeddingBase64Str = embeddingBase64Obj.embedding; - embeddingBase64Obj.embedding = Core.toFloat32Array(embeddingBase64Str); - }); - } - return response2; - }); + function yt2(e7) { + return new TypeError(`WritableStreamDefaultWriter.prototype.${e7} can only be used on a WritableStreamDefaultWriter`); } - }; - exports2.Embeddings = Embeddings; - } -}); - -// node_modules/openai/resources/evals/runs/output-items.js -var require_output_items = __commonJS({ - "node_modules/openai/resources/evals/runs/output-items.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.OutputItemListResponsesPage = exports2.OutputItems = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var pagination_1 = require_pagination(); - var OutputItems = class extends resource_1.APIResource { - /** - * Get an evaluation run output item by ID. - */ - retrieve(evalId, runId, outputItemId, options) { - return this._client.get(`/evals/${evalId}/runs/${runId}/output_items/${outputItemId}`, options); + function gt2(e7) { + return new TypeError("Cannot " + e7 + " a stream using a released writer"); } - list(evalId, runId, query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list(evalId, runId, {}, query); - } - return this._client.getAPIList(`/evals/${evalId}/runs/${runId}/output_items`, OutputItemListResponsesPage, { query, ...options }); + function St2(e7) { + e7._closedPromise = c6(((t2, r7) => { + e7._closedPromise_resolve = t2, e7._closedPromise_reject = r7, e7._closedPromiseState = "pending"; + })); } - }; - exports2.OutputItems = OutputItems; - var OutputItemListResponsesPage = class extends pagination_1.CursorPage { - }; - exports2.OutputItemListResponsesPage = OutputItemListResponsesPage; - OutputItems.OutputItemListResponsesPage = OutputItemListResponsesPage; - } -}); - -// node_modules/openai/resources/evals/runs/runs.js -var require_runs2 = __commonJS({ - "node_modules/openai/resources/evals/runs/runs.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + function wt2(e7, t2) { + St2(e7), vt2(e7, t2); } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + function vt2(e7, t2) { + void 0 !== e7._closedPromise_reject && (y(e7._closedPromise), e7._closedPromise_reject(t2), e7._closedPromise_resolve = void 0, e7._closedPromise_reject = void 0, e7._closedPromiseState = "rejected"); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RunListResponsesPage = exports2.Runs = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var OutputItemsAPI = __importStar(require_output_items()); - var output_items_1 = require_output_items(); - var pagination_1 = require_pagination(); - var Runs = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.outputItems = new OutputItemsAPI.OutputItems(this._client); + function Rt2(e7) { + void 0 !== e7._closedPromise_resolve && (e7._closedPromise_resolve(void 0), e7._closedPromise_resolve = void 0, e7._closedPromise_reject = void 0, e7._closedPromiseState = "resolved"); } - /** - * Kicks off a new run for a given evaluation, specifying the data source, and what - * model configuration to use to test. The datasource will be validated against the - * schema specified in the config of the evaluation. - */ - create(evalId, body2, options) { - return this._client.post(`/evals/${evalId}/runs`, { body: body2, ...options }); + function Tt2(e7) { + e7._readyPromise = c6(((t2, r7) => { + e7._readyPromise_resolve = t2, e7._readyPromise_reject = r7; + })), e7._readyPromiseState = "pending"; } - /** - * Get an evaluation run by ID. - */ - retrieve(evalId, runId, options) { - return this._client.get(`/evals/${evalId}/runs/${runId}`, options); + function qt2(e7, t2) { + Tt2(e7), Pt2(e7, t2); } - list(evalId, query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list(evalId, {}, query); - } - return this._client.getAPIList(`/evals/${evalId}/runs`, RunListResponsesPage, { query, ...options }); + function Ct2(e7) { + Tt2(e7), Et2(e7); } - /** - * Delete an eval run. - */ - del(evalId, runId, options) { - return this._client.delete(`/evals/${evalId}/runs/${runId}`, options); + function Pt2(e7, t2) { + void 0 !== e7._readyPromise_reject && (y(e7._readyPromise), e7._readyPromise_reject(t2), e7._readyPromise_resolve = void 0, e7._readyPromise_reject = void 0, e7._readyPromiseState = "rejected"); } - /** - * Cancel an ongoing evaluation run. - */ - cancel(evalId, runId, options) { - return this._client.post(`/evals/${evalId}/runs/${runId}`, options); + function Et2(e7) { + void 0 !== e7._readyPromise_resolve && (e7._readyPromise_resolve(void 0), e7._readyPromise_resolve = void 0, e7._readyPromise_reject = void 0, e7._readyPromiseState = "fulfilled"); } - }; - exports2.Runs = Runs; - var RunListResponsesPage = class extends pagination_1.CursorPage { - }; - exports2.RunListResponsesPage = RunListResponsesPage; - Runs.RunListResponsesPage = RunListResponsesPage; - Runs.OutputItems = output_items_1.OutputItems; - Runs.OutputItemListResponsesPage = output_items_1.OutputItemListResponsesPage; - } -}); - -// node_modules/openai/resources/evals/evals.js -var require_evals = __commonJS({ - "node_modules/openai/resources/evals/evals.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + Object.defineProperties(WritableStreamDefaultController.prototype, { abortReason: { enumerable: true }, signal: { enumerable: true }, error: { enumerable: true } }), "symbol" == typeof t.toStringTag && Object.defineProperty(WritableStreamDefaultController.prototype, t.toStringTag, { value: "WritableStreamDefaultController", configurable: true }); + const Wt2 = "undefined" != typeof DOMException ? DOMException : void 0; + const Ot2 = (function(e7) { + if ("function" != typeof e7 && "object" != typeof e7) return false; + try { + return new e7(), true; + } catch (e8) { + return false; + } + })(Wt2) ? Wt2 : (function() { + const e7 = function(e8, t2) { + this.message = e8 || "", this.name = t2 || "Error", Error.captureStackTrace && Error.captureStackTrace(this, this.constructor); + }; + return e7.prototype = Object.create(Error.prototype), Object.defineProperty(e7.prototype, "constructor", { value: e7, writable: true, configurable: true }), e7; + })(); + function kt2(e7, t2, r7, o3, n9, a7) { + const i7 = e7.getReader(), l4 = t2.getWriter(); + Ut2(e7) && (e7._disturbed = true); + let s2, u2, p3, S2 = false, w2 = false, v3 = "readable", R3 = "writable", T3 = false, q4 = false; + const C3 = c6(((e8) => { + p3 = e8; + })); + let P3 = Promise.resolve(void 0); + return c6(((E2, W3) => { + let O3; + function k8() { + if (S2) return; + const e8 = c6(((e9, t3) => { + !(function r8(o4) { + o4 ? e9() : b6((function() { + if (S2) return d6(true); + return b6(l4.ready, (() => b6(i7.read(), ((e10) => !!e10.done || (P3 = l4.write(e10.value), y(P3), false))))); + })(), r8, t3); + })(false); + })); + y(e8); + } + function B3() { + return v3 = "closed", r7 ? L3() : z2((() => (Xe2(t2) && (T3 = ot2(t2), R3 = t2._state), T3 || "closed" === R3 ? d6(void 0) : "erroring" === R3 || "errored" === R3 ? f6(u2) : (T3 = true, l4.close()))), false, void 0), null; + } + function A3(e8) { + return S2 || (v3 = "errored", s2 = e8, o3 ? L3(true, e8) : z2((() => l4.abort(e8)), true, e8)), null; + } + function j8(e8) { + return w2 || (R3 = "errored", u2 = e8, n9 ? L3(true, e8) : z2((() => i7.cancel(e8)), true, e8)), null; + } + if (void 0 !== a7 && (O3 = () => { + const e8 = void 0 !== a7.reason ? a7.reason : new Ot2("Aborted", "AbortError"), t3 = []; + o3 || t3.push((() => "writable" === R3 ? l4.abort(e8) : d6(void 0))), n9 || t3.push((() => "readable" === v3 ? i7.cancel(e8) : d6(void 0))), z2((() => Promise.all(t3.map(((e9) => e9())))), true, e8); + }, a7.aborted ? O3() : a7.addEventListener("abort", O3)), Ut2(e7) && (v3 = e7._state, s2 = e7._storedError), Xe2(t2) && (R3 = t2._state, u2 = t2._storedError, T3 = ot2(t2)), Ut2(e7) && Xe2(t2) && (q4 = true, p3()), "errored" === v3) A3(s2); + else if ("erroring" === R3 || "errored" === R3) j8(u2); + else if ("closed" === v3) B3(); + else if (T3 || "closed" === R3) { + const e8 = new TypeError("the destination writable stream closed before all data could be piped to it"); + n9 ? L3(true, e8) : z2((() => i7.cancel(e8)), true, e8); + } + function z2(e8, t3, r8) { + function o4() { + return "writable" !== R3 || T3 ? n10() : _3((function() { + let e9; + return d6((function t4() { + if (e9 !== P3) return e9 = P3, m3(P3, t4, t4); + })()); + })(), n10), null; + } + function n10() { + return e8 ? h6(e8(), (() => F3(t3, r8)), ((e9) => F3(true, e9))) : F3(t3, r8), null; + } + S2 || (S2 = true, q4 ? o4() : _3(C3, o4)); + } + function L3(e8, t3) { + z2(void 0, e8, t3); + } + function F3(e8, t3) { + return w2 = true, l4.releaseLock(), i7.releaseLock(), void 0 !== a7 && a7.removeEventListener("abort", O3), e8 ? W3(t3) : E2(void 0), null; + } + S2 || (h6(i7.closed, B3, A3), h6(l4.closed, (function() { + return w2 || (R3 = "closed"), null; + }), j8)), q4 ? k8() : g6((() => { + q4 = true, p3(), k8(); + })); + })); } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + function Bt2(e7, t2) { + return (function(e8) { + try { + return e8.getReader({ mode: "byob" }).releaseLock(), true; + } catch (e9) { + return false; + } + })(e7) ? (function(e8) { + let t3, r7, o3, n9, a7, i7 = e8.getReader(), l4 = false, s2 = false, u2 = false, f7 = false, b7 = false, _4 = false; + const m4 = c6(((e9) => { + a7 = e9; + })); + function y2(e9) { + p2(e9.closed, ((t4) => (e9 !== i7 || (o3.error(t4), n9.error(t4), b7 && _4 || a7(void 0)), null))); + } + function g7() { + l4 && (i7.releaseLock(), i7 = e8.getReader(), y2(i7), l4 = false), h6(i7.read(), ((e9) => { + var t4, r8; + if (u2 = false, f7 = false, e9.done) return b7 || o3.close(), _4 || n9.close(), null === (t4 = o3.byobRequest) || void 0 === t4 || t4.respond(0), null === (r8 = n9.byobRequest) || void 0 === r8 || r8.respond(0), b7 && _4 || a7(void 0), null; + const l5 = e9.value, c7 = l5; + let d7 = l5; + if (!b7 && !_4) try { + d7 = se2(l5); + } catch (e10) { + return o3.error(e10), n9.error(e10), a7(i7.cancel(e10)), null; + } + return b7 || o3.enqueue(c7), _4 || n9.enqueue(d7), s2 = false, u2 ? w2() : f7 && v3(), null; + }), (() => (s2 = false, null))); + } + function S2(t4, r8) { + l4 || (i7.releaseLock(), i7 = e8.getReader({ mode: "byob" }), y2(i7), l4 = true); + const c7 = r8 ? n9 : o3, d7 = r8 ? o3 : n9; + h6(i7.read(t4), ((e9) => { + var t5; + u2 = false, f7 = false; + const o4 = r8 ? _4 : b7, n10 = r8 ? b7 : _4; + if (e9.done) { + o4 || c7.close(), n10 || d7.close(); + const r9 = e9.value; + return void 0 !== r9 && (o4 || c7.byobRequest.respondWithNewView(r9), n10 || null === (t5 = d7.byobRequest) || void 0 === t5 || t5.respond(0)), o4 && n10 || a7(void 0), null; + } + const l5 = e9.value; + if (n10) o4 || c7.byobRequest.respondWithNewView(l5); + else { + let e10; + try { + e10 = se2(l5); + } catch (e11) { + return c7.error(e11), d7.error(e11), a7(i7.cancel(e11)), null; + } + o4 || c7.byobRequest.respondWithNewView(l5), d7.enqueue(e10); + } + return s2 = false, u2 ? w2() : f7 && v3(), null; + }), (() => (s2 = false, null))); + } + function w2() { + if (s2) return u2 = true, d6(void 0); + s2 = true; + const e9 = o3.byobRequest; + return null === e9 ? g7() : S2(e9.view, false), d6(void 0); + } + function v3() { + if (s2) return f7 = true, d6(void 0); + s2 = true; + const e9 = n9.byobRequest; + return null === e9 ? g7() : S2(e9.view, true), d6(void 0); + } + function R3(e9) { + if (b7 = true, t3 = e9, _4) { + const e10 = [t3, r7], o4 = i7.cancel(e10); + a7(o4); + } + return m4; + } + function T3(e9) { + if (_4 = true, r7 = e9, b7) { + const e10 = [t3, r7], o4 = i7.cancel(e10); + a7(o4); + } + return m4; + } + const q4 = new ReadableStream2({ type: "bytes", start(e9) { + o3 = e9; + }, pull: w2, cancel: R3 }), C3 = new ReadableStream2({ type: "bytes", start(e9) { + n9 = e9; + }, pull: v3, cancel: T3 }); + return y2(i7), [q4, C3]; + })(e7) : (function(e8, t3) { + const r7 = e8.getReader(); + let o3, n9, a7, i7, l4, s2 = false, u2 = false, f7 = false, b7 = false; + const _4 = c6(((e9) => { + l4 = e9; + })); + function m4() { + return s2 ? (u2 = true, d6(void 0)) : (s2 = true, h6(r7.read(), ((e9) => { + if (u2 = false, e9.done) return f7 || a7.close(), b7 || i7.close(), f7 && b7 || l4(void 0), null; + const t4 = e9.value, r8 = t4, o4 = t4; + return f7 || a7.enqueue(r8), b7 || i7.enqueue(o4), s2 = false, u2 && m4(), null; + }), (() => (s2 = false, null))), d6(void 0)); + } + function y2(e9) { + if (f7 = true, o3 = e9, b7) { + const e10 = [o3, n9], t4 = r7.cancel(e10); + l4(t4); + } + return _4; + } + function g7(e9) { + if (b7 = true, n9 = e9, f7) { + const e10 = [o3, n9], t4 = r7.cancel(e10); + l4(t4); + } + return _4; + } + const S2 = new ReadableStream2({ start(e9) { + a7 = e9; + }, pull: m4, cancel: y2 }), w2 = new ReadableStream2({ start(e9) { + i7 = e9; + }, pull: m4, cancel: g7 }); + return p2(r7.closed, ((e9) => (a7.error(e9), i7.error(e9), f7 && b7 || l4(void 0), null))), [S2, w2]; + })(e7); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.EvalListResponsesPage = exports2.Evals = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var RunsAPI = __importStar(require_runs2()); - var runs_1 = require_runs2(); - var pagination_1 = require_pagination(); - var Evals = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.runs = new RunsAPI.Runs(this._client); + class ReadableStreamDefaultController { + constructor() { + throw new TypeError("Illegal constructor"); + } + get desiredSize() { + if (!At2(this)) throw $t("desiredSize"); + return Ft2(this); + } + close() { + if (!At2(this)) throw $t("close"); + if (!Dt2(this)) throw new TypeError("The stream is not in a state that permits close"); + !(function(e7) { + if (!Dt2(e7)) return; + const t2 = e7._controlledReadableStream; + e7._closeRequested = true, 0 === e7._queue.length && (zt2(e7), Jt2(t2)); + })(this); + } + enqueue(e7) { + if (!At2(this)) throw $t("enqueue"); + if (!Dt2(this)) throw new TypeError("The stream is not in a state that permits enqueue"); + return (function(e8, t2) { + if (!Dt2(e8)) return; + const r7 = e8._controlledReadableStream; + if (Gt2(r7) && J(r7) > 0) X2(r7, t2, false); + else { + let r8; + try { + r8 = e8._strategySizeAlgorithm(t2); + } catch (t3) { + throw Lt2(e8, t3), t3; + } + try { + ce2(e8, t2, r8); + } catch (t3) { + throw Lt2(e8, t3), t3; + } + } + jt2(e8); + })(this, e7); + } + error(e7) { + if (!At2(this)) throw $t("error"); + Lt2(this, e7); + } + [q3](e7) { + de2(this); + const t2 = this._cancelAlgorithm(e7); + return zt2(this), t2; + } + [C2](e7) { + const t2 = this._controlledReadableStream; + if (this._queue.length > 0) { + const r7 = ue2(this); + this._closeRequested && 0 === this._queue.length ? (zt2(this), Jt2(t2)) : jt2(this), e7._chunkSteps(r7); + } else G2(t2, e7), jt2(this); + } + [P2]() { + } } - /** - * Create the structure of an evaluation that can be used to test a model's - * performance. An evaluation is a set of testing criteria and the config for a - * data source, which dictates the schema of the data used in the evaluation. After - * creating an evaluation, you can run it on different models and model parameters. - * We support several types of graders and datasources. For more information, see - * the [Evals guide](https://platform.openai.com/docs/guides/evals). - */ - create(body2, options) { - return this._client.post("/evals", { body: body2, ...options }); + function At2(e7) { + return !!o2(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_controlledReadableStream") && e7 instanceof ReadableStreamDefaultController); } - /** - * Get an evaluation by ID. - */ - retrieve(evalId, options) { - return this._client.get(`/evals/${evalId}`, options); + function jt2(e7) { + const t2 = (function(e8) { + const t3 = e8._controlledReadableStream; + if (!Dt2(e8)) return false; + if (!e8._started) return false; + if (Gt2(t3) && J(t3) > 0) return true; + if (Ft2(e8) > 0) return true; + return false; + })(e7); + if (!t2) return; + if (e7._pulling) return void (e7._pullAgain = true); + e7._pulling = true; + h6(e7._pullAlgorithm(), (() => (e7._pulling = false, e7._pullAgain && (e7._pullAgain = false, jt2(e7)), null)), ((t3) => (Lt2(e7, t3), null))); } - /** - * Update certain properties of an evaluation. - */ - update(evalId, body2, options) { - return this._client.post(`/evals/${evalId}`, { body: body2, ...options }); + function zt2(e7) { + e7._pullAlgorithm = void 0, e7._cancelAlgorithm = void 0, e7._strategySizeAlgorithm = void 0; } - list(query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list({}, query); - } - return this._client.getAPIList("/evals", EvalListResponsesPage, { query, ...options }); + function Lt2(e7, t2) { + const r7 = e7._controlledReadableStream; + "readable" === r7._state && (de2(e7), zt2(e7), Kt2(r7, t2)); } - /** - * Delete an evaluation. - */ - del(evalId, options) { - return this._client.delete(`/evals/${evalId}`, options); + function Ft2(e7) { + const t2 = e7._controlledReadableStream._state; + return "errored" === t2 ? null : "closed" === t2 ? 0 : e7._strategyHWM - e7._queueTotalSize; } - }; - exports2.Evals = Evals; - var EvalListResponsesPage = class extends pagination_1.CursorPage { - }; - exports2.EvalListResponsesPage = EvalListResponsesPage; - Evals.EvalListResponsesPage = EvalListResponsesPage; - Evals.Runs = runs_1.Runs; - Evals.RunListResponsesPage = runs_1.RunListResponsesPage; - } -}); - -// node_modules/openai/resources/files.js -var require_files2 = __commonJS({ - "node_modules/openai/resources/files.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + function Dt2(e7) { + return !e7._closeRequested && "readable" === e7._controlledReadableStream._state; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + function It2(e7, t2, r7, o3) { + const n9 = Object.create(ReadableStreamDefaultController.prototype); + let a7, i7, l4; + a7 = void 0 !== t2.start ? () => t2.start(n9) : () => { + }, i7 = void 0 !== t2.pull ? () => t2.pull(n9) : () => d6(void 0), l4 = void 0 !== t2.cancel ? (e8) => t2.cancel(e8) : () => d6(void 0), (function(e8, t3, r8, o4, n10, a8, i8) { + t3._controlledReadableStream = e8, t3._queue = void 0, t3._queueTotalSize = void 0, de2(t3), t3._started = false, t3._closeRequested = false, t3._pullAgain = false, t3._pulling = false, t3._strategySizeAlgorithm = i8, t3._strategyHWM = a8, t3._pullAlgorithm = o4, t3._cancelAlgorithm = n10, e8._readableStreamController = t3, h6(d6(r8()), (() => (t3._started = true, jt2(t3), null)), ((e9) => (Lt2(t3, e9), null))); + })(e7, n9, a7, i7, l4, r7, o3); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.FileObjectsPage = exports2.Files = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var core_2 = require_core2(); - var error_1 = require_error2(); - var Core = __importStar(require_core2()); - var pagination_1 = require_pagination(); - var Files = class extends resource_1.APIResource { - /** - * Upload a file that can be used across various endpoints. Individual files can be - * up to 512 MB, and the size of all files uploaded by one organization can be up - * to 100 GB. - * - * The Assistants API supports files up to 2 million tokens and of specific file - * types. See the - * [Assistants Tools guide](https://platform.openai.com/docs/assistants/tools) for - * details. - * - * The Fine-tuning API only supports `.jsonl` files. The input also has certain - * required formats for fine-tuning - * [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input) or - * [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) - * models. - * - * The Batch API only supports `.jsonl` files up to 200 MB in size. The input also - * has a specific required - * [format](https://platform.openai.com/docs/api-reference/batch/request-input). - * - * Please [contact us](https://help.openai.com/) if you need to increase these - * storage limits. - */ - create(body2, options) { - return this._client.post("/files", Core.multipartFormRequestOptions({ body: body2, ...options })); + function $t(e7) { + return new TypeError(`ReadableStreamDefaultController.prototype.${e7} can only be used on a ReadableStreamDefaultController`); } - /** - * Returns information about a specific file. - */ - retrieve(fileId, options) { - return this._client.get(`/files/${fileId}`, options); + function Mt2(e7, t2, r7) { + return I2(e7, r7), (r8) => w(e7, t2, [r8]); } - list(query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list({}, query); - } - return this._client.getAPIList("/files", FileObjectsPage, { query, ...options }); + function Yt2(e7, t2, r7) { + return I2(e7, r7), (r8) => w(e7, t2, [r8]); } - /** - * Delete a file. - */ - del(fileId, options) { - return this._client.delete(`/files/${fileId}`, options); + function Qt2(e7, t2, r7) { + return I2(e7, r7), (r8) => S(e7, t2, [r8]); } - /** - * Returns the contents of the specified file. - */ - content(fileId, options) { - return this._client.get(`/files/${fileId}/content`, { - ...options, - headers: { Accept: "application/binary", ...options?.headers }, - __binaryResponse: true - }); + function Nt2(e7, t2) { + if ("bytes" !== (e7 = `${e7}`)) throw new TypeError(`${t2} '${e7}' is not a valid enumeration value for ReadableStreamType`); + return e7; } - /** - * Returns the contents of the specified file. - * - * @deprecated The `.content()` method should be used instead - */ - retrieveContent(fileId, options) { - return this._client.get(`/files/${fileId}/content`, options); + function xt2(e7, t2) { + if ("byob" !== (e7 = `${e7}`)) throw new TypeError(`${t2} '${e7}' is not a valid enumeration value for ReadableStreamReaderMode`); + return e7; } - /** - * Waits for the given file to be processed, default timeout is 30 mins. - */ - async waitForProcessing(id, { pollInterval = 5e3, maxWait = 30 * 60 * 1e3 } = {}) { - const TERMINAL_STATES = /* @__PURE__ */ new Set(["processed", "error", "deleted"]); - const start = Date.now(); - let file = await this.retrieve(id); - while (!file.status || !TERMINAL_STATES.has(file.status)) { - await (0, core_2.sleep)(pollInterval); - file = await this.retrieve(id); - if (Date.now() - start > maxWait) { - throw new error_1.APIConnectionTimeoutError({ - message: `Giving up on waiting for file ${id} to finish processing after ${maxWait} milliseconds.` - }); + function Ht2(e7, t2) { + D2(e7, t2); + const r7 = null == e7 ? void 0 : e7.preventAbort, o3 = null == e7 ? void 0 : e7.preventCancel, n9 = null == e7 ? void 0 : e7.preventClose, a7 = null == e7 ? void 0 : e7.signal; + return void 0 !== a7 && (function(e8, t3) { + if (!(function(e9) { + if ("object" != typeof e9 || null === e9) return false; + try { + return "boolean" == typeof e9.aborted; + } catch (e10) { + return false; + } + })(e8)) throw new TypeError(`${t3} is not an AbortSignal.`); + })(a7, `${t2} has member 'signal' that`), { preventAbort: Boolean(r7), preventCancel: Boolean(o3), preventClose: Boolean(n9), signal: a7 }; + } + function Vt2(e7, t2) { + D2(e7, t2); + const r7 = null == e7 ? void 0 : e7.readable; + Y2(r7, "readable", "ReadableWritablePair"), (function(e8, t3) { + if (!H2(e8)) throw new TypeError(`${t3} is not a ReadableStream.`); + })(r7, `${t2} has member 'readable' that`); + const o3 = null == e7 ? void 0 : e7.writable; + return Y2(o3, "writable", "ReadableWritablePair"), (function(e8, t3) { + if (!V2(e8)) throw new TypeError(`${t3} is not a WritableStream.`); + })(o3, `${t2} has member 'writable' that`), { readable: r7, writable: o3 }; + } + Object.defineProperties(ReadableStreamDefaultController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, desiredSize: { enumerable: true } }), a6(ReadableStreamDefaultController.prototype.close, "close"), a6(ReadableStreamDefaultController.prototype.enqueue, "enqueue"), a6(ReadableStreamDefaultController.prototype.error, "error"), "symbol" == typeof t.toStringTag && Object.defineProperty(ReadableStreamDefaultController.prototype, t.toStringTag, { value: "ReadableStreamDefaultController", configurable: true }); + class ReadableStream2 { + constructor(e7 = {}, t2 = {}) { + void 0 === e7 ? e7 = null : $(e7, "First parameter"); + const r7 = Qe2(t2, "Second parameter"), o3 = (function(e8, t3) { + D2(e8, t3); + const r8 = e8, o4 = null == r8 ? void 0 : r8.autoAllocateChunkSize, n10 = null == r8 ? void 0 : r8.cancel, a7 = null == r8 ? void 0 : r8.pull, i7 = null == r8 ? void 0 : r8.start, l4 = null == r8 ? void 0 : r8.type; + return { autoAllocateChunkSize: void 0 === o4 ? void 0 : x2(o4, `${t3} has member 'autoAllocateChunkSize' that`), cancel: void 0 === n10 ? void 0 : Mt2(n10, r8, `${t3} has member 'cancel' that`), pull: void 0 === a7 ? void 0 : Yt2(a7, r8, `${t3} has member 'pull' that`), start: void 0 === i7 ? void 0 : Qt2(i7, r8, `${t3} has member 'start' that`), type: void 0 === l4 ? void 0 : Nt2(l4, `${t3} has member 'type' that`) }; + })(e7, "First parameter"); + var n9; + if ((n9 = this)._state = "readable", n9._reader = void 0, n9._storedError = void 0, n9._disturbed = false, "bytes" === o3.type) { + if (void 0 !== r7.size) throw new RangeError("The strategy for a byte stream cannot have a size function"); + Be2(this, o3, Me2(r7, 0)); + } else { + const e8 = Ye2(r7); + It2(this, o3, Me2(r7, 1), e8); } } - return file; - } - }; - exports2.Files = Files; - var FileObjectsPage = class extends pagination_1.CursorPage { - }; - exports2.FileObjectsPage = FileObjectsPage; - Files.FileObjectsPage = FileObjectsPage; - } -}); - -// node_modules/openai/resources/fine-tuning/methods.js -var require_methods2 = __commonJS({ - "node_modules/openai/resources/fine-tuning/methods.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Methods = void 0; - var resource_1 = require_resource(); - var Methods = class extends resource_1.APIResource { - }; - exports2.Methods = Methods; - } -}); - -// node_modules/openai/resources/fine-tuning/alpha/graders.js -var require_graders = __commonJS({ - "node_modules/openai/resources/fine-tuning/alpha/graders.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Graders = void 0; - var resource_1 = require_resource(); - var Graders = class extends resource_1.APIResource { - /** - * Run a grader. - * - * @example - * ```ts - * const response = await client.fineTuning.alpha.graders.run({ - * grader: { - * input: 'input', - * name: 'name', - * operation: 'eq', - * reference: 'reference', - * type: 'string_check', - * }, - * model_sample: 'model_sample', - * reference_answer: 'string', - * }); - * ``` - */ - run(body2, options) { - return this._client.post("/fine_tuning/alpha/graders/run", { body: body2, ...options }); + get locked() { + if (!Ut2(this)) throw Zt2("locked"); + return Gt2(this); + } + cancel(e7) { + return Ut2(this) ? Gt2(this) ? f6(new TypeError("Cannot cancel a stream that already has a reader")) : Xt2(this, e7) : f6(Zt2("cancel")); + } + getReader(e7) { + if (!Ut2(this)) throw Zt2("getReader"); + return void 0 === (function(e8, t2) { + D2(e8, t2); + const r7 = null == e8 ? void 0 : e8.mode; + return { mode: void 0 === r7 ? void 0 : xt2(r7, `${t2} has member 'mode' that`) }; + })(e7, "First parameter").mode ? new ReadableStreamDefaultReader(this) : (function(e8) { + return new ReadableStreamBYOBReader(e8); + })(this); + } + pipeThrough(e7, t2 = {}) { + if (!H2(this)) throw Zt2("pipeThrough"); + M2(e7, 1, "pipeThrough"); + const r7 = Vt2(e7, "First parameter"), o3 = Ht2(t2, "Second parameter"); + if (this.locked) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream"); + if (r7.writable.locked) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream"); + return y(kt2(this, r7.writable, o3.preventClose, o3.preventAbort, o3.preventCancel, o3.signal)), r7.readable; + } + pipeTo(e7, t2 = {}) { + if (!H2(this)) return f6(Zt2("pipeTo")); + if (void 0 === e7) return f6("Parameter 1 is required in 'pipeTo'."); + if (!V2(e7)) return f6(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream")); + let r7; + try { + r7 = Ht2(t2, "Second parameter"); + } catch (e8) { + return f6(e8); + } + return this.locked ? f6(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")) : e7.locked ? f6(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")) : kt2(this, e7, r7.preventClose, r7.preventAbort, r7.preventCancel, r7.signal); + } + tee() { + if (!H2(this)) throw Zt2("tee"); + if (this.locked) throw new TypeError("Cannot tee a stream that already has a reader"); + return Bt2(this); + } + values(e7) { + if (!H2(this)) throw Zt2("values"); + return (function(e8, t2) { + const r7 = e8.getReader(), o3 = new re2(r7, t2), n9 = Object.create(oe2); + return n9._asyncIteratorImpl = o3, n9; + })(this, (function(e8, t2) { + D2(e8, t2); + const r7 = null == e8 ? void 0 : e8.preventCancel; + return { preventCancel: Boolean(r7) }; + })(e7, "First parameter").preventCancel); + } } - /** - * Validate a grader. - * - * @example - * ```ts - * const response = - * await client.fineTuning.alpha.graders.validate({ - * grader: { - * input: 'input', - * name: 'name', - * operation: 'eq', - * reference: 'reference', - * type: 'string_check', - * }, - * }); - * ``` - */ - validate(body2, options) { - return this._client.post("/fine_tuning/alpha/graders/validate", { body: body2, ...options }); + function Ut2(e7) { + return !!o2(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_readableStreamController") && e7 instanceof ReadableStream2); } - }; - exports2.Graders = Graders; - } -}); - -// node_modules/openai/resources/fine-tuning/alpha/alpha.js -var require_alpha = __commonJS({ - "node_modules/openai/resources/fine-tuning/alpha/alpha.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + function Gt2(e7) { + return void 0 !== e7._reader; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + function Xt2(e7, t2) { + if (e7._disturbed = true, "closed" === e7._state) return d6(void 0); + if ("errored" === e7._state) return f6(e7._storedError); + Jt2(e7); + const o3 = e7._reader; + if (void 0 !== o3 && De2(o3)) { + const e8 = o3._readIntoRequests; + o3._readIntoRequests = new v2(), e8.forEach(((e9) => { + e9._closeSteps(void 0); + })); + } + return m3(e7._readableStreamController[q3](t2), r6); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Alpha = void 0; - var resource_1 = require_resource(); - var GradersAPI = __importStar(require_graders()); - var graders_1 = require_graders(); - var Alpha = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.graders = new GradersAPI.Graders(this._client); + function Jt2(e7) { + e7._state = "closed"; + const t2 = e7._reader; + if (void 0 !== t2 && (z(t2), Z(t2))) { + const e8 = t2._readRequests; + t2._readRequests = new v2(), e8.forEach(((e9) => { + e9._closeSteps(); + })); + } } - }; - exports2.Alpha = Alpha; - Alpha.Graders = graders_1.Graders; - } -}); - -// node_modules/openai/resources/fine-tuning/checkpoints/permissions.js -var require_permissions = __commonJS({ - "node_modules/openai/resources/fine-tuning/checkpoints/permissions.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PermissionCreateResponsesPage = exports2.Permissions = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var pagination_1 = require_pagination(); - var Permissions = class extends resource_1.APIResource { - /** - * **NOTE:** Calling this endpoint requires an [admin API key](../admin-api-keys). - * - * This enables organization owners to share fine-tuned models with other projects - * in their organization. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const permissionCreateResponse of client.fineTuning.checkpoints.permissions.create( - * 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd', - * { project_ids: ['string'] }, - * )) { - * // ... - * } - * ``` - */ - create(fineTunedModelCheckpoint, body2, options) { - return this._client.getAPIList(`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, PermissionCreateResponsesPage, { body: body2, method: "post", ...options }); + function Kt2(e7, t2) { + e7._state = "errored", e7._storedError = t2; + const r7 = e7._reader; + void 0 !== r7 && (j7(r7, t2), Z(r7) ? ee2(r7, t2) : Ie2(r7, t2)); } - retrieve(fineTunedModelCheckpoint, query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.retrieve(fineTunedModelCheckpoint, {}, query); - } - return this._client.get(`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, { - query, - ...options - }); + function Zt2(e7) { + return new TypeError(`ReadableStream.prototype.${e7} can only be used on a ReadableStream`); } - /** - * **NOTE:** This endpoint requires an [admin API key](../admin-api-keys). - * - * Organization owners can use this endpoint to delete a permission for a - * fine-tuned model checkpoint. - * - * @example - * ```ts - * const permission = - * await client.fineTuning.checkpoints.permissions.del( - * 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd', - * 'cp_zc4Q7MP6XxulcVzj4MZdwsAB', - * ); - * ``` - */ - del(fineTunedModelCheckpoint, permissionId, options) { - return this._client.delete(`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions/${permissionId}`, options); + function er(e7, t2) { + D2(e7, t2); + const r7 = null == e7 ? void 0 : e7.highWaterMark; + return Y2(r7, "highWaterMark", "QueuingStrategyInit"), { highWaterMark: Q2(r7) }; } - }; - exports2.Permissions = Permissions; - var PermissionCreateResponsesPage = class extends pagination_1.Page { - }; - exports2.PermissionCreateResponsesPage = PermissionCreateResponsesPage; - Permissions.PermissionCreateResponsesPage = PermissionCreateResponsesPage; - } -}); - -// node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.js -var require_checkpoints = __commonJS({ - "node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + Object.defineProperties(ReadableStream2.prototype, { cancel: { enumerable: true }, getReader: { enumerable: true }, pipeThrough: { enumerable: true }, pipeTo: { enumerable: true }, tee: { enumerable: true }, values: { enumerable: true }, locked: { enumerable: true } }), a6(ReadableStream2.prototype.cancel, "cancel"), a6(ReadableStream2.prototype.getReader, "getReader"), a6(ReadableStream2.prototype.pipeThrough, "pipeThrough"), a6(ReadableStream2.prototype.pipeTo, "pipeTo"), a6(ReadableStream2.prototype.tee, "tee"), a6(ReadableStream2.prototype.values, "values"), "symbol" == typeof t.toStringTag && Object.defineProperty(ReadableStream2.prototype, t.toStringTag, { value: "ReadableStream", configurable: true }), "symbol" == typeof t.asyncIterator && Object.defineProperty(ReadableStream2.prototype, t.asyncIterator, { value: ReadableStream2.prototype.values, writable: true, configurable: true }); + const tr = (e7) => e7.byteLength; + a6(tr, "size"); + class ByteLengthQueuingStrategy { + constructor(e7) { + M2(e7, 1, "ByteLengthQueuingStrategy"), e7 = er(e7, "First parameter"), this._byteLengthQueuingStrategyHighWaterMark = e7.highWaterMark; + } + get highWaterMark() { + if (!or(this)) throw rr("highWaterMark"); + return this._byteLengthQueuingStrategyHighWaterMark; + } + get size() { + if (!or(this)) throw rr("size"); + return tr; + } } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + function rr(e7) { + return new TypeError(`ByteLengthQueuingStrategy.prototype.${e7} can only be used on a ByteLengthQueuingStrategy`); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Checkpoints = void 0; - var resource_1 = require_resource(); - var PermissionsAPI = __importStar(require_permissions()); - var permissions_1 = require_permissions(); - var Checkpoints = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.permissions = new PermissionsAPI.Permissions(this._client); + function or(e7) { + return !!o2(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_byteLengthQueuingStrategyHighWaterMark") && e7 instanceof ByteLengthQueuingStrategy); } - }; - exports2.Checkpoints = Checkpoints; - Checkpoints.Permissions = permissions_1.Permissions; - Checkpoints.PermissionCreateResponsesPage = permissions_1.PermissionCreateResponsesPage; - } -}); - -// node_modules/openai/resources/fine-tuning/jobs/checkpoints.js -var require_checkpoints2 = __commonJS({ - "node_modules/openai/resources/fine-tuning/jobs/checkpoints.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.FineTuningJobCheckpointsPage = exports2.Checkpoints = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var pagination_1 = require_pagination(); - var Checkpoints = class extends resource_1.APIResource { - list(fineTuningJobId, query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list(fineTuningJobId, {}, query); + Object.defineProperties(ByteLengthQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), "symbol" == typeof t.toStringTag && Object.defineProperty(ByteLengthQueuingStrategy.prototype, t.toStringTag, { value: "ByteLengthQueuingStrategy", configurable: true }); + const nr = () => 1; + a6(nr, "size"); + class CountQueuingStrategy { + constructor(e7) { + M2(e7, 1, "CountQueuingStrategy"), e7 = er(e7, "First parameter"), this._countQueuingStrategyHighWaterMark = e7.highWaterMark; + } + get highWaterMark() { + if (!ir(this)) throw ar("highWaterMark"); + return this._countQueuingStrategyHighWaterMark; + } + get size() { + if (!ir(this)) throw ar("size"); + return nr; } - return this._client.getAPIList(`/fine_tuning/jobs/${fineTuningJobId}/checkpoints`, FineTuningJobCheckpointsPage, { query, ...options }); } - }; - exports2.Checkpoints = Checkpoints; - var FineTuningJobCheckpointsPage = class extends pagination_1.CursorPage { - }; - exports2.FineTuningJobCheckpointsPage = FineTuningJobCheckpointsPage; - Checkpoints.FineTuningJobCheckpointsPage = FineTuningJobCheckpointsPage; - } -}); - -// node_modules/openai/resources/fine-tuning/jobs/jobs.js -var require_jobs = __commonJS({ - "node_modules/openai/resources/fine-tuning/jobs/jobs.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + function ar(e7) { + return new TypeError(`CountQueuingStrategy.prototype.${e7} can only be used on a CountQueuingStrategy`); } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + function ir(e7) { + return !!o2(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_countQueuingStrategyHighWaterMark") && e7 instanceof CountQueuingStrategy); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.FineTuningJobEventsPage = exports2.FineTuningJobsPage = exports2.Jobs = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var CheckpointsAPI = __importStar(require_checkpoints2()); - var checkpoints_1 = require_checkpoints2(); - var pagination_1 = require_pagination(); - var Jobs = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.checkpoints = new CheckpointsAPI.Checkpoints(this._client); + function lr(e7, t2, r7) { + return I2(e7, r7), (r8) => w(e7, t2, [r8]); } - /** - * Creates a fine-tuning job which begins the process of creating a new model from - * a given dataset. - * - * Response includes details of the enqueued job including job status and the name - * of the fine-tuned models once complete. - * - * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning) - * - * @example - * ```ts - * const fineTuningJob = await client.fineTuning.jobs.create({ - * model: 'gpt-4o-mini', - * training_file: 'file-abc123', - * }); - * ``` - */ - create(body2, options) { - return this._client.post("/fine_tuning/jobs", { body: body2, ...options }); + function sr(e7, t2, r7) { + return I2(e7, r7), (r8) => S(e7, t2, [r8]); } - /** - * Get info about a fine-tuning job. - * - * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning) - * - * @example - * ```ts - * const fineTuningJob = await client.fineTuning.jobs.retrieve( - * 'ft-AF1WoRqd3aJAHsqc9NY7iL8F', - * ); - * ``` - */ - retrieve(fineTuningJobId, options) { - return this._client.get(`/fine_tuning/jobs/${fineTuningJobId}`, options); + function ur(e7, t2, r7) { + return I2(e7, r7), (r8, o3) => w(e7, t2, [r8, o3]); } - list(query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list({}, query); + Object.defineProperties(CountQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), "symbol" == typeof t.toStringTag && Object.defineProperty(CountQueuingStrategy.prototype, t.toStringTag, { value: "CountQueuingStrategy", configurable: true }); + class TransformStream2 { + constructor(e7 = {}, t2 = {}, r7 = {}) { + void 0 === e7 && (e7 = null); + const o3 = Qe2(t2, "Second parameter"), n9 = Qe2(r7, "Third parameter"), a7 = (function(e8, t3) { + D2(e8, t3); + const r8 = null == e8 ? void 0 : e8.flush, o4 = null == e8 ? void 0 : e8.readableType, n10 = null == e8 ? void 0 : e8.start, a8 = null == e8 ? void 0 : e8.transform, i8 = null == e8 ? void 0 : e8.writableType; + return { flush: void 0 === r8 ? void 0 : lr(r8, e8, `${t3} has member 'flush' that`), readableType: o4, start: void 0 === n10 ? void 0 : sr(n10, e8, `${t3} has member 'start' that`), transform: void 0 === a8 ? void 0 : ur(a8, e8, `${t3} has member 'transform' that`), writableType: i8 }; + })(e7, "First parameter"); + if (void 0 !== a7.readableType) throw new RangeError("Invalid readableType specified"); + if (void 0 !== a7.writableType) throw new RangeError("Invalid writableType specified"); + const i7 = Me2(n9, 0), l4 = Ye2(n9), s2 = Me2(o3, 1), u2 = Ye2(o3); + let b7; + !(function(e8, t3, r8, o4, n10, a8) { + function i8() { + return t3; + } + function l5(t4) { + return (function(e9, t5) { + const r9 = e9._transformStreamController; + if (e9._backpressure) { + return m3(e9._backpressureChangePromise, (() => { + if ("erroring" === (Xe2(e9._writable) ? e9._writable._state : e9._writableState)) throw Xe2(e9._writable) ? e9._writable._storedError : e9._writableStoredError; + return mr(r9, t5); + })); + } + return mr(r9, t5); + })(e8, t4); + } + function s3(t4) { + return (function(e9, t5) { + return dr(e9, t5), d6(void 0); + })(e8, t4); + } + function u3() { + return (function(e9) { + const t4 = e9._transformStreamController, r9 = t4._flushAlgorithm(); + return _r3(t4), m3(r9, (() => { + if ("errored" === e9._readableState) throw e9._readableStoredError; + Sr(e9) && wr(e9); + }), ((t5) => { + throw dr(e9, t5), e9._readableStoredError; + })); + })(e8); + } + function c7() { + return (function(e9) { + return br(e9, false), e9._backpressureChangePromise; + })(e8); + } + function f7(t4) { + return fr(e8, t4), d6(void 0); + } + e8._writableState = "writable", e8._writableStoredError = void 0, e8._writableHasInFlightOperation = false, e8._writableStarted = false, e8._writable = (function(e9, t4, r9, o5, n11, a9, i9) { + return new WritableStream({ start(r10) { + e9._writableController = r10; + try { + const t5 = r10.signal; + void 0 !== t5 && t5.addEventListener("abort", (() => { + "writable" === e9._writableState && (e9._writableState = "erroring", t5.reason && (e9._writableStoredError = t5.reason)); + })); + } catch (e10) { + } + return m3(t4(), (() => (e9._writableStarted = true, Pr(e9), null)), ((t5) => { + throw e9._writableStarted = true, Tr(e9, t5), t5; + })); + }, write: (t5) => ((function(e10) { + e10._writableHasInFlightOperation = true; + })(e9), m3(r9(t5), (() => ((function(e10) { + e10._writableHasInFlightOperation = false; + })(e9), Pr(e9), null)), ((t6) => { + throw (function(e10, t7) { + e10._writableHasInFlightOperation = false, Tr(e10, t7); + })(e9, t6), t6; + }))), close: () => ((function(e10) { + e10._writableHasInFlightOperation = true; + })(e9), m3(o5(), (() => ((function(e10) { + e10._writableHasInFlightOperation = false; + "erroring" === e10._writableState && (e10._writableStoredError = void 0); + e10._writableState = "closed"; + })(e9), null)), ((t5) => { + throw (function(e10, t6) { + e10._writableHasInFlightOperation = false, e10._writableState, Tr(e10, t6); + })(e9, t5), t5; + }))), abort: (t5) => (e9._writableState = "errored", e9._writableStoredError = t5, n11(t5)) }, { highWaterMark: a9, size: i9 }); + })(e8, i8, l5, u3, s3, r8, o4), e8._readableState = "readable", e8._readableStoredError = void 0, e8._readableCloseRequested = false, e8._readablePulling = false, e8._readable = (function(e9, t4, r9, o5, n11, a9) { + return new ReadableStream2({ start: (r10) => (e9._readableController = r10, t4().catch(((t5) => { + vr(e9, t5); + }))), pull: () => (e9._readablePulling = true, r9().catch(((t5) => { + vr(e9, t5); + }))), cancel: (t5) => (e9._readableState = "closed", o5(t5)) }, { highWaterMark: n11, size: a9 }); + })(e8, i8, c7, f7, n10, a8), e8._backpressure = void 0, e8._backpressureChangePromise = void 0, e8._backpressureChangePromise_resolve = void 0, br(e8, true), e8._transformStreamController = void 0; + })(this, c6(((e8) => { + b7 = e8; + })), s2, u2, i7, l4), (function(e8, t3) { + const r8 = Object.create(TransformStreamDefaultController.prototype); + let o4, n10; + o4 = void 0 !== t3.transform ? (e9) => t3.transform(e9, r8) : (e9) => { + try { + return pr(r8, e9), d6(void 0); + } catch (e10) { + return f6(e10); + } + }; + n10 = void 0 !== t3.flush ? () => t3.flush(r8) : () => d6(void 0); + !(function(e9, t4, r9, o5) { + t4._controlledTransformStream = e9, e9._transformStreamController = t4, t4._transformAlgorithm = r9, t4._flushAlgorithm = o5; + })(e8, r8, o4, n10); + })(this, a7), void 0 !== a7.start ? b7(a7.start(this._transformStreamController)) : b7(void 0); + } + get readable() { + if (!cr(this)) throw gr("readable"); + return this._readable; + } + get writable() { + if (!cr(this)) throw gr("writable"); + return this._writable; } - return this._client.getAPIList("/fine_tuning/jobs", FineTuningJobsPage, { query, ...options }); } - /** - * Immediately cancel a fine-tune job. - * - * @example - * ```ts - * const fineTuningJob = await client.fineTuning.jobs.cancel( - * 'ft-AF1WoRqd3aJAHsqc9NY7iL8F', - * ); - * ``` - */ - cancel(fineTuningJobId, options) { - return this._client.post(`/fine_tuning/jobs/${fineTuningJobId}/cancel`, options); + function cr(e7) { + return !!o2(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_transformStreamController") && e7 instanceof TransformStream2); } - listEvents(fineTuningJobId, query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.listEvents(fineTuningJobId, {}, query); - } - return this._client.getAPIList(`/fine_tuning/jobs/${fineTuningJobId}/events`, FineTuningJobEventsPage, { - query, - ...options - }); + function dr(e7, t2) { + vr(e7, t2), fr(e7, t2); } - /** - * Pause a fine-tune job. - * - * @example - * ```ts - * const fineTuningJob = await client.fineTuning.jobs.pause( - * 'ft-AF1WoRqd3aJAHsqc9NY7iL8F', - * ); - * ``` - */ - pause(fineTuningJobId, options) { - return this._client.post(`/fine_tuning/jobs/${fineTuningJobId}/pause`, options); + function fr(e7, t2) { + _r3(e7._transformStreamController), (function(e8, t3) { + e8._writableController.error(t3); + "writable" === e8._writableState && qr(e8, t3); + })(e7, t2), e7._backpressure && br(e7, false); } - /** - * Resume a fine-tune job. - * - * @example - * ```ts - * const fineTuningJob = await client.fineTuning.jobs.resume( - * 'ft-AF1WoRqd3aJAHsqc9NY7iL8F', - * ); - * ``` - */ - resume(fineTuningJobId, options) { - return this._client.post(`/fine_tuning/jobs/${fineTuningJobId}/resume`, options); + function br(e7, t2) { + void 0 !== e7._backpressureChangePromise && e7._backpressureChangePromise_resolve(), e7._backpressureChangePromise = c6(((t3) => { + e7._backpressureChangePromise_resolve = t3; + })), e7._backpressure = t2; } - }; - exports2.Jobs = Jobs; - var FineTuningJobsPage = class extends pagination_1.CursorPage { - }; - exports2.FineTuningJobsPage = FineTuningJobsPage; - var FineTuningJobEventsPage = class extends pagination_1.CursorPage { - }; - exports2.FineTuningJobEventsPage = FineTuningJobEventsPage; - Jobs.FineTuningJobsPage = FineTuningJobsPage; - Jobs.FineTuningJobEventsPage = FineTuningJobEventsPage; - Jobs.Checkpoints = checkpoints_1.Checkpoints; - Jobs.FineTuningJobCheckpointsPage = checkpoints_1.FineTuningJobCheckpointsPage; - } -}); - -// node_modules/openai/resources/fine-tuning/fine-tuning.js -var require_fine_tuning = __commonJS({ - "node_modules/openai/resources/fine-tuning/fine-tuning.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + Object.defineProperties(TransformStream2.prototype, { readable: { enumerable: true }, writable: { enumerable: true } }), "symbol" == typeof t.toStringTag && Object.defineProperty(TransformStream2.prototype, t.toStringTag, { value: "TransformStream", configurable: true }); + class TransformStreamDefaultController { + constructor() { + throw new TypeError("Illegal constructor"); + } + get desiredSize() { + if (!hr(this)) throw yr("desiredSize"); + return Rr(this._controlledTransformStream); + } + enqueue(e7) { + if (!hr(this)) throw yr("enqueue"); + pr(this, e7); + } + error(e7) { + if (!hr(this)) throw yr("error"); + var t2; + t2 = e7, dr(this._controlledTransformStream, t2); + } + terminate() { + if (!hr(this)) throw yr("terminate"); + !(function(e7) { + const t2 = e7._controlledTransformStream; + Sr(t2) && wr(t2); + const r7 = new TypeError("TransformStream terminated"); + fr(t2, r7); + })(this); + } } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + function hr(e7) { + return !!o2(e7) && (!!Object.prototype.hasOwnProperty.call(e7, "_controlledTransformStream") && e7 instanceof TransformStreamDefaultController); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.FineTuning = void 0; - var resource_1 = require_resource(); - var MethodsAPI = __importStar(require_methods2()); - var methods_1 = require_methods2(); - var AlphaAPI = __importStar(require_alpha()); - var alpha_1 = require_alpha(); - var CheckpointsAPI = __importStar(require_checkpoints()); - var checkpoints_1 = require_checkpoints(); - var JobsAPI = __importStar(require_jobs()); - var jobs_1 = require_jobs(); - var FineTuning = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.methods = new MethodsAPI.Methods(this._client); - this.jobs = new JobsAPI.Jobs(this._client); - this.checkpoints = new CheckpointsAPI.Checkpoints(this._client); - this.alpha = new AlphaAPI.Alpha(this._client); + function _r3(e7) { + e7._transformAlgorithm = void 0, e7._flushAlgorithm = void 0; } - }; - exports2.FineTuning = FineTuning; - FineTuning.Methods = methods_1.Methods; - FineTuning.Jobs = jobs_1.Jobs; - FineTuning.FineTuningJobsPage = jobs_1.FineTuningJobsPage; - FineTuning.FineTuningJobEventsPage = jobs_1.FineTuningJobEventsPage; - FineTuning.Checkpoints = checkpoints_1.Checkpoints; - FineTuning.Alpha = alpha_1.Alpha; - } -}); - -// node_modules/openai/resources/graders/grader-models.js -var require_grader_models = __commonJS({ - "node_modules/openai/resources/graders/grader-models.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.GraderModels = void 0; - var resource_1 = require_resource(); - var GraderModels = class extends resource_1.APIResource { - }; - exports2.GraderModels = GraderModels; - } -}); - -// node_modules/openai/resources/graders/graders.js -var require_graders2 = __commonJS({ - "node_modules/openai/resources/graders/graders.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + function pr(e7, t2) { + const r7 = e7._controlledTransformStream; + if (!Sr(r7)) throw new TypeError("Readable side is not in a state that permits enqueue"); + try { + !(function(e8, t3) { + e8._readablePulling = false; + try { + e8._readableController.enqueue(t3); + } catch (t4) { + throw vr(e8, t4), t4; + } + })(r7, t2); + } catch (e8) { + throw fr(r7, e8), r7._readableStoredError; + } + const o3 = (function(e8) { + return !(function(e9) { + if (!Sr(e9)) return false; + if (e9._readablePulling) return true; + if (Rr(e9) > 0) return true; + return false; + })(e8); + })(r7); + o3 !== r7._backpressure && br(r7, true); } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + function mr(e7, t2) { + return m3(e7._transformAlgorithm(t2), void 0, ((t3) => { + throw dr(e7._controlledTransformStream, t3), t3; + })); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Graders = void 0; - var resource_1 = require_resource(); - var GraderModelsAPI = __importStar(require_grader_models()); - var grader_models_1 = require_grader_models(); - var Graders = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.graderModels = new GraderModelsAPI.GraderModels(this._client); + function yr(e7) { + return new TypeError(`TransformStreamDefaultController.prototype.${e7} can only be used on a TransformStreamDefaultController`); } - }; - exports2.Graders = Graders; - Graders.GraderModels = grader_models_1.GraderModels; - } -}); - -// node_modules/openai/resources/images.js -var require_images = __commonJS({ - "node_modules/openai/resources/images.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + function gr(e7) { + return new TypeError(`TransformStream.prototype.${e7} can only be used on a TransformStream`); } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + function Sr(e7) { + return !e7._readableCloseRequested && "readable" === e7._readableState; } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Images = void 0; - var resource_1 = require_resource(); - var Core = __importStar(require_core2()); - var Images = class extends resource_1.APIResource { - /** - * Creates a variation of a given image. This endpoint only supports `dall-e-2`. - * - * @example - * ```ts - * const imagesResponse = await client.images.createVariation({ - * image: fs.createReadStream('otter.png'), - * }); - * ``` - */ - createVariation(body2, options) { - return this._client.post("/images/variations", Core.multipartFormRequestOptions({ body: body2, ...options })); + function wr(e7) { + e7._readableState = "closed", e7._readableCloseRequested = true, e7._readableController.close(); } - /** - * Creates an edited or extended image given one or more source images and a - * prompt. This endpoint only supports `gpt-image-1` and `dall-e-2`. - * - * @example - * ```ts - * const imagesResponse = await client.images.edit({ - * image: fs.createReadStream('path/to/file'), - * prompt: 'A cute baby sea otter wearing a beret', - * }); - * ``` - */ - edit(body2, options) { - return this._client.post("/images/edits", Core.multipartFormRequestOptions({ body: body2, ...options })); + function vr(e7, t2) { + "readable" === e7._readableState && (e7._readableState = "errored", e7._readableStoredError = t2), e7._readableController.error(t2); } - /** - * Creates an image given a prompt. - * [Learn more](https://platform.openai.com/docs/guides/images). - * - * @example - * ```ts - * const imagesResponse = await client.images.generate({ - * prompt: 'A cute baby sea otter', - * }); - * ``` - */ - generate(body2, options) { - return this._client.post("/images/generations", { body: body2, ...options }); + function Rr(e7) { + return e7._readableController.desiredSize; } - }; - exports2.Images = Images; - } -}); - -// node_modules/openai/resources/models.js -var require_models = __commonJS({ - "node_modules/openai/resources/models.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ModelsPage = exports2.Models = void 0; - var resource_1 = require_resource(); - var pagination_1 = require_pagination(); - var Models = class extends resource_1.APIResource { - /** - * Retrieves a model instance, providing basic information about the model such as - * the owner and permissioning. - */ - retrieve(model, options) { - return this._client.get(`/models/${model}`, options); + function Tr(e7, t2) { + "writable" !== e7._writableState ? Cr2(e7) : qr(e7, t2); } - /** - * Lists the currently available models, and provides basic information about each - * one such as the owner and availability. - */ - list(options) { - return this._client.getAPIList("/models", ModelsPage, options); + function qr(e7, t2) { + e7._writableState = "erroring", e7._writableStoredError = t2, !(function(e8) { + return e8._writableHasInFlightOperation; + })(e7) && e7._writableStarted && Cr2(e7); } - /** - * Delete a fine-tuned model. You must have the Owner role in your organization to - * delete a model. - */ - del(model, options) { - return this._client.delete(`/models/${model}`, options); + function Cr2(e7) { + e7._writableState = "errored"; } - }; - exports2.Models = Models; - var ModelsPage = class extends pagination_1.Page { - }; - exports2.ModelsPage = ModelsPage; - Models.ModelsPage = ModelsPage; + function Pr(e7) { + "erroring" === e7._writableState && Cr2(e7); + } + Object.defineProperties(TransformStreamDefaultController.prototype, { enqueue: { enumerable: true }, error: { enumerable: true }, terminate: { enumerable: true }, desiredSize: { enumerable: true } }), a6(TransformStreamDefaultController.prototype.enqueue, "enqueue"), a6(TransformStreamDefaultController.prototype.error, "error"), a6(TransformStreamDefaultController.prototype.terminate, "terminate"), "symbol" == typeof t.toStringTag && Object.defineProperty(TransformStreamDefaultController.prototype, t.toStringTag, { value: "TransformStreamDefaultController", configurable: true }), e6.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy, e6.CountQueuingStrategy = CountQueuingStrategy, e6.ReadableByteStreamController = ReadableByteStreamController, e6.ReadableStream = ReadableStream2, e6.ReadableStreamBYOBReader = ReadableStreamBYOBReader, e6.ReadableStreamBYOBRequest = ReadableStreamBYOBRequest, e6.ReadableStreamDefaultController = ReadableStreamDefaultController, e6.ReadableStreamDefaultReader = ReadableStreamDefaultReader, e6.TransformStream = TransformStream2, e6.TransformStreamDefaultController = TransformStreamDefaultController, e6.WritableStream = WritableStream, e6.WritableStreamDefaultController = WritableStreamDefaultController, e6.WritableStreamDefaultWriter = WritableStreamDefaultWriter, Object.defineProperty(e6, "__esModule", { value: true }); + })); } }); -// node_modules/openai/resources/moderations.js -var require_moderations = __commonJS({ - "node_modules/openai/resources/moderations.js"(exports2) { +// node_modules/formdata-node/lib/cjs/isFunction.js +var require_isFunction2 = __commonJS({ + "node_modules/formdata-node/lib/cjs/isFunction.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Moderations = void 0; - var resource_1 = require_resource(); - var Moderations = class extends resource_1.APIResource { - /** - * Classifies if text and/or image inputs are potentially harmful. Learn more in - * the [moderation guide](https://platform.openai.com/docs/guides/moderation). - */ - create(body2, options) { - return this._client.post("/moderations", { body: body2, ...options }); - } - }; - exports2.Moderations = Moderations; + exports2.isFunction = void 0; + var isFunction3 = (value) => typeof value === "function"; + exports2.isFunction = isFunction3; } }); -// node_modules/openai/lib/ResponsesParser.js -var require_ResponsesParser = __commonJS({ - "node_modules/openai/lib/ResponsesParser.js"(exports2) { +// node_modules/formdata-node/lib/cjs/blobHelpers.js +var require_blobHelpers = __commonJS({ + "node_modules/formdata-node/lib/cjs/blobHelpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.addOutputText = exports2.validateInputTools = exports2.shouldParseToolCall = exports2.isAutoParsableTool = exports2.makeParseableResponseTool = exports2.hasAutoParseableInput = exports2.parseResponse = exports2.maybeParseResponse = void 0; - var error_1 = require_error2(); - var parser_1 = require_parser3(); - function maybeParseResponse(response, params) { - if (!params || !hasAutoParseableInput(params)) { - return { - ...response, - output_parsed: null, - output: response.output.map((item) => { - if (item.type === "function_call") { - return { - ...item, - parsed_arguments: null - }; - } - if (item.type === "message") { - return { - ...item, - content: item.content.map((content) => ({ - ...content, - parsed: null - })) - }; - } else { - return item; - } - }) - }; + exports2.sliceBlob = exports2.consumeBlobParts = void 0; + var isFunction_1 = require_isFunction2(); + var CHUNK_SIZE = 65536; + async function* clonePart(part) { + const end = part.byteOffset + part.byteLength; + let position = part.byteOffset; + while (position !== end) { + const size = Math.min(end - position, CHUNK_SIZE); + const chunk = part.buffer.slice(position, position + size); + position += chunk.byteLength; + yield new Uint8Array(chunk); } - return parseResponse(response, params); } - exports2.maybeParseResponse = maybeParseResponse; - function parseResponse(response, params) { - const output = response.output.map((item) => { - if (item.type === "function_call") { - return { - ...item, - parsed_arguments: parseToolCall(params, item) - }; - } - if (item.type === "message") { - const content = item.content.map((content2) => { - if (content2.type === "output_text") { - return { - ...content2, - parsed: parseTextFormat(params, content2.text) - }; - } - return content2; - }); - return { - ...item, - content - }; - } - return item; - }); - const parsed = Object.assign({}, response, { output }); - if (!Object.getOwnPropertyDescriptor(response, "output_text")) { - addOutputText(parsed); + async function* consumeNodeBlob(blob) { + let position = 0; + while (position !== blob.size) { + const chunk = blob.slice(position, Math.min(blob.size, position + CHUNK_SIZE)); + const buffer2 = await chunk.arrayBuffer(); + position += buffer2.byteLength; + yield new Uint8Array(buffer2); } - Object.defineProperty(parsed, "output_parsed", { - enumerable: true, - get() { - for (const output2 of parsed.output) { - if (output2.type !== "message") { - continue; - } - for (const content of output2.content) { - if (content.type === "output_text" && content.parsed !== null) { - return content.parsed; - } - } + } + async function* consumeBlobParts(parts, clone2 = false) { + for (const part of parts) { + if (ArrayBuffer.isView(part)) { + if (clone2) { + yield* clonePart(part); + } else { + yield part; } - return null; + } else if ((0, isFunction_1.isFunction)(part.stream)) { + yield* part.stream(); + } else { + yield* consumeNodeBlob(part); } - }); - return parsed; - } - exports2.parseResponse = parseResponse; - function parseTextFormat(params, content) { - if (params.text?.format?.type !== "json_schema") { - return null; - } - if ("$parseRaw" in params.text?.format) { - const text_format = params.text?.format; - return text_format.$parseRaw(content); - } - return JSON.parse(content); - } - function hasAutoParseableInput(params) { - if ((0, parser_1.isAutoParsableResponseFormat)(params.text?.format)) { - return true; } - return false; } - exports2.hasAutoParseableInput = hasAutoParseableInput; - function makeParseableResponseTool(tool, { parser: parser2, callback }) { - const obj = { ...tool }; - Object.defineProperties(obj, { - $brand: { - value: "auto-parseable-tool", - enumerable: false - }, - $parseRaw: { - value: parser2, - enumerable: false - }, - $callback: { - value: callback, - enumerable: false + exports2.consumeBlobParts = consumeBlobParts; + function* sliceBlob(blobParts, blobSize, start = 0, end) { + end !== null && end !== void 0 ? end : end = blobSize; + let relativeStart = start < 0 ? Math.max(blobSize + start, 0) : Math.min(start, blobSize); + let relativeEnd = end < 0 ? Math.max(blobSize + end, 0) : Math.min(end, blobSize); + const span = Math.max(relativeEnd - relativeStart, 0); + let added = 0; + for (const part of blobParts) { + if (added >= span) { + break; + } + const partSize = ArrayBuffer.isView(part) ? part.byteLength : part.size; + if (relativeStart && partSize <= relativeStart) { + relativeStart -= partSize; + relativeEnd -= partSize; + } else { + let chunk; + if (ArrayBuffer.isView(part)) { + chunk = part.subarray(relativeStart, Math.min(partSize, relativeEnd)); + added += chunk.byteLength; + } else { + chunk = part.slice(relativeStart, Math.min(partSize, relativeEnd)); + added += chunk.size; + } + relativeEnd -= partSize; + relativeStart = 0; + yield chunk; } - }); - return obj; - } - exports2.makeParseableResponseTool = makeParseableResponseTool; - function isAutoParsableTool(tool) { - return tool?.["$brand"] === "auto-parseable-tool"; - } - exports2.isAutoParsableTool = isAutoParsableTool; - function getInputToolByName(input_tools, name) { - return input_tools.find((tool) => tool.type === "function" && tool.name === name); - } - function parseToolCall(params, toolCall) { - const inputTool = getInputToolByName(params.tools ?? [], toolCall.name); - return { - ...toolCall, - ...toolCall, - parsed_arguments: isAutoParsableTool(inputTool) ? inputTool.$parseRaw(toolCall.arguments) : inputTool?.strict ? JSON.parse(toolCall.arguments) : null - }; - } - function shouldParseToolCall(params, toolCall) { - if (!params) { - return false; } - const inputTool = getInputToolByName(params.tools ?? [], toolCall.name); - return isAutoParsableTool(inputTool) || inputTool?.strict || false; } - exports2.shouldParseToolCall = shouldParseToolCall; - function validateInputTools(tools) { - for (const tool of tools ?? []) { - if (tool.type !== "function") { - throw new error_1.OpenAIError(`Currently only \`function\` tool types support auto-parsing; Received \`${tool.type}\``); + exports2.sliceBlob = sliceBlob; + } +}); + +// node_modules/formdata-node/lib/cjs/Blob.js +var require_Blob = __commonJS({ + "node_modules/formdata-node/lib/cjs/Blob.js"(exports2) { + "use strict"; + var __classPrivateFieldGet2 = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { + if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); + }; + var __classPrivateFieldSet2 = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; + }; + var _Blob_parts; + var _Blob_type; + var _Blob_size; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Blob = void 0; + var web_streams_polyfill_1 = require_ponyfill(); + var isFunction_1 = require_isFunction2(); + var blobHelpers_1 = require_blobHelpers(); + var Blob3 = class _Blob { + constructor(blobParts = [], options = {}) { + _Blob_parts.set(this, []); + _Blob_type.set(this, ""); + _Blob_size.set(this, 0); + options !== null && options !== void 0 ? options : options = {}; + if (typeof blobParts !== "object" || blobParts === null) { + throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence."); } - if (tool.function.strict !== true) { - throw new error_1.OpenAIError(`The \`${tool.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`); + if (!(0, isFunction_1.isFunction)(blobParts[Symbol.iterator])) { + throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property."); + } + if (typeof options !== "object" && !(0, isFunction_1.isFunction)(options)) { + throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary."); + } + const encoder = new TextEncoder(); + for (const raw of blobParts) { + let part; + if (ArrayBuffer.isView(raw)) { + part = new Uint8Array(raw.buffer.slice(raw.byteOffset, raw.byteOffset + raw.byteLength)); + } else if (raw instanceof ArrayBuffer) { + part = new Uint8Array(raw.slice(0)); + } else if (raw instanceof _Blob) { + part = raw; + } else { + part = encoder.encode(String(raw)); + } + __classPrivateFieldSet2(this, _Blob_size, __classPrivateFieldGet2(this, _Blob_size, "f") + (ArrayBuffer.isView(part) ? part.byteLength : part.size), "f"); + __classPrivateFieldGet2(this, _Blob_parts, "f").push(part); } + const type = options.type === void 0 ? "" : String(options.type); + __classPrivateFieldSet2(this, _Blob_type, /^[\x20-\x7E]*$/.test(type) ? type : "", "f"); + } + static [(_Blob_parts = /* @__PURE__ */ new WeakMap(), _Blob_type = /* @__PURE__ */ new WeakMap(), _Blob_size = /* @__PURE__ */ new WeakMap(), Symbol.hasInstance)](value) { + return Boolean(value && typeof value === "object" && (0, isFunction_1.isFunction)(value.constructor) && ((0, isFunction_1.isFunction)(value.stream) || (0, isFunction_1.isFunction)(value.arrayBuffer)) && /^(Blob|File)$/.test(value[Symbol.toStringTag])); + } + get type() { + return __classPrivateFieldGet2(this, _Blob_type, "f"); + } + get size() { + return __classPrivateFieldGet2(this, _Blob_size, "f"); + } + slice(start, end, contentType2) { + return new _Blob((0, blobHelpers_1.sliceBlob)(__classPrivateFieldGet2(this, _Blob_parts, "f"), this.size, start, end), { + type: contentType2 + }); } - } - exports2.validateInputTools = validateInputTools; - function addOutputText(rsp) { - const texts = []; - for (const output of rsp.output) { - if (output.type !== "message") { - continue; - } - for (const content of output.content) { - if (content.type === "output_text") { - texts.push(content.text); - } + async text() { + const decoder = new TextDecoder(); + let result = ""; + for await (const chunk of (0, blobHelpers_1.consumeBlobParts)(__classPrivateFieldGet2(this, _Blob_parts, "f"))) { + result += decoder.decode(chunk, { stream: true }); } + result += decoder.decode(); + return result; } - rsp.output_text = texts.join(""); - } - exports2.addOutputText = addOutputText; - } -}); - -// node_modules/openai/resources/responses/input-items.js -var require_input_items = __commonJS({ - "node_modules/openai/resources/responses/input-items.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ResponseItemsPage = exports2.InputItems = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var responses_1 = require_responses(); - Object.defineProperty(exports2, "ResponseItemsPage", { enumerable: true, get: function() { - return responses_1.ResponseItemsPage; - } }); - var InputItems = class extends resource_1.APIResource { - list(responseId, query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list(responseId, {}, query); + async arrayBuffer() { + const view = new Uint8Array(this.size); + let offset = 0; + for await (const chunk of (0, blobHelpers_1.consumeBlobParts)(__classPrivateFieldGet2(this, _Blob_parts, "f"))) { + view.set(chunk, offset); + offset += chunk.length; } - return this._client.getAPIList(`/responses/${responseId}/input_items`, responses_1.ResponseItemsPage, { - query, - ...options + return view.buffer; + } + stream() { + const iterator2 = (0, blobHelpers_1.consumeBlobParts)(__classPrivateFieldGet2(this, _Blob_parts, "f"), true); + return new web_streams_polyfill_1.ReadableStream({ + async pull(controller) { + const { value, done } = await iterator2.next(); + if (done) { + return queueMicrotask(() => controller.close()); + } + controller.enqueue(value); + }, + async cancel() { + await iterator2.return(); + } }); } + get [Symbol.toStringTag]() { + return "Blob"; + } }; - exports2.InputItems = InputItems; + exports2.Blob = Blob3; + Object.defineProperties(Blob3.prototype, { + type: { enumerable: true }, + size: { enumerable: true }, + slice: { enumerable: true }, + stream: { enumerable: true }, + text: { enumerable: true }, + arrayBuffer: { enumerable: true } + }); } }); -// node_modules/openai/lib/responses/ResponseStream.js -var require_ResponseStream = __commonJS({ - "node_modules/openai/lib/responses/ResponseStream.js"(exports2) { +// node_modules/formdata-node/lib/cjs/File.js +var require_File = __commonJS({ + "node_modules/formdata-node/lib/cjs/File.js"(exports2) { "use strict"; - var __classPrivateFieldSet = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { + var __classPrivateFieldSet2 = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; }; - var __classPrivateFieldGet = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { + var __classPrivateFieldGet2 = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); }; - var _ResponseStream_instances; - var _ResponseStream_params; - var _ResponseStream_currentResponseSnapshot; - var _ResponseStream_finalResponse; - var _ResponseStream_beginRequest; - var _ResponseStream_addEvent; - var _ResponseStream_endRequest; - var _ResponseStream_accumulateResponse; + var _File_name; + var _File_lastModified; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ResponseStream = void 0; - var error_1 = require_error2(); - var EventStream_1 = require_EventStream(); - var ResponsesParser_1 = require_ResponsesParser(); - var ResponseStream = class _ResponseStream extends EventStream_1.EventStream { - constructor(params) { - super(); - _ResponseStream_instances.add(this); - _ResponseStream_params.set(this, void 0); - _ResponseStream_currentResponseSnapshot.set(this, void 0); - _ResponseStream_finalResponse.set(this, void 0); - __classPrivateFieldSet(this, _ResponseStream_params, params, "f"); + exports2.File = void 0; + var Blob_1 = require_Blob(); + var File2 = class extends Blob_1.Blob { + constructor(fileBits, name, options = {}) { + super(fileBits, options); + _File_name.set(this, void 0); + _File_lastModified.set(this, 0); + if (arguments.length < 2) { + throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`); + } + __classPrivateFieldSet2(this, _File_name, String(name), "f"); + const lastModified = options.lastModified === void 0 ? Date.now() : Number(options.lastModified); + if (!Number.isNaN(lastModified)) { + __classPrivateFieldSet2(this, _File_lastModified, lastModified, "f"); + } } - static createResponse(client2, params, options) { - const runner = new _ResponseStream(params); - runner._run(() => runner._createOrRetrieveResponse(client2, params, { - ...options, - headers: { ...options?.headers, "X-Stainless-Helper-Method": "stream" } - })); - return runner; + static [(_File_name = /* @__PURE__ */ new WeakMap(), _File_lastModified = /* @__PURE__ */ new WeakMap(), Symbol.hasInstance)](value) { + return value instanceof Blob_1.Blob && value[Symbol.toStringTag] === "File" && typeof value.name === "string"; } - async _createOrRetrieveResponse(client2, params, options) { - const signal = options?.signal; - if (signal) { - if (signal.aborted) - this.controller.abort(); - signal.addEventListener("abort", () => this.controller.abort()); + get name() { + return __classPrivateFieldGet2(this, _File_name, "f"); + } + get lastModified() { + return __classPrivateFieldGet2(this, _File_lastModified, "f"); + } + get webkitRelativePath() { + return ""; + } + get [Symbol.toStringTag]() { + return "File"; + } + }; + exports2.File = File2; + } +}); + +// node_modules/formdata-node/lib/cjs/isFile.js +var require_isFile = __commonJS({ + "node_modules/formdata-node/lib/cjs/isFile.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isFile = void 0; + var File_1 = require_File(); + var isFile = (value) => value instanceof File_1.File; + exports2.isFile = isFile; + } +}); + +// node_modules/formdata-node/lib/cjs/isBlob.js +var require_isBlob = __commonJS({ + "node_modules/formdata-node/lib/cjs/isBlob.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isBlob = void 0; + var Blob_1 = require_Blob(); + var isBlob3 = (value) => value instanceof Blob_1.Blob; + exports2.isBlob = isBlob3; + } +}); + +// node_modules/formdata-node/lib/cjs/deprecateConstructorEntries.js +var require_deprecateConstructorEntries = __commonJS({ + "node_modules/formdata-node/lib/cjs/deprecateConstructorEntries.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.deprecateConstructorEntries = void 0; + var util_1 = __require("util"); + exports2.deprecateConstructorEntries = (0, util_1.deprecate)(() => { + }, 'Constructor "entries" argument is not spec-compliant and will be removed in next major release.'); + } +}); + +// node_modules/formdata-node/lib/cjs/FormData.js +var require_FormData = __commonJS({ + "node_modules/formdata-node/lib/cjs/FormData.js"(exports2) { + "use strict"; + var __classPrivateFieldGet2 = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { + if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); + }; + var _FormData_instances; + var _FormData_entries; + var _FormData_setEntry; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.FormData = void 0; + var util_1 = __require("util"); + var File_1 = require_File(); + var isFile_1 = require_isFile(); + var isBlob_1 = require_isBlob(); + var isFunction_1 = require_isFunction2(); + var deprecateConstructorEntries_1 = require_deprecateConstructorEntries(); + var FormData2 = class { + constructor(entries) { + _FormData_instances.add(this); + _FormData_entries.set(this, /* @__PURE__ */ new Map()); + if (entries) { + (0, deprecateConstructorEntries_1.deprecateConstructorEntries)(); + entries.forEach(({ name, value, fileName }) => this.append(name, value, fileName)); } - __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_beginRequest).call(this); - let stream5; - let starting_after = null; - if ("response_id" in params) { - stream5 = await client2.responses.retrieve(params.response_id, { stream: true }, { ...options, signal: this.controller.signal, stream: true }); - starting_after = params.starting_after ?? null; - } else { - stream5 = await client2.responses.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }); + } + static [(_FormData_entries = /* @__PURE__ */ new WeakMap(), _FormData_instances = /* @__PURE__ */ new WeakSet(), Symbol.hasInstance)](value) { + return Boolean(value && (0, isFunction_1.isFunction)(value.constructor) && value[Symbol.toStringTag] === "FormData" && (0, isFunction_1.isFunction)(value.append) && (0, isFunction_1.isFunction)(value.set) && (0, isFunction_1.isFunction)(value.get) && (0, isFunction_1.isFunction)(value.getAll) && (0, isFunction_1.isFunction)(value.has) && (0, isFunction_1.isFunction)(value.delete) && (0, isFunction_1.isFunction)(value.entries) && (0, isFunction_1.isFunction)(value.values) && (0, isFunction_1.isFunction)(value.keys) && (0, isFunction_1.isFunction)(value[Symbol.iterator]) && (0, isFunction_1.isFunction)(value.forEach)); + } + append(name, value, fileName) { + __classPrivateFieldGet2(this, _FormData_instances, "m", _FormData_setEntry).call(this, { + name, + fileName, + append: true, + rawValue: value, + argsLength: arguments.length + }); + } + set(name, value, fileName) { + __classPrivateFieldGet2(this, _FormData_instances, "m", _FormData_setEntry).call(this, { + name, + fileName, + append: false, + rawValue: value, + argsLength: arguments.length + }); + } + get(name) { + const field = __classPrivateFieldGet2(this, _FormData_entries, "f").get(String(name)); + if (!field) { + return null; } - this._connected(); - for await (const event of stream5) { - __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_addEvent).call(this, event, starting_after); + return field[0]; + } + getAll(name) { + const field = __classPrivateFieldGet2(this, _FormData_entries, "f").get(String(name)); + if (!field) { + return []; } - if (stream5.controller.signal?.aborted) { - throw new error_1.APIUserAbortError(); + return field.slice(); + } + has(name) { + return __classPrivateFieldGet2(this, _FormData_entries, "f").has(String(name)); + } + delete(name) { + __classPrivateFieldGet2(this, _FormData_entries, "f").delete(String(name)); + } + *keys() { + for (const key of __classPrivateFieldGet2(this, _FormData_entries, "f").keys()) { + yield key; } - return __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this); } - [(_ResponseStream_params = /* @__PURE__ */ new WeakMap(), _ResponseStream_currentResponseSnapshot = /* @__PURE__ */ new WeakMap(), _ResponseStream_finalResponse = /* @__PURE__ */ new WeakMap(), _ResponseStream_instances = /* @__PURE__ */ new WeakSet(), _ResponseStream_beginRequest = function _ResponseStream_beginRequest2() { - if (this.ended) - return; - __classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, void 0, "f"); - }, _ResponseStream_addEvent = function _ResponseStream_addEvent2(event, starting_after) { - if (this.ended) - return; - const maybeEmit = (name, event2) => { - if (starting_after == null || event2.sequence_number > starting_after) { - this._emit(name, event2); - } - }; - const response = __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_accumulateResponse).call(this, event); - maybeEmit("event", event); - switch (event.type) { - case "response.output_text.delta": { - const output = response.output[event.output_index]; - if (!output) { - throw new error_1.OpenAIError(`missing output at index ${event.output_index}`); - } - if (output.type === "message") { - const content = output.content[event.content_index]; - if (!content) { - throw new error_1.OpenAIError(`missing content at index ${event.content_index}`); - } - if (content.type !== "output_text") { - throw new error_1.OpenAIError(`expected content to be 'output_text', got ${content.type}`); - } - maybeEmit("response.output_text.delta", { - ...event, - snapshot: content.text - }); - } - break; - } - case "response.function_call_arguments.delta": { - const output = response.output[event.output_index]; - if (!output) { - throw new error_1.OpenAIError(`missing output at index ${event.output_index}`); - } - if (output.type === "function_call") { - maybeEmit("response.function_call_arguments.delta", { - ...event, - snapshot: output.arguments - }); - } - break; + *entries() { + for (const name of this.keys()) { + const values = this.getAll(name); + for (const value of values) { + yield [name, value]; } - default: - maybeEmit(event.type, event); - break; } - }, _ResponseStream_endRequest = function _ResponseStream_endRequest2() { - if (this.ended) { - throw new error_1.OpenAIError(`stream has ended, this shouldn't happen`); + } + *values() { + for (const [, value] of this) { + yield value; } - const snapshot2 = __classPrivateFieldGet(this, _ResponseStream_currentResponseSnapshot, "f"); - if (!snapshot2) { - throw new error_1.OpenAIError(`request ended without sending any events`); + } + [(_FormData_setEntry = function _FormData_setEntry2({ name, rawValue, append, fileName, argsLength }) { + const methodName = append ? "append" : "set"; + if (argsLength < 2) { + throw new TypeError(`Failed to execute '${methodName}' on 'FormData': 2 arguments required, but only ${argsLength} present.`); } - __classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, void 0, "f"); - const parsedResponse = finalizeResponse(snapshot2, __classPrivateFieldGet(this, _ResponseStream_params, "f")); - __classPrivateFieldSet(this, _ResponseStream_finalResponse, parsedResponse, "f"); - return parsedResponse; - }, _ResponseStream_accumulateResponse = function _ResponseStream_accumulateResponse2(event) { - let snapshot2 = __classPrivateFieldGet(this, _ResponseStream_currentResponseSnapshot, "f"); - if (!snapshot2) { - if (event.type !== "response.created") { - throw new error_1.OpenAIError(`When snapshot hasn't been set yet, expected 'response.created' event, got ${event.type}`); - } - snapshot2 = __classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, event.response, "f"); - return snapshot2; + name = String(name); + let value; + if ((0, isFile_1.isFile)(rawValue)) { + value = fileName === void 0 ? rawValue : new File_1.File([rawValue], fileName, { + type: rawValue.type, + lastModified: rawValue.lastModified + }); + } else if ((0, isBlob_1.isBlob)(rawValue)) { + value = new File_1.File([rawValue], fileName === void 0 ? "blob" : fileName, { + type: rawValue.type + }); + } else if (fileName) { + throw new TypeError(`Failed to execute '${methodName}' on 'FormData': parameter 2 is not of type 'Blob'.`); + } else { + value = String(rawValue); } - switch (event.type) { - case "response.output_item.added": { - snapshot2.output.push(event.item); - break; - } - case "response.content_part.added": { - const output = snapshot2.output[event.output_index]; - if (!output) { - throw new error_1.OpenAIError(`missing output at index ${event.output_index}`); - } - if (output.type === "message") { - output.content.push(event.part); - } - break; - } - case "response.output_text.delta": { - const output = snapshot2.output[event.output_index]; - if (!output) { - throw new error_1.OpenAIError(`missing output at index ${event.output_index}`); - } - if (output.type === "message") { - const content = output.content[event.content_index]; - if (!content) { - throw new error_1.OpenAIError(`missing content at index ${event.content_index}`); - } - if (content.type !== "output_text") { - throw new error_1.OpenAIError(`expected content to be 'output_text', got ${content.type}`); - } - content.text += event.delta; - } - break; - } - case "response.function_call_arguments.delta": { - const output = snapshot2.output[event.output_index]; - if (!output) { - throw new error_1.OpenAIError(`missing output at index ${event.output_index}`); - } - if (output.type === "function_call") { - output.arguments += event.delta; - } - break; - } - case "response.completed": { - __classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, event.response, "f"); - break; - } + const values = __classPrivateFieldGet2(this, _FormData_entries, "f").get(name); + if (!values) { + return void __classPrivateFieldGet2(this, _FormData_entries, "f").set(name, [value]); } - return snapshot2; - }, Symbol.asyncIterator)]() { - const pushQueue = []; - const readQueue = []; - let done = false; - this.on("event", (event) => { - const reader = readQueue.shift(); - if (reader) { - reader.resolve(event); - } else { - pushQueue.push(event); - } - }); - this.on("end", () => { - done = true; - for (const reader of readQueue) { - reader.resolve(void 0); - } - readQueue.length = 0; - }); - this.on("abort", (err) => { - done = true; - for (const reader of readQueue) { - reader.reject(err); - } - readQueue.length = 0; - }); - this.on("error", (err) => { - done = true; - for (const reader of readQueue) { - reader.reject(err); - } - readQueue.length = 0; - }); - return { - next: async () => { - if (!pushQueue.length) { - if (done) { - return { value: void 0, done: true }; - } - return new Promise((resolve4, reject2) => readQueue.push({ resolve: resolve4, reject: reject2 })).then((event2) => event2 ? { value: event2, done: false } : { value: void 0, done: true }); - } - const event = pushQueue.shift(); - return { value: event, done: false }; - }, - return: async () => { - this.abort(); - return { value: void 0, done: true }; - } - }; + if (!append) { + return void __classPrivateFieldGet2(this, _FormData_entries, "f").set(name, [value]); + } + values.push(value); + }, Symbol.iterator)]() { + return this.entries(); } - /** - * @returns a promise that resolves with the final Response, or rejects - * if an error occurred or the stream ended prematurely without producing a REsponse. - */ - async finalResponse() { - await this.done(); - const response = __classPrivateFieldGet(this, _ResponseStream_finalResponse, "f"); - if (!response) - throw new error_1.OpenAIError("stream ended without producing a ChatCompletion"); - return response; + forEach(callback, thisArg) { + for (const [name, value] of this) { + callback.call(thisArg, value, name, this); + } + } + get [Symbol.toStringTag]() { + return "FormData"; + } + [util_1.inspect.custom]() { + return this[Symbol.toStringTag]; } }; - exports2.ResponseStream = ResponseStream; - function finalizeResponse(snapshot2, params) { - return (0, ResponsesParser_1.maybeParseResponse)(snapshot2, params); - } + exports2.FormData = FormData2; } }); -// node_modules/openai/resources/responses/responses.js -var require_responses = __commonJS({ - "node_modules/openai/resources/responses/responses.js"(exports2) { +// node_modules/formdata-node/lib/cjs/index.js +var require_cjs = __commonJS({ + "node_modules/formdata-node/lib/cjs/index.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; - } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k7]; + } }); + }) : (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; + o2[k22] = m3[k7]; })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); - } - __setModuleDefault(result, mod); - return result; + var __exportStar = exports2 && exports2.__exportStar || function(m3, exports3) { + for (var p2 in m3) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p2)) __createBinding(exports3, m3, p2); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ResponseItemsPage = exports2.Responses = void 0; - var ResponsesParser_1 = require_ResponsesParser(); - var resource_1 = require_resource(); - var InputItemsAPI = __importStar(require_input_items()); - var input_items_1 = require_input_items(); - var ResponseStream_1 = require_ResponseStream(); - var pagination_1 = require_pagination(); - var Responses = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.inputItems = new InputItemsAPI.InputItems(this._client); + __exportStar(require_FormData(), exports2); + __exportStar(require_Blob(), exports2); + __exportStar(require_File(), exports2); + } +}); + +// node_modules/humanize-ms/index.js +var require_humanize_ms = __commonJS({ + "node_modules/humanize-ms/index.js"(exports2, module) { + "use strict"; + var util3 = __require("util"); + var ms2 = require_ms(); + module.exports = function(t) { + if (typeof t === "number") return t; + var r6 = ms2(t); + if (r6 === void 0) { + var err = new Error(util3.format("humanize-ms(%j) result undefined", t)); + console.warn(err.stack); } - create(body2, options) { - return this._client.post("/responses", { body: body2, ...options, stream: body2.stream ?? false })._thenUnwrap((rsp) => { - if ("object" in rsp && rsp.object === "response") { - (0, ResponsesParser_1.addOutputText)(rsp); + return r6; + }; + } +}); + +// node_modules/agentkeepalive/lib/constants.js +var require_constants10 = __commonJS({ + "node_modules/agentkeepalive/lib/constants.js"(exports2, module) { + "use strict"; + module.exports = { + // agent + CURRENT_ID: /* @__PURE__ */ Symbol("agentkeepalive#currentId"), + CREATE_ID: /* @__PURE__ */ Symbol("agentkeepalive#createId"), + INIT_SOCKET: /* @__PURE__ */ Symbol("agentkeepalive#initSocket"), + CREATE_HTTPS_CONNECTION: /* @__PURE__ */ Symbol("agentkeepalive#createHttpsConnection"), + // socket + SOCKET_CREATED_TIME: /* @__PURE__ */ Symbol("agentkeepalive#socketCreatedTime"), + SOCKET_NAME: /* @__PURE__ */ Symbol("agentkeepalive#socketName"), + SOCKET_REQUEST_COUNT: /* @__PURE__ */ Symbol("agentkeepalive#socketRequestCount"), + SOCKET_REQUEST_FINISHED_COUNT: /* @__PURE__ */ Symbol("agentkeepalive#socketRequestFinishedCount") + }; + } +}); + +// node_modules/agentkeepalive/lib/agent.js +var require_agent2 = __commonJS({ + "node_modules/agentkeepalive/lib/agent.js"(exports2, module) { + "use strict"; + var OriginalAgent = __require("http").Agent; + var ms2 = require_humanize_ms(); + var debug2 = __require("util").debuglog("agentkeepalive"); + var { + INIT_SOCKET, + CURRENT_ID, + CREATE_ID, + SOCKET_CREATED_TIME, + SOCKET_NAME, + SOCKET_REQUEST_COUNT, + SOCKET_REQUEST_FINISHED_COUNT + } = require_constants10(); + var defaultTimeoutListenerCount = 1; + var majorVersion = parseInt(process.version.split(".", 1)[0].substring(1)); + if (majorVersion >= 11 && majorVersion <= 12) { + defaultTimeoutListenerCount = 2; + } else if (majorVersion >= 13) { + defaultTimeoutListenerCount = 3; + } + function deprecate(message) { + console.log("[agentkeepalive:deprecated] %s", message); + } + var Agent3 = class extends OriginalAgent { + constructor(options) { + options = options || {}; + options.keepAlive = options.keepAlive !== false; + if (options.freeSocketTimeout === void 0) { + options.freeSocketTimeout = 4e3; + } + if (options.keepAliveTimeout) { + deprecate("options.keepAliveTimeout is deprecated, please use options.freeSocketTimeout instead"); + options.freeSocketTimeout = options.keepAliveTimeout; + delete options.keepAliveTimeout; + } + if (options.freeSocketKeepAliveTimeout) { + deprecate("options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead"); + options.freeSocketTimeout = options.freeSocketKeepAliveTimeout; + delete options.freeSocketKeepAliveTimeout; + } + if (options.timeout === void 0) { + options.timeout = Math.max(options.freeSocketTimeout * 2, 8e3); + } + options.timeout = ms2(options.timeout); + options.freeSocketTimeout = ms2(options.freeSocketTimeout); + options.socketActiveTTL = options.socketActiveTTL ? ms2(options.socketActiveTTL) : 0; + super(options); + this[CURRENT_ID] = 0; + this.createSocketCount = 0; + this.createSocketCountLastCheck = 0; + this.createSocketErrorCount = 0; + this.createSocketErrorCountLastCheck = 0; + this.closeSocketCount = 0; + this.closeSocketCountLastCheck = 0; + this.errorSocketCount = 0; + this.errorSocketCountLastCheck = 0; + this.requestCount = 0; + this.requestCountLastCheck = 0; + this.timeoutSocketCount = 0; + this.timeoutSocketCountLastCheck = 0; + this.on("free", (socket) => { + const timeout2 = this.calcSocketTimeout(socket); + if (timeout2 > 0 && socket.timeout !== timeout2) { + socket.setTimeout(timeout2); } - return rsp; }); } - retrieve(responseId, query = {}, options) { - return this._client.get(`/responses/${responseId}`, { - query, - ...options, - stream: query?.stream ?? false - }); + get freeSocketKeepAliveTimeout() { + deprecate("agent.freeSocketKeepAliveTimeout is deprecated, please use agent.options.freeSocketTimeout instead"); + return this.options.freeSocketTimeout; } - /** - * Deletes a model response with the given ID. - * - * @example - * ```ts - * await client.responses.del( - * 'resp_677efb5139a88190b512bc3fef8e535d', - * ); - * ``` - */ - del(responseId, options) { - return this._client.delete(`/responses/${responseId}`, { - ...options, - headers: { Accept: "*/*", ...options?.headers } - }); + get timeout() { + deprecate("agent.timeout is deprecated, please use agent.options.timeout instead"); + return this.options.timeout; } - parse(body2, options) { - return this._client.responses.create(body2, options)._thenUnwrap((response) => (0, ResponsesParser_1.parseResponse)(response, body2)); + get socketActiveTTL() { + deprecate("agent.socketActiveTTL is deprecated, please use agent.options.socketActiveTTL instead"); + return this.options.socketActiveTTL; } - /** - * Creates a model response stream - */ - stream(body2, options) { - return ResponseStream_1.ResponseStream.createResponse(this._client, body2, options); + calcSocketTimeout(socket) { + let freeSocketTimeout = this.options.freeSocketTimeout; + const socketActiveTTL = this.options.socketActiveTTL; + if (socketActiveTTL) { + const aliveTime = Date.now() - socket[SOCKET_CREATED_TIME]; + const diff = socketActiveTTL - aliveTime; + if (diff <= 0) { + return diff; + } + if (freeSocketTimeout && diff < freeSocketTimeout) { + freeSocketTimeout = diff; + } + } + if (freeSocketTimeout) { + const customFreeSocketTimeout = socket.freeSocketTimeout || socket.freeSocketKeepAliveTimeout; + return customFreeSocketTimeout || freeSocketTimeout; + } } - /** - * Cancels a model response with the given ID. Only responses created with the - * `background` parameter set to `true` can be cancelled. - * [Learn more](https://platform.openai.com/docs/guides/background). - * - * @example - * ```ts - * await client.responses.cancel( - * 'resp_677efb5139a88190b512bc3fef8e535d', - * ); - * ``` - */ - cancel(responseId, options) { - return this._client.post(`/responses/${responseId}/cancel`, { - ...options, - headers: { Accept: "*/*", ...options?.headers } - }); + keepSocketAlive(socket) { + const result = super.keepSocketAlive(socket); + if (!result) return result; + const customTimeout = this.calcSocketTimeout(socket); + if (typeof customTimeout === "undefined") { + return true; + } + if (customTimeout <= 0) { + debug2( + "%s(requests: %s, finished: %s) free but need to destroy by TTL, request count %s, diff is %s", + socket[SOCKET_NAME], + socket[SOCKET_REQUEST_COUNT], + socket[SOCKET_REQUEST_FINISHED_COUNT], + customTimeout + ); + return false; + } + if (socket.timeout !== customTimeout) { + socket.setTimeout(customTimeout); + } + return true; } - }; - exports2.Responses = Responses; - var ResponseItemsPage = class extends pagination_1.CursorPage { - }; - exports2.ResponseItemsPage = ResponseItemsPage; - Responses.InputItems = input_items_1.InputItems; - } -}); - -// node_modules/openai/resources/uploads/parts.js -var require_parts = __commonJS({ - "node_modules/openai/resources/uploads/parts.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + // only call on addRequest + reuseSocket(...args) { + super.reuseSocket(...args); + const socket = args[0]; + const req = args[1]; + req.reusedSocket = true; + const agentTimeout = this.options.timeout; + if (getSocketTimeout(socket) !== agentTimeout) { + socket.setTimeout(agentTimeout); + debug2("%s reset timeout to %sms", socket[SOCKET_NAME], agentTimeout); + } + socket[SOCKET_REQUEST_COUNT]++; + debug2( + "%s(requests: %s, finished: %s) reuse on addRequest, timeout %sms", + socket[SOCKET_NAME], + socket[SOCKET_REQUEST_COUNT], + socket[SOCKET_REQUEST_FINISHED_COUNT], + getSocketTimeout(socket) + ); } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + [CREATE_ID]() { + const id = this[CURRENT_ID]++; + if (this[CURRENT_ID] === Number.MAX_SAFE_INTEGER) this[CURRENT_ID] = 0; + return id; } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Parts = void 0; - var resource_1 = require_resource(); - var Core = __importStar(require_core2()); - var Parts = class extends resource_1.APIResource { - /** - * Adds a - * [Part](https://platform.openai.com/docs/api-reference/uploads/part-object) to an - * [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object. - * A Part represents a chunk of bytes from the file you are trying to upload. - * - * Each Part can be at most 64 MB, and you can add Parts until you hit the Upload - * maximum of 8 GB. - * - * It is possible to add multiple Parts in parallel. You can decide the intended - * order of the Parts when you - * [complete the Upload](https://platform.openai.com/docs/api-reference/uploads/complete). - */ - create(uploadId, body2, options) { - return this._client.post(`/uploads/${uploadId}/parts`, Core.multipartFormRequestOptions({ body: body2, ...options })); + [INIT_SOCKET](socket, options) { + if (options.timeout) { + const timeout2 = getSocketTimeout(socket); + if (!timeout2) { + socket.setTimeout(options.timeout); + } + } + if (this.options.keepAlive) { + socket.setNoDelay(true); + } + this.createSocketCount++; + if (this.options.socketActiveTTL) { + socket[SOCKET_CREATED_TIME] = Date.now(); + } + socket[SOCKET_NAME] = `sock[${this[CREATE_ID]()}#${options._agentKey}]`.split("-----BEGIN", 1)[0]; + socket[SOCKET_REQUEST_COUNT] = 1; + socket[SOCKET_REQUEST_FINISHED_COUNT] = 0; + installListeners(this, socket, options); + } + createConnection(options, oncreate) { + let called = false; + const onNewCreate = (err, socket) => { + if (called) return; + called = true; + if (err) { + this.createSocketErrorCount++; + return oncreate(err); + } + this[INIT_SOCKET](socket, options); + oncreate(err, socket); + }; + const newSocket = super.createConnection(options, onNewCreate); + if (newSocket) onNewCreate(null, newSocket); + return newSocket; + } + get statusChanged() { + const changed = this.createSocketCount !== this.createSocketCountLastCheck || this.createSocketErrorCount !== this.createSocketErrorCountLastCheck || this.closeSocketCount !== this.closeSocketCountLastCheck || this.errorSocketCount !== this.errorSocketCountLastCheck || this.timeoutSocketCount !== this.timeoutSocketCountLastCheck || this.requestCount !== this.requestCountLastCheck; + if (changed) { + this.createSocketCountLastCheck = this.createSocketCount; + this.createSocketErrorCountLastCheck = this.createSocketErrorCount; + this.closeSocketCountLastCheck = this.closeSocketCount; + this.errorSocketCountLastCheck = this.errorSocketCount; + this.timeoutSocketCountLastCheck = this.timeoutSocketCount; + this.requestCountLastCheck = this.requestCount; + } + return changed; + } + getCurrentStatus() { + return { + createSocketCount: this.createSocketCount, + createSocketErrorCount: this.createSocketErrorCount, + closeSocketCount: this.closeSocketCount, + errorSocketCount: this.errorSocketCount, + timeoutSocketCount: this.timeoutSocketCount, + requestCount: this.requestCount, + freeSockets: inspect3(this.freeSockets), + sockets: inspect3(this.sockets), + requests: inspect3(this.requests) + }; } }; - exports2.Parts = Parts; + function getSocketTimeout(socket) { + return socket.timeout || socket._idleTimeout; + } + function installListeners(agent, socket, options) { + debug2("%s create, timeout %sms", socket[SOCKET_NAME], getSocketTimeout(socket)); + function onFree() { + if (!socket._httpMessage && socket[SOCKET_REQUEST_COUNT] === 1) return; + socket[SOCKET_REQUEST_FINISHED_COUNT]++; + agent.requestCount++; + debug2( + "%s(requests: %s, finished: %s) free", + socket[SOCKET_NAME], + socket[SOCKET_REQUEST_COUNT], + socket[SOCKET_REQUEST_FINISHED_COUNT] + ); + const name = agent.getName(options); + if (socket.writable && agent.requests[name] && agent.requests[name].length) { + socket[SOCKET_REQUEST_COUNT]++; + debug2( + "%s(requests: %s, finished: %s) will be reuse on agent free event", + socket[SOCKET_NAME], + socket[SOCKET_REQUEST_COUNT], + socket[SOCKET_REQUEST_FINISHED_COUNT] + ); + } + } + socket.on("free", onFree); + function onClose(isError3) { + debug2( + "%s(requests: %s, finished: %s) close, isError: %s", + socket[SOCKET_NAME], + socket[SOCKET_REQUEST_COUNT], + socket[SOCKET_REQUEST_FINISHED_COUNT], + isError3 + ); + agent.closeSocketCount++; + } + socket.on("close", onClose); + function onTimeout() { + const listenerCount = socket.listeners("timeout").length; + const timeout2 = getSocketTimeout(socket); + const req = socket._httpMessage; + const reqTimeoutListenerCount = req && req.listeners("timeout").length || 0; + debug2( + "%s(requests: %s, finished: %s) timeout after %sms, listeners %s, defaultTimeoutListenerCount %s, hasHttpRequest %s, HttpRequest timeoutListenerCount %s", + socket[SOCKET_NAME], + socket[SOCKET_REQUEST_COUNT], + socket[SOCKET_REQUEST_FINISHED_COUNT], + timeout2, + listenerCount, + defaultTimeoutListenerCount, + !!req, + reqTimeoutListenerCount + ); + if (debug2.enabled) { + debug2("timeout listeners: %s", socket.listeners("timeout").map((f6) => f6.name).join(", ")); + } + agent.timeoutSocketCount++; + const name = agent.getName(options); + if (agent.freeSockets[name] && agent.freeSockets[name].indexOf(socket) !== -1) { + socket.destroy(); + agent.removeSocket(socket, options); + debug2("%s is free, destroy quietly", socket[SOCKET_NAME]); + } else { + if (reqTimeoutListenerCount === 0) { + const error2 = new Error("Socket timeout"); + error2.code = "ERR_SOCKET_TIMEOUT"; + error2.timeout = timeout2; + socket.destroy(error2); + agent.removeSocket(socket, options); + debug2("%s destroy with timeout error", socket[SOCKET_NAME]); + } + } + } + socket.on("timeout", onTimeout); + function onError(err) { + const listenerCount = socket.listeners("error").length; + debug2( + "%s(requests: %s, finished: %s) error: %s, listenerCount: %s", + socket[SOCKET_NAME], + socket[SOCKET_REQUEST_COUNT], + socket[SOCKET_REQUEST_FINISHED_COUNT], + err, + listenerCount + ); + agent.errorSocketCount++; + if (listenerCount === 1) { + debug2("%s emit uncaught error event", socket[SOCKET_NAME]); + socket.removeListener("error", onError); + socket.emit("error", err); + } + } + socket.on("error", onError); + function onRemove() { + debug2( + "%s(requests: %s, finished: %s) agentRemove", + socket[SOCKET_NAME], + socket[SOCKET_REQUEST_COUNT], + socket[SOCKET_REQUEST_FINISHED_COUNT] + ); + socket.removeListener("close", onClose); + socket.removeListener("error", onError); + socket.removeListener("free", onFree); + socket.removeListener("timeout", onTimeout); + socket.removeListener("agentRemove", onRemove); + } + socket.on("agentRemove", onRemove); + } + module.exports = Agent3; + function inspect3(obj) { + const res = {}; + for (const key in obj) { + res[key] = obj[key].length; + } + return res; + } } }); -// node_modules/openai/resources/uploads/uploads.js -var require_uploads2 = __commonJS({ - "node_modules/openai/resources/uploads/uploads.js"(exports2) { +// node_modules/agentkeepalive/lib/https_agent.js +var require_https_agent = __commonJS({ + "node_modules/agentkeepalive/lib/https_agent.js"(exports2, module) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; + var OriginalHttpsAgent = __require("https").Agent; + var HttpAgent = require_agent2(); + var { + INIT_SOCKET, + CREATE_HTTPS_CONNECTION + } = require_constants10(); + var HttpsAgent = class extends HttpAgent { + constructor(options) { + super(options); + this.defaultPort = 443; + this.protocol = "https:"; + this.maxCachedSessions = this.options.maxCachedSessions; + if (this.maxCachedSessions === void 0) { + this.maxCachedSessions = 100; + } + this._sessionCache = { + map: {}, + list: [] + }; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); + createConnection(options, oncreate) { + const socket = this[CREATE_HTTPS_CONNECTION](options, oncreate); + this[INIT_SOCKET](socket, options); + return socket; } - __setModuleDefault(result, mod); - return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Uploads = void 0; - var resource_1 = require_resource(); - var PartsAPI = __importStar(require_parts()); - var parts_1 = require_parts(); - var Uploads = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.parts = new PartsAPI.Parts(this._client); - } - /** - * Creates an intermediate - * [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object - * that you can add - * [Parts](https://platform.openai.com/docs/api-reference/uploads/part-object) to. - * Currently, an Upload can accept at most 8 GB in total and expires after an hour - * after you create it. - * - * Once you complete the Upload, we will create a - * [File](https://platform.openai.com/docs/api-reference/files/object) object that - * contains all the parts you uploaded. This File is usable in the rest of our - * platform as a regular File object. - * - * For certain `purpose` values, the correct `mime_type` must be specified. Please - * refer to documentation for the - * [supported MIME types for your use case](https://platform.openai.com/docs/assistants/tools/file-search#supported-files). - * - * For guidance on the proper filename extensions for each purpose, please follow - * the documentation on - * [creating a File](https://platform.openai.com/docs/api-reference/files/create). - */ - create(body2, options) { - return this._client.post("/uploads", { body: body2, ...options }); - } - /** - * Cancels the Upload. No Parts may be added after an Upload is cancelled. - */ - cancel(uploadId, options) { - return this._client.post(`/uploads/${uploadId}/cancel`, options); - } - /** - * Completes the - * [Upload](https://platform.openai.com/docs/api-reference/uploads/object). - * - * Within the returned Upload object, there is a nested - * [File](https://platform.openai.com/docs/api-reference/files/object) object that - * is ready to use in the rest of the platform. - * - * You can specify the order of the Parts by passing in an ordered list of the Part - * IDs. - * - * The number of bytes uploaded upon completion must match the number of bytes - * initially specified when creating the Upload object. No Parts may be added after - * an Upload is completed. - */ - complete(uploadId, body2, options) { - return this._client.post(`/uploads/${uploadId}/complete`, { body: body2, ...options }); + HttpsAgent.prototype[CREATE_HTTPS_CONNECTION] = OriginalHttpsAgent.prototype.createConnection; + [ + "getName", + "_getSession", + "_cacheSession", + // https://github.com/nodejs/node/pull/4982 + "_evictSession" + ].forEach(function(method) { + if (typeof OriginalHttpsAgent.prototype[method] === "function") { + HttpsAgent.prototype[method] = OriginalHttpsAgent.prototype[method]; } - }; - exports2.Uploads = Uploads; - Uploads.Parts = parts_1.Parts; + }); + module.exports = HttpsAgent; + } +}); + +// node_modules/agentkeepalive/index.js +var require_agentkeepalive = __commonJS({ + "node_modules/agentkeepalive/index.js"(exports2, module) { + "use strict"; + var HttpAgent = require_agent2(); + module.exports = HttpAgent; + module.exports.HttpAgent = HttpAgent; + module.exports.HttpsAgent = require_https_agent(); + module.exports.constants = require_constants10(); } }); -// node_modules/openai/lib/Util.js -var require_Util = __commonJS({ - "node_modules/openai/lib/Util.js"(exports2) { +// node_modules/form-data-encoder/lib/cjs/util/createBoundary.js +var require_createBoundary = __commonJS({ + "node_modules/form-data-encoder/lib/cjs/util/createBoundary.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.allSettledWithThrow = void 0; - var allSettledWithThrow = async (promises4) => { - const results = await Promise.allSettled(promises4); - const rejected = results.filter((result) => result.status === "rejected"); - if (rejected.length) { - for (const result of rejected) { - console.error(result.reason); - } - throw new Error(`${rejected.length} promise(s) failed - see the above errors`); - } - const values = []; - for (const result of results) { - if (result.status === "fulfilled") { - values.push(result.value); - } + var alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"; + function createBoundary() { + let size = 16; + let res = ""; + while (size--) { + res += alphabet[Math.random() * alphabet.length << 0]; } - return values; - }; - exports2.allSettledWithThrow = allSettledWithThrow; + return res; + } + exports2.default = createBoundary; } }); -// node_modules/openai/resources/vector-stores/files.js -var require_files3 = __commonJS({ - "node_modules/openai/resources/vector-stores/files.js"(exports2) { +// node_modules/form-data-encoder/lib/cjs/util/isPlainObject.js +var require_isPlainObject2 = __commonJS({ + "node_modules/form-data-encoder/lib/cjs/util/isPlainObject.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.FileContentResponsesPage = exports2.VectorStoreFilesPage = exports2.Files = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var pagination_1 = require_pagination(); - var Files = class extends resource_1.APIResource { - /** - * Create a vector store file by attaching a - * [File](https://platform.openai.com/docs/api-reference/files) to a - * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object). - */ - create(vectorStoreId, body2, options) { - return this._client.post(`/vector_stores/${vectorStoreId}/files`, { - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); - } - /** - * Retrieves a vector store file. - */ - retrieve(vectorStoreId, fileId, options) { - return this._client.get(`/vector_stores/${vectorStoreId}/files/${fileId}`, { - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); - } - /** - * Update attributes on a vector store file. - */ - update(vectorStoreId, fileId, body2, options) { - return this._client.post(`/vector_stores/${vectorStoreId}/files/${fileId}`, { - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); - } - list(vectorStoreId, query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list(vectorStoreId, {}, query); - } - return this._client.getAPIList(`/vector_stores/${vectorStoreId}/files`, VectorStoreFilesPage, { - query, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); - } - /** - * Delete a vector store file. This will remove the file from the vector store but - * the file itself will not be deleted. To delete the file, use the - * [delete file](https://platform.openai.com/docs/api-reference/files/delete) - * endpoint. - */ - del(vectorStoreId, fileId, options) { - return this._client.delete(`/vector_stores/${vectorStoreId}/files/${fileId}`, { - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); - } - /** - * Attach a file to the given vector store and wait for it to be processed. - */ - async createAndPoll(vectorStoreId, body2, options) { - const file = await this.create(vectorStoreId, body2, options); - return await this.poll(vectorStoreId, file.id, options); - } - /** - * Wait for the vector store file to finish processing. - * - * Note: this will return even if the file failed to process, you need to check - * file.last_error and file.status to handle these cases - */ - async poll(vectorStoreId, fileId, options) { - const headers = { ...options?.headers, "X-Stainless-Poll-Helper": "true" }; - if (options?.pollIntervalMs) { - headers["X-Stainless-Custom-Poll-Interval"] = options.pollIntervalMs.toString(); - } - while (true) { - const fileResponse = await this.retrieve(vectorStoreId, fileId, { - ...options, - headers - }).withResponse(); - const file = fileResponse.data; - switch (file.status) { - case "in_progress": - let sleepInterval = 5e3; - if (options?.pollIntervalMs) { - sleepInterval = options.pollIntervalMs; - } else { - const headerInterval = fileResponse.response.headers.get("openai-poll-after-ms"); - if (headerInterval) { - const headerIntervalMs = parseInt(headerInterval); - if (!isNaN(headerIntervalMs)) { - sleepInterval = headerIntervalMs; - } - } - } - await (0, core_1.sleep)(sleepInterval); - break; - case "failed": - case "completed": - return file; - } - } - } - /** - * Upload a file to the `files` API and then attach it to the given vector store. - * - * Note the file will be asynchronously processed (you can use the alternative - * polling helper method to wait for processing to complete). - */ - async upload(vectorStoreId, file, options) { - const fileInfo = await this._client.files.create({ file, purpose: "assistants" }, options); - return this.create(vectorStoreId, { file_id: fileInfo.id }, options); - } - /** - * Add a file to a vector store and poll until processing is complete. - */ - async uploadAndPoll(vectorStoreId, file, options) { - const fileInfo = await this.upload(vectorStoreId, file, options); - return await this.poll(vectorStoreId, fileInfo.id, options); + var getType = (value) => Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); + function isPlainObject3(value) { + if (getType(value) !== "object") { + return false; } - /** - * Retrieve the parsed contents of a vector store file. - */ - content(vectorStoreId, fileId, options) { - return this._client.getAPIList(`/vector_stores/${vectorStoreId}/files/${fileId}/content`, FileContentResponsesPage, { ...options, headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } }); + const pp = Object.getPrototypeOf(value); + if (pp === null || pp === void 0) { + return true; } - }; - exports2.Files = Files; - var VectorStoreFilesPage = class extends pagination_1.CursorPage { - }; - exports2.VectorStoreFilesPage = VectorStoreFilesPage; - var FileContentResponsesPage = class extends pagination_1.Page { - }; - exports2.FileContentResponsesPage = FileContentResponsesPage; - Files.VectorStoreFilesPage = VectorStoreFilesPage; - Files.FileContentResponsesPage = FileContentResponsesPage; + const Ctor = pp.constructor && pp.constructor.toString(); + return Ctor === Object.toString(); + } + exports2.default = isPlainObject3; } }); -// node_modules/openai/resources/vector-stores/file-batches.js -var require_file_batches = __commonJS({ - "node_modules/openai/resources/vector-stores/file-batches.js"(exports2) { +// node_modules/form-data-encoder/lib/cjs/util/normalizeValue.js +var require_normalizeValue = __commonJS({ + "node_modules/form-data-encoder/lib/cjs/util/normalizeValue.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.VectorStoreFilesPage = exports2.FileBatches = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var core_2 = require_core2(); - var Util_1 = require_Util(); - var files_1 = require_files3(); - Object.defineProperty(exports2, "VectorStoreFilesPage", { enumerable: true, get: function() { - return files_1.VectorStoreFilesPage; - } }); - var FileBatches = class extends resource_1.APIResource { - /** - * Create a vector store file batch. - */ - create(vectorStoreId, body2, options) { - return this._client.post(`/vector_stores/${vectorStoreId}/file_batches`, { - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); - } - /** - * Retrieves a vector store file batch. - */ - retrieve(vectorStoreId, batchId, options) { - return this._client.get(`/vector_stores/${vectorStoreId}/file_batches/${batchId}`, { - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); - } - /** - * Cancel a vector store file batch. This attempts to cancel the processing of - * files in this batch as soon as possible. - */ - cancel(vectorStoreId, batchId, options) { - return this._client.post(`/vector_stores/${vectorStoreId}/file_batches/${batchId}/cancel`, { - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); - } - /** - * Create a vector store batch and poll until all files have been processed. - */ - async createAndPoll(vectorStoreId, body2, options) { - const batch = await this.create(vectorStoreId, body2); - return await this.poll(vectorStoreId, batch.id, options); - } - listFiles(vectorStoreId, batchId, query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.listFiles(vectorStoreId, batchId, {}, query); - } - return this._client.getAPIList(`/vector_stores/${vectorStoreId}/file_batches/${batchId}/files`, files_1.VectorStoreFilesPage, { query, ...options, headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } }); - } - /** - * Wait for the given file batch to be processed. - * - * Note: this will return even if one of the files failed to process, you need to - * check batch.file_counts.failed_count to handle this case. - */ - async poll(vectorStoreId, batchId, options) { - const headers = { ...options?.headers, "X-Stainless-Poll-Helper": "true" }; - if (options?.pollIntervalMs) { - headers["X-Stainless-Custom-Poll-Interval"] = options.pollIntervalMs.toString(); - } - while (true) { - const { data: batch, response } = await this.retrieve(vectorStoreId, batchId, { - ...options, - headers - }).withResponse(); - switch (batch.status) { - case "in_progress": - let sleepInterval = 5e3; - if (options?.pollIntervalMs) { - sleepInterval = options.pollIntervalMs; - } else { - const headerInterval = response.headers.get("openai-poll-after-ms"); - if (headerInterval) { - const headerIntervalMs = parseInt(headerInterval); - if (!isNaN(headerIntervalMs)) { - sleepInterval = headerIntervalMs; - } - } - } - await (0, core_2.sleep)(sleepInterval); - break; - case "failed": - case "cancelled": - case "completed": - return batch; - } - } - } - /** - * Uploads the given files concurrently and then creates a vector store file batch. - * - * The concurrency limit is configurable using the `maxConcurrency` parameter. - */ - async uploadAndPoll(vectorStoreId, { files, fileIds = [] }, options) { - if (files == null || files.length == 0) { - throw new Error(`No \`files\` provided to process. If you've already uploaded files you should use \`.createAndPoll()\` instead`); - } - const configuredConcurrency = options?.maxConcurrency ?? 5; - const concurrencyLimit = Math.min(configuredConcurrency, files.length); - const client2 = this._client; - const fileIterator = files.values(); - const allFileIds = [...fileIds]; - async function processFiles(iterator2) { - for (let item of iterator2) { - const fileObj = await client2.files.create({ file: item, purpose: "assistants" }, options); - allFileIds.push(fileObj.id); - } - } - const workers = Array(concurrencyLimit).fill(fileIterator).map(processFiles); - await (0, Util_1.allSettledWithThrow)(workers); - return await this.createAndPoll(vectorStoreId, { - file_ids: allFileIds - }); + var normalizeValue = (value) => String(value).replace(/\r|\n/g, (match3, i6, str) => { + if (match3 === "\r" && str[i6 + 1] !== "\n" || match3 === "\n" && str[i6 - 1] !== "\r") { + return "\r\n"; } - }; - exports2.FileBatches = FileBatches; + return match3; + }); + exports2.default = normalizeValue; } }); -// node_modules/openai/resources/vector-stores/vector-stores.js -var require_vector_stores = __commonJS({ - "node_modules/openai/resources/vector-stores/vector-stores.js"(exports2) { +// node_modules/form-data-encoder/lib/cjs/util/escapeName.js +var require_escapeName = __commonJS({ + "node_modules/form-data-encoder/lib/cjs/util/escapeName.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; - } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); - } - __setModuleDefault(result, mod); - return result; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.VectorStoreSearchResponsesPage = exports2.VectorStoresPage = exports2.VectorStores = void 0; - var resource_1 = require_resource(); - var core_1 = require_core2(); - var FileBatchesAPI = __importStar(require_file_batches()); - var file_batches_1 = require_file_batches(); - var FilesAPI = __importStar(require_files3()); - var files_1 = require_files3(); - var pagination_1 = require_pagination(); - var VectorStores = class extends resource_1.APIResource { - constructor() { - super(...arguments); - this.files = new FilesAPI.Files(this._client); - this.fileBatches = new FileBatchesAPI.FileBatches(this._client); - } - /** - * Create a vector store. - */ - create(body2, options) { - return this._client.post("/vector_stores", { - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); - } - /** - * Retrieves a vector store. - */ - retrieve(vectorStoreId, options) { - return this._client.get(`/vector_stores/${vectorStoreId}`, { - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); - } - /** - * Modifies a vector store. - */ - update(vectorStoreId, body2, options) { - return this._client.post(`/vector_stores/${vectorStoreId}`, { - body: body2, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); - } - list(query = {}, options) { - if ((0, core_1.isRequestOptions)(query)) { - return this.list({}, query); - } - return this._client.getAPIList("/vector_stores", VectorStoresPage, { - query, - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); - } - /** - * Delete a vector store. - */ - del(vectorStoreId, options) { - return this._client.delete(`/vector_stores/${vectorStoreId}`, { - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); - } - /** - * Search a vector store for relevant chunks based on a query and file attributes - * filter. - */ - search(vectorStoreId, body2, options) { - return this._client.getAPIList(`/vector_stores/${vectorStoreId}/search`, VectorStoreSearchResponsesPage, { - body: body2, - method: "post", - ...options, - headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } - }); - } - }; - exports2.VectorStores = VectorStores; - var VectorStoresPage = class extends pagination_1.CursorPage { - }; - exports2.VectorStoresPage = VectorStoresPage; - var VectorStoreSearchResponsesPage = class extends pagination_1.Page { + var escapeName = (name) => String(name).replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/"/g, "%22"); + exports2.default = escapeName; + } +}); + +// node_modules/form-data-encoder/lib/cjs/util/isFunction.js +var require_isFunction3 = __commonJS({ + "node_modules/form-data-encoder/lib/cjs/util/isFunction.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var isFunction3 = (value) => typeof value === "function"; + exports2.default = isFunction3; + } +}); + +// node_modules/form-data-encoder/lib/cjs/util/isFileLike.js +var require_isFileLike = __commonJS({ + "node_modules/form-data-encoder/lib/cjs/util/isFileLike.js"(exports2) { + "use strict"; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; }; - exports2.VectorStoreSearchResponsesPage = VectorStoreSearchResponsesPage; - VectorStores.VectorStoresPage = VectorStoresPage; - VectorStores.VectorStoreSearchResponsesPage = VectorStoreSearchResponsesPage; - VectorStores.Files = files_1.Files; - VectorStores.VectorStoreFilesPage = files_1.VectorStoreFilesPage; - VectorStores.FileContentResponsesPage = files_1.FileContentResponsesPage; - VectorStores.FileBatches = file_batches_1.FileBatches; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isFileLike = void 0; + var isFunction_1 = __importDefault(require_isFunction3()); + var isFileLike = (value) => Boolean(value && typeof value === "object" && (0, isFunction_1.default)(value.constructor) && value[Symbol.toStringTag] === "File" && (0, isFunction_1.default)(value.stream) && value.name != null && value.size != null && value.lastModified != null); + exports2.isFileLike = isFileLike; } }); -// node_modules/openai/resources/index.js -var require_resources = __commonJS({ - "node_modules/openai/resources/index.js"(exports2) { +// node_modules/form-data-encoder/lib/cjs/util/isFormData.js +var require_isFormData = __commonJS({ + "node_modules/form-data-encoder/lib/cjs/util/isFormData.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; - } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __exportStar = exports2 && exports2.__exportStar || function(m6, exports3) { - for (var p6 in m6) if (p6 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p6)) __createBinding(exports3, m6, p6); + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.VectorStores = exports2.VectorStoreSearchResponsesPage = exports2.VectorStoresPage = exports2.Uploads = exports2.Responses = exports2.Moderations = exports2.Models = exports2.ModelsPage = exports2.Images = exports2.Graders = exports2.FineTuning = exports2.Files = exports2.FileObjectsPage = exports2.Evals = exports2.EvalListResponsesPage = exports2.Embeddings = exports2.Containers = exports2.ContainerListResponsesPage = exports2.Completions = exports2.Beta = exports2.Batches = exports2.BatchesPage = exports2.Audio = void 0; - __exportStar(require_chat2(), exports2); - __exportStar(require_shared(), exports2); - var audio_1 = require_audio(); - Object.defineProperty(exports2, "Audio", { enumerable: true, get: function() { - return audio_1.Audio; - } }); - var batches_1 = require_batches(); - Object.defineProperty(exports2, "BatchesPage", { enumerable: true, get: function() { - return batches_1.BatchesPage; - } }); - Object.defineProperty(exports2, "Batches", { enumerable: true, get: function() { - return batches_1.Batches; - } }); - var beta_1 = require_beta(); - Object.defineProperty(exports2, "Beta", { enumerable: true, get: function() { - return beta_1.Beta; - } }); - var completions_1 = require_completions4(); - Object.defineProperty(exports2, "Completions", { enumerable: true, get: function() { - return completions_1.Completions; - } }); - var containers_1 = require_containers(); - Object.defineProperty(exports2, "ContainerListResponsesPage", { enumerable: true, get: function() { - return containers_1.ContainerListResponsesPage; - } }); - Object.defineProperty(exports2, "Containers", { enumerable: true, get: function() { - return containers_1.Containers; - } }); - var embeddings_1 = require_embeddings(); - Object.defineProperty(exports2, "Embeddings", { enumerable: true, get: function() { - return embeddings_1.Embeddings; - } }); - var evals_1 = require_evals(); - Object.defineProperty(exports2, "EvalListResponsesPage", { enumerable: true, get: function() { - return evals_1.EvalListResponsesPage; - } }); - Object.defineProperty(exports2, "Evals", { enumerable: true, get: function() { - return evals_1.Evals; - } }); - var files_1 = require_files2(); - Object.defineProperty(exports2, "FileObjectsPage", { enumerable: true, get: function() { - return files_1.FileObjectsPage; - } }); - Object.defineProperty(exports2, "Files", { enumerable: true, get: function() { - return files_1.Files; - } }); - var fine_tuning_1 = require_fine_tuning(); - Object.defineProperty(exports2, "FineTuning", { enumerable: true, get: function() { - return fine_tuning_1.FineTuning; - } }); - var graders_1 = require_graders2(); - Object.defineProperty(exports2, "Graders", { enumerable: true, get: function() { - return graders_1.Graders; - } }); - var images_1 = require_images(); - Object.defineProperty(exports2, "Images", { enumerable: true, get: function() { - return images_1.Images; - } }); - var models_1 = require_models(); - Object.defineProperty(exports2, "ModelsPage", { enumerable: true, get: function() { - return models_1.ModelsPage; - } }); - Object.defineProperty(exports2, "Models", { enumerable: true, get: function() { - return models_1.Models; - } }); - var moderations_1 = require_moderations(); - Object.defineProperty(exports2, "Moderations", { enumerable: true, get: function() { - return moderations_1.Moderations; - } }); - var responses_1 = require_responses(); - Object.defineProperty(exports2, "Responses", { enumerable: true, get: function() { - return responses_1.Responses; - } }); - var uploads_1 = require_uploads2(); - Object.defineProperty(exports2, "Uploads", { enumerable: true, get: function() { - return uploads_1.Uploads; - } }); - var vector_stores_1 = require_vector_stores(); - Object.defineProperty(exports2, "VectorStoresPage", { enumerable: true, get: function() { - return vector_stores_1.VectorStoresPage; - } }); - Object.defineProperty(exports2, "VectorStoreSearchResponsesPage", { enumerable: true, get: function() { - return vector_stores_1.VectorStoreSearchResponsesPage; - } }); - Object.defineProperty(exports2, "VectorStores", { enumerable: true, get: function() { - return vector_stores_1.VectorStores; - } }); + exports2.isFormDataLike = exports2.isFormData = void 0; + var isFunction_1 = __importDefault(require_isFunction3()); + var isFormData = (value) => Boolean(value && (0, isFunction_1.default)(value.constructor) && value[Symbol.toStringTag] === "FormData" && (0, isFunction_1.default)(value.append) && (0, isFunction_1.default)(value.getAll) && (0, isFunction_1.default)(value.entries) && (0, isFunction_1.default)(value[Symbol.iterator])); + exports2.isFormData = isFormData; + exports2.isFormDataLike = exports2.isFormData; } }); -// node_modules/openai/index.js -var require_openai = __commonJS({ - "node_modules/openai/index.js"(exports2, module) { +// node_modules/form-data-encoder/lib/cjs/FormDataEncoder.js +var require_FormDataEncoder = __commonJS({ + "node_modules/form-data-encoder/lib/cjs/FormDataEncoder.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m6[k7]; - } }; - } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { - if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; - }); - var __importStar = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k7 in mod) if (k7 !== "default" && Object.prototype.hasOwnProperty.call(mod, k7)) __createBinding(result, mod, k7); - } - __setModuleDefault(result, mod); - return result; + var __classPrivateFieldSet2 = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; + }; + var __classPrivateFieldGet2 = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { + if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); + }; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; }; - var _a5; + var _FormDataEncoder_instances; + var _FormDataEncoder_CRLF; + var _FormDataEncoder_CRLF_BYTES; + var _FormDataEncoder_CRLF_BYTES_LENGTH; + var _FormDataEncoder_DASHES; + var _FormDataEncoder_encoder; + var _FormDataEncoder_footer; + var _FormDataEncoder_form; + var _FormDataEncoder_options; + var _FormDataEncoder_getFieldHeader; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.UnprocessableEntityError = exports2.PermissionDeniedError = exports2.InternalServerError = exports2.AuthenticationError = exports2.BadRequestError = exports2.RateLimitError = exports2.ConflictError = exports2.NotFoundError = exports2.APIUserAbortError = exports2.APIConnectionTimeoutError = exports2.APIConnectionError = exports2.APIError = exports2.OpenAIError = exports2.fileFromPath = exports2.toFile = exports2.AzureOpenAI = exports2.OpenAI = void 0; - var qs2 = __importStar(require_qs()); - var Core = __importStar(require_core2()); - var Errors = __importStar(require_error2()); - var Pagination = __importStar(require_pagination()); - var Uploads = __importStar(require_uploads()); - var API = __importStar(require_resources()); - var batches_1 = require_batches(); - var completions_1 = require_completions4(); - var embeddings_1 = require_embeddings(); - var files_1 = require_files2(); - var images_1 = require_images(); - var models_1 = require_models(); - var moderations_1 = require_moderations(); - var audio_1 = require_audio(); - var beta_1 = require_beta(); - var chat_1 = require_chat(); - var containers_1 = require_containers(); - var evals_1 = require_evals(); - var fine_tuning_1 = require_fine_tuning(); - var graders_1 = require_graders2(); - var responses_1 = require_responses(); - var uploads_1 = require_uploads2(); - var vector_stores_1 = require_vector_stores(); - var completions_2 = require_completions(); - var OpenAI = class extends Core.APIClient { - /** - * API Client for interfacing with the OpenAI API. - * - * @param {string | undefined} [opts.apiKey=process.env['OPENAI_API_KEY'] ?? undefined] - * @param {string | null | undefined} [opts.organization=process.env['OPENAI_ORG_ID'] ?? null] - * @param {string | null | undefined} [opts.project=process.env['OPENAI_PROJECT_ID'] ?? null] - * @param {string} [opts.baseURL=process.env['OPENAI_BASE_URL'] ?? https://api.openai.com/v1] - Override the default base URL for the API. - * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out. - * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections. - * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation. - * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request. - * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API. - * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API. - * @param {boolean} [opts.dangerouslyAllowBrowser=false] - By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers. - */ - constructor({ baseURL = Core.readEnv("OPENAI_BASE_URL"), apiKey = Core.readEnv("OPENAI_API_KEY"), organization = Core.readEnv("OPENAI_ORG_ID") ?? null, project = Core.readEnv("OPENAI_PROJECT_ID") ?? null, ...opts } = {}) { - if (apiKey === void 0) { - throw new Errors.OpenAIError("The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' })."); - } - const options = { - apiKey, - organization, - project, - ...opts, - baseURL: baseURL || `https://api.openai.com/v1` - }; - if (!options.dangerouslyAllowBrowser && Core.isRunningInBrowser()) { - throw new Errors.OpenAIError("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew OpenAI({ apiKey, dangerouslyAllowBrowser: true });\n\nhttps://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety\n"); - } - super({ - baseURL: options.baseURL, - timeout: options.timeout ?? 6e5, - httpAgent: options.httpAgent, - maxRetries: options.maxRetries, - fetch: options.fetch - }); - this.completions = new API.Completions(this); - this.chat = new API.Chat(this); - this.embeddings = new API.Embeddings(this); - this.files = new API.Files(this); - this.images = new API.Images(this); - this.audio = new API.Audio(this); - this.moderations = new API.Moderations(this); - this.models = new API.Models(this); - this.fineTuning = new API.FineTuning(this); - this.graders = new API.Graders(this); - this.vectorStores = new API.VectorStores(this); - this.beta = new API.Beta(this); - this.batches = new API.Batches(this); - this.uploads = new API.Uploads(this); - this.responses = new API.Responses(this); - this.evals = new API.Evals(this); - this.containers = new API.Containers(this); - this._options = options; - this.apiKey = apiKey; - this.organization = organization; - this.project = project; - } - defaultQuery() { - return this._options.defaultQuery; - } - defaultHeaders(opts) { - return { - ...super.defaultHeaders(opts), - "OpenAI-Organization": this.organization, - "OpenAI-Project": this.project, - ...this._options.defaultHeaders - }; - } - authHeaders(opts) { - return { Authorization: `Bearer ${this.apiKey}` }; - } - stringifyQuery(query) { - return qs2.stringify(query, { arrayFormat: "brackets" }); - } + exports2.Encoder = exports2.FormDataEncoder = void 0; + var createBoundary_1 = __importDefault(require_createBoundary()); + var isPlainObject_1 = __importDefault(require_isPlainObject2()); + var normalizeValue_1 = __importDefault(require_normalizeValue()); + var escapeName_1 = __importDefault(require_escapeName()); + var isFileLike_1 = require_isFileLike(); + var isFormData_1 = require_isFormData(); + var defaultOptions4 = { + enableAdditionalHeaders: false }; - exports2.OpenAI = OpenAI; - _a5 = OpenAI; - OpenAI.OpenAI = _a5; - OpenAI.DEFAULT_TIMEOUT = 6e5; - OpenAI.OpenAIError = Errors.OpenAIError; - OpenAI.APIError = Errors.APIError; - OpenAI.APIConnectionError = Errors.APIConnectionError; - OpenAI.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError; - OpenAI.APIUserAbortError = Errors.APIUserAbortError; - OpenAI.NotFoundError = Errors.NotFoundError; - OpenAI.ConflictError = Errors.ConflictError; - OpenAI.RateLimitError = Errors.RateLimitError; - OpenAI.BadRequestError = Errors.BadRequestError; - OpenAI.AuthenticationError = Errors.AuthenticationError; - OpenAI.InternalServerError = Errors.InternalServerError; - OpenAI.PermissionDeniedError = Errors.PermissionDeniedError; - OpenAI.UnprocessableEntityError = Errors.UnprocessableEntityError; - OpenAI.toFile = Uploads.toFile; - OpenAI.fileFromPath = Uploads.fileFromPath; - OpenAI.Completions = completions_1.Completions; - OpenAI.Chat = chat_1.Chat; - OpenAI.ChatCompletionsPage = completions_2.ChatCompletionsPage; - OpenAI.Embeddings = embeddings_1.Embeddings; - OpenAI.Files = files_1.Files; - OpenAI.FileObjectsPage = files_1.FileObjectsPage; - OpenAI.Images = images_1.Images; - OpenAI.Audio = audio_1.Audio; - OpenAI.Moderations = moderations_1.Moderations; - OpenAI.Models = models_1.Models; - OpenAI.ModelsPage = models_1.ModelsPage; - OpenAI.FineTuning = fine_tuning_1.FineTuning; - OpenAI.Graders = graders_1.Graders; - OpenAI.VectorStores = vector_stores_1.VectorStores; - OpenAI.VectorStoresPage = vector_stores_1.VectorStoresPage; - OpenAI.VectorStoreSearchResponsesPage = vector_stores_1.VectorStoreSearchResponsesPage; - OpenAI.Beta = beta_1.Beta; - OpenAI.Batches = batches_1.Batches; - OpenAI.BatchesPage = batches_1.BatchesPage; - OpenAI.Uploads = uploads_1.Uploads; - OpenAI.Responses = responses_1.Responses; - OpenAI.Evals = evals_1.Evals; - OpenAI.EvalListResponsesPage = evals_1.EvalListResponsesPage; - OpenAI.Containers = containers_1.Containers; - OpenAI.ContainerListResponsesPage = containers_1.ContainerListResponsesPage; - var AzureOpenAI = class extends OpenAI { - /** - * API Client for interfacing with the Azure OpenAI API. - * - * @param {string | undefined} [opts.apiVersion=process.env['OPENAI_API_VERSION'] ?? undefined] - * @param {string | undefined} [opts.endpoint=process.env['AZURE_OPENAI_ENDPOINT'] ?? undefined] - Your Azure endpoint, including the resource, e.g. `https://example-resource.azure.openai.com/` - * @param {string | undefined} [opts.apiKey=process.env['AZURE_OPENAI_API_KEY'] ?? undefined] - * @param {string | undefined} opts.deployment - A model deployment, if given, sets the base client URL to include `/deployments/{deployment}`. - * @param {string | null | undefined} [opts.organization=process.env['OPENAI_ORG_ID'] ?? null] - * @param {string} [opts.baseURL=process.env['OPENAI_BASE_URL']] - Sets the base URL for the API, e.g. `https://example-resource.azure.openai.com/openai/`. - * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out. - * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections. - * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation. - * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request. - * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API. - * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API. - * @param {boolean} [opts.dangerouslyAllowBrowser=false] - By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers. - */ - constructor({ baseURL = Core.readEnv("OPENAI_BASE_URL"), apiKey = Core.readEnv("AZURE_OPENAI_API_KEY"), apiVersion = Core.readEnv("OPENAI_API_VERSION"), endpoint: endpoint2, deployment, azureADTokenProvider, dangerouslyAllowBrowser, ...opts } = {}) { - if (!apiVersion) { - throw new Errors.OpenAIError("The OPENAI_API_VERSION environment variable is missing or empty; either provide it, or instantiate the AzureOpenAI client with an apiVersion option, like new AzureOpenAI({ apiVersion: 'My API Version' })."); + var FormDataEncoder = class { + constructor(form, boundaryOrOptions, options) { + _FormDataEncoder_instances.add(this); + _FormDataEncoder_CRLF.set(this, "\r\n"); + _FormDataEncoder_CRLF_BYTES.set(this, void 0); + _FormDataEncoder_CRLF_BYTES_LENGTH.set(this, void 0); + _FormDataEncoder_DASHES.set(this, "-".repeat(2)); + _FormDataEncoder_encoder.set(this, new TextEncoder()); + _FormDataEncoder_footer.set(this, void 0); + _FormDataEncoder_form.set(this, void 0); + _FormDataEncoder_options.set(this, void 0); + if (!(0, isFormData_1.isFormData)(form)) { + throw new TypeError("Expected first argument to be a FormData instance."); } - if (typeof azureADTokenProvider === "function") { - dangerouslyAllowBrowser = true; + let boundary; + if ((0, isPlainObject_1.default)(boundaryOrOptions)) { + options = boundaryOrOptions; + } else { + boundary = boundaryOrOptions; } - if (!azureADTokenProvider && !apiKey) { - throw new Errors.OpenAIError("Missing credentials. Please pass one of `apiKey` and `azureADTokenProvider`, or set the `AZURE_OPENAI_API_KEY` environment variable."); + if (!boundary) { + boundary = (0, createBoundary_1.default)(); } - if (azureADTokenProvider && apiKey) { - throw new Errors.OpenAIError("The `apiKey` and `azureADTokenProvider` arguments are mutually exclusive; only one can be passed at a time."); + if (typeof boundary !== "string") { + throw new TypeError("Expected boundary argument to be a string."); } - apiKey ?? (apiKey = API_KEY_SENTINEL); - opts.defaultQuery = { ...opts.defaultQuery, "api-version": apiVersion }; - if (!baseURL) { - if (!endpoint2) { - endpoint2 = process.env["AZURE_OPENAI_ENDPOINT"]; - } - if (!endpoint2) { - throw new Errors.OpenAIError("Must provide one of the `baseURL` or `endpoint` arguments, or the `AZURE_OPENAI_ENDPOINT` environment variable"); - } - baseURL = `${endpoint2}/openai`; - } else { - if (endpoint2) { - throw new Errors.OpenAIError("baseURL and endpoint are mutually exclusive"); - } + if (options && !(0, isPlainObject_1.default)(options)) { + throw new TypeError("Expected options argument to be an object."); } - super({ - apiKey, - baseURL, - ...opts, - ...dangerouslyAllowBrowser !== void 0 ? { dangerouslyAllowBrowser } : {} + __classPrivateFieldSet2(this, _FormDataEncoder_form, form, "f"); + __classPrivateFieldSet2(this, _FormDataEncoder_options, { ...defaultOptions4, ...options }, "f"); + __classPrivateFieldSet2(this, _FormDataEncoder_CRLF_BYTES, __classPrivateFieldGet2(this, _FormDataEncoder_encoder, "f").encode(__classPrivateFieldGet2(this, _FormDataEncoder_CRLF, "f")), "f"); + __classPrivateFieldSet2(this, _FormDataEncoder_CRLF_BYTES_LENGTH, __classPrivateFieldGet2(this, _FormDataEncoder_CRLF_BYTES, "f").byteLength, "f"); + this.boundary = `form-data-boundary-${boundary}`; + this.contentType = `multipart/form-data; boundary=${this.boundary}`; + __classPrivateFieldSet2(this, _FormDataEncoder_footer, __classPrivateFieldGet2(this, _FormDataEncoder_encoder, "f").encode(`${__classPrivateFieldGet2(this, _FormDataEncoder_DASHES, "f")}${this.boundary}${__classPrivateFieldGet2(this, _FormDataEncoder_DASHES, "f")}${__classPrivateFieldGet2(this, _FormDataEncoder_CRLF, "f").repeat(2)}`), "f"); + this.contentLength = String(this.getContentLength()); + this.headers = Object.freeze({ + "Content-Type": this.contentType, + "Content-Length": this.contentLength + }); + Object.defineProperties(this, { + boundary: { writable: false, configurable: false }, + contentType: { writable: false, configurable: false }, + contentLength: { writable: false, configurable: false }, + headers: { writable: false, configurable: false } }); - this.apiVersion = ""; - this._azureADTokenProvider = azureADTokenProvider; - this.apiVersion = apiVersion; - this.deploymentName = deployment; } - buildRequest(options, props = {}) { - if (_deployments_endpoints.has(options.path) && options.method === "post" && options.body !== void 0) { - if (!Core.isObj(options.body)) { - throw new Error("Expected request body to be an object"); - } - const model = this.deploymentName || options.body["model"] || options.__metadata?.["model"]; - if (model !== void 0 && !this.baseURL.includes("/deployments")) { - options.path = `/deployments/${model}${options.path}`; - } + getContentLength() { + let length = 0; + for (const [name, raw] of __classPrivateFieldGet2(this, _FormDataEncoder_form, "f")) { + const value = (0, isFileLike_1.isFileLike)(raw) ? raw : __classPrivateFieldGet2(this, _FormDataEncoder_encoder, "f").encode((0, normalizeValue_1.default)(raw)); + length += __classPrivateFieldGet2(this, _FormDataEncoder_instances, "m", _FormDataEncoder_getFieldHeader).call(this, name, value).byteLength; + length += (0, isFileLike_1.isFileLike)(value) ? value.size : value.byteLength; + length += __classPrivateFieldGet2(this, _FormDataEncoder_CRLF_BYTES_LENGTH, "f"); } - return super.buildRequest(options, props); + return length + __classPrivateFieldGet2(this, _FormDataEncoder_footer, "f").byteLength; } - async _getAzureADToken() { - if (typeof this._azureADTokenProvider === "function") { - const token = await this._azureADTokenProvider(); - if (!token || typeof token !== "string") { - throw new Errors.OpenAIError(`Expected 'azureADTokenProvider' argument to return a string but it returned ${token}`); - } - return token; + *values() { + for (const [name, raw] of __classPrivateFieldGet2(this, _FormDataEncoder_form, "f").entries()) { + const value = (0, isFileLike_1.isFileLike)(raw) ? raw : __classPrivateFieldGet2(this, _FormDataEncoder_encoder, "f").encode((0, normalizeValue_1.default)(raw)); + yield __classPrivateFieldGet2(this, _FormDataEncoder_instances, "m", _FormDataEncoder_getFieldHeader).call(this, name, value); + yield value; + yield __classPrivateFieldGet2(this, _FormDataEncoder_CRLF_BYTES, "f"); } - return void 0; + yield __classPrivateFieldGet2(this, _FormDataEncoder_footer, "f"); } - authHeaders(opts) { - return {}; + async *encode() { + for (const part of this.values()) { + if ((0, isFileLike_1.isFileLike)(part)) { + yield* part.stream(); + } else { + yield part; + } + } } - async prepareOptions(opts) { - if (opts.headers?.["api-key"]) { - return super.prepareOptions(opts); + [(_FormDataEncoder_CRLF = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_CRLF_BYTES = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_CRLF_BYTES_LENGTH = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_DASHES = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_encoder = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_footer = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_form = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_options = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_instances = /* @__PURE__ */ new WeakSet(), _FormDataEncoder_getFieldHeader = function _FormDataEncoder_getFieldHeader2(name, value) { + let header = ""; + header += `${__classPrivateFieldGet2(this, _FormDataEncoder_DASHES, "f")}${this.boundary}${__classPrivateFieldGet2(this, _FormDataEncoder_CRLF, "f")}`; + header += `Content-Disposition: form-data; name="${(0, escapeName_1.default)(name)}"`; + if ((0, isFileLike_1.isFileLike)(value)) { + header += `; filename="${(0, escapeName_1.default)(value.name)}"${__classPrivateFieldGet2(this, _FormDataEncoder_CRLF, "f")}`; + header += `Content-Type: ${value.type || "application/octet-stream"}`; } - const token = await this._getAzureADToken(); - opts.headers ?? (opts.headers = {}); - if (token) { - opts.headers["Authorization"] = `Bearer ${token}`; - } else if (this.apiKey !== API_KEY_SENTINEL) { - opts.headers["api-key"] = this.apiKey; - } else { - throw new Errors.OpenAIError("Unable to handle auth"); + if (__classPrivateFieldGet2(this, _FormDataEncoder_options, "f").enableAdditionalHeaders === true) { + header += `${__classPrivateFieldGet2(this, _FormDataEncoder_CRLF, "f")}Content-Length: ${(0, isFileLike_1.isFileLike)(value) ? value.size : value.byteLength}`; } - return super.prepareOptions(opts); + return __classPrivateFieldGet2(this, _FormDataEncoder_encoder, "f").encode(`${header}${__classPrivateFieldGet2(this, _FormDataEncoder_CRLF, "f").repeat(2)}`); + }, Symbol.iterator)]() { + return this.values(); + } + [Symbol.asyncIterator]() { + return this.encode(); } }; - exports2.AzureOpenAI = AzureOpenAI; - var _deployments_endpoints = /* @__PURE__ */ new Set([ - "/completions", - "/chat/completions", - "/embeddings", - "/audio/transcriptions", - "/audio/translations", - "/audio/speech", - "/images/generations", - "/images/edits" - ]); - var API_KEY_SENTINEL = ""; - var uploads_2 = require_uploads(); - Object.defineProperty(exports2, "toFile", { enumerable: true, get: function() { - return uploads_2.toFile; - } }); - Object.defineProperty(exports2, "fileFromPath", { enumerable: true, get: function() { - return uploads_2.fileFromPath; - } }); - var error_1 = require_error2(); - Object.defineProperty(exports2, "OpenAIError", { enumerable: true, get: function() { - return error_1.OpenAIError; - } }); - Object.defineProperty(exports2, "APIError", { enumerable: true, get: function() { - return error_1.APIError; - } }); - Object.defineProperty(exports2, "APIConnectionError", { enumerable: true, get: function() { - return error_1.APIConnectionError; - } }); - Object.defineProperty(exports2, "APIConnectionTimeoutError", { enumerable: true, get: function() { - return error_1.APIConnectionTimeoutError; - } }); - Object.defineProperty(exports2, "APIUserAbortError", { enumerable: true, get: function() { - return error_1.APIUserAbortError; - } }); - Object.defineProperty(exports2, "NotFoundError", { enumerable: true, get: function() { - return error_1.NotFoundError; - } }); - Object.defineProperty(exports2, "ConflictError", { enumerable: true, get: function() { - return error_1.ConflictError; - } }); - Object.defineProperty(exports2, "RateLimitError", { enumerable: true, get: function() { - return error_1.RateLimitError; - } }); - Object.defineProperty(exports2, "BadRequestError", { enumerable: true, get: function() { - return error_1.BadRequestError; - } }); - Object.defineProperty(exports2, "AuthenticationError", { enumerable: true, get: function() { - return error_1.AuthenticationError; - } }); - Object.defineProperty(exports2, "InternalServerError", { enumerable: true, get: function() { - return error_1.InternalServerError; - } }); - Object.defineProperty(exports2, "PermissionDeniedError", { enumerable: true, get: function() { - return error_1.PermissionDeniedError; - } }); - Object.defineProperty(exports2, "UnprocessableEntityError", { enumerable: true, get: function() { - return error_1.UnprocessableEntityError; - } }); - exports2 = module.exports = OpenAI; - module.exports.AzureOpenAI = AzureOpenAI; - exports2.default = OpenAI; + exports2.FormDataEncoder = FormDataEncoder; + exports2.Encoder = FormDataEncoder; } }); -// node_modules/@anthropic-ai/sdk/version.js -var require_version2 = __commonJS({ - "node_modules/@anthropic-ai/sdk/version.js"(exports2) { +// node_modules/form-data-encoder/lib/cjs/FileLike.js +var require_FileLike = __commonJS({ + "node_modules/form-data-encoder/lib/cjs/FileLike.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.VERSION = void 0; - exports2.VERSION = "0.27.3"; } }); -// node_modules/@anthropic-ai/sdk/_shims/registry.js -var require_registry2 = __commonJS({ - "node_modules/@anthropic-ai/sdk/_shims/registry.js"(exports2) { +// node_modules/form-data-encoder/lib/cjs/FormDataLike.js +var require_FormDataLike = __commonJS({ + "node_modules/form-data-encoder/lib/cjs/FormDataLike.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.setShims = exports2.isFsReadStream = exports2.fileFromPath = exports2.getDefaultAgent = exports2.getMultipartRequestOptions = exports2.ReadableStream = exports2.File = exports2.Blob = exports2.FormData = exports2.Headers = exports2.Response = exports2.Request = exports2.fetch = exports2.kind = exports2.auto = void 0; - exports2.auto = false; - exports2.kind = void 0; - exports2.fetch = void 0; - exports2.Request = void 0; - exports2.Response = void 0; - exports2.Headers = void 0; - exports2.FormData = void 0; - exports2.Blob = void 0; - exports2.File = void 0; - exports2.ReadableStream = void 0; - exports2.getMultipartRequestOptions = void 0; - exports2.getDefaultAgent = void 0; - exports2.fileFromPath = void 0; - exports2.isFsReadStream = void 0; - function setShims(shims, options = { auto: false }) { - if (exports2.auto) { - throw new Error(`you must \`import '@anthropic-ai/sdk/shims/${shims.kind}'\` before importing anything else from @anthropic-ai/sdk`); - } - if (exports2.kind) { - throw new Error(`can't \`import '@anthropic-ai/sdk/shims/${shims.kind}'\` after \`import '@anthropic-ai/sdk/shims/${exports2.kind}'\``); - } - exports2.auto = options.auto; - exports2.kind = shims.kind; - exports2.fetch = shims.fetch; - exports2.Request = shims.Request; - exports2.Response = shims.Response; - exports2.Headers = shims.Headers; - exports2.FormData = shims.FormData; - exports2.Blob = shims.Blob; - exports2.File = shims.File; - exports2.ReadableStream = shims.ReadableStream; - exports2.getMultipartRequestOptions = shims.getMultipartRequestOptions; - exports2.getDefaultAgent = shims.getDefaultAgent; - exports2.fileFromPath = shims.fileFromPath; - exports2.isFsReadStream = shims.isFsReadStream; - } - exports2.setShims = setShims; + } +}); + +// node_modules/form-data-encoder/lib/cjs/index.js +var require_cjs2 = __commonJS({ + "node_modules/form-data-encoder/lib/cjs/index.js"(exports2) { + "use strict"; + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k7, k22) { + if (k22 === void 0) k22 = k7; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k7]; + } }); + }) : (function(o2, m3, k7, k22) { + if (k22 === void 0) k22 = k7; + o2[k22] = m3[k7]; + })); + var __exportStar = exports2 && exports2.__exportStar || function(m3, exports3) { + for (var p2 in m3) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p2)) __createBinding(exports3, m3, p2); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + __exportStar(require_FormDataEncoder(), exports2); + __exportStar(require_FileLike(), exports2); + __exportStar(require_FormDataLike(), exports2); + __exportStar(require_isFileLike(), exports2); + __exportStar(require_isFormData(), exports2); } }); // node_modules/@anthropic-ai/sdk/_shims/MultipartBody.js -var require_MultipartBody2 = __commonJS({ +var require_MultipartBody = __commonJS({ "node_modules/@anthropic-ai/sdk/_shims/MultipartBody.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -113332,27 +117908,168 @@ var require_MultipartBody2 = __commonJS({ } }); +// node_modules/node-domexception/index.js +var require_node_domexception = __commonJS({ + "node_modules/node-domexception/index.js"(exports2, module) { + "use strict"; + if (!globalThis.DOMException) { + try { + const { MessageChannel } = __require("worker_threads"), port = new MessageChannel().port1, ab = new ArrayBuffer(); + port.postMessage(ab, [ab, ab]); + } catch (err) { + err.constructor.name === "DOMException" && (globalThis.DOMException = err.constructor); + } + } + module.exports = globalThis.DOMException; + } +}); + +// node_modules/formdata-node/lib/cjs/isPlainObject.js +var require_isPlainObject3 = __commonJS({ + "node_modules/formdata-node/lib/cjs/isPlainObject.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var getType = (value) => Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); + function isPlainObject3(value) { + if (getType(value) !== "object") { + return false; + } + const pp = Object.getPrototypeOf(value); + if (pp === null || pp === void 0) { + return true; + } + const Ctor = pp.constructor && pp.constructor.toString(); + return Ctor === Object.toString(); + } + exports2.default = isPlainObject3; + } +}); + +// node_modules/formdata-node/lib/cjs/fileFromPath.js +var require_fileFromPath = __commonJS({ + "node_modules/formdata-node/lib/cjs/fileFromPath.js"(exports2) { + "use strict"; + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k7, k22) { + if (k22 === void 0) k22 = k7; + Object.defineProperty(o2, k22, { enumerable: true, get: function() { + return m3[k7]; + } }); + }) : (function(o2, m3, k7, k22) { + if (k22 === void 0) k22 = k7; + o2[k22] = m3[k7]; + })); + var __exportStar = exports2 && exports2.__exportStar || function(m3, exports3) { + for (var p2 in m3) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p2)) __createBinding(exports3, m3, p2); + }; + var __classPrivateFieldSet2 = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; + }; + var __classPrivateFieldGet2 = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { + if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); + }; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + var _FileFromPath_path; + var _FileFromPath_start; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.fileFromPath = exports2.fileFromPathSync = void 0; + var fs_1 = __require("fs"); + var path_1 = __require("path"); + var node_domexception_1 = __importDefault(require_node_domexception()); + var File_1 = require_File(); + var isPlainObject_1 = __importDefault(require_isPlainObject3()); + __exportStar(require_isFile(), exports2); + var MESSAGE = "The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired."; + var FileFromPath = class _FileFromPath { + constructor(input) { + _FileFromPath_path.set(this, void 0); + _FileFromPath_start.set(this, void 0); + __classPrivateFieldSet2(this, _FileFromPath_path, input.path, "f"); + __classPrivateFieldSet2(this, _FileFromPath_start, input.start || 0, "f"); + this.name = (0, path_1.basename)(__classPrivateFieldGet2(this, _FileFromPath_path, "f")); + this.size = input.size; + this.lastModified = input.lastModified; + } + slice(start, end) { + return new _FileFromPath({ + path: __classPrivateFieldGet2(this, _FileFromPath_path, "f"), + lastModified: this.lastModified, + size: end - start, + start + }); + } + async *stream() { + const { mtimeMs } = await fs_1.promises.stat(__classPrivateFieldGet2(this, _FileFromPath_path, "f")); + if (mtimeMs > this.lastModified) { + throw new node_domexception_1.default(MESSAGE, "NotReadableError"); + } + if (this.size) { + yield* (0, fs_1.createReadStream)(__classPrivateFieldGet2(this, _FileFromPath_path, "f"), { + start: __classPrivateFieldGet2(this, _FileFromPath_start, "f"), + end: __classPrivateFieldGet2(this, _FileFromPath_start, "f") + this.size - 1 + }); + } + } + get [(_FileFromPath_path = /* @__PURE__ */ new WeakMap(), _FileFromPath_start = /* @__PURE__ */ new WeakMap(), Symbol.toStringTag)]() { + return "File"; + } + }; + function createFileFromPath(path10, { mtimeMs, size }, filenameOrOptions, options = {}) { + let filename; + if ((0, isPlainObject_1.default)(filenameOrOptions)) { + [options, filename] = [filenameOrOptions, void 0]; + } else { + filename = filenameOrOptions; + } + const file = new FileFromPath({ path: path10, size, lastModified: mtimeMs }); + if (!filename) { + filename = file.name; + } + return new File_1.File([file], filename, { + ...options, + lastModified: file.lastModified + }); + } + function fileFromPathSync(path10, filenameOrOptions, options = {}) { + const stats = (0, fs_1.statSync)(path10); + return createFileFromPath(path10, stats, filenameOrOptions, options); + } + exports2.fileFromPathSync = fileFromPathSync; + async function fileFromPath(path10, filenameOrOptions, options) { + const stats = await fs_1.promises.stat(path10); + return createFileFromPath(path10, stats, filenameOrOptions, options); + } + exports2.fileFromPath = fileFromPath; + } +}); + // node_modules/@anthropic-ai/sdk/_shims/node-runtime.js -var require_node_runtime2 = __commonJS({ +var require_node_runtime = __commonJS({ "node_modules/@anthropic-ai/sdk/_shims/node-runtime.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { + var desc = Object.getOwnPropertyDescriptor(m3, k7); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { - return m6[k7]; + return m3[k7]; } }; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { + Object.defineProperty(o2, k22, desc); + }) : (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; + o2[k22] = m3[k7]; })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + }) : function(o2, v2) { + o2["default"] = v2; }); var __importStar = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; @@ -113368,14 +118085,14 @@ var require_node_runtime2 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRuntime = void 0; - var nf = __importStar((init_lib(), __toCommonJS(lib_exports2))); + var nf = __importStar((init_lib4(), __toCommonJS(lib_exports2))); var fd = __importStar(require_cjs()); var agentkeepalive_1 = __importDefault(require_agentkeepalive()); var abort_controller_1 = require_abort_controller(); var node_fs_1 = __require("fs"); var form_data_encoder_1 = require_cjs2(); var node_stream_1 = __require("stream"); - var MultipartBody_1 = require_MultipartBody2(); + var MultipartBody_1 = require_MultipartBody(); var web_1 = __require("stream/web"); var fileFromPathWarned = false; async function fileFromPath(path10, ...args) { @@ -113424,27 +118141,27 @@ var require_node_runtime2 = __commonJS({ }); // node_modules/@anthropic-ai/sdk/_shims/auto/runtime-node.js -var require_runtime_node2 = __commonJS({ +var require_runtime_node = __commonJS({ "node_modules/@anthropic-ai/sdk/_shims/auto/runtime-node.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { + var desc = Object.getOwnPropertyDescriptor(m3, k7); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { - return m6[k7]; + return m3[k7]; } }; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { + Object.defineProperty(o2, k22, desc); + }) : (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; + o2[k22] = m3[k7]; })); - var __exportStar = exports2 && exports2.__exportStar || function(m6, exports3) { - for (var p6 in m6) if (p6 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p6)) __createBinding(exports3, m6, p6); + var __exportStar = exports2 && exports2.__exportStar || function(m3, exports3) { + for (var p2 in m3) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p2)) __createBinding(exports3, m3, p2); }; Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar(require_node_runtime2(), exports2); + __exportStar(require_node_runtime(), exports2); } }); @@ -113452,8 +118169,8 @@ var require_runtime_node2 = __commonJS({ var require_shims2 = __commonJS({ "node_modules/@anthropic-ai/sdk/_shims/index.js"(exports2) { "use strict"; - var shims = require_registry2(); - var auto2 = require_runtime_node2(); + var shims = require_registry(); + var auto2 = require_runtime_node(); if (!shims.kind) shims.setShims(auto2.getRuntime(), { auto: true }); for (const property of Object.keys(shims)) { Object.defineProperty(exports2, property, { @@ -113466,15 +118183,15 @@ var require_shims2 = __commonJS({ }); // node_modules/@anthropic-ai/sdk/streaming.js -var require_streaming2 = __commonJS({ +var require_streaming3 = __commonJS({ "node_modules/@anthropic-ai/sdk/streaming.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.readableStreamAsyncIterable = exports2._decodeChunks = exports2._iterSSEMessages = exports2.Stream = void 0; var index_1 = require_shims2(); - var error_1 = require_error3(); - var core_1 = require_core3(); - var error_2 = require_error3(); + var error_1 = require_error4(); + var core_1 = require_core2(); + var error_2 = require_error4(); var Stream3 = class _Stream { constructor(iterator2, controller) { this.iterator = iterator2; @@ -113578,24 +118295,24 @@ var require_streaming2 = __commonJS({ * independently read from at different speeds. */ tee() { - const left = []; - const right = []; + const left2 = []; + const right2 = []; const iterator2 = this.iterator(); const teeIterator = (queue2) => { return { next: () => { if (queue2.length === 0) { const result = iterator2.next(); - left.push(result); - right.push(result); + left2.push(result); + right2.push(result); } return queue2.shift(); } }; }; return [ - new _Stream(() => teeIterator(left), this.controller), - new _Stream(() => teeIterator(right), this.controller) + new _Stream(() => teeIterator(left2), this.controller), + new _Stream(() => teeIterator(right2), this.controller) ]; } /** @@ -113846,7 +118563,7 @@ var require_streaming2 = __commonJS({ }); // node_modules/@anthropic-ai/sdk/uploads.js -var require_uploads3 = __commonJS({ +var require_uploads4 = __commonJS({ "node_modules/@anthropic-ai/sdk/uploads.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -113906,17 +118623,17 @@ var require_uploads3 = __commonJS({ } function propsForError(value) { const props = Object.getOwnPropertyNames(value); - return `[${props.map((p6) => `"${p6}"`).join(", ")}]`; + return `[${props.map((p2) => `"${p2}"`).join(", ")}]`; } function getName(value) { return getStringFromMaybeBuffer(value.name) || getStringFromMaybeBuffer(value.filename) || // For fs.ReadStream getStringFromMaybeBuffer(value.path)?.split(/[\\/]/).pop(); } - var getStringFromMaybeBuffer = (x6) => { - if (typeof x6 === "string") - return x6; - if (typeof Buffer !== "undefined" && x6 instanceof Buffer) - return String(x6); + var getStringFromMaybeBuffer = (x2) => { + if (typeof x2 === "string") + return x2; + if (typeof Buffer !== "undefined" && x2 instanceof Buffer) + return String(x2); return void 0; }; var isAsyncIterableIterator = (value) => value != null && typeof value === "object" && typeof value[Symbol.asyncIterator] === "function"; @@ -113976,16 +118693,16 @@ var require_uploads3 = __commonJS({ }); // node_modules/@anthropic-ai/sdk/core.js -var require_core3 = __commonJS({ +var require_core2 = __commonJS({ "node_modules/@anthropic-ai/sdk/core.js"(exports2) { "use strict"; - var __classPrivateFieldSet = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { + var __classPrivateFieldSet2 = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; }; - var __classPrivateFieldGet = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { + var __classPrivateFieldGet2 = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); @@ -113994,11 +118711,11 @@ var require_core3 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.isObj = exports2.toBase64 = exports2.getRequiredHeader = exports2.isHeadersProtocol = exports2.isRunningInBrowser = exports2.debug = exports2.hasOwn = exports2.isEmptyObj = exports2.maybeCoerceBoolean = exports2.maybeCoerceFloat = exports2.maybeCoerceInteger = exports2.coerceBoolean = exports2.coerceFloat = exports2.coerceInteger = exports2.readEnv = exports2.ensurePresent = exports2.castToError = exports2.sleep = exports2.safeJSON = exports2.isRequestOptions = exports2.createResponseHeaders = exports2.PagePromise = exports2.AbstractPage = exports2.APIClient = exports2.APIPromise = exports2.createForm = exports2.multipartFormRequestOptions = exports2.maybeMultipartFormRequestOptions = void 0; var version_1 = require_version2(); - var streaming_1 = require_streaming2(); - var error_1 = require_error3(); + var streaming_1 = require_streaming3(); + var error_1 = require_error4(); var index_1 = require_shims2(); - var uploads_1 = require_uploads3(); - var uploads_2 = require_uploads3(); + var uploads_1 = require_uploads4(); + var uploads_2 = require_uploads4(); Object.defineProperty(exports2, "maybeMultipartFormRequestOptions", { enumerable: true, get: function() { return uploads_2.maybeMultipartFormRequestOptions; } }); @@ -114036,8 +118753,8 @@ var require_core3 = __commonJS({ } var APIPromise = class _APIPromise extends Promise { constructor(responsePromise, parseResponse = defaultParseResponse) { - super((resolve4) => { - resolve4(null); + super((resolve8) => { + resolve8(null); }); this.responsePromise = responsePromise; this.parseResponse = parseResponse; @@ -114059,7 +118776,7 @@ var require_core3 = __commonJS({ * - `import '@anthropic-ai/sdk/shims/web'` (otherwise) */ asResponse() { - return this.responsePromise.then((p6) => p6.response); + return this.responsePromise.then((p2) => p2.response); } /** * Gets the parsed response data and the raw `Response` instance. @@ -114232,7 +118949,7 @@ var require_core3 = __commonJS({ * This is useful for cases where you want to add certain headers based off of * the request properties, e.g. `method` or `url`. */ - async prepareRequest(request3, { url: url2, options }) { + async prepareRequest(request2, { url: url2, options }) { } parseHeaders(headers) { return !headers ? {} : Symbol.iterator in headers ? Object.fromEntries(Array.from(headers).map((header) => [...header])) : { ...headers }; @@ -114287,8 +119004,8 @@ var require_core3 = __commonJS({ return { response, options, controller }; } requestAPIList(Page, options) { - const request3 = this.makeRequest(options, null); - return new PagePromise(this, request3, Page); + const request2 = this.makeRequest(options, null); + return new PagePromise(this, request2, Page); } buildURL(path10, query) { const url2 = isAbsoluteURL(path10) ? new URL(path10) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path10.startsWith("/") ? path10.slice(1) : path10)); @@ -114381,7 +119098,7 @@ var require_core3 = __commonJS({ var AbstractPage = class { constructor(client2, response, body2, options) { _AbstractPage_client.set(this, void 0); - __classPrivateFieldSet(this, _AbstractPage_client, client2, "f"); + __classPrivateFieldSet2(this, _AbstractPage_client, client2, "f"); this.options = options; this.response = response; this.body = body2; @@ -114408,7 +119125,7 @@ var require_core3 = __commonJS({ nextOptions.query = void 0; nextOptions.path = nextInfo.url.toString(); } - return await __classPrivateFieldGet(this, _AbstractPage_client, "f").requestAPIList(this.constructor, nextOptions); + return await __classPrivateFieldGet2(this, _AbstractPage_client, "f").requestAPIList(this.constructor, nextOptions); } async *iterPages() { let page = this; @@ -114428,8 +119145,8 @@ var require_core3 = __commonJS({ }; exports2.AbstractPage = AbstractPage; var PagePromise = class extends APIPromise { - constructor(client2, request3, Page) { - super(request3, async (props) => new Page(client2, props.response, await defaultParseResponse(props), props.options)); + constructor(client2, request2, Page) { + super(request2, async (props) => new Page(client2, props.response, await defaultParseResponse(props), props.options)); } /** * Allow auto-paginating iteration on an unawaited list call, eg: @@ -114601,16 +119318,16 @@ var require_core3 = __commonJS({ var isAbsoluteURL = (url2) => { return startsWithSchemeRegexp.test(url2); }; - var sleep = (ms2) => new Promise((resolve4) => setTimeout(resolve4, ms2)); + var sleep = (ms2) => new Promise((resolve8) => setTimeout(resolve8, ms2)); exports2.sleep = sleep; - var validatePositiveInteger = (name, n12) => { - if (typeof n12 !== "number" || !Number.isInteger(n12)) { + var validatePositiveInteger = (name, n8) => { + if (typeof n8 !== "number" || !Number.isInteger(n8)) { throw new error_1.AnthropicError(`${name} must be an integer`); } - if (n12 < 0) { + if (n8 < 0) { throw new error_1.AnthropicError(`${name} must be a positive integer`); } - return n12; + return n8; }; var castToError = (err) => { if (err instanceof Error) @@ -114624,12 +119341,12 @@ var require_core3 = __commonJS({ return value; }; exports2.ensurePresent = ensurePresent; - var readEnv = (env2) => { + var readEnv = (env3) => { if (typeof process !== "undefined") { - return process.env?.[env2]?.trim() ?? void 0; + return process.env?.[env3]?.trim() ?? void 0; } if (typeof Deno !== "undefined") { - return Deno.env?.get?.(env2)?.trim(); + return Deno.env?.get?.(env3)?.trim(); } return void 0; }; @@ -114715,8 +119432,8 @@ var require_core3 = __commonJS({ var uuid4 = () => { return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c6) => { const r6 = Math.random() * 16 | 0; - const v8 = c6 === "x" ? r6 : r6 & 3 | 8; - return v8.toString(16); + const v2 = c6 === "x" ? r6 : r6 & 3 | 8; + return v2.toString(16); }); }; var isRunningInBrowser = () => { @@ -114757,7 +119474,7 @@ var require_core3 = __commonJS({ throw new Error(`Could not find ${header} header`); }; exports2.getRequiredHeader = getRequiredHeader; - var toBase642 = (str) => { + var toBase643 = (str) => { if (!str) return ""; if (typeof Buffer !== "undefined") { @@ -114768,7 +119485,7 @@ var require_core3 = __commonJS({ } throw new error_1.AnthropicError("Cannot generate b64 string; Expected `Buffer` or `btoa` to be defined"); }; - exports2.toBase64 = toBase642; + exports2.toBase64 = toBase643; function isObj(obj) { return obj != null && typeof obj === "object" && !Array.isArray(obj); } @@ -114777,12 +119494,12 @@ var require_core3 = __commonJS({ }); // node_modules/@anthropic-ai/sdk/error.js -var require_error3 = __commonJS({ +var require_error4 = __commonJS({ "node_modules/@anthropic-ai/sdk/error.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.InternalServerError = exports2.RateLimitError = exports2.UnprocessableEntityError = exports2.ConflictError = exports2.NotFoundError = exports2.PermissionDeniedError = exports2.AuthenticationError = exports2.BadRequestError = exports2.APIConnectionTimeoutError = exports2.APIConnectionError = exports2.APIUserAbortError = exports2.APIError = exports2.AnthropicError = void 0; - var core_1 = require_core3(); + var core_1 = require_core2(); var AnthropicError = class extends Error { }; exports2.AnthropicError = AnthropicError; @@ -115164,13 +119881,13 @@ var require_parser5 = __commonJS({ var require_PromptCachingBetaMessageStream = __commonJS({ "node_modules/@anthropic-ai/sdk/lib/PromptCachingBetaMessageStream.js"(exports2) { "use strict"; - var __classPrivateFieldSet = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { + var __classPrivateFieldSet2 = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; }; - var __classPrivateFieldGet = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { + var __classPrivateFieldGet2 = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); @@ -115197,8 +119914,8 @@ var require_PromptCachingBetaMessageStream = __commonJS({ var _PromptCachingBetaMessageStream_accumulateMessage; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.PromptCachingBetaMessageStream = void 0; - var error_1 = require_error3(); - var streaming_1 = require_streaming2(); + var error_1 = require_error4(); + var streaming_1 = require_streaming3(); var parser_1 = require_parser5(); var JSON_BUF_PROPERTY = "__json_buf"; var PromptCachingBetaMessageStream = class _PromptCachingBetaMessageStream { @@ -115224,12 +119941,12 @@ var require_PromptCachingBetaMessageStream = __commonJS({ _PromptCachingBetaMessageStream_aborted.set(this, false); _PromptCachingBetaMessageStream_catchingPromiseCreated.set(this, false); _PromptCachingBetaMessageStream_handleError.set(this, (error2) => { - __classPrivateFieldSet(this, _PromptCachingBetaMessageStream_errored, true, "f"); + __classPrivateFieldSet2(this, _PromptCachingBetaMessageStream_errored, true, "f"); if (error2 instanceof Error && error2.name === "AbortError") { error2 = new error_1.APIUserAbortError(); } if (error2 instanceof error_1.APIUserAbortError) { - __classPrivateFieldSet(this, _PromptCachingBetaMessageStream_aborted, true, "f"); + __classPrivateFieldSet2(this, _PromptCachingBetaMessageStream_aborted, true, "f"); return this._emit("abort", error2); } if (error2 instanceof error_1.AnthropicError) { @@ -115242,17 +119959,17 @@ var require_PromptCachingBetaMessageStream = __commonJS({ } return this._emit("error", new error_1.AnthropicError(String(error2))); }); - __classPrivateFieldSet(this, _PromptCachingBetaMessageStream_connectedPromise, new Promise((resolve4, reject2) => { - __classPrivateFieldSet(this, _PromptCachingBetaMessageStream_resolveConnectedPromise, resolve4, "f"); - __classPrivateFieldSet(this, _PromptCachingBetaMessageStream_rejectConnectedPromise, reject2, "f"); + __classPrivateFieldSet2(this, _PromptCachingBetaMessageStream_connectedPromise, new Promise((resolve8, reject2) => { + __classPrivateFieldSet2(this, _PromptCachingBetaMessageStream_resolveConnectedPromise, resolve8, "f"); + __classPrivateFieldSet2(this, _PromptCachingBetaMessageStream_rejectConnectedPromise, reject2, "f"); }), "f"); - __classPrivateFieldSet(this, _PromptCachingBetaMessageStream_endPromise, new Promise((resolve4, reject2) => { - __classPrivateFieldSet(this, _PromptCachingBetaMessageStream_resolveEndPromise, resolve4, "f"); - __classPrivateFieldSet(this, _PromptCachingBetaMessageStream_rejectEndPromise, reject2, "f"); + __classPrivateFieldSet2(this, _PromptCachingBetaMessageStream_endPromise, new Promise((resolve8, reject2) => { + __classPrivateFieldSet2(this, _PromptCachingBetaMessageStream_resolveEndPromise, resolve8, "f"); + __classPrivateFieldSet2(this, _PromptCachingBetaMessageStream_rejectEndPromise, reject2, "f"); }), "f"); - __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_connectedPromise, "f").catch(() => { + __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_connectedPromise, "f").catch(() => { }); - __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_endPromise, "f").catch(() => { + __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_endPromise, "f").catch(() => { }); } /** @@ -115279,7 +119996,7 @@ var require_PromptCachingBetaMessageStream = __commonJS({ executor().then(() => { this._emitFinal(); this._emit("end"); - }, __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_handleError, "f")); + }, __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_handleError, "f")); } _addPromptCachingBetaMessageParam(message) { this.messages.push(message); @@ -115297,31 +120014,31 @@ var require_PromptCachingBetaMessageStream = __commonJS({ this.controller.abort(); signal.addEventListener("abort", () => this.controller.abort()); } - __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_beginRequest).call(this); + __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_beginRequest).call(this); const stream5 = await messages.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }); this._connected(); for await (const event of stream5) { - __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_addStreamEvent).call(this, event); + __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_addStreamEvent).call(this, event); } if (stream5.controller.signal?.aborted) { throw new error_1.APIUserAbortError(); } - __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_endRequest).call(this); + __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_endRequest).call(this); } _connected() { if (this.ended) return; - __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_resolveConnectedPromise, "f").call(this); + __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_resolveConnectedPromise, "f").call(this); this._emit("connect"); } get ended() { - return __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_ended, "f"); + return __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_ended, "f"); } get errored() { - return __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_errored, "f"); + return __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_errored, "f"); } get aborted() { - return __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_aborted, "f"); + return __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_aborted, "f"); } abort() { this.controller.abort(); @@ -115334,7 +120051,7 @@ var require_PromptCachingBetaMessageStream = __commonJS({ * @returns this PromptCachingBetaMessageStream, so that calls can be chained */ on(event, listener) { - const listeners = __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_listeners, "f")[event] || (__classPrivateFieldGet(this, _PromptCachingBetaMessageStream_listeners, "f")[event] = []); + const listeners = __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_listeners, "f")[event] || (__classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_listeners, "f")[event] = []); listeners.push({ listener }); return this; } @@ -115346,10 +120063,10 @@ var require_PromptCachingBetaMessageStream = __commonJS({ * @returns this PromptCachingBetaMessageStream, so that calls can be chained */ off(event, listener) { - const listeners = __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_listeners, "f")[event]; + const listeners = __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_listeners, "f")[event]; if (!listeners) return this; - const index2 = listeners.findIndex((l6) => l6.listener === listener); + const index2 = listeners.findIndex((l3) => l3.listener === listener); if (index2 >= 0) listeners.splice(index2, 1); return this; @@ -115360,7 +120077,7 @@ var require_PromptCachingBetaMessageStream = __commonJS({ * @returns this PromptCachingBetaMessageStream, so that calls can be chained */ once(event, listener) { - const listeners = __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_listeners, "f")[event] || (__classPrivateFieldGet(this, _PromptCachingBetaMessageStream_listeners, "f")[event] = []); + const listeners = __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_listeners, "f")[event] || (__classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_listeners, "f")[event] = []); listeners.push({ listener, once: true }); return this; } @@ -115376,19 +120093,19 @@ var require_PromptCachingBetaMessageStream = __commonJS({ * const message = await stream.emitted('message') // rejects if the stream errors */ emitted(event) { - return new Promise((resolve4, reject2) => { - __classPrivateFieldSet(this, _PromptCachingBetaMessageStream_catchingPromiseCreated, true, "f"); + return new Promise((resolve8, reject2) => { + __classPrivateFieldSet2(this, _PromptCachingBetaMessageStream_catchingPromiseCreated, true, "f"); if (event !== "error") this.once("error", reject2); - this.once(event, resolve4); + this.once(event, resolve8); }); } async done() { - __classPrivateFieldSet(this, _PromptCachingBetaMessageStream_catchingPromiseCreated, true, "f"); - await __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_endPromise, "f"); + __classPrivateFieldSet2(this, _PromptCachingBetaMessageStream_catchingPromiseCreated, true, "f"); + await __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_endPromise, "f"); } get currentMessage() { - return __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_currentMessageSnapshot, "f"); + return __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_currentMessageSnapshot, "f"); } /** * @returns a promise that resolves with the the final assistant PromptCachingBetaMessage response, @@ -115396,7 +120113,7 @@ var require_PromptCachingBetaMessageStream = __commonJS({ */ async finalMessage() { await this.done(); - return __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_getFinalMessage).call(this); + return __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_getFinalMessage).call(this); } /** * @returns a promise that resolves with the the final assistant PromptCachingBetaMessage's text response, concatenated @@ -115405,44 +120122,44 @@ var require_PromptCachingBetaMessageStream = __commonJS({ */ async finalText() { await this.done(); - return __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_getFinalText).call(this); + return __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_getFinalText).call(this); } _emit(event, ...args) { - if (__classPrivateFieldGet(this, _PromptCachingBetaMessageStream_ended, "f")) + if (__classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_ended, "f")) return; if (event === "end") { - __classPrivateFieldSet(this, _PromptCachingBetaMessageStream_ended, true, "f"); - __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_resolveEndPromise, "f").call(this); + __classPrivateFieldSet2(this, _PromptCachingBetaMessageStream_ended, true, "f"); + __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_resolveEndPromise, "f").call(this); } - const listeners = __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_listeners, "f")[event]; + const listeners = __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_listeners, "f")[event]; if (listeners) { - __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_listeners, "f")[event] = listeners.filter((l6) => !l6.once); + __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_listeners, "f")[event] = listeners.filter((l3) => !l3.once); listeners.forEach(({ listener }) => listener(...args)); } if (event === "abort") { const error2 = args[0]; - if (!__classPrivateFieldGet(this, _PromptCachingBetaMessageStream_catchingPromiseCreated, "f") && !listeners?.length) { + if (!__classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_catchingPromiseCreated, "f") && !listeners?.length) { Promise.reject(error2); } - __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_rejectConnectedPromise, "f").call(this, error2); - __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_rejectEndPromise, "f").call(this, error2); + __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_rejectConnectedPromise, "f").call(this, error2); + __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_rejectEndPromise, "f").call(this, error2); this._emit("end"); return; } if (event === "error") { const error2 = args[0]; - if (!__classPrivateFieldGet(this, _PromptCachingBetaMessageStream_catchingPromiseCreated, "f") && !listeners?.length) { + if (!__classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_catchingPromiseCreated, "f") && !listeners?.length) { Promise.reject(error2); } - __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_rejectConnectedPromise, "f").call(this, error2); - __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_rejectEndPromise, "f").call(this, error2); + __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_rejectConnectedPromise, "f").call(this, error2); + __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_rejectEndPromise, "f").call(this, error2); this._emit("end"); } } _emitFinal() { const finalPromptCachingBetaMessage = this.receivedMessages.at(-1); if (finalPromptCachingBetaMessage) { - this._emit("finalPromptCachingBetaMessage", __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_getFinalMessage).call(this)); + this._emit("finalPromptCachingBetaMessage", __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_getFinalMessage).call(this)); } } async _fromReadableStream(readableStream, options) { @@ -115452,16 +120169,16 @@ var require_PromptCachingBetaMessageStream = __commonJS({ this.controller.abort(); signal.addEventListener("abort", () => this.controller.abort()); } - __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_beginRequest).call(this); + __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_beginRequest).call(this); this._connected(); const stream5 = streaming_1.Stream.fromReadableStream(readableStream, this.controller); for await (const event of stream5) { - __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_addStreamEvent).call(this, event); + __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_addStreamEvent).call(this, event); } if (stream5.controller.signal?.aborted) { throw new error_1.APIUserAbortError(); } - __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_endRequest).call(this); + __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_endRequest).call(this); } [(_PromptCachingBetaMessageStream_currentMessageSnapshot = /* @__PURE__ */ new WeakMap(), _PromptCachingBetaMessageStream_connectedPromise = /* @__PURE__ */ new WeakMap(), _PromptCachingBetaMessageStream_resolveConnectedPromise = /* @__PURE__ */ new WeakMap(), _PromptCachingBetaMessageStream_rejectConnectedPromise = /* @__PURE__ */ new WeakMap(), _PromptCachingBetaMessageStream_endPromise = /* @__PURE__ */ new WeakMap(), _PromptCachingBetaMessageStream_resolveEndPromise = /* @__PURE__ */ new WeakMap(), _PromptCachingBetaMessageStream_rejectEndPromise = /* @__PURE__ */ new WeakMap(), _PromptCachingBetaMessageStream_listeners = /* @__PURE__ */ new WeakMap(), _PromptCachingBetaMessageStream_ended = /* @__PURE__ */ new WeakMap(), _PromptCachingBetaMessageStream_errored = /* @__PURE__ */ new WeakMap(), _PromptCachingBetaMessageStream_aborted = /* @__PURE__ */ new WeakMap(), _PromptCachingBetaMessageStream_catchingPromiseCreated = /* @__PURE__ */ new WeakMap(), _PromptCachingBetaMessageStream_handleError = /* @__PURE__ */ new WeakMap(), _PromptCachingBetaMessageStream_instances = /* @__PURE__ */ new WeakSet(), _PromptCachingBetaMessageStream_getFinalMessage = function _PromptCachingBetaMessageStream_getFinalMessage2() { if (this.receivedMessages.length === 0) { @@ -115480,11 +120197,11 @@ var require_PromptCachingBetaMessageStream = __commonJS({ }, _PromptCachingBetaMessageStream_beginRequest = function _PromptCachingBetaMessageStream_beginRequest2() { if (this.ended) return; - __classPrivateFieldSet(this, _PromptCachingBetaMessageStream_currentMessageSnapshot, void 0, "f"); + __classPrivateFieldSet2(this, _PromptCachingBetaMessageStream_currentMessageSnapshot, void 0, "f"); }, _PromptCachingBetaMessageStream_addStreamEvent = function _PromptCachingBetaMessageStream_addStreamEvent2(event) { if (this.ended) return; - const messageSnapshot = __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_accumulateMessage).call(this, event); + const messageSnapshot = __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_instances, "m", _PromptCachingBetaMessageStream_accumulateMessage).call(this, event); this._emit("streamEvent", event, messageSnapshot); switch (event.type) { case "content_block_delta": { @@ -115508,7 +120225,7 @@ var require_PromptCachingBetaMessageStream = __commonJS({ break; } case "message_start": { - __classPrivateFieldSet(this, _PromptCachingBetaMessageStream_currentMessageSnapshot, messageSnapshot, "f"); + __classPrivateFieldSet2(this, _PromptCachingBetaMessageStream_currentMessageSnapshot, messageSnapshot, "f"); break; } case "content_block_start": @@ -115519,14 +120236,14 @@ var require_PromptCachingBetaMessageStream = __commonJS({ if (this.ended) { throw new error_1.AnthropicError(`stream has ended, this shouldn't happen`); } - const snapshot2 = __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_currentMessageSnapshot, "f"); + const snapshot2 = __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_currentMessageSnapshot, "f"); if (!snapshot2) { throw new error_1.AnthropicError(`request ended without sending any chunks`); } - __classPrivateFieldSet(this, _PromptCachingBetaMessageStream_currentMessageSnapshot, void 0, "f"); + __classPrivateFieldSet2(this, _PromptCachingBetaMessageStream_currentMessageSnapshot, void 0, "f"); return snapshot2; }, _PromptCachingBetaMessageStream_accumulateMessage = function _PromptCachingBetaMessageStream_accumulateMessage2(event) { - let snapshot2 = __classPrivateFieldGet(this, _PromptCachingBetaMessageStream_currentMessageSnapshot, "f"); + let snapshot2 = __classPrivateFieldGet2(this, _PromptCachingBetaMessageStream_currentMessageSnapshot, "f"); if (event.type === "message_start") { if (snapshot2) { throw new error_1.AnthropicError(`Unexpected event order, got ${event.type} before receiving "message_stop"`); @@ -115607,7 +120324,7 @@ var require_PromptCachingBetaMessageStream = __commonJS({ if (done) { return { value: void 0, done: true }; } - return new Promise((resolve4, reject2) => readQueue.push({ resolve: resolve4, reject: reject2 })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true }); + return new Promise((resolve8, reject2) => readQueue.push({ resolve: resolve8, reject: reject2 })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true }); } const chunk = pushQueue.shift(); return { value: chunk, done: false }; @@ -115662,23 +120379,23 @@ var require_messages3 = __commonJS({ var require_prompt_caching = __commonJS({ "node_modules/@anthropic-ai/sdk/resources/beta/prompt-caching/prompt-caching.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { + var desc = Object.getOwnPropertyDescriptor(m3, k7); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { - return m6[k7]; + return m3[k7]; } }; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { + Object.defineProperty(o2, k22, desc); + }) : (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; + o2[k22] = m3[k7]; })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + }) : function(o2, v2) { + o2["default"] = v2; }); var __importStar = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; @@ -115710,23 +120427,23 @@ var require_prompt_caching = __commonJS({ var require_beta2 = __commonJS({ "node_modules/@anthropic-ai/sdk/resources/beta/beta.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { + var desc = Object.getOwnPropertyDescriptor(m3, k7); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { - return m6[k7]; + return m3[k7]; } }; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { + Object.defineProperty(o2, k22, desc); + }) : (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; + o2[k22] = m3[k7]; })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + }) : function(o2, v2) { + o2["default"] = v2; }); var __importStar = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; @@ -115755,7 +120472,7 @@ var require_beta2 = __commonJS({ }); // node_modules/@anthropic-ai/sdk/resources/completions.js -var require_completions5 = __commonJS({ +var require_completions4 = __commonJS({ "node_modules/@anthropic-ai/sdk/resources/completions.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -115781,13 +120498,13 @@ var require_completions5 = __commonJS({ var require_MessageStream = __commonJS({ "node_modules/@anthropic-ai/sdk/lib/MessageStream.js"(exports2) { "use strict"; - var __classPrivateFieldSet = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { + var __classPrivateFieldSet2 = exports2 && exports2.__classPrivateFieldSet || function(receiver, state4, value, kind, f6) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a setter"); if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return kind === "a" ? f6.call(receiver, value) : f6 ? f6.value = value : state4.set(receiver, value), value; }; - var __classPrivateFieldGet = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { + var __classPrivateFieldGet2 = exports2 && exports2.__classPrivateFieldGet || function(receiver, state4, kind, f6) { if (kind === "a" && !f6) throw new TypeError("Private accessor was defined without a getter"); if (typeof state4 === "function" ? receiver !== state4 || !f6 : !state4.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f6 : kind === "a" ? f6.call(receiver) : f6 ? f6.value : state4.get(receiver); @@ -115814,8 +120531,8 @@ var require_MessageStream = __commonJS({ var _MessageStream_accumulateMessage; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.MessageStream = void 0; - var error_1 = require_error3(); - var streaming_1 = require_streaming2(); + var error_1 = require_error4(); + var streaming_1 = require_streaming3(); var parser_1 = require_parser5(); var JSON_BUF_PROPERTY = "__json_buf"; var MessageStream = class _MessageStream { @@ -115841,12 +120558,12 @@ var require_MessageStream = __commonJS({ _MessageStream_aborted.set(this, false); _MessageStream_catchingPromiseCreated.set(this, false); _MessageStream_handleError.set(this, (error2) => { - __classPrivateFieldSet(this, _MessageStream_errored, true, "f"); + __classPrivateFieldSet2(this, _MessageStream_errored, true, "f"); if (error2 instanceof Error && error2.name === "AbortError") { error2 = new error_1.APIUserAbortError(); } if (error2 instanceof error_1.APIUserAbortError) { - __classPrivateFieldSet(this, _MessageStream_aborted, true, "f"); + __classPrivateFieldSet2(this, _MessageStream_aborted, true, "f"); return this._emit("abort", error2); } if (error2 instanceof error_1.AnthropicError) { @@ -115859,17 +120576,17 @@ var require_MessageStream = __commonJS({ } return this._emit("error", new error_1.AnthropicError(String(error2))); }); - __classPrivateFieldSet(this, _MessageStream_connectedPromise, new Promise((resolve4, reject2) => { - __classPrivateFieldSet(this, _MessageStream_resolveConnectedPromise, resolve4, "f"); - __classPrivateFieldSet(this, _MessageStream_rejectConnectedPromise, reject2, "f"); + __classPrivateFieldSet2(this, _MessageStream_connectedPromise, new Promise((resolve8, reject2) => { + __classPrivateFieldSet2(this, _MessageStream_resolveConnectedPromise, resolve8, "f"); + __classPrivateFieldSet2(this, _MessageStream_rejectConnectedPromise, reject2, "f"); }), "f"); - __classPrivateFieldSet(this, _MessageStream_endPromise, new Promise((resolve4, reject2) => { - __classPrivateFieldSet(this, _MessageStream_resolveEndPromise, resolve4, "f"); - __classPrivateFieldSet(this, _MessageStream_rejectEndPromise, reject2, "f"); + __classPrivateFieldSet2(this, _MessageStream_endPromise, new Promise((resolve8, reject2) => { + __classPrivateFieldSet2(this, _MessageStream_resolveEndPromise, resolve8, "f"); + __classPrivateFieldSet2(this, _MessageStream_rejectEndPromise, reject2, "f"); }), "f"); - __classPrivateFieldGet(this, _MessageStream_connectedPromise, "f").catch(() => { + __classPrivateFieldGet2(this, _MessageStream_connectedPromise, "f").catch(() => { }); - __classPrivateFieldGet(this, _MessageStream_endPromise, "f").catch(() => { + __classPrivateFieldGet2(this, _MessageStream_endPromise, "f").catch(() => { }); } /** @@ -115896,7 +120613,7 @@ var require_MessageStream = __commonJS({ executor().then(() => { this._emitFinal(); this._emit("end"); - }, __classPrivateFieldGet(this, _MessageStream_handleError, "f")); + }, __classPrivateFieldGet2(this, _MessageStream_handleError, "f")); } _addMessageParam(message) { this.messages.push(message); @@ -115914,31 +120631,31 @@ var require_MessageStream = __commonJS({ this.controller.abort(); signal.addEventListener("abort", () => this.controller.abort()); } - __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_beginRequest).call(this); + __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_beginRequest).call(this); const stream5 = await messages.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }); this._connected(); for await (const event of stream5) { - __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_addStreamEvent).call(this, event); + __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_addStreamEvent).call(this, event); } if (stream5.controller.signal?.aborted) { throw new error_1.APIUserAbortError(); } - __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_endRequest).call(this); + __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_endRequest).call(this); } _connected() { if (this.ended) return; - __classPrivateFieldGet(this, _MessageStream_resolveConnectedPromise, "f").call(this); + __classPrivateFieldGet2(this, _MessageStream_resolveConnectedPromise, "f").call(this); this._emit("connect"); } get ended() { - return __classPrivateFieldGet(this, _MessageStream_ended, "f"); + return __classPrivateFieldGet2(this, _MessageStream_ended, "f"); } get errored() { - return __classPrivateFieldGet(this, _MessageStream_errored, "f"); + return __classPrivateFieldGet2(this, _MessageStream_errored, "f"); } get aborted() { - return __classPrivateFieldGet(this, _MessageStream_aborted, "f"); + return __classPrivateFieldGet2(this, _MessageStream_aborted, "f"); } abort() { this.controller.abort(); @@ -115951,7 +120668,7 @@ var require_MessageStream = __commonJS({ * @returns this MessageStream, so that calls can be chained */ on(event, listener) { - const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] || (__classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] = []); + const listeners = __classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event] || (__classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event] = []); listeners.push({ listener }); return this; } @@ -115963,10 +120680,10 @@ var require_MessageStream = __commonJS({ * @returns this MessageStream, so that calls can be chained */ off(event, listener) { - const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event]; + const listeners = __classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event]; if (!listeners) return this; - const index2 = listeners.findIndex((l6) => l6.listener === listener); + const index2 = listeners.findIndex((l3) => l3.listener === listener); if (index2 >= 0) listeners.splice(index2, 1); return this; @@ -115977,7 +120694,7 @@ var require_MessageStream = __commonJS({ * @returns this MessageStream, so that calls can be chained */ once(event, listener) { - const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] || (__classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] = []); + const listeners = __classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event] || (__classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event] = []); listeners.push({ listener, once: true }); return this; } @@ -115993,19 +120710,19 @@ var require_MessageStream = __commonJS({ * const message = await stream.emitted('message') // rejects if the stream errors */ emitted(event) { - return new Promise((resolve4, reject2) => { - __classPrivateFieldSet(this, _MessageStream_catchingPromiseCreated, true, "f"); + return new Promise((resolve8, reject2) => { + __classPrivateFieldSet2(this, _MessageStream_catchingPromiseCreated, true, "f"); if (event !== "error") this.once("error", reject2); - this.once(event, resolve4); + this.once(event, resolve8); }); } async done() { - __classPrivateFieldSet(this, _MessageStream_catchingPromiseCreated, true, "f"); - await __classPrivateFieldGet(this, _MessageStream_endPromise, "f"); + __classPrivateFieldSet2(this, _MessageStream_catchingPromiseCreated, true, "f"); + await __classPrivateFieldGet2(this, _MessageStream_endPromise, "f"); } get currentMessage() { - return __classPrivateFieldGet(this, _MessageStream_currentMessageSnapshot, "f"); + return __classPrivateFieldGet2(this, _MessageStream_currentMessageSnapshot, "f"); } /** * @returns a promise that resolves with the the final assistant Message response, @@ -116013,7 +120730,7 @@ var require_MessageStream = __commonJS({ */ async finalMessage() { await this.done(); - return __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_getFinalMessage).call(this); + return __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_getFinalMessage).call(this); } /** * @returns a promise that resolves with the the final assistant Message's text response, concatenated @@ -116022,44 +120739,44 @@ var require_MessageStream = __commonJS({ */ async finalText() { await this.done(); - return __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_getFinalText).call(this); + return __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_getFinalText).call(this); } _emit(event, ...args) { - if (__classPrivateFieldGet(this, _MessageStream_ended, "f")) + if (__classPrivateFieldGet2(this, _MessageStream_ended, "f")) return; if (event === "end") { - __classPrivateFieldSet(this, _MessageStream_ended, true, "f"); - __classPrivateFieldGet(this, _MessageStream_resolveEndPromise, "f").call(this); + __classPrivateFieldSet2(this, _MessageStream_ended, true, "f"); + __classPrivateFieldGet2(this, _MessageStream_resolveEndPromise, "f").call(this); } - const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event]; + const listeners = __classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event]; if (listeners) { - __classPrivateFieldGet(this, _MessageStream_listeners, "f")[event] = listeners.filter((l6) => !l6.once); + __classPrivateFieldGet2(this, _MessageStream_listeners, "f")[event] = listeners.filter((l3) => !l3.once); listeners.forEach(({ listener }) => listener(...args)); } if (event === "abort") { const error2 = args[0]; - if (!__classPrivateFieldGet(this, _MessageStream_catchingPromiseCreated, "f") && !listeners?.length) { + if (!__classPrivateFieldGet2(this, _MessageStream_catchingPromiseCreated, "f") && !listeners?.length) { Promise.reject(error2); } - __classPrivateFieldGet(this, _MessageStream_rejectConnectedPromise, "f").call(this, error2); - __classPrivateFieldGet(this, _MessageStream_rejectEndPromise, "f").call(this, error2); + __classPrivateFieldGet2(this, _MessageStream_rejectConnectedPromise, "f").call(this, error2); + __classPrivateFieldGet2(this, _MessageStream_rejectEndPromise, "f").call(this, error2); this._emit("end"); return; } if (event === "error") { const error2 = args[0]; - if (!__classPrivateFieldGet(this, _MessageStream_catchingPromiseCreated, "f") && !listeners?.length) { + if (!__classPrivateFieldGet2(this, _MessageStream_catchingPromiseCreated, "f") && !listeners?.length) { Promise.reject(error2); } - __classPrivateFieldGet(this, _MessageStream_rejectConnectedPromise, "f").call(this, error2); - __classPrivateFieldGet(this, _MessageStream_rejectEndPromise, "f").call(this, error2); + __classPrivateFieldGet2(this, _MessageStream_rejectConnectedPromise, "f").call(this, error2); + __classPrivateFieldGet2(this, _MessageStream_rejectEndPromise, "f").call(this, error2); this._emit("end"); } } _emitFinal() { const finalMessage = this.receivedMessages.at(-1); if (finalMessage) { - this._emit("finalMessage", __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_getFinalMessage).call(this)); + this._emit("finalMessage", __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_getFinalMessage).call(this)); } } async _fromReadableStream(readableStream, options) { @@ -116069,16 +120786,16 @@ var require_MessageStream = __commonJS({ this.controller.abort(); signal.addEventListener("abort", () => this.controller.abort()); } - __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_beginRequest).call(this); + __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_beginRequest).call(this); this._connected(); const stream5 = streaming_1.Stream.fromReadableStream(readableStream, this.controller); for await (const event of stream5) { - __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_addStreamEvent).call(this, event); + __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_addStreamEvent).call(this, event); } if (stream5.controller.signal?.aborted) { throw new error_1.APIUserAbortError(); } - __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_endRequest).call(this); + __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_endRequest).call(this); } [(_MessageStream_currentMessageSnapshot = /* @__PURE__ */ new WeakMap(), _MessageStream_connectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_resolveConnectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_rejectConnectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_endPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_resolveEndPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_rejectEndPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_listeners = /* @__PURE__ */ new WeakMap(), _MessageStream_ended = /* @__PURE__ */ new WeakMap(), _MessageStream_errored = /* @__PURE__ */ new WeakMap(), _MessageStream_aborted = /* @__PURE__ */ new WeakMap(), _MessageStream_catchingPromiseCreated = /* @__PURE__ */ new WeakMap(), _MessageStream_handleError = /* @__PURE__ */ new WeakMap(), _MessageStream_instances = /* @__PURE__ */ new WeakSet(), _MessageStream_getFinalMessage = function _MessageStream_getFinalMessage2() { if (this.receivedMessages.length === 0) { @@ -116097,11 +120814,11 @@ var require_MessageStream = __commonJS({ }, _MessageStream_beginRequest = function _MessageStream_beginRequest2() { if (this.ended) return; - __classPrivateFieldSet(this, _MessageStream_currentMessageSnapshot, void 0, "f"); + __classPrivateFieldSet2(this, _MessageStream_currentMessageSnapshot, void 0, "f"); }, _MessageStream_addStreamEvent = function _MessageStream_addStreamEvent2(event) { if (this.ended) return; - const messageSnapshot = __classPrivateFieldGet(this, _MessageStream_instances, "m", _MessageStream_accumulateMessage).call(this, event); + const messageSnapshot = __classPrivateFieldGet2(this, _MessageStream_instances, "m", _MessageStream_accumulateMessage).call(this, event); this._emit("streamEvent", event, messageSnapshot); switch (event.type) { case "content_block_delta": { @@ -116125,7 +120842,7 @@ var require_MessageStream = __commonJS({ break; } case "message_start": { - __classPrivateFieldSet(this, _MessageStream_currentMessageSnapshot, messageSnapshot, "f"); + __classPrivateFieldSet2(this, _MessageStream_currentMessageSnapshot, messageSnapshot, "f"); break; } case "content_block_start": @@ -116136,14 +120853,14 @@ var require_MessageStream = __commonJS({ if (this.ended) { throw new error_1.AnthropicError(`stream has ended, this shouldn't happen`); } - const snapshot2 = __classPrivateFieldGet(this, _MessageStream_currentMessageSnapshot, "f"); + const snapshot2 = __classPrivateFieldGet2(this, _MessageStream_currentMessageSnapshot, "f"); if (!snapshot2) { throw new error_1.AnthropicError(`request ended without sending any chunks`); } - __classPrivateFieldSet(this, _MessageStream_currentMessageSnapshot, void 0, "f"); + __classPrivateFieldSet2(this, _MessageStream_currentMessageSnapshot, void 0, "f"); return snapshot2; }, _MessageStream_accumulateMessage = function _MessageStream_accumulateMessage2(event) { - let snapshot2 = __classPrivateFieldGet(this, _MessageStream_currentMessageSnapshot, "f"); + let snapshot2 = __classPrivateFieldGet2(this, _MessageStream_currentMessageSnapshot, "f"); if (event.type === "message_start") { if (snapshot2) { throw new error_1.AnthropicError(`Unexpected event order, got ${event.type} before receiving "message_stop"`); @@ -116224,7 +120941,7 @@ var require_MessageStream = __commonJS({ if (done) { return { value: void 0, done: true }; } - return new Promise((resolve4, reject2) => readQueue.push({ resolve: resolve4, reject: reject2 })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true }); + return new Promise((resolve8, reject2) => readQueue.push({ resolve: resolve8, reject: reject2 })).then((chunk2) => chunk2 ? { value: chunk2, done: false } : { value: void 0, done: true }); } const chunk = pushQueue.shift(); return { value: chunk, done: false }; @@ -116299,7 +121016,7 @@ var require_resources2 = __commonJS({ Object.defineProperty(exports2, "Beta", { enumerable: true, get: function() { return beta_1.Beta; } }); - var completions_1 = require_completions5(); + var completions_1 = require_completions4(); Object.defineProperty(exports2, "Completions", { enumerable: true, get: function() { return completions_1.Completions; } }); @@ -116314,23 +121031,23 @@ var require_resources2 = __commonJS({ var require_sdk = __commonJS({ "node_modules/@anthropic-ai/sdk/index.js"(exports2, module) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { + var desc = Object.getOwnPropertyDescriptor(m3, k7); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { - return m6[k7]; + return m3[k7]; } }; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { + Object.defineProperty(o2, k22, desc); + }) : (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; + o2[k22] = m3[k7]; })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + }) : function(o2, v2) { + o2["default"] = v2; }); var __importStar = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; @@ -116341,12 +121058,12 @@ var require_sdk = __commonJS({ __setModuleDefault(result, mod); return result; }; - var _a5; + var _a6; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.fileFromPath = exports2.toFile = exports2.UnprocessableEntityError = exports2.PermissionDeniedError = exports2.InternalServerError = exports2.AuthenticationError = exports2.BadRequestError = exports2.RateLimitError = exports2.ConflictError = exports2.NotFoundError = exports2.APIUserAbortError = exports2.APIConnectionTimeoutError = exports2.APIConnectionError = exports2.APIError = exports2.AnthropicError = exports2.AI_PROMPT = exports2.HUMAN_PROMPT = exports2.Anthropic = void 0; - var Errors = __importStar(require_error3()); - var Uploads = __importStar(require_uploads3()); - var Core = __importStar(require_core3()); + var Errors = __importStar(require_error4()); + var Uploads = __importStar(require_uploads4()); + var Core = __importStar(require_core2()); var API = __importStar(require_resources2()); var Anthropic = class extends Core.APIClient { /** @@ -116402,461 +121119,87 @@ var require_sdk = __commonJS({ if (this.apiKey && headers["x-api-key"]) { return; } - if (customHeaders["x-api-key"] === null) { - return; - } - if (this.authToken && headers["authorization"]) { - return; - } - if (customHeaders["authorization"] === null) { - return; - } - throw new Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted'); - } - authHeaders(opts) { - const apiKeyAuth = this.apiKeyAuth(opts); - const bearerAuth = this.bearerAuth(opts); - if (apiKeyAuth != null && !Core.isEmptyObj(apiKeyAuth)) { - return apiKeyAuth; - } - if (bearerAuth != null && !Core.isEmptyObj(bearerAuth)) { - return bearerAuth; - } - return {}; - } - apiKeyAuth(opts) { - if (this.apiKey == null) { - return {}; - } - return { "X-Api-Key": this.apiKey }; - } - bearerAuth(opts) { - if (this.authToken == null) { - return {}; - } - return { Authorization: `Bearer ${this.authToken}` }; - } - }; - exports2.Anthropic = Anthropic; - _a5 = Anthropic; - Anthropic.Anthropic = _a5; - Anthropic.HUMAN_PROMPT = "\n\nHuman:"; - Anthropic.AI_PROMPT = "\n\nAssistant:"; - Anthropic.DEFAULT_TIMEOUT = 6e5; - Anthropic.AnthropicError = Errors.AnthropicError; - Anthropic.APIError = Errors.APIError; - Anthropic.APIConnectionError = Errors.APIConnectionError; - Anthropic.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError; - Anthropic.APIUserAbortError = Errors.APIUserAbortError; - Anthropic.NotFoundError = Errors.NotFoundError; - Anthropic.ConflictError = Errors.ConflictError; - Anthropic.RateLimitError = Errors.RateLimitError; - Anthropic.BadRequestError = Errors.BadRequestError; - Anthropic.AuthenticationError = Errors.AuthenticationError; - Anthropic.InternalServerError = Errors.InternalServerError; - Anthropic.PermissionDeniedError = Errors.PermissionDeniedError; - Anthropic.UnprocessableEntityError = Errors.UnprocessableEntityError; - Anthropic.toFile = Uploads.toFile; - Anthropic.fileFromPath = Uploads.fileFromPath; - exports2.HUMAN_PROMPT = Anthropic.HUMAN_PROMPT, exports2.AI_PROMPT = Anthropic.AI_PROMPT; - exports2.AnthropicError = Errors.AnthropicError, exports2.APIError = Errors.APIError, exports2.APIConnectionError = Errors.APIConnectionError, exports2.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError, exports2.APIUserAbortError = Errors.APIUserAbortError, exports2.NotFoundError = Errors.NotFoundError, exports2.ConflictError = Errors.ConflictError, exports2.RateLimitError = Errors.RateLimitError, exports2.BadRequestError = Errors.BadRequestError, exports2.AuthenticationError = Errors.AuthenticationError, exports2.InternalServerError = Errors.InternalServerError, exports2.PermissionDeniedError = Errors.PermissionDeniedError, exports2.UnprocessableEntityError = Errors.UnprocessableEntityError; - exports2.toFile = Uploads.toFile; - exports2.fileFromPath = Uploads.fileFromPath; - (function(Anthropic2) { - Anthropic2.Completions = API.Completions; - Anthropic2.Messages = API.Messages; - Anthropic2.Beta = API.Beta; - })(Anthropic = exports2.Anthropic || (exports2.Anthropic = {})); - exports2 = module.exports = Anthropic; - exports2.default = Anthropic; - } -}); - -// node_modules/ai-ctrf/dist/models/claude.js -var require_claude = __commonJS({ - "node_modules/ai-ctrf/dist/models/claude.js"(exports2) { - "use strict"; - var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); - }); - } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e6) { - reject2(e6); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e6) { - reject2(e6); - } - } - function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.claudeAI = claudeAI; - exports2.claudeFailedTestSummary = claudeFailedTestSummary2; - var common_1 = require_common3(); - var sdk_1 = require_sdk(); - var consolidated_summary_1 = require_consolidated_summary(); - var constants_1 = require_constants9(); - var assess_1 = require_assess(); - function claudeAI(systemPrompt, prompt, args) { - return __awaiter16(this, void 0, void 0, function* () { - var _a5, _b2, _c6; - const client2 = new sdk_1.Anthropic({ - apiKey: process.env.ANTHROPIC_API_KEY - }); - try { - const response = yield client2.messages.create({ - system: systemPrompt, - messages: [{ role: "user", content: (0, common_1.stripAnsi)(prompt) }], - max_tokens: (_a5 = args.maxTokens) !== null && _a5 !== void 0 ? _a5 : 300, - model: (_b2 = args.model) !== null && _b2 !== void 0 ? _b2 : "claude-3-5-sonnet-20240620", - temperature: (_c6 = args.temperature) !== null && _c6 !== void 0 ? _c6 : 1 - }); - const aiResponseArray = response.content; - const aiResponse = aiResponseArray.filter((block) => block.type === "text").map((block) => block.text).join(" "); - return aiResponse !== "" ? aiResponse : null; - } catch (error2) { - console.error(`Error invoking Claude AI`, error2); - return null; - } - }); - } - function claudeFailedTestSummary2(report_1, args_1, file_1) { - return __awaiter16(this, arguments, void 0, function* (report, args, file, log3 = false) { - var _a5, _b2; - const assessmentType = (_a5 = args.assess) !== null && _a5 !== void 0 ? _a5 : "failed"; - const assessmentConfig = (0, assess_1.getAssessmentConfig)(assessmentType); - const testsToAnalyze = (0, assess_1.filterTestsByAssessment)(report.results.tests, assessmentType); - testsToAnalyze.forEach((test) => { - if (test.extra != null) { - delete test.extra; - } - }); - let logged = false; - let messageCount = 0; - for (const test of testsToAnalyze) { - if (args.maxMessages != null && messageCount >= args.maxMessages) { - break; - } - let prompt = (0, common_1.generateAssessmentPromptContext)(test, report, assessmentType); - if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { - prompt += ` - -Additional Context: -${args.additionalPromptContext}`; - } - let systemPrompt = (_b2 = args.systemPrompt) !== null && _b2 !== void 0 ? _b2 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; - if (args.additionalSystemPromptContext != null && args.additionalSystemPromptContext !== "") { - systemPrompt += ` - -${args.additionalSystemPromptContext}`; - } - const response = yield claudeAI(systemPrompt, prompt, args); - if (response != null) { - test.ai = response; - messageCount++; - if (args.log === true && !logged) { - console.log(` -\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`); - console.log(`\u2728 AI Test Reporter Summary - ${assessmentConfig.label}`); - console.log(`\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -`); - logged = true; - } - if (args.log === true) { - const icon = (0, common_1.getAssessmentIcon)(assessmentType); - console.log(`${icon} ${assessmentConfig.label}: ${test.name} -`); - console.log(`${response} -`); - } - } - } - if (args.consolidate === true) { - yield (0, consolidated_summary_1.generateConsolidatedSummary)(report, "claude", args); - } - if (file !== void 0) { - (0, common_1.saveUpdatedReport)(file, report); - } - return report; - }); - } - } -}); - -// node_modules/ai-ctrf/dist/models/azure-openai.js -var require_azure_openai = __commonJS({ - "node_modules/ai-ctrf/dist/models/azure-openai.js"(exports2) { - "use strict"; - var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); - }); - } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e6) { - reject2(e6); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e6) { - reject2(e6); - } - } - function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.azureOpenAI = azureOpenAI; - exports2.azureOpenAIFailedTestSummary = azureOpenAIFailedTestSummary2; - var openai_1 = require_openai(); - var common_1 = require_common3(); - var consolidated_summary_1 = require_consolidated_summary(); - var constants_1 = require_constants9(); - var assess_1 = require_assess(); - function azureOpenAI(systemPrompt, prompt, args) { - return __awaiter16(this, void 0, void 0, function* () { - var _a5, _b2, _c6, _d2; - const apiKey = process.env.AZURE_OPENAI_API_KEY; - const endpoint2 = process.env.AZURE_OPENAI_ENDPOINT; - const deployment = (_a5 = args.deploymentId) !== null && _a5 !== void 0 ? _a5 : process.env.AZURE_OPENAI_DEPLOYMENT_NAME; - if (apiKey == null || apiKey === "" || endpoint2 == null || endpoint2 === "" || deployment == null || deployment === "") { - console.error("Missing Azure OpenAI configuration. Please set AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT, and AZURE_OPENAI_DEPLOYMENT_NAME environment variables or provide them as arguments."); - return null; - } - const client2 = new openai_1.AzureOpenAI({ - apiKey, - endpoint: endpoint2, - apiVersion: "2024-05-01-preview" - }); - try { - const response = yield client2.chat.completions.create(Object.assign(Object.assign({ model: deployment, messages: [ - { role: "system", content: systemPrompt }, - { role: "user", content: (0, common_1.stripAnsi)(prompt) } - ], max_tokens: (_b2 = args.maxTokens) !== null && _b2 !== void 0 ? _b2 : null, frequency_penalty: args.frequencyPenalty, presence_penalty: args.presencePenalty }, args.temperature !== void 0 ? { temperature: args.temperature } : {}), args.topP !== void 0 ? { top_p: args.topP } : {})); - return (_d2 = (_c6 = response.choices[0].message) === null || _c6 === void 0 ? void 0 : _c6.content) !== null && _d2 !== void 0 ? _d2 : null; - } catch (error2) { - console.error(`Error invoking Azure OpenAI`, error2); - return null; - } - }); - } - function azureOpenAIFailedTestSummary2(report_1, args_1, file_1) { - return __awaiter16(this, arguments, void 0, function* (report, args, file, log3 = false) { - var _a5, _b2; - const assessmentType = (_a5 = args.assess) !== null && _a5 !== void 0 ? _a5 : "failed"; - const assessmentConfig = (0, assess_1.getAssessmentConfig)(assessmentType); - const testsToAnalyze = (0, assess_1.filterTestsByAssessment)(report.results.tests, assessmentType); - testsToAnalyze.forEach((test) => { - if (test.extra != null) { - delete test.extra; - } - }); - let logged = false; - let messageCount = 0; - for (const test of testsToAnalyze) { - if (args.maxMessages != null && messageCount >= args.maxMessages) { - break; - } - let prompt = (0, common_1.generateAssessmentPromptContext)(test, report, assessmentType); - if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { - prompt += ` - -Additional Context: -${args.additionalPromptContext}`; - } - let systemPrompt = (_b2 = args.systemPrompt) !== null && _b2 !== void 0 ? _b2 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; - if (args.additionalSystemPromptContext != null && args.additionalSystemPromptContext !== "") { - systemPrompt += ` - -${args.additionalSystemPromptContext}`; - } - const response = yield azureOpenAI(systemPrompt, prompt, args); - if (response != null) { - test.ai = response; - messageCount++; - if (args.log === true && !logged) { - console.log("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"); - console.log(`\u2728 AI Test Reporter Summary - ${assessmentConfig.label}`); - console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n"); - logged = true; - } - if (args.log === true) { - const icon = (0, common_1.getAssessmentIcon)(assessmentType); - console.log(`${icon} ${assessmentConfig.label}: ${test.name} -`); - console.log(`${response} -`); - } - } - } - if (args.consolidate === true) { - yield (0, consolidated_summary_1.generateConsolidatedSummary)(report, "azure", args); - } - if (file !== void 0) { - (0, common_1.saveUpdatedReport)(file, report); - } - return report; - }); - } - } -}); - -// node_modules/ai-ctrf/dist/models/grok.js -var require_grok = __commonJS({ - "node_modules/ai-ctrf/dist/models/grok.js"(exports2) { - "use strict"; - var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); - }); - } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e6) { - reject2(e6); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e6) { - reject2(e6); - } - } - function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.grokAI = grokAI; - exports2.grokFailedTestSummary = grokFailedTestSummary2; - var common_1 = require_common3(); - var consolidated_summary_1 = require_consolidated_summary(); - var openai_1 = __importDefault(require_openai()); - var constants_1 = require_constants9(); - var assess_1 = require_assess(); - function grokAI(systemPrompt, prompt, args) { - return __awaiter16(this, void 0, void 0, function* () { - var _a5, _b2, _c6, _d2, _e7; - const client2 = new openai_1.default({ - apiKey: process.env.GROK_API_KEY, - baseURL: (_a5 = process.env.GROK_API_BASE_URL) !== null && _a5 !== void 0 ? _a5 : "https://api.x.ai/v1" - }); - try { - const response = yield client2.chat.completions.create(Object.assign(Object.assign({ model: (_b2 = args.model) !== null && _b2 !== void 0 ? _b2 : "grok-beta", messages: [ - { role: "system", content: systemPrompt }, - { role: "user", content: (0, common_1.stripAnsi)(prompt) } - ], max_tokens: (_c6 = args.maxTokens) !== null && _c6 !== void 0 ? _c6 : null, frequency_penalty: args.frequencyPenalty, presence_penalty: args.presencePenalty }, args.temperature !== void 0 ? { temperature: args.temperature } : {}), args.topP !== void 0 ? { top_p: args.topP } : {})); - return (_e7 = (_d2 = response.choices[0].message) === null || _d2 === void 0 ? void 0 : _d2.content) !== null && _e7 !== void 0 ? _e7 : null; - } catch (error2) { - console.error(`Error invoking Grok`, error2); - return null; - } - }); - } - function grokFailedTestSummary2(report_1, args_1, file_1) { - return __awaiter16(this, arguments, void 0, function* (report, args, file, log3 = false) { - var _a5, _b2; - const assessmentType = (_a5 = args.assess) !== null && _a5 !== void 0 ? _a5 : "failed"; - const assessmentConfig = (0, assess_1.getAssessmentConfig)(assessmentType); - const testsToAnalyze = (0, assess_1.filterTestsByAssessment)(report.results.tests, assessmentType); - testsToAnalyze.forEach((test) => { - if (test.extra != null) { - delete test.extra; - } - }); - let logged = false; - let messageCount = 0; - for (const test of testsToAnalyze) { - if (args.maxMessages != null && messageCount >= args.maxMessages) { - break; - } - let prompt = (0, common_1.generateAssessmentPromptContext)(test, report, assessmentType); - if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { - prompt += ` - -Additional Context: -${args.additionalPromptContext}`; - } - let systemPrompt = (_b2 = args.systemPrompt) !== null && _b2 !== void 0 ? _b2 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; - if (args.additionalSystemPromptContext != null && args.additionalSystemPromptContext !== "") { - systemPrompt += ` - -${args.additionalSystemPromptContext}`; - } - const response = yield grokAI(systemPrompt, prompt, args); - if (response != null) { - test.ai = response; - messageCount++; - if (args.log === true && !logged) { - console.log("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"); - console.log(`\u2728 AI Test Reporter Summary - ${assessmentConfig.label}`); - console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n"); - logged = true; - } - if (args.log === true) { - const icon = (0, common_1.getAssessmentIcon)(assessmentType); - console.log(`${icon} ${assessmentConfig.label}: ${test.name} -`); - console.log(`${response} -`); - } - } + if (customHeaders["x-api-key"] === null) { + return; } - if (args.consolidate === true) { - yield (0, consolidated_summary_1.generateConsolidatedSummary)(report, "grok", args); + if (this.authToken && headers["authorization"]) { + return; } - if (file !== void 0) { - (0, common_1.saveUpdatedReport)(file, report); + if (customHeaders["authorization"] === null) { + return; } - return report; - }); - } + throw new Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted'); + } + authHeaders(opts) { + const apiKeyAuth = this.apiKeyAuth(opts); + const bearerAuth = this.bearerAuth(opts); + if (apiKeyAuth != null && !Core.isEmptyObj(apiKeyAuth)) { + return apiKeyAuth; + } + if (bearerAuth != null && !Core.isEmptyObj(bearerAuth)) { + return bearerAuth; + } + return {}; + } + apiKeyAuth(opts) { + if (this.apiKey == null) { + return {}; + } + return { "X-Api-Key": this.apiKey }; + } + bearerAuth(opts) { + if (this.authToken == null) { + return {}; + } + return { Authorization: `Bearer ${this.authToken}` }; + } + }; + exports2.Anthropic = Anthropic; + _a6 = Anthropic; + Anthropic.Anthropic = _a6; + Anthropic.HUMAN_PROMPT = "\n\nHuman:"; + Anthropic.AI_PROMPT = "\n\nAssistant:"; + Anthropic.DEFAULT_TIMEOUT = 6e5; + Anthropic.AnthropicError = Errors.AnthropicError; + Anthropic.APIError = Errors.APIError; + Anthropic.APIConnectionError = Errors.APIConnectionError; + Anthropic.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError; + Anthropic.APIUserAbortError = Errors.APIUserAbortError; + Anthropic.NotFoundError = Errors.NotFoundError; + Anthropic.ConflictError = Errors.ConflictError; + Anthropic.RateLimitError = Errors.RateLimitError; + Anthropic.BadRequestError = Errors.BadRequestError; + Anthropic.AuthenticationError = Errors.AuthenticationError; + Anthropic.InternalServerError = Errors.InternalServerError; + Anthropic.PermissionDeniedError = Errors.PermissionDeniedError; + Anthropic.UnprocessableEntityError = Errors.UnprocessableEntityError; + Anthropic.toFile = Uploads.toFile; + Anthropic.fileFromPath = Uploads.fileFromPath; + exports2.HUMAN_PROMPT = Anthropic.HUMAN_PROMPT, exports2.AI_PROMPT = Anthropic.AI_PROMPT; + exports2.AnthropicError = Errors.AnthropicError, exports2.APIError = Errors.APIError, exports2.APIConnectionError = Errors.APIConnectionError, exports2.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError, exports2.APIUserAbortError = Errors.APIUserAbortError, exports2.NotFoundError = Errors.NotFoundError, exports2.ConflictError = Errors.ConflictError, exports2.RateLimitError = Errors.RateLimitError, exports2.BadRequestError = Errors.BadRequestError, exports2.AuthenticationError = Errors.AuthenticationError, exports2.InternalServerError = Errors.InternalServerError, exports2.PermissionDeniedError = Errors.PermissionDeniedError, exports2.UnprocessableEntityError = Errors.UnprocessableEntityError; + exports2.toFile = Uploads.toFile; + exports2.fileFromPath = Uploads.fileFromPath; + (function(Anthropic2) { + Anthropic2.Completions = API.Completions; + Anthropic2.Messages = API.Messages; + Anthropic2.Beta = API.Beta; + })(Anthropic = exports2.Anthropic || (exports2.Anthropic = {})); + exports2 = module.exports = Anthropic; + exports2.default = Anthropic; } }); -// node_modules/ai-ctrf/dist/models/deepseek.js -var require_deepseek = __commonJS({ - "node_modules/ai-ctrf/dist/models/deepseek.js"(exports2) { +// node_modules/ai-ctrf/dist/models/claude.js +var require_claude = __commonJS({ + "node_modules/ai-ctrf/dist/models/claude.js"(exports2) { "use strict"; var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -116872,84 +121215,88 @@ var require_deepseek = __commonJS({ } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __importDefault = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.deepseekAI = deepseekAI; - exports2.deepseekFailedTestSummary = deepseekFailedTestSummary2; + exports2.claudeAI = claudeAI; + exports2.claudeFailedTestSummary = claudeFailedTestSummary2; var common_1 = require_common3(); + var sdk_1 = require_sdk(); var consolidated_summary_1 = require_consolidated_summary(); - var openai_1 = __importDefault(require_openai()); var constants_1 = require_constants9(); - var assess_1 = require_assess(); - function deepseekAI(systemPrompt, prompt, args) { + function claudeAI(systemPrompt, prompt, args) { return __awaiter16(this, void 0, void 0, function* () { - var _a5, _b2, _c6, _d2, _e7; - const client2 = new openai_1.default({ - apiKey: process.env.DEEPSEEK_API_KEY, - baseURL: (_a5 = process.env.DEEPSEEK_API_BASE_URL) !== null && _a5 !== void 0 ? _a5 : "https://api.deepseek.com/v1" + var _a6, _b3, _c7; + const client2 = new sdk_1.Anthropic({ + apiKey: process.env.ANTHROPIC_API_KEY }); try { - const response = yield client2.chat.completions.create(Object.assign(Object.assign({ model: (_b2 = args.model) !== null && _b2 !== void 0 ? _b2 : "deepseek-reasoner", messages: [ - { role: "system", content: systemPrompt }, - { role: "user", content: (0, common_1.stripAnsi)(prompt) } - ], max_tokens: (_c6 = args.maxTokens) !== null && _c6 !== void 0 ? _c6 : null, frequency_penalty: args.frequencyPenalty, presence_penalty: args.presencePenalty }, args.temperature !== void 0 ? { temperature: args.temperature } : {}), args.topP !== void 0 ? { top_p: args.topP } : {})); - return (_e7 = (_d2 = response.choices[0].message) === null || _d2 === void 0 ? void 0 : _d2.content) !== null && _e7 !== void 0 ? _e7 : null; + const response = yield client2.messages.create({ + system: systemPrompt, + messages: [{ role: "user", content: (0, common_1.stripAnsi)(prompt) }], + max_tokens: (_a6 = args.maxTokens) !== null && _a6 !== void 0 ? _a6 : 300, + model: (_b3 = args.model) !== null && _b3 !== void 0 ? _b3 : "claude-3-5-sonnet-20240620", + temperature: (_c7 = args.temperature) !== null && _c7 !== void 0 ? _c7 : 1 + }); + const aiResponseArray = response.content; + const aiResponse = aiResponseArray.filter((block) => block.type === "text").map((block) => block.text).join(" "); + return aiResponse !== "" ? aiResponse : null; } catch (error2) { - console.error(`Error invoking DeepSeek`, error2); + console.error(`Error invoking Claude AI`, error2); return null; } }); } - function deepseekFailedTestSummary2(report_1, args_1, file_1) { + function claudeFailedTestSummary2(report_1, args_1, file_1) { return __awaiter16(this, arguments, void 0, function* (report, args, file, log3 = false) { - var _a5, _b2; - const assessmentType = (_a5 = args.assess) !== null && _a5 !== void 0 ? _a5 : "failed"; - const assessmentConfig = (0, assess_1.getAssessmentConfig)(assessmentType); - const testsToAnalyze = (0, assess_1.filterTestsByAssessment)(report.results.tests, assessmentType); - testsToAnalyze.forEach((test) => { + var _a6; + const failedTests = report.results.tests.filter((test) => test.status === "failed"); + failedTests.forEach((test) => { if (test.extra != null) { delete test.extra; } }); let logged = false; let messageCount = 0; - for (const test of testsToAnalyze) { + for (const test of failedTests) { if (args.maxMessages != null && messageCount >= args.maxMessages) { break; } - let prompt = (0, common_1.generateAssessmentPromptContext)(test, report, assessmentType); + let prompt = `Report: +${JSON.stringify(test, null, 2)}. + +Tool:${report.results.tool.name}. + + Please provide a human-readable failure summary that explains why you think the test might have failed and ways to fix`; if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { prompt += ` Additional Context: ${args.additionalPromptContext}`; } - let systemPrompt = (_b2 = args.systemPrompt) !== null && _b2 !== void 0 ? _b2 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; + let systemPrompt = (_a6 = args.systemPrompt) !== null && _a6 !== void 0 ? _a6 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; if (args.additionalSystemPromptContext != null && args.additionalSystemPromptContext !== "") { systemPrompt += ` ${args.additionalSystemPromptContext}`; } - const response = yield deepseekAI(systemPrompt, prompt, args); + const response = yield claudeAI(systemPrompt, prompt, args); if (response != null) { test.ai = response; messageCount++; if (args.log === true && !logged) { - console.log("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"); - console.log(`\u2728 AI Test Reporter Summary - ${assessmentConfig.label}`); - console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n"); + console.log(` +\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`); + console.log(`\u2728 AI Test Reporter Summary`); + console.log(`\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 +`); logged = true; } if (args.log === true) { - const icon = (0, common_1.getAssessmentIcon)(assessmentType); - console.log(`${icon} ${assessmentConfig.label}: ${test.name} + console.log(`\u274C Failed Test: ${test.name} `); console.log(`${response} `); @@ -116957,7 +121304,7 @@ ${args.additionalSystemPromptContext}`; } } if (args.consolidate === true) { - yield (0, consolidated_summary_1.generateConsolidatedSummary)(report, "deepseek", args); + yield (0, consolidated_summary_1.generateConsolidatedSummary)(report, "claude", args); } if (file !== void 0) { (0, common_1.saveUpdatedReport)(file, report); @@ -116968,992 +121315,17 @@ ${args.additionalSystemPromptContext}`; } }); -// node_modules/@google/generative-ai/dist/index.js -var require_dist7 = __commonJS({ - "node_modules/@google/generative-ai/dist/index.js"(exports2) { - "use strict"; - exports2.SchemaType = void 0; - (function(SchemaType) { - SchemaType["STRING"] = "string"; - SchemaType["NUMBER"] = "number"; - SchemaType["INTEGER"] = "integer"; - SchemaType["BOOLEAN"] = "boolean"; - SchemaType["ARRAY"] = "array"; - SchemaType["OBJECT"] = "object"; - })(exports2.SchemaType || (exports2.SchemaType = {})); - exports2.ExecutableCodeLanguage = void 0; - (function(ExecutableCodeLanguage) { - ExecutableCodeLanguage["LANGUAGE_UNSPECIFIED"] = "language_unspecified"; - ExecutableCodeLanguage["PYTHON"] = "python"; - })(exports2.ExecutableCodeLanguage || (exports2.ExecutableCodeLanguage = {})); - exports2.Outcome = void 0; - (function(Outcome) { - Outcome["OUTCOME_UNSPECIFIED"] = "outcome_unspecified"; - Outcome["OUTCOME_OK"] = "outcome_ok"; - Outcome["OUTCOME_FAILED"] = "outcome_failed"; - Outcome["OUTCOME_DEADLINE_EXCEEDED"] = "outcome_deadline_exceeded"; - })(exports2.Outcome || (exports2.Outcome = {})); - var POSSIBLE_ROLES = ["user", "model", "function", "system"]; - exports2.HarmCategory = void 0; - (function(HarmCategory) { - HarmCategory["HARM_CATEGORY_UNSPECIFIED"] = "HARM_CATEGORY_UNSPECIFIED"; - HarmCategory["HARM_CATEGORY_HATE_SPEECH"] = "HARM_CATEGORY_HATE_SPEECH"; - HarmCategory["HARM_CATEGORY_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_SEXUALLY_EXPLICIT"; - HarmCategory["HARM_CATEGORY_HARASSMENT"] = "HARM_CATEGORY_HARASSMENT"; - HarmCategory["HARM_CATEGORY_DANGEROUS_CONTENT"] = "HARM_CATEGORY_DANGEROUS_CONTENT"; - })(exports2.HarmCategory || (exports2.HarmCategory = {})); - exports2.HarmBlockThreshold = void 0; - (function(HarmBlockThreshold) { - HarmBlockThreshold["HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED"; - HarmBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE"; - HarmBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE"; - HarmBlockThreshold["BLOCK_ONLY_HIGH"] = "BLOCK_ONLY_HIGH"; - HarmBlockThreshold["BLOCK_NONE"] = "BLOCK_NONE"; - })(exports2.HarmBlockThreshold || (exports2.HarmBlockThreshold = {})); - exports2.HarmProbability = void 0; - (function(HarmProbability) { - HarmProbability["HARM_PROBABILITY_UNSPECIFIED"] = "HARM_PROBABILITY_UNSPECIFIED"; - HarmProbability["NEGLIGIBLE"] = "NEGLIGIBLE"; - HarmProbability["LOW"] = "LOW"; - HarmProbability["MEDIUM"] = "MEDIUM"; - HarmProbability["HIGH"] = "HIGH"; - })(exports2.HarmProbability || (exports2.HarmProbability = {})); - exports2.BlockReason = void 0; - (function(BlockReason) { - BlockReason["BLOCKED_REASON_UNSPECIFIED"] = "BLOCKED_REASON_UNSPECIFIED"; - BlockReason["SAFETY"] = "SAFETY"; - BlockReason["OTHER"] = "OTHER"; - })(exports2.BlockReason || (exports2.BlockReason = {})); - exports2.FinishReason = void 0; - (function(FinishReason) { - FinishReason["FINISH_REASON_UNSPECIFIED"] = "FINISH_REASON_UNSPECIFIED"; - FinishReason["STOP"] = "STOP"; - FinishReason["MAX_TOKENS"] = "MAX_TOKENS"; - FinishReason["SAFETY"] = "SAFETY"; - FinishReason["RECITATION"] = "RECITATION"; - FinishReason["LANGUAGE"] = "LANGUAGE"; - FinishReason["OTHER"] = "OTHER"; - })(exports2.FinishReason || (exports2.FinishReason = {})); - exports2.TaskType = void 0; - (function(TaskType) { - TaskType["TASK_TYPE_UNSPECIFIED"] = "TASK_TYPE_UNSPECIFIED"; - TaskType["RETRIEVAL_QUERY"] = "RETRIEVAL_QUERY"; - TaskType["RETRIEVAL_DOCUMENT"] = "RETRIEVAL_DOCUMENT"; - TaskType["SEMANTIC_SIMILARITY"] = "SEMANTIC_SIMILARITY"; - TaskType["CLASSIFICATION"] = "CLASSIFICATION"; - TaskType["CLUSTERING"] = "CLUSTERING"; - })(exports2.TaskType || (exports2.TaskType = {})); - exports2.FunctionCallingMode = void 0; - (function(FunctionCallingMode) { - FunctionCallingMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED"; - FunctionCallingMode["AUTO"] = "AUTO"; - FunctionCallingMode["ANY"] = "ANY"; - FunctionCallingMode["NONE"] = "NONE"; - })(exports2.FunctionCallingMode || (exports2.FunctionCallingMode = {})); - exports2.DynamicRetrievalMode = void 0; - (function(DynamicRetrievalMode) { - DynamicRetrievalMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED"; - DynamicRetrievalMode["MODE_DYNAMIC"] = "MODE_DYNAMIC"; - })(exports2.DynamicRetrievalMode || (exports2.DynamicRetrievalMode = {})); - var GoogleGenerativeAIError = class extends Error { - constructor(message) { - super(`[GoogleGenerativeAI Error]: ${message}`); - } - }; - var GoogleGenerativeAIResponseError = class extends GoogleGenerativeAIError { - constructor(message, response) { - super(message); - this.response = response; - } - }; - var GoogleGenerativeAIFetchError = class extends GoogleGenerativeAIError { - constructor(message, status, statusText, errorDetails) { - super(message); - this.status = status; - this.statusText = statusText; - this.errorDetails = errorDetails; - } - }; - var GoogleGenerativeAIRequestInputError = class extends GoogleGenerativeAIError { - }; - var DEFAULT_BASE_URL = "https://generativelanguage.googleapis.com"; - var DEFAULT_API_VERSION = "v1beta"; - var PACKAGE_VERSION = "0.21.0"; - var PACKAGE_LOG_HEADER = "genai-js"; - var Task; - (function(Task2) { - Task2["GENERATE_CONTENT"] = "generateContent"; - Task2["STREAM_GENERATE_CONTENT"] = "streamGenerateContent"; - Task2["COUNT_TOKENS"] = "countTokens"; - Task2["EMBED_CONTENT"] = "embedContent"; - Task2["BATCH_EMBED_CONTENTS"] = "batchEmbedContents"; - })(Task || (Task = {})); - var RequestUrl = class { - constructor(model, task, apiKey, stream5, requestOptions) { - this.model = model; - this.task = task; - this.apiKey = apiKey; - this.stream = stream5; - this.requestOptions = requestOptions; - } - toString() { - var _a5, _b2; - const apiVersion = ((_a5 = this.requestOptions) === null || _a5 === void 0 ? void 0 : _a5.apiVersion) || DEFAULT_API_VERSION; - const baseUrl2 = ((_b2 = this.requestOptions) === null || _b2 === void 0 ? void 0 : _b2.baseUrl) || DEFAULT_BASE_URL; - let url2 = `${baseUrl2}/${apiVersion}/${this.model}:${this.task}`; - if (this.stream) { - url2 += "?alt=sse"; - } - return url2; - } - }; - function getClientHeaders(requestOptions) { - const clientHeaders = []; - if (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiClient) { - clientHeaders.push(requestOptions.apiClient); - } - clientHeaders.push(`${PACKAGE_LOG_HEADER}/${PACKAGE_VERSION}`); - return clientHeaders.join(" "); - } - async function getHeaders2(url2) { - var _a5; - const headers = new Headers(); - headers.append("Content-Type", "application/json"); - headers.append("x-goog-api-client", getClientHeaders(url2.requestOptions)); - headers.append("x-goog-api-key", url2.apiKey); - let customHeaders = (_a5 = url2.requestOptions) === null || _a5 === void 0 ? void 0 : _a5.customHeaders; - if (customHeaders) { - if (!(customHeaders instanceof Headers)) { - try { - customHeaders = new Headers(customHeaders); - } catch (e6) { - throw new GoogleGenerativeAIRequestInputError(`unable to convert customHeaders value ${JSON.stringify(customHeaders)} to Headers: ${e6.message}`); - } - } - for (const [headerName, headerValue] of customHeaders.entries()) { - if (headerName === "x-goog-api-key") { - throw new GoogleGenerativeAIRequestInputError(`Cannot set reserved header name ${headerName}`); - } else if (headerName === "x-goog-api-client") { - throw new GoogleGenerativeAIRequestInputError(`Header name ${headerName} can only be set using the apiClient field`); - } - headers.append(headerName, headerValue); - } - } - return headers; - } - async function constructModelRequest(model, task, apiKey, stream5, body2, requestOptions) { - const url2 = new RequestUrl(model, task, apiKey, stream5, requestOptions); - return { - url: url2.toString(), - fetchOptions: Object.assign(Object.assign({}, buildFetchOptions(requestOptions)), { method: "POST", headers: await getHeaders2(url2), body: body2 }) - }; - } - async function makeModelRequest(model, task, apiKey, stream5, body2, requestOptions = {}, fetchFn = fetch) { - const { url: url2, fetchOptions } = await constructModelRequest(model, task, apiKey, stream5, body2, requestOptions); - return makeRequest(url2, fetchOptions, fetchFn); - } - async function makeRequest(url2, fetchOptions, fetchFn = fetch) { - let response; - try { - response = await fetchFn(url2, fetchOptions); - } catch (e6) { - handleResponseError(e6, url2); - } - if (!response.ok) { - await handleResponseNotOk(response, url2); - } - return response; - } - function handleResponseError(e6, url2) { - let err = e6; - if (!(e6 instanceof GoogleGenerativeAIFetchError || e6 instanceof GoogleGenerativeAIRequestInputError)) { - err = new GoogleGenerativeAIError(`Error fetching from ${url2.toString()}: ${e6.message}`); - err.stack = e6.stack; - } - throw err; - } - async function handleResponseNotOk(response, url2) { - let message = ""; - let errorDetails; - try { - const json = await response.json(); - message = json.error.message; - if (json.error.details) { - message += ` ${JSON.stringify(json.error.details)}`; - errorDetails = json.error.details; - } - } catch (e6) { - } - throw new GoogleGenerativeAIFetchError(`Error fetching from ${url2.toString()}: [${response.status} ${response.statusText}] ${message}`, response.status, response.statusText, errorDetails); - } - function buildFetchOptions(requestOptions) { - const fetchOptions = {}; - if ((requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.signal) !== void 0 || (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeout) >= 0) { - const controller = new AbortController(); - if ((requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeout) >= 0) { - setTimeout(() => controller.abort(), requestOptions.timeout); - } - if (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.signal) { - requestOptions.signal.addEventListener("abort", () => { - controller.abort(); - }); - } - fetchOptions.signal = controller.signal; - } - return fetchOptions; - } - function addHelpers(response) { - response.text = () => { - if (response.candidates && response.candidates.length > 0) { - if (response.candidates.length > 1) { - console.warn(`This response had ${response.candidates.length} candidates. Returning text from the first candidate only. Access response.candidates directly to use the other candidates.`); - } - if (hadBadFinishReason(response.candidates[0])) { - throw new GoogleGenerativeAIResponseError(`${formatBlockErrorMessage(response)}`, response); - } - return getText(response); - } else if (response.promptFeedback) { - throw new GoogleGenerativeAIResponseError(`Text not available. ${formatBlockErrorMessage(response)}`, response); - } - return ""; - }; - response.functionCall = () => { - if (response.candidates && response.candidates.length > 0) { - if (response.candidates.length > 1) { - console.warn(`This response had ${response.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`); - } - if (hadBadFinishReason(response.candidates[0])) { - throw new GoogleGenerativeAIResponseError(`${formatBlockErrorMessage(response)}`, response); - } - console.warn(`response.functionCall() is deprecated. Use response.functionCalls() instead.`); - return getFunctionCalls(response)[0]; - } else if (response.promptFeedback) { - throw new GoogleGenerativeAIResponseError(`Function call not available. ${formatBlockErrorMessage(response)}`, response); - } - return void 0; - }; - response.functionCalls = () => { - if (response.candidates && response.candidates.length > 0) { - if (response.candidates.length > 1) { - console.warn(`This response had ${response.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`); - } - if (hadBadFinishReason(response.candidates[0])) { - throw new GoogleGenerativeAIResponseError(`${formatBlockErrorMessage(response)}`, response); - } - return getFunctionCalls(response); - } else if (response.promptFeedback) { - throw new GoogleGenerativeAIResponseError(`Function call not available. ${formatBlockErrorMessage(response)}`, response); - } - return void 0; - }; - return response; - } - function getText(response) { - var _a5, _b2, _c6, _d2; - const textStrings = []; - if ((_b2 = (_a5 = response.candidates) === null || _a5 === void 0 ? void 0 : _a5[0].content) === null || _b2 === void 0 ? void 0 : _b2.parts) { - for (const part of (_d2 = (_c6 = response.candidates) === null || _c6 === void 0 ? void 0 : _c6[0].content) === null || _d2 === void 0 ? void 0 : _d2.parts) { - if (part.text) { - textStrings.push(part.text); - } - if (part.executableCode) { - textStrings.push("\n```" + part.executableCode.language + "\n" + part.executableCode.code + "\n```\n"); - } - if (part.codeExecutionResult) { - textStrings.push("\n```\n" + part.codeExecutionResult.output + "\n```\n"); - } - } - } - if (textStrings.length > 0) { - return textStrings.join(""); - } else { - return ""; - } - } - function getFunctionCalls(response) { - var _a5, _b2, _c6, _d2; - const functionCalls = []; - if ((_b2 = (_a5 = response.candidates) === null || _a5 === void 0 ? void 0 : _a5[0].content) === null || _b2 === void 0 ? void 0 : _b2.parts) { - for (const part of (_d2 = (_c6 = response.candidates) === null || _c6 === void 0 ? void 0 : _c6[0].content) === null || _d2 === void 0 ? void 0 : _d2.parts) { - if (part.functionCall) { - functionCalls.push(part.functionCall); - } - } - } - if (functionCalls.length > 0) { - return functionCalls; - } else { - return void 0; - } - } - var badFinishReasons = [ - exports2.FinishReason.RECITATION, - exports2.FinishReason.SAFETY, - exports2.FinishReason.LANGUAGE - ]; - function hadBadFinishReason(candidate) { - return !!candidate.finishReason && badFinishReasons.includes(candidate.finishReason); - } - function formatBlockErrorMessage(response) { - var _a5, _b2, _c6; - let message = ""; - if ((!response.candidates || response.candidates.length === 0) && response.promptFeedback) { - message += "Response was blocked"; - if ((_a5 = response.promptFeedback) === null || _a5 === void 0 ? void 0 : _a5.blockReason) { - message += ` due to ${response.promptFeedback.blockReason}`; - } - if ((_b2 = response.promptFeedback) === null || _b2 === void 0 ? void 0 : _b2.blockReasonMessage) { - message += `: ${response.promptFeedback.blockReasonMessage}`; - } - } else if ((_c6 = response.candidates) === null || _c6 === void 0 ? void 0 : _c6[0]) { - const firstCandidate = response.candidates[0]; - if (hadBadFinishReason(firstCandidate)) { - message += `Candidate was blocked due to ${firstCandidate.finishReason}`; - if (firstCandidate.finishMessage) { - message += `: ${firstCandidate.finishMessage}`; - } - } - } - return message; - } - function __await(v8) { - return this instanceof __await ? (this.v = v8, this) : new __await(v8); - } - function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g6 = generator.apply(thisArg, _arguments || []), i6, q7 = []; - return i6 = {}, verb("next"), verb("throw"), verb("return"), i6[Symbol.asyncIterator] = function() { - return this; - }, i6; - function verb(n12) { - if (g6[n12]) i6[n12] = function(v8) { - return new Promise(function(a6, b6) { - q7.push([n12, v8, a6, b6]) > 1 || resume(n12, v8); - }); - }; - } - function resume(n12, v8) { - try { - step(g6[n12](v8)); - } catch (e6) { - settle(q7[0][3], e6); - } - } - function step(r6) { - r6.value instanceof __await ? Promise.resolve(r6.value.v).then(fulfill, reject2) : settle(q7[0][2], r6); - } - function fulfill(value) { - resume("next", value); - } - function reject2(value) { - resume("throw", value); - } - function settle(f6, v8) { - if (f6(v8), q7.shift(), q7.length) resume(q7[0][0], q7[0][1]); - } - } - var responseLineRE = /^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/; - function processStream(response) { - const inputStream = response.body.pipeThrough(new TextDecoderStream("utf8", { fatal: true })); - const responseStream = getResponseStream(inputStream); - const [stream1, stream22] = responseStream.tee(); - return { - stream: generateResponseSequence(stream1), - response: getResponsePromise(stream22) - }; - } - async function getResponsePromise(stream5) { - const allResponses = []; - const reader = stream5.getReader(); - while (true) { - const { done, value } = await reader.read(); - if (done) { - return addHelpers(aggregateResponses(allResponses)); - } - allResponses.push(value); - } - } - function generateResponseSequence(stream5) { - return __asyncGenerator(this, arguments, function* generateResponseSequence_1() { - const reader = stream5.getReader(); - while (true) { - const { value, done } = yield __await(reader.read()); - if (done) { - break; - } - yield yield __await(addHelpers(value)); - } - }); - } - function getResponseStream(inputStream) { - const reader = inputStream.getReader(); - const stream5 = new ReadableStream({ - start(controller) { - let currentText = ""; - return pump(); - function pump() { - return reader.read().then(({ value, done }) => { - if (done) { - if (currentText.trim()) { - controller.error(new GoogleGenerativeAIError("Failed to parse stream")); - return; - } - controller.close(); - return; - } - currentText += value; - let match3 = currentText.match(responseLineRE); - let parsedResponse; - while (match3) { - try { - parsedResponse = JSON.parse(match3[1]); - } catch (e6) { - controller.error(new GoogleGenerativeAIError(`Error parsing JSON response: "${match3[1]}"`)); - return; - } - controller.enqueue(parsedResponse); - currentText = currentText.substring(match3[0].length); - match3 = currentText.match(responseLineRE); - } - return pump(); - }); - } - } - }); - return stream5; - } - function aggregateResponses(responses) { - const lastResponse = responses[responses.length - 1]; - const aggregatedResponse = { - promptFeedback: lastResponse === null || lastResponse === void 0 ? void 0 : lastResponse.promptFeedback - }; - for (const response of responses) { - if (response.candidates) { - for (const candidate of response.candidates) { - const i6 = candidate.index; - if (!aggregatedResponse.candidates) { - aggregatedResponse.candidates = []; - } - if (!aggregatedResponse.candidates[i6]) { - aggregatedResponse.candidates[i6] = { - index: candidate.index - }; - } - aggregatedResponse.candidates[i6].citationMetadata = candidate.citationMetadata; - aggregatedResponse.candidates[i6].groundingMetadata = candidate.groundingMetadata; - aggregatedResponse.candidates[i6].finishReason = candidate.finishReason; - aggregatedResponse.candidates[i6].finishMessage = candidate.finishMessage; - aggregatedResponse.candidates[i6].safetyRatings = candidate.safetyRatings; - if (candidate.content && candidate.content.parts) { - if (!aggregatedResponse.candidates[i6].content) { - aggregatedResponse.candidates[i6].content = { - role: candidate.content.role || "user", - parts: [] - }; - } - const newPart = {}; - for (const part of candidate.content.parts) { - if (part.text) { - newPart.text = part.text; - } - if (part.functionCall) { - newPart.functionCall = part.functionCall; - } - if (part.executableCode) { - newPart.executableCode = part.executableCode; - } - if (part.codeExecutionResult) { - newPart.codeExecutionResult = part.codeExecutionResult; - } - if (Object.keys(newPart).length === 0) { - newPart.text = ""; - } - aggregatedResponse.candidates[i6].content.parts.push(newPart); - } - } - } - } - if (response.usageMetadata) { - aggregatedResponse.usageMetadata = response.usageMetadata; - } - } - return aggregatedResponse; - } - async function generateContentStream(apiKey, model, params, requestOptions) { - const response = await makeModelRequest( - model, - Task.STREAM_GENERATE_CONTENT, - apiKey, - /* stream */ - true, - JSON.stringify(params), - requestOptions - ); - return processStream(response); - } - async function generateContent(apiKey, model, params, requestOptions) { - const response = await makeModelRequest( - model, - Task.GENERATE_CONTENT, - apiKey, - /* stream */ - false, - JSON.stringify(params), - requestOptions - ); - const responseJson = await response.json(); - const enhancedResponse = addHelpers(responseJson); - return { - response: enhancedResponse - }; - } - function formatSystemInstruction(input) { - if (input == null) { - return void 0; - } else if (typeof input === "string") { - return { role: "system", parts: [{ text: input }] }; - } else if (input.text) { - return { role: "system", parts: [input] }; - } else if (input.parts) { - if (!input.role) { - return { role: "system", parts: input.parts }; - } else { - return input; - } - } - } - function formatNewContent(request3) { - let newParts = []; - if (typeof request3 === "string") { - newParts = [{ text: request3 }]; - } else { - for (const partOrString of request3) { - if (typeof partOrString === "string") { - newParts.push({ text: partOrString }); - } else { - newParts.push(partOrString); - } - } - } - return assignRoleToPartsAndValidateSendMessageRequest(newParts); - } - function assignRoleToPartsAndValidateSendMessageRequest(parts) { - const userContent = { role: "user", parts: [] }; - const functionContent = { role: "function", parts: [] }; - let hasUserContent = false; - let hasFunctionContent = false; - for (const part of parts) { - if ("functionResponse" in part) { - functionContent.parts.push(part); - hasFunctionContent = true; - } else { - userContent.parts.push(part); - hasUserContent = true; - } - } - if (hasUserContent && hasFunctionContent) { - throw new GoogleGenerativeAIError("Within a single message, FunctionResponse cannot be mixed with other type of part in the request for sending chat message."); - } - if (!hasUserContent && !hasFunctionContent) { - throw new GoogleGenerativeAIError("No content is provided for sending chat message."); - } - if (hasUserContent) { - return userContent; - } - return functionContent; - } - function formatCountTokensInput(params, modelParams) { - var _a5; - let formattedGenerateContentRequest = { - model: modelParams === null || modelParams === void 0 ? void 0 : modelParams.model, - generationConfig: modelParams === null || modelParams === void 0 ? void 0 : modelParams.generationConfig, - safetySettings: modelParams === null || modelParams === void 0 ? void 0 : modelParams.safetySettings, - tools: modelParams === null || modelParams === void 0 ? void 0 : modelParams.tools, - toolConfig: modelParams === null || modelParams === void 0 ? void 0 : modelParams.toolConfig, - systemInstruction: modelParams === null || modelParams === void 0 ? void 0 : modelParams.systemInstruction, - cachedContent: (_a5 = modelParams === null || modelParams === void 0 ? void 0 : modelParams.cachedContent) === null || _a5 === void 0 ? void 0 : _a5.name, - contents: [] - }; - const containsGenerateContentRequest = params.generateContentRequest != null; - if (params.contents) { - if (containsGenerateContentRequest) { - throw new GoogleGenerativeAIRequestInputError("CountTokensRequest must have one of contents or generateContentRequest, not both."); - } - formattedGenerateContentRequest.contents = params.contents; - } else if (containsGenerateContentRequest) { - formattedGenerateContentRequest = Object.assign(Object.assign({}, formattedGenerateContentRequest), params.generateContentRequest); - } else { - const content = formatNewContent(params); - formattedGenerateContentRequest.contents = [content]; - } - return { generateContentRequest: formattedGenerateContentRequest }; - } - function formatGenerateContentInput(params) { - let formattedRequest; - if (params.contents) { - formattedRequest = params; - } else { - const content = formatNewContent(params); - formattedRequest = { contents: [content] }; - } - if (params.systemInstruction) { - formattedRequest.systemInstruction = formatSystemInstruction(params.systemInstruction); - } - return formattedRequest; - } - function formatEmbedContentInput(params) { - if (typeof params === "string" || Array.isArray(params)) { - const content = formatNewContent(params); - return { content }; - } - return params; - } - var VALID_PART_FIELDS = [ - "text", - "inlineData", - "functionCall", - "functionResponse", - "executableCode", - "codeExecutionResult" - ]; - var VALID_PARTS_PER_ROLE = { - user: ["text", "inlineData"], - function: ["functionResponse"], - model: ["text", "functionCall", "executableCode", "codeExecutionResult"], - // System instructions shouldn't be in history anyway. - system: ["text"] - }; - function validateChatHistory(history) { - let prevContent = false; - for (const currContent of history) { - const { role, parts } = currContent; - if (!prevContent && role !== "user") { - throw new GoogleGenerativeAIError(`First content should be with role 'user', got ${role}`); - } - if (!POSSIBLE_ROLES.includes(role)) { - throw new GoogleGenerativeAIError(`Each item should include role field. Got ${role} but valid roles are: ${JSON.stringify(POSSIBLE_ROLES)}`); - } - if (!Array.isArray(parts)) { - throw new GoogleGenerativeAIError("Content should have 'parts' property with an array of Parts"); - } - if (parts.length === 0) { - throw new GoogleGenerativeAIError("Each Content should have at least one part"); - } - const countFields = { - text: 0, - inlineData: 0, - functionCall: 0, - functionResponse: 0, - fileData: 0, - executableCode: 0, - codeExecutionResult: 0 - }; - for (const part of parts) { - for (const key of VALID_PART_FIELDS) { - if (key in part) { - countFields[key] += 1; - } - } - } - const validParts = VALID_PARTS_PER_ROLE[role]; - for (const key of VALID_PART_FIELDS) { - if (!validParts.includes(key) && countFields[key] > 0) { - throw new GoogleGenerativeAIError(`Content with role '${role}' can't contain '${key}' part`); - } - } - prevContent = true; - } - } - var SILENT_ERROR = "SILENT_ERROR"; - var ChatSession = class { - constructor(apiKey, model, params, _requestOptions = {}) { - this.model = model; - this.params = params; - this._requestOptions = _requestOptions; - this._history = []; - this._sendPromise = Promise.resolve(); - this._apiKey = apiKey; - if (params === null || params === void 0 ? void 0 : params.history) { - validateChatHistory(params.history); - this._history = params.history; - } - } - /** - * Gets the chat history so far. Blocked prompts are not added to history. - * Blocked candidates are not added to history, nor are the prompts that - * generated them. - */ - async getHistory() { - await this._sendPromise; - return this._history; - } - /** - * Sends a chat message and receives a non-streaming - * {@link GenerateContentResult}. - * - * Fields set in the optional {@link SingleRequestOptions} parameter will - * take precedence over the {@link RequestOptions} values provided to - * {@link GoogleGenerativeAI.getGenerativeModel }. - */ - async sendMessage(request3, requestOptions = {}) { - var _a5, _b2, _c6, _d2, _e7, _f2; - await this._sendPromise; - const newContent = formatNewContent(request3); - const generateContentRequest = { - safetySettings: (_a5 = this.params) === null || _a5 === void 0 ? void 0 : _a5.safetySettings, - generationConfig: (_b2 = this.params) === null || _b2 === void 0 ? void 0 : _b2.generationConfig, - tools: (_c6 = this.params) === null || _c6 === void 0 ? void 0 : _c6.tools, - toolConfig: (_d2 = this.params) === null || _d2 === void 0 ? void 0 : _d2.toolConfig, - systemInstruction: (_e7 = this.params) === null || _e7 === void 0 ? void 0 : _e7.systemInstruction, - cachedContent: (_f2 = this.params) === null || _f2 === void 0 ? void 0 : _f2.cachedContent, - contents: [...this._history, newContent] - }; - const chatSessionRequestOptions = Object.assign(Object.assign({}, this._requestOptions), requestOptions); - let finalResult; - this._sendPromise = this._sendPromise.then(() => generateContent(this._apiKey, this.model, generateContentRequest, chatSessionRequestOptions)).then((result) => { - var _a6; - if (result.response.candidates && result.response.candidates.length > 0) { - this._history.push(newContent); - const responseContent = Object.assign({ - parts: [], - // Response seems to come back without a role set. - role: "model" - }, (_a6 = result.response.candidates) === null || _a6 === void 0 ? void 0 : _a6[0].content); - this._history.push(responseContent); - } else { - const blockErrorMessage = formatBlockErrorMessage(result.response); - if (blockErrorMessage) { - console.warn(`sendMessage() was unsuccessful. ${blockErrorMessage}. Inspect response object for details.`); - } - } - finalResult = result; - }); - await this._sendPromise; - return finalResult; - } - /** - * Sends a chat message and receives the response as a - * {@link GenerateContentStreamResult} containing an iterable stream - * and a response promise. - * - * Fields set in the optional {@link SingleRequestOptions} parameter will - * take precedence over the {@link RequestOptions} values provided to - * {@link GoogleGenerativeAI.getGenerativeModel }. - */ - async sendMessageStream(request3, requestOptions = {}) { - var _a5, _b2, _c6, _d2, _e7, _f2; - await this._sendPromise; - const newContent = formatNewContent(request3); - const generateContentRequest = { - safetySettings: (_a5 = this.params) === null || _a5 === void 0 ? void 0 : _a5.safetySettings, - generationConfig: (_b2 = this.params) === null || _b2 === void 0 ? void 0 : _b2.generationConfig, - tools: (_c6 = this.params) === null || _c6 === void 0 ? void 0 : _c6.tools, - toolConfig: (_d2 = this.params) === null || _d2 === void 0 ? void 0 : _d2.toolConfig, - systemInstruction: (_e7 = this.params) === null || _e7 === void 0 ? void 0 : _e7.systemInstruction, - cachedContent: (_f2 = this.params) === null || _f2 === void 0 ? void 0 : _f2.cachedContent, - contents: [...this._history, newContent] - }; - const chatSessionRequestOptions = Object.assign(Object.assign({}, this._requestOptions), requestOptions); - const streamPromise = generateContentStream(this._apiKey, this.model, generateContentRequest, chatSessionRequestOptions); - this._sendPromise = this._sendPromise.then(() => streamPromise).catch((_ignored) => { - throw new Error(SILENT_ERROR); - }).then((streamResult) => streamResult.response).then((response) => { - if (response.candidates && response.candidates.length > 0) { - this._history.push(newContent); - const responseContent = Object.assign({}, response.candidates[0].content); - if (!responseContent.role) { - responseContent.role = "model"; - } - this._history.push(responseContent); - } else { - const blockErrorMessage = formatBlockErrorMessage(response); - if (blockErrorMessage) { - console.warn(`sendMessageStream() was unsuccessful. ${blockErrorMessage}. Inspect response object for details.`); - } - } - }).catch((e6) => { - if (e6.message !== SILENT_ERROR) { - console.error(e6); - } - }); - return streamPromise; - } - }; - async function countTokens(apiKey, model, params, singleRequestOptions) { - const response = await makeModelRequest(model, Task.COUNT_TOKENS, apiKey, false, JSON.stringify(params), singleRequestOptions); - return response.json(); - } - async function embedContent(apiKey, model, params, requestOptions) { - const response = await makeModelRequest(model, Task.EMBED_CONTENT, apiKey, false, JSON.stringify(params), requestOptions); - return response.json(); - } - async function batchEmbedContents(apiKey, model, params, requestOptions) { - const requestsWithModel = params.requests.map((request3) => { - return Object.assign(Object.assign({}, request3), { model }); - }); - const response = await makeModelRequest(model, Task.BATCH_EMBED_CONTENTS, apiKey, false, JSON.stringify({ requests: requestsWithModel }), requestOptions); - return response.json(); - } - var GenerativeModel = class { - constructor(apiKey, modelParams, _requestOptions = {}) { - this.apiKey = apiKey; - this._requestOptions = _requestOptions; - if (modelParams.model.includes("/")) { - this.model = modelParams.model; - } else { - this.model = `models/${modelParams.model}`; - } - this.generationConfig = modelParams.generationConfig || {}; - this.safetySettings = modelParams.safetySettings || []; - this.tools = modelParams.tools; - this.toolConfig = modelParams.toolConfig; - this.systemInstruction = formatSystemInstruction(modelParams.systemInstruction); - this.cachedContent = modelParams.cachedContent; - } - /** - * Makes a single non-streaming call to the model - * and returns an object containing a single {@link GenerateContentResponse}. - * - * Fields set in the optional {@link SingleRequestOptions} parameter will - * take precedence over the {@link RequestOptions} values provided to - * {@link GoogleGenerativeAI.getGenerativeModel }. - */ - async generateContent(request3, requestOptions = {}) { - var _a5; - const formattedParams = formatGenerateContentInput(request3); - const generativeModelRequestOptions = Object.assign(Object.assign({}, this._requestOptions), requestOptions); - return generateContent(this.apiKey, this.model, Object.assign({ generationConfig: this.generationConfig, safetySettings: this.safetySettings, tools: this.tools, toolConfig: this.toolConfig, systemInstruction: this.systemInstruction, cachedContent: (_a5 = this.cachedContent) === null || _a5 === void 0 ? void 0 : _a5.name }, formattedParams), generativeModelRequestOptions); - } - /** - * Makes a single streaming call to the model and returns an object - * containing an iterable stream that iterates over all chunks in the - * streaming response as well as a promise that returns the final - * aggregated response. - * - * Fields set in the optional {@link SingleRequestOptions} parameter will - * take precedence over the {@link RequestOptions} values provided to - * {@link GoogleGenerativeAI.getGenerativeModel }. - */ - async generateContentStream(request3, requestOptions = {}) { - var _a5; - const formattedParams = formatGenerateContentInput(request3); - const generativeModelRequestOptions = Object.assign(Object.assign({}, this._requestOptions), requestOptions); - return generateContentStream(this.apiKey, this.model, Object.assign({ generationConfig: this.generationConfig, safetySettings: this.safetySettings, tools: this.tools, toolConfig: this.toolConfig, systemInstruction: this.systemInstruction, cachedContent: (_a5 = this.cachedContent) === null || _a5 === void 0 ? void 0 : _a5.name }, formattedParams), generativeModelRequestOptions); - } - /** - * Gets a new {@link ChatSession} instance which can be used for - * multi-turn chats. - */ - startChat(startChatParams) { - var _a5; - return new ChatSession(this.apiKey, this.model, Object.assign({ generationConfig: this.generationConfig, safetySettings: this.safetySettings, tools: this.tools, toolConfig: this.toolConfig, systemInstruction: this.systemInstruction, cachedContent: (_a5 = this.cachedContent) === null || _a5 === void 0 ? void 0 : _a5.name }, startChatParams), this._requestOptions); - } - /** - * Counts the tokens in the provided request. - * - * Fields set in the optional {@link SingleRequestOptions} parameter will - * take precedence over the {@link RequestOptions} values provided to - * {@link GoogleGenerativeAI.getGenerativeModel }. - */ - async countTokens(request3, requestOptions = {}) { - const formattedParams = formatCountTokensInput(request3, { - model: this.model, - generationConfig: this.generationConfig, - safetySettings: this.safetySettings, - tools: this.tools, - toolConfig: this.toolConfig, - systemInstruction: this.systemInstruction, - cachedContent: this.cachedContent - }); - const generativeModelRequestOptions = Object.assign(Object.assign({}, this._requestOptions), requestOptions); - return countTokens(this.apiKey, this.model, formattedParams, generativeModelRequestOptions); - } - /** - * Embeds the provided content. - * - * Fields set in the optional {@link SingleRequestOptions} parameter will - * take precedence over the {@link RequestOptions} values provided to - * {@link GoogleGenerativeAI.getGenerativeModel }. - */ - async embedContent(request3, requestOptions = {}) { - const formattedParams = formatEmbedContentInput(request3); - const generativeModelRequestOptions = Object.assign(Object.assign({}, this._requestOptions), requestOptions); - return embedContent(this.apiKey, this.model, formattedParams, generativeModelRequestOptions); - } - /** - * Embeds an array of {@link EmbedContentRequest}s. - * - * Fields set in the optional {@link SingleRequestOptions} parameter will - * take precedence over the {@link RequestOptions} values provided to - * {@link GoogleGenerativeAI.getGenerativeModel }. - */ - async batchEmbedContents(batchEmbedContentRequest, requestOptions = {}) { - const generativeModelRequestOptions = Object.assign(Object.assign({}, this._requestOptions), requestOptions); - return batchEmbedContents(this.apiKey, this.model, batchEmbedContentRequest, generativeModelRequestOptions); - } - }; - var GoogleGenerativeAI = class { - constructor(apiKey) { - this.apiKey = apiKey; - } - /** - * Gets a {@link GenerativeModel} instance for the provided model name. - */ - getGenerativeModel(modelParams, requestOptions) { - if (!modelParams.model) { - throw new GoogleGenerativeAIError(`Must provide a model name. Example: genai.getGenerativeModel({ model: 'my-model-name' })`); - } - return new GenerativeModel(this.apiKey, modelParams, requestOptions); - } - /** - * Creates a {@link GenerativeModel} instance from provided content cache. - */ - getGenerativeModelFromCachedContent(cachedContent, modelParams, requestOptions) { - if (!cachedContent.name) { - throw new GoogleGenerativeAIRequestInputError("Cached content must contain a `name` field."); - } - if (!cachedContent.model) { - throw new GoogleGenerativeAIRequestInputError("Cached content must contain a `model` field."); - } - const disallowedDuplicates = ["model", "systemInstruction"]; - for (const key of disallowedDuplicates) { - if ((modelParams === null || modelParams === void 0 ? void 0 : modelParams[key]) && cachedContent[key] && (modelParams === null || modelParams === void 0 ? void 0 : modelParams[key]) !== cachedContent[key]) { - if (key === "model") { - const modelParamsComp = modelParams.model.startsWith("models/") ? modelParams.model.replace("models/", "") : modelParams.model; - const cachedContentComp = cachedContent.model.startsWith("models/") ? cachedContent.model.replace("models/", "") : cachedContent.model; - if (modelParamsComp === cachedContentComp) { - continue; - } - } - throw new GoogleGenerativeAIRequestInputError(`Different value for "${key}" specified in modelParams (${modelParams[key]}) and cachedContent (${cachedContent[key]})`); - } - } - const modelParamsFromCache = Object.assign(Object.assign({}, modelParams), { model: cachedContent.model, tools: cachedContent.tools, toolConfig: cachedContent.toolConfig, systemInstruction: cachedContent.systemInstruction, cachedContent }); - return new GenerativeModel(this.apiKey, modelParamsFromCache, requestOptions); - } - }; - exports2.ChatSession = ChatSession; - exports2.GenerativeModel = GenerativeModel; - exports2.GoogleGenerativeAI = GoogleGenerativeAI; - exports2.GoogleGenerativeAIError = GoogleGenerativeAIError; - exports2.GoogleGenerativeAIFetchError = GoogleGenerativeAIFetchError; - exports2.GoogleGenerativeAIRequestInputError = GoogleGenerativeAIRequestInputError; - exports2.GoogleGenerativeAIResponseError = GoogleGenerativeAIResponseError; - exports2.POSSIBLE_ROLES = POSSIBLE_ROLES; - } -}); - -// node_modules/ai-ctrf/dist/models/gemini.js -var require_gemini = __commonJS({ - "node_modules/ai-ctrf/dist/models/gemini.js"(exports2) { +// node_modules/ai-ctrf/dist/models/azure-openai.js +var require_azure_openai = __commonJS({ + "node_modules/ai-ctrf/dist/models/azure-openai.js"(exports2) { "use strict"; var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -117969,81 +121341,90 @@ var require_gemini = __commonJS({ } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.gemini = gemini; - exports2.geminiFailedTestSummary = geminiFailedTestSummary2; - var generative_ai_1 = require_dist7(); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.azureOpenAI = azureOpenAI; + exports2.azureOpenAIFailedTestSummary = azureOpenAIFailedTestSummary2; + var openai_1 = require_openai(); var common_1 = require_common3(); var consolidated_summary_1 = require_consolidated_summary(); var constants_1 = require_constants9(); - var assess_1 = require_assess(); - function gemini(systemPrompt, prompt, args) { + function azureOpenAI(systemPrompt, prompt, args) { return __awaiter16(this, void 0, void 0, function* () { - var _a5, _b2; - const genAI = new generative_ai_1.GoogleGenerativeAI((_a5 = process.env.GOOGLE_API_KEY) !== null && _a5 !== void 0 ? _a5 : ""); - const model = genAI.getGenerativeModel({ model: (_b2 = args.model) !== null && _b2 !== void 0 ? _b2 : "gemini-pro" }); + var _a6, _b3, _c7, _d2; + const apiKey = process.env.AZURE_OPENAI_API_KEY; + const endpoint2 = process.env.AZURE_OPENAI_ENDPOINT; + const deployment = (_a6 = args.deploymentId) !== null && _a6 !== void 0 ? _a6 : process.env.AZURE_OPENAI_DEPLOYMENT_NAME; + if (apiKey == null || apiKey === "" || endpoint2 == null || endpoint2 === "" || deployment == null || deployment === "") { + console.error("Missing Azure OpenAI configuration. Please set AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT, and AZURE_OPENAI_DEPLOYMENT_NAME environment variables or provide them as arguments."); + return null; + } + const client2 = new openai_1.AzureOpenAI({ + apiKey, + endpoint: endpoint2, + apiVersion: "2024-05-01-preview" + }); try { - const combinedPrompt = `${systemPrompt} - -${(0, common_1.stripAnsi)(prompt)}`; - const result = yield model.generateContent(combinedPrompt); - const response = result.response; - const text = response.text(); - return text !== "" ? text : null; + const response = yield client2.chat.completions.create(Object.assign(Object.assign({ model: deployment, messages: [ + { role: "system", content: systemPrompt }, + { role: "user", content: (0, common_1.stripAnsi)(prompt) } + ], max_tokens: (_b3 = args.maxTokens) !== null && _b3 !== void 0 ? _b3 : null, frequency_penalty: args.frequencyPenalty, presence_penalty: args.presencePenalty }, args.temperature !== void 0 ? { temperature: args.temperature } : {}), args.topP !== void 0 ? { top_p: args.topP } : {})); + return (_d2 = (_c7 = response.choices[0].message) === null || _c7 === void 0 ? void 0 : _c7.content) !== null && _d2 !== void 0 ? _d2 : null; } catch (error2) { - console.error(`Error invoking Gemini`, error2); + console.error(`Error invoking Azure OpenAI`, error2); return null; } }); } - function geminiFailedTestSummary2(report_1, args_1, file_1) { + function azureOpenAIFailedTestSummary2(report_1, args_1, file_1) { return __awaiter16(this, arguments, void 0, function* (report, args, file, log3 = false) { - var _a5, _b2; - const assessmentType = (_a5 = args.assess) !== null && _a5 !== void 0 ? _a5 : "failed"; - const assessmentConfig = (0, assess_1.getAssessmentConfig)(assessmentType); - const testsToAnalyze = (0, assess_1.filterTestsByAssessment)(report.results.tests, assessmentType); - testsToAnalyze.forEach((test) => { + var _a6; + const failedTests = report.results.tests.filter((test) => test.status === "failed"); + failedTests.forEach((test) => { if (test.extra != null) { delete test.extra; } }); let logged = false; let messageCount = 0; - for (const test of testsToAnalyze) { + for (const test of failedTests) { if (args.maxMessages != null && messageCount >= args.maxMessages) { break; } - let prompt = (0, common_1.generateAssessmentPromptContext)(test, report, assessmentType); + let prompt = `Report: +${JSON.stringify(test, null, 2)}. + +Tool:${report.results.tool.name}. + + Please provide a human-readable failure summary that explains why you think the test might have failed and ways to fix`; if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { prompt += ` Additional Context: ${args.additionalPromptContext}`; } - let systemPrompt = (_b2 = args.systemPrompt) !== null && _b2 !== void 0 ? _b2 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; + let systemPrompt = (_a6 = args.systemPrompt) !== null && _a6 !== void 0 ? _a6 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; if (args.additionalSystemPromptContext != null && args.additionalSystemPromptContext !== "") { systemPrompt += ` ${args.additionalSystemPromptContext}`; } - const response = yield gemini(systemPrompt, prompt, args); + const response = yield azureOpenAI(systemPrompt, prompt, args); if (response != null) { test.ai = response; messageCount++; if (args.log === true && !logged) { console.log("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"); - console.log(`\u2728 AI Test Reporter Summary - ${assessmentConfig.label}`); + console.log("\u2728 AI Test Reporter Summary"); console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n"); logged = true; } if (args.log === true) { - const icon = (0, common_1.getAssessmentIcon)(assessmentType); - console.log(`${icon} ${assessmentConfig.label}: ${test.name} + console.log(`\u274C Failed Test: ${test.name} `); console.log(`${response} `); @@ -118051,7 +121432,7 @@ ${args.additionalSystemPromptContext}`; } } if (args.consolidate === true) { - yield (0, consolidated_summary_1.generateConsolidatedSummary)(report, "gemini", args); + yield (0, consolidated_summary_1.generateConsolidatedSummary)(report, "azure", args); } if (file !== void 0) { (0, common_1.saveUpdatedReport)(file, report); @@ -118062,17 +121443,17 @@ ${args.additionalSystemPromptContext}`; } }); -// node_modules/ai-ctrf/dist/models/perplexity.js -var require_perplexity = __commonJS({ - "node_modules/ai-ctrf/dist/models/perplexity.js"(exports2) { +// node_modules/ai-ctrf/dist/models/grok.js +var require_grok = __commonJS({ + "node_modules/ai-ctrf/dist/models/grok.js"(exports2) { "use strict"; var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -118088,7 +121469,7 @@ var require_perplexity = __commonJS({ } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -118097,75 +121478,76 @@ var require_perplexity = __commonJS({ return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.perplexity = perplexity; - exports2.perplexityFailedTestSummary = perplexityFailedTestSummary2; + exports2.grokAI = grokAI; + exports2.grokFailedTestSummary = grokFailedTestSummary2; var common_1 = require_common3(); var consolidated_summary_1 = require_consolidated_summary(); var openai_1 = __importDefault(require_openai()); var constants_1 = require_constants9(); - var assess_1 = require_assess(); - function perplexity(systemPrompt, prompt, args) { + function grokAI(systemPrompt, prompt, args) { return __awaiter16(this, void 0, void 0, function* () { - var _a5, _b2, _c6, _d2; + var _a6, _b3, _c7, _d2, _e7; const client2 = new openai_1.default({ - apiKey: process.env.PERPLEXITY_API_KEY, - baseURL: "https://api.perplexity.ai" + apiKey: process.env.GROK_API_KEY, + baseURL: (_a6 = process.env.GROK_API_BASE_URL) !== null && _a6 !== void 0 ? _a6 : "https://api.x.ai/v1" }); try { - const response = yield client2.chat.completions.create(Object.assign(Object.assign({ model: (_a5 = args.model) !== null && _a5 !== void 0 ? _a5 : "llama-3.1-sonar-small-128k-online", messages: [ + const response = yield client2.chat.completions.create(Object.assign(Object.assign({ model: (_b3 = args.model) !== null && _b3 !== void 0 ? _b3 : "grok-beta", messages: [ { role: "system", content: systemPrompt }, { role: "user", content: (0, common_1.stripAnsi)(prompt) } - ], max_tokens: (_b2 = args.maxTokens) !== null && _b2 !== void 0 ? _b2 : null, frequency_penalty: args.frequencyPenalty, presence_penalty: args.presencePenalty }, args.temperature !== void 0 ? { temperature: args.temperature } : {}), args.topP !== void 0 ? { top_p: args.topP } : {})); - return (_d2 = (_c6 = response.choices[0].message) === null || _c6 === void 0 ? void 0 : _c6.content) !== null && _d2 !== void 0 ? _d2 : null; + ], max_tokens: (_c7 = args.maxTokens) !== null && _c7 !== void 0 ? _c7 : null, frequency_penalty: args.frequencyPenalty, presence_penalty: args.presencePenalty }, args.temperature !== void 0 ? { temperature: args.temperature } : {}), args.topP !== void 0 ? { top_p: args.topP } : {})); + return (_e7 = (_d2 = response.choices[0].message) === null || _d2 === void 0 ? void 0 : _d2.content) !== null && _e7 !== void 0 ? _e7 : null; } catch (error2) { - console.error(`Error invoking Perplexity`, error2); + console.error(`Error invoking Grok`, error2); return null; } }); } - function perplexityFailedTestSummary2(report_1, args_1, file_1) { + function grokFailedTestSummary2(report_1, args_1, file_1) { return __awaiter16(this, arguments, void 0, function* (report, args, file, log3 = false) { - var _a5, _b2; - const assessmentType = (_a5 = args.assess) !== null && _a5 !== void 0 ? _a5 : "failed"; - const assessmentConfig = (0, assess_1.getAssessmentConfig)(assessmentType); - const testsToAnalyze = (0, assess_1.filterTestsByAssessment)(report.results.tests, assessmentType); - testsToAnalyze.forEach((test) => { + var _a6; + const failedTests = report.results.tests.filter((test) => test.status === "failed"); + failedTests.forEach((test) => { if (test.extra != null) { delete test.extra; } }); let logged = false; let messageCount = 0; - for (const test of testsToAnalyze) { + for (const test of failedTests) { if (args.maxMessages != null && messageCount >= args.maxMessages) { break; } - let prompt = (0, common_1.generateAssessmentPromptContext)(test, report, assessmentType); + let prompt = `Report: +${JSON.stringify(test, null, 2)}. + +Tool:${report.results.tool.name}. + + Please provide a human-readable failure summary that explains why you think the test might have failed and ways to fix`; if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { prompt += ` Additional Context: ${args.additionalPromptContext}`; } - let systemPrompt = (_b2 = args.systemPrompt) !== null && _b2 !== void 0 ? _b2 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; + let systemPrompt = (_a6 = args.systemPrompt) !== null && _a6 !== void 0 ? _a6 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; if (args.additionalSystemPromptContext != null && args.additionalSystemPromptContext !== "") { systemPrompt += ` ${args.additionalSystemPromptContext}`; } - const response = yield perplexity(systemPrompt, prompt, args); + const response = yield grokAI(systemPrompt, prompt, args); if (response != null) { test.ai = response; messageCount++; if (args.log === true && !logged) { console.log("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"); - console.log(`\u2728 AI Test Reporter Summary - ${assessmentConfig.label}`); + console.log("\u2728 AI Test Reporter Summary"); console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n"); logged = true; } if (args.log === true) { - const icon = (0, common_1.getAssessmentIcon)(assessmentType); - console.log(`${icon} ${assessmentConfig.label}: ${test.name} + console.log(`\u274C Failed Test: ${test.name} `); console.log(`${response} `); @@ -118173,7 +121555,7 @@ ${args.additionalSystemPromptContext}`; } } if (args.consolidate === true) { - yield (0, consolidated_summary_1.generateConsolidatedSummary)(report, "perplexity", args); + yield (0, consolidated_summary_1.generateConsolidatedSummary)(report, "grok", args); } if (file !== void 0) { (0, common_1.saveUpdatedReport)(file, report); @@ -118184,17 +121566,17 @@ ${args.additionalSystemPromptContext}`; } }); -// node_modules/ai-ctrf/dist/models/openrouter.js -var require_openrouter = __commonJS({ - "node_modules/ai-ctrf/dist/models/openrouter.js"(exports2) { +// node_modules/ai-ctrf/dist/models/deepseek.js +var require_deepseek = __commonJS({ + "node_modules/ai-ctrf/dist/models/deepseek.js"(exports2) { "use strict"; var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -118210,7 +121592,7 @@ var require_openrouter = __commonJS({ } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -118219,86 +121601,76 @@ var require_openrouter = __commonJS({ return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.openRouter = openRouter; - exports2.openRouterFailedTestSummary = openRouterFailedTestSummary2; - var openai_1 = __importDefault(require_openai()); + exports2.deepseekAI = deepseekAI; + exports2.deepseekFailedTestSummary = deepseekFailedTestSummary2; var common_1 = require_common3(); var consolidated_summary_1 = require_consolidated_summary(); + var openai_1 = __importDefault(require_openai()); var constants_1 = require_constants9(); - var assess_1 = require_assess(); - function openRouter(systemPrompt, prompt, args) { + function deepseekAI(systemPrompt, prompt, args) { return __awaiter16(this, void 0, void 0, function* () { - var _a5, _b2, _c6, _d2, _e7, _f2, _g2; + var _a6, _b3, _c7, _d2, _e7; const client2 = new openai_1.default({ - apiKey: process.env.OPENROUTER_API_KEY, - baseURL: "https://openrouter.ai/api/v1", - defaultHeaders: { - "HTTP-Referer": (_a5 = process.env.OPENROUTER_REFERER) !== null && _a5 !== void 0 ? _a5 : "http://localhost:3000", - "X-Title": "AI Test Reporter" - } + apiKey: process.env.DEEPSEEK_API_KEY, + baseURL: (_a6 = process.env.DEEPSEEK_API_BASE_URL) !== null && _a6 !== void 0 ? _a6 : "https://api.deepseek.com/v1" }); try { - const response = yield client2.chat.completions.create(Object.assign(Object.assign(Object.assign({ model: (_b2 = args.model) !== null && _b2 !== void 0 ? _b2 : "openai/gpt-3.5-turbo", messages: [ + const response = yield client2.chat.completions.create(Object.assign(Object.assign({ model: (_b3 = args.model) !== null && _b3 !== void 0 ? _b3 : "deepseek-reasoner", messages: [ { role: "system", content: systemPrompt }, { role: "user", content: (0, common_1.stripAnsi)(prompt) } - ], max_tokens: (_c6 = args.maxTokens) !== null && _c6 !== void 0 ? _c6 : void 0, temperature: (_d2 = args.temperature) !== null && _d2 !== void 0 ? _d2 : void 0 }, args.frequencyPenalty !== void 0 && { - frequency_penalty: args.frequencyPenalty - }), args.presencePenalty !== void 0 && { - presence_penalty: args.presencePenalty - }), args.topP !== void 0 && { top_p: args.topP })); - if (((_g2 = (_f2 = (_e7 = response === null || response === void 0 ? void 0 : response.choices) === null || _e7 === void 0 ? void 0 : _e7[0]) === null || _f2 === void 0 ? void 0 : _f2.message) === null || _g2 === void 0 ? void 0 : _g2.content) == null) { - return null; - } - return response.choices[0].message.content; + ], max_tokens: (_c7 = args.maxTokens) !== null && _c7 !== void 0 ? _c7 : null, frequency_penalty: args.frequencyPenalty, presence_penalty: args.presencePenalty }, args.temperature !== void 0 ? { temperature: args.temperature } : {}), args.topP !== void 0 ? { top_p: args.topP } : {})); + return (_e7 = (_d2 = response.choices[0].message) === null || _d2 === void 0 ? void 0 : _d2.content) !== null && _e7 !== void 0 ? _e7 : null; } catch (error2) { - console.error(`Error invoking OpenRouter`, error2); + console.error(`Error invoking DeepSeek`, error2); return null; } }); } - function openRouterFailedTestSummary2(report_1, args_1, file_1) { + function deepseekFailedTestSummary2(report_1, args_1, file_1) { return __awaiter16(this, arguments, void 0, function* (report, args, file, log3 = false) { - var _a5, _b2; - const assessmentType = (_a5 = args.assess) !== null && _a5 !== void 0 ? _a5 : "failed"; - const assessmentConfig = (0, assess_1.getAssessmentConfig)(assessmentType); - const testsToAnalyze = (0, assess_1.filterTestsByAssessment)(report.results.tests, assessmentType); - testsToAnalyze.forEach((test) => { + var _a6; + const failedTests = report.results.tests.filter((test) => test.status === "failed"); + failedTests.forEach((test) => { if (test.extra != null) { delete test.extra; } }); let logged = false; let messageCount = 0; - for (const test of testsToAnalyze) { + for (const test of failedTests) { if (args.maxMessages != null && messageCount >= args.maxMessages) { break; } - let prompt = (0, common_1.generateAssessmentPromptContext)(test, report, assessmentType); + let prompt = `Report: +${JSON.stringify(test, null, 2)}. + +Tool:${report.results.tool.name}. + + Please provide a human-readable failure summary that explains why you think the test might have failed and ways to fix`; if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { prompt += ` Additional Context: ${args.additionalPromptContext}`; } - let systemPrompt = (_b2 = args.systemPrompt) !== null && _b2 !== void 0 ? _b2 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; + let systemPrompt = (_a6 = args.systemPrompt) !== null && _a6 !== void 0 ? _a6 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; if (args.additionalSystemPromptContext != null && args.additionalSystemPromptContext !== "") { systemPrompt += ` ${args.additionalSystemPromptContext}`; } - const response = yield openRouter(systemPrompt, prompt, args); + const response = yield deepseekAI(systemPrompt, prompt, args); if (response != null) { test.ai = response; messageCount++; if (args.log === true && !logged) { console.log("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"); - console.log(`\u2728 AI Test Reporter Summary - ${assessmentConfig.label}`); + console.log("\u2728 AI Test Reporter Summary"); console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n"); logged = true; } if (args.log === true) { - const icon = (0, common_1.getAssessmentIcon)(assessmentType); - console.log(`${icon} ${assessmentConfig.label}: ${test.name} + console.log(`\u274C Failed Test: ${test.name} `); console.log(`${response} `); @@ -118306,7 +121678,7 @@ ${args.additionalSystemPromptContext}`; } } if (args.consolidate === true) { - yield (0, consolidated_summary_1.generateConsolidatedSummary)(report, "openrouter", args); + yield (0, consolidated_summary_1.generateConsolidatedSummary)(report, "deepseek", args); } if (file !== void 0) { (0, common_1.saveUpdatedReport)(file, report); @@ -118317,14079 +121689,12912 @@ ${args.additionalSystemPromptContext}`; } }); -// node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamConfiguration.js -function resolveEventStreamConfig(input) { - const eventSigner = input.signer; - const messageSigner = input.signer; - const newInput = Object.assign(input, { - eventSigner, - messageSigner - }); - const eventStreamPayloadHandler = newInput.eventStreamPayloadHandlerProvider(newInput); - return Object.assign(newInput, { - eventStreamPayloadHandler - }); -} -var init_eventStreamConfiguration = __esm({ - "node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamConfiguration.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/protocol-http/dist-es/extensions/httpExtensionConfiguration.js -var getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig; -var init_httpExtensionConfiguration = __esm({ - "node_modules/@smithy/protocol-http/dist-es/extensions/httpExtensionConfiguration.js"() { - "use strict"; - getHttpHandlerExtensionConfiguration = (runtimeConfig) => { - return { - setHttpHandler(handler2) { - runtimeConfig.httpHandler = handler2; - }, - httpHandler() { - return runtimeConfig.httpHandler; - }, - updateHttpClientConfig(key, value) { - runtimeConfig.httpHandler?.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return runtimeConfig.httpHandler.httpHandlerConfigs(); - } - }; - }; - resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler() - }; - }; - } -}); - -// node_modules/@smithy/protocol-http/dist-es/extensions/index.js -var init_extensions = __esm({ - "node_modules/@smithy/protocol-http/dist-es/extensions/index.js"() { - "use strict"; - init_httpExtensionConfiguration(); - } -}); - -// node_modules/@smithy/types/dist-es/abort.js -var init_abort = __esm({ - "node_modules/@smithy/types/dist-es/abort.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/auth/auth.js -var HttpAuthLocation; -var init_auth = __esm({ - "node_modules/@smithy/types/dist-es/auth/auth.js"() { - "use strict"; - (function(HttpAuthLocation2) { - HttpAuthLocation2["HEADER"] = "header"; - HttpAuthLocation2["QUERY"] = "query"; - })(HttpAuthLocation || (HttpAuthLocation = {})); - } -}); - -// node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js -var HttpApiKeyAuthLocation; -var init_HttpApiKeyAuth = __esm({ - "node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js"() { - "use strict"; - (function(HttpApiKeyAuthLocation2) { - HttpApiKeyAuthLocation2["HEADER"] = "header"; - HttpApiKeyAuthLocation2["QUERY"] = "query"; - })(HttpApiKeyAuthLocation || (HttpApiKeyAuthLocation = {})); - } -}); - -// node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js -var init_HttpAuthScheme = __esm({ - "node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js -var init_HttpAuthSchemeProvider = __esm({ - "node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/auth/HttpSigner.js -var init_HttpSigner = __esm({ - "node_modules/@smithy/types/dist-es/auth/HttpSigner.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js -var init_IdentityProviderConfig = __esm({ - "node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/auth/index.js -var init_auth2 = __esm({ - "node_modules/@smithy/types/dist-es/auth/index.js"() { - "use strict"; - init_auth(); - init_HttpApiKeyAuth(); - init_HttpAuthScheme(); - init_HttpAuthSchemeProvider(); - init_HttpSigner(); - init_IdentityProviderConfig(); - } -}); - -// node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js -var init_blob_payload_input_types = __esm({ - "node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/checksum.js -var init_checksum = __esm({ - "node_modules/@smithy/types/dist-es/checksum.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/client.js -var init_client = __esm({ - "node_modules/@smithy/types/dist-es/client.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/command.js -var init_command = __esm({ - "node_modules/@smithy/types/dist-es/command.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/connection/config.js -var init_config = __esm({ - "node_modules/@smithy/types/dist-es/connection/config.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/connection/manager.js -var init_manager = __esm({ - "node_modules/@smithy/types/dist-es/connection/manager.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/connection/pool.js -var init_pool = __esm({ - "node_modules/@smithy/types/dist-es/connection/pool.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/connection/index.js -var init_connection = __esm({ - "node_modules/@smithy/types/dist-es/connection/index.js"() { - "use strict"; - init_config(); - init_manager(); - init_pool(); - } -}); - -// node_modules/@smithy/types/dist-es/crypto.js -var init_crypto = __esm({ - "node_modules/@smithy/types/dist-es/crypto.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/encode.js -var init_encode = __esm({ - "node_modules/@smithy/types/dist-es/encode.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/endpoint.js -var EndpointURLScheme; -var init_endpoint = __esm({ - "node_modules/@smithy/types/dist-es/endpoint.js"() { - "use strict"; - (function(EndpointURLScheme2) { - EndpointURLScheme2["HTTP"] = "http"; - EndpointURLScheme2["HTTPS"] = "https"; - })(EndpointURLScheme || (EndpointURLScheme = {})); - } -}); - -// node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js -var init_EndpointRuleObject = __esm({ - "node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js -var init_ErrorRuleObject = __esm({ - "node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js -var init_RuleSetObject = __esm({ - "node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/endpoints/shared.js -var init_shared = __esm({ - "node_modules/@smithy/types/dist-es/endpoints/shared.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js -var init_TreeRuleObject = __esm({ - "node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/endpoints/index.js -var init_endpoints2 = __esm({ - "node_modules/@smithy/types/dist-es/endpoints/index.js"() { - "use strict"; - init_EndpointRuleObject(); - init_ErrorRuleObject(); - init_RuleSetObject(); - init_shared(); - init_TreeRuleObject(); - } -}); - -// node_modules/@smithy/types/dist-es/eventStream.js -var init_eventStream = __esm({ - "node_modules/@smithy/types/dist-es/eventStream.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/extensions/checksum.js -var AlgorithmId; -var init_checksum2 = __esm({ - "node_modules/@smithy/types/dist-es/extensions/checksum.js"() { - "use strict"; - (function(AlgorithmId2) { - AlgorithmId2["MD5"] = "md5"; - AlgorithmId2["CRC32"] = "crc32"; - AlgorithmId2["CRC32C"] = "crc32c"; - AlgorithmId2["SHA1"] = "sha1"; - AlgorithmId2["SHA256"] = "sha256"; - })(AlgorithmId || (AlgorithmId = {})); - } -}); - -// node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js -var init_defaultClientConfiguration = __esm({ - "node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js -var init_defaultExtensionConfiguration = __esm({ - "node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/extensions/index.js -var init_extensions2 = __esm({ - "node_modules/@smithy/types/dist-es/extensions/index.js"() { - "use strict"; - init_defaultClientConfiguration(); - init_defaultExtensionConfiguration(); - init_checksum2(); - } -}); - -// node_modules/@smithy/types/dist-es/feature-ids.js -var init_feature_ids = __esm({ - "node_modules/@smithy/types/dist-es/feature-ids.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/http.js -var FieldPosition; -var init_http = __esm({ - "node_modules/@smithy/types/dist-es/http.js"() { - "use strict"; - (function(FieldPosition2) { - FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; - FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; - })(FieldPosition || (FieldPosition = {})); - } -}); - -// node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js -var init_httpHandlerInitialization = __esm({ - "node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js -var init_apiKeyIdentity = __esm({ - "node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js -var init_awsCredentialIdentity = __esm({ - "node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/identity/identity.js -var init_identity = __esm({ - "node_modules/@smithy/types/dist-es/identity/identity.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/identity/tokenIdentity.js -var init_tokenIdentity = __esm({ - "node_modules/@smithy/types/dist-es/identity/tokenIdentity.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/identity/index.js -var init_identity2 = __esm({ - "node_modules/@smithy/types/dist-es/identity/index.js"() { - "use strict"; - init_apiKeyIdentity(); - init_awsCredentialIdentity(); - init_identity(); - init_tokenIdentity(); - } -}); - -// node_modules/@smithy/types/dist-es/logger.js -var init_logger = __esm({ - "node_modules/@smithy/types/dist-es/logger.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/middleware.js -var SMITHY_CONTEXT_KEY; -var init_middleware = __esm({ - "node_modules/@smithy/types/dist-es/middleware.js"() { - "use strict"; - SMITHY_CONTEXT_KEY = "__smithy_context"; - } -}); - -// node_modules/@smithy/types/dist-es/pagination.js -var init_pagination = __esm({ - "node_modules/@smithy/types/dist-es/pagination.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/profile.js -var IniSectionType; -var init_profile = __esm({ - "node_modules/@smithy/types/dist-es/profile.js"() { - "use strict"; - (function(IniSectionType2) { - IniSectionType2["PROFILE"] = "profile"; - IniSectionType2["SSO_SESSION"] = "sso-session"; - IniSectionType2["SERVICES"] = "services"; - })(IniSectionType || (IniSectionType = {})); - } -}); - -// node_modules/@smithy/types/dist-es/response.js -var init_response = __esm({ - "node_modules/@smithy/types/dist-es/response.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/retry.js -var init_retry = __esm({ - "node_modules/@smithy/types/dist-es/retry.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/schema/schema.js -var init_schema = __esm({ - "node_modules/@smithy/types/dist-es/schema/schema.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/schema/traits.js -var init_traits = __esm({ - "node_modules/@smithy/types/dist-es/schema/traits.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/schema/schema-deprecated.js -var init_schema_deprecated = __esm({ - "node_modules/@smithy/types/dist-es/schema/schema-deprecated.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/schema/sentinels.js -var init_sentinels = __esm({ - "node_modules/@smithy/types/dist-es/schema/sentinels.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/schema/static-schemas.js -var init_static_schemas = __esm({ - "node_modules/@smithy/types/dist-es/schema/static-schemas.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/serde.js -var init_serde = __esm({ - "node_modules/@smithy/types/dist-es/serde.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/shapes.js -var init_shapes = __esm({ - "node_modules/@smithy/types/dist-es/shapes.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/signature.js -var init_signature = __esm({ - "node_modules/@smithy/types/dist-es/signature.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/stream.js -var init_stream = __esm({ - "node_modules/@smithy/types/dist-es/stream.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js -var init_streaming_blob_common_types = __esm({ - "node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js -var init_streaming_blob_payload_input_types = __esm({ - "node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js -var init_streaming_blob_payload_output_types = __esm({ - "node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/transfer.js -var RequestHandlerProtocol; -var init_transfer = __esm({ - "node_modules/@smithy/types/dist-es/transfer.js"() { - "use strict"; - (function(RequestHandlerProtocol2) { - RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; - })(RequestHandlerProtocol || (RequestHandlerProtocol = {})); - } -}); - -// node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js -var init_client_payload_blob_type_narrow = __esm({ - "node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/transform/mutable.js -var init_mutable = __esm({ - "node_modules/@smithy/types/dist-es/transform/mutable.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/transform/no-undefined.js -var init_no_undefined = __esm({ - "node_modules/@smithy/types/dist-es/transform/no-undefined.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/transform/type-transform.js -var init_type_transform = __esm({ - "node_modules/@smithy/types/dist-es/transform/type-transform.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/uri.js -var init_uri = __esm({ - "node_modules/@smithy/types/dist-es/uri.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/util.js -var init_util2 = __esm({ - "node_modules/@smithy/types/dist-es/util.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/waiter.js -var init_waiter = __esm({ - "node_modules/@smithy/types/dist-es/waiter.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/types/dist-es/index.js -var init_dist_es = __esm({ - "node_modules/@smithy/types/dist-es/index.js"() { - "use strict"; - init_abort(); - init_auth2(); - init_blob_payload_input_types(); - init_checksum(); - init_client(); - init_command(); - init_connection(); - init_crypto(); - init_encode(); - init_endpoint(); - init_endpoints2(); - init_eventStream(); - init_extensions2(); - init_feature_ids(); - init_http(); - init_httpHandlerInitialization(); - init_identity2(); - init_logger(); - init_middleware(); - init_pagination(); - init_profile(); - init_response(); - init_retry(); - init_schema(); - init_traits(); - init_schema_deprecated(); - init_sentinels(); - init_static_schemas(); - init_serde(); - init_shapes(); - init_signature(); - init_stream(); - init_streaming_blob_common_types(); - init_streaming_blob_payload_input_types(); - init_streaming_blob_payload_output_types(); - init_transfer(); - init_client_payload_blob_type_narrow(); - init_mutable(); - init_no_undefined(); - init_type_transform(); - init_uri(); - init_util2(); - init_waiter(); - } -}); - -// node_modules/@smithy/protocol-http/dist-es/Field.js -var init_Field = __esm({ - "node_modules/@smithy/protocol-http/dist-es/Field.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/protocol-http/dist-es/Fields.js -var init_Fields = __esm({ - "node_modules/@smithy/protocol-http/dist-es/Fields.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/protocol-http/dist-es/httpHandler.js -var init_httpHandler = __esm({ - "node_modules/@smithy/protocol-http/dist-es/httpHandler.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/protocol-http/dist-es/httpRequest.js -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param - }; - }, {}); -} -var HttpRequest; -var init_httpRequest = __esm({ - "node_modules/@smithy/protocol-http/dist-es/httpRequest.js"() { - "use strict"; - HttpRequest = 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(request3) { - const cloned = new _HttpRequest({ - ...request3, - headers: { ...request3.headers } - }); - if (cloned.query) { - cloned.query = cloneQuery(cloned.query); - } - return cloned; - } - static isInstance(request3) { - if (!request3) { - return false; - } - const req = request3; - 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); - } - }; - } -}); - -// node_modules/@smithy/protocol-http/dist-es/httpResponse.js -var HttpResponse; -var init_httpResponse = __esm({ - "node_modules/@smithy/protocol-http/dist-es/httpResponse.js"() { - "use strict"; - HttpResponse = 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"; - } - }; - } -}); - -// node_modules/@smithy/protocol-http/dist-es/isValidHostname.js -var init_isValidHostname = __esm({ - "node_modules/@smithy/protocol-http/dist-es/isValidHostname.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/protocol-http/dist-es/types.js -var init_types = __esm({ - "node_modules/@smithy/protocol-http/dist-es/types.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/protocol-http/dist-es/index.js -var init_dist_es2 = __esm({ - "node_modules/@smithy/protocol-http/dist-es/index.js"() { - "use strict"; - init_extensions(); - init_Field(); - init_Fields(); - init_httpHandler(); - init_httpRequest(); - init_httpResponse(); - init_isValidHostname(); - init_types(); - } -}); - -// node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHandlingMiddleware.js -var eventStreamHandlingMiddleware, eventStreamHandlingMiddlewareOptions; -var init_eventStreamHandlingMiddleware = __esm({ - "node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHandlingMiddleware.js"() { - "use strict"; - init_dist_es2(); - eventStreamHandlingMiddleware = (options) => (next, context5) => async (args) => { - const { request: request3 } = args; - if (!HttpRequest.isInstance(request3)) - return next(args); - return options.eventStreamPayloadHandler.handle(next, args, context5); - }; - eventStreamHandlingMiddlewareOptions = { - tags: ["EVENT_STREAM", "SIGNATURE", "HANDLE"], - name: "eventStreamHandlingMiddleware", - relation: "after", - toMiddleware: "awsAuthMiddleware", - override: true - }; - } -}); - -// node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHeaderMiddleware.js -var eventStreamHeaderMiddleware, eventStreamHeaderMiddlewareOptions; -var init_eventStreamHeaderMiddleware = __esm({ - "node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHeaderMiddleware.js"() { - "use strict"; - init_dist_es2(); - eventStreamHeaderMiddleware = (next) => async (args) => { - const { request: request3 } = args; - if (!HttpRequest.isInstance(request3)) - return next(args); - request3.headers = { - ...request3.headers, - "content-type": "application/vnd.amazon.eventstream", - "x-amz-content-sha256": "STREAMING-AWS4-HMAC-SHA256-EVENTS" - }; - return next({ - ...args, - request: request3 - }); - }; - eventStreamHeaderMiddlewareOptions = { - step: "build", - tags: ["EVENT_STREAM", "HEADER", "CONTENT_TYPE", "CONTENT_SHA256"], - name: "eventStreamHeaderMiddleware", - override: true - }; - } -}); - -// node_modules/@aws-sdk/middleware-eventstream/dist-es/getEventStreamPlugin.js -var getEventStreamPlugin; -var init_getEventStreamPlugin = __esm({ - "node_modules/@aws-sdk/middleware-eventstream/dist-es/getEventStreamPlugin.js"() { - "use strict"; - init_eventStreamHandlingMiddleware(); - init_eventStreamHeaderMiddleware(); - getEventStreamPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(eventStreamHandlingMiddleware(options), eventStreamHandlingMiddlewareOptions); - clientStack.add(eventStreamHeaderMiddleware, eventStreamHeaderMiddlewareOptions); - } - }); - } -}); - -// node_modules/@aws-sdk/middleware-eventstream/dist-es/index.js -var init_dist_es3 = __esm({ - "node_modules/@aws-sdk/middleware-eventstream/dist-es/index.js"() { - "use strict"; - init_eventStreamConfiguration(); - init_eventStreamHandlingMiddleware(); - init_eventStreamHeaderMiddleware(); - init_getEventStreamPlugin(); - } -}); - -// node_modules/@aws-sdk/middleware-host-header/dist-es/index.js -function resolveHostHeaderConfig(input) { - return input; -} -var hostHeaderMiddleware, hostHeaderMiddlewareOptions, getHostHeaderPlugin; -var init_dist_es4 = __esm({ - "node_modules/@aws-sdk/middleware-host-header/dist-es/index.js"() { - "use strict"; - init_dist_es2(); - hostHeaderMiddleware = (options) => (next) => async (args) => { - if (!HttpRequest.isInstance(args.request)) - return next(args); - const { request: request3 } = args; - const { handlerProtocol = "" } = options.requestHandler.metadata || {}; - if (handlerProtocol.indexOf("h2") >= 0 && !request3.headers[":authority"]) { - delete request3.headers["host"]; - request3.headers[":authority"] = request3.hostname + (request3.port ? ":" + request3.port : ""); - } else if (!request3.headers["host"]) { - let host = request3.hostname; - if (request3.port != null) - host += `:${request3.port}`; - request3.headers["host"] = host; - } - return next(args); - }; - hostHeaderMiddlewareOptions = { - name: "hostHeaderMiddleware", - step: "build", - priority: "low", - tags: ["HOST"], - override: true - }; - getHostHeaderPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions); - } - }); - } -}); - -// node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js -var loggerMiddleware, loggerMiddlewareOptions, getLoggerPlugin; -var init_loggerMiddleware = __esm({ - "node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js"() { +// node_modules/@google/generative-ai/dist/index.js +var require_dist7 = __commonJS({ + "node_modules/@google/generative-ai/dist/index.js"(exports2) { "use strict"; - loggerMiddleware = () => (next, context5) => async (args) => { - try { - const response = await next(args); - const { clientName, commandName, logger: logger8, dynamoDbDocumentClientOptions = {} } = context5; - const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions; - const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context5.inputFilterSensitiveLog; - const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context5.outputFilterSensitiveLog; - const { $metadata, ...outputWithoutMetadata } = response.output; - logger8?.info?.({ - clientName, - commandName, - input: inputFilterSensitiveLog(args.input), - output: outputFilterSensitiveLog(outputWithoutMetadata), - metadata: $metadata - }); - return response; - } catch (error2) { - const { clientName, commandName, logger: logger8, dynamoDbDocumentClientOptions = {} } = context5; - const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions; - const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context5.inputFilterSensitiveLog; - logger8?.error?.({ - clientName, - commandName, - input: inputFilterSensitiveLog(args.input), - error: error2, - metadata: error2.$metadata - }); - throw error2; + exports2.SchemaType = void 0; + (function(SchemaType) { + SchemaType["STRING"] = "string"; + SchemaType["NUMBER"] = "number"; + SchemaType["INTEGER"] = "integer"; + SchemaType["BOOLEAN"] = "boolean"; + SchemaType["ARRAY"] = "array"; + SchemaType["OBJECT"] = "object"; + })(exports2.SchemaType || (exports2.SchemaType = {})); + exports2.ExecutableCodeLanguage = void 0; + (function(ExecutableCodeLanguage) { + ExecutableCodeLanguage["LANGUAGE_UNSPECIFIED"] = "language_unspecified"; + ExecutableCodeLanguage["PYTHON"] = "python"; + })(exports2.ExecutableCodeLanguage || (exports2.ExecutableCodeLanguage = {})); + exports2.Outcome = void 0; + (function(Outcome) { + Outcome["OUTCOME_UNSPECIFIED"] = "outcome_unspecified"; + Outcome["OUTCOME_OK"] = "outcome_ok"; + Outcome["OUTCOME_FAILED"] = "outcome_failed"; + Outcome["OUTCOME_DEADLINE_EXCEEDED"] = "outcome_deadline_exceeded"; + })(exports2.Outcome || (exports2.Outcome = {})); + var POSSIBLE_ROLES = ["user", "model", "function", "system"]; + exports2.HarmCategory = void 0; + (function(HarmCategory) { + HarmCategory["HARM_CATEGORY_UNSPECIFIED"] = "HARM_CATEGORY_UNSPECIFIED"; + HarmCategory["HARM_CATEGORY_HATE_SPEECH"] = "HARM_CATEGORY_HATE_SPEECH"; + HarmCategory["HARM_CATEGORY_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_SEXUALLY_EXPLICIT"; + HarmCategory["HARM_CATEGORY_HARASSMENT"] = "HARM_CATEGORY_HARASSMENT"; + HarmCategory["HARM_CATEGORY_DANGEROUS_CONTENT"] = "HARM_CATEGORY_DANGEROUS_CONTENT"; + HarmCategory["HARM_CATEGORY_CIVIC_INTEGRITY"] = "HARM_CATEGORY_CIVIC_INTEGRITY"; + })(exports2.HarmCategory || (exports2.HarmCategory = {})); + exports2.HarmBlockThreshold = void 0; + (function(HarmBlockThreshold) { + HarmBlockThreshold["HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED"; + HarmBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE"; + HarmBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE"; + HarmBlockThreshold["BLOCK_ONLY_HIGH"] = "BLOCK_ONLY_HIGH"; + HarmBlockThreshold["BLOCK_NONE"] = "BLOCK_NONE"; + })(exports2.HarmBlockThreshold || (exports2.HarmBlockThreshold = {})); + exports2.HarmProbability = void 0; + (function(HarmProbability) { + HarmProbability["HARM_PROBABILITY_UNSPECIFIED"] = "HARM_PROBABILITY_UNSPECIFIED"; + HarmProbability["NEGLIGIBLE"] = "NEGLIGIBLE"; + HarmProbability["LOW"] = "LOW"; + HarmProbability["MEDIUM"] = "MEDIUM"; + HarmProbability["HIGH"] = "HIGH"; + })(exports2.HarmProbability || (exports2.HarmProbability = {})); + exports2.BlockReason = void 0; + (function(BlockReason) { + BlockReason["BLOCKED_REASON_UNSPECIFIED"] = "BLOCKED_REASON_UNSPECIFIED"; + BlockReason["SAFETY"] = "SAFETY"; + BlockReason["OTHER"] = "OTHER"; + })(exports2.BlockReason || (exports2.BlockReason = {})); + exports2.FinishReason = void 0; + (function(FinishReason) { + FinishReason["FINISH_REASON_UNSPECIFIED"] = "FINISH_REASON_UNSPECIFIED"; + FinishReason["STOP"] = "STOP"; + FinishReason["MAX_TOKENS"] = "MAX_TOKENS"; + FinishReason["SAFETY"] = "SAFETY"; + FinishReason["RECITATION"] = "RECITATION"; + FinishReason["LANGUAGE"] = "LANGUAGE"; + FinishReason["BLOCKLIST"] = "BLOCKLIST"; + FinishReason["PROHIBITED_CONTENT"] = "PROHIBITED_CONTENT"; + FinishReason["SPII"] = "SPII"; + FinishReason["MALFORMED_FUNCTION_CALL"] = "MALFORMED_FUNCTION_CALL"; + FinishReason["OTHER"] = "OTHER"; + })(exports2.FinishReason || (exports2.FinishReason = {})); + exports2.TaskType = void 0; + (function(TaskType) { + TaskType["TASK_TYPE_UNSPECIFIED"] = "TASK_TYPE_UNSPECIFIED"; + TaskType["RETRIEVAL_QUERY"] = "RETRIEVAL_QUERY"; + TaskType["RETRIEVAL_DOCUMENT"] = "RETRIEVAL_DOCUMENT"; + TaskType["SEMANTIC_SIMILARITY"] = "SEMANTIC_SIMILARITY"; + TaskType["CLASSIFICATION"] = "CLASSIFICATION"; + TaskType["CLUSTERING"] = "CLUSTERING"; + })(exports2.TaskType || (exports2.TaskType = {})); + exports2.FunctionCallingMode = void 0; + (function(FunctionCallingMode) { + FunctionCallingMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED"; + FunctionCallingMode["AUTO"] = "AUTO"; + FunctionCallingMode["ANY"] = "ANY"; + FunctionCallingMode["NONE"] = "NONE"; + })(exports2.FunctionCallingMode || (exports2.FunctionCallingMode = {})); + exports2.DynamicRetrievalMode = void 0; + (function(DynamicRetrievalMode) { + DynamicRetrievalMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED"; + DynamicRetrievalMode["MODE_DYNAMIC"] = "MODE_DYNAMIC"; + })(exports2.DynamicRetrievalMode || (exports2.DynamicRetrievalMode = {})); + var GoogleGenerativeAIError = class extends Error { + constructor(message) { + super(`[GoogleGenerativeAI Error]: ${message}`); } }; - loggerMiddlewareOptions = { - name: "loggerMiddleware", - tags: ["LOGGER"], - step: "initialize", - override: true + var GoogleGenerativeAIResponseError = class extends GoogleGenerativeAIError { + constructor(message, response) { + super(message); + this.response = response; + } }; - getLoggerPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add(loggerMiddleware(), loggerMiddlewareOptions); + var GoogleGenerativeAIFetchError = class extends GoogleGenerativeAIError { + constructor(message, status, statusText, errorDetails) { + super(message); + this.status = status; + this.statusText = statusText; + this.errorDetails = errorDetails; } - }); - } -}); - -// node_modules/@aws-sdk/middleware-logger/dist-es/index.js -var init_dist_es5 = __esm({ - "node_modules/@aws-sdk/middleware-logger/dist-es/index.js"() { - "use strict"; - init_loggerMiddleware(); - } -}); - -// node_modules/@aws-sdk/middleware-recursion-detection/dist-es/configuration.js -var recursionDetectionMiddlewareOptions; -var init_configuration = __esm({ - "node_modules/@aws-sdk/middleware-recursion-detection/dist-es/configuration.js"() { - "use strict"; - recursionDetectionMiddlewareOptions = { - step: "build", - tags: ["RECURSION_DETECTION"], - name: "recursionDetectionMiddleware", - override: true, - priority: "low" }; - } -}); - -// node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js -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"() { - "use strict"; - 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") + var GoogleGenerativeAIRequestInputError = class extends GoogleGenerativeAIError { }; - 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); + var GoogleGenerativeAIAbortError = class extends GoogleGenerativeAIError { + }; + var DEFAULT_BASE_URL = "https://generativelanguage.googleapis.com"; + var DEFAULT_API_VERSION = "v1beta"; + var PACKAGE_VERSION = "0.24.1"; + var PACKAGE_LOG_HEADER = "genai-js"; + var Task; + (function(Task2) { + Task2["GENERATE_CONTENT"] = "generateContent"; + Task2["STREAM_GENERATE_CONTENT"] = "streamGenerateContent"; + Task2["COUNT_TOKENS"] = "countTokens"; + Task2["EMBED_CONTENT"] = "embedContent"; + Task2["BATCH_EMBED_CONTENTS"] = "batchEmbedContents"; + })(Task || (Task = {})); + var RequestUrl = class { + constructor(model, task, apiKey, stream5, requestOptions) { + this.model = model; + this.task = task; + this.apiKey = apiKey; + this.stream = stream5; + this.requestOptions = requestOptions; } - getRequestId() { - return this.get(PROTECTED_KEYS.REQUEST_ID) ?? "-"; + toString() { + var _a6, _b3; + const apiVersion = ((_a6 = this.requestOptions) === null || _a6 === void 0 ? void 0 : _a6.apiVersion) || DEFAULT_API_VERSION; + const baseUrl2 = ((_b3 = this.requestOptions) === null || _b3 === void 0 ? void 0 : _b3.baseUrl) || DEFAULT_BASE_URL; + let url2 = `${baseUrl2}/${apiVersion}/${this.model}:${this.task}`; + if (this.stream) { + url2 += "?alt=sse"; + } + return url2; } - getXRayTraceId() { - return this.get(PROTECTED_KEYS.X_RAY_TRACE_ID); + }; + function getClientHeaders(requestOptions) { + const clientHeaders = []; + if (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiClient) { + clientHeaders.push(requestOptions.apiClient); } - getTenantId() { - return this.get(PROTECTED_KEYS.TENANT_ID); + clientHeaders.push(`${PACKAGE_LOG_HEADER}/${PACKAGE_VERSION}`); + return clientHeaders.join(" "); + } + async function getHeaders2(url2) { + var _a6; + const headers = new Headers(); + headers.append("Content-Type", "application/json"); + headers.append("x-goog-api-client", getClientHeaders(url2.requestOptions)); + headers.append("x-goog-api-key", url2.apiKey); + let customHeaders = (_a6 = url2.requestOptions) === null || _a6 === void 0 ? void 0 : _a6.customHeaders; + if (customHeaders) { + if (!(customHeaders instanceof Headers)) { + try { + customHeaders = new Headers(customHeaders); + } catch (e6) { + throw new GoogleGenerativeAIRequestInputError(`unable to convert customHeaders value ${JSON.stringify(customHeaders)} to Headers: ${e6.message}`); + } + } + for (const [headerName, headerValue] of customHeaders.entries()) { + if (headerName === "x-goog-api-key") { + throw new GoogleGenerativeAIRequestInputError(`Cannot set reserved header name ${headerName}`); + } else if (headerName === "x-goog-api-client") { + throw new GoogleGenerativeAIRequestInputError(`Header name ${headerName} can only be set using the apiClient field`); + } + headers.append(headerName, headerValue); + } } - }; - InvokeStoreSingle = class extends InvokeStoreBase { - currentContext; - getContext() { - return this.currentContext; + return headers; + } + async function constructModelRequest(model, task, apiKey, stream5, body2, requestOptions) { + const url2 = new RequestUrl(model, task, apiKey, stream5, requestOptions); + return { + url: url2.toString(), + fetchOptions: Object.assign(Object.assign({}, buildFetchOptions(requestOptions)), { method: "POST", headers: await getHeaders2(url2), body: body2 }) + }; + } + async function makeModelRequest(model, task, apiKey, stream5, body2, requestOptions = {}, fetchFn = fetch) { + const { url: url2, fetchOptions } = await constructModelRequest(model, task, apiKey, stream5, body2, requestOptions); + return makeRequest(url2, fetchOptions, fetchFn); + } + async function makeRequest(url2, fetchOptions, fetchFn = fetch) { + let response; + try { + response = await fetchFn(url2, fetchOptions); + } catch (e6) { + handleResponseError(e6, url2); } - hasContext() { - return this.currentContext !== void 0; + if (!response.ok) { + await handleResponseNotOk(response, url2); } - get(key) { - return this.currentContext?.[key]; + return response; + } + function handleResponseError(e6, url2) { + let err = e6; + if (err.name === "AbortError") { + err = new GoogleGenerativeAIAbortError(`Request aborted when fetching ${url2.toString()}: ${e6.message}`); + err.stack = e6.stack; + } else if (!(e6 instanceof GoogleGenerativeAIFetchError || e6 instanceof GoogleGenerativeAIRequestInputError)) { + err = new GoogleGenerativeAIError(`Error fetching from ${url2.toString()}: ${e6.message}`); + err.stack = e6.stack; } - set(key, value) { - if (this.isProtectedKey(key)) { - throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`); + throw err; + } + async function handleResponseNotOk(response, url2) { + let message = ""; + let errorDetails; + try { + const json = await response.json(); + message = json.error.message; + if (json.error.details) { + message += ` ${JSON.stringify(json.error.details)}`; + errorDetails = json.error.details; } - this.currentContext = this.currentContext || {}; - this.currentContext[key] = value; + } catch (e6) { } - run(context5, fn) { - this.currentContext = context5; - return fn(); + throw new GoogleGenerativeAIFetchError(`Error fetching from ${url2.toString()}: [${response.status} ${response.statusText}] ${message}`, response.status, response.statusText, errorDetails); + } + function buildFetchOptions(requestOptions) { + const fetchOptions = {}; + if ((requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.signal) !== void 0 || (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeout) >= 0) { + const controller = new AbortController(); + if ((requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeout) >= 0) { + setTimeout(() => controller.abort(), requestOptions.timeout); + } + if (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.signal) { + requestOptions.signal.addEventListener("abort", () => { + controller.abort(); + }); + } + fetchOptions.signal = controller.signal; } - }; - InvokeStoreMulti = class _InvokeStoreMulti extends InvokeStoreBase { - als; - static async create() { - const instance = new _InvokeStoreMulti(); - const asyncHooks = await import("async_hooks"); - instance.als = new asyncHooks.AsyncLocalStorage(); - return instance; + return fetchOptions; + } + function addHelpers(response) { + response.text = () => { + if (response.candidates && response.candidates.length > 0) { + if (response.candidates.length > 1) { + console.warn(`This response had ${response.candidates.length} candidates. Returning text from the first candidate only. Access response.candidates directly to use the other candidates.`); + } + if (hadBadFinishReason(response.candidates[0])) { + throw new GoogleGenerativeAIResponseError(`${formatBlockErrorMessage(response)}`, response); + } + return getText2(response); + } else if (response.promptFeedback) { + throw new GoogleGenerativeAIResponseError(`Text not available. ${formatBlockErrorMessage(response)}`, response); + } + return ""; + }; + response.functionCall = () => { + if (response.candidates && response.candidates.length > 0) { + if (response.candidates.length > 1) { + console.warn(`This response had ${response.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`); + } + if (hadBadFinishReason(response.candidates[0])) { + throw new GoogleGenerativeAIResponseError(`${formatBlockErrorMessage(response)}`, response); + } + console.warn(`response.functionCall() is deprecated. Use response.functionCalls() instead.`); + return getFunctionCalls(response)[0]; + } else if (response.promptFeedback) { + throw new GoogleGenerativeAIResponseError(`Function call not available. ${formatBlockErrorMessage(response)}`, response); + } + return void 0; + }; + response.functionCalls = () => { + if (response.candidates && response.candidates.length > 0) { + if (response.candidates.length > 1) { + console.warn(`This response had ${response.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`); + } + if (hadBadFinishReason(response.candidates[0])) { + throw new GoogleGenerativeAIResponseError(`${formatBlockErrorMessage(response)}`, response); + } + return getFunctionCalls(response); + } else if (response.promptFeedback) { + throw new GoogleGenerativeAIResponseError(`Function call not available. ${formatBlockErrorMessage(response)}`, response); + } + return void 0; + }; + return response; + } + function getText2(response) { + var _a6, _b3, _c7, _d2; + const textStrings = []; + if ((_b3 = (_a6 = response.candidates) === null || _a6 === void 0 ? void 0 : _a6[0].content) === null || _b3 === void 0 ? void 0 : _b3.parts) { + for (const part of (_d2 = (_c7 = response.candidates) === null || _c7 === void 0 ? void 0 : _c7[0].content) === null || _d2 === void 0 ? void 0 : _d2.parts) { + if (part.text) { + textStrings.push(part.text); + } + if (part.executableCode) { + textStrings.push("\n```" + part.executableCode.language + "\n" + part.executableCode.code + "\n```\n"); + } + if (part.codeExecutionResult) { + textStrings.push("\n```\n" + part.codeExecutionResult.output + "\n```\n"); + } + } } - getContext() { - return this.als.getStore(); + if (textStrings.length > 0) { + return textStrings.join(""); + } else { + return ""; } - hasContext() { - return this.als.getStore() !== void 0; + } + function getFunctionCalls(response) { + var _a6, _b3, _c7, _d2; + const functionCalls = []; + if ((_b3 = (_a6 = response.candidates) === null || _a6 === void 0 ? void 0 : _a6[0].content) === null || _b3 === void 0 ? void 0 : _b3.parts) { + for (const part of (_d2 = (_c7 = response.candidates) === null || _c7 === void 0 ? void 0 : _c7[0].content) === null || _d2 === void 0 ? void 0 : _d2.parts) { + if (part.functionCall) { + functionCalls.push(part.functionCall); + } + } } - get(key) { - return this.als.getStore()?.[key]; + if (functionCalls.length > 0) { + return functionCalls; + } else { + return void 0; } - set(key, value) { - if (this.isProtectedKey(key)) { - throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`); + } + var badFinishReasons = [ + exports2.FinishReason.RECITATION, + exports2.FinishReason.SAFETY, + exports2.FinishReason.LANGUAGE + ]; + function hadBadFinishReason(candidate) { + return !!candidate.finishReason && badFinishReasons.includes(candidate.finishReason); + } + function formatBlockErrorMessage(response) { + var _a6, _b3, _c7; + let message = ""; + if ((!response.candidates || response.candidates.length === 0) && response.promptFeedback) { + message += "Response was blocked"; + if ((_a6 = response.promptFeedback) === null || _a6 === void 0 ? void 0 : _a6.blockReason) { + message += ` due to ${response.promptFeedback.blockReason}`; } - const store = this.als.getStore(); - if (!store) { - throw new Error("No context available"); + if ((_b3 = response.promptFeedback) === null || _b3 === void 0 ? void 0 : _b3.blockReasonMessage) { + message += `: ${response.promptFeedback.blockReasonMessage}`; + } + } else if ((_c7 = response.candidates) === null || _c7 === void 0 ? void 0 : _c7[0]) { + const firstCandidate = response.candidates[0]; + if (hadBadFinishReason(firstCandidate)) { + message += `Candidate was blocked due to ${firstCandidate.finishReason}`; + if (firstCandidate.finishMessage) { + message += `: ${firstCandidate.finishMessage}`; + } } - store[key] = value; } - run(context5, fn) { - return this.als.run(context5, fn); + return message; + } + function __await(v2) { + return this instanceof __await ? (this.v = v2, this) : new __await(v2); + } + function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g6 = generator.apply(thisArg, _arguments || []), i6, q3 = []; + return i6 = {}, verb("next"), verb("throw"), verb("return"), i6[Symbol.asyncIterator] = function() { + return this; + }, i6; + function verb(n8) { + if (g6[n8]) i6[n8] = function(v2) { + return new Promise(function(a6, b6) { + q3.push([n8, v2, a6, b6]) > 1 || resume(n8, v2); + }); + }; } - }; - (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; - } - })(); + function resume(n8, v2) { + try { + step(g6[n8](v2)); + } catch (e6) { + settle(q3[0][3], e6); } - 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-es/recursionDetectionMiddleware.js -var TRACE_ID_HEADER_NAME, ENV_LAMBDA_FUNCTION_NAME, ENV_TRACE_ID, recursionDetectionMiddleware; -var init_recursionDetectionMiddleware = __esm({ - "node_modules/@aws-sdk/middleware-recursion-detection/dist-es/recursionDetectionMiddleware.js"() { - "use strict"; - init_invoke_store(); - init_dist_es2(); - TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id"; - ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME"; - ENV_TRACE_ID = "_X_AMZN_TRACE_ID"; - recursionDetectionMiddleware = () => (next) => async (args) => { - const { request: request3 } = args; - if (!HttpRequest.isInstance(request3)) { - return next(args); + function step(r6) { + r6.value instanceof __await ? Promise.resolve(r6.value.v).then(fulfill, reject2) : settle(q3[0][2], r6); } - const traceIdHeader = Object.keys(request3.headers ?? {}).find((h6) => h6.toLowerCase() === TRACE_ID_HEADER_NAME.toLowerCase()) ?? TRACE_ID_HEADER_NAME; - if (request3.headers.hasOwnProperty(traceIdHeader)) { - return next(args); + function fulfill(value) { + resume("next", value); } - const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; - const traceIdFromEnv = process.env[ENV_TRACE_ID]; - const invokeStore = await InvokeStore.getInstanceAsync(); - const traceIdFromInvokeStore = invokeStore?.getXRayTraceId(); - const traceId = traceIdFromInvokeStore ?? traceIdFromEnv; - const nonEmptyString = (str) => typeof str === "string" && str.length > 0; - if (nonEmptyString(functionName) && nonEmptyString(traceId)) { - request3.headers[TRACE_ID_HEADER_NAME] = traceId; + function reject2(value) { + resume("throw", value); } - return next({ - ...args, - request: request3 + function settle(f6, v2) { + if (f6(v2), q3.shift(), q3.length) resume(q3[0][0], q3[0][1]); + } + } + var responseLineRE = /^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/; + function processStream(response) { + const inputStream = response.body.pipeThrough(new TextDecoderStream("utf8", { fatal: true })); + const responseStream = getResponseStream(inputStream); + const [stream1, stream22] = responseStream.tee(); + return { + stream: generateResponseSequence(stream1), + response: getResponsePromise(stream22) + }; + } + async function getResponsePromise(stream5) { + const allResponses = []; + const reader = stream5.getReader(); + while (true) { + const { done, value } = await reader.read(); + if (done) { + return addHelpers(aggregateResponses(allResponses)); + } + allResponses.push(value); + } + } + function generateResponseSequence(stream5) { + return __asyncGenerator(this, arguments, function* generateResponseSequence_1() { + const reader = stream5.getReader(); + while (true) { + const { value, done } = yield __await(reader.read()); + if (done) { + break; + } + yield yield __await(addHelpers(value)); + } }); - }; - } -}); - -// node_modules/@aws-sdk/middleware-recursion-detection/dist-es/getRecursionDetectionPlugin.js -var getRecursionDetectionPlugin; -var init_getRecursionDetectionPlugin = __esm({ - "node_modules/@aws-sdk/middleware-recursion-detection/dist-es/getRecursionDetectionPlugin.js"() { - "use strict"; - init_configuration(); - init_recursionDetectionMiddleware(); - getRecursionDetectionPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add(recursionDetectionMiddleware(), recursionDetectionMiddlewareOptions); + } + function getResponseStream(inputStream) { + const reader = inputStream.getReader(); + const stream5 = new ReadableStream({ + start(controller) { + let currentText = ""; + return pump(); + function pump() { + return reader.read().then(({ value, done }) => { + if (done) { + if (currentText.trim()) { + controller.error(new GoogleGenerativeAIError("Failed to parse stream")); + return; + } + controller.close(); + return; + } + currentText += value; + let match3 = currentText.match(responseLineRE); + let parsedResponse; + while (match3) { + try { + parsedResponse = JSON.parse(match3[1]); + } catch (e6) { + controller.error(new GoogleGenerativeAIError(`Error parsing JSON response: "${match3[1]}"`)); + return; + } + controller.enqueue(parsedResponse); + currentText = currentText.substring(match3[0].length); + match3 = currentText.match(responseLineRE); + } + return pump(); + }).catch((e6) => { + let err = e6; + err.stack = e6.stack; + if (err.name === "AbortError") { + err = new GoogleGenerativeAIAbortError("Request aborted when reading from the stream"); + } else { + err = new GoogleGenerativeAIError("Error reading from the stream"); + } + throw err; + }); + } + } + }); + return stream5; + } + function aggregateResponses(responses) { + const lastResponse = responses[responses.length - 1]; + const aggregatedResponse = { + promptFeedback: lastResponse === null || lastResponse === void 0 ? void 0 : lastResponse.promptFeedback + }; + for (const response of responses) { + if (response.candidates) { + let candidateIndex = 0; + for (const candidate of response.candidates) { + if (!aggregatedResponse.candidates) { + aggregatedResponse.candidates = []; + } + if (!aggregatedResponse.candidates[candidateIndex]) { + aggregatedResponse.candidates[candidateIndex] = { + index: candidateIndex + }; + } + aggregatedResponse.candidates[candidateIndex].citationMetadata = candidate.citationMetadata; + aggregatedResponse.candidates[candidateIndex].groundingMetadata = candidate.groundingMetadata; + aggregatedResponse.candidates[candidateIndex].finishReason = candidate.finishReason; + aggregatedResponse.candidates[candidateIndex].finishMessage = candidate.finishMessage; + aggregatedResponse.candidates[candidateIndex].safetyRatings = candidate.safetyRatings; + if (candidate.content && candidate.content.parts) { + if (!aggregatedResponse.candidates[candidateIndex].content) { + aggregatedResponse.candidates[candidateIndex].content = { + role: candidate.content.role || "user", + parts: [] + }; + } + const newPart = {}; + for (const part of candidate.content.parts) { + if (part.text) { + newPart.text = part.text; + } + if (part.functionCall) { + newPart.functionCall = part.functionCall; + } + if (part.executableCode) { + newPart.executableCode = part.executableCode; + } + if (part.codeExecutionResult) { + newPart.codeExecutionResult = part.codeExecutionResult; + } + if (Object.keys(newPart).length === 0) { + newPart.text = ""; + } + aggregatedResponse.candidates[candidateIndex].content.parts.push(newPart); + } + } + } + candidateIndex++; + } + if (response.usageMetadata) { + aggregatedResponse.usageMetadata = response.usageMetadata; + } } - }); - } -}); - -// node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js -var init_dist_es6 = __esm({ - "node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js"() { - "use strict"; - init_getRecursionDetectionPlugin(); - init_recursionDetectionMiddleware(); - } -}); - -// node_modules/@smithy/core/dist-es/getSmithyContext.js -var init_getSmithyContext = __esm({ - "node_modules/@smithy/core/dist-es/getSmithyContext.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/util-middleware/dist-es/getSmithyContext.js -var getSmithyContext; -var init_getSmithyContext2 = __esm({ - "node_modules/@smithy/util-middleware/dist-es/getSmithyContext.js"() { - "use strict"; - init_dist_es(); - getSmithyContext = (context5) => context5[SMITHY_CONTEXT_KEY] || (context5[SMITHY_CONTEXT_KEY] = {}); - } -}); - -// node_modules/@smithy/util-middleware/dist-es/normalizeProvider.js -var normalizeProvider; -var init_normalizeProvider = __esm({ - "node_modules/@smithy/util-middleware/dist-es/normalizeProvider.js"() { - "use strict"; - normalizeProvider = (input) => { - if (typeof input === "function") - return input; - const promisified = Promise.resolve(input); - return () => promisified; - }; - } -}); - -// node_modules/@smithy/util-middleware/dist-es/index.js -var init_dist_es7 = __esm({ - "node_modules/@smithy/util-middleware/dist-es/index.js"() { - "use strict"; - init_getSmithyContext2(); - init_normalizeProvider(); - } -}); - -// 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"() { - "use strict"; - resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => { - if (!authSchemePreference || authSchemePreference.length === 0) { - return candidateAuthOptions; + return aggregatedResponse; + } + async function generateContentStream(apiKey, model, params, requestOptions) { + const response = await makeModelRequest( + model, + Task.STREAM_GENERATE_CONTENT, + apiKey, + /* stream */ + true, + JSON.stringify(params), + requestOptions + ); + return processStream(response); + } + async function generateContent(apiKey, model, params, requestOptions) { + const response = await makeModelRequest( + model, + Task.GENERATE_CONTENT, + apiKey, + /* stream */ + false, + JSON.stringify(params), + requestOptions + ); + const responseJson = await response.json(); + const enhancedResponse = addHelpers(responseJson); + return { + response: enhancedResponse + }; + } + function formatSystemInstruction(input) { + if (input == null) { + return void 0; + } else if (typeof input === "string") { + return { role: "system", parts: [{ text: input }] }; + } else if (input.text) { + return { role: "system", parts: [input] }; + } else if (input.parts) { + if (!input.role) { + return { role: "system", parts: input.parts }; + } else { + return input; + } } - const preferredAuthOptions = []; - for (const preferredSchemeName of authSchemePreference) { - for (const candidateAuthOption of candidateAuthOptions) { - const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1]; - if (candidateAuthSchemeName === preferredSchemeName) { - preferredAuthOptions.push(candidateAuthOption); + } + function formatNewContent(request2) { + let newParts = []; + if (typeof request2 === "string") { + newParts = [{ text: request2 }]; + } else { + for (const partOrString of request2) { + if (typeof partOrString === "string") { + newParts.push({ text: partOrString }); + } else { + newParts.push(partOrString); } } } - for (const candidateAuthOption of candidateAuthOptions) { - if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) { - preferredAuthOptions.push(candidateAuthOption); + return assignRoleToPartsAndValidateSendMessageRequest(newParts); + } + function assignRoleToPartsAndValidateSendMessageRequest(parts) { + const userContent = { role: "user", parts: [] }; + const functionContent = { role: "function", parts: [] }; + let hasUserContent = false; + let hasFunctionContent = false; + for (const part of parts) { + if ("functionResponse" in part) { + functionContent.parts.push(part); + hasFunctionContent = true; + } else { + userContent.parts.push(part); + hasUserContent = true; } } - return preferredAuthOptions; + if (hasUserContent && hasFunctionContent) { + throw new GoogleGenerativeAIError("Within a single message, FunctionResponse cannot be mixed with other type of part in the request for sending chat message."); + } + if (!hasUserContent && !hasFunctionContent) { + throw new GoogleGenerativeAIError("No content is provided for sending chat message."); + } + if (hasUserContent) { + return userContent; + } + return functionContent; + } + function formatCountTokensInput(params, modelParams) { + var _a6; + let formattedGenerateContentRequest = { + model: modelParams === null || modelParams === void 0 ? void 0 : modelParams.model, + generationConfig: modelParams === null || modelParams === void 0 ? void 0 : modelParams.generationConfig, + safetySettings: modelParams === null || modelParams === void 0 ? void 0 : modelParams.safetySettings, + tools: modelParams === null || modelParams === void 0 ? void 0 : modelParams.tools, + toolConfig: modelParams === null || modelParams === void 0 ? void 0 : modelParams.toolConfig, + systemInstruction: modelParams === null || modelParams === void 0 ? void 0 : modelParams.systemInstruction, + cachedContent: (_a6 = modelParams === null || modelParams === void 0 ? void 0 : modelParams.cachedContent) === null || _a6 === void 0 ? void 0 : _a6.name, + contents: [] + }; + const containsGenerateContentRequest = params.generateContentRequest != null; + if (params.contents) { + if (containsGenerateContentRequest) { + throw new GoogleGenerativeAIRequestInputError("CountTokensRequest must have one of contents or generateContentRequest, not both."); + } + formattedGenerateContentRequest.contents = params.contents; + } else if (containsGenerateContentRequest) { + formattedGenerateContentRequest = Object.assign(Object.assign({}, formattedGenerateContentRequest), params.generateContentRequest); + } else { + const content = formatNewContent(params); + formattedGenerateContentRequest.contents = [content]; + } + return { generateContentRequest: formattedGenerateContentRequest }; + } + function formatGenerateContentInput(params) { + let formattedRequest; + if (params.contents) { + formattedRequest = params; + } else { + const content = formatNewContent(params); + formattedRequest = { contents: [content] }; + } + if (params.systemInstruction) { + formattedRequest.systemInstruction = formatSystemInstruction(params.systemInstruction); + } + return formattedRequest; + } + function formatEmbedContentInput(params) { + if (typeof params === "string" || Array.isArray(params)) { + const content = formatNewContent(params); + return { content }; + } + return params; + } + var VALID_PART_FIELDS = [ + "text", + "inlineData", + "functionCall", + "functionResponse", + "executableCode", + "codeExecutionResult" + ]; + var VALID_PARTS_PER_ROLE = { + user: ["text", "inlineData"], + function: ["functionResponse"], + model: ["text", "functionCall", "executableCode", "codeExecutionResult"], + // System instructions shouldn't be in history anyway. + system: ["text"] }; - } -}); - -// node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js -function convertHttpAuthSchemesToMap(httpAuthSchemes) { - const map2 = /* @__PURE__ */ new Map(); - for (const scheme of httpAuthSchemes) { - map2.set(scheme.schemeId, scheme); - } - return map2; -} -var httpAuthSchemeMiddleware; -var init_httpAuthSchemeMiddleware = __esm({ - "node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js"() { - "use strict"; - init_dist_es7(); - init_resolveAuthOptions(); - httpAuthSchemeMiddleware = (config, mwOptions) => (next, context5) => async (args) => { - const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context5, args.input)); - const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : []; - const resolvedOptions = resolveAuthOptions(options, authSchemePreference); - const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes); - const smithyContext = getSmithyContext(context5); - 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; + function validateChatHistory(history) { + let prevContent = false; + for (const currContent of history) { + const { role, parts } = currContent; + if (!prevContent && role !== "user") { + throw new GoogleGenerativeAIError(`First content should be with role 'user', got ${role}`); } - const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config)); - if (!identityProvider) { - failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`); - continue; + if (!POSSIBLE_ROLES.includes(role)) { + throw new GoogleGenerativeAIError(`Each item should include role field. Got ${role} but valid roles are: ${JSON.stringify(POSSIBLE_ROLES)}`); } - const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context5) || {}; - 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 + if (!Array.isArray(parts)) { + throw new GoogleGenerativeAIError("Content should have 'parts' property with an array of Parts"); + } + if (parts.length === 0) { + throw new GoogleGenerativeAIError("Each Content should have at least one part"); + } + const countFields = { + text: 0, + inlineData: 0, + functionCall: 0, + functionResponse: 0, + fileData: 0, + executableCode: 0, + codeExecutionResult: 0 }; - break; + for (const part of parts) { + for (const key of VALID_PART_FIELDS) { + if (key in part) { + countFields[key] += 1; + } + } + } + const validParts = VALID_PARTS_PER_ROLE[role]; + for (const key of VALID_PART_FIELDS) { + if (!validParts.includes(key) && countFields[key] > 0) { + throw new GoogleGenerativeAIError(`Content with role '${role}' can't contain '${key}' part`); + } + } + prevContent = true; } - if (!smithyContext.selectedHttpAuthScheme) { - throw new Error(failureReasons.join("\n")); + } + function isValidResponse(response) { + var _a6; + if (response.candidates === void 0 || response.candidates.length === 0) { + return false; } - 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"() { - "use strict"; - 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); + const content = (_a6 = response.candidates[0]) === null || _a6 === void 0 ? void 0 : _a6.content; + if (content === void 0) { + return false; } - }); - } -}); - -// node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js -var init_getHttpAuthSchemePlugin = __esm({ - "node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js"() { - "use strict"; - } -}); - -// 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"() { - "use strict"; - init_httpAuthSchemeMiddleware(); - init_getHttpAuthSchemeEndpointRuleSetPlugin(); - init_getHttpAuthSchemePlugin(); - } -}); - -// node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js -var defaultErrorHandler, defaultSuccessHandler, httpSigningMiddleware; -var init_httpSigningMiddleware = __esm({ - "node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js"() { - "use strict"; - init_dist_es2(); - init_dist_es7(); - defaultErrorHandler = (signingProperties) => (error2) => { - throw error2; - }; - defaultSuccessHandler = (httpResponse, signingProperties) => { - }; - httpSigningMiddleware = (config) => (next, context5) => async (args) => { - if (!HttpRequest.isInstance(args.request)) { - return next(args); + if (content.parts === void 0 || content.parts.length === 0) { + return false; } - const smithyContext = getSmithyContext(context5); - const scheme = smithyContext.selectedHttpAuthScheme; - if (!scheme) { - throw new Error(`No HttpAuthScheme was selected: unable to sign request`); + for (const part of content.parts) { + if (part === void 0 || Object.keys(part).length === 0) { + return false; + } + if (part.text !== void 0 && part.text === "") { + return false; + } } - 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"() { - "use strict"; - 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); + return true; + } + var SILENT_ERROR = "SILENT_ERROR"; + var ChatSession = class { + constructor(apiKey, model, params, _requestOptions = {}) { + this.model = model; + this.params = params; + this._requestOptions = _requestOptions; + this._history = []; + this._sendPromise = Promise.resolve(); + this._apiKey = apiKey; + if (params === null || params === void 0 ? void 0 : params.history) { + validateChatHistory(params.history); + this._history = params.history; + } } - }); - } -}); - -// 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"() { - "use strict"; - init_httpSigningMiddleware(); - init_getHttpSigningMiddleware(); - } -}); - -// node_modules/@smithy/core/dist-es/normalizeProvider.js -var normalizeProvider2; -var init_normalizeProvider2 = __esm({ - "node_modules/@smithy/core/dist-es/normalizeProvider.js"() { - "use strict"; - normalizeProvider2 = (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; + /** + * Gets the chat history so far. Blocked prompts are not added to history. + * Blocked candidates are not added to history, nor are the prompts that + * generated them. + */ + async getHistory() { + await this._sendPromise; + return this._history; } - 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}`); + /** + * Sends a chat message and receives a non-streaming + * {@link GenerateContentResult}. + * + * Fields set in the optional {@link SingleRequestOptions} parameter will + * take precedence over the {@link RequestOptions} values provided to + * {@link GoogleGenerativeAI.getGenerativeModel }. + */ + async sendMessage(request2, requestOptions = {}) { + var _a6, _b3, _c7, _d2, _e7, _f2; + await this._sendPromise; + const newContent = formatNewContent(request2); + const generateContentRequest = { + safetySettings: (_a6 = this.params) === null || _a6 === void 0 ? void 0 : _a6.safetySettings, + generationConfig: (_b3 = this.params) === null || _b3 === void 0 ? void 0 : _b3.generationConfig, + tools: (_c7 = this.params) === null || _c7 === void 0 ? void 0 : _c7.tools, + toolConfig: (_d2 = this.params) === null || _d2 === void 0 ? void 0 : _d2.toolConfig, + systemInstruction: (_e7 = this.params) === null || _e7 === void 0 ? void 0 : _e7.systemInstruction, + cachedContent: (_f2 = this.params) === null || _f2 === void 0 ? void 0 : _f2.cachedContent, + contents: [...this._history, newContent] + }; + const chatSessionRequestOptions = Object.assign(Object.assign({}, this._requestOptions), requestOptions); + let finalResult; + this._sendPromise = this._sendPromise.then(() => generateContent(this._apiKey, this.model, generateContentRequest, chatSessionRequestOptions)).then((result) => { + var _a7; + if (isValidResponse(result.response)) { + this._history.push(newContent); + const responseContent = Object.assign({ + parts: [], + // Response seems to come back without a role set. + role: "model" + }, (_a7 = result.response.candidates) === null || _a7 === void 0 ? void 0 : _a7[0].content); + this._history.push(responseContent); + } else { + const blockErrorMessage = formatBlockErrorMessage(result.response); + if (blockErrorMessage) { + console.warn(`sendMessage() was unsuccessful. ${blockErrorMessage}. Inspect response object for details.`); + } + } + finalResult = result; + }).catch((e6) => { + this._sendPromise = Promise.resolve(); + throw e6; + }); + await this._sendPromise; + return finalResult; + } + /** + * Sends a chat message and receives the response as a + * {@link GenerateContentStreamResult} containing an iterable stream + * and a response promise. + * + * Fields set in the optional {@link SingleRequestOptions} parameter will + * take precedence over the {@link RequestOptions} values provided to + * {@link GoogleGenerativeAI.getGenerativeModel }. + */ + async sendMessageStream(request2, requestOptions = {}) { + var _a6, _b3, _c7, _d2, _e7, _f2; + await this._sendPromise; + const newContent = formatNewContent(request2); + const generateContentRequest = { + safetySettings: (_a6 = this.params) === null || _a6 === void 0 ? void 0 : _a6.safetySettings, + generationConfig: (_b3 = this.params) === null || _b3 === void 0 ? void 0 : _b3.generationConfig, + tools: (_c7 = this.params) === null || _c7 === void 0 ? void 0 : _c7.tools, + toolConfig: (_d2 = this.params) === null || _d2 === void 0 ? void 0 : _d2.toolConfig, + systemInstruction: (_e7 = this.params) === null || _e7 === void 0 ? void 0 : _e7.systemInstruction, + cachedContent: (_f2 = this.params) === null || _f2 === void 0 ? void 0 : _f2.cachedContent, + contents: [...this._history, newContent] + }; + const chatSessionRequestOptions = Object.assign(Object.assign({}, this._requestOptions), requestOptions); + const streamPromise = generateContentStream(this._apiKey, this.model, generateContentRequest, chatSessionRequestOptions); + this._sendPromise = this._sendPromise.then(() => streamPromise).catch((_ignored) => { + throw new Error(SILENT_ERROR); + }).then((streamResult) => streamResult.response).then((response) => { + if (isValidResponse(response)) { + this._history.push(newContent); + const responseContent = Object.assign({}, response.candidates[0].content); + if (!responseContent.role) { + responseContent.role = "model"; + } + this._history.push(responseContent); + } else { + const blockErrorMessage = formatBlockErrorMessage(response); + if (blockErrorMessage) { + console.warn(`sendMessageStream() was unsuccessful. ${blockErrorMessage}. Inspect response object for details.`); + } + } + }).catch((e6) => { + if (e6.message !== SILENT_ERROR) { + console.error(e6); + } + }); + return streamPromise; } - 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"() { - "use strict"; - makePagedClientRequest = async (CommandCtor, client2, input, withCommand = (_3) => _3, ...args) => { - let command = new CommandCtor(input); - command = withCommand(command) ?? command; - return await client2.send(command, ...args); }; - get = (fromObject, path10) => { - let cursor = fromObject; - const pathComponents = path10.split("."); - for (const step of pathComponents) { - if (!cursor || typeof cursor !== "object") { - return void 0; + async function countTokens(apiKey, model, params, singleRequestOptions) { + const response = await makeModelRequest(model, Task.COUNT_TOKENS, apiKey, false, JSON.stringify(params), singleRequestOptions); + return response.json(); + } + async function embedContent(apiKey, model, params, requestOptions) { + const response = await makeModelRequest(model, Task.EMBED_CONTENT, apiKey, false, JSON.stringify(params), requestOptions); + return response.json(); + } + async function batchEmbedContents(apiKey, model, params, requestOptions) { + const requestsWithModel = params.requests.map((request2) => { + return Object.assign(Object.assign({}, request2), { model }); + }); + const response = await makeModelRequest(model, Task.BATCH_EMBED_CONTENTS, apiKey, false, JSON.stringify({ requests: requestsWithModel }), requestOptions); + return response.json(); + } + var GenerativeModel = class { + constructor(apiKey, modelParams, _requestOptions = {}) { + this.apiKey = apiKey; + this._requestOptions = _requestOptions; + if (modelParams.model.includes("/")) { + this.model = modelParams.model; + } else { + this.model = `models/${modelParams.model}`; } - cursor = cursor[step]; + this.generationConfig = modelParams.generationConfig || {}; + this.safetySettings = modelParams.safetySettings || []; + this.tools = modelParams.tools; + this.toolConfig = modelParams.toolConfig; + this.systemInstruction = formatSystemInstruction(modelParams.systemInstruction); + this.cachedContent = modelParams.cachedContent; } - return cursor; - }; - } -}); - -// node_modules/@smithy/is-array-buffer/dist-es/index.js -var isArrayBuffer2; -var init_dist_es8 = __esm({ - "node_modules/@smithy/is-array-buffer/dist-es/index.js"() { - "use strict"; - isArrayBuffer2 = (arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]"; - } -}); - -// node_modules/@smithy/util-buffer-from/dist-es/index.js -import { Buffer as Buffer3 } from "buffer"; -var fromArrayBuffer, fromString; -var init_dist_es9 = __esm({ - "node_modules/@smithy/util-buffer-from/dist-es/index.js"() { - "use strict"; - init_dist_es8(); - fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => { - if (!isArrayBuffer2(input)) { - throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); + /** + * Makes a single non-streaming call to the model + * and returns an object containing a single {@link GenerateContentResponse}. + * + * Fields set in the optional {@link SingleRequestOptions} parameter will + * take precedence over the {@link RequestOptions} values provided to + * {@link GoogleGenerativeAI.getGenerativeModel }. + */ + async generateContent(request2, requestOptions = {}) { + var _a6; + const formattedParams = formatGenerateContentInput(request2); + const generativeModelRequestOptions = Object.assign(Object.assign({}, this._requestOptions), requestOptions); + return generateContent(this.apiKey, this.model, Object.assign({ generationConfig: this.generationConfig, safetySettings: this.safetySettings, tools: this.tools, toolConfig: this.toolConfig, systemInstruction: this.systemInstruction, cachedContent: (_a6 = this.cachedContent) === null || _a6 === void 0 ? void 0 : _a6.name }, formattedParams), generativeModelRequestOptions); } - return Buffer3.from(input, offset, length); - }; - fromString = (input, encoding) => { - if (typeof input !== "string") { - throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); + /** + * Makes a single streaming call to the model and returns an object + * containing an iterable stream that iterates over all chunks in the + * streaming response as well as a promise that returns the final + * aggregated response. + * + * Fields set in the optional {@link SingleRequestOptions} parameter will + * take precedence over the {@link RequestOptions} values provided to + * {@link GoogleGenerativeAI.getGenerativeModel }. + */ + async generateContentStream(request2, requestOptions = {}) { + var _a6; + const formattedParams = formatGenerateContentInput(request2); + const generativeModelRequestOptions = Object.assign(Object.assign({}, this._requestOptions), requestOptions); + return generateContentStream(this.apiKey, this.model, Object.assign({ generationConfig: this.generationConfig, safetySettings: this.safetySettings, tools: this.tools, toolConfig: this.toolConfig, systemInstruction: this.systemInstruction, cachedContent: (_a6 = this.cachedContent) === null || _a6 === void 0 ? void 0 : _a6.name }, formattedParams), generativeModelRequestOptions); } - return encoding ? Buffer3.from(input, encoding) : Buffer3.from(input); - }; - } -}); - -// node_modules/@smithy/util-base64/dist-es/fromBase64.js -var BASE64_REGEX, fromBase64; -var init_fromBase64 = __esm({ - "node_modules/@smithy/util-base64/dist-es/fromBase64.js"() { - "use strict"; - init_dist_es9(); - BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; - fromBase64 = (input) => { - if (input.length * 3 % 4 !== 0) { - throw new TypeError(`Incorrect padding on base64 string.`); + /** + * Gets a new {@link ChatSession} instance which can be used for + * multi-turn chats. + */ + startChat(startChatParams) { + var _a6; + return new ChatSession(this.apiKey, this.model, Object.assign({ generationConfig: this.generationConfig, safetySettings: this.safetySettings, tools: this.tools, toolConfig: this.toolConfig, systemInstruction: this.systemInstruction, cachedContent: (_a6 = this.cachedContent) === null || _a6 === void 0 ? void 0 : _a6.name }, startChatParams), this._requestOptions); } - if (!BASE64_REGEX.exec(input)) { - throw new TypeError(`Invalid base64 string.`); + /** + * Counts the tokens in the provided request. + * + * Fields set in the optional {@link SingleRequestOptions} parameter will + * take precedence over the {@link RequestOptions} values provided to + * {@link GoogleGenerativeAI.getGenerativeModel }. + */ + async countTokens(request2, requestOptions = {}) { + const formattedParams = formatCountTokensInput(request2, { + model: this.model, + generationConfig: this.generationConfig, + safetySettings: this.safetySettings, + tools: this.tools, + toolConfig: this.toolConfig, + systemInstruction: this.systemInstruction, + cachedContent: this.cachedContent + }); + const generativeModelRequestOptions = Object.assign(Object.assign({}, this._requestOptions), requestOptions); + return countTokens(this.apiKey, this.model, formattedParams, generativeModelRequestOptions); } - const buffer2 = fromString(input, "base64"); - return new Uint8Array(buffer2.buffer, buffer2.byteOffset, buffer2.byteLength); - }; - } -}); - -// node_modules/@smithy/util-utf8/dist-es/fromUtf8.js -var fromUtf8; -var init_fromUtf8 = __esm({ - "node_modules/@smithy/util-utf8/dist-es/fromUtf8.js"() { - "use strict"; - init_dist_es9(); - fromUtf8 = (input) => { - const buf = fromString(input, "utf8"); - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); - }; - } -}); - -// node_modules/@smithy/util-utf8/dist-es/toUint8Array.js -var toUint8Array; -var init_toUint8Array = __esm({ - "node_modules/@smithy/util-utf8/dist-es/toUint8Array.js"() { - "use strict"; - init_fromUtf8(); - toUint8Array = (data) => { - if (typeof data === "string") { - return fromUtf8(data); + /** + * Embeds the provided content. + * + * Fields set in the optional {@link SingleRequestOptions} parameter will + * take precedence over the {@link RequestOptions} values provided to + * {@link GoogleGenerativeAI.getGenerativeModel }. + */ + async embedContent(request2, requestOptions = {}) { + const formattedParams = formatEmbedContentInput(request2); + const generativeModelRequestOptions = Object.assign(Object.assign({}, this._requestOptions), requestOptions); + return embedContent(this.apiKey, this.model, formattedParams, generativeModelRequestOptions); } - if (ArrayBuffer.isView(data)) { - return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); + /** + * Embeds an array of {@link EmbedContentRequest}s. + * + * Fields set in the optional {@link SingleRequestOptions} parameter will + * take precedence over the {@link RequestOptions} values provided to + * {@link GoogleGenerativeAI.getGenerativeModel }. + */ + async batchEmbedContents(batchEmbedContentRequest, requestOptions = {}) { + const generativeModelRequestOptions = Object.assign(Object.assign({}, this._requestOptions), requestOptions); + return batchEmbedContents(this.apiKey, this.model, batchEmbedContentRequest, generativeModelRequestOptions); } - return new Uint8Array(data); }; - } -}); - -// node_modules/@smithy/util-utf8/dist-es/toUtf8.js -var toUtf8; -var init_toUtf8 = __esm({ - "node_modules/@smithy/util-utf8/dist-es/toUtf8.js"() { - "use strict"; - init_dist_es9(); - toUtf8 = (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."); + var GoogleGenerativeAI = class { + constructor(apiKey) { + this.apiKey = apiKey; } - return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("utf8"); - }; - } -}); - -// node_modules/@smithy/util-utf8/dist-es/index.js -var init_dist_es10 = __esm({ - "node_modules/@smithy/util-utf8/dist-es/index.js"() { - "use strict"; - init_fromUtf8(); - init_toUint8Array(); - init_toUtf8(); - } -}); - -// node_modules/@smithy/util-base64/dist-es/toBase64.js -var toBase64; -var init_toBase64 = __esm({ - "node_modules/@smithy/util-base64/dist-es/toBase64.js"() { - "use strict"; - init_dist_es9(); - init_dist_es10(); - toBase64 = (_input) => { - let input; - if (typeof _input === "string") { - input = fromUtf8(_input); - } else { - input = _input; + /** + * Gets a {@link GenerativeModel} instance for the provided model name. + */ + getGenerativeModel(modelParams, requestOptions) { + if (!modelParams.model) { + throw new GoogleGenerativeAIError(`Must provide a model name. Example: genai.getGenerativeModel({ model: 'my-model-name' })`); + } + return new GenerativeModel(this.apiKey, modelParams, requestOptions); } - 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."); + /** + * Creates a {@link GenerativeModel} instance from provided content cache. + */ + getGenerativeModelFromCachedContent(cachedContent, modelParams, requestOptions) { + if (!cachedContent.name) { + throw new GoogleGenerativeAIRequestInputError("Cached content must contain a `name` field."); + } + if (!cachedContent.model) { + throw new GoogleGenerativeAIRequestInputError("Cached content must contain a `model` field."); + } + const disallowedDuplicates = ["model", "systemInstruction"]; + for (const key of disallowedDuplicates) { + if ((modelParams === null || modelParams === void 0 ? void 0 : modelParams[key]) && cachedContent[key] && (modelParams === null || modelParams === void 0 ? void 0 : modelParams[key]) !== cachedContent[key]) { + if (key === "model") { + const modelParamsComp = modelParams.model.startsWith("models/") ? modelParams.model.replace("models/", "") : modelParams.model; + const cachedContentComp = cachedContent.model.startsWith("models/") ? cachedContent.model.replace("models/", "") : cachedContent.model; + if (modelParamsComp === cachedContentComp) { + continue; + } + } + throw new GoogleGenerativeAIRequestInputError(`Different value for "${key}" specified in modelParams (${modelParams[key]}) and cachedContent (${cachedContent[key]})`); + } + } + const modelParamsFromCache = Object.assign(Object.assign({}, modelParams), { model: cachedContent.model, tools: cachedContent.tools, toolConfig: cachedContent.toolConfig, systemInstruction: cachedContent.systemInstruction, cachedContent }); + return new GenerativeModel(this.apiKey, modelParamsFromCache, requestOptions); } - return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("base64"); }; + exports2.ChatSession = ChatSession; + exports2.GenerativeModel = GenerativeModel; + exports2.GoogleGenerativeAI = GoogleGenerativeAI; + exports2.GoogleGenerativeAIAbortError = GoogleGenerativeAIAbortError; + exports2.GoogleGenerativeAIError = GoogleGenerativeAIError; + exports2.GoogleGenerativeAIFetchError = GoogleGenerativeAIFetchError; + exports2.GoogleGenerativeAIRequestInputError = GoogleGenerativeAIRequestInputError; + exports2.GoogleGenerativeAIResponseError = GoogleGenerativeAIResponseError; + exports2.POSSIBLE_ROLES = POSSIBLE_ROLES; } }); -// node_modules/@smithy/util-base64/dist-es/index.js -var init_dist_es11 = __esm({ - "node_modules/@smithy/util-base64/dist-es/index.js"() { - "use strict"; - init_fromBase64(); - init_toBase64(); - } -}); - -// node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js -var Uint8ArrayBlobAdapter; -var init_Uint8ArrayBlobAdapter = __esm({ - "node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js"() { +// node_modules/ai-ctrf/dist/models/gemini.js +var require_gemini = __commonJS({ + "node_modules/ai-ctrf/dist/models/gemini.js"(exports2) { "use strict"; - init_dist_es11(); - init_dist_es10(); - Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter extends Uint8Array { - static fromString(source, encoding = "utf-8") { - if (typeof source === "string") { - if (encoding === "base64") { - return _Uint8ArrayBlobAdapter.mutate(fromBase64(source)); + var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e6) { + reject2(e6); } - return _Uint8ArrayBlobAdapter.mutate(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 toBase64(this); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e6) { + reject2(e6); + } } - return toUtf8(this); - } + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - } -}); - -// node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.js -var init_ChecksumStream = __esm({ - "node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/util-stream/dist-es/stream-type-check.js -var isReadableStream3; -var init_stream_type_check = __esm({ - "node_modules/@smithy/util-stream/dist-es/stream-type-check.js"() { - "use strict"; - isReadableStream3 = (stream5) => typeof ReadableStream === "function" && (stream5?.constructor?.name === ReadableStream.name || stream5 instanceof ReadableStream); - } -}); - -// node_modules/@smithy/util-stream/dist-es/checksum/createChecksumStream.js -var init_createChecksumStream = __esm({ - "node_modules/@smithy/util-stream/dist-es/checksum/createChecksumStream.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/util-stream/dist-es/createBufferedReadable.js -import { Readable as Readable6 } from "stream"; -var init_createBufferedReadable = __esm({ - "node_modules/@smithy/util-stream/dist-es/createBufferedReadable.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/util-stream/dist-es/getAwsChunkedEncodingStream.js -import { Readable as Readable7 } from "stream"; -var init_getAwsChunkedEncodingStream = __esm({ - "node_modules/@smithy/util-stream/dist-es/getAwsChunkedEncodingStream.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/util-stream/dist-es/headStream.js -var init_headStream = __esm({ - "node_modules/@smithy/util-stream/dist-es/headStream.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/util-uri-escape/dist-es/escape-uri.js -var escapeUri, hexEncode; -var init_escape_uri = __esm({ - "node_modules/@smithy/util-uri-escape/dist-es/escape-uri.js"() { - "use strict"; - escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); - hexEncode = (c6) => `%${c6.charCodeAt(0).toString(16).toUpperCase()}`; - } -}); - -// node_modules/@smithy/util-uri-escape/dist-es/escape-uri-path.js -var init_escape_uri_path = __esm({ - "node_modules/@smithy/util-uri-escape/dist-es/escape-uri-path.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/util-uri-escape/dist-es/index.js -var init_dist_es12 = __esm({ - "node_modules/@smithy/util-uri-escape/dist-es/index.js"() { - "use strict"; - init_escape_uri(); - init_escape_uri_path(); - } -}); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.gemini = gemini; + exports2.geminiFailedTestSummary = geminiFailedTestSummary2; + var generative_ai_1 = require_dist7(); + var common_1 = require_common3(); + var consolidated_summary_1 = require_consolidated_summary(); + var constants_1 = require_constants9(); + function gemini(systemPrompt, prompt, args) { + return __awaiter16(this, void 0, void 0, function* () { + var _a6, _b3; + const genAI = new generative_ai_1.GoogleGenerativeAI((_a6 = process.env.GOOGLE_API_KEY) !== null && _a6 !== void 0 ? _a6 : ""); + const model = genAI.getGenerativeModel({ model: (_b3 = args.model) !== null && _b3 !== void 0 ? _b3 : "gemini-pro" }); + try { + const combinedPrompt = `${systemPrompt} -// node_modules/@smithy/querystring-builder/dist-es/index.js -function buildQueryString(query) { - const parts = []; - for (let key of Object.keys(query).sort()) { - const value = query[key]; - key = escapeUri(key); - if (Array.isArray(value)) { - for (let i6 = 0, iLen = value.length; i6 < iLen; i6++) { - parts.push(`${key}=${escapeUri(value[i6])}`); - } - } else { - let qsEntry = key; - if (value || typeof value === "string") { - qsEntry += `=${escapeUri(value)}`; - } - parts.push(qsEntry); +${(0, common_1.stripAnsi)(prompt)}`; + const result = yield model.generateContent(combinedPrompt); + const response = result.response; + const text = response.text(); + return text !== "" ? text : null; + } catch (error2) { + console.error(`Error invoking Gemini`, error2); + return null; + } + }); } - } - return parts.join("&"); -} -var init_dist_es13 = __esm({ - "node_modules/@smithy/querystring-builder/dist-es/index.js"() { - "use strict"; - init_dist_es12(); - } -}); + function geminiFailedTestSummary2(report_1, args_1, file_1) { + return __awaiter16(this, arguments, void 0, function* (report, args, file, log3 = false) { + var _a6; + const failedTests = report.results.tests.filter((test) => test.status === "failed"); + failedTests.forEach((test) => { + if (test.extra != null) { + delete test.extra; + } + }); + let logged = false; + let messageCount = 0; + for (const test of failedTests) { + if (args.maxMessages != null && messageCount >= args.maxMessages) { + break; + } + let prompt = `Report: +${JSON.stringify(test, null, 2)}. -// node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js -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 init_build_abort_error = __esm({ - "node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js"() { - "use strict"; - } -}); +Tool:${report.results.tool.name}. -// node_modules/@smithy/node-http-handler/dist-es/constants.js -var NODEJS_TIMEOUT_ERROR_CODES; -var init_constants = __esm({ - "node_modules/@smithy/node-http-handler/dist-es/constants.js"() { - "use strict"; - NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; - } -}); + Please provide a human-readable failure summary that explains why you think the test might have failed and ways to fix`; + if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { + prompt += ` -// node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js -var getTransformedHeaders; -var init_get_transformed_headers = __esm({ - "node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js"() { - "use strict"; - 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; - }; - } -}); +Additional Context: +${args.additionalPromptContext}`; + } + let systemPrompt = (_a6 = args.systemPrompt) !== null && _a6 !== void 0 ? _a6 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; + if (args.additionalSystemPromptContext != null && args.additionalSystemPromptContext !== "") { + systemPrompt += ` -// node_modules/@smithy/node-http-handler/dist-es/timing.js -var timing; -var init_timing = __esm({ - "node_modules/@smithy/node-http-handler/dist-es/timing.js"() { - "use strict"; - timing = { - setTimeout: (cb, ms2) => setTimeout(cb, ms2), - clearTimeout: (timeoutId) => clearTimeout(timeoutId) - }; +${args.additionalSystemPromptContext}`; + } + const response = yield gemini(systemPrompt, prompt, args); + if (response != null) { + test.ai = response; + messageCount++; + if (args.log === true && !logged) { + console.log("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"); + console.log("\u2728 AI Test Reporter Summary"); + console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n"); + logged = true; + } + if (args.log === true) { + console.log(`\u274C Failed Test: ${test.name} +`); + console.log(`${response} +`); + } + } + } + if (args.consolidate === true) { + yield (0, consolidated_summary_1.generateConsolidatedSummary)(report, "gemini", args); + } + if (file !== void 0) { + (0, common_1.saveUpdatedReport)(file, report); + } + return report; + }); + } } }); -// node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js -var DEFER_EVENT_LISTENER_TIME, setConnectionTimeout; -var init_set_connection_timeout = __esm({ - "node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js"() { +// node_modules/ai-ctrf/dist/models/perplexity.js +var require_perplexity = __commonJS({ + "node_modules/ai-ctrf/dist/models/perplexity.js"(exports2) { "use strict"; - init_timing(); - DEFER_EVENT_LISTENER_TIME = 1e3; - setConnectionTimeout = (request3, reject2, timeoutInMs = 0) => { - if (!timeoutInMs) { - return -1; + var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); + }); } - const registerTimeout = (offset) => { - const timeoutId = timing.setTimeout(() => { - request3.destroy(); - reject2(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); + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e6) { + reject2(e6); } - }; - if (request3.socket) { - doWithSocket(request3.socket); - } else { - request3.on("socket", doWithSocket); } - }; - if (timeoutInMs < 2e3) { - registerTimeout(0); - return 0; - } - return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME); - }; - } -}); - -// node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js -var setRequestTimeout; -var init_set_request_timeout = __esm({ - "node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js"() { - "use strict"; - init_timing(); - setRequestTimeout = (req, reject2, timeoutInMs = 0, throwOnRequestTimeout, logger8) => { - 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 error2 = Object.assign(new Error(msg), { - name: "TimeoutError", - code: "ETIMEDOUT" - }); - req.destroy(error2); - reject2(error2); - } else { - msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`; - logger8?.warn?.(msg); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e6) { + reject2(e6); } - }, timeoutInMs); - } - return -1; - }; - } -}); - -// node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js -var DEFER_EVENT_LISTENER_TIME2, setSocketKeepAlive; -var init_set_socket_keep_alive = __esm({ - "node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js"() { - "use strict"; - init_timing(); - DEFER_EVENT_LISTENER_TIME2 = 3e3; - setSocketKeepAlive = (request3, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME2) => { - if (keepAlive !== true) { - return -1; - } - const registerListener = () => { - if (request3.socket) { - request3.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - } else { - request3.on("socket", (socket) => { - socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - }); } - }; - if (deferTimeMs === 0) { - registerListener(); - return 0; - } - return timing.setTimeout(registerListener, deferTimeMs); - }; - } -}); - -// node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js -var DEFER_EVENT_LISTENER_TIME3, setSocketTimeout; -var init_set_socket_timeout = __esm({ - "node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js"() { - "use strict"; - init_timing(); - DEFER_EVENT_LISTENER_TIME3 = 3e3; - setSocketTimeout = (request3, reject2, timeoutInMs = 0) => { - const registerTimeout = (offset) => { - const timeout2 = timeoutInMs - offset; - const onTimeout = () => { - request3.destroy(); - reject2(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 (request3.socket) { - request3.socket.setTimeout(timeout2, onTimeout); - request3.on("close", () => request3.socket?.removeListener("timeout", onTimeout)); - } else { - request3.setTimeout(timeout2, onTimeout); + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - }; - if (0 < timeoutInMs && timeoutInMs < 6e3) { - registerTimeout(0); - return 0; - } - return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME3), DEFER_EVENT_LISTENER_TIME3); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - } -}); - -// node_modules/@smithy/node-http-handler/dist-es/write-request-body.js -import { Readable as Readable8 } from "stream"; -async function writeRequestBody(httpRequest2, request3, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) { - const headers = request3.headers ?? {}; - const expect = headers.Expect || headers.expect; - let timeoutId = -1; - let sendBody = true; - if (!externalAgent && expect === "100-continue") { - sendBody = await Promise.race([ - new Promise((resolve4) => { - timeoutId = Number(timing.setTimeout(() => resolve4(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); - }), - new Promise((resolve4) => { - httpRequest2.on("continue", () => { - timing.clearTimeout(timeoutId); - resolve4(true); - }); - httpRequest2.on("response", () => { - timing.clearTimeout(timeoutId); - resolve4(false); - }); - httpRequest2.on("error", () => { - timing.clearTimeout(timeoutId); - resolve4(false); + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.perplexity = perplexity; + exports2.perplexityFailedTestSummary = perplexityFailedTestSummary2; + var common_1 = require_common3(); + var consolidated_summary_1 = require_consolidated_summary(); + var openai_1 = __importDefault(require_openai()); + var constants_1 = require_constants9(); + function perplexity(systemPrompt, prompt, args) { + return __awaiter16(this, void 0, void 0, function* () { + var _a6, _b3, _c7, _d2; + const client2 = new openai_1.default({ + apiKey: process.env.PERPLEXITY_API_KEY, + baseURL: "https://api.perplexity.ai" }); - }) - ]); - } - if (sendBody) { - writeBody(httpRequest2, request3.body); - } -} -function writeBody(httpRequest2, body2) { - if (body2 instanceof Readable8) { - body2.pipe(httpRequest2); - return; - } - if (body2) { - const isBuffer = Buffer.isBuffer(body2); - const isString = typeof body2 === "string"; - if (isBuffer || isString) { - if (isBuffer && body2.byteLength === 0) { - httpRequest2.end(); - } else { - httpRequest2.end(body2); - } - return; + try { + const response = yield client2.chat.completions.create(Object.assign(Object.assign({ model: (_a6 = args.model) !== null && _a6 !== void 0 ? _a6 : "llama-3.1-sonar-small-128k-online", messages: [ + { role: "system", content: systemPrompt }, + { role: "user", content: (0, common_1.stripAnsi)(prompt) } + ], max_tokens: (_b3 = args.maxTokens) !== null && _b3 !== void 0 ? _b3 : null, frequency_penalty: args.frequencyPenalty, presence_penalty: args.presencePenalty }, args.temperature !== void 0 ? { temperature: args.temperature } : {}), args.topP !== void 0 ? { top_p: args.topP } : {})); + return (_d2 = (_c7 = response.choices[0].message) === null || _c7 === void 0 ? void 0 : _c7.content) !== null && _d2 !== void 0 ? _d2 : null; + } catch (error2) { + console.error(`Error invoking Perplexity`, error2); + return null; + } + }); } - const uint8 = body2; - if (typeof uint8 === "object" && uint8.buffer && typeof uint8.byteOffset === "number" && typeof uint8.byteLength === "number") { - httpRequest2.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength)); - return; + function perplexityFailedTestSummary2(report_1, args_1, file_1) { + return __awaiter16(this, arguments, void 0, function* (report, args, file, log3 = false) { + var _a6; + const failedTests = report.results.tests.filter((test) => test.status === "failed"); + failedTests.forEach((test) => { + if (test.extra != null) { + delete test.extra; + } + }); + let logged = false; + let messageCount = 0; + for (const test of failedTests) { + if (args.maxMessages != null && messageCount >= args.maxMessages) { + break; + } + let prompt = `Report: +${JSON.stringify(test, null, 2)}. + +Tool:${report.results.tool.name}. + + Please provide a human-readable failure summary that explains why you think the test might have failed and ways to fix`; + if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { + prompt += ` + +Additional Context: +${args.additionalPromptContext}`; + } + let systemPrompt = (_a6 = args.systemPrompt) !== null && _a6 !== void 0 ? _a6 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; + if (args.additionalSystemPromptContext != null && args.additionalSystemPromptContext !== "") { + systemPrompt += ` + +${args.additionalSystemPromptContext}`; + } + const response = yield perplexity(systemPrompt, prompt, args); + if (response != null) { + test.ai = response; + messageCount++; + if (args.log === true && !logged) { + console.log("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"); + console.log("\u2728 AI Test Reporter Summary"); + console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n"); + logged = true; + } + if (args.log === true) { + console.log(`\u274C Failed Test: ${test.name} +`); + console.log(`${response} +`); + } + } + } + if (args.consolidate === true) { + yield (0, consolidated_summary_1.generateConsolidatedSummary)(report, "perplexity", args); + } + if (file !== void 0) { + (0, common_1.saveUpdatedReport)(file, report); + } + return report; + }); } - httpRequest2.end(Buffer.from(body2)); - return; - } - httpRequest2.end(); -} -var MIN_WAIT_TIME; -var init_write_request_body = __esm({ - "node_modules/@smithy/node-http-handler/dist-es/write-request-body.js"() { - "use strict"; - init_timing(); - MIN_WAIT_TIME = 6e3; } }); -// node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js -import { Agent as hsAgent, request as hsRequest } from "https"; -var hAgent, hRequest, NodeHttpHandler; -var init_node_http_handler = __esm({ - "node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js"() { +// node_modules/ai-ctrf/dist/models/openrouter.js +var require_openrouter = __commonJS({ + "node_modules/ai-ctrf/dist/models/openrouter.js"(exports2) { "use strict"; - init_dist_es2(); - init_dist_es13(); - init_build_abort_error(); - init_constants(); - init_get_transformed_headers(); - init_set_connection_timeout(); - init_set_request_timeout(); - init_set_socket_keep_alive(); - init_set_socket_timeout(); - init_timing(); - init_write_request_body(); - hAgent = void 0; - hRequest = void 0; - NodeHttpHandler = 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); + var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); + }); } - static checkSocketUsage(agent, socketWarningTimestamp, logger8 = 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) { - logger8?.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 new (P2 || (P2 = Promise))(function(resolve8, reject2) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e6) { + reject2(e6); } } - return socketWarningTimestamp; - } - constructor(options) { - this.configProvider = new Promise((resolve4, reject2) => { - if (typeof options === "function") { - options().then((_options) => { - resolve4(this.resolveDefaultConfig(_options)); - }).catch(reject2); - } else { - resolve4(this.resolveDefaultConfig(options)); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e6) { + reject2(e6); } - }); - } - destroy() { - this.config?.httpAgent?.destroy(); - this.config?.httpsAgent?.destroy(); - } - async handle(request3, { abortSignal, requestTimeout } = {}) { - if (!this.config) { - this.config = await this.configProvider; } - const config = this.config; - const isSSL = request3.protocol === "https:"; - if (!isSSL && !this.config.httpAgent) { - this.config.httpAgent = await this.config.httpAgentProvider(); + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - return new Promise((_resolve, _reject) => { - let writeRequestBodyPromise = void 0; - const timeouts = []; - const resolve4 = async (arg) => { - await writeRequestBodyPromise; - timeouts.forEach(timing.clearTimeout); - _resolve(arg); - }; - const reject2 = async (arg) => { - await writeRequestBodyPromise; - timeouts.forEach(timing.clearTimeout); - _reject(arg); - }; - if (abortSignal?.aborted) { - const abortError = buildAbortError(abortSignal); - reject2(abortError); - return; - } - const headers = request3.headers ?? {}; - const expectContinue = (headers.Expect ?? headers.expect) === "100-continue"; - let agent = isSSL ? config.httpsAgent : config.httpAgent; - if (expectContinue && !this.externalAgent) { - agent = new (isSSL ? hsAgent : 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 = buildQueryString(request3.query || {}); - let auth2 = void 0; - if (request3.username != null || request3.password != null) { - const username = request3.username ?? ""; - const password = request3.password ?? ""; - auth2 = `${username}:${password}`; - } - let path10 = request3.path; - if (queryString) { - path10 += `?${queryString}`; + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.openRouter = openRouter; + exports2.openRouterFailedTestSummary = openRouterFailedTestSummary2; + var openai_1 = __importDefault(require_openai()); + var common_1 = require_common3(); + var consolidated_summary_1 = require_consolidated_summary(); + var constants_1 = require_constants9(); + function openRouter(systemPrompt, prompt, args) { + return __awaiter16(this, void 0, void 0, function* () { + var _a6, _b3, _c7, _d2, _e7, _f2, _g2; + const client2 = new openai_1.default({ + apiKey: process.env.OPENROUTER_API_KEY, + baseURL: "https://openrouter.ai/api/v1", + defaultHeaders: { + "HTTP-Referer": (_a6 = process.env.OPENROUTER_REFERER) !== null && _a6 !== void 0 ? _a6 : "http://localhost:3000", + "X-Title": "AI Test Reporter" } - if (request3.fragment) { - path10 += `#${request3.fragment}`; + }); + try { + const response = yield client2.chat.completions.create(Object.assign(Object.assign(Object.assign({ model: (_b3 = args.model) !== null && _b3 !== void 0 ? _b3 : "openai/gpt-3.5-turbo", messages: [ + { role: "system", content: systemPrompt }, + { role: "user", content: (0, common_1.stripAnsi)(prompt) } + ], max_tokens: (_c7 = args.maxTokens) !== null && _c7 !== void 0 ? _c7 : void 0, temperature: (_d2 = args.temperature) !== null && _d2 !== void 0 ? _d2 : void 0 }, args.frequencyPenalty !== void 0 && { + frequency_penalty: args.frequencyPenalty + }), args.presencePenalty !== void 0 && { + presence_penalty: args.presencePenalty + }), args.topP !== void 0 && { top_p: args.topP })); + if (((_g2 = (_f2 = (_e7 = response === null || response === void 0 ? void 0 : response.choices) === null || _e7 === void 0 ? void 0 : _e7[0]) === null || _f2 === void 0 ? void 0 : _f2.message) === null || _g2 === void 0 ? void 0 : _g2.content) == null) { + return null; } - let hostname = request3.hostname ?? ""; - if (hostname[0] === "[" && hostname.endsWith("]")) { - hostname = request3.hostname.slice(1, -1); - } else { - hostname = request3.hostname; + return response.choices[0].message.content; + } catch (error2) { + console.error(`Error invoking OpenRouter`, error2); + return null; + } + }); + } + function openRouterFailedTestSummary2(report_1, args_1, file_1) { + return __awaiter16(this, arguments, void 0, function* (report, args, file, log3 = false) { + var _a6; + const failedTests = report.results.tests.filter((test) => test.status === "failed"); + failedTests.forEach((test) => { + if (test.extra != null) { + delete test.extra; } - const nodeHttpsOptions = { - headers: request3.headers, - host: hostname, - method: request3.method, - path: path10, - port: request3.port, - agent, - auth: auth2 - }; - const requestFunc = isSSL ? hsRequest : hRequest; - const req = requestFunc(nodeHttpsOptions, (res) => { - const httpResponse = new HttpResponse({ - statusCode: res.statusCode || -1, - reason: res.statusMessage, - headers: getTransformedHeaders(res.headers), - body: res - }); - resolve4({ response: httpResponse }); - }); - req.on("error", (err) => { - if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { - reject2(Object.assign(err, { name: "TimeoutError" })); - } else { - reject2(err); - } - }); - if (abortSignal) { - const onAbort = () => { - req.destroy(); - const abortError = buildAbortError(abortSignal); - reject2(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; - } + }); + let logged = false; + let messageCount = 0; + for (const test of failedTests) { + if (args.maxMessages != null && messageCount >= args.maxMessages) { + break; } - const effectiveRequestTimeout = requestTimeout ?? config.requestTimeout; - timeouts.push(setConnectionTimeout(req, reject2, config.connectionTimeout)); - timeouts.push(setRequestTimeout(req, reject2, effectiveRequestTimeout, config.throwOnRequestTimeout, config.logger ?? console)); - timeouts.push(setSocketTimeout(req, reject2, config.socketTimeout)); - const httpAgent = nodeHttpsOptions.agent; - if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { - timeouts.push(setSocketKeepAlive(req, { - keepAlive: httpAgent.keepAlive, - keepAliveMsecs: httpAgent.keepAliveMsecs - })); + let prompt = `Report: +${JSON.stringify(test, null, 2)}. + +Tool:${report.results.tool.name}. + + Please provide a human-readable failure summary that explains why you think the test might have failed and ways to fix`; + if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { + prompt += ` + +Additional Context: +${args.additionalPromptContext}`; } - writeRequestBodyPromise = writeRequestBody(req, request3, effectiveRequestTimeout, this.externalAgent).catch((e6) => { - timeouts.forEach(timing.clearTimeout); - return _reject(e6); - }); - }); - } - 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: logger8 } = options || {}; - const keepAlive = true; - const maxSockets = 50; - return { - connectionTimeout, - requestTimeout, - socketTimeout, - socketAcquisitionWarningTimeout, - throwOnRequestTimeout, - httpAgentProvider: async () => { - const { Agent: Agent3, request: request3 } = await import("http"); - hRequest = request3; - hAgent = Agent3; - if (httpAgent instanceof hAgent || typeof httpAgent?.destroy === "function") { - this.externalAgent = true; - return httpAgent; - } - return new hAgent({ keepAlive, maxSockets, ...httpAgent }); - }, - httpsAgent: (() => { - if (httpsAgent instanceof hsAgent || typeof httpsAgent?.destroy === "function") { - this.externalAgent = true; - return httpsAgent; - } - return new hsAgent({ keepAlive, maxSockets, ...httpsAgent }); - })(), - logger: logger8 - }; - } - }; - } -}); + let systemPrompt = (_a6 = args.systemPrompt) !== null && _a6 !== void 0 ? _a6 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; + if (args.additionalSystemPromptContext != null && args.additionalSystemPromptContext !== "") { + systemPrompt += ` -// node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js -var NodeHttp2ConnectionPool; -var init_node_http2_connection_pool = __esm({ - "node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js"() { - "use strict"; - NodeHttp2ConnectionPool = class { - sessions = []; - constructor(sessions) { - this.sessions = sessions ?? []; - } - poll() { - if (this.sessions.length > 0) { - return this.sessions.shift(); - } - } - offerLast(session) { - this.sessions.push(session); - } - contains(session) { - return this.sessions.includes(session); - } - remove(session) { - this.sessions = this.sessions.filter((s6) => s6 !== session); - } - [Symbol.iterator]() { - return this.sessions[Symbol.iterator](); - } - destroy(connection) { - for (const session of this.sessions) { - if (session === connection) { - if (!session.destroyed) { - session.destroy(); +${args.additionalSystemPromptContext}`; + } + const response = yield openRouter(systemPrompt, prompt, args); + if (response != null) { + test.ai = response; + messageCount++; + if (args.log === true && !logged) { + console.log("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"); + console.log("\u2728 AI Test Reporter Summary"); + console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n"); + logged = true; + } + if (args.log === true) { + console.log(`\u274C Failed Test: ${test.name} +`); + console.log(`${response} +`); } } } - } - }; + if (args.consolidate === true) { + yield (0, consolidated_summary_1.generateConsolidatedSummary)(report, "openrouter", args); + } + if (file !== void 0) { + (0, common_1.saveUpdatedReport)(file, report); + } + return report; + }); + } } }); -// node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js -import http22 from "http2"; -var NodeHttp2ConnectionManager; -var init_node_http2_connection_manager = __esm({ - "node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js +var state3, emitWarningIfUnsupportedVersion; +var init_emitWarningIfUnsupportedVersion = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js"() { "use strict"; - init_node_http2_connection_pool(); - NodeHttp2ConnectionManager = class { - constructor(config) { - this.config = config; - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrency must be greater than zero."); - } - } - config; - sessionCache = /* @__PURE__ */ new Map(); - lease(requestContext, connectionConfiguration) { - const url2 = this.getUrlString(requestContext); - const existingPool = this.sessionCache.get(url2); - if (existingPool) { - const existingSession = existingPool.poll(); - if (existingSession && !this.config.disableConcurrency) { - return existingSession; - } - } - const session = http22.connect(url2); - 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()); - } - }); - } - session.unref(); - const destroySessionCb = () => { - session.destroy(); - this.deleteSession(url2, session); - }; - session.on("goaway", destroySessionCb); - session.on("error", destroySessionCb); - session.on("frameError", destroySessionCb); - session.on("close", () => this.deleteSession(url2, session)); - if (connectionConfiguration.requestTimeout) { - session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb); - } - const connectionPool = this.sessionCache.get(url2) || new NodeHttp2ConnectionPool(); - connectionPool.offerLast(session); - this.sessionCache.set(url2, connectionPool); - return session; - } - deleteSession(authority, session) { - const existingConnectionPool = this.sessionCache.get(authority); - if (!existingConnectionPool) { - return; - } - if (!existingConnectionPool.contains(session)) { + state3 = { + warningEmitted: false + }; + emitWarningIfUnsupportedVersion = (version3) => { + if (version3 && !state3.warningEmitted) { + if (process.env.AWS_SDK_JS_NODE_VERSION_SUPPORT_WARNING_DISABLED === "true") { + state3.warningEmitted = true; return; } - existingConnectionPool.remove(session); - this.sessionCache.set(authority, existingConnectionPool); - } - release(requestContext, session) { - const cacheKey = this.getUrlString(requestContext); - this.sessionCache.get(cacheKey)?.offerLast(session); - } - destroy() { - for (const [key, connectionPool] of this.sessionCache) { - for (const session of connectionPool) { - if (!session.destroyed) { - session.destroy(); - } - connectionPool.remove(session); - } - this.sessionCache.delete(key); - } - } - setMaxConcurrentStreams(maxConcurrentStreams) { - if (maxConcurrentStreams && maxConcurrentStreams <= 0) { - throw new RangeError("maxConcurrentStreams must be greater than zero."); + const userMajorVersion = parseInt(version3.substring(1, version3.indexOf("."))); + const vv = 22; + if (userMajorVersion < vv) { + state3.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 ${version3}. + +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`); } - this.config.maxConcurrency = maxConcurrentStreams; - } - setDisableConcurrentStreams(disableConcurrentStreams) { - this.config.disableConcurrency = disableConcurrentStreams; - } - getUrlString(request3) { - return request3.destination.toString(); } }; } }); -// node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js -import { constants as constants3 } from "http2"; -var NodeHttp2Handler; -var init_node_http2_handler = __esm({ - "node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js"() { +// 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"() { "use strict"; - init_dist_es2(); - init_dist_es13(); - init_build_abort_error(); - init_get_transformed_headers(); - init_node_http2_connection_manager(); - init_write_request_body(); - NodeHttp2Handler = class _NodeHttp2Handler { - config; - configProvider; - metadata = { handlerProtocol: "h2" }; - connectionManager = new NodeHttp2ConnectionManager({}); - static create(instanceOrOptions) { - if (typeof instanceOrOptions?.handle === "function") { - return instanceOrOptions; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/isStreamingPayload/isStreamingPayload.js +import { Readable as Readable6 } from "stream"; +var isStreamingPayload; +var init_isStreamingPayload = __esm({ + "node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/isStreamingPayload/isStreamingPayload.js"() { + "use strict"; + isStreamingPayload = (request2) => request2?.body instanceof Readable6 || typeof ReadableStream !== "undefined" && request2?.body instanceof ReadableStream; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/client/middleware-stack/MiddlewareStack.js +var getAllAliases, getMiddlewareNameWithAliases, constructStack, stepWeights, priorityWeights; +var init_MiddlewareStack = __esm({ + "node_modules/@smithy/core/dist-es/submodules/client/middleware-stack/MiddlewareStack.js"() { + "use strict"; + getAllAliases = (name, aliases) => { + const _aliases = []; + if (name) { + _aliases.push(name); + } + if (aliases) { + for (const alias of aliases) { + _aliases.push(alias); } - return new _NodeHttp2Handler(instanceOrOptions); } - constructor(options) { - this.configProvider = new Promise((resolve4, reject2) => { - if (typeof options === "function") { - options().then((opts) => { - resolve4(opts || {}); - }).catch(reject2); + return _aliases; + }; + getMiddlewareNameWithAliases = (name, aliases) => { + return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`; + }; + constructStack = () => { + let absoluteEntries = []; + let relativeEntries = []; + let identifyOnResolve = false; + const entriesNameSet = /* @__PURE__ */ new Set(); + const sort = (entries) => entries.sort((a6, b6) => stepWeights[b6.step] - stepWeights[a6.step] || priorityWeights[b6.priority || "normal"] - priorityWeights[a6.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 { - resolve4(options || {}); + expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); } }); - } - destroy() { - this.connectionManager.destroy(); - } - async handle(request3, { abortSignal, requestTimeout } = {}) { - if (!this.config) { - this.config = await this.configProvider; - this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); - if (this.config.maxConcurrentStreams) { - this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); + 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)); } - } - const { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config; - const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout; - return new Promise((_resolve, _reject) => { - let fulfilled = false; - let writeRequestBodyPromise = void 0; - const resolve4 = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject2 = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); + }); + return expandedMiddlewareList; + }; + const getMiddlewareList = (debug2 = false) => { + const normalizedAbsoluteEntries = []; + const normalizedRelativeEntries = []; + const normalizedEntriesNameMap = {}; + absoluteEntries.forEach((entry) => { + const normalizedEntry = { + ...entry, + before: [], + after: [] }; - if (abortSignal?.aborted) { - fulfilled = true; - const abortError = buildAbortError(abortSignal); - reject2(abortError); - return; - } - const { hostname, method, port, protocol, query } = request3; - let auth2 = ""; - if (request3.username != null || request3.password != null) { - const username = request3.username ?? ""; - const password = request3.password ?? ""; - auth2 = `${username}:${password}@`; + for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { + normalizedEntriesNameMap[alias] = normalizedEntry; } - const authority = `${protocol}//${auth2}${hostname}${port ? `:${port}` : ""}`; - const requestContext = { destination: new URL(authority) }; - const session = this.connectionManager.lease(requestContext, { - requestTimeout: this.config?.sessionTimeout, - disableConcurrentStreams: disableConcurrentStreams || false - }); - const rejectWithDestroy = (err) => { - if (disableConcurrentStreams) { - this.destroySession(session); - } - fulfilled = true; - reject2(err); + normalizedAbsoluteEntries.push(normalizedEntry); + }); + relativeEntries.forEach((entry) => { + const normalizedEntry = { + ...entry, + before: [], + after: [] }; - const queryString = buildQueryString(query || {}); - let path10 = request3.path; - if (queryString) { - path10 += `?${queryString}`; - } - if (request3.fragment) { - path10 += `#${request3.fragment}`; + for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { + normalizedEntriesNameMap[alias] = normalizedEntry; } - const req = session.request({ - ...request3.headers, - [constants3.HTTP2_HEADER_PATH]: path10, - [constants3.HTTP2_HEADER_METHOD]: method - }); - session.ref(); - req.on("response", (headers) => { - const httpResponse = new HttpResponse({ - statusCode: headers[":status"] || -1, - headers: getTransformedHeaders(headers), - body: req - }); - fulfilled = true; - resolve4({ response: httpResponse }); - if (disableConcurrentStreams) { - session.close(); - this.connectionManager.deleteSession(authority, session); + normalizedRelativeEntries.push(normalizedEntry); + }); + normalizedRelativeEntries.forEach((entry) => { + if (entry.toMiddleware) { + const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware]; + if (toMiddleware === void 0) { + if (debug2) { + 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); } - }); - if (effectiveRequestTimeout) { - req.setTimeout(effectiveRequestTimeout, () => { - req.close(); - const timeoutError = new Error(`Stream timed out because of no activity for ${effectiveRequestTimeout} ms`); - timeoutError.name = "TimeoutError"; - rejectWithDestroy(timeoutError); - }); } - if (abortSignal) { - const onAbort = () => { - req.close(); - const abortError = buildAbortError(abortSignal); - rejectWithDestroy(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 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((a6) => a6 === 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); } } - req.on("frameError", (type, code, id) => { - rejectWithDestroy(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`)); - }); - req.on("error", rejectWithDestroy); - req.on("aborted", () => { - rejectWithDestroy(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${req.rstCode}.`)); - }); - req.on("close", () => { - session.unref(); - if (disableConcurrentStreams) { - session.destroy(); + 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((a6) => a6 === 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); + } } - if (!fulfilled) { - rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response")); + for (const alias of aliases) { + entriesNameSet.add(alias); } - }); - writeRequestBodyPromise = writeRequestBody(req, request3, effectiveRequestTimeout); - }); - } - updateHttpClientConfig(key, value) { - this.config = void 0; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value + } + 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: tags2, name, aliases: _aliases } = entry; + if (tags2 && tags2.includes(toRemove)) { + const aliases = getAllAliases(name, _aliases); + for (const alias of aliases) { + entriesNameSet.delete(alias); + } + isRemoved = true; + return false; + } + return true; }; - }); - } - httpHandlerConfigs() { - return this.config ?? {}; - } - destroySession(session) { - if (!session.destroyed) { - session.destroy(); + 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: (handler2, context5) => { + for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) { + handler2 = middleware(handler2, context5); + } + if (identifyOnResolve) { + console.log(stack.identify()); + } + return handler2; } - } + }; + return stack; + }; + stepWeights = { + initialize: 5, + serialize: 4, + build: 3, + finalizeRequest: 2, + deserialize: 1 + }; + priorityWeights = { + high: 3, + normal: 2, + low: 1 }; } }); -// node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js -import { Writable } from "stream"; -var Collector; -var init_collector = __esm({ - "node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js"() { +// node_modules/@smithy/types/dist-es/abort.js +var init_abort = __esm({ + "node_modules/@smithy/types/dist-es/abort.js"() { "use strict"; - Collector = class extends Writable { - bufferedBytes = []; - _write(chunk, encoding, callback) { - this.bufferedBytes.push(chunk); - callback(); - } - }; } }); -// node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js -async function collectReadableStream(stream5) { - const chunks = []; - const reader = stream5.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; +// node_modules/@smithy/types/dist-es/auth/auth.js +var HttpAuthLocation; +var init_auth = __esm({ + "node_modules/@smithy/types/dist-es/auth/auth.js"() { + "use strict"; + (function(HttpAuthLocation2) { + HttpAuthLocation2["HEADER"] = "header"; + HttpAuthLocation2["QUERY"] = "query"; + })(HttpAuthLocation || (HttpAuthLocation = {})); } - const collected = new Uint8Array(length); - let offset = 0; - for (const chunk of chunks) { - collected.set(chunk, offset); - offset += chunk.length; +}); + +// node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js +var HttpApiKeyAuthLocation; +var init_HttpApiKeyAuth = __esm({ + "node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js"() { + "use strict"; + (function(HttpApiKeyAuthLocation2) { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + })(HttpApiKeyAuthLocation || (HttpApiKeyAuthLocation = {})); } - return collected; -} -var streamCollector, isReadableStreamInstance; -var init_stream_collector = __esm({ - "node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js"() { +}); + +// node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js +var init_HttpAuthScheme = __esm({ + "node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js"() { "use strict"; - init_collector(); - streamCollector = (stream5) => { - if (isReadableStreamInstance(stream5)) { - return collectReadableStream(stream5); - } - return new Promise((resolve4, reject2) => { - const collector = new Collector(); - stream5.pipe(collector); - stream5.on("error", (err) => { - collector.end(); - reject2(err); - }); - collector.on("error", reject2); - collector.on("finish", function() { - const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); - resolve4(bytes); - }); - }); - }; - isReadableStreamInstance = (stream5) => typeof ReadableStream === "function" && stream5 instanceof ReadableStream; } }); -// node_modules/@smithy/node-http-handler/dist-es/index.js -var init_dist_es14 = __esm({ - "node_modules/@smithy/node-http-handler/dist-es/index.js"() { +// node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js +var init_HttpAuthSchemeProvider = __esm({ + "node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js"() { "use strict"; - init_node_http_handler(); - init_node_http2_handler(); - init_stream_collector(); } }); -// node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js -var init_fetch_http_handler = __esm({ - "node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js"() { +// node_modules/@smithy/types/dist-es/auth/HttpSigner.js +var init_HttpSigner = __esm({ + "node_modules/@smithy/types/dist-es/auth/HttpSigner.js"() { "use strict"; } }); -// node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js -async function collectBlob(blob) { - const base64 = await readToBase64(blob); - const arrayBuffer = fromBase64(base64); - return new Uint8Array(arrayBuffer); -} -async function collectStream(stream5) { - const chunks = []; - const reader = stream5.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; +// node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js +var init_IdentityProviderConfig = __esm({ + "node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js"() { + "use strict"; } - const collected = new Uint8Array(length); - let offset = 0; - for (const chunk of chunks) { - collected.set(chunk, offset); - offset += chunk.length; +}); + +// node_modules/@smithy/types/dist-es/auth/index.js +var init_auth2 = __esm({ + "node_modules/@smithy/types/dist-es/auth/index.js"() { + "use strict"; + init_auth(); + init_HttpApiKeyAuth(); + init_HttpAuthScheme(); + init_HttpAuthSchemeProvider(); + init_HttpSigner(); + init_IdentityProviderConfig(); } - return collected; -} -function readToBase64(blob) { - return new Promise((resolve4, reject2) => { - const reader = new FileReader(); - reader.onloadend = () => { - if (reader.readyState !== 2) { - return reject2(new Error("Reader aborted too early")); - } - const result = reader.result ?? ""; - const commaIndex = result.indexOf(","); - const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length; - resolve4(result.substring(dataOffset)); - }; - reader.onabort = () => reject2(new Error("Read aborted")); - reader.onerror = () => reject2(reader.error); - reader.readAsDataURL(blob); - }); -} -var streamCollector2; -var init_stream_collector2 = __esm({ - "node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js"() { +}); + +// node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js +var init_blob_payload_input_types = __esm({ + "node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js"() { "use strict"; - init_dist_es11(); - streamCollector2 = async (stream5) => { - if (typeof Blob === "function" && stream5 instanceof Blob || stream5.constructor?.name === "Blob") { - if (Blob.prototype.arrayBuffer !== void 0) { - return new Uint8Array(await stream5.arrayBuffer()); - } - return collectBlob(stream5); - } - return collectStream(stream5); - }; } }); -// node_modules/@smithy/fetch-http-handler/dist-es/index.js -var init_dist_es15 = __esm({ - "node_modules/@smithy/fetch-http-handler/dist-es/index.js"() { +// node_modules/@smithy/types/dist-es/checksum.js +var init_checksum = __esm({ + "node_modules/@smithy/types/dist-es/checksum.js"() { "use strict"; - init_fetch_http_handler(); - init_stream_collector2(); } }); -// node_modules/@smithy/util-hex-encoding/dist-es/index.js -function fromHex(encoded) { - if (encoded.length % 2 !== 0) { - throw new Error("Hex encoded strings must have an even number length"); +// node_modules/@smithy/types/dist-es/client.js +var init_client = __esm({ + "node_modules/@smithy/types/dist-es/client.js"() { + "use strict"; } - const out = new Uint8Array(encoded.length / 2); - for (let i6 = 0; i6 < encoded.length; i6 += 2) { - const encodedByte = encoded.slice(i6, i6 + 2).toLowerCase(); - if (encodedByte in HEX_TO_SHORT) { - out[i6 / 2] = HEX_TO_SHORT[encodedByte]; - } else { - throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`); - } +}); + +// node_modules/@smithy/types/dist-es/command.js +var init_command2 = __esm({ + "node_modules/@smithy/types/dist-es/command.js"() { + "use strict"; } - return out; -} -function toHex(bytes) { - let out = ""; - for (let i6 = 0; i6 < bytes.byteLength; i6++) { - out += SHORT_TO_HEX[bytes[i6]]; +}); + +// node_modules/@smithy/types/dist-es/connection/config.js +var init_config = __esm({ + "node_modules/@smithy/types/dist-es/connection/config.js"() { + "use strict"; } - return out; -} -var SHORT_TO_HEX, HEX_TO_SHORT; -var init_dist_es16 = __esm({ - "node_modules/@smithy/util-hex-encoding/dist-es/index.js"() { +}); + +// node_modules/@smithy/types/dist-es/connection/manager.js +var init_manager = __esm({ + "node_modules/@smithy/types/dist-es/connection/manager.js"() { "use strict"; - SHORT_TO_HEX = {}; - HEX_TO_SHORT = {}; - for (let i6 = 0; i6 < 256; i6++) { - let encodedByte = i6.toString(16).toLowerCase(); - if (encodedByte.length === 1) { - encodedByte = `0${encodedByte}`; - } - SHORT_TO_HEX[i6] = encodedByte; - HEX_TO_SHORT[encodedByte] = i6; - } } }); -// node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js -var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED, sdkStreamMixin, isBlobInstance; -var init_sdk_stream_mixin_browser = __esm({ - "node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js"() { +// node_modules/@smithy/types/dist-es/connection/pool.js +var init_pool = __esm({ + "node_modules/@smithy/types/dist-es/connection/pool.js"() { "use strict"; - init_dist_es15(); - init_dist_es11(); - init_dist_es16(); - init_dist_es10(); - init_stream_type_check(); - ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; - sdkStreamMixin = (stream5) => { - if (!isBlobInstance(stream5) && !isReadableStream3(stream5)) { - const name = stream5?.__proto__?.constructor?.name || stream5; - 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 streamCollector2(stream5); - }; - 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(stream5, { - transformToByteArray, - transformToString: async (encoding) => { - const buf = await transformToByteArray(); - if (encoding === "base64") { - return toBase64(buf); - } else if (encoding === "hex") { - return toHex(buf); - } else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") { - return toUtf8(buf); - } else if (typeof TextDecoder === "function") { - return new TextDecoder(encoding).decode(buf); - } else { - throw new Error("TextDecoder is not available, please make sure polyfill is provided."); - } - }, - transformToWebStream: () => { - if (transformed) { - throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); - } - transformed = true; - if (isBlobInstance(stream5)) { - return blobToWebStream(stream5); - } else if (isReadableStream3(stream5)) { - return stream5; - } else { - throw new Error(`Cannot transform payload to web stream, got ${stream5}`); - } - } - }); - }; - isBlobInstance = (stream5) => typeof Blob === "function" && stream5 instanceof Blob; } }); -// node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.js -import { Readable as Readable9 } from "stream"; -var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2, sdkStreamMixin2; -var init_sdk_stream_mixin = __esm({ - "node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.js"() { +// node_modules/@smithy/types/dist-es/connection/index.js +var init_connection = __esm({ + "node_modules/@smithy/types/dist-es/connection/index.js"() { "use strict"; - init_dist_es14(); - init_dist_es9(); - init_sdk_stream_mixin_browser(); - ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2 = "The stream has already been transformed."; - sdkStreamMixin2 = (stream5) => { - if (!(stream5 instanceof Readable9)) { - try { - return sdkStreamMixin(stream5); - } catch (e6) { - const name = stream5?.__proto__?.constructor?.name || stream5; - 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_TRANSFORMED2); - } - transformed = true; - return await streamCollector(stream5); - }; - return Object.assign(stream5, { - transformToByteArray, - transformToString: async (encoding) => { - const buf = await transformToByteArray(); - if (encoding === void 0 || Buffer.isEncoding(encoding)) { - return fromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding); - } else { - const decoder = new TextDecoder(encoding); - return decoder.decode(buf); - } - }, - transformToWebStream: () => { - if (transformed) { - throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2); - } - if (stream5.readableFlowing !== null) { - throw new Error("The stream has been consumed by other callbacks."); - } - if (typeof Readable9.toWeb !== "function") { - throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available."); - } - transformed = true; - return Readable9.toWeb(stream5); - } - }); - }; + init_config(); + init_manager(); + init_pool(); } }); -// node_modules/@smithy/util-stream/dist-es/splitStream.js -var init_splitStream = __esm({ - "node_modules/@smithy/util-stream/dist-es/splitStream.js"() { +// node_modules/@smithy/types/dist-es/crypto.js +var init_crypto = __esm({ + "node_modules/@smithy/types/dist-es/crypto.js"() { "use strict"; } }); -// node_modules/@smithy/util-stream/dist-es/index.js -var init_dist_es17 = __esm({ - "node_modules/@smithy/util-stream/dist-es/index.js"() { +// node_modules/@smithy/types/dist-es/encode.js +var init_encode = __esm({ + "node_modules/@smithy/types/dist-es/encode.js"() { "use strict"; - init_Uint8ArrayBlobAdapter(); - init_ChecksumStream(); - init_createChecksumStream(); - init_createBufferedReadable(); - init_getAwsChunkedEncodingStream(); - init_headStream(); - init_sdk_stream_mixin(); - init_splitStream(); } }); -// node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js -var collectBody; -var init_collect_stream_body = __esm({ - "node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js"() { +// node_modules/@smithy/types/dist-es/endpoint.js +var EndpointURLScheme; +var init_endpoint = __esm({ + "node_modules/@smithy/types/dist-es/endpoint.js"() { "use strict"; - init_dist_es17(); - collectBody = async (streamBody = new Uint8Array(), context5) => { - if (streamBody instanceof Uint8Array) { - return Uint8ArrayBlobAdapter.mutate(streamBody); - } - if (!streamBody) { - return Uint8ArrayBlobAdapter.mutate(new Uint8Array()); - } - const fromContext = context5.streamCollector(streamBody); - return Uint8ArrayBlobAdapter.mutate(await fromContext); - }; + (function(EndpointURLScheme2) { + EndpointURLScheme2["HTTP"] = "http"; + EndpointURLScheme2["HTTPS"] = "https"; + })(EndpointURLScheme || (EndpointURLScheme = {})); } }); -// node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js -function extendedEncodeURIComponent(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function(c6) { - return "%" + c6.charCodeAt(0).toString(16).toUpperCase(); - }); -} -var init_extended_encode_uri_component = __esm({ - "node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js"() { +// node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js +var init_EndpointRuleObject = __esm({ + "node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js"() { "use strict"; } }); -// 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"() { +// node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js +var init_ErrorRuleObject = __esm({ + "node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js"() { "use strict"; - 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"() { +// node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js +var init_RuleSetObject = __esm({ + "node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js"() { "use strict"; - operation = (namespace, name, traits, input, output) => ({ - name, - namespace, - traits, - input, - output - }); } }); -// node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js -var schemaDeserializationMiddleware, findHeader; -var init_schemaDeserializationMiddleware = __esm({ - "node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js"() { +// node_modules/@smithy/types/dist-es/endpoints/shared.js +var init_shared = __esm({ + "node_modules/@smithy/types/dist-es/endpoints/shared.js"() { "use strict"; - init_dist_es2(); - init_dist_es7(); - init_operation(); - schemaDeserializationMiddleware = (config) => (next, context5) => async (args) => { - const { response } = await next(args); - const { operationSchema } = getSmithyContext(context5); - const [, ns2, n12, t6, i6, o6] = operationSchema ?? []; - try { - const parsed = await config.protocol.deserializeResponse(operation(ns2, n12, t6, i6, o6), { - ...config, - ...context5 - }, response); - return { - response, - output: parsed - }; - } catch (error2) { - Object.defineProperty(error2, "$response", { - value: response, - enumerable: false, - writable: false, - configurable: false - }); - if (!("$metadata" in error2)) { - const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; - try { - error2.message += "\n " + hint; - } catch (e6) { - if (!context5.logger || context5.logger?.constructor?.name === "NoOpLogger") { - console.warn(hint); - } else { - context5.logger?.warn?.(hint); - } - } - if (typeof error2.$responseBodyText !== "undefined") { - if (error2.$response) { - error2.$response.body = error2.$responseBodyText; - } - } - try { - if (HttpResponse.isInstance(response)) { - const { headers = {} } = response; - const headerEntries = Object.entries(headers); - error2.$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 (e6) { - } - } - throw error2; - } - }; - findHeader = (pattern, headers) => { - return (headers.find(([k7]) => { - return k7.match(pattern); - }) || [void 0, void 0])[1]; - }; } }); -// node_modules/@smithy/querystring-parser/dist-es/index.js -function parseQueryString(querystring) { - const query = {}; - querystring = querystring.replace(/^\?/, ""); - if (querystring) { - for (const pair of querystring.split("&")) { - let [key, value = null] = pair.split("="); - key = decodeURIComponent(key); - if (value) { - value = decodeURIComponent(value); - } - if (!(key in query)) { - query[key] = value; - } else if (Array.isArray(query[key])) { - query[key].push(value); - } else { - query[key] = [query[key], value]; - } - } +// node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js +var init_TreeRuleObject = __esm({ + "node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js"() { + "use strict"; } - return query; -} -var init_dist_es18 = __esm({ - "node_modules/@smithy/querystring-parser/dist-es/index.js"() { +}); + +// node_modules/@smithy/types/dist-es/endpoints/index.js +var init_endpoints2 = __esm({ + "node_modules/@smithy/types/dist-es/endpoints/index.js"() { "use strict"; + init_EndpointRuleObject(); + init_ErrorRuleObject(); + init_RuleSetObject(); + init_shared(); + init_TreeRuleObject(); } }); -// node_modules/@smithy/url-parser/dist-es/index.js -var parseUrl2; -var init_dist_es19 = __esm({ - "node_modules/@smithy/url-parser/dist-es/index.js"() { +// node_modules/@smithy/types/dist-es/eventStream.js +var init_eventStream = __esm({ + "node_modules/@smithy/types/dist-es/eventStream.js"() { "use strict"; - init_dist_es18(); - parseUrl2 = (url2) => { - if (typeof url2 === "string") { - return parseUrl2(new URL(url2)); - } - const { hostname, pathname, port, protocol, search } = url2; - let query; - if (search) { - query = parseQueryString(search); - } - return { - hostname, - port: port ? parseInt(port) : void 0, - protocol, - path: pathname, - query - }; - }; } }); -// node_modules/@smithy/core/dist-es/submodules/endpoints/toEndpointV1.js -var toEndpointV1; -var init_toEndpointV1 = __esm({ - "node_modules/@smithy/core/dist-es/submodules/endpoints/toEndpointV1.js"() { +// node_modules/@smithy/types/dist-es/extensions/checksum.js +var AlgorithmId; +var init_checksum2 = __esm({ + "node_modules/@smithy/types/dist-es/extensions/checksum.js"() { + "use strict"; + (function(AlgorithmId2) { + AlgorithmId2["MD5"] = "md5"; + AlgorithmId2["CRC32"] = "crc32"; + AlgorithmId2["CRC32C"] = "crc32c"; + AlgorithmId2["SHA1"] = "sha1"; + AlgorithmId2["SHA256"] = "sha256"; + })(AlgorithmId || (AlgorithmId = {})); + } +}); + +// node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js +var init_defaultClientConfiguration = __esm({ + "node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js"() { + "use strict"; + } +}); + +// node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js +var init_defaultExtensionConfiguration = __esm({ + "node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js"() { + "use strict"; + } +}); + +// node_modules/@smithy/types/dist-es/extensions/index.js +var init_extensions = __esm({ + "node_modules/@smithy/types/dist-es/extensions/index.js"() { + "use strict"; + init_defaultClientConfiguration(); + init_defaultExtensionConfiguration(); + init_checksum2(); + } +}); + +// node_modules/@smithy/types/dist-es/feature-ids.js +var init_feature_ids = __esm({ + "node_modules/@smithy/types/dist-es/feature-ids.js"() { + "use strict"; + } +}); + +// node_modules/@smithy/types/dist-es/http.js +var FieldPosition; +var init_http = __esm({ + "node_modules/@smithy/types/dist-es/http.js"() { + "use strict"; + (function(FieldPosition2) { + FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; + FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; + })(FieldPosition || (FieldPosition = {})); + } +}); + +// node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js +var init_httpHandlerInitialization = __esm({ + "node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js"() { "use strict"; - init_dist_es19(); - toEndpointV1 = (endpoint2) => { - if (typeof endpoint2 === "object") { - if ("url" in endpoint2) { - const v1Endpoint = parseUrl2(endpoint2.url); - if (endpoint2.headers) { - v1Endpoint.headers = {}; - for (const [name, values] of Object.entries(endpoint2.headers)) { - v1Endpoint.headers[name.toLowerCase()] = values.join(", "); - } - } - return v1Endpoint; - } - return endpoint2; - } - return parseUrl2(endpoint2); - }; } }); -// node_modules/@smithy/core/dist-es/submodules/endpoints/index.js -var init_endpoints3 = __esm({ - "node_modules/@smithy/core/dist-es/submodules/endpoints/index.js"() { +// node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js +var init_apiKeyIdentity = __esm({ + "node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js"() { "use strict"; - init_toEndpointV1(); } }); -// node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js -var schemaSerializationMiddleware; -var init_schemaSerializationMiddleware = __esm({ - "node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js"() { +// node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js +var init_awsCredentialIdentity = __esm({ + "node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js"() { "use strict"; - init_endpoints3(); - init_dist_es7(); - init_operation(); - schemaSerializationMiddleware = (config) => (next, context5) => async (args) => { - const { operationSchema } = getSmithyContext(context5); - const [, ns2, n12, t6, i6, o6] = operationSchema ?? []; - const endpoint2 = context5.endpointV2 ? async () => toEndpointV1(context5.endpointV2) : config.endpoint; - const request3 = await config.protocol.serializeRequest(operation(ns2, n12, t6, i6, o6), args.input, { - ...config, - ...context5, - endpoint: endpoint2 - }); - return next({ - ...args, - request: request3 - }); - }; } }); -// 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"() { +// node_modules/@smithy/types/dist-es/identity/identity.js +var init_identity = __esm({ + "node_modules/@smithy/types/dist-es/identity/identity.js"() { "use strict"; - 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 init_Schema = __esm({ - "node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js"() { +// node_modules/@smithy/types/dist-es/identity/tokenIdentity.js +var init_tokenIdentity = __esm({ + "node_modules/@smithy/types/dist-es/identity/tokenIdentity.js"() { "use strict"; } }); -// node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js -var init_ListSchema = __esm({ - "node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js"() { +// node_modules/@smithy/types/dist-es/identity/index.js +var init_identity2 = __esm({ + "node_modules/@smithy/types/dist-es/identity/index.js"() { "use strict"; + init_apiKeyIdentity(); + init_awsCredentialIdentity(); + init_identity(); + init_tokenIdentity(); } }); -// node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js -var init_MapSchema = __esm({ - "node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js"() { +// node_modules/@smithy/types/dist-es/logger.js +var init_logger = __esm({ + "node_modules/@smithy/types/dist-es/logger.js"() { "use strict"; } }); -// node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js -var init_OperationSchema = __esm({ - "node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js"() { +// node_modules/@smithy/types/dist-es/middleware.js +var SMITHY_CONTEXT_KEY; +var init_middleware2 = __esm({ + "node_modules/@smithy/types/dist-es/middleware.js"() { "use strict"; + SMITHY_CONTEXT_KEY = "__smithy_context"; } }); -// node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js -var init_StructureSchema = __esm({ - "node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js"() { +// node_modules/@smithy/types/dist-es/pagination.js +var init_pagination = __esm({ + "node_modules/@smithy/types/dist-es/pagination.js"() { "use strict"; } }); -// node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js -var init_ErrorSchema = __esm({ - "node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js"() { +// node_modules/@smithy/types/dist-es/profile.js +var IniSectionType; +var init_profile = __esm({ + "node_modules/@smithy/types/dist-es/profile.js"() { "use strict"; + (function(IniSectionType2) { + IniSectionType2["PROFILE"] = "profile"; + IniSectionType2["SSO_SESSION"] = "sso-session"; + IniSectionType2["SERVICES"] = "services"; + })(IniSectionType || (IniSectionType = {})); } }); -// 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 i6 = 0; - for (const trait of [ - "httpLabel", - "idempotent", - "idempotencyToken", - "sensitive", - "httpPayload", - "httpResponseCode", - "httpQueryParams" - ]) { - if ((indicator >> i6++ & 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"() { +// node_modules/@smithy/types/dist-es/response.js +var init_response = __esm({ + "node_modules/@smithy/types/dist-es/response.js"() { "use strict"; - 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"() { +// node_modules/@smithy/types/dist-es/retry.js +var init_retry = __esm({ + "node_modules/@smithy/types/dist-es/retry.js"() { "use strict"; - 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 i6 = traitStack.length - 1; i6 >= 0; --i6) { - const traitSet = traitStack[i6]; - 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 ns2 = lhs; - return ns2.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 [ns3, traits] = sc; - if (ns3 instanceof _NormalizedSchema) { - Object.assign(ns3.getMergedTraits(), translateTraits(traits)); - return ns3; - } - throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`); - } - const ns2 = new _NormalizedSchema(sc); - if (keyAble) { - return ref[anno.ns] = ns2; - } - if (typeof sc === "string") { - return simpleSchemaCacheS[sc] = ns2; - } - if (typeof sc === "number") { - return simpleSchemaCacheN[sc] = ns2; - } - return ns2; - } - 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 struct = this.getSchema(); - if (this.isStructSchema() && struct[4].includes(memberName)) { - const i6 = struct[4].indexOf(memberName); - const memberSchema = struct[5][i6]; - 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 buffer2 = {}; - try { - for (const [k7, v8] of this.structIterator()) { - buffer2[k7] = v8; - } - } catch (ignored) { - } - return buffer2; - } - 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 struct = this.getSchema(); - const z2 = struct[4].length; - let it2 = struct[anno.it]; - if (it2 && z2 === it2.length) { - yield* it2; - return; - } - it2 = Array(z2); - for (let i6 = 0; i6 < z2; ++i6) { - const k7 = struct[4][i6]; - const v8 = member([struct[5][i6], 0], k7); - yield it2[i6] = [k7, v8]; - } - struct[anno.it] = it2; - } - }; - 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 init_SimpleSchema = __esm({ - "node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js"() { +// node_modules/@smithy/types/dist-es/schema/schema.js +var init_schema = __esm({ + "node_modules/@smithy/types/dist-es/schema/schema.js"() { "use strict"; } }); -// node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js -var init_sentinels2 = __esm({ - "node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js"() { +// node_modules/@smithy/types/dist-es/schema/traits.js +var init_traits = __esm({ + "node_modules/@smithy/types/dist-es/schema/traits.js"() { "use strict"; } }); -// 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"() { +// node_modules/@smithy/types/dist-es/schema/schema-deprecated.js +var init_schema_deprecated = __esm({ + "node_modules/@smithy/types/dist-es/schema/schema-deprecated.js"() { "use strict"; - 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 [k7, v8] of other.schemas) { - if (!schemas.has(k7)) { - schemas.set(k7, v8); - } - } - for (const [k7, v8] of other.exceptions) { - if (!exceptions.has(k7)) { - exceptions.set(k7, v8); - } - } - } - register(shapeId, schema) { - const qualifiedName = this.normalizeShapeId(shapeId); - for (const r6 of [this, _TypeRegistry.for(qualifiedName.split("#")[0])]) { - r6.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(es2, ctor) { - const $error = es2; - const ns2 = $error[1]; - for (const r6 of [this, _TypeRegistry.for(ns2)]) { - r6.schemas.set(ns2 + "#" + $error[2], $error); - r6.exceptions.set($error, ctor); - } - } - getErrorCtor(es2) { - const $error = es2; - if (this.exceptions.has($error)) { - return this.exceptions.get($error); - } - const registry2 = _TypeRegistry.for($error[1]); - return registry2.exceptions.get($error); - } - getBaseException() { - for (const exceptionKey of this.exceptions.keys()) { - if (Array.isArray(exceptionKey)) { - const [, ns2, name] = exceptionKey; - const id = ns2 + "#" + name; - if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) { - return exceptionKey; - } - } - } - return void 0; - } - find(predicate) { - return [...this.schemas.values()].find(predicate); - } - 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 init_schema2 = __esm({ - "node_modules/@smithy/core/dist-es/submodules/schema/index.js"() { +// node_modules/@smithy/types/dist-es/schema/sentinels.js +var init_sentinels = __esm({ + "node_modules/@smithy/types/dist-es/schema/sentinels.js"() { "use strict"; - init_deref(); - init_getSchemaSerdePlugin(); - init_ListSchema(); - init_MapSchema(); - init_OperationSchema(); - init_operation(); - init_ErrorSchema(); - init_NormalizedSchema(); - init_Schema(); - init_SimpleSchema(); - init_StructureSchema(); - init_sentinels2(); - init_translateTraits(); - init_TypeRegistry(); } }); -// node_modules/@smithy/core/dist-es/submodules/serde/copyDocumentWithTransform.js -var init_copyDocumentWithTransform = __esm({ - "node_modules/@smithy/core/dist-es/submodules/serde/copyDocumentWithTransform.js"() { +// node_modules/@smithy/types/dist-es/schema/static-schemas.js +var init_static_schemas = __esm({ + "node_modules/@smithy/types/dist-es/schema/static-schemas.js"() { "use strict"; } }); -// node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js -var expectNumber, MAX_FLOAT, expectFloat32, expectLong, expectShort, expectByte, expectSizedInt, castInt, strictParseDouble, strictParseFloat32, NUMBER_REGEX, parseNumber, strictParseShort, strictParseByte, stackTraceWarning, logger7; -var init_parse_utils = __esm({ - "node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js"() { +// node_modules/@smithy/types/dist-es/serde.js +var init_serde = __esm({ + "node_modules/@smithy/types/dist-es/serde.js"() { "use strict"; - 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)) { - logger7.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}`); - }; - 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]; - } - }; - strictParseDouble = (value) => { - if (typeof value == "string") { - return expectNumber(parseNumber(value)); - } - return expectNumber(value); - }; - 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); - }; - 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((s6) => !s6.includes("stackTraceWarning")).join("\n"); - }; - logger7 = { - 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"() { +// node_modules/@smithy/types/dist-es/shapes.js +var init_shapes = __esm({ + "node_modules/@smithy/types/dist-es/shapes.js"() { "use strict"; - 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 match3 = RFC3339.exec(value); - if (!match3) { - throw new TypeError("Invalid RFC-3339 date-time value"); - } - const [_3, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match3; - 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 match3 = RFC3339_WITH_OFFSET.exec(value); - if (!match3) { - throw new TypeError("Invalid RFC-3339 date-time value"); - } - const [_3, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match3; - 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 match3 = IMF_FIXDATE.exec(value); - if (match3) { - const [_3, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match3; - return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); - } - match3 = RFC_850_DATE.exec(value); - if (match3) { - const [_3, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match3; - return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { - hours, - minutes, - seconds, - fractionalMilliseconds - })); - } - match3 = ASC_TIME.exec(value); - if (match3) { - const [_3, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match3; - 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/@smithy/uuid/dist-es/randomUUID.js -import crypto5 from "crypto"; -var randomUUID4; -var init_randomUUID = __esm({ - "node_modules/@smithy/uuid/dist-es/randomUUID.js"() { +// node_modules/@smithy/types/dist-es/signature.js +var init_signature = __esm({ + "node_modules/@smithy/types/dist-es/signature.js"() { "use strict"; - randomUUID4 = crypto5.randomUUID.bind(crypto5); } }); -// node_modules/@smithy/uuid/dist-es/v4.js -var decimalToHex, v4; -var init_v4 = __esm({ - "node_modules/@smithy/uuid/dist-es/v4.js"() { +// node_modules/@smithy/types/dist-es/stream.js +var init_stream = __esm({ + "node_modules/@smithy/types/dist-es/stream.js"() { "use strict"; - init_randomUUID(); - decimalToHex = Array.from({ length: 256 }, (_3, i6) => i6.toString(16).padStart(2, "0")); - v4 = () => { - if (randomUUID4) { - return randomUUID4(); - } - 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]]; - }; } }); -// node_modules/@smithy/uuid/dist-es/index.js -var init_dist_es20 = __esm({ - "node_modules/@smithy/uuid/dist-es/index.js"() { +// node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js +var init_streaming_blob_common_types = __esm({ + "node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js"() { "use strict"; - init_v4(); } }); -// node_modules/@smithy/core/dist-es/submodules/serde/generateIdempotencyToken.js -var init_generateIdempotencyToken = __esm({ - "node_modules/@smithy/core/dist-es/submodules/serde/generateIdempotencyToken.js"() { +// node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js +var init_streaming_blob_payload_input_types = __esm({ + "node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js"() { "use strict"; - init_dist_es20(); } }); -// 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"() { +// node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js +var init_streaming_blob_payload_output_types = __esm({ + "node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js"() { "use strict"; - 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/types/dist-es/transfer.js +var RequestHandlerProtocol; +var init_transfer = __esm({ + "node_modules/@smithy/types/dist-es/transfer.js"() { "use strict"; + (function(RequestHandlerProtocol2) { + RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; + })(RequestHandlerProtocol || (RequestHandlerProtocol = {})); } }); -// node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js -function range5(v8, min, max) { - const _v2 = Number(v8); - if (_v2 < min || _v2 > max) { - throw new Error(`Value ${_v2} 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"() { - "use strict"; - 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, , ms2, offsetStr] = matches; - range5(monthStr, 1, 12); - range5(dayStr, 1, 31); - range5(hours, 0, 23); - range5(minutes, 0, 59); - range5(seconds, 0, 60); - const date2 = new Date(Date.UTC(Number(yearStr), Number(monthStr) - 1, Number(dayStr), Number(hours), Number(minutes), Number(seconds), Number(ms2) ? Math.round(parseFloat(`0.${ms2}`) * 1e3) : 0)); - date2.setUTCFullYear(Number(yearStr)); - if (offsetStr.toUpperCase() != "Z") { - const [, sign2, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [void 0, "+", 0, 0]; - const scalar = sign2 === "-" ? 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); - range5(day, 1, 31); - range5(hour, 0, 23); - range5(minute, 0, 59); - range5(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/types/dist-es/transform/client-payload-blob-type-narrow.js +var init_client_payload_blob_type_narrow = __esm({ + "node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js"() { + "use strict"; } }); -// node_modules/@smithy/core/dist-es/submodules/serde/split-every.js -function splitEvery(value, delimiter2, numDelimiters) { - if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { - throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); - } - const segments = value.split(delimiter2); - if (numDelimiters === 1) { - return segments; +// node_modules/@smithy/types/dist-es/transform/mutable.js +var init_mutable = __esm({ + "node_modules/@smithy/types/dist-es/transform/mutable.js"() { + "use strict"; } - const compoundSegments = []; - let currentSegment = ""; - for (let i6 = 0; i6 < segments.length; i6++) { - if (currentSegment === "") { - currentSegment = segments[i6]; - } else { - currentSegment += delimiter2 + segments[i6]; - } - if ((i6 + 1) % numDelimiters === 0) { - compoundSegments.push(currentSegment); - currentSegment = ""; - } +}); + +// node_modules/@smithy/types/dist-es/transform/no-undefined.js +var init_no_undefined = __esm({ + "node_modules/@smithy/types/dist-es/transform/no-undefined.js"() { + "use strict"; } - if (currentSegment !== "") { - compoundSegments.push(currentSegment); +}); + +// node_modules/@smithy/types/dist-es/transform/type-transform.js +var init_type_transform = __esm({ + "node_modules/@smithy/types/dist-es/transform/type-transform.js"() { + "use strict"; } - return compoundSegments; -} -var init_split_every = __esm({ - "node_modules/@smithy/core/dist-es/submodules/serde/split-every.js"() { +}); + +// node_modules/@smithy/types/dist-es/uri.js +var init_uri = __esm({ + "node_modules/@smithy/types/dist-es/uri.js"() { "use strict"; } }); -// 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"() { +// node_modules/@smithy/types/dist-es/util.js +var init_util3 = __esm({ + "node_modules/@smithy/types/dist-es/util.js"() { "use strict"; - splitHeader = (value) => { - const z2 = value.length; - const values = []; - let withinQuotes = false; - let prevChar = void 0; - let anchor = 0; - for (let i6 = 0; i6 < z2; ++i6) { - const char = value[i6]; - switch (char) { - case `"`: - if (prevChar !== "\\") { - withinQuotes = !withinQuotes; - } - break; - case ",": - if (!withinQuotes) { - values.push(value.slice(anchor, i6)); - anchor = i6 + 1; - } - break; - default: - } - prevChar = char; - } - values.push(value.slice(anchor)); - return values.map((v8) => { - v8 = v8.trim(); - const z3 = v8.length; - if (z3 < 2) { - return v8; - } - if (v8[0] === `"` && v8[z3 - 1] === `"`) { - v8 = v8.slice(1, z3 - 1); - } - return v8.replace(/\\"/g, '"'); - }); - }; } }); -// node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js -var format, NumericValue; -var init_NumericValue = __esm({ - "node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js"() { +// node_modules/@smithy/types/dist-es/waiter.js +var init_waiter = __esm({ + "node_modules/@smithy/types/dist-es/waiter.js"() { "use strict"; - 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 init_serde2 = __esm({ - "node_modules/@smithy/core/dist-es/submodules/serde/index.js"() { +// node_modules/@smithy/types/dist-es/index.js +var init_dist_es = __esm({ + "node_modules/@smithy/types/dist-es/index.js"() { "use strict"; - 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(); + init_abort(); + init_auth2(); + init_blob_payload_input_types(); + init_checksum(); + init_client(); + init_command2(); + init_connection(); + init_crypto(); + init_encode(); + init_endpoint(); + init_endpoints2(); + init_eventStream(); + init_extensions(); + init_feature_ids(); + init_http(); + init_httpHandlerInitialization(); + init_identity2(); + init_logger(); + init_middleware2(); + init_pagination(); + init_profile(); + init_response(); + init_retry(); + init_schema(); + init_traits(); + init_schema_deprecated(); + init_sentinels(); + init_static_schemas(); + init_serde(); + init_shapes(); + init_signature(); + init_stream(); + init_streaming_blob_common_types(); + init_streaming_blob_payload_input_types(); + init_streaming_blob_payload_output_types(); + init_transfer(); + init_client_payload_blob_type_narrow(); + init_mutable(); + init_no_undefined(); + init_type_transform(); + init_uri(); + init_util3(); + init_waiter(); } }); -// 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"() { +// node_modules/@smithy/core/dist-es/submodules/transport/getSmithyContext.js +var getSmithyContext; +var init_getSmithyContext = __esm({ + "node_modules/@smithy/core/dist-es/submodules/transport/getSmithyContext.js"() { "use strict"; - SerdeContext = class { - serdeContext; - setSerdeContext(serdeContext) { - this.serdeContext = serdeContext; - } - }; + init_dist_es(); + getSmithyContext = (context5) => context5[SMITHY_CONTEXT_KEY] || (context5[SMITHY_CONTEXT_KEY] = {}); } }); -// node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js -var EventStreamSerde; -var init_EventStreamSerde = __esm({ - "node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js"() { +// node_modules/@smithy/core/dist-es/submodules/transport/httpRequest.js +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); +} +var HttpRequest; +var init_httpRequest = __esm({ + "node_modules/@smithy/core/dist-es/submodules/transport/httpRequest.js"() { "use strict"; - init_dist_es10(); - 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 body2 = serializer.flush(); - yield { - [initialRequestMarker]: true, - headers, - body: body2 - }; - } - for await (const page of eventStream) { - yield page; - } - } - }; - return marshaller.serialize(eventStreamIterable, (event) => { - if (event[initialRequestMarker]) { - return { - headers: event.headers, - body: event.body - }; - } - const unionMember = Object.keys(event).find((key) => { - return key !== "__type"; - }) ?? ""; - const { additionalHeaders, body: body2, 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: body2 - }; - }); + HttpRequest = 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; } - 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) => { - const unionMember = Object.keys(event).find((key) => { - return key !== "__type"; - }) ?? ""; - const body2 = event[unionMember].body; - if (unionMember === "initial-response") { - const dataObject = await this.deserializer.read(responseSchema, body2); - 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] = body2; - } else if (member2.isStringSchema()) { - out[name] = (this.serdeContext?.utf8Encoder ?? toUtf8)(body2); - } else if (member2.isStructSchema()) { - out[name] = await this.deserializer.read(member2, body2); - } - } 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 (body2.byteLength === 0) { - return { - [unionMember]: {} - }; - } - } - return { - [unionMember]: await this.deserializer.read(eventStreamSchema, body2) - }; - } else { - return { - $unknown: event - }; - } + static clone(request2) { + const cloned = new _HttpRequest({ + ...request2, + headers: { ...request2.headers } }); - 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, value] of Object.entries(firstEvent.value)) { - initialResponseContainer[key] = value; - } + if (cloned.query) { + cloned.query = cloneQuery(cloned.query); } - return { - async *[Symbol.asyncIterator]() { - if (!firstEvent?.value?.[initialResponseMarker]) { - yield firstEvent.value; - } - while (true) { - const { done, value } = await asyncIterator.next(); - if (done) { - break; - } - yield value; - } - } - }; + return cloned; } - writeEventBody(unionMember, unionSchema, event) { - const serializer = this.serializer; - let eventType = unionMember; - let explicitPayloadMember = null; - let explicitPayloadContentType; - const isKnownSchema = (() => { - const struct = unionSchema.getSchema(); - return struct[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."); - } + static isInstance(request2) { + if (!request2) { + return false; } - const messageSerialization = serializer.flush() ?? new Uint8Array(); - const body2 = typeof messageSerialization === "string" ? (this.serdeContext?.utf8Decoder ?? fromUtf8)(messageSerialization) : messageSerialization; - return { - body: body2, - eventType, - explicitPayloadContentType, - additionalHeaders - }; + const req = request2; + 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); } }; } }); -// 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"() { +// node_modules/@smithy/core/dist-es/submodules/transport/httpResponse.js +var HttpResponse; +var init_httpResponse = __esm({ + "node_modules/@smithy/core/dist-es/submodules/transport/httpResponse.js"() { "use strict"; - init_EventStreamSerde(); + HttpResponse = 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"; + } + }; } }); -// node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js -var HttpProtocol; -var init_HttpProtocol = __esm({ - "node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js"() { +// node_modules/@smithy/core/dist-es/submodules/transport/isValidHostLabel.js +var VALID_HOST_LABEL_REGEX, isValidHostLabel; +var init_isValidHostLabel = __esm({ + "node_modules/@smithy/core/dist-es/submodules/transport/isValidHostLabel.js"() { "use strict"; - init_schema2(); - init_dist_es2(); - 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); + VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`); + 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; } } - getRequestType() { - return HttpRequest; + return true; + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/transport/normalizeProvider.js +var normalizeProvider; +var init_normalizeProvider = __esm({ + "node_modules/@smithy/core/dist-es/submodules/transport/normalizeProvider.js"() { + "use strict"; + normalizeProvider = (input) => { + if (typeof input === "function") + return input; + const promisified = Promise.resolve(input); + return () => promisified; + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/transport/parseQueryString.js +function parseQueryString(querystring) { + const query = {}; + querystring = querystring.replace(/^\?/, ""); + if (querystring) { + for (const pair of querystring.split("&")) { + let [key, value = null] = pair.split("="); + key = decodeURIComponent(key); + if (value) { + value = decodeURIComponent(value); } - getResponseType() { - return HttpResponse; + if (!(key in query)) { + query[key] = value; + } else if (Array.isArray(query[key])) { + query[key].push(value); + } else { + query[key] = [query[key], value]; } - setSerdeContext(serdeContext) { - this.serdeContext = serdeContext; - this.serializer.setSerdeContext(serdeContext); - this.deserializer.setSerdeContext(serdeContext); - if (this.getPayloadCodec()) { - this.getPayloadCodec().setSerdeContext(serdeContext); - } + } + } + return query; +} +var init_parseQueryString = __esm({ + "node_modules/@smithy/core/dist-es/submodules/transport/parseQueryString.js"() { + "use strict"; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/transport/parseUrl.js +var parseUrl2; +var init_parseUrl = __esm({ + "node_modules/@smithy/core/dist-es/submodules/transport/parseUrl.js"() { + "use strict"; + init_parseQueryString(); + parseUrl2 = (url2) => { + if (typeof url2 === "string") { + return parseUrl2(new URL(url2)); + } + const { hostname, pathname, port, protocol, search } = url2; + let query; + if (search) { + query = parseQueryString(search); } - updateServiceEndpoint(request3, endpoint2) { + return { + hostname, + port: port ? parseInt(port) : void 0, + protocol, + path: pathname, + query + }; + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/transport/toEndpointV1.js +var toEndpointV1; +var init_toEndpointV1 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/transport/toEndpointV1.js"() { + "use strict"; + init_parseUrl(); + toEndpointV1 = (endpoint2) => { + if (typeof endpoint2 === "object") { if ("url" in endpoint2) { - request3.protocol = endpoint2.url.protocol; - request3.hostname = endpoint2.url.hostname; - request3.port = endpoint2.url.port ? Number(endpoint2.url.port) : void 0; - request3.path = endpoint2.url.pathname; - request3.fragment = endpoint2.url.hash || void 0; - request3.username = endpoint2.url.username || void 0; - request3.password = endpoint2.url.password || void 0; - if (!request3.query) { - request3.query = {}; - } - for (const [k7, v8] of endpoint2.url.searchParams.entries()) { - request3.query[k7] = v8; - } - if (endpoint2.headers) { - for (const [name, values] of Object.entries(endpoint2.headers)) { - request3.headers[name] = values.join(", "); - } - } - return request3; - } else { - request3.protocol = endpoint2.protocol; - request3.hostname = endpoint2.hostname; - request3.port = endpoint2.port ? Number(endpoint2.port) : void 0; - request3.path = endpoint2.path; - request3.query = { - ...endpoint2.query - }; + const v1Endpoint = parseUrl2(endpoint2.url); if (endpoint2.headers) { - for (const [name, value] of Object.entries(endpoint2.headers)) { - request3.headers[name] = value; - } - } - return request3; - } - } - setHostPrefix(request3, 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") { - const hostLabelInputs = [...inputNs.structIterator()].filter(([, member2]) => member2.getMergedTraits().hostLabel); - for (const [name] of hostLabelInputs) { - 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); + v1Endpoint.headers = {}; + for (const name in endpoint2.headers) { + v1Endpoint.headers[name.toLowerCase()] = endpoint2.headers[name].join(", "); } - request3.hostname = hostPrefix + request3.hostname; } + return v1Endpoint; } + return endpoint2; } - 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, context5, response, arg4, arg5) { - void schema; - void context5; - void response; - void arg4; - void arg5; - return []; - } - getEventStreamMarshaller() { - const context5 = this.serdeContext; - if (!context5.eventStreamMarshaller) { - throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext."); - } - return context5.eventStreamMarshaller; - } + return parseUrl2(endpoint2); }; } }); -// node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js -var HttpBindingProtocol; -var init_HttpBindingProtocol = __esm({ - "node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js"() { +// node_modules/@smithy/core/dist-es/submodules/transport/index.js +var init_transport = __esm({ + "node_modules/@smithy/core/dist-es/submodules/transport/index.js"() { "use strict"; - init_schema2(); - init_serde2(); - init_dist_es2(); - init_dist_es17(); - init_collect_stream_body(); - init_extended_encode_uri_component(); - init_HttpProtocol(); - HttpBindingProtocol = class extends HttpProtocol { - async serializeRequest(operationSchema, _input, context5) { - const input = { - ..._input ?? {} - }; - const serializer = this.serializer; - const query = {}; - const headers = {}; - const endpoint2 = await context5.endpoint(); - const ns2 = NormalizedSchema.of(operationSchema?.input); - const payloadMemberNames = []; - const payloadMemberSchemas = []; - let hasNonHttpBindingMember = false; - let payload; - const request3 = new HttpRequest({ - protocol: "", - hostname: "", - port: void 0, - path: "", - fragment: void 0, - query, - headers, - body: void 0 - }); - if (endpoint2) { - this.updateServiceEndpoint(request3, endpoint2); - this.setHostPrefix(request3, operationSchema, input); - const opTraits = translateTraits(operationSchema.traits); - if (opTraits.http) { - request3.method = opTraits.http[0]; - const [path10, search] = opTraits.http[1].split("?"); - if (request3.path == "/") { - request3.path = path10; - } else { - request3.path += path10; - } - const traitSearchParams = new URLSearchParams(search ?? ""); - Object.assign(query, Object.fromEntries(traitSearchParams)); + init_getSmithyContext(); + init_httpRequest(); + init_httpResponse(); + init_isValidHostLabel(); + init_normalizeProvider(); + init_parseUrl(); + init_toEndpointV1(); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/client/smithy-client/client.js +var Client; +var init_client2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/client/smithy-client/client.js"() { + "use strict"; + init_MiddlewareStack(); + Client = class { + config; + middlewareStack = constructStack(); + initConfig; + handlers; + constructor(config) { + this.config = config; + const { protocol, protocolSettings } = config; + if (protocolSettings) { + if (typeof protocol === "function") { + config.protocol = new protocol(protocolSettings); } } - for (const [memberName, memberNs] of ns2.structIterator()) { - const memberTraits = memberNs.getMergedTraits() ?? {}; - const inputMemberValue = input[memberName]; - if (inputMemberValue == null && !memberNs.isIdempotencyToken()) { - if (memberTraits.httpLabel) { - if (request3.path.includes(`{${memberName}+}`) || request3.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]) { - payload = await this.serializeEventStream({ - eventStream: input[memberName], - requestSchema: ns2 - }); - } - } else { - payload = inputMemberValue; - } - } else { - serializer.write(memberNs, inputMemberValue); - payload = serializer.flush(); - } - delete input[memberName]; - } else if (memberTraits.httpLabel) { - serializer.write(memberNs, inputMemberValue); - const replacement = serializer.flush(); - if (request3.path.includes(`{${memberName}+}`)) { - request3.path = request3.path.replace(`{${memberName}+}`, replacement.split("/").map(extendedEncodeURIComponent).join("/")); - } else if (request3.path.includes(`{${memberName}}`)) { - request3.path = request3.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement)); - } - delete input[memberName]; - } else if (memberTraits.httpHeader) { - serializer.write(memberNs, inputMemberValue); - headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush()); - delete input[memberName]; - } else if (typeof memberTraits.httpPrefixHeaders === "string") { - for (const [key, val] of Object.entries(inputMemberValue)) { - const amalgam = memberTraits.httpPrefixHeaders + key; - serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val); - headers[amalgam.toLowerCase()] = serializer.flush(); - } - delete input[memberName]; - } else if (memberTraits.httpQuery || memberTraits.httpQueryParams) { - this.serializeQuery(memberNs, inputMemberValue, query); - delete input[memberName]; - } else { - hasNonHttpBindingMember = true; - payloadMemberNames.push(memberName); - payloadMemberSchemas.push(memberNs); + } + send(command2, 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 handler2; + if (useHandlerCache) { + if (!this.handlers) { + this.handlers = /* @__PURE__ */ new WeakMap(); } - } - if (hasNonHttpBindingMember && input) { - const [namespace, name] = (ns2.getName(true) ?? "#Unknown").split("#"); - const requiredMembers = ns2.getSchema()[6]; - const payloadSchema = [ - 3, - namespace, - name, - ns2.getMergedTraits(), - payloadMemberNames, - payloadMemberSchemas, - void 0 - ]; - if (requiredMembers) { - payloadSchema[6] = requiredMembers; + const handlers = this.handlers; + if (handlers.has(command2.constructor)) { + handler2 = handlers.get(command2.constructor); } else { - payloadSchema.pop(); - } - serializer.write(payloadSchema, input); - payload = serializer.flush(); - } - request3.headers = headers; - request3.query = query; - request3.body = payload; - return request3; - } - serializeQuery(ns2, data, query) { - const serializer = this.serializer; - const traits = ns2.getMergedTraits(); - if (traits.httpQueryParams) { - for (const [key, val] of Object.entries(data)) { - if (!(key in query)) { - const valueSchema = ns2.getValueSchema(); - Object.assign(valueSchema.getMergedTraits(), { - ...traits, - httpQuery: key, - httpQueryParams: void 0 - }); - this.serializeQuery(valueSchema, val, query); - } + handler2 = command2.resolveMiddleware(this.middlewareStack, this.config, options); + handlers.set(command2.constructor, handler2); } - return; + } else { + delete this.handlers; + handler2 = command2.resolveMiddleware(this.middlewareStack, this.config, options); } - if (ns2.isListSchema()) { - const sparse = !!ns2.getMergedTraits().sparse; - const buffer2 = []; - for (const item of data) { - serializer.write([ns2.getValueSchema(), traits], item); - const serializable = serializer.flush(); - if (sparse || serializable !== void 0) { - buffer2.push(serializable); - } - } - query[traits.httpQuery] = buffer2; + if (callback) { + handler2(command2).then((result) => callback(null, result.output), (err) => callback(err)).catch(() => { + }); } else { - serializer.write([ns2, traits], data); - query[traits.httpQuery] = serializer.flush(); + return handler2(command2).then((result) => result.output); } } - async deserializeResponse(operationSchema, context5, response) { - const deserializer = this.deserializer; - const ns2 = NormalizedSchema.of(operationSchema.output); - const dataObject = {}; - if (response.statusCode >= 300) { - const bytes = await collectBody(response.body, context5); - if (bytes.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(15, bytes)); - } - await this.handleError(operationSchema, context5, 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(ns2, context5, response, dataObject); - if (nonHttpBindingMembers.length) { - const bytes = await collectBody(response.body, context5); - if (bytes.byteLength > 0) { - const dataFromBody = await deserializer.read(ns2, bytes); - for (const member2 of nonHttpBindingMembers) { - if (dataFromBody[member2] != null) { - dataObject[member2] = dataFromBody[member2]; - } - } - } - } else if (nonHttpBindingMembers.discardResponseBody) { - await collectBody(response.body, context5); - } - dataObject.$metadata = this.deserializeMetadata(response); - return dataObject; + destroy() { + this.config?.requestHandler?.destroy?.(); + delete this.handlers; } - async deserializeHttpMessage(schema, context5, response, arg4, arg5) { - let dataObject; - if (arg4 instanceof Set) { - dataObject = arg5; - } else { - dataObject = arg4; - } - let discardResponseBody = true; - const deserializer = this.deserializer; - const ns2 = NormalizedSchema.of(schema); - const nonHttpBindingMembers = []; - for (const [memberName, memberSchema] of ns2.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: ns2 - }); - } else { - dataObject[memberName] = sdkStreamMixin2(response.body); - } - } else if (response.body) { - const bytes = await collectBody(response.body, context5); - 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 list = []; - for (const section of sections) { - list.push(await deserializer.read(headerListValueSchema, section.trim())); - } - dataObject[memberName] = list; - } else { - dataObject[memberName] = await deserializer.read(memberSchema, value); - } - } - } else if (memberTraits.httpPrefixHeaders !== void 0) { - dataObject[memberName] = {}; - for (const [header, value] of Object.entries(response.headers)) { - if (header.startsWith(memberTraits.httpPrefixHeaders)) { - 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/schema/deref.js +var deref; +var init_deref = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/deref.js"() { + "use strict"; + deref = (schemaRef) => { + if (typeof schemaRef === "function") { + return schemaRef(); } + return schemaRef; }; } }); -// node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js -var RpcProtocol; -var init_RpcProtocol = __esm({ - "node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js"() { +// 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"() { "use strict"; - init_schema2(); - init_dist_es2(); - init_collect_stream_body(); - init_HttpProtocol(); - RpcProtocol = class extends HttpProtocol { - async serializeRequest(operationSchema, input, context5) { - const serializer = this.serializer; - const query = {}; - const headers = {}; - const endpoint2 = await context5.endpoint(); - const ns2 = NormalizedSchema.of(operationSchema?.input); - const schema = ns2.getSchema(); - let payload; - const request3 = new HttpRequest({ - protocol: "", - hostname: "", - port: void 0, - path: "/", - fragment: void 0, - query, - headers, - body: void 0 - }); - if (endpoint2) { - this.updateServiceEndpoint(request3, endpoint2); - this.setHostPrefix(request3, operationSchema, input); - } - const _input = { - ...input + operation = (namespace, name, traits, input, output) => ({ + name, + namespace, + traits, + input, + output + }); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js +var schemaDeserializationMiddleware, findHeader; +var init_schemaDeserializationMiddleware = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js"() { + "use strict"; + init_transport(); + init_operation(); + schemaDeserializationMiddleware = (config) => (next, context5) => async (args) => { + const { response } = await next(args); + const { operationSchema } = getSmithyContext(context5); + const [, ns2, n8, t, i6, o2] = operationSchema ?? []; + try { + const parsed = await config.protocol.deserializeResponse(operation(ns2, n8, t, i6, o2), { + ...config, + ...context5 + }, response); + return { + response, + output: parsed }; - if (input) { - const eventStreamMember = ns2.getEventStreamMember(); - if (eventStreamMember) { - if (_input[eventStreamMember]) { - const initialRequest = {}; - for (const [memberName, memberSchema] of ns2.structIterator()) { - if (memberName !== eventStreamMember && _input[memberName]) { - serializer.write(memberSchema, _input[memberName]); - initialRequest[memberName] = serializer.flush(); - } - } - payload = await this.serializeEventStream({ - eventStream: _input[eventStreamMember], - requestSchema: ns2, - initialRequest - }); + } catch (error2) { + Object.defineProperty(error2, "$response", { + value: response, + enumerable: false, + writable: false, + configurable: false + }); + if (!("$metadata" in error2)) { + const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; + try { + error2.message += "\n " + hint; + } catch (e6) { + if (!context5.logger || context5.logger?.constructor?.name === "NoOpLogger") { + console.warn(hint); + } else { + context5.logger?.warn?.(hint); } - } else { - serializer.write(schema, _input); - payload = serializer.flush(); } - } - request3.headers = Object.assign(request3.headers, headers); - request3.query = query; - request3.body = payload; - request3.method = "POST"; - return request3; - } - async deserializeResponse(operationSchema, context5, response) { - const deserializer = this.deserializer; - const ns2 = NormalizedSchema.of(operationSchema.output); - const dataObject = {}; - if (response.statusCode >= 300) { - const bytes = await collectBody(response.body, context5); - if (bytes.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(15, bytes)); + if (typeof error2.$responseBodyText !== "undefined") { + if (error2.$response) { + error2.$response.body = error2.$responseBodyText; + } } - await this.handleError(operationSchema, context5, 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 = ns2.getEventStreamMember(); - if (eventStreamMember) { - dataObject[eventStreamMember] = await this.deserializeEventStream({ - response, - responseSchema: ns2, - initialResponseContainer: dataObject - }); - } else { - const bytes = await collectBody(response.body, context5); - if (bytes.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(ns2, bytes)); + try { + if (HttpResponse.isInstance(response)) { + const { headers = {}, statusCode } = response; + const headerEntries = Object.entries(headers); + error2.$metadata = { + httpStatusCode: statusCode, + requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries), + extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries), + cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries) + }; + } + } catch (e6) { } } - dataObject.$metadata = this.deserializeMetadata(response); - return dataObject; + throw error2; } }; + findHeader = (pattern, headers) => { + return (headers.find(([k7]) => { + return k7.match(pattern); + }) || [void 0, void 0])[1]; + }; } }); -// node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js -var init_resolve_path = __esm({ - "node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js"() { +// node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js +var schemaSerializationMiddleware; +var init_schemaSerializationMiddleware = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js"() { "use strict"; + init_transport(); + init_operation(); + schemaSerializationMiddleware = (config) => (next, context5) => async (args) => { + const { operationSchema } = getSmithyContext(context5); + const [, ns2, n8, t, i6, o2] = operationSchema ?? []; + const endpoint2 = context5.endpointV2 ? async () => toEndpointV1(context5.endpointV2) : config.endpoint; + const request2 = await config.protocol.serializeRequest(operation(ns2, n8, t, i6, o2), args.input, { + ...config, + ...context5, + endpoint: endpoint2 + }); + return next({ + ...args, + request: request2 + }); + }; } }); -// node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js -var init_requestBuilder = __esm({ - "node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js"() { +// 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"() { + "use strict"; + 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 init_Schema = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js"() { "use strict"; } }); -// node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js -function determineTimestampFormat(ns2, settings) { - if (settings.timestampFormat.useTrait) { - if (ns2.isTimestampSchema() && (ns2.getSchema() === 5 || ns2.getSchema() === 6 || ns2.getSchema() === 7)) { - return ns2.getSchema(); +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js +var init_ListSchema = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js"() { + "use strict"; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js +var init_MapSchema = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js"() { + "use strict"; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js +var init_OperationSchema = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js"() { + "use strict"; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js +var init_StructureSchema = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js"() { + "use strict"; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js +var init_ErrorSchema = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js"() { + "use strict"; + } +}); + +// 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 i6 = 0; + for (const trait of [ + "httpLabel", + "idempotent", + "idempotencyToken", + "sensitive", + "httpPayload", + "httpResponseCode", + "httpQueryParams" + ]) { + if ((indicator >> i6++ & 1) === 1) { + traits[trait] = 1; } } - const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns2.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; + return traitsCache[indicator] = traits; } -var init_determineTimestampFormat = __esm({ - "node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js"() { +var traitsCache; +var init_translateTraits = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js"() { "use strict"; + traitsCache = []; } }); -// node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js -var FromStringShapeDeserializer; -var init_FromStringShapeDeserializer = __esm({ - "node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js"() { +// 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"() { "use strict"; - init_schema2(); - init_serde2(); - init_dist_es11(); - init_dist_es10(); - init_SerdeContext(); - init_determineTimestampFormat(); - FromStringShapeDeserializer = class extends SerdeContext { - settings; - constructor(settings) { - super(); - this.settings = settings; - } - read(_schema, data) { - const ns2 = NormalizedSchema.of(_schema); - if (ns2.isListSchema()) { - return splitHeader(data).map((item) => this.read(ns2.getValueSchema(), item)); + 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 (ns2.isBlobSchema()) { - return (this.serdeContext?.base64Decoder ?? fromBase64)(data); + if (traitStack.length > 0) { + this.memberTraits = {}; + for (let i6 = traitStack.length - 1; i6 >= 0; --i6) { + const traitSet = traitStack[i6]; + Object.assign(this.memberTraits, translateTraits(traitSet)); + } + } else { + this.memberTraits = 0; } - if (ns2.isTimestampSchema()) { - const format2 = determineTimestampFormat(ns2, this.settings); - switch (format2) { - case 5: - return _parseRfc3339DateTimeWithOffset(data); - case 6: - return _parseRfc7231DateTime(data); - case 7: - return _parseEpochTimestamp(data); - default: - console.warn("Missing timestamp format, parsing value with Date constructor:", data); - return new Date(data); + 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 ns2 = lhs; + return ns2.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]; } } - if (ns2.isStringSchema()) { - const mediaType = ns2.getMergedTraits().mediaType; - let intermediateValue = data; - if (mediaType) { - if (ns2.getMergedTraits().httpHeader) { - intermediateValue = this.base64ToUtf8(intermediateValue); - } - const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); - if (isJson) { - intermediateValue = LazyJsonString.from(intermediateValue); - } - return intermediateValue; + const sc = deref(ref); + if (sc instanceof _NormalizedSchema) { + return sc; + } + if (isMemberSchema(sc)) { + const [ns3, traits] = sc; + if (ns3 instanceof _NormalizedSchema) { + Object.assign(ns3.getMergedTraits(), translateTraits(traits)); + return ns3; } + throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`); } - if (ns2.isNumericSchema()) { - return Number(data); + const ns2 = new _NormalizedSchema(sc); + if (keyAble) { + return ref[anno.ns] = ns2; } - if (ns2.isBigIntegerSchema()) { - return BigInt(data); + if (typeof sc === "string") { + return simpleSchemaCacheS[sc] = ns2; } - if (ns2.isBigDecimalSchema()) { - return new NumericValue(data, "bigDecimal"); + if (typeof sc === "number") { + return simpleSchemaCacheN[sc] = ns2; } - if (ns2.isBooleanSchema()) { - return String(data).toLowerCase() === "true"; + return ns2; + } + getSchema() { + const sc = this.schema; + if (Array.isArray(sc) && sc[0] === 0) { + return sc[4]; } - return data; + return sc; } - base64ToUtf8(base64String) { - return (this.serdeContext?.utf8Encoder ?? toUtf8)((this.serdeContext?.base64Decoder ?? fromBase64)(base64String)); + getName(withNamespace = false) { + const { name } = this; + const short = !withNamespace && name && name.includes("#"); + return short ? name.split("#")[1] : name || void 0; } - }; - } -}); - -// node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js -var HttpInterceptingShapeDeserializer; -var init_HttpInterceptingShapeDeserializer = __esm({ - "node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js"() { - "use strict"; - init_schema2(); - init_dist_es10(); - init_SerdeContext(); - init_FromStringShapeDeserializer(); - HttpInterceptingShapeDeserializer = class extends SerdeContext { - codecDeserializer; - stringDeserializer; - constructor(codecDeserializer, codecSettings) { - super(); - this.codecDeserializer = codecDeserializer; - this.stringDeserializer = new FromStringShapeDeserializer(codecSettings); + getMemberName() { + return this.memberName; } - setSerdeContext(serdeContext) { - this.stringDeserializer.setSerdeContext(serdeContext); - this.codecDeserializer.setSerdeContext(serdeContext); - this.serdeContext = serdeContext; + isMemberSchema() { + return this._isMemberSchema; } - read(schema, data) { - const ns2 = NormalizedSchema.of(schema); - const traits = ns2.getMergedTraits(); - const toString3 = this.serdeContext?.utf8Encoder ?? toUtf8; - if (traits.httpHeader || traits.httpResponseCode) { - return this.stringDeserializer.read(ns2, toString3(data)); + 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; } - if (traits.httpPayload) { - if (ns2.isBlobSchema()) { - const toBytes = this.serdeContext?.utf8Decoder ?? fromUtf8; - if (typeof data === "string") { - return toBytes(data); - } - return data; - } else if (ns2.isStringSchema()) { - if ("byteLength" in data) { - return toString3(data); - } - return data; - } + const id = sc[0]; + return id === 3 || id === -3 || id === 4; + } + isUnionSchema() { + const sc = this.getSchema(); + if (typeof sc !== "object") { + return false; } - return this.codecDeserializer.read(ns2, data); + return sc[0] === 4; } - }; - } -}); - -// node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js -var ToStringShapeSerializer; -var init_ToStringShapeSerializer = __esm({ - "node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js"() { - "use strict"; - init_schema2(); - init_serde2(); - init_dist_es11(); - init_SerdeContext(); - init_determineTimestampFormat(); - ToStringShapeSerializer = class extends SerdeContext { - settings; - stringBuffer = ""; - constructor(settings) { - super(); - this.settings = settings; + isBlobSchema() { + const sc = this.getSchema(); + return sc === 21 || sc === 42; } - write(schema, value) { - const ns2 = NormalizedSchema.of(schema); - switch (typeof value) { - case "object": - if (value === null) { - this.stringBuffer = "null"; - return; - } - if (ns2.isTimestampSchema()) { - if (!(value instanceof Date)) { - throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns2.getName(true)}`); - } - const format2 = determineTimestampFormat(ns2, 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 (ns2.isBlobSchema() && "byteLength" in value) { - this.stringBuffer = (this.serdeContext?.base64Encoder ?? toBase64)(value); - return; - } - if (ns2.isListSchema() && Array.isArray(value)) { - let buffer2 = ""; - for (const item of value) { - this.write([ns2.getValueSchema(), ns2.getMergedTraits()], item); - const headerItem = this.flush(); - const serialized = ns2.getValueSchema().isTimestampSchema() ? headerItem : quoteHeader(headerItem); - if (buffer2 !== "") { - buffer2 += ", "; - } - buffer2 += serialized; - } - this.stringBuffer = buffer2; - return; - } - this.stringBuffer = JSON.stringify(value, null, 2); - break; - case "string": - const mediaType = ns2.getMergedTraits().mediaType; - let intermediateValue = value; - if (mediaType) { - const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); - if (isJson) { - intermediateValue = LazyJsonString.from(intermediateValue); - } - if (ns2.getMergedTraits().httpHeader) { - this.stringBuffer = (this.serdeContext?.base64Encoder ?? toBase64)(intermediateValue.toString()); - return; - } - } - this.stringBuffer = value; - break; - default: - if (ns2.isIdempotencyToken()) { - this.stringBuffer = v4(); - } else { - this.stringBuffer = String(value); - } + 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"); } - flush() { - const buffer2 = this.stringBuffer; - this.stringBuffer = ""; - return buffer2; + 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.`); } - }; - } -}); - -// 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"() { - "use strict"; - init_schema2(); - init_ToStringShapeSerializer(); - HttpInterceptingShapeSerializer = class { - codecSerializer; - stringSerializer; - buffer; - constructor(codecSerializer, codecSettings, stringSerializer = new ToStringShapeSerializer(codecSettings)) { - this.codecSerializer = codecSerializer; - this.stringSerializer = stringSerializer; + getMemberSchema(memberName) { + const struct = this.getSchema(); + if (this.isStructSchema() && struct[4].includes(memberName)) { + const i6 = struct[4].indexOf(memberName); + const memberSchema = struct[5][i6]; + 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}.`); } - setSerdeContext(serdeContext) { - this.codecSerializer.setSerdeContext(serdeContext); - this.stringSerializer.setSerdeContext(serdeContext); + getMemberSchemas() { + const buffer2 = {}; + try { + for (const [k7, v2] of this.structIterator()) { + buffer2[k7] = v2; + } + } catch (ignored) { + } + return buffer2; } - write(schema, value) { - const ns2 = NormalizedSchema.of(schema); - const traits = ns2.getMergedTraits(); - if (traits.httpHeader || traits.httpLabel || traits.httpQuery) { - this.stringSerializer.write(ns2, value); - this.buffer = this.stringSerializer.flush(); - return; + getEventStreamMember() { + if (this.isStructSchema()) { + for (const [memberName, memberSchema] of this.structIterator()) { + if (memberSchema.isStreaming() && memberSchema.isStructSchema()) { + return memberName; + } + } } - return this.codecSerializer.write(ns2, value); + return ""; } - flush() { - if (this.buffer !== void 0) { - const buffer2 = this.buffer; - this.buffer = void 0; - return buffer2; + *structIterator() { + if (this.isUnitSchema()) { + return; } - return this.codecSerializer.flush(); + if (!this.isStructSchema()) { + throw new Error("@smithy/core/schema - cannot iterate non-struct schema."); + } + const struct = this.getSchema(); + const z = struct[4].length; + let it2 = struct[anno.it]; + if (it2 && z === it2.length) { + yield* it2; + return; + } + it2 = Array(z); + for (let i6 = 0; i6 < z; ++i6) { + const k7 = struct[4][i6]; + const v2 = member([struct[5][i6], 0], k7); + yield it2[i6] = [k7, v2]; + } + struct[anno.it] = it2; } }; + isMemberSchema = (sc) => Array.isArray(sc) && sc.length === 2; + isStaticSchema = (sc) => Array.isArray(sc) && sc.length >= 5; } }); -// node_modules/@smithy/core/dist-es/submodules/protocols/index.js -var init_protocols = __esm({ - "node_modules/@smithy/core/dist-es/submodules/protocols/index.js"() { - "use strict"; - 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"() { +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js +var init_SimpleSchema = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js"() { "use strict"; } }); -// node_modules/@smithy/core/dist-es/setFeature.js -function setFeature(context5, feature, value) { - if (!context5.__smithy_context) { - context5.__smithy_context = { - features: {} - }; - } else if (!context5.__smithy_context.features) { - context5.__smithy_context.features = {}; - } - context5.__smithy_context.features[feature] = value; -} -var init_setFeature = __esm({ - "node_modules/@smithy/core/dist-es/setFeature.js"() { +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js +var init_sentinels2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js"() { "use strict"; } }); -// 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"() { +// 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"() { "use strict"; - DefaultIdentityProviderConfig = class { - authSchemes = /* @__PURE__ */ new Map(); - constructor(config) { - for (const [key, value] of Object.entries(config)) { - if (value !== void 0) { - this.authSchemes.set(key, value); + 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 [k7, v2] of other.schemas) { + if (!schemas.has(k7)) { + schemas.set(k7, v2); + } + } + for (const [k7, v2] of other.exceptions) { + if (!exceptions.has(k7)) { + exceptions.set(k7, v2); } } } - getIdentityProvider(schemeId) { - return this.authSchemes.get(schemeId); + register(shapeId, schema) { + const qualifiedName = this.normalizeShapeId(shapeId); + for (const r6 of [this, _TypeRegistry.for(qualifiedName.split("#")[0])]) { + r6.schemas.set(qualifiedName, schema); + } + } + getSchema(shapeId) { + const id = this.normalizeShapeId(shapeId); + if (!this.schemas.has(id)) { + if (!shapeId.includes("#")) { + const suffix = "#" + shapeId; + const candidates = []; + for (const [shapeId2, schema] of this.schemas.entries()) { + if (shapeId2.endsWith(suffix)) { + candidates.push(schema); + } + } + if (candidates.length === 1) { + return candidates[0]; + } + } + throw new Error(`@smithy/core/schema - schema not found for ${id}`); + } + return this.schemas.get(id); + } + registerError(es2, ctor) { + const $error = es2; + const ns2 = $error[1]; + for (const r6 of [this, _TypeRegistry.for(ns2)]) { + r6.schemas.set(ns2 + "#" + $error[2], $error); + r6.exceptions.set($error, ctor); + } + } + getErrorCtor(es2) { + const $error = es2; + if (this.exceptions.has($error)) { + return this.exceptions.get($error); + } + const registry2 = _TypeRegistry.for($error[1]); + return registry2.exceptions.get($error); + } + getBaseException() { + for (const exceptionKey of this.exceptions.keys()) { + if (Array.isArray(exceptionKey)) { + const [, ns2, name] = exceptionKey; + const id = ns2 + "#" + 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/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js -var init_httpApiKeyAuth = __esm({ - "node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js"() { +// node_modules/@smithy/core/dist-es/submodules/schema/index.js +var init_schema2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/index.js"() { "use strict"; + init_deref(); + init_getSchemaSerdePlugin(); + init_ListSchema(); + init_MapSchema(); + init_OperationSchema(); + init_operation(); + init_ErrorSchema(); + init_NormalizedSchema(); + init_Schema(); + init_SimpleSchema(); + init_StructureSchema(); + init_sentinels2(); + init_translateTraits(); + init_TypeRegistry(); } }); -// node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js -var HttpBearerAuthSigner; -var init_httpBearerAuth = __esm({ - "node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js"() { - "use strict"; - init_dist_es2(); - HttpBearerAuthSigner = class { - async sign(httpRequest2, identity, signingProperties) { - const clonedRequest = HttpRequest.clone(httpRequest2); - 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/submodules/client/smithy-client/schemaLogFilter.js +function schemaLogFilter(schema, data) { + if (data == null) { + return data; } -}); - -// 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"() { - "use strict"; - NoAuthSigner = class { - async sign(httpRequest2, identity, signingProperties) { - return httpRequest2; + const ns2 = NormalizedSchema.of(schema); + if (ns2.getMergedTraits().sensitive) { + return SENSITIVE_STRING; + } + if (ns2.isListSchema()) { + const isSensitive = !!ns2.getValueSchema().getMergedTraits().sensitive; + if (isSensitive) { + return SENSITIVE_STRING; + } + } else if (ns2.isMapSchema()) { + const isSensitive = !!ns2.getKeySchema().getMergedTraits().sensitive || !!ns2.getValueSchema().getMergedTraits().sensitive; + if (isSensitive) { + return SENSITIVE_STRING; + } + } else if (ns2.isStructSchema() && typeof data === "object") { + const object = data; + const newObject = {}; + for (const [member2, memberNs] of ns2.structIterator()) { + if (object[member2] != null) { + newObject[member2] = schemaLogFilter(memberNs, object[member2]); } - }; + } + return newObject; } -}); - -// 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"() { + return data; +} +var SENSITIVE_STRING; +var init_schemaLogFilter = __esm({ + "node_modules/@smithy/core/dist-es/submodules/client/smithy-client/schemaLogFilter.js"() { "use strict"; - init_httpApiKeyAuth(); - init_httpBearerAuth(); - init_noAuth(); + init_schema2(); + SENSITIVE_STRING = "***SensitiveInformation***"; } }); -// 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"() { +// node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js +var Command2, ClassBuilder; +var init_command3 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js"() { "use strict"; - 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; + init_dist_es(); + init_MiddlewareStack(); + init_schemaLogFilter(); + Command2 = class { + middlewareStack = constructStack(); + schema; + static classBuilder() { + return new ClassBuilder(); } - 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); + 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); } - try { - resolved = await pending; - hasResult = true; - isConstant = false; - } finally { - pending = void 0; + const stack = clientStack.concat(this.middlewareStack); + const { logger: logger8 } = configuration; + const handlerExecutionContext = { + logger: logger8, + clientName, + commandName, + inputFilterSensitiveLog, + outputFilterSensitiveLog, + [SMITHY_CONTEXT_KEY]: { + commandInstance: this, + ...smithyContext + }, + ...additionalContext + }; + const { requestHandler } = configuration; + let requestOptions = options ?? {}; + if (smithyContext.eventStream) { + requestOptions = { + isEventStream: true, + ...requestOptions + }; } - return resolved; + return stack.resolve((request2) => requestHandler.handle(request2.request, requestOptions), handlerExecutionContext); + } + }; + ClassBuilder = class { + _init = () => { }; - if (isExpired === void 0) { - return async (options) => { - if (!hasResult || options?.forceRefresh) { - resolved = await coalesceProvider(options); - } - return resolved; + _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 = (_3) => _3, outputFilter = (_3) => _3) { + 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 op = closure._operationSchema; + const input = op?.[4] ?? op?.input; + const output = op?.[5] ?? op?.output; + return this.resolveMiddlewareWithContext(stack, configuration, options, { + CommandCtor: CommandRef, + middlewareFn: closure._middlewareFn, + clientName: closure._clientName, + commandName: closure._commandName, + inputFilterSensitiveLog: closure._inputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, input) : (_3) => _3), + outputFilterSensitiveLog: closure._outputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, output) : (_3) => _3), + smithyContext: closure._smithyContext, + additionalContext: closure._additionalContext + }); + } + serialize = closure._serializer; + deserialize = closure._deserializer; }; } - 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"() { - "use strict"; - init_DefaultIdentityProviderConfig(); - init_httpAuthSchemes(); - init_memoizeIdentityProvider(); - } -}); - -// node_modules/@smithy/core/dist-es/index.js -var init_dist_es21 = __esm({ - "node_modules/@smithy/core/dist-es/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/client/smithy-client/create-aggregated-client.js +var createAggregatedClient; +var init_create_aggregated_client = __esm({ + "node_modules/@smithy/core/dist-es/submodules/client/smithy-client/create-aggregated-client.js"() { "use strict"; - init_getSmithyContext(); - init_middleware_http_auth_scheme(); - init_middleware_http_signing(); - init_normalizeProvider2(); - init_createPaginator(); - init_requestBuilder2(); - init_setFeature(); - init_util_identity_and_auth(); - } -}); - -// node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js -function isValidUserAgentAppId(appId) { - if (appId === void 0) { - return true; - } - return typeof appId === "string" && appId.length <= 50; -} -function resolveUserAgentConfig(input) { - const normalizedAppIdProvider = normalizeProvider2(input.userAgentAppId ?? DEFAULT_UA_APP_ID); - const { customUserAgent } = input; - return Object.assign(input, { - customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent, - userAgentAppId: async () => { - const appId = await normalizedAppIdProvider(); - if (!isValidUserAgentAppId(appId)) { - const logger8 = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger; - if (typeof appId !== "string") { - logger8?.warn("userAgentAppId must be a string or undefined."); - } else if (appId.length > 50) { - logger8?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters."); + createAggregatedClient = (commands6, Client2, options) => { + for (const [command2, CommandCtor] of Object.entries(commands6)) { + const methodImpl = async function(args, optionsOrCb, cb) { + const command3 = new CommandCtor(args); + if (typeof optionsOrCb === "function") { + this.send(command3, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expected http options but got ${typeof optionsOrCb}`); + this.send(command3, optionsOrCb || {}, cb); + } else { + return this.send(command3, optionsOrCb); + } + }; + const methodName = (command2[0].toLowerCase() + command2.slice(1)).replace(/Command$/, ""); + Client2.prototype[methodName] = methodImpl; + } + const { paginators: paginators2 = {}, waiters = {} } = options ?? {}; + for (const [paginatorName, paginatorFn] of Object.entries(paginators2)) { + if (Client2.prototype[paginatorName] === void 0) { + Client2.prototype[paginatorName] = function(commandInput = {}, paginationConfiguration, ...rest) { + return paginatorFn({ + ...paginationConfiguration, + client: this + }, commandInput, ...rest); + }; } } - return appId; - } - }); -} -var DEFAULT_UA_APP_ID; -var init_configurations = __esm({ - "node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js"() { - "use strict"; - init_dist_es21(); - DEFAULT_UA_APP_ID = void 0; + for (const [waiterName, waiterFn] of Object.entries(waiters)) { + if (Client2.prototype[waiterName] === void 0) { + Client2.prototype[waiterName] = async function(commandInput = {}, waiterConfiguration, ...rest) { + let config = waiterConfiguration; + if (typeof waiterConfiguration === "number") { + config = { + maxWaitTime: waiterConfiguration + }; + } + return waiterFn({ + ...config, + client: this + }, commandInput, ...rest); + }; + } + } + }; } }); -// node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js -var EndpointCache; -var init_EndpointCache = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js"() { +// node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js +var ServiceException, decorateServiceException; +var init_exceptions = __esm({ + "node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js"() { "use strict"; - EndpointCache = 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 i6 = 0; - while (true) { - const { value, done } = keys.next(); - this.data.delete(value); - if (done || ++i6 > 10) { - break; - } - } - } - this.data.set(key, resolver()); - } - return this.data.get(key); + 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; } - size() { - return this.data.size; + 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"); } - hash(endpointParams) { - let buffer2 = ""; - const { parameters } = this; - if (parameters.length === 0) { + static [Symbol.hasInstance](instance) { + if (!instance) return false; + const candidate = instance; + if (this === _ServiceException) { + return _ServiceException.isInstance(instance); } - for (const param of parameters) { - const val = String(endpointParams[param] ?? ""); - if (val.includes("|;")) { - return false; + if (_ServiceException.isInstance(instance)) { + if (candidate.name && this.name) { + return this.prototype.isPrototypeOf(instance) || candidate.name === this.name; } - buffer2 += val + "|;"; + return this.prototype.isPrototypeOf(instance); } - return buffer2; + return false; } }; + decorateServiceException = (exception, additions = {}) => { + Object.entries(additions).filter(([, v2]) => v2 !== void 0).forEach(([k7, v2]) => { + if (exception[k7] == void 0 || exception[k7] === "") { + exception[k7] = v2; + } + }); + const message = exception.message || exception.Message || "UnknownError"; + exception.message = message; + delete exception.Message; + return exception; + }; } }); -// node_modules/@smithy/util-endpoints/dist-es/lib/isIpAddress.js -var IP_V4_REGEX, isIpAddress; -var init_isIpAddress = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/lib/isIpAddress.js"() { - "use strict"; - IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`); - isIpAddress = (value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]"); - } -}); - -// node_modules/@smithy/util-endpoints/dist-es/lib/isValidHostLabel.js -var VALID_HOST_LABEL_REGEX, isValidHostLabel; -var init_isValidHostLabel = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/lib/isValidHostLabel.js"() { +// node_modules/@smithy/core/dist-es/submodules/client/smithy-client/defaults-mode.js +var loadConfigsForDefaultMode; +var init_defaults_mode = __esm({ + "node_modules/@smithy/core/dist-es/submodules/client/smithy-client/defaults-mode.js"() { "use strict"; - VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`); - 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; - } + loadConfigsForDefaultMode = (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 {}; } - return true; }; } }); -// node_modules/@smithy/util-endpoints/dist-es/utils/customEndpointFunctions.js -var customEndpointFunctions; -var init_customEndpointFunctions = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/utils/customEndpointFunctions.js"() { +// node_modules/@smithy/core/dist-es/submodules/client/smithy-client/emitWarningIfUnsupportedVersion.js +var warningEmitted, emitWarningIfUnsupportedVersion2; +var init_emitWarningIfUnsupportedVersion2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/client/smithy-client/emitWarningIfUnsupportedVersion.js"() { "use strict"; - customEndpointFunctions = {}; + warningEmitted = false; + emitWarningIfUnsupportedVersion2 = (version3) => { + if (version3 && !warningEmitted && parseInt(version3.substring(1, version3.indexOf("."))) < 16) { + warningEmitted = true; + } + }; } }); -// node_modules/@smithy/util-endpoints/dist-es/debug/debugId.js -var debugId; -var init_debugId = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/debug/debugId.js"() { +// node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/checksum.js +var knownAlgorithms, getChecksumConfiguration, resolveChecksumRuntimeConfig; +var init_checksum3 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/checksum.js"() { "use strict"; - debugId = "endpoints"; + init_dist_es(); + knownAlgorithms = Object.values(AlgorithmId); + getChecksumConfiguration = (runtimeConfig) => { + const checksumAlgorithms = []; + for (const id in AlgorithmId) { + const algorithmId = AlgorithmId[id]; + if (runtimeConfig[algorithmId] === void 0) { + continue; + } + checksumAlgorithms.push({ + algorithmId: () => algorithmId, + checksumConstructor: () => runtimeConfig[algorithmId] + }); + } + 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; + } + }; + }; + resolveChecksumRuntimeConfig = (clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + const id = checksumAlgorithm.algorithmId(); + if (knownAlgorithms.includes(id)) { + runtimeConfig[id] = checksumAlgorithm.checksumConstructor(); + } + }); + return runtimeConfig; + }; } }); -// node_modules/@smithy/util-endpoints/dist-es/debug/toDebugString.js -function toDebugString(input) { - if (typeof input !== "object" || input == null) { - return input; - } - if ("ref" in input) { - return `$${toDebugString(input.ref)}`; - } - if ("fn" in input) { - return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`; - } - return JSON.stringify(input, null, 2); -} -var init_toDebugString = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/debug/toDebugString.js"() { +// node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/retry.js +var getRetryConfiguration, resolveRetryRuntimeConfig; +var init_retry2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/retry.js"() { "use strict"; + getRetryConfiguration = (runtimeConfig) => { + return { + setRetryStrategy(retryStrategy) { + runtimeConfig.retryStrategy = retryStrategy; + }, + retryStrategy() { + return runtimeConfig.retryStrategy; + } + }; + }; + resolveRetryRuntimeConfig = (retryStrategyConfiguration) => { + const runtimeConfig = {}; + runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy(); + return runtimeConfig; + }; } }); -// node_modules/@smithy/util-endpoints/dist-es/debug/index.js -var init_debug = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/debug/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/defaultExtensionConfiguration.js +var getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig; +var init_defaultExtensionConfiguration2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/defaultExtensionConfiguration.js"() { "use strict"; - init_debugId(); - init_toDebugString(); + init_checksum3(); + init_retry2(); + getDefaultExtensionConfiguration = (runtimeConfig) => { + return Object.assign(getChecksumConfiguration(runtimeConfig), getRetryConfiguration(runtimeConfig)); + }; + resolveDefaultRuntimeConfig = (config) => { + return Object.assign(resolveChecksumRuntimeConfig(config), resolveRetryRuntimeConfig(config)); + }; } }); -// node_modules/@smithy/util-endpoints/dist-es/types/EndpointError.js -var EndpointError; -var init_EndpointError = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/types/EndpointError.js"() { +// node_modules/@smithy/core/dist-es/submodules/client/smithy-client/get-value-from-text-node.js +var getValueFromTextNode; +var init_get_value_from_text_node = __esm({ + "node_modules/@smithy/core/dist-es/submodules/client/smithy-client/get-value-from-text-node.js"() { "use strict"; - EndpointError = class extends Error { - constructor(message) { - super(message); - this.name = "EndpointError"; + getValueFromTextNode = (obj) => { + const textNodeName = "#text"; + for (const key in obj) { + if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== void 0) { + obj[key] = obj[key][textNodeName]; + } else if (typeof obj[key] === "object" && obj[key] !== null) { + obj[key] = getValueFromTextNode(obj[key]); + } } + return obj; }; } }); -// node_modules/@smithy/util-endpoints/dist-es/types/EndpointFunctions.js -var init_EndpointFunctions = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/types/EndpointFunctions.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/util-endpoints/dist-es/types/EndpointRuleObject.js -var init_EndpointRuleObject2 = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/types/EndpointRuleObject.js"() { +// node_modules/@smithy/core/dist-es/submodules/client/smithy-client/NoOpLogger.js +var NoOpLogger; +var init_NoOpLogger = __esm({ + "node_modules/@smithy/core/dist-es/submodules/client/smithy-client/NoOpLogger.js"() { "use strict"; + NoOpLogger = class { + trace() { + } + debug() { + } + info() { + } + warn() { + } + error() { + } + }; } }); -// node_modules/@smithy/util-endpoints/dist-es/types/ErrorRuleObject.js -var init_ErrorRuleObject2 = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/types/ErrorRuleObject.js"() { +// node_modules/@smithy/core/dist-es/submodules/client/index.js +var init_client3 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/client/index.js"() { "use strict"; + init_transport(); + init_transport(); + init_client2(); + init_command3(); + init_create_aggregated_client(); + init_defaults_mode(); + init_emitWarningIfUnsupportedVersion2(); + init_exceptions(); + init_defaultExtensionConfiguration2(); + init_get_value_from_text_node(); + init_NoOpLogger(); } }); -// node_modules/@smithy/util-endpoints/dist-es/types/RuleSetObject.js -var init_RuleSetObject2 = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/types/RuleSetObject.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/is-array-buffer/is-array-buffer.js +var isArrayBuffer2; +var init_is_array_buffer = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/is-array-buffer/is-array-buffer.js"() { "use strict"; + isArrayBuffer2 = (arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]"; } }); -// node_modules/@smithy/util-endpoints/dist-es/types/TreeRuleObject.js -var init_TreeRuleObject2 = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/types/TreeRuleObject.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/util-buffer-from/buffer-from.js +var fromArrayBuffer, fromString; +var init_buffer_from = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-buffer-from/buffer-from.js"() { "use strict"; + init_is_array_buffer(); + fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => { + if (!isArrayBuffer2(input)) { + throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); + } + return Buffer.from(input, offset, length); + }; + 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.from(input, encoding) : Buffer.from(input); + }; } }); -// node_modules/@smithy/util-endpoints/dist-es/types/shared.js -var init_shared2 = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/types/shared.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/util-base64/fromBase64.js +var BASE64_REGEX, fromBase64; +var init_fromBase64 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-base64/fromBase64.js"() { "use strict"; + init_buffer_from(); + BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; + fromBase64 = (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 buffer2 = fromString(input, "base64"); + return new Uint8Array(buffer2.buffer, buffer2.byteOffset, buffer2.byteLength); + }; } }); -// node_modules/@smithy/util-endpoints/dist-es/types/index.js -var init_types2 = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/types/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/fromUtf8.js +var fromUtf8; +var init_fromUtf8 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/fromUtf8.js"() { "use strict"; - init_EndpointError(); - init_EndpointFunctions(); - init_EndpointRuleObject2(); - init_ErrorRuleObject2(); - init_RuleSetObject2(); - init_TreeRuleObject2(); - init_shared2(); + init_buffer_from(); + fromUtf8 = (input) => { + const buf = fromString(input, "utf8"); + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); + }; } }); -// node_modules/@smithy/util-endpoints/dist-es/lib/booleanEquals.js -var booleanEquals; -var init_booleanEquals = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/lib/booleanEquals.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/util-base64/toBase64.js +var toBase64; +var init_toBase64 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-base64/toBase64.js"() { "use strict"; - booleanEquals = (value1, value2) => value1 === value2; + init_buffer_from(); + init_fromUtf8(); + toBase64 = (_input) => { + let input; + if (typeof _input === "string") { + input = fromUtf8(_input); + } else { + input = _input; + } + if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") { + throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array."); + } + return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("base64"); + }; } }); -// node_modules/@smithy/util-endpoints/dist-es/lib/getAttrPathList.js -var getAttrPathList; -var init_getAttrPathList = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/lib/getAttrPathList.js"() { - "use strict"; - init_types2(); - getAttrPathList = (path10) => { - const parts = path10.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: '${path10}' 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: '${path10}'`); - } - if (squareBracketIndex !== 0) { - pathList.push(part.slice(0, squareBracketIndex)); - } - pathList.push(arrayIndex); - } else { - pathList.push(part); +// node_modules/@smithy/core/dist-es/submodules/serde/util-stream/blob/Uint8ArrayBlobAdapter.js +function bindUint8ArrayBlobAdapter(toUtf83, fromUtf85, toBase643, fromBase643) { + return class Uint8ArrayBlobAdapter2 extends Uint8Array { + static fromString(source, encoding = "utf-8") { + if (typeof source === "string") { + if (encoding === "base64") { + return Uint8ArrayBlobAdapter2.mutate(fromBase643(source)); } + return Uint8ArrayBlobAdapter2.mutate(fromUtf85(source)); } - return pathList; - }; + throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`); + } + static mutate(source) { + Object.setPrototypeOf(source, Uint8ArrayBlobAdapter2.prototype); + return source; + } + transformToString(encoding = "utf-8") { + if (encoding === "base64") { + return toBase643(this); + } + return toUtf83(this); + } + }; +} +var init_Uint8ArrayBlobAdapter = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-stream/blob/Uint8ArrayBlobAdapter.js"() { + "use strict"; } }); -// node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js -var getAttr; -var init_getAttr = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUtf8.js +var toUtf8; +var init_toUtf8 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUtf8.js"() { "use strict"; - init_types2(); - init_getAttrPathList(); - getAttr = (value, path10) => getAttrPathList(path10).reduce((acc, index2) => { - if (typeof acc !== "object") { - throw new EndpointError(`Index '${index2}' in '${path10}' not found in '${JSON.stringify(value)}'`); - } else if (Array.isArray(acc)) { - return acc[parseInt(index2)]; + init_buffer_from(); + toUtf8 = (input) => { + if (typeof input === "string") { + return input; } - return acc[index2]; - }, value); + if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") { + throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array."); + } + return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("utf8"); + }; } }); -// node_modules/@smithy/util-endpoints/dist-es/lib/isSet.js -var isSet; -var init_isSet = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/lib/isSet.js"() { - "use strict"; - isSet = (value) => value != null; +// node_modules/@smithy/core/dist-es/submodules/serde/uuid/v4.js +function bindV4(getRandomValues2) { + if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") { + return () => crypto.randomUUID(); } -}); - -// node_modules/@smithy/util-endpoints/dist-es/lib/not.js -var not; -var init_not = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/lib/not.js"() { + return () => { + const rnds = new Uint8Array(16); + getRandomValues2(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]]; + }; +} +var decimalToHex; +var init_v4 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/uuid/v4.js"() { "use strict"; - not = (value) => !value; + decimalToHex = Array.from({ length: 256 }, (_3, i6) => i6.toString(16).padStart(2, "0")); } }); -// node_modules/@smithy/util-endpoints/dist-es/lib/parseURL.js -var DEFAULT_PORTS, parseURL2; -var init_parseURL = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/lib/parseURL.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js +var expectNumber, MAX_FLOAT, expectFloat32, expectLong, expectShort, expectByte, expectSizedInt, castInt, strictParseDouble, strictParseFloat32, NUMBER_REGEX, parseNumber, strictParseShort, strictParseByte, stackTraceWarning, logger7; +var init_parse_utils = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js"() { "use strict"; - init_dist_es(); - init_isIpAddress(); - DEFAULT_PORTS = { - [EndpointURLScheme.HTTP]: 80, - [EndpointURLScheme.HTTPS]: 443 - }; - parseURL2 = (value) => { - const whatwgURL = (() => { - try { - if (value instanceof URL) { - return value; - } - if (typeof value === "object" && "hostname" in value) { - const { hostname: hostname2, port, protocol: protocol2 = "", path: path10 = "", query = {} } = value; - const url2 = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path10}`); - url2.search = Object.entries(query).map(([k7, v8]) => `${k7}=${v8}`).join("&"); - return url2; + 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)) { + logger7.warn(stackTraceWarning(`Expected number but observed string: ${value}`)); } - return new URL(value); - } catch (error2) { - return null; + return parsed; } - })(); - 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; + if (typeof value === "number") { + return value; } - const scheme = protocol.slice(0, -1); - if (!Object.values(EndpointURLScheme).includes(scheme)) { - return null; + 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}`); + } } - const isIp = isIpAddress(hostname); - const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`); - const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`; - return { - scheme, - authority, - path: pathname, - normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`, - isIp - }; + return expected; }; - } -}); - -// node_modules/@smithy/util-endpoints/dist-es/lib/stringEquals.js -var stringEquals; -var init_stringEquals = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/lib/stringEquals.js"() { - "use strict"; - stringEquals = (value1, value2) => value1 === value2; - } -}); - -// node_modules/@smithy/util-endpoints/dist-es/lib/substring.js -var substring; -var init_substring = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/lib/substring.js"() { - "use strict"; - substring = (input, start, stop, reverse) => { - if (start >= stop || input.length < stop || /[^\u0000-\u007f]/.test(input)) { - return null; + expectLong = (value) => { + if (value === null || value === void 0) { + return void 0; } - if (!reverse) { - return input.substring(start, stop); + if (Number.isInteger(value) && !Number.isNaN(value)) { + return value; } - return input.substring(input.length - stop, input.length - start); + throw new TypeError(`Expected integer, got ${typeof value}: ${value}`); + }; + 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]; + } + }; + strictParseDouble = (value) => { + if (typeof value == "string") { + return expectNumber(parseNumber(value)); + } + return expectNumber(value); + }; + 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); + }; + 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"); + }; + logger7 = { + warn: console.warn }; } }); -// node_modules/@smithy/util-endpoints/dist-es/lib/uriEncode.js -var uriEncode; -var init_uriEncode = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/lib/uriEncode.js"() { - "use strict"; - uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c6) => `%${c6.charCodeAt(0).toString(16).toUpperCase()}`); - } -}); - -// node_modules/@smithy/util-endpoints/dist-es/lib/index.js -var init_lib2 = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/lib/index.js"() { - "use strict"; - init_booleanEquals(); - init_getAttr(); - init_isSet(); - init_isValidHostLabel(); - init_not(); - init_parseURL(); - init_stringEquals(); - init_substring(); - init_uriEncode(); - } -}); - -// node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js -var endpointFunctions; -var init_endpointFunctions = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js"() { +// 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"() { "use strict"; - init_lib2(); - endpointFunctions = { - booleanEquals, - getAttr, - isSet, - isValidHostLabel, - not, - parseURL: parseURL2, - stringEquals, - substring, - uriEncode + 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 match3 = RFC3339.exec(value); + if (!match3) { + throw new TypeError("Invalid RFC-3339 date-time value"); + } + const [_3, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match3; + 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 match3 = RFC3339_WITH_OFFSET.exec(value); + if (!match3) { + throw new TypeError("Invalid RFC-3339 date-time value"); + } + const [_3, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match3; + 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 match3 = IMF_FIXDATE.exec(value); + if (match3) { + const [_3, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match3; + return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); + } + match3 = RFC_850_DATE.exec(value); + if (match3) { + const [_3, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match3; + return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { + hours, + minutes, + seconds, + fractionalMilliseconds + })); + } + match3 = ASC_TIME.exec(value); + if (match3) { + const [_3, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match3; + 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/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js -var evaluateTemplate; -var init_evaluateTemplate = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js"() { +// 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"() { "use strict"; - init_lib2(); - evaluateTemplate = (template, options) => { - const evaluatedTemplateArr = []; - const templateContext = { - ...options.endpointParams, - ...options.referenceRecord - }; - let currentIndex = 0; - while (currentIndex < template.length) { - const openingBraceIndex = template.indexOf("{", currentIndex); - if (openingBraceIndex === -1) { - evaluatedTemplateArr.push(template.slice(currentIndex)); - break; - } - evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex)); - const closingBraceIndex = template.indexOf("}", openingBraceIndex); - if (closingBraceIndex === -1) { - evaluatedTemplateArr.push(template.slice(openingBraceIndex)); - break; - } - if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") { - evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex)); - currentIndex = closingBraceIndex + 2; - } - const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex); - if (parameterName.includes("#")) { - const [refName, attrName] = parameterName.split("#"); - evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName)); - } else { - evaluatedTemplateArr.push(templateContext[parameterName]); + 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); } - currentIndex = closingBraceIndex + 1; + }); + 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 evaluatedTemplateArr.join(""); + return LazyJsonString(JSON.stringify(object)); }; + LazyJsonString.fromObject = LazyJsonString.from; } }); -// node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js -var getReferenceValue; -var init_getReferenceValue = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js"() { +// 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"() { "use strict"; - getReferenceValue = ({ ref }, options) => { - const referenceRecord = { - ...options.endpointParams, - ...options.referenceRecord - }; - return referenceRecord[ref]; - }; } }); -// node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js -var evaluateExpression, callFunction, group; -var init_evaluateExpression = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js +function range5(v2, min, max) { + const _v2 = Number(v2); + if (_v2 < min || _v2 > max) { + throw new Error(`Value ${_v2} 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"() { "use strict"; - init_types2(); - init_customEndpointFunctions(); - init_endpointFunctions(); - init_evaluateTemplate(); - init_getReferenceValue(); - evaluateExpression = (obj, keyName, options) => { - if (typeof obj === "string") { - return evaluateTemplate(obj, options); - } else if (obj["fn"]) { - return group.callFunction(obj, options); - } else if (obj["ref"]) { - return getReferenceValue(obj, options); + 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, , ms2, offsetStr] = matches; + range5(monthStr, 1, 12); + range5(dayStr, 1, 31); + range5(hours, 0, 23); + range5(minutes, 0, 59); + range5(seconds, 0, 60); + const date2 = new Date(Date.UTC(Number(yearStr), Number(monthStr) - 1, Number(dayStr), Number(hours), Number(minutes), Number(seconds), Number(ms2) ? Math.round(parseFloat(`0.${ms2}`) * 1e3) : 0)); + date2.setUTCFullYear(Number(yearStr)); + if (offsetStr.toUpperCase() != "Z") { + const [, sign2, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [void 0, "+", 0, 0]; + const scalar = sign2 === "-" ? 1 : -1; + date2.setTime(date2.getTime() + scalar * (Number(offsetH) * 60 * 60 * 1e3 + Number(offsetM) * 60 * 1e3)); } - throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`); + return date2; }; - callFunction = ({ fn, argv }, options) => { - const evaluatedArgs = argv.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : group.evaluateExpression(arg, "arg", options)); - const fnSegments = fn.split("."); - if (fnSegments[0] in customEndpointFunctions && fnSegments[1] != null) { - return customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs); + _parseRfc7231DateTime = (value) => { + if (value == null) { + return void 0; } - return endpointFunctions[fn](...evaluatedArgs); - }; - group = { - evaluateExpression, - callFunction + 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); + range5(day, 1, 31); + range5(hour, 0, 23); + range5(minute, 0, 59); + range5(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/util-endpoints/dist-es/utils/callFunction.js -var init_callFunction = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/utils/callFunction.js"() { - "use strict"; - init_evaluateExpression(); +// node_modules/@smithy/core/dist-es/submodules/serde/split-every.js +function splitEvery(value, delimiter2, numDelimiters) { + if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { + throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); } -}); - -// node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js -var evaluateCondition; -var init_evaluateCondition = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js"() { + const segments = value.split(delimiter2); + if (numDelimiters === 1) { + return segments; + } + const compoundSegments = []; + let currentSegment = ""; + for (let i6 = 0; i6 < segments.length; i6++) { + if (currentSegment === "") { + currentSegment = segments[i6]; + } else { + currentSegment += delimiter2 + segments[i6]; + } + if ((i6 + 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"() { "use strict"; - init_debug(); - init_types2(); - init_callFunction(); - evaluateCondition = ({ assign, ...fnArgs }, options) => { - if (assign && assign in options.referenceRecord) { - throw new EndpointError(`'${assign}' is already defined in Reference Record.`); - } - const value = callFunction(fnArgs, options); - options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`); - return { - result: value === "" ? true : !!value, - ...assign != null && { toAssign: { name: assign, value } } - }; - }; } }); -// node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js -var evaluateConditions; -var init_evaluateConditions = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.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"() { "use strict"; - init_debug(); - init_evaluateCondition(); - evaluateConditions = (conditions = [], options) => { - const conditionsReferenceRecord = {}; - for (const condition of conditions) { - const { result, toAssign } = evaluateCondition(condition, { - ...options, - referenceRecord: { - ...options.referenceRecord, - ...conditionsReferenceRecord - } - }); - if (!result) { - return { result }; - } - if (toAssign) { - conditionsReferenceRecord[toAssign.name] = toAssign.value; - options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`); + splitHeader = (value) => { + const z = value.length; + const values = []; + let withinQuotes = false; + let prevChar = void 0; + let anchor = 0; + for (let i6 = 0; i6 < z; ++i6) { + const char = value[i6]; + switch (char) { + case `"`: + if (prevChar !== "\\") { + withinQuotes = !withinQuotes; + } + break; + case ",": + if (!withinQuotes) { + values.push(value.slice(anchor, i6)); + anchor = i6 + 1; + } + break; + default: } + prevChar = char; } - return { result: true, referenceRecord: conditionsReferenceRecord }; + values.push(value.slice(anchor)); + return values.map((v2) => { + v2 = v2.trim(); + const z2 = v2.length; + if (z2 < 2) { + return v2; + } + if (v2[0] === `"` && v2[z2 - 1] === `"`) { + v2 = v2.slice(1, z2 - 1); + } + return v2.replace(/\\"/g, '"'); + }); }; } }); -// node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js -var getEndpointHeaders; -var init_getEndpointHeaders = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js +var format3, NumericValue; +var init_NumericValue = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js"() { "use strict"; - init_types2(); - init_evaluateExpression(); - 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`); + format3 = /^-?\d*(\.\d+)?$/; + NumericValue = class _NumericValue { + string; + type; + constructor(string, type) { + this.string = string; + this.type = type; + if (!format3.test(string)) { + throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`); } - return processedExpr; - }) - }), {}); - } -}); - -// node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js -var getEndpointProperties, getEndpointProperty, group2; -var init_getEndpointProperties = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js"() { - "use strict"; - init_types2(); - init_evaluateTemplate(); - getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({ - ...acc, - [propertyKey]: group2.getEndpointProperty(propertyVal, options) - }), {}); - 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 group2.getEndpointProperties(property, options); - case "boolean": - return property; - default: - throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`); + toString() { + return this.string; } - }; - group2 = { - getEndpointProperty, - getEndpointProperties - }; - } -}); - -// node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointUrl.js -var getEndpointUrl; -var init_getEndpointUrl = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointUrl.js"() { - "use strict"; - init_types2(); - init_evaluateExpression(); - getEndpointUrl = (endpointUrl, options) => { - const expression = evaluateExpression(endpointUrl, "Endpoint URL", options); - if (typeof expression === "string") { - try { - return new URL(expression); - } catch (error2) { - console.error(`Failed to construct URL with ${expression}`, error2); - throw error2; + static [Symbol.hasInstance](object) { + if (!object || typeof object !== "object") { + return false; } + const _nv = object; + return _NumericValue.prototype.isPrototypeOf(object) || _nv.type === "bigDecimal" && format3.test(_nv.string); } - throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`); }; } }); -// node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js -var evaluateEndpointRule; -var init_evaluateEndpointRule = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/util-hex-encoding/hex-encoding.js +function fromHex(encoded) { + if (encoded.length % 2 !== 0) { + throw new Error("Hex encoded strings must have an even number length"); + } + const out = new Uint8Array(encoded.length / 2); + for (let i6 = 0; i6 < encoded.length; i6 += 2) { + const encodedByte = encoded.slice(i6, i6 + 2).toLowerCase(); + if (encodedByte in HEX_TO_SHORT) { + out[i6 / 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 i6 = 0; i6 < bytes.byteLength; i6++) { + out += SHORT_TO_HEX[bytes[i6]]; + } + return out; +} +var SHORT_TO_HEX, HEX_TO_SHORT; +var init_hex_encoding = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-hex-encoding/hex-encoding.js"() { "use strict"; - init_debug(); - init_evaluateConditions(); - init_getEndpointHeaders(); - init_getEndpointProperties(); - init_getEndpointUrl(); - evaluateEndpointRule = (endpointRule, options) => { - const { conditions, endpoint: endpoint2 } = endpointRule; - const { result, referenceRecord } = evaluateConditions(conditions, options); - if (!result) { - return; + SHORT_TO_HEX = {}; + HEX_TO_SHORT = {}; + for (let i6 = 0; i6 < 256; i6++) { + let encodedByte = i6.toString(16).toLowerCase(); + if (encodedByte.length === 1) { + encodedByte = `0${encodedByte}`; } - const endpointRuleOptions = { - ...options, - referenceRecord: { ...options.referenceRecord, ...referenceRecord } - }; - const { url: url2, properties, headers } = endpoint2; - options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint2)}`); - return { - ...headers != void 0 && { - headers: getEndpointHeaders(headers, endpointRuleOptions) - }, - ...properties != void 0 && { - properties: getEndpointProperties(properties, endpointRuleOptions) - }, - url: getEndpointUrl(url2, endpointRuleOptions) - }; - }; + SHORT_TO_HEX[i6] = encodedByte; + HEX_TO_SHORT[encodedByte] = i6; + } } }); -// node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js -var evaluateErrorRule; -var init_evaluateErrorRule = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/util-body-length/calculateBodyLength.js +import { ReadStream, fstatSync, lstatSync as lstatSync3 } from "fs"; +var calculateBodyLength; +var init_calculateBodyLength = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-body-length/calculateBodyLength.js"() { "use strict"; - init_types2(); - init_evaluateConditions(); - init_evaluateExpression(); - evaluateErrorRule = (errorRule, options) => { - const { conditions, error: error2 } = errorRule; - const { result, referenceRecord } = evaluateConditions(conditions, options); - if (!result) { - return; + calculateBodyLength = (body2) => { + if (!body2) { + return 0; } - throw new EndpointError(evaluateExpression(error2, "Error", { - ...options, - referenceRecord: { ...options.referenceRecord, ...referenceRecord } - })); + if (typeof body2 === "string") { + return Buffer.byteLength(body2); + } else if (typeof body2.byteLength === "number") { + return body2.byteLength; + } else if (typeof body2.size === "number") { + return body2.size; + } else if (typeof body2.start === "number" && typeof body2.end === "number") { + return body2.end + 1 - body2.start; + } else if (body2 instanceof ReadStream) { + if (body2.path != null) { + return lstatSync3(body2.path).size; + } else if (typeof body2.fd === "number") { + return fstatSync(body2.fd).size; + } + } + throw new Error(`Body Length computation failed for ${body2}`); }; } }); -// node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js -var evaluateRules, evaluateTreeRule, group3; -var init_evaluateRules = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUint8Array.js +var toUint8Array; +var init_toUint8Array = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUint8Array.js"() { "use strict"; - init_types2(); - init_evaluateConditions(); - init_evaluateEndpointRule(); - init_evaluateErrorRule(); - 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 = group3.evaluateTreeRule(rule, options); - if (endpointOrUndefined) { - return endpointOrUndefined; - } - } else { - throw new EndpointError(`Unknown endpoint rule: ${rule}`); - } + init_fromUtf8(); + toUint8Array = (data) => { + if (typeof data === "string") { + return fromUtf8(data); } - throw new EndpointError(`Rules evaluation failed`); - }; - evaluateTreeRule = (treeRule, options) => { - const { conditions, rules } = treeRule; - const { result, referenceRecord } = evaluateConditions(conditions, options); - if (!result) { - return; + if (ArrayBuffer.isView(data)) { + return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); } - return group3.evaluateRules(rules, { - ...options, - referenceRecord: { ...options.referenceRecord, ...referenceRecord } - }); - }; - group3 = { - evaluateRules, - evaluateTreeRule + return new Uint8Array(data); }; } }); -// node_modules/@smithy/util-endpoints/dist-es/utils/index.js -var init_utils = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/utils/index.js"() { - "use strict"; - init_customEndpointFunctions(); - init_evaluateRules(); - } -}); - -// node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js -var resolveEndpoint; -var init_resolveEndpoint = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/property-provider/ProviderError.js +var ProviderError; +var init_ProviderError = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/property-provider/ProviderError.js"() { "use strict"; - init_debug(); - init_types2(); - init_utils(); - resolveEndpoint = (ruleSetObject, options) => { - const { endpointParams, logger: logger8 } = options; - const { parameters, rules } = ruleSetObject; - options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`); - const paramsWithDefault = Object.entries(parameters).filter(([, v8]) => v8.default != null).map(([k7, v8]) => [k7, v8.default]); - if (paramsWithDefault.length > 0) { - for (const [paramKey, paramDefaultValue] of paramsWithDefault) { - endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue; + ProviderError = class _ProviderError extends Error { + name = "ProviderError"; + tryNextLink; + constructor(message, options = true) { + let logger8; + let tryNextLink = true; + if (typeof options === "boolean") { + logger8 = void 0; + tryNextLink = options; + } else if (options != null && typeof options === "object") { + logger8 = options.logger; + tryNextLink = options.tryNextLink ?? true; } + super(message); + this.tryNextLink = tryNextLink; + Object.setPrototypeOf(this, _ProviderError.prototype); + logger8?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`); } - const requiredParams = Object.entries(parameters).filter(([, v8]) => v8.required).map(([k7]) => k7); - for (const requiredParam of requiredParams) { - if (endpointParams[requiredParam] == null) { - throw new EndpointError(`Missing required parameter: '${requiredParam}'`); - } + static from(error2, options = true) { + return Object.assign(new this(error2.message, options), error2); } - const endpoint2 = evaluateRules(rules, { endpointParams, logger: logger8, referenceRecord: {} }); - options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint2)}`); - return endpoint2; }; } }); -// node_modules/@smithy/util-endpoints/dist-es/index.js -var init_dist_es22 = __esm({ - "node_modules/@smithy/util-endpoints/dist-es/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/property-provider/CredentialsProviderError.js +var CredentialsProviderError; +var init_CredentialsProviderError = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/property-provider/CredentialsProviderError.js"() { "use strict"; - init_EndpointCache(); - init_isIpAddress(); - init_isValidHostLabel(); - init_customEndpointFunctions(); - init_resolveEndpoint(); - init_types2(); + init_ProviderError(); + CredentialsProviderError = class _CredentialsProviderError extends ProviderError { + name = "CredentialsProviderError"; + constructor(message, options = true) { + super(message, options); + Object.setPrototypeOf(this, _CredentialsProviderError.prototype); + } + }; } }); -// node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js -var init_isIpAddress2 = __esm({ - "node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/property-provider/TokenProviderError.js +var TokenProviderError; +var init_TokenProviderError = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/property-provider/TokenProviderError.js"() { "use strict"; - init_dist_es22(); + init_ProviderError(); + TokenProviderError = class _TokenProviderError extends ProviderError { + name = "TokenProviderError"; + constructor(message, options = true) { + super(message, options); + Object.setPrototypeOf(this, _TokenProviderError.prototype); + } + }; } }); -// node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js -var isVirtualHostableS3Bucket; -var init_isVirtualHostableS3Bucket = __esm({ - "node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/property-provider/chain.js +var chain; +var init_chain = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/property-provider/chain.js"() { "use strict"; - init_dist_es22(); - init_isIpAddress2(); - isVirtualHostableS3Bucket = (value, allowSubDomains = false) => { - if (allowSubDomains) { - for (const label of value.split(".")) { - if (!isVirtualHostableS3Bucket(label)) { - return false; + init_ProviderError(); + chain = (...providers) => async () => { + if (providers.length === 0) { + throw new ProviderError("No providers in chain"); + } + let lastProviderError; + for (const provider of providers) { + try { + const credentials = await provider(); + return credentials; + } catch (err) { + lastProviderError = err; + if (err?.tryNextLink) { + continue; } + throw err; } - return true; - } - if (!isValidHostLabel(value)) { - return false; - } - if (value.length < 3 || value.length > 63) { - return false; - } - if (value !== value.toLowerCase()) { - return false; } - if (isIpAddress(value)) { - return false; - } - return true; + throw lastProviderError; }; } }); -// node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js -var ARN_DELIMITER, RESOURCE_DELIMITER, parseArn; -var init_parseArn = __esm({ - "node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/property-provider/fromValue.js +var fromValue; +var init_fromValue = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/property-provider/fromValue.js"() { "use strict"; - ARN_DELIMITER = ":"; - RESOURCE_DELIMITER = "/"; - 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 - }; - }; + fromValue = (staticValue) => () => Promise.resolve(staticValue); } }); -// node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json -var partitions_default; -var init_partitions = __esm({ - "node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json"() { - partitions_default = { - partitions: [{ - id: "aws", - outputs: { - dnsSuffix: "amazonaws.com", - dualStackDnsSuffix: "api.aws", - implicitGlobalRegion: "us-east-1", - name: "aws", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$", - regions: { - "af-south-1": { - description: "Africa (Cape Town)" - }, - "ap-east-1": { - description: "Asia Pacific (Hong Kong)" - }, - "ap-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)" - } +// node_modules/@smithy/core/dist-es/submodules/config/property-provider/memoize.js +var memoize2; +var init_memoize = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/property-provider/memoize.js"() { + "use strict"; + memoize2 = (provider, isExpired, requiresRefresh) => { + let resolved; + let pending; + let hasResult; + let isConstant = false; + const coalesceProvider = async () => { + if (!pending) { + pending = provider(); } - }, { - 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" - } + try { + resolved = await pending; + hasResult = true; + isConstant = false; + } finally { + pending = void 0; } - }, { - 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" + 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(); } - }, { - 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" - } + if (isConstant) { + return resolved; } - }, { - 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" - } + if (requiresRefresh && !requiresRefresh(resolved)) { + isConstant = true; + return resolved; } - }, { - 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)" - } + if (isExpired(resolved)) { + await coalesceProvider(); + return resolved; } - }], - version: "1.1" + return resolved; + }; }; } }); -// node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js -var selectedPartitionsInfo, selectedUserAgentPrefix, partition, getUserAgentPrefix; -var init_partition = __esm({ - "node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/booleanSelector.js +var booleanSelector; +var init_booleanSelector = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/booleanSelector.js"() { "use strict"; - init_partitions(); - selectedPartitionsInfo = partitions_default; - selectedUserAgentPrefix = ""; - partition = (value) => { - const { partitions } = selectedPartitionsInfo; - for (const partition2 of partitions) { - const { regions, outputs } = partition2; - for (const [region, regionData] of Object.entries(regions)) { - if (region === value) { - return { - ...outputs, - ...regionData - }; - } - } - } - for (const partition2 of partitions) { - const { regionRegex, outputs } = partition2; - if (new RegExp(regionRegex).test(value)) { - return { - ...outputs - }; - } - } - const DEFAULT_PARTITION = partitions.find((partition2) => partition2.id === "aws"); - if (!DEFAULT_PARTITION) { - throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist."); - } - return { - ...DEFAULT_PARTITION.outputs - }; + 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]}.`); }; - getUserAgentPrefix = () => selectedUserAgentPrefix; } }); -// node_modules/@aws-sdk/util-endpoints/dist-es/aws.js -var awsEndpointFunctions; -var init_aws = __esm({ - "node_modules/@aws-sdk/util-endpoints/dist-es/aws.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/types.js +var SelectorType; +var init_types = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/types.js"() { "use strict"; - init_dist_es22(); - init_isVirtualHostableS3Bucket(); - init_parseArn(); - init_partition(); - awsEndpointFunctions = { - isVirtualHostableS3Bucket, - parseArn, - partition - }; - customEndpointFunctions.aws = awsEndpointFunctions; + (function(SelectorType2) { + SelectorType2["ENV"] = "env"; + SelectorType2["CONFIG"] = "shared config entry"; + })(SelectorType || (SelectorType = {})); } }); -// node_modules/@aws-sdk/util-endpoints/dist-es/resolveDefaultAwsRegionalEndpointsConfig.js -var init_resolveDefaultAwsRegionalEndpointsConfig = __esm({ - "node_modules/@aws-sdk/util-endpoints/dist-es/resolveDefaultAwsRegionalEndpointsConfig.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getHomeDir.js +import { homedir } from "os"; +import { sep as sep5 } from "path"; +var homeDirCache, getHomeDirCacheKey, getHomeDir; +var init_getHomeDir = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getHomeDir.js"() { "use strict"; + homeDirCache = {}; + getHomeDirCacheKey = () => { + if (process && process.geteuid) { + return `${process.geteuid()}`; + } + return "DEFAULT"; + }; + getHomeDir = () => { + const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${sep5}` } = process.env; + if (HOME) + return HOME; + if (USERPROFILE) + return USERPROFILE; + if (HOMEPATH) + return `${HOMEDRIVE}${HOMEPATH}`; + const homeDirCacheKey = getHomeDirCacheKey(); + if (!homeDirCache[homeDirCacheKey]) + homeDirCache[homeDirCacheKey] = homedir(); + return homeDirCache[homeDirCacheKey]; + }; } }); -// node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js -var init_resolveEndpoint2 = __esm({ - "node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getProfileName.js +var ENV_PROFILE, DEFAULT_PROFILE, getProfileName; +var init_getProfileName = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getProfileName.js"() { "use strict"; + ENV_PROFILE = "AWS_PROFILE"; + DEFAULT_PROFILE = "default"; + getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE; } }); -// node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js -var init_EndpointError2 = __esm({ - "node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getSSOTokenFilepath.js +import { createHash as createHash4 } from "crypto"; +import { join as join5 } from "path"; +var getSSOTokenFilepath; +var init_getSSOTokenFilepath = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getSSOTokenFilepath.js"() { "use strict"; + init_getHomeDir(); + getSSOTokenFilepath = (id) => { + const hasher = createHash4("sha1"); + const cacheName = hasher.update(id).digest("hex"); + return join5(getHomeDir(), ".aws", "sso", "cache", `${cacheName}.json`); + }; } }); -// node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointRuleObject.js -var init_EndpointRuleObject3 = __esm({ - "node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointRuleObject.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getSSOTokenFromFile.js +import { readFile } from "fs/promises"; +var tokenIntercept, getSSOTokenFromFile; +var init_getSSOTokenFromFile = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getSSOTokenFromFile.js"() { "use strict"; + init_getSSOTokenFilepath(); + tokenIntercept = {}; + getSSOTokenFromFile = async (id) => { + if (tokenIntercept[id]) { + return tokenIntercept[id]; + } + const ssoTokenFilepath = getSSOTokenFilepath(id); + const ssoTokenText = await readFile(ssoTokenFilepath, "utf8"); + return JSON.parse(ssoTokenText); + }; } }); -// node_modules/@aws-sdk/util-endpoints/dist-es/types/ErrorRuleObject.js -var init_ErrorRuleObject3 = __esm({ - "node_modules/@aws-sdk/util-endpoints/dist-es/types/ErrorRuleObject.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/constants.js +var CONFIG_PREFIX_SEPARATOR; +var init_constants = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/constants.js"() { "use strict"; + CONFIG_PREFIX_SEPARATOR = "."; } }); -// node_modules/@aws-sdk/util-endpoints/dist-es/types/RuleSetObject.js -var init_RuleSetObject3 = __esm({ - "node_modules/@aws-sdk/util-endpoints/dist-es/types/RuleSetObject.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getConfigData.js +var getConfigData; +var init_getConfigData = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getConfigData.js"() { "use strict"; + init_dist_es(); + init_constants(); + getConfigData = (data) => Object.entries(data).filter(([key]) => { + const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); + if (indexOfSeparator === -1) { + return false; + } + return Object.values(IniSectionType).includes(key.substring(0, indexOfSeparator)); + }).reduce((acc, [key, value]) => { + const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); + const updatedKey = key.substring(0, indexOfSeparator) === IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; + acc[updatedKey] = value; + return acc; + }, { + ...data.default && { default: data.default } + }); } }); -// node_modules/@aws-sdk/util-endpoints/dist-es/types/TreeRuleObject.js -var init_TreeRuleObject3 = __esm({ - "node_modules/@aws-sdk/util-endpoints/dist-es/types/TreeRuleObject.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getConfigFilepath.js +import { join as join6 } from "path"; +var ENV_CONFIG_PATH, getConfigFilepath; +var init_getConfigFilepath = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getConfigFilepath.js"() { "use strict"; + init_getHomeDir(); + ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; + getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join6(getHomeDir(), ".aws", "config"); } }); -// node_modules/@aws-sdk/util-endpoints/dist-es/types/shared.js -var init_shared3 = __esm({ - "node_modules/@aws-sdk/util-endpoints/dist-es/types/shared.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getCredentialsFilepath.js +import { join as join7 } from "path"; +var ENV_CREDENTIALS_PATH, getCredentialsFilepath; +var init_getCredentialsFilepath = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getCredentialsFilepath.js"() { "use strict"; + init_getHomeDir(); + ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; + getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join7(getHomeDir(), ".aws", "credentials"); } }); -// node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js -var init_types3 = __esm({ - "node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/parseIni.js +var prefixKeyRegex, profileNameBlockList, parseIni; +var init_parseIni = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/parseIni.js"() { "use strict"; - init_EndpointError2(); - init_EndpointRuleObject3(); - init_ErrorRuleObject3(); - init_RuleSetObject3(); - init_TreeRuleObject3(); - init_shared3(); + init_dist_es(); + init_constants(); + prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/; + profileNameBlockList = ["__proto__", "profile __proto__"]; + parseIni = (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 [, prefix2, , name] = matches; + if (Object.values(IniSectionType).includes(prefix2)) { + currentSection = [prefix2, 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; + }; } }); -// node_modules/@aws-sdk/util-endpoints/dist-es/index.js -var init_dist_es23 = __esm({ - "node_modules/@aws-sdk/util-endpoints/dist-es/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/readFile.js +import { readFile as fsReadFile } from "fs/promises"; +var filePromises, fileIntercept, readFile2; +var init_readFile = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/readFile.js"() { "use strict"; - init_aws(); - init_partition(); - init_isIpAddress2(); - init_resolveDefaultAwsRegionalEndpointsConfig(); - init_resolveEndpoint2(); - init_types3(); + filePromises = {}; + fileIntercept = {}; + readFile2 = (path10, options) => { + if (fileIntercept[path10] !== void 0) { + return fileIntercept[path10]; + } + if (!filePromises[path10] || options?.ignoreCache) { + filePromises[path10] = fsReadFile(path10, "utf8"); + } + return filePromises[path10]; + }; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js -var state3, emitWarningIfUnsupportedVersion; -var init_emitWarningIfUnsupportedVersion = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/loadSharedConfigFiles.js +import { join as join8 } from "path"; +var swallowError, loadSharedConfigFiles; +var init_loadSharedConfigFiles = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/loadSharedConfigFiles.js"() { "use strict"; - state3 = { - warningEmitted: false - }; - emitWarningIfUnsupportedVersion = (version3) => { - if (version3 && !state3.warningEmitted && parseInt(version3.substring(1, version3.indexOf("."))) < 20) { - state3.warningEmitted = true; - process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will -no longer support Node.js ${version3} in January 2026. - -To continue receiving updates to AWS services, bug fixes, and security -updates please upgrade to a supported Node.js LTS version. - -More information can be found at: https://a.co/c895JFp`); + init_getConfigData(); + init_getConfigFilepath(); + init_getCredentialsFilepath(); + init_getHomeDir(); + init_parseIni(); + init_readFile(); + init_constants(); + swallowError = () => ({}); + loadSharedConfigFiles = async (init = {}) => { + const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init; + const homeDir = getHomeDir(); + const relativeHomeDirPrefix = "~/"; + let resolvedFilepath = filepath; + if (filepath.startsWith(relativeHomeDirPrefix)) { + resolvedFilepath = join8(homeDir, filepath.slice(2)); } + let resolvedConfigFilepath = configFilepath; + if (configFilepath.startsWith(relativeHomeDirPrefix)) { + resolvedConfigFilepath = join8(homeDir, configFilepath.slice(2)); + } + const parsedFiles = await Promise.all([ + readFile2(resolvedConfigFilepath, { + ignoreCache: init.ignoreCache + }).then(parseIni).then(getConfigData).catch(swallowError), + readFile2(resolvedFilepath, { + ignoreCache: init.ignoreCache + }).then(parseIni).catch(swallowError) + ]); + return { + configFile: parsedFiles[0], + credentialsFile: parsedFiles[1] + }; }; } }); -// 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/core/dist-es/submodules/config/shared-ini-file-loader/getSsoSessionData.js +var getSsoSessionData; +var init_getSsoSessionData = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getSsoSessionData.js"() { "use strict"; + init_dist_es(); + init_loadSharedConfigFiles(); + getSsoSessionData = (data) => Object.entries(data).filter(([key]) => key.startsWith(IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)).reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {}); } }); -// node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js -function setFeature2(context5, feature, value) { - if (!context5.__aws_sdk_context) { - context5.__aws_sdk_context = { - features: {} - }; - } else if (!context5.__aws_sdk_context.features) { - context5.__aws_sdk_context.features = {}; - } - context5.__aws_sdk_context.features[feature] = value; -} -var init_setFeature2 = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/loadSsoSessionData.js +var swallowError2, loadSsoSessionData; +var init_loadSsoSessionData = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/loadSsoSessionData.js"() { "use strict"; + init_getConfigFilepath(); + init_getSsoSessionData(); + init_parseIni(); + init_readFile(); + swallowError2 = () => ({}); + loadSsoSessionData = async (init = {}) => readFile2(init.configFilepath ?? getConfigFilepath()).then(parseIni).then(getSsoSessionData).catch(swallowError2); } }); -// 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/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/mergeConfigFiles.js +var mergeConfigFiles; +var init_mergeConfigFiles = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/mergeConfigFiles.js"() { "use strict"; + mergeConfigFiles = (...files) => { + const merged = {}; + for (const file of files) { + for (const [key, values] of Object.entries(file)) { + if (merged[key] !== void 0) { + Object.assign(merged[key], values); + } else { + merged[key] = values; + } + } + } + return merged; + }; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/client/index.js -var init_client2 = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/client/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/parseKnownFiles.js +var parseKnownFiles; +var init_parseKnownFiles = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/parseKnownFiles.js"() { "use strict"; - init_emitWarningIfUnsupportedVersion(); - init_setCredentialFeature(); - init_setFeature2(); - init_setTokenFeature(); + init_loadSharedConfigFiles(); + init_mergeConfigFiles(); + parseKnownFiles = async (init) => { + const parsedFiles = await loadSharedConfigFiles(init); + return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile); + }; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js -var getDateHeader; -var init_getDateHeader = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/externalDataInterceptor.js +var externalDataInterceptor; +var init_externalDataInterceptor = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/externalDataInterceptor.js"() { "use strict"; - init_dist_es2(); - getDateHeader = (response) => HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : void 0; + init_getSSOTokenFromFile(); + init_readFile(); + externalDataInterceptor = { + getFileRecord() { + return fileIntercept; + }, + interceptFile(path10, contents) { + fileIntercept[path10] = Promise.resolve(contents); + }, + getTokenRecord() { + return tokenIntercept; + }, + interceptToken(id, contents) { + tokenIntercept[id] = contents; + } + }; } }); -// 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"() { +// node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/getSelectorName.js +function getSelectorName(functionString) { + try { + const constants4 = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? [])); + constants4.delete("CONFIG"); + constants4.delete("CONFIG_PREFIX_SEPARATOR"); + constants4.delete("ENV"); + return [...constants4].join(", "); + } catch (e6) { + return functionString; + } +} +var init_getSelectorName = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/getSelectorName.js"() { "use strict"; - 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"() { +// node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/fromEnv.js +var fromEnv; +var init_fromEnv = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/fromEnv.js"() { "use strict"; - init_getSkewCorrectedDate(); - isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5; + init_CredentialsProviderError(); + init_getSelectorName(); + fromEnv = (envVarSelector, options) => async () => { + try { + const config = envVarSelector(process.env, options); + if (config === void 0) { + throw new Error(); + } + return config; + } catch (e6) { + throw new CredentialsProviderError(e6.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, { logger: options?.logger }); + } + }; } }); -// 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"() { +// node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/fromSharedConfigFiles.js +var fromSharedConfigFiles; +var init_fromSharedConfigFiles = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/fromSharedConfigFiles.js"() { "use strict"; - init_isClockSkewed(); - getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { - const clockTimeInMs = Date.parse(clockTime); - if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) { - return clockTimeInMs - Date.now(); + init_CredentialsProviderError(); + init_getProfileName(); + init_loadSharedConfigFiles(); + init_getSelectorName(); + fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => { + const profile = getProfileName(init); + const { configFile, credentialsFile } = await 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 (e6) { + throw new CredentialsProviderError(e6.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, { logger: init.logger }); } - return currentSystemClockOffset; }; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js -var init_utils2 = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/fromStatic.js +var isFunction2, fromStatic; +var init_fromStatic = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/fromStatic.js"() { "use strict"; - init_getDateHeader(); - init_getSkewCorrectedDate(); - init_getUpdatedSystemClockOffset(); + init_fromValue(); + isFunction2 = (func) => typeof func === "function"; + fromStatic = (defaultValue) => isFunction2(defaultValue) ? async () => await defaultValue() : fromValue(defaultValue); } }); -// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js -var throwSigningPropertyError, validateSigningProperties, AwsSdkSigV4Signer; -var init_AwsSdkSigV4Signer = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/configLoader.js +var loadConfig; +var init_configLoader = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/configLoader.js"() { "use strict"; - init_dist_es2(); - init_utils2(); - throwSigningPropertyError = (name, property) => { - if (!property) { - throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`); - } - return property; - }; - validateSigningProperties = async (signingProperties) => { - const context5 = throwSigningPropertyError("context", signingProperties.context); - const config = throwSigningPropertyError("config", signingProperties.config); - const authScheme = context5.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(httpRequest2, identity, signingProperties) { - if (!HttpRequest.isInstance(httpRequest2)) { - throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); - } - const validatedProps = await validateSigningProperties(signingProperties); - const { config, signer } = validatedProps; - let { signingRegion, signingName } = validatedProps; - const handlerExecutionContext = signingProperties.context; - if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) { - const [first, second] = handlerExecutionContext.authSchemes; - if (first?.name === "sigv4a" && second?.name === "sigv4") { - signingRegion = second?.signingRegion ?? signingRegion; - signingName = second?.signingName ?? signingName; - } - } - const signedRequest = await signer.sign(httpRequest2, { - signingDate: getSkewCorrectedDate(config.systemClockOffset), - signingRegion, - signingService: signingName - }); - return signedRequest; - } - errorHandler(signingProperties) { - return (error2) => { - const serverTime = error2.ServerTime ?? getDateHeader(error2.$response); - if (serverTime) { - const config = throwSigningPropertyError("config", signingProperties.config); - const initialSystemClockOffset = config.systemClockOffset; - config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset); - const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset; - if (clockSkewCorrected && error2.$metadata) { - error2.$metadata.clockSkewCorrected = true; - } - } - throw error2; - }; - } - successHandler(httpResponse, signingProperties) { - const dateHeader = getDateHeader(httpResponse); - if (dateHeader) { - const config = throwSigningPropertyError("config", signingProperties.config); - config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset); - } - } + init_chain(); + init_memoize(); + init_fromEnv(); + init_fromSharedConfigFiles(); + init_fromStatic(); + loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => { + const { signingName, logger: logger8 } = configuration; + const envOptions = { signingName, logger: logger8 }; + return memoize2(chain(fromEnv(environmentVariableSelector, envOptions), fromSharedConfigFiles(configFileSelector, configuration), fromStatic(defaultValue))); }; } }); -// 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"() { +// node_modules/@smithy/core/dist-es/submodules/config/config-resolver/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js +var ENV_USE_DUALSTACK_ENDPOINT, CONFIG_USE_DUALSTACK_ENDPOINT, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS; +var init_NodeUseDualstackEndpointConfigOptions = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/config-resolver/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js"() { "use strict"; - getArrayForCommaSeparatedString = (str) => typeof str === "string" && str.length > 0 ? str.split(",").map((item) => item.trim()) : []; + init_booleanSelector(); + init_types(); + ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; + CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; + NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env3) => booleanSelector(env3, ENV_USE_DUALSTACK_ENDPOINT, SelectorType.ENV), + configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, SelectorType.CONFIG), + default: false + }; } }); -// 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"() { +// node_modules/@smithy/core/dist-es/submodules/config/config-resolver/endpointsConfig/NodeUseFipsEndpointConfigOptions.js +var ENV_USE_FIPS_ENDPOINT, CONFIG_USE_FIPS_ENDPOINT, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS; +var init_NodeUseFipsEndpointConfigOptions = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/config-resolver/endpointsConfig/NodeUseFipsEndpointConfigOptions.js"() { "use strict"; - getBearerTokenEnvKey = (signingName) => `AWS_BEARER_TOKEN_${signingName.replace(/[\s-]/g, "_").toUpperCase()}`; + init_booleanSelector(); + init_types(); + ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; + CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; + NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env3) => booleanSelector(env3, ENV_USE_FIPS_ENDPOINT, SelectorType.ENV), + configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, SelectorType.CONFIG), + default: false + }; } }); -// 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"() { +// node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/config.js +var REGION_ENV_NAME, REGION_INI_NAME, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS; +var init_config2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/config.js"() { "use strict"; - 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: (env2, options) => { - if (options?.signingName) { - const bearerTokenKey = getBearerTokenEnvKey(options.signingName); - if (bearerTokenKey in env2) - return ["httpBearerAuth"]; - } - if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env2)) - return void 0; - return getArrayForCommaSeparatedString(env2[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: [] + REGION_ENV_NAME = "AWS_REGION"; + REGION_INI_NAME = "region"; + NODE_REGION_CONFIG_OPTIONS = { + environmentVariableSelector: (env3) => env3[REGION_ENV_NAME], + configFileSelector: (profile) => profile[REGION_INI_NAME], + default: () => { + throw new Error("Region is missing"); + } + }; + NODE_REGION_CONFIG_FILE_OPTIONS = { + preferredFile: "credentials" }; } }); -// node_modules/@smithy/property-provider/dist-es/ProviderError.js -var ProviderError; -var init_ProviderError = __esm({ - "node_modules/@smithy/property-provider/dist-es/ProviderError.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/checkRegion.js +var validRegions, checkRegion; +var init_checkRegion = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/checkRegion.js"() { "use strict"; - ProviderError = class _ProviderError extends Error { - name = "ProviderError"; - tryNextLink; - constructor(message, options = true) { - let logger8; - let tryNextLink = true; - if (typeof options === "boolean") { - logger8 = void 0; - tryNextLink = options; - } else if (options != null && typeof options === "object") { - logger8 = options.logger; - tryNextLink = options.tryNextLink ?? true; + init_transport(); + validRegions = /* @__PURE__ */ new Set(); + checkRegion = (region, check = 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.`); } - super(message); - this.tryNextLink = tryNextLink; - Object.setPrototypeOf(this, _ProviderError.prototype); - logger8?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`); - } - static from(error2, options = true) { - return Object.assign(new this(error2.message, options), error2); + } else { + validRegions.add(region); } }; } }); -// node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js -var CredentialsProviderError; -var init_CredentialsProviderError = __esm({ - "node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/isFipsRegion.js +var isFipsRegion; +var init_isFipsRegion = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/isFipsRegion.js"() { "use strict"; - init_ProviderError(); - CredentialsProviderError = class _CredentialsProviderError extends ProviderError { - name = "CredentialsProviderError"; - constructor(message, options = true) { - super(message, options); - Object.setPrototypeOf(this, _CredentialsProviderError.prototype); - } - }; + isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")); } }); -// node_modules/@smithy/property-provider/dist-es/TokenProviderError.js -var TokenProviderError; -var init_TokenProviderError = __esm({ - "node_modules/@smithy/property-provider/dist-es/TokenProviderError.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/getRealRegion.js +var getRealRegion; +var init_getRealRegion = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/getRealRegion.js"() { "use strict"; - init_ProviderError(); - TokenProviderError = class _TokenProviderError extends ProviderError { - name = "TokenProviderError"; - constructor(message, options = true) { - super(message, options); - Object.setPrototypeOf(this, _TokenProviderError.prototype); - } - }; + init_isFipsRegion(); + getRealRegion = (region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region; } }); -// node_modules/@smithy/property-provider/dist-es/chain.js -var chain; -var init_chain = __esm({ - "node_modules/@smithy/property-provider/dist-es/chain.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/resolveRegionConfig.js +var resolveRegionConfig; +var init_resolveRegionConfig = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/resolveRegionConfig.js"() { "use strict"; - init_ProviderError(); - chain = (...providers) => async () => { - if (providers.length === 0) { - throw new ProviderError("No providers in chain"); + init_checkRegion(); + init_getRealRegion(); + init_isFipsRegion(); + resolveRegionConfig = (input) => { + const { region, useFipsEndpoint } = input; + if (!region) { + throw new Error("Region is missing"); } - let lastProviderError; - for (const provider of providers) { - try { - const credentials = await provider(); - return credentials; - } catch (err) { - lastProviderError = err; - if (err?.tryNextLink) { - continue; + 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; } - throw err; + return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); } - } - throw lastProviderError; + }); }; } }); -// node_modules/@smithy/property-provider/dist-es/fromStatic.js -var fromStatic; -var init_fromStatic = __esm({ - "node_modules/@smithy/property-provider/dist-es/fromStatic.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/constants.js +var AWS_EXECUTION_ENV, AWS_REGION_ENV, AWS_DEFAULT_REGION_ENV, ENV_IMDS_DISABLED, DEFAULTS_MODE_OPTIONS, IMDS_REGION_PATH; +var init_constants2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/constants.js"() { "use strict"; - fromStatic = (staticValue) => () => Promise.resolve(staticValue); + AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; + AWS_REGION_ENV = "AWS_REGION"; + AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; + ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; + DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; + IMDS_REGION_PATH = "/latest/meta-data/placement/region"; } }); -// node_modules/@smithy/property-provider/dist-es/memoize.js -var memoize2; -var init_memoize = __esm({ - "node_modules/@smithy/property-provider/dist-es/memoize.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/defaultsModeConfig.js +var AWS_DEFAULTS_MODE_ENV, AWS_DEFAULTS_MODE_CONFIG, NODE_DEFAULTS_MODE_CONFIG_OPTIONS; +var init_defaultsModeConfig = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/defaultsModeConfig.js"() { "use strict"; - memoize2 = (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; - }; + AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE"; + AWS_DEFAULTS_MODE_CONFIG = "defaults_mode"; + NODE_DEFAULTS_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env3) => { + return env3[AWS_DEFAULTS_MODE_ENV]; + }, + configFileSelector: (profile) => { + return profile[AWS_DEFAULTS_MODE_CONFIG]; + }, + default: "legacy" + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/resolveDefaultsModeConfig.js +var resolveDefaultsModeConfig, resolveNodeDefaultsModeAuto, inferPhysicalRegion, getImdsEndpoint, imdsHttpGet; +var init_resolveDefaultsModeConfig = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/resolveDefaultsModeConfig.js"() { + "use strict"; + init_config2(); + init_configLoader(); + init_memoize(); + init_constants2(); + init_defaultsModeConfig(); + resolveDefaultsModeConfig = ({ region = loadConfig(NODE_REGION_CONFIG_OPTIONS), defaultsMode = loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS) } = {}) => memoize2(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}`); } - return async (options) => { - if (!hasResult || options?.forceRefresh) { - resolved = await coalesceProvider(); - } - if (isConstant) { - return resolved; + }); + resolveNodeDefaultsModeAuto = async (clientRegion) => { + if (clientRegion) { + const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion; + const inferredRegion = await inferPhysicalRegion(); + if (!inferredRegion) { + return "standard"; } - if (requiresRefresh && !requiresRefresh(resolved)) { - isConstant = true; - return resolved; + if (resolvedRegion === inferredRegion) { + return "in-region"; + } else { + return "cross-region"; } - if (isExpired(resolved)) { - await coalesceProvider(); - return resolved; + } + return "standard"; + }; + 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 endpoint2 = await getImdsEndpoint(); + return (await imdsHttpGet({ hostname: endpoint2.hostname, path: IMDS_REGION_PATH })).toString(); + } catch (e6) { } - return resolved; - }; + } + }; + getImdsEndpoint = async () => { + const envEndpoint = process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT; + if (envEndpoint) { + const url2 = new URL(envEndpoint); + return { hostname: url2.hostname, path: url2.pathname }; + } + const envMode = process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE; + if (envMode === "IPv6") { + return { hostname: "fd00:ec2::254", path: "/" }; + } + return { hostname: "169.254.169.254", path: "/" }; + }; + imdsHttpGet = async ({ hostname, path: path10 }) => { + const { request: request2 } = await import("http"); + return new Promise((resolve8, reject2) => { + const req = request2({ + method: "GET", + hostname: hostname.replace(/^\[(.+)]$/, "$1"), + path: path10, + timeout: 1e3, + signal: AbortSignal.timeout(1e3) + }); + req.on("error", (err) => { + reject2(err); + req.destroy(); + }); + req.on("timeout", () => { + reject2(new Error("TimeoutError from instance metadata service")); + req.destroy(); + }); + req.on("response", (res) => { + const { statusCode = 400 } = res; + if (statusCode < 200 || 300 <= statusCode) { + reject2(Object.assign(new Error("Error response received from instance metadata service"), { statusCode })); + req.destroy(); + return; + } + const chunks = []; + res.on("data", (chunk) => chunks.push(chunk)); + res.on("end", () => { + resolve8(Buffer.concat(chunks)); + req.destroy(); + }); + }); + req.end(); + }); }; } }); -// node_modules/@smithy/property-provider/dist-es/index.js -var init_dist_es24 = __esm({ - "node_modules/@smithy/property-provider/dist-es/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/config/index.js +var init_config3 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/config/index.js"() { "use strict"; - init_CredentialsProviderError(); init_ProviderError(); + init_CredentialsProviderError(); init_TokenProviderError(); init_chain(); - init_fromStatic(); init_memoize(); + init_booleanSelector(); + init_types(); + init_getProfileName(); + init_getSSOTokenFilepath(); + init_getSSOTokenFromFile(); + init_constants(); + init_loadSsoSessionData(); + init_parseKnownFiles(); + init_externalDataInterceptor(); + init_readFile(); + init_configLoader(); + init_NodeUseDualstackEndpointConfigOptions(); + init_NodeUseFipsEndpointConfigOptions(); + init_config2(); + init_resolveRegionConfig(); + init_resolveDefaultsModeConfig(); } }); -// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js -var init_resolveAwsSdkSigV4AConfig = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.js +var ENV_ENDPOINT_URL, CONFIG_ENDPOINT_URL, getEndpointUrlConfig; +var init_getEndpointUrlConfig = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.js"() { "use strict"; + init_config3(); + ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL"; + CONFIG_ENDPOINT_URL = "endpoint_url"; + getEndpointUrlConfig = (serviceId) => ({ + environmentVariableSelector: (env3) => { + const serviceSuffixParts = serviceId.split(" ").map((w) => w.toUpperCase()); + const serviceEndpointUrl = env3[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")]; + if (serviceEndpointUrl) + return serviceEndpointUrl; + const endpointUrl = env3[ENV_ENDPOINT_URL]; + if (endpointUrl) + return endpointUrl; + return void 0; + }, + configFileSelector: (profile, config) => { + if (config && profile.services) { + const servicesSection = config[["services", profile.services].join(CONFIG_PREFIX_SEPARATOR)]; + if (servicesSection) { + const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase()); + const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)]; + if (endpointUrl2) + return endpointUrl2; + } + } + const endpointUrl = profile[CONFIG_ENDPOINT_URL]; + if (endpointUrl) + return endpointUrl; + return void 0; + }, + default: void 0 + }); } }); -// node_modules/@smithy/signature-v4/dist-es/constants.js -var ALGORITHM_QUERY_PARAM, CREDENTIAL_QUERY_PARAM, AMZ_DATE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, EXPIRES_QUERY_PARAM, SIGNATURE_QUERY_PARAM, TOKEN_QUERY_PARAM, AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER, GENERATED_HEADERS, SIGNATURE_HEADER, SHA256_HEADER, TOKEN_HEADER, ALWAYS_UNSIGNABLE_HEADERS, PROXY_HEADER_PATTERN, SEC_HEADER_PATTERN, ALGORITHM_IDENTIFIER, EVENT_ALGORITHM_IDENTIFIER, UNSIGNED_PAYLOAD, MAX_CACHE_SIZE, KEY_TYPE_IDENTIFIER, MAX_PRESIGNED_TTL; -var init_constants2 = __esm({ - "node_modules/@smithy/signature-v4/dist-es/constants.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromConfig.js +var getEndpointFromConfig; +var init_getEndpointFromConfig = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromConfig.js"() { "use strict"; - ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; - CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; - AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; - SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; - EXPIRES_QUERY_PARAM = "X-Amz-Expires"; - SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; - TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; - AUTH_HEADER = "authorization"; - AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase(); - DATE_HEADER = "date"; - GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER]; - SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase(); - SHA256_HEADER = "x-amz-content-sha256"; - TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase(); - ALWAYS_UNSIGNABLE_HEADERS = { - authorization: true, - "cache-control": true, - connection: true, - expect: true, - from: true, - "keep-alive": true, - "max-forwards": true, - pragma: true, - referer: true, - te: true, - trailer: true, - "transfer-encoding": true, - upgrade: true, - "user-agent": true, - "x-amzn-trace-id": true - }; - PROXY_HEADER_PATTERN = /^proxy-/; - SEC_HEADER_PATTERN = /^sec-/; - ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; - EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; - UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; - MAX_CACHE_SIZE = 50; - KEY_TYPE_IDENTIFIER = "aws4_request"; - MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; + init_config3(); + init_getEndpointUrlConfig(); + getEndpointFromConfig = async (serviceId) => loadConfig(getEndpointUrlConfig(serviceId ?? ""))(); } }); -// node_modules/@smithy/signature-v4/dist-es/credentialDerivation.js -var signingKeyCache, cacheQueue, createScope, getSigningKey, hmac; -var init_credentialDerivation = __esm({ - "node_modules/@smithy/signature-v4/dist-es/credentialDerivation.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/service-customizations/s3.js +var resolveParamsForS3, DOMAIN_PATTERN, IP_ADDRESS_PATTERN, DOTS_PATTERN, isDnsCompatibleBucketName, isArnBucketName; +var init_s3 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/service-customizations/s3.js"() { "use strict"; - init_dist_es16(); - init_dist_es10(); - init_constants2(); - signingKeyCache = {}; - cacheQueue = []; - createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`; - getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => { - const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); - const cacheKey = `${shortDate}:${region}:${service}:${toHex(credsHash)}:${credentials.sessionToken}`; - if (cacheKey in signingKeyCache) { - return signingKeyCache[cacheKey]; + resolveParamsForS3 = async (endpointParams) => { + const bucket = endpointParams?.Bucket || ""; + if (typeof endpointParams.Bucket === "string") { + endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?")); } - cacheQueue.push(cacheKey); - while (cacheQueue.length > MAX_CACHE_SIZE) { - delete signingKeyCache[cacheQueue.shift()]; + 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; } - let key = `AWS4${credentials.secretAccessKey}`; - for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) { - key = await hmac(sha256Constructor, key, signable); + if (endpointParams.DisableMultiRegionAccessPoints) { + endpointParams.disableMultiRegionAccessPoints = true; + endpointParams.DisableMRAP = true; } - return signingKeyCache[cacheKey] = key; + return endpointParams; }; - hmac = (ctor, secret, data) => { - const hash = new ctor(secret); - hash.update(toUint8Array(data)); - return hash.digest(); + DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; + IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; + DOTS_PATTERN = /\.\./; + isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName); + isArnBucketName = (bucketName) => { + const [arn, partition2, service, , , bucket] = bucketName.split(":"); + const isArn = arn === "arn" && bucketName.split(":").length >= 6; + const isValidArn = Boolean(isArn && partition2 && service && bucket); + if (isArn && !isValidArn) { + throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`); + } + return isValidArn; }; } }); -// node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js -var getCanonicalHeaders; -var init_getCanonicalHeaders = __esm({ - "node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/service-customizations/index.js +var init_service_customizations = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/service-customizations/index.js"() { "use strict"; - init_constants2(); - 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; - }; + init_s3(); } }); -// node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js -var getPayloadHash; -var init_getPayloadHash = __esm({ - "node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/createConfigValueProvider.js +var createConfigValueProvider; +var init_createConfigValueProvider = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/createConfigValueProvider.js"() { "use strict"; - init_dist_es8(); - init_dist_es16(); - init_dist_es10(); - init_constants2(); - getPayloadHash = async ({ headers, body: body2 }, hashConstructor) => { - for (const headerName of Object.keys(headers)) { - if (headerName.toLowerCase() === SHA256_HEADER) { - return headers[headerName]; + 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 (body2 == void 0) { - return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; - } else if (typeof body2 === "string" || ArrayBuffer.isView(body2) || isArrayBuffer2(body2)) { - const hashCtor = new hashConstructor(); - hashCtor.update(toUint8Array(body2)); - return toHex(await hashCtor.digest()); + 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; + }; } - return UNSIGNED_PAYLOAD; + if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { + return async () => { + if (config.isCustomEndpoint === false) { + return void 0; + } + const endpoint2 = await configProvider(); + if (endpoint2 && typeof endpoint2 === "object") { + if ("url" in endpoint2) { + return endpoint2.url.href; + } + if ("hostname" in endpoint2) { + const { protocol, hostname, port, path: path10 } = endpoint2; + return `${protocol}//${hostname}${port ? ":" + port : ""}${path10}`; + } + } + return endpoint2; + }; + } + return configProvider; }; } }); -// node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js -function negate(bytes) { - for (let i6 = 0; i6 < 8; i6++) { - bytes[i6] ^= 255; - } - for (let i6 = 7; i6 > -1; i6--) { - bytes[i6]++; - if (bytes[i6] !== 0) - break; - } -} -var HeaderFormatter, HEADER_VALUE_TYPE, UUID_PATTERN, Int64; -var init_HeaderFormatter = __esm({ - "node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/toEndpointV1.js +var init_toEndpointV12 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/toEndpointV1.js"() { "use strict"; - init_dist_es16(); - init_dist_es10(); - HeaderFormatter = class { - format(headers) { - const chunks = []; - for (const headerName of Object.keys(headers)) { - const bytes = fromUtf8(headerName); - chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName])); - } - const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0)); - let position = 0; - for (const chunk of chunks) { - out.set(chunk, position); - position += chunk.byteLength; - } - return out; + init_transport(); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromInstructions.js +function bindGetEndpointFromInstructions(getEndpointFromConfig2) { + return async (commandInput, instructionsSupplier, clientConfig, context5) => { + if (!clientConfig.isCustomEndpoint) { + let endpointFromConfig; + if (clientConfig.serviceConfiguredEndpoint) { + endpointFromConfig = await clientConfig.serviceConfiguredEndpoint(); + } else { + endpointFromConfig = await getEndpointFromConfig2(clientConfig.serviceId); } - formatHeaderValue(header) { - switch (header.type) { - case "boolean": - return Uint8Array.from([header.value ? 0 : 1]); - case "byte": - return Uint8Array.from([2, header.value]); - case "short": - const shortView = new DataView(new ArrayBuffer(3)); - shortView.setUint8(0, 3); - shortView.setInt16(1, header.value, false); - return new Uint8Array(shortView.buffer); - case "integer": - const intView = new DataView(new ArrayBuffer(5)); - intView.setUint8(0, 4); - intView.setInt32(1, header.value, false); - return new Uint8Array(intView.buffer); - case "long": - const longBytes = new Uint8Array(9); - longBytes[0] = 5; - longBytes.set(header.value.bytes, 1); - return longBytes; - case "binary": - const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength)); - binView.setUint8(0, 6); - binView.setUint16(1, header.value.byteLength, false); - const binBytes = new Uint8Array(binView.buffer); - binBytes.set(header.value, 3); - return binBytes; - case "string": - const utf8Bytes = fromUtf8(header.value); - const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength)); - strView.setUint8(0, 7); - strView.setUint16(1, utf8Bytes.byteLength, false); - const strBytes = new Uint8Array(strView.buffer); - strBytes.set(utf8Bytes, 3); - return strBytes; - case "timestamp": - const tsBytes = new Uint8Array(9); - tsBytes[0] = 8; - tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1); - return tsBytes; - case "uuid": - if (!UUID_PATTERN.test(header.value)) { - throw new Error(`Invalid UUID received: ${header.value}`); - } - const uuidBytes = new Uint8Array(17); - uuidBytes[0] = 9; - uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1); - return uuidBytes; - } + if (endpointFromConfig) { + clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig)); + clientConfig.isCustomEndpoint = true; } - }; - (function(HEADER_VALUE_TYPE3) { - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolTrue"] = 0] = "boolTrue"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolFalse"] = 1] = "boolFalse"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byte"] = 2] = "byte"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["short"] = 3] = "short"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["integer"] = 4] = "integer"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["long"] = 5] = "long"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byteArray"] = 6] = "byteArray"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["string"] = 7] = "string"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["timestamp"] = 8] = "timestamp"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["uuid"] = 9] = "uuid"; - })(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {})); - UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; - Int64 = class _Int64 { - bytes; - constructor(bytes) { - this.bytes = bytes; - if (bytes.byteLength !== 8) { - throw new Error("Int64 buffers must be exactly 8 bytes"); + } + const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig); + if (typeof clientConfig.endpointProvider !== "function") { + throw new Error("config.endpointProvider is not set."); + } + const endpoint2 = clientConfig.endpointProvider(endpointParams, context5); + if (clientConfig.isCustomEndpoint && clientConfig.endpoint) { + const customEndpoint = await clientConfig.endpoint(); + if (customEndpoint?.headers) { + endpoint2.headers ??= {}; + for (const [name, value] of Object.entries(customEndpoint.headers)) { + endpoint2.headers[name] = Array.isArray(value) ? value : [value]; } } - 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 i6 = 7, remaining = Math.abs(Math.round(number)); i6 > -1 && remaining > 0; i6--, remaining /= 256) { - bytes[i6] = remaining; - } - if (number < 0) { - negate(bytes); + } + return endpoint2; + }; +} +var resolveParams; +var init_getEndpointFromInstructions = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromInstructions.js"() { + "use strict"; + init_service_customizations(); + init_createConfigValueProvider(); + init_toEndpointV12(); + resolveParams = 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)); } - return new _Int64(bytes); } - valueOf() { - const bytes = this.bytes.slice(0); - const negative = bytes[0] & 128; - if (negative) { - negate(bytes); - } - return parseInt(toHex(bytes), 16) * (negative ? -1 : 1); + if (Object.keys(instructions).length === 0) { + Object.assign(endpointParams, clientConfig); } - toString() { - return String(this.valueOf()); + if (String(clientConfig.serviceId).toLowerCase() === "s3") { + await resolveParamsForS3(endpointParams); } + return endpointParams; }; } }); -// node_modules/@smithy/signature-v4/dist-es/headerUtil.js -var hasHeader; -var init_headerUtil = __esm({ - "node_modules/@smithy/signature-v4/dist-es/headerUtil.js"() { - "use strict"; - hasHeader = (soughtHeader, headers) => { - soughtHeader = soughtHeader.toLowerCase(); - for (const headerName of Object.keys(headers)) { - if (soughtHeader === headerName.toLowerCase()) { - return true; - } - } - return false; - }; +// node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/endpointMiddleware.js +function setFeature(context5, feature, value) { + if (!context5.__smithy_context) { + context5.__smithy_context = { features: {} }; + } else if (!context5.__smithy_context.features) { + context5.__smithy_context.features = {}; } -}); - -// node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js -var moveHeadersToQuery; -var init_moveHeadersToQuery = __esm({ - "node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js"() { - "use strict"; - init_dist_es2(); - moveHeadersToQuery = (request3, options = {}) => { - const { headers, query = {} } = HttpRequest.clone(request3); - 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]; + context5.__smithy_context.features[feature] = value; +} +function bindEndpointMiddleware(getEndpointFromConfig2) { + const getEndpointFromInstructions2 = bindGetEndpointFromInstructions(getEndpointFromConfig2); + return ({ config, instructions }) => { + return (next, context5) => async (args) => { + if (config.isCustomEndpoint) { + setFeature(context5, "ENDPOINT_OVERRIDE", "N"); + } + const endpoint2 = await getEndpointFromInstructions2(args.input, { + getEndpointParameterInstructions() { + return instructions; + } + }, { ...config }, context5); + context5.endpointV2 = endpoint2; + context5.authSchemes = endpoint2.properties?.authSchemes; + const authScheme = context5.authSchemes?.[0]; + if (authScheme) { + context5["signing_region"] = authScheme.signingRegion; + context5["signing_service"] = authScheme.signingName; + const smithyContext = getSmithyContext(context5); + 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 { - ...request3, - headers, - query - }; + return next({ + ...args + }); }; + }; +} +var init_endpointMiddleware = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/endpointMiddleware.js"() { + "use strict"; + init_client3(); + init_getEndpointFromInstructions(); } }); -// node_modules/@smithy/signature-v4/dist-es/prepareRequest.js -var prepareRequest; -var init_prepareRequest = __esm({ - "node_modules/@smithy/signature-v4/dist-es/prepareRequest.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/getEndpointPlugin.js +function bindGetEndpointPlugin(getEndpointFromConfig2) { + const endpointMiddleware2 = bindEndpointMiddleware(getEndpointFromConfig2); + return (config, instructions) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(endpointMiddleware2({ + config, + instructions + }), endpointMiddlewareOptions); + } + }); +} +var serializerMiddlewareOption2, endpointMiddlewareOptions; +var init_getEndpointPlugin = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/getEndpointPlugin.js"() { "use strict"; - init_dist_es2(); - init_constants2(); - prepareRequest = (request3) => { - request3 = HttpRequest.clone(request3); - for (const headerName of Object.keys(request3.headers)) { - if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { - delete request3.headers[headerName]; - } - } - return request3; + init_endpointMiddleware(); + serializerMiddlewareOption2 = { + name: "serializerMiddleware", + step: "serialize", + tags: ["SERIALIZER"], + override: true + }; + endpointMiddlewareOptions = { + step: "serialize", + tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], + name: "endpointV2Middleware", + override: true, + relation: "before", + toMiddleware: serializerMiddlewareOption2.name }; } }); -// node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js -var getCanonicalQuery; -var init_getCanonicalQuery = __esm({ - "node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js"() { - "use strict"; - init_dist_es12(); - init_constants2(); - getCanonicalQuery = ({ query = {} }) => { - const keys = []; - const serialized = {}; - for (const key of Object.keys(query)) { - if (key.toLowerCase() === SIGNATURE_HEADER) { - continue; - } - const encodedKey = escapeUri(key); - keys.push(encodedKey); - const value = query[key]; - if (typeof value === "string") { - serialized[encodedKey] = `${encodedKey}=${escapeUri(value)}`; - } else if (Array.isArray(value)) { - serialized[encodedKey] = value.slice(0).reduce((encoded, value2) => encoded.concat([`${encodedKey}=${escapeUri(value2)}`]), []).sort().join("&"); - } +// node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/resolveEndpointConfig.js +function bindResolveEndpointConfig(getEndpointFromConfig2) { + return (input) => { + const tls = input.tls ?? true; + const { endpoint: endpoint2, useDualstackEndpoint, useFipsEndpoint } = input; + const customEndpointProvider = endpoint2 != null ? async () => toEndpointV1(await normalizeProvider(endpoint2)()) : void 0; + const isCustomEndpoint = !!endpoint2; + const resolvedConfig = Object.assign(input, { + endpoint: customEndpointProvider, + tls, + isCustomEndpoint, + useDualstackEndpoint: normalizeProvider(useDualstackEndpoint ?? false), + useFipsEndpoint: normalizeProvider(useFipsEndpoint ?? false) + }); + let configuredEndpointPromise = void 0; + resolvedConfig.serviceConfiguredEndpoint = async () => { + if (input.serviceId && !configuredEndpointPromise) { + configuredEndpointPromise = getEndpointFromConfig2(input.serviceId); } - return keys.sort().map((key) => serialized[key]).filter((serialized2) => serialized2).join("&"); + return configuredEndpointPromise; }; + return resolvedConfig; + }; +} +var init_resolveEndpointConfig = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/resolveEndpointConfig.js"() { + "use strict"; + init_transport(); + init_toEndpointV12(); } }); -// node_modules/@smithy/signature-v4/dist-es/utilDate.js -var iso8601, toDate; -var init_utilDate = __esm({ - "node_modules/@smithy/signature-v4/dist-es/utilDate.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/bdd/BinaryDecisionDiagram.js +var BinaryDecisionDiagram; +var init_BinaryDecisionDiagram = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/bdd/BinaryDecisionDiagram.js"() { "use strict"; - iso8601 = (time2) => toDate(time2).toISOString().replace(/\.\d{3}Z$/, "Z"); - toDate = (time2) => { - if (typeof time2 === "number") { - return new Date(time2 * 1e3); + BinaryDecisionDiagram = class _BinaryDecisionDiagram { + nodes; + root; + conditions; + results; + constructor(bdd6, root6, conditions, results) { + this.nodes = bdd6; + this.root = root6; + this.conditions = conditions; + this.results = results; } - if (typeof time2 === "string") { - if (Number(time2)) { - return new Date(Number(time2) * 1e3); - } - return new Date(time2); + static from(bdd6, root6, conditions, results) { + return new _BinaryDecisionDiagram(bdd6, root6, conditions, results); } - return time2; }; } }); -// node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js -var SignatureV4Base; -var init_SignatureV4Base = __esm({ - "node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/cache/EndpointCache.js +var EndpointCache; +var init_EndpointCache = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/cache/EndpointCache.js"() { "use strict"; - init_dist_es16(); - init_dist_es7(); - init_dist_es12(); - init_dist_es10(); - init_getCanonicalQuery(); - init_utilDate(); - 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 = normalizeProvider(region); - this.credentialProvider = normalizeProvider(credentials); - } - createCanonicalRequest(request3, canonicalHeaders, payloadHash) { - const sortedHeaders = Object.keys(canonicalHeaders).sort(); - return `${request3.method} -${this.getCanonicalPath(request3)} -${getCanonicalQuery(request3)} -${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} - -${sortedHeaders.join(";")} -${payloadHash}`; - } - async createStringToSign(longDate, credentialScope, canonicalRequest, algorithmIdentifier) { - const hash = new this.sha256(); - hash.update(toUint8Array(canonicalRequest)); - const hashedRequest = await hash.digest(); - return `${algorithmIdentifier} -${longDate} -${credentialScope} -${toHex(hashedRequest)}`; + EndpointCache = class { + capacity; + data = /* @__PURE__ */ new Map(); + parameters = []; + constructor({ size, params }) { + this.capacity = size ?? 50; + if (params) { + this.parameters = params; + } } - getCanonicalPath({ path: path10 }) { - if (this.uriEscapePath) { - const normalizedPathSegments = []; - for (const pathSegment of path10.split("/")) { - if (pathSegment?.length === 0) - continue; - if (pathSegment === ".") - continue; - if (pathSegment === "..") { - normalizedPathSegments.pop(); - } else { - normalizedPathSegments.push(pathSegment); + 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 i6 = 0; + while (true) { + const { value, done } = keys.next(); + this.data.delete(value); + if (done || ++i6 > 10) { + break; + } } } - const normalizedPath = `${path10?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path10?.endsWith("/") ? "/" : ""}`; - const doubleEncoded = escapeUri(normalizedPath); - return doubleEncoded.replace(/%2F/g, "/"); - } - return path10; - } - validateResolvedCredentials(credentials) { - if (typeof credentials !== "object" || typeof credentials.accessKeyId !== "string" || typeof credentials.secretAccessKey !== "string") { - throw new Error("Resolved credential object is not valid"); + this.data.set(key, resolver()); } + return this.data.get(key); } - formatDate(now) { - const longDate = iso8601(now).replace(/[\-:]/g, ""); - return { - longDate, - shortDate: longDate.slice(0, 8) - }; + size() { + return this.data.size; } - getCanonicalHeaderList(headers) { - return Object.keys(headers).sort().join(";"); + hash(endpointParams) { + let buffer2 = ""; + const { parameters } = this; + if (parameters.length === 0) { + return false; + } + for (const param of parameters) { + const val = String(endpointParams[param] ?? ""); + if (val.includes("|;")) { + return false; + } + buffer2 += val + "|;"; + } + return buffer2; } }; } }); -// node_modules/@smithy/signature-v4/dist-es/SignatureV4.js -var SignatureV4; -var init_SignatureV4 = __esm({ - "node_modules/@smithy/signature-v4/dist-es/SignatureV4.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointError.js +var EndpointError; +var init_EndpointError = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointError.js"() { "use strict"; - init_dist_es16(); - init_dist_es10(); - init_constants2(); - init_credentialDerivation(); - init_getCanonicalHeaders(); - init_getPayloadHash(); - init_HeaderFormatter(); - init_headerUtil(); - init_moveHeadersToQuery(); - init_prepareRequest(); - init_SignatureV4Base(); - SignatureV4 = 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 request3 = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders, hoistableHeaders }); - if (credentials.sessionToken) { - request3.query[TOKEN_QUERY_PARAM] = credentials.sessionToken; - } - request3.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER; - request3.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; - request3.query[AMZ_DATE_QUERY_PARAM] = longDate; - request3.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10); - const canonicalHeaders = getCanonicalHeaders(request3, unsignableHeaders, signableHeaders); - request3.query[SIGNED_HEADERS_QUERY_PARAM] = this.getCanonicalHeaderList(canonicalHeaders); - request3.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request3, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256))); - return request3; - } - 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 }, { signingDate = /* @__PURE__ */ new Date(), priorSignature, signingRegion, signingService }) { - 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: payload }, this.sha256); - const hash = new this.sha256(); - hash.update(headers); - const hashedHeaders = toHex(await hash.digest()); - const stringToSign = [ - EVENT_ALGORITHM_IDENTIFIER, - longDate, - scope, - priorSignature, - hashedHeaders, - hashedPayload - ].join("\n"); - return this.signString(stringToSign, { signingDate, signingRegion: region, signingService }); - } - async signMessage(signableMessage, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService }) { - const promise = this.signEvent({ - headers: this.headerFormatter.format(signableMessage.message.headers), - payload: signableMessage.message.body - }, { - signingDate, - signingRegion, - signingService, - priorSignature: signableMessage.priorSignature - }); - return promise.then((signature) => { - return { message: signableMessage.message, signature }; - }); - } - async signString(stringToSign, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService } = {}) { - const credentials = await this.credentialProvider(); - this.validateResolvedCredentials(credentials); - const region = signingRegion ?? await this.regionProvider(); - const { shortDate } = this.formatDate(signingDate); - const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); - hash.update(toUint8Array(stringToSign)); - return toHex(await hash.digest()); - } - async signRequest(requestToSign, { signingDate = /* @__PURE__ */ new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService } = {}) { - const credentials = await this.credentialProvider(); - this.validateResolvedCredentials(credentials); - const region = signingRegion ?? await this.regionProvider(); - const request3 = prepareRequest(requestToSign); - const { longDate, shortDate } = this.formatDate(signingDate); - const scope = createScope(shortDate, region, signingService ?? this.service); - request3.headers[AMZ_DATE_HEADER] = longDate; - if (credentials.sessionToken) { - request3.headers[TOKEN_HEADER] = credentials.sessionToken; - } - const payloadHash = await getPayloadHash(request3, this.sha256); - if (!hasHeader(SHA256_HEADER, request3.headers) && this.applyChecksum) { - request3.headers[SHA256_HEADER] = payloadHash; - } - const canonicalHeaders = getCanonicalHeaders(request3, unsignableHeaders, signableHeaders); - const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request3, canonicalHeaders, payloadHash)); - request3.headers[AUTH_HEADER] = `${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${this.getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`; - return request3; - } - 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(toUint8Array(stringToSign)); - return toHex(await hash.digest()); - } - getSigningKey(credentials, region, shortDate, service) { - return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service); + EndpointError = class extends Error { + constructor(message) { + super(message); + this.name = "EndpointError"; } }; } }); -// node_modules/@smithy/signature-v4/dist-es/signature-v4a-container.js -var init_signature_v4a_container = __esm({ - "node_modules/@smithy/signature-v4/dist-es/signature-v4a-container.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointFunctions.js +var init_EndpointFunctions = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointFunctions.js"() { + "use strict"; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointRuleObject.js +var init_EndpointRuleObject2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointRuleObject.js"() { + "use strict"; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/ErrorRuleObject.js +var init_ErrorRuleObject2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/ErrorRuleObject.js"() { + "use strict"; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/RuleSetObject.js +var init_RuleSetObject2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/RuleSetObject.js"() { "use strict"; } }); -// node_modules/@smithy/signature-v4/dist-es/index.js -var init_dist_es25 = __esm({ - "node_modules/@smithy/signature-v4/dist-es/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/TreeRuleObject.js +var init_TreeRuleObject2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/TreeRuleObject.js"() { "use strict"; - init_SignatureV4(); - init_constants2(); - init_credentialDerivation(); - init_signature_v4a_container(); } }); -// 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 = normalizeProvider2(credentialDefaultProvider(Object.assign({}, config, { - parentClientConfig: config - }))); - } else { - credentialsProvider = async () => { - throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured."); - }; - } +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/shared.js +var init_shared2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/shared.js"() { + "use strict"; } - credentialsProvider.memoized = true; - return credentialsProvider; -} -function bindCallerConfig(config, credentialsProvider) { - if (credentialsProvider.configBound) { - return credentialsProvider; +}); + +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/index.js +var init_types2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/index.js"() { + "use strict"; + init_EndpointError(); + init_EndpointFunctions(); + init_EndpointRuleObject2(); + init_ErrorRuleObject2(); + init_RuleSetObject2(); + init_TreeRuleObject2(); + init_shared2(); } - const fn = async (options) => credentialsProvider({ ...options, callerClientConfig: config }); - fn.memoized = credentialsProvider.memoized; - fn.configBound = true; - return fn; +}); + +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/debugId.js +var debugId; +var init_debugId = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/debugId.js"() { + "use strict"; + debugId = "endpoints"; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/toDebugString.js +function toDebugString(input) { + if (typeof input !== "object" || input == null) { + return input; + } + if ("ref" in input) { + return `$${toDebugString(input.ref)}`; + } + if ("fn" in input) { + return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`; + } + return JSON.stringify(input, null, 2); } -var resolveAwsSdkSigV4Config; -var init_resolveAwsSdkSigV4Config = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js"() { +var init_toDebugString = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/toDebugString.js"() { "use strict"; - init_client2(); - init_dist_es21(); - init_dist_es25(); - 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 = normalizeProvider2(config.signer); - } else if (config.regionInfoProvider) { - signer = () => normalizeProvider2(config.region)().then(async (region) => [ - await config.regionInfoProvider(region, { - useFipsEndpoint: await config.useFipsEndpoint(), - useDualstackEndpoint: await config.useDualstackEndpoint() - }) || {}, - region - ]).then(([regionInfo, region]) => { - const { signingRegion, signingService } = regionInfo; - config.signingRegion = config.signingRegion || signingRegion || region; - config.signingName = config.signingName || signingService || config.serviceId; - const params = { - ...config, - credentials: config.credentials, - region: config.signingRegion, - service: config.signingName, - sha256, - uriEscapePath: signingEscapePath - }; - const SignerCtor = config.signerConstructor || SignatureV4; - return new SignerCtor(params); - }); - } else { - signer = async (authScheme) => { - authScheme = Object.assign({}, { - name: "sigv4", - signingName: config.signingName || config.defaultSigningName, - signingRegion: await normalizeProvider2(config.region)(), - properties: {} - }, authScheme); - const signingRegion = authScheme.signingRegion; - const signingService = authScheme.signingName; - config.signingRegion = config.signingRegion || signingRegion; - config.signingName = config.signingName || signingService || config.serviceId; - const params = { - ...config, - credentials: config.credentials, - region: config.signingRegion, - service: config.signingName, - sha256, - uriEscapePath: signingEscapePath - }; - const SignerCtor = config.signerConstructor || SignatureV4; - return new SignerCtor(params); - }; - } - const resolvedConfig = Object.assign(config, { - systemClockOffset, - signingEscapePath, - signer - }); - return resolvedConfig; - }; } }); -// 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"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/index.js +var init_debug = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/index.js"() { "use strict"; - init_AwsSdkSigV4Signer(); - init_NODE_AUTH_SCHEME_PREFERENCE_OPTIONS(); - init_resolveAwsSdkSigV4AConfig(); - init_resolveAwsSdkSigV4Config(); + init_debugId(); + init_toDebugString(); } }); -// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js -var init_httpAuthSchemes2 = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/customEndpointFunctions.js +var customEndpointFunctions; +var init_customEndpointFunctions = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/customEndpointFunctions.js"() { "use strict"; - init_aws_sdk(); - init_getBearerTokenEnvKey(); + customEndpointFunctions = {}; } }); -// node_modules/@smithy/middleware-stack/dist-es/MiddlewareStack.js -var getAllAliases, getMiddlewareNameWithAliases, constructStack, stepWeights, priorityWeights; -var init_MiddlewareStack = __esm({ - "node_modules/@smithy/middleware-stack/dist-es/MiddlewareStack.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/booleanEquals.js +var booleanEquals; +var init_booleanEquals = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/booleanEquals.js"() { "use strict"; - getAllAliases = (name, aliases) => { - const _aliases = []; - if (name) { - _aliases.push(name); - } - if (aliases) { - for (const alias of aliases) { - _aliases.push(alias); - } - } - return _aliases; - }; - getMiddlewareNameWithAliases = (name, aliases) => { - return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`; - }; - constructStack = () => { - let absoluteEntries = []; - let relativeEntries = []; - let identifyOnResolve = false; - const entriesNameSet = /* @__PURE__ */ new Set(); - const sort = (entries) => entries.sort((a6, b6) => stepWeights[b6.step] - stepWeights[a6.step] || priorityWeights[b6.priority || "normal"] - priorityWeights[a6.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 = (debug2 = 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 (debug2) { - 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((a6) => a6 === 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((a6) => a6 === 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: tags2, name, aliases: _aliases } = entry; - if (tags2 && tags2.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: (handler2, context5) => { - for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) { - handler2 = middleware(handler2, context5); - } - if (identifyOnResolve) { - console.log(stack.identify()); - } - return handler2; - } - }; - return stack; - }; - stepWeights = { - initialize: 5, - serialize: 4, - build: 3, - finalizeRequest: 2, - deserialize: 1 - }; - priorityWeights = { - high: 3, - normal: 2, - low: 1 - }; + booleanEquals = (value1, value2) => value1 === value2; } }); -// node_modules/@smithy/middleware-stack/dist-es/index.js -var init_dist_es26 = __esm({ - "node_modules/@smithy/middleware-stack/dist-es/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/coalesce.js +function coalesce(...args) { + for (const arg of args) { + if (arg != null) { + return arg; + } + } + return void 0; +} +var init_coalesce = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/coalesce.js"() { "use strict"; - init_MiddlewareStack(); } }); -// node_modules/@smithy/smithy-client/dist-es/client.js -var Client; -var init_client3 = __esm({ - "node_modules/@smithy/smithy-client/dist-es/client.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttrPathList.js +var getAttrPathList; +var init_getAttrPathList = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttrPathList.js"() { "use strict"; - init_dist_es26(); - Client = class { - config; - middlewareStack = constructStack(); - initConfig; - handlers; - constructor(config) { - this.config = config; - const { protocol, protocolSettings } = config; - if (protocolSettings) { - if (typeof protocol === "function") { - config.protocol = new protocol(protocolSettings); + init_types2(); + getAttrPathList = (path10) => { + const parts = path10.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: '${path10}' does not end with ']'`); } - } - } - 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 handler2; - if (useHandlerCache) { - if (!this.handlers) { - this.handlers = /* @__PURE__ */ new WeakMap(); + const arrayIndex = part.slice(squareBracketIndex + 1, -1); + if (Number.isNaN(parseInt(arrayIndex))) { + throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path10}'`); } - const handlers = this.handlers; - if (handlers.has(command.constructor)) { - handler2 = handlers.get(command.constructor); - } else { - handler2 = command.resolveMiddleware(this.middlewareStack, this.config, options); - handlers.set(command.constructor, handler2); + if (squareBracketIndex !== 0) { + pathList.push(part.slice(0, squareBracketIndex)); } + pathList.push(arrayIndex); } else { - delete this.handlers; - handler2 = command.resolveMiddleware(this.middlewareStack, this.config, options); - } - if (callback) { - handler2(command).then((result) => callback(null, result.output), (err) => callback(err)).catch(() => { - }); - } else { - return handler2(command).then((result) => result.output); + pathList.push(part); } } - destroy() { - this.config?.requestHandler?.destroy?.(); - delete this.handlers; - } + return pathList; }; } }); -// node_modules/@smithy/smithy-client/dist-es/collect-stream-body.js -var init_collect_stream_body2 = __esm({ - "node_modules/@smithy/smithy-client/dist-es/collect-stream-body.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttr.js +var getAttr; +var init_getAttr = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttr.js"() { "use strict"; - init_protocols(); + init_types2(); + init_getAttrPathList(); + getAttr = (value, path10) => getAttrPathList(path10).reduce((acc, index2) => { + if (typeof acc !== "object") { + throw new EndpointError(`Index '${index2}' in '${path10}' not found in '${JSON.stringify(value)}'`); + } else if (Array.isArray(acc)) { + const i6 = parseInt(index2); + return acc[i6 < 0 ? acc.length + i6 : i6]; + } + return acc[index2]; + }, value); } }); -// node_modules/@smithy/smithy-client/dist-es/schemaLogFilter.js -function schemaLogFilter(schema, data) { - if (data == null) { - return data; +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/isSet.js +var isSet; +var init_isSet = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/isSet.js"() { + "use strict"; + isSet = (value) => value != null; } - const ns2 = NormalizedSchema.of(schema); - if (ns2.getMergedTraits().sensitive) { - return SENSITIVE_STRING; +}); + +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/ite.js +function ite(condition, trueValue, falseValue) { + return condition ? trueValue : falseValue; +} +var init_ite = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/ite.js"() { + "use strict"; } - if (ns2.isListSchema()) { - const isSensitive = !!ns2.getValueSchema().getMergedTraits().sensitive; - if (isSensitive) { - return SENSITIVE_STRING; - } - } else if (ns2.isMapSchema()) { - const isSensitive = !!ns2.getKeySchema().getMergedTraits().sensitive || !!ns2.getValueSchema().getMergedTraits().sensitive; - if (isSensitive) { - return SENSITIVE_STRING; - } - } else if (ns2.isStructSchema() && typeof data === "object") { - const object = data; - const newObject = {}; - for (const [member2, memberNs] of ns2.structIterator()) { - if (object[member2] != null) { - newObject[member2] = schemaLogFilter(memberNs, object[member2]); - } - } - return newObject; +}); + +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/not.js +var not; +var init_not = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/not.js"() { + "use strict"; + not = (value) => !value; } - return data; -} -var SENSITIVE_STRING; -var init_schemaLogFilter = __esm({ - "node_modules/@smithy/smithy-client/dist-es/schemaLogFilter.js"() { +}); + +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/isIpAddress.js +var IP_V4_REGEX, isIpAddress; +var init_isIpAddress = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/isIpAddress.js"() { "use strict"; - init_schema2(); - SENSITIVE_STRING = "***SensitiveInformation***"; + IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`); + isIpAddress = (value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]"); } }); -// node_modules/@smithy/smithy-client/dist-es/command.js -var Command2, ClassBuilder; -var init_command2 = __esm({ - "node_modules/@smithy/smithy-client/dist-es/command.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/parseURL.js +var DEFAULT_PORTS, parseURL2; +var init_parseURL = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/parseURL.js"() { "use strict"; - init_dist_es26(); init_dist_es(); - init_schemaLogFilter(); - Command2 = class { - 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: logger8 } = configuration; - const handlerExecutionContext = { - logger: logger8, - clientName, - commandName, - inputFilterSensitiveLog, - outputFilterSensitiveLog, - [SMITHY_CONTEXT_KEY]: { - commandInstance: this, - ...smithyContext - }, - ...additionalContext - }; - const { requestHandler } = configuration; - return stack.resolve((request3) => requestHandler.handle(request3.request, options || {}), handlerExecutionContext); - } + init_isIpAddress(); + DEFAULT_PORTS = { + [EndpointURLScheme.HTTP]: 80, + [EndpointURLScheme.HTTPS]: 443 }; - 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 = (_3) => _3, outputFilter = (_3) => _3) { - 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; + parseURL2 = (value) => { + const whatwgURL = (() => { + try { + if (value instanceof URL) { + return value; } - resolveMiddleware(stack, configuration, options) { - const op = closure._operationSchema; - const input = op?.[4] ?? op?.input; - const output = op?.[5] ?? op?.output; - return this.resolveMiddlewareWithContext(stack, configuration, options, { - CommandCtor: CommandRef, - middlewareFn: closure._middlewareFn, - clientName: closure._clientName, - commandName: closure._commandName, - inputFilterSensitiveLog: closure._inputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, input) : (_3) => _3), - outputFilterSensitiveLog: closure._outputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, output) : (_3) => _3), - smithyContext: closure._smithyContext, - additionalContext: closure._additionalContext - }); + if (typeof value === "object" && "hostname" in value) { + const { hostname: hostname2, port, protocol: protocol2 = "", path: path10 = "", query = {} } = value; + const url2 = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path10}`); + url2.search = Object.entries(query).map(([k7, v2]) => `${k7}=${v2}`).join("&"); + return url2; } - serialize = closure._serializer; - deserialize = closure._deserializer; - }; + return new URL(value); + } catch (error2) { + return null; + } + })(); + if (!whatwgURL) { + console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`); + return null; + } + const urlString = whatwgURL.href; + const { host, hostname, pathname, protocol, search } = whatwgURL; + if (search) { + return null; + } + const scheme = protocol.slice(0, -1); + if (!Object.values(EndpointURLScheme).includes(scheme)) { + return null; } + const isIp = isIpAddress(hostname); + const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`); + const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`; + return { + scheme, + authority, + path: pathname, + normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`, + isIp + }; }; } }); -// node_modules/@smithy/smithy-client/dist-es/constants.js -var init_constants3 = __esm({ - "node_modules/@smithy/smithy-client/dist-es/constants.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/split.js +function split(value, delimiter2, limit) { + if (limit === 1) { + return [value]; + } + if (value === "") { + return [""]; + } + const parts = value.split(delimiter2); + if (limit === 0) { + return parts; + } + return parts.slice(0, limit - 1).concat(parts.slice(1).join(delimiter2)); +} +var init_split = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/split.js"() { "use strict"; } }); -// node_modules/@smithy/smithy-client/dist-es/create-aggregated-client.js -var createAggregatedClient; -var init_create_aggregated_client = __esm({ - "node_modules/@smithy/smithy-client/dist-es/create-aggregated-client.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/stringEquals.js +var stringEquals; +var init_stringEquals = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/stringEquals.js"() { "use strict"; - createAggregatedClient = (commands6, Client2, options) => { - for (const [command, CommandCtor] of Object.entries(commands6)) { - 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$/, ""); - Client2.prototype[methodName] = methodImpl; - } - const { paginators: paginators2 = {}, waiters = {} } = options ?? {}; - for (const [paginatorName, paginatorFn] of Object.entries(paginators2)) { - if (Client2.prototype[paginatorName] === void 0) { - Client2.prototype[paginatorName] = function(commandInput = {}, paginationConfiguration, ...rest) { - return paginatorFn({ - ...paginationConfiguration, - client: this - }, commandInput, ...rest); - }; - } - } - for (const [waiterName, waiterFn] of Object.entries(waiters)) { - if (Client2.prototype[waiterName] === void 0) { - Client2.prototype[waiterName] = async function(commandInput = {}, waiterConfiguration, ...rest) { - let config = waiterConfiguration; - if (typeof waiterConfiguration === "number") { - config = { - maxWaitTime: waiterConfiguration - }; - } - return waiterFn({ - ...config, - client: this - }, commandInput, ...rest); - }; - } - } - }; + stringEquals = (value1, value2) => value1 === value2; } }); -// node_modules/@smithy/smithy-client/dist-es/exceptions.js -var ServiceException, decorateServiceException; -var init_exceptions = __esm({ - "node_modules/@smithy/smithy-client/dist-es/exceptions.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/substring.js +var substring; +var init_substring = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/substring.js"() { "use strict"; - 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"); + substring = (input, start, stop, reverse) => { + if (input == null || start >= stop || input.length < stop || /[^\u0000-\u007f]/.test(input)) { + return null; } - 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; + if (!reverse) { + return input.substring(start, stop); } - }; - decorateServiceException = (exception, additions = {}) => { - Object.entries(additions).filter(([, v8]) => v8 !== void 0).forEach(([k7, v8]) => { - if (exception[k7] == void 0 || exception[k7] === "") { - exception[k7] = v8; - } - }); - const message = exception.message || exception.Message || "UnknownError"; - exception.message = message; - delete exception.Message; - return exception; + return input.substring(input.length - stop, input.length - start); }; } }); -// node_modules/@smithy/smithy-client/dist-es/default-error-handler.js -var init_default_error_handler = __esm({ - "node_modules/@smithy/smithy-client/dist-es/default-error-handler.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/uriEncode.js +var uriEncode; +var init_uriEncode = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/uriEncode.js"() { "use strict"; + uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c6) => `%${c6.charCodeAt(0).toString(16).toUpperCase()}`); } }); -// node_modules/@smithy/smithy-client/dist-es/defaults-mode.js -var loadConfigsForDefaultMode; -var init_defaults_mode = __esm({ - "node_modules/@smithy/smithy-client/dist-es/defaults-mode.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/index.js +var init_lib5 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/index.js"() { "use strict"; - loadConfigsForDefaultMode = (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 {}; - } + init_booleanEquals(); + init_coalesce(); + init_getAttr(); + init_isSet(); + init_transport(); + init_ite(); + init_not(); + init_parseURL(); + init_split(); + init_stringEquals(); + init_substring(); + init_uriEncode(); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/endpointFunctions.js +var endpointFunctions; +var init_endpointFunctions = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/endpointFunctions.js"() { + "use strict"; + init_lib5(); + endpointFunctions = { + booleanEquals, + coalesce, + getAttr, + isSet, + isValidHostLabel, + ite, + not, + parseURL: parseURL2, + split, + stringEquals, + substring, + uriEncode }; } }); -// node_modules/@smithy/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js -var warningEmitted, emitWarningIfUnsupportedVersion2; -var init_emitWarningIfUnsupportedVersion2 = __esm({ - "node_modules/@smithy/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateTemplate.js +var evaluateTemplate; +var init_evaluateTemplate = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateTemplate.js"() { "use strict"; - warningEmitted = false; - emitWarningIfUnsupportedVersion2 = (version3) => { - if (version3 && !warningEmitted && parseInt(version3.substring(1, version3.indexOf("."))) < 16) { - warningEmitted = true; + init_lib5(); + 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(""); }; } }); -// node_modules/@smithy/smithy-client/dist-es/extended-encode-uri-component.js -var init_extended_encode_uri_component2 = __esm({ - "node_modules/@smithy/smithy-client/dist-es/extended-encode-uri-component.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getReferenceValue.js +var getReferenceValue; +var init_getReferenceValue = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getReferenceValue.js"() { "use strict"; + getReferenceValue = ({ ref }, options) => { + return options.referenceRecord[ref] ?? options.endpointParams[ref]; + }; } }); -// node_modules/@smithy/smithy-client/dist-es/extensions/checksum.js -var knownAlgorithms, getChecksumConfiguration, resolveChecksumRuntimeConfig; -var init_checksum3 = __esm({ - "node_modules/@smithy/smithy-client/dist-es/extensions/checksum.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateExpression.js +var evaluateExpression, callFunction, group; +var init_evaluateExpression = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateExpression.js"() { "use strict"; - init_dist_es(); - knownAlgorithms = Object.values(AlgorithmId); - getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - for (const id in AlgorithmId) { - const algorithmId = AlgorithmId[id]; - if (runtimeConfig[algorithmId] === void 0) { - continue; - } - checksumAlgorithms.push({ - algorithmId: () => algorithmId, - checksumConstructor: () => runtimeConfig[algorithmId] - }); + init_types2(); + init_customEndpointFunctions(); + init_endpointFunctions(); + init_evaluateTemplate(); + init_getReferenceValue(); + evaluateExpression = (obj, keyName, options) => { + if (typeof obj === "string") { + return evaluateTemplate(obj, options); + } else if (obj["fn"]) { + return group.callFunction(obj, options); + } else if (obj["ref"]) { + return getReferenceValue(obj, options); } - for (const [id, ChecksumCtor] of Object.entries(runtimeConfig.checksumAlgorithms ?? {})) { - checksumAlgorithms.push({ - algorithmId: () => id, - checksumConstructor: () => ChecksumCtor - }); + throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`); + }; + callFunction = ({ fn, argv }, options) => { + const evaluatedArgs = Array(argv.length); + for (let i6 = 0; i6 < evaluatedArgs.length; ++i6) { + const arg = argv[i6]; + if (typeof arg === "boolean" || typeof arg === "number") { + evaluatedArgs[i6] = arg; + } else { + evaluatedArgs[i6] = group.evaluateExpression(arg, "arg", options); + } } - 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; + const namespaceSeparatorIndex = fn.indexOf("."); + if (namespaceSeparatorIndex !== -1) { + const namespaceFunctions = customEndpointFunctions[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.`); }; - resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - const id = checksumAlgorithm.algorithmId(); - if (knownAlgorithms.includes(id)) { - runtimeConfig[id] = checksumAlgorithm.checksumConstructor(); - } - }); - return runtimeConfig; + group = { + evaluateExpression, + callFunction + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/callFunction.js +var init_callFunction = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/callFunction.js"() { + "use strict"; + init_evaluateExpression(); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateCondition.js +var evaluateCondition; +var init_evaluateCondition = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateCondition.js"() { + "use strict"; + init_debug(); + init_types2(); + init_callFunction(); + 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 }; }; } }); -// node_modules/@smithy/smithy-client/dist-es/extensions/retry.js -var getRetryConfiguration, resolveRetryRuntimeConfig; -var init_retry2 = __esm({ - "node_modules/@smithy/smithy-client/dist-es/extensions/retry.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getEndpointHeaders.js +var getEndpointHeaders; +var init_getEndpointHeaders = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getEndpointHeaders.js"() { "use strict"; - getRetryConfiguration = (runtimeConfig) => { - return { - setRetryStrategy(retryStrategy) { - runtimeConfig.retryStrategy = retryStrategy; - }, - retryStrategy() { - return runtimeConfig.retryStrategy; + init_types2(); + init_evaluateExpression(); + 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`); } - }; - }; - resolveRetryRuntimeConfig = (retryStrategyConfiguration) => { - const runtimeConfig = {}; - runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy(); - return runtimeConfig; - }; + return processedExpr; + }); + return acc; + }, {}); } }); -// node_modules/@smithy/smithy-client/dist-es/extensions/defaultExtensionConfiguration.js -var getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig; -var init_defaultExtensionConfiguration2 = __esm({ - "node_modules/@smithy/smithy-client/dist-es/extensions/defaultExtensionConfiguration.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getEndpointProperties.js +var getEndpointProperties, getEndpointProperty, group2; +var init_getEndpointProperties = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getEndpointProperties.js"() { "use strict"; - init_checksum3(); - init_retry2(); - getDefaultExtensionConfiguration = (runtimeConfig) => { - return Object.assign(getChecksumConfiguration(runtimeConfig), getRetryConfiguration(runtimeConfig)); + init_types2(); + init_evaluateTemplate(); + getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => { + acc[propertyKey] = group2.getEndpointProperty(propertyVal, options); + return acc; + }, {}); + 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 group2.getEndpointProperties(property, options); + case "boolean": + return property; + default: + throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`); + } }; - resolveDefaultRuntimeConfig = (config) => { - return Object.assign(resolveChecksumRuntimeConfig(config), resolveRetryRuntimeConfig(config)); + group2 = { + getEndpointProperty, + getEndpointProperties }; } }); -// node_modules/@smithy/smithy-client/dist-es/extensions/index.js -var init_extensions3 = __esm({ - "node_modules/@smithy/smithy-client/dist-es/extensions/index.js"() { - "use strict"; - init_defaultExtensionConfiguration2(); - } -}); - -// node_modules/@smithy/smithy-client/dist-es/get-array-if-single-item.js -var init_get_array_if_single_item = __esm({ - "node_modules/@smithy/smithy-client/dist-es/get-array-if-single-item.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getEndpointUrl.js +var getEndpointUrl; +var init_getEndpointUrl = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getEndpointUrl.js"() { "use strict"; + init_types2(); + init_evaluateExpression(); + getEndpointUrl = (endpointUrl, options) => { + const expression = evaluateExpression(endpointUrl, "Endpoint URL", options); + if (typeof expression === "string") { + try { + return new URL(expression); + } catch (error2) { + console.error(`Failed to construct URL with ${expression}`, error2); + throw error2; + } + } + throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`); + }; } }); -// node_modules/@smithy/smithy-client/dist-es/get-value-from-text-node.js -var getValueFromTextNode; -var init_get_value_from_text_node = __esm({ - "node_modules/@smithy/smithy-client/dist-es/get-value-from-text-node.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/decideEndpoint.js +var RESULT, decideEndpoint; +var init_decideEndpoint = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/decideEndpoint.js"() { "use strict"; - getValueFromTextNode = (obj) => { - const textNodeName = "#text"; - for (const key in obj) { - if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== void 0) { - obj[key] = obj[key][textNodeName]; - } else if (typeof obj[key] === "object" && obj[key] !== null) { - obj[key] = getValueFromTextNode(obj[key]); - } + init_types2(); + init_evaluateCondition(); + init_evaluateExpression(); + init_getEndpointHeaders(); + init_getEndpointProperties(); + init_getEndpointUrl(); + RESULT = 1e8; + decideEndpoint = (bdd6, options) => { + const { nodes: nodes6, root: root6, results, conditions } = bdd6; + let ref = root6; + 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] = [nodes6[node_i], nodes6[node_i + 1], nodes6[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 [url2, properties, headers] = result; + return { + url: getEndpointUrl(url2, closure), + properties: getEndpointProperties(properties, closure), + headers: getEndpointHeaders(headers ?? {}, closure) + }; } - return obj; + throw new EndpointError(`No matching endpoint.`); }; } }); -// node_modules/@smithy/smithy-client/dist-es/is-serializable-header-value.js -var init_is_serializable_header_value = __esm({ - "node_modules/@smithy/smithy-client/dist-es/is-serializable-header-value.js"() { +// node_modules/@smithy/core/dist-es/submodules/endpoints/index.js +var getEndpointFromInstructions, resolveEndpointConfig, endpointMiddleware, getEndpointPlugin; +var init_endpoints3 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/endpoints/index.js"() { "use strict"; + init_getEndpointFromConfig(); + init_getEndpointFromInstructions(); + init_endpointMiddleware(); + init_getEndpointPlugin(); + init_resolveEndpointConfig(); + init_BinaryDecisionDiagram(); + init_EndpointCache(); + init_decideEndpoint(); + init_isIpAddress(); + init_transport(); + init_customEndpointFunctions(); + init_types2(); + init_getEndpointFromInstructions(); + getEndpointFromInstructions = bindGetEndpointFromInstructions(getEndpointFromConfig); + resolveEndpointConfig = bindResolveEndpointConfig(getEndpointFromConfig); + endpointMiddleware = bindEndpointMiddleware(getEndpointFromConfig); + getEndpointPlugin = bindGetEndpointPlugin(getEndpointFromConfig); } }); -// node_modules/@smithy/smithy-client/dist-es/NoOpLogger.js -var NoOpLogger; -var init_NoOpLogger = __esm({ - "node_modules/@smithy/smithy-client/dist-es/NoOpLogger.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/hash-node/hash-node.js +import { createHash as createHash5, createHmac as createHmac5 } from "crypto"; +function castSourceData(toCast, encoding) { + if (Buffer.isBuffer(toCast)) { + return toCast; + } + if (typeof toCast === "string") { + return fromString(toCast, encoding); + } + if (ArrayBuffer.isView(toCast)) { + return fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength); + } + return fromArrayBuffer(toCast); +} +var Hash; +var init_hash_node = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/hash-node/hash-node.js"() { "use strict"; - NoOpLogger = class { - trace() { - } - debug() { + init_buffer_from(); + init_toUint8Array(); + Hash = class { + algorithmIdentifier; + secret; + hash; + constructor(algorithmIdentifier, secret) { + this.algorithmIdentifier = algorithmIdentifier; + this.secret = secret; + this.reset(); } - info() { + update(toHash, encoding) { + this.hash.update(toUint8Array(castSourceData(toHash, encoding))); } - warn() { + digest() { + return Promise.resolve(this.hash.digest()); } - error() { + reset() { + this.hash = this.secret ? createHmac5(this.algorithmIdentifier, castSourceData(this.secret)) : createHash5(this.algorithmIdentifier); } }; } }); -// node_modules/@smithy/smithy-client/dist-es/object-mapping.js -var init_object_mapping = __esm({ - "node_modules/@smithy/smithy-client/dist-es/object-mapping.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-type-check.js +var isReadableStream3; +var init_stream_type_check = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-type-check.js"() { "use strict"; + isReadableStream3 = (stream5) => typeof ReadableStream === "function" && (stream5?.constructor?.name === ReadableStream.name || stream5 instanceof ReadableStream); } }); -// node_modules/@smithy/smithy-client/dist-es/resolve-path.js -var init_resolve_path2 = __esm({ - "node_modules/@smithy/smithy-client/dist-es/resolve-path.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/fromUtf8.browser.js +var fromUtf82; +var init_fromUtf8_browser = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/fromUtf8.browser.js"() { "use strict"; + fromUtf82 = (input) => new TextEncoder().encode(input); } }); -// node_modules/@smithy/smithy-client/dist-es/ser-utils.js -var init_ser_utils = __esm({ - "node_modules/@smithy/smithy-client/dist-es/ser-utils.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/util-base64/constants-for-browser.js +var chars, alphabetByEncoding, alphabetByValue, bitsPerLetter, bitsPerByte, maxLetterValue; +var init_constants_for_browser = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-base64/constants-for-browser.js"() { "use strict"; + chars = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`; + alphabetByEncoding = Object.entries(chars).reduce((acc, [i6, c6]) => { + acc[c6] = Number(i6); + return acc; + }, {}); + alphabetByValue = chars.split(""); + bitsPerLetter = 6; + bitsPerByte = 8; + maxLetterValue = 63; } }); -// node_modules/@smithy/smithy-client/dist-es/serde-json.js -var init_serde_json = __esm({ - "node_modules/@smithy/smithy-client/dist-es/serde-json.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/util-base64/toBase64.browser.js +function toBase642(_input) { + let input; + if (typeof _input === "string") { + input = fromUtf82(_input); + } else { + input = _input; + } + const isArrayLike2 = typeof input === "object" && typeof input.length === "number"; + const isUint8Array = typeof input === "object" && typeof input.byteOffset === "number" && typeof input.byteLength === "number"; + if (!isArrayLike2 && !isUint8Array) { + throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array."); + } + let str = ""; + for (let i6 = 0; i6 < input.length; i6 += 3) { + let bits = 0; + let bitLength = 0; + for (let j7 = i6, limit = Math.min(i6 + 3, input.length); j7 < limit; j7++) { + bits |= input[j7] << (limit - j7 - 1) * bitsPerByte; + bitLength += bitsPerByte; + } + const bitClusterCount = Math.ceil(bitLength / bitsPerLetter); + bits <<= bitClusterCount * bitsPerLetter - bitLength; + for (let k7 = 1; k7 <= bitClusterCount; k7++) { + const offset = (bitClusterCount - k7) * bitsPerLetter; + str += alphabetByValue[(bits & maxLetterValue << offset) >> offset]; + } + str += "==".slice(0, 4 - bitClusterCount); + } + return str; +} +var init_toBase64_browser = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-base64/toBase64.browser.js"() { "use strict"; + init_fromUtf8_browser(); + init_constants_for_browser(); } }); -// node_modules/@smithy/smithy-client/dist-es/index.js -var init_dist_es27 = __esm({ - "node_modules/@smithy/smithy-client/dist-es/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUtf8.browser.js +var toUtf82; +var init_toUtf8_browser = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUtf8.browser.js"() { "use strict"; - init_client3(); - init_collect_stream_body2(); - init_command2(); - init_constants3(); - init_create_aggregated_client(); - init_default_error_handler(); - init_defaults_mode(); - init_emitWarningIfUnsupportedVersion2(); - init_exceptions(); - init_extended_encode_uri_component2(); - init_extensions3(); - init_get_array_if_single_item(); - init_get_value_from_text_node(); - init_is_serializable_header_value(); - init_NoOpLogger(); - init_object_mapping(); - init_resolve_path2(); - init_ser_utils(); - init_serde_json(); - init_serde2(); + toUtf82 = (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 new TextDecoder("utf-8").decode(input); + }; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js -var ProtocolLib; -var init_ProtocolLib = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/util-base64/fromBase64.browser.js +var fromBase642; +var init_fromBase64_browser = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-base64/fromBase64.browser.js"() { "use strict"; - init_schema2(); - init_dist_es27(); - ProtocolLib = class { - queryCompat; - constructor(queryCompat = false) { - this.queryCompat = queryCompat; + init_constants_for_browser(); + fromBase642 = (input) => { + let totalByteLength = input.length / 4 * 3; + if (input.slice(-2) === "==") { + totalByteLength -= 2; + } else if (input.slice(-1) === "=") { + totalByteLength--; } - resolveRestContentType(defaultContentType, inputSchema) { - const members = inputSchema.getMemberSchemas(); - const httpPayloadMember = Object.values(members).find((m6) => { - return !!m6.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"; + const out = new ArrayBuffer(totalByteLength); + const dataView = new DataView(out); + for (let i6 = 0; i6 < input.length; i6 += 4) { + let bits = 0; + let bitLength = 0; + for (let j7 = i6, limit = i6 + 3; j7 <= limit; j7++) { + if (input[j7] !== "=") { + if (!(input[j7] in alphabetByEncoding)) { + throw new TypeError(`Invalid character ${input[j7]} in base64 string.`); + } + bits |= alphabetByEncoding[input[j7]] << (limit - j7) * bitsPerLetter; + bitLength += bitsPerLetter; } else { - return defaultContentType; - } - } else if (!inputSchema.isUnitSchema()) { - const hasBody = Object.values(members).find((m6) => { - const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m6.getMergedTraits(); - const noPrefixHeaders = httpPrefixHeaders === void 0; - return !httpQuery && !httpQueryParams && !httpHeader && !httpLabel && noPrefixHeaders; - }); - if (hasBody) { - return defaultContentType; - } - } - } - async getErrorSchemaOrThrowBaseException(errorIdentifier, defaultNamespace, response, dataObject, metadata2, getErrorSchema) { - let namespace = defaultNamespace; - let errorName = errorIdentifier; - if (errorIdentifier.includes("#")) { - [namespace, errorName] = errorIdentifier.split("#"); - } - const errorMetadata = { - $metadata: metadata2, - $fault: response.statusCode < 500 ? "client" : "server" - }; - const registry2 = TypeRegistry.for(namespace); - try { - const errorSchema = getErrorSchema?.(registry2, errorName) ?? registry2.getSchema(errorIdentifier); - return { errorSchema, errorMetadata }; - } catch (e6) { - dataObject.message = dataObject.message ?? dataObject.Message ?? "UnknownError"; - const synthetic = TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace); - const baseExceptionSchema = synthetic.getBaseException(); - if (baseExceptionSchema) { - const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema) ?? Error; - throw this.decorateServiceException(Object.assign(new ErrorCtor({ name: errorName }), errorMetadata), dataObject); - } - throw this.decorateServiceException(Object.assign(new Error(errorName), errorMetadata), dataObject); - } - } - decorateServiceException(exception, additions = {}) { - if (this.queryCompat) { - const msg = exception.Message ?? additions.Message; - const error2 = decorateServiceException(exception, additions); - if (msg) { - error2.message = msg; - } - error2.Error = { - ...error2.Error, - Type: error2.Error?.Type, - Code: error2.Error?.Code, - Message: error2.Error?.message ?? error2.Error?.Message ?? msg - }; - const reqId = error2.$metadata.requestId; - if (reqId) { - error2.RequestId = reqId; - } - return error2; - } - return 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 entries = Object.entries(output); - const Error2 = { - Code, - Type - }; - Object.assign(output, Error2); - for (const [k7, v8] of entries) { - Error2[k7 === "message" ? "Message" : k7] = v8; + bits >>= bitsPerLetter; } - 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(registry2, errorName) { - try { - return registry2.getSchema(errorName); - } catch (e6) { - return registry2.find((schema) => NormalizedSchema.of(schema).getMergedTraits().awsQueryError?.[0] === errorName); + const chunkOffset = i6 / 4 * 3; + bits >>= bitLength % bitsPerByte; + const byteLength = Math.floor(bitLength / bitsPerByte); + for (let k7 = 0; k7 < byteLength; k7++) { + const offset = (byteLength - k7 - 1) * bitsPerByte; + dataView.setUint8(chunkOffset + k7, (bits & 255 << offset) >> offset); } } + return new Uint8Array(out); }; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js -var init_AwsSmithyRpcV2CborProtocol = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js"() { - "use strict"; +// node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.browser.js +async function collectBlob(blob) { + const base64 = await readToBase64(blob); + const arrayBuffer = fromBase642(base64); + return new Uint8Array(arrayBuffer); +} +async function collectStream(stream5) { + const chunks = []; + const reader = stream5.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; } -}); - -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js -var init_coercing_serializers = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js"() { - "use strict"; + const collected = new Uint8Array(length); + let offset = 0; + for (const chunk of chunks) { + collected.set(chunk, offset); + offset += chunk.length; } -}); - -// 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"() { + return collected; +} +function readToBase64(blob) { + return new Promise((resolve8, reject2) => { + const reader = new FileReader(); + reader.onloadend = () => { + if (reader.readyState !== 2) { + return reject2(new Error("Reader aborted too early")); + } + const result = reader.result ?? ""; + const commaIndex = result.indexOf(","); + const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length; + resolve8(result.substring(dataOffset)); + }; + reader.onabort = () => reject2(new Error("Read aborted")); + reader.onerror = () => reject2(reader.error); + reader.readAsDataURL(blob); + }); +} +var streamCollector; +var init_stream_collector_browser = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.browser.js"() { "use strict"; - SerdeContextConfig = class { - serdeContext; - setSerdeContext(serdeContext) { - this.serdeContext = serdeContext; + init_fromBase64_browser(); + streamCollector = async (stream5) => { + if (typeof Blob === "function" && stream5 instanceof Blob || stream5.constructor?.name === "Blob") { + if (Blob.prototype.arrayBuffer !== void 0) { + return new Uint8Array(await stream5.arrayBuffer()); + } + return collectBlob(stream5); } + return collectStream(stream5); }; } }); -// 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"() { +// node_modules/@smithy/core/dist-es/submodules/serde/util-stream/sdk-stream-mixin.browser.js +var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED, sdkStreamMixin, isBlobInstance; +var init_sdk_stream_mixin_browser = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-stream/sdk-stream-mixin.browser.js"() { "use strict"; - UnionSerde = class { - from; - to; - keys; - constructor(from, to) { - this.from = from; - this.to = to; - this.keys = new Set(Object.keys(this.from).filter((k7) => k7 !== "__type")); - } - mark(key) { - this.keys.delete(key); - } - hasUnknown() { - return this.keys.size === 1 && Object.keys(this.to).length === 0; + init_toBase64_browser(); + init_hex_encoding(); + init_toUtf8_browser(); + init_stream_collector_browser(); + init_stream_type_check(); + ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; + sdkStreamMixin = (stream5) => { + if (!isBlobInstance(stream5) && !isReadableStream3(stream5)) { + const name = stream5?.__proto__?.constructor?.name || stream5; + throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`); } - writeUnknown() { - if (this.hasUnknown()) { - const k7 = this.keys.values().next().value; - const v8 = this.from[k7]; - this.to.$unknown = [k7, v8]; + let transformed = false; + const transformToByteArray = async () => { + if (transformed) { + throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); } - } + transformed = true; + return await streamCollector(stream5); + }; + 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(stream5, { + transformToByteArray, + transformToString: async (encoding) => { + const buf = await transformToByteArray(); + if (encoding === "base64") { + return toBase642(buf); + } else if (encoding === "hex") { + return toHex(buf); + } else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") { + return toUtf82(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(stream5)) { + return blobToWebStream(stream5); + } else if (isReadableStream3(stream5)) { + return stream5; + } else { + throw new Error(`Cannot transform payload to web stream, got ${stream5}`); + } + } + }); }; + isBlobInstance = (stream5) => typeof Blob === "function" && stream5 instanceof Blob; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js -function jsonReviver(key, value, context5) { - if (context5?.source) { - const numericString = context5.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); - } - } +// node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.js +import { Writable } from "stream"; +async function collectReadableStream(stream5) { + const chunks = []; + const reader = stream5.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; } - return value; -} -var init_jsonReviver = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js"() { - "use strict"; - init_serde2(); + const collected = new Uint8Array(length); + let offset = 0; + for (const chunk of chunks) { + collected.set(chunk, offset); + offset += chunk.length; } -}); - -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js -var collectBodyString; -var init_common = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js"() { + return collected; +} +var Collector, isReadableStreamInstance, streamCollector2; +var init_stream_collector = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.js"() { "use strict"; - init_dist_es27(); - init_dist_es10(); - collectBodyString = (streamBody, context5) => collectBody(streamBody, context5).then((body2) => (context5?.utf8Encoder ?? toUtf8)(body2)); + Collector = class extends Writable { + bufferedBytes = []; + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); + } + }; + isReadableStreamInstance = (stream5) => typeof ReadableStream === "function" && stream5 instanceof ReadableStream; + streamCollector2 = (stream5) => { + if (isReadableStreamInstance(stream5)) { + return collectReadableStream(stream5); + } + return new Promise((resolve8, reject2) => { + const collector = new Collector(); + stream5.pipe(collector); + stream5.on("error", (err) => { + collector.end(); + reject2(err); + }); + collector.on("error", reject2); + collector.on("finish", function() { + const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); + resolve8(bytes); + }); + }); + }; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js -var parseJsonBody, loadRestJsonErrorCode; -var init_parseJsonBody = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/util-stream/sdk-stream-mixin.js +import { Readable as Readable7 } from "stream"; +var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2, sdkStreamMixin2; +var init_sdk_stream_mixin = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/util-stream/sdk-stream-mixin.js"() { "use strict"; - init_common(); - parseJsonBody = (streamBody, context5) => collectBodyString(streamBody, context5).then((encoded) => { - if (encoded.length) { + init_buffer_from(); + init_sdk_stream_mixin_browser(); + init_stream_collector(); + ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2 = "The stream has already been transformed."; + sdkStreamMixin2 = (stream5) => { + if (!(stream5 instanceof Readable7)) { try { - return JSON.parse(encoded); + return sdkStreamMixin(stream5); } catch (e6) { - if (e6?.name === "SyntaxError") { - Object.defineProperty(e6, "$responseBodyText", { - value: encoded - }); - } - throw e6; + const name = stream5?.__proto__?.constructor?.name || stream5; + throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`); } } - return {}; - }); - loadRestJsonErrorCode = (output, data) => { - const findKey = (object, key) => Object.keys(object).find((k7) => k7.toLowerCase() === key.toLowerCase()); - const 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]; + let transformed = false; + const transformToByteArray = async () => { + if (transformed) { + throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2); } - return cleanValue; + transformed = true; + return await streamCollector2(stream5); }; - const headerKey = findKey(output.headers, "x-amzn-errortype"); - if (headerKey !== void 0) { - return sanitizeErrorCode(output.headers[headerKey]); - } - if (data && typeof data === "object") { - const codeKey = findKey(data, "code"); - if (codeKey && data[codeKey] !== void 0) { - return sanitizeErrorCode(data[codeKey]); - } - if (data["__type"] !== void 0) { - return sanitizeErrorCode(data["__type"]); + return Object.assign(stream5, { + transformToByteArray, + transformToString: async (encoding) => { + const buf = await transformToByteArray(); + if (encoding === void 0 || Buffer.isEncoding(encoding)) { + return fromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding); + } else { + const decoder = new TextDecoder(encoding); + return decoder.decode(buf); + } + }, + transformToWebStream: () => { + if (transformed) { + throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2); + } + if (stream5.readableFlowing !== null) { + throw new Error("The stream has been consumed by other callbacks."); + } + if (typeof Readable7.toWeb !== "function") { + throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available."); + } + transformed = true; + return Readable7.toWeb(stream5); } - } + }); }; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js -var JsonShapeDeserializer; -var init_JsonShapeDeserializer = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js"() { +// node_modules/@smithy/core/dist-es/submodules/serde/index.js +import { getRandomValues } from "crypto"; +var Uint8ArrayBlobAdapter, _getRandomValues, v4, generateIdempotencyToken; +var init_serde2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/index.js"() { "use strict"; - init_protocols(); - init_schema2(); - init_serde2(); - init_dist_es11(); - init_ConfigurableSerdeContext(); - init_UnionSerde(); - init_jsonReviver(); - init_parseJsonBody(); - JsonShapeDeserializer = class extends SerdeContextConfig { - settings; - constructor(settings) { - super(); - this.settings = settings; - } - async read(schema, data) { - return this._read(schema, typeof data === "string" ? JSON.parse(data, jsonReviver) : await parseJsonBody(data, this.serdeContext)); - } - readObject(schema, data) { - return this._read(schema, data); - } - _read(schema, value) { - const isObject2 = value !== null && typeof value === "object"; - const ns2 = NormalizedSchema.of(schema); - if (isObject2) { - if (ns2.isStructSchema()) { - const record = value; - const union = ns2.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 ns2.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 [k7, v8] of Object.entries(record)) { - const t6 = jsonName ? nameMap[k7] ?? k7 : k7; - if (!(t6 in out)) { - out[t6] = v8; - } - } - } - return out; - } - if (Array.isArray(value) && ns2.isListSchema()) { - const listMember = ns2.getValueSchema(); - const out = []; - for (const item of value) { - out.push(this._read(listMember, item)); - } - return out; - } - if (ns2.isMapSchema()) { - const mapMember = ns2.getValueSchema(); - const out = {}; - for (const [_k2, _v2] of Object.entries(value)) { - out[_k2] = this._read(mapMember, _v2); - } - return out; - } - } - if (ns2.isBlobSchema() && typeof value === "string") { - return fromBase64(value); - } - const mediaType = ns2.getMergedTraits().mediaType; - if (ns2.isStringSchema() && typeof value === "string" && mediaType) { - const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); - if (isJson) { - return LazyJsonString.from(value); - } - return value; - } - if (ns2.isTimestampSchema() && value != null) { - const format2 = determineTimestampFormat(ns2, 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 (ns2.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) { - return BigInt(value); - } - if (ns2.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 (ns2.isNumericSchema() && typeof value === "string") { - switch (value) { - case "Infinity": - return Infinity; - case "-Infinity": - return -Infinity; - case "NaN": - return NaN; - } - return value; - } - if (ns2.isDocumentSchema()) { - if (isObject2) { - const out = Array.isArray(value) ? [] : {}; - for (const [k7, v8] of Object.entries(value)) { - if (v8 instanceof NumericValue) { - out[k7] = v8; - } else { - out[k7] = this._read(ns2, v8); - } - } - return out; - } else { - return structuredClone(value); - } - } - return value; - } + init_fromBase64(); + init_toBase64(); + init_Uint8ArrayBlobAdapter(); + init_fromUtf8(); + init_toUtf8(); + init_v4(); + init_date_utils(); + init_lazy_json(); + init_quote_header(); + init_schema_date_utils(); + init_split_every(); + init_split_header(); + init_NumericValue(); + init_hex_encoding(); + init_calculateBodyLength(); + init_toUint8Array(); + init_is_array_buffer(); + init_hash_node(); + init_sdk_stream_mixin(); + Uint8ArrayBlobAdapter = class extends bindUint8ArrayBlobAdapter(toUtf8, fromUtf8, toBase64, fromBase64) { }; + _getRandomValues = getRandomValues; + v4 = bindV4(_getRandomValues); + generateIdempotencyToken = v4; } }); -// 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"() { +// node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js +var collectBody; +var init_collect_stream_body = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js"() { "use strict"; init_serde2(); - 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 v8 = `${NUMERIC_CONTROL_CHAR + "nv" + this.counter++}_` + value.string; - this.values.set(`"${v8}"`, value.string); - return v8; - } - if (typeof value === "bigint") { - const s6 = value.toString(); - const v8 = `${NUMERIC_CONTROL_CHAR + "b" + this.counter++}_` + s6; - this.values.set(`"${v8}"`, s6); - return v8; - } - return value; - }; + collectBody = async (streamBody = new Uint8Array(), context5) => { + if (streamBody instanceof Uint8Array) { + return Uint8ArrayBlobAdapter.mutate(streamBody); } - 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; + if (!streamBody) { + return Uint8ArrayBlobAdapter.mutate(new Uint8Array()); } + const fromContext = context5.streamCollector(streamBody); + return Uint8ArrayBlobAdapter.mutate(await fromContext); }; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js -var JsonShapeSerializer; -var init_JsonShapeSerializer = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js"() { +// node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js +function extendedEncodeURIComponent(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function(c6) { + return "%" + c6.charCodeAt(0).toString(16).toUpperCase(); + }); +} +var init_extended_encode_uri_component = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js"() { "use strict"; - init_protocols(); - init_schema2(); - init_serde2(); - init_dist_es11(); - 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); + } +}); + +// 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"() { + "use strict"; + SerdeContext = class { + serdeContext; + setSerdeContext(serdeContext) { + this.serdeContext = serdeContext; } - writeDiscriminatedDocument(schema, value) { - this.write(schema, value); - if (typeof this.buffer === "object") { - this.buffer.__type = NormalizedSchema.of(schema).getName(true); - } + }; + } +}); + +// node_modules/tslib/tslib.es6.mjs +function __awaiter15(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e6) { + reject2(e6); } - 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; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e6) { + reject2(e6); } - _write(schema, value, container) { - const isObject2 = value !== null && typeof value === "object"; - const ns2 = NormalizedSchema.of(schema); - if (isObject2) { - if (ns2.isStructSchema()) { - const record = value; - const out = {}; - const { jsonName } = this.settings; - let nameMap = void 0; - if (jsonName) { - nameMap = {}; - } - for (const [memberName, memberSchema] of ns2.structIterator()) { - const serializableValue = this._write(memberSchema, record[memberName], ns2); - if (serializableValue !== void 0) { - let targetKey = memberName; - if (jsonName) { - targetKey = memberSchema.getMergedTraits().jsonName ?? memberName; - nameMap[memberName] = targetKey; - } - out[targetKey] = serializableValue; - } - } - if (ns2.isUnionSchema() && Object.keys(out).length === 0) { - const { $unknown } = record; - if (Array.isArray($unknown)) { - const [k7, v8] = $unknown; - out[k7] = this._write(15, v8); - } - } else if (typeof record.__type === "string") { - for (const [k7, v8] of Object.entries(record)) { - const targetKey = jsonName ? nameMap[k7] ?? k7 : k7; - if (!(targetKey in out)) { - out[targetKey] = this._write(15, v8); - } - } - } - return out; - } - if (Array.isArray(value) && ns2.isListSchema()) { - const listMember = ns2.getValueSchema(); - const out = []; - const sparse = !!ns2.getMergedTraits().sparse; - for (const item of value) { - if (sparse || item != null) { - out.push(this._write(listMember, item)); - } - } - return out; - } - if (ns2.isMapSchema()) { - const mapMember = ns2.getValueSchema(); - const out = {}; - const sparse = !!ns2.getMergedTraits().sparse; - for (const [_k2, _v2] of Object.entries(value)) { - if (sparse || _v2 != null) { - out[_k2] = this._write(mapMember, _v2); - } - } - return out; - } - if (value instanceof Uint8Array && (ns2.isBlobSchema() || ns2.isDocumentSchema())) { - if (ns2 === this.rootSchema) { - return value; - } - return (this.serdeContext?.base64Encoder ?? toBase64)(value); - } - if (value instanceof Date && (ns2.isTimestampSchema() || ns2.isDocumentSchema())) { - const format2 = determineTimestampFormat(ns2, 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 (ns2.isStringSchema()) { - if (typeof value === "undefined" && ns2.isIdempotencyToken()) { - return v4(); - } - const mediaType = ns2.getMergedTraits().mediaType; - if (value != null && mediaType) { - const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); - if (isJson) { - return LazyJsonString.from(value); - } + } + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator(thisArg, body2) { + var _3 = { label: 0, sent: function() { + if (t[0] & 1) throw t[1]; + return t[1]; + }, trys: [], ops: [] }, f6, y, t, g6 = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g6.next = verb(0), g6["throw"] = verb(1), g6["return"] = verb(2), typeof Symbol === "function" && (g6[Symbol.iterator] = function() { + return this; + }), g6; + function verb(n8) { + return function(v2) { + return step([n8, v2]); + }; + } + function step(op) { + if (f6) throw new TypeError("Generator is already executing."); + while (g6 && (g6 = 0, op[0] && (_3 = 0)), _3) try { + if (f6 = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _3.label++; + return { value: op[1], done: false }; + case 5: + _3.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _3.ops.pop(); + _3.trys.pop(); + continue; + default: + if (!(t = _3.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _3 = 0; + continue; } - return value; - } - if (typeof value === "number" && ns2.isNumericSchema()) { - if (Math.abs(value) === Infinity || isNaN(value)) { - return String(value); + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _3.label = op[1]; + break; } - return value; - } - if (typeof value === "string" && ns2.isBlobSchema()) { - if (ns2 === this.rootSchema) { - return value; + if (op[0] === 6 && _3.label < t[1]) { + _3.label = t[1]; + t = op; + break; } - return (this.serdeContext?.base64Encoder ?? toBase64)(value); - } - if (typeof value === "bigint") { - this.useReplacer = true; - } - if (ns2.isDocumentSchema()) { - if (isObject2) { - const out = Array.isArray(value) ? [] : {}; - for (const [k7, v8] of Object.entries(value)) { - if (v8 instanceof NumericValue) { - this.useReplacer = true; - out[k7] = v8; - } else { - out[k7] = this._write(ns2, v8); - } - } - return out; - } else { - return structuredClone(value); + if (t && _3.label < t[2]) { + _3.label = t[2]; + _3.ops.push(op); + break; } - } - return value; + if (t[2]) _3.ops.pop(); + _3.trys.pop(); + continue; } - }; + op = body2.call(thisArg, _3); + } catch (e6) { + op = [6, e6]; + y = 0; + } finally { + f6 = t = 0; + } + if (op[0] & 5) throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } +} +function __values(o2) { + var s = typeof Symbol === "function" && Symbol.iterator, m3 = s && o2[s], i6 = 0; + if (m3) return m3.call(o2); + if (o2 && typeof o2.length === "number") return { + next: function() { + if (o2 && i6 >= o2.length) o2 = void 0; + return { value: o2 && o2[i6++], done: !o2 }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +var init_tslib_es6 = __esm({ + "node_modules/tslib/tslib.es6.mjs"() { + "use strict"; } }); -// 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"() { - "use strict"; - 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/@smithy/is-array-buffer/dist-es/index.js +var init_dist_es2 = __esm({ + "node_modules/@smithy/is-array-buffer/dist-es/index.js"() { + "use strict"; + } +}); + +// node_modules/@smithy/util-buffer-from/dist-es/index.js +import { Buffer as Buffer3 } from "buffer"; +var fromString2; +var init_dist_es3 = __esm({ + "node_modules/@smithy/util-buffer-from/dist-es/index.js"() { + "use strict"; + init_dist_es2(); + fromString2 = (input, encoding) => { + if (typeof input !== "string") { + throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); } + return encoding ? Buffer3.from(input, encoding) : Buffer3.from(input); }; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js -var init_AwsJsonRpcProtocol = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js"() { +// node_modules/@smithy/util-utf8/dist-es/fromUtf8.js +var fromUtf83; +var init_fromUtf82 = __esm({ + "node_modules/@smithy/util-utf8/dist-es/fromUtf8.js"() { "use strict"; + init_dist_es3(); + fromUtf83 = (input) => { + const buf = fromString2(input, "utf8"); + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); + }; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_0Protocol.js -var init_AwsJson1_0Protocol = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_0Protocol.js"() { +// node_modules/@smithy/util-utf8/dist-es/toUint8Array.js +var init_toUint8Array2 = __esm({ + "node_modules/@smithy/util-utf8/dist-es/toUint8Array.js"() { "use strict"; + init_fromUtf82(); } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_1Protocol.js -var init_AwsJson1_1Protocol = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_1Protocol.js"() { +// node_modules/@smithy/util-utf8/dist-es/toUtf8.js +var init_toUtf82 = __esm({ + "node_modules/@smithy/util-utf8/dist-es/toUtf8.js"() { "use strict"; + init_dist_es3(); } }); -// 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"() { +// node_modules/@smithy/util-utf8/dist-es/index.js +var init_dist_es4 = __esm({ + "node_modules/@smithy/util-utf8/dist-es/index.js"() { "use strict"; - init_protocols(); - init_schema2(); - init_ProtocolLib(); - init_JsonCodec(); - init_parseJsonBody(); - AwsRestJsonProtocol = class extends HttpBindingProtocol { - serializer; - deserializer; - codec; - mixin = new ProtocolLib(); - constructor({ defaultNamespace }) { - super({ - defaultNamespace - }); - 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, context5) { - const request3 = await super.serializeRequest(operationSchema, input, context5); - const inputSchema = NormalizedSchema.of(operationSchema.input); - if (!request3.headers["content-type"]) { - const contentType2 = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); - if (contentType2) { - request3.headers["content-type"] = contentType2; - } - } - if (request3.body == null && request3.headers["content-type"] === this.getDefaultContentType()) { - request3.body = "{}"; - } - return request3; - } - async deserializeResponse(operationSchema, context5, response) { - const output = await super.deserializeResponse(operationSchema, context5, 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, context5, response, dataObject, metadata2) { - const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown"; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata2); - const ns2 = NormalizedSchema.of(errorSchema); - const message = dataObject.message ?? dataObject.Message ?? "Unknown"; - const ErrorCtor = TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; - const exception = new ErrorCtor(message); - await this.deserializeHttpMessage(errorSchema, context5, response, dataObject); - const output = {}; - for (const [name, member2] of ns2.structIterator()) { - const target = member2.getMergedTraits().jsonName ?? name; - output[name] = this.codec.createDeserializer().readObject(member2, dataObject[target]); - } - throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { - $fault: ns2.getMergedTraits().error, - message - }, output), dataObject); - } - getDefaultContentType() { - return "application/json"; - } - }; + init_fromUtf82(); + init_toUint8Array2(); + init_toUtf82(); } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js -var init_awsExpectUnion = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js"() { +// node_modules/@aws-crypto/util/build/module/convertToBuffer.js +function convertToBuffer(data) { + if (data instanceof Uint8Array) + return data; + if (typeof data === "string") { + return fromUtf84(data); + } + if (ArrayBuffer.isView(data)) { + return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); + } + return new Uint8Array(data); +} +var fromUtf84; +var init_convertToBuffer = __esm({ + "node_modules/@aws-crypto/util/build/module/convertToBuffer.js"() { "use strict"; + init_dist_es4(); + fromUtf84 = typeof Buffer !== "undefined" && Buffer.from ? function(input) { + return Buffer.from(input, "utf8"); + } : fromUtf83; } }); -// node_modules/@aws-sdk/xml-builder/dist-es/XmlText.js -var init_XmlText = __esm({ - "node_modules/@aws-sdk/xml-builder/dist-es/XmlText.js"() { +// node_modules/@aws-crypto/util/build/module/isEmptyData.js +function isEmptyData(data) { + if (typeof data === "string") { + return data.length === 0; + } + return data.byteLength === 0; +} +var init_isEmptyData = __esm({ + "node_modules/@aws-crypto/util/build/module/isEmptyData.js"() { "use strict"; } }); -// node_modules/@aws-sdk/xml-builder/dist-es/XmlNode.js -var init_XmlNode = __esm({ - "node_modules/@aws-sdk/xml-builder/dist-es/XmlNode.js"() { +// node_modules/@aws-crypto/util/build/module/numToUint8.js +function numToUint8(num) { + return new Uint8Array([ + (num & 4278190080) >> 24, + (num & 16711680) >> 16, + (num & 65280) >> 8, + num & 255 + ]); +} +var init_numToUint8 = __esm({ + "node_modules/@aws-crypto/util/build/module/numToUint8.js"() { "use strict"; } }); -// node_modules/@aws-sdk/xml-builder/dist-es/xml-external/nodable_entities.js -function validateEntityName3(name) { - if (name[0] === "#") { - throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${name}"`); - } - for (const ch of name) { - if (SPECIAL_CHARS2.has(ch)) { - throw new Error(`[EntityReplacer] Invalid character '${ch}' in entity name: "${name}"`); +// node_modules/@aws-crypto/util/build/module/uint32ArrayFrom.js +function uint32ArrayFrom(a_lookUpTable2) { + if (!Uint32Array.from) { + var return_array = new Uint32Array(a_lookUpTable2.length); + var a_index = 0; + while (a_index < a_lookUpTable2.length) { + return_array[a_index] = a_lookUpTable2[a_index]; + a_index += 1; } + return return_array; } - return name; + return Uint32Array.from(a_lookUpTable2); } -function mergeEntityMaps2(...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; - } - } - } +var init_uint32ArrayFrom = __esm({ + "node_modules/@aws-crypto/util/build/module/uint32ArrayFrom.js"() { + "use strict"; } - return out; -} -function parseLimitTiers2(raw) { - if (!raw || raw === LIMIT_TIER_EXTERNAL2) { - return /* @__PURE__ */ new Set([LIMIT_TIER_EXTERNAL2]); +}); + +// node_modules/@aws-crypto/util/build/module/index.js +var init_module = __esm({ + "node_modules/@aws-crypto/util/build/module/index.js"() { + "use strict"; + init_convertToBuffer(); + init_isEmptyData(); + init_numToUint8(); + init_uint32ArrayFrom(); } - if (raw === LIMIT_TIER_ALL2) { - return /* @__PURE__ */ new Set([LIMIT_TIER_ALL2]); +}); + +// node_modules/@aws-crypto/crc32/build/module/aws_crc32.js +var AwsCrc32; +var init_aws_crc32 = __esm({ + "node_modules/@aws-crypto/crc32/build/module/aws_crc32.js"() { + "use strict"; + init_tslib_es6(); + init_module(); + init_module2(); + AwsCrc32 = /** @class */ + (function() { + function AwsCrc322() { + this.crc32 = new Crc32(); + } + AwsCrc322.prototype.update = function(toHash) { + if (isEmptyData(toHash)) + return; + this.crc32.update(convertToBuffer(toHash)); + }; + AwsCrc322.prototype.digest = function() { + return __awaiter15(this, void 0, void 0, function() { + return __generator(this, function(_a6) { + return [2, numToUint8(this.crc32.digest())]; + }); + }); + }; + AwsCrc322.prototype.reset = function() { + this.crc32 = new Crc32(); + }; + return AwsCrc322; + })(); } - if (raw === LIMIT_TIER_BASE2) { - return /* @__PURE__ */ new Set([LIMIT_TIER_BASE2]); +}); + +// node_modules/@aws-crypto/crc32/build/module/index.js +var Crc32, a_lookUpTable, lookupTable; +var init_module2 = __esm({ + "node_modules/@aws-crypto/crc32/build/module/index.js"() { + "use strict"; + init_tslib_es6(); + init_module(); + init_aws_crc32(); + Crc32 = /** @class */ + (function() { + function Crc322() { + this.checksum = 4294967295; + } + Crc322.prototype.update = function(data) { + var e_1, _a6; + try { + for (var data_1 = __values(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) { + var byte = data_1_1.value; + this.checksum = this.checksum >>> 8 ^ lookupTable[(this.checksum ^ byte) & 255]; + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (data_1_1 && !data_1_1.done && (_a6 = data_1.return)) _a6.call(data_1); + } finally { + if (e_1) throw e_1.error; + } + } + return this; + }; + Crc322.prototype.digest = function() { + return (this.checksum ^ 4294967295) >>> 0; + }; + return Crc322; + })(); + a_lookUpTable = [ + 0, + 1996959894, + 3993919788, + 2567524794, + 124634137, + 1886057615, + 3915621685, + 2657392035, + 249268274, + 2044508324, + 3772115230, + 2547177864, + 162941995, + 2125561021, + 3887607047, + 2428444049, + 498536548, + 1789927666, + 4089016648, + 2227061214, + 450548861, + 1843258603, + 4107580753, + 2211677639, + 325883990, + 1684777152, + 4251122042, + 2321926636, + 335633487, + 1661365465, + 4195302755, + 2366115317, + 997073096, + 1281953886, + 3579855332, + 2724688242, + 1006888145, + 1258607687, + 3524101629, + 2768942443, + 901097722, + 1119000684, + 3686517206, + 2898065728, + 853044451, + 1172266101, + 3705015759, + 2882616665, + 651767980, + 1373503546, + 3369554304, + 3218104598, + 565507253, + 1454621731, + 3485111705, + 3099436303, + 671266974, + 1594198024, + 3322730930, + 2970347812, + 795835527, + 1483230225, + 3244367275, + 3060149565, + 1994146192, + 31158534, + 2563907772, + 4023717930, + 1907459465, + 112637215, + 2680153253, + 3904427059, + 2013776290, + 251722036, + 2517215374, + 3775830040, + 2137656763, + 141376813, + 2439277719, + 3865271297, + 1802195444, + 476864866, + 2238001368, + 4066508878, + 1812370925, + 453092731, + 2181625025, + 4111451223, + 1706088902, + 314042704, + 2344532202, + 4240017532, + 1658658271, + 366619977, + 2362670323, + 4224994405, + 1303535960, + 984961486, + 2747007092, + 3569037538, + 1256170817, + 1037604311, + 2765210733, + 3554079995, + 1131014506, + 879679996, + 2909243462, + 3663771856, + 1141124467, + 855842277, + 2852801631, + 3708648649, + 1342533948, + 654459306, + 3188396048, + 3373015174, + 1466479909, + 544179635, + 3110523913, + 3462522015, + 1591671054, + 702138776, + 2966460450, + 3352799412, + 1504918807, + 783551873, + 3082640443, + 3233442989, + 3988292384, + 2596254646, + 62317068, + 1957810842, + 3939845945, + 2647816111, + 81470997, + 1943803523, + 3814918930, + 2489596804, + 225274430, + 2053790376, + 3826175755, + 2466906013, + 167816743, + 2097651377, + 4027552580, + 2265490386, + 503444072, + 1762050814, + 4150417245, + 2154129355, + 426522225, + 1852507879, + 4275313526, + 2312317920, + 282753626, + 1742555852, + 4189708143, + 2394877945, + 397917763, + 1622183637, + 3604390888, + 2714866558, + 953729732, + 1340076626, + 3518719985, + 2797360999, + 1068828381, + 1219638859, + 3624741850, + 2936675148, + 906185462, + 1090812512, + 3747672003, + 2825379669, + 829329135, + 1181335161, + 3412177804, + 3160834842, + 628085408, + 1382605366, + 3423369109, + 3138078467, + 570562233, + 1426400815, + 3317316542, + 2998733608, + 733239954, + 1555261956, + 3268935591, + 3050360625, + 752459403, + 1541320221, + 2607071920, + 3965973030, + 1969922972, + 40735498, + 2617837225, + 3943577151, + 1913087877, + 83908371, + 2512341634, + 3803740692, + 2075208622, + 213261112, + 2463272603, + 3855990285, + 2094854071, + 198958881, + 2262029012, + 4057260610, + 1759359992, + 534414190, + 2176718541, + 4139329115, + 1873836001, + 414664567, + 2282248934, + 4279200368, + 1711684554, + 285281116, + 2405801727, + 4167216745, + 1634467795, + 376229701, + 2685067896, + 3608007406, + 1308918612, + 956543938, + 2808555105, + 3495958263, + 1231636301, + 1047427035, + 2932959818, + 3654703836, + 1088359270, + 936918e3, + 2847714899, + 3736837829, + 1202900863, + 817233897, + 3183342108, + 3401237130, + 1404277552, + 615818150, + 3134207493, + 3453421203, + 1423857449, + 601450431, + 3009837614, + 3294710456, + 1567103746, + 711928724, + 3020668471, + 3272380065, + 1510334235, + 755167117 + ]; + lookupTable = uint32ArrayFrom(a_lookUpTable); } - if (Array.isArray(raw)) { - return new Set(raw); +}); + +// node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js +function negate(bytes) { + for (let i6 = 0; i6 < 8; i6++) { + bytes[i6] ^= 255; } - return /* @__PURE__ */ new Set([LIMIT_TIER_EXTERNAL2]); -} -function parseNCRConfig2(ncr) { - if (!ncr) { - return { xmlVersion: 1, onLevel: NCR_LEVEL2.allow, nullLevel: NCR_LEVEL2.remove }; + for (let i6 = 7; i6 > -1; i6--) { + bytes[i6]++; + if (bytes[i6] !== 0) + break; } - const xmlVersion = ncr.xmlVersion === 1.1 ? 1.1 : 1; - const onLevel = NCR_LEVEL2[ncr.onNCR ?? "allow"] ?? NCR_LEVEL2.allow; - const nullLevel = NCR_LEVEL2[ncr.nullNCR ?? "remove"] ?? NCR_LEVEL2.remove; - const clampedNull = Math.max(nullLevel, NCR_LEVEL2.remove); - return { xmlVersion, onLevel, nullLevel: clampedNull }; } -var XML2, COMMON_HTML2, CURRENCY2, SPECIAL_CHARS2, LIMIT_TIER_EXTERNAL2, LIMIT_TIER_BASE2, LIMIT_TIER_ALL2, NCR_LEVEL2, XML10_ALLOWED_C02, EntityDecoderImpl; -var init_nodable_entities = __esm({ - "node_modules/@aws-sdk/xml-builder/dist-es/xml-external/nodable_entities.js"() { +var Int64; +var init_Int64 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js"() { "use strict"; - XML2 = { - amp: "&", - apos: "'", - gt: ">", - lt: "<", - quot: '"' - }; - COMMON_HTML2 = { - 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" - }; - CURRENCY2 = { - 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" - }; - SPECIAL_CHARS2 = new Set("!?\\/[]$%{}^&*()<>|+"); - LIMIT_TIER_EXTERNAL2 = "external"; - LIMIT_TIER_BASE2 = "base"; - LIMIT_TIER_ALL2 = "all"; - NCR_LEVEL2 = Object.freeze({ allow: 0, leave: 1, remove: 2, throw: 3 }); - XML10_ALLOWED_C02 = /* @__PURE__ */ new Set([9, 10, 13]); - EntityDecoderImpl = class EntityDecoderImpl2 { - _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 : (r6) => r6; - this._limitTiers = parseLimitTiers2(this._limit.applyLimitsTo ?? LIMIT_TIER_EXTERNAL2); - this._numericAllowed = options.numericAllowed ?? true; - this._baseMap = mergeEntityMaps2(XML2, 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 = parseNCRConfig2(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)) { - validateEntityName3(key); - } - } - this._externalMap = mergeEntityMaps2(map2); - } - addExternalEntity(key, value) { - validateEntityName3(key); - if (typeof value === "string" && value.indexOf("&") === -1) { - this._externalMap[key] = value; + init_serde2(); + Int64 = class _Int64 { + bytes; + constructor(bytes) { + this.bytes = bytes; + if (bytes.byteLength !== 8) { + throw new Error("Int64 buffers must be exactly 8 bytes"); } } - addInputEntities(map2) { - this._totalExpansions = 0; - this._expandedLength = 0; - this._inputMap = mergeEntityMaps2(map2); - } - reset() { - this._inputMap = /* @__PURE__ */ Object.create(null); - this._totalExpansions = 0; - this._expandedLength = 0; - return this; - } - setXmlVersion(version3) { - this._ncrXmlVersion = version3 === "1.1" || version3 === 1.1 ? 1.1 : 1; - } - decode(str) { - if (typeof str !== "string" || str.length === 0) { - return str; + 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 original = str; - const chunks = []; - const len = str.length; - let last = 0; - let i6 = 0; - const limitExpansions = this._maxTotalExpansions > 0; - const limitLength = this._maxExpandedLength > 0; - const checkLimits = limitExpansions || limitLength; - while (i6 < len) { - if (str.charCodeAt(i6) !== 38) { - i6++; - continue; - } - let j7 = i6 + 1; - while (j7 < len && str.charCodeAt(j7) !== 59 && j7 - i6 <= 32) { - j7++; - } - if (j7 >= len || str.charCodeAt(j7) !== 59) { - i6++; - continue; - } - const token = str.slice(i6 + 1, j7); - if (token.length === 0) { - i6++; - continue; - } - let replacement; - let tier2; - if (this._removeSet.has(token)) { - replacement = ""; - if (tier2 === void 0) { - tier2 = LIMIT_TIER_EXTERNAL2; - } - } else if (this._leaveSet.has(token)) { - i6++; - continue; - } else if (token.charCodeAt(0) === 35) { - const ncrResult = this._resolveNCR(token); - if (ncrResult === void 0) { - i6++; - continue; - } - replacement = ncrResult; - tier2 = LIMIT_TIER_BASE2; - } else { - const resolved = this._resolveName(token); - replacement = resolved?.value; - tier2 = resolved?.tier; - } - if (replacement === void 0) { - i6++; - continue; - } - if (i6 > last) { - chunks.push(str.slice(last, i6)); - } - chunks.push(replacement); - last = j7 + 1; - i6 = last; - if (checkLimits && this._tierCounts(tier2)) { - 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}`); - } - } - } - } + const bytes = new Uint8Array(8); + for (let i6 = 7, remaining = Math.abs(Math.round(number)); i6 > -1 && remaining > 0; i6--, remaining /= 256) { + bytes[i6] = remaining; } - if (last < len) { - chunks.push(str.slice(last)); + if (number < 0) { + negate(bytes); } - const result = chunks.length === 0 ? str : chunks.join(""); - return this._postCheck(result, original); + return new _Int64(bytes); } - _tierCounts(tier2) { - if (this._limitTiers.has(LIMIT_TIER_ALL2)) { - return true; + valueOf() { + const bytes = this.bytes.slice(0); + const negative = bytes[0] & 128; + if (negative) { + negate(bytes); } - return this._limitTiers.has(tier2); + return parseInt(toHex(bytes), 16) * (negative ? -1 : 1); } - _resolveName(name) { - if (name in this._inputMap) { - return { value: this._inputMap[name], tier: LIMIT_TIER_EXTERNAL2 }; - } - if (name in this._externalMap) { - return { value: this._externalMap[name], tier: LIMIT_TIER_EXTERNAL2 }; - } - if (name in this._baseMap) { - return { value: this._baseMap[name], tier: LIMIT_TIER_BASE2 }; - } - return void 0; + toString() { + return String(this.valueOf()); } - _classifyNCR(cp) { - if (cp === 0) { - return this._ncrNullLevel; - } - if (cp >= 55296 && cp <= 57343) { - return NCR_LEVEL2.remove; + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +var HeaderMarshaller, HEADER_VALUE_TYPE, BOOLEAN_TAG, BYTE_TAG, SHORT_TAG, INT_TAG, LONG_TAG, BINARY_TAG, STRING_TAG, TIMESTAMP_TAG, UUID_TAG, UUID_PATTERN; +var init_HeaderMarshaller = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js"() { + "use strict"; + init_serde2(); + init_Int64(); + HeaderMarshaller = class { + toUtf8; + fromUtf8; + constructor(toUtf83, fromUtf85) { + this.toUtf8 = toUtf83; + this.fromUtf8 = fromUtf85; + } + format(headers) { + const chunks = []; + for (const headerName of Object.keys(headers)) { + const bytes = this.fromUtf8(headerName); + chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName])); } - if (this._ncrXmlVersion === 1) { - if (cp >= 1 && cp <= 31 && !XML10_ALLOWED_C02.has(cp)) { - return NCR_LEVEL2.remove; - } + 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 -1; + return out; } - _applyNCRAction(action5, token, cp) { - switch (action5) { - case NCR_LEVEL2.allow: - return String.fromCodePoint(cp); - case NCR_LEVEL2.remove: - return ""; - case NCR_LEVEL2.leave: - return void 0; - case NCR_LEVEL2.throw: - throw new Error(`[EntityDecoder] Prohibited numeric character reference &${token}; (U+${cp.toString(16).toUpperCase().padStart(4, "0")})`); - default: - return String.fromCodePoint(cp); + 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 = this.fromUtf8(header.value); + const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength)); + strView.setUint8(0, 7); + strView.setUint16(1, utf8Bytes.byteLength, false); + const strBytes = new Uint8Array(strView.buffer); + strBytes.set(utf8Bytes, 3); + return strBytes; + case "timestamp": + const tsBytes = new Uint8Array(9); + tsBytes[0] = 8; + tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1); + return tsBytes; + case "uuid": + if (!UUID_PATTERN.test(header.value)) { + throw new Error(`Invalid UUID received: ${header.value}`); + } + const uuidBytes = new Uint8Array(17); + uuidBytes[0] = 9; + uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1); + return uuidBytes; } } - _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_LEVEL2.remove) { - return void 0; + parse(headers) { + const out = {}; + let position = 0; + while (position < headers.byteLength) { + const nameLength = headers.getUint8(position++); + const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength)); + position += nameLength; + switch (headers.getUint8(position++)) { + case 0: + out[name] = { + type: BOOLEAN_TAG, + value: true + }; + break; + case 1: + out[name] = { + type: BOOLEAN_TAG, + value: false + }; + break; + case 2: + out[name] = { + type: BYTE_TAG, + value: headers.getInt8(position++) + }; + break; + case 3: + out[name] = { + type: SHORT_TAG, + value: headers.getInt16(position, false) + }; + position += 2; + break; + case 4: + out[name] = { + type: INT_TAG, + value: headers.getInt32(position, false) + }; + position += 4; + break; + case 5: + out[name] = { + type: LONG_TAG, + value: new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)) + }; + position += 8; + break; + case 6: + const binaryLength = headers.getUint16(position, false); + position += 2; + out[name] = { + type: BINARY_TAG, + value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength) + }; + position += binaryLength; + break; + case 7: + const stringLength = headers.getUint16(position, false); + position += 2; + out[name] = { + type: STRING_TAG, + value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength)) + }; + position += stringLength; + break; + case 8: + out[name] = { + type: TIMESTAMP_TAG, + value: new Date(new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()) + }; + position += 8; + break; + case 9: + const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16); + position += 16; + out[name] = { + type: UUID_TAG, + value: `${toHex(uuidBytes.subarray(0, 4))}-${toHex(uuidBytes.subarray(4, 6))}-${toHex(uuidBytes.subarray(6, 8))}-${toHex(uuidBytes.subarray(8, 10))}-${toHex(uuidBytes.subarray(10))}` + }; + break; + default: + throw new Error(`Unrecognized header type tag`); + } } - const effective = minimum === -1 ? this._ncrOnLevel : Math.max(this._ncrOnLevel, minimum); - return this._applyNCRAction(effective, token, cp); + return out; } }; + (function(HEADER_VALUE_TYPE3) { + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolTrue"] = 0] = "boolTrue"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolFalse"] = 1] = "boolFalse"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byte"] = 2] = "byte"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["short"] = 3] = "short"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["integer"] = 4] = "integer"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["long"] = 5] = "long"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byteArray"] = 6] = "byteArray"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["string"] = 7] = "string"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["timestamp"] = 8] = "timestamp"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["uuid"] = 9] = "uuid"; + })(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {})); + BOOLEAN_TAG = "boolean"; + BYTE_TAG = "byte"; + SHORT_TAG = "short"; + INT_TAG = "integer"; + LONG_TAG = "long"; + BINARY_TAG = "binary"; + STRING_TAG = "string"; + TIMESTAMP_TAG = "timestamp"; + UUID_TAG = "uuid"; + UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; } }); -// node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js -function parseXML2(xmlString) { - return parser.parse(xmlString, true); -} -var entityDecoder, parser; -var init_xml_parser = __esm({ - "node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js"() { - "use strict"; - init_fxp(); - init_nodable_entities(); - entityDecoder = new EntityDecoderImpl({ - namedEntities: { ...XML2, ...COMMON_HTML2, ...CURRENCY2 }, - numericAllowed: true, - limit: { - maxTotalExpansions: Infinity - }, - ncr: { - xmlVersion: 1.1 - } - }); - parser = new 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: (version3) => void {} - }, - ignoreAttributes: false, - ignoreDeclaration: true, - parseTagValue: false, - trimValues: false, - tagValueProcessor: (_3, val) => val.trim() === "" && val.includes("\n") ? "" : void 0, - maxNestedTags: Infinity - }); +// node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/splitMessage.js +function splitMessage({ byteLength, byteOffset, buffer: buffer2 }) { + if (byteLength < MINIMUM_MESSAGE_LENGTH) { + throw new Error("Provided message too short to accommodate event stream message overhead"); } -}); - -// node_modules/@aws-sdk/xml-builder/dist-es/index.js -var init_dist_es28 = __esm({ - "node_modules/@aws-sdk/xml-builder/dist-es/index.js"() { + const view = new DataView(buffer2, byteOffset, byteLength); + const messageLength = view.getUint32(0, false); + if (byteLength !== messageLength) { + throw new Error("Reported message length does not match received message length"); + } + const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false); + const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false); + const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false); + const checksummer = new Crc32().update(new Uint8Array(buffer2, byteOffset, PRELUDE_LENGTH)); + if (expectedPreludeChecksum !== checksummer.digest()) { + throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})`); + } + checksummer.update(new Uint8Array(buffer2, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH))); + if (expectedMessageChecksum !== checksummer.digest()) { + throw new Error(`The message checksum (${checksummer.digest()}) did not match the expected value of ${expectedMessageChecksum}`); + } + return { + headers: new DataView(buffer2, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength), + body: new Uint8Array(buffer2, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength, messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH)) + }; +} +var PRELUDE_MEMBER_LENGTH, PRELUDE_LENGTH, CHECKSUM_LENGTH, MINIMUM_MESSAGE_LENGTH; +var init_splitMessage = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/splitMessage.js"() { "use strict"; - init_XmlNode(); - init_XmlText(); - init_xml_parser(); + init_module2(); + PRELUDE_MEMBER_LENGTH = 4; + PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2; + CHECKSUM_LENGTH = 4; + MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js -var XmlShapeDeserializer; -var init_XmlShapeDeserializer = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js"() { +// node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/EventStreamCodec.js +var EventStreamCodec; +var init_EventStreamCodec = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/EventStreamCodec.js"() { "use strict"; - init_dist_es28(); - init_protocols(); - init_schema2(); - init_dist_es27(); - init_dist_es10(); - init_ConfigurableSerdeContext(); - init_UnionSerde(); - XmlShapeDeserializer = class extends SerdeContextConfig { - settings; - stringDeserializer; - constructor(settings) { - super(); - this.settings = settings; - this.stringDeserializer = new FromStringShapeDeserializer(settings); + init_module2(); + init_HeaderMarshaller(); + init_splitMessage(); + EventStreamCodec = class { + headerMarshaller; + messageBuffer; + isEndOfStream; + constructor(toUtf83, fromUtf85) { + this.headerMarshaller = new HeaderMarshaller(toUtf83, fromUtf85); + this.messageBuffer = []; + this.isEndOfStream = false; } - setSerdeContext(serdeContext) { - this.serdeContext = serdeContext; - this.stringDeserializer.setSerdeContext(serdeContext); + feed(message) { + this.messageBuffer.push(this.decode(message)); } - read(schema, bytes, key) { - const ns2 = NormalizedSchema.of(schema); - const memberSchemas = ns2.getMemberSchemas(); - const isEventPayload = ns2.isStructSchema() && ns2.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 ?? toUtf8)(bytes); - const parsedObject = this.parseXml(xmlString); - return this.readSchema(schema, key ? parsedObject[key] : parsedObject); + endOfStream() { + this.isEndOfStream = true; } - readSchema(_schema, value) { - const ns2 = NormalizedSchema.of(_schema); - if (ns2.isUnitSchema()) { - return; - } - const traits = ns2.getMergedTraits(); - if (ns2.isListSchema() && !Array.isArray(value)) { - return this.readSchema(ns2, [value]); - } - if (value == null) { - return value; - } - if (typeof value === "object") { - const flat = !!traits.xmlFlattened; - if (ns2.isListSchema()) { - const listValue = ns2.getValueSchema(); - const buffer3 = []; - const sourceKey = listValue.getMergedTraits().xmlName ?? "member"; - const source = flat ? value : (value[0] ?? value)[sourceKey]; - if (source == null) { - return buffer3; - } - const sourceArray = Array.isArray(source) ? source : [source]; - for (const v8 of sourceArray) { - buffer3.push(this.readSchema(listValue, v8)); - } - return buffer3; - } - const buffer2 = {}; - if (ns2.isMapSchema()) { - const keyNs = ns2.getKeySchema(); - const memberNs = ns2.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]; - buffer2[key] = this.readSchema(memberNs, value2); - } - return buffer2; - } - if (ns2.isStructSchema()) { - const union = ns2.isUnionSchema(); - let unionSerde; - if (union) { - unionSerde = new UnionSerde(value, buffer2); - } - for (const [memberName, memberSchema] of ns2.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) { - buffer2[memberName] = this.readSchema(memberSchema, value[xmlObjectKey]); - } - } - if (union) { - unionSerde.writeUnknown(); - } - return buffer2; - } - if (ns2.isDocumentSchema()) { - return value; + getMessage() { + const message = this.messageBuffer.pop(); + const isEndOfStream = this.isEndOfStream; + return { + getMessage() { + return message; + }, + isEndOfStream() { + return isEndOfStream; } - throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${ns2.getName(true)}`); - } - if (ns2.isListSchema()) { - return []; - } - if (ns2.isMapSchema() || ns2.isStructSchema()) { - return {}; - } - return this.stringDeserializer.read(ns2, value); + }; } - parseXml(xml) { - if (xml.length) { - let parsedObj; - try { - parsedObj = parseXML2(xml); - } catch (e6) { - if (e6 && typeof e6 === "object") { - Object.defineProperty(e6, "$responseBodyText", { - value: xml - }); - } - throw e6; - } - const textNodeName = "#text"; - const key = Object.keys(parsedObj)[0]; - const parsedObjToReturn = parsedObj[key]; - if (parsedObjToReturn[textNodeName]) { - parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; - delete parsedObjToReturn[textNodeName]; + getAvailableMessages() { + const messages = this.messageBuffer; + this.messageBuffer = []; + const isEndOfStream = this.isEndOfStream; + return { + getMessages() { + return messages; + }, + isEndOfStream() { + return isEndOfStream; } - return getValueFromTextNode(parsedObjToReturn); - } - return {}; + }; + } + encode({ headers: rawHeaders, body: body2 }) { + const headers = this.headerMarshaller.format(rawHeaders); + const length = headers.byteLength + body2.byteLength + 16; + const out = new Uint8Array(length); + const view = new DataView(out.buffer, out.byteOffset, out.byteLength); + const checksum = new Crc32(); + view.setUint32(0, length, false); + view.setUint32(4, headers.byteLength, false); + view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false); + out.set(headers, 12); + out.set(body2, headers.byteLength + 12); + view.setUint32(length - 4, checksum.update(out.subarray(8, length - 4)).digest(), false); + return out; + } + decode(message) { + const { headers, body: body2 } = splitMessage(message); + return { headers: this.headerMarshaller.parse(headers), body: body2 }; + } + formatHeaders(rawHeaders) { + return this.headerMarshaller.format(rawHeaders); } }; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js -var QueryShapeSerializer; -var init_QueryShapeSerializer = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js"() { +// node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/MessageDecoderStream.js +var MessageDecoderStream; +var init_MessageDecoderStream = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/MessageDecoderStream.js"() { "use strict"; - init_protocols(); - init_schema2(); - init_serde2(); - init_dist_es27(); - init_dist_es11(); - init_ConfigurableSerdeContext(); - QueryShapeSerializer = class extends SerdeContextConfig { - settings; - buffer; - constructor(settings) { - super(); - this.settings = settings; - } - write(schema, value, prefix2 = "") { - if (this.buffer === void 0) { - this.buffer = ""; - } - const ns2 = NormalizedSchema.of(schema); - if (prefix2 && !prefix2.endsWith(".")) { - prefix2 += "."; - } - if (ns2.isBlobSchema()) { - if (typeof value === "string" || value instanceof Uint8Array) { - this.writeKey(prefix2); - this.writeValue((this.serdeContext?.base64Encoder ?? toBase64)(value)); - } - } else if (ns2.isBooleanSchema() || ns2.isNumericSchema() || ns2.isStringSchema()) { - if (value != null) { - this.writeKey(prefix2); - this.writeValue(String(value)); - } else if (ns2.isIdempotencyToken()) { - this.writeKey(prefix2); - this.writeValue(v4()); - } - } else if (ns2.isBigIntegerSchema()) { - if (value != null) { - this.writeKey(prefix2); - this.writeValue(String(value)); - } - } else if (ns2.isBigDecimalSchema()) { - if (value != null) { - this.writeKey(prefix2); - this.writeValue(value instanceof NumericValue ? value.string : String(value)); - } - } else if (ns2.isTimestampSchema()) { - if (value instanceof Date) { - this.writeKey(prefix2); - const format2 = determineTimestampFormat(ns2, this.settings); - switch (format2) { - case 5: - this.writeValue(value.toISOString().replace(".000Z", "Z")); - break; - case 6: - this.writeValue(dateToUtcString(value)); - break; - case 7: - this.writeValue(String(value.getTime() / 1e3)); - break; - } - } - } else if (ns2.isDocumentSchema()) { - if (Array.isArray(value)) { - this.write(64 | 15, value, prefix2); - } else if (value instanceof Date) { - this.write(4, value, prefix2); - } else if (value instanceof Uint8Array) { - this.write(21, value, prefix2); - } else if (value && typeof value === "object") { - this.write(128 | 15, value, prefix2); - } else { - this.writeKey(prefix2); - this.writeValue(String(value)); - } - } else if (ns2.isListSchema()) { - if (Array.isArray(value)) { - if (value.length === 0) { - if (this.settings.serializeEmptyLists) { - this.writeKey(prefix2); - this.writeValue(""); - } - } else { - const member2 = ns2.getValueSchema(); - const flat = this.settings.flattenLists || ns2.getMergedTraits().xmlFlattened; - let i6 = 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 ? `${prefix2}${i6}` : `${prefix2}${suffix}.${i6}`; - this.write(member2, item, key); - ++i6; - } - } - } - } else if (ns2.isMapSchema()) { - if (value && typeof value === "object") { - const keySchema = ns2.getKeySchema(); - const memberSchema = ns2.getValueSchema(); - const flat = ns2.getMergedTraits().xmlFlattened; - let i6 = 1; - for (const [k7, v8] of Object.entries(value)) { - if (v8 == null) { - continue; - } - const keyTraits = keySchema.getMergedTraits(); - const keySuffix = this.getKey("key", keyTraits.xmlName, keyTraits.ec2QueryName); - const key = flat ? `${prefix2}${i6}.${keySuffix}` : `${prefix2}entry.${i6}.${keySuffix}`; - const valTraits = memberSchema.getMergedTraits(); - const valueSuffix = this.getKey("value", valTraits.xmlName, valTraits.ec2QueryName); - const valueKey = flat ? `${prefix2}${i6}.${valueSuffix}` : `${prefix2}entry.${i6}.${valueSuffix}`; - this.write(keySchema, k7, key); - this.write(memberSchema, v8, valueKey); - ++i6; - } - } - } else if (ns2.isStructSchema()) { - if (value && typeof value === "object") { - let didWriteMember = false; - for (const [memberName, member2] of ns2.structIterator()) { - if (value[memberName] == null && !member2.isIdempotencyToken()) { - continue; - } - const traits = member2.getMergedTraits(); - const suffix = this.getKey(memberName, traits.xmlName, traits.ec2QueryName, "struct"); - const key = `${prefix2}${suffix}`; - this.write(member2, value[memberName], key); - didWriteMember = true; - } - if (!didWriteMember && ns2.isUnionSchema()) { - const { $unknown } = value; - if (Array.isArray($unknown)) { - const [k7, v8] = $unknown; - const key = `${prefix2}${k7}`; - this.write(15, v8, key); - } - } - } - } else if (ns2.isUnitSchema()) { - } else { - throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${ns2.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; + MessageDecoderStream = class { + options; + constructor(options) { + this.options = options; } - 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; + [Symbol.asyncIterator]() { + return this.asyncIterator(); } - writeKey(key) { - if (key.endsWith(".")) { - key = key.slice(0, key.length - 1); + async *asyncIterator() { + for await (const bytes of this.options.inputStream) { + const decoded = this.options.decoder.decode(bytes); + yield decoded; } - 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"() { +// node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/MessageEncoderStream.js +var MessageEncoderStream; +var init_MessageEncoderStream = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/MessageEncoderStream.js"() { "use strict"; - init_protocols(); - init_schema2(); - init_ProtocolLib(); - init_XmlShapeDeserializer(); - init_QueryShapeSerializer(); - AwsQueryProtocol = class extends RpcProtocol { + MessageEncoderStream = class { options; - serializer; - deserializer; - mixin = new ProtocolLib(); constructor(options) { - super({ - defaultNamespace: options.defaultNamespace - }); 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, context5) { - const request3 = await super.serializeRequest(operationSchema, input, context5); - if (!request3.path.endsWith("/")) { - request3.path += "/"; - } - Object.assign(request3.headers, { - "content-type": `application/x-www-form-urlencoded` - }); - if (deref(operationSchema.input) === "unit" || !request3.body) { - request3.body = ""; - } - const action5 = operationSchema.name.split("#")[1] ?? operationSchema.name; - request3.body = `Action=${action5}&Version=${this.options.version}` + request3.body; - if (request3.body.endsWith("&")) { - request3.body = request3.body.slice(-1); - } - return request3; + [Symbol.asyncIterator]() { + return this.asyncIterator(); } - async deserializeResponse(operationSchema, context5, response) { - const deserializer = this.deserializer; - const ns2 = NormalizedSchema.of(operationSchema.output); - const dataObject = {}; - if (response.statusCode >= 300) { - const bytes2 = await collectBody(response.body, context5); - if (bytes2.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(15, bytes2)); - } - await this.handleError(operationSchema, context5, 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; + async *asyncIterator() { + for await (const msg of this.options.messageStream) { + const encoded = this.options.encoder.encode(msg); + yield encoded; } - const shortName = operationSchema.name.split("#")[1] ?? operationSchema.name; - const awsQueryResultKey = ns2.isStructSchema() && this.useNestedResult() ? shortName + "Result" : void 0; - const bytes = await collectBody(response.body, context5); - if (bytes.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(ns2, bytes, awsQueryResultKey)); + if (this.options.includeEndFrame) { + yield new Uint8Array(0); } - const output = { - $metadata: this.deserializeMetadata(response), - ...dataObject - }; - return output; } - useNestedResult() { - return true; + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.js +var SmithyMessageDecoderStream; +var init_SmithyMessageDecoderStream = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.js"() { + "use strict"; + SmithyMessageDecoderStream = class { + options; + constructor(options) { + this.options = options; } - async handleError(operationSchema, context5, response, dataObject, metadata2) { - const errorIdentifier = this.loadQueryErrorCode(response, dataObject) ?? "Unknown"; - 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, metadata2, this.mixin.findQueryCompatibleError); - const ns2 = NormalizedSchema.of(errorSchema); - const ErrorCtor = TypeRegistry.for(errorSchema[1]).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 ns2.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: ns2.getMergedTraits().error, - message - }, output), dataObject); + [Symbol.asyncIterator]() { + return this.asyncIterator(); } - loadQueryErrorCode(output, data) { - const code = (data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error)?.Code; - if (code !== void 0) { - return code; - } - if (output.statusCode == 404) { - return "NotFound"; + async *asyncIterator() { + for await (const message of this.options.messageStream) { + const deserialized = await this.options.deserializer(message); + if (deserialized === void 0) + continue; + yield deserialized; } } - loadQueryError(data) { - return data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error; - } - loadQueryErrorMessage(data) { - const errorData = this.loadQueryError(data); - return errorData?.message ?? errorData?.Message ?? data.message ?? data.Message ?? "Unknown"; - } - getDefaultContentType() { - return "application/x-www-form-urlencoded"; - } }; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js -var init_AwsEc2QueryProtocol = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js"() { +// node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageEncoderStream.js +var SmithyMessageEncoderStream; +var init_SmithyMessageEncoderStream = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageEncoderStream.js"() { "use strict"; + SmithyMessageEncoderStream = class { + options; + constructor(options) { + this.options = options; + } + [Symbol.asyncIterator]() { + return this.asyncIterator(); + } + async *asyncIterator() { + for await (const chunk of this.options.inputStream) { + const payloadBuf = this.options.serializer(chunk); + yield payloadBuf; + } + } + }; } }); -// 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/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getChunkedStream.js +function getChunkedStream(source) { + let currentMessageTotalLength = 0; + let currentMessagePendingLength = 0; + let currentMessage = null; + let messageLengthBuffer = null; + const allocateMessage = (size) => { + if (typeof size !== "number") { + throw new Error("Attempted to allocate an event message where size was not a number: " + size); + } + currentMessageTotalLength = size; + currentMessagePendingLength = 4; + currentMessage = new Uint8Array(size); + const currentMessageView = new DataView(currentMessage.buffer); + currentMessageView.setUint32(0, size, false); + }; + const iterator2 = async function* () { + const sourceIterator = source[Symbol.asyncIterator](); + while (true) { + const { value, done } = await sourceIterator.next(); + if (done) { + if (!currentMessageTotalLength) { + return; + } else if (currentMessageTotalLength === currentMessagePendingLength) { + yield currentMessage; + } else { + throw new Error("Truncated event message received."); + } + return; + } + const chunkLength = value.length; + let currentOffset = 0; + while (currentOffset < chunkLength) { + if (!currentMessage) { + const bytesRemaining = chunkLength - currentOffset; + if (!messageLengthBuffer) { + messageLengthBuffer = new Uint8Array(4); + } + const numBytesForTotal = Math.min(4 - currentMessagePendingLength, bytesRemaining); + messageLengthBuffer.set(value.slice(currentOffset, currentOffset + numBytesForTotal), currentMessagePendingLength); + currentMessagePendingLength += numBytesForTotal; + currentOffset += numBytesForTotal; + if (currentMessagePendingLength < 4) { + break; + } + allocateMessage(new DataView(messageLengthBuffer.buffer).getUint32(0, false)); + messageLengthBuffer = null; + } + const numBytesToWrite = Math.min(currentMessageTotalLength - currentMessagePendingLength, chunkLength - currentOffset); + currentMessage.set(value.slice(currentOffset, currentOffset + numBytesToWrite), currentMessagePendingLength); + currentMessagePendingLength += numBytesToWrite; + currentOffset += numBytesToWrite; + if (currentMessageTotalLength && currentMessageTotalLength === currentMessagePendingLength) { + yield currentMessage; + currentMessage = null; + currentMessageTotalLength = 0; + currentMessagePendingLength = 0; + } + } + } + }; + return { + [Symbol.asyncIterator]: iterator2 + }; +} +var init_getChunkedStream = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getChunkedStream.js"() { "use strict"; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js -var init_parseXmlBody = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js"() { +// node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.js +function getUnmarshalledStream(source, options) { + const messageUnmarshaller = getMessageUnmarshaller(options.deserializer, options.toUtf8); + return { + [Symbol.asyncIterator]: async function* () { + for await (const chunk of source) { + const message = options.eventStreamCodec.decode(chunk); + const type = await messageUnmarshaller(message); + if (type === void 0) + continue; + yield type; + } + } + }; +} +function getMessageUnmarshaller(deserializer, toUtf83) { + return async function(message) { + const { value: messageType } = message.headers[":message-type"]; + if (messageType === "error") { + const unmodeledError = new Error(message.headers[":error-message"].value || "UnknownError"); + unmodeledError.name = message.headers[":error-code"].value; + throw unmodeledError; + } else if (messageType === "exception") { + const code = message.headers[":exception-type"].value; + const exception = { [code]: message }; + const deserializedException = await deserializer(exception); + if (deserializedException.$unknown) { + const error2 = new Error(toUtf83(message.body)); + error2.name = code; + throw error2; + } + throw deserializedException[code]; + } else if (messageType === "event") { + const event = { + [message.headers[":event-type"].value]: message + }; + const deserialized = await deserializer(event); + if (deserialized.$unknown) + return; + return deserialized; + } else { + throw Error(`Unrecognizable event type: ${message.headers[":event-type"].value}`); + } + }; +} +var init_getUnmarshalledStream = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.js"() { "use strict"; } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js -var init_XmlShapeSerializer = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js"() { +// node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/EventStreamMarshaller.js +var EventStreamMarshaller, eventStreamSerdeProvider; +var init_EventStreamMarshaller = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/EventStreamMarshaller.js"() { "use strict"; + init_EventStreamCodec(); + init_MessageDecoderStream(); + init_MessageEncoderStream(); + init_SmithyMessageDecoderStream(); + init_SmithyMessageEncoderStream(); + init_getChunkedStream(); + init_getUnmarshalledStream(); + EventStreamMarshaller = class { + eventStreamCodec; + utfEncoder; + constructor({ utf8Encoder, utf8Decoder }) { + this.eventStreamCodec = new EventStreamCodec(utf8Encoder, utf8Decoder); + this.utfEncoder = utf8Encoder; + } + deserialize(body2, deserializer) { + const inputStream = getChunkedStream(body2); + return new SmithyMessageDecoderStream({ + messageStream: new MessageDecoderStream({ inputStream, decoder: this.eventStreamCodec }), + deserializer: getMessageUnmarshaller(deserializer, this.utfEncoder) + }); + } + serialize(inputStream, serializer) { + return new MessageEncoderStream({ + messageStream: new SmithyMessageEncoderStream({ inputStream, serializer }), + encoder: this.eventStreamCodec, + includeEndFrame: true + }); + } + }; + eventStreamSerdeProvider = (options) => new EventStreamMarshaller(options); } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlCodec.js -var init_XmlCodec = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlCodec.js"() { - "use strict"; +// node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde/EventStreamMarshaller.js +import { Readable as Readable8 } from "stream"; +async function* readableToIterable(readStream) { + let streamEnded = false; + let generationEnded = false; + const records = new Array(); + readStream.on("error", (err) => { + if (!streamEnded) { + streamEnded = true; + } + if (err) { + throw err; + } + }); + readStream.on("data", (data) => { + records.push(data); + }); + readStream.on("end", () => { + streamEnded = true; + }); + while (!generationEnded) { + const value = await new Promise((resolve8) => setTimeout(() => resolve8(records.shift()), 0)); + if (value) { + yield value; + } + generationEnded = streamEnded && records.length === 0; } -}); - -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js -var init_AwsRestXmlProtocol = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js"() { +} +var EventStreamMarshaller2, eventStreamSerdeProvider2; +var init_EventStreamMarshaller2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde/EventStreamMarshaller.js"() { "use strict"; + init_EventStreamMarshaller(); + EventStreamMarshaller2 = class { + universalMarshaller; + constructor({ utf8Encoder, utf8Decoder }) { + this.universalMarshaller = new EventStreamMarshaller({ + utf8Decoder, + utf8Encoder + }); + } + deserialize(body2, deserializer) { + const bodyIterable = typeof body2[Symbol.asyncIterator] === "function" ? body2 : readableToIterable(body2); + return this.universalMarshaller.deserialize(bodyIterable, deserializer); + } + serialize(input, serializer) { + return Readable8.from(this.universalMarshaller.serialize(input, serializer)); + } + }; + eventStreamSerdeProvider2 = (options) => new EventStreamMarshaller2(options); } }); -// node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js -var init_protocols2 = __esm({ - "node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde/utils.js +var readableStreamToIterable, iterableToReadableStream; +var init_utils = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde/utils.js"() { "use strict"; - 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(); + readableStreamToIterable = (readableStream) => ({ + [Symbol.asyncIterator]: async function* () { + const reader = readableStream.getReader(); + try { + while (true) { + const { done, value } = await reader.read(); + if (done) + return; + yield value; + } + } finally { + reader.releaseLock(); + } + } + }); + iterableToReadableStream = (asyncIterable) => { + const iterator2 = asyncIterable[Symbol.asyncIterator](); + return new ReadableStream({ + async pull(controller) { + const { done, value } = await iterator2.next(); + if (done) { + return controller.close(); + } + controller.enqueue(value); + } + }); + }; } }); -// node_modules/@aws-sdk/core/dist-es/index.js -var init_dist_es29 = __esm({ - "node_modules/@aws-sdk/core/dist-es/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-config-resolver/EventStreamSerdeConfig.js +var resolveEventStreamSerdeConfig; +var init_EventStreamSerdeConfig = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-config-resolver/EventStreamSerdeConfig.js"() { "use strict"; - init_client2(); - init_httpAuthSchemes2(); - init_protocols2(); + resolveEventStreamSerdeConfig = (input) => Object.assign(input, { + eventStreamMarshaller: input.eventStreamSerdeProvider(input) + }); } }); -// node_modules/@smithy/util-retry/dist-es/config.js -var RETRY_MODES, DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE; -var init_config2 = __esm({ - "node_modules/@smithy/util-retry/dist-es/config.js"() { +// node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +var EventStreamSerde; +var init_EventStreamSerde = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js"() { "use strict"; - (function(RETRY_MODES2) { - RETRY_MODES2["STANDARD"] = "standard"; - RETRY_MODES2["ADAPTIVE"] = "adaptive"; - })(RETRY_MODES || (RETRY_MODES = {})); - DEFAULT_MAX_ATTEMPTS = 3; - DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD; + init_serde2(); + 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 body2 = serializer.flush(); + yield { + [initialRequestMarker]: true, + headers, + body: body2 + }; + } + 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: body2, 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: body2 + }; + }); + } + 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 body2 = event[unionMember].body; + if (unionMember === "initial-response") { + const dataObject = await this.deserializer.read(responseSchema, body2); + 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] = body2; + } else if (member2.isStringSchema()) { + out[name] = (this.serdeContext?.utf8Encoder ?? toUtf8)(body2); + } else if (member2.isStructSchema()) { + out[name] = await this.deserializer.read(member2, body2); + } + } 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 (body2.byteLength === 0) { + return { + [unionMember]: {} + }; + } + } + return { + [unionMember]: await this.deserializer.read(eventStreamSchema, body2) + }; + } 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 struct = unionSchema.getSchema(); + return struct[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 body2 = typeof messageSerialization === "string" ? (this.serdeContext?.utf8Decoder ?? fromUtf8)(messageSerialization) : messageSerialization; + return { + body: body2, + eventType, + explicitPayloadContentType, + additionalHeaders + }; + } + }; } }); -// node_modules/@smithy/service-error-classification/dist-es/constants.js -var THROTTLING_ERROR_CODES, TRANSIENT_ERROR_CODES, TRANSIENT_ERROR_STATUS_CODES, NODEJS_TIMEOUT_ERROR_CODES2, NODEJS_NETWORK_ERROR_CODES; -var init_constants4 = __esm({ - "node_modules/@smithy/service-error-classification/dist-es/constants.js"() { - "use strict"; - THROTTLING_ERROR_CODES = [ - "BandwidthLimitExceeded", - "EC2ThrottledException", - "LimitExceededException", - "PriorRequestNotComplete", - "ProvisionedThroughputExceededException", - "RequestLimitExceeded", - "RequestThrottled", - "RequestThrottledException", - "SlowDown", - "ThrottledException", - "Throttling", - "ThrottlingException", - "TooManyRequestsException", - "TransactionInProgressException" - ]; - TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; - TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; - NODEJS_TIMEOUT_ERROR_CODES2 = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; - NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND"]; - } +// node_modules/@smithy/core/dist-es/submodules/event-streams/index.js +var event_streams_exports = {}; +__export(event_streams_exports, { + EventStreamCodec: () => EventStreamCodec, + EventStreamMarshaller: () => EventStreamMarshaller2, + EventStreamSerde: () => EventStreamSerde, + HeaderMarshaller: () => HeaderMarshaller, + Int64: () => Int64, + MessageDecoderStream: () => MessageDecoderStream, + MessageEncoderStream: () => MessageEncoderStream, + SmithyMessageDecoderStream: () => SmithyMessageDecoderStream, + SmithyMessageEncoderStream: () => SmithyMessageEncoderStream, + UniversalEventStreamMarshaller: () => EventStreamMarshaller, + eventStreamSerdeProvider: () => eventStreamSerdeProvider2, + getChunkedStream: () => getChunkedStream, + getMessageUnmarshaller: () => getMessageUnmarshaller, + getUnmarshalledStream: () => getUnmarshalledStream, + iterableToReadableStream: () => iterableToReadableStream, + readableStreamToIterable: () => readableStreamToIterable, + resolveEventStreamSerdeConfig: () => resolveEventStreamSerdeConfig, + universalEventStreamSerdeProvider: () => eventStreamSerdeProvider }); - -// node_modules/@smithy/service-error-classification/dist-es/index.js -var isRetryableByTrait, isClockSkewCorrectedError, isBrowserNetworkError, isThrottlingError, isTransientError, isServerError; -var init_dist_es30 = __esm({ - "node_modules/@smithy/service-error-classification/dist-es/index.js"() { +var init_event_streams = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/index.js"() { "use strict"; - init_constants4(); - isRetryableByTrait = (error2) => error2?.$retryable !== void 0; - isClockSkewCorrectedError = (error2) => error2.$metadata?.clockSkewCorrected; - isBrowserNetworkError = (error2) => { - 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 = error2 && error2 instanceof TypeError; - if (!isValid) { - return false; - } - return errorMessages.has(error2.message); - }; - isThrottlingError = (error2) => error2.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error2.name) || error2.$retryable?.throttling == true; - isTransientError = (error2, depth = 0) => isRetryableByTrait(error2) || isClockSkewCorrectedError(error2) || TRANSIENT_ERROR_CODES.includes(error2.name) || NODEJS_TIMEOUT_ERROR_CODES2.includes(error2?.code || "") || NODEJS_NETWORK_ERROR_CODES.includes(error2?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error2.$metadata?.httpStatusCode || 0) || isBrowserNetworkError(error2) || error2.cause !== void 0 && depth <= 10 && isTransientError(error2.cause, depth + 1); - isServerError = (error2) => { - if (error2.$metadata?.httpStatusCode !== void 0) { - const statusCode = error2.$metadata.httpStatusCode; - if (500 <= statusCode && statusCode <= 599 && !isTransientError(error2)) { - return true; - } - return false; - } - return false; - }; + init_EventStreamCodec(); + init_HeaderMarshaller(); + init_Int64(); + init_MessageDecoderStream(); + init_MessageEncoderStream(); + init_SmithyMessageDecoderStream(); + init_SmithyMessageEncoderStream(); + init_EventStreamMarshaller2(); + init_utils(); + init_EventStreamMarshaller(); + init_getChunkedStream(); + init_getUnmarshalledStream(); + init_EventStreamSerdeConfig(); + init_EventStreamSerde(); } }); -// node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js -var DefaultRateLimiter; -var init_DefaultRateLimiter = __esm({ - "node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js"() { +// node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +var HttpProtocol; +var init_HttpProtocol = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js"() { "use strict"; - init_dist_es30(); - DefaultRateLimiter = class _DefaultRateLimiter { - static setTimeoutFn = setTimeout; - beta; - minCapacity; - minFillRate; - scaleConstant; - smooth; - currentCapacity = 0; - enabled = false; - lastMaxRate = 0; - measuredTxRate = 0; - requestCount = 0; - fillRate; - lastThrottleTime; - lastTimestamp = 0; - lastTxRateBucket; - maxCapacity; - timeWindow = 0; + init_schema2(); + init_transport(); + init_SerdeContext(); + HttpProtocol = class extends SerdeContext { + options; + compositeErrorRegistry; 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; - const currentTimeInSeconds = this.getCurrentTimeInSeconds(); - this.lastThrottleTime = currentTimeInSeconds; - this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds()); - this.fillRate = this.minFillRate; - this.maxCapacity = this.minCapacity; + super(); + this.options = options; + this.compositeErrorRegistry = TypeRegistry.for(options.defaultNamespace); + for (const etr of options.errorTypeRegistries ?? []) { + this.compositeErrorRegistry.copyFrom(etr); + } } - getCurrentTimeInSeconds() { - return Date.now() / 1e3; + getRequestType() { + return HttpRequest; } - async getSendToken() { - return this.acquireTokenBucket(1); + getResponseType() { + return HttpResponse; } - async acquireTokenBucket(amount) { - if (!this.enabled) { - return; + setSerdeContext(serdeContext) { + this.serdeContext = serdeContext; + this.serializer.setSerdeContext(serdeContext); + this.deserializer.setSerdeContext(serdeContext); + if (this.getPayloadCodec()) { + this.getPayloadCodec().setSerdeContext(serdeContext); } - this.refillTokenBucket(); - if (amount > this.currentCapacity) { - const delay4 = (amount - this.currentCapacity) / this.fillRate * 1e3; - await new Promise((resolve4) => _DefaultRateLimiter.setTimeoutFn(resolve4, delay4)); + } + updateServiceEndpoint(request2, endpoint2) { + if ("url" in endpoint2) { + request2.protocol = endpoint2.url.protocol; + request2.hostname = endpoint2.url.hostname; + request2.port = endpoint2.url.port ? Number(endpoint2.url.port) : void 0; + request2.path = endpoint2.url.pathname; + request2.fragment = endpoint2.url.hash || void 0; + request2.username = endpoint2.url.username || void 0; + request2.password = endpoint2.url.password || void 0; + if (!request2.query) { + request2.query = {}; + } + for (const [k7, v2] of endpoint2.url.searchParams.entries()) { + request2.query[k7] = v2; + } + if (endpoint2.headers) { + for (const name in endpoint2.headers) { + request2.headers[name] = endpoint2.headers[name].join(", "); + } + } + return request2; + } else { + request2.protocol = endpoint2.protocol; + request2.hostname = endpoint2.hostname; + request2.port = endpoint2.port ? Number(endpoint2.port) : void 0; + request2.path = endpoint2.path; + request2.query = { + ...endpoint2.query + }; + if (endpoint2.headers) { + for (const name in endpoint2.headers) { + request2.headers[name] = endpoint2.headers[name]; + } + } + return request2; } - this.currentCapacity = this.currentCapacity - amount; } - refillTokenBucket() { - const timestamp = this.getCurrentTimeInSeconds(); - if (!this.lastTimestamp) { - this.lastTimestamp = timestamp; + setHostPrefix(request2, operationSchema, input) { + if (this.serdeContext?.disableHostPrefix) { return; } - const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate; - this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount); - this.lastTimestamp = timestamp; - } - updateClientSendingRate(response) { - let calculatedRate; - this.updateMeasuredRate(); - if (isThrottlingError(response)) { - const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate); - this.lastMaxRate = rateToUse; - this.calculateTimeWindow(); - this.lastThrottleTime = this.getCurrentTimeInSeconds(); - calculatedRate = this.cubicThrottle(rateToUse); - this.enableTokenBucket(); - } else { - this.calculateTimeWindow(); - calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds()); + const 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); + } + request2.hostname = hostPrefix + request2.hostname; + } } - const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate); - this.updateTokenBucketRate(newRate); } - calculateTimeWindow() { - this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3)); + 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"] + }; } - cubicThrottle(rateToUse) { - return this.getPrecise(rateToUse * this.beta); + async serializeEventStream({ eventStream, requestSchema, initialRequest }) { + const eventStreamSerde = await this.loadEventStreamCapability(); + return eventStreamSerde.serializeEventStream({ + eventStream, + requestSchema, + initialRequest + }); } - cubicSuccess(timestamp) { - return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate); + async deserializeEventStream({ response, responseSchema, initialResponseContainer }) { + const eventStreamSerde = await this.loadEventStreamCapability(); + return eventStreamSerde.deserializeEventStream({ + response, + responseSchema, + initialResponseContainer + }); } - enableTokenBucket() { - this.enabled = true; + 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() + }); } - updateTokenBucketRate(newRate) { - this.refillTokenBucket(); - this.fillRate = Math.max(newRate, this.minFillRate); - this.maxCapacity = Math.max(newRate, this.minCapacity); - this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity); + getDefaultContentType() { + throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`); } - updateMeasuredRate() { - const t6 = this.getCurrentTimeInSeconds(); - const timeBucket = Math.floor(t6 * 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; - } + async deserializeHttpMessage(schema, context5, response, arg4, arg5) { + void schema; + void context5; + void response; + void arg4; + void arg5; + return []; } - getPrecise(num) { - return parseFloat(num.toFixed(8)); + getEventStreamMarshaller() { + const context5 = this.serdeContext; + if (!context5.eventStreamMarshaller) { + throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext."); + } + return context5.eventStreamMarshaller; } }; } }); -// node_modules/@smithy/util-retry/dist-es/constants.js -var DEFAULT_RETRY_DELAY_BASE, MAXIMUM_RETRY_DELAY, THROTTLING_RETRY_DELAY_BASE, INITIAL_RETRY_TOKENS, RETRY_COST, TIMEOUT_RETRY_COST, NO_RETRY_INCREMENT, INVOCATION_ID_HEADER, REQUEST_HEADER; -var init_constants5 = __esm({ - "node_modules/@smithy/util-retry/dist-es/constants.js"() { - "use strict"; - DEFAULT_RETRY_DELAY_BASE = 100; - MAXIMUM_RETRY_DELAY = 20 * 1e3; - THROTTLING_RETRY_DELAY_BASE = 500; - INITIAL_RETRY_TOKENS = 500; - RETRY_COST = 5; - TIMEOUT_RETRY_COST = 10; - NO_RETRY_INCREMENT = 1; - INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; - REQUEST_HEADER = "amz-sdk-request"; - } -}); - -// node_modules/@smithy/util-retry/dist-es/defaultRetryBackoffStrategy.js -var getDefaultRetryBackoffStrategy; -var init_defaultRetryBackoffStrategy = __esm({ - "node_modules/@smithy/util-retry/dist-es/defaultRetryBackoffStrategy.js"() { - "use strict"; - init_constants5(); - getDefaultRetryBackoffStrategy = () => { - let delayBase = DEFAULT_RETRY_DELAY_BASE; - const computeNextBackoffDelay = (attempts) => { - return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); - }; - const setDelayBase = (delay4) => { - delayBase = delay4; - }; - return { - computeNextBackoffDelay, - setDelayBase - }; - }; - } -}); - -// node_modules/@smithy/util-retry/dist-es/defaultRetryToken.js -var createDefaultRetryToken; -var init_defaultRetryToken = __esm({ - "node_modules/@smithy/util-retry/dist-es/defaultRetryToken.js"() { - "use strict"; - init_constants5(); - createDefaultRetryToken = ({ retryDelay, retryCount, retryCost }) => { - const getRetryCount = () => retryCount; - const getRetryDelay = () => Math.min(MAXIMUM_RETRY_DELAY, retryDelay); - const getRetryCost = () => retryCost; - return { - getRetryCount, - getRetryDelay, - getRetryCost - }; - }; - } -}); - -// node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js -var StandardRetryStrategy; -var init_StandardRetryStrategy = __esm({ - "node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js"() { +// node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +var HttpBindingProtocol; +var init_HttpBindingProtocol = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js"() { "use strict"; - init_config2(); - init_constants5(); - init_defaultRetryBackoffStrategy(); - init_defaultRetryToken(); - StandardRetryStrategy = class { - maxAttempts; - mode = RETRY_MODES.STANDARD; - capacity = INITIAL_RETRY_TOKENS; - retryBackoffStrategy = getDefaultRetryBackoffStrategy(); - maxAttemptsProvider; - constructor(maxAttempts) { - this.maxAttempts = maxAttempts; - this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts; - } - async acquireInitialRetryToken(retryTokenScope) { - return createDefaultRetryToken({ - retryDelay: DEFAULT_RETRY_DELAY_BASE, - retryCount: 0 + init_schema2(); + init_serde2(); + init_transport(); + init_HttpProtocol(); + init_collect_stream_body(); + init_extended_encode_uri_component(); + HttpBindingProtocol = class extends HttpProtocol { + async serializeRequest(operationSchema, _input, context5) { + const input = _input && typeof _input === "object" ? _input : {}; + const serializer = this.serializer; + const query = {}; + const headers = {}; + const endpoint2 = await context5.endpoint(); + const ns2 = NormalizedSchema.of(operationSchema?.input); + const payloadMemberNames = []; + const payloadMemberSchemas = []; + let hasNonHttpBindingMember = false; + let payload; + const request2 = new HttpRequest({ + protocol: "", + hostname: "", + port: void 0, + path: "", + fragment: void 0, + query, + headers, + body: void 0 }); - } - async refreshRetryTokenForRetry(token, errorInfo) { - const maxAttempts = await this.getMaxAttempts(); - if (this.shouldRetry(token, errorInfo, maxAttempts)) { - const errorType = errorInfo.errorType; - this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE); - const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount()); - const retryDelay = errorInfo.retryAfterHint ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) : delayFromErrorType; - const capacityCost = this.getCapacityCost(errorType); - this.capacity -= capacityCost; - return createDefaultRetryToken({ - retryDelay, - retryCount: token.getRetryCount() + 1, - retryCost: capacityCost - }); + if (endpoint2) { + this.updateServiceEndpoint(request2, endpoint2); + this.setHostPrefix(request2, operationSchema, input); + const opTraits = translateTraits(operationSchema.traits); + if (opTraits.http) { + request2.method = opTraits.http[0]; + const [path10, search] = opTraits.http[1].split("?"); + if (request2.path == "/") { + request2.path = path10; + } else { + request2.path += path10; + } + const traitSearchParams = new URLSearchParams(search ?? ""); + for (const [key, value] of traitSearchParams) { + query[key] = value; + } + } } - throw new Error("No retry token available"); - } - recordSuccess(token) { - this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT)); - } - getCapacity() { - return this.capacity; - } - async getMaxAttempts() { - try { - return await this.maxAttemptsProvider(); - } catch (error2) { - console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`); - return DEFAULT_MAX_ATTEMPTS; + for (const [memberName, memberNs] of ns2.structIterator()) { + const memberTraits = memberNs.getMergedTraits() ?? {}; + const inputMemberValue = input[memberName]; + if (inputMemberValue == null && !memberNs.isIdempotencyToken()) { + if (memberTraits.httpLabel) { + if (request2.path.includes(`{${memberName}+}`) || request2.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]) { + payload = await this.serializeEventStream({ + eventStream: input[memberName], + requestSchema: ns2 + }); + } + } else { + payload = inputMemberValue; + } + } else { + serializer.write(memberNs, inputMemberValue); + payload = serializer.flush(); + } + } else if (memberTraits.httpLabel) { + serializer.write(memberNs, inputMemberValue); + const replacement = serializer.flush(); + if (request2.path.includes(`{${memberName}+}`)) { + request2.path = request2.path.replace(`{${memberName}+}`, replacement.split("/").map(extendedEncodeURIComponent).join("/")); + } else if (request2.path.includes(`{${memberName}}`)) { + request2.path = request2.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] = (ns2.getName(true) ?? "#Unknown").split("#"); + const requiredMembers = ns2.getSchema()[6]; + const payloadSchema = [ + 3, + namespace, + name, + ns2.getMergedTraits(), + payloadMemberNames, + payloadMemberSchemas, + void 0 + ]; + if (requiredMembers) { + payloadSchema[6] = requiredMembers; + } else { + payloadSchema.pop(); + } + serializer.write(payloadSchema, input); + payload = serializer.flush(); } + request2.headers = headers; + request2.query = query; + request2.body = payload; + return request2; } - shouldRetry(tokenToRenew, errorInfo, maxAttempts) { - const attempts = tokenToRenew.getRetryCount() + 1; - return attempts < maxAttempts && this.capacity >= this.getCapacityCost(errorInfo.errorType) && this.isRetryableError(errorInfo.errorType); + serializeQuery(ns2, data, query) { + const serializer = this.serializer; + const traits = ns2.getMergedTraits(); + if (traits.httpQueryParams) { + for (const key in data) { + if (!(key in query)) { + const val = data[key]; + const valueSchema = ns2.getValueSchema(); + Object.assign(valueSchema.getMergedTraits(), { + ...traits, + httpQuery: key, + httpQueryParams: void 0 + }); + this.serializeQuery(valueSchema, val, query); + } + } + return; + } + if (ns2.isListSchema()) { + const sparse = !!ns2.getMergedTraits().sparse; + const buffer2 = []; + for (const item of data) { + serializer.write([ns2.getValueSchema(), traits], item); + const serializable = serializer.flush(); + if (sparse || serializable !== void 0) { + buffer2.push(serializable); + } + } + query[traits.httpQuery] = buffer2; + } else { + serializer.write([ns2, traits], data); + query[traits.httpQuery] = serializer.flush(); + } } - getCapacityCost(errorType) { - return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST; + async deserializeResponse(operationSchema, context5, response) { + const deserializer = this.deserializer; + const ns2 = NormalizedSchema.of(operationSchema.output); + const dataObject = {}; + if (response.statusCode >= 300) { + const bytes = await collectBody(response.body, context5); + if (bytes.byteLength > 0) { + Object.assign(dataObject, await deserializer.read(15, bytes)); + } + await this.handleError(operationSchema, context5, 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(ns2, context5, response, dataObject); + if (nonHttpBindingMembers.length) { + const bytes = await collectBody(response.body, context5); + if (bytes.byteLength > 0) { + const dataFromBody = await deserializer.read(ns2, bytes); + for (const member2 of nonHttpBindingMembers) { + if (dataFromBody[member2] != null) { + dataObject[member2] = dataFromBody[member2]; + } + } + } + } else if (nonHttpBindingMembers.discardResponseBody) { + await collectBody(response.body, context5); + } + dataObject.$metadata = this.deserializeMetadata(response); + return dataObject; } - isRetryableError(errorType) { - return errorType === "THROTTLING" || errorType === "TRANSIENT"; + async deserializeHttpMessage(schema, context5, response, arg4, arg5) { + let dataObject; + if (arg4 instanceof Set) { + dataObject = arg5; + } else { + dataObject = arg4; + } + let discardResponseBody = true; + const deserializer = this.deserializer; + const ns2 = NormalizedSchema.of(schema); + const nonHttpBindingMembers = []; + for (const [memberName, memberSchema] of ns2.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: ns2 + }); + } else { + dataObject[memberName] = sdkStreamMixin2(response.body); + } + } else if (response.body) { + const bytes = await collectBody(response.body, context5); + 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 list = []; + for (const section of sections) { + list.push(await deserializer.read(headerListValueSchema, section.trim())); + } + dataObject[memberName] = list; + } 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/util-retry/dist-es/AdaptiveRetryStrategy.js -var AdaptiveRetryStrategy; -var init_AdaptiveRetryStrategy = __esm({ - "node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js"() { +// node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +var RpcProtocol; +var init_RpcProtocol = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js"() { "use strict"; - init_config2(); - init_DefaultRateLimiter(); - init_StandardRetryStrategy(); - AdaptiveRetryStrategy = class { - maxAttemptsProvider; - rateLimiter; - standardRetryStrategy; - mode = RETRY_MODES.ADAPTIVE; - constructor(maxAttemptsProvider, options) { - this.maxAttemptsProvider = maxAttemptsProvider; - const { rateLimiter } = options ?? {}; - this.rateLimiter = rateLimiter ?? new DefaultRateLimiter(); - this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider); - } - async acquireInitialRetryToken(retryTokenScope) { - await this.rateLimiter.getSendToken(); - return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); - } - async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { - this.rateLimiter.updateClientSendingRate(errorInfo); - return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + init_schema2(); + init_transport(); + init_HttpProtocol(); + init_collect_stream_body(); + RpcProtocol = class extends HttpProtocol { + async serializeRequest(operationSchema, _input, context5) { + const serializer = this.serializer; + const query = {}; + const headers = {}; + const endpoint2 = await context5.endpoint(); + const ns2 = NormalizedSchema.of(operationSchema?.input); + const schema = ns2.getSchema(); + let payload; + const input = _input && typeof _input === "object" ? _input : {}; + const request2 = new HttpRequest({ + protocol: "", + hostname: "", + port: void 0, + path: "/", + fragment: void 0, + query, + headers, + body: void 0 + }); + if (endpoint2) { + this.updateServiceEndpoint(request2, endpoint2); + this.setHostPrefix(request2, operationSchema, input); + } + if (input) { + const eventStreamMember = ns2.getEventStreamMember(); + if (eventStreamMember) { + if (input[eventStreamMember]) { + const initialRequest = {}; + for (const [memberName, memberSchema] of ns2.structIterator()) { + if (memberName !== eventStreamMember && input[memberName]) { + serializer.write(memberSchema, input[memberName]); + initialRequest[memberName] = serializer.flush(); + } + } + payload = await this.serializeEventStream({ + eventStream: input[eventStreamMember], + requestSchema: ns2, + initialRequest + }); + } + } else { + serializer.write(schema, input); + payload = serializer.flush(); + } + } + request2.headers = Object.assign(request2.headers, headers); + request2.query = query; + request2.body = payload; + request2.method = "POST"; + return request2; } - recordSuccess(token) { - this.rateLimiter.updateClientSendingRate({}); - this.standardRetryStrategy.recordSuccess(token); + async deserializeResponse(operationSchema, context5, response) { + const deserializer = this.deserializer; + const ns2 = NormalizedSchema.of(operationSchema.output); + const dataObject = {}; + if (response.statusCode >= 300) { + const bytes = await collectBody(response.body, context5); + if (bytes.byteLength > 0) { + Object.assign(dataObject, await deserializer.read(15, bytes)); + } + await this.handleError(operationSchema, context5, 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 = ns2.getEventStreamMember(); + if (eventStreamMember) { + dataObject[eventStreamMember] = await this.deserializeEventStream({ + response, + responseSchema: ns2, + initialResponseContainer: dataObject + }); + } else { + const bytes = await collectBody(response.body, context5); + if (bytes.byteLength > 0) { + Object.assign(dataObject, await deserializer.read(ns2, bytes)); + } + } + dataObject.$metadata = this.deserializeMetadata(response); + return dataObject; } }; } }); -// node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js -var init_ConfiguredRetryStrategy = __esm({ - "node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/util-retry/dist-es/types.js -var init_types4 = __esm({ - "node_modules/@smithy/util-retry/dist-es/types.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/util-retry/dist-es/index.js -var init_dist_es31 = __esm({ - "node_modules/@smithy/util-retry/dist-es/index.js"() { - "use strict"; - init_AdaptiveRetryStrategy(); - init_ConfiguredRetryStrategy(); - init_DefaultRateLimiter(); - init_StandardRetryStrategy(); - init_config2(); - init_constants5(); - init_types4(); - } -}); - -// node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js -async function checkFeatures(context5, config, args) { - const request3 = args.request; - if (request3?.headers?.["smithy-protocol"] === "rpc-v2-cbor") { - setFeature2(context5, "PROTOCOL_RPC_V2_CBOR", "M"); - } - if (typeof config.retryStrategy === "function") { - const retryStrategy = await config.retryStrategy(); - if (typeof retryStrategy.mode === "string") { - switch (retryStrategy.mode) { - case RETRY_MODES.ADAPTIVE: - setFeature2(context5, "RETRY_MODE_ADAPTIVE", "F"); - break; - case RETRY_MODES.STANDARD: - setFeature2(context5, "RETRY_MODE_STANDARD", "E"); - break; - } - } - } - if (typeof config.accountIdEndpointMode === "function") { - const endpointV2 = context5.endpointV2; - if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) { - setFeature2(context5, "ACCOUNT_ID_ENDPOINT", "O"); - } - switch (await config.accountIdEndpointMode?.()) { - case "disabled": - setFeature2(context5, "ACCOUNT_ID_MODE_DISABLED", "Q"); - break; - case "preferred": - setFeature2(context5, "ACCOUNT_ID_MODE_PREFERRED", "P"); - break; - case "required": - setFeature2(context5, "ACCOUNT_ID_MODE_REQUIRED", "R"); - break; - } - } - const identity = context5.__smithy_context?.selectedHttpAuthScheme?.identity; - if (identity?.$source) { - const credentials = identity; - if (credentials.accountId) { - setFeature2(context5, "RESOLVED_ACCOUNT_ID", "T"); - } - for (const [key, value] of Object.entries(credentials.$source ?? {})) { - setFeature2(context5, key, value); - } - } -} -var ACCOUNT_ID_ENDPOINT_REGEX; -var init_check_features = __esm({ - "node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js"() { +// node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js +var init_resolve_path = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js"() { "use strict"; - init_dist_es29(); - init_dist_es31(); - ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/; } }); -// node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js -var USER_AGENT, X_AMZ_USER_AGENT, SPACE, UA_NAME_SEPARATOR, UA_NAME_ESCAPE_REGEX, UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR; -var init_constants6 = __esm({ - "node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js"() { +// node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js +var init_requestBuilder = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js"() { "use strict"; - USER_AGENT = "user-agent"; - X_AMZ_USER_AGENT = "x-amz-user-agent"; - SPACE = " "; - UA_NAME_SEPARATOR = "/"; - UA_NAME_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w]/g; - UA_VALUE_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w#]/g; - UA_ESCAPE_CHAR = "-"; } }); -// node_modules/@aws-sdk/middleware-user-agent/dist-es/encode-features.js -function encodeFeatures(features) { - let buffer2 = ""; - for (const key in features) { - const val = features[key]; - if (buffer2.length + val.length + 1 <= BYTE_LIMIT) { - if (buffer2.length) { - buffer2 += "," + val; - } else { - buffer2 += val; - } - continue; +// node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js +function determineTimestampFormat(ns2, settings) { + if (settings.timestampFormat.useTrait) { + if (ns2.isTimestampSchema() && (ns2.getSchema() === 5 || ns2.getSchema() === 6 || ns2.getSchema() === 7)) { + return ns2.getSchema(); } - break; } - return buffer2; + const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns2.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 BYTE_LIMIT; -var init_encode_features = __esm({ - "node_modules/@aws-sdk/middleware-user-agent/dist-es/encode-features.js"() { +var init_determineTimestampFormat = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js"() { "use strict"; - BYTE_LIMIT = 1024; } }); -// node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js -var userAgentMiddleware, escapeUserAgent, getUserAgentMiddlewareOptions, getUserAgentPlugin; -var init_user_agent_middleware = __esm({ - "node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js"() { +// node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js +var FromStringShapeDeserializer; +var init_FromStringShapeDeserializer = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js"() { "use strict"; - init_dist_es23(); - init_dist_es2(); - init_check_features(); - init_constants6(); - init_encode_features(); - userAgentMiddleware = (options) => (next, context5) => async (args) => { - const { request: request3 } = args; - if (!HttpRequest.isInstance(request3)) { - return next(args); - } - const { headers } = request3; - const userAgent2 = context5?.userAgent?.map(escapeUserAgent) || []; - const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent); - await checkFeatures(context5, options, args); - const awsContext = context5; - defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context5.__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}`])); + init_schema2(); + init_serde2(); + init_SerdeContext(); + init_determineTimestampFormat(); + FromStringShapeDeserializer = class extends SerdeContext { + settings; + constructor(settings) { + super(); + this.settings = settings; } - const prefix2 = getUserAgentPrefix(); - const sdkUserAgentValue = (prefix2 ? [prefix2] : []).concat([...defaultUserAgent, ...userAgent2, ...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_AGENT]} ${normalUAValue}` : normalUAValue; + read(_schema, data) { + const ns2 = NormalizedSchema.of(_schema); + if (ns2.isListSchema()) { + return splitHeader(data).map((item) => this.read(ns2.getValueSchema(), item)); } - headers[USER_AGENT] = sdkUserAgentValue; - } else { - headers[X_AMZ_USER_AGENT] = sdkUserAgentValue; - } - return next({ - ...args, - request: request3 - }); - }; - 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 version3 = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR); - const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR); - const prefix2 = name.substring(0, prefixSeparatorIndex); - let uaName = name.substring(prefixSeparatorIndex + 1); - if (prefix2 === "api") { - uaName = uaName.toLowerCase(); - } - return [prefix2, uaName, version3].filter((item) => item && item.length > 0).reduce((acc, item, index2) => { - switch (index2) { - case 0: - return item; - case 1: - return `${acc}/${item}`; - default: - return `${acc}#${item}`; + if (ns2.isBlobSchema()) { + return (this.serdeContext?.base64Decoder ?? fromBase64)(data); } - }, ""); - }; - getUserAgentMiddlewareOptions = { - name: "getUserAgentMiddleware", - step: "build", - priority: "low", - tags: ["SET_USER_AGENT", "USER_AGENT"], - override: true - }; - getUserAgentPlugin = (config) => ({ - applyToStack: (clientStack) => { - clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions); - } - }); - } -}); - -// node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js -var init_dist_es32 = __esm({ - "node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js"() { - "use strict"; - init_configurations(); - init_user_agent_middleware(); - } -}); - -// node_modules/tslib/tslib.es6.mjs -function __awaiter15(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); - }); - } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e6) { - reject2(e6); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e6) { - reject2(e6); - } - } - function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body2) { - var _3 = { label: 0, sent: function() { - if (t6[0] & 1) throw t6[1]; - return t6[1]; - }, trys: [], ops: [] }, f6, y2, t6, g6 = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g6.next = verb(0), g6["throw"] = verb(1), g6["return"] = verb(2), typeof Symbol === "function" && (g6[Symbol.iterator] = function() { - return this; - }), g6; - function verb(n12) { - return function(v8) { - return step([n12, v8]); - }; - } - function step(op) { - if (f6) throw new TypeError("Generator is already executing."); - while (g6 && (g6 = 0, op[0] && (_3 = 0)), _3) try { - if (f6 = 1, y2 && (t6 = op[0] & 2 ? y2["return"] : op[0] ? y2["throw"] || ((t6 = y2["return"]) && t6.call(y2), 0) : y2.next) && !(t6 = t6.call(y2, op[1])).done) return t6; - if (y2 = 0, t6) op = [op[0] & 2, t6.value]; - switch (op[0]) { - case 0: - case 1: - t6 = op; - break; - case 4: - _3.label++; - return { value: op[1], done: false }; - case 5: - _3.label++; - y2 = op[1]; - op = [0]; - continue; - case 7: - op = _3.ops.pop(); - _3.trys.pop(); - continue; - default: - if (!(t6 = _3.trys, t6 = t6.length > 0 && t6[t6.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _3 = 0; - continue; - } - if (op[0] === 3 && (!t6 || op[1] > t6[0] && op[1] < t6[3])) { - _3.label = op[1]; - break; - } - if (op[0] === 6 && _3.label < t6[1]) { - _3.label = t6[1]; - t6 = op; - break; + if (ns2.isTimestampSchema()) { + const format4 = determineTimestampFormat(ns2, this.settings); + switch (format4) { + case 5: + return _parseRfc3339DateTimeWithOffset(data); + case 6: + return _parseRfc7231DateTime(data); + case 7: + return _parseEpochTimestamp(data); + default: + console.warn("Missing timestamp format, parsing value with Date constructor:", data); + return new Date(data); } - if (t6 && _3.label < t6[2]) { - _3.label = t6[2]; - _3.ops.push(op); - break; + } + if (ns2.isStringSchema()) { + const mediaType = ns2.getMergedTraits().mediaType; + let intermediateValue = data; + if (mediaType) { + if (ns2.getMergedTraits().httpHeader) { + intermediateValue = this.base64ToUtf8(intermediateValue); + } + const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); + if (isJson) { + intermediateValue = LazyJsonString.from(intermediateValue); + } + return intermediateValue; } - if (t6[2]) _3.ops.pop(); - _3.trys.pop(); - continue; - } - op = body2.call(thisArg, _3); - } catch (e6) { - op = [6, e6]; - y2 = 0; - } finally { - f6 = t6 = 0; - } - if (op[0] & 5) throw op[1]; - return { value: op[0] ? op[1] : void 0, done: true }; - } -} -function __values(o6) { - var s6 = typeof Symbol === "function" && Symbol.iterator, m6 = s6 && o6[s6], i6 = 0; - if (m6) return m6.call(o6); - if (o6 && typeof o6.length === "number") return { - next: function() { - if (o6 && i6 >= o6.length) o6 = void 0; - return { value: o6 && o6[i6++], done: !o6 }; - } - }; - throw new TypeError(s6 ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -var init_tslib_es6 = __esm({ - "node_modules/tslib/tslib.es6.mjs"() { - "use strict"; - } -}); - -// node_modules/@aws-crypto/util/node_modules/@smithy/is-array-buffer/dist-es/index.js -var init_dist_es33 = __esm({ - "node_modules/@aws-crypto/util/node_modules/@smithy/is-array-buffer/dist-es/index.js"() { - "use strict"; - } -}); - -// node_modules/@aws-crypto/util/node_modules/@smithy/util-buffer-from/dist-es/index.js -import { Buffer as Buffer4 } from "buffer"; -var fromString2; -var init_dist_es34 = __esm({ - "node_modules/@aws-crypto/util/node_modules/@smithy/util-buffer-from/dist-es/index.js"() { - "use strict"; - init_dist_es33(); - fromString2 = (input, encoding) => { - if (typeof input !== "string") { - throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); + } + if (ns2.isNumericSchema()) { + return Number(data); + } + if (ns2.isBigIntegerSchema()) { + return BigInt(data); + } + if (ns2.isBigDecimalSchema()) { + return new NumericValue(data, "bigDecimal"); + } + if (ns2.isBooleanSchema()) { + return String(data).toLowerCase() === "true"; + } + return data; + } + base64ToUtf8(base64String) { + return (this.serdeContext?.utf8Encoder ?? toUtf8)((this.serdeContext?.base64Decoder ?? fromBase64)(base64String)); } - return encoding ? Buffer4.from(input, encoding) : Buffer4.from(input); }; } }); -// node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/fromUtf8.js -var fromUtf82; -var init_fromUtf82 = __esm({ - "node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/fromUtf8.js"() { +// node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js +var HttpInterceptingShapeDeserializer; +var init_HttpInterceptingShapeDeserializer = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js"() { "use strict"; - init_dist_es34(); - fromUtf82 = (input) => { - const buf = fromString2(input, "utf8"); - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); + init_schema2(); + init_serde2(); + 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, data) { + const ns2 = NormalizedSchema.of(schema); + const traits = ns2.getMergedTraits(); + const toString3 = this.serdeContext?.utf8Encoder ?? toUtf8; + if (traits.httpHeader || traits.httpResponseCode) { + return this.stringDeserializer.read(ns2, toString3(data)); + } + if (traits.httpPayload) { + if (ns2.isBlobSchema()) { + const toBytes = this.serdeContext?.utf8Decoder ?? fromUtf8; + if (typeof data === "string") { + return toBytes(data); + } + return data; + } else if (ns2.isStringSchema()) { + if ("byteLength" in data) { + return toString3(data); + } + return data; + } + } + return this.codecDeserializer.read(ns2, data); + } }; } }); -// node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js -var init_toUint8Array2 = __esm({ - "node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js"() { - "use strict"; - init_fromUtf82(); - } -}); - -// node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUtf8.js -var init_toUtf82 = __esm({ - "node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUtf8.js"() { +// node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js +var ToStringShapeSerializer; +var init_ToStringShapeSerializer = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js"() { "use strict"; - init_dist_es34(); + init_schema2(); + init_serde2(); + init_SerdeContext(); + init_determineTimestampFormat(); + ToStringShapeSerializer = class extends SerdeContext { + settings; + stringBuffer = ""; + constructor(settings) { + super(); + this.settings = settings; + } + write(schema, value) { + const ns2 = NormalizedSchema.of(schema); + switch (typeof value) { + case "object": + if (value === null) { + this.stringBuffer = "null"; + return; + } + if (ns2.isTimestampSchema()) { + if (!(value instanceof Date)) { + throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns2.getName(true)}`); + } + const format4 = determineTimestampFormat(ns2, this.settings); + switch (format4) { + 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 (ns2.isBlobSchema() && "byteLength" in value) { + this.stringBuffer = (this.serdeContext?.base64Encoder ?? toBase64)(value); + return; + } + if (ns2.isListSchema() && Array.isArray(value)) { + let buffer2 = ""; + for (const item of value) { + this.write([ns2.getValueSchema(), ns2.getMergedTraits()], item); + const headerItem = this.flush(); + const serialized = ns2.getValueSchema().isTimestampSchema() ? headerItem : quoteHeader(headerItem); + if (buffer2 !== "") { + buffer2 += ", "; + } + buffer2 += serialized; + } + this.stringBuffer = buffer2; + return; + } + this.stringBuffer = JSON.stringify(value, null, 2); + break; + case "string": + const mediaType = ns2.getMergedTraits().mediaType; + let intermediateValue = value; + if (mediaType) { + const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); + if (isJson) { + intermediateValue = LazyJsonString.from(intermediateValue); + } + if (ns2.getMergedTraits().httpHeader) { + this.stringBuffer = (this.serdeContext?.base64Encoder ?? toBase64)(intermediateValue.toString()); + return; + } + } + this.stringBuffer = value; + break; + default: + if (ns2.isIdempotencyToken()) { + this.stringBuffer = generateIdempotencyToken(); + } else { + this.stringBuffer = String(value); + } + } + } + flush() { + const buffer2 = this.stringBuffer; + this.stringBuffer = ""; + return buffer2; + } + }; } }); -// node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/index.js -var init_dist_es35 = __esm({ - "node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/index.js"() { +// 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"() { "use strict"; - init_fromUtf82(); - init_toUint8Array2(); - init_toUtf82(); + init_schema2(); + 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 ns2 = NormalizedSchema.of(schema); + const traits = ns2.getMergedTraits(); + if (traits.httpHeader || traits.httpLabel || traits.httpQuery) { + this.stringSerializer.write(ns2, value); + this.buffer = this.stringSerializer.flush(); + return; + } + return this.codecSerializer.write(ns2, value); + } + flush() { + if (this.buffer !== void 0) { + const buffer2 = this.buffer; + this.buffer = void 0; + return buffer2; + } + return this.codecSerializer.flush(); + } + }; } }); -// node_modules/@aws-crypto/util/build/module/convertToBuffer.js -function convertToBuffer(data) { - if (data instanceof Uint8Array) - return data; - if (typeof data === "string") { - return fromUtf83(data); - } - if (ArrayBuffer.isView(data)) { - return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); - } - return new Uint8Array(data); -} -var fromUtf83; -var init_convertToBuffer = __esm({ - "node_modules/@aws-crypto/util/build/module/convertToBuffer.js"() { +// node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js +var getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig; +var init_httpExtensionConfiguration = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js"() { "use strict"; - init_dist_es35(); - fromUtf83 = typeof Buffer !== "undefined" && Buffer.from ? function(input) { - return Buffer.from(input, "utf8"); - } : fromUtf82; + getHttpHandlerExtensionConfiguration = (runtimeConfig) => { + return { + setHttpHandler(handler2) { + runtimeConfig.httpHandler = handler2; + }, + httpHandler() { + return runtimeConfig.httpHandler; + }, + updateHttpClientConfig(key, value) { + runtimeConfig.httpHandler?.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return runtimeConfig.httpHandler.httpHandlerConfigs(); + } + }; + }; + resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler() + }; + }; } }); -// node_modules/@aws-crypto/util/build/module/isEmptyData.js -function isEmptyData(data) { - if (typeof data === "string") { - return data.length === 0; - } - return data.byteLength === 0; +// node_modules/@smithy/core/dist-es/submodules/protocols/middleware-content-length/contentLengthMiddleware.js +function contentLengthMiddleware(bodyLengthChecker) { + return (next) => async (args) => { + const request2 = args.request; + if (HttpRequest.isInstance(request2)) { + const { body: body2, headers } = request2; + if (body2 && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER) === -1) { + try { + const length = bodyLengthChecker(body2); + request2.headers = { + ...request2.headers, + [CONTENT_LENGTH_HEADER]: String(length) + }; + } catch (error2) { + } + } + } + return next({ + ...args, + request: request2 + }); + }; } -var init_isEmptyData = __esm({ - "node_modules/@aws-crypto/util/build/module/isEmptyData.js"() { +var CONTENT_LENGTH_HEADER, contentLengthMiddlewareOptions, getContentLengthPlugin; +var init_contentLengthMiddleware = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/middleware-content-length/contentLengthMiddleware.js"() { "use strict"; + init_transport(); + CONTENT_LENGTH_HEADER = "content-length"; + contentLengthMiddlewareOptions = { + step: "build", + tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], + name: "contentLengthMiddleware", + override: true + }; + getContentLengthPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions); + } + }); } }); -// node_modules/@aws-crypto/util/build/module/numToUint8.js -function numToUint8(num) { - return new Uint8Array([ - (num & 4278190080) >> 24, - (num & 16711680) >> 16, - (num & 65280) >> 8, - num & 255 - ]); -} -var init_numToUint8 = __esm({ - "node_modules/@aws-crypto/util/build/module/numToUint8.js"() { +// node_modules/@smithy/core/dist-es/submodules/protocols/util-uri-escape/escape-uri.js +var escapeUri, hexEncode; +var init_escape_uri = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/util-uri-escape/escape-uri.js"() { "use strict"; + escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); + hexEncode = (c6) => `%${c6.charCodeAt(0).toString(16).toUpperCase()}`; } }); -// node_modules/@aws-crypto/util/build/module/uint32ArrayFrom.js -function uint32ArrayFrom(a_lookUpTable2) { - if (!Uint32Array.from) { - var return_array = new Uint32Array(a_lookUpTable2.length); - var a_index = 0; - while (a_index < a_lookUpTable2.length) { - return_array[a_index] = a_lookUpTable2[a_index]; - a_index += 1; +// node_modules/@smithy/core/dist-es/submodules/protocols/querystring-builder/buildQueryString.js +function buildQueryString(query) { + const parts = []; + for (let key of Object.keys(query).sort()) { + const value = query[key]; + key = escapeUri(key); + if (Array.isArray(value)) { + for (let i6 = 0, iLen = value.length; i6 < iLen; i6++) { + parts.push(`${key}=${escapeUri(value[i6])}`); + } + } else { + let qsEntry = key; + if (value || typeof value === "string") { + qsEntry += `=${escapeUri(value)}`; + } + parts.push(qsEntry); } - return return_array; } - return Uint32Array.from(a_lookUpTable2); + return parts.join("&"); } -var init_uint32ArrayFrom = __esm({ - "node_modules/@aws-crypto/util/build/module/uint32ArrayFrom.js"() { - "use strict"; - } -}); - -// node_modules/@aws-crypto/util/build/module/index.js -var init_module = __esm({ - "node_modules/@aws-crypto/util/build/module/index.js"() { +var init_buildQueryString = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/querystring-builder/buildQueryString.js"() { "use strict"; - init_convertToBuffer(); - init_isEmptyData(); - init_numToUint8(); - init_uint32ArrayFrom(); + init_escape_uri(); } }); -// node_modules/@aws-crypto/crc32/build/module/aws_crc32.js -var AwsCrc32; -var init_aws_crc32 = __esm({ - "node_modules/@aws-crypto/crc32/build/module/aws_crc32.js"() { +// node_modules/@smithy/core/dist-es/submodules/protocols/index.js +var init_protocols = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/index.js"() { "use strict"; - init_tslib_es6(); - init_module(); - init_module2(); - AwsCrc32 = /** @class */ - (function() { - function AwsCrc322() { - this.crc32 = new Crc32(); - } - AwsCrc322.prototype.update = function(toHash) { - if (isEmptyData(toHash)) - return; - this.crc32.update(convertToBuffer(toHash)); - }; - AwsCrc322.prototype.digest = function() { - return __awaiter15(this, void 0, void 0, function() { - return __generator(this, function(_a5) { - return [2, numToUint8(this.crc32.digest())]; - }); - }); - }; - AwsCrc322.prototype.reset = function() { - this.crc32 = new Crc32(); - }; - return AwsCrc322; - })(); + 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(); + init_transport(); + init_transport(); + init_httpExtensionConfiguration(); + init_contentLengthMiddleware(); + init_escape_uri(); + init_buildQueryString(); + init_transport(); } }); -// node_modules/@aws-crypto/crc32/build/module/index.js -var Crc32, a_lookUpTable, lookupTable; -var init_module2 = __esm({ - "node_modules/@aws-crypto/crc32/build/module/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/constants.js +var THROTTLING_ERROR_CODES, TRANSIENT_ERROR_CODES, TRANSIENT_ERROR_STATUS_CODES, NODEJS_TIMEOUT_ERROR_CODES, NODEJS_NETWORK_ERROR_CODES; +var init_constants3 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/constants.js"() { "use strict"; - init_tslib_es6(); - init_module(); - init_aws_crc32(); - Crc32 = /** @class */ - (function() { - function Crc322() { - this.checksum = 4294967295; - } - Crc322.prototype.update = function(data) { - var e_1, _a5; - try { - for (var data_1 = __values(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) { - var byte = data_1_1.value; - this.checksum = this.checksum >>> 8 ^ lookupTable[(this.checksum ^ byte) & 255]; - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (data_1_1 && !data_1_1.done && (_a5 = data_1.return)) _a5.call(data_1); - } finally { - if (e_1) throw e_1.error; - } - } - return this; - }; - Crc322.prototype.digest = function() { - return (this.checksum ^ 4294967295) >>> 0; - }; - return Crc322; - })(); - a_lookUpTable = [ - 0, - 1996959894, - 3993919788, - 2567524794, - 124634137, - 1886057615, - 3915621685, - 2657392035, - 249268274, - 2044508324, - 3772115230, - 2547177864, - 162941995, - 2125561021, - 3887607047, - 2428444049, - 498536548, - 1789927666, - 4089016648, - 2227061214, - 450548861, - 1843258603, - 4107580753, - 2211677639, - 325883990, - 1684777152, - 4251122042, - 2321926636, - 335633487, - 1661365465, - 4195302755, - 2366115317, - 997073096, - 1281953886, - 3579855332, - 2724688242, - 1006888145, - 1258607687, - 3524101629, - 2768942443, - 901097722, - 1119000684, - 3686517206, - 2898065728, - 853044451, - 1172266101, - 3705015759, - 2882616665, - 651767980, - 1373503546, - 3369554304, - 3218104598, - 565507253, - 1454621731, - 3485111705, - 3099436303, - 671266974, - 1594198024, - 3322730930, - 2970347812, - 795835527, - 1483230225, - 3244367275, - 3060149565, - 1994146192, - 31158534, - 2563907772, - 4023717930, - 1907459465, - 112637215, - 2680153253, - 3904427059, - 2013776290, - 251722036, - 2517215374, - 3775830040, - 2137656763, - 141376813, - 2439277719, - 3865271297, - 1802195444, - 476864866, - 2238001368, - 4066508878, - 1812370925, - 453092731, - 2181625025, - 4111451223, - 1706088902, - 314042704, - 2344532202, - 4240017532, - 1658658271, - 366619977, - 2362670323, - 4224994405, - 1303535960, - 984961486, - 2747007092, - 3569037538, - 1256170817, - 1037604311, - 2765210733, - 3554079995, - 1131014506, - 879679996, - 2909243462, - 3663771856, - 1141124467, - 855842277, - 2852801631, - 3708648649, - 1342533948, - 654459306, - 3188396048, - 3373015174, - 1466479909, - 544179635, - 3110523913, - 3462522015, - 1591671054, - 702138776, - 2966460450, - 3352799412, - 1504918807, - 783551873, - 3082640443, - 3233442989, - 3988292384, - 2596254646, - 62317068, - 1957810842, - 3939845945, - 2647816111, - 81470997, - 1943803523, - 3814918930, - 2489596804, - 225274430, - 2053790376, - 3826175755, - 2466906013, - 167816743, - 2097651377, - 4027552580, - 2265490386, - 503444072, - 1762050814, - 4150417245, - 2154129355, - 426522225, - 1852507879, - 4275313526, - 2312317920, - 282753626, - 1742555852, - 4189708143, - 2394877945, - 397917763, - 1622183637, - 3604390888, - 2714866558, - 953729732, - 1340076626, - 3518719985, - 2797360999, - 1068828381, - 1219638859, - 3624741850, - 2936675148, - 906185462, - 1090812512, - 3747672003, - 2825379669, - 829329135, - 1181335161, - 3412177804, - 3160834842, - 628085408, - 1382605366, - 3423369109, - 3138078467, - 570562233, - 1426400815, - 3317316542, - 2998733608, - 733239954, - 1555261956, - 3268935591, - 3050360625, - 752459403, - 1541320221, - 2607071920, - 3965973030, - 1969922972, - 40735498, - 2617837225, - 3943577151, - 1913087877, - 83908371, - 2512341634, - 3803740692, - 2075208622, - 213261112, - 2463272603, - 3855990285, - 2094854071, - 198958881, - 2262029012, - 4057260610, - 1759359992, - 534414190, - 2176718541, - 4139329115, - 1873836001, - 414664567, - 2282248934, - 4279200368, - 1711684554, - 285281116, - 2405801727, - 4167216745, - 1634467795, - 376229701, - 2685067896, - 3608007406, - 1308918612, - 956543938, - 2808555105, - 3495958263, - 1231636301, - 1047427035, - 2932959818, - 3654703836, - 1088359270, - 936918e3, - 2847714899, - 3736837829, - 1202900863, - 817233897, - 3183342108, - 3401237130, - 1404277552, - 615818150, - 3134207493, - 3453421203, - 1423857449, - 601450431, - 3009837614, - 3294710456, - 1567103746, - 711928724, - 3020668471, - 3272380065, - 1510334235, - 755167117 + THROTTLING_ERROR_CODES = [ + "BandwidthLimitExceeded", + "EC2ThrottledException", + "LimitExceededException", + "PriorRequestNotComplete", + "ProvisionedThroughputExceededException", + "RequestLimitExceeded", + "RequestThrottled", + "RequestThrottledException", + "SlowDown", + "ThrottledException", + "Throttling", + "ThrottlingException", + "TooManyRequestsException", + "TransactionInProgressException" ]; - lookupTable = uint32ArrayFrom(a_lookUpTable); + TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; + TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; + NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; + NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND", "EAI_AGAIN"]; } }); -// node_modules/@smithy/eventstream-codec/dist-es/Int64.js -function negate2(bytes) { - for (let i6 = 0; i6 < 8; i6++) { - bytes[i6] ^= 255; - } - for (let i6 = 7; i6 > -1; i6--) { - bytes[i6]++; - if (bytes[i6] !== 0) - break; - } +// node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/service-error-classification.js +function isNodeJsHttp2TransientError(error2) { + return error2.code === "ERR_HTTP2_STREAM_ERROR" && error2.message.includes("NGHTTP2_REFUSED_STREAM"); } -var Int642; -var init_Int64 = __esm({ - "node_modules/@smithy/eventstream-codec/dist-es/Int64.js"() { +var isRetryableByTrait, isClockSkewCorrectedError, isBrowserNetworkError, isThrottlingError, isTransientError, isServerError; +var init_service_error_classification = __esm({ + "node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/service-error-classification.js"() { "use strict"; - init_dist_es16(); - Int642 = 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 i6 = 7, remaining = Math.abs(Math.round(number)); i6 > -1 && remaining > 0; i6--, remaining /= 256) { - bytes[i6] = remaining; - } - if (number < 0) { - negate2(bytes); - } - return new _Int64(bytes); - } - valueOf() { - const bytes = this.bytes.slice(0); - const negative = bytes[0] & 128; - if (negative) { - negate2(bytes); - } - return parseInt(toHex(bytes), 16) * (negative ? -1 : 1); - } - toString() { - return String(this.valueOf()); + init_constants3(); + isRetryableByTrait = (error2) => error2?.$retryable !== void 0; + isClockSkewCorrectedError = (error2) => error2.$metadata?.clockSkewCorrected; + isBrowserNetworkError = (error2) => { + 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 = error2 && error2 instanceof TypeError; + if (!isValid) { + return false; } + return errorMessages.has(error2.message); }; - } -}); - -// node_modules/@smithy/eventstream-codec/dist-es/HeaderMarshaller.js -var HeaderMarshaller, HEADER_VALUE_TYPE2, BOOLEAN_TAG, BYTE_TAG, SHORT_TAG, INT_TAG, LONG_TAG, BINARY_TAG, STRING_TAG, TIMESTAMP_TAG, UUID_TAG, UUID_PATTERN2; -var init_HeaderMarshaller = __esm({ - "node_modules/@smithy/eventstream-codec/dist-es/HeaderMarshaller.js"() { - "use strict"; - init_dist_es16(); - init_Int64(); - HeaderMarshaller = class { - toUtf8; - fromUtf8; - constructor(toUtf82, fromUtf84) { - this.toUtf8 = toUtf82; - this.fromUtf8 = fromUtf84; - } - format(headers) { - const chunks = []; - for (const headerName of Object.keys(headers)) { - const bytes = this.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 = this.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(Int642.fromNumber(header.value.valueOf()).bytes, 1); - return tsBytes; - case "uuid": - if (!UUID_PATTERN2.test(header.value)) { - throw new Error(`Invalid UUID received: ${header.value}`); - } - const uuidBytes = new Uint8Array(17); - uuidBytes[0] = 9; - uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1); - return uuidBytes; - } - } - parse(headers) { - const out = {}; - let position = 0; - while (position < headers.byteLength) { - const nameLength = headers.getUint8(position++); - const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength)); - position += nameLength; - switch (headers.getUint8(position++)) { - case 0: - out[name] = { - type: BOOLEAN_TAG, - value: true - }; - break; - case 1: - out[name] = { - type: BOOLEAN_TAG, - value: false - }; - break; - case 2: - out[name] = { - type: BYTE_TAG, - value: headers.getInt8(position++) - }; - break; - case 3: - out[name] = { - type: SHORT_TAG, - value: headers.getInt16(position, false) - }; - position += 2; - break; - case 4: - out[name] = { - type: INT_TAG, - value: headers.getInt32(position, false) - }; - position += 4; - break; - case 5: - out[name] = { - type: LONG_TAG, - value: new Int642(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)) - }; - position += 8; - break; - case 6: - const binaryLength = headers.getUint16(position, false); - position += 2; - out[name] = { - type: BINARY_TAG, - value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength) - }; - position += binaryLength; - break; - case 7: - const stringLength = headers.getUint16(position, false); - position += 2; - out[name] = { - type: STRING_TAG, - value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength)) - }; - position += stringLength; - break; - case 8: - out[name] = { - type: TIMESTAMP_TAG, - value: new Date(new Int642(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()) - }; - position += 8; - break; - case 9: - const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16); - position += 16; - out[name] = { - type: UUID_TAG, - value: `${toHex(uuidBytes.subarray(0, 4))}-${toHex(uuidBytes.subarray(4, 6))}-${toHex(uuidBytes.subarray(6, 8))}-${toHex(uuidBytes.subarray(8, 10))}-${toHex(uuidBytes.subarray(10))}` - }; - break; - default: - throw new Error(`Unrecognized header type tag`); - } + isThrottlingError = (error2) => error2.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error2.name) || error2.$retryable?.throttling == true; + isTransientError = (error2, depth = 0) => isRetryableByTrait(error2) || isClockSkewCorrectedError(error2) || error2.name === "InvalidSignatureException" && error2.message?.includes("Signature expired") || TRANSIENT_ERROR_CODES.includes(error2.name) || NODEJS_TIMEOUT_ERROR_CODES.includes(error2?.code || "") || NODEJS_NETWORK_ERROR_CODES.includes(error2?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error2.$metadata?.httpStatusCode || 0) || isBrowserNetworkError(error2) || isNodeJsHttp2TransientError(error2) || error2.cause !== void 0 && depth <= 10 && isTransientError(error2.cause, depth + 1); + isServerError = (error2) => { + if (error2.$metadata?.httpStatusCode !== void 0) { + const statusCode = error2.$metadata.httpStatusCode; + if (500 <= statusCode && statusCode <= 599 && !isTransientError(error2)) { + return true; } - return out; + return false; } + return false; }; - (function(HEADER_VALUE_TYPE3) { - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolTrue"] = 0] = "boolTrue"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolFalse"] = 1] = "boolFalse"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byte"] = 2] = "byte"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["short"] = 3] = "short"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["integer"] = 4] = "integer"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["long"] = 5] = "long"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byteArray"] = 6] = "byteArray"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["string"] = 7] = "string"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["timestamp"] = 8] = "timestamp"; - HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["uuid"] = 9] = "uuid"; - })(HEADER_VALUE_TYPE2 || (HEADER_VALUE_TYPE2 = {})); - BOOLEAN_TAG = "boolean"; - BYTE_TAG = "byte"; - SHORT_TAG = "short"; - INT_TAG = "integer"; - LONG_TAG = "long"; - BINARY_TAG = "binary"; - STRING_TAG = "string"; - TIMESTAMP_TAG = "timestamp"; - UUID_TAG = "uuid"; - UUID_PATTERN2 = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; - } -}); - -// node_modules/@smithy/eventstream-codec/dist-es/splitMessage.js -function splitMessage({ byteLength, byteOffset, buffer: buffer2 }) { - if (byteLength < MINIMUM_MESSAGE_LENGTH) { - throw new Error("Provided message too short to accommodate event stream message overhead"); - } - const view = new DataView(buffer2, byteOffset, byteLength); - const messageLength = view.getUint32(0, false); - if (byteLength !== messageLength) { - throw new Error("Reported message length does not match received message length"); - } - const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false); - const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false); - const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false); - const checksummer = new Crc32().update(new Uint8Array(buffer2, byteOffset, PRELUDE_LENGTH)); - if (expectedPreludeChecksum !== checksummer.digest()) { - throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})`); - } - checksummer.update(new Uint8Array(buffer2, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH))); - if (expectedMessageChecksum !== checksummer.digest()) { - throw new Error(`The message checksum (${checksummer.digest()}) did not match the expected value of ${expectedMessageChecksum}`); - } - return { - headers: new DataView(buffer2, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength), - body: new Uint8Array(buffer2, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength, messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH)) - }; -} -var PRELUDE_MEMBER_LENGTH, PRELUDE_LENGTH, CHECKSUM_LENGTH, MINIMUM_MESSAGE_LENGTH; -var init_splitMessage = __esm({ - "node_modules/@smithy/eventstream-codec/dist-es/splitMessage.js"() { - "use strict"; - init_module2(); - PRELUDE_MEMBER_LENGTH = 4; - PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2; - CHECKSUM_LENGTH = 4; - MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2; } }); -// node_modules/@smithy/eventstream-codec/dist-es/EventStreamCodec.js -var EventStreamCodec; -var init_EventStreamCodec = __esm({ - "node_modules/@smithy/eventstream-codec/dist-es/EventStreamCodec.js"() { +// node_modules/@smithy/core/dist-es/submodules/retry/util-retry/constants.js +var MAXIMUM_RETRY_DELAY, INITIAL_RETRY_TOKENS, NO_RETRY_INCREMENT, INVOCATION_ID_HEADER, REQUEST_HEADER; +var init_constants4 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/retry/util-retry/constants.js"() { "use strict"; - init_module2(); - init_HeaderMarshaller(); - init_splitMessage(); - EventStreamCodec = class { - headerMarshaller; - messageBuffer; - isEndOfStream; - constructor(toUtf82, fromUtf84) { - this.headerMarshaller = new HeaderMarshaller(toUtf82, fromUtf84); - this.messageBuffer = []; - this.isEndOfStream = false; - } - feed(message) { - this.messageBuffer.push(this.decode(message)); - } - endOfStream() { - this.isEndOfStream = true; - } - getMessage() { - const message = this.messageBuffer.pop(); - const isEndOfStream = this.isEndOfStream; - return { - getMessage() { - return message; - }, - isEndOfStream() { - return isEndOfStream; - } - }; - } - getAvailableMessages() { - const messages = this.messageBuffer; - this.messageBuffer = []; - const isEndOfStream = this.isEndOfStream; - return { - getMessages() { - return messages; - }, - isEndOfStream() { - return isEndOfStream; - } - }; - } - encode({ headers: rawHeaders, body: body2 }) { - const headers = this.headerMarshaller.format(rawHeaders); - const length = headers.byteLength + body2.byteLength + 16; - const out = new Uint8Array(length); - const view = new DataView(out.buffer, out.byteOffset, out.byteLength); - const checksum = new Crc32(); - view.setUint32(0, length, false); - view.setUint32(4, headers.byteLength, false); - view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false); - out.set(headers, 12); - out.set(body2, headers.byteLength + 12); - view.setUint32(length - 4, checksum.update(out.subarray(8, length - 4)).digest(), false); - return out; + MAXIMUM_RETRY_DELAY = 20 * 1e3; + INITIAL_RETRY_TOKENS = 500; + NO_RETRY_INCREMENT = 1; + INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; + REQUEST_HEADER = "amz-sdk-request"; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js +function parseRetryAfterHeader(response, logger8) { + if (!HttpResponse.isInstance(response)) { + return; + } + for (const header of Object.keys(response.headers)) { + const h6 = header.toLowerCase(); + if (h6 === "retry-after") { + const retryAfter = response.headers[header]; + let retryAfterSeconds = NaN; + if (retryAfter.endsWith("GMT")) { + try { + const date2 = parseRfc7231DateTime(retryAfter); + retryAfterSeconds = (date2.getTime() - Date.now()) / 1e3; + } catch (e6) { + logger8?.trace?.("Failed to parse retry-after header"); + logger8?.trace?.(e6); + } + } 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; } - decode(message) { - const { headers, body: body2 } = splitMessage(message); - return { headers: this.headerMarshaller.parse(headers), body: body2 }; + if (isNaN(retryAfterSeconds)) { + return; } - formatHeaders(rawHeaders) { - return this.headerMarshaller.format(rawHeaders); + return new Date(Date.now() + retryAfterSeconds * 1e3); + } else if (h6 === "x-amz-retry-after") { + const v2 = response.headers[header]; + const backoffMilliseconds = Number(v2); + if (isNaN(backoffMilliseconds)) { + logger8?.trace?.(`Failed to parse x-amz-retry-after=${v2}`); + return; } - }; + return new Date(Date.now() + backoffMilliseconds); + } + } +} +var init_parseRetryAfterHeader = __esm({ + "node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js"() { + "use strict"; + init_protocols(); + init_serde2(); } }); -// node_modules/@smithy/eventstream-codec/dist-es/Message.js -var init_Message = __esm({ - "node_modules/@smithy/eventstream-codec/dist-es/Message.js"() { +// node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/util.js +var asSdkError; +var init_util4 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/util.js"() { "use strict"; + asSdkError = (error2) => { + if (error2 instanceof Error) + return error2; + if (error2 instanceof Object) + return Object.assign(new Error(), error2); + if (typeof error2 === "string") + return new Error(error2); + return new Error(`AWS SDK error wrapper for ${error2}`); + }; } }); -// node_modules/@smithy/eventstream-codec/dist-es/MessageDecoderStream.js -var MessageDecoderStream; -var init_MessageDecoderStream = __esm({ - "node_modules/@smithy/eventstream-codec/dist-es/MessageDecoderStream.js"() { - "use strict"; - MessageDecoderStream = class { - options; - constructor(options) { - this.options = options; - } - [Symbol.asyncIterator]() { - return this.asyncIterator(); +// node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js +function bindRetryMiddleware(isStreamingPayload2) { + return (options) => (next, context5) => async (args) => { + let retryStrategy = await options.retryStrategy(); + const maxAttempts = await options.maxAttempts(); + if (isRetryStrategyV2(retryStrategy)) { + retryStrategy = retryStrategy; + let retryToken = await retryStrategy.acquireInitialRetryToken((context5["partition_id"] ?? "") + (context5.__retryLongPoll ? ":longpoll" : "")); + let lastError = new Error(); + let attempts = 0; + let totalRetryDelay = 0; + const { request: request2 } = args; + const isRequest2 = HttpRequest.isInstance(request2); + if (isRequest2) { + request2.headers[INVOCATION_ID_HEADER] = v4(); } - async *asyncIterator() { - for await (const bytes of this.options.inputStream) { - const decoded = this.options.decoder.decode(bytes); - yield decoded; + while (true) { + try { + if (isRequest2) { + request2.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; + } + const { response, output } = await next(args); + retryStrategy.recordSuccess(retryToken); + output.$metadata.attempts = attempts + 1; + output.$metadata.totalRetryDelay = totalRetryDelay; + return { response, output }; + } catch (e6) { + const retryErrorInfo = getRetryErrorInfo(e6, options.logger); + lastError = asSdkError(e6); + if (isRequest2 && isStreamingPayload2(request2)) { + (context5.logger instanceof NoOpLogger ? console : context5.logger)?.warn("An error was encountered in a non-retryable streaming request."); + throw lastError; + } + try { + retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo); + } catch (refreshError) { + if (!lastError.$metadata) { + lastError.$metadata = {}; + } + lastError.$metadata.attempts = attempts + 1; + lastError.$metadata.totalRetryDelay = totalRetryDelay; + throw lastError; + } + attempts = retryToken.getRetryCount(); + const delay4 = retryToken.getRetryDelay(); + totalRetryDelay += (retryToken?.$retryLog?.acquisitionDelay ?? 0) + delay4; + if (delay4 > 0) { + await cooldown(delay4); + } } } + } else { + retryStrategy = retryStrategy; + if (retryStrategy?.mode) { + context5.userAgent = [...context5.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]]; + } + return retryStrategy.retry(next, args); + } + }; +} +function bindGetRetryPlugin(isStreamingPayload2) { + const retryMiddleware2 = bindRetryMiddleware(isStreamingPayload2); + return (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(retryMiddleware2(options), retryMiddlewareOptions); + } + }); +} +var cooldown, isRetryStrategyV2, getRetryErrorInfo, getRetryErrorType, retryMiddlewareOptions; +var init_retryMiddleware = __esm({ + "node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js"() { + "use strict"; + init_client3(); + init_protocols(); + init_serde2(); + init_service_error_classification(); + init_constants4(); + init_parseRetryAfterHeader(); + init_util4(); + cooldown = (ms2) => new Promise((resolve8) => setTimeout(resolve8, ms2)); + isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined"; + getRetryErrorInfo = (error2, logger8) => { + const errorInfo = { + error: error2, + errorType: getRetryErrorType(error2) + }; + const retryAfterHint = parseRetryAfterHeader(error2.$response, logger8); + if (retryAfterHint) { + errorInfo.retryAfterHint = retryAfterHint; + } + return errorInfo; + }; + getRetryErrorType = (error2) => { + if (isThrottlingError(error2)) + return "THROTTLING"; + if (isTransientError(error2)) + return "TRANSIENT"; + if (isServerError(error2)) + return "SERVER_ERROR"; + return "CLIENT_ERROR"; + }; + retryMiddlewareOptions = { + name: "retryMiddleware", + tags: ["RETRY"], + step: "finalizeRequest", + priority: "high", + override: true }; } }); -// node_modules/@smithy/eventstream-codec/dist-es/MessageEncoderStream.js -var MessageEncoderStream; -var init_MessageEncoderStream = __esm({ - "node_modules/@smithy/eventstream-codec/dist-es/MessageEncoderStream.js"() { +// node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRateLimiter.js +var DefaultRateLimiter; +var init_DefaultRateLimiter = __esm({ + "node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRateLimiter.js"() { "use strict"; - MessageEncoderStream = class { - options; + init_service_error_classification(); + 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.options = 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; } - [Symbol.asyncIterator]() { - return this.asyncIterator(); + async getSendToken() { + return this.acquireTokenBucket(1); } - async *asyncIterator() { - for await (const msg of this.options.messageStream) { - const encoded = this.options.encoder.encode(msg); - yield encoded; + updateClientSendingRate(response) { + let calculatedRate; + this.updateMeasuredRate(); + const retryErrorInfo = response; + const isThrottling = retryErrorInfo?.errorType === "THROTTLING" || 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()); } - if (this.options.includeEndFrame) { - yield new Uint8Array(0); + 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 delay4 = (amount - this.availableTokens) / this.fillRate * 1e3; + await new Promise((resolve8) => _DefaultRateLimiter.setTimeoutFn(resolve8, delay4)); + 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)); + } }; } }); -// node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageDecoderStream.js -var SmithyMessageDecoderStream; -var init_SmithyMessageDecoderStream = __esm({ - "node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageDecoderStream.js"() { +// node_modules/@smithy/core/dist-es/submodules/retry/util-retry/retries-2026-config.js +var Retry; +var init_retries_2026_config = __esm({ + "node_modules/@smithy/core/dist-es/submodules/retry/util-retry/retries-2026-config.js"() { "use strict"; - SmithyMessageDecoderStream = class { - options; - constructor(options) { - this.options = options; + Retry = class _Retry { + static v2026 = typeof process !== "undefined" && process.env?.SMITHY_NEW_RETRIES_2026 === "true"; + static delay() { + return _Retry.v2026 ? 50 : 100; } - [Symbol.asyncIterator]() { - return this.asyncIterator(); + static throttlingDelay() { + return _Retry.v2026 ? 1e3 : 500; } - async *asyncIterator() { - for await (const message of this.options.messageStream) { - const deserialized = await this.options.deserializer(message); - if (deserialized === void 0) - continue; - yield deserialized; - } + static cost() { + return _Retry.v2026 ? 14 : 5; + } + static throttlingCost() { + return _Retry.v2026 ? 5 : 10; + } + static modifiedCostType() { + return _Retry.v2026 ? "THROTTLING" : "TRANSIENT"; } }; } }); -// node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageEncoderStream.js -var SmithyMessageEncoderStream; -var init_SmithyMessageEncoderStream = __esm({ - "node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageEncoderStream.js"() { +// node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRetryBackoffStrategy.js +var DefaultRetryBackoffStrategy; +var init_DefaultRetryBackoffStrategy = __esm({ + "node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRetryBackoffStrategy.js"() { "use strict"; - SmithyMessageEncoderStream = class { - options; - constructor(options) { - this.options = options; + init_constants4(); + init_retries_2026_config(); + DefaultRetryBackoffStrategy = class { + x = Retry.delay(); + computeNextBackoffDelay(i6) { + const b6 = Math.random(); + const r6 = 2; + const t_i = b6 * Math.min(this.x * r6 ** i6, MAXIMUM_RETRY_DELAY); + return Math.floor(t_i); } - [Symbol.asyncIterator]() { - return this.asyncIterator(); + setDelayBase(delay4) { + this.x = delay4; } - async *asyncIterator() { - for await (const chunk of this.options.inputStream) { - const payloadBuf = this.options.serializer(chunk); - yield payloadBuf; - } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRetryToken.js +var DefaultRetryToken; +var init_DefaultRetryToken = __esm({ + "node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRetryToken.js"() { + "use strict"; + init_constants4(); + DefaultRetryToken = class { + delay; + count; + cost; + longPoll; + $retryLog = { + acquisitionDelay: 0 + }; + constructor(delay4, count, cost, longPoll) { + this.delay = delay4; + 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; } }; } }); -// node_modules/@smithy/eventstream-codec/dist-es/index.js -var init_dist_es36 = __esm({ - "node_modules/@smithy/eventstream-codec/dist-es/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/retry/util-retry/config.js +var RETRY_MODES, DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE; +var init_config4 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/retry/util-retry/config.js"() { "use strict"; - init_EventStreamCodec(); - init_HeaderMarshaller(); - init_Int64(); - init_Message(); - init_MessageDecoderStream(); - init_MessageEncoderStream(); - init_SmithyMessageDecoderStream(); - init_SmithyMessageEncoderStream(); + (function(RETRY_MODES2) { + RETRY_MODES2["STANDARD"] = "standard"; + RETRY_MODES2["ADAPTIVE"] = "adaptive"; + })(RETRY_MODES || (RETRY_MODES = {})); + DEFAULT_MAX_ATTEMPTS = 3; + DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD; } }); -// node_modules/@smithy/eventstream-serde-universal/dist-es/getChunkedStream.js -function getChunkedStream(source) { - let currentMessageTotalLength = 0; - let currentMessagePendingLength = 0; - let currentMessage = null; - let messageLengthBuffer = null; - const allocateMessage = (size) => { - if (typeof size !== "number") { - throw new Error("Attempted to allocate an event message where size was not a number: " + size); - } - currentMessageTotalLength = size; - currentMessagePendingLength = 4; - currentMessage = new Uint8Array(size); - const currentMessageView = new DataView(currentMessage.buffer); - currentMessageView.setUint32(0, size, false); - }; - const iterator2 = async function* () { - const sourceIterator = source[Symbol.asyncIterator](); - while (true) { - const { value, done } = await sourceIterator.next(); - if (done) { - if (!currentMessageTotalLength) { - return; - } else if (currentMessageTotalLength === currentMessagePendingLength) { - yield currentMessage; - } else { - throw new Error("Truncated event message received."); - } - return; +// node_modules/@smithy/core/dist-es/submodules/retry/util-retry/StandardRetryStrategy.js +var refusal, StandardRetryStrategy; +var init_StandardRetryStrategy = __esm({ + "node_modules/@smithy/core/dist-es/submodules/retry/util-retry/StandardRetryStrategy.js"() { + "use strict"; + init_DefaultRetryBackoffStrategy(); + init_DefaultRetryToken(); + init_config4(); + init_constants4(); + init_retries_2026_config(); + refusal = { + incompatible: 1, + attempts: 2, + capacity: 3 + }; + StandardRetryStrategy = class { + mode = RETRY_MODES.STANDARD; + retryBackoffStrategy; + capacity = INITIAL_RETRY_TOKENS; + 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 ??= Retry.delay(); + this.retryBackoffStrategy ??= new DefaultRetryBackoffStrategy(); } - const chunkLength = value.length; - let currentOffset = 0; - while (currentOffset < chunkLength) { - if (!currentMessage) { - const bytesRemaining = chunkLength - currentOffset; - if (!messageLengthBuffer) { - messageLengthBuffer = new Uint8Array(4); + async acquireInitialRetryToken(retryTokenScope) { + return new DefaultRetryToken(Retry.delay(), 0, void 0, Retry.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" ? Retry.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)); } - const numBytesForTotal = Math.min(4 - currentMessagePendingLength, bytesRemaining); - messageLengthBuffer.set(value.slice(currentOffset, currentOffset + numBytesForTotal), currentMessagePendingLength); - currentMessagePendingLength += numBytesForTotal; - currentOffset += numBytesForTotal; - if (currentMessagePendingLength < 4) { - break; + if (!shouldRetry) { + const longPollBackoff = Retry.v2026 && retryCode === refusal.capacity && isLongPoll ? retryDelay : 0; + if (longPollBackoff > 0) { + await new Promise((r6) => setTimeout(r6, longPollBackoff)); + } + } else { + const capacityCost = this.getCapacityCost(errorType); + this.capacity -= capacityCost; + const nextToken = new DefaultRetryToken(0, token.getRetryCount() + 1, capacityCost, token.isLongPoll?.() ?? false); + await new Promise((r6) => setTimeout(r6, retryDelay)); + nextToken.$retryLog.acquisitionDelay = retryDelay; + return nextToken; } - allocateMessage(new DataView(messageLengthBuffer.buffer).getUint32(0, false)); - messageLengthBuffer = null; } - const numBytesToWrite = Math.min(currentMessageTotalLength - currentMessagePendingLength, chunkLength - currentOffset); - currentMessage.set(value.slice(currentOffset, currentOffset + numBytesToWrite), currentMessagePendingLength); - currentMessagePendingLength += numBytesToWrite; - currentOffset += numBytesToWrite; - if (currentMessageTotalLength && currentMessageTotalLength === currentMessagePendingLength) { - yield currentMessage; - currentMessage = null; - currentMessageTotalLength = 0; - currentMessagePendingLength = 0; + 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 (error2) { + console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`); + return DEFAULT_MAX_ATTEMPTS; } } - } - }; - return { - [Symbol.asyncIterator]: iterator2 - }; -} -var init_getChunkedStream = __esm({ - "node_modules/@smithy/eventstream-serde-universal/dist-es/getChunkedStream.js"() { - "use strict"; - } -}); - -// node_modules/@smithy/eventstream-serde-universal/dist-es/getUnmarshalledStream.js -function getMessageUnmarshaller(deserializer, toUtf82) { - return async function(message) { - const { value: messageType } = message.headers[":message-type"]; - if (messageType === "error") { - const unmodeledError = new Error(message.headers[":error-message"].value || "UnknownError"); - unmodeledError.name = message.headers[":error-code"].value; - throw unmodeledError; - } else if (messageType === "exception") { - const code = message.headers[":exception-type"].value; - const exception = { [code]: message }; - const deserializedException = await deserializer(exception); - if (deserializedException.$unknown) { - const error2 = new Error(toUtf82(message.body)); - error2.name = code; - throw error2; + 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; } - throw deserializedException[code]; - } else if (messageType === "event") { - const event = { - [message.headers[":event-type"].value]: message - }; - const deserialized = await deserializer(event); - if (deserialized.$unknown) - return; - return deserialized; - } else { - throw Error(`Unrecognizable event type: ${message.headers[":event-type"].value}`); - } - }; -} -var init_getUnmarshalledStream = __esm({ - "node_modules/@smithy/eventstream-serde-universal/dist-es/getUnmarshalledStream.js"() { - "use strict"; + getCapacityCost(errorType) { + return errorType === Retry.modifiedCostType() ? Retry.throttlingCost() : Retry.cost(); + } + isRetryableError(errorType) { + return errorType === "THROTTLING" || errorType === "TRANSIENT"; + } + }; } }); -// node_modules/@smithy/eventstream-serde-universal/dist-es/EventStreamMarshaller.js -var EventStreamMarshaller; -var init_EventStreamMarshaller = __esm({ - "node_modules/@smithy/eventstream-serde-universal/dist-es/EventStreamMarshaller.js"() { +// node_modules/@smithy/core/dist-es/submodules/retry/util-retry/AdaptiveRetryStrategy.js +var AdaptiveRetryStrategy; +var init_AdaptiveRetryStrategy = __esm({ + "node_modules/@smithy/core/dist-es/submodules/retry/util-retry/AdaptiveRetryStrategy.js"() { "use strict"; - init_dist_es36(); - init_getChunkedStream(); - init_getUnmarshalledStream(); - EventStreamMarshaller = class { - eventStreamCodec; - utfEncoder; - constructor({ utf8Encoder, utf8Decoder }) { - this.eventStreamCodec = new EventStreamCodec(utf8Encoder, utf8Decoder); - this.utfEncoder = utf8Encoder; + init_DefaultRateLimiter(); + init_StandardRetryStrategy(); + init_config4(); + AdaptiveRetryStrategy = class { + mode = 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); } - deserialize(body2, deserializer) { - const inputStream = getChunkedStream(body2); - return new SmithyMessageDecoderStream({ - messageStream: new MessageDecoderStream({ inputStream, decoder: this.eventStreamCodec }), - deserializer: getMessageUnmarshaller(deserializer, this.utfEncoder) - }); + async acquireInitialRetryToken(retryTokenScope) { + const token = await this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); + await this.rateLimiter.getSendToken(); + return token; } - serialize(inputStream, serializer) { - return new MessageEncoderStream({ - messageStream: new SmithyMessageEncoderStream({ inputStream, serializer }), - encoder: this.eventStreamCodec, - includeEndFrame: true - }); + 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(); } }; } }); -// node_modules/@smithy/eventstream-serde-universal/dist-es/provider.js -var init_provider = __esm({ - "node_modules/@smithy/eventstream-serde-universal/dist-es/provider.js"() { +// node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js +var ENV_MAX_ATTEMPTS, CONFIG_MAX_ATTEMPTS, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, resolveRetryConfig, ENV_RETRY_MODE, CONFIG_RETRY_MODE, NODE_RETRY_MODE_CONFIG_OPTIONS; +var init_configurations = __esm({ + "node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js"() { "use strict"; + init_client3(); + init_AdaptiveRetryStrategy(); + init_StandardRetryStrategy(); + init_config4(); + init_retries_2026_config(); + ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; + CONFIG_MAX_ATTEMPTS = "max_attempts"; + NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { + environmentVariableSelector: (env3) => { + const value = env3[ENV_MAX_ATTEMPTS]; + if (!value) + return void 0; + const maxAttempt = parseInt(value); + if (Number.isNaN(maxAttempt)) { + throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`); + } + return maxAttempt; + }, + configFileSelector: (profile) => { + const value = profile[CONFIG_MAX_ATTEMPTS]; + if (!value) + return void 0; + const maxAttempt = parseInt(value); + if (Number.isNaN(maxAttempt)) { + throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`); + } + return maxAttempt; + }, + default: DEFAULT_MAX_ATTEMPTS + }; + resolveRetryConfig = (input, defaults4) => { + const { retryStrategy, retryMode } = input; + const { defaultMaxAttempts = DEFAULT_MAX_ATTEMPTS, defaultBaseDelay = Retry.delay() } = defaults4 ?? {}; + const maxAttemptsProvider = normalizeProvider(input.maxAttempts ?? defaultMaxAttempts); + let controller = retryStrategy ? Promise.resolve(retryStrategy) : void 0; + const getDefault = async () => { + const maxAttempts = await maxAttemptsProvider(); + const adaptive = await normalizeProvider(retryMode)() === RETRY_MODES.ADAPTIVE; + if (adaptive) { + return new AdaptiveRetryStrategy(maxAttemptsProvider, { + maxAttempts, + baseDelay: defaultBaseDelay + }); + } + return new StandardRetryStrategy({ + maxAttempts, + baseDelay: defaultBaseDelay + }); + }; + return Object.assign(input, { + maxAttempts: maxAttemptsProvider, + retryStrategy: () => controller ??= getDefault() + }); + }; + ENV_RETRY_MODE = "AWS_RETRY_MODE"; + CONFIG_RETRY_MODE = "retry_mode"; + NODE_RETRY_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env3) => env3[ENV_RETRY_MODE], + configFileSelector: (profile) => profile[CONFIG_RETRY_MODE], + default: DEFAULT_RETRY_MODE + }; } }); -// node_modules/@smithy/eventstream-serde-universal/dist-es/index.js -var init_dist_es37 = __esm({ - "node_modules/@smithy/eventstream-serde-universal/dist-es/index.js"() { +// node_modules/@smithy/core/dist-es/submodules/retry/index.js +var retryMiddleware, getRetryPlugin; +var init_retry3 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/retry/index.js"() { "use strict"; - init_EventStreamMarshaller(); - init_provider(); + init_isStreamingPayload(); + init_retryMiddleware(); + init_config4(); + init_retries_2026_config(); + init_configurations(); + retryMiddleware = bindRetryMiddleware(isStreamingPayload); + getRetryPlugin = bindGetRetryPlugin(isStreamingPayload); } }); -// node_modules/@aws-sdk/middleware-websocket/dist-es/utils.js -var isWebSocketRequest; -var init_utils3 = __esm({ - "node_modules/@aws-sdk/middleware-websocket/dist-es/utils.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js +function setFeature2(context5, feature, value) { + if (!context5.__aws_sdk_context) { + context5.__aws_sdk_context = { + features: {} + }; + } else if (!context5.__aws_sdk_context.features) { + context5.__aws_sdk_context.features = {}; + } + context5.__aws_sdk_context.features[feature] = value; +} +var init_setFeature = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js"() { "use strict"; - isWebSocketRequest = (request3) => request3.protocol === "ws:" || request3.protocol === "wss:"; + init_retry3(); + Retry.v2026 ||= typeof process === "object" && process.env?.AWS_NEW_RETRIES_2026 === "true"; } }); -// node_modules/@aws-sdk/middleware-websocket/dist-es/WebSocketFetchHandler.js -var init_WebSocketFetchHandler = __esm({ - "node_modules/@aws-sdk/middleware-websocket/dist-es/WebSocketFetchHandler.js"() { +// 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"() { "use strict"; } }); -// node_modules/@aws-sdk/middleware-websocket/dist-es/middlewares/websocketEndpointMiddleware.js -var websocketEndpointMiddleware, websocketEndpointMiddlewareOptions; -var init_websocketEndpointMiddleware = __esm({ - "node_modules/@aws-sdk/middleware-websocket/dist-es/middlewares/websocketEndpointMiddleware.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js +function resolveHostHeaderConfig(input) { + return input; +} +var hostHeaderMiddleware, hostHeaderMiddlewareOptions, getHostHeaderPlugin; +var init_hostHeaderMiddleware = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js"() { "use strict"; - init_dist_es2(); - websocketEndpointMiddleware = (config, options) => (next) => (args) => { - const { request: request3 } = args; - if (HttpRequest.isInstance(request3) && config.requestHandler.metadata?.handlerProtocol?.toLowerCase().includes("websocket")) { - request3.protocol = "wss:"; - request3.method = "GET"; - request3.path = `${request3.path}-websocket`; - const { headers } = request3; - delete headers["content-type"]; - delete headers["x-amz-content-sha256"]; - for (const name of Object.keys(headers)) { - if (name.indexOf(options.headerPrefix) === 0) { - const chunkedName = name.replace(options.headerPrefix, ""); - request3.query[chunkedName] = headers[name]; - } - } - if (headers["x-amz-user-agent"]) { - request3.query["user-agent"] = headers["x-amz-user-agent"]; - } - request3.headers = { host: headers.host ?? request3.hostname }; + init_protocols(); + hostHeaderMiddleware = (options) => (next) => async (args) => { + if (!HttpRequest.isInstance(args.request)) + return next(args); + const { request: request2 } = args; + const { handlerProtocol = "" } = options.requestHandler.metadata || {}; + if (handlerProtocol.indexOf("h2") >= 0 && !request2.headers[":authority"]) { + delete request2.headers["host"]; + request2.headers[":authority"] = request2.hostname + (request2.port ? ":" + request2.port : ""); + } else if (!request2.headers["host"]) { + let host = request2.hostname; + if (request2.port != null) + host += `:${request2.port}`; + request2.headers["host"] = host; } return next(args); }; - websocketEndpointMiddlewareOptions = { - name: "websocketEndpointMiddleware", - tags: ["WEBSOCKET", "EVENT_STREAM"], - relation: "after", - toMiddleware: "eventStreamHeaderMiddleware", + hostHeaderMiddlewareOptions = { + name: "hostHeaderMiddleware", + step: "build", + priority: "low", + tags: ["HOST"], override: true }; + getHostHeaderPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions); + } + }); } }); -// node_modules/@aws-sdk/middleware-websocket/dist-es/middlewares/websocketInjectSessionIdMiddleware.js -var injectSessionIdMiddleware, injectSessionIdMiddlewareOptions; -var init_websocketInjectSessionIdMiddleware = __esm({ - "node_modules/@aws-sdk/middleware-websocket/dist-es/middlewares/websocketInjectSessionIdMiddleware.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-logger/loggerMiddleware.js +var loggerMiddleware, loggerMiddlewareOptions, getLoggerPlugin; +var init_loggerMiddleware = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-logger/loggerMiddleware.js"() { "use strict"; - injectSessionIdMiddleware = () => (next) => async (args) => { - const requestParams = { - ...args.input - }; - const response = await next(args); - const output = response.output; - if (requestParams.SessionId && output.SessionId == null) { - output.SessionId = requestParams.SessionId; + loggerMiddleware = () => (next, context5) => async (args) => { + try { + const response = await next(args); + const { clientName, commandName, logger: logger8, dynamoDbDocumentClientOptions = {} } = context5; + const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions; + const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context5.inputFilterSensitiveLog; + const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context5.outputFilterSensitiveLog; + const { $metadata, ...outputWithoutMetadata } = response.output; + logger8?.info?.({ + clientName, + commandName, + input: inputFilterSensitiveLog(args.input), + output: outputFilterSensitiveLog(outputWithoutMetadata), + metadata: $metadata + }); + return response; + } catch (error2) { + const { clientName, commandName, logger: logger8, dynamoDbDocumentClientOptions = {} } = context5; + const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions; + const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context5.inputFilterSensitiveLog; + logger8?.error?.({ + clientName, + commandName, + input: inputFilterSensitiveLog(args.input), + error: error2, + metadata: error2.$metadata + }); + throw error2; } - return response; }; - injectSessionIdMiddlewareOptions = { + loggerMiddlewareOptions = { + name: "loggerMiddleware", + tags: ["LOGGER"], step: "initialize", - name: "injectSessionIdMiddleware", - tags: ["WEBSOCKET", "EVENT_STREAM"], override: true }; + getLoggerPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(loggerMiddleware(), loggerMiddlewareOptions); + } + }); } }); -// node_modules/@aws-sdk/middleware-websocket/dist-es/getWebSocketPlugin.js -var getWebSocketPlugin; -var init_getWebSocketPlugin = __esm({ - "node_modules/@aws-sdk/middleware-websocket/dist-es/getWebSocketPlugin.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/configuration.js +var recursionDetectionMiddlewareOptions; +var init_configuration = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/configuration.js"() { "use strict"; - init_websocketEndpointMiddleware(); - init_websocketInjectSessionIdMiddleware(); - getWebSocketPlugin = (config, options) => ({ + recursionDetectionMiddlewareOptions = { + step: "build", + tags: ["RECURSION_DETECTION"], + name: "recursionDetectionMiddleware", + override: true, + priority: "low" + }; + } +}); + +// node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js +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"() { + "use strict"; + 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(context5, fn) { + this.currentContext = context5; + return fn(); + } + }; + InvokeStoreMulti = class _InvokeStoreMulti extends InvokeStoreBase { + als; + static async create() { + const instance = new _InvokeStoreMulti(); + const asyncHooks = await import("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(context5, fn) { + return this.als.run(context5, 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/core/dist-es/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.js +var TRACE_ID_HEADER_NAME, ENV_LAMBDA_FUNCTION_NAME, ENV_TRACE_ID, recursionDetectionMiddleware; +var init_recursionDetectionMiddleware = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.js"() { + "use strict"; + init_invoke_store(); + init_protocols(); + TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id"; + ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME"; + ENV_TRACE_ID = "_X_AMZN_TRACE_ID"; + recursionDetectionMiddleware = () => (next) => async (args) => { + const { request: request2 } = args; + if (!HttpRequest.isInstance(request2)) { + return next(args); + } + const traceIdHeader = Object.keys(request2.headers ?? {}).find((h6) => h6.toLowerCase() === TRACE_ID_HEADER_NAME.toLowerCase()) ?? TRACE_ID_HEADER_NAME; + if (request2.headers.hasOwnProperty(traceIdHeader)) { + return next(args); + } + const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; + const traceIdFromEnv = process.env[ENV_TRACE_ID]; + const invokeStore = await InvokeStore.getInstanceAsync(); + const traceIdFromInvokeStore = invokeStore?.getXRayTraceId(); + const traceId = traceIdFromInvokeStore ?? traceIdFromEnv; + const nonEmptyString = (str) => typeof str === "string" && str.length > 0; + if (nonEmptyString(functionName) && nonEmptyString(traceId)) { + request2.headers[TRACE_ID_HEADER_NAME] = traceId; + } + return next({ + ...args, + request: request2 + }); + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.js +var getRecursionDetectionPlugin; +var init_getRecursionDetectionPlugin = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.js"() { + "use strict"; + init_configuration(); + init_recursionDetectionMiddleware(); + getRecursionDetectionPlugin = (options) => ({ applyToStack: (clientStack) => { - clientStack.addRelativeTo(websocketEndpointMiddleware(config, options), websocketEndpointMiddlewareOptions); - clientStack.add(injectSessionIdMiddleware(), injectSessionIdMiddlewareOptions); + clientStack.add(recursionDetectionMiddleware(), recursionDetectionMiddlewareOptions); } }); } }); -// node_modules/@aws-sdk/middleware-websocket/dist-es/WebsocketSignatureV4.js -var WebsocketSignatureV4; -var init_WebsocketSignatureV4 = __esm({ - "node_modules/@aws-sdk/middleware-websocket/dist-es/WebsocketSignatureV4.js"() { +// node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/resolveAuthOptions.js +var resolveAuthOptions; +var init_resolveAuthOptions = __esm({ + "node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/resolveAuthOptions.js"() { "use strict"; - init_dist_es2(); - init_utils3(); - WebsocketSignatureV4 = class { - signer; - constructor(options) { - this.signer = options.signer; - } - presign(originalRequest, options = {}) { - return this.signer.presign(originalRequest, options); + resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => { + if (!authSchemePreference || authSchemePreference.length === 0) { + return candidateAuthOptions; } - async sign(toSign, options) { - if (HttpRequest.isInstance(toSign) && isWebSocketRequest(toSign)) { - const signedRequest = await this.signer.presign({ ...toSign, body: "" }, { - ...options, - expiresIn: 60, - unsignableHeaders: new Set(Object.keys(toSign.headers).filter((header) => header !== "host")) - }); - return { - ...signedRequest, - body: toSign.body - }; - } else { - return this.signer.sign(toSign, options); + const preferredAuthOptions = []; + for (const preferredSchemeName of authSchemePreference) { + for (const candidateAuthOption of candidateAuthOptions) { + const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1]; + if (candidateAuthSchemeName === preferredSchemeName) { + preferredAuthOptions.push(candidateAuthOption); + } } } - signMessage(message, args) { - return this.signer.signMessage(message, args); + for (const candidateAuthOption of candidateAuthOptions) { + if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) { + preferredAuthOptions.push(candidateAuthOption); + } } + return preferredAuthOptions; }; } }); -// node_modules/@aws-sdk/middleware-websocket/dist-es/resolveWebSocketConfig.js -var resolveWebSocketConfig, validateSigner; -var init_resolveWebSocketConfig = __esm({ - "node_modules/@aws-sdk/middleware-websocket/dist-es/resolveWebSocketConfig.js"() { +// node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js +function convertHttpAuthSchemesToMap(httpAuthSchemes) { + const map2 = /* @__PURE__ */ new Map(); + for (const scheme of httpAuthSchemes) { + map2.set(scheme.schemeId, scheme); + } + return map2; +} +var httpAuthSchemeMiddleware; +var init_httpAuthSchemeMiddleware = __esm({ + "node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js"() { "use strict"; - init_WebsocketSignatureV4(); - resolveWebSocketConfig = (input) => { - const { signer } = input; - return Object.assign(input, { - signer: async (authScheme) => { - const signerObj = await signer(authScheme); - if (validateSigner(signerObj)) { - return new WebsocketSignatureV4({ signer: signerObj }); - } - throw new Error("Expected WebsocketSignatureV4 signer, please check the client constructor."); + init_client3(); + init_resolveAuthOptions(); + httpAuthSchemeMiddleware = (config, mwOptions) => (next, context5) => async (args) => { + const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context5, args.input)); + const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : []; + const resolvedOptions = resolveAuthOptions(options, authSchemePreference); + const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes); + const smithyContext = getSmithyContext(context5); + 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, context5) || {}; + 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); }; - validateSigner = (signer) => !!signer; } }); -// node_modules/@aws-sdk/middleware-websocket/dist-es/ws-eventstream/eventStreamPayloadHandlerProvider.js -var init_eventStreamPayloadHandlerProvider = __esm({ - "node_modules/@aws-sdk/middleware-websocket/dist-es/ws-eventstream/eventStreamPayloadHandlerProvider.js"() { +// node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js +var httpAuthSchemeEndpointRuleSetMiddlewareOptions, getHttpAuthSchemeEndpointRuleSetPlugin; +var init_getHttpAuthSchemeEndpointRuleSetPlugin = __esm({ + "node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js"() { "use strict"; + 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/@aws-sdk/middleware-websocket/dist-es/index.js -var init_dist_es38 = __esm({ - "node_modules/@aws-sdk/middleware-websocket/dist-es/index.js"() { +// node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js +var init_getHttpAuthSchemePlugin = __esm({ + "node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js"() { "use strict"; - init_WebSocketFetchHandler(); - init_getWebSocketPlugin(); - init_resolveWebSocketConfig(); - init_eventStreamPayloadHandlerProvider(); } }); -// node_modules/@smithy/util-config-provider/dist-es/booleanSelector.js -var booleanSelector; -var init_booleanSelector = __esm({ - "node_modules/@smithy/util-config-provider/dist-es/booleanSelector.js"() { +// node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/index.js +var init_middleware_http_auth_scheme = __esm({ + "node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/index.js"() { "use strict"; - 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]}.`); - }; + init_httpAuthSchemeMiddleware(); + init_getHttpAuthSchemeEndpointRuleSetPlugin(); + init_getHttpAuthSchemePlugin(); } }); -// node_modules/@smithy/util-config-provider/dist-es/numberSelector.js -var init_numberSelector = __esm({ - "node_modules/@smithy/util-config-provider/dist-es/numberSelector.js"() { +// node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/httpSigningMiddleware.js +var defaultErrorHandler, defaultSuccessHandler, httpSigningMiddleware; +var init_httpSigningMiddleware = __esm({ + "node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/httpSigningMiddleware.js"() { "use strict"; + init_client3(); + init_protocols(); + defaultErrorHandler = (signingProperties) => (error2) => { + throw error2; + }; + defaultSuccessHandler = (httpResponse, signingProperties) => { + }; + httpSigningMiddleware = (config) => (next, context5) => async (args) => { + if (!HttpRequest.isInstance(args.request)) { + return next(args); + } + const smithyContext = getSmithyContext(context5); + 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/util-config-provider/dist-es/types.js -var SelectorType; -var init_types5 = __esm({ - "node_modules/@smithy/util-config-provider/dist-es/types.js"() { +// node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/getHttpSigningMiddleware.js +var httpSigningMiddlewareOptions, getHttpSigningPlugin; +var init_getHttpSigningMiddleware = __esm({ + "node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/getHttpSigningMiddleware.js"() { "use strict"; - (function(SelectorType2) { - SelectorType2["ENV"] = "env"; - SelectorType2["CONFIG"] = "shared config entry"; - })(SelectorType || (SelectorType = {})); + 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/util-config-provider/dist-es/index.js -var init_dist_es39 = __esm({ - "node_modules/@smithy/util-config-provider/dist-es/index.js"() { +// node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/index.js +var init_middleware_http_signing = __esm({ + "node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/index.js"() { "use strict"; - init_booleanSelector(); - init_numberSelector(); - init_types5(); + init_httpSigningMiddleware(); + init_getHttpSigningMiddleware(); } }); -// node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js -var ENV_USE_DUALSTACK_ENDPOINT, CONFIG_USE_DUALSTACK_ENDPOINT, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS; -var init_NodeUseDualstackEndpointConfigOptions = __esm({ - "node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js"() { +// node_modules/@smithy/core/dist-es/normalizeProvider.js +var normalizeProvider2; +var init_normalizeProvider2 = __esm({ + "node_modules/@smithy/core/dist-es/normalizeProvider.js"() { "use strict"; - init_dist_es39(); - ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; - CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; - NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env2) => booleanSelector(env2, ENV_USE_DUALSTACK_ENDPOINT, SelectorType.ENV), - configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, SelectorType.CONFIG), - default: false + normalizeProvider2 = (input) => { + if (typeof input === "function") + return input; + const promisified = Promise.resolve(input); + return () => promisified; }; } }); -// node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js -var ENV_USE_FIPS_ENDPOINT, CONFIG_USE_FIPS_ENDPOINT, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS; -var init_NodeUseFipsEndpointConfigOptions = __esm({ - "node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js"() { +// node_modules/@smithy/core/dist-es/legacy-root-exports/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/legacy-root-exports/pagination/createPaginator.js"() { "use strict"; - init_dist_es39(); - ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; - CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; - NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env2) => booleanSelector(env2, ENV_USE_FIPS_ENDPOINT, SelectorType.ENV), - configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, SelectorType.CONFIG), - default: false + makePagedClientRequest = async (CommandCtor, client2, input, withCommand = (_3) => _3, ...args) => { + let command2 = new CommandCtor(input); + command2 = withCommand(command2) ?? command2; + return await client2.send(command2, ...args); + }; + get = (fromObject, path10) => { + let cursor = fromObject; + const pathComponents = path10.split("."); + for (const step of pathComponents) { + if (!cursor || typeof cursor !== "object") { + return void 0; + } + cursor = cursor[step]; + } + return cursor; }; } }); -// node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveCustomEndpointsConfig.js -var init_resolveCustomEndpointsConfig = __esm({ - "node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveCustomEndpointsConfig.js"() { +// node_modules/@smithy/core/dist-es/setFeature.js +var init_setFeature2 = __esm({ + "node_modules/@smithy/core/dist-es/setFeature.js"() { "use strict"; } }); -// node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveEndpointsConfig.js -var init_resolveEndpointsConfig = __esm({ - "node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveEndpointsConfig.js"() { +// node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js +var DefaultIdentityProviderConfig; +var init_DefaultIdentityProviderConfig = __esm({ + "node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js"() { "use strict"; + 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/config-resolver/dist-es/endpointsConfig/index.js -var init_endpointsConfig = __esm({ - "node_modules/@smithy/config-resolver/dist-es/endpointsConfig/index.js"() { +// node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js +var init_httpApiKeyAuth = __esm({ + "node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js"() { "use strict"; - init_NodeUseDualstackEndpointConfigOptions(); - init_NodeUseFipsEndpointConfigOptions(); - init_resolveCustomEndpointsConfig(); - init_resolveEndpointsConfig(); } }); -// node_modules/@smithy/config-resolver/dist-es/regionConfig/config.js -var REGION_ENV_NAME, REGION_INI_NAME, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS; -var init_config3 = __esm({ - "node_modules/@smithy/config-resolver/dist-es/regionConfig/config.js"() { +// node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js +var HttpBearerAuthSigner; +var init_httpBearerAuth = __esm({ + "node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js"() { "use strict"; - REGION_ENV_NAME = "AWS_REGION"; - REGION_INI_NAME = "region"; - NODE_REGION_CONFIG_OPTIONS = { - environmentVariableSelector: (env2) => env2[REGION_ENV_NAME], - configFileSelector: (profile) => profile[REGION_INI_NAME], - default: () => { - throw new Error("Region is missing"); + init_protocols(); + HttpBearerAuthSigner = class { + async sign(httpRequest2, identity, signingProperties) { + const clonedRequest = HttpRequest.clone(httpRequest2); + 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_REGION_CONFIG_FILE_OPTIONS = { - preferredFile: "credentials" - }; } }); -// node_modules/@smithy/config-resolver/dist-es/regionConfig/checkRegion.js -var validRegions, checkRegion; -var init_checkRegion = __esm({ - "node_modules/@smithy/config-resolver/dist-es/regionConfig/checkRegion.js"() { +// node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/httpAuthSchemes/noAuth.js +var NoAuthSigner; +var init_noAuth = __esm({ + "node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/httpAuthSchemes/noAuth.js"() { "use strict"; - init_dist_es22(); - validRegions = /* @__PURE__ */ new Set(); - checkRegion = (region, check = 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); + NoAuthSigner = class { + async sign(httpRequest2, identity, signingProperties) { + return httpRequest2; } }; } }); -// node_modules/@smithy/config-resolver/dist-es/regionConfig/isFipsRegion.js -var isFipsRegion; -var init_isFipsRegion = __esm({ - "node_modules/@smithy/config-resolver/dist-es/regionConfig/isFipsRegion.js"() { - "use strict"; - isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")); - } -}); - -// node_modules/@smithy/config-resolver/dist-es/regionConfig/getRealRegion.js -var getRealRegion; -var init_getRealRegion = __esm({ - "node_modules/@smithy/config-resolver/dist-es/regionConfig/getRealRegion.js"() { +// node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/httpAuthSchemes/index.js +var init_httpAuthSchemes = __esm({ + "node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/httpAuthSchemes/index.js"() { "use strict"; - init_isFipsRegion(); - getRealRegion = (region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region; + init_httpApiKeyAuth(); + init_httpBearerAuth(); + init_noAuth(); } }); -// node_modules/@smithy/config-resolver/dist-es/regionConfig/resolveRegionConfig.js -var resolveRegionConfig; -var init_resolveRegionConfig = __esm({ - "node_modules/@smithy/config-resolver/dist-es/regionConfig/resolveRegionConfig.js"() { +// node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/memoizeIdentityProvider.js +var createIsIdentityExpiredFunction, EXPIRATION_MS, isIdentityExpired, doesIdentityRequireRefresh, memoizeIdentityProvider; +var init_memoizeIdentityProvider = __esm({ + "node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/memoizeIdentityProvider.js"() { "use strict"; - init_checkRegion(); - init_getRealRegion(); - init_isFipsRegion(); - resolveRegionConfig = (input) => { - const { region, useFipsEndpoint } = input; - if (!region) { - throw new Error("Region is missing"); + 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; } - 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; + 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 typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); + 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/config-resolver/dist-es/regionConfig/index.js -var init_regionConfig = __esm({ - "node_modules/@smithy/config-resolver/dist-es/regionConfig/index.js"() { +// node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/index.js +var init_util_identity_and_auth = __esm({ + "node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/index.js"() { "use strict"; - init_config3(); - init_resolveRegionConfig(); + init_DefaultIdentityProviderConfig(); + init_httpAuthSchemes(); + init_memoizeIdentityProvider(); } }); -// node_modules/@smithy/config-resolver/dist-es/regionInfo/PartitionHash.js -var init_PartitionHash = __esm({ - "node_modules/@smithy/config-resolver/dist-es/regionInfo/PartitionHash.js"() { +// node_modules/@smithy/core/dist-es/index.js +var init_dist_es5 = __esm({ + "node_modules/@smithy/core/dist-es/index.js"() { "use strict"; + init_middleware_http_auth_scheme(); + init_middleware_http_signing(); + init_normalizeProvider2(); + init_createPaginator(); + init_setFeature2(); + init_util_identity_and_auth(); } }); -// node_modules/@smithy/config-resolver/dist-es/regionInfo/RegionHash.js -var init_RegionHash = __esm({ - "node_modules/@smithy/config-resolver/dist-es/regionInfo/RegionHash.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/configurations.js +function isValidUserAgentAppId(appId) { + if (appId === void 0) { + return true; + } + return typeof appId === "string" && appId.length <= 50; +} +function resolveUserAgentConfig(input) { + const normalizedAppIdProvider = normalizeProvider2(input.userAgentAppId ?? DEFAULT_UA_APP_ID); + const { customUserAgent } = input; + return Object.assign(input, { + customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent, + userAgentAppId: async () => { + const appId = await normalizedAppIdProvider(); + if (!isValidUserAgentAppId(appId)) { + const logger8 = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger; + if (typeof appId !== "string") { + logger8?.warn("userAgentAppId must be a string or undefined."); + } else if (appId.length > 50) { + logger8?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters."); + } + } + return appId; + } + }); +} +var DEFAULT_UA_APP_ID; +var init_configurations2 = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/configurations.js"() { "use strict"; + init_dist_es5(); + DEFAULT_UA_APP_ID = void 0; } }); -// node_modules/@smithy/config-resolver/dist-es/regionInfo/getRegionInfo.js -var init_getRegionInfo = __esm({ - "node_modules/@smithy/config-resolver/dist-es/regionInfo/getRegionInfo.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partitions.js +var partitionsInfo; +var init_partitions = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partitions.js"() { "use strict"; + partitionsInfo = { "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)" } } }], "version": "1.1" }; } }); -// node_modules/@smithy/config-resolver/dist-es/regionInfo/index.js -var init_regionInfo = __esm({ - "node_modules/@smithy/config-resolver/dist-es/regionInfo/index.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partition.js +var selectedPartitionsInfo, selectedUserAgentPrefix, partition, getUserAgentPrefix; +var init_partition = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partition.js"() { "use strict"; - init_PartitionHash(); - init_RegionHash(); - init_getRegionInfo(); + init_partitions(); + selectedPartitionsInfo = partitionsInfo; + selectedUserAgentPrefix = ""; + partition = (value) => { + const { partitions } = selectedPartitionsInfo; + for (const partition2 of partitions) { + const { regions, outputs } = partition2; + for (const [region, regionData] of Object.entries(regions)) { + if (region === value) { + return { + ...outputs, + ...regionData + }; + } + } + } + for (const partition2 of partitions) { + const { regionRegex, outputs } = partition2; + if (new RegExp(regionRegex).test(value)) { + return { + ...outputs + }; + } + } + const DEFAULT_PARTITION = partitions.find((partition2) => partition2.id === "aws"); + if (!DEFAULT_PARTITION) { + throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist."); + } + return { + ...DEFAULT_PARTITION.outputs + }; + }; + getUserAgentPrefix = () => selectedUserAgentPrefix; } }); -// node_modules/@smithy/config-resolver/dist-es/index.js -var init_dist_es40 = __esm({ - "node_modules/@smithy/config-resolver/dist-es/index.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/check-features.js +async function checkFeatures(context5, config, args) { + const request2 = args.request; + if (request2?.headers?.["smithy-protocol"] === "rpc-v2-cbor") { + setFeature2(context5, "PROTOCOL_RPC_V2_CBOR", "M"); + } + if (typeof config.retryStrategy === "function") { + const retryStrategy = await config.retryStrategy(); + if (typeof retryStrategy.mode === "string") { + switch (retryStrategy.mode) { + case RETRY_MODES.ADAPTIVE: + setFeature2(context5, "RETRY_MODE_ADAPTIVE", "F"); + break; + case RETRY_MODES.STANDARD: + setFeature2(context5, "RETRY_MODE_STANDARD", "E"); + break; + } + } + } + if (typeof config.accountIdEndpointMode === "function") { + const endpointV2 = context5.endpointV2; + if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) { + setFeature2(context5, "ACCOUNT_ID_ENDPOINT", "O"); + } + switch (await config.accountIdEndpointMode?.()) { + case "disabled": + setFeature2(context5, "ACCOUNT_ID_MODE_DISABLED", "Q"); + break; + case "preferred": + setFeature2(context5, "ACCOUNT_ID_MODE_PREFERRED", "P"); + break; + case "required": + setFeature2(context5, "ACCOUNT_ID_MODE_REQUIRED", "R"); + break; + } + } + const identity = context5.__smithy_context?.selectedHttpAuthScheme?.identity; + if (identity?.$source) { + const credentials = identity; + if (credentials.accountId) { + setFeature2(context5, "RESOLVED_ACCOUNT_ID", "T"); + } + for (const [key, value] of Object.entries(credentials.$source ?? {})) { + setFeature2(context5, key, value); + } + } +} +var ACCOUNT_ID_ENDPOINT_REGEX; +var init_check_features = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/check-features.js"() { "use strict"; - init_endpointsConfig(); - init_regionConfig(); - init_regionInfo(); + init_retry3(); + init_setFeature(); + ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/; } }); -// node_modules/@smithy/eventstream-serde-config-resolver/dist-es/EventStreamSerdeConfig.js -var resolveEventStreamSerdeConfig; -var init_EventStreamSerdeConfig = __esm({ - "node_modules/@smithy/eventstream-serde-config-resolver/dist-es/EventStreamSerdeConfig.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/constants.js +var USER_AGENT, X_AMZ_USER_AGENT, SPACE, UA_NAME_SEPARATOR, UA_NAME_ESCAPE_REGEX, UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR; +var init_constants5 = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/constants.js"() { "use strict"; - resolveEventStreamSerdeConfig = (input) => Object.assign(input, { - eventStreamMarshaller: input.eventStreamSerdeProvider(input) - }); + USER_AGENT = "user-agent"; + X_AMZ_USER_AGENT = "x-amz-user-agent"; + SPACE = " "; + UA_NAME_SEPARATOR = "/"; + UA_NAME_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w]/g; + UA_VALUE_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w#]/g; + UA_ESCAPE_CHAR = "-"; } }); -// node_modules/@smithy/eventstream-serde-config-resolver/dist-es/index.js -var init_dist_es41 = __esm({ - "node_modules/@smithy/eventstream-serde-config-resolver/dist-es/index.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/encode-features.js +function encodeFeatures(features) { + let buffer2 = ""; + for (const key in features) { + const val = features[key]; + if (buffer2.length + val.length + 1 <= BYTE_LIMIT) { + if (buffer2.length) { + buffer2 += "," + val; + } else { + buffer2 += val; + } + continue; + } + break; + } + return buffer2; +} +var BYTE_LIMIT; +var init_encode_features = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/encode-features.js"() { "use strict"; - init_EventStreamSerdeConfig(); + BYTE_LIMIT = 1024; } }); -// node_modules/@smithy/middleware-content-length/dist-es/index.js -function contentLengthMiddleware(bodyLengthChecker) { - return (next) => async (args) => { - const request3 = args.request; - if (HttpRequest.isInstance(request3)) { - const { body: body2, headers } = request3; - if (body2 && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER) === -1) { - try { - const length = bodyLengthChecker(body2); - request3.headers = { - ...request3.headers, - [CONTENT_LENGTH_HEADER]: String(length) - }; - } catch (error2) { +// node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/user-agent-middleware.js +var userAgentMiddleware, escapeUserAgent, getUserAgentMiddlewareOptions, getUserAgentPlugin; +var init_user_agent_middleware = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/user-agent-middleware.js"() { + "use strict"; + init_protocols(); + init_partition(); + init_check_features(); + init_constants5(); + init_encode_features(); + userAgentMiddleware = (options) => (next, context5) => async (args) => { + const { request: request2 } = args; + if (!HttpRequest.isInstance(request2)) { + return next(args); + } + const { headers } = request2; + const userAgent2 = context5?.userAgent?.map(escapeUserAgent) || []; + const defaultUserAgent2 = (await options.defaultUserAgentProvider()).map(escapeUserAgent); + await checkFeatures(context5, options, args); + const awsContext = context5; + defaultUserAgent2.push(`m/${encodeFeatures(Object.assign({}, context5.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`); + const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || []; + const appId = await options.userAgentAppId(); + if (appId) { + defaultUserAgent2.push(escapeUserAgent([`app`, `${appId}`])); + } + const prefix2 = getUserAgentPrefix(); + const sdkUserAgentValue = (prefix2 ? [prefix2] : []).concat([...defaultUserAgent2, ...userAgent2, ...customUserAgent]).join(SPACE); + const normalUAValue = [ + ...defaultUserAgent2.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_AGENT]} ${normalUAValue}` : normalUAValue; } + headers[USER_AGENT] = sdkUserAgentValue; + } else { + headers[X_AMZ_USER_AGENT] = sdkUserAgentValue; } - } - return next({ - ...args, - request: request3 - }); - }; -} -var CONTENT_LENGTH_HEADER, contentLengthMiddlewareOptions, getContentLengthPlugin; -var init_dist_es42 = __esm({ - "node_modules/@smithy/middleware-content-length/dist-es/index.js"() { - "use strict"; - init_dist_es2(); - CONTENT_LENGTH_HEADER = "content-length"; - contentLengthMiddlewareOptions = { + return next({ + ...args, + request: request2 + }); + }; + 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 version3 = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR); + const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR); + const prefix2 = name.substring(0, prefixSeparatorIndex); + let uaName = name.substring(prefixSeparatorIndex + 1); + if (prefix2 === "api") { + uaName = uaName.toLowerCase(); + } + return [prefix2, uaName, version3].filter((item) => item && item.length > 0).reduce((acc, item, index2) => { + switch (index2) { + case 0: + return item; + case 1: + return `${acc}/${item}`; + default: + return `${acc}#${item}`; + } + }, ""); + }; + getUserAgentMiddlewareOptions = { + name: "getUserAgentMiddleware", step: "build", - tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], - name: "contentLengthMiddleware", + priority: "low", + tags: ["SET_USER_AGENT", "USER_AGENT"], override: true }; - getContentLengthPlugin = (options) => ({ + getUserAgentPlugin = (config) => ({ applyToStack: (clientStack) => { - clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions); + clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions); } }); } }); -// node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/s3.js -var resolveParamsForS3, DOMAIN_PATTERN, IP_ADDRESS_PATTERN, DOTS_PATTERN, isDnsCompatibleBucketName, isArnBucketName; -var init_s3 = __esm({ - "node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/s3.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/getRuntimeUserAgentPair.js +import { versions } from "process"; +var getRuntimeUserAgentPair; +var init_getRuntimeUserAgentPair = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/getRuntimeUserAgentPair.js"() { "use strict"; - 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"); + getRuntimeUserAgentPair = () => { + const runtimesToCheck = ["deno", "bun", "llrt"]; + for (const runtime of runtimesToCheck) { + if (versions[runtime]) { + return [`md/${runtime}`, versions[runtime]]; } - } 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 ["md/nodejs", versions.node]; + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/getNodeModulesParentDirs.js +import { normalize as normalize4, sep as sep6 } from "path"; +var getNodeModulesParentDirs; +var init_getNodeModulesParentDirs = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/getNodeModulesParentDirs.js"() { + "use strict"; + getNodeModulesParentDirs = (dirname5) => { + const cwd = process.cwd(); + if (!dirname5) { + return [cwd]; } - return endpointParams; + const normalizedPath = normalize4(dirname5); + const parts = normalizedPath.split(sep6); + const nodeModulesIndex = parts.indexOf("node_modules"); + const parentDir = nodeModulesIndex !== -1 ? parts.slice(0, nodeModulesIndex).join(sep6) : normalizedPath; + if (cwd === parentDir) { + return [cwd]; + } + return [parentDir, cwd]; }; - DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; - IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; - DOTS_PATTERN = /\.\./; - isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName); - isArnBucketName = (bucketName) => { - const [arn, partition2, service, , , bucket] = bucketName.split(":"); - const isArn = arn === "arn" && bucketName.split(":").length >= 6; - const isValidArn = Boolean(isArn && partition2 && service && bucket); - if (isArn && !isValidArn) { - throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`); + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/getSanitizedTypeScriptVersion.js +var SEMVER_REGEX, getSanitizedTypeScriptVersion; +var init_getSanitizedTypeScriptVersion = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/getSanitizedTypeScriptVersion.js"() { + "use strict"; + 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-]+)*)?$/; + getSanitizedTypeScriptVersion = (version3 = "") => { + const match3 = version3.match(SEMVER_REGEX); + if (!match3) { + return void 0; } - return isValidArn; + const [major, minor, patch, prerelease] = [match3[1], match3[2], match3[3], match3[4]]; + return prerelease ? `${major}.${minor}.${patch}-${prerelease}` : `${major}.${minor}.${patch}`; }; } }); -// node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/index.js -var init_service_customizations = __esm({ - "node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/index.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/getSanitizedDevTypeScriptVersion.js +var ALLOWED_PREFIXES, ALLOWED_DIST_TAGS, getSanitizedDevTypeScriptVersion; +var init_getSanitizedDevTypeScriptVersion = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/getSanitizedDevTypeScriptVersion.js"() { "use strict"; - init_s3(); + init_getSanitizedTypeScriptVersion(); + ALLOWED_PREFIXES = ["^", "~", ">=", "<=", ">", "<"]; + ALLOWED_DIST_TAGS = ["latest", "beta", "dev", "rc", "insiders", "next"]; + getSanitizedDevTypeScriptVersion = (version3 = "") => { + if (ALLOWED_DIST_TAGS.includes(version3)) { + return version3; + } + const prefix2 = ALLOWED_PREFIXES.find((p2) => version3.startsWith(p2)) ?? ""; + const sanitizedTypeScriptVersion = getSanitizedTypeScriptVersion(version3.slice(prefix2.length)); + if (!sanitizedTypeScriptVersion) { + return void 0; + } + return `${prefix2}${sanitizedTypeScriptVersion}`; + }; } }); -// node_modules/@smithy/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js -var createConfigValueProvider; -var init_createConfigValueProvider = __esm({ - "node_modules/@smithy/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/getTypeScriptUserAgentPair.js +import { readFile as readFile3 } from "fs/promises"; +import { join as join9 } from "path"; +var tscVersion, TS_PACKAGE_JSON, getTypeScriptUserAgentPair; +var init_getTypeScriptUserAgentPair = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/getTypeScriptUserAgentPair.js"() { "use strict"; - 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; - }; + init_config3(); + init_getNodeModulesParentDirs(); + init_getSanitizedDevTypeScriptVersion(); + init_getSanitizedTypeScriptVersion(); + TS_PACKAGE_JSON = join9("node_modules", "typescript", "package.json"); + getTypeScriptUserAgentPair = async () => { + if (tscVersion === null) { + return void 0; + } else if (typeof tscVersion === "string") { + return ["md/tsc", tscVersion]; } - 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; - }; + let isTypeScriptDetectionDisabled = false; + try { + isTypeScriptDetectionDisabled = booleanSelector(process.env, "AWS_SDK_JS_TYPESCRIPT_DETECTION_DISABLED", SelectorType.ENV) || false; + } catch { } - if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { - return async () => { - if (config.isCustomEndpoint === false) { - return void 0; + if (isTypeScriptDetectionDisabled) { + tscVersion = null; + return void 0; + } + const dirname5 = typeof __dirname !== "undefined" ? __dirname : void 0; + const nodeModulesParentDirs = getNodeModulesParentDirs(dirname5); + let versionFromApp; + for (const nodeModulesParentDir of nodeModulesParentDirs) { + try { + const appPackageJsonPath = join9(nodeModulesParentDir, "package.json"); + const packageJson = await readFile3(appPackageJsonPath, "utf-8"); + const { dependencies, devDependencies } = JSON.parse(packageJson); + const version3 = devDependencies?.typescript ?? dependencies?.typescript; + if (typeof version3 !== "string") { + continue; } - const endpoint2 = await configProvider(); - if (endpoint2 && typeof endpoint2 === "object") { - if ("url" in endpoint2) { - return endpoint2.url.href; - } - if ("hostname" in endpoint2) { - const { protocol, hostname, port, path: path10 } = endpoint2; - return `${protocol}//${hostname}${port ? ":" + port : ""}${path10}`; - } + versionFromApp = version3; + break; + } catch { + } + } + if (!versionFromApp) { + tscVersion = null; + return void 0; + } + let versionFromNodeModules; + for (const nodeModulesParentDir of nodeModulesParentDirs) { + try { + const tsPackageJsonPath = join9(nodeModulesParentDir, TS_PACKAGE_JSON); + const packageJson = await readFile3(tsPackageJsonPath, "utf-8"); + const { version: version3 } = JSON.parse(packageJson); + const sanitizedVersion2 = getSanitizedTypeScriptVersion(version3); + if (typeof sanitizedVersion2 !== "string") { + continue; } - return endpoint2; - }; + versionFromNodeModules = sanitizedVersion2; + break; + } catch { + } } - return configProvider; + 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]; }; } }); -// node_modules/@smithy/node-config-provider/dist-es/getSelectorName.js -function getSelectorName(functionString) { - try { - const constants4 = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? [])); - constants4.delete("CONFIG"); - constants4.delete("CONFIG_PREFIX_SEPARATOR"); - constants4.delete("ENV"); - return [...constants4].join(", "); - } catch (e6) { - return functionString; - } -} -var init_getSelectorName = __esm({ - "node_modules/@smithy/node-config-provider/dist-es/getSelectorName.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/crt-availability.js +var crtAvailability; +var init_crt_availability = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/crt-availability.js"() { "use strict"; + crtAvailability = { + isCrtAvailable: false + }; } }); -// node_modules/@smithy/node-config-provider/dist-es/fromEnv.js -var fromEnv; -var init_fromEnv = __esm({ - "node_modules/@smithy/node-config-provider/dist-es/fromEnv.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/is-crt-available.js +var isCrtAvailable; +var init_is_crt_available = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/is-crt-available.js"() { "use strict"; - init_dist_es24(); - init_getSelectorName(); - fromEnv = (envVarSelector, options) => async () => { - try { - const config = envVarSelector(process.env, options); - if (config === void 0) { - throw new Error(); - } - return config; - } catch (e6) { - throw new CredentialsProviderError(e6.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, { logger: options?.logger }); + init_crt_availability(); + isCrtAvailable = () => { + if (crtAvailability.isCrtAvailable) { + return ["md/crt-avail"]; } + return null; }; } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/getHomeDir.js -import { homedir } from "os"; -import { sep as sep5 } from "path"; -var homeDirCache, getHomeDirCacheKey, getHomeDir; -var init_getHomeDir = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/getHomeDir.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/defaultUserAgent.js +import { platform as platform2, release } from "os"; +import { env as env2 } from "process"; +var createDefaultUserAgentProvider; +var init_defaultUserAgent = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/defaultUserAgent.js"() { "use strict"; - homeDirCache = {}; - getHomeDirCacheKey = () => { - if (process && process.geteuid) { - return `${process.geteuid()}`; - } - return "DEFAULT"; - }; - getHomeDir = () => { - const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${sep5}` } = process.env; - if (HOME) - return HOME; - if (USERPROFILE) - return USERPROFILE; - if (HOMEPATH) - return `${HOMEDRIVE}${HOMEPATH}`; - const homeDirCacheKey = getHomeDirCacheKey(); - if (!homeDirCache[homeDirCacheKey]) - homeDirCache[homeDirCacheKey] = homedir(); - return homeDirCache[homeDirCacheKey]; + init_getRuntimeUserAgentPair(); + init_getTypeScriptUserAgentPair(); + init_is_crt_available(); + createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => { + const runtimeUserAgentPair = getRuntimeUserAgentPair(); + return async (config) => { + const sections = [ + ["aws-sdk-js", clientVersion], + ["ua", "2.1"], + [`os/${platform2()}`, 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 (env2.AWS_EXECUTION_ENV) { + sections.push([`exec-env/${env2.AWS_EXECUTION_ENV}`]); + } + const appId = await config?.userAgentAppId?.(); + const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections]; + return resolvedUserAgent; + }; }; } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/getProfileName.js -var ENV_PROFILE, DEFAULT_PROFILE, getProfileName; -var init_getProfileName = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/getProfileName.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/nodeAppIdConfigOptions.js +var UA_APP_ID_ENV_NAME, UA_APP_ID_INI_NAME, UA_APP_ID_INI_NAME_DEPRECATED, NODE_APP_ID_CONFIG_OPTIONS; +var init_nodeAppIdConfigOptions = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/nodeAppIdConfigOptions.js"() { "use strict"; - ENV_PROFILE = "AWS_PROFILE"; - DEFAULT_PROFILE = "default"; - getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE; + init_configurations2(); + UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; + UA_APP_ID_INI_NAME = "sdk_ua_app_id"; + UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id"; + NODE_APP_ID_CONFIG_OPTIONS = { + environmentVariableSelector: (env3) => env3[UA_APP_ID_ENV_NAME], + configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED], + default: DEFAULT_UA_APP_ID + }; } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js -import { createHash as createHash4 } from "crypto"; -import { join as join4 } from "path"; -var getSSOTokenFilepath; -var init_getSSOTokenFilepath = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/isIpAddress.js +var init_isIpAddress2 = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/isIpAddress.js"() { "use strict"; - init_getHomeDir(); - getSSOTokenFilepath = (id) => { - const hasher = createHash4("sha1"); - const cacheName = hasher.update(id).digest("hex"); - return join4(getHomeDir(), ".aws", "sso", "cache", `${cacheName}.json`); - }; + init_endpoints3(); } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js -import { readFile } from "fs/promises"; -var tokenIntercept, getSSOTokenFromFile; -var init_getSSOTokenFromFile = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/isVirtualHostableS3Bucket.js +var isVirtualHostableS3Bucket; +var init_isVirtualHostableS3Bucket = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/isVirtualHostableS3Bucket.js"() { "use strict"; - init_getSSOTokenFilepath(); - tokenIntercept = {}; - getSSOTokenFromFile = async (id) => { - if (tokenIntercept[id]) { - return tokenIntercept[id]; + init_endpoints3(); + init_isIpAddress2(); + isVirtualHostableS3Bucket = (value, allowSubDomains = false) => { + if (allowSubDomains) { + for (const label of value.split(".")) { + if (!isVirtualHostableS3Bucket(label)) { + return false; + } + } + return true; } - const ssoTokenFilepath = getSSOTokenFilepath(id); - const ssoTokenText = await readFile(ssoTokenFilepath, "utf8"); - return JSON.parse(ssoTokenText); + if (!isValidHostLabel(value)) { + return false; + } + if (value.length < 3 || value.length > 63) { + return false; + } + if (value !== value.toLowerCase()) { + return false; + } + if (isIpAddress(value)) { + return false; + } + return true; }; } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/constants.js -var CONFIG_PREFIX_SEPARATOR; -var init_constants7 = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/constants.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/parseArn.js +var ARN_DELIMITER, RESOURCE_DELIMITER, parseArn; +var init_parseArn = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/parseArn.js"() { "use strict"; - CONFIG_PREFIX_SEPARATOR = "."; + ARN_DELIMITER = ":"; + RESOURCE_DELIMITER = "/"; + 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 + }; + }; } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigData.js -var getConfigData; -var init_getConfigData = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigData.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/aws.js +var awsEndpointFunctions; +var init_aws = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/aws.js"() { "use strict"; - init_dist_es(); - init_constants7(); - getConfigData = (data) => Object.entries(data).filter(([key]) => { - const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); - if (indexOfSeparator === -1) { - return false; + init_endpoints3(); + init_isVirtualHostableS3Bucket(); + init_parseArn(); + init_partition(); + awsEndpointFunctions = { + isVirtualHostableS3Bucket, + parseArn, + partition + }; + customEndpointFunctions.aws = awsEndpointFunctions; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/client/region-config-resolver/stsRegionDefaultResolver.js +function stsRegionDefaultResolver(loaderConfig = {}) { + return loadConfig({ + ...NODE_REGION_CONFIG_OPTIONS, + async default() { + if (!warning2.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 Object.values(IniSectionType).includes(key.substring(0, indexOfSeparator)); - }).reduce((acc, [key, value]) => { - const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); - const updatedKey = key.substring(0, indexOfSeparator) === IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; - acc[updatedKey] = value; - return acc; - }, { - ...data.default && { default: data.default } - }); + return "us-east-1"; + } + }, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }); +} +var warning2; +var init_stsRegionDefaultResolver = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/region-config-resolver/stsRegionDefaultResolver.js"() { + "use strict"; + init_config3(); + warning2 = { + silence: false + }; } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigFilepath.js -import { join as join5 } from "path"; -var ENV_CONFIG_PATH, getConfigFilepath; -var init_getConfigFilepath = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigFilepath.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/region-config-resolver/extensions.js +var getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration; +var init_extensions2 = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/region-config-resolver/extensions.js"() { "use strict"; - init_getHomeDir(); - ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; - getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join5(getHomeDir(), ".aws", "config"); + getAwsRegionExtensionConfiguration = (runtimeConfig) => { + return { + setRegion(region) { + runtimeConfig.region = region; + }, + region() { + return runtimeConfig.region; + } + }; + }; + resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) => { + return { + region: awsRegionExtensionConfiguration.region() + }; + }; } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/getCredentialsFilepath.js -import { join as join6 } from "path"; -var ENV_CREDENTIALS_PATH, getCredentialsFilepath; -var init_getCredentialsFilepath = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/getCredentialsFilepath.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/client/index.js +var init_client4 = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/index.js"() { "use strict"; - init_getHomeDir(); - ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; - getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join6(getHomeDir(), ".aws", "credentials"); + init_emitWarningIfUnsupportedVersion(); + init_setCredentialFeature(); + init_setTokenFeature(); + init_hostHeaderMiddleware(); + init_loggerMiddleware(); + init_getRecursionDetectionPlugin(); + init_configurations2(); + init_user_agent_middleware(); + init_defaultUserAgent(); + init_nodeAppIdConfigOptions(); + init_aws(); + init_stsRegionDefaultResolver(); + init_extensions2(); } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/parseIni.js -var prefixKeyRegex, profileNameBlockList, parseIni; -var init_parseIni = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/parseIni.js"() { +// node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamConfiguration.js +function resolveEventStreamConfig(input) { + const eventSigner = input.signer; + const messageSigner = input.signer; + const newInput = Object.assign(input, { + eventSigner, + messageSigner + }); + const eventStreamPayloadHandler = newInput.eventStreamPayloadHandlerProvider(newInput); + return Object.assign(newInput, { + eventStreamPayloadHandler + }); +} +var init_eventStreamConfiguration = __esm({ + "node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamConfiguration.js"() { "use strict"; - init_dist_es(); - init_constants7(); - prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/; - profileNameBlockList = ["__proto__", "profile __proto__"]; - parseIni = (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 [, prefix2, , name] = matches; - if (Object.values(IniSectionType).includes(prefix2)) { - currentSection = [prefix2, 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; - }; } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/readFile.js -import { readFile as fsReadFile } from "fs/promises"; -var filePromises, fileIntercept, readFile2; -var init_readFile = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/readFile.js"() { +// node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHandlingMiddleware.js +var eventStreamHandlingMiddleware, eventStreamHandlingMiddlewareOptions; +var init_eventStreamHandlingMiddleware = __esm({ + "node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHandlingMiddleware.js"() { "use strict"; - filePromises = {}; - fileIntercept = {}; - readFile2 = (path10, options) => { - if (fileIntercept[path10] !== void 0) { - return fileIntercept[path10]; - } - if (!filePromises[path10] || options?.ignoreCache) { - filePromises[path10] = fsReadFile(path10, "utf8"); - } - return filePromises[path10]; + init_protocols(); + eventStreamHandlingMiddleware = (options) => (next, context5) => async (args) => { + const { request: request2 } = args; + if (!HttpRequest.isInstance(request2)) + return next(args); + return options.eventStreamPayloadHandler.handle(next, args, context5); + }; + eventStreamHandlingMiddlewareOptions = { + tags: ["EVENT_STREAM", "SIGNATURE", "HANDLE"], + name: "eventStreamHandlingMiddleware", + relation: "after", + toMiddleware: "awsAuthMiddleware", + override: true }; } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js -import { join as join7 } from "path"; -var swallowError, loadSharedConfigFiles; -var init_loadSharedConfigFiles = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js"() { +// node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHeaderMiddleware.js +var eventStreamHeaderMiddleware, eventStreamHeaderMiddlewareOptions; +var init_eventStreamHeaderMiddleware = __esm({ + "node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHeaderMiddleware.js"() { "use strict"; - init_getConfigData(); - init_getConfigFilepath(); - init_getCredentialsFilepath(); - init_getHomeDir(); - init_parseIni(); - init_readFile(); - init_constants7(); - swallowError = () => ({}); - loadSharedConfigFiles = async (init = {}) => { - const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init; - const homeDir = getHomeDir(); - const relativeHomeDirPrefix = "~/"; - let resolvedFilepath = filepath; - if (filepath.startsWith(relativeHomeDirPrefix)) { - resolvedFilepath = join7(homeDir, filepath.slice(2)); - } - let resolvedConfigFilepath = configFilepath; - if (configFilepath.startsWith(relativeHomeDirPrefix)) { - resolvedConfigFilepath = join7(homeDir, configFilepath.slice(2)); - } - const parsedFiles = await Promise.all([ - readFile2(resolvedConfigFilepath, { - ignoreCache: init.ignoreCache - }).then(parseIni).then(getConfigData).catch(swallowError), - readFile2(resolvedFilepath, { - ignoreCache: init.ignoreCache - }).then(parseIni).catch(swallowError) - ]); - return { - configFile: parsedFiles[0], - credentialsFile: parsedFiles[1] + init_protocols(); + eventStreamHeaderMiddleware = (next) => async (args) => { + const { request: request2 } = args; + if (!HttpRequest.isInstance(request2)) + return next(args); + request2.headers = { + ...request2.headers, + "content-type": "application/vnd.amazon.eventstream", + "x-amz-content-sha256": "STREAMING-AWS4-HMAC-SHA256-EVENTS" }; + return next({ + ...args, + request: request2 + }); + }; + eventStreamHeaderMiddlewareOptions = { + step: "build", + tags: ["EVENT_STREAM", "HEADER", "CONTENT_TYPE", "CONTENT_SHA256"], + name: "eventStreamHeaderMiddleware", + override: true }; } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/getSsoSessionData.js -var getSsoSessionData; -var init_getSsoSessionData = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/getSsoSessionData.js"() { +// node_modules/@aws-sdk/middleware-eventstream/dist-es/getEventStreamPlugin.js +var getEventStreamPlugin; +var init_getEventStreamPlugin = __esm({ + "node_modules/@aws-sdk/middleware-eventstream/dist-es/getEventStreamPlugin.js"() { + "use strict"; + init_eventStreamHandlingMiddleware(); + init_eventStreamHeaderMiddleware(); + getEventStreamPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(eventStreamHandlingMiddleware(options), eventStreamHandlingMiddlewareOptions); + clientStack.add(eventStreamHeaderMiddleware, eventStreamHeaderMiddlewareOptions); + } + }); + } +}); + +// node_modules/@aws-sdk/middleware-eventstream/dist-es/index.js +var init_dist_es6 = __esm({ + "node_modules/@aws-sdk/middleware-eventstream/dist-es/index.js"() { + "use strict"; + init_eventStreamConfiguration(); + init_eventStreamHandlingMiddleware(); + init_eventStreamHeaderMiddleware(); + init_getEventStreamPlugin(); + } +}); + +// node_modules/@aws-sdk/middleware-websocket/dist-es/utils.js +var isWebSocketRequest; +var init_utils2 = __esm({ + "node_modules/@aws-sdk/middleware-websocket/dist-es/utils.js"() { "use strict"; - init_dist_es(); - init_loadSharedConfigFiles(); - getSsoSessionData = (data) => Object.entries(data).filter(([key]) => key.startsWith(IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)).reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {}); + isWebSocketRequest = (request2) => request2.protocol === "ws:" || request2.protocol === "wss:"; } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/loadSsoSessionData.js -var swallowError2, loadSsoSessionData; -var init_loadSsoSessionData = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/loadSsoSessionData.js"() { +// node_modules/@aws-sdk/middleware-websocket/dist-es/WebSocketFetchHandler.js +var init_WebSocketFetchHandler = __esm({ + "node_modules/@aws-sdk/middleware-websocket/dist-es/WebSocketFetchHandler.js"() { "use strict"; - init_getConfigFilepath(); - init_getSsoSessionData(); - init_parseIni(); - init_readFile(); - swallowError2 = () => ({}); - loadSsoSessionData = async (init = {}) => readFile2(init.configFilepath ?? getConfigFilepath()).then(parseIni).then(getSsoSessionData).catch(swallowError2); } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/mergeConfigFiles.js -var mergeConfigFiles; -var init_mergeConfigFiles = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/mergeConfigFiles.js"() { +// node_modules/@aws-sdk/middleware-websocket/dist-es/middlewares/websocketEndpointMiddleware.js +var websocketEndpointMiddleware, websocketEndpointMiddlewareOptions; +var init_websocketEndpointMiddleware = __esm({ + "node_modules/@aws-sdk/middleware-websocket/dist-es/middlewares/websocketEndpointMiddleware.js"() { "use strict"; - mergeConfigFiles = (...files) => { - const merged = {}; - for (const file of files) { - for (const [key, values] of Object.entries(file)) { - if (merged[key] !== void 0) { - Object.assign(merged[key], values); - } else { - merged[key] = values; + init_protocols(); + websocketEndpointMiddleware = (config, options) => (next) => (args) => { + const { request: request2 } = args; + if (HttpRequest.isInstance(request2) && config.requestHandler.metadata?.handlerProtocol?.toLowerCase().includes("websocket")) { + request2.protocol = "wss:"; + request2.method = "GET"; + request2.path = `${request2.path}-websocket`; + const { headers } = request2; + delete headers["content-type"]; + delete headers["x-amz-content-sha256"]; + for (const name of Object.keys(headers)) { + if (name.indexOf(options.headerPrefix) === 0) { + const chunkedName = name.replace(options.headerPrefix, ""); + request2.query[chunkedName] = headers[name]; } } + if (headers["x-amz-user-agent"]) { + request2.query["user-agent"] = headers["x-amz-user-agent"]; + } + request2.headers = { host: headers.host ?? request2.hostname }; } - return merged; + return next(args); }; - } -}); - -// node_modules/@smithy/shared-ini-file-loader/dist-es/parseKnownFiles.js -var parseKnownFiles; -var init_parseKnownFiles = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/parseKnownFiles.js"() { - "use strict"; - init_loadSharedConfigFiles(); - init_mergeConfigFiles(); - parseKnownFiles = async (init) => { - const parsedFiles = await loadSharedConfigFiles(init); - return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile); + websocketEndpointMiddlewareOptions = { + name: "websocketEndpointMiddleware", + tags: ["WEBSOCKET", "EVENT_STREAM"], + relation: "after", + toMiddleware: "eventStreamHeaderMiddleware", + override: true }; } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/externalDataInterceptor.js -var externalDataInterceptor; -var init_externalDataInterceptor = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/externalDataInterceptor.js"() { +// node_modules/@aws-sdk/middleware-websocket/dist-es/middlewares/websocketInjectSessionIdMiddleware.js +var injectSessionIdMiddleware, injectSessionIdMiddlewareOptions; +var init_websocketInjectSessionIdMiddleware = __esm({ + "node_modules/@aws-sdk/middleware-websocket/dist-es/middlewares/websocketInjectSessionIdMiddleware.js"() { "use strict"; - init_getSSOTokenFromFile(); - init_readFile(); - externalDataInterceptor = { - getFileRecord() { - return fileIntercept; - }, - interceptFile(path10, contents) { - fileIntercept[path10] = Promise.resolve(contents); - }, - getTokenRecord() { - return tokenIntercept; - }, - interceptToken(id, contents) { - tokenIntercept[id] = contents; + injectSessionIdMiddleware = () => (next) => async (args) => { + const requestParams = { + ...args.input + }; + const response = await next(args); + const output = response.output; + if (requestParams.SessionId && output.SessionId == null) { + output.SessionId = requestParams.SessionId; } + return response; + }; + injectSessionIdMiddlewareOptions = { + step: "initialize", + name: "injectSessionIdMiddleware", + tags: ["WEBSOCKET", "EVENT_STREAM"], + override: true }; } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/types.js -var init_types6 = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/types.js"() { +// node_modules/@aws-sdk/middleware-websocket/dist-es/getWebSocketPlugin.js +var getWebSocketPlugin; +var init_getWebSocketPlugin = __esm({ + "node_modules/@aws-sdk/middleware-websocket/dist-es/getWebSocketPlugin.js"() { "use strict"; + init_websocketEndpointMiddleware(); + init_websocketInjectSessionIdMiddleware(); + getWebSocketPlugin = (config, options) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(websocketEndpointMiddleware(config, options), websocketEndpointMiddlewareOptions); + clientStack.add(injectSessionIdMiddleware(), injectSessionIdMiddlewareOptions); + } + }); } }); -// node_modules/@smithy/shared-ini-file-loader/dist-es/index.js -var init_dist_es43 = __esm({ - "node_modules/@smithy/shared-ini-file-loader/dist-es/index.js"() { +// node_modules/@aws-sdk/middleware-websocket/dist-es/WebsocketSignatureV4.js +var WebsocketSignatureV4; +var init_WebsocketSignatureV4 = __esm({ + "node_modules/@aws-sdk/middleware-websocket/dist-es/WebsocketSignatureV4.js"() { "use strict"; - init_getHomeDir(); - init_getProfileName(); - init_getSSOTokenFilepath(); - init_getSSOTokenFromFile(); - init_loadSharedConfigFiles(); - init_loadSsoSessionData(); - init_parseKnownFiles(); - init_externalDataInterceptor(); - init_types6(); - init_readFile(); + init_protocols(); + init_utils2(); + WebsocketSignatureV4 = class { + signer; + constructor(options) { + this.signer = options.signer; + } + presign(originalRequest, options = {}) { + return this.signer.presign(originalRequest, options); + } + async sign(toSign, options) { + if (HttpRequest.isInstance(toSign) && isWebSocketRequest(toSign)) { + const signedRequest = await this.signer.presign({ ...toSign, body: "" }, { + ...options, + expiresIn: 60, + unsignableHeaders: new Set(Object.keys(toSign.headers).filter((header) => header !== "host")) + }); + return { + ...signedRequest, + body: toSign.body + }; + } else { + return this.signer.sign(toSign, options); + } + } + signMessage(message, args) { + return this.signer.signMessage(message, args); + } + }; } }); -// node_modules/@smithy/node-config-provider/dist-es/fromSharedConfigFiles.js -var fromSharedConfigFiles; -var init_fromSharedConfigFiles = __esm({ - "node_modules/@smithy/node-config-provider/dist-es/fromSharedConfigFiles.js"() { +// node_modules/@aws-sdk/middleware-websocket/dist-es/resolveWebSocketConfig.js +var resolveWebSocketConfig, validateSigner; +var init_resolveWebSocketConfig = __esm({ + "node_modules/@aws-sdk/middleware-websocket/dist-es/resolveWebSocketConfig.js"() { "use strict"; - init_dist_es24(); - init_dist_es43(); - init_getSelectorName(); - fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => { - const profile = getProfileName(init); - const { configFile, credentialsFile } = await 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(); + init_WebsocketSignatureV4(); + resolveWebSocketConfig = (input) => { + const { signer } = input; + return Object.assign(input, { + signer: async (authScheme) => { + const signerObj = await signer(authScheme); + if (validateSigner(signerObj)) { + return new WebsocketSignatureV4({ signer: signerObj }); + } + throw new Error("Expected WebsocketSignatureV4 signer, please check the client constructor."); } - return configValue; - } catch (e6) { - throw new CredentialsProviderError(e6.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, { logger: init.logger }); - } + }); }; + validateSigner = (signer) => !!signer; } }); -// node_modules/@smithy/node-config-provider/dist-es/fromStatic.js -var isFunction, fromStatic2; -var init_fromStatic2 = __esm({ - "node_modules/@smithy/node-config-provider/dist-es/fromStatic.js"() { +// node_modules/@aws-sdk/middleware-websocket/dist-es/ws-eventstream/eventStreamPayloadHandlerProvider.js +var init_eventStreamPayloadHandlerProvider = __esm({ + "node_modules/@aws-sdk/middleware-websocket/dist-es/ws-eventstream/eventStreamPayloadHandlerProvider.js"() { "use strict"; - init_dist_es24(); - isFunction = (func) => typeof func === "function"; - fromStatic2 = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : fromStatic(defaultValue); } }); -// node_modules/@smithy/node-config-provider/dist-es/configLoader.js -var loadConfig; -var init_configLoader = __esm({ - "node_modules/@smithy/node-config-provider/dist-es/configLoader.js"() { +// node_modules/@aws-sdk/middleware-websocket/dist-es/index.js +var init_dist_es7 = __esm({ + "node_modules/@aws-sdk/middleware-websocket/dist-es/index.js"() { "use strict"; - init_dist_es24(); - init_fromEnv(); - init_fromSharedConfigFiles(); - init_fromStatic2(); - loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => { - const { signingName, logger: logger8 } = configuration; - const envOptions = { signingName, logger: logger8 }; - return memoize2(chain(fromEnv(environmentVariableSelector, envOptions), fromSharedConfigFiles(configFileSelector, configuration), fromStatic2(defaultValue))); - }; + init_WebSocketFetchHandler(); + init_getWebSocketPlugin(); + init_resolveWebSocketConfig(); + init_eventStreamPayloadHandlerProvider(); } }); -// node_modules/@smithy/node-config-provider/dist-es/index.js -var init_dist_es44 = __esm({ - "node_modules/@smithy/node-config-provider/dist-es/index.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js +var getDateHeader; +var init_getDateHeader = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js"() { "use strict"; - init_configLoader(); + init_protocols(); + getDateHeader = (response) => HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : void 0; } }); -// node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointUrlConfig.js -var ENV_ENDPOINT_URL, CONFIG_ENDPOINT_URL, getEndpointUrlConfig; -var init_getEndpointUrlConfig = __esm({ - "node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointUrlConfig.js"() { +// 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"() { "use strict"; - init_dist_es43(); - ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL"; - CONFIG_ENDPOINT_URL = "endpoint_url"; - getEndpointUrlConfig = (serviceId) => ({ - environmentVariableSelector: (env2) => { - const serviceSuffixParts = serviceId.split(" ").map((w5) => w5.toUpperCase()); - const serviceEndpointUrl = env2[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")]; - if (serviceEndpointUrl) - return serviceEndpointUrl; - const endpointUrl = env2[ENV_ENDPOINT_URL]; - if (endpointUrl) - return endpointUrl; - return void 0; - }, - configFileSelector: (profile, config) => { - if (config && profile.services) { - const servicesSection = config[["services", profile.services].join(CONFIG_PREFIX_SEPARATOR)]; - if (servicesSection) { - const servicePrefixParts = serviceId.split(" ").map((w5) => w5.toLowerCase()); - const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)]; - if (endpointUrl2) - return endpointUrl2; - } - } - const endpointUrl = profile[CONFIG_ENDPOINT_URL]; - if (endpointUrl) - return endpointUrl; - return void 0; - }, - default: void 0 - }); + getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset); } }); -// node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromConfig.js -var getEndpointFromConfig; -var init_getEndpointFromConfig = __esm({ - "node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromConfig.js"() { +// 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"() { "use strict"; - init_dist_es44(); - init_getEndpointUrlConfig(); - getEndpointFromConfig = async (serviceId) => loadConfig(getEndpointUrlConfig(serviceId ?? ""))(); + init_getSkewCorrectedDate(); + isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5; } }); -// node_modules/@smithy/middleware-endpoint/dist-es/adaptors/toEndpointV1.js -var toEndpointV12; -var init_toEndpointV12 = __esm({ - "node_modules/@smithy/middleware-endpoint/dist-es/adaptors/toEndpointV1.js"() { +// 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"() { "use strict"; - init_dist_es19(); - toEndpointV12 = (endpoint2) => { - if (typeof endpoint2 === "object") { - if ("url" in endpoint2) { - const v1Endpoint = parseUrl2(endpoint2.url); - if (endpoint2.headers) { - v1Endpoint.headers = {}; - for (const [name, values] of Object.entries(endpoint2.headers)) { - v1Endpoint.headers[name.toLowerCase()] = values.join(", "); - } - } - return v1Endpoint; - } - return endpoint2; + init_isClockSkewed(); + getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { + const clockTimeInMs = Date.parse(clockTime); + if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) { + return clockTimeInMs - Date.now(); } - return parseUrl2(endpoint2); + return currentSystemClockOffset; }; } }); -// node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js -var getEndpointFromInstructions, resolveParams; -var init_getEndpointFromInstructions = __esm({ - "node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js +var init_utils3 = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js"() { "use strict"; - init_service_customizations(); - init_createConfigValueProvider(); - init_getEndpointFromConfig(); - init_toEndpointV12(); - getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context5) => { - if (!clientConfig.isCustomEndpoint) { - let endpointFromConfig; - if (clientConfig.serviceConfiguredEndpoint) { - endpointFromConfig = await clientConfig.serviceConfiguredEndpoint(); - } else { - endpointFromConfig = await getEndpointFromConfig(clientConfig.serviceId); + init_getDateHeader(); + init_getSkewCorrectedDate(); + init_getUpdatedSystemClockOffset(); + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +var throwSigningPropertyError, validateSigningProperties, AwsSdkSigV4Signer; +var init_AwsSdkSigV4Signer = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js"() { + "use strict"; + init_protocols(); + init_utils3(); + throwSigningPropertyError = (name, property) => { + if (!property) { + throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`); + } + return property; + }; + validateSigningProperties = async (signingProperties) => { + const context5 = throwSigningPropertyError("context", signingProperties.context); + const config = throwSigningPropertyError("config", signingProperties.config); + const authScheme = context5.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(httpRequest2, identity, signingProperties) { + if (!HttpRequest.isInstance(httpRequest2)) { + throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); } - if (endpointFromConfig) { - clientConfig.endpoint = () => Promise.resolve(toEndpointV12(endpointFromConfig)); - clientConfig.isCustomEndpoint = true; + 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; + } } + signingProperties._preRequestSystemClockOffset = config.systemClockOffset; + const signedRequest = await signer.sign(httpRequest2, { + signingDate: getSkewCorrectedDate(config.systemClockOffset), + signingRegion, + signingService: signingName + }); + return signedRequest; } - const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig); - if (typeof clientConfig.endpointProvider !== "function") { - throw new Error("config.endpointProvider is not set."); - } - const endpoint2 = clientConfig.endpointProvider(endpointParams, context5); - if (clientConfig.isCustomEndpoint && clientConfig.endpoint) { - const customEndpoint = await clientConfig.endpoint(); - if (customEndpoint?.headers) { - endpoint2.headers ??= {}; - for (const [name, value] of Object.entries(customEndpoint.headers)) { - endpoint2.headers[name] = Array.isArray(value) ? value : [value]; + errorHandler(signingProperties) { + return (error2) => { + const errorException = error2; + const serverTime = errorException.ServerTime ?? getDateHeader(errorException.$response); + if (serverTime) { + const config = throwSigningPropertyError("config", signingProperties.config); + const preRequestOffset = signingProperties._preRequestSystemClockOffset; + const newOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset); + const isLocalCorrection = newOffset !== config.systemClockOffset; + const isConcurrentCorrection = preRequestOffset !== void 0 && preRequestOffset !== newOffset; + const clockSkewCorrected = isLocalCorrection || isConcurrentCorrection; + if (clockSkewCorrected && errorException.$metadata) { + config.systemClockOffset = newOffset; + errorException.$metadata.clockSkewCorrected = true; + } } - } + throw error2; + }; } - return endpoint2; - }; - resolveParams = 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)); + successHandler(httpResponse, signingProperties) { + const dateHeader = getDateHeader(httpResponse); + if (dateHeader) { + const config = throwSigningPropertyError("config", signingProperties.config); + config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset); } } - if (Object.keys(instructions).length === 0) { - Object.assign(endpointParams, clientConfig); - } - if (String(clientConfig.serviceId).toLowerCase() === "s3") { - await resolveParamsForS3(endpointParams); - } - return endpointParams; }; } }); -// node_modules/@smithy/middleware-endpoint/dist-es/adaptors/index.js -var init_adaptors = __esm({ - "node_modules/@smithy/middleware-endpoint/dist-es/adaptors/index.js"() { - "use strict"; - init_getEndpointFromInstructions(); - init_toEndpointV12(); - } -}); - -// node_modules/@smithy/middleware-endpoint/dist-es/endpointMiddleware.js -var endpointMiddleware; -var init_endpointMiddleware = __esm({ - "node_modules/@smithy/middleware-endpoint/dist-es/endpointMiddleware.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js +var AwsSdkSigV4ASigner; +var init_AwsSdkSigV4ASigner = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js"() { "use strict"; - init_dist_es21(); - init_dist_es7(); - init_getEndpointFromInstructions(); - endpointMiddleware = ({ config, instructions }) => { - return (next, context5) => async (args) => { - if (config.isCustomEndpoint) { - setFeature(context5, "ENDPOINT_OVERRIDE", "N"); - } - const endpoint2 = await getEndpointFromInstructions(args.input, { - getEndpointParameterInstructions() { - return instructions; - } - }, { ...config }, context5); - context5.endpointV2 = endpoint2; - context5.authSchemes = endpoint2.properties?.authSchemes; - const authScheme = context5.authSchemes?.[0]; - if (authScheme) { - context5["signing_region"] = authScheme.signingRegion; - context5["signing_service"] = authScheme.signingName; - const smithyContext = getSmithyContext(context5); - 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); - } + init_protocols(); + init_utils3(); + init_AwsSdkSigV4Signer(); + AwsSdkSigV4ASigner = class extends AwsSdkSigV4Signer { + async sign(httpRequest2, identity, signingProperties) { + if (!HttpRequest.isInstance(httpRequest2)) { + throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); } - return next({ - ...args + const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties); + const configResolvedSigningRegionSet = await config.sigv4aSigningRegionSet?.(); + const multiRegionOverride = (configResolvedSigningRegionSet ?? signingRegionSet ?? [signingRegion]).join(","); + signingProperties._preRequestSystemClockOffset = config.systemClockOffset; + const signedRequest = await signer.sign(httpRequest2, { + signingDate: getSkewCorrectedDate(config.systemClockOffset), + signingRegion: multiRegionOverride, + signingService: signingName }); - }; + return signedRequest; + } }; } }); -// node_modules/@smithy/middleware-serde/dist-es/deserializerMiddleware.js -var init_deserializerMiddleware = __esm({ - "node_modules/@smithy/middleware-serde/dist-es/deserializerMiddleware.js"() { +// 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"() { "use strict"; + getArrayForCommaSeparatedString = (str) => typeof str === "string" && str.length > 0 ? str.split(",").map((item) => item.trim()) : []; } }); -// node_modules/@smithy/middleware-serde/dist-es/serializerMiddleware.js -var init_serializerMiddleware = __esm({ - "node_modules/@smithy/middleware-serde/dist-es/serializerMiddleware.js"() { +// 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"() { "use strict"; + getBearerTokenEnvKey = (signingName) => `AWS_BEARER_TOKEN_${signingName.replace(/[\s-]/g, "_").toUpperCase()}`; } }); -// node_modules/@smithy/middleware-serde/dist-es/serdePlugin.js -var serializerMiddlewareOption2; -var init_serdePlugin = __esm({ - "node_modules/@smithy/middleware-serde/dist-es/serdePlugin.js"() { +// 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"() { "use strict"; - serializerMiddlewareOption2 = { - name: "serializerMiddleware", - step: "serialize", - tags: ["SERIALIZER"], - override: true + 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: (env3, options) => { + if (options?.signingName) { + const bearerTokenKey = getBearerTokenEnvKey(options.signingName); + if (bearerTokenKey in env3) + return ["httpBearerAuth"]; + } + if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env3)) + return void 0; + return getArrayForCommaSeparatedString(env3[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/@smithy/middleware-serde/dist-es/index.js -var init_dist_es45 = __esm({ - "node_modules/@smithy/middleware-serde/dist-es/index.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js +var resolveAwsSdkSigV4AConfig, NODE_SIGV4A_CONFIG_OPTIONS; +var init_resolveAwsSdkSigV4AConfig = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js"() { "use strict"; - init_deserializerMiddleware(); - init_serdePlugin(); - init_serializerMiddleware(); + init_dist_es5(); + init_config3(); + resolveAwsSdkSigV4AConfig = (config) => { + config.sigv4aSigningRegionSet = normalizeProvider2(config.sigv4aSigningRegionSet); + return config; + }; + NODE_SIGV4A_CONFIG_OPTIONS = { + environmentVariableSelector(env3) { + if (env3.AWS_SIGV4A_SIGNING_REGION_SET) { + return env3.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_3) => _3.trim()); + } + throw new ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", { + tryNextLink: true + }); + }, + configFileSelector(profile) { + if (profile.sigv4a_signing_region_set) { + return (profile.sigv4a_signing_region_set ?? "").split(",").map((_3) => _3.trim()); + } + throw new ProviderError("sigv4a_signing_region_set not set in profile.", { + tryNextLink: true + }); + }, + default: void 0 + }; } }); -// node_modules/@smithy/middleware-endpoint/dist-es/getEndpointPlugin.js -var endpointMiddlewareOptions, getEndpointPlugin; -var init_getEndpointPlugin = __esm({ - "node_modules/@smithy/middleware-endpoint/dist-es/getEndpointPlugin.js"() { +// node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +function negate2(bytes) { + for (let i6 = 0; i6 < 8; i6++) { + bytes[i6] ^= 255; + } + for (let i6 = 7; i6 > -1; i6--) { + bytes[i6]++; + if (bytes[i6] !== 0) + break; + } +} +var HeaderFormatter, HEADER_VALUE_TYPE2, UUID_PATTERN2, Int642; +var init_HeaderFormatter = __esm({ + "node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js"() { "use strict"; - init_dist_es45(); - init_endpointMiddleware(); - endpointMiddlewareOptions = { - step: "serialize", - tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], - name: "endpointV2Middleware", - override: true, - relation: "before", - toMiddleware: serializerMiddlewareOption2.name + init_serde2(); + HeaderFormatter = class { + format(headers) { + const chunks = []; + for (const headerName of Object.keys(headers)) { + const bytes = fromUtf8(headerName); + chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName])); + } + const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0)); + let position = 0; + for (const chunk of chunks) { + out.set(chunk, position); + position += chunk.byteLength; + } + return out; + } + formatHeaderValue(header) { + switch (header.type) { + case "boolean": + return Uint8Array.from([header.value ? 0 : 1]); + case "byte": + return Uint8Array.from([2, header.value]); + case "short": + const shortView = new DataView(new ArrayBuffer(3)); + shortView.setUint8(0, 3); + shortView.setInt16(1, header.value, false); + return new Uint8Array(shortView.buffer); + case "integer": + const intView = new DataView(new ArrayBuffer(5)); + intView.setUint8(0, 4); + intView.setInt32(1, header.value, false); + return new Uint8Array(intView.buffer); + case "long": + const longBytes = new Uint8Array(9); + longBytes[0] = 5; + longBytes.set(header.value.bytes, 1); + return longBytes; + case "binary": + const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength)); + binView.setUint8(0, 6); + binView.setUint16(1, header.value.byteLength, false); + const binBytes = new Uint8Array(binView.buffer); + binBytes.set(header.value, 3); + return binBytes; + case "string": + const utf8Bytes = fromUtf8(header.value); + const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength)); + strView.setUint8(0, 7); + strView.setUint16(1, utf8Bytes.byteLength, false); + const strBytes = new Uint8Array(strView.buffer); + strBytes.set(utf8Bytes, 3); + return strBytes; + case "timestamp": + const tsBytes = new Uint8Array(9); + tsBytes[0] = 8; + tsBytes.set(Int642.fromNumber(header.value.valueOf()).bytes, 1); + return tsBytes; + case "uuid": + if (!UUID_PATTERN2.test(header.value)) { + throw new Error(`Invalid UUID received: ${header.value}`); + } + const uuidBytes = new Uint8Array(17); + uuidBytes[0] = 9; + uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1); + return uuidBytes; + } + } }; - getEndpointPlugin = (config, instructions) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(endpointMiddleware({ - config, - instructions - }), endpointMiddlewareOptions); + (function(HEADER_VALUE_TYPE3) { + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolTrue"] = 0] = "boolTrue"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolFalse"] = 1] = "boolFalse"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byte"] = 2] = "byte"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["short"] = 3] = "short"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["integer"] = 4] = "integer"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["long"] = 5] = "long"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byteArray"] = 6] = "byteArray"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["string"] = 7] = "string"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["timestamp"] = 8] = "timestamp"; + HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["uuid"] = 9] = "uuid"; + })(HEADER_VALUE_TYPE2 || (HEADER_VALUE_TYPE2 = {})); + UUID_PATTERN2 = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; + Int642 = 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 i6 = 7, remaining = Math.abs(Math.round(number)); i6 > -1 && remaining > 0; i6--, remaining /= 256) { + bytes[i6] = remaining; + } + if (number < 0) { + negate2(bytes); + } + return new _Int64(bytes); + } + valueOf() { + const bytes = this.bytes.slice(0); + const negative = bytes[0] & 128; + if (negative) { + negate2(bytes); + } + return parseInt(toHex(bytes), 16) * (negative ? -1 : 1); + } + toString() { + return String(this.valueOf()); + } + }; } }); -// node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointConfig.js -var resolveEndpointConfig; -var init_resolveEndpointConfig = __esm({ - "node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointConfig.js"() { +// node_modules/@smithy/signature-v4/dist-es/constants.js +var ALGORITHM_QUERY_PARAM, CREDENTIAL_QUERY_PARAM, AMZ_DATE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, EXPIRES_QUERY_PARAM, SIGNATURE_QUERY_PARAM, TOKEN_QUERY_PARAM, AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER, GENERATED_HEADERS, SIGNATURE_HEADER, SHA256_HEADER, TOKEN_HEADER, ALWAYS_UNSIGNABLE_HEADERS, PROXY_HEADER_PATTERN, SEC_HEADER_PATTERN, ALGORITHM_IDENTIFIER, EVENT_ALGORITHM_IDENTIFIER, UNSIGNED_PAYLOAD, MAX_CACHE_SIZE, KEY_TYPE_IDENTIFIER, MAX_PRESIGNED_TTL; +var init_constants6 = __esm({ + "node_modules/@smithy/signature-v4/dist-es/constants.js"() { "use strict"; - init_dist_es7(); - init_getEndpointFromConfig(); - init_toEndpointV12(); - resolveEndpointConfig = (input) => { - const tls = input.tls ?? true; - const { endpoint: endpoint2, useDualstackEndpoint, useFipsEndpoint } = input; - const customEndpointProvider = endpoint2 != null ? async () => toEndpointV12(await normalizeProvider(endpoint2)()) : void 0; - const isCustomEndpoint = !!endpoint2; - const resolvedConfig = Object.assign(input, { - endpoint: customEndpointProvider, - tls, - isCustomEndpoint, - useDualstackEndpoint: normalizeProvider(useDualstackEndpoint ?? false), - useFipsEndpoint: normalizeProvider(useFipsEndpoint ?? false) - }); - let configuredEndpointPromise = void 0; - resolvedConfig.serviceConfiguredEndpoint = async () => { - if (input.serviceId && !configuredEndpointPromise) { - configuredEndpointPromise = getEndpointFromConfig(input.serviceId); + ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; + CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; + AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; + SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; + EXPIRES_QUERY_PARAM = "X-Amz-Expires"; + SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; + TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; + AUTH_HEADER = "authorization"; + AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase(); + DATE_HEADER = "date"; + GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER]; + SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase(); + SHA256_HEADER = "x-amz-content-sha256"; + TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase(); + ALWAYS_UNSIGNABLE_HEADERS = { + authorization: true, + "cache-control": true, + connection: true, + expect: true, + from: true, + "keep-alive": true, + "max-forwards": true, + pragma: true, + referer: true, + te: true, + trailer: true, + "transfer-encoding": true, + upgrade: true, + "user-agent": true, + "x-amzn-trace-id": true + }; + PROXY_HEADER_PATTERN = /^proxy-/; + SEC_HEADER_PATTERN = /^sec-/; + ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; + EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; + UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; + MAX_CACHE_SIZE = 50; + KEY_TYPE_IDENTIFIER = "aws4_request"; + MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; + } +}); + +// node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js +var getCanonicalQuery; +var init_getCanonicalQuery = __esm({ + "node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js"() { + "use strict"; + init_protocols(); + init_constants6(); + getCanonicalQuery = ({ query = {} }) => { + const keys = []; + const serialized = {}; + for (const key of Object.keys(query)) { + if (key.toLowerCase() === SIGNATURE_HEADER) { + continue; } - return configuredEndpointPromise; - }; - return resolvedConfig; + const encodedKey = escapeUri(key); + keys.push(encodedKey); + const value = query[key]; + if (typeof value === "string") { + serialized[encodedKey] = `${encodedKey}=${escapeUri(value)}`; + } else if (Array.isArray(value)) { + serialized[encodedKey] = value.slice(0).reduce((encoded, value2) => encoded.concat([`${encodedKey}=${escapeUri(value2)}`]), []).sort().join("&"); + } + } + return keys.sort().map((key) => serialized[key]).filter((serialized2) => serialized2).join("&"); }; } }); -// node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointRequiredConfig.js -var init_resolveEndpointRequiredConfig = __esm({ - "node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointRequiredConfig.js"() { +// node_modules/@smithy/signature-v4/dist-es/utilDate.js +var iso8601, toDate; +var init_utilDate = __esm({ + "node_modules/@smithy/signature-v4/dist-es/utilDate.js"() { "use strict"; + iso8601 = (time2) => toDate(time2).toISOString().replace(/\.\d{3}Z$/, "Z"); + 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; + }; } }); -// node_modules/@smithy/middleware-endpoint/dist-es/types.js -var init_types7 = __esm({ - "node_modules/@smithy/middleware-endpoint/dist-es/types.js"() { +// node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js +var SignatureV4Base; +var init_SignatureV4Base = __esm({ + "node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js"() { "use strict"; + init_client3(); + init_protocols(); + init_serde2(); + init_getCanonicalQuery(); + init_utilDate(); + 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 = normalizeProvider(region); + this.credentialProvider = normalizeProvider(credentials); + } + createCanonicalRequest(request2, canonicalHeaders, payloadHash) { + const sortedHeaders = Object.keys(canonicalHeaders).sort(); + return `${request2.method} +${this.getCanonicalPath(request2)} +${getCanonicalQuery(request2)} +${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} + +${sortedHeaders.join(";")} +${payloadHash}`; + } + async createStringToSign(longDate, credentialScope, canonicalRequest, algorithmIdentifier) { + const hash = new this.sha256(); + hash.update(toUint8Array(canonicalRequest)); + const hashedRequest = await hash.digest(); + return `${algorithmIdentifier} +${longDate} +${credentialScope} +${toHex(hashedRequest)}`; + } + getCanonicalPath({ path: path10 }) { + if (this.uriEscapePath) { + const normalizedPathSegments = []; + for (const pathSegment of path10.split("/")) { + if (pathSegment?.length === 0) + continue; + if (pathSegment === ".") + continue; + if (pathSegment === "..") { + normalizedPathSegments.pop(); + } else { + normalizedPathSegments.push(pathSegment); + } + } + const normalizedPath = `${path10?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path10?.endsWith("/") ? "/" : ""}`; + const doubleEncoded = escapeUri(normalizedPath); + return doubleEncoded.replace(/%2F/g, "/"); + } + return path10; + } + 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(";"); + } + }; } }); -// node_modules/@smithy/middleware-endpoint/dist-es/index.js -var init_dist_es46 = __esm({ - "node_modules/@smithy/middleware-endpoint/dist-es/index.js"() { +// node_modules/@smithy/signature-v4/dist-es/credentialDerivation.js +var signingKeyCache, cacheQueue, createScope, getSigningKey, hmac; +var init_credentialDerivation = __esm({ + "node_modules/@smithy/signature-v4/dist-es/credentialDerivation.js"() { "use strict"; - init_adaptors(); - init_endpointMiddleware(); - init_getEndpointPlugin(); - init_resolveEndpointConfig(); - init_resolveEndpointRequiredConfig(); - init_types7(); + init_serde2(); + init_constants6(); + signingKeyCache = {}; + cacheQueue = []; + createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`; + getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => { + const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); + const cacheKey = `${shortDate}:${region}:${service}:${toHex(credsHash)}:${credentials.sessionToken}`; + if (cacheKey in signingKeyCache) { + return signingKeyCache[cacheKey]; + } + cacheQueue.push(cacheKey); + while (cacheQueue.length > MAX_CACHE_SIZE) { + delete signingKeyCache[cacheQueue.shift()]; + } + let key = `AWS4${credentials.secretAccessKey}`; + for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) { + key = await hmac(sha256Constructor, key, signable); + } + return signingKeyCache[cacheKey] = key; + }; + hmac = (ctor, secret, data) => { + const hash = new ctor(secret); + hash.update(toUint8Array(data)); + return hash.digest(); + }; } }); -// node_modules/@smithy/middleware-retry/dist-es/delayDecider.js -var init_delayDecider = __esm({ - "node_modules/@smithy/middleware-retry/dist-es/delayDecider.js"() { +// node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js +var getCanonicalHeaders; +var init_getCanonicalHeaders = __esm({ + "node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js"() { "use strict"; + init_constants6(); + 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; + }; } }); -// node_modules/@smithy/middleware-retry/dist-es/retryDecider.js -var init_retryDecider = __esm({ - "node_modules/@smithy/middleware-retry/dist-es/retryDecider.js"() { +// node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js +var getPayloadHash; +var init_getPayloadHash = __esm({ + "node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js"() { "use strict"; + init_serde2(); + init_constants6(); + getPayloadHash = async ({ headers, body: body2 }, hashConstructor) => { + for (const headerName of Object.keys(headers)) { + if (headerName.toLowerCase() === SHA256_HEADER) { + return headers[headerName]; + } + } + if (body2 == void 0) { + return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; + } else if (typeof body2 === "string" || ArrayBuffer.isView(body2) || isArrayBuffer2(body2)) { + const hashCtor = new hashConstructor(); + hashCtor.update(toUint8Array(body2)); + return toHex(await hashCtor.digest()); + } + return UNSIGNED_PAYLOAD; + }; } }); -// node_modules/@smithy/middleware-retry/dist-es/util.js -var asSdkError; -var init_util3 = __esm({ - "node_modules/@smithy/middleware-retry/dist-es/util.js"() { +// node_modules/@smithy/signature-v4/dist-es/headerUtil.js +var hasHeader; +var init_headerUtil = __esm({ + "node_modules/@smithy/signature-v4/dist-es/headerUtil.js"() { "use strict"; - asSdkError = (error2) => { - if (error2 instanceof Error) - return error2; - if (error2 instanceof Object) - return Object.assign(new Error(), error2); - if (typeof error2 === "string") - return new Error(error2); - return new Error(`AWS SDK error wrapper for ${error2}`); + hasHeader = (soughtHeader, headers) => { + soughtHeader = soughtHeader.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (soughtHeader === headerName.toLowerCase()) { + return true; + } + } + return false; }; } }); -// node_modules/@smithy/middleware-retry/dist-es/StandardRetryStrategy.js -var init_StandardRetryStrategy2 = __esm({ - "node_modules/@smithy/middleware-retry/dist-es/StandardRetryStrategy.js"() { +// node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js +var moveHeadersToQuery; +var init_moveHeadersToQuery = __esm({ + "node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js"() { "use strict"; + init_protocols(); + moveHeadersToQuery = (request2, options = {}) => { + const { headers, query = {} } = HttpRequest.clone(request2); + 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 { + ...request2, + headers, + query + }; + }; } }); -// node_modules/@smithy/middleware-retry/dist-es/AdaptiveRetryStrategy.js -var init_AdaptiveRetryStrategy2 = __esm({ - "node_modules/@smithy/middleware-retry/dist-es/AdaptiveRetryStrategy.js"() { +// node_modules/@smithy/signature-v4/dist-es/prepareRequest.js +var prepareRequest; +var init_prepareRequest = __esm({ + "node_modules/@smithy/signature-v4/dist-es/prepareRequest.js"() { "use strict"; + init_protocols(); + init_constants6(); + prepareRequest = (request2) => { + request2 = HttpRequest.clone(request2); + for (const headerName of Object.keys(request2.headers)) { + if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { + delete request2.headers[headerName]; + } + } + return request2; + }; } }); -// node_modules/@smithy/middleware-retry/dist-es/configurations.js -var ENV_MAX_ATTEMPTS, CONFIG_MAX_ATTEMPTS, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, resolveRetryConfig, ENV_RETRY_MODE, CONFIG_RETRY_MODE, NODE_RETRY_MODE_CONFIG_OPTIONS; -var init_configurations2 = __esm({ - "node_modules/@smithy/middleware-retry/dist-es/configurations.js"() { +// node_modules/@smithy/signature-v4/dist-es/SignatureV4.js +var SignatureV4; +var init_SignatureV4 = __esm({ + "node_modules/@smithy/signature-v4/dist-es/SignatureV4.js"() { "use strict"; - init_dist_es7(); - init_dist_es31(); - ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; - CONFIG_MAX_ATTEMPTS = "max_attempts"; - NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { - environmentVariableSelector: (env2) => { - const value = env2[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}"`); + init_serde2(); + init_HeaderFormatter(); + init_SignatureV4Base(); + init_constants6(); + init_credentialDerivation(); + init_getCanonicalHeaders(); + init_getPayloadHash(); + init_headerUtil(); + init_moveHeadersToQuery(); + init_prepareRequest(); + SignatureV4 = 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"); } - 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}"`); + const scope = createScope(shortDate, region, signingService ?? this.service); + const request2 = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders, hoistableHeaders }); + if (credentials.sessionToken) { + request2.query[TOKEN_QUERY_PARAM] = credentials.sessionToken; } - return maxAttempt; - }, - default: DEFAULT_MAX_ATTEMPTS - }; - resolveRetryConfig = (input) => { - const { retryStrategy, retryMode } = input; - const maxAttempts = normalizeProvider(input.maxAttempts ?? DEFAULT_MAX_ATTEMPTS); - let controller = retryStrategy ? Promise.resolve(retryStrategy) : void 0; - const getDefault = async () => await normalizeProvider(retryMode)() === RETRY_MODES.ADAPTIVE ? new AdaptiveRetryStrategy(maxAttempts) : new StandardRetryStrategy(maxAttempts); - return Object.assign(input, { - maxAttempts, - retryStrategy: () => controller ??= getDefault() - }); - }; - ENV_RETRY_MODE = "AWS_RETRY_MODE"; - CONFIG_RETRY_MODE = "retry_mode"; - NODE_RETRY_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env2) => env2[ENV_RETRY_MODE], - configFileSelector: (profile) => profile[CONFIG_RETRY_MODE], - default: DEFAULT_RETRY_MODE + request2.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER; + request2.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; + request2.query[AMZ_DATE_QUERY_PARAM] = longDate; + request2.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10); + const canonicalHeaders = getCanonicalHeaders(request2, unsignableHeaders, signableHeaders); + request2.query[SIGNED_HEADERS_QUERY_PARAM] = this.getCanonicalHeaderList(canonicalHeaders); + request2.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request2, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256))); + return request2; + } + 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 }, { 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: payload }, this.sha256); + const hash = new this.sha256(); + hash.update(headers); + const hashedHeaders = toHex(await hash.digest()); + const stringToSign = [ + EVENT_ALGORITHM_IDENTIFIER, + longDate, + scope, + priorSignature, + hashedHeaders, + hashedPayload + ].join("\n"); + return this.signString(stringToSign, { + signingDate, + signingRegion: region, + signingService, + 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(toUint8Array(stringToSign)); + return toHex(await hash.digest()); + } + async signRequest(requestToSign, { signingDate = /* @__PURE__ */ new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService } = {}) { + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion ?? await this.regionProvider(); + const request2 = prepareRequest(requestToSign); + const { longDate, shortDate } = this.formatDate(signingDate); + const scope = createScope(shortDate, region, signingService ?? this.service); + request2.headers[AMZ_DATE_HEADER] = longDate; + if (credentials.sessionToken) { + request2.headers[TOKEN_HEADER] = credentials.sessionToken; + } + const payloadHash = await getPayloadHash(request2, this.sha256); + if (!hasHeader(SHA256_HEADER, request2.headers) && this.applyChecksum) { + request2.headers[SHA256_HEADER] = payloadHash; + } + const canonicalHeaders = getCanonicalHeaders(request2, unsignableHeaders, signableHeaders); + const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request2, canonicalHeaders, payloadHash)); + request2.headers[AUTH_HEADER] = `${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${this.getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`; + return request2; + } + 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(toUint8Array(stringToSign)); + return toHex(await hash.digest()); + } + getSigningKey(credentials, region, shortDate, service) { + return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service); + } }; } }); -// node_modules/@smithy/middleware-retry/dist-es/omitRetryHeadersMiddleware.js -var init_omitRetryHeadersMiddleware = __esm({ - "node_modules/@smithy/middleware-retry/dist-es/omitRetryHeadersMiddleware.js"() { +// node_modules/@smithy/signature-v4/dist-es/signature-v4a-container.js +var signatureV4aContainer; +var init_signature_v4a_container = __esm({ + "node_modules/@smithy/signature-v4/dist-es/signature-v4a-container.js"() { "use strict"; + signatureV4aContainer = { + SignatureV4a: null + }; } }); -// node_modules/@smithy/middleware-retry/dist-es/isStreamingPayload/isStreamingPayload.js -import { Readable as Readable10 } from "stream"; -var isStreamingPayload; -var init_isStreamingPayload = __esm({ - "node_modules/@smithy/middleware-retry/dist-es/isStreamingPayload/isStreamingPayload.js"() { +// node_modules/@smithy/signature-v4/dist-es/index.js +var init_dist_es8 = __esm({ + "node_modules/@smithy/signature-v4/dist-es/index.js"() { "use strict"; - isStreamingPayload = (request3) => request3?.body instanceof Readable10 || typeof ReadableStream !== "undefined" && request3?.body instanceof ReadableStream; + init_SignatureV4(); + init_constants6(); + init_credentialDerivation(); + init_signature_v4a_container(); } }); -// node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js -var retryMiddleware, isRetryStrategyV2, getRetryErrorInfo, getRetryErrorType, retryMiddlewareOptions, getRetryPlugin, getRetryAfterHint; -var init_retryMiddleware = __esm({ - "node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js"() { +// 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 = normalizeProvider2(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 resolveAwsSdkSigV4Config; +var init_resolveAwsSdkSigV4Config = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js"() { "use strict"; - init_dist_es2(); - init_dist_es30(); - init_dist_es27(); - init_dist_es31(); - init_dist_es20(); - init_isStreamingPayload(); - init_util3(); - retryMiddleware = (options) => (next, context5) => async (args) => { - let retryStrategy = await options.retryStrategy(); - const maxAttempts = await options.maxAttempts(); - if (isRetryStrategyV2(retryStrategy)) { - retryStrategy = retryStrategy; - let retryToken = await retryStrategy.acquireInitialRetryToken(context5["partition_id"]); - let lastError = new Error(); - let attempts = 0; - let totalRetryDelay = 0; - const { request: request3 } = args; - const isRequest2 = HttpRequest.isInstance(request3); - if (isRequest2) { - request3.headers[INVOCATION_ID_HEADER] = v4(); - } - while (true) { - try { - if (isRequest2) { - request3.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; - } - const { response, output } = await next(args); - retryStrategy.recordSuccess(retryToken); - output.$metadata.attempts = attempts + 1; - output.$metadata.totalRetryDelay = totalRetryDelay; - return { response, output }; - } catch (e6) { - const retryErrorInfo = getRetryErrorInfo(e6); - lastError = asSdkError(e6); - if (isRequest2 && isStreamingPayload(request3)) { - (context5.logger instanceof NoOpLogger ? console : context5.logger)?.warn("An error was encountered in a non-retryable streaming request."); - throw lastError; - } - try { - retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo); - } catch (refreshError) { - if (!lastError.$metadata) { - lastError.$metadata = {}; + init_client4(); + init_dist_es5(); + init_dist_es8(); + 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"); } - lastError.$metadata.attempts = attempts + 1; - lastError.$metadata.totalRetryDelay = totalRetryDelay; - throw lastError; - } - attempts = retryToken.getRetryCount(); - const delay4 = retryToken.getRetryDelay(); - totalRetryDelay += delay4; - await new Promise((resolve4) => setTimeout(resolve4, delay4)); + 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 = normalizeProvider2(config.signer); + } else if (config.regionInfoProvider) { + signer = () => normalizeProvider2(config.region)().then(async (region) => [ + await config.regionInfoProvider(region, { + useFipsEndpoint: await config.useFipsEndpoint(), + useDualstackEndpoint: await config.useDualstackEndpoint() + }) || {}, + region + ]).then(([regionInfo, region]) => { + const { signingRegion, signingService } = regionInfo; + config.signingRegion = config.signingRegion || signingRegion || region; + config.signingName = config.signingName || signingService || config.serviceId; + const params = { + ...config, + credentials: config.credentials, + region: config.signingRegion, + service: config.signingName, + sha256, + uriEscapePath: signingEscapePath + }; + const SignerCtor = config.signerConstructor || SignatureV4; + return new SignerCtor(params); + }); } else { - retryStrategy = retryStrategy; - if (retryStrategy?.mode) - context5.userAgent = [...context5.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]]; - return retryStrategy.retry(next, args); - } - }; - isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined"; - getRetryErrorInfo = (error2) => { - const errorInfo = { - error: error2, - errorType: getRetryErrorType(error2) - }; - const retryAfterHint = getRetryAfterHint(error2.$response); - if (retryAfterHint) { - errorInfo.retryAfterHint = retryAfterHint; - } - return errorInfo; - }; - getRetryErrorType = (error2) => { - if (isThrottlingError(error2)) - return "THROTTLING"; - if (isTransientError(error2)) - return "TRANSIENT"; - if (isServerError(error2)) - return "SERVER_ERROR"; - return "CLIENT_ERROR"; - }; - retryMiddlewareOptions = { - name: "retryMiddleware", - tags: ["RETRY"], - step: "finalizeRequest", - priority: "high", - override: true - }; - getRetryPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add(retryMiddleware(options), retryMiddlewareOptions); + signer = async (authScheme) => { + authScheme = Object.assign({}, { + name: "sigv4", + signingName: config.signingName || config.defaultSigningName, + signingRegion: await normalizeProvider2(config.region)(), + properties: {} + }, authScheme); + const signingRegion = authScheme.signingRegion; + const signingService = authScheme.signingName; + config.signingRegion = config.signingRegion || signingRegion; + config.signingName = config.signingName || signingService || config.serviceId; + const params = { + ...config, + credentials: config.credentials, + region: config.signingRegion, + service: config.signingName, + sha256, + uriEscapePath: signingEscapePath + }; + const SignerCtor = config.signerConstructor || SignatureV4; + return new SignerCtor(params); + }; } - }); - getRetryAfterHint = (response) => { - if (!HttpResponse.isInstance(response)) - return; - const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); - if (!retryAfterHeaderName) - return; - const retryAfter = response.headers[retryAfterHeaderName]; - const retryAfterSeconds = Number(retryAfter); - if (!Number.isNaN(retryAfterSeconds)) - return new Date(retryAfterSeconds * 1e3); - const retryAfterDate = new Date(retryAfter); - return retryAfterDate; + const resolvedConfig = Object.assign(config, { + systemClockOffset, + signingEscapePath, + signer + }); + return resolvedConfig; }; } }); -// node_modules/@smithy/middleware-retry/dist-es/index.js -var init_dist_es47 = __esm({ - "node_modules/@smithy/middleware-retry/dist-es/index.js"() { +// 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"() { + "use strict"; + 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 init_httpAuthSchemes2 = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js"() { "use strict"; - init_AdaptiveRetryStrategy2(); - init_StandardRetryStrategy2(); - init_configurations2(); - init_delayDecider(); - init_omitRetryHeadersMiddleware(); - init_retryDecider(); - init_retryMiddleware(); + init_aws_sdk(); + init_getBearerTokenEnvKey(); } }); @@ -132426,9 +134631,9 @@ var defaultBedrockRuntimeHttpAuthSchemeParametersProvider, defaultBedrockRuntime var init_httpAuthSchemeProvider = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/auth/httpAuthSchemeProvider.js"() { "use strict"; - init_dist_es29(); - init_dist_es21(); - init_dist_es7(); + init_httpAuthSchemes2(); + init_dist_es5(); + init_client3(); defaultBedrockRuntimeHttpAuthSchemeParametersProvider = async (config, context5, input) => { return { operation: getSmithyContext(context5).operation, @@ -132486,7 +134691,7 @@ var init_package = __esm({ package_default = { name: "@aws-sdk/client-bedrock-runtime", description: "AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native", - version: "3.1014.0", + version: "3.1063.0", scripts: { build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs", "build:cjs": "node ../../scripts/compilation/inline client-bedrock-runtime", @@ -132514,54 +134719,21 @@ var init_package = __esm({ dependencies: { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "^3.973.23", - "@aws-sdk/credential-provider-node": "^3.972.24", - "@aws-sdk/eventstream-handler-node": "^3.972.11", - "@aws-sdk/middleware-eventstream": "^3.972.8", - "@aws-sdk/middleware-host-header": "^3.972.8", - "@aws-sdk/middleware-logger": "^3.972.8", - "@aws-sdk/middleware-recursion-detection": "^3.972.8", - "@aws-sdk/middleware-user-agent": "^3.972.24", - "@aws-sdk/middleware-websocket": "^3.972.13", - "@aws-sdk/region-config-resolver": "^3.972.9", - "@aws-sdk/token-providers": "3.1014.0", - "@aws-sdk/types": "^3.973.6", - "@aws-sdk/util-endpoints": "^3.996.5", - "@aws-sdk/util-user-agent-browser": "^3.972.8", - "@aws-sdk/util-user-agent-node": "^3.973.10", - "@smithy/config-resolver": "^4.4.13", - "@smithy/core": "^3.23.12", - "@smithy/eventstream-serde-browser": "^4.2.12", - "@smithy/eventstream-serde-config-resolver": "^4.3.12", - "@smithy/eventstream-serde-node": "^4.2.12", - "@smithy/fetch-http-handler": "^5.3.15", - "@smithy/hash-node": "^4.2.12", - "@smithy/invalid-dependency": "^4.2.12", - "@smithy/middleware-content-length": "^4.2.12", - "@smithy/middleware-endpoint": "^4.4.27", - "@smithy/middleware-retry": "^4.4.44", - "@smithy/middleware-serde": "^4.2.15", - "@smithy/middleware-stack": "^4.2.12", - "@smithy/node-config-provider": "^4.3.12", - "@smithy/node-http-handler": "^4.5.0", - "@smithy/protocol-http": "^5.3.12", - "@smithy/smithy-client": "^4.12.7", - "@smithy/types": "^4.13.1", - "@smithy/url-parser": "^4.2.12", - "@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.43", - "@smithy/util-defaults-mode-node": "^4.2.47", - "@smithy/util-endpoints": "^3.3.3", - "@smithy/util-middleware": "^4.2.12", - "@smithy/util-retry": "^4.2.12", - "@smithy/util-stream": "^4.5.20", - "@smithy/util-utf8": "^4.2.2", + "@aws-sdk/core": "^3.974.18", + "@aws-sdk/credential-provider-node": "^3.972.52", + "@aws-sdk/eventstream-handler-node": "^3.972.20", + "@aws-sdk/middleware-eventstream": "^3.972.16", + "@aws-sdk/middleware-websocket": "^3.972.26", + "@aws-sdk/token-providers": "3.1063.0", + "@aws-sdk/types": "^3.973.11", + "@smithy/core": "^3.24.6", + "@smithy/fetch-http-handler": "^5.4.6", + "@smithy/node-http-handler": "^4.7.6", + "@smithy/types": "^4.14.3", tslib: "^2.6.2" }, devDependencies: { - "@smithy/snapshot-testing": "^2.0.3", + "@smithy/snapshot-testing": "^2.1.7", "@tsconfig/node20": "20.1.8", "@types/node": "^20.14.8", concurrently: "7.0.0", @@ -132585,7 +134757,7 @@ var init_package = __esm({ ], author: { name: "AWS SDK for JavaScript Team", - url: "https://aws.amazon.com/javascript/" + url: "https://aws.amazon.com/sdk-for-javascript/" }, license: "Apache-2.0", browser: { @@ -132609,8 +134781,8 @@ var ENV_KEY, ENV_SECRET, ENV_SESSION, ENV_EXPIRATION, ENV_CREDENTIAL_SCOPE, ENV_ var init_fromEnv2 = __esm({ "node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js"() { "use strict"; - init_client2(); - init_dist_es24(); + init_client4(); + init_config3(); ENV_KEY = "AWS_ACCESS_KEY_ID"; ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; ENV_SESSION = "AWS_SESSION_TOKEN"; @@ -132653,19 +134825,52 @@ __export(dist_es_exports, { ENV_SESSION: () => ENV_SESSION, fromEnv: () => fromEnv2 }); -var init_dist_es48 = __esm({ +var init_dist_es9 = __esm({ "node_modules/@aws-sdk/credential-provider-env/dist-es/index.js"() { "use strict"; init_fromEnv2(); } }); +// node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js +var isImdsCredentials, fromImdsCredentials; +var init_ImdsCredentials = __esm({ + "node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js"() { + "use strict"; + isImdsCredentials = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string"; + fromImdsCredentials = (creds) => ({ + accessKeyId: creds.AccessKeyId, + secretAccessKey: creds.SecretAccessKey, + sessionToken: creds.Token, + expiration: new Date(creds.Expiration), + ...creds.AccountId && { accountId: creds.AccountId } + }); + } +}); + +// node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js +var DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, providerConfigFromInit; +var init_RemoteProviderInit = __esm({ + "node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js"() { + "use strict"; + DEFAULT_TIMEOUT = 1e3; + DEFAULT_MAX_RETRIES = 0; + providerConfigFromInit = ({ maxRetries = DEFAULT_MAX_RETRIES, timeout: timeout2 = DEFAULT_TIMEOUT }) => ({ maxRetries, timeout: timeout2 }); + } +}); + +// node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/node-http.js +import node_http from "http"; +var init_node_http = __esm({ + "node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/node-http.js"() { + "use strict"; + } +}); + // node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js -import { Buffer as Buffer5 } from "buffer"; -import { request as request2 } from "http"; function httpRequest(options) { - return new Promise((resolve4, reject2) => { - const req = request2({ + return new Promise((resolve8, reject2) => { + const req = node_http.request({ method: "GET", ...options, hostname: options.hostname?.replace(/^\[(.+)\]$/, "$1") @@ -132689,7 +134894,7 @@ function httpRequest(options) { chunks.push(chunk); }); res.on("end", () => { - resolve4(Buffer5.concat(chunks)); + resolve8(Buffer.concat(chunks)); req.destroy(); }); }); @@ -132699,40 +134904,14 @@ function httpRequest(options) { var init_httpRequest2 = __esm({ "node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js"() { "use strict"; - init_dist_es24(); - } -}); - -// node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js -var isImdsCredentials, fromImdsCredentials; -var init_ImdsCredentials = __esm({ - "node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js"() { - "use strict"; - isImdsCredentials = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string"; - fromImdsCredentials = (creds) => ({ - accessKeyId: creds.AccessKeyId, - secretAccessKey: creds.SecretAccessKey, - sessionToken: creds.Token, - expiration: new Date(creds.Expiration), - ...creds.AccountId && { accountId: creds.AccountId } - }); - } -}); - -// node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js -var DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, providerConfigFromInit; -var init_RemoteProviderInit = __esm({ - "node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js"() { - "use strict"; - DEFAULT_TIMEOUT = 1e3; - DEFAULT_MAX_RETRIES = 0; - providerConfigFromInit = ({ maxRetries = DEFAULT_MAX_RETRIES, timeout: timeout2 = DEFAULT_TIMEOUT }) => ({ maxRetries, timeout: timeout2 }); + init_config3(); + init_node_http(); } }); // node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/retry.js var retry3; -var init_retry3 = __esm({ +var init_retry4 = __esm({ "node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/retry.js"() { "use strict"; retry3 = (toRetry, maxRetries) => { @@ -132746,16 +134925,15 @@ var init_retry3 = __esm({ }); // node_modules/@smithy/credential-provider-imds/dist-es/fromContainerMetadata.js -import { parse as parse3 } from "url"; var ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, ENV_CMDS_AUTH_TOKEN, fromContainerMetadata, requestFromEcsImds, CMDS_IP, GREENGRASS_HOSTS, GREENGRASS_PROTOCOLS, getCmdsUri; var init_fromContainerMetadata = __esm({ "node_modules/@smithy/credential-provider-imds/dist-es/fromContainerMetadata.js"() { "use strict"; - init_dist_es24(); - init_httpRequest2(); + init_config3(); init_ImdsCredentials(); init_RemoteProviderInit(); - init_retry3(); + init_httpRequest2(); + init_retry4(); ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; @@ -132786,14 +134964,8 @@ var init_fromContainerMetadata = __esm({ return buffer2.toString(); }; CMDS_IP = "169.254.170.2"; - GREENGRASS_HOSTS = { - localhost: true, - "127.0.0.1": true - }; - GREENGRASS_PROTOCOLS = { - "http:": true, - "https:": true - }; + GREENGRASS_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1"]); + GREENGRASS_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:"]); getCmdsUri = async ({ logger: logger8 }) => { if (process.env[ENV_CMDS_RELATIVE_URI]) { return { @@ -132802,21 +134974,28 @@ var init_fromContainerMetadata = __esm({ }; } if (process.env[ENV_CMDS_FULL_URI]) { - const parsed = parse3(process.env[ENV_CMDS_FULL_URI]); - if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) { + let parsed; + try { + parsed = new URL(process.env[ENV_CMDS_FULL_URI]); + } catch { + throw new CredentialsProviderError(`${process.env[ENV_CMDS_FULL_URI]} is not a valid container metadata service URL`, { tryNextLink: false, logger: logger8 }); + } + if (!parsed.hostname || !GREENGRASS_HOSTS.has(parsed.hostname)) { throw new CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, { tryNextLink: false, logger: logger8 }); } - if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) { + if (!parsed.protocol || !GREENGRASS_PROTOCOLS.has(parsed.protocol)) { throw new CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, { tryNextLink: false, logger: logger8 }); } return { - ...parsed, + protocol: parsed.protocol, + hostname: parsed.hostname, + path: parsed.pathname + parsed.search, port: parsed.port ? parseInt(parsed.port, 10) : void 0 }; } @@ -132833,7 +135012,7 @@ var InstanceMetadataV1FallbackError; var init_InstanceMetadataV1FallbackError = __esm({ "node_modules/@smithy/credential-provider-imds/dist-es/error/InstanceMetadataV1FallbackError.js"() { "use strict"; - init_dist_es24(); + init_config3(); InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError extends CredentialsProviderError { tryNextLink; name = "InstanceMetadataV1FallbackError"; @@ -132866,7 +135045,7 @@ var init_EndpointConfigOptions = __esm({ ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env2) => env2[ENV_ENDPOINT_NAME], + environmentVariableSelector: (env3) => env3[ENV_ENDPOINT_NAME], configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME], default: void 0 }; @@ -132894,7 +135073,7 @@ var init_EndpointModeConfigOptions = __esm({ ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode"; ENDPOINT_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env2) => env2[ENV_ENDPOINT_MODE_NAME], + environmentVariableSelector: (env3) => env3[ENV_ENDPOINT_MODE_NAME], configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME], default: EndpointMode.IPv4 }; @@ -132906,8 +135085,8 @@ var getInstanceMetadataEndpoint, getFromEndpointConfig, getFromEndpointModeConfi var init_getInstanceMetadataEndpoint = __esm({ "node_modules/@smithy/credential-provider-imds/dist-es/utils/getInstanceMetadataEndpoint.js"() { "use strict"; - init_dist_es44(); - init_dist_es19(); + init_config3(); + init_protocols(); init_Endpoint(); init_EndpointConfigOptions(); init_EndpointMode(); @@ -132987,13 +135166,12 @@ var IMDS_PATH, IMDS_TOKEN_PATH, AWS_EC2_METADATA_V1_DISABLED, PROFILE_AWS_EC2_ME var init_fromInstanceMetadata = __esm({ "node_modules/@smithy/credential-provider-imds/dist-es/fromInstanceMetadata.js"() { "use strict"; - init_dist_es44(); - init_dist_es24(); + init_config3(); init_InstanceMetadataV1FallbackError(); - init_httpRequest2(); init_ImdsCredentials(); init_RemoteProviderInit(); - init_retry3(); + init_httpRequest2(); + init_retry4(); init_getInstanceMetadataEndpoint(); init_staticStabilityProvider(); IMDS_PATH = "/latest/meta-data/iam/security-credentials/"; @@ -133012,8 +135190,8 @@ var init_fromInstanceMetadata = __esm({ let fallbackBlockedFromProfile = false; let fallbackBlockedFromProcessEnv = false; const configValue = await loadConfig({ - environmentVariableSelector: (env2) => { - const envValue = env2[AWS_EC2_METADATA_V1_DISABLED]; + environmentVariableSelector: (env3) => { + const envValue = env3[AWS_EC2_METADATA_V1_DISABLED]; fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false"; if (envValue === void 0) { throw new CredentialsProviderError(`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, { logger: init.logger }); @@ -133120,7 +135298,7 @@ var init_fromInstanceMetadata = __esm({ }); // node_modules/@smithy/credential-provider-imds/dist-es/types.js -var init_types8 = __esm({ +var init_types3 = __esm({ "node_modules/@smithy/credential-provider-imds/dist-es/types.js"() { "use strict"; } @@ -133141,25 +135319,1042 @@ __export(dist_es_exports2, { httpRequest: () => httpRequest, providerConfigFromInit: () => providerConfigFromInit }); -var init_dist_es49 = __esm({ +var init_dist_es10 = __esm({ "node_modules/@smithy/credential-provider-imds/dist-es/index.js"() { "use strict"; init_fromContainerMetadata(); init_fromInstanceMetadata(); init_RemoteProviderInit(); - init_types8(); + init_types3(); init_httpRequest2(); init_getInstanceMetadataEndpoint(); init_Endpoint(); } }); +// node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +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 init_build_abort_error = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js"() { + "use strict"; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/constants.js +var NODEJS_TIMEOUT_ERROR_CODES2; +var init_constants7 = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/constants.js"() { + "use strict"; + NODEJS_TIMEOUT_ERROR_CODES2 = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +var getTransformedHeaders; +var init_get_transformed_headers = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js"() { + "use strict"; + getTransformedHeaders = (headers) => { + const transformedHeaders = {}; + for (const name in headers) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; + } + return transformedHeaders; + }; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/node-https.js +import node_https from "https"; +var init_node_https = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/node-https.js"() { + "use strict"; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/timing.js +var timing; +var init_timing = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/timing.js"() { + "use strict"; + timing = { + setTimeout: (cb, ms2) => setTimeout(cb, ms2), + clearTimeout: (timeoutId) => clearTimeout(timeoutId) + }; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +var DEFER_EVENT_LISTENER_TIME, setConnectionTimeout; +var init_set_connection_timeout = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js"() { + "use strict"; + init_timing(); + DEFER_EVENT_LISTENER_TIME = 1e3; + setConnectionTimeout = (request2, reject2, timeoutInMs = 0) => { + if (!timeoutInMs) { + return -1; + } + const registerTimeout = (offset) => { + const timeoutId = timing.setTimeout(() => { + request2.destroy(); + reject2(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 (request2.socket) { + doWithSocket(request2.socket); + } else { + request2.on("socket", doWithSocket); + } + }; + if (timeoutInMs < 2e3) { + registerTimeout(0); + return 0; + } + return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME); + }; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js +var setRequestTimeout; +var init_set_request_timeout = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js"() { + "use strict"; + init_timing(); + setRequestTimeout = (req, reject2, timeoutInMs = 0, throwOnRequestTimeout, logger8) => { + 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 error2 = Object.assign(new Error(msg), { + name: "TimeoutError", + code: "ETIMEDOUT" + }); + req.destroy(error2); + reject2(error2); + } else { + msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`; + logger8?.warn?.(msg); + } + }, timeoutInMs); + } + return -1; + }; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +var DEFER_EVENT_LISTENER_TIME2, setSocketKeepAlive; +var init_set_socket_keep_alive = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js"() { + "use strict"; + init_timing(); + DEFER_EVENT_LISTENER_TIME2 = 3e3; + setSocketKeepAlive = (request2, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME2) => { + if (keepAlive !== true) { + return -1; + } + const registerListener = () => { + if (request2.socket) { + request2.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + } else { + request2.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + }); + } + }; + if (deferTimeMs === 0) { + registerListener(); + return 0; + } + return timing.setTimeout(registerListener, deferTimeMs); + }; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +var DEFER_EVENT_LISTENER_TIME3, setSocketTimeout; +var init_set_socket_timeout = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js"() { + "use strict"; + init_timing(); + DEFER_EVENT_LISTENER_TIME3 = 3e3; + setSocketTimeout = (request2, reject2, timeoutInMs = 0) => { + const registerTimeout = (offset) => { + const timeout2 = timeoutInMs - offset; + const onTimeout = () => { + request2.destroy(); + reject2(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 (request2.socket) { + request2.socket.setTimeout(timeout2, onTimeout); + request2.on("close", () => request2.socket?.removeListener("timeout", onTimeout)); + } else { + request2.setTimeout(timeout2, onTimeout); + } + }; + if (0 < timeoutInMs && timeoutInMs < 6e3) { + registerTimeout(0); + return 0; + } + return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME3), DEFER_EVENT_LISTENER_TIME3); + }; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +import { Readable as Readable9 } from "stream"; +async function writeRequestBody(httpRequest2, request2, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) { + const headers = request2.headers; + const expect = headers ? headers.Expect || headers.expect : void 0; + let timeoutId = -1; + let sendBody = true; + if (!externalAgent && expect === "100-continue") { + sendBody = await Promise.race([ + new Promise((resolve8) => { + timeoutId = Number(timing.setTimeout(() => resolve8(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve8) => { + httpRequest2.on("continue", () => { + timing.clearTimeout(timeoutId); + resolve8(true); + }); + httpRequest2.on("response", () => { + timing.clearTimeout(timeoutId); + resolve8(false); + }); + httpRequest2.on("error", () => { + timing.clearTimeout(timeoutId); + resolve8(false); + }); + }) + ]); + } + if (sendBody) { + writeBody(httpRequest2, request2.body); + } +} +function writeBody(httpRequest2, body2) { + if (body2 instanceof Readable9) { + body2.pipe(httpRequest2); + return; + } + if (body2) { + const isBuffer = Buffer.isBuffer(body2); + const isString = typeof body2 === "string"; + if (isBuffer || isString) { + if (isBuffer && body2.byteLength === 0) { + httpRequest2.end(); + } else { + httpRequest2.end(body2); + } + return; + } + const uint8 = body2; + if (typeof uint8 === "object" && uint8.buffer && typeof uint8.byteOffset === "number" && typeof uint8.byteLength === "number") { + httpRequest2.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength)); + return; + } + httpRequest2.end(Buffer.from(body2)); + return; + } + httpRequest2.end(); +} +var MIN_WAIT_TIME; +var init_write_request_body = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/write-request-body.js"() { + "use strict"; + init_timing(); + MIN_WAIT_TIME = 6e3; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +var hAgent, hRequest, NodeHttpHandler; +var init_node_http_handler = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js"() { + "use strict"; + init_protocols(); + init_build_abort_error(); + init_constants7(); + init_get_transformed_headers(); + init_node_https(); + init_set_connection_timeout(); + init_set_request_timeout(); + init_set_socket_keep_alive(); + init_set_socket_timeout(); + init_timing(); + init_write_request_body(); + hAgent = void 0; + hRequest = void 0; + NodeHttpHandler = 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, logger8 = 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) { + logger8?.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((resolve8, reject2) => { + if (typeof options === "function") { + options().then((_options) => { + resolve8(this.resolveDefaultConfig(_options)); + }).catch(reject2); + } else { + resolve8(this.resolveDefaultConfig(options)); + } + }); + } + destroy() { + this.config?.httpAgent?.destroy(); + this.config?.httpsAgent?.destroy(); + } + async handle(request2, { abortSignal, requestTimeout } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + const config = this.config; + const isSSL = request2.protocol === "https:"; + if (!isSSL && !this.config.httpAgent) { + this.config.httpAgent = await this.config.httpAgentProvider(); + } + return new Promise((_resolve, _reject) => { + let writeRequestBodyPromise = void 0; + let socketWarningTimeoutId = -1; + let connectionTimeoutId = -1; + let requestTimeoutId = -1; + let socketTimeoutId = -1; + let keepAliveTimeoutId = -1; + const clearTimeouts = () => { + timing.clearTimeout(socketWarningTimeoutId); + timing.clearTimeout(connectionTimeoutId); + timing.clearTimeout(requestTimeoutId); + timing.clearTimeout(socketTimeoutId); + timing.clearTimeout(keepAliveTimeoutId); + }; + const resolve8 = async (arg) => { + await writeRequestBodyPromise; + clearTimeouts(); + _resolve(arg); + }; + const reject2 = async (arg) => { + await writeRequestBodyPromise; + clearTimeouts(); + _reject(arg); + }; + if (abortSignal?.aborted) { + const abortError = buildAbortError(abortSignal); + reject2(abortError); + return; + } + const headers = request2.headers; + const expectContinue = headers ? (headers.Expect ?? headers.expect) === "100-continue" : false; + let agent = isSSL ? config.httpsAgent : config.httpAgent; + if (expectContinue && !this.externalAgent) { + agent = new (isSSL ? node_https.Agent : hAgent)({ + keepAlive: false, + maxSockets: Infinity + }); + } + socketWarningTimeoutId = timing.setTimeout(() => { + this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp, config.logger); + }, config.socketAcquisitionWarningTimeout ?? (config.requestTimeout ?? 2e3) + (config.connectionTimeout ?? 1e3)); + const queryString = request2.query ? buildQueryString(request2.query) : ""; + let auth2 = void 0; + if (request2.username != null || request2.password != null) { + const username = request2.username ?? ""; + const password = request2.password ?? ""; + auth2 = `${username}:${password}`; + } + let path10 = request2.path; + if (queryString) { + path10 += `?${queryString}`; + } + if (request2.fragment) { + path10 += `#${request2.fragment}`; + } + let hostname = request2.hostname ?? ""; + if (hostname[0] === "[" && hostname.endsWith("]")) { + hostname = request2.hostname.slice(1, -1); + } else { + hostname = request2.hostname; + } + const nodeHttpsOptions = { + headers: request2.headers, + host: hostname, + method: request2.method, + path: path10, + port: request2.port, + agent, + auth: auth2 + }; + const requestFunc = isSSL ? node_https.request : hRequest; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new HttpResponse({ + statusCode: res.statusCode || -1, + reason: res.statusMessage, + headers: getTransformedHeaders(res.headers), + body: res + }); + resolve8({ response: httpResponse }); + }); + req.on("error", (err) => { + if (NODEJS_TIMEOUT_ERROR_CODES2.includes(err.code)) { + reject2(Object.assign(err, { name: "TimeoutError" })); + } else { + reject2(err); + } + }); + if (abortSignal) { + const onAbort = () => { + req.destroy(); + const abortError = buildAbortError(abortSignal); + reject2(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; + connectionTimeoutId = setConnectionTimeout(req, reject2, config.connectionTimeout); + requestTimeoutId = setRequestTimeout(req, reject2, effectiveRequestTimeout, config.throwOnRequestTimeout, config.logger ?? console); + socketTimeoutId = setSocketTimeout(req, reject2, config.socketTimeout); + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + keepAliveTimeoutId = setSocketKeepAlive(req, { + keepAlive: httpAgent.keepAlive, + keepAliveMsecs: httpAgent.keepAliveMsecs + }); + } + writeRequestBodyPromise = writeRequestBody(req, request2, effectiveRequestTimeout, this.externalAgent).catch((e6) => { + clearTimeouts(); + return _reject(e6); + }); + }); + } + 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: logger8 } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + requestTimeout, + socketTimeout, + socketAcquisitionWarningTimeout, + throwOnRequestTimeout, + httpAgentProvider: async () => { + const node_http3 = await import("http"); + const { Agent: Agent3, request: request2 } = node_http3.default ?? node_http3; + hRequest = request2; + hAgent = Agent3; + 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: logger8 + }; + } + }; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/node-http2.js +import node_http2 from "http2"; +var init_node_http2 = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/node-http2.js"() { + "use strict"; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +var ids, ClientHttp2SessionRef; +var init_ClientHttp2SessionRef = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js"() { + "use strict"; + ids = new Uint16Array(1); + 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; + } + }; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +var NodeHttp2ConnectionPool; +var init_node_http2_connection_pool = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js"() { + "use strict"; + init_ClientHttp2SessionRef(); + 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(); + } + }; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +import http22 from "http2"; +var NodeHttp2ConnectionManager; +var init_node_http2_connection_manager = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js"() { + "use strict"; + init_ClientHttp2SessionRef(); + init_node_http2_connection_pool(); + NodeHttp2ConnectionManager = class { + config; + connectOptions; + 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 url2 = this.getUrlString(requestContext); + const pool = this.getPool(url2); + if (!this.config.disableConcurrency && !connectionConfiguration.isEventStream) { + const available = pool.poll(); + if (available) { + available.retain(); + return available; + } + } + const ref = new ClientHttp2SessionRef(this.connect(url2)); + 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(url2, ref); + }; + const ensureDestroyed = () => { + this.removeFromPoolAndCheckedDestroy(url2, 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 url2 = this.getUrlString(requestContext); + const ref = new ClientHttp2SessionRef(this.connect(url2)); + 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 [url2, connectionPool] of this.connectionPools) { + for (const session of [...connectionPool]) { + session.destroy(); + } + this.connectionPools.delete(url2); + } + } + 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; + } + setNodeHttp2ConnectOptions(nodeHttp2ConnectOptions) { + this.connectOptions = nodeHttp2ConnectOptions; + } + debug() { + const pools = {}; + for (const [url2, 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[url2] = { 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(url2) { + if (!this.connectionPools.has(url2)) { + const pool = new NodeHttp2ConnectionPool(); + if (this.config.maxConcurrency) { + pool.setMaxConcurrency(this.config.maxConcurrency); + } + this.connectionPools.set(url2, pool); + } + return this.connectionPools.get(url2); + } + getUrlString(request2) { + return request2.destination.toString(); + } + connect(url2) { + return this.connectOptions === void 0 ? http22.connect(url2) : http22.connect(url2, this.connectOptions); + } + }; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +var constants3, NodeHttp2Handler; +var init_node_http2_handler = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js"() { + "use strict"; + init_protocols(); + init_build_abort_error(); + init_get_transformed_headers(); + init_node_http2(); + init_node_http2_connection_manager(); + init_write_request_body(); + ({ constants: constants3 } = node_http2); + 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((resolve8, reject2) => { + if (typeof options === "function") { + options().then((opts) => { + resolve8(opts || {}); + }).catch(reject2); + } else { + resolve8(options || {}); + } + }); + } + destroy() { + this.connectionManager.destroy(); + } + async handle(request2, { abortSignal, requestTimeout, isEventStream } = {}) { + if (!this.config) { + this.config = await this.configProvider; + const { disableConcurrentStreams: disableConcurrentStreams2, maxConcurrentStreams, nodeHttp2ConnectOptions } = this.config; + this.connectionManager.setDisableConcurrentStreams(disableConcurrentStreams2 ?? false); + if (maxConcurrentStreams) { + this.connectionManager.setMaxConcurrentStreams(maxConcurrentStreams); + } + if (nodeHttp2ConnectOptions) { + this.connectionManager.setNodeHttp2ConnectOptions(nodeHttp2ConnectOptions); + } + } + 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 resolve8 = async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }; + const reject2 = async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }; + if (abortSignal?.aborted) { + fulfilled = true; + const abortError = buildAbortError(abortSignal); + reject2(abortError); + return; + } + const { hostname, method, port, protocol, query } = request2; + let auth2 = ""; + if (request2.username != null || request2.password != null) { + const username = request2.username ?? ""; + const password = request2.password ?? ""; + auth2 = `${username}:${password}@`; + } + const authority = `${protocol}//${auth2}${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; + reject2(err); + }; + const queryString = query ? buildQueryString(query) : ""; + let path10 = request2.path; + if (queryString) { + path10 += `?${queryString}`; + } + if (request2.fragment) { + path10 += `#${request2.fragment}`; + } + const clientHttp2Stream = session.request({ + ...request2.headers, + [constants3.HTTP2_HEADER_PATH]: path10, + [constants3.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 HttpResponse({ + statusCode: headers[":status"] ?? -1, + headers: getTransformedHeaders(headers), + body: clientHttp2Stream + }); + fulfilled = true; + resolve8({ 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, request2, effectiveRequestTimeout); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } + }; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +import { Writable as Writable2 } from "stream"; +var Collector2; +var init_collector = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js"() { + "use strict"; + Collector2 = class extends Writable2 { + bufferedBytes = []; + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); + } + }; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +async function collectReadableStream2(stream5) { + const chunks = []; + const reader = stream5.getReader(); + let isDone = false; + let length = 0; + while (!isDone) { + const { done, value } = await reader.read(); + if (value) { + chunks.push(value); + length += value.length; + } + isDone = done; + } + const collected = new Uint8Array(length); + let offset = 0; + for (const chunk of chunks) { + collected.set(chunk, offset); + offset += chunk.length; + } + return collected; +} +var streamCollector3, isReadableStreamInstance2; +var init_stream_collector2 = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js"() { + "use strict"; + init_collector(); + streamCollector3 = (stream5) => { + if (isReadableStreamInstance2(stream5)) { + return collectReadableStream2(stream5); + } + return new Promise((resolve8, reject2) => { + const collector = new Collector2(); + stream5.pipe(collector); + stream5.on("error", (err) => { + collector.end(); + reject2(err); + }); + collector.on("error", reject2); + collector.on("finish", function() { + const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); + resolve8(bytes); + }); + }); + }; + isReadableStreamInstance2 = (stream5) => typeof ReadableStream === "function" && stream5 instanceof ReadableStream; + } +}); + +// node_modules/@smithy/node-http-handler/dist-es/index.js +var init_dist_es11 = __esm({ + "node_modules/@smithy/node-http-handler/dist-es/index.js"() { + "use strict"; + init_node_http_handler(); + init_node_http2_handler(); + init_stream_collector2(); + } +}); + // node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/checkUrl.js var ECS_CONTAINER_HOST, EKS_CONTAINER_HOST_IPv4, EKS_CONTAINER_HOST_IPv6, checkUrl; var init_checkUrl = __esm({ "node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/checkUrl.js"() { "use strict"; - init_dist_es24(); + init_config3(); ECS_CONTAINER_HOST = "169.254.170.2"; EKS_CONTAINER_HOST_IPv4 = "169.254.170.23"; EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]"; @@ -133202,8 +136397,8 @@ function createGetRequest(url2) { hostname: url2.hostname, port: Number(url2.port), path: url2.pathname, - query: Array.from(url2.searchParams.entries()).reduce((acc, [k7, v8]) => { - acc[k7] = v8; + query: Array.from(url2.searchParams.entries()).reduce((acc, [k7, v2]) => { + acc[k7] = v2; return acc; }, {}), fragment: url2.hash @@ -133240,10 +136435,10 @@ async function getCredentials(response, logger8) { var init_requestHelpers = __esm({ "node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/requestHelpers.js"() { "use strict"; - init_dist_es24(); - init_dist_es2(); - init_dist_es27(); - init_dist_es17(); + init_config3(); + init_protocols(); + init_serde2(); + init_serde2(); } }); @@ -133258,7 +136453,7 @@ var init_retry_wrapper = __esm({ try { return await toRetry(); } catch (e6) { - await new Promise((resolve4) => setTimeout(resolve4, delayMs)); + await new Promise((resolve8) => setTimeout(resolve8, delayMs)); } } return await toRetry(); @@ -133273,9 +136468,9 @@ var AWS_CONTAINER_CREDENTIALS_RELATIVE_URI, DEFAULT_LINK_LOCAL_HOST, AWS_CONTAIN var init_fromHttp = __esm({ "node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js"() { "use strict"; - init_client2(); - init_dist_es14(); - init_dist_es24(); + init_client4(); + init_config3(); + init_dist_es11(); init_checkUrl(); init_requestHelpers(); init_retry_wrapper(); @@ -133287,12 +136482,12 @@ var init_fromHttp = __esm({ fromHttp = (options = {}) => { options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp"); let host; - const relative2 = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI]; + const relative3 = 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 warn = options.logger?.constructor?.name === "NoOpLogger" || !options.logger?.warn ? console.warn : options.logger.warn.bind(options.logger); - if (relative2 && full) { + if (relative3 && full) { warn("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."); warn("awsContainerCredentialsFullUri will take precedence."); } @@ -133302,32 +136497,37 @@ var init_fromHttp = __esm({ } if (full) { host = full; - } else if (relative2) { - host = `${DEFAULT_LINK_LOCAL_HOST}${relative2}`; + } else if (relative3) { + host = `${DEFAULT_LINK_LOCAL_HOST}${relative3}`; } else { throw new CredentialsProviderError(`No HTTP credential provider host provided. Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options.logger }); } const url2 = new URL(host); checkUrl(url2, options.logger); - const requestHandler = NodeHttpHandler.create({ - requestTimeout: options.timeout ?? 1e3, - connectionTimeout: options.timeout ?? 1e3 - }); - return retryWrapper(async () => { - const request3 = createGetRequest(url2); + const requestHandler = NodeHttpHandler.create({ connectionTimeout: options.timeout ?? 1e3 }); + const requestTimeout = options.timeout ?? 1e3; + const provider = retryWrapper(async () => { + const request2 = createGetRequest(url2); if (token) { - request3.headers.Authorization = token; + request2.headers.Authorization = token; } else if (tokenFile) { - request3.headers.Authorization = (await fs14.readFile(tokenFile)).toString(); + request2.headers.Authorization = (await fs14.readFile(tokenFile)).toString(); } try { - const result = await requestHandler.handle(request3); + const result = await requestHandler.handle(request2, { requestTimeout }); return getCredentials(result.response).then((creds) => setCredentialFeature(creds, "CREDENTIALS_HTTP", "z")); } catch (e6) { throw new CredentialsProviderError(String(e6), { logger: options.logger }); } }, options.maxRetries ?? 3, options.timeout ?? 1e3); + return async () => { + try { + return await provider(); + } finally { + requestHandler.destroy?.(); + } + }; }; } }); @@ -133337,7 +136537,7 @@ var dist_es_exports3 = {}; __export(dist_es_exports3, { fromHttp: () => fromHttp }); -var init_dist_es50 = __esm({ +var init_dist_es12 = __esm({ "node_modules/@aws-sdk/credential-provider-http/dist-es/index.js"() { "use strict"; init_fromHttp(); @@ -133345,20 +136545,20 @@ var init_dist_es50 = __esm({ }); // node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js -var ENV_IMDS_DISABLED, remoteProvider; +var ENV_IMDS_DISABLED2, remoteProvider; var init_remoteProvider = __esm({ "node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js"() { "use strict"; - init_dist_es24(); - ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; + init_config3(); + ENV_IMDS_DISABLED2 = "AWS_EC2_METADATA_DISABLED"; remoteProvider = async (init) => { - const { ENV_CMDS_FULL_URI: ENV_CMDS_FULL_URI2, ENV_CMDS_RELATIVE_URI: ENV_CMDS_RELATIVE_URI2, fromContainerMetadata: fromContainerMetadata2, fromInstanceMetadata: fromInstanceMetadata2 } = await Promise.resolve().then(() => (init_dist_es49(), dist_es_exports2)); + const { ENV_CMDS_FULL_URI: ENV_CMDS_FULL_URI2, ENV_CMDS_RELATIVE_URI: ENV_CMDS_RELATIVE_URI2, fromContainerMetadata: fromContainerMetadata2, fromInstanceMetadata: fromInstanceMetadata2 } = await Promise.resolve().then(() => (init_dist_es10(), dist_es_exports2)); if (process.env[ENV_CMDS_RELATIVE_URI2] || process.env[ENV_CMDS_FULL_URI2]) { init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata"); - const { fromHttp: fromHttp2 } = await Promise.resolve().then(() => (init_dist_es50(), dist_es_exports3)); + const { fromHttp: fromHttp2 } = await Promise.resolve().then(() => (init_dist_es12(), dist_es_exports3)); return chain(fromHttp2(init), fromContainerMetadata2(init)); } - if (process.env[ENV_IMDS_DISABLED] && process.env[ENV_IMDS_DISABLED] !== "false") { + if (process.env[ENV_IMDS_DISABLED2] && process.env[ENV_IMDS_DISABLED2] !== "false") { return async () => { throw new CredentialsProviderError("EC2 Instance Metadata Service access disabled", { logger: init.logger }); }; @@ -133375,9 +136575,18 @@ function memoizeChain(providers, treatAsExpired) { let activeLock; let passiveLock; let credentials; + let forceRefreshLock; const provider = async (options) => { if (options?.forceRefresh) { - return await chain2(options); + if (!forceRefreshLock) { + forceRefreshLock = chain2(options).then((c6) => { + credentials = c6; + }).finally(() => { + forceRefreshLock = void 0; + }); + } + await forceRefreshLock; + return credentials; } if (credentials?.expiration) { if (credentials?.expiration?.getTime() < Date.now()) { @@ -133444,9 +136653,9 @@ var fromEnvSigningName; var init_fromEnvSigningName = __esm({ "node_modules/@aws-sdk/token-providers/dist-es/fromEnvSigningName.js"() { "use strict"; - init_client2(); + init_client4(); init_httpAuthSchemes2(); - init_dist_es24(); + init_config3(); fromEnvSigningName = ({ logger: logger8, signingName } = {}) => async () => { logger8?.debug?.("@aws-sdk/token-providers - fromEnvSigningName"); if (!signingName) { @@ -133498,8 +136707,8 @@ var defaultSSOOIDCHttpAuthSchemeParametersProvider, defaultSSOOIDCHttpAuthScheme var init_httpAuthSchemeProvider2 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthSchemeProvider.js"() { "use strict"; - init_dist_es29(); - init_dist_es7(); + init_httpAuthSchemes2(); + init_client3(); defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context5, input) => { return { operation: getSmithyContext(context5).operation, @@ -133557,7 +136766,7 @@ var init_package2 = __esm({ "node_modules/@aws-sdk/nested-clients/package.json"() { package_default2 = { name: "@aws-sdk/nested-clients", - version: "3.996.13", + version: "3.997.17", description: "Nested clients for AWS SDK packages.", main: "./dist-cjs/index.js", module: "./dist-es/index.js", @@ -133580,47 +136789,19 @@ var init_package2 = __esm({ sideEffects: false, author: { name: "AWS SDK for JavaScript Team", - url: "https://aws.amazon.com/javascript/" + url: "https://aws.amazon.com/sdk-for-javascript/" }, license: "Apache-2.0", dependencies: { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "^3.973.23", - "@aws-sdk/middleware-host-header": "^3.972.8", - "@aws-sdk/middleware-logger": "^3.972.8", - "@aws-sdk/middleware-recursion-detection": "^3.972.8", - "@aws-sdk/middleware-user-agent": "^3.972.24", - "@aws-sdk/region-config-resolver": "^3.972.9", - "@aws-sdk/types": "^3.973.6", - "@aws-sdk/util-endpoints": "^3.996.5", - "@aws-sdk/util-user-agent-browser": "^3.972.8", - "@aws-sdk/util-user-agent-node": "^3.973.10", - "@smithy/config-resolver": "^4.4.13", - "@smithy/core": "^3.23.12", - "@smithy/fetch-http-handler": "^5.3.15", - "@smithy/hash-node": "^4.2.12", - "@smithy/invalid-dependency": "^4.2.12", - "@smithy/middleware-content-length": "^4.2.12", - "@smithy/middleware-endpoint": "^4.4.27", - "@smithy/middleware-retry": "^4.4.44", - "@smithy/middleware-serde": "^4.2.15", - "@smithy/middleware-stack": "^4.2.12", - "@smithy/node-config-provider": "^4.3.12", - "@smithy/node-http-handler": "^4.5.0", - "@smithy/protocol-http": "^5.3.12", - "@smithy/smithy-client": "^4.12.7", - "@smithy/types": "^4.13.1", - "@smithy/url-parser": "^4.2.12", - "@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.43", - "@smithy/util-defaults-mode-node": "^4.2.47", - "@smithy/util-endpoints": "^3.3.3", - "@smithy/util-middleware": "^4.2.12", - "@smithy/util-retry": "^4.2.12", - "@smithy/util-utf8": "^4.2.2", + "@aws-sdk/core": "^3.974.18", + "@aws-sdk/signature-v4-multi-region": "^3.996.32", + "@aws-sdk/types": "^3.973.11", + "@smithy/core": "^3.24.6", + "@smithy/fetch-http-handler": "^5.4.6", + "@smithy/node-http-handler": "^4.7.6", + "@smithy/types": "^4.14.3", tslib: "^2.6.2" }, devDependencies: { @@ -133701,572 +136882,1905 @@ var init_package2 = __esm({ require: "./dist-cjs/submodules/sso/index.js" } } - }; - } -}); - -// node_modules/@aws-sdk/util-user-agent-node/dist-es/getRuntimeUserAgentPair.js -import { versions } from "process"; -var getRuntimeUserAgentPair; -var init_getRuntimeUserAgentPair = __esm({ - "node_modules/@aws-sdk/util-user-agent-node/dist-es/getRuntimeUserAgentPair.js"() { - "use strict"; - getRuntimeUserAgentPair = () => { - const runtimesToCheck = ["deno", "bun", "llrt"]; - for (const runtime of runtimesToCheck) { - if (versions[runtime]) { - return [`md/${runtime}`, versions[runtime]]; + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js +var ProtocolLib; +var init_ProtocolLib = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js"() { + "use strict"; + init_client3(); + init_schema2(); + 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, metadata2, getErrorSchema) { + let errorName = errorIdentifier; + if (errorIdentifier.includes("#")) { + [, errorName] = errorIdentifier.split("#"); + } + const errorMetadata = { + $metadata: metadata2, + $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 (e6) { + 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 d6 = dataObject; + const message = d6?.message ?? d6?.Message ?? d6?.Error?.Message ?? d6?.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 error2 = decorateServiceException(exception, additions); + if (msg) { + error2.message = msg; + } + const errorObj = error2.Error ?? {}; + errorObj.Type = error2.Error?.Type; + errorObj.Code = error2.Error?.Code; + errorObj.Message = error2.Error?.message ?? error2.Error?.Message ?? msg; + error2.Error = errorObj; + const reqId = error2.$metadata.requestId; + if (reqId) { + error2.RequestId = reqId; + } + return error2; + } + return 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 i6 = 0; i6 < keys.length; i6++) { + const k7 = keys[i6]; + Error2[k7 === "message" ? "Message" : k7] = output[k7]; + } + 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(registry2, errorName) { + try { + return registry2.getSchema(errorName); + } catch (e6) { + return registry2.find((schema) => NormalizedSchema.of(schema).getMergedTraits().awsQueryError?.[0] === errorName); + } + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js +var init_AwsSmithyRpcV2CborProtocol = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js"() { + "use strict"; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js +var init_coercing_serializers = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js"() { + "use strict"; + } +}); + +// 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"() { + "use strict"; + 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"() { + "use strict"; + 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 k7 = this.keys.values().next().value; + const v2 = this.from[k7]; + this.to.$unknown = [k7, v2]; + } + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js +function jsonReviver(key, value, context5) { + if (context5?.source) { + const numericString = context5.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"() { + "use strict"; + init_serde2(); + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js +var collectBodyString; +var init_common = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js"() { + "use strict"; + init_protocols(); + init_serde2(); + collectBodyString = (streamBody, context5) => collectBody(streamBody, context5).then((body2) => (context5?.utf8Encoder ?? toUtf8)(body2)); + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js +var parseJsonBody, findKey, sanitizeErrorCode, loadRestJsonErrorCode, loadErrorCode; +var init_parseJsonBody = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js"() { + "use strict"; + init_common(); + parseJsonBody = (streamBody, context5) => collectBodyString(streamBody, context5).then((encoded) => { + if (encoded.length) { + try { + return JSON.parse(encoded); + } catch (e6) { + if (e6?.name === "SyntaxError") { + Object.defineProperty(e6, "$responseBodyText", { + value: encoded + }); + } + throw e6; + } + } + return {}; + }); + findKey = (object, key) => Object.keys(object).find((k7) => k7.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, data) => { + return loadErrorCode(output, data, ["header", "code", "type"]); + }; + loadErrorCode = ({ headers }, data, order) => { + while (order.length > 0) { + const location = order.shift(); + switch (location) { + case "header": + const headerKey = findKey(headers ?? {}, "x-amzn-errortype"); + if (headerKey !== void 0) { + return sanitizeErrorCode(headers[headerKey]); + } + break; + case "code": + const codeKey = findKey(data ?? {}, "code"); + if (codeKey && data[codeKey] !== void 0) { + return sanitizeErrorCode(data[codeKey]); + } + break; + case "type": + if (data?.__type !== void 0) { + return sanitizeErrorCode(data.__type); + } + break; + } + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js +var JsonShapeDeserializer; +var init_JsonShapeDeserializer = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js"() { + "use strict"; + init_protocols(); + init_schema2(); + init_serde2(); + init_serde2(); + init_ConfigurableSerdeContext(); + init_UnionSerde(); + init_jsonReviver(); + init_parseJsonBody(); + JsonShapeDeserializer = class extends SerdeContextConfig { + settings; + constructor(settings) { + super(); + this.settings = settings; + } + async read(schema, data) { + return this._read(schema, typeof data === "string" ? JSON.parse(data, jsonReviver) : await parseJsonBody(data, this.serdeContext)); + } + readObject(schema, data) { + return this._read(schema, data); + } + _read(schema, value) { + const isObject2 = value !== null && typeof value === "object"; + const ns2 = NormalizedSchema.of(schema); + if (isObject2) { + if (ns2.isStructSchema()) { + const record = value; + const union = ns2.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 ns2.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 k7 in record) { + const v2 = record[k7]; + const t = jsonName ? nameMap[k7] ?? k7 : k7; + if (!(t in out)) { + out[t] = v2; + } + } + } + return out; + } + if (Array.isArray(value) && ns2.isListSchema()) { + const listMember = ns2.getValueSchema(); + const out = []; + for (const item of value) { + out.push(this._read(listMember, item)); + } + return out; + } + if (ns2.isMapSchema()) { + const mapMember = ns2.getValueSchema(); + const out = {}; + for (const _k2 in value) { + out[_k2] = this._read(mapMember, value[_k2]); + } + return out; + } + } + if (ns2.isBlobSchema() && typeof value === "string") { + return fromBase64(value); + } + const mediaType = ns2.getMergedTraits().mediaType; + if (ns2.isStringSchema() && typeof value === "string" && mediaType) { + const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); + if (isJson) { + return LazyJsonString.from(value); + } + return value; + } + if (ns2.isTimestampSchema() && value != null) { + const format4 = determineTimestampFormat(ns2, this.settings); + switch (format4) { + 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 (ns2.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) { + return BigInt(value); + } + if (ns2.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 (ns2.isNumericSchema() && typeof value === "string") { + switch (value) { + case "Infinity": + return Infinity; + case "-Infinity": + return -Infinity; + case "NaN": + return NaN; + } + return value; + } + if (ns2.isDocumentSchema()) { + if (isObject2) { + const out = Array.isArray(value) ? [] : {}; + for (const k7 in value) { + const v2 = value[k7]; + if (v2 instanceof NumericValue) { + out[k7] = v2; + } else { + out[k7] = this._read(ns2, v2); + } + } + 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"() { + "use strict"; + init_serde2(); + 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 v2 = `${NUMERIC_CONTROL_CHAR + "nv" + this.counter++}_` + value.string; + this.values.set(`"${v2}"`, value.string); + return v2; + } + if (typeof value === "bigint") { + const s = value.toString(); + const v2 = `${NUMERIC_CONTROL_CHAR + "b" + this.counter++}_` + s; + this.values.set(`"${v2}"`, s); + return v2; + } + 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 JsonShapeSerializer; +var init_JsonShapeSerializer = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js"() { + "use strict"; + init_protocols(); + init_schema2(); + init_serde2(); + 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 isObject2 = value !== null && typeof value === "object"; + const ns2 = NormalizedSchema.of(schema); + if (isObject2) { + if (ns2.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 ns2.structIterator()) { + const serializableValue = this._write(memberSchema, record[memberName], ns2); + if (serializableValue !== void 0) { + let targetKey = memberName; + if (jsonName) { + targetKey = memberSchema.getMergedTraits().jsonName ?? memberName; + nameMap[memberName] = targetKey; + } + out[targetKey] = serializableValue; + outCount++; + } + } + if (ns2.isUnionSchema() && outCount === 0) { + const { $unknown } = record; + if (Array.isArray($unknown)) { + const [k7, v2] = $unknown; + out[k7] = this._write(15, v2); + } + } else if (typeof record.__type === "string") { + for (const k7 in record) { + const v2 = record[k7]; + const targetKey = jsonName ? nameMap[k7] ?? k7 : k7; + if (!(targetKey in out)) { + out[targetKey] = this._write(15, v2); + } + } + } + return out; + } + if (Array.isArray(value) && ns2.isListSchema()) { + const listMember = ns2.getValueSchema(); + const out = []; + const sparse = !!ns2.getMergedTraits().sparse; + for (const item of value) { + if (sparse || item != null) { + out.push(this._write(listMember, item)); + } + } + return out; + } + if (ns2.isMapSchema()) { + const mapMember = ns2.getValueSchema(); + const out = {}; + const sparse = !!ns2.getMergedTraits().sparse; + for (const _k2 in value) { + const _v2 = value[_k2]; + if (sparse || _v2 != null) { + out[_k2] = this._write(mapMember, _v2); + } + } + return out; + } + if (value instanceof Uint8Array && (ns2.isBlobSchema() || ns2.isDocumentSchema())) { + if (ns2 === this.rootSchema) { + return value; + } + return (this.serdeContext?.base64Encoder ?? toBase64)(value); + } + if (value instanceof Date && (ns2.isTimestampSchema() || ns2.isDocumentSchema())) { + const format4 = determineTimestampFormat(ns2, this.settings); + switch (format4) { + 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 (ns2.isStringSchema()) { + if (typeof value === "undefined" && ns2.isIdempotencyToken()) { + return generateIdempotencyToken(); + } + const mediaType = ns2.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" && ns2.isNumericSchema()) { + if (Math.abs(value) === Infinity || isNaN(value)) { + return String(value); + } + return value; + } + if (typeof value === "string" && ns2.isBlobSchema()) { + if (ns2 === this.rootSchema) { + return value; + } + return (this.serdeContext?.base64Encoder ?? toBase64)(value); + } + if (typeof value === "bigint") { + this.useReplacer = true; + } + if (ns2.isDocumentSchema()) { + if (isObject2) { + const out = Array.isArray(value) ? [] : {}; + for (const k7 in value) { + const v2 = value[k7]; + if (v2 instanceof NumericValue) { + this.useReplacer = true; + out[k7] = v2; + } else { + out[k7] = this._write(ns2, v2); + } + } + 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"() { + "use strict"; + 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 init_AwsJsonRpcProtocol = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js"() { + "use strict"; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_0Protocol.js +var init_AwsJson1_0Protocol = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_0Protocol.js"() { + "use strict"; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_1Protocol.js +var init_AwsJson1_1Protocol = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_1Protocol.js"() { + "use strict"; + } +}); + +// 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"() { + "use strict"; + init_protocols(); + init_schema2(); + init_ProtocolLib(); + init_JsonCodec(); + init_parseJsonBody(); + AwsRestJsonProtocol = class extends HttpBindingProtocol { + serializer; + deserializer; + codec; + mixin = new ProtocolLib(); + constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries6 }) { + super({ + defaultNamespace, + errorTypeRegistries: errorTypeRegistries6 + }); + 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, context5) { + const request2 = await super.serializeRequest(operationSchema, input, context5); + const inputSchema = NormalizedSchema.of(operationSchema.input); + if (!request2.headers["content-type"]) { + const contentType2 = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); + if (contentType2) { + request2.headers["content-type"] = contentType2; + } + } + if (request2.body == null && request2.headers["content-type"] === this.getDefaultContentType()) { + request2.body = "{}"; + } + return request2; + } + async deserializeResponse(operationSchema, context5, response) { + const output = await super.deserializeResponse(operationSchema, context5, 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, context5, response, dataObject, metadata2) { + 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, metadata2); + const ns2 = NormalizedSchema.of(errorSchema); + const message = dataObject.message ?? dataObject.Message ?? "UnknownError"; + const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error; + const exception = new ErrorCtor({}); + await this.deserializeHttpMessage(errorSchema, context5, response, dataObject); + const output = {}; + const errorDeserializer = this.codec.createDeserializer(); + for (const [name, member2] of ns2.structIterator()) { + const target = member2.getMergedTraits().jsonName ?? name; + output[name] = errorDeserializer.readObject(member2, dataObject[target]); + } + throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { + $fault: ns2.getMergedTraits().error, + message + }, output), dataObject); + } + getDefaultContentType() { + return "application/json"; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js +var init_awsExpectUnion = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js"() { + "use strict"; + } +}); + +// node_modules/@aws-sdk/xml-builder/dist-es/XmlText.js +var init_XmlText = __esm({ + "node_modules/@aws-sdk/xml-builder/dist-es/XmlText.js"() { + "use strict"; + } +}); + +// node_modules/@aws-sdk/xml-builder/dist-es/XmlNode.js +var init_XmlNode = __esm({ + "node_modules/@aws-sdk/xml-builder/dist-es/XmlNode.js"() { + "use strict"; + } +}); + +// node_modules/@aws-sdk/xml-builder/dist-es/xml-external/nodable_entities.js +function validateEntityName3(name) { + if (name[0] === "#") { + throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${name}"`); + } + for (const ch of name) { + if (SPECIAL_CHARS2.has(ch)) { + throw new Error(`[EntityReplacer] Invalid character '${ch}' in entity name: "${name}"`); + } + } + return name; +} +function mergeEntityMaps2(...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; +} +function parseLimitTiers2(raw) { + if (!raw || raw === LIMIT_TIER_EXTERNAL2) { + return /* @__PURE__ */ new Set([LIMIT_TIER_EXTERNAL2]); + } + if (raw === LIMIT_TIER_ALL2) { + return /* @__PURE__ */ new Set([LIMIT_TIER_ALL2]); + } + if (raw === LIMIT_TIER_BASE2) { + return /* @__PURE__ */ new Set([LIMIT_TIER_BASE2]); + } + if (Array.isArray(raw)) { + return new Set(raw); + } + return /* @__PURE__ */ new Set([LIMIT_TIER_EXTERNAL2]); +} +function parseNCRConfig2(ncr) { + if (!ncr) { + return { xmlVersion: 1, onLevel: NCR_LEVEL2.allow, nullLevel: NCR_LEVEL2.remove }; + } + const xmlVersion = ncr.xmlVersion === 1.1 ? 1.1 : 1; + const onLevel = NCR_LEVEL2[ncr.onNCR ?? "allow"] ?? NCR_LEVEL2.allow; + const nullLevel = NCR_LEVEL2[ncr.nullNCR ?? "remove"] ?? NCR_LEVEL2.remove; + const clampedNull = Math.max(nullLevel, NCR_LEVEL2.remove); + return { xmlVersion, onLevel, nullLevel: clampedNull }; +} +var XML2, COMMON_HTML2, CURRENCY2, SPECIAL_CHARS2, LIMIT_TIER_EXTERNAL2, LIMIT_TIER_BASE2, LIMIT_TIER_ALL2, NCR_LEVEL2, XML10_ALLOWED_C02, EntityDecoderImpl; +var init_nodable_entities = __esm({ + "node_modules/@aws-sdk/xml-builder/dist-es/xml-external/nodable_entities.js"() { + "use strict"; + XML2 = { + amp: "&", + apos: "'", + gt: ">", + lt: "<", + quot: '"' + }; + COMMON_HTML2 = { + 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" + }; + CURRENCY2 = { + 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" + }; + SPECIAL_CHARS2 = new Set("!?\\/[]$%{}^&*()<>|+"); + LIMIT_TIER_EXTERNAL2 = "external"; + LIMIT_TIER_BASE2 = "base"; + LIMIT_TIER_ALL2 = "all"; + NCR_LEVEL2 = Object.freeze({ allow: 0, leave: 1, remove: 2, throw: 3 }); + XML10_ALLOWED_C02 = /* @__PURE__ */ new Set([9, 10, 13]); + EntityDecoderImpl = class EntityDecoderImpl2 { + _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 : (r6) => r6; + this._limitTiers = parseLimitTiers2(this._limit.applyLimitsTo ?? LIMIT_TIER_EXTERNAL2); + this._numericAllowed = options.numericAllowed ?? true; + this._baseMap = mergeEntityMaps2(XML2, 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 = parseNCRConfig2(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)) { + validateEntityName3(key); + } + } + this._externalMap = mergeEntityMaps2(map2); + } + addExternalEntity(key, value) { + validateEntityName3(key); + if (typeof value === "string" && value.indexOf("&") === -1) { + this._externalMap[key] = value; + } + } + addInputEntities(map2) { + this._totalExpansions = 0; + this._expandedLength = 0; + this._inputMap = mergeEntityMaps2(map2); + } + reset() { + this._inputMap = /* @__PURE__ */ Object.create(null); + this._totalExpansions = 0; + this._expandedLength = 0; + return this; + } + setXmlVersion(version3) { + this._ncrXmlVersion = version3 === "1.1" || version3 === 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 i6 = 0; + const limitExpansions = this._maxTotalExpansions > 0; + const limitLength = this._maxExpandedLength > 0; + const checkLimits = limitExpansions || limitLength; + while (i6 < len) { + if (str.charCodeAt(i6) !== 38) { + i6++; + continue; + } + let j7 = i6 + 1; + while (j7 < len && str.charCodeAt(j7) !== 59 && j7 - i6 <= 32) { + j7++; + } + if (j7 >= len || str.charCodeAt(j7) !== 59) { + i6++; + continue; + } + const token = str.slice(i6 + 1, j7); + if (token.length === 0) { + i6++; + continue; + } + let replacement; + let tier2; + if (this._removeSet.has(token)) { + replacement = ""; + if (tier2 === void 0) { + tier2 = LIMIT_TIER_EXTERNAL2; + } + } else if (this._leaveSet.has(token)) { + i6++; + continue; + } else if (token.charCodeAt(0) === 35) { + const ncrResult = this._resolveNCR(token); + if (ncrResult === void 0) { + i6++; + continue; + } + replacement = ncrResult; + tier2 = LIMIT_TIER_BASE2; + } else { + const resolved = this._resolveName(token); + replacement = resolved?.value; + tier2 = resolved?.tier; + } + if (replacement === void 0) { + i6++; + continue; + } + if (i6 > last) { + chunks.push(str.slice(last, i6)); + } + chunks.push(replacement); + last = j7 + 1; + i6 = last; + if (checkLimits && this._tierCounts(tier2)) { + 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(tier2) { + if (this._limitTiers.has(LIMIT_TIER_ALL2)) { + return true; } + return this._limitTiers.has(tier2); } - return ["md/nodejs", versions.node]; - }; - } -}); - -// node_modules/@aws-sdk/util-user-agent-node/dist-es/getNodeModulesParentDirs.js -import { normalize as normalize3, sep as sep6 } from "path"; -var getNodeModulesParentDirs; -var init_getNodeModulesParentDirs = __esm({ - "node_modules/@aws-sdk/util-user-agent-node/dist-es/getNodeModulesParentDirs.js"() { - "use strict"; - getNodeModulesParentDirs = (dirname3) => { - const cwd = process.cwd(); - if (!dirname3) { - return [cwd]; + _resolveName(name) { + if (name in this._inputMap) { + return { value: this._inputMap[name], tier: LIMIT_TIER_EXTERNAL2 }; + } + if (name in this._externalMap) { + return { value: this._externalMap[name], tier: LIMIT_TIER_EXTERNAL2 }; + } + if (name in this._baseMap) { + return { value: this._baseMap[name], tier: LIMIT_TIER_BASE2 }; + } + return void 0; } - const normalizedPath = normalize3(dirname3); - const parts = normalizedPath.split(sep6); - const nodeModulesIndex = parts.indexOf("node_modules"); - const parentDir = nodeModulesIndex !== -1 ? parts.slice(0, nodeModulesIndex).join(sep6) : normalizedPath; - if (cwd === parentDir) { - return [cwd]; + _classifyNCR(cp) { + if (cp === 0) { + return this._ncrNullLevel; + } + if (cp >= 55296 && cp <= 57343) { + return NCR_LEVEL2.remove; + } + if (this._ncrXmlVersion === 1) { + if (cp >= 1 && cp <= 31 && !XML10_ALLOWED_C02.has(cp)) { + return NCR_LEVEL2.remove; + } + } + return -1; + } + _applyNCRAction(action5, token, cp) { + switch (action5) { + case NCR_LEVEL2.allow: + return String.fromCodePoint(cp); + case NCR_LEVEL2.remove: + return ""; + case NCR_LEVEL2.leave: + return void 0; + case NCR_LEVEL2.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_LEVEL2.remove) { + return void 0; + } + const effective = minimum === -1 ? this._ncrOnLevel : Math.max(this._ncrOnLevel, minimum); + return this._applyNCRAction(effective, token, cp); } - return [parentDir, cwd]; }; } }); -// node_modules/@aws-sdk/util-user-agent-node/dist-es/getSanitizedTypeScriptVersion.js -var SEMVER_REGEX, getSanitizedTypeScriptVersion; -var init_getSanitizedTypeScriptVersion = __esm({ - "node_modules/@aws-sdk/util-user-agent-node/dist-es/getSanitizedTypeScriptVersion.js"() { +// node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js +function parseXML2(xmlString) { + return parser2.parse(xmlString, true); +} +var entityDecoder, parser2; +var init_xml_parser = __esm({ + "node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js"() { "use strict"; - 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-]+)*)?$/; - getSanitizedTypeScriptVersion = (version3 = "") => { - const match3 = version3.match(SEMVER_REGEX); - if (!match3) { - return void 0; + init_fxp(); + init_nodable_entities(); + entityDecoder = new EntityDecoderImpl({ + namedEntities: { ...XML2, ...COMMON_HTML2, ...CURRENCY2 }, + numericAllowed: true, + limit: { + maxTotalExpansions: Infinity + }, + ncr: { + xmlVersion: 1.1 } - const [major, minor, patch, prerelease] = [match3[1], match3[2], match3[3], match3[4]]; - return prerelease ? `${major}.${minor}.${patch}-${prerelease}` : `${major}.${minor}.${patch}`; - }; + }); + parser2 = new 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: (version3) => void {} + }, + ignoreAttributes: false, + ignoreDeclaration: true, + parseTagValue: false, + trimValues: false, + tagValueProcessor: (_3, val) => val.trim() === "" && val.includes("\n") ? "" : void 0, + maxNestedTags: Infinity + }); } }); -// node_modules/@aws-sdk/util-user-agent-node/dist-es/getSanitizedDevTypeScriptVersion.js -var ALLOWED_PREFIXES, ALLOWED_DIST_TAGS, getSanitizedDevTypeScriptVersion; -var init_getSanitizedDevTypeScriptVersion = __esm({ - "node_modules/@aws-sdk/util-user-agent-node/dist-es/getSanitizedDevTypeScriptVersion.js"() { +// node_modules/@aws-sdk/xml-builder/dist-es/index.js +var init_dist_es13 = __esm({ + "node_modules/@aws-sdk/xml-builder/dist-es/index.js"() { "use strict"; - init_getSanitizedTypeScriptVersion(); - ALLOWED_PREFIXES = ["^", "~", ">=", "<=", ">", "<"]; - ALLOWED_DIST_TAGS = ["latest", "beta", "dev", "rc", "insiders", "next"]; - getSanitizedDevTypeScriptVersion = (version3 = "") => { - if (ALLOWED_DIST_TAGS.includes(version3)) { - return version3; - } - const prefix2 = ALLOWED_PREFIXES.find((p6) => version3.startsWith(p6)) ?? ""; - const sanitizedTypeScriptVersion = getSanitizedTypeScriptVersion(version3.slice(prefix2.length)); - if (!sanitizedTypeScriptVersion) { - return void 0; - } - return `${prefix2}${sanitizedTypeScriptVersion}`; - }; + init_XmlNode(); + init_XmlText(); + init_xml_parser(); } }); -// node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptUserAgentPair.js -import { readFile as readFile3 } from "fs/promises"; -import { join as join8 } from "path"; -var tscVersion, TS_PACKAGE_JSON, getTypeScriptUserAgentPair; -var init_getTypeScriptUserAgentPair = __esm({ - "node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptUserAgentPair.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js +var XmlShapeDeserializer; +var init_XmlShapeDeserializer = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js"() { "use strict"; - init_dist_es39(); - init_getNodeModulesParentDirs(); - init_getSanitizedDevTypeScriptVersion(); - init_getSanitizedTypeScriptVersion(); - TS_PACKAGE_JSON = join8("node_modules", "typescript", "package.json"); - getTypeScriptUserAgentPair = async () => { - if (tscVersion === null) { - return void 0; - } else if (typeof tscVersion === "string") { - return ["md/tsc", tscVersion]; - } - let isTypeScriptDetectionDisabled = false; - try { - isTypeScriptDetectionDisabled = booleanSelector(process.env, "AWS_SDK_JS_TYPESCRIPT_DETECTION_DISABLED", SelectorType.ENV) || false; - } catch { + init_dist_es13(); + init_client3(); + init_protocols(); + init_schema2(); + init_serde2(); + init_ConfigurableSerdeContext(); + init_UnionSerde(); + XmlShapeDeserializer = class extends SerdeContextConfig { + settings; + stringDeserializer; + constructor(settings) { + super(); + this.settings = settings; + this.stringDeserializer = new FromStringShapeDeserializer(settings); } - if (isTypeScriptDetectionDisabled) { - tscVersion = null; - return void 0; + setSerdeContext(serdeContext) { + this.serdeContext = serdeContext; + this.stringDeserializer.setSerdeContext(serdeContext); } - const dirname3 = typeof __dirname !== "undefined" ? __dirname : void 0; - const nodeModulesParentDirs = getNodeModulesParentDirs(dirname3); - let versionFromApp; - for (const nodeModulesParentDir of nodeModulesParentDirs) { - try { - const appPackageJsonPath = join8(nodeModulesParentDir, "package.json"); - const packageJson = await readFile3(appPackageJsonPath, "utf-8"); - const { dependencies, devDependencies } = JSON.parse(packageJson); - const version3 = devDependencies?.typescript ?? dependencies?.typescript; - if (typeof version3 !== "string") { - continue; + read(schema, bytes, key) { + const ns2 = NormalizedSchema.of(schema); + const memberSchemas = ns2.getMemberSchemas(); + const isEventPayload = ns2.isStructSchema() && ns2.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); } - versionFromApp = version3; - break; - } catch { + return output; } + const xmlString = (this.serdeContext?.utf8Encoder ?? toUtf8)(bytes); + const parsedObject = this.parseXml(xmlString); + return this.readSchema(schema, key ? parsedObject[key] : parsedObject); } - if (!versionFromApp) { - tscVersion = null; - return void 0; - } - let versionFromNodeModules; - for (const nodeModulesParentDir of nodeModulesParentDirs) { - try { - const tsPackageJsonPath = join8(nodeModulesParentDir, TS_PACKAGE_JSON); - const packageJson = await readFile3(tsPackageJsonPath, "utf-8"); - const { version: version3 } = JSON.parse(packageJson); - const sanitizedVersion2 = getSanitizedTypeScriptVersion(version3); - if (typeof sanitizedVersion2 !== "string") { - continue; + readSchema(_schema, value) { + const ns2 = NormalizedSchema.of(_schema); + if (ns2.isUnitSchema()) { + return; + } + const traits = ns2.getMergedTraits(); + if (ns2.isListSchema() && !Array.isArray(value)) { + return this.readSchema(ns2, [value]); + } + if (value == null) { + return value; + } + if (typeof value === "object") { + const flat = !!traits.xmlFlattened; + if (ns2.isListSchema()) { + const listValue = ns2.getValueSchema(); + const buffer3 = []; + const sourceKey = listValue.getMergedTraits().xmlName ?? "member"; + const source = flat ? value : (value[0] ?? value)[sourceKey]; + if (source == null) { + return buffer3; + } + const sourceArray = Array.isArray(source) ? source : [source]; + for (const v2 of sourceArray) { + buffer3.push(this.readSchema(listValue, v2)); + } + return buffer3; } - versionFromNodeModules = sanitizedVersion2; - break; - } catch { + const buffer2 = {}; + if (ns2.isMapSchema()) { + const keyNs = ns2.getKeySchema(); + const memberNs = ns2.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]; + buffer2[key] = this.readSchema(memberNs, value2); + } + return buffer2; + } + if (ns2.isStructSchema()) { + const union = ns2.isUnionSchema(); + let unionSerde; + if (union) { + unionSerde = new UnionSerde(value, buffer2); + } + for (const [memberName, memberSchema] of ns2.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) { + buffer2[memberName] = this.readSchema(memberSchema, value[xmlObjectKey]); + } + } + if (union) { + unionSerde.writeUnknown(); + } + return buffer2; + } + if (ns2.isDocumentSchema()) { + return value; + } + throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${ns2.getName(true)}`); } + if (ns2.isListSchema()) { + return []; + } + if (ns2.isMapSchema() || ns2.isStructSchema()) { + return {}; + } + return this.stringDeserializer.read(ns2, value); } - if (versionFromNodeModules) { - tscVersion = versionFromNodeModules; - return ["md/tsc", tscVersion]; - } - const sanitizedVersion = getSanitizedDevTypeScriptVersion(versionFromApp); - if (typeof sanitizedVersion !== "string") { - tscVersion = null; - return void 0; + parseXml(xml) { + if (xml.length) { + let parsedObj; + try { + parsedObj = parseXML2(xml); + } catch (e6) { + if (e6 && typeof e6 === "object") { + Object.defineProperty(e6, "$responseBodyText", { + value: xml + }); + } + throw e6; + } + const textNodeName = "#text"; + const key = Object.keys(parsedObj)[0]; + const parsedObjToReturn = parsedObj[key]; + if (parsedObjToReturn[textNodeName]) { + parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; + delete parsedObjToReturn[textNodeName]; + } + return getValueFromTextNode(parsedObjToReturn); + } + return {}; } - tscVersion = `dev_${sanitizedVersion}`; - return ["md/tsc", tscVersion]; - }; - } -}); - -// node_modules/@aws-sdk/util-user-agent-node/dist-es/crt-availability.js -var crtAvailability; -var init_crt_availability = __esm({ - "node_modules/@aws-sdk/util-user-agent-node/dist-es/crt-availability.js"() { - "use strict"; - crtAvailability = { - isCrtAvailable: false }; } }); -// node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js -var isCrtAvailable; -var init_is_crt_available = __esm({ - "node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js +var QueryShapeSerializer; +var init_QueryShapeSerializer = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js"() { "use strict"; - init_crt_availability(); - isCrtAvailable = () => { - if (crtAvailability.isCrtAvailable) { - return ["md/crt-avail"]; + init_protocols(); + init_schema2(); + init_serde2(); + init_serde2(); + init_ConfigurableSerdeContext(); + QueryShapeSerializer = class extends SerdeContextConfig { + settings; + buffer; + constructor(settings) { + super(); + this.settings = settings; } - return null; - }; - } -}); - -// node_modules/@aws-sdk/util-user-agent-node/dist-es/defaultUserAgent.js -import { platform as platform2, release } from "os"; -import { env } from "process"; -var createDefaultUserAgentProvider; -var init_defaultUserAgent = __esm({ - "node_modules/@aws-sdk/util-user-agent-node/dist-es/defaultUserAgent.js"() { - "use strict"; - init_getRuntimeUserAgentPair(); - init_getTypeScriptUserAgentPair(); - init_is_crt_available(); - createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => { - const runtimeUserAgentPair = getRuntimeUserAgentPair(); - return async (config) => { - const sections = [ - ["aws-sdk-js", clientVersion], - ["ua", "2.1"], - [`os/${platform2()}`, release()], - ["lang/js"], - runtimeUserAgentPair - ]; - const typescriptUserAgentPair = await getTypeScriptUserAgentPair(); - if (typescriptUserAgentPair) { - sections.push(typescriptUserAgentPair); + write(schema, value, prefix2 = "") { + if (this.buffer === void 0) { + this.buffer = ""; } - const crtAvailable = isCrtAvailable(); - if (crtAvailable) { - sections.push(crtAvailable); + const ns2 = NormalizedSchema.of(schema); + if (prefix2 && !prefix2.endsWith(".")) { + prefix2 += "."; } - if (serviceId) { - sections.push([`api/${serviceId}`, clientVersion]); + if (ns2.isBlobSchema()) { + if (typeof value === "string" || value instanceof Uint8Array) { + this.writeKey(prefix2); + this.writeValue((this.serdeContext?.base64Encoder ?? toBase64)(value)); + } + } else if (ns2.isBooleanSchema() || ns2.isNumericSchema() || ns2.isStringSchema()) { + if (value != null) { + this.writeKey(prefix2); + this.writeValue(String(value)); + } else if (ns2.isIdempotencyToken()) { + this.writeKey(prefix2); + this.writeValue(generateIdempotencyToken()); + } + } else if (ns2.isBigIntegerSchema()) { + if (value != null) { + this.writeKey(prefix2); + this.writeValue(String(value)); + } + } else if (ns2.isBigDecimalSchema()) { + if (value != null) { + this.writeKey(prefix2); + this.writeValue(value instanceof NumericValue ? value.string : String(value)); + } + } else if (ns2.isTimestampSchema()) { + if (value instanceof Date) { + this.writeKey(prefix2); + const format4 = determineTimestampFormat(ns2, this.settings); + switch (format4) { + case 5: + this.writeValue(value.toISOString().replace(".000Z", "Z")); + break; + case 6: + this.writeValue(dateToUtcString(value)); + break; + case 7: + this.writeValue(String(value.getTime() / 1e3)); + break; + } + } + } else if (ns2.isDocumentSchema()) { + if (Array.isArray(value)) { + this.write(64 | 15, value, prefix2); + } else if (value instanceof Date) { + this.write(4, value, prefix2); + } else if (value instanceof Uint8Array) { + this.write(21, value, prefix2); + } else if (value && typeof value === "object") { + this.write(128 | 15, value, prefix2); + } else { + this.writeKey(prefix2); + this.writeValue(String(value)); + } + } else if (ns2.isListSchema()) { + if (Array.isArray(value)) { + if (value.length === 0) { + if (this.settings.serializeEmptyLists) { + this.writeKey(prefix2); + this.writeValue(""); + } + } else { + const member2 = ns2.getValueSchema(); + const flat = this.settings.flattenLists || ns2.getMergedTraits().xmlFlattened; + let i6 = 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 ? `${prefix2}${i6}` : `${prefix2}${suffix}.${i6}`; + this.write(member2, item, key); + ++i6; + } + } + } + } else if (ns2.isMapSchema()) { + if (value && typeof value === "object") { + const keySchema = ns2.getKeySchema(); + const memberSchema = ns2.getValueSchema(); + const flat = ns2.getMergedTraits().xmlFlattened; + let i6 = 1; + for (const k7 in value) { + const v2 = value[k7]; + if (v2 == null) { + continue; + } + const keyTraits = keySchema.getMergedTraits(); + const keySuffix = this.getKey("key", keyTraits.xmlName, keyTraits.ec2QueryName); + const key = flat ? `${prefix2}${i6}.${keySuffix}` : `${prefix2}entry.${i6}.${keySuffix}`; + const valTraits = memberSchema.getMergedTraits(); + const valueSuffix = this.getKey("value", valTraits.xmlName, valTraits.ec2QueryName); + const valueKey = flat ? `${prefix2}${i6}.${valueSuffix}` : `${prefix2}entry.${i6}.${valueSuffix}`; + this.write(keySchema, k7, key); + this.write(memberSchema, v2, valueKey); + ++i6; + } + } + } else if (ns2.isStructSchema()) { + if (value && typeof value === "object") { + let didWriteMember = false; + for (const [memberName, member2] of ns2.structIterator()) { + if (value[memberName] == null && !member2.isIdempotencyToken()) { + continue; + } + const traits = member2.getMergedTraits(); + const suffix = this.getKey(memberName, traits.xmlName, traits.ec2QueryName, "struct"); + const key = `${prefix2}${suffix}`; + this.write(member2, value[memberName], key); + didWriteMember = true; + } + if (!didWriteMember && ns2.isUnionSchema()) { + const { $unknown } = value; + if (Array.isArray($unknown)) { + const [k7, v2] = $unknown; + const key = `${prefix2}${k7}`; + this.write(15, v2, key); + } + } + } + } else if (ns2.isUnitSchema()) { + } else { + throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${ns2.getName(true)}`); } - if (env.AWS_EXECUTION_ENV) { - sections.push([`exec-env/${env.AWS_EXECUTION_ENV}`]); + } + flush() { + if (this.buffer === void 0) { + throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer."); } - const appId = await config?.userAgentAppId?.(); - const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections]; - return resolvedUserAgent; - }; + 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/util-user-agent-node/dist-es/nodeAppIdConfigOptions.js -var UA_APP_ID_ENV_NAME, UA_APP_ID_INI_NAME, UA_APP_ID_INI_NAME_DEPRECATED, NODE_APP_ID_CONFIG_OPTIONS; -var init_nodeAppIdConfigOptions = __esm({ - "node_modules/@aws-sdk/util-user-agent-node/dist-es/nodeAppIdConfigOptions.js"() { +// 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"() { "use strict"; - init_dist_es32(); - UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; - UA_APP_ID_INI_NAME = "sdk_ua_app_id"; - UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id"; - NODE_APP_ID_CONFIG_OPTIONS = { - environmentVariableSelector: (env2) => env2[UA_APP_ID_ENV_NAME], - configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED], - default: DEFAULT_UA_APP_ID + init_protocols(); + init_schema2(); + 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, context5) { + const request2 = await super.serializeRequest(operationSchema, input, context5); + if (!request2.path.endsWith("/")) { + request2.path += "/"; + } + request2.headers["content-type"] = "application/x-www-form-urlencoded"; + if (deref(operationSchema.input) === "unit" || !request2.body) { + request2.body = ""; + } + const action5 = operationSchema.name.split("#")[1] ?? operationSchema.name; + request2.body = `Action=${action5}&Version=${this.options.version}` + request2.body; + if (request2.body.endsWith("&")) { + request2.body = request2.body.slice(-1); + } + return request2; + } + async deserializeResponse(operationSchema, context5, response) { + const deserializer = this.deserializer; + const ns2 = NormalizedSchema.of(operationSchema.output); + const dataObject = {}; + if (response.statusCode >= 300) { + const bytes2 = await collectBody(response.body, context5); + if (bytes2.byteLength > 0) { + Object.assign(dataObject, await deserializer.read(15, bytes2)); + } + await this.handleError(operationSchema, context5, 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 = ns2.isStructSchema() && this.useNestedResult() ? shortName + "Result" : void 0; + const bytes = await collectBody(response.body, context5); + if (bytes.byteLength > 0) { + Object.assign(dataObject, await deserializer.read(ns2, bytes, awsQueryResultKey)); + } + dataObject.$metadata = this.deserializeMetadata(response); + return dataObject; + } + useNestedResult() { + return true; + } + async handleError(operationSchema, context5, response, dataObject, metadata2) { + 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, metadata2, this.mixin.findQueryCompatibleError); + const ns2 = NormalizedSchema.of(errorSchema); + const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error; + const exception = new ErrorCtor({}); + const output = { + Type: errorData.Error.Type, + Code: errorData.Error.Code, + Error: errorData.Error + }; + for (const [name, member2] of ns2.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: ns2.getMergedTraits().error, + message + }, output), dataObject); + } + loadQueryErrorCode(output, data) { + const code = (data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error)?.Code; + if (code !== void 0) { + return code; + } + if (output.statusCode == 404) { + return "NotFound"; + } + } + loadQueryError(data) { + return data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error; + } + loadQueryErrorMessage(data) { + const errorData = this.loadQueryError(data); + return errorData?.message ?? errorData?.Message ?? data.message ?? data.Message ?? "Unknown"; + } + getDefaultContentType() { + return "application/x-www-form-urlencoded"; + } }; } }); -// node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js -var init_dist_es51 = __esm({ - "node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js +var init_AwsEc2QueryProtocol = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js"() { "use strict"; - init_defaultUserAgent(); - init_nodeAppIdConfigOptions(); } }); -// node_modules/@smithy/hash-node/dist-es/index.js -import { Buffer as Buffer6 } from "buffer"; -import { createHash as createHash5, createHmac as createHmac5 } from "crypto"; -function castSourceData(toCast, encoding) { - if (Buffer6.isBuffer(toCast)) { - return toCast; - } - if (typeof toCast === "string") { - return fromString(toCast, encoding); - } - if (ArrayBuffer.isView(toCast)) { - return fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength); - } - return fromArrayBuffer(toCast); -} -var Hash; -var init_dist_es52 = __esm({ - "node_modules/@smithy/hash-node/dist-es/index.js"() { +// 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"() { "use strict"; - init_dist_es9(); - init_dist_es10(); - Hash = class { - algorithmIdentifier; - secret; - hash; - constructor(algorithmIdentifier, secret) { - this.algorithmIdentifier = algorithmIdentifier; - this.secret = secret; - this.reset(); - } - update(toHash, encoding) { - this.hash.update(toUint8Array(castSourceData(toHash, encoding))); - } - digest() { - return Promise.resolve(this.hash.digest()); - } - reset() { - this.hash = this.secret ? createHmac5(this.algorithmIdentifier, castSourceData(this.secret)) : createHash5(this.algorithmIdentifier); - } - }; } }); -// node_modules/@smithy/util-body-length-node/dist-es/calculateBodyLength.js -import { fstatSync, lstatSync as lstatSync3, ReadStream } from "fs"; -var calculateBodyLength; -var init_calculateBodyLength = __esm({ - "node_modules/@smithy/util-body-length-node/dist-es/calculateBodyLength.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js +var init_parseXmlBody = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js"() { "use strict"; - calculateBodyLength = (body2) => { - if (!body2) { - return 0; - } - if (typeof body2 === "string") { - return Buffer.byteLength(body2); - } else if (typeof body2.byteLength === "number") { - return body2.byteLength; - } else if (typeof body2.size === "number") { - return body2.size; - } else if (typeof body2.start === "number" && typeof body2.end === "number") { - return body2.end + 1 - body2.start; - } else if (body2 instanceof ReadStream) { - if (body2.path != null) { - return lstatSync3(body2.path).size; - } else if (typeof body2.fd === "number") { - return fstatSync(body2.fd).size; - } - } - throw new Error(`Body Length computation failed for ${body2}`); - }; } }); -// node_modules/@smithy/util-body-length-node/dist-es/index.js -var init_dist_es53 = __esm({ - "node_modules/@smithy/util-body-length-node/dist-es/index.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js +var init_XmlShapeSerializer = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js"() { "use strict"; - init_calculateBodyLength(); } }); -// node_modules/@smithy/util-defaults-mode-node/dist-es/constants.js -var AWS_EXECUTION_ENV, AWS_REGION_ENV, AWS_DEFAULT_REGION_ENV, ENV_IMDS_DISABLED2, DEFAULTS_MODE_OPTIONS, IMDS_REGION_PATH; -var init_constants9 = __esm({ - "node_modules/@smithy/util-defaults-mode-node/dist-es/constants.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlCodec.js +var init_XmlCodec = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlCodec.js"() { "use strict"; - AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; - AWS_REGION_ENV = "AWS_REGION"; - AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; - ENV_IMDS_DISABLED2 = "AWS_EC2_METADATA_DISABLED"; - DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; - IMDS_REGION_PATH = "/latest/meta-data/placement/region"; } }); -// node_modules/@smithy/util-defaults-mode-node/dist-es/defaultsModeConfig.js -var AWS_DEFAULTS_MODE_ENV, AWS_DEFAULTS_MODE_CONFIG, NODE_DEFAULTS_MODE_CONFIG_OPTIONS; -var init_defaultsModeConfig = __esm({ - "node_modules/@smithy/util-defaults-mode-node/dist-es/defaultsModeConfig.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +var init_AwsRestXmlProtocol = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js"() { "use strict"; - AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE"; - AWS_DEFAULTS_MODE_CONFIG = "defaults_mode"; - NODE_DEFAULTS_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env2) => { - return env2[AWS_DEFAULTS_MODE_ENV]; - }, - configFileSelector: (profile) => { - return profile[AWS_DEFAULTS_MODE_CONFIG]; - }, - default: "legacy" - }; } }); -// node_modules/@smithy/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js -var resolveDefaultsModeConfig, resolveNodeDefaultsModeAuto, inferPhysicalRegion; -var init_resolveDefaultsModeConfig = __esm({ - "node_modules/@smithy/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js"() { +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +var init_protocols2 = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js"() { "use strict"; - init_dist_es40(); - init_dist_es44(); - init_dist_es24(); - init_constants9(); - init_defaultsModeConfig(); - resolveDefaultsModeConfig = ({ region = loadConfig(NODE_REGION_CONFIG_OPTIONS), defaultsMode = loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS) } = {}) => memoize2(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}`); - } - }); - 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"; - }; - 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_DISABLED2]) { - try { - const { getInstanceMetadataEndpoint: getInstanceMetadataEndpoint2, httpRequest: httpRequest2 } = await Promise.resolve().then(() => (init_dist_es49(), dist_es_exports2)); - const endpoint2 = await getInstanceMetadataEndpoint2(); - return (await httpRequest2({ ...endpoint2, path: IMDS_REGION_PATH })).toString(); - } catch (e6) { - } - } - }; + 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/@smithy/util-defaults-mode-node/dist-es/index.js -var init_dist_es54 = __esm({ - "node_modules/@smithy/util-defaults-mode-node/dist-es/index.js"() { +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/bdd.js +var k2, a, b, c, d, e, f, g, h, i, j2, _data, root, r, nodes, bdd; +var init_bdd = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/bdd.js"() { "use strict"; - init_resolveDefaultsModeConfig(); - } -}); - -// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/ruleset.js -var u, v2, w, x2, a, b, c, d, e, f, g, h, i, j2, k2, l, m, n7, o, p, q2, r, s, t, _data, ruleSet; -var init_ruleset = __esm({ - "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/ruleset.js"() { - "use strict"; - u = "required"; - v2 = "fn"; - w = "argv"; - x2 = "ref"; - a = true; - b = "isSet"; - c = "booleanEquals"; - d = "error"; - e = "endpoint"; - f = "tree"; - g = "PartitionResult"; - h = "getAttr"; - i = { [u]: false, type: "string" }; - j2 = { [u]: true, default: false, type: "boolean" }; - k2 = { [x2]: "Endpoint" }; - l = { [v2]: c, [w]: [{ [x2]: "UseFIPS" }, true] }; - m = { [v2]: c, [w]: [{ [x2]: "UseDualStack" }, true] }; - n7 = {}; - o = { [v2]: h, [w]: [{ [x2]: g }, "supportsFIPS"] }; - p = { [x2]: g }; - q2 = { [v2]: c, [w]: [true, { [v2]: h, [w]: [p, "supportsDualStack"] }] }; - r = [l]; - s = [m]; - t = [{ [x2]: "Region" }]; + init_endpoints3(); + k2 = "ref"; + a = -1; + b = true; + c = "isSet"; + d = "PartitionResult"; + e = "booleanEquals"; + f = "getAttr"; + g = { [k2]: "Endpoint" }; + h = { [k2]: d }; + i = {}; + j2 = [{ [k2]: "Region" }]; _data = { - version: "1.0", - parameters: { Region: i, UseDualStack: j2, UseFIPS: j2, Endpoint: i }, - rules: [ - { - conditions: [{ [v2]: b, [w]: [k2] }], - rules: [ - { conditions: r, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, - { conditions: s, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, - { endpoint: { url: k2, properties: n7, headers: n7 }, type: e } - ], - type: f - }, - { - conditions: [{ [v2]: b, [w]: t }], - rules: [ - { - conditions: [{ [v2]: "aws.partition", [w]: t, assign: g }], - rules: [ - { - conditions: [l, m], - rules: [ - { - conditions: [{ [v2]: c, [w]: [a, o] }, q2], - rules: [ - { - endpoint: { - url: "https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - properties: n7, - headers: n7 - }, - type: e - } - ], - type: f - }, - { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d } - ], - type: f - }, - { - conditions: r, - rules: [ - { - conditions: [{ [v2]: c, [w]: [o, a] }], - rules: [ - { - conditions: [{ [v2]: "stringEquals", [w]: [{ [v2]: h, [w]: [p, "name"] }, "aws-us-gov"] }], - endpoint: { url: "https://oidc.{Region}.amazonaws.com", properties: n7, headers: n7 }, - type: e - }, - { - endpoint: { - url: "https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", - properties: n7, - headers: n7 - }, - type: e - } - ], - type: f - }, - { error: "FIPS is enabled but this partition does not support FIPS", type: d } - ], - type: f - }, - { - conditions: s, - rules: [ - { - conditions: [q2], - rules: [ - { - endpoint: { - url: "https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", - properties: n7, - headers: n7 - }, - type: e - } - ], - type: f - }, - { error: "DualStack is enabled but this partition does not support DualStack", type: d } - ], - type: f - }, - { - endpoint: { url: "https://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: n7, headers: n7 }, - type: e - } - ], - type: f - } - ], - type: f - }, - { error: "Invalid Configuration: Missing Region", type: d } + conditions: [ + [c, [g]], + [c, j2], + ["aws.partition", j2, d], + [e, [{ [k2]: "UseFIPS" }, b]], + [e, [{ [k2]: "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"] ] }; - ruleSet = _data; + 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 = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results); } }); @@ -134275,15 +138789,15 @@ var cache, defaultEndpointResolver; var init_endpointResolver = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/endpointResolver.js"() { "use strict"; - init_dist_es23(); - init_dist_es22(); - init_ruleset(); + init_client4(); + init_endpoints3(); + init_bdd(); cache = new EndpointCache({ size: 50, params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] }); defaultEndpointResolver = (endpointParams, context5 = {}) => { - return cache.get(endpointParams, () => resolveEndpoint(ruleSet, { + return cache.get(endpointParams, () => decideEndpoint(bdd, { endpointParams, logger: context5.logger })); @@ -134297,7 +138811,7 @@ var SSOOIDCServiceException; var init_SSOOIDCServiceException = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/SSOOIDCServiceException.js"() { "use strict"; - init_dist_es27(); + init_client3(); SSOOIDCServiceException = class _SSOOIDCServiceException extends ServiceException { constructor(options) { super(options); @@ -134497,7 +139011,7 @@ var init_errors = __esm({ }); // 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, _e2, _eI, _ed, _gT, _h, _hE, _iT, _r, _rT, _rU, _s2, _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 _ADE, _APE, _AT, _CS, _CT, _CTR, _CTRr, _CV, _ETE, _ICE, _IGE, _IRE, _ISE, _ISEn, _IT, _RT, _SDE, _UCE, _UGTE, _aT, _c2, _cI, _cS, _cV, _co, _dC, _e2, _eI, _ed, _gT, _h, _hE, _iT, _r, _rT, _rU, _s2, _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"() { "use strict"; @@ -134524,7 +139038,7 @@ var init_schemas_0 = __esm({ _UCE = "UnauthorizedClientException"; _UGTE = "UnsupportedGrantTypeException"; _aT = "accessToken"; - _c = "client"; + _c2 = "client"; _cI = "clientId"; _cS = "clientSecret"; _cV = "codeVerifier"; @@ -134553,7 +139067,7 @@ var init_schemas_0 = __esm({ -3, n0, _ADE, - { [_e2]: _c, [_hE]: 400 }, + { [_e2]: _c2, [_hE]: 400 }, [_e2, _r, _ed], [0, 0, 0] ]; @@ -134562,37 +139076,79 @@ var init_schemas_0 = __esm({ -3, n0, _APE, - { [_e2]: _c, [_hE]: 400 }, + { [_e2]: _c2, [_hE]: 400 }, [_e2, _ed], [0, 0] ]; n0_registry.registerError(AuthorizationPendingException$, AuthorizationPendingException); - ExpiredTokenException$ = [-3, n0, _ETE, { [_e2]: _c, [_hE]: 400 }, [_e2, _ed], [0, 0]]; + ExpiredTokenException$ = [ + -3, + n0, + _ETE, + { [_e2]: _c2, [_hE]: 400 }, + [_e2, _ed], + [0, 0] + ]; n0_registry.registerError(ExpiredTokenException$, ExpiredTokenException); - InternalServerException$ = [-3, n0, _ISE, { [_e2]: _se, [_hE]: 500 }, [_e2, _ed], [0, 0]]; + InternalServerException$ = [ + -3, + n0, + _ISE, + { [_e2]: _se, [_hE]: 500 }, + [_e2, _ed], + [0, 0] + ]; n0_registry.registerError(InternalServerException$, InternalServerException); - InvalidClientException$ = [-3, n0, _ICE, { [_e2]: _c, [_hE]: 401 }, [_e2, _ed], [0, 0]]; + InvalidClientException$ = [ + -3, + n0, + _ICE, + { [_e2]: _c2, [_hE]: 401 }, + [_e2, _ed], + [0, 0] + ]; n0_registry.registerError(InvalidClientException$, InvalidClientException); - InvalidGrantException$ = [-3, n0, _IGE, { [_e2]: _c, [_hE]: 400 }, [_e2, _ed], [0, 0]]; + InvalidGrantException$ = [ + -3, + n0, + _IGE, + { [_e2]: _c2, [_hE]: 400 }, + [_e2, _ed], + [0, 0] + ]; n0_registry.registerError(InvalidGrantException$, InvalidGrantException); InvalidRequestException$ = [ -3, n0, _IRE, - { [_e2]: _c, [_hE]: 400 }, + { [_e2]: _c2, [_hE]: 400 }, [_e2, _r, _ed], [0, 0, 0] ]; n0_registry.registerError(InvalidRequestException$, InvalidRequestException); - InvalidScopeException$ = [-3, n0, _ISEn, { [_e2]: _c, [_hE]: 400 }, [_e2, _ed], [0, 0]]; + InvalidScopeException$ = [ + -3, + n0, + _ISEn, + { [_e2]: _c2, [_hE]: 400 }, + [_e2, _ed], + [0, 0] + ]; n0_registry.registerError(InvalidScopeException$, InvalidScopeException); - SlowDownException$ = [-3, n0, _SDE, { [_e2]: _c, [_hE]: 400 }, [_e2, _ed], [0, 0]]; + SlowDownException$ = [ + -3, + n0, + _SDE, + { [_e2]: _c2, [_hE]: 400 }, + [_e2, _ed], + [0, 0] + ]; n0_registry.registerError(SlowDownException$, SlowDownException); UnauthorizedClientException$ = [ -3, n0, _UCE, - { [_e2]: _c, [_hE]: 400 }, + { [_e2]: _c2, [_hE]: 400 }, [_e2, _ed], [0, 0] ]; @@ -134601,12 +139157,15 @@ var init_schemas_0 = __esm({ -3, n0, _UGTE, - { [_e2]: _c, [_hE]: 400 }, + { [_e2]: _c2, [_hE]: 400 }, [_e2, _ed], [0, 0] ]; n0_registry.registerError(UnsupportedGrantTypeException$, UnsupportedGrantTypeException); - errorTypeRegistries = [_s_registry, n0_registry]; + errorTypeRegistries = [ + _s_registry, + n0_registry + ]; AccessToken = [0, n0, _AT, 8, 0]; ClientSecret = [0, n0, _CS, 8, 0]; CodeVerifier = [0, n0, _CV, 8, 0]; @@ -134646,13 +139205,12 @@ var getRuntimeConfig; var init_runtimeConfig_shared = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.shared.js"() { "use strict"; - init_dist_es29(); + init_httpAuthSchemes2(); init_protocols2(); - init_dist_es21(); - init_dist_es27(); - init_dist_es19(); - init_dist_es11(); - init_dist_es10(); + init_dist_es5(); + init_client3(); + init_protocols(); + init_serde2(); init_httpAuthSchemeProvider2(); init_endpointResolver(); init_schemas_0(); @@ -134700,17 +139258,13 @@ var init_runtimeConfig = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js"() { "use strict"; init_package2(); - init_dist_es29(); - init_dist_es51(); - init_dist_es40(); - init_dist_es52(); - init_dist_es47(); - init_dist_es44(); - init_dist_es14(); - init_dist_es27(); - init_dist_es53(); - init_dist_es54(); - init_dist_es31(); + init_client4(); + init_httpAuthSchemes2(); + init_client3(); + init_config3(); + init_retry3(); + init_serde2(); + init_dist_es11(); init_runtimeConfig_shared(); getRuntimeConfig2 = (config) => { emitWarningIfUnsupportedVersion2(process.version); @@ -134738,7 +139292,7 @@ var init_runtimeConfig = __esm({ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE }, config), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, + streamCollector: config?.streamCollector ?? streamCollector3, useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) @@ -134747,70 +139301,6 @@ var init_runtimeConfig = __esm({ } }); -// node_modules/@aws-sdk/region-config-resolver/dist-es/extensions/index.js -var getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration; -var init_extensions4 = __esm({ - "node_modules/@aws-sdk/region-config-resolver/dist-es/extensions/index.js"() { - "use strict"; - getAwsRegionExtensionConfiguration = (runtimeConfig) => { - return { - setRegion(region) { - runtimeConfig.region = region; - }, - region() { - return runtimeConfig.region; - } - }; - }; - resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) => { - return { - region: awsRegionExtensionConfiguration.region() - }; - }; - } -}); - -// node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/awsRegionConfig.js -var init_awsRegionConfig = __esm({ - "node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/awsRegionConfig.js"() { - "use strict"; - } -}); - -// node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/stsRegionDefaultResolver.js -function stsRegionDefaultResolver(loaderConfig = {}) { - return loadConfig({ - ...NODE_REGION_CONFIG_OPTIONS, - async default() { - if (!warning2.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"; - } - }, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }); -} -var warning2; -var init_stsRegionDefaultResolver = __esm({ - "node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/stsRegionDefaultResolver.js"() { - "use strict"; - init_dist_es40(); - init_dist_es44(); - warning2 = { - silence: false - }; - } -}); - -// node_modules/@aws-sdk/region-config-resolver/dist-es/index.js -var init_dist_es55 = __esm({ - "node_modules/@aws-sdk/region-config-resolver/dist-es/index.js"() { - "use strict"; - init_extensions4(); - init_awsRegionConfig(); - init_stsRegionDefaultResolver(); - } -}); - // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.js var getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig; var init_httpAuthExtensionConfiguration = __esm({ @@ -134861,9 +139351,9 @@ var resolveRuntimeExtensions; var init_runtimeExtensions = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeExtensions.js"() { "use strict"; - init_dist_es55(); - init_dist_es2(); - init_dist_es27(); + init_client4(); + init_client3(); + init_protocols(); init_httpAuthExtensionConfiguration(); resolveRuntimeExtensions = (runtimeConfig, extensions) => { const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig)); @@ -134878,17 +139368,14 @@ var SSOOIDCClient; var init_SSOOIDCClient = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDCClient.js"() { "use strict"; - init_dist_es4(); + init_client4(); init_dist_es5(); - init_dist_es6(); - init_dist_es32(); - init_dist_es40(); - init_dist_es21(); + init_client3(); + init_config3(); + init_endpoints3(); + init_protocols(); + init_retry3(); init_schema2(); - init_dist_es42(); - init_dist_es46(); - init_dist_es47(); - init_dist_es27(); init_httpAuthSchemeProvider2(); init_EndpointParameters2(); init_runtimeConfig(); @@ -134935,11 +139422,11 @@ var CreateTokenCommand; var init_CreateTokenCommand = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/CreateTokenCommand.js"() { "use strict"; - init_dist_es46(); - init_dist_es27(); + init_client3(); + init_endpoints3(); init_EndpointParameters2(); init_schemas_0(); - CreateTokenCommand = class extends Command2.classBuilder().ep(commonParams2).m(function(Command3, cs2, config, o6) { + CreateTokenCommand = class extends Command2.classBuilder().ep(commonParams2).m(function(Command3, cs2, config, o2) { return [getEndpointPlugin(config, Command3.getEndpointParameterInstructions())]; }).s("AWSSSOOIDCService", "CreateToken", {}).n("SSOOIDCClient", "CreateTokenCommand").sc(CreateToken$).build() { }; @@ -134951,7 +139438,7 @@ var commands, SSOOIDC; var init_SSOOIDC = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDC.js"() { "use strict"; - init_dist_es27(); + init_client3(); init_CreateTokenCommand(); init_SSOOIDCClient(); commands = { @@ -135055,11 +139542,11 @@ var init_getSsoOidcClient = __esm({ "use strict"; 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 coalesce2 = (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") + logger: coalesce2("logger"), + userAgentAppId: coalesce2("userAgentAppId") })); return ssoOidcClient; }; @@ -135090,7 +139577,7 @@ var validateTokenExpiry; var init_validateTokenExpiry = __esm({ "node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js"() { "use strict"; - init_dist_es24(); + init_config3(); init_constants8(); validateTokenExpiry = (token) => { if (token.expiration && token.expiration.getTime() < Date.now()) { @@ -135105,7 +139592,7 @@ var validateTokenKey; var init_validateTokenKey = __esm({ "node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js"() { "use strict"; - init_dist_es24(); + init_config3(); init_constants8(); validateTokenKey = (key, value, forRefresh = false) => { if (typeof value === "undefined") { @@ -135117,16 +139604,16 @@ var init_validateTokenKey = __esm({ // node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js import { promises as fsPromises } from "fs"; -var writeFile2, writeSSOTokenToFile; +var writeFile3, writeSSOTokenToFile; var init_writeSSOTokenToFile = __esm({ "node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js"() { "use strict"; - init_dist_es43(); - ({ writeFile: writeFile2 } = fsPromises); + init_config3(); + ({ writeFile: writeFile3 } = fsPromises); writeSSOTokenToFile = (id, ssoToken) => { const tokenFilepath = getSSOTokenFilepath(id); const tokenString = JSON.stringify(ssoToken, null, 2); - return writeFile2(tokenFilepath, tokenString); + return writeFile3(tokenFilepath, tokenString); }; } }); @@ -135136,8 +139623,7 @@ var lastRefreshAttemptTime, fromSso; var init_fromSso = __esm({ "node_modules/@aws-sdk/token-providers/dist-es/fromSso.js"() { "use strict"; - init_dist_es24(); - init_dist_es43(); + init_config3(); init_constants8(); init_getNewSsoOidcToken(); init_validateTokenExpiry(); @@ -135217,7 +139703,7 @@ var init_fromSso = __esm({ }); // node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js -var init_fromStatic3 = __esm({ +var init_fromStatic2 = __esm({ "node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js"() { "use strict"; } @@ -135228,7 +139714,7 @@ var nodeProvider; var init_nodeProvider = __esm({ "node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js"() { "use strict"; - init_dist_es24(); + init_config3(); init_fromSso(); nodeProvider = (init = {}) => memoize2(chain(fromSso(init), async () => { throw new TokenProviderError("Could not load token from any providers", false); @@ -135237,12 +139723,12 @@ var init_nodeProvider = __esm({ }); // node_modules/@aws-sdk/token-providers/dist-es/index.js -var init_dist_es56 = __esm({ +var init_dist_es14 = __esm({ "node_modules/@aws-sdk/token-providers/dist-es/index.js"() { "use strict"; init_fromEnvSigningName(); init_fromSso(); - init_fromStatic3(); + init_fromStatic2(); init_nodeProvider(); } }); @@ -135272,8 +139758,8 @@ var defaultSSOHttpAuthSchemeParametersProvider, defaultSSOHttpAuthSchemeProvider var init_httpAuthSchemeProvider3 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/auth/httpAuthSchemeProvider.js"() { "use strict"; - init_dist_es29(); - init_dist_es7(); + init_httpAuthSchemes2(); + init_client3(); defaultSSOHttpAuthSchemeParametersProvider = async (config, context5, input) => { return { operation: getSmithyContext(context5).operation, @@ -135325,136 +139811,97 @@ var init_EndpointParameters3 = __esm({ } }); -// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/ruleset.js -var u2, v3, w2, x3, a2, b2, c2, d2, e2, f2, g2, h2, i2, j3, k3, l2, m2, n8, o2, p2, q3, r2, s2, t2, _data2, ruleSet2; -var init_ruleset2 = __esm({ - "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/ruleset.js"() { - "use strict"; - u2 = "required"; - v3 = "fn"; - w2 = "argv"; - x3 = "ref"; - a2 = true; - b2 = "isSet"; - c2 = "booleanEquals"; - d2 = "error"; - e2 = "endpoint"; - f2 = "tree"; - g2 = "PartitionResult"; - h2 = "getAttr"; - i2 = { [u2]: false, type: "string" }; - j3 = { [u2]: true, default: false, type: "boolean" }; - k3 = { [x3]: "Endpoint" }; - l2 = { [v3]: c2, [w2]: [{ [x3]: "UseFIPS" }, true] }; - m2 = { [v3]: c2, [w2]: [{ [x3]: "UseDualStack" }, true] }; - n8 = {}; - o2 = { [v3]: h2, [w2]: [{ [x3]: g2 }, "supportsFIPS"] }; - p2 = { [x3]: g2 }; - q3 = { [v3]: c2, [w2]: [true, { [v3]: h2, [w2]: [p2, "supportsDualStack"] }] }; - r2 = [l2]; - s2 = [m2]; - t2 = [{ [x3]: "Region" }]; +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/bdd.js +var k3, a2, b2, c2, d2, e2, f2, g2, h2, i2, j3, _data2, root2, r2, nodes2, bdd2; +var init_bdd2 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/bdd.js"() { + "use strict"; + init_endpoints3(); + k3 = "ref"; + a2 = -1; + b2 = true; + c2 = "isSet"; + d2 = "PartitionResult"; + e2 = "booleanEquals"; + f2 = "getAttr"; + g2 = { [k3]: "Endpoint" }; + h2 = { [k3]: d2 }; + i2 = {}; + j3 = [{ [k3]: "Region" }]; _data2 = { - version: "1.0", - parameters: { Region: i2, UseDualStack: j3, UseFIPS: j3, Endpoint: i2 }, - rules: [ - { - conditions: [{ [v3]: b2, [w2]: [k3] }], - rules: [ - { conditions: r2, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d2 }, - { conditions: s2, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d2 }, - { endpoint: { url: k3, properties: n8, headers: n8 }, type: e2 } - ], - type: f2 - }, - { - conditions: [{ [v3]: b2, [w2]: t2 }], - rules: [ - { - conditions: [{ [v3]: "aws.partition", [w2]: t2, assign: g2 }], - rules: [ - { - conditions: [l2, m2], - rules: [ - { - conditions: [{ [v3]: c2, [w2]: [a2, o2] }, q3], - rules: [ - { - endpoint: { - url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - properties: n8, - headers: n8 - }, - type: e2 - } - ], - type: f2 - }, - { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d2 } - ], - type: f2 - }, - { - conditions: r2, - rules: [ - { - conditions: [{ [v3]: c2, [w2]: [o2, a2] }], - rules: [ - { - conditions: [{ [v3]: "stringEquals", [w2]: [{ [v3]: h2, [w2]: [p2, "name"] }, "aws-us-gov"] }], - endpoint: { url: "https://portal.sso.{Region}.amazonaws.com", properties: n8, headers: n8 }, - type: e2 - }, - { - endpoint: { - url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}", - properties: n8, - headers: n8 - }, - type: e2 - } - ], - type: f2 - }, - { error: "FIPS is enabled but this partition does not support FIPS", type: d2 } - ], - type: f2 - }, - { - conditions: s2, - rules: [ - { - conditions: [q3], - rules: [ - { - endpoint: { - url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}", - properties: n8, - headers: n8 - }, - type: e2 - } - ], - type: f2 - }, - { error: "DualStack is enabled but this partition does not support DualStack", type: d2 } - ], - type: f2 - }, - { - endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}", properties: n8, headers: n8 }, - type: e2 - } - ], - type: f2 - } - ], - type: f2 - }, - { error: "Invalid Configuration: Missing Region", type: d2 } + conditions: [ + [c2, [g2]], + [c2, j3], + ["aws.partition", j3, d2], + [e2, [{ [k3]: "UseFIPS" }, b2]], + [e2, [{ [k3]: "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"] ] }; - ruleSet2 = _data2; + 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 = BinaryDecisionDiagram.from(nodes2, root2, _data2.conditions, _data2.results); } }); @@ -135463,15 +139910,15 @@ var cache2, defaultEndpointResolver2; var init_endpointResolver2 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/endpointResolver.js"() { "use strict"; - init_dist_es23(); - init_dist_es22(); - init_ruleset2(); + init_client4(); + init_endpoints3(); + init_bdd2(); cache2 = new EndpointCache({ size: 50, params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] }); defaultEndpointResolver2 = (endpointParams, context5 = {}) => { - return cache2.get(endpointParams, () => resolveEndpoint(ruleSet2, { + return cache2.get(endpointParams, () => decideEndpoint(bdd2, { endpointParams, logger: context5.logger })); @@ -135485,7 +139932,7 @@ var SSOServiceException; var init_SSOServiceException = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/SSOServiceException.js"() { "use strict"; - init_dist_es27(); + init_client3(); SSOServiceException = class _SSOServiceException extends ServiceException { constructor(options) { super(options); @@ -135553,7 +140000,7 @@ var init_errors2 = __esm({ }); // 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, _e3, _ex, _h2, _hE2, _hH, _hQ, _m, _rC, _rN, _rn, _s3, _sAK, _sT, _xasbt, n02, _s_registry2, SSOServiceException$, n0_registry2, InvalidRequestException$2, ResourceNotFoundException$, TooManyRequestsException$, UnauthorizedException$, errorTypeRegistries2, AccessTokenType, SecretAccessKeyType, SessionTokenType, GetRoleCredentialsRequest$, GetRoleCredentialsResponse$, RoleCredentials$, GetRoleCredentials$; +var _ATT, _GRC, _GRCR, _GRCRe, _IRE2, _RC, _RNFE, _SAKT, _STT, _TMRE, _UE, _aI, _aKI, _aT2, _ai, _c3, _e3, _ex, _h2, _hE2, _hH, _hQ, _m, _rC, _rN, _rn, _s3, _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"() { "use strict"; @@ -135575,7 +140022,7 @@ var init_schemas_02 = __esm({ _aKI = "accessKeyId"; _aT2 = "accessToken"; _ai = "account_id"; - _c2 = "client"; + _c3 = "client"; _e3 = "error"; _ex = "expiration"; _h2 = "http"; @@ -135595,15 +140042,46 @@ var init_schemas_02 = __esm({ SSOServiceException$ = [-3, _s3, "SSOServiceException", 0, [], []]; _s_registry2.registerError(SSOServiceException$, SSOServiceException); n0_registry2 = TypeRegistry.for(n02); - InvalidRequestException$2 = [-3, n02, _IRE2, { [_e3]: _c2, [_hE2]: 400 }, [_m], [0]]; + InvalidRequestException$2 = [ + -3, + n02, + _IRE2, + { [_e3]: _c3, [_hE2]: 400 }, + [_m], + [0] + ]; n0_registry2.registerError(InvalidRequestException$2, InvalidRequestException2); - ResourceNotFoundException$ = [-3, n02, _RNFE, { [_e3]: _c2, [_hE2]: 404 }, [_m], [0]]; + ResourceNotFoundException$ = [ + -3, + n02, + _RNFE, + { [_e3]: _c3, [_hE2]: 404 }, + [_m], + [0] + ]; n0_registry2.registerError(ResourceNotFoundException$, ResourceNotFoundException); - TooManyRequestsException$ = [-3, n02, _TMRE, { [_e3]: _c2, [_hE2]: 429 }, [_m], [0]]; + TooManyRequestsException$ = [ + -3, + n02, + _TMRE, + { [_e3]: _c3, [_hE2]: 429 }, + [_m], + [0] + ]; n0_registry2.registerError(TooManyRequestsException$, TooManyRequestsException); - UnauthorizedException$ = [-3, n02, _UE, { [_e3]: _c2, [_hE2]: 401 }, [_m], [0]]; + UnauthorizedException$ = [ + -3, + n02, + _UE, + { [_e3]: _c3, [_hE2]: 401 }, + [_m], + [0] + ]; n0_registry2.registerError(UnauthorizedException$, UnauthorizedException); - errorTypeRegistries2 = [_s_registry2, n0_registry2]; + errorTypeRegistries2 = [ + _s_registry2, + n0_registry2 + ]; AccessTokenType = [0, n02, _ATT, 8, 0]; SecretAccessKeyType = [0, n02, _SAKT, 8, 0]; SessionTokenType = [0, n02, _STT, 8, 0]; @@ -135613,11 +140091,7 @@ var init_schemas_02 = __esm({ _GRCR, 0, [_rN, _aI, _aT2], - [ - [0, { [_hQ]: _rn }], - [0, { [_hQ]: _ai }], - [() => AccessTokenType, { [_hH]: _xasbt }] - ], + [[0, { [_hQ]: _rn }], [0, { [_hQ]: _ai }], [() => AccessTokenType, { [_hH]: _xasbt }]], 3 ]; GetRoleCredentialsResponse$ = [ @@ -135652,13 +140126,12 @@ var getRuntimeConfig3; var init_runtimeConfig_shared2 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.shared.js"() { "use strict"; - init_dist_es29(); + init_httpAuthSchemes2(); init_protocols2(); - init_dist_es21(); - init_dist_es27(); - init_dist_es19(); - init_dist_es11(); - init_dist_es10(); + init_dist_es5(); + init_client3(); + init_protocols(); + init_serde2(); init_httpAuthSchemeProvider3(); init_endpointResolver2(); init_schemas_02(); @@ -135706,17 +140179,13 @@ var init_runtimeConfig2 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js"() { "use strict"; init_package2(); - init_dist_es29(); - init_dist_es51(); - init_dist_es40(); - init_dist_es52(); - init_dist_es47(); - init_dist_es44(); - init_dist_es14(); - init_dist_es27(); - init_dist_es53(); - init_dist_es54(); - init_dist_es31(); + init_client4(); + init_httpAuthSchemes2(); + init_client3(); + init_config3(); + init_retry3(); + init_serde2(); + init_dist_es11(); init_runtimeConfig_shared2(); getRuntimeConfig4 = (config) => { emitWarningIfUnsupportedVersion2(process.version); @@ -135744,7 +140213,7 @@ var init_runtimeConfig2 = __esm({ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE }, config), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, + streamCollector: config?.streamCollector ?? streamCollector3, useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) @@ -135803,9 +140272,9 @@ var resolveRuntimeExtensions2; var init_runtimeExtensions2 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeExtensions.js"() { "use strict"; - init_dist_es55(); - init_dist_es2(); - init_dist_es27(); + init_client4(); + init_client3(); + init_protocols(); init_httpAuthExtensionConfiguration2(); resolveRuntimeExtensions2 = (runtimeConfig, extensions) => { const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration2(runtimeConfig)); @@ -135820,17 +140289,14 @@ var SSOClient; var init_SSOClient = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSOClient.js"() { "use strict"; - init_dist_es4(); + init_client4(); init_dist_es5(); - init_dist_es6(); - init_dist_es32(); - init_dist_es40(); - init_dist_es21(); + init_client3(); + init_config3(); + init_endpoints3(); + init_protocols(); + init_retry3(); init_schema2(); - init_dist_es42(); - init_dist_es46(); - init_dist_es47(); - init_dist_es27(); init_httpAuthSchemeProvider3(); init_EndpointParameters3(); init_runtimeConfig2(); @@ -135877,11 +140343,11 @@ var GetRoleCredentialsCommand; var init_GetRoleCredentialsCommand = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commands/GetRoleCredentialsCommand.js"() { "use strict"; - init_dist_es46(); - init_dist_es27(); + init_client3(); + init_endpoints3(); init_EndpointParameters3(); init_schemas_02(); - GetRoleCredentialsCommand = class extends Command2.classBuilder().ep(commonParams3).m(function(Command3, cs2, config, o6) { + GetRoleCredentialsCommand = class extends Command2.classBuilder().ep(commonParams3).m(function(Command3, cs2, config, o2) { return [getEndpointPlugin(config, Command3.getEndpointParameterInstructions())]; }).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").sc(GetRoleCredentials$).build() { }; @@ -135893,7 +140359,7 @@ var commands2, SSO; var init_SSO = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSO.js"() { "use strict"; - init_dist_es27(); + init_client3(); init_GetRoleCredentialsCommand(); init_SSOClient(); commands2 = { @@ -135951,10 +140417,9 @@ var SHOULD_FAIL_CREDENTIAL_CHAIN, resolveSSOCredentials; var init_resolveSSOCredentials = __esm({ "node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js"() { "use strict"; - init_client2(); - init_dist_es56(); - init_dist_es24(); - init_dist_es43(); + init_client4(); + init_dist_es14(); + init_config3(); SHOULD_FAIL_CREDENTIAL_CHAIN = false; resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, callerClientConfig, profile, filepath, configFilepath, ignoreCache, logger: logger8 }) => { let token; @@ -136043,7 +140508,7 @@ var validateSsoProfile; var init_validateSsoProfile = __esm({ "node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js"() { "use strict"; - init_dist_es24(); + init_config3(); validateSsoProfile = (profile, logger8) => { 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) { @@ -136060,8 +140525,7 @@ var fromSSO; var init_fromSSO = __esm({ "node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js"() { "use strict"; - init_dist_es24(); - init_dist_es43(); + init_config3(); init_isSsoProfile(); init_resolveSSOCredentials(); init_validateSsoProfile(); @@ -136144,7 +140608,7 @@ var init_fromSSO = __esm({ }); // node_modules/@aws-sdk/credential-provider-sso/dist-es/types.js -var init_types9 = __esm({ +var init_types4 = __esm({ "node_modules/@aws-sdk/credential-provider-sso/dist-es/types.js"() { "use strict"; } @@ -136157,12 +140621,12 @@ __export(dist_es_exports4, { isSsoProfile: () => isSsoProfile, validateSsoProfile: () => validateSsoProfile }); -var init_dist_es57 = __esm({ +var init_dist_es15 = __esm({ "node_modules/@aws-sdk/credential-provider-sso/dist-es/index.js"() { "use strict"; init_fromSSO(); init_isSsoProfile(); - init_types9(); + init_types4(); init_validateSsoProfile(); } }); @@ -136172,24 +140636,24 @@ var resolveCredentialSource, setNamedProvider; var init_resolveCredentialSource = __esm({ "node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveCredentialSource.js"() { "use strict"; - init_client2(); - init_dist_es24(); + init_client4(); + init_config3(); resolveCredentialSource = (credentialSource, profileName, logger8) => { const sourceProvidersMap = { EcsContainer: async (options) => { - const { fromHttp: fromHttp2 } = await Promise.resolve().then(() => (init_dist_es50(), dist_es_exports3)); - const { fromContainerMetadata: fromContainerMetadata2 } = await Promise.resolve().then(() => (init_dist_es49(), dist_es_exports2)); + const { fromHttp: fromHttp2 } = await Promise.resolve().then(() => (init_dist_es12(), dist_es_exports3)); + const { fromContainerMetadata: fromContainerMetadata2 } = await Promise.resolve().then(() => (init_dist_es10(), dist_es_exports2)); logger8?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"); return async () => chain(fromHttp2(options ?? {}), fromContainerMetadata2(options))().then(setNamedProvider); }, Ec2InstanceMetadata: async (options) => { logger8?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata"); - const { fromInstanceMetadata: fromInstanceMetadata2 } = await Promise.resolve().then(() => (init_dist_es49(), dist_es_exports2)); + const { fromInstanceMetadata: fromInstanceMetadata2 } = await Promise.resolve().then(() => (init_dist_es10(), dist_es_exports2)); return async () => fromInstanceMetadata2(options)().then(setNamedProvider); }, Environment: async (options) => { logger8?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment"); - const { fromEnv: fromEnv3 } = await Promise.resolve().then(() => (init_dist_es48(), dist_es_exports)); + const { fromEnv: fromEnv3 } = await Promise.resolve().then(() => (init_dist_es9(), dist_es_exports)); return async () => fromEnv3(options)().then(setNamedProvider); } }; @@ -136203,6 +140667,356 @@ var init_resolveCredentialSource = __esm({ } }); +// node_modules/@aws-sdk/signature-v4-multi-region/dist-es/signature-v4-crt-container.js +var signatureV4CrtContainer; +var init_signature_v4_crt_container = __esm({ + "node_modules/@aws-sdk/signature-v4-multi-region/dist-es/signature-v4-crt-container.js"() { + "use strict"; + signatureV4CrtContainer = { + CrtSignerV4: null + }; + } +}); + +// node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4SignWithCredentials.js +function getCredentialsWithoutSessionToken(credentials) { + return { + accessKeyId: credentials.accessKeyId, + secretAccessKey: credentials.secretAccessKey, + expiration: credentials.expiration + }; +} +function setSingleOverride(privateAccess, credentialsWithoutSessionToken) { + const currentCredentialProvider = privateAccess.credentialProvider; + privateAccess.credentialProvider = () => { + privateAccess.credentialProvider = currentCredentialProvider; + return Promise.resolve(credentialsWithoutSessionToken); + }; +} +var SESSION_TOKEN_QUERY_PARAM, SESSION_TOKEN_HEADER, SignatureV4SignWithCredentials; +var init_SignatureV4SignWithCredentials = __esm({ + "node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4SignWithCredentials.js"() { + "use strict"; + init_dist_es8(); + SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token"; + SESSION_TOKEN_HEADER = SESSION_TOKEN_QUERY_PARAM.toLowerCase(); + SignatureV4SignWithCredentials = class extends 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); + } + }; + } +}); + +// node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4MultiRegion.js +var SignatureV4MultiRegion; +var init_SignatureV4MultiRegion = __esm({ + "node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4MultiRegion.js"() { + "use strict"; + init_dist_es8(); + init_signature_v4_crt_container(); + init_SignatureV4SignWithCredentials(); + SignatureV4MultiRegion = class { + sigv4aSigner; + sigv4Signer; + signerOptions; + static sigv4aDependency() { + if (typeof signatureV4CrtContainer.CrtSignerV4 === "function") { + return "crt"; + } else if (typeof signatureV4aContainer.SignatureV4a === "function") { + return "js"; + } + return "none"; + } + constructor(options) { + this.sigv4Signer = new SignatureV4SignWithCredentials(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 = 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; + } + }; + } +}); + +// node_modules/@aws-sdk/signature-v4-multi-region/dist-es/index.js +var init_dist_es16 = __esm({ + "node_modules/@aws-sdk/signature-v4-multi-region/dist-es/index.js"() { + "use strict"; + init_SignatureV4MultiRegion(); + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/bdd.js +var q2, a3, b3, c3, d3, e3, f3, g3, h3, i3, j4, k4, l, m, n7, o, p, _data3, root3, r3, nodes3, bdd3; +var init_bdd3 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/bdd.js"() { + "use strict"; + init_endpoints3(); + q2 = "ref"; + a3 = -1; + b3 = true; + c3 = "isSet"; + d3 = "PartitionResult"; + e3 = "booleanEquals"; + f3 = "stringEquals"; + g3 = "getAttr"; + h3 = "us-east-1"; + i3 = "sigv4"; + j4 = "sts"; + k4 = "https://sts.{Region}.{PartitionResult#dnsSuffix}"; + l = { [q2]: "Endpoint" }; + m = { [q2]: "Region" }; + n7 = { [q2]: d3 }; + o = {}; + p = [m]; + _data3 = { + conditions: [ + [c3, [l]], + [c3, p], + ["aws.partition", p, d3], + [e3, [{ [q2]: "UseFIPS" }, b3]], + [e3, [{ [q2]: "UseDualStack" }, b3]], + [f3, [m, "aws-global"]], + [e3, [{ [q2]: "UseGlobalEndpoint" }, b3]], + [f3, [m, "eu-central-1"]], + [e3, [{ fn: g3, argv: [n7, "supportsDualStack"] }, b3]], + [e3, [{ fn: g3, argv: [n7, "supportsFIPS"] }, b3]], + [f3, [m, "ap-south-1"]], + [f3, [m, "eu-north-1"]], + [f3, [m, "eu-west-1"]], + [f3, [m, "eu-west-2"]], + [f3, [m, "eu-west-3"]], + [f3, [m, "sa-east-1"]], + [f3, [m, h3]], + [f3, [m, "us-east-2"]], + [f3, [m, "us-west-2"]], + [f3, [m, "us-west-1"]], + [f3, [m, "ca-central-1"]], + [f3, [m, "ap-southeast-1"]], + [f3, [m, "ap-northeast-1"]], + [f3, [m, "ap-southeast-2"]], + [f3, [{ fn: g3, argv: [n7, "name"] }, "aws-us-gov"]] + ], + results: [ + [a3], + ["https://sts.amazonaws.com", { authSchemes: [{ name: i3, signingName: j4, signingRegion: h3 }] }], + [k4, { authSchemes: [{ name: i3, signingName: j4, signingRegion: "{Region}" }] }], + [a3, "Invalid Configuration: FIPS and custom endpoint are not supported"], + [a3, "Invalid Configuration: Dualstack and custom endpoint are not supported"], + [l, o], + ["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", o], + [a3, "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], + [a3, "FIPS is enabled but this partition does not support FIPS"], + ["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", o], + [a3, "DualStack is enabled but this partition does not support DualStack"], + [k4, o], + [a3, "Invalid Configuration: Missing Region"] + ] + }; + root3 = 2; + r3 = 1e8; + nodes3 = new Int32Array([ + -1, + 1, + -1, + 0, + 30, + 3, + 1, + 4, + r3 + 14, + 2, + 5, + r3 + 14, + 3, + 25, + 6, + 4, + 24, + 7, + 5, + r3 + 1, + 8, + 6, + 9, + r3 + 13, + 7, + r3 + 1, + 10, + 10, + r3 + 1, + 11, + 11, + r3 + 1, + 12, + 12, + r3 + 1, + 13, + 13, + r3 + 1, + 14, + 14, + r3 + 1, + 15, + 15, + r3 + 1, + 16, + 16, + r3 + 1, + 17, + 17, + r3 + 1, + 18, + 18, + r3 + 1, + 19, + 19, + r3 + 1, + 20, + 20, + r3 + 1, + 21, + 21, + r3 + 1, + 22, + 22, + r3 + 1, + 23, + 23, + r3 + 1, + r3 + 2, + 8, + r3 + 11, + r3 + 12, + 4, + 28, + 26, + 9, + 27, + r3 + 10, + 24, + r3 + 8, + r3 + 9, + 8, + 29, + r3 + 7, + 9, + r3 + 6, + r3 + 7, + 3, + r3 + 3, + 31, + 4, + r3 + 4, + r3 + 5 + ]); + bdd3 = BinaryDecisionDiagram.from(nodes3, root3, _data3.conditions, _data3.results); + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js +var cache3, defaultEndpointResolver3; +var init_endpointResolver3 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js"() { + "use strict"; + init_client4(); + init_endpoints3(); + init_bdd3(); + cache3 = new EndpointCache({ + size: 50, + params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"] + }); + defaultEndpointResolver3 = (endpointParams, context5 = {}) => { + return cache3.get(endpointParams, () => decideEndpoint(bdd3, { + endpointParams, + logger: context5.logger + })); + }; + customEndpointFunctions.aws = awsEndpointFunctions; + } +}); + // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js function createAwsAuthSigv4HttpAuthOption4(authParameters) { return { @@ -136219,19 +141033,48 @@ function createAwsAuthSigv4HttpAuthOption4(authParameters) { }) }; } +function createAwsAuthSigv4aHttpAuthOption(authParameters) { + return { + schemeId: "aws.auth#sigv4a", + signingProperties: { + name: "sts", + region: authParameters.region + }, + propertiesExtractor: (config, context5) => ({ + signingProperties: { + config, + context: context5 + } + }) + }; +} function createSmithyApiNoAuthHttpAuthOption3(authParameters) { return { schemeId: "smithy.api#noAuth" }; } -var defaultSTSHttpAuthSchemeParametersProvider, defaultSTSHttpAuthSchemeProvider, resolveStsAuthConfig, resolveHttpAuthSchemeConfig4; +var createEndpointRuleSetHttpAuthSchemeParametersProvider, _defaultSTSHttpAuthSchemeParametersProvider, defaultSTSHttpAuthSchemeParametersProvider, createEndpointRuleSetHttpAuthSchemeProvider, _defaultSTSHttpAuthSchemeProvider, defaultSTSHttpAuthSchemeProvider, resolveHttpAuthSchemeConfig4; var init_httpAuthSchemeProvider4 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js"() { "use strict"; - init_dist_es29(); - init_dist_es7(); - init_STSClient(); - defaultSTSHttpAuthSchemeParametersProvider = async (config, context5, input) => { + init_httpAuthSchemes2(); + init_dist_es16(); + init_client3(); + init_endpoints3(); + init_endpointResolver3(); + createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context5, input) => { + if (!input) { + throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`"); + } + const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context5, input); + const instructionsFn = getSmithyContext(context5)?.commandInstance?.constructor?.getEndpointParameterInstructions; + if (!instructionsFn) { + throw new Error(`getEndpointParameterInstructions() is not defined on '${context5.commandName}'`); + } + const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config); + return Object.assign(defaultParameters, endpointParameters); + }; + _defaultSTSHttpAuthSchemeParametersProvider = async (config, context5, input) => { return { operation: getSmithyContext(context5).operation, region: await normalizeProvider(config.region)() || (() => { @@ -136239,25 +141082,72 @@ var init_httpAuthSchemeProvider4 = __esm({ })() }; }; - defaultSTSHttpAuthSchemeProvider = (authParameters) => { + defaultSTSHttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultSTSHttpAuthSchemeParametersProvider); + createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver6, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => { + const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => { + const endpoint2 = defaultEndpointResolver6(authParameters); + const authSchemes = endpoint2.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 (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(createSmithyApiNoAuthHttpAuthOption3(authParameters)); + options.push(createAwsAuthSigv4aHttpAuthOption(authParameters)); break; } default: { options.push(createAwsAuthSigv4HttpAuthOption4(authParameters)); + options.push(createAwsAuthSigv4aHttpAuthOption(authParameters)); } } return options; }; - resolveStsAuthConfig = (input) => Object.assign(input, { - stsClientCtor: STSClient + defaultSTSHttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver3, _defaultSTSHttpAuthSchemeProvider, { + "aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption4, + "aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption, + "smithy.api#noAuth": createSmithyApiNoAuthHttpAuthOption3 }); resolveHttpAuthSchemeConfig4 = (config) => { - const config_0 = resolveStsAuthConfig(config); - const config_1 = resolveAwsSdkSigV4Config(config_0); + const config_0 = resolveAwsSdkSigV4Config(config); + const config_1 = resolveAwsSdkSigV4AConfig(config_0); return Object.assign(config_1, { authSchemePreference: normalizeProvider(config.authSchemePreference ?? []) }); @@ -136288,218 +141178,12 @@ var init_EndpointParameters4 = __esm({ } }); -// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/ruleset.js -var F2, G2, H2, I2, J, a3, b3, c3, d3, e3, f3, g3, h3, i3, j4, k4, l3, m3, n9, o3, p3, q4, r3, s3, t3, u3, v5, w3, x4, y, z, A2, B2, C2, D2, E, _data3, ruleSet3; -var init_ruleset3 = __esm({ - "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/ruleset.js"() { - "use strict"; - F2 = "required"; - G2 = "type"; - H2 = "fn"; - I2 = "argv"; - J = "ref"; - a3 = false; - b3 = true; - c3 = "booleanEquals"; - d3 = "stringEquals"; - e3 = "sigv4"; - f3 = "sts"; - g3 = "us-east-1"; - h3 = "endpoint"; - i3 = "https://sts.{Region}.{PartitionResult#dnsSuffix}"; - j4 = "tree"; - k4 = "error"; - l3 = "getAttr"; - m3 = { [F2]: false, [G2]: "string" }; - n9 = { [F2]: true, default: false, [G2]: "boolean" }; - o3 = { [J]: "Endpoint" }; - p3 = { [H2]: "isSet", [I2]: [{ [J]: "Region" }] }; - q4 = { [J]: "Region" }; - r3 = { [H2]: "aws.partition", [I2]: [q4], assign: "PartitionResult" }; - s3 = { [J]: "UseFIPS" }; - t3 = { [J]: "UseDualStack" }; - u3 = { - url: "https://sts.amazonaws.com", - properties: { authSchemes: [{ name: e3, signingName: f3, signingRegion: g3 }] }, - headers: {} - }; - v5 = {}; - w3 = { conditions: [{ [H2]: d3, [I2]: [q4, "aws-global"] }], [h3]: u3, [G2]: h3 }; - x4 = { [H2]: c3, [I2]: [s3, true] }; - y = { [H2]: c3, [I2]: [t3, true] }; - z = { [H2]: l3, [I2]: [{ [J]: "PartitionResult" }, "supportsFIPS"] }; - A2 = { [J]: "PartitionResult" }; - B2 = { [H2]: c3, [I2]: [true, { [H2]: l3, [I2]: [A2, "supportsDualStack"] }] }; - C2 = [{ [H2]: "isSet", [I2]: [o3] }]; - D2 = [x4]; - E = [y]; - _data3 = { - version: "1.0", - parameters: { Region: m3, UseDualStack: n9, UseFIPS: n9, Endpoint: m3, UseGlobalEndpoint: n9 }, - rules: [ - { - conditions: [ - { [H2]: c3, [I2]: [{ [J]: "UseGlobalEndpoint" }, b3] }, - { [H2]: "not", [I2]: C2 }, - p3, - r3, - { [H2]: c3, [I2]: [s3, a3] }, - { [H2]: c3, [I2]: [t3, a3] } - ], - rules: [ - { conditions: [{ [H2]: d3, [I2]: [q4, "ap-northeast-1"] }], endpoint: u3, [G2]: h3 }, - { conditions: [{ [H2]: d3, [I2]: [q4, "ap-south-1"] }], endpoint: u3, [G2]: h3 }, - { conditions: [{ [H2]: d3, [I2]: [q4, "ap-southeast-1"] }], endpoint: u3, [G2]: h3 }, - { conditions: [{ [H2]: d3, [I2]: [q4, "ap-southeast-2"] }], endpoint: u3, [G2]: h3 }, - w3, - { conditions: [{ [H2]: d3, [I2]: [q4, "ca-central-1"] }], endpoint: u3, [G2]: h3 }, - { conditions: [{ [H2]: d3, [I2]: [q4, "eu-central-1"] }], endpoint: u3, [G2]: h3 }, - { conditions: [{ [H2]: d3, [I2]: [q4, "eu-north-1"] }], endpoint: u3, [G2]: h3 }, - { conditions: [{ [H2]: d3, [I2]: [q4, "eu-west-1"] }], endpoint: u3, [G2]: h3 }, - { conditions: [{ [H2]: d3, [I2]: [q4, "eu-west-2"] }], endpoint: u3, [G2]: h3 }, - { conditions: [{ [H2]: d3, [I2]: [q4, "eu-west-3"] }], endpoint: u3, [G2]: h3 }, - { conditions: [{ [H2]: d3, [I2]: [q4, "sa-east-1"] }], endpoint: u3, [G2]: h3 }, - { conditions: [{ [H2]: d3, [I2]: [q4, g3] }], endpoint: u3, [G2]: h3 }, - { conditions: [{ [H2]: d3, [I2]: [q4, "us-east-2"] }], endpoint: u3, [G2]: h3 }, - { conditions: [{ [H2]: d3, [I2]: [q4, "us-west-1"] }], endpoint: u3, [G2]: h3 }, - { conditions: [{ [H2]: d3, [I2]: [q4, "us-west-2"] }], endpoint: u3, [G2]: h3 }, - { - endpoint: { - url: i3, - properties: { authSchemes: [{ name: e3, signingName: f3, signingRegion: "{Region}" }] }, - headers: v5 - }, - [G2]: h3 - } - ], - [G2]: j4 - }, - { - conditions: C2, - rules: [ - { conditions: D2, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G2]: k4 }, - { conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G2]: k4 }, - { endpoint: { url: o3, properties: v5, headers: v5 }, [G2]: h3 } - ], - [G2]: j4 - }, - { - conditions: [p3], - rules: [ - { - conditions: [r3], - rules: [ - { - conditions: [x4, y], - rules: [ - { - conditions: [{ [H2]: c3, [I2]: [b3, z] }, B2], - rules: [ - { - endpoint: { - url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - properties: v5, - headers: v5 - }, - [G2]: h3 - } - ], - [G2]: j4 - }, - { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G2]: k4 } - ], - [G2]: j4 - }, - { - conditions: D2, - rules: [ - { - conditions: [{ [H2]: c3, [I2]: [z, b3] }], - rules: [ - { - conditions: [{ [H2]: d3, [I2]: [{ [H2]: l3, [I2]: [A2, "name"] }, "aws-us-gov"] }], - endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v5, headers: v5 }, - [G2]: h3 - }, - { - endpoint: { - url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", - properties: v5, - headers: v5 - }, - [G2]: h3 - } - ], - [G2]: j4 - }, - { error: "FIPS is enabled but this partition does not support FIPS", [G2]: k4 } - ], - [G2]: j4 - }, - { - conditions: E, - rules: [ - { - conditions: [B2], - rules: [ - { - endpoint: { - url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", - properties: v5, - headers: v5 - }, - [G2]: h3 - } - ], - [G2]: j4 - }, - { error: "DualStack is enabled but this partition does not support DualStack", [G2]: k4 } - ], - [G2]: j4 - }, - w3, - { endpoint: { url: i3, properties: v5, headers: v5 }, [G2]: h3 } - ], - [G2]: j4 - } - ], - [G2]: j4 - }, - { error: "Invalid Configuration: Missing Region", [G2]: k4 } - ] - }; - ruleSet3 = _data3; - } -}); - -// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js -var cache3, defaultEndpointResolver3; -var init_endpointResolver3 = __esm({ - "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js"() { - "use strict"; - init_dist_es23(); - init_dist_es22(); - init_ruleset3(); - cache3 = new EndpointCache({ - size: 50, - params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"] - }); - defaultEndpointResolver3 = (endpointParams, context5 = {}) => { - return cache3.get(endpointParams, () => resolveEndpoint(ruleSet3, { - endpointParams, - logger: context5.logger - })); - }; - customEndpointFunctions.aws = awsEndpointFunctions; - } -}); - // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js var STSServiceException; var init_STSServiceException = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js"() { "use strict"; - init_dist_es27(); + init_client3(); STSServiceException = class _STSServiceException extends ServiceException { constructor(options) { super(options); @@ -136590,6 +141274,7 @@ var init_errors3 = __esm({ IDPCommunicationErrorException = class _IDPCommunicationErrorException extends STSServiceException { name = "IDPCommunicationErrorException"; $fault = "client"; + $retryable = {}; constructor(opts) { super({ name: "IDPCommunicationErrorException", @@ -136603,7 +141288,7 @@ var init_errors3 = __esm({ }); // 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, _a3, _aKST, _aQE, _c3, _cTT, _e4, _hE3, _m2, _pDLT, _s4, _tLT, n03, _s_registry3, STSServiceException$, n0_registry3, ExpiredTokenException$2, IDPCommunicationErrorException$, IDPRejectedClaimException$, InvalidIdentityTokenException$, MalformedPolicyDocumentException$, PackedPolicyTooLargeException$, RegionDisabledException$, errorTypeRegistries3, accessKeySecretType, clientTokenType, AssumedRoleUser$, AssumeRoleRequest$, AssumeRoleResponse$, AssumeRoleWithWebIdentityRequest$, AssumeRoleWithWebIdentityResponse$, Credentials$, PolicyDescriptorType$, ProvidedContext$, Tag$, policyDescriptorListType, ProvidedContextsListType, tagKeyListType, tagListType, AssumeRole$, AssumeRoleWithWebIdentity$; +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, _a4, _aKST, _aQE, _c4, _cTT, _e4, _hE3, _m2, _pDLT, _s4, _tLT, n03, _s_registry3, STSServiceException$, n0_registry3, ExpiredTokenException$2, IDPCommunicationErrorException$, IDPRejectedClaimException$, InvalidIdentityTokenException$, MalformedPolicyDocumentException$, PackedPolicyTooLargeException$, RegionDisabledException$, errorTypeRegistries3, accessKeySecretType, clientTokenType, AssumedRoleUser$, AssumeRoleRequest$, AssumeRoleResponse$, AssumeRoleWithWebIdentityRequest$, AssumeRoleWithWebIdentityResponse$, Credentials$, PolicyDescriptorType$, ProvidedContext$, Tag$, policyDescriptorListType, ProvidedContextsListType, tagKeyListType, tagListType, AssumeRole$, AssumeRoleWithWebIdentity$; var init_schemas_03 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js"() { "use strict"; @@ -136657,10 +141342,10 @@ var init_schemas_03 = __esm({ _Ta = "Tag"; _V = "Value"; _WIT = "WebIdentityToken"; - _a3 = "arn"; + _a4 = "arn"; _aKST = "accessKeySecretType"; _aQE = "awsQueryError"; - _c3 = "client"; + _c4 = "client"; _cTT = "clientTokenType"; _e4 = "error"; _hE3 = "httpError"; @@ -136677,7 +141362,7 @@ var init_schemas_03 = __esm({ -3, n03, _ETE2, - { [_aQE]: [`ExpiredTokenException`, 400], [_e4]: _c3, [_hE3]: 400 }, + { [_aQE]: [`ExpiredTokenException`, 400], [_e4]: _c4, [_hE3]: 400 }, [_m2], [0] ]; @@ -136686,7 +141371,7 @@ var init_schemas_03 = __esm({ -3, n03, _IDPCEE, - { [_aQE]: [`IDPCommunicationError`, 400], [_e4]: _c3, [_hE3]: 400 }, + { [_aQE]: [`IDPCommunicationError`, 400], [_e4]: _c4, [_hE3]: 400 }, [_m2], [0] ]; @@ -136695,7 +141380,7 @@ var init_schemas_03 = __esm({ -3, n03, _IDPRCE, - { [_aQE]: [`IDPRejectedClaim`, 403], [_e4]: _c3, [_hE3]: 403 }, + { [_aQE]: [`IDPRejectedClaim`, 403], [_e4]: _c4, [_hE3]: 403 }, [_m2], [0] ]; @@ -136704,7 +141389,7 @@ var init_schemas_03 = __esm({ -3, n03, _IITE, - { [_aQE]: [`InvalidIdentityToken`, 400], [_e4]: _c3, [_hE3]: 400 }, + { [_aQE]: [`InvalidIdentityToken`, 400], [_e4]: _c4, [_hE3]: 400 }, [_m2], [0] ]; @@ -136713,7 +141398,7 @@ var init_schemas_03 = __esm({ -3, n03, _MPDE, - { [_aQE]: [`MalformedPolicyDocument`, 400], [_e4]: _c3, [_hE3]: 400 }, + { [_aQE]: [`MalformedPolicyDocument`, 400], [_e4]: _c4, [_hE3]: 400 }, [_m2], [0] ]; @@ -136722,7 +141407,7 @@ var init_schemas_03 = __esm({ -3, n03, _PPTLE, - { [_aQE]: [`PackedPolicyTooLarge`, 400], [_e4]: _c3, [_hE3]: 400 }, + { [_aQE]: [`PackedPolicyTooLarge`, 400], [_e4]: _c4, [_hE3]: 400 }, [_m2], [0] ]; @@ -136731,15 +141416,26 @@ var init_schemas_03 = __esm({ -3, n03, _RDE, - { [_aQE]: [`RegionDisabledException`, 403], [_e4]: _c3, [_hE3]: 403 }, + { [_aQE]: [`RegionDisabledException`, 403], [_e4]: _c4, [_hE3]: 403 }, [_m2], [0] ]; n0_registry3.registerError(RegionDisabledException$, RegionDisabledException); - errorTypeRegistries3 = [_s_registry3, n0_registry3]; + errorTypeRegistries3 = [ + _s_registry3, + n0_registry3 + ]; accessKeySecretType = [0, n03, _aKST, 8, 0]; clientTokenType = [0, n03, _cTT, 8, 0]; - AssumedRoleUser$ = [3, n03, _ARU, 0, [_ARI, _A], [0, 0], 2]; + AssumedRoleUser$ = [ + 3, + n03, + _ARU, + 0, + [_ARI, _A], + [0, 0], + 2 + ]; AssumeRoleRequest$ = [ 3, n03, @@ -136783,14 +141479,61 @@ var init_schemas_03 = __esm({ [0, [() => accessKeySecretType, 0], 0, 4], 4 ]; - PolicyDescriptorType$ = [3, n03, _PDT, 0, [_a3], [0]]; - ProvidedContext$ = [3, n03, _PCr, 0, [_PAr, _CA], [0, 0]]; - Tag$ = [3, n03, _Ta, 0, [_K, _V], [0, 0], 2]; - policyDescriptorListType = [1, n03, _pDLT, 0, () => PolicyDescriptorType$]; - ProvidedContextsListType = [1, n03, _PCLT, 0, () => ProvidedContext$]; + PolicyDescriptorType$ = [ + 3, + n03, + _PDT, + 0, + [_a4], + [0] + ]; + ProvidedContext$ = [ + 3, + n03, + _PCr, + 0, + [_PAr, _CA], + [0, 0] + ]; + Tag$ = [ + 3, + n03, + _Ta, + 0, + [_K, _V], + [0, 0], + 2 + ]; + policyDescriptorListType = [ + 1, + n03, + _pDLT, + 0, + () => PolicyDescriptorType$ + ]; + ProvidedContextsListType = [ + 1, + n03, + _PCLT, + 0, + () => ProvidedContext$ + ]; tagKeyListType = 64 | 0; - tagListType = [1, n03, _tLT, 0, () => Tag$]; - AssumeRole$ = [9, n03, _AR, 0, () => AssumeRoleRequest$, () => AssumeRoleResponse$]; + tagListType = [ + 1, + n03, + _tLT, + 0, + () => Tag$ + ]; + AssumeRole$ = [ + 9, + n03, + _AR, + 0, + () => AssumeRoleRequest$, + () => AssumeRoleResponse$ + ]; AssumeRoleWithWebIdentity$ = [ 9, n03, @@ -136807,13 +141550,13 @@ var getRuntimeConfig5; var init_runtimeConfig_shared3 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.shared.js"() { "use strict"; - init_dist_es29(); + init_httpAuthSchemes2(); init_protocols2(); - init_dist_es21(); - init_dist_es27(); - init_dist_es19(); - init_dist_es11(); - init_dist_es10(); + init_dist_es16(); + init_dist_es5(); + init_client3(); + init_protocols(); + init_serde2(); init_httpAuthSchemeProvider4(); init_endpointResolver3(); init_schemas_03(); @@ -136832,6 +141575,11 @@ var init_runtimeConfig_shared3 = __esm({ 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 () => ({})), @@ -136848,6 +141596,7 @@ var init_runtimeConfig_shared3 = __esm({ serviceTarget: "AWSSecurityTokenServiceV20110615" }, serviceId: config?.serviceId ?? "STS", + signerConstructor: config?.signerConstructor ?? SignatureV4MultiRegion, urlParser: config?.urlParser ?? parseUrl2, utf8Decoder: config?.utf8Decoder ?? fromUtf8, utf8Encoder: config?.utf8Encoder ?? toUtf8 @@ -136862,18 +141611,14 @@ var init_runtimeConfig3 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js"() { "use strict"; init_package2(); - init_dist_es29(); - init_dist_es51(); - init_dist_es40(); - init_dist_es21(); - init_dist_es52(); - init_dist_es47(); - init_dist_es44(); - init_dist_es14(); - init_dist_es27(); - init_dist_es53(); - init_dist_es54(); - init_dist_es31(); + init_client4(); + init_httpAuthSchemes2(); + init_dist_es5(); + init_client3(); + init_config3(); + init_retry3(); + init_serde2(); + init_dist_es11(); init_runtimeConfig_shared3(); getRuntimeConfig6 = (config) => { emitWarningIfUnsupportedVersion2(process.version); @@ -136899,6 +141644,11 @@ var init_runtimeConfig3 = __esm({ 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 () => ({})), @@ -136913,7 +141663,8 @@ var init_runtimeConfig3 = __esm({ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE }, config), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, + sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadConfig(NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig), + streamCollector: config?.streamCollector ?? streamCollector3, useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) @@ -136972,9 +141723,9 @@ var resolveRuntimeExtensions3; var init_runtimeExtensions3 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeExtensions.js"() { "use strict"; - init_dist_es55(); - init_dist_es2(); - init_dist_es27(); + init_client4(); + init_client3(); + init_protocols(); init_httpAuthExtensionConfiguration3(); resolveRuntimeExtensions3 = (runtimeConfig, extensions) => { const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration3(runtimeConfig)); @@ -136989,17 +141740,14 @@ var STSClient; var init_STSClient = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STSClient.js"() { "use strict"; - init_dist_es4(); + init_client4(); init_dist_es5(); - init_dist_es6(); - init_dist_es32(); - init_dist_es40(); - init_dist_es21(); + init_client3(); + init_config3(); + init_endpoints3(); + init_protocols(); + init_retry3(); init_schema2(); - init_dist_es42(); - init_dist_es46(); - init_dist_es47(); - init_dist_es27(); init_httpAuthSchemeProvider4(); init_EndpointParameters4(); init_runtimeConfig3(); @@ -137029,7 +141777,8 @@ var init_STSClient = __esm({ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { httpAuthSchemeParametersProvider: defaultSTSHttpAuthSchemeParametersProvider, identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({ - "aws.auth#sigv4": config.credentials + "aws.auth#sigv4": config.credentials, + "aws.auth#sigv4a": config.credentials }) })); this.middlewareStack.use(getHttpSigningPlugin(this.config)); @@ -137046,11 +141795,11 @@ var AssumeRoleCommand; var init_AssumeRoleCommand = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleCommand.js"() { "use strict"; - init_dist_es46(); - init_dist_es27(); + init_client3(); + init_endpoints3(); init_EndpointParameters4(); init_schemas_03(); - AssumeRoleCommand = class extends Command2.classBuilder().ep(commonParams4).m(function(Command3, cs2, config, o6) { + AssumeRoleCommand = class extends Command2.classBuilder().ep(commonParams4).m(function(Command3, cs2, config, o2) { return [getEndpointPlugin(config, Command3.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").sc(AssumeRole$).build() { }; @@ -137062,11 +141811,11 @@ var AssumeRoleWithWebIdentityCommand; var init_AssumeRoleWithWebIdentityCommand = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.js"() { "use strict"; - init_dist_es46(); - init_dist_es27(); + init_client3(); + init_endpoints3(); init_EndpointParameters4(); init_schemas_03(); - AssumeRoleWithWebIdentityCommand = class extends Command2.classBuilder().ep(commonParams4).m(function(Command3, cs2, config, o6) { + AssumeRoleWithWebIdentityCommand = class extends Command2.classBuilder().ep(commonParams4).m(function(Command3, cs2, config, o2) { return [getEndpointPlugin(config, Command3.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").sc(AssumeRoleWithWebIdentity$).build() { }; @@ -137078,7 +141827,7 @@ var commands3, STS; var init_STS = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STS.js"() { "use strict"; - init_dist_es27(); + init_client3(); init_AssumeRoleCommand(); init_AssumeRoleWithWebIdentityCommand(); init_STSClient(); @@ -137113,8 +141862,7 @@ var getAccountIdFromAssumedRoleUser, resolveRegion, getDefaultRoleAssumer, getDe var init_defaultStsRoleAssumers = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultStsRoleAssumers.js"() { "use strict"; - init_client2(); - init_dist_es55(); + init_client4(); init_AssumeRoleCommand(); init_AssumeRoleWithWebIdentityCommand(); getAccountIdFromAssumedRoleUser = (assumedRoleUser) => { @@ -137308,9 +142056,8 @@ var isAssumeRoleProfile, isAssumeRoleWithSourceProfile, isCredentialSourceProfil var init_resolveAssumeRoleCredentials = __esm({ "node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js"() { "use strict"; - init_client2(); - init_dist_es24(); - init_dist_es43(); + init_client4(); + init_config3(); init_resolveCredentialSource(); isAssumeRoleProfile = (arg, { profile = "default", logger: logger8 } = {}) => { 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: logger8 }) || isCredentialSourceProfile(arg, { profile, logger: logger8 })); @@ -137405,8 +142152,8 @@ var defaultSigninHttpAuthSchemeParametersProvider, defaultSigninHttpAuthSchemePr var init_httpAuthSchemeProvider5 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthSchemeProvider.js"() { "use strict"; - init_dist_es29(); - init_dist_es7(); + init_httpAuthSchemes2(); + init_client3(); defaultSigninHttpAuthSchemeParametersProvider = async (config, context5, input) => { return { operation: getSmithyContext(context5).operation, @@ -137458,163 +142205,109 @@ var init_EndpointParameters5 = __esm({ } }); -// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/ruleset.js -var u4, v6, w4, x5, a4, b4, c4, d4, e4, f4, g4, h4, i4, j5, k5, l4, m4, n10, o4, p4, q5, r4, s4, t4, _data4, ruleSet4; -var init_ruleset4 = __esm({ - "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/ruleset.js"() { - "use strict"; - u4 = "required"; - v6 = "fn"; - w4 = "argv"; - x5 = "ref"; - a4 = true; - b4 = "isSet"; - c4 = "booleanEquals"; - d4 = "error"; - e4 = "endpoint"; - f4 = "tree"; - g4 = "PartitionResult"; - h4 = "stringEquals"; - i4 = { [u4]: true, default: false, type: "boolean" }; - j5 = { [u4]: false, type: "string" }; - k5 = { [x5]: "Endpoint" }; - l4 = { [v6]: c4, [w4]: [{ [x5]: "UseFIPS" }, true] }; - m4 = { [v6]: c4, [w4]: [{ [x5]: "UseDualStack" }, true] }; - n10 = {}; - o4 = { [v6]: "getAttr", [w4]: [{ [x5]: g4 }, "name"] }; - p4 = { [v6]: c4, [w4]: [{ [x5]: "UseFIPS" }, false] }; - q5 = { [v6]: c4, [w4]: [{ [x5]: "UseDualStack" }, false] }; - r4 = { [v6]: "getAttr", [w4]: [{ [x5]: g4 }, "supportsFIPS"] }; - s4 = { [v6]: c4, [w4]: [true, { [v6]: "getAttr", [w4]: [{ [x5]: g4 }, "supportsDualStack"] }] }; - t4 = [{ [x5]: "Region" }]; +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/bdd.js +var m2, a4, b4, c4, d4, e4, f4, g4, h4, i4, j5, k5, l2, _data4, root4, r4, nodes4, bdd4; +var init_bdd4 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/bdd.js"() { + "use strict"; + init_endpoints3(); + m2 = "ref"; + a4 = -1; + b4 = true; + c4 = "isSet"; + d4 = "PartitionResult"; + e4 = "booleanEquals"; + f4 = "getAttr"; + g4 = "stringEquals"; + h4 = { [m2]: "Endpoint" }; + i4 = { [m2]: d4 }; + j5 = { "fn": f4, "argv": [i4, "name"] }; + k5 = {}; + l2 = [{ [m2]: "Region" }]; _data4 = { - version: "1.0", - parameters: { UseDualStack: i4, UseFIPS: i4, Endpoint: j5, Region: j5 }, - rules: [ - { - conditions: [{ [v6]: b4, [w4]: [k5] }], - rules: [ - { conditions: [l4], error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d4 }, - { - rules: [ - { - conditions: [m4], - error: "Invalid Configuration: Dualstack and custom endpoint are not supported", - type: d4 - }, - { endpoint: { url: k5, properties: n10, headers: n10 }, type: e4 } - ], - type: f4 - } - ], - type: f4 - }, - { - rules: [ - { - conditions: [{ [v6]: b4, [w4]: t4 }], - rules: [ - { - conditions: [{ [v6]: "aws.partition", [w4]: t4, assign: g4 }], - rules: [ - { - conditions: [{ [v6]: h4, [w4]: [o4, "aws"] }, p4, q5], - endpoint: { url: "https://{Region}.signin.aws.amazon.com", properties: n10, headers: n10 }, - type: e4 - }, - { - conditions: [{ [v6]: h4, [w4]: [o4, "aws-cn"] }, p4, q5], - endpoint: { url: "https://{Region}.signin.amazonaws.cn", properties: n10, headers: n10 }, - type: e4 - }, - { - conditions: [{ [v6]: h4, [w4]: [o4, "aws-us-gov"] }, p4, q5], - endpoint: { url: "https://{Region}.signin.amazonaws-us-gov.com", properties: n10, headers: n10 }, - type: e4 - }, - { - conditions: [l4, m4], - rules: [ - { - conditions: [{ [v6]: c4, [w4]: [a4, r4] }, s4], - rules: [ - { - endpoint: { - url: "https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - properties: n10, - headers: n10 - }, - type: e4 - } - ], - type: f4 - }, - { - error: "FIPS and DualStack are enabled, but this partition does not support one or both", - type: d4 - } - ], - type: f4 - }, - { - conditions: [l4, q5], - rules: [ - { - conditions: [{ [v6]: c4, [w4]: [r4, a4] }], - rules: [ - { - endpoint: { - url: "https://signin-fips.{Region}.{PartitionResult#dnsSuffix}", - properties: n10, - headers: n10 - }, - type: e4 - } - ], - type: f4 - }, - { error: "FIPS is enabled but this partition does not support FIPS", type: d4 } - ], - type: f4 - }, - { - conditions: [p4, m4], - rules: [ - { - conditions: [s4], - rules: [ - { - endpoint: { - url: "https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}", - properties: n10, - headers: n10 - }, - type: e4 - } - ], - type: f4 - }, - { error: "DualStack is enabled but this partition does not support DualStack", type: d4 } - ], - type: f4 - }, - { - endpoint: { url: "https://signin.{Region}.{PartitionResult#dnsSuffix}", properties: n10, headers: n10 }, - type: e4 - } - ], - type: f4 - } - ], - type: f4 - }, - { error: "Invalid Configuration: Missing Region", type: d4 } - ], - type: f4 - } + conditions: [ + [c4, [h4]], + [c4, l2], + ["aws.partition", l2, d4], + [e4, [{ [m2]: "UseFIPS" }, b4]], + [e4, [{ [m2]: "UseDualStack" }, b4]], + [e4, [{ fn: f4, argv: [i4, "supportsDualStack"] }, b4]], + [e4, [{ fn: f4, argv: [i4, "supportsFIPS"] }, b4]], + [g4, [j5, "aws"]], + [g4, [j5, "aws-cn"]], + [g4, [j5, "aws-us-gov"]] + ], + results: [ + [a4], + [a4, "Invalid Configuration: FIPS and custom endpoint are not supported"], + [a4, "Invalid Configuration: Dualstack and custom endpoint are not supported"], + [h4, k5], + ["https://{Region}.signin.aws.amazon.com", k5], + ["https://{Region}.signin.amazonaws.cn", k5], + ["https://{Region}.signin.amazonaws-us-gov.com", k5], + ["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", k5], + [a4, "FIPS and DualStack are enabled, but this partition does not support one or both"], + ["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}", k5], + [a4, "FIPS is enabled but this partition does not support FIPS"], + ["https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}", k5], + [a4, "DualStack is enabled but this partition does not support DualStack"], + ["https://signin.{Region}.{PartitionResult#dnsSuffix}", k5], + [a4, "Invalid Configuration: Missing Region"] ] }; - ruleSet4 = _data4; + root4 = 2; + r4 = 1e8; + nodes4 = new Int32Array([ + -1, + 1, + -1, + 0, + 15, + 3, + 1, + 4, + r4 + 14, + 2, + 5, + r4 + 14, + 3, + 11, + 6, + 4, + 10, + 7, + 7, + r4 + 4, + 8, + 8, + r4 + 5, + 9, + 9, + r4 + 6, + r4 + 13, + 5, + r4 + 11, + r4 + 12, + 4, + 13, + 12, + 6, + r4 + 9, + r4 + 10, + 5, + 14, + r4 + 8, + 6, + r4 + 7, + r4 + 8, + 3, + r4 + 1, + 16, + 4, + r4 + 2, + r4 + 3 + ]); + bdd4 = BinaryDecisionDiagram.from(nodes4, root4, _data4.conditions, _data4.results); } }); @@ -137623,15 +142316,15 @@ var cache4, defaultEndpointResolver4; var init_endpointResolver4 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js"() { "use strict"; - init_dist_es23(); - init_dist_es22(); - init_ruleset4(); + init_client4(); + init_endpoints3(); + init_bdd4(); cache4 = new EndpointCache({ size: 50, params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] }); defaultEndpointResolver4 = (endpointParams, context5 = {}) => { - return cache4.get(endpointParams, () => resolveEndpoint(ruleSet4, { + return cache4.get(endpointParams, () => decideEndpoint(bdd4, { endpointParams, logger: context5.logger })); @@ -137645,7 +142338,7 @@ var SigninServiceException; var init_SigninServiceException = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/SigninServiceException.js"() { "use strict"; - init_dist_es27(); + init_client3(); SigninServiceException = class _SigninServiceException extends ServiceException { constructor(options) { super(options); @@ -137721,7 +142414,7 @@ var init_errors4 = __esm({ }); // 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, _c4, _cI2, _cV2, _co2, _e5, _eI2, _gT2, _h3, _hE4, _iT2, _jN, _m3, _rT2, _rU2, _s5, _sAK2, _sT2, _se2, _tI, _tO, _tT2, n04, _s_registry4, SigninServiceException$, n0_registry4, AccessDeniedException$2, InternalServerException$2, TooManyRequestsError$, ValidationException$, errorTypeRegistries4, RefreshToken2, AccessToken$, CreateOAuth2TokenRequest$, CreateOAuth2TokenRequestBody$, CreateOAuth2TokenResponse$, CreateOAuth2TokenResponseBody$, CreateOAuth2Token$; +var _ADE2, _AT2, _COAT, _COATR, _COATRB, _COATRBr, _COATRr, _ISE2, _RT2, _TMRE2, _VE, _aKI2, _aT3, _c5, _cI2, _cV2, _co2, _e5, _eI2, _gT2, _h3, _hE4, _iT2, _jN, _m3, _rT2, _rU2, _s5, _sAK2, _sT2, _se2, _tI, _tO, _tT2, n04, _s_registry4, SigninServiceException$, n0_registry4, AccessDeniedException$2, InternalServerException$2, TooManyRequestsError$, ValidationException$, errorTypeRegistries4, RefreshToken2, AccessToken$, CreateOAuth2TokenRequest$, CreateOAuth2TokenRequestBody$, CreateOAuth2TokenResponse$, CreateOAuth2TokenResponseBody$, CreateOAuth2Token$; var init_schemas_04 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/schemas/schemas_0.js"() { "use strict"; @@ -137741,7 +142434,7 @@ var init_schemas_04 = __esm({ _VE = "ValidationException"; _aKI2 = "accessKeyId"; _aT3 = "accessToken"; - _c4 = "client"; + _c5 = "client"; _cI2 = "clientId"; _cV2 = "codeVerifier"; _co2 = "code"; @@ -137767,15 +142460,50 @@ var init_schemas_04 = __esm({ SigninServiceException$ = [-3, _s5, "SigninServiceException", 0, [], []]; _s_registry4.registerError(SigninServiceException$, SigninServiceException); n0_registry4 = TypeRegistry.for(n04); - AccessDeniedException$2 = [-3, n04, _ADE2, { [_e5]: _c4 }, [_e5, _m3], [0, 0], 2]; + AccessDeniedException$2 = [ + -3, + n04, + _ADE2, + { [_e5]: _c5 }, + [_e5, _m3], + [0, 0], + 2 + ]; n0_registry4.registerError(AccessDeniedException$2, AccessDeniedException2); - InternalServerException$2 = [-3, n04, _ISE2, { [_e5]: _se2, [_hE4]: 500 }, [_e5, _m3], [0, 0], 2]; + InternalServerException$2 = [ + -3, + n04, + _ISE2, + { [_e5]: _se2, [_hE4]: 500 }, + [_e5, _m3], + [0, 0], + 2 + ]; n0_registry4.registerError(InternalServerException$2, InternalServerException2); - TooManyRequestsError$ = [-3, n04, _TMRE2, { [_e5]: _c4, [_hE4]: 429 }, [_e5, _m3], [0, 0], 2]; + TooManyRequestsError$ = [ + -3, + n04, + _TMRE2, + { [_e5]: _c5, [_hE4]: 429 }, + [_e5, _m3], + [0, 0], + 2 + ]; n0_registry4.registerError(TooManyRequestsError$, TooManyRequestsError); - ValidationException$ = [-3, n04, _VE, { [_e5]: _c4, [_hE4]: 400 }, [_e5, _m3], [0, 0], 2]; + ValidationException$ = [ + -3, + n04, + _VE, + { [_e5]: _c5, [_hE4]: 400 }, + [_e5, _m3], + [0, 0], + 2 + ]; n0_registry4.registerError(ValidationException$, ValidationException); - errorTypeRegistries4 = [_s_registry4, n0_registry4]; + errorTypeRegistries4 = [ + _s_registry4, + n0_registry4 + ]; RefreshToken2 = [0, n04, _RT2, 8, 0]; AccessToken$ = [ 3, @@ -137783,11 +142511,7 @@ var init_schemas_04 = __esm({ _AT2, 8, [_aKI2, _sAK2, _sT2], - [ - [0, { [_jN]: _aKI2 }], - [0, { [_jN]: _sAK2 }], - [0, { [_jN]: _sT2 }] - ], + [[0, { [_jN]: _aKI2 }], [0, { [_jN]: _sAK2 }], [0, { [_jN]: _sT2 }]], 3 ]; CreateOAuth2TokenRequest$ = [ @@ -137805,14 +142529,7 @@ var init_schemas_04 = __esm({ _COATRB, 0, [_cI2, _gT2, _co2, _rU2, _cV2, _rT2], - [ - [0, { [_jN]: _cI2 }], - [0, { [_jN]: _gT2 }], - 0, - [0, { [_jN]: _rU2 }], - [0, { [_jN]: _cV2 }], - [() => RefreshToken2, { [_jN]: _rT2 }] - ], + [[0, { [_jN]: _cI2 }], [0, { [_jN]: _gT2 }], 0, [0, { [_jN]: _rU2 }], [0, { [_jN]: _cV2 }], [() => RefreshToken2, { [_jN]: _rT2 }]], 2 ]; CreateOAuth2TokenResponse$ = [ @@ -137830,13 +142547,7 @@ var init_schemas_04 = __esm({ _COATRBr, 0, [_aT3, _tT2, _eI2, _rT2, _iT2], - [ - [() => AccessToken$, { [_jN]: _aT3 }], - [0, { [_jN]: _tT2 }], - [1, { [_jN]: _eI2 }], - [() => RefreshToken2, { [_jN]: _rT2 }], - [0, { [_jN]: _iT2 }] - ], + [[() => AccessToken$, { [_jN]: _aT3 }], [0, { [_jN]: _tT2 }], [1, { [_jN]: _eI2 }], [() => RefreshToken2, { [_jN]: _rT2 }], [0, { [_jN]: _iT2 }]], 4 ]; CreateOAuth2Token$ = [ @@ -137855,13 +142566,12 @@ var getRuntimeConfig7; var init_runtimeConfig_shared4 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.shared.js"() { "use strict"; - init_dist_es29(); + init_httpAuthSchemes2(); init_protocols2(); - init_dist_es21(); - init_dist_es27(); - init_dist_es19(); - init_dist_es11(); - init_dist_es10(); + init_dist_es5(); + init_client3(); + init_protocols(); + init_serde2(); init_httpAuthSchemeProvider5(); init_endpointResolver4(); init_schemas_04(); @@ -137909,17 +142619,13 @@ var init_runtimeConfig4 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js"() { "use strict"; init_package2(); - init_dist_es29(); - init_dist_es51(); - init_dist_es40(); - init_dist_es52(); - init_dist_es47(); - init_dist_es44(); - init_dist_es14(); - init_dist_es27(); - init_dist_es53(); - init_dist_es54(); - init_dist_es31(); + init_client4(); + init_httpAuthSchemes2(); + init_client3(); + init_config3(); + init_retry3(); + init_serde2(); + init_dist_es11(); init_runtimeConfig_shared4(); getRuntimeConfig8 = (config) => { emitWarningIfUnsupportedVersion2(process.version); @@ -137947,7 +142653,7 @@ var init_runtimeConfig4 = __esm({ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE }, config), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, + streamCollector: config?.streamCollector ?? streamCollector3, useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) @@ -138006,9 +142712,9 @@ var resolveRuntimeExtensions4; var init_runtimeExtensions4 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeExtensions.js"() { "use strict"; - init_dist_es55(); - init_dist_es2(); - init_dist_es27(); + init_client4(); + init_client3(); + init_protocols(); init_httpAuthExtensionConfiguration4(); resolveRuntimeExtensions4 = (runtimeConfig, extensions) => { const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration4(runtimeConfig)); @@ -138023,17 +142729,14 @@ var SigninClient; var init_SigninClient = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/SigninClient.js"() { "use strict"; - init_dist_es4(); + init_client4(); init_dist_es5(); - init_dist_es6(); - init_dist_es32(); - init_dist_es40(); - init_dist_es21(); + init_client3(); + init_config3(); + init_endpoints3(); + init_protocols(); + init_retry3(); init_schema2(); - init_dist_es42(); - init_dist_es46(); - init_dist_es47(); - init_dist_es27(); init_httpAuthSchemeProvider5(); init_EndpointParameters5(); init_runtimeConfig4(); @@ -138080,11 +142783,11 @@ var CreateOAuth2TokenCommand; var init_CreateOAuth2TokenCommand = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js"() { "use strict"; - init_dist_es46(); - init_dist_es27(); + init_client3(); + init_endpoints3(); init_EndpointParameters5(); init_schemas_04(); - CreateOAuth2TokenCommand = class extends Command2.classBuilder().ep(commonParams5).m(function(Command3, cs2, config, o6) { + CreateOAuth2TokenCommand = class extends Command2.classBuilder().ep(commonParams5).m(function(Command3, cs2, config, o2) { return [getEndpointPlugin(config, Command3.getEndpointParameterInstructions())]; }).s("Signin", "CreateOAuth2Token", {}).n("SigninClient", "CreateOAuth2TokenCommand").sc(CreateOAuth2Token$).build() { }; @@ -138096,7 +142799,7 @@ var commands4, Signin; var init_Signin = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/Signin.js"() { "use strict"; - init_dist_es27(); + init_client3(); init_CreateOAuth2TokenCommand(); init_SigninClient(); commands4 = { @@ -138184,14 +142887,13 @@ var init_signin = __esm({ import { createHash as createHash6, createPrivateKey, createPublicKey, sign } from "crypto"; import { promises as fs15 } from "fs"; import { homedir as homedir2 } from "os"; -import { dirname as dirname2, join as join9 } from "path"; +import { dirname as dirname4, join as join10 } from "path"; var LoginCredentialsFetcher; var init_LoginCredentialsFetcher = __esm({ "node_modules/@aws-sdk/credential-provider-login/dist-es/LoginCredentialsFetcher.js"() { "use strict"; - init_dist_es24(); - init_dist_es2(); - init_dist_es43(); + init_config3(); + init_protocols(); LoginCredentialsFetcher = class _LoginCredentialsFetcher { profileData; init; @@ -138339,7 +143041,7 @@ var init_LoginCredentialsFetcher = __esm({ } async saveToken(token) { const tokenFilePath = this.getTokenFilePath(); - const directory = dirname2(tokenFilePath); + const directory = dirname4(tokenFilePath); try { await fs15.mkdir(directory, { recursive: true }); } catch (error2) { @@ -138347,10 +143049,10 @@ var init_LoginCredentialsFetcher = __esm({ await fs15.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8"); } getTokenFilePath() { - const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join9(homedir2(), ".aws", "login", "cache"); + const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join10(homedir2(), ".aws", "login", "cache"); const loginSessionBytes = Buffer.from(this.loginSession, "utf8"); const loginSessionSha256 = createHash6("sha256").update(loginSessionBytes).digest("hex"); - return join9(directory, `${loginSessionSha256}.json`); + return join10(directory, `${loginSessionSha256}.json`); } derToRawSignature(derSignature) { let offset = 2; @@ -138366,21 +143068,21 @@ var init_LoginCredentialsFetcher = __esm({ } offset++; const sLength = derSignature[offset++]; - let s6 = derSignature.subarray(offset, offset + sLength); + let s = derSignature.subarray(offset, offset + sLength); r6 = r6[0] === 0 ? r6.subarray(1) : r6; - s6 = s6[0] === 0 ? s6.subarray(1) : s6; + s = s[0] === 0 ? s.subarray(1) : s; const rPadded = Buffer.concat([Buffer.alloc(32 - r6.length), r6]); - const sPadded = Buffer.concat([Buffer.alloc(32 - s6.length), s6]); + const sPadded = Buffer.concat([Buffer.alloc(32 - s.length), s]); return Buffer.concat([rPadded, sPadded]); } createDPoPInterceptor(middlewareStack) { middlewareStack.add((next) => async (args) => { if (HttpRequest.isInstance(args.request)) { - const request3 = args.request; - const actualEndpoint = `${request3.protocol}//${request3.hostname}${request3.port ? `:${request3.port}` : ""}${request3.path}`; - const dpop = await this.generateDpop(request3.method, actualEndpoint); - request3.headers = { - ...request3.headers, + const request2 = args.request; + const actualEndpoint = `${request2.protocol}//${request2.hostname}${request2.port ? `:${request2.port}` : ""}${request2.path}`; + const dpop = await this.generateDpop(request2.method, actualEndpoint); + request2.headers = { + ...request2.headers, DPoP: dpop }; } @@ -138408,16 +143110,16 @@ var init_LoginCredentialsFetcher = __esm({ break; } } - const x6 = publicDer.slice(pointStart + 1, pointStart + 33); - const y2 = publicDer.slice(pointStart + 33, pointStart + 65); + const x2 = 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: x6.toString("base64url"), - y: y2.toString("base64url") + x: x2.toString("base64url"), + y: y.toString("base64url") } }; const payload = { @@ -138446,9 +143148,8 @@ var fromLoginCredentials; var init_fromLoginCredentials = __esm({ "node_modules/@aws-sdk/credential-provider-login/dist-es/fromLoginCredentials.js"() { "use strict"; - init_client2(); - init_dist_es24(); - init_dist_es43(); + init_client4(); + init_config3(); init_LoginCredentialsFetcher(); fromLoginCredentials = (init) => async ({ callerClientConfig } = {}) => { init?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials"); @@ -138471,18 +143172,18 @@ var init_fromLoginCredentials = __esm({ }); // node_modules/@aws-sdk/credential-provider-login/dist-es/types.js -var init_types10 = __esm({ +var init_types5 = __esm({ "node_modules/@aws-sdk/credential-provider-login/dist-es/types.js"() { "use strict"; } }); // node_modules/@aws-sdk/credential-provider-login/dist-es/index.js -var init_dist_es58 = __esm({ +var init_dist_es17 = __esm({ "node_modules/@aws-sdk/credential-provider-login/dist-es/index.js"() { "use strict"; init_fromLoginCredentials(); - init_types10(); + init_types5(); } }); @@ -138491,8 +143192,8 @@ var isLoginProfile, resolveLoginCredentials; var init_resolveLoginCredentials = __esm({ "node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveLoginCredentials.js"() { "use strict"; - init_client2(); - init_dist_es58(); + init_client4(); + init_dist_es17(); isLoginProfile = (data) => { return Boolean(data && data.login_session); }; @@ -138511,7 +143212,7 @@ var getValidatedProcessCredentials; var init_getValidatedProcessCredentials = __esm({ "node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js"() { "use strict"; - init_client2(); + init_client4(); getValidatedProcessCredentials = (profileName, data, profiles) => { if (data.Version !== 1) { throw Error(`Profile ${profileName} credential_process did not return Version 1.`); @@ -138545,21 +143246,20 @@ var init_getValidatedProcessCredentials = __esm({ }); // node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js -import { exec } from "child_process"; +import { exec as exec2 } from "child_process"; import { promisify } from "util"; var resolveProcessCredentials; var init_resolveProcessCredentials = __esm({ "node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js"() { "use strict"; - init_dist_es24(); - init_dist_es43(); + init_config3(); init_getValidatedProcessCredentials(); resolveProcessCredentials = async (profileName, profiles, logger8) => { const profile = profiles[profileName]; if (profiles[profileName]) { const credentialProcess = profile["credential_process"]; if (credentialProcess !== void 0) { - const execPromise = promisify(externalDataInterceptor?.getTokenRecord?.().exec ?? exec); + const execPromise = promisify(externalDataInterceptor?.getTokenRecord?.().exec ?? exec2); try { const { stdout } = await execPromise(credentialProcess); let data; @@ -138589,7 +143289,7 @@ var fromProcess; var init_fromProcess = __esm({ "node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js"() { "use strict"; - init_dist_es43(); + init_config3(); init_resolveProcessCredentials(); fromProcess = (init = {}) => async ({ callerClientConfig } = {}) => { init.logger?.debug("@aws-sdk/credential-provider-process - fromProcess"); @@ -138606,7 +143306,7 @@ var dist_es_exports5 = {}; __export(dist_es_exports5, { fromProcess: () => fromProcess }); -var init_dist_es59 = __esm({ +var init_dist_es18 = __esm({ "node_modules/@aws-sdk/credential-provider-process/dist-es/index.js"() { "use strict"; init_fromProcess(); @@ -138618,9 +143318,9 @@ var isProcessProfile, resolveProcessCredentials2; var init_resolveProcessCredentials2 = __esm({ "node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js"() { "use strict"; - init_client2(); + init_client4(); isProcessProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string"; - resolveProcessCredentials2 = async (options, profile) => Promise.resolve().then(() => (init_dist_es59(), dist_es_exports5)).then(({ fromProcess: fromProcess2 }) => fromProcess2({ + resolveProcessCredentials2 = async (options, profile) => Promise.resolve().then(() => (init_dist_es18(), dist_es_exports5)).then(({ fromProcess: fromProcess2 }) => fromProcess2({ ...options, profile })().then((creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_PROCESS", "v"))); @@ -138632,9 +143332,9 @@ var resolveSsoCredentials, isSsoProfile2; var init_resolveSsoCredentials = __esm({ "node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveSsoCredentials.js"() { "use strict"; - init_client2(); + init_client4(); resolveSsoCredentials = async (profile, profileData, options = {}, callerClientConfig) => { - const { fromSSO: fromSSO2 } = await Promise.resolve().then(() => (init_dist_es57(), dist_es_exports4)); + const { fromSSO: fromSSO2 } = await Promise.resolve().then(() => (init_dist_es15(), dist_es_exports4)); return fromSSO2({ profile, logger: options.logger, @@ -138659,7 +143359,7 @@ var isStaticCredsProfile, resolveStaticCredentials; var init_resolveStaticCredentials = __esm({ "node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveStaticCredentials.js"() { "use strict"; - init_client2(); + init_client4(); 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; resolveStaticCredentials = async (profile, options) => { options?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials"); @@ -138709,14 +143409,13 @@ var init_fromWebToken = __esm({ }); // node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js -import { readFileSync as readFileSync4 } from "fs"; +import { readFileSync as readFileSync7 } from "fs"; var ENV_TOKEN_FILE, ENV_ROLE_ARN, ENV_ROLE_SESSION_NAME, fromTokenFile; var init_fromTokenFile = __esm({ "node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js"() { "use strict"; - init_client2(); - init_dist_es24(); - init_dist_es43(); + init_client4(); + init_config3(); init_fromWebToken(); ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE"; ENV_ROLE_ARN = "AWS_ROLE_ARN"; @@ -138733,7 +143432,7 @@ var init_fromTokenFile = __esm({ } const credentials = await fromWebToken({ ...init, - webIdentityToken: externalDataInterceptor?.getTokenRecord?.()[webIdentityTokenFile] ?? readFileSync4(webIdentityTokenFile, { encoding: "ascii" }), + webIdentityToken: externalDataInterceptor?.getTokenRecord?.()[webIdentityTokenFile] ?? readFileSync7(webIdentityTokenFile, { encoding: "ascii" }), roleArn, roleSessionName })(awsIdentityProperties); @@ -138751,7 +143450,7 @@ __export(dist_es_exports6, { fromTokenFile: () => fromTokenFile, fromWebToken: () => fromWebToken }); -var init_dist_es60 = __esm({ +var init_dist_es19 = __esm({ "node_modules/@aws-sdk/credential-provider-web-identity/dist-es/index.js"() { "use strict"; init_fromTokenFile(); @@ -138764,9 +143463,9 @@ var isWebIdentityProfile, resolveWebIdentityCredentials; var init_resolveWebIdentityCredentials = __esm({ "node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js"() { "use strict"; - init_client2(); + init_client4(); 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; - resolveWebIdentityCredentials = async (profile, options, callerClientConfig) => Promise.resolve().then(() => (init_dist_es60(), dist_es_exports6)).then(({ fromTokenFile: fromTokenFile2 }) => fromTokenFile2({ + resolveWebIdentityCredentials = async (profile, options, callerClientConfig) => Promise.resolve().then(() => (init_dist_es19(), dist_es_exports6)).then(({ fromTokenFile: fromTokenFile2 }) => fromTokenFile2({ webIdentityTokenFile: profile.web_identity_token_file, roleArn: profile.role_arn, roleSessionName: profile.role_session_name, @@ -138784,7 +143483,7 @@ var resolveProfileData; var init_resolveProfileData = __esm({ "node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProfileData.js"() { "use strict"; - init_dist_es24(); + init_config3(); init_resolveAssumeRoleCredentials(); init_resolveLoginCredentials(); init_resolveProcessCredentials2(); @@ -138824,7 +143523,7 @@ var fromIni; var init_fromIni = __esm({ "node_modules/@aws-sdk/credential-provider-ini/dist-es/fromIni.js"() { "use strict"; - init_dist_es43(); + init_config3(); init_resolveProfileData(); fromIni = (init = {}) => async ({ callerClientConfig } = {}) => { init.logger?.debug("@aws-sdk/credential-provider-ini - fromIni"); @@ -138841,7 +143540,7 @@ var dist_es_exports7 = {}; __export(dist_es_exports7, { fromIni: () => fromIni }); -var init_dist_es61 = __esm({ +var init_dist_es20 = __esm({ "node_modules/@aws-sdk/credential-provider-ini/dist-es/index.js"() { "use strict"; init_fromIni(); @@ -138853,9 +143552,8 @@ var multipleCredentialSourceWarningEmitted, defaultProvider, credentialsTreatedA var init_defaultProvider = __esm({ "node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js"() { "use strict"; - init_dist_es48(); - init_dist_es24(); - init_dist_es43(); + init_dist_es9(); + init_config3(); init_remoteProvider(); init_memoize_chain(); multipleCredentialSourceWarningEmitted = false; @@ -138893,22 +143591,22 @@ var init_defaultProvider = __esm({ if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { throw new CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).", { logger: init.logger }); } - const { fromSSO: fromSSO2 } = await Promise.resolve().then(() => (init_dist_es57(), dist_es_exports4)); + const { fromSSO: fromSSO2 } = await Promise.resolve().then(() => (init_dist_es15(), dist_es_exports4)); return fromSSO2(init)(awsIdentityProperties); }, async (awsIdentityProperties) => { init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni"); - const { fromIni: fromIni2 } = await Promise.resolve().then(() => (init_dist_es61(), dist_es_exports7)); + const { fromIni: fromIni2 } = await Promise.resolve().then(() => (init_dist_es20(), dist_es_exports7)); return fromIni2(init)(awsIdentityProperties); }, async (awsIdentityProperties) => { init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess"); - const { fromProcess: fromProcess2 } = await Promise.resolve().then(() => (init_dist_es59(), dist_es_exports5)); + const { fromProcess: fromProcess2 } = await Promise.resolve().then(() => (init_dist_es18(), dist_es_exports5)); return fromProcess2(init)(awsIdentityProperties); }, async (awsIdentityProperties) => { init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile"); - const { fromTokenFile: fromTokenFile2 } = await Promise.resolve().then(() => (init_dist_es60(), dist_es_exports6)); + const { fromTokenFile: fromTokenFile2 } = await Promise.resolve().then(() => (init_dist_es19(), dist_es_exports6)); return fromTokenFile2(init)(awsIdentityProperties); }, async () => { @@ -138927,7 +143625,7 @@ var init_defaultProvider = __esm({ }); // node_modules/@aws-sdk/credential-provider-node/dist-es/index.js -var init_dist_es62 = __esm({ +var init_dist_es21 = __esm({ "node_modules/@aws-sdk/credential-provider-node/dist-es/index.js"() { "use strict"; init_defaultProvider(); @@ -138949,6 +143647,7 @@ var init_EventSigningTransformStream = __esm({ messageSigner; eventStreamCodec; systemClockOffsetProvider; + staticCredentials; constructor(options) { super({ autoDestroy: true, @@ -138960,6 +143659,7 @@ var init_EventSigningTransformStream = __esm({ this.eventStreamCodec = options.eventStreamCodec; this.messageSigner = options.messageSigner; this.systemClockOffsetProvider = options.systemClockOffsetProvider; + this.staticCredentials = options.credentials?.(); } async _transform(chunk, encoding, callback) { try { @@ -138974,7 +143674,8 @@ var init_EventSigningTransformStream = __esm({ }, priorSignature: this.priorSignature }, { - signingDate: now + signingDate: now, + eventStreamCredentials: await this.staticCredentials }); this.priorSignature = signedMessage.signature; const serializedSigned = this.eventStreamCodec.encode({ @@ -138998,33 +143699,35 @@ var init_EventSigningTransformStream = __esm({ }); // node_modules/@aws-sdk/eventstream-handler-node/dist-es/EventStreamPayloadHandler.js -import { PassThrough as PassThrough4, pipeline, Readable as Readable11 } from "stream"; +import { PassThrough as PassThrough4, pipeline, Readable as Readable10 } from "stream"; var EventStreamPayloadHandler; var init_EventStreamPayloadHandler = __esm({ "node_modules/@aws-sdk/eventstream-handler-node/dist-es/EventStreamPayloadHandler.js"() { "use strict"; - init_dist_es36(); + init_event_streams(); init_EventSigningTransformStream(); EventStreamPayloadHandler = class { messageSigner; eventStreamCodec; systemClockOffsetProvider; + credentials; constructor(options) { this.messageSigner = options.messageSigner; this.eventStreamCodec = new EventStreamCodec(options.utf8Encoder, options.utf8Decoder); this.systemClockOffsetProvider = async () => options.systemClockOffset ?? 0; + this.credentials = options.credentials; } async handle(next, args, context5 = {}) { - const request3 = args.request; - const { body: payload, query } = request3; - if (!(payload instanceof Readable11)) { + const request2 = args.request; + const { body: payload, query } = request2; + if (!(payload instanceof Readable10)) { throw new Error("Eventstream payload must be a Readable stream."); } const payloadStream = payload; - request3.body = new PassThrough4({ + request2.body = new PassThrough4({ objectMode: true }); - const match3 = request3.headers?.authorization?.match(/Signature=([\w]+)$/); + const match3 = request2.headers?.authorization?.match(/Signature=([\w]+)$/); let priorSignature = match3?.[1] ?? query?.["X-Amz-Signature"] ?? ""; if (context5.__staticSignature) { priorSignature = ""; @@ -139033,12 +143736,13 @@ var init_EventStreamPayloadHandler = __esm({ priorSignature, eventStreamCodec: this.eventStreamCodec, messageSigner: await this.messageSigner(), - systemClockOffsetProvider: this.systemClockOffsetProvider + systemClockOffsetProvider: this.systemClockOffsetProvider, + credentials: this.credentials }); let resolvePipeline; - const pipelineError = new Promise((resolve4, reject2) => { - resolvePipeline = () => resolve4(void 0); - pipeline(payloadStream, signingStream, request3.body, (err) => { + const pipelineError = new Promise((resolve8, reject2) => { + resolvePipeline = () => resolve8(void 0); + pipeline(payloadStream, signingStream, request2.body, (err) => { if (err) { reject2(new Error(`Pipeline error in @aws-sdk/eventstream-handler-node: ${err.message}`, { cause: err })); } @@ -139048,7 +143752,7 @@ var init_EventStreamPayloadHandler = __esm({ try { result = await Promise.race([next(args), pipelineError]); } catch (e6) { - request3.body.end(); + request2.body.end(); throw e6; } finally { resolvePipeline(); @@ -139070,121 +143774,99 @@ var init_eventStreamPayloadHandlerProvider2 = __esm({ }); // node_modules/@aws-sdk/eventstream-handler-node/dist-es/index.js -var init_dist_es63 = __esm({ +var init_dist_es22 = __esm({ "node_modules/@aws-sdk/eventstream-handler-node/dist-es/index.js"() { "use strict"; init_eventStreamPayloadHandlerProvider2(); } }); -// node_modules/@smithy/eventstream-serde-node/dist-es/utils.js -async function* readabletoIterable(readStream) { - let streamEnded = false; - let generationEnded = false; - const records = new Array(); - readStream.on("error", (err) => { - if (!streamEnded) { - streamEnded = true; - } - if (err) { - throw err; - } - }); - readStream.on("data", (data) => { - records.push(data); - }); - readStream.on("end", () => { - streamEnded = true; - }); - while (!generationEnded) { - const value = await new Promise((resolve4) => setTimeout(() => resolve4(records.shift()), 0)); - if (value) { - yield value; - } - generationEnded = streamEnded && records.length === 0; - } -} -var init_utils4 = __esm({ - "node_modules/@smithy/eventstream-serde-node/dist-es/utils.js"() { +// node_modules/@aws-sdk/client-bedrock-runtime/dist-es/endpoint/bdd.js +var k6, a5, b5, c5, d5, e5, f5, g5, h5, i5, j6, _data5, root5, r5, nodes5, bdd5; +var init_bdd5 = __esm({ + "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/endpoint/bdd.js"() { "use strict"; - } -}); - -// node_modules/@smithy/eventstream-serde-node/dist-es/EventStreamMarshaller.js -import { Readable as Readable12 } from "stream"; -var EventStreamMarshaller2; -var init_EventStreamMarshaller2 = __esm({ - "node_modules/@smithy/eventstream-serde-node/dist-es/EventStreamMarshaller.js"() { - "use strict"; - init_dist_es37(); - init_utils4(); - EventStreamMarshaller2 = class { - universalMarshaller; - constructor({ utf8Encoder, utf8Decoder }) { - this.universalMarshaller = new EventStreamMarshaller({ - utf8Decoder, - utf8Encoder - }); - } - deserialize(body2, deserializer) { - const bodyIterable = typeof body2[Symbol.asyncIterator] === "function" ? body2 : readabletoIterable(body2); - return this.universalMarshaller.deserialize(bodyIterable, deserializer); - } - serialize(input, serializer) { - return Readable12.from(this.universalMarshaller.serialize(input, serializer)); - } + init_endpoints3(); + k6 = "ref"; + a5 = -1; + b5 = true; + c5 = "isSet"; + d5 = "PartitionResult"; + e5 = "booleanEquals"; + f5 = "getAttr"; + g5 = { [k6]: "Endpoint" }; + h5 = { [k6]: d5 }; + i5 = {}; + j6 = [{ [k6]: "Region" }]; + _data5 = { + conditions: [ + [c5, [g5]], + [c5, j6], + ["aws.partition", j6, d5], + [e5, [{ [k6]: "UseFIPS" }, b5]], + [e5, [{ [k6]: "UseDualStack" }, b5]], + [e5, [{ fn: f5, argv: [h5, "supportsDualStack"] }, b5]], + [e5, [{ fn: f5, argv: [h5, "supportsFIPS"] }, b5]] + ], + results: [ + [a5], + [a5, "Invalid Configuration: FIPS and custom endpoint are not supported"], + [a5, "Invalid Configuration: Dualstack and custom endpoint are not supported"], + [g5, i5], + ["https://bedrock-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", i5], + [a5, "FIPS and DualStack are enabled, but this partition does not support one or both"], + ["https://bedrock-runtime-fips.{Region}.{PartitionResult#dnsSuffix}", i5], + [a5, "FIPS is enabled but this partition does not support FIPS"], + ["https://bedrock-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}", i5], + [a5, "DualStack is enabled but this partition does not support DualStack"], + ["https://bedrock-runtime.{Region}.{PartitionResult#dnsSuffix}", i5], + [a5, "Invalid Configuration: Missing Region"] + ] }; - } -}); - -// node_modules/@smithy/eventstream-serde-node/dist-es/provider.js -var eventStreamSerdeProvider; -var init_provider2 = __esm({ - "node_modules/@smithy/eventstream-serde-node/dist-es/provider.js"() { - "use strict"; - init_EventStreamMarshaller2(); - eventStreamSerdeProvider = (options) => new EventStreamMarshaller2(options); - } -}); - -// node_modules/@smithy/eventstream-serde-node/dist-es/index.js -var init_dist_es64 = __esm({ - "node_modules/@smithy/eventstream-serde-node/dist-es/index.js"() { - "use strict"; - init_EventStreamMarshaller2(); - init_provider2(); - } -}); - -// node_modules/@aws-sdk/client-bedrock-runtime/dist-es/endpoint/ruleset.js -var s5, t5, u5, v7, a5, b5, c5, d5, e5, f5, g5, h5, i5, j6, k6, l5, m5, n11, o5, p5, q6, r5, _data5, ruleSet5; -var init_ruleset5 = __esm({ - "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/endpoint/ruleset.js"() { - "use strict"; - s5 = "required"; - t5 = "fn"; - u5 = "argv"; - v7 = "ref"; - a5 = true; - b5 = "isSet"; - c5 = "booleanEquals"; - d5 = "error"; - e5 = "endpoint"; - f5 = "tree"; - g5 = "PartitionResult"; - h5 = { [s5]: false, "type": "string" }; - i5 = { [s5]: true, "default": false, "type": "boolean" }; - j6 = { [v7]: "Endpoint" }; - k6 = { [t5]: c5, [u5]: [{ [v7]: "UseFIPS" }, true] }; - l5 = { [t5]: c5, [u5]: [{ [v7]: "UseDualStack" }, true] }; - m5 = {}; - n11 = { [t5]: "getAttr", [u5]: [{ [v7]: g5 }, "supportsFIPS"] }; - o5 = { [t5]: c5, [u5]: [true, { [t5]: "getAttr", [u5]: [{ [v7]: g5 }, "supportsDualStack"] }] }; - p5 = [k6]; - q6 = [l5]; - r5 = [{ [v7]: "Region" }]; - _data5 = { version: "1.0", parameters: { Region: h5, UseDualStack: i5, UseFIPS: i5, Endpoint: h5 }, rules: [{ conditions: [{ [t5]: b5, [u5]: [j6] }], rules: [{ conditions: p5, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d5 }, { rules: [{ conditions: q6, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d5 }, { endpoint: { url: j6, properties: m5, headers: m5 }, type: e5 }], type: f5 }], type: f5 }, { rules: [{ conditions: [{ [t5]: b5, [u5]: r5 }], rules: [{ conditions: [{ [t5]: "aws.partition", [u5]: r5, assign: g5 }], rules: [{ conditions: [k6, l5], rules: [{ conditions: [{ [t5]: c5, [u5]: [a5, n11] }, o5], rules: [{ rules: [{ endpoint: { url: "https://bedrock-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: m5, headers: m5 }, type: e5 }], type: f5 }], type: f5 }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d5 }], type: f5 }, { conditions: p5, rules: [{ conditions: [{ [t5]: c5, [u5]: [n11, a5] }], rules: [{ rules: [{ endpoint: { url: "https://bedrock-runtime-fips.{Region}.{PartitionResult#dnsSuffix}", properties: m5, headers: m5 }, type: e5 }], type: f5 }], type: f5 }, { error: "FIPS is enabled but this partition does not support FIPS", type: d5 }], type: f5 }, { conditions: q6, rules: [{ conditions: [o5], rules: [{ rules: [{ endpoint: { url: "https://bedrock-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: m5, headers: m5 }, type: e5 }], type: f5 }], type: f5 }, { error: "DualStack is enabled but this partition does not support DualStack", type: d5 }], type: f5 }, { rules: [{ endpoint: { url: "https://bedrock-runtime.{Region}.{PartitionResult#dnsSuffix}", properties: m5, headers: m5 }, type: e5 }], type: f5 }], type: f5 }], type: f5 }, { error: "Invalid Configuration: Missing Region", type: d5 }], type: f5 }] }; - ruleSet5 = _data5; + root5 = 2; + r5 = 1e8; + nodes5 = new Int32Array([ + -1, + 1, + -1, + 0, + 12, + 3, + 1, + 4, + r5 + 11, + 2, + 5, + r5 + 11, + 3, + 8, + 6, + 4, + 7, + r5 + 10, + 5, + r5 + 8, + r5 + 9, + 4, + 10, + 9, + 6, + r5 + 6, + r5 + 7, + 5, + 11, + r5 + 5, + 6, + r5 + 4, + r5 + 5, + 3, + r5 + 1, + 13, + 4, + r5 + 2, + r5 + 3 + ]); + bdd5 = BinaryDecisionDiagram.from(nodes5, root5, _data5.conditions, _data5.results); } }); @@ -139193,15 +143875,15 @@ var cache5, defaultEndpointResolver5; var init_endpointResolver5 = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/endpoint/endpointResolver.js"() { "use strict"; - init_dist_es23(); - init_dist_es22(); - init_ruleset5(); + init_client4(); + init_endpoints3(); + init_bdd5(); cache5 = new EndpointCache({ size: 50, params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] }); defaultEndpointResolver5 = (endpointParams, context5 = {}) => { - return cache5.get(endpointParams, () => resolveEndpoint(ruleSet5, { + return cache5.get(endpointParams, () => decideEndpoint(bdd5, { endpointParams, logger: context5.logger })); @@ -139215,7 +143897,7 @@ var BedrockRuntimeServiceException; var init_BedrockRuntimeServiceException = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/models/BedrockRuntimeServiceException.js"() { "use strict"; - init_dist_es27(); + init_client3(); BedrockRuntimeServiceException = class _BedrockRuntimeServiceException extends ServiceException { constructor(options) { super(options); @@ -139388,7 +144070,7 @@ var init_errors5 = __esm({ }); // node_modules/@aws-sdk/client-bedrock-runtime/dist-es/schemas/schemas_0.js -var _A2, _AB, _ADE3, _AG, _AGD, _AGR, _AGRp, _AIM, _AIODC, _AIS, _AISODC, _AISs, _AS, _ATC, _ATCu, _B, _BIPP, _BOPP, _C2, _CB, _CBD, _CBDE, _CBS, _CBSE, _CBSEo, _CBo, _CC, _CCB, _CD, _CDL, _CDi, _CE, _CGC, _CGCL, _CL, _CM, _CO, _CPB, _CR, _CRo, _CS2, _CSC, _CSCD, _CSCL, _CSCLD, _CSM, _CSME, _CSO, _CSR, _CSRo, _CST, _CT2, _CTI, _CTR2, _CTRo, _CTRou, _CT_, _CTo, _Ci, _Co, _DB, _DCB, _DCBo, _DCL, _DCLo, _DPL, _DS2, _EB, _GA, _GAI, _GAIR, _GAIRe, _GAL, _GALM, _GAM, _GARDSL, _GARF, _GARFL, _GARIF, _GARIFu, _GARITR, _GARITRL, _GARLW, _GARNTF, _GARPA, _GARR, _GARRL, _GARS, _GARSF, _GARSL, _GARSLC, _GARSNLC, _GARSu, _GART, _GARTAF, _GARTCF, _GARTL, _GARTO, _GARTOL, _GARVF, _GC, _GCB, _GCBL, _GCCB, _GCF, _GCFL, _GCGF, _GCGFu, _GCGPA, _GCIB, _GCIS, _GCPA, _GCTB, _GCW, _GCWL, _GCu, _GIB, _GIC, _GIM, _GIS, _GMW, _GMWL, _GOC, _GOCL, _GPEF, _GPEFL, _GRF, _GRFL, _GSC, _GSIPA, _GT, _GTA, _GTB, _GTCC, _GTL, _GTPA, _GU, _GWPA, _IB, _IBD, _IBS, _IC, _IM, _IMR, _IMRn, _IMTR, _IMWBS, _IMWBSI, _IMWBSO, _IMWBSR, _IMWBSRn, _IMWRS, _IMWRSR, _IMWRSRn, _IS, _ISE3, _JSD, _LAI, _LAIR, _LAIRi, _M, _MEE, _MIP, _MNRE, _MSE, _MSEE, _MSEe, _MTE, _Me, _OC, _OF, _OFS, _PB, _PC2, _PP, _PRT, _PVM, _PVV, _RCB, _RCBD, _RM, _RNFE2, _RS, _RTB, _SAI, _SAIR, _SAIRt, _SCB, _SCBy, _SL, _SQEE, _SRB, _SRCB, _SRCBe, _SRL, _ST2, _STC, _STy, _SUE, _T2, _TC2, _TCo, _TE, _TIS, _TL, _TRB, _TRBD, _TRBDo, _TRBS, _TRCB, _TRCBo, _TS, _TU, _TUB, _TUBD, _TUBS, _To, _Too, _VB, _VE2, _VS, _WL, _XABA, _XABCT, _XABG, _XABG_, _XABPL, _XABST, _XABT, _a4, _aGD, _aIS, _aMRF, _aMRFP, _aMRFd, _aR, _aRP, _aRPU, _aRPu, _ac, _an, _as, _au, _aut, _b, _bO, _bo, _c5, _cBD, _cBI, _cBS, _cBSo, _cC, _cD, _cFS, _cGP, _cGPU, _cP, _cPIU, _cPU, _cPa, _cR, _cRIT, _cRT, _cT, _cTS, _cW, _cWIT, _ch, _ci, _cit, _cl, _co3, _con, _conf, _conv, _d, _dC2, _dCo, _dI, _dP, _dS, _de, _des, _do, _doc, _e6, _eT, _en, _end, _f, _fM, _fS, _fi, _fil, _g, _gA, _gC, _gCu, _gCua, _gI, _gIu, _gO, _gOu, _gPL, _gV, _gu, _h4, _hE5, _hH2, _hQ2, _i2, _iA, _iAn, _iC, _iM, _iMI, _iMn, _iS, _iSE, _iT3, _id, _im, _ima, _imp, _in, _j, _jS, _k, _kKI, _l, _lM, _lMT, _lW, _la, _lo, _m4, _mA, _mI, _mIo, _mO, _mR, _mS, _mSEE, _mSe, _mT, _mTE, _mWL, _ma, _me, _met, _meta, _n, _nL, _nT, _nTo, _o, _oA, _oC, _oDC, _oM, _oS, _oSC, _oT, _op, _ou, _p, _pC, _pCL, _pE, _pR, _pV, _pVA, _q, _r2, _rC2, _rCe, _rM, _rN2, _rT3, _re, _ro, _s6, _sB, _sC, _sE, _sIP, _sIPFU, _sIPU, _sL, _sO, _sODC, _sPM, _sR, _sRI, _sRL, _sRe, _sRu, _sS, _sT3, _sTA, _sTB, _sTe, _sTy, _sU, _sUE, _sa, _sc2, _sch, _se3, _si, _so, _st, _sta, _stat, _str, _stre, _stri, _stru, _sy, _t2, _tA, _tC, _tCe, _tCo, _tCoo, _tE, _tF, _tP, _tPU, _tPo, _tR, _tS, _tT3, _tU, _tUI, _ta, _te, _tem, _th, _ti, _to, _too, _tool, _top, _tr, _tra, _tran, _ty, _u, _uC, _uP, _ur, _url, _v, _vE, _va, _vi, _w, _wP, _wPU, n05, _s_registry5, BedrockRuntimeServiceException$, n0_registry5, AccessDeniedException$3, ConflictException$, InternalServerException$3, ModelErrorException$, ModelNotReadyException$, ModelStreamErrorException$, ModelTimeoutException$, ResourceNotFoundException$2, ServiceQuotaExceededException$, ServiceUnavailableException$, ThrottlingException$, ValidationException$2, errorTypeRegistries5, AsyncInvokeMessage, Body2, GuardrailAutomatedReasoningStatementLogicContent, GuardrailAutomatedReasoningStatementNaturalLanguageContent, ModelInputPayload, PartBody, AnyToolChoice$, AppliedGuardrailDetails$, ApplyGuardrailRequest$, ApplyGuardrailResponse$, AsyncInvokeS3OutputDataConfig$, AsyncInvokeSummary$, AudioBlock$, AutoToolChoice$, BidirectionalInputPayloadPart$, BidirectionalOutputPayloadPart$, CacheDetail$, CachePointBlock$, Citation$, CitationsConfig$, CitationsContentBlock$, CitationsDelta$, CitationSourceContentDelta$, ContentBlockDeltaEvent$, ContentBlockStartEvent$, ContentBlockStopEvent$, ConverseMetrics$, ConverseRequest$, ConverseResponse$, ConverseStreamMetadataEvent$, ConverseStreamMetrics$, ConverseStreamRequest$, ConverseStreamResponse$, ConverseStreamTrace$, ConverseTokensRequest$, ConverseTrace$, CountTokensRequest$, CountTokensResponse$, DocumentBlock$, DocumentCharLocation$, DocumentChunkLocation$, DocumentPageLocation$, ErrorBlock$, GetAsyncInvokeRequest$, GetAsyncInvokeResponse$, GuardrailAssessment$, GuardrailAutomatedReasoningImpossibleFinding$, GuardrailAutomatedReasoningInputTextReference$, GuardrailAutomatedReasoningInvalidFinding$, GuardrailAutomatedReasoningLogicWarning$, GuardrailAutomatedReasoningNoTranslationsFinding$, GuardrailAutomatedReasoningPolicyAssessment$, GuardrailAutomatedReasoningRule$, GuardrailAutomatedReasoningSatisfiableFinding$, GuardrailAutomatedReasoningScenario$, GuardrailAutomatedReasoningStatement$, GuardrailAutomatedReasoningTooComplexFinding$, GuardrailAutomatedReasoningTranslation$, GuardrailAutomatedReasoningTranslationAmbiguousFinding$, GuardrailAutomatedReasoningTranslationOption$, GuardrailAutomatedReasoningValidFinding$, GuardrailConfiguration$, GuardrailContentFilter$, GuardrailContentPolicyAssessment$, GuardrailContextualGroundingFilter$, GuardrailContextualGroundingPolicyAssessment$, GuardrailConverseImageBlock$, GuardrailConverseTextBlock$, GuardrailCoverage$, GuardrailCustomWord$, GuardrailImageBlock$, GuardrailImageCoverage$, GuardrailInvocationMetrics$, GuardrailManagedWord$, GuardrailOutputContent$, GuardrailPiiEntityFilter$, GuardrailRegexFilter$, GuardrailSensitiveInformationPolicyAssessment$, GuardrailStreamConfiguration$, GuardrailTextBlock$, GuardrailTextCharactersCoverage$, GuardrailTopic$, GuardrailTopicPolicyAssessment$, GuardrailTraceAssessment$, GuardrailUsage$, GuardrailWordPolicyAssessment$, ImageBlock$, ImageBlockDelta$, ImageBlockStart$, InferenceConfiguration$, InvokeModelRequest$, InvokeModelResponse$, InvokeModelTokensRequest$, InvokeModelWithBidirectionalStreamRequest$, InvokeModelWithBidirectionalStreamResponse$, InvokeModelWithResponseStreamRequest$, InvokeModelWithResponseStreamResponse$, JsonSchemaDefinition$, ListAsyncInvokesRequest$, ListAsyncInvokesResponse$, Message$, MessageStartEvent$, MessageStopEvent$, OutputConfig$, OutputFormat$, PayloadPart$, PerformanceConfiguration$, PromptRouterTrace$, ReasoningTextBlock$, S3Location$, SearchResultBlock$, SearchResultContentBlock$, SearchResultLocation$, ServiceTier$, SpecificToolChoice$, StartAsyncInvokeRequest$, StartAsyncInvokeResponse$, SystemTool$, Tag$2, TokenUsage$, ToolConfiguration$, ToolResultBlock$, ToolResultBlockStart$, ToolSpecification$, ToolUseBlock$, ToolUseBlockDelta$, ToolUseBlockStart$, VideoBlock$, WebLocation$, AdditionalModelResponseFieldPaths, AsyncInvokeSummaries, CacheDetailsList, CitationGeneratedContentList, Citations, CitationSourceContentList, CitationSourceContentListDelta, ContentBlocks, DocumentContentBlocks, GuardrailAssessmentList, GuardrailAutomatedReasoningDifferenceScenarioList, GuardrailAutomatedReasoningFindingList, GuardrailAutomatedReasoningInputTextReferenceList, GuardrailAutomatedReasoningRuleList, GuardrailAutomatedReasoningStatementList, GuardrailAutomatedReasoningTranslationList, GuardrailAutomatedReasoningTranslationOptionList, GuardrailContentBlockList, GuardrailContentFilterList, GuardrailContentQualifierList, GuardrailContextualGroundingFilters, GuardrailConverseContentQualifierList, GuardrailCustomWordList, GuardrailManagedWordList, GuardrailOriginList, GuardrailOutputContentList, GuardrailPiiEntityFilterList, GuardrailRegexFilterList, GuardrailTopicList, Messages, ModelOutputs, NonEmptyStringList, SearchResultContentBlocks, SystemContentBlocks, TagList, ToolResultBlocksDelta, ToolResultContentBlocks, Tools, GuardrailAssessmentListMap, GuardrailAssessmentMap, PromptVariableMap, RequestMetadata, AsyncInvokeOutputDataConfig$, AudioSource$, CitationGeneratedContent$, CitationLocation$, CitationSourceContent$, ContentBlock$, ContentBlockDelta$, ContentBlockStart$, ConverseOutput$, ConverseStreamOutput$, CountTokensInput$, DocumentContentBlock$, DocumentSource$, GuardrailAutomatedReasoningFinding$, GuardrailContentBlock$, GuardrailConverseContentBlock$, GuardrailConverseImageSource$, GuardrailImageSource$, ImageSource$, InvokeModelWithBidirectionalStreamInput$, InvokeModelWithBidirectionalStreamOutput$, OutputFormatStructure$, PromptVariableValues$, ReasoningContentBlock$, ReasoningContentBlockDelta$, ResponseStream$, SystemContentBlock$, Tool$, ToolChoice$, ToolInputSchema$, ToolResultBlockDelta$, ToolResultContentBlock$, VideoSource$, ApplyGuardrail$, Converse$, ConverseStream$, CountTokens$, GetAsyncInvoke$, InvokeModel$, InvokeModelWithBidirectionalStream$, InvokeModelWithResponseStream$, ListAsyncInvokes$, StartAsyncInvoke$; +var _A2, _AB, _ADE3, _AG, _AGD, _AGR, _AGRp, _AIM, _AIODC, _AIS, _AISODC, _AISs, _AS, _ATC, _ATCu, _B, _BIPP, _BOPP, _C2, _CB, _CBD, _CBDE, _CBS, _CBSE, _CBSEo, _CBo, _CC, _CCB, _CD, _CDL, _CDi, _CE, _CGC, _CGCL, _CL, _CM, _CO, _CPB, _CR, _CRo, _CS2, _CSC, _CSCD, _CSCL, _CSCLD, _CSM, _CSME, _CSO, _CSR, _CSRo, _CST, _CT2, _CTI, _CTR2, _CTRo, _CTRou, _CT_, _CTo, _Ci, _Co, _DB, _DCB, _DCBo, _DCL, _DCLo, _DPL, _DS2, _EB, _GA, _GAI, _GAIR, _GAIRe, _GAL, _GALM, _GAM, _GARDSL, _GARF, _GARFL, _GARIF, _GARIFu, _GARITR, _GARITRL, _GARLW, _GARNTF, _GARPA, _GARR, _GARRL, _GARS, _GARSF, _GARSL, _GARSLC, _GARSNLC, _GARSu, _GART, _GARTAF, _GARTCF, _GARTL, _GARTO, _GARTOL, _GARVF, _GC, _GCB, _GCBL, _GCCB, _GCF, _GCFL, _GCGF, _GCGFu, _GCGPA, _GCIB, _GCIS, _GCPA, _GCTB, _GCW, _GCWL, _GCu, _GIB, _GIC, _GIM, _GIS, _GMW, _GMWL, _GOC, _GOCL, _GPEF, _GPEFL, _GRF, _GRFL, _GSC, _GSIPA, _GT, _GTA, _GTB, _GTCC, _GTL, _GTPA, _GU, _GWPA, _IB, _IBD, _IBS, _IC, _IM, _IMR, _IMRn, _IMTR, _IMWBS, _IMWBSI, _IMWBSO, _IMWBSR, _IMWBSRn, _IMWRS, _IMWRSR, _IMWRSRn, _IS, _ISE3, _JSD, _LAI, _LAIR, _LAIRi, _M, _MEE, _MIP, _MNRE, _MSE, _MSEE, _MSEe, _MTE, _Me, _OC, _OF, _OFS, _PB, _PC2, _PP, _PRT, _PVM, _PVV, _RCB, _RCBD, _RM, _RMJ, _RNFE2, _RS, _RTB, _SAI, _SAIR, _SAIRt, _SCB, _SCBy, _SL, _SQEE, _SRB, _SRCB, _SRCBe, _SRL, _ST2, _STC, _STy, _SUE, _T2, _TC2, _TCo, _TE, _TIS, _TL, _TRB, _TRBD, _TRBDo, _TRBS, _TRCB, _TRCBo, _TS, _TU, _TUB, _TUBD, _TUBS, _To, _Too, _VB, _VE2, _VS, _WL, _XABA, _XABCT, _XABG, _XABG_, _XABPL, _XABRM, _XABST, _XABT, _a5, _aGD, _aIS, _aMRF, _aMRFP, _aMRFd, _aR, _aRP, _aRPU, _aRPu, _ac, _an, _as, _au, _aut, _b2, _bO, _bo, _c6, _cBD, _cBI, _cBS, _cBSo, _cC, _cD, _cFS, _cGP, _cGPU, _cP, _cPIU, _cPU, _cPa, _cR, _cRIT, _cRT, _cT, _cTS, _cW, _cWIT, _ch, _ci, _cit, _cl, _co3, _con, _conf, _conv, _d, _dC2, _dCo, _dI, _dP, _dS, _de, _des, _do, _doc, _e6, _eT, _en, _end, _f, _fM, _fS, _fi, _fil, _g, _gA, _gC, _gCu, _gCua, _gI, _gIu, _gO, _gOu, _gPL, _gV, _gu, _h4, _hE5, _hH2, _hQ2, _i2, _iA, _iAn, _iC, _iM, _iMI, _iMn, _iS, _iSE, _iT3, _id, _im, _ima, _imp, _in, _j, _jS, _k, _kKI, _l, _lM, _lMT, _lW, _la, _lo, _m4, _mA, _mI, _mIo, _mO, _mR, _mS, _mSEE, _mSe, _mT, _mTE, _mWL, _ma, _me, _met, _meta, _n, _nL, _nT, _nTo, _o, _oA, _oC, _oDC, _oM, _oS, _oSC, _oT, _op, _ou, _p, _pC, _pCL, _pE, _pR, _pV, _pVA, _q, _r2, _rC2, _rCe, _rM, _rN2, _rT3, _re, _ro, _s6, _sB, _sC, _sE, _sIP, _sIPFU, _sIPU, _sL, _sO, _sODC, _sPM, _sR, _sRI, _sRL, _sRe, _sRu, _sS, _sT3, _sTA, _sTB, _sTe, _sTy, _sU, _sUE, _sa, _sc2, _sch, _se3, _si, _so, _st, _sta, _stat, _str, _stre, _stri, _stru, _sy, _t2, _tA, _tC, _tCe, _tCo, _tCoo, _tE, _tF, _tP, _tPU, _tPo, _tR, _tS, _tT3, _tU, _tUI, _ta, _te, _tem, _th, _ti, _to, _too, _tool, _top, _tr, _tra, _tran, _ty, _u, _uC, _uP, _ur, _url, _v, _vE, _va, _vi, _w, _wP, _wPU, n05, _s_registry5, BedrockRuntimeServiceException$, n0_registry5, AccessDeniedException$3, ConflictException$, InternalServerException$3, ModelErrorException$, ModelNotReadyException$, ModelStreamErrorException$, ModelTimeoutException$, ResourceNotFoundException$2, ServiceQuotaExceededException$, ServiceUnavailableException$, ThrottlingException$, ValidationException$2, errorTypeRegistries5, AsyncInvokeMessage, Body2, GuardrailAutomatedReasoningStatementLogicContent, GuardrailAutomatedReasoningStatementNaturalLanguageContent, ModelInputPayload, PartBody, RequestMetadataJson, AnyToolChoice$, AppliedGuardrailDetails$, ApplyGuardrailRequest$, ApplyGuardrailResponse$, AsyncInvokeS3OutputDataConfig$, AsyncInvokeSummary$, AudioBlock$, AutoToolChoice$, BidirectionalInputPayloadPart$, BidirectionalOutputPayloadPart$, CacheDetail$, CachePointBlock$, Citation$, CitationsConfig$, CitationsContentBlock$, CitationsDelta$, CitationSourceContentDelta$, ContentBlockDeltaEvent$, ContentBlockStartEvent$, ContentBlockStopEvent$, ConverseMetrics$, ConverseRequest$, ConverseResponse$, ConverseStreamMetadataEvent$, ConverseStreamMetrics$, ConverseStreamRequest$, ConverseStreamResponse$, ConverseStreamTrace$, ConverseTokensRequest$, ConverseTrace$, CountTokensRequest$, CountTokensResponse$, DocumentBlock$, DocumentCharLocation$, DocumentChunkLocation$, DocumentPageLocation$, ErrorBlock$, GetAsyncInvokeRequest$, GetAsyncInvokeResponse$, GuardrailAssessment$, GuardrailAutomatedReasoningImpossibleFinding$, GuardrailAutomatedReasoningInputTextReference$, GuardrailAutomatedReasoningInvalidFinding$, GuardrailAutomatedReasoningLogicWarning$, GuardrailAutomatedReasoningNoTranslationsFinding$, GuardrailAutomatedReasoningPolicyAssessment$, GuardrailAutomatedReasoningRule$, GuardrailAutomatedReasoningSatisfiableFinding$, GuardrailAutomatedReasoningScenario$, GuardrailAutomatedReasoningStatement$, GuardrailAutomatedReasoningTooComplexFinding$, GuardrailAutomatedReasoningTranslation$, GuardrailAutomatedReasoningTranslationAmbiguousFinding$, GuardrailAutomatedReasoningTranslationOption$, GuardrailAutomatedReasoningValidFinding$, GuardrailConfiguration$, GuardrailContentFilter$, GuardrailContentPolicyAssessment$, GuardrailContextualGroundingFilter$, GuardrailContextualGroundingPolicyAssessment$, GuardrailConverseImageBlock$, GuardrailConverseTextBlock$, GuardrailCoverage$, GuardrailCustomWord$, GuardrailImageBlock$, GuardrailImageCoverage$, GuardrailInvocationMetrics$, GuardrailManagedWord$, GuardrailOutputContent$, GuardrailPiiEntityFilter$, GuardrailRegexFilter$, GuardrailSensitiveInformationPolicyAssessment$, GuardrailStreamConfiguration$, GuardrailTextBlock$, GuardrailTextCharactersCoverage$, GuardrailTopic$, GuardrailTopicPolicyAssessment$, GuardrailTraceAssessment$, GuardrailUsage$, GuardrailWordPolicyAssessment$, ImageBlock$, ImageBlockDelta$, ImageBlockStart$, InferenceConfiguration$, InvokeModelRequest$, InvokeModelResponse$, InvokeModelTokensRequest$, InvokeModelWithBidirectionalStreamRequest$, InvokeModelWithBidirectionalStreamResponse$, InvokeModelWithResponseStreamRequest$, InvokeModelWithResponseStreamResponse$, JsonSchemaDefinition$, ListAsyncInvokesRequest$, ListAsyncInvokesResponse$, Message$, MessageStartEvent$, MessageStopEvent$, OutputConfig$, OutputFormat$, PayloadPart$, PerformanceConfiguration$, PromptRouterTrace$, ReasoningTextBlock$, S3Location$, SearchResultBlock$, SearchResultContentBlock$, SearchResultLocation$, ServiceTier$, SpecificToolChoice$, StartAsyncInvokeRequest$, StartAsyncInvokeResponse$, SystemTool$, Tag$2, TokenUsage$, ToolConfiguration$, ToolResultBlock$, ToolResultBlockStart$, ToolSpecification$, ToolUseBlock$, ToolUseBlockDelta$, ToolUseBlockStart$, VideoBlock$, WebLocation$, AdditionalModelResponseFieldPaths, AsyncInvokeSummaries, CacheDetailsList, CitationGeneratedContentList, Citations, CitationSourceContentList, CitationSourceContentListDelta, ContentBlocks, DocumentContentBlocks, GuardrailAssessmentList, GuardrailAutomatedReasoningDifferenceScenarioList, GuardrailAutomatedReasoningFindingList, GuardrailAutomatedReasoningInputTextReferenceList, GuardrailAutomatedReasoningRuleList, GuardrailAutomatedReasoningStatementList, GuardrailAutomatedReasoningTranslationList, GuardrailAutomatedReasoningTranslationOptionList, GuardrailContentBlockList, GuardrailContentFilterList, GuardrailContentQualifierList, GuardrailContextualGroundingFilters, GuardrailConverseContentQualifierList, GuardrailCustomWordList, GuardrailManagedWordList, GuardrailOriginList, GuardrailOutputContentList, GuardrailPiiEntityFilterList, GuardrailRegexFilterList, GuardrailTopicList, Messages, ModelOutputs, NonEmptyStringList, SearchResultContentBlocks, SystemContentBlocks, TagList, ToolResultBlocksDelta, ToolResultContentBlocks, Tools, GuardrailAssessmentListMap, GuardrailAssessmentMap, PromptVariableMap, RequestMetadata, AsyncInvokeOutputDataConfig$, AudioSource$, CitationGeneratedContent$, CitationLocation$, CitationSourceContent$, ContentBlock$, ContentBlockDelta$, ContentBlockStart$, ConverseOutput$, ConverseStreamOutput$, CountTokensInput$, DocumentContentBlock$, DocumentSource$, GuardrailAutomatedReasoningFinding$, GuardrailContentBlock$, GuardrailConverseContentBlock$, GuardrailConverseImageSource$, GuardrailImageSource$, ImageSource$, InvokeModelWithBidirectionalStreamInput$, InvokeModelWithBidirectionalStreamOutput$, OutputFormatStructure$, PromptVariableValues$, ReasoningContentBlock$, ReasoningContentBlockDelta$, ResponseStream$, SystemContentBlock$, Tool$, ToolChoice$, ToolInputSchema$, ToolResultBlockDelta$, ToolResultContentBlock$, VideoSource$, ApplyGuardrail$, Converse$, ConverseStream$, CountTokens$, GetAsyncInvoke$, InvokeModel$, InvokeModelWithBidirectionalStream$, InvokeModelWithResponseStream$, ListAsyncInvokes$, StartAsyncInvoke$; var init_schemas_05 = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/schemas/schemas_0.js"() { "use strict"; @@ -139576,6 +144258,7 @@ var init_schemas_05 = __esm({ _RCB = "ReasoningContentBlock"; _RCBD = "ReasoningContentBlockDelta"; _RM = "RequestMetadata"; + _RMJ = "RequestMetadataJson"; _RNFE2 = "ResourceNotFoundException"; _RS = "ResponseStream"; _RTB = "ReasoningTextBlock"; @@ -139622,9 +144305,10 @@ var init_schemas_05 = __esm({ _XABG = "X-Amzn-Bedrock-GuardrailIdentifier"; _XABG_ = "X-Amzn-Bedrock-GuardrailVersion"; _XABPL = "X-Amzn-Bedrock-PerformanceConfig-Latency"; + _XABRM = "X-Amzn-Bedrock-Request-Metadata"; _XABST = "X-Amzn-Bedrock-Service-Tier"; _XABT = "X-Amzn-Bedrock-Trace"; - _a4 = "action"; + _a5 = "action"; _aGD = "appliedGuardrailDetails"; _aIS = "asyncInvokeSummaries"; _aMRF = "additionalModelRequestFields"; @@ -139639,10 +144323,10 @@ var init_schemas_05 = __esm({ _as = "assessments"; _au = "audio"; _aut = "auto"; - _b = "bytes"; + _b2 = "bytes"; _bO = "bucketOwner"; _bo = "body"; - _c5 = "client"; + _c6 = "client"; _cBD = "contentBlockDelta"; _cBI = "contentBlockIndex"; _cBS = "contentBlockStart"; @@ -139865,7 +144549,7 @@ var init_schemas_05 = __esm({ -3, n05, _ADE3, - { [_e6]: _c5, [_hE5]: 403 }, + { [_e6]: _c6, [_hE5]: 403 }, [_m4], [0] ]; @@ -139874,7 +144558,7 @@ var init_schemas_05 = __esm({ -3, n05, _CE, - { [_e6]: _c5, [_hE5]: 400 }, + { [_e6]: _c6, [_hE5]: 400 }, [_m4], [0] ]; @@ -139892,7 +144576,7 @@ var init_schemas_05 = __esm({ -3, n05, _MEE, - { [_e6]: _c5, [_hE5]: 424 }, + { [_e6]: _c6, [_hE5]: 424 }, [_m4, _oSC, _rN2], [0, 1, 0] ]; @@ -139901,7 +144585,7 @@ var init_schemas_05 = __esm({ -3, n05, _MNRE, - { [_e6]: _c5, [_hE5]: 429 }, + { [_e6]: _c6, [_hE5]: 429 }, [_m4], [0] ]; @@ -139910,7 +144594,7 @@ var init_schemas_05 = __esm({ -3, n05, _MSEE, - { [_e6]: _c5, [_hE5]: 424 }, + { [_e6]: _c6, [_hE5]: 424 }, [_m4, _oSC, _oM], [0, 1, 0] ]; @@ -139919,7 +144603,7 @@ var init_schemas_05 = __esm({ -3, n05, _MTE, - { [_e6]: _c5, [_hE5]: 408 }, + { [_e6]: _c6, [_hE5]: 408 }, [_m4], [0] ]; @@ -139928,7 +144612,7 @@ var init_schemas_05 = __esm({ -3, n05, _RNFE2, - { [_e6]: _c5, [_hE5]: 404 }, + { [_e6]: _c6, [_hE5]: 404 }, [_m4], [0] ]; @@ -139937,7 +144621,7 @@ var init_schemas_05 = __esm({ -3, n05, _SQEE, - { [_e6]: _c5, [_hE5]: 400 }, + { [_e6]: _c6, [_hE5]: 400 }, [_m4], [0] ]; @@ -139955,7 +144639,7 @@ var init_schemas_05 = __esm({ -3, n05, _TE, - { [_e6]: _c5, [_hE5]: 429 }, + { [_e6]: _c6, [_hE5]: 429 }, [_m4], [0] ]; @@ -139964,7 +144648,7 @@ var init_schemas_05 = __esm({ -3, n05, _VE2, - { [_e6]: _c5, [_hE5]: 400 }, + { [_e6]: _c6, [_hE5]: 400 }, [_m4], [0] ]; @@ -139979,6 +144663,7 @@ var init_schemas_05 = __esm({ GuardrailAutomatedReasoningStatementNaturalLanguageContent = [0, n05, _GARSNLC, 8, 0]; ModelInputPayload = [0, n05, _MIP, 8, 15]; PartBody = [0, n05, _PB, 8, 21]; + RequestMetadataJson = [0, n05, _RMJ, 8, 0]; AnyToolChoice$ = [ 3, n05, @@ -140009,7 +144694,7 @@ var init_schemas_05 = __esm({ n05, _AGRp, 0, - [_u, _a4, _o, _as, _aR, _gC], + [_u, _a5, _o, _as, _aR, _gC], [() => GuardrailUsage$, 0, () => GuardrailOutputContentList, [() => GuardrailAssessmentList, 0], 0, () => GuardrailCoverage$], 4 ]; @@ -140053,7 +144738,7 @@ var init_schemas_05 = __esm({ n05, _BIPP, 8, - [_b], + [_b2], [[() => PartBody, 0]] ]; BidirectionalOutputPayloadPart$ = [ @@ -140061,7 +144746,7 @@ var init_schemas_05 = __esm({ n05, _BOPP, 8, - [_b], + [_b2], [[() => PartBody, 0]] ]; CacheDetail$ = [ @@ -140454,7 +145139,7 @@ var init_schemas_05 = __esm({ n05, _GCF, 0, - [_ty, _conf, _a4, _fS, _de], + [_ty, _conf, _a5, _fS, _de], [0, 0, 0, 0, 2], 3 ]; @@ -140472,7 +145157,7 @@ var init_schemas_05 = __esm({ n05, _GCGF, 0, - [_ty, _th, _sc2, _a4, _de], + [_ty, _th, _sc2, _a5, _de], [0, 1, 1, 0, 2], 4 ]; @@ -140515,7 +145200,7 @@ var init_schemas_05 = __esm({ n05, _GCW, 0, - [_ma, _a4, _de], + [_ma, _a5, _de], [0, 0, 2], 2 ]; @@ -140549,7 +145234,7 @@ var init_schemas_05 = __esm({ n05, _GMW, 0, - [_ma, _ty, _a4, _de], + [_ma, _ty, _a5, _de], [0, 0, 0, 2], 3 ]; @@ -140566,7 +145251,7 @@ var init_schemas_05 = __esm({ n05, _GPEF, 0, - [_ma, _ty, _a4, _de], + [_ma, _ty, _a5, _de], [0, 0, 0, 2], 3 ]; @@ -140575,7 +145260,7 @@ var init_schemas_05 = __esm({ n05, _GRF, 0, - [_a4, _n, _ma, _r2, _de], + [_a5, _n, _ma, _r2, _de], [0, 0, 0, 0, 2], 1 ]; @@ -140618,7 +145303,7 @@ var init_schemas_05 = __esm({ n05, _GT, 0, - [_n, _ty, _a4, _de], + [_n, _ty, _a5, _de], [0, 0, 0, 2], 3 ]; @@ -140696,8 +145381,8 @@ var init_schemas_05 = __esm({ n05, _IMR, 0, - [_mI, _bo, _cT, _ac, _tr, _gIu, _gV, _pCL, _sTe], - [[0, 1], [() => Body2, 16], [0, { [_hH2]: _CT_ }], [0, { [_hH2]: _A2 }], [0, { [_hH2]: _XABT }], [0, { [_hH2]: _XABG }], [0, { [_hH2]: _XABG_ }], [0, { [_hH2]: _XABPL }], [0, { [_hH2]: _XABST }]], + [_mI, _bo, _cT, _ac, _tr, _gIu, _gV, _pCL, _sTe, _rM], + [[0, 1], [() => Body2, 16], [0, { [_hH2]: _CT_ }], [0, { [_hH2]: _A2 }], [0, { [_hH2]: _XABT }], [0, { [_hH2]: _XABG }], [0, { [_hH2]: _XABG_ }], [0, { [_hH2]: _XABPL }], [0, { [_hH2]: _XABST }], [() => RequestMetadataJson, { [_hH2]: _XABRM }]], 1 ]; InvokeModelResponse$ = [ @@ -140741,8 +145426,8 @@ var init_schemas_05 = __esm({ n05, _IMWRSR, 0, - [_mI, _bo, _cT, _ac, _tr, _gIu, _gV, _pCL, _sTe], - [[0, 1], [() => Body2, 16], [0, { [_hH2]: _CT_ }], [0, { [_hH2]: _XABA }], [0, { [_hH2]: _XABT }], [0, { [_hH2]: _XABG }], [0, { [_hH2]: _XABG_ }], [0, { [_hH2]: _XABPL }], [0, { [_hH2]: _XABST }]], + [_mI, _bo, _cT, _ac, _tr, _gIu, _gV, _pCL, _sTe, _rM], + [[0, 1], [() => Body2, 16], [0, { [_hH2]: _CT_ }], [0, { [_hH2]: _XABA }], [0, { [_hH2]: _XABT }], [0, { [_hH2]: _XABG }], [0, { [_hH2]: _XABG_ }], [0, { [_hH2]: _XABPL }], [0, { [_hH2]: _XABST }], [() => RequestMetadataJson, { [_hH2]: _XABRM }]], 1 ]; InvokeModelWithResponseStreamResponse$ = [ @@ -140828,7 +145513,7 @@ var init_schemas_05 = __esm({ n05, _PP, 8, - [_b], + [_b2], [[() => PartBody, 0]] ]; PerformanceConfiguration$ = [ @@ -141360,7 +146045,7 @@ var init_schemas_05 = __esm({ n05, _AS, 8, - [_b, _sL], + [_b2, _sL], [21, () => S3Location$] ]; CitationGeneratedContent$ = [ @@ -141448,7 +146133,7 @@ var init_schemas_05 = __esm({ n05, _DS2, 0, - [_b, _sL, _te, _co3], + [_b2, _sL, _te, _co3], [21, () => S3Location$, 0, () => DocumentContentBlocks] ]; GuardrailAutomatedReasoningFinding$ = [ @@ -141480,7 +146165,7 @@ var init_schemas_05 = __esm({ n05, _GCIS, 8, - [_b], + [_b2], [21] ]; GuardrailImageSource$ = [ @@ -141488,7 +146173,7 @@ var init_schemas_05 = __esm({ n05, _GIS, 8, - [_b], + [_b2], [21] ]; ImageSource$ = [ @@ -141496,7 +146181,7 @@ var init_schemas_05 = __esm({ n05, _IS, 8, - [_b, _sL], + [_b2, _sL], [21, () => S3Location$] ]; InvokeModelWithBidirectionalStreamInput$ = [ @@ -141608,7 +146293,7 @@ var init_schemas_05 = __esm({ n05, _VS, 0, - [_b, _sL], + [_b2, _sL], [21, () => S3Location$] ]; ApplyGuardrail$ = [ @@ -141699,13 +146384,12 @@ var getRuntimeConfig9; var init_runtimeConfig_shared5 = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeConfig.shared.js"() { "use strict"; - init_dist_es29(); + init_httpAuthSchemes2(); init_protocols2(); - init_dist_es21(); - init_dist_es27(); - init_dist_es19(); - init_dist_es11(); - init_dist_es10(); + init_dist_es5(); + init_client3(); + init_protocols(); + init_serde2(); init_httpAuthSchemeProvider(); init_endpointResolver5(); init_schemas_05(); @@ -141753,22 +146437,18 @@ var init_runtimeConfig5 = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeConfig.js"() { "use strict"; init_package(); - init_dist_es29(); - init_dist_es62(); - init_dist_es63(); - init_dist_es56(); - init_dist_es51(); - init_dist_es40(); + init_client4(); + init_httpAuthSchemes2(); init_dist_es21(); - init_dist_es64(); - init_dist_es52(); - init_dist_es47(); - init_dist_es44(); + init_dist_es22(); init_dist_es14(); - init_dist_es27(); - init_dist_es53(); - init_dist_es54(); - init_dist_es31(); + init_dist_es5(); + init_client3(); + init_config3(); + init_event_streams(); + init_retry3(); + init_serde2(); + init_dist_es11(); init_runtimeConfig_shared5(); getRuntimeConfig10 = (config) => { emitWarningIfUnsupportedVersion2(process.version); @@ -141791,7 +146471,7 @@ var init_runtimeConfig5 = __esm({ credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }), eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider, - eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, + eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider2, httpAuthSchemes: config?.httpAuthSchemes ?? [ { schemeId: "aws.auth#sigv4", @@ -141821,7 +146501,7 @@ var init_runtimeConfig5 = __esm({ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE }, config), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, + streamCollector: config?.streamCollector ?? streamCollector3, useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) @@ -141888,9 +146568,9 @@ var resolveRuntimeExtensions5; var init_runtimeExtensions5 = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeExtensions.js"() { "use strict"; - init_dist_es55(); - init_dist_es2(); - init_dist_es27(); + init_client4(); + init_client3(); + init_protocols(); init_httpAuthExtensionConfiguration5(); resolveRuntimeExtensions5 = (runtimeConfig, extensions) => { const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration5(runtimeConfig)); @@ -141905,20 +146585,17 @@ var BedrockRuntimeClient; var init_BedrockRuntimeClient = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/BedrockRuntimeClient.js"() { "use strict"; - init_dist_es3(); - init_dist_es4(); - init_dist_es5(); + init_client4(); init_dist_es6(); - init_dist_es32(); - init_dist_es38(); - init_dist_es40(); - init_dist_es21(); + init_dist_es7(); + init_dist_es5(); + init_client3(); + init_config3(); + init_endpoints3(); + init_event_streams(); + init_protocols(); + init_retry3(); init_schema2(); - init_dist_es41(); - init_dist_es42(); - init_dist_es46(); - init_dist_es47(); - init_dist_es27(); init_httpAuthSchemeProvider(); init_EndpointParameters(); init_runtimeConfig5(); @@ -141969,11 +146646,11 @@ var ApplyGuardrailCommand; var init_ApplyGuardrailCommand = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/ApplyGuardrailCommand.js"() { "use strict"; - init_dist_es46(); - init_dist_es27(); + init_client3(); + init_endpoints3(); init_EndpointParameters(); init_schemas_05(); - ApplyGuardrailCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o6) { + ApplyGuardrailCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o2) { return [getEndpointPlugin(config, Command3.getEndpointParameterInstructions())]; }).s("AmazonBedrockFrontendService", "ApplyGuardrail", {}).n("BedrockRuntimeClient", "ApplyGuardrailCommand").sc(ApplyGuardrail$).build() { }; @@ -141985,11 +146662,11 @@ var ConverseCommand; var init_ConverseCommand = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/ConverseCommand.js"() { "use strict"; - init_dist_es46(); - init_dist_es27(); + init_client3(); + init_endpoints3(); init_EndpointParameters(); init_schemas_05(); - ConverseCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o6) { + ConverseCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o2) { return [getEndpointPlugin(config, Command3.getEndpointParameterInstructions())]; }).s("AmazonBedrockFrontendService", "Converse", {}).n("BedrockRuntimeClient", "ConverseCommand").sc(Converse$).build() { }; @@ -142001,11 +146678,11 @@ var ConverseStreamCommand; var init_ConverseStreamCommand = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/ConverseStreamCommand.js"() { "use strict"; - init_dist_es46(); - init_dist_es27(); + init_client3(); + init_endpoints3(); init_EndpointParameters(); init_schemas_05(); - ConverseStreamCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o6) { + ConverseStreamCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o2) { return [getEndpointPlugin(config, Command3.getEndpointParameterInstructions())]; }).s("AmazonBedrockFrontendService", "ConverseStream", { eventStream: { @@ -142021,11 +146698,11 @@ var CountTokensCommand; var init_CountTokensCommand = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/CountTokensCommand.js"() { "use strict"; - init_dist_es46(); - init_dist_es27(); + init_client3(); + init_endpoints3(); init_EndpointParameters(); init_schemas_05(); - CountTokensCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o6) { + CountTokensCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o2) { return [getEndpointPlugin(config, Command3.getEndpointParameterInstructions())]; }).s("AmazonBedrockFrontendService", "CountTokens", {}).n("BedrockRuntimeClient", "CountTokensCommand").sc(CountTokens$).build() { }; @@ -142037,11 +146714,11 @@ var GetAsyncInvokeCommand; var init_GetAsyncInvokeCommand = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/GetAsyncInvokeCommand.js"() { "use strict"; - init_dist_es46(); - init_dist_es27(); + init_client3(); + init_endpoints3(); init_EndpointParameters(); init_schemas_05(); - GetAsyncInvokeCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o6) { + GetAsyncInvokeCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o2) { return [getEndpointPlugin(config, Command3.getEndpointParameterInstructions())]; }).s("AmazonBedrockFrontendService", "GetAsyncInvoke", {}).n("BedrockRuntimeClient", "GetAsyncInvokeCommand").sc(GetAsyncInvoke$).build() { }; @@ -142053,11 +146730,11 @@ var InvokeModelCommand; var init_InvokeModelCommand = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/InvokeModelCommand.js"() { "use strict"; - init_dist_es46(); - init_dist_es27(); + init_client3(); + init_endpoints3(); init_EndpointParameters(); init_schemas_05(); - InvokeModelCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o6) { + InvokeModelCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o2) { return [getEndpointPlugin(config, Command3.getEndpointParameterInstructions())]; }).s("AmazonBedrockFrontendService", "InvokeModel", {}).n("BedrockRuntimeClient", "InvokeModelCommand").sc(InvokeModel$).build() { }; @@ -142069,13 +146746,13 @@ var InvokeModelWithBidirectionalStreamCommand; var init_InvokeModelWithBidirectionalStreamCommand = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/InvokeModelWithBidirectionalStreamCommand.js"() { "use strict"; - init_dist_es3(); - init_dist_es38(); - init_dist_es46(); - init_dist_es27(); + init_dist_es6(); + init_dist_es7(); + init_client3(); + init_endpoints3(); init_EndpointParameters(); init_schemas_05(); - InvokeModelWithBidirectionalStreamCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o6) { + InvokeModelWithBidirectionalStreamCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o2) { return [ getEndpointPlugin(config, Command3.getEndpointParameterInstructions()), getEventStreamPlugin(config), @@ -142098,11 +146775,11 @@ var InvokeModelWithResponseStreamCommand; var init_InvokeModelWithResponseStreamCommand = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/InvokeModelWithResponseStreamCommand.js"() { "use strict"; - init_dist_es46(); - init_dist_es27(); + init_client3(); + init_endpoints3(); init_EndpointParameters(); init_schemas_05(); - InvokeModelWithResponseStreamCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o6) { + InvokeModelWithResponseStreamCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o2) { return [getEndpointPlugin(config, Command3.getEndpointParameterInstructions())]; }).s("AmazonBedrockFrontendService", "InvokeModelWithResponseStream", { eventStream: { @@ -142118,11 +146795,11 @@ var ListAsyncInvokesCommand; var init_ListAsyncInvokesCommand = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/ListAsyncInvokesCommand.js"() { "use strict"; - init_dist_es46(); - init_dist_es27(); + init_client3(); + init_endpoints3(); init_EndpointParameters(); init_schemas_05(); - ListAsyncInvokesCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o6) { + ListAsyncInvokesCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o2) { return [getEndpointPlugin(config, Command3.getEndpointParameterInstructions())]; }).s("AmazonBedrockFrontendService", "ListAsyncInvokes", {}).n("BedrockRuntimeClient", "ListAsyncInvokesCommand").sc(ListAsyncInvokes$).build() { }; @@ -142134,11 +146811,11 @@ var StartAsyncInvokeCommand; var init_StartAsyncInvokeCommand = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/StartAsyncInvokeCommand.js"() { "use strict"; - init_dist_es46(); - init_dist_es27(); + init_client3(); + init_endpoints3(); init_EndpointParameters(); init_schemas_05(); - StartAsyncInvokeCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o6) { + StartAsyncInvokeCommand = class extends Command2.classBuilder().ep(commonParams).m(function(Command3, cs2, config, o2) { return [getEndpointPlugin(config, Command3.getEndpointParameterInstructions())]; }).s("AmazonBedrockFrontendService", "StartAsyncInvoke", {}).n("BedrockRuntimeClient", "StartAsyncInvokeCommand").sc(StartAsyncInvoke$).build() { }; @@ -142150,7 +146827,7 @@ var paginateListAsyncInvokes; var init_ListAsyncInvokesPaginator = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/pagination/ListAsyncInvokesPaginator.js"() { "use strict"; - init_dist_es21(); + init_dist_es5(); init_BedrockRuntimeClient(); init_ListAsyncInvokesCommand(); paginateListAsyncInvokes = createPaginator(BedrockRuntimeClient, ListAsyncInvokesCommand, "nextToken", "nextToken", "maxResults"); @@ -142162,7 +146839,7 @@ var commands5, paginators, BedrockRuntime; var init_BedrockRuntime = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/BedrockRuntime.js"() { "use strict"; - init_dist_es27(); + init_client3(); init_BedrockRuntimeClient(); init_ApplyGuardrailCommand(); init_ConverseCommand(); @@ -142439,6 +147116,7 @@ var init_enums3 = __esm({ }; ConversationRole = { ASSISTANT: "assistant", + SYSTEM: "system", USER: "user" }; OutputFormatType = { @@ -142737,7 +147415,7 @@ __export(dist_es_exports8, { errorTypeRegistries: () => errorTypeRegistries5, paginateListAsyncInvokes: () => paginateListAsyncInvokes }); -var init_dist_es65 = __esm({ +var init_dist_es23 = __esm({ "node_modules/@aws-sdk/client-bedrock-runtime/dist-es/index.js"() { "use strict"; init_BedrockRuntimeClient(); @@ -142753,35 +147431,35 @@ var init_dist_es65 = __esm({ }); // node_modules/ai-ctrf/dist/models/bedrock.js -var require_bedrock = __commonJS({ +var require_bedrock2 = __commonJS({ "node_modules/ai-ctrf/dist/models/bedrock.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o6, m6, k7, k22) { + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m6, k7); - if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { + var desc = Object.getOwnPropertyDescriptor(m3, k7); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { - return m6[k7]; + return m3[k7]; } }; } - Object.defineProperty(o6, k22, desc); - }) : (function(o6, m6, k7, k22) { + Object.defineProperty(o2, k22, desc); + }) : (function(o2, m3, k7, k22) { if (k22 === void 0) k22 = k7; - o6[k22] = m6[k7]; + o2[k22] = m3[k7]; })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o6, v8) { - Object.defineProperty(o6, "default", { enumerable: true, value: v8 }); - }) : function(o6, v8) { - o6["default"] = v8; + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v2) { + Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); + }) : function(o2, v2) { + o2["default"] = v2; }); var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o6) { - ownKeys = Object.getOwnPropertyNames || function(o7) { + var ownKeys = function(o2) { + ownKeys = Object.getOwnPropertyNames || function(o3) { var ar = []; - for (var k7 in o7) if (Object.prototype.hasOwnProperty.call(o7, k7)) ar[ar.length] = k7; + for (var k7 in o3) if (Object.prototype.hasOwnProperty.call(o3, k7)) ar[ar.length] = k7; return ar; }; - return ownKeys(o6); + return ownKeys(o2); }; return function(mod) { if (mod && mod.__esModule) return mod; @@ -142795,11 +147473,11 @@ var require_bedrock = __commonJS({ })(); var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -142815,7 +147493,7 @@ var require_bedrock = __commonJS({ } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -142826,11 +147504,10 @@ var require_bedrock = __commonJS({ var common_1 = require_common3(); var consolidated_summary_1 = require_consolidated_summary(); var constants_1 = require_constants9(); - var assess_1 = require_assess(); function bedrock(systemPrompt, prompt, args) { return __awaiter16(this, void 0, void 0, function* () { - var _a5, _b2, _c6, _d2, _e7; - const region = (_a5 = process.env.AWS_REGION) !== null && _a5 !== void 0 ? _a5 : "us-west-2"; + var _a6, _b3, _c7, _d2, _e7; + const region = (_a6 = process.env.AWS_REGION) !== null && _a6 !== void 0 ? _a6 : "us-west-2"; const accessKeyId = process.env.AWS_ACCESS_KEY_ID; const secretAccessKey = process.env.AWS_SECRET_ACCESS_KEY; const sessionToken = process.env.AWS_SESSION_TOKEN; @@ -142839,7 +147516,7 @@ var require_bedrock = __commonJS({ return null; } try { - const { BedrockRuntimeClient: BedrockRuntimeClient2, InvokeModelCommand: InvokeModelCommand2 } = yield Promise.resolve().then(() => __importStar((init_dist_es65(), __toCommonJS(dist_es_exports8)))); + const { BedrockRuntimeClient: BedrockRuntimeClient2, InvokeModelCommand: InvokeModelCommand2 } = yield Promise.resolve().then(() => __importStar((init_dist_es23(), __toCommonJS(dist_es_exports8)))); const client2 = new BedrockRuntimeClient2({ region, credentials: Object.assign({ @@ -142847,20 +147524,20 @@ var require_bedrock = __commonJS({ secretAccessKey }, sessionToken != null && { sessionToken }) }); - const modelId = (_b2 = args.model) !== null && _b2 !== void 0 ? _b2 : "anthropic.claude-3-5-sonnet-20240620-v1:0"; - const body2 = JSON.stringify(Object.assign(Object.assign({ anthropic_version: "bedrock-2023-05-31", max_tokens: (_c6 = args.maxTokens) !== null && _c6 !== void 0 ? _c6 : 4e3, system: systemPrompt, messages: [ + const modelId = (_b3 = args.model) !== null && _b3 !== void 0 ? _b3 : "anthropic.claude-3-5-sonnet-20240620-v1:0"; + const body2 = JSON.stringify(Object.assign(Object.assign({ anthropic_version: "bedrock-2023-05-31", max_tokens: (_c7 = args.maxTokens) !== null && _c7 !== void 0 ? _c7 : 4e3, system: systemPrompt, messages: [ { role: "user", content: (0, common_1.stripAnsi)(prompt) } ] }, args.temperature != null && { temperature: args.temperature }), args.topP != null && { top_p: args.topP })); - const command = new InvokeModelCommand2({ + const command2 = new InvokeModelCommand2({ modelId, body: body2, contentType: "application/json", accept: "application/json" }); - const response = yield client2.send(command); + const response = yield client2.send(command2); const responseBody = JSON.parse(new TextDecoder().decode(response.body)); if (((_e7 = (_d2 = responseBody.content) === null || _d2 === void 0 ? void 0 : _d2[0]) === null || _e7 === void 0 ? void 0 : _e7.text) != null) { return responseBody.content[0].text; @@ -142874,29 +147551,32 @@ var require_bedrock = __commonJS({ } function bedrockFailedTestSummary2(report_1, args_1, file_1) { return __awaiter16(this, arguments, void 0, function* (report, args, file, log3 = false) { - var _a5, _b2; - const assessmentType = (_a5 = args.assess) !== null && _a5 !== void 0 ? _a5 : "failed"; - const assessmentConfig = (0, assess_1.getAssessmentConfig)(assessmentType); - const testsToAnalyze = (0, assess_1.filterTestsByAssessment)(report.results.tests, assessmentType); - testsToAnalyze.forEach((test) => { + var _a6; + const failedTests = report.results.tests.filter((test) => test.status === "failed"); + failedTests.forEach((test) => { if (test.extra != null) { delete test.extra; } }); let logged = false; let messageCount = 0; - for (const test of testsToAnalyze) { + for (const test of failedTests) { if (args.maxMessages != null && messageCount >= args.maxMessages) { break; } - let prompt = (0, common_1.generateAssessmentPromptContext)(test, report, assessmentType); + let prompt = `Report: +${JSON.stringify(test, null, 2)}. + +Tool:${report.results.tool.name}. + + Please provide a human-readable failure summary that explains why you think the test might have failed and ways to fix`; if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { prompt += ` Additional Context: ${args.additionalPromptContext}`; } - let systemPrompt = (_b2 = args.systemPrompt) !== null && _b2 !== void 0 ? _b2 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; + let systemPrompt = (_a6 = args.systemPrompt) !== null && _a6 !== void 0 ? _a6 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; if (args.additionalSystemPromptContext != null && args.additionalSystemPromptContext !== "") { systemPrompt += ` @@ -142908,13 +147588,12 @@ ${args.additionalSystemPromptContext}`; messageCount++; if (args.log === true && !logged) { console.log("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"); - console.log(`\u2728 AI Test Reporter Summary - ${assessmentConfig.label}`); + console.log("\u2728 AI Test Reporter Summary"); console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n"); logged = true; } if (args.log === true) { - const icon = (0, common_1.getAssessmentIcon)(assessmentType); - console.log(`${icon} ${assessmentConfig.label}: ${test.name} + console.log(`\u274C Failed Test: ${test.name} `); console.log(`${response} `); @@ -142939,11 +147618,11 @@ var require_custom = __commonJS({ "use strict"; var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -142959,7 +147638,7 @@ var require_custom = __commonJS({ } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -142974,16 +147653,15 @@ var require_custom = __commonJS({ var common_1 = require_common3(); var consolidated_summary_1 = require_consolidated_summary(); var constants_1 = require_constants9(); - var assess_1 = require_assess(); function customService(systemPrompt, prompt, args, customUrl) { return __awaiter16(this, void 0, void 0, function* () { - var _a5, _b2, _c6, _d2, _e7, _f2, _g2; - const baseURL = (_a5 = customUrl !== null && customUrl !== void 0 ? customUrl : args.customUrl) !== null && _a5 !== void 0 ? _a5 : process.env.AI_CTRF_CUSTOM_URL; + var _a6, _b3, _c7, _d2, _e7, _f2, _g2; + const baseURL = (_a6 = customUrl !== null && customUrl !== void 0 ? customUrl : args.customUrl) !== null && _a6 !== void 0 ? _a6 : process.env.AI_CTRF_CUSTOM_URL; if (baseURL == null) { console.error("Error: Custom URL is required. Please provide it via --url option, customUrl parameter, or AI_CTRF_CUSTOM_URL environment variable."); return null; } - const apiKey = (_c6 = (_b2 = process.env.AI_CTRF_CUSTOM_API_KEY) !== null && _b2 !== void 0 ? _b2 : process.env.OPENAI_API_KEY) !== null && _c6 !== void 0 ? _c6 : "not-needed"; + const apiKey = (_c7 = (_b3 = process.env.AI_CTRF_CUSTOM_API_KEY) !== null && _b3 !== void 0 ? _b3 : process.env.OPENAI_API_KEY) !== null && _c7 !== void 0 ? _c7 : "not-needed"; const client2 = new openai_1.default({ apiKey, baseURL @@ -143002,29 +147680,32 @@ var require_custom = __commonJS({ } function customFailedTestSummary(report_1, args_1, file_1) { return __awaiter16(this, arguments, void 0, function* (report, args, file, log3 = false, customUrl) { - var _a5, _b2; - const assessmentType = (_a5 = args.assess) !== null && _a5 !== void 0 ? _a5 : "failed"; - const assessmentConfig = (0, assess_1.getAssessmentConfig)(assessmentType); - const testsToAnalyze = (0, assess_1.filterTestsByAssessment)(report.results.tests, assessmentType); - testsToAnalyze.forEach((test) => { + var _a6; + const failedTests = report.results.tests.filter((test) => test.status === "failed"); + failedTests.forEach((test) => { if (test.extra != null) { delete test.extra; } }); let logged = false; let messageCount = 0; - for (const test of testsToAnalyze) { + for (const test of failedTests) { if (args.maxMessages != null && messageCount >= args.maxMessages) { break; } - let prompt = (0, common_1.generateAssessmentPromptContext)(test, report, assessmentType); + let prompt = `Report: +${JSON.stringify(test, null, 2)}. + +Tool:${report.results.tool.name}. + + Please provide a human-readable failure summary that explains why you think the test might have failed and ways to fix`; if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { prompt += ` Additional Context: ${args.additionalPromptContext}`; } - let systemPrompt = (_b2 = args.systemPrompt) !== null && _b2 !== void 0 ? _b2 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; + let systemPrompt = (_a6 = args.systemPrompt) !== null && _a6 !== void 0 ? _a6 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; if (args.additionalSystemPromptContext != null && args.additionalSystemPromptContext !== "") { systemPrompt += ` @@ -143043,8 +147724,7 @@ ${args.additionalSystemPromptContext}`; logged = true; } if (args.log === true) { - const icon = (0, common_1.getAssessmentIcon)(assessmentType); - console.log(`${icon} ${assessmentConfig.label}: ${test.name} + console.log(`\u274C Failed Test: ${test.name} `); console.log(`${response} `); @@ -143069,11 +147749,11 @@ var require_consolidated_summary = __commonJS({ "use strict"; var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -143089,7 +147769,7 @@ var require_consolidated_summary = __commonJS({ } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -143104,29 +147784,21 @@ var require_consolidated_summary = __commonJS({ var gemini_1 = require_gemini(); var perplexity_1 = require_perplexity(); var openrouter_1 = require_openrouter(); - var bedrock_1 = require_bedrock(); + var bedrock_1 = require_bedrock2(); var custom_1 = require_custom(); - var assess_1 = require_assess(); function generateConsolidatedSummary(report, model, args, customUrl) { return __awaiter16(this, void 0, void 0, function* () { - var _a5, _b2, _c6, _d2, _e7, _f2, _g2, _h5, _j2, _k2, _l2, _m5; - const assessmentType = (_a5 = args.assess) !== null && _a5 !== void 0 ? _a5 : "failed"; - const assessmentConfig = (0, assess_1.getAssessmentConfig)(assessmentType); - const testsToAnalyze = (0, assess_1.filterTestsByAssessment)(report.results.tests, assessmentType); + var _a6, _b3, _c7, _d2, _e7, _f2, _g2, _h5, _j2, _k2, _l2; + const failedTests = report.results.tests.filter((test) => test.status === "failed"); const aiSummaries = []; - for (const test of testsToAnalyze) { + for (const test of failedTests) { if (test.ai != null && test.ai.trim() !== "") { aiSummaries.push(`Test Name: ${test.name} AI Summary: ${test.ai} `); } } - let systemPrompt = `You are tasked with summarizing test analysis results. Your goal is to provide a concise, high-level overview based on the individual test summaries provided. - -Assessment Context: ${assessmentConfig.description} -${assessmentConfig.systemPromptSuffix} - -Focus on identifying patterns or root causes. Keep the summary brief and informative, without repeating the test details or providing step-by-step instructions. Avoid unnecessary verbosity and focus on delivering actionable insights. + let systemPrompt = `You are tasked with summarizing the results of a test run that contains test failures. Your goal is to provide a concise, high-level overview of what went wrong in the test run. Focus on identifying patterns or root causes that might explain why these tests failed. Keep the summary brief and informative, without repeating the test details or providing step-by-step instructions. Avoid unnecessary verbosity and focus on delivering actionable insights. Avoid: - Including any code in your response. - Adding generic conclusions or advice such as "By following these steps..." @@ -143136,11 +147808,11 @@ Focus on identifying patterns or root causes. Keep the summary brief and informa ${args.additionalSystemPromptContext}`; } - let consolidatedPrompt = `The following tests from the ${assessmentConfig.label} assessment: + let consolidatedPrompt = `The following tests failed in the suite: ${aiSummaries.join("\n")} -A total of ${testsToAnalyze.length} tests were analyzed (${assessmentConfig.label}). Please provide a high-level summary of the findings across the suite and suggest what might be the root causes or patterns.`; +A total of ${failedTests.length} tests failed in this test suite. Please provide a high-level summary of what went wrong across the suite and suggest what might be the root causes or patterns.`; if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { consolidatedPrompt += ` @@ -143149,25 +147821,25 @@ ${args.additionalPromptContext}`; } let consolidatedSummary = ""; if (model === "openai") { - consolidatedSummary = (_b2 = yield (0, openai_1.openAI)(systemPrompt, consolidatedPrompt, args)) !== null && _b2 !== void 0 ? _b2 : ""; + consolidatedSummary = (_a6 = yield (0, openai_1.openAI)(systemPrompt, consolidatedPrompt, args)) !== null && _a6 !== void 0 ? _a6 : ""; } else if (model === "claude") { - consolidatedSummary = (_c6 = yield (0, claude_1.claudeAI)(systemPrompt, consolidatedPrompt, args)) !== null && _c6 !== void 0 ? _c6 : ""; + consolidatedSummary = (_b3 = yield (0, claude_1.claudeAI)(systemPrompt, consolidatedPrompt, args)) !== null && _b3 !== void 0 ? _b3 : ""; } else if (model === "azure") { - consolidatedSummary = (_d2 = yield (0, azure_openai_1.azureOpenAI)(systemPrompt, consolidatedPrompt, args)) !== null && _d2 !== void 0 ? _d2 : ""; + consolidatedSummary = (_c7 = yield (0, azure_openai_1.azureOpenAI)(systemPrompt, consolidatedPrompt, args)) !== null && _c7 !== void 0 ? _c7 : ""; } else if (model === "grok") { - consolidatedSummary = (_e7 = yield (0, grok_1.grokAI)(systemPrompt, consolidatedPrompt, args)) !== null && _e7 !== void 0 ? _e7 : ""; + consolidatedSummary = (_d2 = yield (0, grok_1.grokAI)(systemPrompt, consolidatedPrompt, args)) !== null && _d2 !== void 0 ? _d2 : ""; } else if (model === "deepseek") { - consolidatedSummary = (_f2 = yield (0, deepseek_1.deepseekAI)(systemPrompt, consolidatedPrompt, args)) !== null && _f2 !== void 0 ? _f2 : ""; + consolidatedSummary = (_e7 = yield (0, deepseek_1.deepseekAI)(systemPrompt, consolidatedPrompt, args)) !== null && _e7 !== void 0 ? _e7 : ""; } else if (model === "gemini") { - consolidatedSummary = (_g2 = yield (0, gemini_1.gemini)(systemPrompt, consolidatedPrompt, args)) !== null && _g2 !== void 0 ? _g2 : ""; + consolidatedSummary = (_f2 = yield (0, gemini_1.gemini)(systemPrompt, consolidatedPrompt, args)) !== null && _f2 !== void 0 ? _f2 : ""; } else if (model === "perplexity") { - consolidatedSummary = (_h5 = yield (0, perplexity_1.perplexity)(systemPrompt, consolidatedPrompt, args)) !== null && _h5 !== void 0 ? _h5 : ""; + consolidatedSummary = (_g2 = yield (0, perplexity_1.perplexity)(systemPrompt, consolidatedPrompt, args)) !== null && _g2 !== void 0 ? _g2 : ""; } else if (model === "openrouter") { - consolidatedSummary = (_j2 = yield (0, openrouter_1.openRouter)(systemPrompt, consolidatedPrompt, args)) !== null && _j2 !== void 0 ? _j2 : ""; + consolidatedSummary = (_h5 = yield (0, openrouter_1.openRouter)(systemPrompt, consolidatedPrompt, args)) !== null && _h5 !== void 0 ? _h5 : ""; } else if (model === "bedrock") { - consolidatedSummary = (_k2 = yield (0, bedrock_1.bedrock)(systemPrompt, consolidatedPrompt, args)) !== null && _k2 !== void 0 ? _k2 : ""; + consolidatedSummary = (_j2 = yield (0, bedrock_1.bedrock)(systemPrompt, consolidatedPrompt, args)) !== null && _j2 !== void 0 ? _j2 : ""; } else if (model === "custom") { - consolidatedSummary = (_l2 = yield (0, custom_1.customService)(systemPrompt, consolidatedPrompt, args, customUrl)) !== null && _l2 !== void 0 ? _l2 : ""; + consolidatedSummary = (_k2 = yield (0, custom_1.customService)(systemPrompt, consolidatedPrompt, args, customUrl)) !== null && _k2 !== void 0 ? _k2 : ""; } if (consolidatedSummary !== "") { if (args.log === true) { @@ -143179,7 +147851,7 @@ ${args.additionalPromptContext}`; console.log(`${consolidatedSummary} `); } - report.results.extra = (_m5 = report.results.extra) !== null && _m5 !== void 0 ? _m5 : {}; + report.results.extra = (_l2 = report.results.extra) !== null && _l2 !== void 0 ? _l2 : {}; report.results.extra.ai = consolidatedSummary; } }); @@ -143193,11 +147865,11 @@ var require_openai2 = __commonJS({ "use strict"; var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -143213,7 +147885,7 @@ var require_openai2 = __commonJS({ } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -143228,19 +147900,18 @@ var require_openai2 = __commonJS({ var common_1 = require_common3(); var consolidated_summary_1 = require_consolidated_summary(); var constants_1 = require_constants9(); - var assess_1 = require_assess(); function openAI(systemPrompt, prompt, args) { return __awaiter16(this, void 0, void 0, function* () { - var _a5, _b2, _c6, _d2; + var _a6, _b3, _c7, _d2; const client2 = new openai_1.default({ apiKey: process.env.OPENAI_API_KEY }); try { - const response = yield client2.chat.completions.create(Object.assign(Object.assign({ model: (_a5 = args.model) !== null && _a5 !== void 0 ? _a5 : "gpt-4o", messages: [ + const response = yield client2.chat.completions.create(Object.assign(Object.assign({ model: (_a6 = args.model) !== null && _a6 !== void 0 ? _a6 : "gpt-4o", messages: [ { role: "system", content: systemPrompt }, { role: "user", content: (0, common_1.stripAnsi)(prompt) } - ], max_tokens: (_b2 = args.maxTokens) !== null && _b2 !== void 0 ? _b2 : null, frequency_penalty: args.frequencyPenalty, presence_penalty: args.presencePenalty }, args.temperature !== void 0 ? { temperature: args.temperature } : {}), args.topP !== void 0 ? { top_p: args.topP } : {})); - return (_d2 = (_c6 = response.choices[0].message) === null || _c6 === void 0 ? void 0 : _c6.content) !== null && _d2 !== void 0 ? _d2 : null; + ], max_tokens: (_b3 = args.maxTokens) !== null && _b3 !== void 0 ? _b3 : null, frequency_penalty: args.frequencyPenalty, presence_penalty: args.presencePenalty }, args.temperature !== void 0 ? { temperature: args.temperature } : {}), args.topP !== void 0 ? { top_p: args.topP } : {})); + return (_d2 = (_c7 = response.choices[0].message) === null || _c7 === void 0 ? void 0 : _c7.content) !== null && _d2 !== void 0 ? _d2 : null; } catch (error2) { console.error(`Error invoking OpenAI`, error2); return null; @@ -143249,29 +147920,32 @@ var require_openai2 = __commonJS({ } function openAIFailedTestSummary2(report_1, args_1, file_1) { return __awaiter16(this, arguments, void 0, function* (report, args, file, log3 = false) { - var _a5, _b2; - const assessmentType = (_a5 = args.assess) !== null && _a5 !== void 0 ? _a5 : "failed"; - const assessmentConfig = (0, assess_1.getAssessmentConfig)(assessmentType); - const testsToAnalyze = (0, assess_1.filterTestsByAssessment)(report.results.tests, assessmentType); - testsToAnalyze.forEach((test) => { + var _a6; + const failedTests = report.results.tests.filter((test) => test.status === "failed"); + failedTests.forEach((test) => { if (test.extra != null) { delete test.extra; } }); let logged = false; let messageCount = 0; - for (const test of testsToAnalyze) { + for (const test of failedTests) { if (args.maxMessages != null && messageCount >= args.maxMessages) { break; } - let prompt = (0, common_1.generateAssessmentPromptContext)(test, report, assessmentType); + let prompt = `Report: +${JSON.stringify(test, null, 2)}. + +Tool:${report.results.tool.name}. + + Please provide a human-readable failure summary that explains why you think the test might have failed and ways to fix`; if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { prompt += ` Additional Context: ${args.additionalPromptContext}`; } - let systemPrompt = (_b2 = args.systemPrompt) !== null && _b2 !== void 0 ? _b2 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; + let systemPrompt = (_a6 = args.systemPrompt) !== null && _a6 !== void 0 ? _a6 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; if (args.additionalSystemPromptContext != null && args.additionalSystemPromptContext !== "") { systemPrompt += ` @@ -143284,14 +147958,13 @@ ${args.additionalSystemPromptContext}`; if (args.log === true && !logged) { console.log(` \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`); - console.log(`\u2728 AI Test Reporter Summary - ${assessmentConfig.label}`); + console.log(`\u2728 AI Test Reporter Summary`); console.log(`\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 `); logged = true; } if (args.log === true) { - const icon = (0, common_1.getAssessmentIcon)(assessmentType); - console.log(`${icon} ${assessmentConfig.label}: ${test.name} + console.log(`\u274C Failed Test: ${test.name} `); console.log(`${response} `); @@ -143316,11 +147989,11 @@ var require_json_summary = __commonJS({ "use strict"; var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -143336,7 +148009,7 @@ var require_json_summary = __commonJS({ } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -143351,44 +148024,26 @@ var require_json_summary = __commonJS({ var gemini_1 = require_gemini(); var perplexity_1 = require_perplexity(); var openrouter_1 = require_openrouter(); - var bedrock_1 = require_bedrock(); + var bedrock_1 = require_bedrock2(); var custom_1 = require_custom(); - var assess_1 = require_assess(); function generateJsonSummary2(report, model, args, customUrl) { return __awaiter16(this, void 0, void 0, function* () { - var _a5, _b2, _c6, _d2, _e7, _f2, _g2, _h5, _j2, _k2, _l2; - const assessmentType = (_a5 = args.assess) !== null && _a5 !== void 0 ? _a5 : "failed"; - const assessmentConfig = (0, assess_1.getAssessmentConfig)(assessmentType); - const testsToAnalyze = (0, assess_1.filterTestsByAssessment)(report.results.tests, assessmentType); + var _a6, _b3, _c7, _d2, _e7, _f2, _g2, _h5, _j2, _k2; + const failedTests = report.results.tests.filter((test) => test.status === "failed"); const testDetails = []; let testCount = 0; - for (const test of testsToAnalyze) { + for (const test of failedTests) { if (args.maxMessages != null && testCount >= args.maxMessages) { break; } let detail = `Test Name: ${test.name} `; - detail += `Status: ${test.status} -`; - if (test.flaky === true) { - detail += `Flaky: Yes -`; - if (test.retries != null) { - detail += `Retries: ${test.retries} -`; - } - } if (test.message != null && test.message.trim() !== "") { detail += `Message: ${test.message} `; } if (test.trace != null && test.trace.trim() !== "") { detail += `Trace: ${test.trace} -`; - } - if (test.insights != null) { - detail += `Insights: -${JSON.stringify(test.insights, null, 2)} `; } if (test.ai != null && test.ai.trim() !== "") { @@ -143398,38 +148053,27 @@ ${JSON.stringify(test.insights, null, 2)} testDetails.push(detail); testCount++; } - let systemPrompt = `You are a test analysis expert. Your task is to analyze tests and provide structured output in JSON format. - -Assessment Context: ${assessmentConfig.description} -${assessmentConfig.systemPromptSuffix} - + let systemPrompt = `You are a test analysis expert. Your task is to analyze test failures and provide structured output in JSON format. Avoid: - Including any code in your response. - Adding generic conclusions or advice such as "By following these steps..." + - headings, bullet points, or special formatting. You must respond ONLY with valid JSON in the following structure: { - "summary": "High-level overview of the assessment", - "code_issues": "Concise description of code-related issues that occurred", - "timeout_issues": "Concise description of timeout and performance issues", - "application_issues": "Concise description of application-level issues", - "recommendations": "Concise recommendations for addressing the findings" + "summary": "High-level overview of what went wrong", + "code_issues": "Detailed description of code-related issues that occurred", + "timeout_issues": "Detailed description of timeout and performance issues", + "application_issues": "Detailed description of application-level issues", + "recommendations": "Detailed recommendations for fixing the issues" } Guidelines: -- "summary": Provide a concise overview of the assessment findings -- "code_issues": Describe specific code-related problems (bugs, logic errors, assertion failures, etc.). If there are no code-related issues, use an empty string. -- "timeout_issues": Describe any timeout, performance, or timing-related issues. If there are no timeout-related issues, use an empty string. -- "application_issues": Describe application-level problems (configuration, environment, dependencies, flakiness, etc.). If there are no application-related issues, use an empty string. -- "recommendations": Provide actionable recommendations to address the findings. If there are no recommendations, use an empty string. - -- Use bullet points for each issue or recommendation. -- Assess whether multiple points refer to the same method, function, or logical issue. -- If two or more points are related to the same method, function, or root cause, merge them into a single, cohesive bullet point that combines the relevant details. -- Avoid repetition or near-duplicate points \u2014 summarize them together under one clear, concise item. -- Ensure each bullet point represents a distinct, meaningful issue or recommendation. -- When referencing a method or function name, format it in **bold Markdown** -- Bullet points should be short and to the point. +- "summary": Provide a concise overview of the test run failures +- "code_issues": Describe specific code-related problems (bugs, logic errors, assertion failures, etc.) in a paragraph. If there are no code-related issues, use an empty string. +- "timeout_issues": Describe any timeout, performance, or timing-related issues in a paragraph. If there are no timeout-related issues, use an empty string. +- "application_issues": Describe application-level problems (configuration, environment, dependencies, etc.) in a paragraph. If there are no application-related issues, use an empty string. +- "recommendations": Provide actionable recommendations to fix the issues in a paragraph. If there are no recommendations, use an empty string. Important: - Each field should be a string @@ -143443,17 +148087,17 @@ Important: Additional Context: ${args.additionalSystemPromptContext}`; } - let analysisPrompt = `Analyze the following tests and provide a structured JSON response. + let analysisPrompt = `Analyze the following test failures and provide a structured JSON response. -Assessment Type: ${assessmentConfig.label} Test Environment: ${report.results.environment != null ? JSON.stringify(report.results.environment) : "Not specified"} Test Tool: ${report.results.tool.name} -Total Tests in Suite: ${report.results.tests.length} -Tests Being Assessed: ${testsToAnalyze.length} -${testCount < testsToAnalyze.length ? ` -Note: Showing ${testCount} of ${testsToAnalyze.length} tests to stay within token limits. +Total Tests Run: ${report.results.tests.length} +Failed Tests: ${failedTests.length} +Passed Tests: ${report.results.summary.passed} +${testCount < failedTests.length ? ` +Note: Showing ${testCount} of ${failedTests.length} failed tests to stay within token limits. ` : ""} -Test Details: +Failed Test Details: ${testDetails.join("\n")} Provide your analysis in the specified JSON format.`; @@ -143465,25 +148109,25 @@ ${args.additionalPromptContext}`; } let jsonResponse = ""; if (model === "openai") { - jsonResponse = (_b2 = yield (0, openai_1.openAI)(systemPrompt, analysisPrompt, args)) !== null && _b2 !== void 0 ? _b2 : ""; + jsonResponse = (_a6 = yield (0, openai_1.openAI)(systemPrompt, analysisPrompt, args)) !== null && _a6 !== void 0 ? _a6 : ""; } else if (model === "claude") { - jsonResponse = (_c6 = yield (0, claude_1.claudeAI)(systemPrompt, analysisPrompt, args)) !== null && _c6 !== void 0 ? _c6 : ""; + jsonResponse = (_b3 = yield (0, claude_1.claudeAI)(systemPrompt, analysisPrompt, args)) !== null && _b3 !== void 0 ? _b3 : ""; } else if (model === "azure") { - jsonResponse = (_d2 = yield (0, azure_openai_1.azureOpenAI)(systemPrompt, analysisPrompt, args)) !== null && _d2 !== void 0 ? _d2 : ""; + jsonResponse = (_c7 = yield (0, azure_openai_1.azureOpenAI)(systemPrompt, analysisPrompt, args)) !== null && _c7 !== void 0 ? _c7 : ""; } else if (model === "grok") { - jsonResponse = (_e7 = yield (0, grok_1.grokAI)(systemPrompt, analysisPrompt, args)) !== null && _e7 !== void 0 ? _e7 : ""; + jsonResponse = (_d2 = yield (0, grok_1.grokAI)(systemPrompt, analysisPrompt, args)) !== null && _d2 !== void 0 ? _d2 : ""; } else if (model === "deepseek") { - jsonResponse = (_f2 = yield (0, deepseek_1.deepseekAI)(systemPrompt, analysisPrompt, args)) !== null && _f2 !== void 0 ? _f2 : ""; + jsonResponse = (_e7 = yield (0, deepseek_1.deepseekAI)(systemPrompt, analysisPrompt, args)) !== null && _e7 !== void 0 ? _e7 : ""; } else if (model === "gemini") { - jsonResponse = (_g2 = yield (0, gemini_1.gemini)(systemPrompt, analysisPrompt, args)) !== null && _g2 !== void 0 ? _g2 : ""; + jsonResponse = (_f2 = yield (0, gemini_1.gemini)(systemPrompt, analysisPrompt, args)) !== null && _f2 !== void 0 ? _f2 : ""; } else if (model === "perplexity") { - jsonResponse = (_h5 = yield (0, perplexity_1.perplexity)(systemPrompt, analysisPrompt, args)) !== null && _h5 !== void 0 ? _h5 : ""; + jsonResponse = (_g2 = yield (0, perplexity_1.perplexity)(systemPrompt, analysisPrompt, args)) !== null && _g2 !== void 0 ? _g2 : ""; } else if (model === "openrouter") { - jsonResponse = (_j2 = yield (0, openrouter_1.openRouter)(systemPrompt, analysisPrompt, args)) !== null && _j2 !== void 0 ? _j2 : ""; + jsonResponse = (_h5 = yield (0, openrouter_1.openRouter)(systemPrompt, analysisPrompt, args)) !== null && _h5 !== void 0 ? _h5 : ""; } else if (model === "bedrock") { - jsonResponse = (_k2 = yield (0, bedrock_1.bedrock)(systemPrompt, analysisPrompt, args)) !== null && _k2 !== void 0 ? _k2 : ""; + jsonResponse = (_j2 = yield (0, bedrock_1.bedrock)(systemPrompt, analysisPrompt, args)) !== null && _j2 !== void 0 ? _j2 : ""; } else if (model === "custom") { - jsonResponse = (_l2 = yield (0, custom_1.customService)(systemPrompt, analysisPrompt, args, customUrl)) !== null && _l2 !== void 0 ? _l2 : ""; + jsonResponse = (_k2 = yield (0, custom_1.customService)(systemPrompt, analysisPrompt, args, customUrl)) !== null && _k2 !== void 0 ? _k2 : ""; } if (jsonResponse === "") { console.error("Failed to generate JSON summary: empty response from model"); @@ -143541,127 +148185,17 @@ ${parsedResponse.recommendations} } }); -// node_modules/ai-ctrf/dist/report-insights.js -var require_report_insights = __commonJS({ - "node_modules/ai-ctrf/dist/report-insights.js"(exports2) { - "use strict"; - var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { - function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); - }); - } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e6) { - reject2(e6); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e6) { - reject2(e6); - } - } - function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.analyzeReportInsights = analyzeReportInsights; - var openai_1 = require_openai2(); - var claude_1 = require_claude(); - var azure_openai_1 = require_azure_openai(); - var grok_1 = require_grok(); - var deepseek_1 = require_deepseek(); - var gemini_1 = require_gemini(); - var perplexity_1 = require_perplexity(); - var openrouter_1 = require_openrouter(); - var bedrock_1 = require_bedrock(); - var custom_1 = require_custom(); - var common_1 = require_common3(); - function analyzeReportInsights(report, model, args, customUrl, file) { - return __awaiter16(this, void 0, void 0, function* () { - var _a5, _b2, _c6, _d2, _e7, _f2, _g2, _h5, _j2, _k2, _l2; - if (report.insights == null) { - if (args.log === true) { - console.log("\n\u2139\uFE0F No report-level insights data found. Skipping report insights analysis."); - } - return; - } - const systemPrompt = `You are analyzing test suite insights. Identify significant trends, regressions, or improvements. Highlight areas of concern and provide actionable recommendations. Be concise and focus on what matters most.${args.additionalSystemPromptContext != null ? ` - -${args.additionalSystemPromptContext}` : ""}`; - let analysisPrompt = `Test Tool: ${report.results.tool.name} -Tests: ${report.results.summary.passed} passed, ${report.results.summary.failed} failed, ${report.results.summary.skipped} skipped (${report.results.tests.length} total) - -Insights: -${JSON.stringify(report.insights, null, 2)}`; - if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { - analysisPrompt += ` - -Additional Context: -${args.additionalPromptContext}`; - } - let insightsAnalysis = ""; - if (model === "openai") { - insightsAnalysis = (_a5 = yield (0, openai_1.openAI)(systemPrompt, analysisPrompt, args)) !== null && _a5 !== void 0 ? _a5 : ""; - } else if (model === "claude") { - insightsAnalysis = (_b2 = yield (0, claude_1.claudeAI)(systemPrompt, analysisPrompt, args)) !== null && _b2 !== void 0 ? _b2 : ""; - } else if (model === "azure") { - insightsAnalysis = (_c6 = yield (0, azure_openai_1.azureOpenAI)(systemPrompt, analysisPrompt, args)) !== null && _c6 !== void 0 ? _c6 : ""; - } else if (model === "grok") { - insightsAnalysis = (_d2 = yield (0, grok_1.grokAI)(systemPrompt, analysisPrompt, args)) !== null && _d2 !== void 0 ? _d2 : ""; - } else if (model === "deepseek") { - insightsAnalysis = (_e7 = yield (0, deepseek_1.deepseekAI)(systemPrompt, analysisPrompt, args)) !== null && _e7 !== void 0 ? _e7 : ""; - } else if (model === "gemini") { - insightsAnalysis = (_f2 = yield (0, gemini_1.gemini)(systemPrompt, analysisPrompt, args)) !== null && _f2 !== void 0 ? _f2 : ""; - } else if (model === "perplexity") { - insightsAnalysis = (_g2 = yield (0, perplexity_1.perplexity)(systemPrompt, analysisPrompt, args)) !== null && _g2 !== void 0 ? _g2 : ""; - } else if (model === "openrouter") { - insightsAnalysis = (_h5 = yield (0, openrouter_1.openRouter)(systemPrompt, analysisPrompt, args)) !== null && _h5 !== void 0 ? _h5 : ""; - } else if (model === "bedrock") { - insightsAnalysis = (_j2 = yield (0, bedrock_1.bedrock)(systemPrompt, analysisPrompt, args)) !== null && _j2 !== void 0 ? _j2 : ""; - } else if (model === "custom") { - insightsAnalysis = (_k2 = yield (0, custom_1.customService)(systemPrompt, analysisPrompt, args, customUrl)) !== null && _k2 !== void 0 ? _k2 : ""; - } - if (insightsAnalysis !== "") { - if (args.log === true) { - console.log(` -\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -`); - console.log(`\u{1F4CA} Report Insights Analysis: -`); - console.log(`${insightsAnalysis} -`); - } - report.results.extra = (_l2 = report.results.extra) !== null && _l2 !== void 0 ? _l2 : {}; - report.results.extra.aiInsights = insightsAnalysis; - if (file !== void 0) { - (0, common_1.saveUpdatedReport)(file, report); - } - } - }); - } - } -}); - // node_modules/ai-ctrf/dist/models/mistral.js var require_mistral = __commonJS({ "node_modules/ai-ctrf/dist/models/mistral.js"(exports2) { "use strict"; var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -143677,7 +148211,7 @@ var require_mistral = __commonJS({ } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -143692,20 +148226,19 @@ var require_mistral = __commonJS({ var consolidated_summary_1 = require_consolidated_summary(); var openai_1 = __importDefault(require_openai()); var constants_1 = require_constants9(); - var assess_1 = require_assess(); function mistralAI(systemPrompt, prompt, args) { return __awaiter16(this, void 0, void 0, function* () { - var _a5, _b2, _c6, _d2; + var _a6, _b3, _c7, _d2; const client2 = new openai_1.default({ apiKey: process.env.MISTRAL_API_KEY, baseURL: "https://api.mistral.ai/v1" }); try { - const response = yield client2.chat.completions.create(Object.assign(Object.assign({ model: (_a5 = args.model) !== null && _a5 !== void 0 ? _a5 : "mistral-large-latest", messages: [ + const response = yield client2.chat.completions.create(Object.assign(Object.assign({ model: (_a6 = args.model) !== null && _a6 !== void 0 ? _a6 : "mistral-large-latest", messages: [ { role: "system", content: systemPrompt }, { role: "user", content: (0, common_1.stripAnsi)(prompt) } - ], max_tokens: (_b2 = args.maxTokens) !== null && _b2 !== void 0 ? _b2 : null, frequency_penalty: args.frequencyPenalty, presence_penalty: args.presencePenalty }, args.temperature !== void 0 ? { temperature: args.temperature } : {}), args.topP !== void 0 ? { top_p: args.topP } : {})); - return (_d2 = (_c6 = response.choices[0].message) === null || _c6 === void 0 ? void 0 : _c6.content) !== null && _d2 !== void 0 ? _d2 : null; + ], max_tokens: (_b3 = args.maxTokens) !== null && _b3 !== void 0 ? _b3 : null, frequency_penalty: args.frequencyPenalty, presence_penalty: args.presencePenalty }, args.temperature !== void 0 ? { temperature: args.temperature } : {}), args.topP !== void 0 ? { top_p: args.topP } : {})); + return (_d2 = (_c7 = response.choices[0].message) === null || _c7 === void 0 ? void 0 : _c7.content) !== null && _d2 !== void 0 ? _d2 : null; } catch (error2) { console.error(`Error invoking Mistral`, error2); return null; @@ -143714,29 +148247,32 @@ var require_mistral = __commonJS({ } function mistralFailedTestSummary2(report_1, args_1, file_1) { return __awaiter16(this, arguments, void 0, function* (report, args, file, log3 = false) { - var _a5, _b2; - const assessmentType = (_a5 = args.assess) !== null && _a5 !== void 0 ? _a5 : "failed"; - const assessmentConfig = (0, assess_1.getAssessmentConfig)(assessmentType); - const testsToAnalyze = (0, assess_1.filterTestsByAssessment)(report.results.tests, assessmentType); - testsToAnalyze.forEach((test) => { + var _a6; + const failedTests = report.results.tests.filter((test) => test.status === "failed"); + failedTests.forEach((test) => { if (test.extra != null) { delete test.extra; } }); let logged = false; let messageCount = 0; - for (const test of testsToAnalyze) { + for (const test of failedTests) { if (args.maxMessages != null && messageCount >= args.maxMessages) { break; } - let prompt = (0, common_1.generateAssessmentPromptContext)(test, report, assessmentType); + let prompt = `Report: +${JSON.stringify(test, null, 2)}. + +Tool:${report.results.tool.name}. + + Please provide a human-readable failure summary that explains why you think the test might have failed and ways to fix`; if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { prompt += ` Additional Context: ${args.additionalPromptContext}`; } - let systemPrompt = (_b2 = args.systemPrompt) !== null && _b2 !== void 0 ? _b2 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; + let systemPrompt = (_a6 = args.systemPrompt) !== null && _a6 !== void 0 ? _a6 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; if (args.additionalSystemPromptContext != null && args.additionalSystemPromptContext !== "") { systemPrompt += ` @@ -143748,13 +148284,12 @@ ${args.additionalSystemPromptContext}`; messageCount++; if (args.log === true && !logged) { console.log("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"); - console.log(`\u2728 AI Test Reporter Summary - ${assessmentConfig.label}`); + console.log("\u2728 AI Test Reporter Summary"); console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n"); logged = true; } if (args.log === true) { - const icon = (0, common_1.getAssessmentIcon)(assessmentType); - console.log(`${icon} ${assessmentConfig.label}: ${test.name} + console.log(`\u274C Failed Test: ${test.name} `); console.log(`${response} `); @@ -143779,11 +148314,11 @@ var require_ollama = __commonJS({ "use strict"; var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -143799,7 +148334,7 @@ var require_ollama = __commonJS({ } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -143810,11 +148345,10 @@ var require_ollama = __commonJS({ var common_1 = require_common3(); var consolidated_summary_1 = require_consolidated_summary(); var constants_1 = require_constants9(); - var assess_1 = require_assess(); function ollama(systemPrompt, prompt, args) { return __awaiter16(this, void 0, void 0, function* () { - var _a5, _b2, _c6; - const baseURL = (_a5 = process.env.OLLAMA_BASE_URL) !== null && _a5 !== void 0 ? _a5 : "http://localhost:11434"; + var _a6, _b3, _c7; + const baseURL = (_a6 = process.env.OLLAMA_BASE_URL) !== null && _a6 !== void 0 ? _a6 : "http://localhost:11434"; try { const response = yield fetch(`${baseURL}/api/generate`, { method: "POST", @@ -143822,7 +148356,7 @@ var require_ollama = __commonJS({ "Content-Type": "application/json" }, body: JSON.stringify({ - model: (_b2 = args.model) !== null && _b2 !== void 0 ? _b2 : "llama2", + model: (_b3 = args.model) !== null && _b3 !== void 0 ? _b3 : "llama2", prompt: `${systemPrompt} ${(0, common_1.stripAnsi)(prompt)}`, @@ -143830,7 +148364,7 @@ ${(0, common_1.stripAnsi)(prompt)}`, }) }); const data = yield response.json(); - return (_c6 = data.response) !== null && _c6 !== void 0 ? _c6 : null; + return (_c7 = data.response) !== null && _c7 !== void 0 ? _c7 : null; } catch (error2) { console.error("Error invoking Ollama", error2); return null; @@ -143839,29 +148373,32 @@ ${(0, common_1.stripAnsi)(prompt)}`, } function ollamaFailedTestSummary(report_1, args_1, file_1) { return __awaiter16(this, arguments, void 0, function* (report, args, file, log3 = false) { - var _a5, _b2; - const assessmentType = (_a5 = args.assess) !== null && _a5 !== void 0 ? _a5 : "failed"; - const assessmentConfig = (0, assess_1.getAssessmentConfig)(assessmentType); - const testsToAnalyze = (0, assess_1.filterTestsByAssessment)(report.results.tests, assessmentType); - testsToAnalyze.forEach((test) => { + var _a6; + const failedTests = report.results.tests.filter((test) => test.status === "failed"); + failedTests.forEach((test) => { if (test.extra != null) { delete test.extra; } }); let logged = false; let messageCount = 0; - for (const test of testsToAnalyze) { + for (const test of failedTests) { if (args.maxMessages != null && messageCount >= args.maxMessages) { break; } - let prompt = (0, common_1.generateAssessmentPromptContext)(test, report, assessmentType); + let prompt = `Report: +${JSON.stringify(test, null, 2)}. + +Tool:${report.results.tool.name}. + + Please provide a human-readable failure summary that explains why you think the test might have failed and ways to fix`; if (args.additionalPromptContext != null && args.additionalPromptContext !== "") { prompt += ` Additional Context: ${args.additionalPromptContext}`; } - let systemPrompt = (_b2 = args.systemPrompt) !== null && _b2 !== void 0 ? _b2 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; + let systemPrompt = (_a6 = args.systemPrompt) !== null && _a6 !== void 0 ? _a6 : constants_1.FAILED_TEST_SUMMARY_SYSTEM_PROMPT_CURRENT; if (args.additionalSystemPromptContext != null && args.additionalSystemPromptContext !== "") { systemPrompt += ` @@ -143873,13 +148410,12 @@ ${args.additionalSystemPromptContext}`; messageCount++; if (args.log === true && !logged) { console.log("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"); - console.log(`\u2728 AI Test Reporter Summary - ${assessmentConfig.label}`); + console.log("\u2728 AI Test Reporter Summary"); console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n"); logged = true; } if (args.log === true) { - const icon = (0, common_1.getAssessmentIcon)(assessmentType); - console.log(`${icon} ${assessmentConfig.label}: ${test.name} + console.log(`\u274C Failed Test: ${test.name} `); console.log(`${response} `); @@ -143904,11 +148440,11 @@ var require_dist8 = __commonJS({ "use strict"; var __awaiter16 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -143924,7 +148460,7 @@ var require_dist8 = __commonJS({ } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -143932,21 +148468,19 @@ var require_dist8 = __commonJS({ var __importDefault = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; - var _a5; + var _a6; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.analyzeReportInsights = exports2.generateJsonSummary = exports2.customFailedTestSummary = exports2.ollamaFailedTestSummary = exports2.bedrockFailedTestSummary = exports2.openRouterFailedTestSummary = exports2.perplexityFailedTestSummary = exports2.geminiFailedTestSummary = exports2.mistralFailedTestSummary = exports2.deepseekFailedTestSummary = exports2.grokFailedTestSummary = exports2.azureOpenAIFailedTestSummary = exports2.claudeFailedTestSummary = exports2.openAIFailedTestSummary = void 0; - var yargs_1 = __importDefault(require_yargs()); - var helpers_1 = require_helpers4(); + exports2.generateJsonSummary = exports2.customFailedTestSummary = exports2.ollamaFailedTestSummary = exports2.bedrockFailedTestSummary = exports2.openRouterFailedTestSummary = exports2.perplexityFailedTestSummary = exports2.geminiFailedTestSummary = exports2.mistralFailedTestSummary = exports2.deepseekFailedTestSummary = exports2.grokFailedTestSummary = exports2.azureOpenAIFailedTestSummary = exports2.claudeFailedTestSummary = exports2.openAIFailedTestSummary = void 0; + var yargs_1 = __importDefault((init_yargs(), __toCommonJS(yargs_exports))); + var helpers_1 = (init_helpers(), __toCommonJS(helpers_exports)); var common_1 = require_common3(); var constants_1 = require_constants9(); var json_summary_1 = require_json_summary(); - var report_insights_1 = require_report_insights(); - var assess_1 = require_assess(); var azure_openai_1 = require_azure_openai(); Object.defineProperty(exports2, "azureOpenAIFailedTestSummary", { enumerable: true, get: function() { return azure_openai_1.azureOpenAIFailedTestSummary; } }); - var bedrock_1 = require_bedrock(); + var bedrock_1 = require_bedrock2(); Object.defineProperty(exports2, "bedrockFailedTestSummary", { enumerable: true, get: function() { return bedrock_1.bedrockFailedTestSummary; } }); @@ -144146,40 +148680,20 @@ var require_dist8 = __commonJS({ describe: "Consolidate and summarize multiple AI summaries into a higher-level overview", type: "boolean", default: true - }).option("insights", { - describe: "Analyze report-level insights data and add AI summary to report.results.extra.aiInsights", - type: "boolean", - default: false }).option("json-analysis", { describe: "Generate structured JSON analysis with categorized issues (code, timeout, application) and recommendations", type: "boolean", default: false - }).option("assess", { - describe: "What to assess: failed (default) or flaky", - type: "string", - default: "failed", - choices: ["failed", "flaky"] }).help().alias("help", "h").parseSync(); - var file = (_a5 = argv.file) !== null && _a5 !== void 0 ? _a5 : "ctrf/ctrf-report.json"; - if (argv.assess !== void 0) { - const assessValue = String(argv.assess); - if (!(0, assess_1.isValidAssessmentType)(assessValue)) { - console.error(`Invalid assessment type: ${assessValue}. Valid options: failed, flaky`); - process.exit(1); - } - argv.assess = assessValue; - } - var executeCommand = (command, modelFunction) => __awaiter16(void 0, void 0, void 0, function* () { - if (argv._.includes(command) && argv.file != null) { + var file = (_a6 = argv.file) !== null && _a6 !== void 0 ? _a6 : "ctrf/ctrf-report.json"; + var executeCommand = (command2, modelFunction) => __awaiter16(void 0, void 0, void 0, function* () { + if (argv._.includes(command2) && argv.file != null) { try { const report = (0, common_1.validateCtrfFile)(argv.file); if (report !== null) { yield modelFunction(report, argv, file, true); - if (argv.insights === true) { - yield (0, report_insights_1.analyzeReportInsights)(report, command, argv, argv.customUrl, file); - } if (argv.jsonAnalysis === true) { - const result = yield (0, json_summary_1.generateJsonSummary)(report, command, argv, argv.customUrl); + const result = yield (0, json_summary_1.generateJsonSummary)(report, command2, argv, argv.customUrl); if (result !== null) { console.log(JSON.stringify(result, null, 2)); } @@ -144211,10 +148725,6 @@ var require_dist8 = __commonJS({ Object.defineProperty(exports2, "generateJsonSummary", { enumerable: true, get: function() { return json_summary_2.generateJsonSummary; } }); - var report_insights_2 = require_report_insights(); - Object.defineProperty(exports2, "analyzeReportInsights", { enumerable: true, get: function() { - return report_insights_2.analyzeReportInsights; - } }); } }); @@ -144245,8 +148755,8 @@ function toCommandProperties(annotationProperties) { } // node_modules/@actions/core/lib/command.js -function issueCommand(command, properties, message) { - const cmd = new Command(command, properties, message); +function issueCommand(command2, properties, message) { + const cmd = new Command(command2, properties, message); process.stdout.write(cmd.toString() + os.EOL); } function issue(name, message = "") { @@ -144254,11 +148764,11 @@ function issue(name, message = "") { } var CMD_STRING = "::"; var Command = class { - constructor(command, properties, message) { - if (!command) { - command = "missing.command"; + constructor(command2, properties, message) { + if (!command2) { + command2 = "missing.command"; } - this.command = command; + this.command = command2; this.properties = properties; this.message = message; } @@ -144285,21 +148795,21 @@ var Command = class { return cmdStr; } }; -function escapeData(s6) { - return toCommandValue(s6).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); +function escapeData(s) { + return toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); } -function escapeProperty(s6) { - return toCommandValue(s6).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); +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 import * as crypto2 from "crypto"; import * as fs from "fs"; import * as os2 from "os"; -function issueFileCommand(command, message) { - const filePath = process.env[`GITHUB_${command}`]; +function issueFileCommand(command2, message) { + const filePath = process.env[`GITHUB_${command2}`]; if (!filePath) { - throw new Error(`Unable to find environment variable for file command ${command}`); + throw new Error(`Unable to find environment variable for file command ${command2}`); } if (!fs.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); @@ -144343,7 +148853,7 @@ function getProxyUrl(reqUrl) { if (proxyVar) { try { return new DecodedURL(proxyVar); - } catch (_a5) { + } catch (_a6) { if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) return new DecodedURL(`http://${proxyVar}`); } @@ -144375,8 +148885,8 @@ function checkBypass(reqUrl) { if (typeof reqPort === "number") { upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - for (const upperNoProxyItem of noProxy.split(",").map((x6) => x6.trim().toUpperCase()).filter((x6) => x6)) { - if (upperNoProxyItem === "*" || upperReqHosts.some((x6) => x6 === upperNoProxyItem || x6.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x6.endsWith(`${upperNoProxyItem}`))) { + for (const upperNoProxyItem of noProxy.split(",").map((x2) => x2.trim().toUpperCase()).filter((x2) => x2)) { + if (upperNoProxyItem === "*" || upperReqHosts.some((x2) => x2 === upperNoProxyItem || x2.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x2.endsWith(`${upperNoProxyItem}`))) { return true; } } @@ -144405,11 +148915,11 @@ var tunnel = __toESM(require_tunnel2(), 1); var import_undici = __toESM(require_undici(), 1); var __awaiter = function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -144425,7 +148935,7 @@ var __awaiter = function(thisArg, _arguments, P2, generator) { } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -144498,26 +149008,26 @@ var HttpClientResponse = class { } readBody() { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve8) => __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", () => { - resolve4(output.toString()); + resolve8(output.toString()); }); })); }); } readBodyBuffer() { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); }); this.message.on("end", () => { - resolve4(Buffer.concat(chunks)); + resolve8(Buffer.concat(chunks)); }); })); }); @@ -144720,14 +149230,14 @@ var HttpClient = class { */ requestRaw(info2, data) { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { function callbackForResult(err, res) { if (err) { reject2(err); } else if (!res) { reject2(new Error("Unknown error")); } else { - resolve4(res); + resolve8(res); } } this.requestRawWithCallback(info2, data, callbackForResult); @@ -144971,12 +149481,12 @@ var HttpClient = class { return __awaiter(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms2 = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve4) => setTimeout(() => resolve4(), ms2)); + return new Promise((resolve8) => setTimeout(() => resolve8(), ms2)); }); } _processResponse(res, options) { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve4, reject2) => __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve8, reject2) => __awaiter(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -144984,7 +149494,7 @@ var HttpClient = class { headers: {} }; if (statusCode === HttpCodes.NotFound) { - resolve4(response); + resolve8(response); } function dateTimeDeserializer(key, value) { if (typeof value === "string") { @@ -145023,7 +149533,7 @@ var HttpClient = class { err.result = response.result; reject2(err); } else { - resolve4(response); + resolve8(response); } })); }); @@ -145034,11 +149544,11 @@ var lowercaseKeys = (obj) => Object.keys(obj).reduce((c6, k7) => (c6[k7.toLowerC // node_modules/@actions/http-client/lib/auth.js var __awaiter2 = function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -145054,7 +149564,7 @@ var __awaiter2 = function(thisArg, _arguments, P2, generator) { } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -145087,11 +149597,11 @@ import { EOL as EOL3 } from "os"; import { constants, promises } from "fs"; var __awaiter3 = function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -145107,7 +149617,7 @@ var __awaiter3 = function(thisArg, _arguments, P2, generator) { } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -145135,7 +149645,7 @@ var Summary = class { } try { yield access(pathFromEnv, constants.R_OK | constants.W_OK); - } catch (_a5) { + } catch (_a6) { throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); } this._filePath = pathFromEnv; @@ -145584,7 +150094,7 @@ var Context = class { * Hydrate the context from the environment */ constructor() { - var _a5, _b2, _c6; + var _a6, _b3, _c7; this.payload = {}; if (process.env.GITHUB_EVENT_PATH) { if (existsSync2(process.env.GITHUB_EVENT_PATH)) { @@ -145604,9 +150114,9 @@ var Context = class { this.runAttempt = parseInt(process.env.GITHUB_RUN_ATTEMPT, 10); this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); - this.apiUrl = (_a5 = process.env.GITHUB_API_URL) !== null && _a5 !== void 0 ? _a5 : `https://api.github.com`; - this.serverUrl = (_b2 = process.env.GITHUB_SERVER_URL) !== null && _b2 !== void 0 ? _b2 : `https://github.com`; - this.graphqlUrl = (_c6 = process.env.GITHUB_GRAPHQL_URL) !== null && _c6 !== void 0 ? _c6 : `https://api.github.com/graphql`; + this.apiUrl = (_a6 = process.env.GITHUB_API_URL) !== null && _a6 !== void 0 ? _a6 : `https://api.github.com`; + this.serverUrl = (_b3 = process.env.GITHUB_SERVER_URL) !== null && _b3 !== void 0 ? _b3 : `https://github.com`; + this.graphqlUrl = (_c7 = process.env.GITHUB_GRAPHQL_URL) !== null && _c7 !== void 0 ? _c7 : `https://api.github.com/graphql`; } get issue() { const payload = this.payload; @@ -145632,11 +150142,11 @@ var httpClient = __toESM(require_lib(), 1); var import_undici2 = __toESM(require_undici(), 1); var __awaiter4 = function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -145652,7 +150162,7 @@ var __awaiter4 = function(thisArg, _arguments, P2, generator) { } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -145684,8 +150194,8 @@ function getApiBaseUrl() { return process.env["GITHUB_API_URL"] || "https://api.github.com"; } function getUserAgentWithOrchestrationId(baseUserAgent) { - var _a5; - const orchId = (_a5 = process.env["ACTIONS_ORCHESTRATION_ID"]) === null || _a5 === void 0 ? void 0 : _a5.trim(); + var _a6; + const orchId = (_a6 = process.env["ACTIONS_ORCHESTRATION_ID"]) === null || _a6 === void 0 ? void 0 : _a6.trim(); if (orchId) { const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, "_"); const tag = `actions_orchestration_id/${sanitizedId}`; @@ -145905,14 +150415,14 @@ import * as path2 from "path"; // node_modules/@protobuf-ts/runtime/build/es2015/json-typings.js function typeofJsonValue(value) { - let t6 = typeof value; - if (t6 == "object") { + let t = typeof value; + if (t == "object") { if (Array.isArray(value)) return "array"; if (value === null) return "null"; } - return t6; + return t; } function isJsonObject(value) { return value !== null && typeof value == "object" && !Array.isArray(value); @@ -145931,7 +150441,7 @@ function base64decode(base64Str) { es2 -= 2; else if (base64Str[base64Str.length - 1] == "=") es2 -= 1; - let bytes = new Uint8Array(es2), bytePos = 0, groupPos = 0, b6, p6 = 0; + let bytes = new Uint8Array(es2), bytePos = 0, groupPos = 0, b6, p2 = 0; for (let i6 = 0; i6 < base64Str.length; i6++) { b6 = decTable[base64Str.charCodeAt(i6)]; if (b6 === void 0) { @@ -145951,21 +150461,21 @@ function base64decode(base64Str) { } switch (groupPos) { case 0: - p6 = b6; + p2 = b6; groupPos = 1; break; case 1: - bytes[bytePos++] = p6 << 2 | (b6 & 48) >> 4; - p6 = b6; + bytes[bytePos++] = p2 << 2 | (b6 & 48) >> 4; + p2 = b6; groupPos = 2; break; case 2: - bytes[bytePos++] = (p6 & 15) << 4 | (b6 & 60) >> 2; - p6 = b6; + bytes[bytePos++] = (p2 & 15) << 4 | (b6 & 60) >> 2; + p2 = b6; groupPos = 3; break; case 3: - bytes[bytePos++] = (p6 & 3) << 6 | b6; + bytes[bytePos++] = (p2 & 3) << 6 | b6; groupPos = 0; break; } @@ -145975,29 +150485,29 @@ function base64decode(base64Str) { return bytes.subarray(0, bytePos); } function base64encode(bytes) { - let base64 = "", groupPos = 0, b6, p6 = 0; + let base64 = "", groupPos = 0, b6, p2 = 0; for (let i6 = 0; i6 < bytes.length; i6++) { b6 = bytes[i6]; switch (groupPos) { case 0: base64 += encTable[b6 >> 2]; - p6 = (b6 & 3) << 4; + p2 = (b6 & 3) << 4; groupPos = 1; break; case 1: - base64 += encTable[p6 | b6 >> 4]; - p6 = (b6 & 15) << 2; + base64 += encTable[p2 | b6 >> 4]; + p2 = (b6 & 15) << 2; groupPos = 2; break; case 2: - base64 += encTable[p6 | b6 >> 6]; + base64 += encTable[p2 | b6 >> 6]; base64 += encTable[b6 & 63]; groupPos = 0; break; } } if (groupPos) { - base64 += encTable[p6]; + base64 += encTable[p2]; base64 += "="; if (groupPos == 1) base64 += "="; @@ -146398,8 +150908,8 @@ var PbLong = class _PbLong extends SharedPbLong { if (BI) return this.toBigInt().toString(); if (this.isNegative()) { - let n12 = this.negate(); - return "-" + int64toString(n12.lo, n12.hi); + let n8 = this.negate(); + return "-" + int64toString(n8.lo, n8.hi); } return int64toString(this.lo, this.hi); } @@ -146466,9 +150976,9 @@ var BinaryReader = class { this.pos += len; break; case WireType.StartGroup: - let t6; - while ((t6 = this.tag()[1]) !== WireType.EndGroup) { - this.skip(t6); + let t; + while ((t = this.tag()[1]) !== WireType.EndGroup) { + this.skip(t); } break; default: @@ -146514,9 +151024,9 @@ var BinaryReader = class { */ sint64() { let [lo, hi2] = this.varint64(); - let s6 = -(lo & 1); - lo = (lo >>> 1 | (hi2 & 1) << 31) ^ s6; - hi2 = hi2 >>> 1 ^ s6; + let s = -(lo & 1); + lo = (lo >>> 1 | (hi2 & 1) << 31) ^ s; + hi2 = hi2 >>> 1 ^ s; return new PbLong(lo, hi2); } /** @@ -146900,10 +151410,10 @@ var RepeatType; RepeatType2[RepeatType2["UNPACKED"] = 2] = "UNPACKED"; })(RepeatType || (RepeatType = {})); function normalizeFieldInfo(field) { - var _a5, _b2, _c6, _d2; - field.localName = (_a5 = field.localName) !== null && _a5 !== void 0 ? _a5 : lowerCamelCase(field.name); - field.jsonName = (_b2 = field.jsonName) !== null && _b2 !== void 0 ? _b2 : lowerCamelCase(field.name); - field.repeat = (_c6 = field.repeat) !== null && _c6 !== void 0 ? _c6 : RepeatType.NO; + var _a6, _b3, _c7, _d2; + field.localName = (_a6 = field.localName) !== null && _a6 !== void 0 ? _a6 : lowerCamelCase(field.name); + field.jsonName = (_b3 = field.jsonName) !== null && _b3 !== void 0 ? _b3 : lowerCamelCase(field.name); + field.repeat = (_c7 = field.repeat) !== null && _c7 !== void 0 ? _c7 : RepeatType.NO; field.opt = (_d2 = field.opt) !== null && _d2 !== void 0 ? _d2 : field.repeat ? false : field.oneof ? false : field.kind == "message"; return field; } @@ -146928,8 +151438,8 @@ function isOneofGroup(any) { // node_modules/@protobuf-ts/runtime/build/es2015/reflection-type-check.js var ReflectionTypeCheck = class { constructor(info2) { - var _a5; - this.fields = (_a5 = info2.fields) !== null && _a5 !== void 0 ? _a5 : []; + var _a6; + this.fields = (_a6 = info2.fields) !== null && _a6 !== void 0 ? _a6 : []; } prepare() { if (this.data) @@ -146989,7 +151499,7 @@ var ReflectionTypeCheck = class { return false; this.prepare(); let keys = Object.keys(message), data = this.data; - if (keys.length < data.req.length || data.req.some((n12) => !keys.includes(n12))) + if (keys.length < data.req.length || data.req.some((n8) => !keys.includes(n8))) return false; if (!allowExcessProperties) { if (keys.some((k7) => !data.known.includes(k7))) @@ -146999,15 +151509,15 @@ var ReflectionTypeCheck = class { return true; } for (const name of data.oneofs) { - const group4 = message[name]; - if (!isOneofGroup(group4)) + const group3 = message[name]; + if (!isOneofGroup(group3)) return false; - if (group4.oneofKind === void 0) + if (group3.oneofKind === void 0) continue; - const field = this.fields.find((f6) => f6.localName === group4.oneofKind); + const field = this.fields.find((f6) => f6.localName === group3.oneofKind); if (!field) return false; - if (!this.field(group4[group4.oneofKind], field, allowExcessProperties, depth)) + if (!this.field(group3[group3.oneofKind], field, allowExcessProperties, depth)) return false; } for (const field of this.fields) { @@ -147156,10 +151666,10 @@ var ReflectionJsonReader = class { this.info = info2; } prepare() { - var _a5; + var _a6; if (this.fMap === void 0) { this.fMap = {}; - const fieldsInput = (_a5 = this.info.fields) !== null && _a5 !== void 0 ? _a5 : []; + const fieldsInput = (_a6 = this.info.fields) !== null && _a6 !== void 0 ? _a6 : []; for (const field of fieldsInput) { this.fMap[field.name] = field; this.fMap[field.jsonName] = field; @@ -147438,8 +151948,8 @@ var ReflectionJsonReader = class { // node_modules/@protobuf-ts/runtime/build/es2015/reflection-json-writer.js var ReflectionJsonWriter = class { constructor(info2) { - var _a5; - this.fields = (_a5 = info2.fields) !== null && _a5 !== void 0 ? _a5 : []; + var _a6; + this.fields = (_a6 = info2.fields) !== null && _a6 !== void 0 ? _a6 : []; } /** * Converts the message to a JSON object, based on the field descriptors. @@ -147453,11 +151963,11 @@ var ReflectionJsonWriter = class { json[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue2; continue; } - const group4 = source[field.oneof]; - if (group4.oneofKind !== field.localName) + const group3 = source[field.oneof]; + if (group3.oneofKind !== field.localName) continue; const opt = field.kind == "scalar" || field.kind == "enum" ? Object.assign(Object.assign({}, options), { emitDefaultValues: true }) : options; - let jsonValue = this.field(field, group4[field.localName], opt); + let jsonValue = this.field(field, group3[field.localName], opt); assert(jsonValue !== void 0); json[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue; } @@ -147673,9 +152183,9 @@ var ReflectionBinaryReader = class { this.info = info2; } prepare() { - var _a5; + var _a6; if (!this.fieldNoToField) { - const fieldsInput = (_a5 = this.info.fields) !== null && _a5 !== void 0 ? _a5 : []; + const fieldsInput = (_a6 = this.info.fields) !== null && _a6 !== void 0 ? _a6 : []; this.fieldNoToField = new Map(fieldsInput.map((field) => [field.no, field])); } } @@ -147694,12 +152204,12 @@ var ReflectionBinaryReader = class { while (reader.pos < end) { const [fieldNo, wireType] = reader.tag(), field = this.fieldNoToField.get(fieldNo); if (!field) { - let u6 = options.readUnknownField; - if (u6 == "throw") + let u = options.readUnknownField; + if (u == "throw") throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.info.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.info.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.info.typeName, message, fieldNo, wireType, d6); continue; } let target = message, repeated = field.repeat, localName = field.localName; @@ -147848,10 +152358,10 @@ var ReflectionBinaryWriter = class { for (const field of this.fields) { let value, emitDefault, repeated = field.repeat, localName = field.localName; if (field.oneof) { - const group4 = message[field.oneof]; - if (group4.oneofKind !== localName) + const group3 = message[field.oneof]; + if (group3.oneofKind !== localName) continue; - value = group4[localName]; + value = group3[localName]; emitDefault = true; } else { value = message[localName]; @@ -147889,9 +152399,9 @@ var ReflectionBinaryWriter = class { break; } } - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onWrite : u6)(this.info.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u === true ? UnknownFieldHandler.onWrite : u)(this.info.typeName, message, writer); } mapEntry(writer, options, field, key, value) { writer.tag(field.no, WireType.LengthDelimited); @@ -147965,74 +152475,74 @@ var ReflectionBinaryWriter = class { * If argument `value` is omitted, [2] is always false. */ scalarInfo(type, value) { - let t6 = WireType.Varint; - let m6; + let t = WireType.Varint; + let m3; let i6 = value === void 0; let d6 = value === 0; switch (type) { case ScalarType.INT32: - m6 = "int32"; + m3 = "int32"; break; case ScalarType.STRING: d6 = i6 || !value.length; - t6 = WireType.LengthDelimited; - m6 = "string"; + t = WireType.LengthDelimited; + m3 = "string"; break; case ScalarType.BOOL: d6 = value === false; - m6 = "bool"; + m3 = "bool"; break; case ScalarType.UINT32: - m6 = "uint32"; + m3 = "uint32"; break; case ScalarType.DOUBLE: - t6 = WireType.Bit64; - m6 = "double"; + t = WireType.Bit64; + m3 = "double"; break; case ScalarType.FLOAT: - t6 = WireType.Bit32; - m6 = "float"; + t = WireType.Bit32; + m3 = "float"; break; case ScalarType.INT64: d6 = i6 || PbLong.from(value).isZero(); - m6 = "int64"; + m3 = "int64"; break; case ScalarType.UINT64: d6 = i6 || PbULong.from(value).isZero(); - m6 = "uint64"; + m3 = "uint64"; break; case ScalarType.FIXED64: d6 = i6 || PbULong.from(value).isZero(); - t6 = WireType.Bit64; - m6 = "fixed64"; + t = WireType.Bit64; + m3 = "fixed64"; break; case ScalarType.BYTES: d6 = i6 || !value.byteLength; - t6 = WireType.LengthDelimited; - m6 = "bytes"; + t = WireType.LengthDelimited; + m3 = "bytes"; break; case ScalarType.FIXED32: - t6 = WireType.Bit32; - m6 = "fixed32"; + t = WireType.Bit32; + m3 = "fixed32"; break; case ScalarType.SFIXED32: - t6 = WireType.Bit32; - m6 = "sfixed32"; + t = WireType.Bit32; + m3 = "sfixed32"; break; case ScalarType.SFIXED64: d6 = i6 || PbLong.from(value).isZero(); - t6 = WireType.Bit64; - m6 = "sfixed64"; + t = WireType.Bit64; + m3 = "sfixed64"; break; case ScalarType.SINT32: - m6 = "sint32"; + m3 = "sint32"; break; case ScalarType.SINT64: d6 = i6 || PbLong.from(value).isZero(); - m6 = "sint64"; + m3 = "sint64"; break; } - return [t6, m6, i6 || d6]; + return [t, m3, i6 || d6]; } }; @@ -148069,13 +152579,13 @@ function reflectionMergePartial(info2, target, source) { for (let field of info2.fields) { let name = field.localName; if (field.oneof) { - const group4 = input[field.oneof]; - if ((group4 === null || group4 === void 0 ? void 0 : group4.oneofKind) == void 0) { + const group3 = input[field.oneof]; + if ((group3 === null || group3 === void 0 ? void 0 : group3.oneofKind) == void 0) { continue; } - fieldValue = group4[name]; + fieldValue = group3[name]; output = target[field.oneof]; - output.oneofKind = group4.oneofKind; + output.oneofKind = group3.oneofKind; if (fieldValue == void 0) { delete output[name]; continue; @@ -148138,8 +152648,8 @@ function reflectionEquals(info2, a6, b6) { switch (field.kind) { case "enum": case "scalar": - let t6 = field.kind == "enum" ? ScalarType.INT32 : field.T; - if (!(field.repeat ? repeatedPrimitiveEq(t6, val_a, val_b) : primitiveEq(t6, val_a, val_b))) + let t = field.kind == "enum" ? ScalarType.INT32 : field.T; + if (!(field.repeat ? repeatedPrimitiveEq(t, val_a, val_b) : primitiveEq(t, val_a, val_b))) return false; break; case "map": @@ -148280,9 +152790,9 @@ var MessageType = class { * This is equivalent to `JSON.stringify(T.toJson(t))` */ toJsonString(message, options) { - var _a5; + var _a6; let value = this.toJson(message, options); - return JSON.stringify(value, null, (_a5 = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a5 !== void 0 ? _a5 : 0); + return JSON.stringify(value, null, (_a6 = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a6 !== void 0 ? _a6 : 0); } /** * Write the message to binary format. @@ -148398,17 +152908,17 @@ var Timestamp$Type = class extends MessageType { throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive."); if (message.nanos < 0) throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative."); - let z2 = "Z"; + let z = "Z"; if (message.nanos > 0) { let nanosStr = (message.nanos + 1e9).toString().substring(1); if (nanosStr.substring(3) === "000000") - z2 = "." + nanosStr.substring(0, 3) + "Z"; + z = "." + nanosStr.substring(0, 3) + "Z"; else if (nanosStr.substring(6) === "000") - z2 = "." + nanosStr.substring(0, 6) + "Z"; + z = "." + nanosStr.substring(0, 6) + "Z"; else - z2 = "." + nanosStr + "Z"; + z = "." + nanosStr + "Z"; } - return new Date(ms2).toISOString().replace(".000Z", z2); + return new Date(ms2).toISOString().replace(".000Z", z); } /** * In JSON format, the `Timestamp` type is encoded as a string @@ -148454,12 +152964,12 @@ var Timestamp$Type = class extends MessageType { message.nanos = reader.int32(); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -148469,9 +152979,9 @@ var Timestamp$Type = class extends MessageType { writer.tag(1, WireType.Varint).int64(message.seconds); if (message.nanos !== 0) writer.tag(2, WireType.Varint).int32(message.nanos); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -148522,12 +153032,12 @@ var DoubleValue$Type = class extends MessageType { message.value = reader.double(); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -148535,9 +153045,9 @@ var DoubleValue$Type = class extends MessageType { internalBinaryWrite(message, writer, options) { if (message.value !== 0) writer.tag(1, WireType.Bit64).double(message.value); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -148586,12 +153096,12 @@ var FloatValue$Type = class extends MessageType { message.value = reader.float(); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -148599,9 +153109,9 @@ var FloatValue$Type = class extends MessageType { internalBinaryWrite(message, writer, options) { if (message.value !== 0) writer.tag(1, WireType.Bit32).float(message.value); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -148650,12 +153160,12 @@ var Int64Value$Type = class extends MessageType { message.value = reader.int64().toString(); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -148663,9 +153173,9 @@ var Int64Value$Type = class extends MessageType { internalBinaryWrite(message, writer, options) { if (message.value !== "0") writer.tag(1, WireType.Varint).int64(message.value); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -148714,12 +153224,12 @@ var UInt64Value$Type = class extends MessageType { message.value = reader.uint64().toString(); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -148727,9 +153237,9 @@ var UInt64Value$Type = class extends MessageType { internalBinaryWrite(message, writer, options) { if (message.value !== "0") writer.tag(1, WireType.Varint).uint64(message.value); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -148778,12 +153288,12 @@ var Int32Value$Type = class extends MessageType { message.value = reader.int32(); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -148791,9 +153301,9 @@ var Int32Value$Type = class extends MessageType { internalBinaryWrite(message, writer, options) { if (message.value !== 0) writer.tag(1, WireType.Varint).int32(message.value); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -148842,12 +153352,12 @@ var UInt32Value$Type = class extends MessageType { message.value = reader.uint32(); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -148855,9 +153365,9 @@ var UInt32Value$Type = class extends MessageType { internalBinaryWrite(message, writer, options) { if (message.value !== 0) writer.tag(1, WireType.Varint).uint32(message.value); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -148906,12 +153416,12 @@ var BoolValue$Type = class extends MessageType { message.value = reader.bool(); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -148919,9 +153429,9 @@ var BoolValue$Type = class extends MessageType { internalBinaryWrite(message, writer, options) { if (message.value !== false) writer.tag(1, WireType.Varint).bool(message.value); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -148970,12 +153480,12 @@ var StringValue$Type = class extends MessageType { message.value = reader.string(); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -148983,9 +153493,9 @@ var StringValue$Type = class extends MessageType { internalBinaryWrite(message, writer, options) { if (message.value !== "") writer.tag(1, WireType.LengthDelimited).string(message.value); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -149034,12 +153544,12 @@ var BytesValue$Type = class extends MessageType { message.value = reader.bytes(); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -149047,9 +153557,9 @@ var BytesValue$Type = class extends MessageType { internalBinaryWrite(message, writer, options) { if (message.value.length) writer.tag(1, WireType.LengthDelimited).bytes(message.value); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -149057,15 +153567,15 @@ var BytesValue = new BytesValue$Type(); // node_modules/@protobuf-ts/runtime-rpc/build/es2015/reflection-info.js function normalizeMethodInfo(method, service) { - var _a5, _b2, _c6; - let m6 = method; - m6.service = service; - m6.localName = (_a5 = m6.localName) !== null && _a5 !== void 0 ? _a5 : lowerCamelCase(m6.name); - m6.serverStreaming = !!m6.serverStreaming; - m6.clientStreaming = !!m6.clientStreaming; - m6.options = (_b2 = m6.options) !== null && _b2 !== void 0 ? _b2 : {}; - m6.idempotency = (_c6 = m6.idempotency) !== null && _c6 !== void 0 ? _c6 : void 0; - return m6; + var _a6, _b3, _c7; + let m3 = method; + m3.service = service; + m3.localName = (_a6 = m3.localName) !== null && _a6 !== void 0 ? _a6 : lowerCamelCase(m3.name); + m3.serverStreaming = !!m3.serverStreaming; + m3.clientStreaming = !!m3.clientStreaming; + m3.options = (_b3 = m3.options) !== null && _b3 !== void 0 ? _b3 : {}; + m3.idempotency = (_c7 = m3.idempotency) !== null && _c7 !== void 0 ? _c7 : void 0; + return m3; } // node_modules/@protobuf-ts/runtime-rpc/build/es2015/service-type.js @@ -149150,12 +153660,12 @@ var CreateArtifactRequest$Type = class extends MessageType { message.mimeType = StringValue.internalBinaryRead(reader, reader.uint32(), options, message.mimeType); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -149173,9 +153683,9 @@ var CreateArtifactRequest$Type = class extends MessageType { writer.tag(5, WireType.Varint).int32(message.version); if (message.mimeType) StringValue.internalBinaryWrite(message.mimeType, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -149220,12 +153730,12 @@ var CreateArtifactResponse$Type = class extends MessageType { message.signedUploadUrl = reader.string(); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -149235,9 +153745,9 @@ var CreateArtifactResponse$Type = class extends MessageType { writer.tag(1, WireType.Varint).bool(message.ok); if (message.signedUploadUrl !== "") writer.tag(2, WireType.LengthDelimited).string(message.signedUploadUrl); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -149309,12 +153819,12 @@ var FinalizeArtifactRequest$Type = class extends MessageType { message.hash = StringValue.internalBinaryRead(reader, reader.uint32(), options, message.hash); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -149330,9 +153840,9 @@ var FinalizeArtifactRequest$Type = class extends MessageType { writer.tag(4, WireType.Varint).int64(message.size); if (message.hash) StringValue.internalBinaryWrite(message.hash, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -149377,12 +153887,12 @@ var FinalizeArtifactResponse$Type = class extends MessageType { message.artifactId = reader.int64().toString(); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -149392,9 +153902,9 @@ var FinalizeArtifactResponse$Type = class extends MessageType { writer.tag(1, WireType.Varint).bool(message.ok); if (message.artifactId !== "0") writer.tag(2, WireType.Varint).int64(message.artifactId); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -149449,12 +153959,12 @@ var ListArtifactsRequest$Type = class extends MessageType { message.idFilter = Int64Value.internalBinaryRead(reader, reader.uint32(), options, message.idFilter); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -149468,9 +153978,9 @@ var ListArtifactsRequest$Type = class extends MessageType { StringValue.internalBinaryWrite(message.nameFilter, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); if (message.idFilter) Int64Value.internalBinaryWrite(message.idFilter, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -149498,12 +154008,12 @@ var ListArtifactsResponse$Type = class extends MessageType { message.artifacts.push(ListArtifactsResponse_MonolithArtifact.internalBinaryRead(reader, reader.uint32(), options)); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -149511,9 +154021,9 @@ var ListArtifactsResponse$Type = class extends MessageType { internalBinaryWrite(message, writer, options) { for (let i6 = 0; i6 < message.artifacts.length; i6++) ListArtifactsResponse_MonolithArtifact.internalBinaryWrite(message.artifacts[i6], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -149601,12 +154111,12 @@ var ListArtifactsResponse_MonolithArtifact$Type = class extends MessageType { message.digest = StringValue.internalBinaryRead(reader, reader.uint32(), options, message.digest); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -149626,9 +154136,9 @@ var ListArtifactsResponse_MonolithArtifact$Type = class extends MessageType { Timestamp.internalBinaryWrite(message.createdAt, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); if (message.digest) StringValue.internalBinaryWrite(message.digest, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -149684,12 +154194,12 @@ var GetSignedArtifactURLRequest$Type = class extends MessageType { message.name = reader.string(); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -149701,9 +154211,9 @@ var GetSignedArtifactURLRequest$Type = class extends MessageType { writer.tag(2, WireType.LengthDelimited).string(message.workflowJobRunBackendId); if (message.name !== "") writer.tag(3, WireType.LengthDelimited).string(message.name); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -149737,12 +154247,12 @@ var GetSignedArtifactURLResponse$Type = class extends MessageType { message.signedUrl = reader.string(); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -149750,9 +154260,9 @@ var GetSignedArtifactURLResponse$Type = class extends MessageType { internalBinaryWrite(message, writer, options) { if (message.signedUrl !== "") writer.tag(1, WireType.LengthDelimited).string(message.signedUrl); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -149808,12 +154318,12 @@ var DeleteArtifactRequest$Type = class extends MessageType { message.name = reader.string(); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -149825,9 +154335,9 @@ var DeleteArtifactRequest$Type = class extends MessageType { writer.tag(2, WireType.LengthDelimited).string(message.workflowJobRunBackendId); if (message.name !== "") writer.tag(3, WireType.LengthDelimited).string(message.name); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -149872,12 +154382,12 @@ var DeleteArtifactResponse$Type = class extends MessageType { message.artifactId = reader.int64().toString(); break; default: - let u6 = options.readUnknownField; - if (u6 === "throw") + let u = options.readUnknownField; + if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d6 = reader.skip(wireType); - if (u6 !== false) - (u6 === true ? UnknownFieldHandler.onRead : u6)(this.typeName, message, fieldNo, wireType, d6); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d6); } } return message; @@ -149887,9 +154397,9 @@ var DeleteArtifactResponse$Type = class extends MessageType { writer.tag(1, WireType.Varint).bool(message.ok); if (message.artifactId !== "0") writer.tag(2, WireType.Varint).int64(message.artifactId); - let u6 = options.writeUnknownFields; - if (u6 !== false) - (u6 == true ? UnknownFieldHandler.onWrite : u6)(this.typeName, message, writer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; @@ -149912,8 +154422,8 @@ var ArtifactServiceClientJSON = class { this.GetSignedArtifactURL.bind(this); this.DeleteArtifact.bind(this); } - CreateArtifact(request3) { - const data = CreateArtifactRequest.toJson(request3, { + CreateArtifact(request2) { + const data = CreateArtifactRequest.toJson(request2, { useProtoFieldName: true, emitDefaultValues: false }); @@ -149922,8 +154432,8 @@ var ArtifactServiceClientJSON = class { ignoreUnknownFields: true })); } - FinalizeArtifact(request3) { - const data = FinalizeArtifactRequest.toJson(request3, { + FinalizeArtifact(request2) { + const data = FinalizeArtifactRequest.toJson(request2, { useProtoFieldName: true, emitDefaultValues: false }); @@ -149932,16 +154442,16 @@ var ArtifactServiceClientJSON = class { ignoreUnknownFields: true })); } - ListArtifacts(request3) { - const data = ListArtifactsRequest.toJson(request3, { + ListArtifacts(request2) { + const data = ListArtifactsRequest.toJson(request2, { useProtoFieldName: true, emitDefaultValues: false }); const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "ListArtifacts", "application/json", data); return promise.then((data2) => ListArtifactsResponse.fromJson(data2, { ignoreUnknownFields: true })); } - GetSignedArtifactURL(request3) { - const data = GetSignedArtifactURLRequest.toJson(request3, { + GetSignedArtifactURL(request2) { + const data = GetSignedArtifactURLRequest.toJson(request2, { useProtoFieldName: true, emitDefaultValues: false }); @@ -149950,8 +154460,8 @@ var ArtifactServiceClientJSON = class { ignoreUnknownFields: true })); } - DeleteArtifact(request3) { - const data = DeleteArtifactRequest.toJson(request3, { + DeleteArtifact(request2) { + const data = DeleteArtifactRequest.toJson(request2, { useProtoFieldName: true, emitDefaultValues: false }); @@ -150111,8 +154621,8 @@ var InvalidTokenError = class extends Error { }; InvalidTokenError.prototype.name = "InvalidTokenError"; function b64DecodeUnicode(str) { - return decodeURIComponent(atob(str).replace(/(.)/g, (m6, p6) => { - let code = p6.charCodeAt(0).toString(16).toUpperCase(); + return decodeURIComponent(atob(str).replace(/(.)/g, (m3, p2) => { + let code = p2.charCodeAt(0).toString(16).toUpperCase(); if (code.length < 2) { code = "0" + code; } @@ -150182,13 +154692,13 @@ function getBackendIdsFromToken() { if (scopeParts.length !== 3) { throw InvalidJwtError; } - const ids = { + const ids2 = { workflowRunBackendId: scopeParts[1], workflowJobRunBackendId: scopeParts[2] }; - debug(`Workflow Run Backend ID: ${ids.workflowRunBackendId}`); - debug(`Workflow Job Run Backend ID: ${ids.workflowJobRunBackendId}`); - return ids; + debug(`Workflow Run Backend ID: ${ids2.workflowRunBackendId}`); + debug(`Workflow Job Run Backend ID: ${ids2.workflowJobRunBackendId}`); + return ids2; } throw InvalidJwtError; } @@ -150222,11 +154732,11 @@ function maskSecretUrls(body2) { // node_modules/@actions/artifact/lib/internal/shared/artifact-twirp-client.js var __awaiter5 = function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -150242,7 +154752,7 @@ var __awaiter5 = function(thisArg, _arguments, P2, generator) { } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -150359,7 +154869,7 @@ var ArtifactHttpClient = class { } sleep(milliseconds) { return __awaiter5(this, void 0, void 0, function* () { - return new Promise((resolve4) => setTimeout(resolve4, milliseconds)); + return new Promise((resolve8) => setTimeout(resolve8, milliseconds)); }); } getExponentialRetryTimeMilliseconds(attempt) { @@ -150861,14 +155371,14 @@ var HttpPipeline = class _HttpPipeline { this._orderedPolicies = void 0; return removedPolicies; } - sendRequest(httpClient2, request3) { + sendRequest(httpClient2, request2) { const policies = this.getOrderedPolicies(); const pipeline2 = policies.reduceRight((next, policy) => { return (req) => { return policy.sendRequest(req, next); }; }, (req) => httpClient2.sendRequest(req)); - return pipeline2(request3); + return pipeline2(request2); } getOrderedPolicies() { if (!this._orderedPolicies) { @@ -151073,8 +155583,8 @@ var Sanitizer = class { constructor({ additionalAllowedHeaderNames: allowedHeaderNames = [], additionalAllowedQueryParameters: allowedQueryParameters = [] } = {}) { allowedHeaderNames = defaultAllowedHeaderNames.concat(allowedHeaderNames); allowedQueryParameters = defaultAllowedQueryParameters.concat(allowedQueryParameters); - this.allowedHeaderNames = new Set(allowedHeaderNames.map((n12) => n12.toLowerCase())); - this.allowedQueryParameters = new Set(allowedQueryParameters.map((p6) => p6.toLowerCase())); + this.allowedHeaderNames = new Set(allowedHeaderNames.map((n8) => n8.toLowerCase())); + this.allowedQueryParameters = new Set(allowedQueryParameters.map((p2) => p2.toLowerCase())); } /** * Sanitizes an object for logging. @@ -151228,8 +155738,8 @@ function isRestError(e6) { } // node_modules/@typespec/ts-http-runtime/dist/esm/util/bytesEncoding.js -function stringToUint8Array(value, format2) { - return Buffer.from(value, format2); +function stringToUint8Array(value, format4) { + return Buffer.from(value, format4); } // node_modules/@typespec/ts-http-runtime/dist/esm/nodeHttpClient.js @@ -151250,9 +155760,9 @@ function isStreamComplete(stream5) { if (stream5.readable === false) { return Promise.resolve(); } - return new Promise((resolve4) => { + return new Promise((resolve8) => { const handler2 = () => { - resolve4(); + resolve8(); stream5.removeListener("close", handler2); stream5.removeListener("end", handler2); stream5.removeListener("error", handler2); @@ -151291,11 +155801,11 @@ var NodeHttpClient = class { * Makes a request over an underlying transport layer and returns the response. * @param request - The request to be made. */ - async sendRequest(request3) { + async sendRequest(request2) { const abortController = new AbortController(); let abortListener; - if (request3.abortSignal) { - if (request3.abortSignal.aborted) { + if (request2.abortSignal) { + if (request2.abortSignal.aborted) { throw new AbortError("The operation was aborted. Request has already been canceled."); } abortListener = (event) => { @@ -151303,29 +155813,29 @@ var NodeHttpClient = class { abortController.abort(); } }; - request3.abortSignal.addEventListener("abort", abortListener); + request2.abortSignal.addEventListener("abort", abortListener); } let timeoutId; - if (request3.timeout > 0) { + if (request2.timeout > 0) { timeoutId = setTimeout(() => { const sanitizer = new Sanitizer(); - logger.info(`request to '${sanitizer.sanitizeUrl(request3.url)}' timed out. canceling...`); + logger.info(`request to '${sanitizer.sanitizeUrl(request2.url)}' timed out. canceling...`); abortController.abort(); - }, request3.timeout); + }, request2.timeout); } - const acceptEncoding = request3.headers.get("Accept-Encoding"); + const acceptEncoding = request2.headers.get("Accept-Encoding"); const shouldDecompress = acceptEncoding?.includes("gzip") || acceptEncoding?.includes("deflate"); - let body2 = typeof request3.body === "function" ? request3.body() : request3.body; - if (body2 && !request3.headers.has("Content-Length")) { + let body2 = typeof request2.body === "function" ? request2.body() : request2.body; + if (body2 && !request2.headers.has("Content-Length")) { const bodyLength = getBodyLength(body2); if (bodyLength !== null) { - request3.headers.set("Content-Length", bodyLength); + request2.headers.set("Content-Length", bodyLength); } } let responseStream; try { - if (body2 && request3.onUploadProgress) { - const onUploadProgress = request3.onUploadProgress; + if (body2 && request2.onUploadProgress) { + const onUploadProgress = request2.onUploadProgress; const uploadReportStream = new ReportTransform(onUploadProgress); uploadReportStream.on("error", (e6) => { logger.error("Error in upload progress", e6); @@ -151337,7 +155847,7 @@ var NodeHttpClient = class { } body2 = uploadReportStream; } - const res = await this.makeRequest(request3, abortController, body2); + const res = await this.makeRequest(request2, abortController, body2); if (timeoutId !== void 0) { clearTimeout(timeoutId); } @@ -151346,14 +155856,14 @@ var NodeHttpClient = class { const response = { status, headers, - request: request3 + request: request2 }; - if (request3.method === "HEAD") { + if (request2.method === "HEAD") { res.resume(); return response; } responseStream = shouldDecompress ? getDecodedResponseStream(res, headers) : res; - const onDownloadProgress = request3.onDownloadProgress; + const onDownloadProgress = request2.onDownloadProgress; if (onDownloadProgress) { const downloadReportStream = new ReportTransform(onDownloadProgress); downloadReportStream.on("error", (e6) => { @@ -151364,7 +155874,7 @@ var NodeHttpClient = class { } if ( // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code - request3.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) || request3.streamResponseStatusCodes?.has(response.status) + request2.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) || request2.streamResponseStatusCodes?.has(response.status) ) { response.readableStreamBody = responseStream; } else { @@ -151372,7 +155882,7 @@ var NodeHttpClient = class { } return response; } finally { - if (request3.abortSignal && abortListener) { + if (request2.abortSignal && abortListener) { let uploadStreamDone = Promise.resolve(); if (isReadableStream(body2)) { uploadStreamDone = isStreamComplete(body2); @@ -151383,7 +155893,7 @@ var NodeHttpClient = class { } Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { if (abortListener) { - request3.abortSignal?.removeEventListener("abort", abortListener); + request2.abortSignal?.removeEventListener("abort", abortListener); } }).catch((e6) => { logger.warning("Error when cleaning up abortListener on httpRequest", e6); @@ -151391,26 +155901,26 @@ var NodeHttpClient = class { } } } - makeRequest(request3, abortController, body2) { - const url2 = new URL(request3.url); + makeRequest(request2, abortController, body2) { + const url2 = new URL(request2.url); const isInsecure = url2.protocol !== "https:"; - if (isInsecure && !request3.allowInsecureConnection) { - throw new Error(`Cannot connect to ${request3.url} while allowInsecureConnection is false.`); + if (isInsecure && !request2.allowInsecureConnection) { + throw new Error(`Cannot connect to ${request2.url} while allowInsecureConnection is false.`); } - const agent = request3.agent ?? this.getOrCreateAgent(request3, isInsecure); + const agent = request2.agent ?? this.getOrCreateAgent(request2, isInsecure); const options = { agent, hostname: url2.hostname, path: `${url2.pathname}${url2.search}`, port: url2.port, - method: request3.method, - headers: request3.headers.toJSON({ preserveCase: true }), - ...request3.requestOverrides + method: request2.method, + headers: request2.headers.toJSON({ preserveCase: true }), + ...request2.requestOverrides }; - return new Promise((resolve4, reject2) => { - const req = isInsecure ? http2.request(options, resolve4) : https2.request(options, resolve4); + return new Promise((resolve8, reject2) => { + const req = isInsecure ? http2.request(options, resolve8) : https2.request(options, resolve8); req.once("error", (err) => { - reject2(new RestError(err.message, { code: err.code ?? RestError.REQUEST_SEND_ERROR, request: request3 })); + reject2(new RestError(err.message, { code: err.code ?? RestError.REQUEST_SEND_ERROR, request: request2 })); }); abortController.signal.addEventListener("abort", () => { const abortError = new AbortError("The operation was aborted. Rejecting from abort signal callback while making request."); @@ -151433,8 +155943,8 @@ var NodeHttpClient = class { } }); } - getOrCreateAgent(request3, isInsecure) { - const disableKeepAlive = request3.disableKeepAlive; + getOrCreateAgent(request2, isInsecure) { + const disableKeepAlive = request2.disableKeepAlive; if (isInsecure) { if (disableKeepAlive) { return http2.globalAgent; @@ -151444,10 +155954,10 @@ var NodeHttpClient = class { } return this.cachedHttpAgent; } else { - if (disableKeepAlive && !request3.tlsSettings) { + if (disableKeepAlive && !request2.tlsSettings) { return https2.globalAgent; } - const tlsSettings = request3.tlsSettings ?? DEFAULT_TLS_SETTINGS; + const tlsSettings = request2.tlsSettings ?? DEFAULT_TLS_SETTINGS; let agent = this.cachedHttpsAgents.get(tlsSettings); if (agent && agent.options.keepAlive === !disableKeepAlive) { return agent; @@ -151492,7 +156002,7 @@ function getDecodedResponseStream(stream5, headers) { return stream5; } function streamToText(stream5) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { const buffer2 = []; stream5.on("data", (chunk) => { if (Buffer.isBuffer(chunk)) { @@ -151502,7 +156012,7 @@ function streamToText(stream5) { } }); stream5.on("end", () => { - resolve4(Buffer.concat(buffer2).toString("utf8")); + resolve8(Buffer.concat(buffer2).toString("utf8")); }); stream5.on("error", (e6) => { if (e6 && e6?.name === "AbortError") { @@ -151549,12 +156059,12 @@ function logPolicy(options = {}) { }); return { name: logPolicyName, - async sendRequest(request3, next) { + async sendRequest(request2, next) { if (!logger8.enabled) { - return next(request3); + return next(request2); } - logger8(`Request: ${sanitizer.sanitize(request3)}`); - const response = await next(request3); + logger8(`Request: ${sanitizer.sanitize(request2)}`); + const response = await next(request2); logger8(`Response status code: ${response.status}`); logger8(`Headers: ${sanitizer.sanitize(response.headers)}`); return response; @@ -151569,32 +156079,32 @@ function redirectPolicy(options = {}) { const { maxRetries = 20, allowCrossOriginRedirects = false } = options; return { name: redirectPolicyName, - async sendRequest(request3, next) { - const response = await next(request3); + async sendRequest(request2, next) { + const response = await next(request2); return handleRedirect(next, response, maxRetries, allowCrossOriginRedirects); } }; } async function handleRedirect(next, response, maxRetries, allowCrossOriginRedirects, currentRetries = 0) { - const { request: request3, status, headers } = response; + const { request: request2, status, headers } = response; const locationHeader = headers.get("location"); - if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request3.method) || status === 302 && allowedRedirect.includes(request3.method) || status === 303 && request3.method === "POST" || status === 307) && currentRetries < maxRetries) { - const url2 = new URL(locationHeader, request3.url); + if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request2.method) || status === 302 && allowedRedirect.includes(request2.method) || status === 303 && request2.method === "POST" || status === 307) && currentRetries < maxRetries) { + const url2 = new URL(locationHeader, request2.url); if (!allowCrossOriginRedirects) { - const originalUrl = new URL(request3.url); + const originalUrl = new URL(request2.url); if (url2.origin !== originalUrl.origin) { logger.verbose(`Skipping cross-origin redirect from ${originalUrl.origin} to ${url2.origin}.`); return response; } } - request3.url = url2.toString(); + request2.url = url2.toString(); if (status === 303) { - request3.method = "GET"; - request3.headers.delete("Content-Length"); - delete request3.body; + request2.method = "GET"; + request2.headers.delete("Content-Length"); + delete request2.body; } - request3.headers.delete("Authorization"); - const res = await next(request3); + request2.headers.delete("Authorization"); + const res = await next(request2); return handleRedirect(next, res, maxRetries, allowCrossOriginRedirects, currentRetries + 1); } return response; @@ -151623,11 +156133,11 @@ var decompressResponsePolicyName = "decompressResponsePolicy"; function decompressResponsePolicy() { return { name: decompressResponsePolicyName, - async sendRequest(request3, next) { - if (request3.method !== "HEAD") { - request3.headers.set("Accept-Encoding", "gzip,deflate"); + async sendRequest(request2, next) { + if (request2.method !== "HEAD") { + request2.headers.set("Accept-Encoding", "gzip,deflate"); } - return next(request3); + return next(request2); } }; } @@ -151651,7 +156161,7 @@ function calculateRetryDelay(retryAttempt, config) { // node_modules/@typespec/ts-http-runtime/dist/esm/util/helpers.js var StandardAbortMessage = "The operation was aborted."; function delay(delayInMs, value, options) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { let timer = void 0; let onAborted = void 0; const rejectOnAbort = () => { @@ -151674,7 +156184,7 @@ function delay(delayInMs, value, options) { } timer = setTimeout(() => { removeListeners(); - resolve4(value); + resolve8(value); }, delayInMs); if (options?.abortSignal) { options.abortSignal.addEventListener("abort", onAborted); @@ -151777,7 +156287,7 @@ function retryPolicy(strategies, options = { maxRetries: DEFAULT_RETRY_POLICY_CO const logger8 = options.logger || retryPolicyLogger; return { name: retryPolicyName, - async sendRequest(request3, next) { + async sendRequest(request2, next) { let response; let responseError; let retryCount = -1; @@ -151786,18 +156296,18 @@ function retryPolicy(strategies, options = { maxRetries: DEFAULT_RETRY_POLICY_CO response = void 0; responseError = void 0; try { - logger8.info(`Retry ${retryCount}: Attempting to send request`, request3.requestId); - response = await next(request3); - logger8.info(`Retry ${retryCount}: Received a response from request`, request3.requestId); + logger8.info(`Retry ${retryCount}: Attempting to send request`, request2.requestId); + response = await next(request2); + logger8.info(`Retry ${retryCount}: Received a response from request`, request2.requestId); } catch (e6) { - logger8.error(`Retry ${retryCount}: Received an error from request`, request3.requestId); + logger8.error(`Retry ${retryCount}: Received an error from request`, request2.requestId); if (!isRestError(e6)) { throw e6; } responseError = e6; response = e6.response; } - if (request3.abortSignal?.aborted) { + if (request2.abortSignal?.aborted) { logger8.error(`Retry ${retryCount}: Request aborted.`); const abortError = new AbortError(); throw abortError; @@ -151832,12 +156342,12 @@ function retryPolicy(strategies, options = { maxRetries: DEFAULT_RETRY_POLICY_CO } if (retryAfterInMs || retryAfterInMs === 0) { strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} retries after ${retryAfterInMs}`); - await delay(retryAfterInMs, void 0, { abortSignal: request3.abortSignal }); + await delay(retryAfterInMs, void 0, { abortSignal: request2.abortSignal }); continue retryRequest; } if (redirectTo) { strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); - request3.url = redirectTo; + request2.url = redirectTo; continue retryRequest; } } @@ -151886,21 +156396,21 @@ function formDataToFormDataMap(formData) { function formDataPolicy() { return { name: formDataPolicyName, - async sendRequest(request3, next) { - if (isNodeLike && typeof FormData !== "undefined" && request3.body instanceof FormData) { - request3.formData = formDataToFormDataMap(request3.body); - request3.body = void 0; + async sendRequest(request2, next) { + if (isNodeLike && typeof FormData !== "undefined" && request2.body instanceof FormData) { + request2.formData = formDataToFormDataMap(request2.body); + request2.body = void 0; } - if (request3.formData) { - const contentType2 = request3.headers.get("Content-Type"); + if (request2.formData) { + const contentType2 = request2.headers.get("Content-Type"); if (contentType2 && contentType2.indexOf("application/x-www-form-urlencoded") !== -1) { - request3.body = wwwFormUrlEncode(request3.formData); + request2.body = wwwFormUrlEncode(request2.formData); } else { - await prepareFormData(request3.formData, request3); + await prepareFormData(request2.formData, request2); } - request3.formData = void 0; + request2.formData = void 0; } - return next(request3); + return next(request2); } }; } @@ -151917,12 +156427,12 @@ function wwwFormUrlEncode(formData) { } return urlSearchParams.toString(); } -async function prepareFormData(formData, request3) { - const contentType2 = request3.headers.get("Content-Type"); +async function prepareFormData(formData, request2) { + const contentType2 = request2.headers.get("Content-Type"); if (contentType2 && !contentType2.startsWith("multipart/form-data")) { return; } - request3.headers.set("Content-Type", contentType2 ?? "multipart/form-data"); + request2.headers.set("Content-Type", contentType2 ?? "multipart/form-data"); const parts = []; for (const [fieldName, values] of Object.entries(formData)) { for (const value of Array.isArray(values) ? values : [values]) { @@ -151947,7 +156457,7 @@ async function prepareFormData(formData, request3) { } } } - request3.multipartBody = { parts }; + request2.multipartBody = { parts }; } // node_modules/@typespec/ts-http-runtime/dist/esm/policies/proxyPolicy.js @@ -152049,25 +156559,25 @@ function getUrlFromProxySettings(settings) { } return parsedProxyUrl; } -function setProxyAgentOnRequest(request3, cachedAgents, proxyUrl) { - if (request3.agent) { +function setProxyAgentOnRequest(request2, cachedAgents, proxyUrl) { + if (request2.agent) { return; } - const url2 = new URL(request3.url); + const url2 = new URL(request2.url); const isInsecure = url2.protocol !== "https:"; - if (request3.tlsSettings) { + if (request2.tlsSettings) { logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored."); } if (isInsecure) { if (!cachedAgents.httpProxyAgent) { cachedAgents.httpProxyAgent = new import_http_proxy_agent.HttpProxyAgent(proxyUrl); } - request3.agent = cachedAgents.httpProxyAgent; + request2.agent = cachedAgents.httpProxyAgent; } else { if (!cachedAgents.httpsProxyAgent) { cachedAgents.httpsProxyAgent = new import_https_proxy_agent.HttpsProxyAgent(proxyUrl); } - request3.agent = cachedAgents.httpsProxyAgent; + request2.agent = cachedAgents.httpsProxyAgent; } } function proxyPolicy(proxySettings, options) { @@ -152078,13 +156588,13 @@ function proxyPolicy(proxySettings, options) { const cachedAgents = {}; return { name: proxyPolicyName, - async sendRequest(request3, next) { - if (!request3.proxySettings && defaultProxy && !isBypassed(request3.url, options?.customNoProxyList ?? globalNoProxyList, options?.customNoProxyList ? void 0 : globalBypassedMap)) { - setProxyAgentOnRequest(request3, cachedAgents, defaultProxy); - } else if (request3.proxySettings) { - setProxyAgentOnRequest(request3, cachedAgents, getUrlFromProxySettings(request3.proxySettings)); + async sendRequest(request2, next) { + if (!request2.proxySettings && defaultProxy && !isBypassed(request2.url, options?.customNoProxyList ?? globalNoProxyList, options?.customNoProxyList ? void 0 : globalBypassedMap)) { + setProxyAgentOnRequest(request2, cachedAgents, defaultProxy); + } else if (request2.proxySettings) { + setProxyAgentOnRequest(request2, cachedAgents, getUrlFromProxySettings(request2.proxySettings)); } - return next(request3); + return next(request2); } }; } @@ -152118,8 +156628,8 @@ function tlsPolicy(tlsSettings) { } // node_modules/@typespec/ts-http-runtime/dist/esm/util/typeGuards.js -function isBlob(x6) { - return typeof Blob !== "undefined" && x6 instanceof Blob; +function isBlob(x2) { + return typeof Blob !== "undefined" && x2 instanceof Blob; } // node_modules/@typespec/ts-http-runtime/dist/esm/util/concat.js @@ -152165,7 +156675,7 @@ function toStream(source) { } async function concat(sources) { return function() { - const streams = sources.map((x6) => typeof x6 === "function" ? x6() : x6).map(toStream); + const streams = sources.map((x2) => typeof x2 === "function" ? x2() : x2).map(toStream); return Readable.from((async function* () { for (const stream5 of streams) { for await (const chunk of stream5) { @@ -152209,7 +156719,7 @@ function getTotalLength(sources) { } return total; } -async function buildRequestBody(request3, parts, boundary) { +async function buildRequestBody(request2, parts, boundary) { const sources = [ stringToUint8Array(`--${boundary}`, "utf-8"), ...parts.flatMap((part) => [ @@ -152224,9 +156734,9 @@ async function buildRequestBody(request3, parts, boundary) { ]; const contentLength2 = getTotalLength(sources); if (contentLength2) { - request3.headers.set("Content-Length", contentLength2); + request2.headers.set("Content-Length", contentLength2); } - request3.body = await concat(sources); + request2.body = await concat(sources); } var multipartPolicyName = "multipartPolicy"; var maxBoundaryLength = 70; @@ -152235,22 +156745,22 @@ function assertValidBoundary(boundary) { if (boundary.length > maxBoundaryLength) { throw new Error(`Multipart boundary "${boundary}" exceeds maximum length of 70 characters`); } - if (Array.from(boundary).some((x6) => !validBoundaryCharacters.has(x6))) { + if (Array.from(boundary).some((x2) => !validBoundaryCharacters.has(x2))) { throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); } } function multipartPolicy() { return { name: multipartPolicyName, - async sendRequest(request3, next) { - if (!request3.multipartBody) { - return next(request3); + async sendRequest(request2, next) { + if (!request2.multipartBody) { + return next(request2); } - if (request3.body) { + if (request2.body) { throw new Error("multipartBody and regular body cannot be set at the same time"); } - let boundary = request3.multipartBody.boundary; - const contentTypeHeader = request3.headers.get("Content-Type") ?? "multipart/mixed"; + let boundary = request2.multipartBody.boundary; + const contentTypeHeader = request2.headers.get("Content-Type") ?? "multipart/mixed"; const parsedHeader = contentTypeHeader.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/); if (!parsedHeader) { throw new Error(`Got multipart request body, but content-type header was not multipart: ${contentTypeHeader}`); @@ -152265,10 +156775,10 @@ function multipartPolicy() { } else { boundary = generateBoundary(); } - request3.headers.set("Content-Type", `${contentType2}; boundary=${boundary}`); - await buildRequestBody(request3, request3.multipartBody.parts, boundary); - request3.multipartBody = void 0; - return next(request3); + request2.headers.set("Content-Type", `${contentType2}; boundary=${boundary}`); + await buildRequestBody(request2, request2.multipartBody.parts, boundary); + request2.multipartBody = void 0; + return next(request2); } }; } @@ -152356,11 +156866,11 @@ function userAgentPolicy2(options = {}) { const userAgentValue = getUserAgentValue2(options.userAgentPrefix); return { name: userAgentPolicyName2, - async sendRequest(request3, next) { - if (!request3.headers.has(UserAgentHeaderName2)) { - request3.headers.set(UserAgentHeaderName2, await userAgentValue); + async sendRequest(request2, next) { + if (!request2.headers.has(UserAgentHeaderName2)) { + request2.headers.set(UserAgentHeaderName2, await userAgentValue); } - return next(request3); + return next(request2); } }; } @@ -152379,7 +156889,7 @@ var AbortError2 = class extends Error { // node_modules/@azure/core-util/dist/esm/createAbortablePromise.js function createAbortablePromise(buildPromise, options) { const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options ?? {}; - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { function rejectOnAbort() { reject2(new AbortError2(abortErrorMsg ?? "The operation was aborted.")); } @@ -152395,12 +156905,12 @@ function createAbortablePromise(buildPromise, options) { return rejectOnAbort(); } try { - buildPromise((x6) => { + buildPromise((x2) => { removeListeners(); - resolve4(x6); - }, (x6) => { + resolve8(x2); + }, (x2) => { removeListeners(); - reject2(x6); + reject2(x2); }); } catch (err) { reject2(err); @@ -152414,8 +156924,8 @@ var StandardAbortMessage2 = "The delay was aborted."; function delay2(timeInMs, options) { let token; const { abortSignal, abortErrorMsg } = options ?? {}; - return createAbortablePromise((resolve4) => { - token = setTimeout(resolve4, timeInMs); + return createAbortablePromise((resolve8) => { + token = setTimeout(resolve8, timeInMs); }, { cleanupBeforeAbort: () => clearTimeout(token), abortSignal, @@ -152453,8 +156963,8 @@ var isNodeLike2 = isNodeLike; // node_modules/@azure/core-rest-pipeline/dist/esm/util/file.js var rawContent = /* @__PURE__ */ Symbol("rawContent"); -function hasRawContent(x6) { - return typeof x6[rawContent] === "function"; +function hasRawContent(x2) { + return typeof x2[rawContent] === "function"; } function getRawContent(blob) { if (hasRawContent(blob)) { @@ -152470,15 +156980,15 @@ function multipartPolicy2() { const tspPolicy = multipartPolicy(); return { name: multipartPolicyName2, - sendRequest: async (request3, next) => { - if (request3.multipartBody) { - for (const part of request3.multipartBody.parts) { + sendRequest: async (request2, next) => { + if (request2.multipartBody) { + for (const part of request2.multipartBody.parts) { if (hasRawContent(part.body)) { part.body = getRawContent(part.body); } } } - return tspPolicy.sendRequest(request3, next); + return tspPolicy.sendRequest(request2, next); } }; } @@ -152512,11 +157022,11 @@ var setClientRequestIdPolicyName = "setClientRequestIdPolicy"; function setClientRequestIdPolicy(requestIdHeaderName = "x-ms-client-request-id") { return { name: setClientRequestIdPolicyName, - async sendRequest(request3, next) { - if (!request3.headers.has(requestIdHeaderName)) { - request3.headers.set(requestIdHeaderName, request3.requestId); + async sendRequest(request2, next) { + if (!request2.headers.has(requestIdHeaderName)) { + request2.headers.set(requestIdHeaderName, request2.requestId); } - return next(request3); + return next(request2); } }; } @@ -152683,26 +157193,26 @@ function tracingPolicy(options = {}) { const tracingClient2 = tryCreateTracingClient(); return { name: tracingPolicyName, - async sendRequest(request3, next) { + async sendRequest(request2, next) { if (!tracingClient2) { - return next(request3); + return next(request2); } const userAgent2 = await userAgentPromise; const spanAttributes = { - "http.url": sanitizer.sanitizeUrl(request3.url), - "http.method": request3.method, + "http.url": sanitizer.sanitizeUrl(request2.url), + "http.method": request2.method, "http.user_agent": userAgent2, - requestId: request3.requestId + requestId: request2.requestId }; if (userAgent2) { spanAttributes["http.user_agent"] = userAgent2; } - const { span, tracingContext } = tryCreateSpan(tracingClient2, request3, spanAttributes) ?? {}; + const { span, tracingContext } = tryCreateSpan(tracingClient2, request2, spanAttributes) ?? {}; if (!span || !tracingContext) { - return next(request3); + return next(request2); } try { - const response = await tracingClient2.withContext(tracingContext, next, request3); + const response = await tracingClient2.withContext(tracingContext, next, request2); tryProcessResponse(span, response); return response; } catch (err) { @@ -152724,9 +157234,9 @@ function tryCreateTracingClient() { return void 0; } } -function tryCreateSpan(tracingClient2, request3, spanAttributes) { +function tryCreateSpan(tracingClient2, request2, spanAttributes) { try { - const { span, updatedOptions } = tracingClient2.startSpan(`HTTP ${request3.method}`, { tracingOptions: request3.tracingOptions }, { + const { span, updatedOptions } = tracingClient2.startSpan(`HTTP ${request2.method}`, { tracingOptions: request2.tracingOptions }, { spanKind: "client", spanAttributes }); @@ -152736,7 +157246,7 @@ function tryCreateSpan(tracingClient2, request3, spanAttributes) { } const headers = tracingClient2.createRequestHeaders(updatedOptions.tracingOptions.tracingContext); for (const [key, value] of Object.entries(headers)) { - request3.headers.set(key, value); + request2.headers.set(key, value); } return { span, tracingContext: updatedOptions.tracingOptions.tracingContext }; } catch (e6) { @@ -152805,14 +157315,14 @@ var wrapAbortSignalLikePolicyName = "wrapAbortSignalLikePolicy"; function wrapAbortSignalLikePolicy() { return { name: wrapAbortSignalLikePolicyName, - sendRequest: async (request3, next) => { - if (!request3.abortSignal) { - return next(request3); + sendRequest: async (request2, next) => { + if (!request2.abortSignal) { + return next(request2); } - const { abortSignal, cleanup } = wrapAbortSignalLike(request3.abortSignal); - request3.abortSignal = abortSignal; + const { abortSignal, cleanup } = wrapAbortSignalLike(request2.abortSignal); + request2.abortSignal = abortSignal; try { - return await next(request3); + return await next(request2); } finally { cleanup?.(); } @@ -152853,11 +157363,11 @@ function createPipelineFromOptions2(options) { function createDefaultHttpClient2() { const client2 = createDefaultHttpClient(); return { - async sendRequest(request3) { - const { abortSignal, cleanup } = request3.abortSignal ? wrapAbortSignalLike(request3.abortSignal) : {}; + async sendRequest(request2) { + const { abortSignal, cleanup } = request2.abortSignal ? wrapAbortSignalLike(request2.abortSignal) : {}; try { - request3.abortSignal = abortSignal; - return await client2.sendRequest(request3); + request2.abortSignal = abortSignal; + return await client2.sendRequest(request2); } finally { cleanup?.(); } @@ -152987,9 +157497,9 @@ function createTokenCycler(credential, tokenCyclerOptions) { // node_modules/@azure/core-rest-pipeline/dist/esm/policies/bearerTokenAuthenticationPolicy.js var bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy"; -async function trySendRequest(request3, next) { +async function trySendRequest(request2, next) { try { - return [await next(request3), void 0]; + return [await next(request2), void 0]; } catch (e6) { if (isRestError2(e6) && e6.response) { return [e6.response, e6]; @@ -152999,10 +157509,10 @@ async function trySendRequest(request3, next) { } } async function defaultAuthorizeRequest(options) { - const { scopes, getAccessToken, request: request3 } = options; + const { scopes, getAccessToken, request: request2 } = options; const getTokenOptions = { - abortSignal: request3.abortSignal, - tracingOptions: request3.tracingOptions, + abortSignal: request2.abortSignal, + tracingOptions: request2.tracingOptions, enableCae: true }; const accessToken = await getAccessToken(scopes, getTokenOptions); @@ -153051,20 +157561,20 @@ function bearerTokenAuthenticationPolicy(options) { * - Process a challenge if the response contains it. * - Retrieve a token with the challenge information, then re-send the request. */ - async sendRequest(request3, next) { - if (!request3.url.toLowerCase().startsWith("https://")) { + async sendRequest(request2, next) { + if (!request2.url.toLowerCase().startsWith("https://")) { throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs."); } await callbacks.authorizeRequest({ scopes: Array.isArray(scopes) ? scopes : [scopes], - request: request3, + request: request2, getAccessToken, logger: logger8 }); let response; let error2; let shouldSendRequest; - [response, error2] = await trySendRequest(request3, next); + [response, error2] = await trySendRequest(request2, next); if (isChallengeResponse(response)) { let claims = getCaeChallengeClaims(response.headers.get("WWW-Authenticate")); if (claims) { @@ -153078,23 +157588,23 @@ function bearerTokenAuthenticationPolicy(options) { shouldSendRequest = await authorizeRequestOnCaeChallenge({ scopes: Array.isArray(scopes) ? scopes : [scopes], response, - request: request3, + request: request2, getAccessToken, logger: logger8 }, parsedClaim); if (shouldSendRequest) { - [response, error2] = await trySendRequest(request3, next); + [response, error2] = await trySendRequest(request2, next); } } else if (callbacks.authorizeRequestOnChallenge) { shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ scopes: Array.isArray(scopes) ? scopes : [scopes], - request: request3, + request: request2, response, getAccessToken, logger: logger8 }); if (shouldSendRequest) { - [response, error2] = await trySendRequest(request3, next); + [response, error2] = await trySendRequest(request2, next); } if (isChallengeResponse(response)) { claims = getCaeChallengeClaims(response.headers.get("WWW-Authenticate")); @@ -153109,12 +157619,12 @@ function bearerTokenAuthenticationPolicy(options) { shouldSendRequest = await authorizeRequestOnCaeChallenge({ scopes: Array.isArray(scopes) ? scopes : [scopes], response, - request: request3, + request: request2, getAccessToken, logger: logger8 }, parsedClaim); if (shouldSendRequest) { - [response, error2] = await trySendRequest(request3, next); + [response, error2] = await trySendRequest(request2, next); } } } @@ -153150,7 +157660,7 @@ function getCaeChallengeClaims(challenges) { return; } const parsedChallenges = parseChallenges(challenges); - return parsedChallenges.find((x6) => x6.scheme === "Bearer" && x6.params.claims && x6.params.error === "insufficient_claims")?.params.claims; + return parsedChallenges.find((x2) => x2.scheme === "Bearer" && x2.params.claims && x2.params.error === "insufficient_claims")?.params.claims; } // node_modules/@azure/core-auth/dist/esm/tokenCredential.js @@ -153164,9 +157674,9 @@ var disableKeepAlivePolicyName = "DisableKeepAlivePolicy"; function createDisableKeepAlivePolicy() { return { name: disableKeepAlivePolicyName, - async sendRequest(request3, next) { - request3.disableKeepAlive = true; - return next(request3); + async sendRequest(request2, next) { + request2.disableKeepAlive = true; + return next(request2); } }; } @@ -153514,11 +158024,11 @@ function dateToUnixTime(d6) { } return Math.floor(d6.getTime() / 1e3); } -function unixTimeToDate(n12) { - if (!n12) { +function unixTimeToDate(n8) { + if (!n8) { return void 0; } - return new Date(n12 * 1e3); + return new Date(n8 * 1e3); } function serializeBasicTypes(typeName, objectName, value) { if (value !== null && value !== void 0) { @@ -153860,9 +158370,9 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName, if (Array.isArray(responseBody[key]) && modelProps[key].serializedName === "") { propertyInstance = responseBody[key]; const arrayInstance = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); - for (const [k7, v8] of Object.entries(instance)) { + for (const [k7, v2] of Object.entries(instance)) { if (!Object.prototype.hasOwnProperty.call(arrayInstance, k7)) { - arrayInstance[k7] = v8; + arrayInstance[k7] = v2; } } instance = arrayInstance; @@ -154060,17 +158570,17 @@ function getPropertyFromParameterPath(parent2, parameterPath) { return result; } var originalRequestSymbol = /* @__PURE__ */ Symbol.for("@azure/core-client original request"); -function hasOriginalRequest(request3) { - return originalRequestSymbol in request3; +function hasOriginalRequest(request2) { + return originalRequestSymbol in request2; } -function getOperationRequestInfo(request3) { - if (hasOriginalRequest(request3)) { - return getOperationRequestInfo(request3[originalRequestSymbol]); +function getOperationRequestInfo(request2) { + if (hasOriginalRequest(request2)) { + return getOperationRequestInfo(request2[originalRequestSymbol]); } - let info2 = state2.operationRequestMap.get(request3); + let info2 = state2.operationRequestMap.get(request2); if (!info2) { info2 = {}; - state2.operationRequestMap.set(request3, info2); + state2.operationRequestMap.set(request2, info2); } return info2; } @@ -154093,16 +158603,16 @@ function deserializationPolicy(options = {}) { }; return { name: deserializationPolicyName, - async sendRequest(request3, next) { - const response = await next(request3); + async sendRequest(request2, next) { + const response = await next(request2); return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML3); } }; } function getOperationResponseMap(parsedResponse) { let result; - const request3 = parsedResponse.request; - const operationInfo = getOperationRequestInfo(request3); + const request2 = parsedResponse.request; + const operationInfo = getOperationRequestInfo(request2); const operationSpec = operationInfo?.operationSpec; if (operationSpec) { if (!operationInfo?.operationResponseGetter) { @@ -154114,8 +158624,8 @@ function getOperationResponseMap(parsedResponse) { return result; } function shouldDeserializeResponse(parsedResponse) { - const request3 = parsedResponse.request; - const operationInfo = getOperationRequestInfo(request3); + const request2 = parsedResponse.request; + const operationInfo = getOperationRequestInfo(request2); const shouldDeserialize = operationInfo?.shouldDeserialize; let result; if (shouldDeserialize === void 0) { @@ -154291,19 +158801,19 @@ function serializationPolicy(options = {}) { const stringifyXML2 = options.stringifyXML; return { name: serializationPolicyName, - async sendRequest(request3, next) { - const operationInfo = getOperationRequestInfo(request3); + async sendRequest(request2, next) { + const operationInfo = getOperationRequestInfo(request2); const operationSpec = operationInfo?.operationSpec; const operationArguments = operationInfo?.operationArguments; if (operationSpec && operationArguments) { - serializeHeaders(request3, operationArguments, operationSpec); - serializeRequestBody(request3, operationArguments, operationSpec, stringifyXML2); + serializeHeaders(request2, operationArguments, operationSpec); + serializeRequestBody(request2, operationArguments, operationSpec, stringifyXML2); } - return next(request3); + return next(request2); } }; } -function serializeHeaders(request3, operationArguments, operationSpec) { +function serializeHeaders(request2, operationArguments, operationSpec) { if (operationSpec.headerParameters) { for (const headerParameter of operationSpec.headerParameters) { let headerValue = getOperationArgumentValueFromParameter(operationArguments, headerParameter); @@ -154312,10 +158822,10 @@ function serializeHeaders(request3, operationArguments, operationSpec) { const headerCollectionPrefix = headerParameter.mapper.headerCollectionPrefix; if (headerCollectionPrefix) { for (const key of Object.keys(headerValue)) { - request3.headers.set(headerCollectionPrefix + key, headerValue[key]); + request2.headers.set(headerCollectionPrefix + key, headerValue[key]); } } else { - request3.headers.set(headerParameter.mapper.serializedName || getPathStringFromParameter(headerParameter), headerValue); + request2.headers.set(headerParameter.mapper.serializedName || getPathStringFromParameter(headerParameter), headerValue); } } } @@ -154323,11 +158833,11 @@ function serializeHeaders(request3, operationArguments, operationSpec) { const customHeaders = operationArguments.options?.requestOptions?.customHeaders; if (customHeaders) { for (const customHeaderName of Object.keys(customHeaders)) { - request3.headers.set(customHeaderName, customHeaders[customHeaderName]); + request2.headers.set(customHeaderName, customHeaders[customHeaderName]); } } } -function serializeRequestBody(request3, operationArguments, operationSpec, stringifyXML2 = function() { +function serializeRequestBody(request2, operationArguments, operationSpec, stringifyXML2 = function() { throw new Error("XML serialization unsupported!"); }) { const serializerOptions = operationArguments.options?.serializerOptions; @@ -154340,22 +158850,22 @@ function serializeRequestBody(request3, operationArguments, operationSpec, strin }; const xmlCharKey = updatedOptions.xml.xmlCharKey; if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - request3.body = getOperationArgumentValueFromParameter(operationArguments, operationSpec.requestBody); + request2.body = getOperationArgumentValueFromParameter(operationArguments, operationSpec.requestBody); const bodyMapper = operationSpec.requestBody.mapper; const { required, serializedName, xmlName, xmlElementName, xmlNamespace, xmlNamespacePrefix, nullable } = bodyMapper; const typeName = bodyMapper.type.name; try { - if (request3.body !== void 0 && request3.body !== null || nullable && request3.body === null || required) { + if (request2.body !== void 0 && request2.body !== null || nullable && request2.body === null || required) { const requestBodyParameterPathString = getPathStringFromParameter(operationSpec.requestBody); - request3.body = operationSpec.serializer.serialize(bodyMapper, request3.body, requestBodyParameterPathString, updatedOptions); + request2.body = operationSpec.serializer.serialize(bodyMapper, request2.body, requestBodyParameterPathString, updatedOptions); const isStream2 = typeName === MapperTypeNames.Stream; if (operationSpec.isXML) { const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; - const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request3.body, updatedOptions); + const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request2.body, updatedOptions); if (typeName === MapperTypeNames.Sequence) { - request3.body = stringifyXML2(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); + request2.body = stringifyXML2(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); } else if (!isStream2) { - request3.body = stringifyXML2(value, { + request2.body = stringifyXML2(value, { rootName: xmlName || serializedName, xmlCharKey }); @@ -154363,19 +158873,19 @@ function serializeRequestBody(request3, operationArguments, operationSpec, strin } else if (typeName === MapperTypeNames.String && (operationSpec.contentType?.match("text/plain") || operationSpec.mediaType === "text")) { return; } else if (!isStream2) { - request3.body = JSON.stringify(request3.body); + request2.body = JSON.stringify(request2.body); } } } catch (error2) { throw new Error(`Error "${error2.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`); } } else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - request3.formData = {}; + request2.formData = {}; for (const formDataParameter of operationSpec.formDataParameters) { const formDataParameterValue = getOperationArgumentValueFromParameter(operationArguments, formDataParameter); if (formDataParameterValue !== void 0 && formDataParameterValue !== null) { const formDataParameterPropertyName = formDataParameter.mapper.serializedName || getPathStringFromParameter(formDataParameter); - request3.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, getPathStringFromParameter(formDataParameter), updatedOptions); + request2.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, getPathStringFromParameter(formDataParameter), updatedOptions); } } } @@ -154670,8 +159180,8 @@ var ServiceClient = class { /** * Send the provided httpRequest. */ - async sendRequest(request3) { - return this.pipeline.sendRequest(this._httpClient, request3); + async sendRequest(request2) { + return this.pipeline.sendRequest(this._httpClient, request2); } /** * Send an HTTP request that is populated using the provided OperationSpec. @@ -154685,52 +159195,52 @@ var ServiceClient = class { throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a endpoint string property that contains the base URL to use."); } const url2 = getRequestUrl(endpoint2, operationSpec, operationArguments, this); - const request3 = createPipelineRequest2({ + const request2 = createPipelineRequest2({ url: url2 }); - request3.method = operationSpec.httpMethod; - const operationInfo = getOperationRequestInfo(request3); + request2.method = operationSpec.httpMethod; + const operationInfo = getOperationRequestInfo(request2); operationInfo.operationSpec = operationSpec; operationInfo.operationArguments = operationArguments; const contentType2 = operationSpec.contentType || this._requestContentType; if (contentType2 && operationSpec.requestBody) { - request3.headers.set("Content-Type", contentType2); + request2.headers.set("Content-Type", contentType2); } const options = operationArguments.options; if (options) { const requestOptions = options.requestOptions; if (requestOptions) { if (requestOptions.timeout) { - request3.timeout = requestOptions.timeout; + request2.timeout = requestOptions.timeout; } if (requestOptions.onUploadProgress) { - request3.onUploadProgress = requestOptions.onUploadProgress; + request2.onUploadProgress = requestOptions.onUploadProgress; } if (requestOptions.onDownloadProgress) { - request3.onDownloadProgress = requestOptions.onDownloadProgress; + request2.onDownloadProgress = requestOptions.onDownloadProgress; } if (requestOptions.shouldDeserialize !== void 0) { operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; } if (requestOptions.allowInsecureConnection) { - request3.allowInsecureConnection = true; + request2.allowInsecureConnection = true; } } if (options.abortSignal) { - request3.abortSignal = options.abortSignal; + request2.abortSignal = options.abortSignal; } if (options.tracingOptions) { - request3.tracingOptions = options.tracingOptions; + request2.tracingOptions = options.tracingOptions; } } if (this._allowInsecureConnection) { - request3.allowInsecureConnection = true; + request2.allowInsecureConnection = true; } - if (request3.streamResponseStatusCodes === void 0) { - request3.streamResponseStatusCodes = getStreamingResponseStatusCodes(operationSpec); + if (request2.streamResponseStatusCodes === void 0) { + request2.streamResponseStatusCodes = getStreamingResponseStatusCodes(operationSpec); } try { - const rawResponse = await this.sendRequest(request3); + const rawResponse = await this.sendRequest(request2); const flatResponse = flattenResponse(rawResponse, operationSpec.responses[rawResponse.status]); if (options?.onResponse) { options.onResponse(rawResponse, flatResponse); @@ -154841,17 +159351,17 @@ function getChallenge(response) { } function parseChallenge(challenge) { const bearerChallenge = challenge.slice("Bearer ".length); - const challengeParts = `${bearerChallenge.trim()} `.split(" ").filter((x6) => x6); + const challengeParts = `${bearerChallenge.trim()} `.split(" ").filter((x2) => x2); const keyValuePairs = challengeParts.map((keyValue) => (([key, value]) => ({ [key]: value }))(keyValue.trim().split("="))); return keyValuePairs.reduce((a6, b6) => ({ ...a6, ...b6 }), {}); } -function requestToOptions(request3) { +function requestToOptions(request2) { return { - abortSignal: request3.abortSignal, + abortSignal: request2.abortSignal, requestOptions: { - timeout: request3.timeout + timeout: request2.timeout }, - tracingOptions: request3.tracingOptions + tracingOptions: request2.tracingOptions }; } @@ -154860,11 +159370,11 @@ var originalRequestSymbol2 = /* @__PURE__ */ Symbol("Original PipelineRequest"); var originalClientRequestSymbol = /* @__PURE__ */ Symbol.for("@azure/core-client original request"); function toPipelineRequest(webResource, options = {}) { const compatWebResource = webResource; - const request3 = compatWebResource[originalRequestSymbol2]; + const request2 = compatWebResource[originalRequestSymbol2]; const headers = createHttpHeaders2(webResource.headers.toJson({ preserveCase: true })); - if (request3) { - request3.headers = headers; - return request3; + if (request2) { + request2.headers = headers; + return request2; } else { const newRequest = createPipelineRequest2({ url: webResource.url, @@ -154890,25 +159400,25 @@ function toPipelineRequest(webResource, options = {}) { return newRequest; } } -function toWebResourceLike(request3, options) { - const originalRequest = options?.originalRequest ?? request3; +function toWebResourceLike(request2, options) { + const originalRequest = options?.originalRequest ?? request2; const webResource = { - url: request3.url, - method: request3.method, - headers: toHttpHeadersLike(request3.headers), - withCredentials: request3.withCredentials, - timeout: request3.timeout, - requestId: request3.headers.get("x-ms-client-request-id") || request3.requestId, - abortSignal: request3.abortSignal, - body: request3.body, - formData: request3.formData, - keepAlive: !!request3.disableKeepAlive, - onDownloadProgress: request3.onDownloadProgress, - onUploadProgress: request3.onUploadProgress, - proxySettings: request3.proxySettings, - streamResponseStatusCodes: request3.streamResponseStatusCodes, - agent: request3.agent, - requestOverrides: request3.requestOverrides, + url: request2.url, + method: request2.method, + headers: toHttpHeadersLike(request2.headers), + withCredentials: request2.withCredentials, + timeout: request2.timeout, + requestId: request2.headers.get("x-ms-client-request-id") || request2.requestId, + abortSignal: request2.abortSignal, + body: request2.body, + formData: request2.formData, + keepAlive: !!request2.disableKeepAlive, + onDownloadProgress: request2.onDownloadProgress, + onUploadProgress: request2.onUploadProgress, + proxySettings: request2.proxySettings, + streamResponseStatusCodes: request2.streamResponseStatusCodes, + agent: request2.agent, + requestOverrides: request2.requestOverrides, clone() { throw new Error("Cannot clone a non-proxied WebResourceLike"); }, @@ -154922,7 +159432,7 @@ function toWebResourceLike(request3, options) { return new Proxy(webResource, { get(target, prop, receiver) { if (prop === originalRequestSymbol2) { - return request3; + return request2; } else if (prop === "clone") { return () => { return toWebResourceLike(toPipelineRequest(webResource, { originalRequest }), { @@ -154935,7 +159445,7 @@ function toWebResourceLike(request3, options) { }, set(target, prop, value, receiver) { if (prop === "keepAlive") { - request3.disableKeepAlive = !value; + request2.disableKeepAlive = !value; } const passThroughProps = [ "url", @@ -154954,7 +159464,7 @@ function toWebResourceLike(request3, options) { "requestOverrides" ]; if (typeof prop === "string" && passThroughProps.includes(prop)) { - request3[prop] = value; + request2[prop] = value; } return Reflect.set(target, prop, value, receiver); } @@ -155094,7 +159604,7 @@ var HttpHeaders = class _HttpHeaders { // node_modules/@azure/core-http-compat/dist/esm/response.js var originalResponse = /* @__PURE__ */ Symbol("Original FullOperationResponse"); function toCompatResponse(response, options) { - let request3 = toWebResourceLike(response.request); + let request2 = toWebResourceLike(response.request); let headers = toHttpHeadersLike(response.headers); if (options?.createProxy) { return new Proxy(response, { @@ -155102,7 +159612,7 @@ function toCompatResponse(response, options) { if (prop === "headers") { return headers; } else if (prop === "request") { - return request3; + return request2; } else if (prop === originalResponse) { return response; } @@ -155112,7 +159622,7 @@ function toCompatResponse(response, options) { if (prop === "headers") { headers = value; } else if (prop === "request") { - request3 = value; + request2 = value; } return Reflect.set(target, prop, value, receiver); } @@ -155120,7 +159630,7 @@ function toCompatResponse(response, options) { } else { return { ...response, - request: request3, + request: request2, headers }; } @@ -155204,7 +159714,7 @@ function createRequestPolicyFactoryPolicy(factories) { const orderedFactories = factories.slice().reverse(); return { name: requestPolicyFactoryPolicyName, - async sendRequest(request3, next) { + async sendRequest(request2, next) { let httpPipeline = { async sendRequest(httpRequest2) { const response2 = await next(toPipelineRequest(httpRequest2)); @@ -155214,7 +159724,7 @@ function createRequestPolicyFactoryPolicy(factories) { for (const factory of orderedFactories) { httpPipeline = factory.create(httpPipeline, mockRequestPolicyOptions); } - const webResourceLike = toWebResourceLike(request3, { createProxy: true }); + const webResourceLike = toWebResourceLike(request2, { createProxy: true }); const response = await httpPipeline.sendRequest(webResourceLike); return toPipelineResponse(response); } @@ -155224,8 +159734,8 @@ function createRequestPolicyFactoryPolicy(factories) { // node_modules/@azure/core-http-compat/dist/esm/httpClientAdapter.js function convertHttpClient(requestPolicyClient) { return { - sendRequest: async (request3) => { - const response = await requestPolicyClient.sendRequest(toWebResourceLike(request3, { createProxy: true })); + sendRequest: async (request2) => { + const response = await requestPolicyClient.sendRequest(toWebResourceLike(request2, { createProxy: true })); return toPipelineResponse(response); } }; @@ -155280,12 +159790,12 @@ async function parseXML(str, opts = {}) { if (!str) { throw new Error("Document is empty"); } - const validation = XMLValidator.validate(str); - if (validation !== true) { - throw validation; + const validation2 = XMLValidator.validate(str); + if (validation2 !== true) { + throw validation2; } - const parser2 = new XMLParser(getParserOptions(opts)); - const parsedXml = parser2.parse(str); + const parser3 = new XMLParser(getParserOptions(opts)); + const parsedXml = parser3.parse(str); if (parsedXml["?xml"]) { delete parsedXml["?xml"]; } @@ -155576,7 +160086,7 @@ var BufferScheduler = class { * */ async do() { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { this.readable.on("data", (data) => { data = typeof data === "string" ? Buffer.from(data, this.encoding) : data; this.appendUnresolvedData(data); @@ -155604,11 +160114,11 @@ var BufferScheduler = class { if (this.isStreamEnd && this.executingOutgoingHandlers === 0) { if (this.unresolvedLength > 0 && this.unresolvedLength < this.bufferSize) { const buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer2.getReadableStream(), buffer2.size, this.offset).then(resolve4).catch(reject2); + this.outgoingHandler(() => buffer2.getReadableStream(), buffer2.size, this.offset).then(resolve8).catch(reject2); } else if (this.unresolvedLength >= this.bufferSize) { return; } else { - resolve4(); + resolve8(); } } }); @@ -155846,7 +160356,7 @@ function getURLQueries(url2) { return queries; } async function delay3(timeInMs, aborter, abortError) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { let timeout2; const abortHandler = () => { if (timeout2 !== void 0) { @@ -155858,7 +160368,7 @@ async function delay3(timeInMs, aborter, abortError) { if (aborter !== void 0) { aborter.removeEventListener("abort", abortHandler); } - resolve4(); + resolve8(); }; timeout2 = setTimeout(resolveHandler, timeInMs); if (aborter !== void 0) { @@ -155884,16 +160394,16 @@ var StorageBrowserPolicy = class extends BaseRequestPolicy { * * @param request - */ - async sendRequest(request3) { + async sendRequest(request2) { if (isNodeLike2) { - return this._nextPolicy.sendRequest(request3); + return this._nextPolicy.sendRequest(request2); } - if (request3.method.toUpperCase() === "GET" || request3.method.toUpperCase() === "HEAD") { - request3.url = setURLParameter(request3.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + if (request2.method.toUpperCase() === "GET" || request2.method.toUpperCase() === "HEAD") { + request2.url = setURLParameter(request2.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); } - request3.headers.remove(HeaderConstants.COOKIE); - request3.headers.remove(HeaderConstants.CONTENT_LENGTH); - return this._nextPolicy.sendRequest(request3); + request2.headers.remove(HeaderConstants.COOKIE); + request2.headers.remove(HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request2); } }; @@ -155917,8 +160427,8 @@ var CredentialPolicy = class extends BaseRequestPolicy { * * @param request - */ - sendRequest(request3) { - return this._nextPolicy.sendRequest(this.signRequest(request3)); + sendRequest(request2) { + return this._nextPolicy.sendRequest(this.signRequest(request2)); } /** * Child classes must implement this method with request signing. This method @@ -155926,8 +160436,8 @@ var CredentialPolicy = class extends BaseRequestPolicy { * * @param request - */ - signRequest(request3) { - return request3; + signRequest(request2) { + return request2; } }; @@ -156420,28 +160930,28 @@ var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { * * @param request - */ - signRequest(request3) { - request3.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request3.body && (typeof request3.body === "string" || request3.body !== void 0) && request3.body.length > 0) { - request3.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request3.body)); + signRequest(request2) { + request2.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request2.body && (typeof request2.body === "string" || request2.body !== void 0) && request2.body.length > 0) { + request2.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request2.body)); } const stringToSign = [ - request3.method.toUpperCase(), - this.getHeaderValueToSign(request3, HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request3, HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request3, HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request3, HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request3, HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request3, HeaderConstants.DATE), - this.getHeaderValueToSign(request3, HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request3, HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request3, HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request3, HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request3, HeaderConstants.RANGE) - ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request3) + this.getCanonicalizedResourceString(request3); + request2.method.toUpperCase(), + this.getHeaderValueToSign(request2, HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request2, HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request2, HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request2, HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request2, HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request2, HeaderConstants.DATE), + this.getHeaderValueToSign(request2, HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request2, HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request2, HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request2, HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request2, HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request2) + this.getCanonicalizedResourceString(request2); const signature = this.factory.computeHMACSHA256(stringToSign); - request3.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); - return request3; + request2.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request2; } /** * Retrieve header value according to shared key sign rules. @@ -156450,8 +160960,8 @@ var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { * @param request - * @param headerName - */ - getHeaderValueToSign(request3, headerName) { - const value = request3.headers.get(headerName); + getHeaderValueToSign(request2, headerName) { + const value = request2.headers.get(headerName); if (!value) { return ""; } @@ -156473,8 +160983,8 @@ var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { * * @param request - */ - getCanonicalizedHeadersString(request3) { - let headersArray = request3.headers.headersArray().filter((value) => { + getCanonicalizedHeadersString(request2) { + let headersArray = request2.headers.headersArray().filter((value) => { return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); }); headersArray.sort((a6, b6) => { @@ -156498,11 +161008,11 @@ var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { * * @param request - */ - getCanonicalizedResourceString(request3) { - const path10 = getURLPath(request3.url) || "/"; + getCanonicalizedResourceString(request2) { + const path10 = getURLPath(request2.url) || "/"; let canonicalizedResourceString = ""; canonicalizedResourceString += `/${this.factory.accountName}${path10}`; - const queries = getURLQueries(request3.url); + const queries = getURLQueries(request2.url); const lowercaseQueries = {}; if (queries) { const queryKeys = []; @@ -156611,8 +161121,8 @@ var StorageRetryPolicy = class extends BaseRequestPolicy { * * @param request - */ - async sendRequest(request3) { - return this.attemptSendRequest(request3, false, 1); + async sendRequest(request2) { + return this.attemptSendRequest(request2, false, 1); } /** * Decide and perform next retry. Won't mutate request parameter. @@ -156624,9 +161134,9 @@ var StorageRetryPolicy = class extends BaseRequestPolicy { * @param attempt - How many retries has been attempted to performed, starting from 1, which includes * the attempt will be performed by this method call. */ - async attemptSendRequest(request3, secondaryHas404, attempt) { - const newRequest = request3.clone(); - const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request3.method === "GET" || request3.method === "HEAD" || request3.method === "OPTIONS") || attempt % 2 === 1; + async attemptSendRequest(request2, secondaryHas404, attempt) { + const newRequest = request2.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request2.method === "GET" || request2.method === "HEAD" || request2.method === "OPTIONS") || attempt % 2 === 1; if (!isPrimaryRetry) { newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost); } @@ -156647,8 +161157,8 @@ var StorageRetryPolicy = class extends BaseRequestPolicy { throw err; } } - await this.delay(isPrimaryRetry, attempt, request3.abortSignal); - return this.attemptSendRequest(request3, secondaryHas404, ++attempt); + await this.delay(isPrimaryRetry, attempt, request2.abortSignal); + return this.attemptSendRequest(request2, secondaryHas404, ++attempt); } /** * Decide whether to retry according to last HTTP response and retry counters. @@ -156765,16 +161275,16 @@ var storageBrowserPolicyName = "storageBrowserPolicy"; function storageBrowserPolicy() { return { name: storageBrowserPolicyName, - async sendRequest(request3, next) { + async sendRequest(request2, next) { if (isNodeLike2) { - return next(request3); + return next(request2); } - if (request3.method === "GET" || request3.method === "HEAD") { - request3.url = setURLParameter(request3.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + if (request2.method === "GET" || request2.method === "HEAD") { + request2.url = setURLParameter(request2.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); } - request3.headers.delete(HeaderConstants.COOKIE); - request3.headers.delete(HeaderConstants.CONTENT_LENGTH); - return next(request3); + request2.headers.delete(HeaderConstants.COOKIE); + request2.headers.delete(HeaderConstants.CONTENT_LENGTH); + return next(request2); } }; } @@ -156782,16 +161292,16 @@ function storageBrowserPolicy() { // node_modules/@azure/storage-common/dist/esm/policies/StorageCorrectContentLengthPolicy.js var storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; function storageCorrectContentLengthPolicy() { - function correctContentLength(request3) { - if (request3.body && (typeof request3.body === "string" || Buffer.isBuffer(request3.body)) && request3.body.length > 0) { - request3.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request3.body)); + function correctContentLength(request2) { + if (request2.body && (typeof request2.body === "string" || Buffer.isBuffer(request2.body)) && request2.body.length > 0) { + request2.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request2.body)); } } return { name: storageCorrectContentLengthPolicyName, - async sendRequest(request3, next) { - correctContentLength(request3); - return next(request3); + async sendRequest(request2, next) { + correctContentLength(request2); + return next(request2); } }; } @@ -156888,25 +161398,25 @@ function storageRetryPolicy(options = {}) { } return { name: storageRetryPolicyName, - async sendRequest(request3, next) { + async sendRequest(request2, next) { if (tryTimeoutInMs) { - request3.url = setURLParameter(request3.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + request2.url = setURLParameter(request2.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); } - const primaryUrl = request3.url; - const secondaryUrl = secondaryHost ? setURLHost(request3.url, secondaryHost) : void 0; + const primaryUrl = request2.url; + const secondaryUrl = secondaryHost ? setURLHost(request2.url, secondaryHost) : void 0; let secondaryHas404 = false; let attempt = 1; let retryAgain = true; let response; let error2; while (retryAgain) { - const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request3.method) || attempt % 2 === 1; - request3.url = isPrimaryRetry ? primaryUrl : secondaryUrl; + const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request2.method) || attempt % 2 === 1; + request2.url = isPrimaryRetry ? primaryUrl : secondaryUrl; response = void 0; error2 = void 0; try { logger5.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await next(request3); + response = await next(request2); secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; } catch (e6) { if (isRestError2(e6)) { @@ -156919,7 +161429,7 @@ function storageRetryPolicy(options = {}) { } retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error2 }); if (retryAgain) { - await delay3(calculateDelay(isPrimaryRetry, attempt), request3.abortSignal, RETRY_ABORT_ERROR2); + await delay3(calculateDelay(isPrimaryRetry, attempt), request2.abortSignal, RETRY_ABORT_ERROR2); } attempt++; } @@ -156935,30 +161445,30 @@ function storageRetryPolicy(options = {}) { import { createHmac as createHmac3 } from "crypto"; var storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; function storageSharedKeyCredentialPolicy(options) { - function signRequest(request3) { - request3.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request3.body && (typeof request3.body === "string" || Buffer.isBuffer(request3.body)) && request3.body.length > 0) { - request3.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request3.body)); + function signRequest(request2) { + request2.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request2.body && (typeof request2.body === "string" || Buffer.isBuffer(request2.body)) && request2.body.length > 0) { + request2.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request2.body)); } const stringToSign = [ - request3.method.toUpperCase(), - getHeaderValueToSign(request3, HeaderConstants.CONTENT_LANGUAGE), - getHeaderValueToSign(request3, HeaderConstants.CONTENT_ENCODING), - getHeaderValueToSign(request3, HeaderConstants.CONTENT_LENGTH), - getHeaderValueToSign(request3, HeaderConstants.CONTENT_MD5), - getHeaderValueToSign(request3, HeaderConstants.CONTENT_TYPE), - getHeaderValueToSign(request3, HeaderConstants.DATE), - getHeaderValueToSign(request3, HeaderConstants.IF_MODIFIED_SINCE), - getHeaderValueToSign(request3, HeaderConstants.IF_MATCH), - getHeaderValueToSign(request3, HeaderConstants.IF_NONE_MATCH), - getHeaderValueToSign(request3, HeaderConstants.IF_UNMODIFIED_SINCE), - getHeaderValueToSign(request3, HeaderConstants.RANGE) - ].join("\n") + "\n" + getCanonicalizedHeadersString(request3) + getCanonicalizedResourceString(request3); + request2.method.toUpperCase(), + getHeaderValueToSign(request2, HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request2, HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request2, HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request2, HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request2, HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request2, HeaderConstants.DATE), + getHeaderValueToSign(request2, HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request2, HeaderConstants.IF_MATCH), + getHeaderValueToSign(request2, HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request2, HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request2, HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request2) + getCanonicalizedResourceString(request2); const signature = createHmac3("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); - request3.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + request2.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); } - function getHeaderValueToSign(request3, headerName) { - const value = request3.headers.get(headerName); + function getHeaderValueToSign(request2, headerName) { + const value = request2.headers.get(headerName); if (!value) { return ""; } @@ -156967,9 +161477,9 @@ function storageSharedKeyCredentialPolicy(options) { } return value; } - function getCanonicalizedHeadersString(request3) { + function getCanonicalizedHeadersString(request2) { let headersArray = []; - for (const [name, value] of request3.headers) { + for (const [name, value] of request2.headers) { if (name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE)) { headersArray.push({ name, value }); } @@ -156990,11 +161500,11 @@ function storageSharedKeyCredentialPolicy(options) { }); return canonicalizedHeadersStringToSign; } - function getCanonicalizedResourceString(request3) { - const path10 = getURLPath(request3.url) || "/"; + function getCanonicalizedResourceString(request2) { + const path10 = getURLPath(request2.url) || "/"; let canonicalizedResourceString = ""; canonicalizedResourceString += `/${options.accountName}${path10}`; - const queries = getURLQueries(request3.url); + const queries = getURLQueries(request2.url); const lowercaseQueries = {}; if (queries) { const queryKeys = []; @@ -157015,9 +161525,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } return { name: storageSharedKeyCredentialPolicyName, - async sendRequest(request3, next) { - signRequest(request3); - return next(request3); + async sendRequest(request2, next) { + signRequest(request2); + return next(request2); } }; } @@ -157027,9 +161537,9 @@ var storageRequestFailureDetailsParserPolicyName = "storageRequestFailureDetails function storageRequestFailureDetailsParserPolicy() { return { name: storageRequestFailureDetailsParserPolicyName, - async sendRequest(request3, next) { + async sendRequest(request2, next) { try { - const response = await next(request3); + const response = await next(request2); return response; } catch (err) { if (typeof err === "object" && err !== null && err.response && err.response.parsedBody) { @@ -157466,10 +161976,10 @@ function isCoreHttpPolicyFactory(factory) { "DeserializationPolicy" ]; const mockHttpClient = { - sendRequest: async (request3) => { + sendRequest: async (request2) => { return { - request: request3, - headers: request3.headers.clone(), + request: request2, + headers: request2.headers.clone(), status: 500 }; } @@ -171221,21 +175731,21 @@ function parseObjectReplicationRecord(objectReplicationRecord) { } const orProperties = []; for (const key in objectReplicationRecord) { - const ids = key.split("_"); + const ids2 = key.split("_"); const policyPrefix = "or-"; - if (ids[0].startsWith(policyPrefix)) { - ids[0] = ids[0].substring(policyPrefix.length); + if (ids2[0].startsWith(policyPrefix)) { + ids2[0] = ids2[0].substring(policyPrefix.length); } const rule = { - ruleId: ids[1], + ruleId: ids2[1], replicationStatus: objectReplicationRecord[key] }; - const policyIndex = orProperties.findIndex((policy) => policy.policyId === ids[0]); + const policyIndex = orProperties.findIndex((policy) => policy.policyId === ids2[0]); if (policyIndex > -1) { orProperties[policyIndex].rules.push(rule); } else { orProperties.push({ - policyId: ids[0], + policyId: ids2[0], rules: [rule] }); } @@ -173381,8 +177891,8 @@ var AvroParser = class _AvroParser { return { key, value }; } static async readMap(stream5, readItemMethod, options = {}) { - const readPairMethod = (s6, opts = {}) => { - return _AvroParser.readMapPair(s6, readItemMethod, opts); + const readPairMethod = (s, opts = {}) => { + return _AvroParser.readMapPair(s, readItemMethod, opts); }; const pairs = await _AvroParser.readArray(stream5, readPairMethod, options); const dict = {}; @@ -173563,8 +178073,8 @@ var AvroMapType = class extends AvroType { } // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types read(stream5, options = {}) { - const readItemMethod = (s6, opts) => { - return this._itemType.read(s6, opts); + const readItemMethod = (s, opts) => { + return this._itemType.read(s, opts); }; return AvroParser.readMap(stream5, readItemMethod, options); } @@ -173748,7 +178258,7 @@ var AvroReadableFromStream = class extends AvroReadable { this._position += chunk.length; return this.toUint8Array(chunk); } else { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { const cleanUp = () => { this._readable.removeListener("readable", readableCallback); this._readable.removeListener("error", rejectCallback); @@ -173763,7 +178273,7 @@ var AvroReadableFromStream = class extends AvroReadable { if (callbackChunk) { this._position += callbackChunk.length; cleanUp(); - resolve4(this.toUint8Array(callbackChunk)); + resolve8(this.toUint8Array(callbackChunk)); } }; const rejectCallback = () => { @@ -174298,13 +178808,13 @@ var StorageBlobAudience; // node_modules/@azure/storage-blob/dist/esm/PageBlobRangeResponse.js function rangeResponseFromModel(response) { - const pageRange = (response._response.parsedBody.pageRange || []).map((x6) => ({ - offset: x6.start, - count: x6.end - x6.start + const pageRange = (response._response.parsedBody.pageRange || []).map((x2) => ({ + offset: x2.start, + count: x2.end - x2.start })); - const clearRange = (response._response.parsedBody.clearRange || []).map((x6) => ({ - offset: x6.start, - count: x6.end - x6.start + const clearRange = (response._response.parsedBody.clearRange || []).map((x2) => ({ + offset: x2.start, + count: x2.end - x2.start })); return { ...response, @@ -174409,8 +178919,8 @@ var Poller = class { this.stopped = true; this.pollProgressCallbacks = []; this.operation = operation2; - this.promise = new Promise((resolve4, reject2) => { - this.resolve = resolve4; + this.promise = new Promise((resolve8, reject2) => { + this.resolve = resolve8; this.reject = reject2; }); this.promise.catch(() => { @@ -174815,8 +179325,8 @@ var Batch = class { return Promise.resolve(); } this.parallelExecute(); - return new Promise((resolve4, reject2) => { - this.emitter.on("finish", resolve4); + return new Promise((resolve8, reject2) => { + this.emitter.on("finish", resolve8); this.emitter.on("error", (error2) => { this.state = BatchStates.Error; reject2(error2); @@ -174863,12 +179373,12 @@ import util2 from "util"; async function streamToBuffer(stream5, buffer2, offset, end, encoding) { let pos = 0; const count = end - offset; - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { const timeout2 = setTimeout(() => reject2(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); stream5.on("readable", () => { if (pos >= count) { clearTimeout(timeout2); - resolve4(); + resolve8(); return; } let chunk = stream5.read(); @@ -174887,7 +179397,7 @@ async function streamToBuffer(stream5, buffer2, offset, end, encoding) { if (pos < count) { reject2(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); } - resolve4(); + resolve8(); }); stream5.on("error", (msg) => { clearTimeout(timeout2); @@ -174896,7 +179406,7 @@ async function streamToBuffer(stream5, buffer2, offset, end, encoding) { }); } async function readStreamToLocalFile(rs2, file) { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { const ws2 = fs4.createWriteStream(file); rs2.on("error", (err) => { reject2(err); @@ -174904,7 +179414,7 @@ async function readStreamToLocalFile(rs2, file) { ws2.on("error", (err) => { reject2(err); }); - ws2.on("close", resolve4); + ws2.on("close", resolve8); rs2.pipe(ws2); }); } @@ -175816,7 +180326,7 @@ var BlobClient = class _BlobClient extends StorageClient2 { * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. */ generateSasUrl(options) { - return new Promise((resolve4) => { + return new Promise((resolve8) => { if (!(this.credential instanceof StorageSharedKeyCredential)) { throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); } @@ -175827,7 +180337,7 @@ var BlobClient = class _BlobClient extends StorageClient2 { versionId: this._versionId, ...options }, this.credential).toString(); - resolve4(appendToURLQuery(this.url, sas)); + resolve8(appendToURLQuery(this.url, sas)); }); } /** @@ -175866,7 +180376,7 @@ var BlobClient = class _BlobClient extends StorageClient2 { * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. */ generateUserDelegationSasUrl(options, userDelegationKey) { - return new Promise((resolve4) => { + return new Promise((resolve8) => { const sas = generateBlobSASQueryParameters({ containerName: this._containerName, blobName: this._name, @@ -175874,7 +180384,7 @@ var BlobClient = class _BlobClient extends StorageClient2 { versionId: this._versionId, ...options }, userDelegationKey, this.accountName).toString(); - resolve4(appendToURLQuery(this.url, sas)); + resolve8(appendToURLQuery(this.url, sas)); }); } /** @@ -177586,11 +182096,11 @@ import * as crypto3 from "crypto"; import * as stream from "stream"; var __awaiter6 = function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -177606,7 +182116,7 @@ var __awaiter6 = function(thisArg, _arguments, P2, generator) { } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -177617,7 +182127,7 @@ function uploadToBlobStorage(authenticatedUploadURL, uploadStream, contentType2) let lastProgressTime = Date.now(); const abortController = new AbortController(); const chunkTimer = (interval) => __awaiter6(this, void 0, void 0, function* () { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { const timer = setInterval(() => { if (Date.now() - lastProgressTime > interval) { reject2(new Error("Upload progress stalled.")); @@ -177625,7 +182135,7 @@ function uploadToBlobStorage(authenticatedUploadURL, uploadStream, contentType2) }, interval); abortController.signal.addEventListener("abort", () => { clearInterval(timer); - resolve4(); + resolve8(); }); }); }); @@ -177687,11 +182197,11 @@ import * as fs5 from "fs"; import { realpath } from "fs/promises"; var __awaiter7 = function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -177707,7 +182217,7 @@ var __awaiter7 = function(thisArg, _arguments, P2, generator) { } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -177749,11 +182259,11 @@ function createRawFileUploadStream(filePath) { // node_modules/@actions/artifact/lib/internal/upload/zip.js var __awaiter8 = function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -177769,7 +182279,7 @@ var __awaiter8 = function(thisArg, _arguments, P2, generator) { } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -177898,11 +182408,11 @@ function getMimeType(filePath) { // node_modules/@actions/artifact/lib/internal/upload/upload-artifact.js var __awaiter9 = function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -177918,7 +182428,7 @@ var __awaiter9 = function(thisArg, _arguments, P2, generator) { } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -177945,7 +182455,7 @@ function uploadArtifact(name, files, rootDirectory, options) { if (!(options === null || options === void 0 ? void 0 : options.skipArchive)) { zipSpecification = getUploadZipSpecification(files, rootDirectory); if (zipSpecification.length === 0) { - throw new FilesNotFoundError(zipSpecification.flatMap((s6) => s6.sourcePath ? [s6.sourcePath] : [])); + throw new FilesNotFoundError(zipSpecification.flatMap((s) => s.sourcePath ? [s.sourcePath] : [])); } } const contentType2 = getMimeType(artifactFileName); @@ -178009,11 +182519,11 @@ import * as path3 from "path"; var import_unzip_stream = __toESM(require_unzip(), 1); var __awaiter10 = function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -178029,7 +182539,7 @@ var __awaiter10 = function(thisArg, _arguments, P2, generator) { } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -178062,7 +182572,7 @@ function streamExtract(url2, directory, skipDecompress) { } catch (error2) { retryCount++; debug(`Failed to download artifact after ${retryCount} retries due to ${error2.message}. Retrying in 5 seconds...`); - yield new Promise((resolve4) => setTimeout(resolve4, 5e3)); + yield new Promise((resolve8) => setTimeout(resolve8, 5e3)); } } throw new Error(`Artifact download failed after ${retryCount} retries.`); @@ -178092,7 +182602,7 @@ function streamExtractExternal(url_1, directory_1) { debug(`Content-Type: ${contentType2}, mimeType: ${mimeType}, urlEndsWithZip: ${urlEndsWithZip}, isZip: ${isZip}, skipDecompress: ${skipDecompress}`); debug(`Content-Disposition: ${contentDisposition}, fileName: ${fileName}`); let sha256Digest = void 0; - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { const timerFn = () => { const timeoutError = new Error(`Blob storage chunk did not respond in ${timeout2}ms`); response.message.destroy(timeoutError); @@ -178117,7 +182627,7 @@ function streamExtractExternal(url_1, directory_1) { sha256Digest = hashStream.read(); info(`SHA256 digest of downloaded artifact is ${sha256Digest}`); } - resolve4({ sha256Digest: `sha256:${sha256Digest}` }); + resolve8({ sha256Digest: `sha256:${sha256Digest}` }); }; if (isZip && !skipDecompress) { passThrough.pipe(import_unzip_stream.default.Extract({ path: directory })).on("close", onClose).on("error", onError); @@ -178229,7 +182739,7 @@ function resolveOrCreateDirectory() { var defaultMaxRetryNumber = 5; var defaultExemptStatusCodes = [400, 401, 403, 404, 422]; function getRetryOptions(defaultOptions4, retries = defaultMaxRetryNumber, exemptStatusCodes = defaultExemptStatusCodes) { - var _a5; + var _a6; if (retries <= 0) { return [{ enabled: false }, defaultOptions4.request]; } @@ -178240,7 +182750,7 @@ function getRetryOptions(defaultOptions4, retries = defaultMaxRetryNumber, exemp retryOptions.doNotRetry = exemptStatusCodes; } const requestOptions = Object.assign(Object.assign({}, defaultOptions4.request), { retries }); - debug(`GitHub client configured with: (retries: ${requestOptions.retries}, retry-exempt-status-code: ${(_a5 = retryOptions.doNotRetry) !== null && _a5 !== void 0 ? _a5 : "octokit default: [400, 401, 403, 404, 422]"})`); + debug(`GitHub client configured with: (retries: ${requestOptions.retries}, retry-exempt-status-code: ${(_a6 = retryOptions.doNotRetry) !== null && _a6 !== void 0 ? _a6 : "octokit default: [400, 401, 403, 404, 422]"})`); return [retryOptions, requestOptions]; } @@ -178253,11 +182763,11 @@ init_dist_bundle6(); init_dist_src4(); var __awaiter11 = function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -178273,14 +182783,14 @@ var __awaiter11 = function(thisArg, _arguments, P2, generator) { } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; function getArtifactPublic(artifactName, workflowRunId, repositoryOwner, repositoryName, token) { return __awaiter11(this, void 0, void 0, function* () { - var _a5; + var _a6; const [retryOpts, requestOpts] = getRetryOptions(defaults); const opts = { log: void 0, @@ -178297,7 +182807,7 @@ function getArtifactPublic(artifactName, workflowRunId, repositoryOwner, reposit name: artifactName }); if (getArtifactResp.status !== 200) { - throw new InvalidResponseError(`Invalid response from GitHub API: ${getArtifactResp.status} (${(_a5 = getArtifactResp === null || getArtifactResp === void 0 ? void 0 : getArtifactResp.headers) === null || _a5 === void 0 ? void 0 : _a5["x-github-request-id"]})`); + throw new InvalidResponseError(`Invalid response from GitHub API: ${getArtifactResp.status} (${(_a6 = getArtifactResp === null || getArtifactResp === void 0 ? void 0 : getArtifactResp.headers) === null || _a6 === void 0 ? void 0 : _a6["x-github-request-id"]})`); } if (getArtifactResp.data.artifacts.length === 0) { throw new ArtifactNotFoundError(`Artifact not found for name: ${artifactName} @@ -178322,7 +182832,7 @@ function getArtifactPublic(artifactName, workflowRunId, repositoryOwner, reposit } function getArtifactInternal(artifactName) { return __awaiter11(this, void 0, void 0, function* () { - var _a5; + var _a6; const artifactClient = internalArtifactTwirpClient(); const { workflowRunBackendId, workflowJobRunBackendId } = getBackendIdsFromToken(); const req = { @@ -178347,7 +182857,7 @@ function getArtifactInternal(artifactName) { id: Number(artifact.databaseId), size: Number(artifact.size), createdAt: artifact.createdAt ? Timestamp.toDate(artifact.createdAt) : void 0, - digest: (_a5 = artifact.digest) === null || _a5 === void 0 ? void 0 : _a5.value + digest: (_a6 = artifact.digest) === null || _a6 === void 0 ? void 0 : _a6.value } }; }); @@ -178356,11 +182866,11 @@ function getArtifactInternal(artifactName) { // node_modules/@actions/artifact/lib/internal/delete/delete-artifact.js var __awaiter12 = function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -178376,14 +182886,14 @@ var __awaiter12 = function(thisArg, _arguments, P2, generator) { } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; function deleteArtifactPublic(artifactName, workflowRunId, repositoryOwner, repositoryName, token) { return __awaiter12(this, void 0, void 0, function* () { - var _a5; + var _a6; const [retryOpts, requestOpts] = getRetryOptions(defaults); const opts = { log: void 0, @@ -178400,7 +182910,7 @@ function deleteArtifactPublic(artifactName, workflowRunId, repositoryOwner, repo artifact_id: getArtifactResp.artifact.id }); if (deleteArtifactResp.status !== 204) { - throw new InvalidResponseError(`Invalid response from GitHub API: ${deleteArtifactResp.status} (${(_a5 = deleteArtifactResp === null || deleteArtifactResp === void 0 ? void 0 : deleteArtifactResp.headers) === null || _a5 === void 0 ? void 0 : _a5["x-github-request-id"]})`); + throw new InvalidResponseError(`Invalid response from GitHub API: ${deleteArtifactResp.status} (${(_a6 = deleteArtifactResp === null || deleteArtifactResp === void 0 ? void 0 : deleteArtifactResp.headers) === null || _a6 === void 0 ? void 0 : _a6["x-github-request-id"]})`); } return { id: getArtifactResp.artifact.id @@ -178443,11 +182953,11 @@ init_dist_src4(); init_dist_bundle6(); var __awaiter13 = function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -178463,7 +182973,7 @@ var __awaiter13 = function(thisArg, _arguments, P2, generator) { } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -178546,13 +183056,13 @@ function listArtifactsInternal() { }; const res = yield artifactClient.ListArtifacts(req); let artifacts = res.artifacts.map((artifact) => { - var _a5; + var _a6; return { name: artifact.name, id: Number(artifact.databaseId), size: Number(artifact.size), createdAt: artifact.createdAt ? Timestamp.toDate(artifact.createdAt) : void 0, - digest: (_a5 = artifact.digest) === null || _a5 === void 0 ? void 0 : _a5.value + digest: (_a6 = artifact.digest) === null || _a6 === void 0 ? void 0 : _a6.value }; }); if (latest) { @@ -178580,11 +183090,11 @@ function filterLatest(artifacts) { // node_modules/@actions/artifact/lib/internal/client.js var __awaiter14 = function(thisArg, _arguments, P2, generator) { function adopt(value) { - return value instanceof P2 ? value : new P2(function(resolve4) { - resolve4(value); + return value instanceof P2 ? value : new P2(function(resolve8) { + resolve8(value); }); } - return new (P2 || (P2 = Promise))(function(resolve4, reject2) { + return new (P2 || (P2 = Promise))(function(resolve8, reject2) { function fulfilled(value) { try { step(generator.next(value)); @@ -178600,21 +183110,21 @@ var __awaiter14 = function(thisArg, _arguments, P2, generator) { } } function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __rest = function(s6, e6) { - var t6 = {}; - for (var p6 in s6) if (Object.prototype.hasOwnProperty.call(s6, p6) && e6.indexOf(p6) < 0) - t6[p6] = s6[p6]; - if (s6 != null && typeof Object.getOwnPropertySymbols === "function") - for (var i6 = 0, p6 = Object.getOwnPropertySymbols(s6); i6 < p6.length; i6++) { - if (e6.indexOf(p6[i6]) < 0 && Object.prototype.propertyIsEnumerable.call(s6, p6[i6])) - t6[p6[i6]] = s6[p6[i6]]; +var __rest = function(s, e6) { + var t = {}; + for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2) && e6.indexOf(p2) < 0) + t[p2] = s[p2]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i6 = 0, p2 = Object.getOwnPropertySymbols(s); i6 < p2.length; i6++) { + if (e6.indexOf(p2[i6]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i6])) + t[p2[i6]] = s[p2[i6]]; } - return t6; + return t; }; var DefaultArtifactClient = class { uploadArtifact(name, files, rootDirectory, options) { @@ -179397,27 +183907,27 @@ import { lstat as Ci, readdir as Ti, readlink as Ai, realpath as ki } from "fs/p import { EventEmitter as ee } from "events"; import Pe from "stream"; import { StringDecoder as ni } from "string_decoder"; -var Gt = (n12, t6, e6) => { - let s6 = n12 instanceof RegExp ? ce(n12, e6) : n12, i6 = t6 instanceof RegExp ? ce(t6, e6) : t6, r6 = s6 !== null && i6 != null && ss(s6, i6, e6); - return r6 && { start: r6[0], end: r6[1], pre: e6.slice(0, r6[0]), body: e6.slice(r6[0] + s6.length, r6[1]), post: e6.slice(r6[1] + i6.length) }; +var Gt = (n8, t, e6) => { + let s = n8 instanceof RegExp ? ce(n8, e6) : n8, i6 = t instanceof RegExp ? ce(t, e6) : t, r6 = s !== null && i6 != null && ss(s, i6, e6); + return r6 && { start: r6[0], end: r6[1], pre: e6.slice(0, r6[0]), body: e6.slice(r6[0] + s.length, r6[1]), post: e6.slice(r6[1] + i6.length) }; }; -var ce = (n12, t6) => { - let e6 = t6.match(n12); +var ce = (n8, t) => { + let e6 = t.match(n8); return e6 ? e6[0] : null; }; -var ss = (n12, t6, e6) => { - let s6, i6, r6, o6, h6, a6 = e6.indexOf(n12), l6 = e6.indexOf(t6, a6 + 1), u6 = a6; - if (a6 >= 0 && l6 > 0) { - if (n12 === t6) return [a6, l6]; - for (s6 = [], r6 = e6.length; u6 >= 0 && !h6; ) { - if (u6 === a6) s6.push(u6), a6 = e6.indexOf(n12, u6 + 1); - else if (s6.length === 1) { - let c6 = s6.pop(); - c6 !== void 0 && (h6 = [c6, l6]); - } else i6 = s6.pop(), i6 !== void 0 && i6 < r6 && (r6 = i6, o6 = l6), l6 = e6.indexOf(t6, u6 + 1); - u6 = a6 < l6 && a6 >= 0 ? a6 : l6; +var ss = (n8, t, e6) => { + let s, i6, r6, o2, h6, a6 = e6.indexOf(n8), l3 = e6.indexOf(t, a6 + 1), u = a6; + if (a6 >= 0 && l3 > 0) { + if (n8 === t) return [a6, l3]; + for (s = [], r6 = e6.length; u >= 0 && !h6; ) { + if (u === a6) s.push(u), a6 = e6.indexOf(n8, u + 1); + else if (s.length === 1) { + let c6 = s.pop(); + c6 !== void 0 && (h6 = [c6, l3]); + } else i6 = s.pop(), i6 !== void 0 && i6 < r6 && (r6 = i6, o2 = l3), l3 = e6.indexOf(t, u + 1); + u = a6 < l3 && a6 >= 0 ? a6 : l3; } - s6.length && o6 !== void 0 && (h6 = [r6, o6]); + s.length && o2 !== void 0 && (h6 = [r6, o2]); } return h6; }; @@ -179437,149 +183947,149 @@ var cs = /\\}/g; var fs9 = /\\,/g; var us = /\\./g; var ds = 1e5; -function Ht(n12) { - return isNaN(n12) ? n12.charCodeAt(0) : parseInt(n12, 10); +function Ht(n8) { + return isNaN(n8) ? n8.charCodeAt(0) : parseInt(n8, 10); } -function ps(n12) { - return n12.replace(as, fe).replace(ls, ue).replace(cs, qt).replace(fs9, de).replace(us, pe); +function ps(n8) { + return n8.replace(as, fe).replace(ls, ue).replace(cs, qt).replace(fs9, de).replace(us, pe); } -function ms(n12) { - return n12.replace(is, "\\").replace(rs, "{").replace(ns, "}").replace(os8, ",").replace(hs, "."); +function ms(n8) { + return n8.replace(is, "\\").replace(rs, "{").replace(ns, "}").replace(os8, ",").replace(hs, "."); } -function me(n12) { - if (!n12) return [""]; - let t6 = [], e6 = Gt("{", "}", n12); - if (!e6) return n12.split(","); - let { pre: s6, body: i6, post: r6 } = e6, o6 = s6.split(","); - o6[o6.length - 1] += "{" + i6 + "}"; +function me(n8) { + if (!n8) return [""]; + let t = [], e6 = Gt("{", "}", n8); + if (!e6) return n8.split(","); + let { pre: s, body: i6, post: r6 } = e6, o2 = s.split(","); + o2[o2.length - 1] += "{" + i6 + "}"; let h6 = me(r6); - return r6.length && (o6[o6.length - 1] += h6.shift(), o6.push.apply(o6, h6)), t6.push.apply(t6, o6), t6; + return r6.length && (o2[o2.length - 1] += h6.shift(), o2.push.apply(o2, h6)), t.push.apply(t, o2), t; } -function ge(n12, t6 = {}) { - if (!n12) return []; - let { max: e6 = ds } = t6; - return n12.slice(0, 2) === "{}" && (n12 = "\\{\\}" + n12.slice(2)), ht(ps(n12), e6, true).map(ms); +function ge(n8, t = {}) { + if (!n8) return []; + let { max: e6 = ds } = t; + return n8.slice(0, 2) === "{}" && (n8 = "\\{\\}" + n8.slice(2)), ht(ps(n8), e6, true).map(ms); } -function gs(n12) { - return "{" + n12 + "}"; +function gs(n8) { + return "{" + n8 + "}"; } -function ws(n12) { - return /^-?0\d/.test(n12); +function ws(n8) { + return /^-?0\d/.test(n8); } -function ys(n12, t6) { - return n12 <= t6; +function ys(n8, t) { + return n8 <= t; } -function bs(n12, t6) { - return n12 >= t6; +function bs(n8, t) { + return n8 >= t; } -function ht(n12, t6, e6) { - let s6 = [], i6 = Gt("{", "}", n12); - if (!i6) return [n12]; - let r6 = i6.pre, o6 = i6.post.length ? ht(i6.post, t6, false) : [""]; - if (/\$$/.test(i6.pre)) for (let h6 = 0; h6 < o6.length && h6 < t6; h6++) { - let a6 = r6 + "{" + i6.body + "}" + o6[h6]; - s6.push(a6); +function ht(n8, t, e6) { + let s = [], i6 = Gt("{", "}", n8); + if (!i6) return [n8]; + let r6 = i6.pre, o2 = i6.post.length ? ht(i6.post, t, false) : [""]; + if (/\$$/.test(i6.pre)) for (let h6 = 0; h6 < o2.length && h6 < t; h6++) { + let a6 = r6 + "{" + i6.body + "}" + o2[h6]; + s.push(a6); } else { - let h6 = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i6.body), a6 = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i6.body), l6 = h6 || a6, u6 = i6.body.indexOf(",") >= 0; - if (!l6 && !u6) return i6.post.match(/,(?!,).*\}/) ? (n12 = i6.pre + "{" + i6.body + qt + i6.post, ht(n12, t6, true)) : [n12]; + let h6 = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i6.body), a6 = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i6.body), l3 = h6 || a6, u = i6.body.indexOf(",") >= 0; + if (!l3 && !u) return i6.post.match(/,(?!,).*\}/) ? (n8 = i6.pre + "{" + i6.body + qt + i6.post, ht(n8, t, true)) : [n8]; let c6; - if (l6) c6 = i6.body.split(/\.\./); - else if (c6 = me(i6.body), c6.length === 1 && c6[0] !== void 0 && (c6 = ht(c6[0], t6, false).map(gs), c6.length === 1)) return o6.map((f6) => i6.pre + c6[0] + f6); + if (l3) c6 = i6.body.split(/\.\./); + else if (c6 = me(i6.body), c6.length === 1 && c6[0] !== void 0 && (c6 = ht(c6[0], t, false).map(gs), c6.length === 1)) return o2.map((f6) => i6.pre + c6[0] + f6); let d6; - if (l6 && c6[0] !== void 0 && c6[1] !== void 0) { - let f6 = Ht(c6[0]), m6 = Ht(c6[1]), p6 = Math.max(c6[0].length, c6[1].length), w5 = c6.length === 3 && c6[2] !== void 0 ? Math.abs(Ht(c6[2])) : 1, g6 = ys; - m6 < f6 && (w5 *= -1, g6 = bs); - let E2 = c6.some(ws); + if (l3 && c6[0] !== void 0 && c6[1] !== void 0) { + let f6 = Ht(c6[0]), m3 = Ht(c6[1]), p2 = Math.max(c6[0].length, c6[1].length), w = c6.length === 3 && c6[2] !== void 0 ? Math.abs(Ht(c6[2])) : 1, g6 = ys; + m3 < f6 && (w *= -1, g6 = bs); + let E = c6.some(ws); d6 = []; - for (let y2 = f6; g6(y2, m6); y2 += w5) { + for (let y = f6; g6(y, m3); y += w) { let b6; - if (a6) b6 = String.fromCharCode(y2), b6 === "\\" && (b6 = ""); - else if (b6 = String(y2), E2) { - let z2 = p6 - b6.length; - if (z2 > 0) { - let $ = new Array(z2 + 1).join("0"); - y2 < 0 ? b6 = "-" + $ + b6.slice(1) : b6 = $ + b6; + if (a6) b6 = String.fromCharCode(y), b6 === "\\" && (b6 = ""); + else if (b6 = String(y), E) { + let z = p2 - b6.length; + if (z > 0) { + let $ = new Array(z + 1).join("0"); + y < 0 ? b6 = "-" + $ + b6.slice(1) : b6 = $ + b6; } } d6.push(b6); } } else { d6 = []; - for (let f6 = 0; f6 < c6.length; f6++) d6.push.apply(d6, ht(c6[f6], t6, false)); + for (let f6 = 0; f6 < c6.length; f6++) d6.push.apply(d6, ht(c6[f6], t, false)); } - for (let f6 = 0; f6 < d6.length; f6++) for (let m6 = 0; m6 < o6.length && s6.length < t6; m6++) { - let p6 = r6 + d6[f6] + o6[m6]; - (!e6 || l6 || p6) && s6.push(p6); + for (let f6 = 0; f6 < d6.length; f6++) for (let m3 = 0; m3 < o2.length && s.length < t; m3++) { + let p2 = r6 + d6[f6] + o2[m3]; + (!e6 || l3 || p2) && s.push(p2); } } - return s6; + return s; } -var at = (n12) => { - if (typeof n12 != "string") throw new TypeError("invalid pattern"); - if (n12.length > 65536) throw new TypeError("pattern is too long"); +var at = (n8) => { + if (typeof n8 != "string") throw new TypeError("invalid pattern"); + if (n8.length > 65536) throw new TypeError("pattern is too long"); }; var Ss = { "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true], "[:alpha:]": ["\\p{L}\\p{Nl}", true], "[:ascii:]": ["\\x00-\\x7f", false], "[:blank:]": ["\\p{Zs}\\t", true], "[:cntrl:]": ["\\p{Cc}", true], "[:digit:]": ["\\p{Nd}", true], "[:graph:]": ["\\p{Z}\\p{C}", true, true], "[:lower:]": ["\\p{Ll}", true], "[:print:]": ["\\p{C}", true], "[:punct:]": ["\\p{P}", true], "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true], "[:upper:]": ["\\p{Lu}", true], "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true], "[:xdigit:]": ["A-Fa-f0-9", false] }; -var lt = (n12) => n12.replace(/[[\]\\-]/g, "\\$&"); -var Es = (n12) => n12.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); -var we = (n12) => n12.join(""); -var ye = (n12, t6) => { - let e6 = t6; - if (n12.charAt(e6) !== "[") throw new Error("not in a brace expression"); - let s6 = [], i6 = [], r6 = e6 + 1, o6 = false, h6 = false, a6 = false, l6 = false, u6 = e6, c6 = ""; - t: for (; r6 < n12.length; ) { - let p6 = n12.charAt(r6); - if ((p6 === "!" || p6 === "^") && r6 === e6 + 1) { - l6 = true, r6++; +var lt = (n8) => n8.replace(/[[\]\\-]/g, "\\$&"); +var Es = (n8) => n8.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); +var we = (n8) => n8.join(""); +var ye = (n8, t) => { + let e6 = t; + if (n8.charAt(e6) !== "[") throw new Error("not in a brace expression"); + let s = [], i6 = [], r6 = e6 + 1, o2 = false, h6 = false, a6 = false, l3 = false, u = e6, c6 = ""; + t: for (; r6 < n8.length; ) { + let p2 = n8.charAt(r6); + if ((p2 === "!" || p2 === "^") && r6 === e6 + 1) { + l3 = true, r6++; continue; } - if (p6 === "]" && o6 && !a6) { - u6 = r6 + 1; + if (p2 === "]" && o2 && !a6) { + u = r6 + 1; break; } - if (o6 = true, p6 === "\\" && !a6) { + if (o2 = true, p2 === "\\" && !a6) { a6 = true, r6++; continue; } - if (p6 === "[" && !a6) { - for (let [w5, [g6, S, E2]] of Object.entries(Ss)) if (n12.startsWith(w5, r6)) { - if (c6) return ["$.", false, n12.length - e6, true]; - r6 += w5.length, E2 ? i6.push(g6) : s6.push(g6), h6 = h6 || S; + if (p2 === "[" && !a6) { + for (let [w, [g6, S, E]] of Object.entries(Ss)) if (n8.startsWith(w, r6)) { + if (c6) return ["$.", false, n8.length - e6, true]; + r6 += w.length, E ? i6.push(g6) : s.push(g6), h6 = h6 || S; continue t; } } if (a6 = false, c6) { - p6 > c6 ? s6.push(lt(c6) + "-" + lt(p6)) : p6 === c6 && s6.push(lt(p6)), c6 = "", r6++; + p2 > c6 ? s.push(lt(c6) + "-" + lt(p2)) : p2 === c6 && s.push(lt(p2)), c6 = "", r6++; continue; } - if (n12.startsWith("-]", r6 + 1)) { - s6.push(lt(p6 + "-")), r6 += 2; + if (n8.startsWith("-]", r6 + 1)) { + s.push(lt(p2 + "-")), r6 += 2; continue; } - if (n12.startsWith("-", r6 + 1)) { - c6 = p6, r6 += 2; + if (n8.startsWith("-", r6 + 1)) { + c6 = p2, r6 += 2; continue; } - s6.push(lt(p6)), r6++; + s.push(lt(p2)), r6++; } - if (u6 < r6) return ["", false, 0, false]; - if (!s6.length && !i6.length) return ["$.", false, n12.length - e6, true]; - if (i6.length === 0 && s6.length === 1 && /^\\?.$/.test(s6[0]) && !l6) { - let p6 = s6[0].length === 2 ? s6[0].slice(-1) : s6[0]; - return [Es(p6), false, u6 - e6, false]; + if (u < r6) return ["", false, 0, false]; + if (!s.length && !i6.length) return ["$.", false, n8.length - e6, true]; + if (i6.length === 0 && s.length === 1 && /^\\?.$/.test(s[0]) && !l3) { + let p2 = s[0].length === 2 ? s[0].slice(-1) : s[0]; + return [Es(p2), false, u - e6, false]; } - let d6 = "[" + (l6 ? "^" : "") + we(s6) + "]", f6 = "[" + (l6 ? "" : "^") + we(i6) + "]"; - return [s6.length && i6.length ? "(" + d6 + "|" + f6 + ")" : s6.length ? d6 : f6, h6, u6 - e6, true]; + let d6 = "[" + (l3 ? "^" : "") + we(s) + "]", f6 = "[" + (l3 ? "" : "^") + we(i6) + "]"; + return [s.length && i6.length ? "(" + d6 + "|" + f6 + ")" : s.length ? d6 : f6, h6, u - e6, true]; }; -var W = (n12, { windowsPathsNoEscape: t6 = false, magicalBraces: e6 = true } = {}) => e6 ? t6 ? n12.replace(/\[([^\/\\])\]/g, "$1") : n12.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1") : t6 ? n12.replace(/\[([^\/\\{}])\]/g, "$1") : n12.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1"); +var W = (n8, { windowsPathsNoEscape: t = false, magicalBraces: e6 = true } = {}) => e6 ? t ? n8.replace(/\[([^\/\\])\]/g, "$1") : n8.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1") : t ? n8.replace(/\[([^\/\\{}])\]/g, "$1") : n8.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1"); var xs = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]); -var be = (n12) => xs.has(n12); +var be = (n8) => xs.has(n8); var vs = "(?!(?:^|/)\\.\\.?(?:$|/))"; var Ct = "(?!\\.)"; var Cs = /* @__PURE__ */ new Set(["[", "."]); var Ts = /* @__PURE__ */ new Set(["..", "."]); var As = new Set("().*{}+?[]^$\\!"); -var ks = (n12) => n12.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); +var ks = (n8) => n8.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); var Kt = "[^/]"; var Se = Kt + "*?"; var Ee = Kt + "+?"; @@ -179596,53 +184106,53 @@ var Q = class n { #h; #u; #f = false; - constructor(t6, e6, s6 = {}) { - this.type = t6, t6 && (this.#s = true), this.#o = e6, this.#t = this.#o ? this.#o.#t : this, this.#h = this.#t === this ? s6 : this.#t.#h, this.#w = this.#t === this ? [] : this.#t.#w, t6 === "!" && !this.#t.#c && this.#w.push(this), this.#S = this.#o ? this.#o.#r.length : 0; + constructor(t, e6, s = {}) { + this.type = t, t && (this.#s = true), this.#o = e6, this.#t = this.#o ? this.#o.#t : this, this.#h = this.#t === this ? s : this.#t.#h, this.#w = this.#t === this ? [] : this.#t.#w, t === "!" && !this.#t.#c && this.#w.push(this), this.#S = this.#o ? this.#o.#r.length : 0; } get hasMagic() { if (this.#s !== void 0) return this.#s; - for (let t6 of this.#r) if (typeof t6 != "string" && (t6.type || t6.hasMagic)) return this.#s = true; + for (let t of this.#r) if (typeof t != "string" && (t.type || t.hasMagic)) return this.#s = true; return this.#s; } toString() { - return this.#u !== void 0 ? this.#u : this.type ? this.#u = this.type + "(" + this.#r.map((t6) => String(t6)).join("|") + ")" : this.#u = this.#r.map((t6) => String(t6)).join(""); + return this.#u !== void 0 ? this.#u : this.type ? this.#u = this.type + "(" + this.#r.map((t) => String(t)).join("|") + ")" : this.#u = this.#r.map((t) => String(t)).join(""); } #a() { if (this !== this.#t) throw new Error("should only call on root"); if (this.#c) return this; this.toString(), this.#c = true; - let t6; - for (; t6 = this.#w.pop(); ) { - if (t6.type !== "!") continue; - let e6 = t6, s6 = e6.#o; - for (; s6; ) { - for (let i6 = e6.#S + 1; !s6.type && i6 < s6.#r.length; i6++) for (let r6 of t6.#r) { + let t; + for (; t = this.#w.pop(); ) { + if (t.type !== "!") continue; + let e6 = t, s = e6.#o; + for (; s; ) { + for (let i6 = e6.#S + 1; !s.type && i6 < s.#r.length; i6++) for (let r6 of t.#r) { if (typeof r6 == "string") throw new Error("string part in extglob AST??"); - r6.copyIn(s6.#r[i6]); + r6.copyIn(s.#r[i6]); } - e6 = s6, s6 = e6.#o; + e6 = s, s = e6.#o; } } return this; } - push(...t6) { - for (let e6 of t6) if (e6 !== "") { + push(...t) { + for (let e6 of t) if (e6 !== "") { if (typeof e6 != "string" && !(e6 instanceof n && e6.#o === this)) throw new Error("invalid part: " + e6); this.#r.push(e6); } } toJSON() { - let t6 = this.type === null ? this.#r.slice().map((e6) => typeof e6 == "string" ? e6 : e6.toJSON()) : [this.type, ...this.#r.map((e6) => e6.toJSON())]; - return this.isStart() && !this.type && t6.unshift([]), this.isEnd() && (this === this.#t || this.#t.#c && this.#o?.type === "!") && t6.push({}), t6; + let t = this.type === null ? this.#r.slice().map((e6) => typeof e6 == "string" ? e6 : e6.toJSON()) : [this.type, ...this.#r.map((e6) => e6.toJSON())]; + return this.isStart() && !this.type && t.unshift([]), this.isEnd() && (this === this.#t || this.#t.#c && this.#o?.type === "!") && t.push({}), t; } isStart() { if (this.#t === this) return true; if (!this.#o?.isStart()) return false; if (this.#S === 0) return true; - let t6 = this.#o; + let t = this.#o; for (let e6 = 0; e6 < this.#S; e6++) { - let s6 = t6.#r[e6]; - if (!(s6 instanceof n && s6.type === "!")) return false; + let s = t.#r[e6]; + if (!(s instanceof n && s.type === "!")) return false; } return true; } @@ -179650,195 +184160,195 @@ var Q = class n { if (this.#t === this || this.#o?.type === "!") return true; if (!this.#o?.isEnd()) return false; if (!this.type) return this.#o?.isEnd(); - let t6 = this.#o ? this.#o.#r.length : 0; - return this.#S === t6 - 1; + let t = this.#o ? this.#o.#r.length : 0; + return this.#S === t - 1; } - copyIn(t6) { - typeof t6 == "string" ? this.push(t6) : this.push(t6.clone(this)); + copyIn(t) { + typeof t == "string" ? this.push(t) : this.push(t.clone(this)); } - clone(t6) { - let e6 = new n(this.type, t6); - for (let s6 of this.#r) e6.copyIn(s6); + clone(t) { + let e6 = new n(this.type, t); + for (let s of this.#r) e6.copyIn(s); return e6; } - static #i(t6, e6, s6, i6) { - let r6 = false, o6 = false, h6 = -1, a6 = false; + static #i(t, e6, s, i6) { + let r6 = false, o2 = false, h6 = -1, a6 = false; if (e6.type === null) { - let f6 = s6, m6 = ""; - for (; f6 < t6.length; ) { - let p6 = t6.charAt(f6++); - if (r6 || p6 === "\\") { - r6 = !r6, m6 += p6; + let f6 = s, m3 = ""; + for (; f6 < t.length; ) { + let p2 = t.charAt(f6++); + if (r6 || p2 === "\\") { + r6 = !r6, m3 += p2; continue; } - if (o6) { - f6 === h6 + 1 ? (p6 === "^" || p6 === "!") && (a6 = true) : p6 === "]" && !(f6 === h6 + 2 && a6) && (o6 = false), m6 += p6; + if (o2) { + f6 === h6 + 1 ? (p2 === "^" || p2 === "!") && (a6 = true) : p2 === "]" && !(f6 === h6 + 2 && a6) && (o2 = false), m3 += p2; continue; - } else if (p6 === "[") { - o6 = true, h6 = f6, a6 = false, m6 += p6; + } else if (p2 === "[") { + o2 = true, h6 = f6, a6 = false, m3 += p2; continue; } - if (!i6.noext && be(p6) && t6.charAt(f6) === "(") { - e6.push(m6), m6 = ""; - let w5 = new n(p6, e6); - f6 = n.#i(t6, w5, f6, i6), e6.push(w5); + if (!i6.noext && be(p2) && t.charAt(f6) === "(") { + e6.push(m3), m3 = ""; + let w = new n(p2, e6); + f6 = n.#i(t, w, f6, i6), e6.push(w); continue; } - m6 += p6; + m3 += p2; } - return e6.push(m6), f6; + return e6.push(m3), f6; } - let l6 = s6 + 1, u6 = new n(null, e6), c6 = [], d6 = ""; - for (; l6 < t6.length; ) { - let f6 = t6.charAt(l6++); + let l3 = s + 1, u = new n(null, e6), c6 = [], d6 = ""; + for (; l3 < t.length; ) { + let f6 = t.charAt(l3++); if (r6 || f6 === "\\") { r6 = !r6, d6 += f6; continue; } - if (o6) { - l6 === h6 + 1 ? (f6 === "^" || f6 === "!") && (a6 = true) : f6 === "]" && !(l6 === h6 + 2 && a6) && (o6 = false), d6 += f6; + if (o2) { + l3 === h6 + 1 ? (f6 === "^" || f6 === "!") && (a6 = true) : f6 === "]" && !(l3 === h6 + 2 && a6) && (o2 = false), d6 += f6; continue; } else if (f6 === "[") { - o6 = true, h6 = l6, a6 = false, d6 += f6; + o2 = true, h6 = l3, a6 = false, d6 += f6; continue; } - if (be(f6) && t6.charAt(l6) === "(") { - u6.push(d6), d6 = ""; - let m6 = new n(f6, u6); - u6.push(m6), l6 = n.#i(t6, m6, l6, i6); + if (be(f6) && t.charAt(l3) === "(") { + u.push(d6), d6 = ""; + let m3 = new n(f6, u); + u.push(m3), l3 = n.#i(t, m3, l3, i6); continue; } if (f6 === "|") { - u6.push(d6), d6 = "", c6.push(u6), u6 = new n(null, e6); + u.push(d6), d6 = "", c6.push(u), u = new n(null, e6); continue; } - if (f6 === ")") return d6 === "" && e6.#r.length === 0 && (e6.#f = true), u6.push(d6), d6 = "", e6.push(...c6, u6), l6; + if (f6 === ")") return d6 === "" && e6.#r.length === 0 && (e6.#f = true), u.push(d6), d6 = "", e6.push(...c6, u), l3; d6 += f6; } - return e6.type = null, e6.#s = void 0, e6.#r = [t6.substring(s6 - 1)], l6; + return e6.type = null, e6.#s = void 0, e6.#r = [t.substring(s - 1)], l3; } - static fromGlob(t6, e6 = {}) { - let s6 = new n(null, void 0, e6); - return n.#i(t6, s6, 0, e6), s6; + static fromGlob(t, e6 = {}) { + let s = new n(null, void 0, e6); + return n.#i(t, s, 0, e6), s; } toMMPattern() { if (this !== this.#t) return this.#t.toMMPattern(); - let t6 = this.toString(), [e6, s6, i6, r6] = this.toRegExpSource(); - if (!(i6 || this.#s || this.#h.nocase && !this.#h.nocaseMagicOnly && t6.toUpperCase() !== t6.toLowerCase())) return s6; + let t = this.toString(), [e6, s, i6, r6] = this.toRegExpSource(); + if (!(i6 || this.#s || this.#h.nocase && !this.#h.nocaseMagicOnly && t.toUpperCase() !== t.toLowerCase())) return s; let h6 = (this.#h.nocase ? "i" : "") + (r6 ? "u" : ""); - return Object.assign(new RegExp(`^${e6}$`, h6), { _src: e6, _glob: t6 }); + return Object.assign(new RegExp(`^${e6}$`, h6), { _src: e6, _glob: t }); } get options() { return this.#h; } - toRegExpSource(t6) { - let e6 = t6 ?? !!this.#h.dot; + toRegExpSource(t) { + let e6 = t ?? !!this.#h.dot; if (this.#t === this && this.#a(), !this.type) { - let a6 = this.isStart() && this.isEnd() && !this.#r.some((f6) => typeof f6 != "string"), l6 = this.#r.map((f6) => { - let [m6, p6, w5, g6] = typeof f6 == "string" ? n.#E(f6, this.#s, a6) : f6.toRegExpSource(t6); - return this.#s = this.#s || w5, this.#n = this.#n || g6, m6; - }).join(""), u6 = ""; + let a6 = this.isStart() && this.isEnd() && !this.#r.some((f6) => typeof f6 != "string"), l3 = this.#r.map((f6) => { + let [m3, p2, w, g6] = typeof f6 == "string" ? n.#E(f6, this.#s, a6) : f6.toRegExpSource(t); + return this.#s = this.#s || w, this.#n = this.#n || g6, m3; + }).join(""), u = ""; if (this.isStart() && typeof this.#r[0] == "string" && !(this.#r.length === 1 && Ts.has(this.#r[0]))) { - let m6 = Cs, p6 = e6 && m6.has(l6.charAt(0)) || l6.startsWith("\\.") && m6.has(l6.charAt(2)) || l6.startsWith("\\.\\.") && m6.has(l6.charAt(4)), w5 = !e6 && !t6 && m6.has(l6.charAt(0)); - u6 = p6 ? vs : w5 ? Ct : ""; + let m3 = Cs, p2 = e6 && m3.has(l3.charAt(0)) || l3.startsWith("\\.") && m3.has(l3.charAt(2)) || l3.startsWith("\\.\\.") && m3.has(l3.charAt(4)), w = !e6 && !t && m3.has(l3.charAt(0)); + u = p2 ? vs : w ? Ct : ""; } let c6 = ""; - return this.isEnd() && this.#t.#c && this.#o?.type === "!" && (c6 = "(?:$|\\/)"), [u6 + l6 + c6, W(l6), this.#s = !!this.#s, this.#n]; + return this.isEnd() && this.#t.#c && this.#o?.type === "!" && (c6 = "(?:$|\\/)"), [u + l3 + c6, W(l3), this.#s = !!this.#s, this.#n]; } - let s6 = this.type === "*" || this.type === "+", i6 = this.type === "!" ? "(?:(?!(?:" : "(?:", r6 = this.#d(e6); + let s = this.type === "*" || this.type === "+", i6 = this.type === "!" ? "(?:(?!(?:" : "(?:", r6 = this.#d(e6); if (this.isStart() && this.isEnd() && !r6 && this.type !== "!") { let a6 = this.toString(); return this.#r = [a6], this.type = null, this.#s = void 0, [a6, W(this.toString()), false, false]; } - let o6 = !s6 || t6 || e6 || !Ct ? "" : this.#d(true); - o6 === r6 && (o6 = ""), o6 && (r6 = `(?:${r6})(?:${o6})*?`); + let o2 = !s || t || e6 || !Ct ? "" : this.#d(true); + o2 === r6 && (o2 = ""), o2 && (r6 = `(?:${r6})(?:${o2})*?`); let h6 = ""; if (this.type === "!" && this.#f) h6 = (this.isStart() && !e6 ? Ct : "") + Ee; else { - let a6 = this.type === "!" ? "))" + (this.isStart() && !e6 && !t6 ? Ct : "") + Se + ")" : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && o6 ? ")" : this.type === "*" && o6 ? ")?" : `)${this.type}`; + let a6 = this.type === "!" ? "))" + (this.isStart() && !e6 && !t ? Ct : "") + Se + ")" : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && o2 ? ")" : this.type === "*" && o2 ? ")?" : `)${this.type}`; h6 = i6 + r6 + a6; } return [h6, W(r6), this.#s = !!this.#s, this.#n]; } - #d(t6) { + #d(t) { return this.#r.map((e6) => { if (typeof e6 == "string") throw new Error("string type in extglob ast??"); - let [s6, i6, r6, o6] = e6.toRegExpSource(t6); - return this.#n = this.#n || o6, s6; + let [s, i6, r6, o2] = e6.toRegExpSource(t); + return this.#n = this.#n || o2, s; }).filter((e6) => !(this.isStart() && this.isEnd()) || !!e6).join("|"); } - static #E(t6, e6, s6 = false) { - let i6 = false, r6 = "", o6 = false, h6 = false; - for (let a6 = 0; a6 < t6.length; a6++) { - let l6 = t6.charAt(a6); + static #E(t, e6, s = false) { + let i6 = false, r6 = "", o2 = false, h6 = false; + for (let a6 = 0; a6 < t.length; a6++) { + let l3 = t.charAt(a6); if (i6) { - i6 = false, r6 += (As.has(l6) ? "\\" : "") + l6; + i6 = false, r6 += (As.has(l3) ? "\\" : "") + l3; continue; } - if (l6 === "*") { + if (l3 === "*") { if (h6) continue; - h6 = true, r6 += s6 && /^[*]+$/.test(t6) ? Ee : Se, e6 = true; + h6 = true, r6 += s && /^[*]+$/.test(t) ? Ee : Se, e6 = true; continue; } else h6 = false; - if (l6 === "\\") { - a6 === t6.length - 1 ? r6 += "\\\\" : i6 = true; + if (l3 === "\\") { + a6 === t.length - 1 ? r6 += "\\\\" : i6 = true; continue; } - if (l6 === "[") { - let [u6, c6, d6, f6] = ye(t6, a6); + if (l3 === "[") { + let [u, c6, d6, f6] = ye(t, a6); if (d6) { - r6 += u6, o6 = o6 || c6, a6 += d6 - 1, e6 = e6 || f6; + r6 += u, o2 = o2 || c6, a6 += d6 - 1, e6 = e6 || f6; continue; } } - if (l6 === "?") { + if (l3 === "?") { r6 += Kt, e6 = true; continue; } - r6 += ks(l6); + r6 += ks(l3); } - return [r6, W(t6), !!e6, o6]; + return [r6, W(t), !!e6, o2]; } }; -var tt = (n12, { windowsPathsNoEscape: t6 = false, magicalBraces: e6 = false } = {}) => e6 ? t6 ? n12.replace(/[?*()[\]{}]/g, "[$&]") : n12.replace(/[?*()[\]\\{}]/g, "\\$&") : t6 ? n12.replace(/[?*()[\]]/g, "[$&]") : n12.replace(/[?*()[\]\\]/g, "\\$&"); -var O = (n12, t6, e6 = {}) => (at(t6), !e6.nocomment && t6.charAt(0) === "#" ? false : new D(t6, e6).match(n12)); +var tt = (n8, { windowsPathsNoEscape: t = false, magicalBraces: e6 = false } = {}) => e6 ? t ? n8.replace(/[?*()[\]{}]/g, "[$&]") : n8.replace(/[?*()[\]\\{}]/g, "\\$&") : t ? n8.replace(/[?*()[\]]/g, "[$&]") : n8.replace(/[?*()[\]\\]/g, "\\$&"); +var O = (n8, t, e6 = {}) => (at(t), !e6.nocomment && t.charAt(0) === "#" ? false : new D(t, e6).match(n8)); var Rs = /^\*+([^+@!?\*\[\(]*)$/; -var Os = (n12) => (t6) => !t6.startsWith(".") && t6.endsWith(n12); -var Fs = (n12) => (t6) => t6.endsWith(n12); -var Ds = (n12) => (n12 = n12.toLowerCase(), (t6) => !t6.startsWith(".") && t6.toLowerCase().endsWith(n12)); -var Ms = (n12) => (n12 = n12.toLowerCase(), (t6) => t6.toLowerCase().endsWith(n12)); +var Os = (n8) => (t) => !t.startsWith(".") && t.endsWith(n8); +var Fs = (n8) => (t) => t.endsWith(n8); +var Ds = (n8) => (n8 = n8.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(n8)); +var Ms = (n8) => (n8 = n8.toLowerCase(), (t) => t.toLowerCase().endsWith(n8)); var Ns = /^\*+\.\*+$/; -var _s = (n12) => !n12.startsWith(".") && n12.includes("."); -var Ls = (n12) => n12 !== "." && n12 !== ".." && n12.includes("."); +var _s = (n8) => !n8.startsWith(".") && n8.includes("."); +var Ls = (n8) => n8 !== "." && n8 !== ".." && n8.includes("."); var Ws = /^\.\*+$/; -var Ps = (n12) => n12 !== "." && n12 !== ".." && n12.startsWith("."); +var Ps = (n8) => n8 !== "." && n8 !== ".." && n8.startsWith("."); var js = /^\*+$/; -var Is = (n12) => n12.length !== 0 && !n12.startsWith("."); -var zs = (n12) => n12.length !== 0 && n12 !== "." && n12 !== ".."; +var Is = (n8) => n8.length !== 0 && !n8.startsWith("."); +var zs = (n8) => n8.length !== 0 && n8 !== "." && n8 !== ".."; var Bs = /^\?+([^+@!?\*\[\(]*)?$/; -var Us = ([n12, t6 = ""]) => { - let e6 = Ce([n12]); - return t6 ? (t6 = t6.toLowerCase(), (s6) => e6(s6) && s6.toLowerCase().endsWith(t6)) : e6; +var Us = ([n8, t = ""]) => { + let e6 = Ce([n8]); + return t ? (t = t.toLowerCase(), (s) => e6(s) && s.toLowerCase().endsWith(t)) : e6; }; -var $s = ([n12, t6 = ""]) => { - let e6 = Te([n12]); - return t6 ? (t6 = t6.toLowerCase(), (s6) => e6(s6) && s6.toLowerCase().endsWith(t6)) : e6; +var $s = ([n8, t = ""]) => { + let e6 = Te([n8]); + return t ? (t = t.toLowerCase(), (s) => e6(s) && s.toLowerCase().endsWith(t)) : e6; }; -var Gs = ([n12, t6 = ""]) => { - let e6 = Te([n12]); - return t6 ? (s6) => e6(s6) && s6.endsWith(t6) : e6; +var Gs = ([n8, t = ""]) => { + let e6 = Te([n8]); + return t ? (s) => e6(s) && s.endsWith(t) : e6; }; -var Hs = ([n12, t6 = ""]) => { - let e6 = Ce([n12]); - return t6 ? (s6) => e6(s6) && s6.endsWith(t6) : e6; +var Hs = ([n8, t = ""]) => { + let e6 = Ce([n8]); + return t ? (s) => e6(s) && s.endsWith(t) : e6; }; -var Ce = ([n12]) => { - let t6 = n12.length; - return (e6) => e6.length === t6 && !e6.startsWith("."); +var Ce = ([n8]) => { + let t = n8.length; + return (e6) => e6.length === t && !e6.startsWith("."); }; -var Te = ([n12]) => { - let t6 = n12.length; - return (e6) => e6.length === t6 && e6 !== "." && e6 !== ".."; +var Te = ([n8]) => { + let t = n8.length; + return (e6) => e6.length === t && e6 !== "." && e6 !== ".."; }; var Ae = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix"; var xe = { win32: { sep: "\\" }, posix: { sep: "/" } }; @@ -179850,40 +184360,40 @@ var Ks = "[^/]"; var Vs = Ks + "*?"; var Ys = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; var Xs = "(?:(?!(?:\\/|^)\\.).)*?"; -var Js = (n12, t6 = {}) => (e6) => O(e6, n12, t6); +var Js = (n8, t = {}) => (e6) => O(e6, n8, t); O.filter = Js; -var N = (n12, t6 = {}) => Object.assign({}, n12, t6); -var Zs = (n12) => { - if (!n12 || typeof n12 != "object" || !Object.keys(n12).length) return O; - let t6 = O; - return Object.assign((s6, i6, r6 = {}) => t6(s6, i6, N(n12, r6)), { Minimatch: class extends t6.Minimatch { +var N = (n8, t = {}) => Object.assign({}, n8, t); +var Zs = (n8) => { + if (!n8 || typeof n8 != "object" || !Object.keys(n8).length) return O; + let t = O; + return Object.assign((s, i6, r6 = {}) => t(s, i6, N(n8, r6)), { Minimatch: class extends t.Minimatch { constructor(i6, r6 = {}) { - super(i6, N(n12, r6)); + super(i6, N(n8, r6)); } static defaults(i6) { - return t6.defaults(N(n12, i6)).Minimatch; + return t.defaults(N(n8, i6)).Minimatch; } - }, AST: class extends t6.AST { - constructor(i6, r6, o6 = {}) { - super(i6, r6, N(n12, o6)); + }, AST: class extends t.AST { + constructor(i6, r6, o2 = {}) { + super(i6, r6, N(n8, o2)); } static fromGlob(i6, r6 = {}) { - return t6.AST.fromGlob(i6, N(n12, r6)); + return t.AST.fromGlob(i6, N(n8, r6)); } - }, unescape: (s6, i6 = {}) => t6.unescape(s6, N(n12, i6)), escape: (s6, i6 = {}) => t6.escape(s6, N(n12, i6)), filter: (s6, i6 = {}) => t6.filter(s6, N(n12, i6)), defaults: (s6) => t6.defaults(N(n12, s6)), makeRe: (s6, i6 = {}) => t6.makeRe(s6, N(n12, i6)), braceExpand: (s6, i6 = {}) => t6.braceExpand(s6, N(n12, i6)), match: (s6, i6, r6 = {}) => t6.match(s6, i6, N(n12, r6)), sep: t6.sep, GLOBSTAR: A }); + }, unescape: (s, i6 = {}) => t.unescape(s, N(n8, i6)), escape: (s, i6 = {}) => t.escape(s, N(n8, i6)), filter: (s, i6 = {}) => t.filter(s, N(n8, i6)), defaults: (s) => t.defaults(N(n8, s)), makeRe: (s, i6 = {}) => t.makeRe(s, N(n8, i6)), braceExpand: (s, i6 = {}) => t.braceExpand(s, N(n8, i6)), match: (s, i6, r6 = {}) => t.match(s, i6, N(n8, r6)), sep: t.sep, GLOBSTAR: A }); }; O.defaults = Zs; -var ke = (n12, t6 = {}) => (at(n12), t6.nobrace || !/\{(?:(?!\{).)*\}/.test(n12) ? [n12] : ge(n12, { max: t6.braceExpandMax })); +var ke = (n8, t = {}) => (at(n8), t.nobrace || !/\{(?:(?!\{).)*\}/.test(n8) ? [n8] : ge(n8, { max: t.braceExpandMax })); O.braceExpand = ke; -var Qs = (n12, t6 = {}) => new D(n12, t6).makeRe(); +var Qs = (n8, t = {}) => new D(n8, t).makeRe(); O.makeRe = Qs; -var ti = (n12, t6, e6 = {}) => { - let s6 = new D(t6, e6); - return n12 = n12.filter((i6) => s6.match(i6)), s6.options.nonull && !n12.length && n12.push(t6), n12; +var ti = (n8, t, e6 = {}) => { + let s = new D(t, e6); + return n8 = n8.filter((i6) => s.match(i6)), s.options.nonull && !n8.length && n8.push(t), n8; }; O.match = ti; var ve = /[?*]|[+@!]\(.*?\)|\[|\]/; -var ei = (n12) => n12.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); +var ei = (n8) => n8.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); var D = class { options; set; @@ -179902,230 +184412,230 @@ var D = class { platform; windowsNoMagicRoot; regexp; - constructor(t6, e6 = {}) { - at(t6), e6 = e6 || {}, this.options = e6, this.pattern = t6, this.platform = e6.platform || Ae, this.isWindows = this.platform === "win32"; - let s6 = "allowWindowsEscape"; - this.windowsPathsNoEscape = !!e6.windowsPathsNoEscape || e6[s6] === false, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!e6.preserveMultipleSlashes, this.regexp = null, this.negate = false, this.nonegate = !!e6.nonegate, this.comment = false, this.empty = false, this.partial = !!e6.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = e6.windowsNoMagicRoot !== void 0 ? e6.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make(); + constructor(t, e6 = {}) { + at(t), e6 = e6 || {}, this.options = e6, this.pattern = t, this.platform = e6.platform || Ae, this.isWindows = this.platform === "win32"; + let s = "allowWindowsEscape"; + this.windowsPathsNoEscape = !!e6.windowsPathsNoEscape || e6[s] === false, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!e6.preserveMultipleSlashes, this.regexp = null, this.negate = false, this.nonegate = !!e6.nonegate, this.comment = false, this.empty = false, this.partial = !!e6.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = e6.windowsNoMagicRoot !== void 0 ? e6.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make(); } hasMagic() { if (this.options.magicalBraces && this.set.length > 1) return true; - for (let t6 of this.set) for (let e6 of t6) if (typeof e6 != "string") return true; + for (let t of this.set) for (let e6 of t) if (typeof e6 != "string") return true; return false; } - debug(...t6) { + debug(...t) { } make() { - let t6 = this.pattern, e6 = this.options; - if (!e6.nocomment && t6.charAt(0) === "#") { + let t = this.pattern, e6 = this.options; + if (!e6.nocomment && t.charAt(0) === "#") { this.comment = true; return; } - if (!t6) { + if (!t) { this.empty = true; return; } this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], e6.debug && (this.debug = (...r6) => console.error(...r6)), this.debug(this.pattern, this.globSet); - let s6 = this.globSet.map((r6) => this.slashSplit(r6)); - this.globParts = this.preprocess(s6), this.debug(this.pattern, this.globParts); - let i6 = this.globParts.map((r6, o6, h6) => { + let s = this.globSet.map((r6) => this.slashSplit(r6)); + this.globParts = this.preprocess(s), this.debug(this.pattern, this.globParts); + let i6 = this.globParts.map((r6, o2, h6) => { if (this.isWindows && this.windowsNoMagicRoot) { - let a6 = r6[0] === "" && r6[1] === "" && (r6[2] === "?" || !ve.test(r6[2])) && !ve.test(r6[3]), l6 = /^[a-z]:/i.test(r6[0]); - if (a6) return [...r6.slice(0, 4), ...r6.slice(4).map((u6) => this.parse(u6))]; - if (l6) return [r6[0], ...r6.slice(1).map((u6) => this.parse(u6))]; + let a6 = r6[0] === "" && r6[1] === "" && (r6[2] === "?" || !ve.test(r6[2])) && !ve.test(r6[3]), l3 = /^[a-z]:/i.test(r6[0]); + if (a6) return [...r6.slice(0, 4), ...r6.slice(4).map((u) => this.parse(u))]; + if (l3) return [r6[0], ...r6.slice(1).map((u) => this.parse(u))]; } return r6.map((a6) => this.parse(a6)); }); if (this.debug(this.pattern, i6), this.set = i6.filter((r6) => r6.indexOf(false) === -1), this.isWindows) for (let r6 = 0; r6 < this.set.length; r6++) { - let o6 = this.set[r6]; - o6[0] === "" && o6[1] === "" && this.globParts[r6][2] === "?" && typeof o6[3] == "string" && /^[a-z]:$/i.test(o6[3]) && (o6[2] = "?"); + let o2 = this.set[r6]; + o2[0] === "" && o2[1] === "" && this.globParts[r6][2] === "?" && typeof o2[3] == "string" && /^[a-z]:$/i.test(o2[3]) && (o2[2] = "?"); } this.debug(this.pattern, this.set); } - preprocess(t6) { - if (this.options.noglobstar) for (let s6 = 0; s6 < t6.length; s6++) for (let i6 = 0; i6 < t6[s6].length; i6++) t6[s6][i6] === "**" && (t6[s6][i6] = "*"); + preprocess(t) { + if (this.options.noglobstar) for (let s = 0; s < t.length; s++) for (let i6 = 0; i6 < t[s].length; i6++) t[s][i6] === "**" && (t[s][i6] = "*"); let { optimizationLevel: e6 = 1 } = this.options; - return e6 >= 2 ? (t6 = this.firstPhasePreProcess(t6), t6 = this.secondPhasePreProcess(t6)) : e6 >= 1 ? t6 = this.levelOneOptimize(t6) : t6 = this.adjascentGlobstarOptimize(t6), t6; + return e6 >= 2 ? (t = this.firstPhasePreProcess(t), t = this.secondPhasePreProcess(t)) : e6 >= 1 ? t = this.levelOneOptimize(t) : t = this.adjascentGlobstarOptimize(t), t; } - adjascentGlobstarOptimize(t6) { - return t6.map((e6) => { - let s6 = -1; - for (; (s6 = e6.indexOf("**", s6 + 1)) !== -1; ) { - let i6 = s6; + adjascentGlobstarOptimize(t) { + return t.map((e6) => { + let s = -1; + for (; (s = e6.indexOf("**", s + 1)) !== -1; ) { + let i6 = s; for (; e6[i6 + 1] === "**"; ) i6++; - i6 !== s6 && e6.splice(s6, i6 - s6); + i6 !== s && e6.splice(s, i6 - s); } return e6; }); } - levelOneOptimize(t6) { - return t6.map((e6) => (e6 = e6.reduce((s6, i6) => { - let r6 = s6[s6.length - 1]; - return i6 === "**" && r6 === "**" ? s6 : i6 === ".." && r6 && r6 !== ".." && r6 !== "." && r6 !== "**" ? (s6.pop(), s6) : (s6.push(i6), s6); + levelOneOptimize(t) { + return t.map((e6) => (e6 = e6.reduce((s, i6) => { + let r6 = s[s.length - 1]; + return i6 === "**" && r6 === "**" ? s : i6 === ".." && r6 && r6 !== ".." && r6 !== "." && r6 !== "**" ? (s.pop(), s) : (s.push(i6), s); }, []), e6.length === 0 ? [""] : e6)); } - levelTwoFileOptimize(t6) { - Array.isArray(t6) || (t6 = this.slashSplit(t6)); + levelTwoFileOptimize(t) { + Array.isArray(t) || (t = this.slashSplit(t)); let e6 = false; do { if (e6 = false, !this.preserveMultipleSlashes) { - for (let i6 = 1; i6 < t6.length - 1; i6++) { - let r6 = t6[i6]; - i6 === 1 && r6 === "" && t6[0] === "" || (r6 === "." || r6 === "") && (e6 = true, t6.splice(i6, 1), i6--); + for (let i6 = 1; i6 < t.length - 1; i6++) { + let r6 = t[i6]; + i6 === 1 && r6 === "" && t[0] === "" || (r6 === "." || r6 === "") && (e6 = true, t.splice(i6, 1), i6--); } - t6[0] === "." && t6.length === 2 && (t6[1] === "." || t6[1] === "") && (e6 = true, t6.pop()); + t[0] === "." && t.length === 2 && (t[1] === "." || t[1] === "") && (e6 = true, t.pop()); } - let s6 = 0; - for (; (s6 = t6.indexOf("..", s6 + 1)) !== -1; ) { - let i6 = t6[s6 - 1]; - i6 && i6 !== "." && i6 !== ".." && i6 !== "**" && (e6 = true, t6.splice(s6 - 1, 2), s6 -= 2); + let s = 0; + for (; (s = t.indexOf("..", s + 1)) !== -1; ) { + let i6 = t[s - 1]; + i6 && i6 !== "." && i6 !== ".." && i6 !== "**" && (e6 = true, t.splice(s - 1, 2), s -= 2); } } while (e6); - return t6.length === 0 ? [""] : t6; + return t.length === 0 ? [""] : t; } - firstPhasePreProcess(t6) { + firstPhasePreProcess(t) { let e6 = false; do { e6 = false; - for (let s6 of t6) { + for (let s of t) { let i6 = -1; - for (; (i6 = s6.indexOf("**", i6 + 1)) !== -1; ) { - let o6 = i6; - for (; s6[o6 + 1] === "**"; ) o6++; - o6 > i6 && s6.splice(i6 + 1, o6 - i6); - let h6 = s6[i6 + 1], a6 = s6[i6 + 2], l6 = s6[i6 + 3]; - if (h6 !== ".." || !a6 || a6 === "." || a6 === ".." || !l6 || l6 === "." || l6 === "..") continue; - e6 = true, s6.splice(i6, 1); - let u6 = s6.slice(0); - u6[i6] = "**", t6.push(u6), i6--; + for (; (i6 = s.indexOf("**", i6 + 1)) !== -1; ) { + let o2 = i6; + for (; s[o2 + 1] === "**"; ) o2++; + o2 > i6 && s.splice(i6 + 1, o2 - i6); + let h6 = s[i6 + 1], a6 = s[i6 + 2], l3 = s[i6 + 3]; + if (h6 !== ".." || !a6 || a6 === "." || a6 === ".." || !l3 || l3 === "." || l3 === "..") continue; + e6 = true, s.splice(i6, 1); + let u = s.slice(0); + u[i6] = "**", t.push(u), i6--; } if (!this.preserveMultipleSlashes) { - for (let o6 = 1; o6 < s6.length - 1; o6++) { - let h6 = s6[o6]; - o6 === 1 && h6 === "" && s6[0] === "" || (h6 === "." || h6 === "") && (e6 = true, s6.splice(o6, 1), o6--); + for (let o2 = 1; o2 < s.length - 1; o2++) { + let h6 = s[o2]; + o2 === 1 && h6 === "" && s[0] === "" || (h6 === "." || h6 === "") && (e6 = true, s.splice(o2, 1), o2--); } - s6[0] === "." && s6.length === 2 && (s6[1] === "." || s6[1] === "") && (e6 = true, s6.pop()); + s[0] === "." && s.length === 2 && (s[1] === "." || s[1] === "") && (e6 = true, s.pop()); } let r6 = 0; - for (; (r6 = s6.indexOf("..", r6 + 1)) !== -1; ) { - let o6 = s6[r6 - 1]; - if (o6 && o6 !== "." && o6 !== ".." && o6 !== "**") { + for (; (r6 = s.indexOf("..", r6 + 1)) !== -1; ) { + let o2 = s[r6 - 1]; + if (o2 && o2 !== "." && o2 !== ".." && o2 !== "**") { e6 = true; - let a6 = r6 === 1 && s6[r6 + 1] === "**" ? ["."] : []; - s6.splice(r6 - 1, 2, ...a6), s6.length === 0 && s6.push(""), r6 -= 2; + let a6 = r6 === 1 && s[r6 + 1] === "**" ? ["."] : []; + s.splice(r6 - 1, 2, ...a6), s.length === 0 && s.push(""), r6 -= 2; } } } } while (e6); - return t6; + return t; } - secondPhasePreProcess(t6) { - for (let e6 = 0; e6 < t6.length - 1; e6++) for (let s6 = e6 + 1; s6 < t6.length; s6++) { - let i6 = this.partsMatch(t6[e6], t6[s6], !this.preserveMultipleSlashes); + secondPhasePreProcess(t) { + for (let e6 = 0; e6 < t.length - 1; e6++) for (let s = e6 + 1; s < t.length; s++) { + let i6 = this.partsMatch(t[e6], t[s], !this.preserveMultipleSlashes); if (i6) { - t6[e6] = [], t6[s6] = i6; + t[e6] = [], t[s] = i6; break; } } - return t6.filter((e6) => e6.length); + return t.filter((e6) => e6.length); } - partsMatch(t6, e6, s6 = false) { - let i6 = 0, r6 = 0, o6 = [], h6 = ""; - for (; i6 < t6.length && r6 < e6.length; ) if (t6[i6] === e6[r6]) o6.push(h6 === "b" ? e6[r6] : t6[i6]), i6++, r6++; - else if (s6 && t6[i6] === "**" && e6[r6] === t6[i6 + 1]) o6.push(t6[i6]), i6++; - else if (s6 && e6[r6] === "**" && t6[i6] === e6[r6 + 1]) o6.push(e6[r6]), r6++; - else if (t6[i6] === "*" && e6[r6] && (this.options.dot || !e6[r6].startsWith(".")) && e6[r6] !== "**") { + partsMatch(t, e6, s = false) { + let i6 = 0, r6 = 0, o2 = [], h6 = ""; + for (; i6 < t.length && r6 < e6.length; ) if (t[i6] === e6[r6]) o2.push(h6 === "b" ? e6[r6] : t[i6]), i6++, r6++; + else if (s && t[i6] === "**" && e6[r6] === t[i6 + 1]) o2.push(t[i6]), i6++; + else if (s && e6[r6] === "**" && t[i6] === e6[r6 + 1]) o2.push(e6[r6]), r6++; + else if (t[i6] === "*" && e6[r6] && (this.options.dot || !e6[r6].startsWith(".")) && e6[r6] !== "**") { if (h6 === "b") return false; - h6 = "a", o6.push(t6[i6]), i6++, r6++; - } else if (e6[r6] === "*" && t6[i6] && (this.options.dot || !t6[i6].startsWith(".")) && t6[i6] !== "**") { + h6 = "a", o2.push(t[i6]), i6++, r6++; + } else if (e6[r6] === "*" && t[i6] && (this.options.dot || !t[i6].startsWith(".")) && t[i6] !== "**") { if (h6 === "a") return false; - h6 = "b", o6.push(e6[r6]), i6++, r6++; + h6 = "b", o2.push(e6[r6]), i6++, r6++; } else return false; - return t6.length === e6.length && o6; + return t.length === e6.length && o2; } parseNegate() { if (this.nonegate) return; - let t6 = this.pattern, e6 = false, s6 = 0; - for (let i6 = 0; i6 < t6.length && t6.charAt(i6) === "!"; i6++) e6 = !e6, s6++; - s6 && (this.pattern = t6.slice(s6)), this.negate = e6; + let t = this.pattern, e6 = false, s = 0; + for (let i6 = 0; i6 < t.length && t.charAt(i6) === "!"; i6++) e6 = !e6, s++; + s && (this.pattern = t.slice(s)), this.negate = e6; } - matchOne(t6, e6, s6 = false) { + matchOne(t, e6, s = false) { let i6 = this.options; if (this.isWindows) { - let p6 = typeof t6[0] == "string" && /^[a-z]:$/i.test(t6[0]), w5 = !p6 && t6[0] === "" && t6[1] === "" && t6[2] === "?" && /^[a-z]:$/i.test(t6[3]), g6 = typeof e6[0] == "string" && /^[a-z]:$/i.test(e6[0]), S = !g6 && e6[0] === "" && e6[1] === "" && e6[2] === "?" && typeof e6[3] == "string" && /^[a-z]:$/i.test(e6[3]), E2 = w5 ? 3 : p6 ? 0 : void 0, y2 = S ? 3 : g6 ? 0 : void 0; - if (typeof E2 == "number" && typeof y2 == "number") { - let [b6, z2] = [t6[E2], e6[y2]]; - b6.toLowerCase() === z2.toLowerCase() && (e6[y2] = b6, y2 > E2 ? e6 = e6.slice(y2) : E2 > y2 && (t6 = t6.slice(E2))); + let p2 = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), w = !p2 && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), g6 = typeof e6[0] == "string" && /^[a-z]:$/i.test(e6[0]), S = !g6 && e6[0] === "" && e6[1] === "" && e6[2] === "?" && typeof e6[3] == "string" && /^[a-z]:$/i.test(e6[3]), E = w ? 3 : p2 ? 0 : void 0, y = S ? 3 : g6 ? 0 : void 0; + if (typeof E == "number" && typeof y == "number") { + let [b6, z] = [t[E], e6[y]]; + b6.toLowerCase() === z.toLowerCase() && (e6[y] = b6, y > E ? e6 = e6.slice(y) : E > y && (t = t.slice(E))); } } let { optimizationLevel: r6 = 1 } = this.options; - r6 >= 2 && (t6 = this.levelTwoFileOptimize(t6)), this.debug("matchOne", this, { file: t6, pattern: e6 }), this.debug("matchOne", t6.length, e6.length); - for (var o6 = 0, h6 = 0, a6 = t6.length, l6 = e6.length; o6 < a6 && h6 < l6; o6++, h6++) { + r6 >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, { file: t, pattern: e6 }), this.debug("matchOne", t.length, e6.length); + for (var o2 = 0, h6 = 0, a6 = t.length, l3 = e6.length; o2 < a6 && h6 < l3; o2++, h6++) { this.debug("matchOne loop"); - var u6 = e6[h6], c6 = t6[o6]; - if (this.debug(e6, u6, c6), u6 === false) return false; - if (u6 === A) { - this.debug("GLOBSTAR", [e6, u6, c6]); - var d6 = o6, f6 = h6 + 1; - if (f6 === l6) { - for (this.debug("** at the end"); o6 < a6; o6++) if (t6[o6] === "." || t6[o6] === ".." || !i6.dot && t6[o6].charAt(0) === ".") return false; + var u = e6[h6], c6 = t[o2]; + if (this.debug(e6, u, c6), u === false) return false; + if (u === A) { + this.debug("GLOBSTAR", [e6, u, c6]); + var d6 = o2, f6 = h6 + 1; + if (f6 === l3) { + for (this.debug("** at the end"); o2 < a6; o2++) if (t[o2] === "." || t[o2] === ".." || !i6.dot && t[o2].charAt(0) === ".") return false; return true; } for (; d6 < a6; ) { - var m6 = t6[d6]; + var m3 = t[d6]; if (this.debug(` -globstar while`, t6, d6, e6, f6, m6), this.matchOne(t6.slice(d6), e6.slice(f6), s6)) return this.debug("globstar found match!", d6, a6, m6), true; - if (m6 === "." || m6 === ".." || !i6.dot && m6.charAt(0) === ".") { - this.debug("dot detected!", t6, d6, e6, f6); +globstar while`, t, d6, e6, f6, m3), this.matchOne(t.slice(d6), e6.slice(f6), s)) return this.debug("globstar found match!", d6, a6, m3), true; + if (m3 === "." || m3 === ".." || !i6.dot && m3.charAt(0) === ".") { + this.debug("dot detected!", t, d6, e6, f6); break; } this.debug("globstar swallow a segment, and continue"), d6++; } - return !!(s6 && (this.debug(` ->>> no match, partial?`, t6, d6, e6, f6), d6 === a6)); + return !!(s && (this.debug(` +>>> no match, partial?`, t, d6, e6, f6), d6 === a6)); } - let p6; - if (typeof u6 == "string" ? (p6 = c6 === u6, this.debug("string match", u6, c6, p6)) : (p6 = u6.test(c6), this.debug("pattern match", u6, c6, p6)), !p6) return false; + let p2; + if (typeof u == "string" ? (p2 = c6 === u, this.debug("string match", u, c6, p2)) : (p2 = u.test(c6), this.debug("pattern match", u, c6, p2)), !p2) return false; } - if (o6 === a6 && h6 === l6) return true; - if (o6 === a6) return s6; - if (h6 === l6) return o6 === a6 - 1 && t6[o6] === ""; + if (o2 === a6 && h6 === l3) return true; + if (o2 === a6) return s; + if (h6 === l3) return o2 === a6 - 1 && t[o2] === ""; throw new Error("wtf?"); } braceExpand() { return ke(this.pattern, this.options); } - parse(t6) { - at(t6); + parse(t) { + at(t); let e6 = this.options; - if (t6 === "**") return A; - if (t6 === "") return ""; - let s6, i6 = null; - (s6 = t6.match(js)) ? i6 = e6.dot ? zs : Is : (s6 = t6.match(Rs)) ? i6 = (e6.nocase ? e6.dot ? Ms : Ds : e6.dot ? Fs : Os)(s6[1]) : (s6 = t6.match(Bs)) ? i6 = (e6.nocase ? e6.dot ? $s : Us : e6.dot ? Gs : Hs)(s6) : (s6 = t6.match(Ns)) ? i6 = e6.dot ? Ls : _s : (s6 = t6.match(Ws)) && (i6 = Ps); - let r6 = Q.fromGlob(t6, this.options).toMMPattern(); + if (t === "**") return A; + if (t === "") return ""; + let s, i6 = null; + (s = t.match(js)) ? i6 = e6.dot ? zs : Is : (s = t.match(Rs)) ? i6 = (e6.nocase ? e6.dot ? Ms : Ds : e6.dot ? Fs : Os)(s[1]) : (s = t.match(Bs)) ? i6 = (e6.nocase ? e6.dot ? $s : Us : e6.dot ? Gs : Hs)(s) : (s = t.match(Ns)) ? i6 = e6.dot ? Ls : _s : (s = t.match(Ws)) && (i6 = Ps); + let r6 = Q.fromGlob(t, this.options).toMMPattern(); return i6 && typeof r6 == "object" && Reflect.defineProperty(r6, "test", { value: i6 }), r6; } makeRe() { if (this.regexp || this.regexp === false) return this.regexp; - let t6 = this.set; - if (!t6.length) return this.regexp = false, this.regexp; - let e6 = this.options, s6 = e6.noglobstar ? Vs : e6.dot ? Ys : Xs, i6 = new Set(e6.nocase ? ["i"] : []), r6 = t6.map((a6) => { - let l6 = a6.map((c6) => { + let t = this.set; + if (!t.length) return this.regexp = false, this.regexp; + let e6 = this.options, s = e6.noglobstar ? Vs : e6.dot ? Ys : Xs, i6 = new Set(e6.nocase ? ["i"] : []), r6 = t.map((a6) => { + let l3 = a6.map((c6) => { if (c6 instanceof RegExp) for (let d6 of c6.flags.split("")) i6.add(d6); return typeof c6 == "string" ? ei(c6) : c6 === A ? A : c6._src; }); - l6.forEach((c6, d6) => { - let f6 = l6[d6 + 1], m6 = l6[d6 - 1]; - c6 !== A || m6 === A || (m6 === void 0 ? f6 !== void 0 && f6 !== A ? l6[d6 + 1] = "(?:\\/|" + s6 + "\\/)?" + f6 : l6[d6] = s6 : f6 === void 0 ? l6[d6 - 1] = m6 + "(?:\\/|\\/" + s6 + ")?" : f6 !== A && (l6[d6 - 1] = m6 + "(?:\\/|\\/" + s6 + "\\/)" + f6, l6[d6 + 1] = A)); + l3.forEach((c6, d6) => { + let f6 = l3[d6 + 1], m3 = l3[d6 - 1]; + c6 !== A || m3 === A || (m3 === void 0 ? f6 !== void 0 && f6 !== A ? l3[d6 + 1] = "(?:\\/|" + s + "\\/)?" + f6 : l3[d6] = s : f6 === void 0 ? l3[d6 - 1] = m3 + "(?:\\/|\\/" + s + ")?" : f6 !== A && (l3[d6 - 1] = m3 + "(?:\\/|\\/" + s + "\\/)" + f6, l3[d6 + 1] = A)); }); - let u6 = l6.filter((c6) => c6 !== A); - if (this.partial && u6.length >= 1) { + let u = l3.filter((c6) => c6 !== A); + if (this.partial && u.length >= 1) { let c6 = []; - for (let d6 = 1; d6 <= u6.length; d6++) c6.push(u6.slice(0, d6).join("/")); + for (let d6 = 1; d6 <= u.length; d6++) c6.push(u.slice(0, d6).join("/")); return "(?:" + c6.join("|") + ")"; } - return u6.join("/"); - }).join("|"), [o6, h6] = t6.length > 1 ? ["(?:", ")"] : ["", ""]; - r6 = "^" + o6 + r6 + h6 + "$", this.partial && (r6 = "^(?:\\/|" + o6 + r6.slice(1, -1) + h6 + ")$"), this.negate && (r6 = "^(?!" + r6 + ").+$"); + return u.join("/"); + }).join("|"), [o2, h6] = t.length > 1 ? ["(?:", ")"] : ["", ""]; + r6 = "^" + o2 + r6 + h6 + "$", this.partial && (r6 = "^(?:\\/|" + o2 + r6.slice(1, -1) + h6 + ")$"), this.negate && (r6 = "^(?!" + r6 + ").+$"); try { this.regexp = new RegExp(r6, [...i6].join("")); } catch { @@ -180133,29 +184643,29 @@ globstar while`, t6, d6, e6, f6, m6), this.matchOne(t6.slice(d6), e6.slice(f6), } return this.regexp; } - slashSplit(t6) { - return this.preserveMultipleSlashes ? t6.split("/") : this.isWindows && /^\/\/[^\/]+/.test(t6) ? ["", ...t6.split(/\/+/)] : t6.split(/\/+/); + slashSplit(t) { + return this.preserveMultipleSlashes ? t.split("/") : this.isWindows && /^\/\/[^\/]+/.test(t) ? ["", ...t.split(/\/+/)] : t.split(/\/+/); } - match(t6, e6 = this.partial) { - if (this.debug("match", t6, this.pattern), this.comment) return false; - if (this.empty) return t6 === ""; - if (t6 === "/" && e6) return true; - let s6 = this.options; - this.isWindows && (t6 = t6.split("\\").join("/")); - let i6 = this.slashSplit(t6); + match(t, e6 = this.partial) { + if (this.debug("match", t, this.pattern), this.comment) return false; + if (this.empty) return t === ""; + if (t === "/" && e6) return true; + let s = this.options; + this.isWindows && (t = t.split("\\").join("/")); + let i6 = this.slashSplit(t); this.debug(this.pattern, "split", i6); let r6 = this.set; this.debug(this.pattern, "set", r6); - let o6 = i6[i6.length - 1]; - if (!o6) for (let h6 = i6.length - 2; !o6 && h6 >= 0; h6--) o6 = i6[h6]; + let o2 = i6[i6.length - 1]; + if (!o2) for (let h6 = i6.length - 2; !o2 && h6 >= 0; h6--) o2 = i6[h6]; for (let h6 = 0; h6 < r6.length; h6++) { - let a6 = r6[h6], l6 = i6; - if (s6.matchBase && a6.length === 1 && (l6 = [o6]), this.matchOne(l6, a6, e6)) return s6.flipNegate ? true : !this.negate; + let a6 = r6[h6], l3 = i6; + if (s.matchBase && a6.length === 1 && (l3 = [o2]), this.matchOne(l3, a6, e6)) return s.flipNegate ? true : !this.negate; } - return s6.flipNegate ? false : this.negate; + return s.flipNegate ? false : this.negate; } - static defaults(t6) { - return O.defaults(t6).Minimatch; + static defaults(t) { + return O.defaults(t).Minimatch; } }; O.AST = Q; @@ -180165,8 +184675,8 @@ O.unescape = W; var si = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date; var Oe = /* @__PURE__ */ new Set(); var Vt = typeof process == "object" && process ? process : {}; -var Fe = (n12, t6, e6, s6) => { - typeof Vt.emitWarning == "function" ? Vt.emitWarning(n12, t6, e6, s6) : console.error(`[${e6}] ${t6}: ${n12}`); +var Fe = (n8, t, e6, s) => { + typeof Vt.emitWarning == "function" ? Vt.emitWarning(n8, t, e6, s) : console.error(`[${e6}] ${t}: ${n8}`); }; var At = globalThis.AbortController; var Re = globalThis.AbortSignal; @@ -180176,51 +184686,51 @@ if (typeof At > "u") { _onabort = []; reason; aborted = false; - addEventListener(e6, s6) { - this._onabort.push(s6); + addEventListener(e6, s) { + this._onabort.push(s); } }, At = class { constructor() { - t6(); + t(); } signal = new Re(); abort(e6) { if (!this.signal.aborted) { this.signal.reason = e6, this.signal.aborted = true; - for (let s6 of this.signal._onabort) s6(e6); + for (let s of this.signal._onabort) s(e6); this.signal.onabort?.(e6); } } }; - let n12 = Vt.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t6 = () => { - n12 && (n12 = false, Fe("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", t6)); + let n8 = Vt.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t = () => { + n8 && (n8 = false, Fe("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", t)); }; } -var ii = (n12) => !Oe.has(n12); -var q = (n12) => n12 && n12 === Math.floor(n12) && n12 > 0 && isFinite(n12); -var De = (n12) => q(n12) ? n12 <= Math.pow(2, 8) ? Uint8Array : n12 <= Math.pow(2, 16) ? Uint16Array : n12 <= Math.pow(2, 32) ? Uint32Array : n12 <= Number.MAX_SAFE_INTEGER ? Tt : null : null; +var ii = (n8) => !Oe.has(n8); +var q = (n8) => n8 && n8 === Math.floor(n8) && n8 > 0 && isFinite(n8); +var De = (n8) => q(n8) ? n8 <= Math.pow(2, 8) ? Uint8Array : n8 <= Math.pow(2, 16) ? Uint16Array : n8 <= Math.pow(2, 32) ? Uint32Array : n8 <= Number.MAX_SAFE_INTEGER ? Tt : null : null; var Tt = class extends Array { - constructor(n12) { - super(n12), this.fill(0); + constructor(n8) { + super(n8), this.fill(0); } }; var ri = class ct { heap; length; static #t = false; - static create(t6) { - let e6 = De(t6); + static create(t) { + let e6 = De(t); if (!e6) return []; ct.#t = true; - let s6 = new ct(t6, e6); - return ct.#t = false, s6; + let s = new ct(t, e6); + return ct.#t = false, s; } - constructor(t6, e6) { + constructor(t, e6) { if (!ct.#t) throw new TypeError("instantiate Stack using Stack.create(n)"); - this.heap = new e6(t6), this.length = 0; + this.heap = new e6(t), this.length = 0; } - push(t6) { - this.heap[this.length++] = t6; + push(t) { + this.heap[this.length++] = t; } pop() { return this.heap[--this.length]; @@ -180272,12 +184782,12 @@ var ft = class Me { #A; #e; #_; - static unsafeExposeInternals(t6) { - return { starts: t6.#T, ttls: t6.#g, autopurgeTimers: t6.#y, sizes: t6.#C, keyMap: t6.#f, keyList: t6.#a, valList: t6.#i, next: t6.#d, prev: t6.#E, get head() { - return t6.#b; + static unsafeExposeInternals(t) { + return { starts: t.#T, ttls: t.#g, autopurgeTimers: t.#y, sizes: t.#C, keyMap: t.#f, keyList: t.#a, valList: t.#i, next: t.#d, prev: t.#E, get head() { + return t.#b; }, get tail() { - return t6.#p; - }, free: t6.#R, isBackgroundFetch: (e6) => t6.#l(e6), backgroundFetch: (e6, s6, i6, r6) => t6.#U(e6, s6, i6, r6), moveToTail: (e6) => t6.#W(e6), indexes: (e6) => t6.#F(e6), rindexes: (e6) => t6.#D(e6), isStale: (e6) => t6.#v(e6) }; + return t.#p; + }, free: t.#R, isBackgroundFetch: (e6) => t.#l(e6), backgroundFetch: (e6, s, i6, r6) => t.#U(e6, s, i6, r6), moveToTail: (e6) => t.#W(e6), indexes: (e6) => t.#F(e6), rindexes: (e6) => t.#D(e6), isStale: (e6) => t.#v(e6) }; } get max() { return this.#t; @@ -180306,24 +184816,24 @@ var ft = class Me { get disposeAfter() { return this.#o; } - constructor(t6) { - let { max: e6 = 0, ttl: s6, ttlResolution: i6 = 1, ttlAutopurge: r6, updateAgeOnGet: o6, updateAgeOnHas: h6, allowStale: a6, dispose: l6, onInsert: u6, disposeAfter: c6, noDisposeOnSet: d6, noUpdateTTL: f6, maxSize: m6 = 0, maxEntrySize: p6 = 0, sizeCalculation: w5, fetchMethod: g6, memoMethod: S, noDeleteOnFetchRejection: E2, noDeleteOnStaleGet: y2, allowStaleOnFetchRejection: b6, allowStaleOnFetchAbort: z2, ignoreFetchAbort: $, perf: J2 } = t6; - if (J2 !== void 0 && typeof J2?.now != "function") throw new TypeError("perf option must have a now() method if specified"); - if (this.#c = J2 ?? si, e6 !== 0 && !q(e6)) throw new TypeError("max option must be a nonnegative integer"); + constructor(t) { + let { max: e6 = 0, ttl: s, ttlResolution: i6 = 1, ttlAutopurge: r6, updateAgeOnGet: o2, updateAgeOnHas: h6, allowStale: a6, dispose: l3, onInsert: u, disposeAfter: c6, noDisposeOnSet: d6, noUpdateTTL: f6, maxSize: m3 = 0, maxEntrySize: p2 = 0, sizeCalculation: w, fetchMethod: g6, memoMethod: S, noDeleteOnFetchRejection: E, noDeleteOnStaleGet: y, allowStaleOnFetchRejection: b6, allowStaleOnFetchAbort: z, ignoreFetchAbort: $, perf: J } = t; + if (J !== void 0 && typeof J?.now != "function") throw new TypeError("perf option must have a now() method if specified"); + if (this.#c = J ?? si, e6 !== 0 && !q(e6)) throw new TypeError("max option must be a nonnegative integer"); let Z = e6 ? De(e6) : Array; if (!Z) throw new Error("invalid max value: " + e6); - if (this.#t = e6, this.#s = m6, this.maxEntrySize = p6 || this.#s, this.sizeCalculation = w5, this.sizeCalculation) { + if (this.#t = e6, this.#s = m3, this.maxEntrySize = p2 || this.#s, this.sizeCalculation = w, this.sizeCalculation) { if (!this.#s && !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"); } if (S !== void 0 && typeof S != "function") throw new TypeError("memoMethod must be a function if defined"); if (this.#w = S, g6 !== void 0 && typeof g6 != "function") throw new TypeError("fetchMethod must be a function if specified"); - if (this.#S = g6, this.#A = !!g6, this.#f = /* @__PURE__ */ new Map(), this.#a = new Array(e6).fill(void 0), this.#i = new Array(e6).fill(void 0), this.#d = new Z(e6), this.#E = new Z(e6), this.#b = 0, this.#p = 0, this.#R = ri.create(e6), this.#h = 0, this.#u = 0, typeof l6 == "function" && (this.#n = l6), typeof u6 == "function" && (this.#r = u6), typeof c6 == "function" ? (this.#o = c6, this.#m = []) : (this.#o = void 0, this.#m = void 0), this.#x = !!this.#n, this.#_ = !!this.#r, this.#e = !!this.#o, this.noDisposeOnSet = !!d6, this.noUpdateTTL = !!f6, this.noDeleteOnFetchRejection = !!E2, this.allowStaleOnFetchRejection = !!b6, this.allowStaleOnFetchAbort = !!z2, this.ignoreFetchAbort = !!$, this.maxEntrySize !== 0) { + if (this.#S = g6, this.#A = !!g6, this.#f = /* @__PURE__ */ new Map(), this.#a = new Array(e6).fill(void 0), this.#i = new Array(e6).fill(void 0), this.#d = new Z(e6), this.#E = new Z(e6), this.#b = 0, this.#p = 0, this.#R = ri.create(e6), this.#h = 0, this.#u = 0, typeof l3 == "function" && (this.#n = l3), typeof u == "function" && (this.#r = u), typeof c6 == "function" ? (this.#o = c6, this.#m = []) : (this.#o = void 0, this.#m = void 0), this.#x = !!this.#n, this.#_ = !!this.#r, this.#e = !!this.#o, this.noDisposeOnSet = !!d6, this.noUpdateTTL = !!f6, this.noDeleteOnFetchRejection = !!E, this.allowStaleOnFetchRejection = !!b6, this.allowStaleOnFetchAbort = !!z, this.ignoreFetchAbort = !!$, this.maxEntrySize !== 0) { if (this.#s !== 0 && !q(this.#s)) throw new TypeError("maxSize must be a positive integer if specified"); if (!q(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified"); this.#G(); } - if (this.allowStale = !!a6, this.noDeleteOnStaleGet = !!y2, this.updateAgeOnGet = !!o6, this.updateAgeOnHas = !!h6, this.ttlResolution = q(i6) || i6 === 0 ? i6 : 1, this.ttlAutopurge = !!r6, this.ttl = s6 || 0, this.ttl) { + if (this.allowStale = !!a6, this.noDeleteOnStaleGet = !!y, this.updateAgeOnGet = !!o2, this.updateAgeOnHas = !!h6, this.ttlResolution = q(i6) || i6 === 0 ? i6 : 1, this.ttlAutopurge = !!r6, this.ttl = s || 0, this.ttl) { if (!q(this.ttl)) throw new TypeError("ttl must be a positive integer if specified"); this.#M(); } @@ -180333,49 +184843,49 @@ var ft = class Me { ii($t) && (Oe.add($t), Fe("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", $t, Me)); } } - getRemainingTTL(t6) { - return this.#f.has(t6) ? 1 / 0 : 0; + getRemainingTTL(t) { + return this.#f.has(t) ? 1 / 0 : 0; } #M() { - let t6 = new Tt(this.#t), e6 = new Tt(this.#t); - this.#g = t6, this.#T = e6; - let s6 = this.ttlAutopurge ? new Array(this.#t) : void 0; - this.#y = s6, this.#j = (o6, h6, a6 = this.#c.now()) => { - if (e6[o6] = h6 !== 0 ? a6 : 0, t6[o6] = h6, s6?.[o6] && (clearTimeout(s6[o6]), s6[o6] = void 0), h6 !== 0 && s6) { - let l6 = setTimeout(() => { - this.#v(o6) && this.#O(this.#a[o6], "expire"); + let t = new Tt(this.#t), e6 = new Tt(this.#t); + this.#g = t, this.#T = e6; + let s = this.ttlAutopurge ? new Array(this.#t) : void 0; + this.#y = s, this.#j = (o2, h6, a6 = this.#c.now()) => { + if (e6[o2] = h6 !== 0 ? a6 : 0, t[o2] = h6, s?.[o2] && (clearTimeout(s[o2]), s[o2] = void 0), h6 !== 0 && s) { + let l3 = setTimeout(() => { + this.#v(o2) && this.#O(this.#a[o2], "expire"); }, h6 + 1); - l6.unref && l6.unref(), s6[o6] = l6; + l3.unref && l3.unref(), s[o2] = l3; } - }, this.#k = (o6) => { - e6[o6] = t6[o6] !== 0 ? this.#c.now() : 0; - }, this.#N = (o6, h6) => { - if (t6[h6]) { - let a6 = t6[h6], l6 = e6[h6]; - if (!a6 || !l6) return; - o6.ttl = a6, o6.start = l6, o6.now = i6 || r6(); - let u6 = o6.now - l6; - o6.remainingTTL = a6 - u6; + }, this.#k = (o2) => { + e6[o2] = t[o2] !== 0 ? this.#c.now() : 0; + }, this.#N = (o2, h6) => { + if (t[h6]) { + let a6 = t[h6], l3 = e6[h6]; + if (!a6 || !l3) return; + o2.ttl = a6, o2.start = l3, o2.now = i6 || r6(); + let u = o2.now - l3; + o2.remainingTTL = a6 - u; } }; let i6 = 0, r6 = () => { - let o6 = this.#c.now(); + let o2 = this.#c.now(); if (this.ttlResolution > 0) { - i6 = o6; + i6 = o2; let h6 = setTimeout(() => i6 = 0, this.ttlResolution); h6.unref && h6.unref(); } - return o6; + return o2; }; - this.getRemainingTTL = (o6) => { - let h6 = this.#f.get(o6); + this.getRemainingTTL = (o2) => { + let h6 = this.#f.get(o2); if (h6 === void 0) return 0; - let a6 = t6[h6], l6 = e6[h6]; - if (!a6 || !l6) return 1 / 0; - let u6 = (i6 || r6()) - l6; - return a6 - u6; - }, this.#v = (o6) => { - let h6 = e6[o6], a6 = t6[o6]; + let a6 = t[h6], l3 = e6[h6]; + if (!a6 || !l3) return 1 / 0; + let u = (i6 || r6()) - l3; + return a6 - u; + }, this.#v = (o2) => { + let h6 = e6[o2], a6 = t[o2]; return !!a6 && !!h6 && (i6 || r6()) - h6 > a6; }; } @@ -180387,138 +184897,138 @@ var ft = class Me { }; #v = () => false; #G() { - let t6 = new Tt(this.#t); - this.#u = 0, this.#C = t6, this.#P = (e6) => { - this.#u -= t6[e6], t6[e6] = 0; - }, this.#I = (e6, s6, i6, r6) => { - if (this.#l(s6)) return 0; + let t = new Tt(this.#t); + this.#u = 0, this.#C = t, this.#P = (e6) => { + this.#u -= t[e6], t[e6] = 0; + }, this.#I = (e6, s, i6, r6) => { + if (this.#l(s)) return 0; if (!q(i6)) if (r6) { if (typeof r6 != "function") throw new TypeError("sizeCalculation must be a function"); - if (i6 = r6(s6, e6), !q(i6)) throw new TypeError("sizeCalculation return invalid (expect positive integer)"); + if (i6 = r6(s, e6), !q(i6)) 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 i6; - }, this.#L = (e6, s6, i6) => { - if (t6[e6] = s6, this.#s) { - let r6 = this.#s - t6[e6]; + }, this.#L = (e6, s, i6) => { + if (t[e6] = s, this.#s) { + let r6 = this.#s - t[e6]; for (; this.#u > r6; ) this.#B(true); } - this.#u += t6[e6], i6 && (i6.entrySize = s6, i6.totalCalculatedSize = this.#u); + this.#u += t[e6], i6 && (i6.entrySize = s, i6.totalCalculatedSize = this.#u); }; } - #P = (t6) => { + #P = (t) => { }; - #L = (t6, e6, s6) => { + #L = (t, e6, s) => { }; - #I = (t6, e6, s6, i6) => { - if (s6 || i6) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache"); + #I = (t, e6, s, i6) => { + if (s || i6) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache"); return 0; }; - *#F({ allowStale: t6 = this.allowStale } = {}) { - if (this.#h) for (let e6 = this.#p; !(!this.#z(e6) || ((t6 || !this.#v(e6)) && (yield e6), e6 === this.#b)); ) e6 = this.#E[e6]; + *#F({ allowStale: t = this.allowStale } = {}) { + if (this.#h) for (let e6 = this.#p; !(!this.#z(e6) || ((t || !this.#v(e6)) && (yield e6), e6 === this.#b)); ) e6 = this.#E[e6]; } - *#D({ allowStale: t6 = this.allowStale } = {}) { - if (this.#h) for (let e6 = this.#b; !(!this.#z(e6) || ((t6 || !this.#v(e6)) && (yield e6), e6 === this.#p)); ) e6 = this.#d[e6]; + *#D({ allowStale: t = this.allowStale } = {}) { + if (this.#h) for (let e6 = this.#b; !(!this.#z(e6) || ((t || !this.#v(e6)) && (yield e6), e6 === this.#p)); ) e6 = this.#d[e6]; } - #z(t6) { - return t6 !== void 0 && this.#f.get(this.#a[t6]) === t6; + #z(t) { + return t !== void 0 && this.#f.get(this.#a[t]) === t; } *entries() { - for (let t6 of this.#F()) this.#i[t6] !== void 0 && this.#a[t6] !== void 0 && !this.#l(this.#i[t6]) && (yield [this.#a[t6], this.#i[t6]]); + for (let t of this.#F()) this.#i[t] !== void 0 && this.#a[t] !== void 0 && !this.#l(this.#i[t]) && (yield [this.#a[t], this.#i[t]]); } *rentries() { - for (let t6 of this.#D()) this.#i[t6] !== void 0 && this.#a[t6] !== void 0 && !this.#l(this.#i[t6]) && (yield [this.#a[t6], this.#i[t6]]); + for (let t of this.#D()) this.#i[t] !== void 0 && this.#a[t] !== void 0 && !this.#l(this.#i[t]) && (yield [this.#a[t], this.#i[t]]); } *keys() { - for (let t6 of this.#F()) { - let e6 = this.#a[t6]; - e6 !== void 0 && !this.#l(this.#i[t6]) && (yield e6); + for (let t of this.#F()) { + let e6 = this.#a[t]; + e6 !== void 0 && !this.#l(this.#i[t]) && (yield e6); } } *rkeys() { - for (let t6 of this.#D()) { - let e6 = this.#a[t6]; - e6 !== void 0 && !this.#l(this.#i[t6]) && (yield e6); + for (let t of this.#D()) { + let e6 = this.#a[t]; + e6 !== void 0 && !this.#l(this.#i[t]) && (yield e6); } } *values() { - for (let t6 of this.#F()) this.#i[t6] !== void 0 && !this.#l(this.#i[t6]) && (yield this.#i[t6]); + for (let t of this.#F()) this.#i[t] !== void 0 && !this.#l(this.#i[t]) && (yield this.#i[t]); } *rvalues() { - for (let t6 of this.#D()) this.#i[t6] !== void 0 && !this.#l(this.#i[t6]) && (yield this.#i[t6]); + for (let t of this.#D()) this.#i[t] !== void 0 && !this.#l(this.#i[t]) && (yield this.#i[t]); } [Symbol.iterator]() { return this.entries(); } [Symbol.toStringTag] = "LRUCache"; - find(t6, e6 = {}) { - for (let s6 of this.#F()) { - let i6 = this.#i[s6], r6 = this.#l(i6) ? i6.__staleWhileFetching : i6; - if (r6 !== void 0 && t6(r6, this.#a[s6], this)) return this.get(this.#a[s6], e6); + find(t, e6 = {}) { + for (let s of this.#F()) { + let i6 = this.#i[s], r6 = this.#l(i6) ? i6.__staleWhileFetching : i6; + if (r6 !== void 0 && t(r6, this.#a[s], this)) return this.get(this.#a[s], e6); } } - forEach(t6, e6 = this) { - for (let s6 of this.#F()) { - let i6 = this.#i[s6], r6 = this.#l(i6) ? i6.__staleWhileFetching : i6; - r6 !== void 0 && t6.call(e6, r6, this.#a[s6], this); + forEach(t, e6 = this) { + for (let s of this.#F()) { + let i6 = this.#i[s], r6 = this.#l(i6) ? i6.__staleWhileFetching : i6; + r6 !== void 0 && t.call(e6, r6, this.#a[s], this); } } - rforEach(t6, e6 = this) { - for (let s6 of this.#D()) { - let i6 = this.#i[s6], r6 = this.#l(i6) ? i6.__staleWhileFetching : i6; - r6 !== void 0 && t6.call(e6, r6, this.#a[s6], this); + rforEach(t, e6 = this) { + for (let s of this.#D()) { + let i6 = this.#i[s], r6 = this.#l(i6) ? i6.__staleWhileFetching : i6; + r6 !== void 0 && t.call(e6, r6, this.#a[s], this); } } purgeStale() { - let t6 = false; - for (let e6 of this.#D({ allowStale: true })) this.#v(e6) && (this.#O(this.#a[e6], "expire"), t6 = true); - return t6; + let t = false; + for (let e6 of this.#D({ allowStale: true })) this.#v(e6) && (this.#O(this.#a[e6], "expire"), t = true); + return t; } - info(t6) { - let e6 = this.#f.get(t6); + info(t) { + let e6 = this.#f.get(t); if (e6 === void 0) return; - let s6 = this.#i[e6], i6 = this.#l(s6) ? s6.__staleWhileFetching : s6; + let s = this.#i[e6], i6 = this.#l(s) ? s.__staleWhileFetching : s; if (i6 === void 0) return; let r6 = { value: i6 }; if (this.#g && this.#T) { - let o6 = this.#g[e6], h6 = this.#T[e6]; - if (o6 && h6) { - let a6 = o6 - (this.#c.now() - h6); + let o2 = this.#g[e6], h6 = this.#T[e6]; + if (o2 && h6) { + let a6 = o2 - (this.#c.now() - h6); r6.ttl = a6, r6.start = Date.now(); } } return this.#C && (r6.size = this.#C[e6]), r6; } dump() { - let t6 = []; + let t = []; for (let e6 of this.#F({ allowStale: true })) { - let s6 = this.#a[e6], i6 = this.#i[e6], r6 = this.#l(i6) ? i6.__staleWhileFetching : i6; - if (r6 === void 0 || s6 === void 0) continue; - let o6 = { value: r6 }; + let s = this.#a[e6], i6 = this.#i[e6], r6 = this.#l(i6) ? i6.__staleWhileFetching : i6; + if (r6 === void 0 || s === void 0) continue; + let o2 = { value: r6 }; if (this.#g && this.#T) { - o6.ttl = this.#g[e6]; + o2.ttl = this.#g[e6]; let h6 = this.#c.now() - this.#T[e6]; - o6.start = Math.floor(Date.now() - h6); + o2.start = Math.floor(Date.now() - h6); } - this.#C && (o6.size = this.#C[e6]), t6.unshift([s6, o6]); + this.#C && (o2.size = this.#C[e6]), t.unshift([s, o2]); } - return t6; + return t; } - load(t6) { + load(t) { this.clear(); - for (let [e6, s6] of t6) { - if (s6.start) { - let i6 = Date.now() - s6.start; - s6.start = this.#c.now() - i6; + for (let [e6, s] of t) { + if (s.start) { + let i6 = Date.now() - s.start; + s.start = this.#c.now() - i6; } - this.set(e6, s6.value, s6); + this.set(e6, s.value, s); } } - set(t6, e6, s6 = {}) { - if (e6 === void 0) return this.delete(t6), this; - let { ttl: i6 = this.ttl, start: r6, noDisposeOnSet: o6 = this.noDisposeOnSet, sizeCalculation: h6 = this.sizeCalculation, status: a6 } = s6, { noUpdateTTL: l6 = this.noUpdateTTL } = s6, u6 = this.#I(t6, e6, s6.size || 0, h6); - if (this.maxEntrySize && u6 > this.maxEntrySize) return a6 && (a6.set = "miss", a6.maxEntrySizeExceeded = true), this.#O(t6, "set"), this; - let c6 = this.#h === 0 ? void 0 : this.#f.get(t6); - if (c6 === void 0) c6 = this.#h === 0 ? this.#p : this.#R.length !== 0 ? this.#R.pop() : this.#h === this.#t ? this.#B(false) : this.#h, this.#a[c6] = t6, this.#i[c6] = e6, this.#f.set(t6, c6), this.#d[this.#p] = c6, this.#E[c6] = this.#p, this.#p = c6, this.#h++, this.#L(c6, u6, a6), a6 && (a6.set = "add"), l6 = false, this.#_ && this.#r?.(e6, t6, "add"); + set(t, e6, s = {}) { + if (e6 === void 0) return this.delete(t), this; + let { ttl: i6 = this.ttl, start: r6, noDisposeOnSet: o2 = this.noDisposeOnSet, sizeCalculation: h6 = this.sizeCalculation, status: a6 } = s, { noUpdateTTL: l3 = this.noUpdateTTL } = s, u = this.#I(t, e6, s.size || 0, h6); + if (this.maxEntrySize && u > this.maxEntrySize) return a6 && (a6.set = "miss", a6.maxEntrySizeExceeded = true), this.#O(t, "set"), this; + let c6 = this.#h === 0 ? void 0 : this.#f.get(t); + if (c6 === void 0) c6 = this.#h === 0 ? this.#p : this.#R.length !== 0 ? this.#R.pop() : this.#h === this.#t ? this.#B(false) : this.#h, this.#a[c6] = t, this.#i[c6] = e6, this.#f.set(t, c6), this.#d[this.#p] = c6, this.#E[c6] = this.#p, this.#p = c6, this.#h++, this.#L(c6, u, a6), a6 && (a6.set = "add"), l3 = false, this.#_ && this.#r?.(e6, t, "add"); else { this.#W(c6); let d6 = this.#i[c6]; @@ -180526,17 +185036,17 @@ var ft = class Me { if (this.#A && this.#l(d6)) { d6.__abortController.abort(new Error("replaced")); let { __staleWhileFetching: f6 } = d6; - f6 !== void 0 && !o6 && (this.#x && this.#n?.(f6, t6, "set"), this.#e && this.#m?.push([f6, t6, "set"])); - } else o6 || (this.#x && this.#n?.(d6, t6, "set"), this.#e && this.#m?.push([d6, t6, "set"])); - if (this.#P(c6), this.#L(c6, u6, a6), this.#i[c6] = e6, a6) { + f6 !== void 0 && !o2 && (this.#x && this.#n?.(f6, t, "set"), this.#e && this.#m?.push([f6, t, "set"])); + } else o2 || (this.#x && this.#n?.(d6, t, "set"), this.#e && this.#m?.push([d6, t, "set"])); + if (this.#P(c6), this.#L(c6, u, a6), this.#i[c6] = e6, a6) { a6.set = "replace"; let f6 = d6 && this.#l(d6) ? d6.__staleWhileFetching : d6; f6 !== void 0 && (a6.oldValue = f6); } } else a6 && (a6.set = "update"); - this.#_ && this.onInsert?.(e6, t6, e6 === d6 ? "update" : "replace"); + this.#_ && this.onInsert?.(e6, t, e6 === d6 ? "update" : "replace"); } - if (i6 !== 0 && !this.#g && this.#M(), this.#g && (l6 || this.#j(c6, i6, r6), a6 && this.#N(a6, c6)), !o6 && this.#e && this.#m) { + if (i6 !== 0 && !this.#g && this.#M(), this.#g && (l3 || this.#j(c6, i6, r6), a6 && this.#N(a6, c6)), !o2 && this.#e && this.#m) { let d6 = this.#m, f6; for (; f6 = d6?.shift(); ) this.#o?.(...f6); } @@ -180545,129 +185055,129 @@ var ft = class Me { pop() { try { for (; this.#h; ) { - let t6 = this.#i[this.#b]; - if (this.#B(true), this.#l(t6)) { - if (t6.__staleWhileFetching) return t6.__staleWhileFetching; - } else if (t6 !== void 0) return t6; + let t = this.#i[this.#b]; + if (this.#B(true), this.#l(t)) { + if (t.__staleWhileFetching) return t.__staleWhileFetching; + } else if (t !== void 0) return t; } } finally { if (this.#e && this.#m) { - let t6 = this.#m, e6; - for (; e6 = t6?.shift(); ) this.#o?.(...e6); + let t = this.#m, e6; + for (; e6 = t?.shift(); ) this.#o?.(...e6); } } } - #B(t6) { - let e6 = this.#b, s6 = this.#a[e6], i6 = this.#i[e6]; - return this.#A && this.#l(i6) ? i6.__abortController.abort(new Error("evicted")) : (this.#x || this.#e) && (this.#x && this.#n?.(i6, s6, "evict"), this.#e && this.#m?.push([i6, s6, "evict"])), this.#P(e6), this.#y?.[e6] && (clearTimeout(this.#y[e6]), this.#y[e6] = void 0), t6 && (this.#a[e6] = void 0, this.#i[e6] = void 0, this.#R.push(e6)), this.#h === 1 ? (this.#b = this.#p = 0, this.#R.length = 0) : this.#b = this.#d[e6], this.#f.delete(s6), this.#h--, e6; + #B(t) { + let e6 = this.#b, s = this.#a[e6], i6 = this.#i[e6]; + return this.#A && this.#l(i6) ? i6.__abortController.abort(new Error("evicted")) : (this.#x || this.#e) && (this.#x && this.#n?.(i6, s, "evict"), this.#e && this.#m?.push([i6, s, "evict"])), this.#P(e6), this.#y?.[e6] && (clearTimeout(this.#y[e6]), this.#y[e6] = void 0), t && (this.#a[e6] = void 0, this.#i[e6] = void 0, this.#R.push(e6)), this.#h === 1 ? (this.#b = this.#p = 0, this.#R.length = 0) : this.#b = this.#d[e6], this.#f.delete(s), this.#h--, e6; } - has(t6, e6 = {}) { - let { updateAgeOnHas: s6 = this.updateAgeOnHas, status: i6 } = e6, r6 = this.#f.get(t6); + has(t, e6 = {}) { + let { updateAgeOnHas: s = this.updateAgeOnHas, status: i6 } = e6, r6 = this.#f.get(t); if (r6 !== void 0) { - let o6 = this.#i[r6]; - if (this.#l(o6) && o6.__staleWhileFetching === void 0) return false; + let o2 = this.#i[r6]; + if (this.#l(o2) && o2.__staleWhileFetching === void 0) return false; if (this.#v(r6)) i6 && (i6.has = "stale", this.#N(i6, r6)); - else return s6 && this.#k(r6), i6 && (i6.has = "hit", this.#N(i6, r6)), true; + else return s && this.#k(r6), i6 && (i6.has = "hit", this.#N(i6, r6)), true; } else i6 && (i6.has = "miss"); return false; } - peek(t6, e6 = {}) { - let { allowStale: s6 = this.allowStale } = e6, i6 = this.#f.get(t6); - if (i6 === void 0 || !s6 && this.#v(i6)) return; + peek(t, e6 = {}) { + let { allowStale: s = this.allowStale } = e6, i6 = this.#f.get(t); + if (i6 === void 0 || !s && this.#v(i6)) return; let r6 = this.#i[i6]; return this.#l(r6) ? r6.__staleWhileFetching : r6; } - #U(t6, e6, s6, i6) { + #U(t, e6, s, i6) { let r6 = e6 === void 0 ? void 0 : this.#i[e6]; if (this.#l(r6)) return r6; - let o6 = new At(), { signal: h6 } = s6; - h6?.addEventListener("abort", () => o6.abort(h6.reason), { signal: o6.signal }); - let a6 = { signal: o6.signal, options: s6, context: i6 }, l6 = (p6, w5 = false) => { - let { aborted: g6 } = o6.signal, S = s6.ignoreFetchAbort && p6 !== void 0, E2 = s6.ignoreFetchAbort || !!(s6.allowStaleOnFetchAbort && p6 !== void 0); - if (s6.status && (g6 && !w5 ? (s6.status.fetchAborted = true, s6.status.fetchError = o6.signal.reason, S && (s6.status.fetchAbortIgnored = true)) : s6.status.fetchResolved = true), g6 && !S && !w5) return c6(o6.signal.reason, E2); - let y2 = f6, b6 = this.#i[e6]; - return (b6 === f6 || S && w5 && b6 === void 0) && (p6 === void 0 ? y2.__staleWhileFetching !== void 0 ? this.#i[e6] = y2.__staleWhileFetching : this.#O(t6, "fetch") : (s6.status && (s6.status.fetchUpdated = true), this.set(t6, p6, a6.options))), p6; - }, u6 = (p6) => (s6.status && (s6.status.fetchRejected = true, s6.status.fetchError = p6), c6(p6, false)), c6 = (p6, w5) => { - let { aborted: g6 } = o6.signal, S = g6 && s6.allowStaleOnFetchAbort, E2 = S || s6.allowStaleOnFetchRejection, y2 = E2 || s6.noDeleteOnFetchRejection, b6 = f6; - if (this.#i[e6] === f6 && (!y2 || !w5 && b6.__staleWhileFetching === void 0 ? this.#O(t6, "fetch") : S || (this.#i[e6] = b6.__staleWhileFetching)), E2) return s6.status && b6.__staleWhileFetching !== void 0 && (s6.status.returnedStale = true), b6.__staleWhileFetching; - if (b6.__returned === b6) throw p6; - }, d6 = (p6, w5) => { - let g6 = this.#S?.(t6, r6, a6); - g6 && g6 instanceof Promise && g6.then((S) => p6(S === void 0 ? void 0 : S), w5), o6.signal.addEventListener("abort", () => { - (!s6.ignoreFetchAbort || s6.allowStaleOnFetchAbort) && (p6(void 0), s6.allowStaleOnFetchAbort && (p6 = (S) => l6(S, true))); - }); - }; - s6.status && (s6.status.fetchDispatched = true); - let f6 = new Promise(d6).then(l6, u6), m6 = Object.assign(f6, { __abortController: o6, __staleWhileFetching: r6, __returned: void 0 }); - return e6 === void 0 ? (this.set(t6, m6, { ...a6.options, status: void 0 }), e6 = this.#f.get(t6)) : this.#i[e6] = m6, m6; - } - #l(t6) { + let o2 = new At(), { signal: h6 } = s; + h6?.addEventListener("abort", () => o2.abort(h6.reason), { signal: o2.signal }); + let a6 = { signal: o2.signal, options: s, context: i6 }, l3 = (p2, w = false) => { + let { aborted: g6 } = o2.signal, S = s.ignoreFetchAbort && p2 !== void 0, E = s.ignoreFetchAbort || !!(s.allowStaleOnFetchAbort && p2 !== void 0); + if (s.status && (g6 && !w ? (s.status.fetchAborted = true, s.status.fetchError = o2.signal.reason, S && (s.status.fetchAbortIgnored = true)) : s.status.fetchResolved = true), g6 && !S && !w) return c6(o2.signal.reason, E); + let y = f6, b6 = this.#i[e6]; + return (b6 === f6 || S && w && b6 === void 0) && (p2 === void 0 ? y.__staleWhileFetching !== void 0 ? this.#i[e6] = y.__staleWhileFetching : this.#O(t, "fetch") : (s.status && (s.status.fetchUpdated = true), this.set(t, p2, a6.options))), p2; + }, u = (p2) => (s.status && (s.status.fetchRejected = true, s.status.fetchError = p2), c6(p2, false)), c6 = (p2, w) => { + let { aborted: g6 } = o2.signal, S = g6 && s.allowStaleOnFetchAbort, E = S || s.allowStaleOnFetchRejection, y = E || s.noDeleteOnFetchRejection, b6 = f6; + if (this.#i[e6] === f6 && (!y || !w && b6.__staleWhileFetching === void 0 ? this.#O(t, "fetch") : S || (this.#i[e6] = b6.__staleWhileFetching)), E) return s.status && b6.__staleWhileFetching !== void 0 && (s.status.returnedStale = true), b6.__staleWhileFetching; + if (b6.__returned === b6) throw p2; + }, d6 = (p2, w) => { + let g6 = this.#S?.(t, r6, a6); + g6 && g6 instanceof Promise && g6.then((S) => p2(S === void 0 ? void 0 : S), w), o2.signal.addEventListener("abort", () => { + (!s.ignoreFetchAbort || s.allowStaleOnFetchAbort) && (p2(void 0), s.allowStaleOnFetchAbort && (p2 = (S) => l3(S, true))); + }); + }; + s.status && (s.status.fetchDispatched = true); + let f6 = new Promise(d6).then(l3, u), m3 = Object.assign(f6, { __abortController: o2, __staleWhileFetching: r6, __returned: void 0 }); + return e6 === void 0 ? (this.set(t, m3, { ...a6.options, status: void 0 }), e6 = this.#f.get(t)) : this.#i[e6] = m3, m3; + } + #l(t) { if (!this.#A) return false; - let e6 = t6; + let e6 = t; return !!e6 && e6 instanceof Promise && e6.hasOwnProperty("__staleWhileFetching") && e6.__abortController instanceof At; } - async fetch(t6, e6 = {}) { - let { allowStale: s6 = this.allowStale, updateAgeOnGet: i6 = this.updateAgeOnGet, noDeleteOnStaleGet: r6 = this.noDeleteOnStaleGet, ttl: o6 = this.ttl, noDisposeOnSet: h6 = this.noDisposeOnSet, size: a6 = 0, sizeCalculation: l6 = this.sizeCalculation, noUpdateTTL: u6 = this.noUpdateTTL, noDeleteOnFetchRejection: c6 = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d6 = this.allowStaleOnFetchRejection, ignoreFetchAbort: f6 = this.ignoreFetchAbort, allowStaleOnFetchAbort: m6 = this.allowStaleOnFetchAbort, context: p6, forceRefresh: w5 = false, status: g6, signal: S } = e6; - if (!this.#A) return g6 && (g6.fetch = "get"), this.get(t6, { allowStale: s6, updateAgeOnGet: i6, noDeleteOnStaleGet: r6, status: g6 }); - let E2 = { allowStale: s6, updateAgeOnGet: i6, noDeleteOnStaleGet: r6, ttl: o6, noDisposeOnSet: h6, size: a6, sizeCalculation: l6, noUpdateTTL: u6, noDeleteOnFetchRejection: c6, allowStaleOnFetchRejection: d6, allowStaleOnFetchAbort: m6, ignoreFetchAbort: f6, status: g6, signal: S }, y2 = this.#f.get(t6); - if (y2 === void 0) { + async fetch(t, e6 = {}) { + let { allowStale: s = this.allowStale, updateAgeOnGet: i6 = this.updateAgeOnGet, noDeleteOnStaleGet: r6 = this.noDeleteOnStaleGet, ttl: o2 = this.ttl, noDisposeOnSet: h6 = this.noDisposeOnSet, size: a6 = 0, sizeCalculation: l3 = this.sizeCalculation, noUpdateTTL: u = this.noUpdateTTL, noDeleteOnFetchRejection: c6 = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d6 = this.allowStaleOnFetchRejection, ignoreFetchAbort: f6 = this.ignoreFetchAbort, allowStaleOnFetchAbort: m3 = this.allowStaleOnFetchAbort, context: p2, forceRefresh: w = false, status: g6, signal: S } = e6; + if (!this.#A) return g6 && (g6.fetch = "get"), this.get(t, { allowStale: s, updateAgeOnGet: i6, noDeleteOnStaleGet: r6, status: g6 }); + let E = { allowStale: s, updateAgeOnGet: i6, noDeleteOnStaleGet: r6, ttl: o2, noDisposeOnSet: h6, size: a6, sizeCalculation: l3, noUpdateTTL: u, noDeleteOnFetchRejection: c6, allowStaleOnFetchRejection: d6, allowStaleOnFetchAbort: m3, ignoreFetchAbort: f6, status: g6, signal: S }, y = this.#f.get(t); + if (y === void 0) { g6 && (g6.fetch = "miss"); - let b6 = this.#U(t6, y2, E2, p6); + let b6 = this.#U(t, y, E, p2); return b6.__returned = b6; } else { - let b6 = this.#i[y2]; + let b6 = this.#i[y]; if (this.#l(b6)) { - let Z = s6 && b6.__staleWhileFetching !== void 0; + let Z = s && b6.__staleWhileFetching !== void 0; return g6 && (g6.fetch = "inflight", Z && (g6.returnedStale = true)), Z ? b6.__staleWhileFetching : b6.__returned = b6; } - let z2 = this.#v(y2); - if (!w5 && !z2) return g6 && (g6.fetch = "hit"), this.#W(y2), i6 && this.#k(y2), g6 && this.#N(g6, y2), b6; - let $ = this.#U(t6, y2, E2, p6), J2 = $.__staleWhileFetching !== void 0 && s6; - return g6 && (g6.fetch = z2 ? "stale" : "refresh", J2 && z2 && (g6.returnedStale = true)), J2 ? $.__staleWhileFetching : $.__returned = $; + let z = this.#v(y); + if (!w && !z) return g6 && (g6.fetch = "hit"), this.#W(y), i6 && this.#k(y), g6 && this.#N(g6, y), b6; + let $ = this.#U(t, y, E, p2), J = $.__staleWhileFetching !== void 0 && s; + return g6 && (g6.fetch = z ? "stale" : "refresh", J && z && (g6.returnedStale = true)), J ? $.__staleWhileFetching : $.__returned = $; } } - async forceFetch(t6, e6 = {}) { - let s6 = await this.fetch(t6, e6); - if (s6 === void 0) throw new Error("fetch() returned undefined"); - return s6; + async forceFetch(t, e6 = {}) { + let s = await this.fetch(t, e6); + if (s === void 0) throw new Error("fetch() returned undefined"); + return s; } - memo(t6, e6 = {}) { - let s6 = this.#w; - if (!s6) throw new Error("no memoMethod provided to constructor"); - let { context: i6, forceRefresh: r6, ...o6 } = e6, h6 = this.get(t6, o6); + memo(t, e6 = {}) { + let s = this.#w; + if (!s) throw new Error("no memoMethod provided to constructor"); + let { context: i6, forceRefresh: r6, ...o2 } = e6, h6 = this.get(t, o2); if (!r6 && h6 !== void 0) return h6; - let a6 = s6(t6, h6, { options: o6, context: i6 }); - return this.set(t6, a6, o6), a6; + let a6 = s(t, h6, { options: o2, context: i6 }); + return this.set(t, a6, o2), a6; } - get(t6, e6 = {}) { - let { allowStale: s6 = this.allowStale, updateAgeOnGet: i6 = this.updateAgeOnGet, noDeleteOnStaleGet: r6 = this.noDeleteOnStaleGet, status: o6 } = e6, h6 = this.#f.get(t6); + get(t, e6 = {}) { + let { allowStale: s = this.allowStale, updateAgeOnGet: i6 = this.updateAgeOnGet, noDeleteOnStaleGet: r6 = this.noDeleteOnStaleGet, status: o2 } = e6, h6 = this.#f.get(t); if (h6 !== void 0) { - let a6 = this.#i[h6], l6 = this.#l(a6); - return o6 && this.#N(o6, h6), this.#v(h6) ? (o6 && (o6.get = "stale"), l6 ? (o6 && s6 && a6.__staleWhileFetching !== void 0 && (o6.returnedStale = true), s6 ? a6.__staleWhileFetching : void 0) : (r6 || this.#O(t6, "expire"), o6 && s6 && (o6.returnedStale = true), s6 ? a6 : void 0)) : (o6 && (o6.get = "hit"), l6 ? a6.__staleWhileFetching : (this.#W(h6), i6 && this.#k(h6), a6)); - } else o6 && (o6.get = "miss"); + let a6 = this.#i[h6], l3 = this.#l(a6); + return o2 && this.#N(o2, h6), this.#v(h6) ? (o2 && (o2.get = "stale"), l3 ? (o2 && s && a6.__staleWhileFetching !== void 0 && (o2.returnedStale = true), s ? a6.__staleWhileFetching : void 0) : (r6 || this.#O(t, "expire"), o2 && s && (o2.returnedStale = true), s ? a6 : void 0)) : (o2 && (o2.get = "hit"), l3 ? a6.__staleWhileFetching : (this.#W(h6), i6 && this.#k(h6), a6)); + } else o2 && (o2.get = "miss"); } - #$(t6, e6) { - this.#E[e6] = t6, this.#d[t6] = e6; + #$(t, e6) { + this.#E[e6] = t, this.#d[t] = e6; } - #W(t6) { - t6 !== this.#p && (t6 === this.#b ? this.#b = this.#d[t6] : this.#$(this.#E[t6], this.#d[t6]), this.#$(this.#p, t6), this.#p = t6); + #W(t) { + t !== this.#p && (t === this.#b ? this.#b = this.#d[t] : this.#$(this.#E[t], this.#d[t]), this.#$(this.#p, t), this.#p = t); } - delete(t6) { - return this.#O(t6, "delete"); + delete(t) { + return this.#O(t, "delete"); } - #O(t6, e6) { - let s6 = false; + #O(t, e6) { + let s = false; if (this.#h !== 0) { - let i6 = this.#f.get(t6); - if (i6 !== void 0) if (this.#y?.[i6] && (clearTimeout(this.#y?.[i6]), this.#y[i6] = void 0), s6 = true, this.#h === 1) this.#H(e6); + let i6 = this.#f.get(t); + if (i6 !== void 0) if (this.#y?.[i6] && (clearTimeout(this.#y?.[i6]), this.#y[i6] = void 0), s = true, this.#h === 1) this.#H(e6); else { this.#P(i6); let r6 = this.#i[i6]; - if (this.#l(r6) ? r6.__abortController.abort(new Error("deleted")) : (this.#x || this.#e) && (this.#x && this.#n?.(r6, t6, e6), this.#e && this.#m?.push([r6, t6, e6])), this.#f.delete(t6), this.#a[i6] = void 0, this.#i[i6] = void 0, i6 === this.#p) this.#p = this.#E[i6]; + if (this.#l(r6) ? r6.__abortController.abort(new Error("deleted")) : (this.#x || this.#e) && (this.#x && this.#n?.(r6, t, e6), this.#e && this.#m?.push([r6, t, e6])), this.#f.delete(t), this.#a[i6] = void 0, this.#i[i6] = void 0, i6 === this.#p) this.#p = this.#E[i6]; else if (i6 === this.#b) this.#b = this.#d[i6]; else { - let o6 = this.#E[i6]; - this.#d[o6] = this.#d[i6]; + let o2 = this.#E[i6]; + this.#d[o2] = this.#d[i6]; let h6 = this.#d[i6]; this.#E[h6] = this.#E[i6]; } @@ -180678,18 +185188,18 @@ var ft = class Me { let i6 = this.#m, r6; for (; r6 = i6?.shift(); ) this.#o?.(...r6); } - return s6; + return s; } clear() { return this.#H("delete"); } - #H(t6) { + #H(t) { for (let e6 of this.#D({ allowStale: true })) { - let s6 = this.#i[e6]; - if (this.#l(s6)) s6.__abortController.abort(new Error("deleted")); + let s = this.#i[e6]; + if (this.#l(s)) s.__abortController.abort(new Error("deleted")); else { let i6 = this.#a[e6]; - this.#x && this.#n?.(s6, i6, t6), this.#e && this.#m?.push([s6, i6, t6]); + this.#x && this.#n?.(s, i6, t), this.#e && this.#m?.push([s, i6, t]); } } if (this.#f.clear(), this.#i.fill(void 0), this.#a.fill(void 0), this.#g && this.#T) { @@ -180698,15 +185208,15 @@ var ft = class Me { this.#y?.fill(void 0); } if (this.#C && this.#C.fill(0), this.#b = 0, this.#p = 0, this.#R.length = 0, this.#u = 0, this.#h = 0, this.#e && this.#m) { - let e6 = this.#m, s6; - for (; s6 = e6?.shift(); ) this.#o?.(...s6); + let e6 = this.#m, s; + for (; s = e6?.shift(); ) this.#o?.(...s); } } }; var Ne = typeof process == "object" && process ? process : { stdout: null, stderr: null }; -var oi = (n12) => !!n12 && typeof n12 == "object" && (n12 instanceof V || n12 instanceof Pe || hi(n12) || ai(n12)); -var hi = (n12) => !!n12 && typeof n12 == "object" && n12 instanceof ee && typeof n12.pipe == "function" && n12.pipe !== Pe.Writable.prototype.pipe; -var ai = (n12) => !!n12 && typeof n12 == "object" && n12 instanceof ee && typeof n12.write == "function" && typeof n12.end == "function"; +var oi = (n8) => !!n8 && typeof n8 == "object" && (n8 instanceof V || n8 instanceof Pe || hi(n8) || ai(n8)); +var hi = (n8) => !!n8 && typeof n8 == "object" && n8 instanceof ee && typeof n8.pipe == "function" && n8.pipe !== Pe.Writable.prototype.pipe; +var ai = (n8) => !!n8 && typeof n8 == "object" && n8 instanceof ee && typeof n8.write == "function" && typeof n8.end == "function"; var G = /* @__PURE__ */ Symbol("EOF"); var H = /* @__PURE__ */ Symbol("maybeEmitEnd"); var K = /* @__PURE__ */ Symbol("emittedEnd"); @@ -180738,23 +185248,23 @@ var Dt = /* @__PURE__ */ Symbol("aborted"); var pt = /* @__PURE__ */ Symbol("signal"); var Y = /* @__PURE__ */ Symbol("dataListeners"); var M = /* @__PURE__ */ Symbol("discarded"); -var mt = (n12) => Promise.resolve().then(n12); -var li = (n12) => n12(); -var ci = (n12) => n12 === "end" || n12 === "finish" || n12 === "prefinish"; -var fi = (n12) => n12 instanceof ArrayBuffer || !!n12 && typeof n12 == "object" && n12.constructor && n12.constructor.name === "ArrayBuffer" && n12.byteLength >= 0; -var ui = (n12) => !Buffer.isBuffer(n12) && ArrayBuffer.isView(n12); +var mt = (n8) => Promise.resolve().then(n8); +var li = (n8) => n8(); +var ci = (n8) => n8 === "end" || n8 === "finish" || n8 === "prefinish"; +var fi = (n8) => n8 instanceof ArrayBuffer || !!n8 && typeof n8 == "object" && n8.constructor && n8.constructor.name === "ArrayBuffer" && n8.byteLength >= 0; +var ui = (n8) => !Buffer.isBuffer(n8) && ArrayBuffer.isView(n8); var Mt = class { src; dest; opts; ondrain; - constructor(t6, e6, s6) { - this.src = t6, this.dest = e6, this.opts = s6, this.ondrain = () => t6[st](), this.dest.on("drain", this.ondrain); + constructor(t, e6, s) { + this.src = t, this.dest = e6, this.opts = s, this.ondrain = () => t[st](), this.dest.on("drain", this.ondrain); } unpipe() { this.dest.removeListener("drain", this.ondrain); } - proxyErrors(t6) { + proxyErrors(t) { } end() { this.unpipe(), this.opts.end && this.dest.end(); @@ -180764,12 +185274,12 @@ var te = class extends Mt { unpipe() { this.src.removeListener("error", this.proxyErrors), super.unpipe(); } - constructor(t6, e6, s6) { - super(t6, e6, s6), this.proxyErrors = (i6) => this.dest.emit("error", i6), t6.on("error", this.proxyErrors); + constructor(t, e6, s) { + super(t, e6, s), this.proxyErrors = (i6) => this.dest.emit("error", i6), t.on("error", this.proxyErrors); } }; -var di = (n12) => !!n12.objectMode; -var pi = (n12) => !n12.objectMode && !!n12.encoding && n12.encoding !== "buffer"; +var di = (n8) => !!n8.objectMode; +var pi = (n8) => !n8.objectMode && !!n8.encoding && n8.encoding !== "buffer"; var V = class extends ee { [v] = false; [dt] = false; @@ -180792,12 +185302,12 @@ var V = class extends ee { [M] = false; writable = true; readable = true; - constructor(...t6) { - let e6 = t6[0] || {}; + constructor(...t) { + let e6 = t[0] || {}; if (super(), e6.objectMode && typeof e6.encoding == "string") throw new TypeError("Encoding and objectMode may not be used together"); di(e6) ? (this[k] = true, this[P] = null) : pi(e6) ? (this[P] = e6.encoding, this[k] = false) : (this[k] = false, this[P] = null), this[B] = !!e6.async, this[et] = this[P] ? new ni(this[P]) : null, e6 && e6.debugExposeBuffer === true && Object.defineProperty(this, "buffer", { get: () => this[C] }), e6 && e6.debugExposePipes === true && Object.defineProperty(this, "pipes", { get: () => this[F] }); - let { signal: s6 } = e6; - s6 && (this[pt] = s6, s6.aborted ? this[Qt]() : s6.addEventListener("abort", () => this[Qt]())); + let { signal: s } = e6; + s && (this[pt] = s, s.aborted ? this[Qt]() : s.addEventListener("abort", () => this[Qt]())); } get bufferLength() { return this[T]; @@ -180805,23 +185315,23 @@ var V = class extends ee { get encoding() { return this[P]; } - set encoding(t6) { + set encoding(t) { throw new Error("Encoding must be set at instantiation time"); } - setEncoding(t6) { + setEncoding(t) { throw new Error("Encoding must be set at instantiation time"); } get objectMode() { return this[k]; } - set objectMode(t6) { + set objectMode(t) { throw new Error("objectMode must be set at instantiation time"); } get async() { return this[B]; } - set async(t6) { - this[B] = this[B] || !!t6; + set async(t) { + this[B] = this[B] || !!t; } [Qt]() { this[Dt] = true, this.emit("abort", this[pt]?.reason), this.destroy(this[pt]?.reason); @@ -180829,38 +185339,38 @@ var V = class extends ee { get aborted() { return this[Dt]; } - set aborted(t6) { + set aborted(t) { } - write(t6, e6, s6) { + write(t, e6, s) { if (this[Dt]) return false; if (this[G]) throw new Error("write after end"); if (this[x]) return this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), true; - typeof e6 == "function" && (s6 = e6, e6 = "utf8"), e6 || (e6 = "utf8"); + typeof e6 == "function" && (s = e6, e6 = "utf8"), e6 || (e6 = "utf8"); let i6 = this[B] ? mt : li; - if (!this[k] && !Buffer.isBuffer(t6)) { - if (ui(t6)) t6 = Buffer.from(t6.buffer, t6.byteOffset, t6.byteLength); - else if (fi(t6)) t6 = Buffer.from(t6); - else if (typeof t6 != "string") throw new Error("Non-contiguous data written to non-objectMode stream"); + if (!this[k] && !Buffer.isBuffer(t)) { + if (ui(t)) t = Buffer.from(t.buffer, t.byteOffset, t.byteLength); + else if (fi(t)) t = Buffer.from(t); + else if (typeof t != "string") throw new Error("Non-contiguous data written to non-objectMode stream"); } - return this[k] ? (this[v] && this[T] !== 0 && this[Ot](true), this[v] ? this.emit("data", t6) : this[Yt](t6), this[T] !== 0 && this.emit("readable"), s6 && i6(s6), this[v]) : t6.length ? (typeof t6 == "string" && !(e6 === this[P] && !this[et]?.lastNeed) && (t6 = Buffer.from(t6, e6)), Buffer.isBuffer(t6) && this[P] && (t6 = this[et].write(t6)), this[v] && this[T] !== 0 && this[Ot](true), this[v] ? this.emit("data", t6) : this[Yt](t6), this[T] !== 0 && this.emit("readable"), s6 && i6(s6), this[v]) : (this[T] !== 0 && this.emit("readable"), s6 && i6(s6), this[v]); + return this[k] ? (this[v] && this[T] !== 0 && this[Ot](true), this[v] ? this.emit("data", t) : this[Yt](t), this[T] !== 0 && this.emit("readable"), s && i6(s), this[v]) : t.length ? (typeof t == "string" && !(e6 === this[P] && !this[et]?.lastNeed) && (t = Buffer.from(t, e6)), Buffer.isBuffer(t) && this[P] && (t = this[et].write(t)), this[v] && this[T] !== 0 && this[Ot](true), this[v] ? this.emit("data", t) : this[Yt](t), this[T] !== 0 && this.emit("readable"), s && i6(s), this[v]) : (this[T] !== 0 && this.emit("readable"), s && i6(s), this[v]); } - read(t6) { + read(t) { if (this[x]) return null; - if (this[M] = false, this[T] === 0 || t6 === 0 || t6 && t6 > this[T]) return this[H](), null; - this[k] && (t6 = null), this[C].length > 1 && !this[k] && (this[C] = [this[P] ? this[C].join("") : Buffer.concat(this[C], this[T])]); - let e6 = this[_e](t6 || null, this[C][0]); + if (this[M] = false, this[T] === 0 || t === 0 || t && t > this[T]) return this[H](), null; + this[k] && (t = null), this[C].length > 1 && !this[k] && (this[C] = [this[P] ? this[C].join("") : Buffer.concat(this[C], this[T])]); + let e6 = this[_e](t || null, this[C][0]); return this[H](), e6; } - [_e](t6, e6) { + [_e](t, e6) { if (this[k]) this[Ft](); else { - let s6 = e6; - t6 === s6.length || t6 === null ? this[Ft]() : typeof s6 == "string" ? (this[C][0] = s6.slice(t6), e6 = s6.slice(0, t6), this[T] -= t6) : (this[C][0] = s6.subarray(t6), e6 = s6.subarray(0, t6), this[T] -= t6); + let s = e6; + t === s.length || t === null ? this[Ft]() : typeof s == "string" ? (this[C][0] = s.slice(t), e6 = s.slice(0, t), this[T] -= t) : (this[C][0] = s.subarray(t), e6 = s.subarray(0, t), this[T] -= t); } return this.emit("data", e6), !this[C].length && !this[G] && this.emit("drain"), e6; } - end(t6, e6, s6) { - return typeof t6 == "function" && (s6 = t6, t6 = void 0), typeof e6 == "function" && (s6 = e6, e6 = "utf8"), t6 !== void 0 && this.write(t6, e6), s6 && this.once("end", s6), this[G] = true, this.writable = false, (this[v] || !this[dt]) && this[H](), this; + end(t, e6, s) { + return typeof t == "function" && (s = t, t = void 0), typeof e6 == "function" && (s = e6, e6 = "utf8"), t !== void 0 && this.write(t, e6), s && this.once("end", s), this[G] = true, this.writable = false, (this[v] || !this[dt]) && this[H](), this; } [st]() { this[x] || (!this[Y] && !this[F].length && (this[M] = true), this[dt] = false, this[v] = true, this.emit("resume"), this[C].length ? this[Ot]() : this[G] ? this[H]() : this.emit("drain")); @@ -180880,55 +185390,55 @@ var V = class extends ee { get paused() { return this[dt]; } - [Yt](t6) { - this[k] ? this[T] += 1 : this[T] += t6.length, this[C].push(t6); + [Yt](t) { + this[k] ? this[T] += 1 : this[T] += t.length, this[C].push(t); } [Ft]() { return this[k] ? this[T] -= 1 : this[T] -= this[C][0].length, this[C].shift(); } - [Ot](t6 = false) { + [Ot](t = false) { do ; while (this[Le](this[Ft]()) && this[C].length); - !t6 && !this[C].length && !this[G] && this.emit("drain"); + !t && !this[C].length && !this[G] && this.emit("drain"); } - [Le](t6) { - return this.emit("data", t6), this[v]; + [Le](t) { + return this.emit("data", t), this[v]; } - pipe(t6, e6) { - if (this[x]) return t6; + pipe(t, e6) { + if (this[x]) return t; this[M] = false; - let s6 = this[K]; - return e6 = e6 || {}, t6 === Ne.stdout || t6 === Ne.stderr ? e6.end = false : e6.end = e6.end !== false, e6.proxyErrors = !!e6.proxyErrors, s6 ? e6.end && t6.end() : (this[F].push(e6.proxyErrors ? new te(this, t6, e6) : new Mt(this, t6, e6)), this[B] ? mt(() => this[st]()) : this[st]()), t6; + let s = this[K]; + return e6 = e6 || {}, t === Ne.stdout || t === Ne.stderr ? e6.end = false : e6.end = e6.end !== false, e6.proxyErrors = !!e6.proxyErrors, s ? e6.end && t.end() : (this[F].push(e6.proxyErrors ? new te(this, t, e6) : new Mt(this, t, e6)), this[B] ? mt(() => this[st]()) : this[st]()), t; } - unpipe(t6) { - let e6 = this[F].find((s6) => s6.dest === t6); + unpipe(t) { + let e6 = this[F].find((s) => s.dest === t); e6 && (this[F].length === 1 ? (this[v] && this[Y] === 0 && (this[v] = false), this[F] = []) : this[F].splice(this[F].indexOf(e6), 1), e6.unpipe()); } - addListener(t6, e6) { - return this.on(t6, e6); + addListener(t, e6) { + return this.on(t, e6); } - on(t6, e6) { - let s6 = super.on(t6, e6); - if (t6 === "data") this[M] = false, this[Y]++, !this[F].length && !this[v] && this[st](); - else if (t6 === "readable" && this[T] !== 0) super.emit("readable"); - else if (ci(t6) && this[K]) super.emit(t6), this.removeAllListeners(t6); - else if (t6 === "error" && this[ut]) { + on(t, e6) { + let s = super.on(t, e6); + if (t === "data") this[M] = false, this[Y]++, !this[F].length && !this[v] && this[st](); + else if (t === "readable" && this[T] !== 0) super.emit("readable"); + else if (ci(t) && this[K]) super.emit(t), this.removeAllListeners(t); + else if (t === "error" && this[ut]) { let i6 = e6; this[B] ? mt(() => i6.call(this, this[ut])) : i6.call(this, this[ut]); } - return s6; + return s; } - removeListener(t6, e6) { - return this.off(t6, e6); + removeListener(t, e6) { + return this.off(t, e6); } - off(t6, e6) { - let s6 = super.off(t6, e6); - return t6 === "data" && (this[Y] = this.listeners("data").length, this[Y] === 0 && !this[M] && !this[F].length && (this[v] = false)), s6; + off(t, e6) { + let s = super.off(t, e6); + return t === "data" && (this[Y] = this.listeners("data").length, this[Y] === 0 && !this[M] && !this[F].length && (this[v] = false)), s; } - removeAllListeners(t6) { - let e6 = super.removeAllListeners(t6); - return (t6 === "data" || t6 === void 0) && (this[Y] = 0, !this[M] && !this[F].length && (this[v] = false)), e6; + removeAllListeners(t) { + let e6 = super.removeAllListeners(t); + return (t === "data" || t === void 0) && (this[Y] = 0, !this[M] && !this[F].length && (this[v] = false)), e6; } get emittedEnd() { return this[K]; @@ -180936,32 +185446,32 @@ var V = class extends ee { [H]() { !this[kt] && !this[K] && !this[x] && this[C].length === 0 && this[G] && (this[kt] = true, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[Rt] && this.emit("close"), this[kt] = false); } - emit(t6, ...e6) { - let s6 = e6[0]; - if (t6 !== "error" && t6 !== "close" && t6 !== x && this[x]) return false; - if (t6 === "data") return !this[k] && !s6 ? false : this[B] ? (mt(() => this[Jt](s6)), true) : this[Jt](s6); - if (t6 === "end") return this[We](); - if (t6 === "close") { + emit(t, ...e6) { + let s = e6[0]; + if (t !== "error" && t !== "close" && t !== x && this[x]) return false; + if (t === "data") return !this[k] && !s ? false : this[B] ? (mt(() => this[Jt](s)), true) : this[Jt](s); + if (t === "end") return this[We](); + if (t === "close") { if (this[Rt] = true, !this[K] && !this[x]) return false; let r6 = super.emit("close"); return this.removeAllListeners("close"), r6; - } else if (t6 === "error") { - this[ut] = s6, super.emit(Xt, s6); - let r6 = !this[pt] || this.listeners("error").length ? super.emit("error", s6) : false; + } else if (t === "error") { + this[ut] = s, super.emit(Xt, s); + let r6 = !this[pt] || this.listeners("error").length ? super.emit("error", s) : false; return this[H](), r6; - } else if (t6 === "resume") { + } else if (t === "resume") { let r6 = super.emit("resume"); return this[H](), r6; - } else if (t6 === "finish" || t6 === "prefinish") { - let r6 = super.emit(t6); - return this.removeAllListeners(t6), r6; + } else if (t === "finish" || t === "prefinish") { + let r6 = super.emit(t); + return this.removeAllListeners(t), r6; } - let i6 = super.emit(t6, ...e6); + let i6 = super.emit(t, ...e6); return this[H](), i6; } - [Jt](t6) { - for (let s6 of this[F]) s6.dest.write(t6) === false && this.pause(); - let e6 = this[M] ? false : super.emit("data", t6); + [Jt](t) { + for (let s of this[F]) s.dest.write(t) === false && this.pause(); + let e6 = this[M] ? false : super.emit("data", t); return this[H](), e6; } [We]() { @@ -180971,49 +185481,49 @@ var V = class extends ee { if (this[et]) { let e6 = this[et].end(); if (e6) { - for (let s6 of this[F]) s6.dest.write(e6); + for (let s of this[F]) s.dest.write(e6); this[M] || super.emit("data", e6); } } for (let e6 of this[F]) e6.end(); - let t6 = super.emit("end"); - return this.removeAllListeners("end"), t6; + let t = super.emit("end"); + return this.removeAllListeners("end"), t; } async collect() { - let t6 = Object.assign([], { dataLength: 0 }); - this[k] || (t6.dataLength = 0); + let t = Object.assign([], { dataLength: 0 }); + this[k] || (t.dataLength = 0); let e6 = this.promise(); - return this.on("data", (s6) => { - t6.push(s6), this[k] || (t6.dataLength += s6.length); - }), await e6, t6; + return this.on("data", (s) => { + t.push(s), this[k] || (t.dataLength += s.length); + }), await e6, t; } async concat() { if (this[k]) throw new Error("cannot concat in objectMode"); - let t6 = await this.collect(); - return this[P] ? t6.join("") : Buffer.concat(t6, t6.dataLength); + let t = await this.collect(); + return this[P] ? t.join("") : Buffer.concat(t, t.dataLength); } async promise() { - return new Promise((t6, e6) => { - this.on(x, () => e6(new Error("stream destroyed"))), this.on("error", (s6) => e6(s6)), this.on("end", () => t6()); + return new Promise((t, e6) => { + this.on(x, () => e6(new Error("stream destroyed"))), this.on("error", (s) => e6(s)), this.on("end", () => t()); }); } [Symbol.asyncIterator]() { this[M] = false; - let t6 = false, e6 = async () => (this.pause(), t6 = true, { value: void 0, done: true }); + let t = false, e6 = async () => (this.pause(), t = true, { value: void 0, done: true }); return { next: () => { - if (t6) return e6(); + if (t) return e6(); let i6 = this.read(); if (i6 !== null) return Promise.resolve({ done: false, value: i6 }); if (this[G]) return e6(); - let r6, o6, h6 = (c6) => { - this.off("data", a6), this.off("end", l6), this.off(x, u6), e6(), o6(c6); + let r6, o2, h6 = (c6) => { + this.off("data", a6), this.off("end", l3), this.off(x, u), e6(), o2(c6); }, a6 = (c6) => { - this.off("error", h6), this.off("end", l6), this.off(x, u6), this.pause(), r6({ value: c6, done: !!this[G] }); - }, l6 = () => { - this.off("error", h6), this.off("data", a6), this.off(x, u6), e6(), r6({ done: true, value: void 0 }); - }, u6 = () => h6(new Error("stream destroyed")); + this.off("error", h6), this.off("end", l3), this.off(x, u), this.pause(), r6({ value: c6, done: !!this[G] }); + }, l3 = () => { + this.off("error", h6), this.off("data", a6), this.off(x, u), e6(), r6({ done: true, value: void 0 }); + }, u = () => h6(new Error("stream destroyed")); return new Promise((c6, d6) => { - o6 = d6, r6 = c6, this.once(x, u6), this.once("error", h6), this.once("end", l6), this.once("data", a6); + o2 = d6, r6 = c6, this.once(x, u), this.once("error", h6), this.once("end", l3), this.once("data", a6); }); }, throw: e6, return: e6, [Symbol.asyncIterator]() { return this; @@ -181022,21 +185532,21 @@ var V = class extends ee { } [Symbol.iterator]() { this[M] = false; - let t6 = false, e6 = () => (this.pause(), this.off(Xt, e6), this.off(x, e6), this.off("end", e6), t6 = true, { done: true, value: void 0 }), s6 = () => { - if (t6) return e6(); + let t = false, e6 = () => (this.pause(), this.off(Xt, e6), this.off(x, e6), this.off("end", e6), t = true, { done: true, value: void 0 }), s = () => { + if (t) return e6(); let i6 = this.read(); return i6 === null ? e6() : { done: false, value: i6 }; }; - return this.once("end", e6), this.once(Xt, e6), this.once(x, e6), { next: s6, throw: e6, return: e6, [Symbol.iterator]() { + return this.once("end", e6), this.once(Xt, e6), this.once(x, e6), { next: s, throw: e6, return: e6, [Symbol.iterator]() { return this; }, [Symbol.dispose]: () => { } }; } - destroy(t6) { - if (this[x]) return t6 ? this.emit("error", t6) : this.emit(x), this; + destroy(t) { + if (this[x]) return t ? this.emit("error", t) : this.emit(x), this; this[x] = true, this[M] = true, this[C].length = 0, this[T] = 0; let e6 = this; - return typeof e6.close == "function" && !this[Rt] && e6.close(), t6 ? this.emit("error", t6) : this.emit(x), this; + return typeof e6.close == "function" && !this[Rt] && e6.close(), t ? this.emit("error", t) : this.emit(x), this; } static get isStream() { return oi; @@ -181044,9 +185554,9 @@ var V = class extends ee { }; var vi = Ei.native; var wt = { lstatSync: wi, readdir: yi, readdirSync: bi, readlinkSync: Si, realpathSync: vi, promises: { lstat: Ci, readdir: Ti, readlink: Ai, realpath: ki } }; -var Ue = (n12) => !n12 || n12 === wt || n12 === xi ? wt : { ...wt, ...n12, promises: { ...wt.promises, ...n12.promises || {} } }; +var Ue = (n8) => !n8 || n8 === wt || n8 === xi ? wt : { ...wt, ...n8, promises: { ...wt.promises, ...n8.promises || {} } }; var $e = /^\\\\\?\\([a-z]:)\\?$/i; -var Ri = (n12) => n12.replace(/\//g, "\\").replace($e, "$1\\"); +var Ri = (n8) => n8.replace(/\//g, "\\").replace($e, "$1\\"); var Oi = /[\\\/]/; var L = 0; var Ge = 1; @@ -181066,20 +185576,20 @@ var Nt = 256; var Lt = 512; var Ie = yt | j | Lt; var Fi = 1023; -var ie = (n12) => n12.isFile() ? Ke : n12.isDirectory() ? U : n12.isSymbolicLink() ? X : n12.isCharacterDevice() ? He : n12.isBlockDevice() ? qe : n12.isSocket() ? Ve : n12.isFIFO() ? Ge : L; +var ie = (n8) => n8.isFile() ? Ke : n8.isDirectory() ? U : n8.isSymbolicLink() ? X : n8.isCharacterDevice() ? He : n8.isBlockDevice() ? qe : n8.isSocket() ? Ve : n8.isFIFO() ? Ge : L; var ze = new ft({ max: 2 ** 12 }); -var bt = (n12) => { - let t6 = ze.get(n12); - if (t6) return t6; - let e6 = n12.normalize("NFKD"); - return ze.set(n12, e6), e6; +var bt = (n8) => { + let t = ze.get(n8); + if (t) return t; + let e6 = n8.normalize("NFKD"); + return ze.set(n8, e6), e6; }; var Be = new ft({ max: 2 ** 12 }); -var _t = (n12) => { - let t6 = Be.get(n12); - if (t6) return t6; - let e6 = bt(n12.toLowerCase()); - return Be.set(n12, e6), e6; +var _t = (n8) => { + let t = Be.get(n8); + if (t) return t; + let e6 = bt(n8.toLowerCase()); + return Be.set(n8, e6), e6; }; var Wt = class extends ft { constructor() { @@ -181087,8 +185597,8 @@ var Wt = class extends ft { } }; var ne = class extends ft { - constructor(t6 = 16 * 1024) { - super({ maxSize: t6, sizeCalculation: (e6) => e6.length + 1 }); + constructor(t = 16 * 1024) { + super({ maxSize: t, sizeCalculation: (e6) => e6.length + 1 }); } }; var Ye = /* @__PURE__ */ Symbol("PathScurry setAsCwd"); @@ -181188,8 +185698,8 @@ var R = class { get path() { return this.parentPath; } - constructor(t6, e6 = L, s6, i6, r6, o6, h6) { - this.name = t6, this.#C = r6 ? _t(t6) : bt(t6), this.#e = e6 & Fi, this.nocase = r6, this.roots = i6, this.root = s6 || this, this.#_ = o6, this.#g = h6.fullpath, this.#x = h6.relative, this.#A = h6.relativePosix, this.parent = h6.parent, this.parent ? this.#t = this.parent.#t : this.#t = Ue(h6.fs); + constructor(t, e6 = L, s, i6, r6, o2, h6) { + this.name = t, this.#C = r6 ? _t(t) : bt(t), this.#e = e6 & Fi, this.nocase = r6, this.roots = i6, this.root = s || this, this.#_ = o2, this.#g = h6.fullpath, this.#x = h6.relative, this.#A = h6.relativePosix, this.parent = h6.parent, this.parent ? this.#t = this.parent.#t : this.#t = Ue(h6.fs); } depth() { return this.#T !== void 0 ? this.#T : this.parent ? this.#T = this.parent.depth() + 1 : this.#T = 0; @@ -181197,52 +185707,52 @@ var R = class { childrenCache() { return this.#_; } - resolve(t6) { - if (!t6) return this; - let e6 = this.getRootString(t6), i6 = t6.substring(e6.length).split(this.splitSep); + resolve(t) { + if (!t) return this; + let e6 = this.getRootString(t), i6 = t.substring(e6.length).split(this.splitSep); return e6 ? this.getRoot(e6).#N(i6) : this.#N(i6); } - #N(t6) { + #N(t) { let e6 = this; - for (let s6 of t6) e6 = e6.child(s6); + for (let s of t) e6 = e6.child(s); return e6; } children() { - let t6 = this.#_.get(this); - if (t6) return t6; + let t = this.#_.get(this); + if (t) return t; let e6 = Object.assign([], { provisional: 0 }); return this.#_.set(this, e6), this.#e &= ~se, e6; } - child(t6, e6) { - if (t6 === "" || t6 === ".") return this; - if (t6 === "..") return this.parent || this; - let s6 = this.children(), i6 = this.nocase ? _t(t6) : bt(t6); - for (let a6 of s6) if (a6.#C === i6) return a6; - let r6 = this.parent ? this.sep : "", o6 = this.#g ? this.#g + r6 + t6 : void 0, h6 = this.newChild(t6, L, { ...e6, parent: this, fullpath: o6 }); - return this.canReaddir() || (h6.#e |= j), s6.push(h6), h6; + child(t, e6) { + if (t === "" || t === ".") return this; + if (t === "..") return this.parent || this; + let s = this.children(), i6 = this.nocase ? _t(t) : bt(t); + for (let a6 of s) if (a6.#C === i6) return a6; + let r6 = this.parent ? this.sep : "", o2 = this.#g ? this.#g + r6 + t : void 0, h6 = this.newChild(t, L, { ...e6, parent: this, fullpath: o2 }); + return this.canReaddir() || (h6.#e |= j), s.push(h6), h6; } relative() { if (this.isCWD) return ""; if (this.#x !== void 0) return this.#x; - let t6 = this.name, e6 = this.parent; + let t = this.name, e6 = this.parent; if (!e6) return this.#x = this.name; - let s6 = e6.relative(); - return s6 + (!s6 || !e6.parent ? "" : this.sep) + t6; + let s = e6.relative(); + return s + (!s || !e6.parent ? "" : this.sep) + t; } relativePosix() { if (this.sep === "/") return this.relative(); if (this.isCWD) return ""; if (this.#A !== void 0) return this.#A; - let t6 = this.name, e6 = this.parent; + let t = this.name, e6 = this.parent; if (!e6) return this.#A = this.fullpathPosix(); - let s6 = e6.relativePosix(); - return s6 + (!s6 || !e6.parent ? "" : "/") + t6; + let s = e6.relativePosix(); + return s + (!s || !e6.parent ? "" : "/") + t; } fullpath() { if (this.#g !== void 0) return this.#g; - let t6 = this.name, e6 = this.parent; + let t = this.name, e6 = this.parent; if (!e6) return this.#g = this.name; - let i6 = e6.fullpath() + (e6.parent ? this.sep : "") + t6; + let i6 = e6.fullpath() + (e6.parent ? this.sep : "") + t; return this.#g = i6; } fullpathPosix() { @@ -181252,14 +185762,14 @@ var R = class { let i6 = this.fullpath().replace(/\\/g, "/"); return /^[a-z]:\//i.test(i6) ? this.#y = `//?/${i6}` : this.#y = i6; } - let t6 = this.parent, e6 = t6.fullpathPosix(), s6 = e6 + (!e6 || !t6.parent ? "" : "/") + this.name; - return this.#y = s6; + let t = this.parent, e6 = t.fullpathPosix(), s = e6 + (!e6 || !t.parent ? "" : "/") + this.name; + return this.#y = s; } isUnknown() { return (this.#e & _2) === L; } - isType(t6) { - return this[`is${t6}`](); + isType(t) { + return this[`is${t}`](); } getType() { return this.isUnknown() ? "Unknown" : this.isDirectory() ? "Directory" : this.isFile() ? "File" : this.isSymbolicLink() ? "SymbolicLink" : this.isFIFO() ? "FIFO" : this.isCharacterDevice() ? "CharacterDevice" : this.isBlockDevice() ? "BlockDevice" : this.isSocket() ? "Socket" : "Unknown"; @@ -181295,14 +185805,14 @@ var R = class { return this.#k; } readdirCached() { - let t6 = this.children(); - return t6.slice(0, t6.provisional); + let t = this.children(); + return t.slice(0, t.provisional); } canReadlink() { if (this.#M) return true; if (!this.parent) return false; - let t6 = this.#e & _2; - return !(t6 !== L && t6 !== X || this.#e & Nt || this.#e & j); + let t = this.#e & _2; + return !(t !== L && t !== X || this.#e & Nt || this.#e & j); } calledReaddir() { return !!(this.#e & se); @@ -181310,178 +185820,178 @@ var R = class { isENOENT() { return !!(this.#e & j); } - isNamed(t6) { - return this.nocase ? this.#C === _t(t6) : this.#C === bt(t6); + isNamed(t) { + return this.nocase ? this.#C === _t(t) : this.#C === bt(t); } async readlink() { - let t6 = this.#M; - if (t6) return t6; + let t = this.#M; + if (t) return t; if (this.canReadlink() && this.parent) try { - let e6 = await this.#t.promises.readlink(this.fullpath()), s6 = (await this.parent.realpath())?.resolve(e6); - if (s6) return this.#M = s6; + let e6 = await this.#t.promises.readlink(this.fullpath()), s = (await this.parent.realpath())?.resolve(e6); + if (s) return this.#M = s; } catch (e6) { this.#D(e6.code); return; } } readlinkSync() { - let t6 = this.#M; - if (t6) return t6; + let t = this.#M; + if (t) return t; if (this.canReadlink() && this.parent) try { - let e6 = this.#t.readlinkSync(this.fullpath()), s6 = this.parent.realpathSync()?.resolve(e6); - if (s6) return this.#M = s6; + let e6 = this.#t.readlinkSync(this.fullpath()), s = this.parent.realpathSync()?.resolve(e6); + if (s) return this.#M = s; } catch (e6) { this.#D(e6.code); return; } } - #j(t6) { + #j(t) { this.#e |= se; - for (let e6 = t6.provisional; e6 < t6.length; e6++) { - let s6 = t6[e6]; - s6 && s6.#v(); + for (let e6 = t.provisional; e6 < t.length; e6++) { + let s = t[e6]; + s && s.#v(); } } #v() { this.#e & j || (this.#e = (this.#e | j) & gt, this.#G()); } #G() { - let t6 = this.children(); - t6.provisional = 0; - for (let e6 of t6) e6.#v(); + let t = this.children(); + t.provisional = 0; + for (let e6 of t) e6.#v(); } #P() { this.#e |= Lt, this.#L(); } #L() { if (this.#e & yt) return; - let t6 = this.#e; - (t6 & _2) === U && (t6 &= gt), this.#e = t6 | yt, this.#G(); + let t = this.#e; + (t & _2) === U && (t &= gt), this.#e = t | yt, this.#G(); } - #I(t6 = "") { - t6 === "ENOTDIR" || t6 === "EPERM" ? this.#L() : t6 === "ENOENT" ? this.#v() : this.children().provisional = 0; + #I(t = "") { + t === "ENOTDIR" || t === "EPERM" ? this.#L() : t === "ENOENT" ? this.#v() : this.children().provisional = 0; } - #F(t6 = "") { - t6 === "ENOTDIR" ? this.parent.#L() : t6 === "ENOENT" && this.#v(); + #F(t = "") { + t === "ENOTDIR" ? this.parent.#L() : t === "ENOENT" && this.#v(); } - #D(t6 = "") { + #D(t = "") { let e6 = this.#e; - e6 |= Nt, t6 === "ENOENT" && (e6 |= j), (t6 === "EINVAL" || t6 === "UNKNOWN") && (e6 &= gt), this.#e = e6, t6 === "ENOTDIR" && this.parent && this.parent.#L(); + e6 |= Nt, t === "ENOENT" && (e6 |= j), (t === "EINVAL" || t === "UNKNOWN") && (e6 &= gt), this.#e = e6, t === "ENOTDIR" && this.parent && this.parent.#L(); } - #z(t6, e6) { - return this.#U(t6, e6) || this.#B(t6, e6); + #z(t, e6) { + return this.#U(t, e6) || this.#B(t, e6); } - #B(t6, e6) { - let s6 = ie(t6), i6 = this.newChild(t6.name, s6, { parent: this }), r6 = i6.#e & _2; + #B(t, e6) { + let s = ie(t), i6 = this.newChild(t.name, s, { parent: this }), r6 = i6.#e & _2; return r6 !== U && r6 !== X && r6 !== L && (i6.#e |= yt), e6.unshift(i6), e6.provisional++, i6; } - #U(t6, e6) { - for (let s6 = e6.provisional; s6 < e6.length; s6++) { - let i6 = e6[s6]; - if ((this.nocase ? _t(t6.name) : bt(t6.name)) === i6.#C) return this.#l(t6, i6, s6, e6); + #U(t, e6) { + for (let s = e6.provisional; s < e6.length; s++) { + let i6 = e6[s]; + if ((this.nocase ? _t(t.name) : bt(t.name)) === i6.#C) return this.#l(t, i6, s, e6); } } - #l(t6, e6, s6, i6) { + #l(t, e6, s, i6) { let r6 = e6.name; - return e6.#e = e6.#e & gt | ie(t6), r6 !== t6.name && (e6.name = t6.name), s6 !== i6.provisional && (s6 === i6.length - 1 ? i6.pop() : i6.splice(s6, 1), i6.unshift(e6)), i6.provisional++, e6; + return e6.#e = e6.#e & gt | ie(t), r6 !== t.name && (e6.name = t.name), s !== i6.provisional && (s === i6.length - 1 ? i6.pop() : i6.splice(s, 1), i6.unshift(e6)), i6.provisional++, e6; } async lstat() { if ((this.#e & j) === 0) try { return this.#$(await this.#t.promises.lstat(this.fullpath())), this; - } catch (t6) { - this.#F(t6.code); + } catch (t) { + this.#F(t.code); } } lstatSync() { if ((this.#e & j) === 0) try { return this.#$(this.#t.lstatSync(this.fullpath())), this; - } catch (t6) { - this.#F(t6.code); + } catch (t) { + this.#F(t.code); } } - #$(t6) { - let { atime: e6, atimeMs: s6, birthtime: i6, birthtimeMs: r6, blksize: o6, blocks: h6, ctime: a6, ctimeMs: l6, dev: u6, gid: c6, ino: d6, mode: f6, mtime: m6, mtimeMs: p6, nlink: w5, rdev: g6, size: S, uid: E2 } = t6; - this.#b = e6, this.#a = s6, this.#m = i6, this.#E = r6, this.#c = o6, this.#f = h6, this.#R = a6, this.#d = l6, this.#s = u6, this.#S = c6, this.#h = d6, this.#n = f6, this.#p = m6, this.#i = p6, this.#r = w5, this.#w = g6, this.#u = S, this.#o = E2; - let y2 = ie(t6); - this.#e = this.#e & gt | y2 | je, y2 !== L && y2 !== U && y2 !== X && (this.#e |= yt); + #$(t) { + let { atime: e6, atimeMs: s, birthtime: i6, birthtimeMs: r6, blksize: o2, blocks: h6, ctime: a6, ctimeMs: l3, dev: u, gid: c6, ino: d6, mode: f6, mtime: m3, mtimeMs: p2, nlink: w, rdev: g6, size: S, uid: E } = t; + this.#b = e6, this.#a = s, this.#m = i6, this.#E = r6, this.#c = o2, this.#f = h6, this.#R = a6, this.#d = l3, this.#s = u, this.#S = c6, this.#h = d6, this.#n = f6, this.#p = m3, this.#i = p2, this.#r = w, this.#w = g6, this.#u = S, this.#o = E; + let y = ie(t); + this.#e = this.#e & gt | y | je, y !== L && y !== U && y !== X && (this.#e |= yt); } #W = []; #O = false; - #H(t6) { + #H(t) { this.#O = false; let e6 = this.#W.slice(); - this.#W.length = 0, e6.forEach((s6) => s6(null, t6)); + this.#W.length = 0, e6.forEach((s) => s(null, t)); } - readdirCB(t6, e6 = false) { + readdirCB(t, e6 = false) { if (!this.canReaddir()) { - e6 ? t6(null, []) : queueMicrotask(() => t6(null, [])); + e6 ? t(null, []) : queueMicrotask(() => t(null, [])); return; } - let s6 = this.children(); + let s = this.children(); if (this.calledReaddir()) { - let r6 = s6.slice(0, s6.provisional); - e6 ? t6(null, r6) : queueMicrotask(() => t6(null, r6)); + let r6 = s.slice(0, s.provisional); + e6 ? t(null, r6) : queueMicrotask(() => t(null, r6)); return; } - if (this.#W.push(t6), this.#O) return; + if (this.#W.push(t), this.#O) return; this.#O = true; let i6 = this.fullpath(); - this.#t.readdir(i6, { withFileTypes: true }, (r6, o6) => { - if (r6) this.#I(r6.code), s6.provisional = 0; + this.#t.readdir(i6, { withFileTypes: true }, (r6, o2) => { + if (r6) this.#I(r6.code), s.provisional = 0; else { - for (let h6 of o6) this.#z(h6, s6); - this.#j(s6); + for (let h6 of o2) this.#z(h6, s); + this.#j(s); } - this.#H(s6.slice(0, s6.provisional)); + this.#H(s.slice(0, s.provisional)); }); } #q; async readdir() { if (!this.canReaddir()) return []; - let t6 = this.children(); - if (this.calledReaddir()) return t6.slice(0, t6.provisional); + let t = this.children(); + if (this.calledReaddir()) return t.slice(0, t.provisional); let e6 = this.fullpath(); if (this.#q) await this.#q; else { - let s6 = () => { + let s = () => { }; - this.#q = new Promise((i6) => s6 = i6); + this.#q = new Promise((i6) => s = i6); try { - for (let i6 of await this.#t.promises.readdir(e6, { withFileTypes: true })) this.#z(i6, t6); - this.#j(t6); + for (let i6 of await this.#t.promises.readdir(e6, { withFileTypes: true })) this.#z(i6, t); + this.#j(t); } catch (i6) { - this.#I(i6.code), t6.provisional = 0; + this.#I(i6.code), t.provisional = 0; } - this.#q = void 0, s6(); + this.#q = void 0, s(); } - return t6.slice(0, t6.provisional); + return t.slice(0, t.provisional); } readdirSync() { if (!this.canReaddir()) return []; - let t6 = this.children(); - if (this.calledReaddir()) return t6.slice(0, t6.provisional); + let t = this.children(); + if (this.calledReaddir()) return t.slice(0, t.provisional); let e6 = this.fullpath(); try { - for (let s6 of this.#t.readdirSync(e6, { withFileTypes: true })) this.#z(s6, t6); - this.#j(t6); - } catch (s6) { - this.#I(s6.code), t6.provisional = 0; + for (let s of this.#t.readdirSync(e6, { withFileTypes: true })) this.#z(s, t); + this.#j(t); + } catch (s) { + this.#I(s.code), t.provisional = 0; } - return t6.slice(0, t6.provisional); + return t.slice(0, t.provisional); } canReaddir() { if (this.#e & Ie) return false; - let t6 = _2 & this.#e; - return t6 === L || t6 === U || t6 === X; + let t = _2 & this.#e; + return t === L || t === U || t === X; } - shouldWalk(t6, e6) { - return (this.#e & U) === U && !(this.#e & Ie) && !t6.has(this) && (!e6 || e6(this)); + shouldWalk(t, e6) { + return (this.#e & U) === U && !(this.#e & Ie) && !t.has(this) && (!e6 || e6(this)); } async realpath() { if (this.#k) return this.#k; if (!((Lt | Nt | j) & this.#e)) try { - let t6 = await this.#t.promises.realpath(this.fullpath()); - return this.#k = this.resolve(t6); + let t = await this.#t.promises.realpath(this.fullpath()); + return this.#k = this.resolve(t); } catch { this.#P(); } @@ -181489,55 +185999,55 @@ var R = class { realpathSync() { if (this.#k) return this.#k; if (!((Lt | Nt | j) & this.#e)) try { - let t6 = this.#t.realpathSync(this.fullpath()); - return this.#k = this.resolve(t6); + let t = this.#t.realpathSync(this.fullpath()); + return this.#k = this.resolve(t); } catch { this.#P(); } } - [Ye](t6) { - if (t6 === this) return; - t6.isCWD = false, this.isCWD = true; - let e6 = /* @__PURE__ */ new Set([]), s6 = [], i6 = this; - for (; i6 && i6.parent; ) e6.add(i6), i6.#x = s6.join(this.sep), i6.#A = s6.join("/"), i6 = i6.parent, s6.push(".."); - for (i6 = t6; i6 && i6.parent && !e6.has(i6); ) i6.#x = void 0, i6.#A = void 0, i6 = i6.parent; + [Ye](t) { + if (t === this) return; + t.isCWD = false, this.isCWD = true; + let e6 = /* @__PURE__ */ new Set([]), s = [], i6 = this; + for (; i6 && i6.parent; ) e6.add(i6), i6.#x = s.join(this.sep), i6.#A = s.join("/"), i6 = i6.parent, s.push(".."); + for (i6 = t; i6 && i6.parent && !e6.has(i6); ) i6.#x = void 0, i6.#A = void 0, i6 = i6.parent; } }; var Pt = class n2 extends R { sep = "\\"; splitSep = Oi; - constructor(t6, e6 = L, s6, i6, r6, o6, h6) { - super(t6, e6, s6, i6, r6, o6, h6); + constructor(t, e6 = L, s, i6, r6, o2, h6) { + super(t, e6, s, i6, r6, o2, h6); } - newChild(t6, e6 = L, s6 = {}) { - return new n2(t6, e6, this.root, this.roots, this.nocase, this.childrenCache(), s6); + newChild(t, e6 = L, s = {}) { + return new n2(t, e6, this.root, this.roots, this.nocase, this.childrenCache(), s); } - getRootString(t6) { - return re.parse(t6).root; + getRootString(t) { + return re.parse(t).root; } - getRoot(t6) { - if (t6 = Ri(t6.toUpperCase()), t6 === this.root.name) return this.root; - for (let [e6, s6] of Object.entries(this.roots)) if (this.sameRoot(t6, e6)) return this.roots[t6] = s6; - return this.roots[t6] = new it(t6, this).root; + getRoot(t) { + if (t = Ri(t.toUpperCase()), t === this.root.name) return this.root; + for (let [e6, s] of Object.entries(this.roots)) if (this.sameRoot(t, e6)) return this.roots[t] = s; + return this.roots[t] = new it(t, this).root; } - sameRoot(t6, e6 = this.root.name) { - return t6 = t6.toUpperCase().replace(/\//g, "\\").replace($e, "$1\\"), t6 === e6; + sameRoot(t, e6 = this.root.name) { + return t = t.toUpperCase().replace(/\//g, "\\").replace($e, "$1\\"), t === e6; } }; var jt = class n3 extends R { splitSep = "/"; sep = "/"; - constructor(t6, e6 = L, s6, i6, r6, o6, h6) { - super(t6, e6, s6, i6, r6, o6, h6); + constructor(t, e6 = L, s, i6, r6, o2, h6) { + super(t, e6, s, i6, r6, o2, h6); } - getRootString(t6) { - return t6.startsWith("/") ? "/" : ""; + getRootString(t) { + return t.startsWith("/") ? "/" : ""; } - getRoot(t6) { + getRoot(t) { return this.root; } - newChild(t6, e6 = L, s6 = {}) { - return new n3(t6, e6, this.root, this.roots, this.nocase, this.childrenCache(), s6); + newChild(t, e6 = L, s = {}) { + return new n3(t, e6, this.root, this.roots, this.nocase, this.childrenCache(), s); } }; var It = class { @@ -181550,136 +186060,136 @@ var It = class { #n; nocase; #r; - constructor(t6 = process.cwd(), e6, s6, { nocase: i6, childrenCacheSize: r6 = 16 * 1024, fs: o6 = wt } = {}) { - this.#r = Ue(o6), (t6 instanceof URL || t6.startsWith("file://")) && (t6 = gi(t6)); - let h6 = e6.resolve(t6); + constructor(t = process.cwd(), e6, s, { nocase: i6, childrenCacheSize: r6 = 16 * 1024, fs: o2 = wt } = {}) { + this.#r = Ue(o2), (t instanceof URL || t.startsWith("file://")) && (t = gi(t)); + let h6 = e6.resolve(t); this.roots = /* @__PURE__ */ Object.create(null), this.rootPath = this.parseRootPath(h6), this.#t = new Wt(), this.#s = new Wt(), this.#n = new ne(r6); - let a6 = h6.substring(this.rootPath.length).split(s6); + let a6 = h6.substring(this.rootPath.length).split(s); if (a6.length === 1 && !a6[0] && a6.pop(), i6 === void 0) throw new TypeError("must provide nocase setting to PathScurryBase ctor"); this.nocase = i6, this.root = this.newRoot(this.#r), this.roots[this.rootPath] = this.root; - let l6 = this.root, u6 = a6.length - 1, c6 = e6.sep, d6 = this.rootPath, f6 = false; - for (let m6 of a6) { - let p6 = u6--; - l6 = l6.child(m6, { relative: new Array(p6).fill("..").join(c6), relativePosix: new Array(p6).fill("..").join("/"), fullpath: d6 += (f6 ? "" : c6) + m6 }), f6 = true; + let l3 = this.root, u = a6.length - 1, c6 = e6.sep, d6 = this.rootPath, f6 = false; + for (let m3 of a6) { + let p2 = u--; + l3 = l3.child(m3, { relative: new Array(p2).fill("..").join(c6), relativePosix: new Array(p2).fill("..").join("/"), fullpath: d6 += (f6 ? "" : c6) + m3 }), f6 = true; } - this.cwd = l6; + this.cwd = l3; } - depth(t6 = this.cwd) { - return typeof t6 == "string" && (t6 = this.cwd.resolve(t6)), t6.depth(); + depth(t = this.cwd) { + return typeof t == "string" && (t = this.cwd.resolve(t)), t.depth(); } childrenCache() { return this.#n; } - resolve(...t6) { + resolve(...t) { let e6 = ""; - for (let r6 = t6.length - 1; r6 >= 0; r6--) { - let o6 = t6[r6]; - if (!(!o6 || o6 === ".") && (e6 = e6 ? `${o6}/${e6}` : o6, this.isAbsolute(o6))) break; + for (let r6 = t.length - 1; r6 >= 0; r6--) { + let o2 = t[r6]; + if (!(!o2 || o2 === ".") && (e6 = e6 ? `${o2}/${e6}` : o2, this.isAbsolute(o2))) break; } - let s6 = this.#t.get(e6); - if (s6 !== void 0) return s6; + let s = this.#t.get(e6); + if (s !== void 0) return s; let i6 = this.cwd.resolve(e6).fullpath(); return this.#t.set(e6, i6), i6; } - resolvePosix(...t6) { + resolvePosix(...t) { let e6 = ""; - for (let r6 = t6.length - 1; r6 >= 0; r6--) { - let o6 = t6[r6]; - if (!(!o6 || o6 === ".") && (e6 = e6 ? `${o6}/${e6}` : o6, this.isAbsolute(o6))) break; + for (let r6 = t.length - 1; r6 >= 0; r6--) { + let o2 = t[r6]; + if (!(!o2 || o2 === ".") && (e6 = e6 ? `${o2}/${e6}` : o2, this.isAbsolute(o2))) break; } - let s6 = this.#s.get(e6); - if (s6 !== void 0) return s6; + let s = this.#s.get(e6); + if (s !== void 0) return s; let i6 = this.cwd.resolve(e6).fullpathPosix(); return this.#s.set(e6, i6), i6; } - relative(t6 = this.cwd) { - return typeof t6 == "string" && (t6 = this.cwd.resolve(t6)), t6.relative(); + relative(t = this.cwd) { + return typeof t == "string" && (t = this.cwd.resolve(t)), t.relative(); } - relativePosix(t6 = this.cwd) { - return typeof t6 == "string" && (t6 = this.cwd.resolve(t6)), t6.relativePosix(); + relativePosix(t = this.cwd) { + return typeof t == "string" && (t = this.cwd.resolve(t)), t.relativePosix(); } - basename(t6 = this.cwd) { - return typeof t6 == "string" && (t6 = this.cwd.resolve(t6)), t6.name; + basename(t = this.cwd) { + return typeof t == "string" && (t = this.cwd.resolve(t)), t.name; } - dirname(t6 = this.cwd) { - return typeof t6 == "string" && (t6 = this.cwd.resolve(t6)), (t6.parent || t6).fullpath(); + dirname(t = this.cwd) { + return typeof t == "string" && (t = this.cwd.resolve(t)), (t.parent || t).fullpath(); } - async readdir(t6 = this.cwd, e6 = { withFileTypes: true }) { - typeof t6 == "string" ? t6 = this.cwd.resolve(t6) : t6 instanceof R || (e6 = t6, t6 = this.cwd); - let { withFileTypes: s6 } = e6; - if (t6.canReaddir()) { - let i6 = await t6.readdir(); - return s6 ? i6 : i6.map((r6) => r6.name); + async readdir(t = this.cwd, e6 = { withFileTypes: true }) { + typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e6 = t, t = this.cwd); + let { withFileTypes: s } = e6; + if (t.canReaddir()) { + let i6 = await t.readdir(); + return s ? i6 : i6.map((r6) => r6.name); } else return []; } - readdirSync(t6 = this.cwd, e6 = { withFileTypes: true }) { - typeof t6 == "string" ? t6 = this.cwd.resolve(t6) : t6 instanceof R || (e6 = t6, t6 = this.cwd); - let { withFileTypes: s6 = true } = e6; - return t6.canReaddir() ? s6 ? t6.readdirSync() : t6.readdirSync().map((i6) => i6.name) : []; - } - async lstat(t6 = this.cwd) { - return typeof t6 == "string" && (t6 = this.cwd.resolve(t6)), t6.lstat(); - } - lstatSync(t6 = this.cwd) { - return typeof t6 == "string" && (t6 = this.cwd.resolve(t6)), t6.lstatSync(); - } - async readlink(t6 = this.cwd, { withFileTypes: e6 } = { withFileTypes: false }) { - typeof t6 == "string" ? t6 = this.cwd.resolve(t6) : t6 instanceof R || (e6 = t6.withFileTypes, t6 = this.cwd); - let s6 = await t6.readlink(); - return e6 ? s6 : s6?.fullpath(); - } - readlinkSync(t6 = this.cwd, { withFileTypes: e6 } = { withFileTypes: false }) { - typeof t6 == "string" ? t6 = this.cwd.resolve(t6) : t6 instanceof R || (e6 = t6.withFileTypes, t6 = this.cwd); - let s6 = t6.readlinkSync(); - return e6 ? s6 : s6?.fullpath(); - } - async realpath(t6 = this.cwd, { withFileTypes: e6 } = { withFileTypes: false }) { - typeof t6 == "string" ? t6 = this.cwd.resolve(t6) : t6 instanceof R || (e6 = t6.withFileTypes, t6 = this.cwd); - let s6 = await t6.realpath(); - return e6 ? s6 : s6?.fullpath(); - } - realpathSync(t6 = this.cwd, { withFileTypes: e6 } = { withFileTypes: false }) { - typeof t6 == "string" ? t6 = this.cwd.resolve(t6) : t6 instanceof R || (e6 = t6.withFileTypes, t6 = this.cwd); - let s6 = t6.realpathSync(); - return e6 ? s6 : s6?.fullpath(); - } - async walk(t6 = this.cwd, e6 = {}) { - typeof t6 == "string" ? t6 = this.cwd.resolve(t6) : t6 instanceof R || (e6 = t6, t6 = this.cwd); - let { withFileTypes: s6 = true, follow: i6 = false, filter: r6, walkFilter: o6 } = e6, h6 = []; - (!r6 || r6(t6)) && h6.push(s6 ? t6 : t6.fullpath()); - let a6 = /* @__PURE__ */ new Set(), l6 = (c6, d6) => { - a6.add(c6), c6.readdirCB((f6, m6) => { + readdirSync(t = this.cwd, e6 = { withFileTypes: true }) { + typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e6 = t, t = this.cwd); + let { withFileTypes: s = true } = e6; + return t.canReaddir() ? s ? t.readdirSync() : t.readdirSync().map((i6) => i6.name) : []; + } + async lstat(t = this.cwd) { + return typeof t == "string" && (t = this.cwd.resolve(t)), t.lstat(); + } + lstatSync(t = this.cwd) { + return typeof t == "string" && (t = this.cwd.resolve(t)), t.lstatSync(); + } + async readlink(t = this.cwd, { withFileTypes: e6 } = { withFileTypes: false }) { + typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e6 = t.withFileTypes, t = this.cwd); + let s = await t.readlink(); + return e6 ? s : s?.fullpath(); + } + readlinkSync(t = this.cwd, { withFileTypes: e6 } = { withFileTypes: false }) { + typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e6 = t.withFileTypes, t = this.cwd); + let s = t.readlinkSync(); + return e6 ? s : s?.fullpath(); + } + async realpath(t = this.cwd, { withFileTypes: e6 } = { withFileTypes: false }) { + typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e6 = t.withFileTypes, t = this.cwd); + let s = await t.realpath(); + return e6 ? s : s?.fullpath(); + } + realpathSync(t = this.cwd, { withFileTypes: e6 } = { withFileTypes: false }) { + typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e6 = t.withFileTypes, t = this.cwd); + let s = t.realpathSync(); + return e6 ? s : s?.fullpath(); + } + async walk(t = this.cwd, e6 = {}) { + typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e6 = t, t = this.cwd); + let { withFileTypes: s = true, follow: i6 = false, filter: r6, walkFilter: o2 } = e6, h6 = []; + (!r6 || r6(t)) && h6.push(s ? t : t.fullpath()); + let a6 = /* @__PURE__ */ new Set(), l3 = (c6, d6) => { + a6.add(c6), c6.readdirCB((f6, m3) => { if (f6) return d6(f6); - let p6 = m6.length; - if (!p6) return d6(); - let w5 = () => { - --p6 === 0 && d6(); + let p2 = m3.length; + if (!p2) return d6(); + let w = () => { + --p2 === 0 && d6(); }; - for (let g6 of m6) (!r6 || r6(g6)) && h6.push(s6 ? g6 : g6.fullpath()), i6 && g6.isSymbolicLink() ? g6.realpath().then((S) => S?.isUnknown() ? S.lstat() : S).then((S) => S?.shouldWalk(a6, o6) ? l6(S, w5) : w5()) : g6.shouldWalk(a6, o6) ? l6(g6, w5) : w5(); + for (let g6 of m3) (!r6 || r6(g6)) && h6.push(s ? g6 : g6.fullpath()), i6 && g6.isSymbolicLink() ? g6.realpath().then((S) => S?.isUnknown() ? S.lstat() : S).then((S) => S?.shouldWalk(a6, o2) ? l3(S, w) : w()) : g6.shouldWalk(a6, o2) ? l3(g6, w) : w(); }, true); - }, u6 = t6; + }, u = t; return new Promise((c6, d6) => { - l6(u6, (f6) => { + l3(u, (f6) => { if (f6) return d6(f6); c6(h6); }); }); } - walkSync(t6 = this.cwd, e6 = {}) { - typeof t6 == "string" ? t6 = this.cwd.resolve(t6) : t6 instanceof R || (e6 = t6, t6 = this.cwd); - let { withFileTypes: s6 = true, follow: i6 = false, filter: r6, walkFilter: o6 } = e6, h6 = []; - (!r6 || r6(t6)) && h6.push(s6 ? t6 : t6.fullpath()); - let a6 = /* @__PURE__ */ new Set([t6]); - for (let l6 of a6) { - let u6 = l6.readdirSync(); - for (let c6 of u6) { - (!r6 || r6(c6)) && h6.push(s6 ? c6 : c6.fullpath()); + walkSync(t = this.cwd, e6 = {}) { + typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e6 = t, t = this.cwd); + let { withFileTypes: s = true, follow: i6 = false, filter: r6, walkFilter: o2 } = e6, h6 = []; + (!r6 || r6(t)) && h6.push(s ? t : t.fullpath()); + let a6 = /* @__PURE__ */ new Set([t]); + for (let l3 of a6) { + let u = l3.readdirSync(); + for (let c6 of u) { + (!r6 || r6(c6)) && h6.push(s ? c6 : c6.fullpath()); let d6 = c6; if (c6.isSymbolicLink()) { if (!(i6 && (d6 = c6.realpathSync()))) continue; d6.isUnknown() && d6.lstatSync(); } - d6.shouldWalk(a6, o6) && a6.add(d6); + d6.shouldWalk(a6, o2) && a6.add(d6); } } return h6; @@ -181687,143 +186197,143 @@ var It = class { [Symbol.asyncIterator]() { return this.iterate(); } - iterate(t6 = this.cwd, e6 = {}) { - return typeof t6 == "string" ? t6 = this.cwd.resolve(t6) : t6 instanceof R || (e6 = t6, t6 = this.cwd), this.stream(t6, e6)[Symbol.asyncIterator](); + iterate(t = this.cwd, e6 = {}) { + return typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e6 = t, t = this.cwd), this.stream(t, e6)[Symbol.asyncIterator](); } [Symbol.iterator]() { return this.iterateSync(); } - *iterateSync(t6 = this.cwd, e6 = {}) { - typeof t6 == "string" ? t6 = this.cwd.resolve(t6) : t6 instanceof R || (e6 = t6, t6 = this.cwd); - let { withFileTypes: s6 = true, follow: i6 = false, filter: r6, walkFilter: o6 } = e6; - (!r6 || r6(t6)) && (yield s6 ? t6 : t6.fullpath()); - let h6 = /* @__PURE__ */ new Set([t6]); + *iterateSync(t = this.cwd, e6 = {}) { + typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e6 = t, t = this.cwd); + let { withFileTypes: s = true, follow: i6 = false, filter: r6, walkFilter: o2 } = e6; + (!r6 || r6(t)) && (yield s ? t : t.fullpath()); + let h6 = /* @__PURE__ */ new Set([t]); for (let a6 of h6) { - let l6 = a6.readdirSync(); - for (let u6 of l6) { - (!r6 || r6(u6)) && (yield s6 ? u6 : u6.fullpath()); - let c6 = u6; - if (u6.isSymbolicLink()) { - if (!(i6 && (c6 = u6.realpathSync()))) continue; + let l3 = a6.readdirSync(); + for (let u of l3) { + (!r6 || r6(u)) && (yield s ? u : u.fullpath()); + let c6 = u; + if (u.isSymbolicLink()) { + if (!(i6 && (c6 = u.realpathSync()))) continue; c6.isUnknown() && c6.lstatSync(); } - c6.shouldWalk(h6, o6) && h6.add(c6); + c6.shouldWalk(h6, o2) && h6.add(c6); } } } - stream(t6 = this.cwd, e6 = {}) { - typeof t6 == "string" ? t6 = this.cwd.resolve(t6) : t6 instanceof R || (e6 = t6, t6 = this.cwd); - let { withFileTypes: s6 = true, follow: i6 = false, filter: r6, walkFilter: o6 } = e6, h6 = new V({ objectMode: true }); - (!r6 || r6(t6)) && h6.write(s6 ? t6 : t6.fullpath()); - let a6 = /* @__PURE__ */ new Set(), l6 = [t6], u6 = 0, c6 = () => { + stream(t = this.cwd, e6 = {}) { + typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e6 = t, t = this.cwd); + let { withFileTypes: s = true, follow: i6 = false, filter: r6, walkFilter: o2 } = e6, h6 = new V({ objectMode: true }); + (!r6 || r6(t)) && h6.write(s ? t : t.fullpath()); + let a6 = /* @__PURE__ */ new Set(), l3 = [t], u = 0, c6 = () => { let d6 = false; for (; !d6; ) { - let f6 = l6.shift(); + let f6 = l3.shift(); if (!f6) { - u6 === 0 && h6.end(); + u === 0 && h6.end(); return; } - u6++, a6.add(f6); - let m6 = (w5, g6, S = false) => { - if (w5) return h6.emit("error", w5); + u++, a6.add(f6); + let m3 = (w, g6, S = false) => { + if (w) return h6.emit("error", w); if (i6 && !S) { - let E2 = []; - for (let y2 of g6) y2.isSymbolicLink() && E2.push(y2.realpath().then((b6) => b6?.isUnknown() ? b6.lstat() : b6)); - if (E2.length) { - Promise.all(E2).then(() => m6(null, g6, true)); + let E = []; + for (let y of g6) y.isSymbolicLink() && E.push(y.realpath().then((b6) => b6?.isUnknown() ? b6.lstat() : b6)); + if (E.length) { + Promise.all(E).then(() => m3(null, g6, true)); return; } } - for (let E2 of g6) E2 && (!r6 || r6(E2)) && (h6.write(s6 ? E2 : E2.fullpath()) || (d6 = true)); - u6--; - for (let E2 of g6) { - let y2 = E2.realpathCached() || E2; - y2.shouldWalk(a6, o6) && l6.push(y2); + for (let E of g6) E && (!r6 || r6(E)) && (h6.write(s ? E : E.fullpath()) || (d6 = true)); + u--; + for (let E of g6) { + let y = E.realpathCached() || E; + y.shouldWalk(a6, o2) && l3.push(y); } - d6 && !h6.flowing ? h6.once("drain", c6) : p6 || c6(); - }, p6 = true; - f6.readdirCB(m6, true), p6 = false; + d6 && !h6.flowing ? h6.once("drain", c6) : p2 || c6(); + }, p2 = true; + f6.readdirCB(m3, true), p2 = false; } }; return c6(), h6; } - streamSync(t6 = this.cwd, e6 = {}) { - typeof t6 == "string" ? t6 = this.cwd.resolve(t6) : t6 instanceof R || (e6 = t6, t6 = this.cwd); - let { withFileTypes: s6 = true, follow: i6 = false, filter: r6, walkFilter: o6 } = e6, h6 = new V({ objectMode: true }), a6 = /* @__PURE__ */ new Set(); - (!r6 || r6(t6)) && h6.write(s6 ? t6 : t6.fullpath()); - let l6 = [t6], u6 = 0, c6 = () => { + streamSync(t = this.cwd, e6 = {}) { + typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e6 = t, t = this.cwd); + let { withFileTypes: s = true, follow: i6 = false, filter: r6, walkFilter: o2 } = e6, h6 = new V({ objectMode: true }), a6 = /* @__PURE__ */ new Set(); + (!r6 || r6(t)) && h6.write(s ? t : t.fullpath()); + let l3 = [t], u = 0, c6 = () => { let d6 = false; for (; !d6; ) { - let f6 = l6.shift(); + let f6 = l3.shift(); if (!f6) { - u6 === 0 && h6.end(); + u === 0 && h6.end(); return; } - u6++, a6.add(f6); - let m6 = f6.readdirSync(); - for (let p6 of m6) (!r6 || r6(p6)) && (h6.write(s6 ? p6 : p6.fullpath()) || (d6 = true)); - u6--; - for (let p6 of m6) { - let w5 = p6; - if (p6.isSymbolicLink()) { - if (!(i6 && (w5 = p6.realpathSync()))) continue; - w5.isUnknown() && w5.lstatSync(); + u++, a6.add(f6); + let m3 = f6.readdirSync(); + for (let p2 of m3) (!r6 || r6(p2)) && (h6.write(s ? p2 : p2.fullpath()) || (d6 = true)); + u--; + for (let p2 of m3) { + let w = p2; + if (p2.isSymbolicLink()) { + if (!(i6 && (w = p2.realpathSync()))) continue; + w.isUnknown() && w.lstatSync(); } - w5.shouldWalk(a6, o6) && l6.push(w5); + w.shouldWalk(a6, o2) && l3.push(w); } } d6 && !h6.flowing && h6.once("drain", c6); }; return c6(), h6; } - chdir(t6 = this.cwd) { + chdir(t = this.cwd) { let e6 = this.cwd; - this.cwd = typeof t6 == "string" ? this.cwd.resolve(t6) : t6, this.cwd[Ye](e6); + this.cwd = typeof t == "string" ? this.cwd.resolve(t) : t, this.cwd[Ye](e6); } }; var it = class extends It { sep = "\\"; - constructor(t6 = process.cwd(), e6 = {}) { - let { nocase: s6 = true } = e6; - super(t6, re, "\\", { ...e6, nocase: s6 }), this.nocase = s6; + constructor(t = process.cwd(), e6 = {}) { + let { nocase: s = true } = e6; + super(t, re, "\\", { ...e6, nocase: s }), this.nocase = s; for (let i6 = this.cwd; i6; i6 = i6.parent) i6.nocase = this.nocase; } - parseRootPath(t6) { - return re.parse(t6).root.toUpperCase(); + parseRootPath(t) { + return re.parse(t).root.toUpperCase(); } - newRoot(t6) { - return new Pt(this.rootPath, U, void 0, this.roots, this.nocase, this.childrenCache(), { fs: t6 }); + newRoot(t) { + return new Pt(this.rootPath, U, void 0, this.roots, this.nocase, this.childrenCache(), { fs: t }); } - isAbsolute(t6) { - return t6.startsWith("/") || t6.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(t6); + isAbsolute(t) { + return t.startsWith("/") || t.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(t); } }; var rt = class extends It { sep = "/"; - constructor(t6 = process.cwd(), e6 = {}) { - let { nocase: s6 = false } = e6; - super(t6, mi, "/", { ...e6, nocase: s6 }), this.nocase = s6; + constructor(t = process.cwd(), e6 = {}) { + let { nocase: s = false } = e6; + super(t, mi, "/", { ...e6, nocase: s }), this.nocase = s; } - parseRootPath(t6) { + parseRootPath(t) { return "/"; } - newRoot(t6) { - return new jt(this.rootPath, U, void 0, this.roots, this.nocase, this.childrenCache(), { fs: t6 }); + newRoot(t) { + return new jt(this.rootPath, U, void 0, this.roots, this.nocase, this.childrenCache(), { fs: t }); } - isAbsolute(t6) { - return t6.startsWith("/"); + isAbsolute(t) { + return t.startsWith("/"); } }; var St = class extends rt { - constructor(t6 = process.cwd(), e6 = {}) { - let { nocase: s6 = true } = e6; - super(t6, { ...e6, nocase: s6 }); + constructor(t = process.cwd(), e6 = {}) { + let { nocase: s = true } = e6; + super(t, { ...e6, nocase: s }); } }; var Cr = process.platform === "win32" ? Pt : jt; var Xe = process.platform === "win32" ? it : process.platform === "darwin" ? St : rt; -var Di = (n12) => n12.length >= 1; -var Mi = (n12) => n12.length >= 1; +var Di = (n8) => n8.length >= 1; +var Mi = (n8) => n8.length >= 1; var Ni = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"); var nt = class n4 { #t; @@ -181837,22 +186347,22 @@ var nt = class n4 { #c; #h; #u = true; - constructor(t6, e6, s6, i6) { - if (!Di(t6)) throw new TypeError("empty pattern list"); + constructor(t, e6, s, i6) { + if (!Di(t)) throw new TypeError("empty pattern list"); if (!Mi(e6)) throw new TypeError("empty glob list"); - if (e6.length !== t6.length) throw new TypeError("mismatched pattern list and glob list lengths"); - if (this.length = t6.length, s6 < 0 || s6 >= this.length) throw new TypeError("index out of range"); - if (this.#t = t6, this.#s = e6, this.#n = s6, this.#r = i6, this.#n === 0) { + if (e6.length !== t.length) throw new TypeError("mismatched pattern list and glob list lengths"); + if (this.length = t.length, s < 0 || s >= this.length) throw new TypeError("index out of range"); + if (this.#t = t, this.#s = e6, this.#n = s, this.#r = i6, this.#n === 0) { if (this.isUNC()) { - let [r6, o6, h6, a6, ...l6] = this.#t, [u6, c6, d6, f6, ...m6] = this.#s; - l6[0] === "" && (l6.shift(), m6.shift()); - let p6 = [r6, o6, h6, a6, ""].join("/"), w5 = [u6, c6, d6, f6, ""].join("/"); - this.#t = [p6, ...l6], this.#s = [w5, ...m6], this.length = this.#t.length; + let [r6, o2, h6, a6, ...l3] = this.#t, [u, c6, d6, f6, ...m3] = this.#s; + l3[0] === "" && (l3.shift(), m3.shift()); + let p2 = [r6, o2, h6, a6, ""].join("/"), w = [u, c6, d6, f6, ""].join("/"); + this.#t = [p2, ...l3], this.#s = [w, ...m3], this.length = this.#t.length; } else if (this.isDrive() || this.isAbsolute()) { - let [r6, ...o6] = this.#t, [h6, ...a6] = this.#s; - o6[0] === "" && (o6.shift(), a6.shift()); - let l6 = r6 + "/", u6 = h6 + "/"; - this.#t = [l6, ...o6], this.#s = [u6, ...a6], this.length = this.#t.length; + let [r6, ...o2] = this.#t, [h6, ...a6] = this.#s; + o2[0] === "" && (o2.shift(), a6.shift()); + let l3 = r6 + "/", u = h6 + "/"; + this.#t = [l3, ...o2], this.#s = [u, ...a6], this.length = this.#t.length; } } } @@ -181881,20 +186391,20 @@ var nt = class n4 { return this.#o !== void 0 ? this.#o : this.hasMore() ? (this.#o = new n4(this.#t, this.#s, this.#n + 1, this.#r), this.#o.#h = this.#h, this.#o.#c = this.#c, this.#o.#w = this.#w, this.#o) : this.#o = null; } isUNC() { - let t6 = this.#t; - return this.#c !== void 0 ? this.#c : this.#c = this.#r === "win32" && this.#n === 0 && t6[0] === "" && t6[1] === "" && typeof t6[2] == "string" && !!t6[2] && typeof t6[3] == "string" && !!t6[3]; + let t = this.#t; + return this.#c !== void 0 ? this.#c : this.#c = this.#r === "win32" && this.#n === 0 && t[0] === "" && t[1] === "" && typeof t[2] == "string" && !!t[2] && typeof t[3] == "string" && !!t[3]; } isDrive() { - let t6 = this.#t; - return this.#w !== void 0 ? this.#w : this.#w = this.#r === "win32" && this.#n === 0 && this.length > 1 && typeof t6[0] == "string" && /^[a-z]:$/i.test(t6[0]); + let t = this.#t; + return this.#w !== void 0 ? this.#w : this.#w = this.#r === "win32" && this.#n === 0 && this.length > 1 && typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]); } isAbsolute() { - let t6 = this.#t; - return this.#h !== void 0 ? this.#h : this.#h = t6[0] === "" && t6.length > 1 || this.isDrive() || this.isUNC(); + let t = this.#t; + return this.#h !== void 0 ? this.#h : this.#h = t[0] === "" && t.length > 1 || this.isDrive() || this.isUNC(); } root() { - let t6 = this.#t[0]; - return typeof t6 == "string" && this.isAbsolute() && this.#n === 0 ? t6 : ""; + let t = this.#t[0]; + return typeof t == "string" && this.isAbsolute() && this.#n === 0 ? t : ""; } checkFollowGlobstar() { return !(this.#n === 0 || !this.isGlobstar() || !this.#u); @@ -181911,76 +186421,76 @@ var ot = class { absoluteChildren; platform; mmopts; - constructor(t6, { nobrace: e6, nocase: s6, noext: i6, noglobstar: r6, platform: o6 = _i }) { - this.relative = [], this.absolute = [], this.relativeChildren = [], this.absoluteChildren = [], this.platform = o6, this.mmopts = { dot: true, nobrace: e6, nocase: s6, noext: i6, noglobstar: r6, optimizationLevel: 2, platform: o6, nocomment: true, nonegate: true }; - for (let h6 of t6) this.add(h6); - } - add(t6) { - let e6 = new D(t6, this.mmopts); - for (let s6 = 0; s6 < e6.set.length; s6++) { - let i6 = e6.set[s6], r6 = e6.globParts[s6]; + constructor(t, { nobrace: e6, nocase: s, noext: i6, noglobstar: r6, platform: o2 = _i }) { + this.relative = [], this.absolute = [], this.relativeChildren = [], this.absoluteChildren = [], this.platform = o2, this.mmopts = { dot: true, nobrace: e6, nocase: s, noext: i6, noglobstar: r6, optimizationLevel: 2, platform: o2, nocomment: true, nonegate: true }; + for (let h6 of t) this.add(h6); + } + add(t) { + let e6 = new D(t, this.mmopts); + for (let s = 0; s < e6.set.length; s++) { + let i6 = e6.set[s], r6 = e6.globParts[s]; if (!i6 || !r6) throw new Error("invalid pattern object"); for (; i6[0] === "." && r6[0] === "."; ) i6.shift(), r6.shift(); - let o6 = new nt(i6, r6, 0, this.platform), h6 = new D(o6.globString(), this.mmopts), a6 = r6[r6.length - 1] === "**", l6 = o6.isAbsolute(); - l6 ? this.absolute.push(h6) : this.relative.push(h6), a6 && (l6 ? this.absoluteChildren.push(h6) : this.relativeChildren.push(h6)); + let o2 = new nt(i6, r6, 0, this.platform), h6 = new D(o2.globString(), this.mmopts), a6 = r6[r6.length - 1] === "**", l3 = o2.isAbsolute(); + l3 ? this.absolute.push(h6) : this.relative.push(h6), a6 && (l3 ? this.absoluteChildren.push(h6) : this.relativeChildren.push(h6)); } } - ignored(t6) { - let e6 = t6.fullpath(), s6 = `${e6}/`, i6 = t6.relative() || ".", r6 = `${i6}/`; - for (let o6 of this.relative) if (o6.match(i6) || o6.match(r6)) return true; - for (let o6 of this.absolute) if (o6.match(e6) || o6.match(s6)) return true; + ignored(t) { + let e6 = t.fullpath(), s = `${e6}/`, i6 = t.relative() || ".", r6 = `${i6}/`; + for (let o2 of this.relative) if (o2.match(i6) || o2.match(r6)) return true; + for (let o2 of this.absolute) if (o2.match(e6) || o2.match(s)) return true; return false; } - childrenIgnored(t6) { - let e6 = t6.fullpath() + "/", s6 = (t6.relative() || ".") + "/"; - for (let i6 of this.relativeChildren) if (i6.match(s6)) return true; + childrenIgnored(t) { + let e6 = t.fullpath() + "/", s = (t.relative() || ".") + "/"; + for (let i6 of this.relativeChildren) if (i6.match(s)) return true; for (let i6 of this.absoluteChildren) if (i6.match(e6)) return true; return false; } }; var oe = class n5 { store; - constructor(t6 = /* @__PURE__ */ new Map()) { - this.store = t6; + constructor(t = /* @__PURE__ */ new Map()) { + this.store = t; } copy() { return new n5(new Map(this.store)); } - hasWalked(t6, e6) { - return this.store.get(t6.fullpath())?.has(e6.globString()); + hasWalked(t, e6) { + return this.store.get(t.fullpath())?.has(e6.globString()); } - storeWalked(t6, e6) { - let s6 = t6.fullpath(), i6 = this.store.get(s6); - i6 ? i6.add(e6.globString()) : this.store.set(s6, /* @__PURE__ */ new Set([e6.globString()])); + storeWalked(t, e6) { + let s = t.fullpath(), i6 = this.store.get(s); + i6 ? i6.add(e6.globString()) : this.store.set(s, /* @__PURE__ */ new Set([e6.globString()])); } }; var he = class { store = /* @__PURE__ */ new Map(); - add(t6, e6, s6) { - let i6 = (e6 ? 2 : 0) | (s6 ? 1 : 0), r6 = this.store.get(t6); - this.store.set(t6, r6 === void 0 ? i6 : i6 & r6); + add(t, e6, s) { + let i6 = (e6 ? 2 : 0) | (s ? 1 : 0), r6 = this.store.get(t); + this.store.set(t, r6 === void 0 ? i6 : i6 & r6); } entries() { - return [...this.store.entries()].map(([t6, e6]) => [t6, !!(e6 & 2), !!(e6 & 1)]); + return [...this.store.entries()].map(([t, e6]) => [t, !!(e6 & 2), !!(e6 & 1)]); } }; var ae = class { store = /* @__PURE__ */ new Map(); - add(t6, e6) { - if (!t6.canReaddir()) return; - let s6 = this.store.get(t6); - s6 ? s6.find((i6) => i6.globString() === e6.globString()) || s6.push(e6) : this.store.set(t6, [e6]); + add(t, e6) { + if (!t.canReaddir()) return; + let s = this.store.get(t); + s ? s.find((i6) => i6.globString() === e6.globString()) || s.push(e6) : this.store.set(t, [e6]); } - get(t6) { - let e6 = this.store.get(t6); + get(t) { + let e6 = this.store.get(t); if (!e6) throw new Error("attempting to walk unknown path"); return e6; } entries() { - return this.keys().map((t6) => [t6, this.store.get(t6)]); + return this.keys().map((t) => [t, this.store.get(t)]); } keys() { - return [...this.store.keys()].filter((t6) => t6.canReaddir()); + return [...this.store.keys()].filter((t) => t.canReaddir()); } }; var Et = class n6 { @@ -181991,17 +186501,17 @@ var Et = class n6 { follow; dot; opts; - constructor(t6, e6) { - this.opts = t6, this.follow = !!t6.follow, this.dot = !!t6.dot, this.hasWalkedCache = e6 ? e6.copy() : new oe(); + constructor(t, e6) { + this.opts = t, this.follow = !!t.follow, this.dot = !!t.dot, this.hasWalkedCache = e6 ? e6.copy() : new oe(); } - processPatterns(t6, e6) { + processPatterns(t, e6) { this.patterns = e6; - let s6 = e6.map((i6) => [t6, i6]); - for (let [i6, r6] of s6) { + let s = e6.map((i6) => [t, i6]); + for (let [i6, r6] of s) { this.hasWalkedCache.storeWalked(i6, r6); - let o6 = r6.root(), h6 = r6.isAbsolute() && this.opts.absolute !== false; - if (o6) { - i6 = i6.resolve(o6 === "/" && this.opts.root !== void 0 ? this.opts.root : o6); + let o2 = r6.root(), h6 = r6.isAbsolute() && this.opts.absolute !== false; + if (o2) { + i6 = i6.resolve(o2 === "/" && this.opts.root !== void 0 ? this.opts.root : o2); let c6 = r6.rest(); if (c6) r6 = c6; else { @@ -182010,9 +186520,9 @@ var Et = class n6 { } } if (i6.isENOENT()) continue; - let a6, l6, u6 = false; - for (; typeof (a6 = r6.pattern()) == "string" && (l6 = r6.rest()); ) i6 = i6.resolve(a6), r6 = l6, u6 = true; - if (a6 = r6.pattern(), l6 = r6.rest(), u6) { + let a6, l3, u = false; + for (; typeof (a6 = r6.pattern()) == "string" && (l3 = r6.rest()); ) i6 = i6.resolve(a6), r6 = l3, u = true; + if (a6 = r6.pattern(), l3 = r6.rest(), u) { if (this.hasWalkedCache.hasWalked(i6, r6)) continue; this.hasWalkedCache.storeWalked(i6, r6); } @@ -182022,8 +186532,8 @@ var Et = class n6 { continue; } else if (a6 === A) { (!i6.isSymbolicLink() || this.follow || r6.checkFollowGlobstar()) && this.subwalks.add(i6, r6); - let c6 = l6?.pattern(), d6 = l6?.rest(); - if (!l6 || (c6 === "" || c6 === ".") && !d6) this.matches.add(i6, h6, c6 === "" || c6 === "."); + let c6 = l3?.pattern(), d6 = l3?.rest(); + if (!l3 || (c6 === "" || c6 === ".") && !d6) this.matches.add(i6, h6, c6 === "" || c6 === "."); else if (c6 === "..") { let f6 = i6.parent || i6; d6 ? this.hasWalkedCache.hasWalked(f6, d6) || this.subwalks.add(f6, d6) : this.matches.add(f6, h6, true); @@ -182038,32 +186548,32 @@ var Et = class n6 { child() { return new n6(this.opts, this.hasWalkedCache); } - filterEntries(t6, e6) { - let s6 = this.subwalks.get(t6), i6 = this.child(); - for (let r6 of e6) for (let o6 of s6) { - let h6 = o6.isAbsolute(), a6 = o6.pattern(), l6 = o6.rest(); - a6 === A ? i6.testGlobstar(r6, o6, l6, h6) : a6 instanceof RegExp ? i6.testRegExp(r6, a6, l6, h6) : i6.testString(r6, a6, l6, h6); + filterEntries(t, e6) { + let s = this.subwalks.get(t), i6 = this.child(); + for (let r6 of e6) for (let o2 of s) { + let h6 = o2.isAbsolute(), a6 = o2.pattern(), l3 = o2.rest(); + a6 === A ? i6.testGlobstar(r6, o2, l3, h6) : a6 instanceof RegExp ? i6.testRegExp(r6, a6, l3, h6) : i6.testString(r6, a6, l3, h6); } return i6; } - testGlobstar(t6, e6, s6, i6) { - if ((this.dot || !t6.name.startsWith(".")) && (e6.hasMore() || this.matches.add(t6, i6, false), t6.canReaddir() && (this.follow || !t6.isSymbolicLink() ? this.subwalks.add(t6, e6) : t6.isSymbolicLink() && (s6 && e6.checkFollowGlobstar() ? this.subwalks.add(t6, s6) : e6.markFollowGlobstar() && this.subwalks.add(t6, e6)))), s6) { - let r6 = s6.pattern(); - if (typeof r6 == "string" && r6 !== ".." && r6 !== "" && r6 !== ".") this.testString(t6, r6, s6.rest(), i6); + testGlobstar(t, e6, s, i6) { + if ((this.dot || !t.name.startsWith(".")) && (e6.hasMore() || this.matches.add(t, i6, false), t.canReaddir() && (this.follow || !t.isSymbolicLink() ? this.subwalks.add(t, e6) : t.isSymbolicLink() && (s && e6.checkFollowGlobstar() ? this.subwalks.add(t, s) : e6.markFollowGlobstar() && this.subwalks.add(t, e6)))), s) { + let r6 = s.pattern(); + if (typeof r6 == "string" && r6 !== ".." && r6 !== "" && r6 !== ".") this.testString(t, r6, s.rest(), i6); else if (r6 === "..") { - let o6 = t6.parent || t6; - this.subwalks.add(o6, s6); - } else r6 instanceof RegExp && this.testRegExp(t6, r6, s6.rest(), i6); + let o2 = t.parent || t; + this.subwalks.add(o2, s); + } else r6 instanceof RegExp && this.testRegExp(t, r6, s.rest(), i6); } } - testRegExp(t6, e6, s6, i6) { - e6.test(t6.name) && (s6 ? this.subwalks.add(t6, s6) : this.matches.add(t6, i6, false)); + testRegExp(t, e6, s, i6) { + e6.test(t.name) && (s ? this.subwalks.add(t, s) : this.matches.add(t, i6, false)); } - testString(t6, e6, s6, i6) { - t6.isNamed(e6) && (s6 ? this.subwalks.add(t6, s6) : this.matches.add(t6, i6, false)); + testString(t, e6, s, i6) { + t.isNamed(e6) && (s ? this.subwalks.add(t, s) : this.matches.add(t, i6, false)); } }; -var Li = (n12, t6) => typeof n12 == "string" ? new ot([n12], t6) : Array.isArray(n12) ? new ot(n12, t6) : n12; +var Li = (n8, t) => typeof n8 == "string" ? new ot([n8], t) : Array.isArray(n8) ? new ot(n8, t) : n8; var zt = class { path; patterns; @@ -182077,20 +186587,20 @@ var zt = class { signal; maxDepth; includeChildMatches; - constructor(t6, e6, s6) { - if (this.patterns = t6, this.path = e6, this.opts = s6, this.#n = !s6.posix && s6.platform === "win32" ? "\\" : "/", this.includeChildMatches = s6.includeChildMatches !== false, (s6.ignore || !this.includeChildMatches) && (this.#s = Li(s6.ignore ?? [], s6), !this.includeChildMatches && typeof this.#s.add != "function")) { + constructor(t, e6, s) { + if (this.patterns = t, this.path = e6, this.opts = s, this.#n = !s.posix && s.platform === "win32" ? "\\" : "/", this.includeChildMatches = s.includeChildMatches !== false, (s.ignore || !this.includeChildMatches) && (this.#s = Li(s.ignore ?? [], s), !this.includeChildMatches && typeof this.#s.add != "function")) { let i6 = "cannot ignore child matches, ignore lacks add() method."; throw new Error(i6); } - this.maxDepth = s6.maxDepth || 1 / 0, s6.signal && (this.signal = s6.signal, this.signal.addEventListener("abort", () => { + this.maxDepth = s.maxDepth || 1 / 0, s.signal && (this.signal = s.signal, this.signal.addEventListener("abort", () => { this.#t.length = 0; })); } - #r(t6) { - return this.seen.has(t6) || !!this.#s?.ignored?.(t6); + #r(t) { + return this.seen.has(t) || !!this.#s?.ignored?.(t); } - #o(t6) { - return !!this.#s?.childrenIgnored?.(t6); + #o(t) { + return !!this.#s?.childrenIgnored?.(t); } pause() { this.paused = true; @@ -182098,145 +186608,145 @@ var zt = class { resume() { if (this.signal?.aborted) return; this.paused = false; - let t6; - for (; !this.paused && (t6 = this.#t.shift()); ) t6(); + let t; + for (; !this.paused && (t = this.#t.shift()); ) t(); } - onResume(t6) { - this.signal?.aborted || (this.paused ? this.#t.push(t6) : t6()); + onResume(t) { + this.signal?.aborted || (this.paused ? this.#t.push(t) : t()); } - async matchCheck(t6, e6) { + async matchCheck(t, e6) { if (e6 && this.opts.nodir) return; - let s6; + let s; if (this.opts.realpath) { - if (s6 = t6.realpathCached() || await t6.realpath(), !s6) return; - t6 = s6; + if (s = t.realpathCached() || await t.realpath(), !s) return; + t = s; } - let r6 = t6.isUnknown() || this.opts.stat ? await t6.lstat() : t6; + let r6 = t.isUnknown() || this.opts.stat ? await t.lstat() : t; if (this.opts.follow && this.opts.nodir && r6?.isSymbolicLink()) { - let o6 = await r6.realpath(); - o6 && (o6.isUnknown() || this.opts.stat) && await o6.lstat(); + let o2 = await r6.realpath(); + o2 && (o2.isUnknown() || this.opts.stat) && await o2.lstat(); } return this.matchCheckTest(r6, e6); } - matchCheckTest(t6, e6) { - return t6 && (this.maxDepth === 1 / 0 || t6.depth() <= this.maxDepth) && (!e6 || t6.canReaddir()) && (!this.opts.nodir || !t6.isDirectory()) && (!this.opts.nodir || !this.opts.follow || !t6.isSymbolicLink() || !t6.realpathCached()?.isDirectory()) && !this.#r(t6) ? t6 : void 0; + matchCheckTest(t, e6) { + return t && (this.maxDepth === 1 / 0 || t.depth() <= this.maxDepth) && (!e6 || t.canReaddir()) && (!this.opts.nodir || !t.isDirectory()) && (!this.opts.nodir || !this.opts.follow || !t.isSymbolicLink() || !t.realpathCached()?.isDirectory()) && !this.#r(t) ? t : void 0; } - matchCheckSync(t6, e6) { + matchCheckSync(t, e6) { if (e6 && this.opts.nodir) return; - let s6; + let s; if (this.opts.realpath) { - if (s6 = t6.realpathCached() || t6.realpathSync(), !s6) return; - t6 = s6; + if (s = t.realpathCached() || t.realpathSync(), !s) return; + t = s; } - let r6 = t6.isUnknown() || this.opts.stat ? t6.lstatSync() : t6; + let r6 = t.isUnknown() || this.opts.stat ? t.lstatSync() : t; if (this.opts.follow && this.opts.nodir && r6?.isSymbolicLink()) { - let o6 = r6.realpathSync(); - o6 && (o6?.isUnknown() || this.opts.stat) && o6.lstatSync(); + let o2 = r6.realpathSync(); + o2 && (o2?.isUnknown() || this.opts.stat) && o2.lstatSync(); } return this.matchCheckTest(r6, e6); } - matchFinish(t6, e6) { - if (this.#r(t6)) return; + matchFinish(t, e6) { + if (this.#r(t)) return; if (!this.includeChildMatches && this.#s?.add) { - let r6 = `${t6.relativePosix()}/**`; + let r6 = `${t.relativePosix()}/**`; this.#s.add(r6); } - let s6 = this.opts.absolute === void 0 ? e6 : this.opts.absolute; - this.seen.add(t6); - let i6 = this.opts.mark && t6.isDirectory() ? this.#n : ""; - if (this.opts.withFileTypes) this.matchEmit(t6); - else if (s6) { - let r6 = this.opts.posix ? t6.fullpathPosix() : t6.fullpath(); + let s = this.opts.absolute === void 0 ? e6 : this.opts.absolute; + this.seen.add(t); + let i6 = this.opts.mark && t.isDirectory() ? this.#n : ""; + if (this.opts.withFileTypes) this.matchEmit(t); + else if (s) { + let r6 = this.opts.posix ? t.fullpathPosix() : t.fullpath(); this.matchEmit(r6 + i6); } else { - let r6 = this.opts.posix ? t6.relativePosix() : t6.relative(), o6 = this.opts.dotRelative && !r6.startsWith(".." + this.#n) ? "." + this.#n : ""; - this.matchEmit(r6 ? o6 + r6 + i6 : "." + i6); + let r6 = this.opts.posix ? t.relativePosix() : t.relative(), o2 = this.opts.dotRelative && !r6.startsWith(".." + this.#n) ? "." + this.#n : ""; + this.matchEmit(r6 ? o2 + r6 + i6 : "." + i6); } } - async match(t6, e6, s6) { - let i6 = await this.matchCheck(t6, s6); + async match(t, e6, s) { + let i6 = await this.matchCheck(t, s); i6 && this.matchFinish(i6, e6); } - matchSync(t6, e6, s6) { - let i6 = this.matchCheckSync(t6, s6); + matchSync(t, e6, s) { + let i6 = this.matchCheckSync(t, s); i6 && this.matchFinish(i6, e6); } - walkCB(t6, e6, s6) { - this.signal?.aborted && s6(), this.walkCB2(t6, e6, new Et(this.opts), s6); + walkCB(t, e6, s) { + this.signal?.aborted && s(), this.walkCB2(t, e6, new Et(this.opts), s); } - walkCB2(t6, e6, s6, i6) { - if (this.#o(t6)) return i6(); + walkCB2(t, e6, s, i6) { + if (this.#o(t)) return i6(); if (this.signal?.aborted && i6(), this.paused) { - this.onResume(() => this.walkCB2(t6, e6, s6, i6)); + this.onResume(() => this.walkCB2(t, e6, s, i6)); return; } - s6.processPatterns(t6, e6); - let r6 = 1, o6 = () => { + s.processPatterns(t, e6); + let r6 = 1, o2 = () => { --r6 === 0 && i6(); }; - for (let [h6, a6, l6] of s6.matches.entries()) this.#r(h6) || (r6++, this.match(h6, a6, l6).then(() => o6())); - for (let h6 of s6.subwalkTargets()) { + for (let [h6, a6, l3] of s.matches.entries()) this.#r(h6) || (r6++, this.match(h6, a6, l3).then(() => o2())); + for (let h6 of s.subwalkTargets()) { if (this.maxDepth !== 1 / 0 && h6.depth() >= this.maxDepth) continue; r6++; let a6 = h6.readdirCached(); - h6.calledReaddir() ? this.walkCB3(h6, a6, s6, o6) : h6.readdirCB((l6, u6) => this.walkCB3(h6, u6, s6, o6), true); + h6.calledReaddir() ? this.walkCB3(h6, a6, s, o2) : h6.readdirCB((l3, u) => this.walkCB3(h6, u, s, o2), true); } - o6(); + o2(); } - walkCB3(t6, e6, s6, i6) { - s6 = s6.filterEntries(t6, e6); - let r6 = 1, o6 = () => { + walkCB3(t, e6, s, i6) { + s = s.filterEntries(t, e6); + let r6 = 1, o2 = () => { --r6 === 0 && i6(); }; - for (let [h6, a6, l6] of s6.matches.entries()) this.#r(h6) || (r6++, this.match(h6, a6, l6).then(() => o6())); - for (let [h6, a6] of s6.subwalks.entries()) r6++, this.walkCB2(h6, a6, s6.child(), o6); - o6(); + for (let [h6, a6, l3] of s.matches.entries()) this.#r(h6) || (r6++, this.match(h6, a6, l3).then(() => o2())); + for (let [h6, a6] of s.subwalks.entries()) r6++, this.walkCB2(h6, a6, s.child(), o2); + o2(); } - walkCBSync(t6, e6, s6) { - this.signal?.aborted && s6(), this.walkCB2Sync(t6, e6, new Et(this.opts), s6); + walkCBSync(t, e6, s) { + this.signal?.aborted && s(), this.walkCB2Sync(t, e6, new Et(this.opts), s); } - walkCB2Sync(t6, e6, s6, i6) { - if (this.#o(t6)) return i6(); + walkCB2Sync(t, e6, s, i6) { + if (this.#o(t)) return i6(); if (this.signal?.aborted && i6(), this.paused) { - this.onResume(() => this.walkCB2Sync(t6, e6, s6, i6)); + this.onResume(() => this.walkCB2Sync(t, e6, s, i6)); return; } - s6.processPatterns(t6, e6); - let r6 = 1, o6 = () => { + s.processPatterns(t, e6); + let r6 = 1, o2 = () => { --r6 === 0 && i6(); }; - for (let [h6, a6, l6] of s6.matches.entries()) this.#r(h6) || this.matchSync(h6, a6, l6); - for (let h6 of s6.subwalkTargets()) { + for (let [h6, a6, l3] of s.matches.entries()) this.#r(h6) || this.matchSync(h6, a6, l3); + for (let h6 of s.subwalkTargets()) { if (this.maxDepth !== 1 / 0 && h6.depth() >= this.maxDepth) continue; r6++; let a6 = h6.readdirSync(); - this.walkCB3Sync(h6, a6, s6, o6); + this.walkCB3Sync(h6, a6, s, o2); } - o6(); + o2(); } - walkCB3Sync(t6, e6, s6, i6) { - s6 = s6.filterEntries(t6, e6); - let r6 = 1, o6 = () => { + walkCB3Sync(t, e6, s, i6) { + s = s.filterEntries(t, e6); + let r6 = 1, o2 = () => { --r6 === 0 && i6(); }; - for (let [h6, a6, l6] of s6.matches.entries()) this.#r(h6) || this.matchSync(h6, a6, l6); - for (let [h6, a6] of s6.subwalks.entries()) r6++, this.walkCB2Sync(h6, a6, s6.child(), o6); - o6(); + for (let [h6, a6, l3] of s.matches.entries()) this.#r(h6) || this.matchSync(h6, a6, l3); + for (let [h6, a6] of s.subwalks.entries()) r6++, this.walkCB2Sync(h6, a6, s.child(), o2); + o2(); } }; var xt = class extends zt { matches = /* @__PURE__ */ new Set(); - constructor(t6, e6, s6) { - super(t6, e6, s6); + constructor(t, e6, s) { + super(t, e6, s); } - matchEmit(t6) { - this.matches.add(t6); + matchEmit(t) { + this.matches.add(t); } async walk() { if (this.signal?.aborted) throw this.signal.reason; - return this.path.isUnknown() && await this.path.lstat(), await new Promise((t6, e6) => { + return this.path.isUnknown() && await this.path.lstat(), await new Promise((t, e6) => { this.walkCB(this.path, this.patterns, () => { - this.signal?.aborted ? e6(this.signal.reason) : t6(this.matches); + this.signal?.aborted ? e6(this.signal.reason) : t(this.matches); }); }), this.matches; } @@ -182249,17 +186759,17 @@ var xt = class extends zt { }; var vt = class extends zt { results; - constructor(t6, e6, s6) { - super(t6, e6, s6), this.results = new V({ signal: this.signal, objectMode: true }), this.results.on("drain", () => this.resume()), this.results.on("resume", () => this.resume()); + constructor(t, e6, s) { + super(t, e6, s), this.results = new V({ signal: this.signal, objectMode: true }), this.results.on("drain", () => this.resume()), this.results.on("resume", () => this.resume()); } - matchEmit(t6) { - this.results.write(t6), this.results.flowing || this.pause(); + matchEmit(t) { + this.results.write(t), this.results.flowing || this.pause(); } stream() { - let t6 = this.path; - return t6.isUnknown() ? t6.lstat().then(() => { - this.walkCB(t6, this.patterns, () => this.results.end()); - }) : this.walkCB(t6, this.patterns, () => this.results.end()), this.results; + let t = this.path; + return t.isUnknown() ? t.lstat().then(() => { + this.walkCB(t, this.patterns, () => this.results.end()); + }) : this.walkCB(t, this.patterns, () => this.results.end()), this.results; } streamSync() { return this.path.isUnknown() && this.path.lstatSync(), this.walkCBSync(this.path, this.patterns, () => this.results.end()), this.results; @@ -182294,25 +186804,25 @@ var I = class { includeChildMatches; opts; patterns; - constructor(t6, e6) { + constructor(t, e6) { if (!e6) throw new TypeError("glob options required"); if (this.withFileTypes = !!e6.withFileTypes, this.signal = e6.signal, this.follow = !!e6.follow, this.dot = !!e6.dot, this.dotRelative = !!e6.dotRelative, this.nodir = !!e6.nodir, this.mark = !!e6.mark, e6.cwd ? (e6.cwd instanceof URL || e6.cwd.startsWith("file://")) && (e6.cwd = Wi(e6.cwd)) : this.cwd = "", this.cwd = e6.cwd || "", this.root = e6.root, this.magicalBraces = !!e6.magicalBraces, this.nobrace = !!e6.nobrace, this.noext = !!e6.noext, this.realpath = !!e6.realpath, this.absolute = e6.absolute, this.includeChildMatches = e6.includeChildMatches !== false, this.noglobstar = !!e6.noglobstar, this.matchBase = !!e6.matchBase, this.maxDepth = typeof e6.maxDepth == "number" ? e6.maxDepth : 1 / 0, this.stat = !!e6.stat, this.ignore = e6.ignore, this.withFileTypes && this.absolute !== void 0) throw new Error("cannot set absolute and withFileTypes:true"); - if (typeof t6 == "string" && (t6 = [t6]), this.windowsPathsNoEscape = !!e6.windowsPathsNoEscape || e6.allowWindowsEscape === false, this.windowsPathsNoEscape && (t6 = t6.map((a6) => a6.replace(/\\/g, "/"))), this.matchBase) { + if (typeof t == "string" && (t = [t]), this.windowsPathsNoEscape = !!e6.windowsPathsNoEscape || e6.allowWindowsEscape === false, this.windowsPathsNoEscape && (t = t.map((a6) => a6.replace(/\\/g, "/"))), this.matchBase) { if (e6.noglobstar) throw new TypeError("base matching requires globstar"); - t6 = t6.map((a6) => a6.includes("/") ? a6 : `./**/${a6}`); + t = t.map((a6) => a6.includes("/") ? a6 : `./**/${a6}`); } - if (this.pattern = t6, this.platform = e6.platform || Pi, this.opts = { ...e6, platform: this.platform }, e6.scurry) { + if (this.pattern = t, this.platform = e6.platform || Pi, this.opts = { ...e6, platform: this.platform }, e6.scurry) { if (this.scurry = e6.scurry, e6.nocase !== void 0 && e6.nocase !== e6.scurry.nocase) throw new Error("nocase option contradicts provided scurry option"); } else { let a6 = e6.platform === "win32" ? it : e6.platform === "darwin" ? St : e6.platform ? rt : Xe; this.scurry = new a6(this.cwd, { nocase: e6.nocase, fs: e6.fs }); } this.nocase = this.scurry.nocase; - let s6 = this.platform === "darwin" || this.platform === "win32", i6 = { braceExpandMax: 1e4, ...e6, dot: this.dot, matchBase: this.matchBase, nobrace: this.nobrace, nocase: this.nocase, nocaseMagicOnly: s6, nocomment: true, noext: this.noext, nonegate: true, optimizationLevel: 2, platform: this.platform, windowsPathsNoEscape: this.windowsPathsNoEscape, debug: !!this.opts.debug }, r6 = this.pattern.map((a6) => new D(a6, i6)), [o6, h6] = r6.reduce((a6, l6) => (a6[0].push(...l6.set), a6[1].push(...l6.globParts), a6), [[], []]); - this.patterns = o6.map((a6, l6) => { - let u6 = h6[l6]; - if (!u6) throw new Error("invalid pattern object"); - return new nt(a6, u6, 0, this.platform); + let s = this.platform === "darwin" || this.platform === "win32", i6 = { braceExpandMax: 1e4, ...e6, dot: this.dot, matchBase: this.matchBase, nobrace: this.nobrace, nocase: this.nocase, nocaseMagicOnly: s, nocomment: true, noext: this.noext, nonegate: true, optimizationLevel: 2, platform: this.platform, windowsPathsNoEscape: this.windowsPathsNoEscape, debug: !!this.opts.debug }, r6 = this.pattern.map((a6) => new D(a6, i6)), [o2, h6] = r6.reduce((a6, l3) => (a6[0].push(...l3.set), a6[1].push(...l3.globParts), a6), [[], []]); + this.patterns = o2.map((a6, l3) => { + let u = h6[l3]; + if (!u) throw new Error("invalid pattern object"); + return new nt(a6, u, 0, this.platform); }); } async walk() { @@ -182340,28 +186850,28 @@ var I = class { return this.iterate(); } }; -var le = (n12, t6 = {}) => { - Array.isArray(n12) || (n12 = [n12]); - for (let e6 of n12) if (new D(e6, t6).hasMagic()) return true; +var le = (n8, t = {}) => { + Array.isArray(n8) || (n8 = [n8]); + for (let e6 of n8) if (new D(e6, t).hasMagic()) return true; return false; }; -function Bt(n12, t6 = {}) { - return new I(n12, t6).streamSync(); +function Bt(n8, t = {}) { + return new I(n8, t).streamSync(); } -function Qe(n12, t6 = {}) { - return new I(n12, t6).stream(); +function Qe(n8, t = {}) { + return new I(n8, t).stream(); } -function ts(n12, t6 = {}) { - return new I(n12, t6).walkSync(); +function ts(n8, t = {}) { + return new I(n8, t).walkSync(); } -async function Je(n12, t6 = {}) { - return new I(n12, t6).walk(); +async function Je(n8, t = {}) { + return new I(n8, t).walk(); } -function Ut(n12, t6 = {}) { - return new I(n12, t6).iterateSync(); +function Ut(n8, t = {}) { + return new I(n8, t).iterateSync(); } -function es(n12, t6 = {}) { - return new I(n12, t6).iterate(); +function es(n8, t = {}) { + return new I(n8, t).iterate(); } var ji = Bt; var Ii = Object.assign(Qe, { sync: Bt }); @@ -182389,9 +186899,9 @@ function normalizeTestSuite(test) { suite: typeof test.suite === "string" ? [test.suite] : test.suite }; } -function normalizeEnvironmentBuildNumber(env2) { - if (!env2) return void 0; - const { buildNumber, ...rest } = env2; +function normalizeEnvironmentBuildNumber(env3) { + if (!env3) return void 0; + const { buildNumber, ...rest } = env3; const normalized = typeof buildNumber === "string" ? parseInt(buildNumber, 10) || void 0 : buildNumber; return { ...rest, buildNumber: normalized }; } @@ -182409,7 +186919,7 @@ var preV1Plugin = { function createReportNormalizer(plugins) { return (raw) => { const specVersion = raw.specVersion; - const result = plugins.filter((p6) => p6.appliesTo(specVersion)).reduce((acc, p6) => p6.normalize(acc), raw); + const result = plugins.filter((p2) => p2.appliesTo(specVersion)).reduce((acc, p2) => p2.normalize(acc), raw); return result; }; } @@ -182987,11 +187497,11 @@ var balanced = (a6, b6, str) => { }; }; var maybeMatch = (reg, str) => { - const m6 = str.match(reg); - return m6 ? m6[0] : null; + const m3 = str.match(reg); + return m3 ? m3[0] : null; }; var range3 = (a6, b6, str) => { - let begs, beg, left, right = void 0, result; + let begs, beg, left2, right2 = void 0, result; let ai2 = str.indexOf(a6); let bi2 = str.indexOf(b6, ai2 + 1); let i6 = ai2; @@ -183000,7 +187510,7 @@ var range3 = (a6, b6, str) => { return [ai2, bi2]; } begs = []; - left = str.length; + left2 = str.length; while (i6 >= 0 && !result) { if (i6 === ai2) { begs.push(i6); @@ -183011,16 +187521,16 @@ var range3 = (a6, b6, str) => { result = [r6, bi2]; } else { beg = begs.pop(); - if (beg !== void 0 && beg < left) { - left = beg; - right = bi2; + if (beg !== void 0 && beg < left2) { + left2 = beg; + right2 = bi2; } bi2 = str.indexOf(b6, i6 + 1); } i6 = ai2 < bi2 && ai2 >= 0 ? ai2 : bi2; } - if (begs.length && right !== void 0) { - result = [left, right]; + if (begs.length && right2 !== void 0) { + result = [left2, right2]; } } return result; @@ -183057,20 +187567,20 @@ function parseCommaParts(str) { return [""]; } const parts = []; - const m6 = balanced("{", "}", str); - if (!m6) { + const m3 = balanced("{", "}", str); + if (!m3) { return str.split(","); } - const { pre, body: body2, post } = m6; - const p6 = pre.split(","); - p6[p6.length - 1] += "{" + body2 + "}"; + const { pre, body: body2, post } = m3; + const p2 = pre.split(","); + p2[p2.length - 1] += "{" + body2 + "}"; const postParts = parseCommaParts(post); if (post.length) { ; - p6[p6.length - 1] += postParts.shift(); - p6.push.apply(p6, postParts); + p2[p2.length - 1] += postParts.shift(); + p2.push.apply(p2, postParts); } - parts.push.apply(parts, p6); + parts.push.apply(parts, p2); return parts; } function expand2(str, options = {}) { @@ -183089,63 +187599,63 @@ function embrace(str) { function isPadded(el) { return /^-?0\d/.test(el); } -function lte(i6, y2) { - return i6 <= y2; +function lte(i6, y) { + return i6 <= y; } -function gte(i6, y2) { - return i6 >= y2; +function gte(i6, y) { + return i6 >= y; } function expand_(str, max, isTop) { const expansions = []; - const m6 = balanced("{", "}", str); - if (!m6) + const m3 = balanced("{", "}", str); + if (!m3) return [str]; - const pre = m6.pre; - const post = m6.post.length ? expand_(m6.post, max, false) : [""]; - if (/\$$/.test(m6.pre)) { + const pre = m3.pre; + const post = m3.post.length ? expand_(m3.post, max, false) : [""]; + if (/\$$/.test(m3.pre)) { for (let k7 = 0; k7 < post.length && k7 < max; k7++) { - const expansion = pre + "{" + m6.body + "}" + post[k7]; + const expansion = pre + "{" + m3.body + "}" + post[k7]; expansions.push(expansion); } } else { - const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m6.body); - const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m6.body); + const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m3.body); + const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m3.body); const isSequence = isNumericSequence || isAlphaSequence; - const isOptions = m6.body.indexOf(",") >= 0; + const isOptions = m3.body.indexOf(",") >= 0; if (!isSequence && !isOptions) { - if (m6.post.match(/,(?!,).*\}/)) { - str = m6.pre + "{" + m6.body + escClose + m6.post; + if (m3.post.match(/,(?!,).*\}/)) { + str = m3.pre + "{" + m3.body + escClose + m3.post; return expand_(str, max, true); } return [str]; } - let n12; + let n8; if (isSequence) { - n12 = m6.body.split(/\.\./); + n8 = m3.body.split(/\.\./); } else { - n12 = parseCommaParts(m6.body); - if (n12.length === 1 && n12[0] !== void 0) { - n12 = expand_(n12[0], max, false).map(embrace); - if (n12.length === 1) { - return post.map((p6) => m6.pre + n12[0] + p6); + n8 = parseCommaParts(m3.body); + if (n8.length === 1 && n8[0] !== void 0) { + n8 = expand_(n8[0], max, false).map(embrace); + if (n8.length === 1) { + return post.map((p2) => m3.pre + n8[0] + p2); } } } let N2; - if (isSequence && n12[0] !== void 0 && n12[1] !== void 0) { - const x6 = numeric(n12[0]); - const y2 = numeric(n12[1]); - const width = Math.max(n12[0].length, n12[1].length); - let incr = n12.length === 3 && n12[2] !== void 0 ? Math.max(Math.abs(numeric(n12[2])), 1) : 1; + if (isSequence && n8[0] !== void 0 && n8[1] !== void 0) { + const x2 = numeric(n8[0]); + const y = numeric(n8[1]); + const width = Math.max(n8[0].length, n8[1].length); + let incr = n8.length === 3 && n8[2] !== void 0 ? Math.max(Math.abs(numeric(n8[2])), 1) : 1; let test = lte; - const reverse = y2 < x6; + const reverse = y < x2; if (reverse) { incr *= -1; test = gte; } - const pad = n12.some(isPadded); + const pad = n8.some(isPadded); N2 = []; - for (let i6 = x6; test(i6, y2); i6 += incr) { + for (let i6 = x2; test(i6, y) && N2.length < max; i6 += incr) { let c6; if (isAlphaSequence) { c6 = String.fromCharCode(i6); @@ -183157,11 +187667,11 @@ function expand_(str, max, isTop) { if (pad) { const need = width - c6.length; if (need > 0) { - const z2 = new Array(need + 1).join("0"); + const z = new Array(need + 1).join("0"); if (i6 < 0) { - c6 = "-" + z2 + c6.slice(1); + c6 = "-" + z + c6.slice(1); } else { - c6 = z2 + c6; + c6 = z + c6; } } } @@ -183170,8 +187680,8 @@ function expand_(str, max, isTop) { } } else { N2 = []; - for (let j7 = 0; j7 < n12.length; j7++) { - N2.push.apply(N2, expand_(n12[j7], max, false)); + for (let j7 = 0; j7 < n8.length; j7++) { + N2.push.apply(N2, expand_(n8[j7], max, false)); } } for (let j7 = 0; j7 < N2.length; j7++) { @@ -183214,8 +187724,8 @@ var posixClasses = { "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true], "[:xdigit:]": ["A-Fa-f0-9", false] }; -var braceEscape = (s6) => s6.replace(/[[\]\\-]/g, "\\$&"); -var regexpEscape = (s6) => s6.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); +var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&"); +var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); var rangesToString = (ranges) => ranges.join(""); var parseClass = (glob2, position) => { const pos = position; @@ -183251,7 +187761,7 @@ var parseClass = (glob2, position) => { } } if (c6 === "[" && !escaping) { - for (const [cls, [unip, u6, neg]] of Object.entries(posixClasses)) { + for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) { if (glob2.startsWith(cls, i6)) { if (rangeStart) { return ["$.", false, glob2.length - pos, true]; @@ -183261,7 +187771,7 @@ var parseClass = (glob2, position) => { negs.push(unip); else ranges.push(unip); - uflag = uflag || u6; + uflag = uflag || u; continue WHILE; } } @@ -183307,11 +187817,11 @@ var parseClass = (glob2, position) => { }; // node_modules/junit-to-ctrf/node_modules/minimatch/dist/esm/unescape.js -var unescape2 = (s6, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => { +var unescape2 = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => { if (magicalBraces) { - return windowsPathsNoEscape ? s6.replace(/\[([^/\\])\]/g, "$1") : s6.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1"); + return windowsPathsNoEscape ? s.replace(/\[([^/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1"); } - return windowsPathsNoEscape ? s6.replace(/\[([^/\\{}])\]/g, "$1") : s6.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1"); + return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1"); }; // node_modules/junit-to-ctrf/node_modules/minimatch/dist/esm/ast.js @@ -183370,7 +187880,7 @@ var startNoDot = "(?!\\.)"; var addPatternStart = /* @__PURE__ */ new Set(["[", "."]); var justDots = /* @__PURE__ */ new Set(["..", "."]); var reSpecials = new Set("().*{}+?[]^$\\!"); -var regExpEscape = (s6) => s6.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); +var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); var qmark = "[^/]"; var star = qmark + "*?"; var starNoEmpty = qmark + "+?"; @@ -183421,17 +187931,17 @@ var AST = class { get hasMagic() { if (this.#hasMagic !== void 0) return this.#hasMagic; - for (const p6 of this.#parts) { - if (typeof p6 === "string") + for (const p2 of this.#parts) { + if (typeof p2 === "string") continue; - if (p6.type || p6.hasMagic) + if (p2.type || p2.hasMagic) return this.#hasMagic = true; } return this.#hasMagic; } // reconstructs the pattern toString() { - return this.#toString !== void 0 ? this.#toString : !this.type ? this.#toString = this.#parts.map((p6) => String(p6)).join("") : this.#toString = this.type + "(" + this.#parts.map((p6) => String(p6)).join("|") + ")"; + return this.#toString !== void 0 ? this.#toString : !this.type ? this.#toString = this.#parts.map((p2) => String(p2)).join("") : this.#toString = this.type + "(" + this.#parts.map((p2) => String(p2)).join("|") + ")"; } #fillNegs() { if (this !== this.#root) @@ -183440,39 +187950,39 @@ var AST = class { return this; this.toString(); this.#filledNegs = true; - let n12; - while (n12 = this.#negs.pop()) { - if (n12.type !== "!") + let n8; + while (n8 = this.#negs.pop()) { + if (n8.type !== "!") continue; - let p6 = n12; - let pp = p6.#parent; + let p2 = n8; + let pp = p2.#parent; while (pp) { - for (let i6 = p6.#parentIndex + 1; !pp.type && i6 < pp.#parts.length; i6++) { - for (const part of n12.#parts) { + for (let i6 = p2.#parentIndex + 1; !pp.type && i6 < pp.#parts.length; i6++) { + for (const part of n8.#parts) { if (typeof part === "string") { throw new Error("string part in extglob AST??"); } part.copyIn(pp.#parts[i6]); } } - p6 = pp; - pp = p6.#parent; + p2 = pp; + pp = p2.#parent; } } return this; } push(...parts) { - for (const p6 of parts) { - if (p6 === "") + for (const p2 of parts) { + if (p2 === "") continue; - if (typeof p6 !== "string" && !(p6 instanceof _a && p6.#parent === this)) { - throw new Error("invalid part: " + p6); + if (typeof p2 !== "string" && !(p2 instanceof _a && p2.#parent === this)) { + throw new Error("invalid part: " + p2); } - this.#parts.push(p6); + this.#parts.push(p2); } } toJSON() { - const ret = this.type === null ? this.#parts.slice().map((p6) => typeof p6 === "string" ? p6 : p6.toJSON()) : [this.type, ...this.#parts.map((p6) => p6.toJSON())]; + const ret = this.type === null ? this.#parts.slice().map((p2) => typeof p2 === "string" ? p2 : p2.toJSON()) : [this.type, ...this.#parts.map((p2) => p2.toJSON())]; if (this.isStart() && !this.type) ret.unshift([]); if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && this.#parent?.type === "!")) { @@ -183487,9 +187997,9 @@ var AST = class { return false; if (this.#parentIndex === 0) return true; - const p6 = this.#parent; + const p2 = this.#parent; for (let i6 = 0; i6 < this.#parentIndex; i6++) { - const pp = p6.#parts[i6]; + const pp = p2.#parts[i6]; if (!(pp instanceof _a && pp.type === "!")) { return false; } @@ -183516,8 +188026,8 @@ var AST = class { } clone(parent2) { const c6 = new _a(this.type, parent2); - for (const p6 of this.#parts) { - c6.copyIn(p6); + for (const p2 of this.#parts) { + c6.copyIn(p2); } return c6; } @@ -183656,15 +188166,15 @@ var AST = class { #adopt(child, index2) { const gc = child.#parts[0]; this.#parts.splice(index2, 1, ...gc.#parts); - for (const p6 of gc.#parts) { - if (typeof p6 === "object") - p6.#parent = this; + for (const p2 of gc.#parts) { + if (typeof p2 === "object") + p2.#parent = this; } this.#toString = void 0; } #canUsurpType(c6) { - const m6 = usurpMap.get(this.type); - return !!m6?.has(c6); + const m3 = usurpMap.get(this.type); + return !!m3?.has(c6); } #canUsurp(child) { if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) { @@ -183677,15 +188187,15 @@ var AST = class { return this.#canUsurpType(gc.type); } #usurp(child) { - const m6 = usurpMap.get(this.type); + const m3 = usurpMap.get(this.type); const gc = child.#parts[0]; - const nt2 = m6?.get(gc.type); + const nt2 = m3?.get(gc.type); if (!nt2) return false; this.#parts = gc.#parts; - for (const p6 of this.#parts) { - if (typeof p6 === "object") { - p6.#parent = this; + for (const p2 of this.#parts) { + if (typeof p2 === "object") { + p2.#parent = this; } } this.type = nt2; @@ -183793,9 +188303,9 @@ var AST = class { this.#fillNegs(); } if (!isExtglobAST(this)) { - const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s6) => typeof s6 !== "string"); - const src = this.#parts.map((p6) => { - const [re2, _3, hasMagic2, uflag] = typeof p6 === "string" ? _a.#parseGlob(p6, this.#hasMagic, noEmpty) : p6.toRegExpSource(allowDot); + const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string"); + const src = this.#parts.map((p2) => { + const [re2, _3, hasMagic2, uflag] = typeof p2 === "string" ? _a.#parseGlob(p2, this.#hasMagic, noEmpty) : p2.toRegExpSource(allowDot); this.#hasMagic = this.#hasMagic || hasMagic2; this.#uflag = this.#uflag || uflag; return re2; @@ -183833,12 +188343,12 @@ var AST = class { const start = this.type === "!" ? "(?:(?!(?:" : "(?:"; let body2 = this.#partsToRegExp(dot); if (this.isStart() && this.isEnd() && !body2 && this.type !== "!") { - const s6 = this.toString(); + const s = this.toString(); const me2 = this; - me2.#parts = [s6]; + me2.#parts = [s]; me2.type = null; me2.#hasMagic = void 0; - return [s6, unescape2(this.toString()), false, false]; + return [s, unescape2(this.toString()), false, false]; } let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true); if (bodyDotAllowed === body2) { @@ -183866,9 +188376,9 @@ var AST = class { } #flatten() { if (!isExtglobAST(this)) { - for (const p6 of this.#parts) { - if (typeof p6 === "object") { - p6.#flatten(); + for (const p2 of this.#parts) { + if (typeof p2 === "object") { + p2.#flatten(); } } } else { @@ -183897,14 +188407,14 @@ var AST = class { this.#toString = void 0; } #partsToRegExp(dot) { - return this.#parts.map((p6) => { - if (typeof p6 === "string") { + return this.#parts.map((p2) => { + if (typeof p2 === "string") { throw new Error("string type in extglob ast??"); } - const [re2, _3, _hasMagic, uflag] = p6.toRegExpSource(dot); + const [re2, _3, _hasMagic, uflag] = p2.toRegExpSource(dot); this.#uflag = this.#uflag || uflag; return re2; - }).filter((p6) => !(this.isStart() && this.isEnd()) || !!p6).join("|"); + }).filter((p2) => !(this.isStart() && this.isEnd()) || !!p2).join("|"); } static #parseGlob(glob2, hasMagic2, noEmpty = false) { let escaping = false; @@ -183959,20 +188469,20 @@ var AST = class { _a = AST; // node_modules/junit-to-ctrf/node_modules/minimatch/dist/esm/escape.js -var escape3 = (s6, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => { +var escape3 = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => { if (magicalBraces) { - return windowsPathsNoEscape ? s6.replace(/[?*()[\]{}]/g, "[$&]") : s6.replace(/[?*()[\]\\{}]/g, "\\$&"); + return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&"); } - return windowsPathsNoEscape ? s6.replace(/[?*()[\]]/g, "[$&]") : s6.replace(/[?*()[\]\\]/g, "\\$&"); + return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&"); }; // node_modules/junit-to-ctrf/node_modules/minimatch/dist/esm/index.js -var minimatch = (p6, pattern, options = {}) => { +var minimatch = (p2, pattern, options = {}) => { assertValidPattern(pattern); if (!options.nocomment && pattern.charAt(0) === "#") { return false; } - return new Minimatch(pattern, options).match(p6); + return new Minimatch(pattern, options).match(p2); }; var starDotExtRE = /^\*+([^+@!?*[(]*)$/; var starDotExtTest = (ext3) => (f6) => !f6.startsWith(".") && f6.endsWith(ext3); @@ -184037,7 +188547,7 @@ var qmark2 = "[^/]"; var star2 = qmark2 + "*?"; var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; -var filter2 = (pattern, options = {}) => (p6) => minimatch(p6, pattern, options); +var filter2 = (pattern, options = {}) => (p2) => minimatch(p2, pattern, options); minimatch.filter = filter2; var ext = (a6, b6 = {}) => Object.assign({}, a6, b6); var defaults2 = (def) => { @@ -184045,8 +188555,8 @@ var defaults2 = (def) => { return minimatch; } const orig = minimatch; - const m6 = (p6, pattern, options = {}) => orig(p6, pattern, ext(def, options)); - return Object.assign(m6, { + const m3 = (p2, pattern, options = {}) => orig(p2, pattern, ext(def, options)); + return Object.assign(m3, { Minimatch: class Minimatch extends orig.Minimatch { constructor(pattern, options = {}) { super(pattern, ext(def, options)); @@ -184065,8 +188575,8 @@ var defaults2 = (def) => { return orig.AST.fromGlob(pattern, ext(def, options)); } }, - unescape: (s6, options = {}) => orig.unescape(s6, ext(def, options)), - escape: (s6, options = {}) => orig.escape(s6, ext(def, options)), + unescape: (s, options = {}) => orig.unescape(s, ext(def, options)), + escape: (s, options = {}) => orig.escape(s, ext(def, options)), filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)), defaults: (options) => orig.defaults(ext(def, options)), makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)), @@ -184097,7 +188607,7 @@ var match = (list, pattern, options = {}) => { }; minimatch.match = match; var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/; -var regExpEscape2 = (s6) => s6.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); +var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); var Minimatch = class { options; set; @@ -184175,31 +188685,31 @@ var Minimatch = class { this.debug = (...args) => console.error(...args); } this.debug(this.pattern, this.globSet); - const rawGlobParts = this.globSet.map((s6) => this.slashSplit(s6)); + const rawGlobParts = this.globSet.map((s) => this.slashSplit(s)); this.globParts = this.preprocess(rawGlobParts); this.debug(this.pattern, this.globParts); - let set = this.globParts.map((s6, _3, __) => { + let set = this.globParts.map((s, _3, __) => { if (this.isWindows && this.windowsNoMagicRoot) { - const isUNC = s6[0] === "" && s6[1] === "" && (s6[2] === "?" || !globMagic.test(s6[2])) && !globMagic.test(s6[3]); - const isDrive = /^[a-z]:/i.test(s6[0]); + const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]); + const isDrive = /^[a-z]:/i.test(s[0]); if (isUNC) { return [ - ...s6.slice(0, 4), - ...s6.slice(4).map((ss2) => this.parse(ss2)) + ...s.slice(0, 4), + ...s.slice(4).map((ss2) => this.parse(ss2)) ]; } else if (isDrive) { - return [s6[0], ...s6.slice(1).map((ss2) => this.parse(ss2))]; + return [s[0], ...s.slice(1).map((ss2) => this.parse(ss2))]; } } - return s6.map((ss2) => this.parse(ss2)); + return s.map((ss2) => this.parse(ss2)); }); this.debug(this.pattern, set); - this.set = set.filter((s6) => s6.indexOf(false) === -1); + this.set = set.filter((s) => s.indexOf(false) === -1); if (this.isWindows) { for (let i6 = 0; i6 < this.set.length; i6++) { - const p6 = this.set[i6]; - if (p6[0] === "" && p6[1] === "" && this.globParts[i6][2] === "?" && typeof p6[3] === "string" && /^[a-z]:$/i.test(p6[3])) { - p6[2] = "?"; + const p2 = this.set[i6]; + if (p2[0] === "" && p2[1] === "" && this.globParts[i6][2] === "?" && typeof p2[3] === "string" && /^[a-z]:$/i.test(p2[3])) { + p2[2] = "?"; } } } @@ -184276,10 +188786,10 @@ var Minimatch = class { didSomething = false; if (!this.preserveMultipleSlashes) { for (let i6 = 1; i6 < parts.length - 1; i6++) { - const p6 = parts[i6]; - if (i6 === 1 && p6 === "" && parts[0] === "") + const p2 = parts[i6]; + if (i6 === 1 && p2 === "" && parts[0] === "") continue; - if (p6 === "." || p6 === "") { + if (p2 === "." || p2 === "") { didSomething = true; parts.splice(i6, 1); i6--; @@ -184292,8 +188802,8 @@ var Minimatch = class { } let dd = 0; while (-1 !== (dd = parts.indexOf("..", dd + 1))) { - const p6 = parts[dd - 1]; - if (p6 && p6 !== "." && p6 !== ".." && p6 !== "**" && !(this.isWindows && /^[a-z]:$/i.test(p6))) { + const p2 = parts[dd - 1]; + if (p2 && p2 !== "." && p2 !== ".." && p2 !== "**" && !(this.isWindows && /^[a-z]:$/i.test(p2))) { didSomething = true; parts.splice(dd - 1, 2); dd -= 2; @@ -184335,11 +188845,11 @@ var Minimatch = class { parts.splice(gs2 + 1, gss - gs2); } let next = parts[gs2 + 1]; - const p6 = parts[gs2 + 2]; + const p2 = parts[gs2 + 2]; const p22 = parts[gs2 + 3]; if (next !== "..") continue; - if (!p6 || p6 === "." || p6 === ".." || !p22 || p22 === "." || p22 === "..") { + if (!p2 || p2 === "." || p2 === ".." || !p22 || p22 === "." || p22 === "..") { continue; } didSomething = true; @@ -184351,10 +188861,10 @@ var Minimatch = class { } if (!this.preserveMultipleSlashes) { for (let i6 = 1; i6 < parts.length - 1; i6++) { - const p6 = parts[i6]; - if (i6 === 1 && p6 === "" && parts[0] === "") + const p2 = parts[i6]; + if (i6 === 1 && p2 === "" && parts[0] === "") continue; - if (p6 === "." || p6 === "") { + if (p2 === "." || p2 === "") { didSomething = true; parts.splice(i6, 1); i6--; @@ -184367,8 +188877,8 @@ var Minimatch = class { } let dd = 0; while (-1 !== (dd = parts.indexOf("..", dd + 1))) { - const p6 = parts[dd - 1]; - if (p6 && p6 !== "." && p6 !== ".." && p6 !== "**") { + const p2 = parts[dd - 1]; + if (p2 && p2 !== "." && p2 !== ".." && p2 !== "**") { didSomething = true; const needDot = dd === 1 && parts[dd + 1] === "**"; const splin = needDot ? ["."] : []; @@ -184574,8 +189084,8 @@ var Minimatch = class { } const [body2, after] = bs2; while (fileIndex <= after) { - const m6 = this.#matchOne(file.slice(0, fileIndex + body2.length), body2, partial, fileIndex, 0); - if (m6 && globStarDepth < this.maxGlobstarRecursion) { + const m3 = this.#matchOne(file.slice(0, fileIndex + body2.length), body2, partial, fileIndex, 0); + if (m3 && globStarDepth < this.maxGlobstarRecursion) { const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body2.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail); if (sub !== false) { return sub; @@ -184596,19 +189106,19 @@ var Minimatch = class { let fl; for (fi2 = fileIndex, pi2 = patternIndex, fl = file.length, pl = pattern.length; fi2 < fl && pi2 < pl; fi2++, pi2++) { this.debug("matchOne loop"); - let p6 = pattern[pi2]; + let p2 = pattern[pi2]; let f6 = file[fi2]; - this.debug(pattern, p6, f6); - if (p6 === false || p6 === GLOBSTAR) { + this.debug(pattern, p2, f6); + if (p2 === false || p2 === GLOBSTAR) { return false; } let hit; - if (typeof p6 === "string") { - hit = f6 === p6; - this.debug("string match", p6, f6, hit); + if (typeof p2 === "string") { + hit = f6 === p2; + this.debug("string match", p2, f6, hit); } else { - hit = p6.test(f6); - this.debug("pattern match", p6, f6, hit); + hit = p2.test(f6); + this.debug("pattern match", p2, f6, hit); } if (!hit) return false; @@ -184633,17 +189143,17 @@ var Minimatch = class { return GLOBSTAR; if (pattern === "") return ""; - let m6; + let m3; let fastTest = null; - if (m6 = pattern.match(starRE)) { + if (m3 = pattern.match(starRE)) { fastTest = options.dot ? starTestDot : starTest; - } else if (m6 = pattern.match(starDotExtRE)) { - fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m6[1]); - } else if (m6 = pattern.match(qmarksRE)) { - fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m6); - } else if (m6 = pattern.match(starDotStarRE)) { + } else if (m3 = pattern.match(starDotExtRE)) { + fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m3[1]); + } else if (m3 = pattern.match(qmarksRE)) { + fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m3); + } else if (m3 = pattern.match(starDotStarRE)) { fastTest = options.dot ? starDotStarTestDot : starDotStarTest; - } else if (m6 = pattern.match(dotStarRE)) { + } else if (m3 = pattern.match(dotStarRE)) { fastTest = dotStarTest; } const re2 = AST.fromGlob(pattern, this.options).toMMPattern(); @@ -184664,17 +189174,17 @@ var Minimatch = class { const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot; const flags = new Set(options.nocase ? ["i"] : []); let re2 = set.map((pattern) => { - const pp = pattern.map((p6) => { - if (p6 instanceof RegExp) { - for (const f6 of p6.flags.split("")) + const pp = pattern.map((p2) => { + if (p2 instanceof RegExp) { + for (const f6 of p2.flags.split("")) flags.add(f6); } - return typeof p6 === "string" ? regExpEscape2(p6) : p6 === GLOBSTAR ? GLOBSTAR : p6._src; + return typeof p2 === "string" ? regExpEscape2(p2) : p2 === GLOBSTAR ? GLOBSTAR : p2._src; }); - pp.forEach((p6, i6) => { + pp.forEach((p2, i6) => { const next = pp[i6 + 1]; const prev = pp[i6 - 1]; - if (p6 !== GLOBSTAR || prev === GLOBSTAR) { + if (p2 !== GLOBSTAR || prev === GLOBSTAR) { return; } if (prev === void 0) { @@ -184690,7 +189200,7 @@ var Minimatch = class { pp[i6 + 1] = GLOBSTAR; } }); - const filtered = pp.filter((p6) => p6 !== GLOBSTAR); + const filtered = pp.filter((p2) => p2 !== GLOBSTAR); if (this.partial && filtered.length >= 1) { const prefixes = []; for (let i6 = 1; i6 <= filtered.length; i6++) { @@ -184714,13 +189224,13 @@ var Minimatch = class { } return this.regexp; } - slashSplit(p6) { + slashSplit(p2) { if (this.preserveMultipleSlashes) { - return p6.split("/"); - } else if (this.isWindows && /^\/\/[^/]+/.test(p6)) { - return ["", ...p6.split(/\/+/)]; + return p2.split("/"); + } else if (this.isWindows && /^\/\/[^/]+/.test(p2)) { + return ["", ...p2.split(/\/+/)]; } else { - return p6.split(/\/+/); + return p2.split(/\/+/); } } match(f6, partial = this.partial) { @@ -184822,7 +189332,7 @@ if (typeof AC === "undefined") { }; } var shouldWarn = (code) => !warned.has(code); -var isPosInt = (n12) => n12 && n12 === Math.floor(n12) && n12 > 0 && isFinite(n12); +var isPosInt = (n8) => n8 && n8 === Math.floor(n8) && n8 > 0 && isFinite(n8); 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) { @@ -184840,9 +189350,9 @@ var Stack = class _Stack { if (!HeapCls) return []; _Stack.#constructing = true; - const s6 = new _Stack(max, HeapCls); + const s = new _Stack(max, HeapCls); _Stack.#constructing = false; - return s6; + return s; } constructor(max, HeapCls) { if (!_Stack.#constructing) { @@ -184851,8 +189361,8 @@ var Stack = class _Stack { this.heap = new HeapCls(max); this.length = 0; } - push(n12) { - this.heap[this.length++] = n12; + push(n8) { + this.heap[this.length++] = n8; } pop() { return this.heap[--this.length]; @@ -184972,7 +189482,7 @@ var LRUCache = class _LRUCache { }, free: c6.#free, // methods - isBackgroundFetch: (p6) => c6.#isBackgroundFetch(p6), + isBackgroundFetch: (p2) => c6.#isBackgroundFetch(p2), backgroundFetch: (k7, index2, options, context5) => c6.#backgroundFetch(k7, index2, options, context5), moveToTail: (index2) => c6.#moveToTail(index2), indexes: (options) => c6.#indexes(options), @@ -185136,13 +189646,13 @@ var LRUCache = class _LRUCache { starts[index2] = ttl !== 0 ? start : 0; ttls[index2] = ttl; if (ttl !== 0 && this.ttlAutopurge) { - const t6 = setTimeout(() => { + const t = setTimeout(() => { if (this.#isStale(index2)) { this.#delete(this.#keyList[index2], "expire"); } }, ttl + 1); - if (t6.unref) { - t6.unref(); + if (t.unref) { + t.unref(); } } }; @@ -185164,15 +189674,15 @@ var LRUCache = class _LRUCache { }; let cachedNow = 0; const getNow = () => { - const n12 = perf.now(); + const n8 = perf.now(); if (this.ttlResolution > 0) { - cachedNow = n12; - const t6 = setTimeout(() => cachedNow = 0, this.ttlResolution); - if (t6.unref) { - t6.unref(); + cachedNow = n8; + const t = setTimeout(() => cachedNow = 0, this.ttlResolution); + if (t.unref) { + t.unref(); } } - return n12; + return n8; }; this.getRemainingTTL = (key) => { const index2 = this.#keyMap.get(key); @@ -185188,9 +189698,9 @@ var LRUCache = class _LRUCache { return ttl - age; }; this.#isStale = (index2) => { - const s6 = starts[index2]; - const t6 = ttls[index2]; - return !!t6 && !!s6 && (cachedNow || getNow()) - s6 > t6; + const s = starts[index2]; + const t = ttls[index2]; + return !!t && !!s && (cachedNow || getNow()) - s > t; }; } // conditionally set private methods related to TTL @@ -185210,8 +189720,8 @@ var LRUCache = class _LRUCache { this.#calculatedSize -= sizes[index2]; sizes[index2] = 0; }; - this.#requireSize = (k7, v8, size, sizeCalculation) => { - if (this.#isBackgroundFetch(v8)) { + this.#requireSize = (k7, v2, size, sizeCalculation) => { + if (this.#isBackgroundFetch(v2)) { return 0; } if (!isPosInt(size)) { @@ -185219,7 +189729,7 @@ var LRUCache = class _LRUCache { if (typeof sizeCalculation !== "function") { throw new TypeError("sizeCalculation must be a function"); } - size = sizeCalculation(v8, k7); + size = sizeCalculation(v2, k7); if (!isPosInt(size)) { throw new TypeError("sizeCalculation return invalid (expect positive integer)"); } @@ -185347,8 +189857,8 @@ var LRUCache = class _LRUCache { */ *values() { for (const i6 of this.#indexes()) { - const v8 = this.#valList[i6]; - if (v8 !== void 0 && !this.#isBackgroundFetch(this.#valList[i6])) { + const v2 = this.#valList[i6]; + if (v2 !== void 0 && !this.#isBackgroundFetch(this.#valList[i6])) { yield this.#valList[i6]; } } @@ -185361,8 +189871,8 @@ var LRUCache = class _LRUCache { */ *rvalues() { for (const i6 of this.#rindexes()) { - const v8 = this.#valList[i6]; - if (v8 !== void 0 && !this.#isBackgroundFetch(this.#valList[i6])) { + const v2 = this.#valList[i6]; + if (v2 !== void 0 && !this.#isBackgroundFetch(this.#valList[i6])) { yield this.#valList[i6]; } } @@ -185386,8 +189896,8 @@ var LRUCache = class _LRUCache { */ find(fn, getOptions = {}) { for (const i6 of this.#indexes()) { - const v8 = this.#valList[i6]; - const value = this.#isBackgroundFetch(v8) ? v8.__staleWhileFetching : v8; + const v2 = this.#valList[i6]; + const value = this.#isBackgroundFetch(v2) ? v2.__staleWhileFetching : v2; if (value === void 0) continue; if (fn(value, this.#keyList[i6], this)) { @@ -185408,8 +189918,8 @@ var LRUCache = class _LRUCache { */ forEach(fn, thisp = this) { for (const i6 of this.#indexes()) { - const v8 = this.#valList[i6]; - const value = this.#isBackgroundFetch(v8) ? v8.__staleWhileFetching : v8; + const v2 = this.#valList[i6]; + const value = this.#isBackgroundFetch(v2) ? v2.__staleWhileFetching : v2; if (value === void 0) continue; fn.call(thisp, value, this.#keyList[i6], this); @@ -185421,8 +189931,8 @@ var LRUCache = class _LRUCache { */ rforEach(fn, thisp = this) { for (const i6 of this.#rindexes()) { - const v8 = this.#valList[i6]; - const value = this.#isBackgroundFetch(v8) ? v8.__staleWhileFetching : v8; + const v2 = this.#valList[i6]; + const value = this.#isBackgroundFetch(v2) ? v2.__staleWhileFetching : v2; if (value === void 0) continue; fn.call(thisp, value, this.#keyList[i6], this); @@ -185458,8 +189968,8 @@ var LRUCache = class _LRUCache { const i6 = this.#keyMap.get(key); if (i6 === void 0) return void 0; - const v8 = this.#valList[i6]; - const value = this.#isBackgroundFetch(v8) ? v8.__staleWhileFetching : v8; + const v2 = this.#valList[i6]; + const value = this.#isBackgroundFetch(v2) ? v2.__staleWhileFetching : v2; if (value === void 0) return void 0; const entry = { value }; @@ -185494,8 +190004,8 @@ var LRUCache = class _LRUCache { const arr = []; for (const i6 of this.#indexes({ allowStale: true })) { const key = this.#keyList[i6]; - const v8 = this.#valList[i6]; - const value = this.#isBackgroundFetch(v8) ? v8.__staleWhileFetching : v8; + const v2 = this.#valList[i6]; + const value = this.#isBackgroundFetch(v2) ? v2.__staleWhileFetching : v2; if (value === void 0 || key === void 0) continue; const entry = { value }; @@ -185560,14 +190070,14 @@ var LRUCache = class _LRUCache { * If the value is `undefined`, then this is an alias for * `cache.delete(key)`. `undefined` is never stored in the cache. */ - set(k7, v8, setOptions = {}) { - if (v8 === void 0) { + set(k7, v2, setOptions = {}) { + if (v2 === void 0) { this.delete(k7); return this; } const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status } = setOptions; let { noUpdateTTL = this.noUpdateTTL } = setOptions; - const size = this.#requireSize(k7, v8, setOptions.size || 0, sizeCalculation); + const size = this.#requireSize(k7, v2, setOptions.size || 0, sizeCalculation); if (this.maxEntrySize && size > this.maxEntrySize) { if (status) { status.set = "miss"; @@ -185580,7 +190090,7 @@ var LRUCache = class _LRUCache { if (index2 === void 0) { index2 = this.#size === 0 ? this.#tail : this.#free.length !== 0 ? this.#free.pop() : this.#size === this.#max ? this.#evict(false) : this.#size; this.#keyList[index2] = k7; - this.#valList[index2] = v8; + this.#valList[index2] = v2; this.#keyMap.set(k7, index2); this.#next[this.#tail] = index2; this.#prev[index2] = this.#tail; @@ -185593,16 +190103,16 @@ var LRUCache = class _LRUCache { } else { this.#moveToTail(index2); const oldVal = this.#valList[index2]; - if (v8 !== oldVal) { + if (v2 !== oldVal) { if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) { oldVal.__abortController.abort(new Error("replaced")); - const { __staleWhileFetching: s6 } = oldVal; - if (s6 !== void 0 && !noDisposeOnSet) { + const { __staleWhileFetching: s } = oldVal; + if (s !== void 0 && !noDisposeOnSet) { if (this.#hasDispose) { - this.#dispose?.(s6, k7, "set"); + this.#dispose?.(s, k7, "set"); } if (this.#hasDisposeAfter) { - this.#disposed?.push([s6, k7, "set"]); + this.#disposed?.push([s, k7, "set"]); } } } else if (!noDisposeOnSet) { @@ -185615,7 +190125,7 @@ var LRUCache = class _LRUCache { } this.#removeItemSize(index2); this.#addItemSize(index2, size, status); - this.#valList[index2] = v8; + this.#valList[index2] = v2; if (status) { status.set = "replace"; const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? oldVal.__staleWhileFetching : oldVal; @@ -185675,15 +190185,15 @@ var LRUCache = class _LRUCache { #evict(free) { const head = this.#head; const k7 = this.#keyList[head]; - const v8 = this.#valList[head]; - if (this.#hasFetchMethod && this.#isBackgroundFetch(v8)) { - v8.__abortController.abort(new Error("evicted")); + const v2 = this.#valList[head]; + if (this.#hasFetchMethod && this.#isBackgroundFetch(v2)) { + v2.__abortController.abort(new Error("evicted")); } else if (this.#hasDispose || this.#hasDisposeAfter) { if (this.#hasDispose) { - this.#dispose?.(v8, k7, "evict"); + this.#dispose?.(v2, k7, "evict"); } if (this.#hasDisposeAfter) { - this.#disposed?.push([v8, k7, "evict"]); + this.#disposed?.push([v2, k7, "evict"]); } } this.#removeItemSize(head); @@ -185722,8 +190232,8 @@ var LRUCache = class _LRUCache { const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; const index2 = this.#keyMap.get(k7); if (index2 !== void 0) { - const v8 = this.#valList[index2]; - if (this.#isBackgroundFetch(v8) && v8.__staleWhileFetching === void 0) { + const v2 = this.#valList[index2]; + if (this.#isBackgroundFetch(v2) && v2.__staleWhileFetching === void 0) { return false; } if (!this.#isStale(index2)) { @@ -185757,13 +190267,13 @@ var LRUCache = class _LRUCache { if (index2 === void 0 || !allowStale && this.#isStale(index2)) { return; } - const v8 = this.#valList[index2]; - return this.#isBackgroundFetch(v8) ? v8.__staleWhileFetching : v8; + const v2 = this.#valList[index2]; + return this.#isBackgroundFetch(v2) ? v2.__staleWhileFetching : v2; } #backgroundFetch(k7, index2, options, context5) { - const v8 = index2 === void 0 ? void 0 : this.#valList[index2]; - if (this.#isBackgroundFetch(v8)) { - return v8; + const v2 = index2 === void 0 ? void 0 : this.#valList[index2]; + if (this.#isBackgroundFetch(v2)) { + return v2; } const ac = new AC(); const { signal } = options; @@ -185775,9 +190285,9 @@ var LRUCache = class _LRUCache { options, context: context5 }; - const cb = (v9, updateCache = false) => { + const cb = (v3, updateCache = false) => { const { aborted } = ac.signal; - const ignoreAbort = options.ignoreFetchAbort && v9 !== void 0; + const ignoreAbort = options.ignoreFetchAbort && v3 !== void 0; if (options.status) { if (aborted && !updateCache) { options.status.fetchAborted = true; @@ -185791,9 +190301,9 @@ var LRUCache = class _LRUCache { if (aborted && !ignoreAbort && !updateCache) { return fetchFail(ac.signal.reason); } - const bf2 = p6; - if (this.#valList[index2] === p6) { - if (v9 === void 0) { + const bf2 = p2; + if (this.#valList[index2] === p2) { + if (v3 === void 0) { if (bf2.__staleWhileFetching) { this.#valList[index2] = bf2.__staleWhileFetching; } else { @@ -185802,10 +190312,10 @@ var LRUCache = class _LRUCache { } else { if (options.status) options.status.fetchUpdated = true; - this.set(k7, v9, fetchOpts.options); + this.set(k7, v3, fetchOpts.options); } } - return v9; + return v3; }; const eb = (er) => { if (options.status) { @@ -185819,8 +190329,8 @@ var LRUCache = class _LRUCache { const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; const noDelete = allowStale || options.noDeleteOnFetchRejection; - const bf2 = p6; - if (this.#valList[index2] === p6) { + const bf2 = p2; + if (this.#valList[index2] === p2) { const del = !noDelete || bf2.__staleWhileFetching === void 0; if (del) { this.#delete(k7, "fetch"); @@ -185838,25 +190348,25 @@ var LRUCache = class _LRUCache { } }; const pcall = (res, rej) => { - const fmp = this.#fetchMethod?.(k7, v8, fetchOpts); + const fmp = this.#fetchMethod?.(k7, v2, fetchOpts); if (fmp && fmp instanceof Promise) { - fmp.then((v9) => res(v9 === void 0 ? void 0 : v9), rej); + fmp.then((v3) => res(v3 === void 0 ? void 0 : v3), rej); } ac.signal.addEventListener("abort", () => { if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { res(void 0); if (options.allowStaleOnFetchAbort) { - res = (v9) => cb(v9, true); + res = (v3) => cb(v3, true); } } }); }; if (options.status) options.status.fetchDispatched = true; - const p6 = new Promise(pcall).then(cb, eb); - const bf = Object.assign(p6, { + const p2 = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p2, { __abortController: ac, - __staleWhileFetching: v8, + __staleWhileFetching: v2, __returned: void 0 }); if (index2 === void 0) { @@ -185867,10 +190377,10 @@ var LRUCache = class _LRUCache { } return bf; } - #isBackgroundFetch(p6) { + #isBackgroundFetch(p2) { if (!this.#hasFetchMethod) return false; - const b6 = p6; + const b6 = p2; return !!b6 && b6 instanceof Promise && b6.hasOwnProperty("__staleWhileFetching") && b6.__abortController instanceof AC; } async fetch(k7, fetchOptions = {}) { @@ -185925,18 +190435,18 @@ var LRUCache = class _LRUCache { if (index2 === void 0) { if (status) status.fetch = "miss"; - const p6 = this.#backgroundFetch(k7, index2, options, context5); - return p6.__returned = p6; + const p2 = this.#backgroundFetch(k7, index2, options, context5); + return p2.__returned = p2; } else { - const v8 = this.#valList[index2]; - if (this.#isBackgroundFetch(v8)) { - const stale = allowStale && v8.__staleWhileFetching !== void 0; + const v2 = this.#valList[index2]; + if (this.#isBackgroundFetch(v2)) { + const stale = allowStale && v2.__staleWhileFetching !== void 0; if (status) { status.fetch = "inflight"; if (stale) status.returnedStale = true; } - return stale ? v8.__staleWhileFetching : v8.__returned = v8; + return stale ? v2.__staleWhileFetching : v2.__returned = v2; } const isStale = this.#isStale(index2); if (!forceRefresh && !isStale) { @@ -185948,24 +190458,24 @@ var LRUCache = class _LRUCache { } if (status) this.#statusTTL(status, index2); - return v8; + return v2; } - const p6 = this.#backgroundFetch(k7, index2, options, context5); - const hasStale = p6.__staleWhileFetching !== void 0; + const p2 = this.#backgroundFetch(k7, index2, options, context5); + const hasStale = p2.__staleWhileFetching !== void 0; const staleVal = hasStale && allowStale; if (status) { status.fetch = isStale ? "stale" : "refresh"; if (staleVal && isStale) status.returnedStale = true; } - return staleVal ? p6.__staleWhileFetching : p6.__returned = p6; + return staleVal ? p2.__staleWhileFetching : p2.__returned = p2; } } async forceFetch(k7, fetchOptions = {}) { - const v8 = await this.fetch(k7, fetchOptions); - if (v8 === void 0) + const v2 = await this.fetch(k7, fetchOptions); + if (v2 === void 0) throw new Error("fetch() returned undefined"); - return v8; + return v2; } memo(k7, memoOptions = {}) { const memoMethod = this.#memoMethod; @@ -185973,10 +190483,10 @@ var LRUCache = class _LRUCache { throw new Error("no memoMethod provided to constructor"); } const { context: context5, forceRefresh, ...options } = memoOptions; - const v8 = this.get(k7, options); - if (!forceRefresh && v8 !== void 0) - return v8; - const vv = memoMethod(k7, v8, { + const v2 = this.get(k7, options); + if (!forceRefresh && v2 !== void 0) + return v2; + const vv = memoMethod(k7, v2, { options, context: context5 }); @@ -186029,9 +190539,9 @@ var LRUCache = class _LRUCache { status.get = "miss"; } } - #connect(p6, n12) { - this.#prev[n12] = p6; - this.#next[p6] = n12; + #connect(p2, n8) { + this.#prev[n8] = p2; + this.#next[p2] = n8; } #moveToTail(index2) { if (index2 !== this.#tail) { @@ -186062,15 +190572,15 @@ var LRUCache = class _LRUCache { this.#clear(reason); } else { this.#removeItemSize(index2); - const v8 = this.#valList[index2]; - if (this.#isBackgroundFetch(v8)) { - v8.__abortController.abort(new Error("deleted")); + const v2 = this.#valList[index2]; + if (this.#isBackgroundFetch(v2)) { + v2.__abortController.abort(new Error("deleted")); } else if (this.#hasDispose || this.#hasDisposeAfter) { if (this.#hasDispose) { - this.#dispose?.(v8, k7, reason); + this.#dispose?.(v2, k7, reason); } if (this.#hasDisposeAfter) { - this.#disposed?.push([v8, k7, reason]); + this.#disposed?.push([v2, k7, reason]); } } this.#keyMap.delete(k7); @@ -186108,16 +190618,16 @@ var LRUCache = class _LRUCache { } #clear(reason) { for (const index2 of this.#rindexes({ allowStale: true })) { - const v8 = this.#valList[index2]; - if (this.#isBackgroundFetch(v8)) { - v8.__abortController.abort(new Error("deleted")); + const v2 = this.#valList[index2]; + if (this.#isBackgroundFetch(v2)) { + v2.__abortController.abort(new Error("deleted")); } else { const k7 = this.#keyList[index2]; if (this.#hasDispose) { - this.#dispose?.(v8, k7, reason); + this.#dispose?.(v2, k7, reason); } if (this.#hasDisposeAfter) { - this.#disposed?.push([v8, k7, reason]); + this.#disposed?.push([v2, k7, reason]); } } } @@ -186161,10 +190671,10 @@ var proc = typeof process === "object" && process ? process : { stdout: null, stderr: null }; -var isStream = (s6) => !!s6 && typeof s6 === "object" && (s6 instanceof Minipass || s6 instanceof Stream || isReadable(s6) || isWritable(s6)); -var isReadable = (s6) => !!s6 && typeof s6 === "object" && s6 instanceof EventEmitter3 && typeof s6.pipe === "function" && // node core Writable streams have a pipe() method, but it throws -s6.pipe !== Stream.Writable.prototype.pipe; -var isWritable = (s6) => !!s6 && typeof s6 === "object" && s6 instanceof EventEmitter3 && typeof s6.write === "function" && typeof s6.end === "function"; +var isStream = (s) => !!s && typeof s === "object" && (s instanceof Minipass || s instanceof Stream || isReadable(s) || isWritable(s)); +var isReadable = (s) => !!s && typeof s === "object" && s instanceof EventEmitter3 && typeof s.pipe === "function" && // node core Writable streams have a pipe() method, but it throws +s.pipe !== Stream.Writable.prototype.pipe; +var isWritable = (s) => !!s && typeof s === "object" && s instanceof EventEmitter3 && typeof s.write === "function" && typeof s.end === "function"; var EOF = /* @__PURE__ */ Symbol("EOF"); var MAYBE_EMIT_END = /* @__PURE__ */ Symbol("maybeEmitEnd"); var EMITTED_END = /* @__PURE__ */ Symbol("emittedEnd"); @@ -186238,8 +190748,8 @@ var PipeProxyErrors = class extends Pipe { src.on("error", this.proxyErrors); } }; -var isObjectModeOptions = (o6) => !!o6.objectMode; -var isEncodingOptions = (o6) => !o6.objectMode && !!o6.encoding && o6.encoding !== "buffer"; +var isObjectModeOptions = (o2) => !!o2.objectMode; +var isEncodingOptions = (o2) => !o2.objectMode && !!o2.encoding && o2.encoding !== "buffer"; var Minipass = class extends EventEmitter3 { [FLOWING] = false; [PAUSED] = false; @@ -186461,40 +190971,40 @@ var Minipass = class extends EventEmitter3 { * If `n` is greater that the amount of data in the internal buffer, * then `null` is returned. */ - read(n12) { + read(n8) { if (this[DESTROYED]) return null; this[DISCARDED] = false; - if (this[BUFFERLENGTH] === 0 || n12 === 0 || n12 && n12 > this[BUFFERLENGTH]) { + if (this[BUFFERLENGTH] === 0 || n8 === 0 || n8 && n8 > this[BUFFERLENGTH]) { this[MAYBE_EMIT_END](); return null; } if (this[OBJECTMODE]) - n12 = null; + n8 = null; if (this[BUFFER].length > 1 && !this[OBJECTMODE]) { this[BUFFER] = [ this[ENCODING] ? this[BUFFER].join("") : Buffer.concat(this[BUFFER], this[BUFFERLENGTH]) ]; } - const ret = this[READ](n12 || null, this[BUFFER][0]); + const ret = this[READ](n8 || null, this[BUFFER][0]); this[MAYBE_EMIT_END](); return ret; } - [READ](n12, chunk) { + [READ](n8, chunk) { if (this[OBJECTMODE]) this[BUFFERSHIFT](); else { const c6 = chunk; - if (n12 === c6.length || n12 === null) + if (n8 === c6.length || n8 === null) this[BUFFERSHIFT](); else if (typeof c6 === "string") { - this[BUFFER][0] = c6.slice(n12); - chunk = c6.slice(0, n12); - this[BUFFERLENGTH] -= n12; + this[BUFFER][0] = c6.slice(n8); + chunk = c6.slice(0, n8); + this[BUFFERLENGTH] -= n8; } else { - this[BUFFER][0] = c6.subarray(n12); - chunk = c6.subarray(0, n12); - this[BUFFERLENGTH] -= n12; + this[BUFFER][0] = c6.subarray(n8); + chunk = c6.subarray(0, n8); + this[BUFFERLENGTH] -= n8; } } this.emit("data", chunk); @@ -186638,16 +191148,16 @@ var Minipass = class extends EventEmitter3 { * {@link Minipass#resume} is explicitly called. */ unpipe(dest) { - const p6 = this[PIPES].find((p7) => p7.dest === dest); - if (p6) { + const p2 = this[PIPES].find((p3) => p3.dest === dest); + if (p2) { if (this[PIPES].length === 1) { if (this[FLOWING] && this[DATALISTENERS] === 0) { this[FLOWING] = false; } this[PIPES] = []; } else - this[PIPES].splice(this[PIPES].indexOf(p6), 1); - p6.unpipe(); + this[PIPES].splice(this[PIPES].indexOf(p2), 1); + p2.unpipe(); } } /** @@ -186813,8 +191323,8 @@ var Minipass = class extends EventEmitter3 { return ret; } [EMITDATA](data) { - for (const p6 of this[PIPES]) { - if (p6.dest.write(data) === false) + for (const p2 of this[PIPES]) { + if (p2.dest.write(data) === false) this.pause(); } const ret = this[DISCARDED] ? false : super.emit("data", data); @@ -186832,15 +191342,15 @@ var Minipass = class extends EventEmitter3 { if (this[DECODER]) { const data = this[DECODER].end(); if (data) { - for (const p6 of this[PIPES]) { - p6.dest.write(data); + for (const p2 of this[PIPES]) { + p2.dest.write(data); } if (!this[DISCARDED]) super.emit("data", data); } } - for (const p6 of this[PIPES]) { - p6.end(); + for (const p2 of this[PIPES]) { + p2.end(); } const ret = super.emit("end"); this.removeAllListeners("end"); @@ -186856,13 +191366,13 @@ var Minipass = class extends EventEmitter3 { }); if (!this[OBJECTMODE]) buf.dataLength = 0; - const p6 = this.promise(); + const p2 = this.promise(); this.on("data", (c6) => { buf.push(c6); if (!this[OBJECTMODE]) buf.dataLength += c6.length; }); - await p6; + await p2; return buf; } /** @@ -186882,10 +191392,10 @@ var Minipass = class extends EventEmitter3 { * Return a void Promise that resolves once the stream ends. */ async promise() { - return new Promise((resolve4, reject2) => { + return new Promise((resolve8, reject2) => { this.on(DESTROYED, () => reject2(new Error("stream destroyed"))); this.on("error", (er) => reject2(er)); - this.on("end", () => resolve4()); + this.on("end", () => resolve8()); }); } /** @@ -186909,7 +191419,7 @@ var Minipass = class extends EventEmitter3 { return Promise.resolve({ done: false, value: res }); if (this[EOF]) return stop(); - let resolve4; + let resolve8; let reject2; const onerr = (er) => { this.off("data", ondata); @@ -186923,19 +191433,19 @@ var Minipass = class extends EventEmitter3 { this.off("end", onend); this.off(DESTROYED, ondestroy); this.pause(); - resolve4({ value, done: !!this[EOF] }); + resolve8({ value, done: !!this[EOF] }); }; const onend = () => { this.off("error", onerr); this.off("data", ondata); this.off(DESTROYED, ondestroy); stop(); - resolve4({ done: true, value: void 0 }); + resolve8({ done: true, value: void 0 }); }; const ondestroy = () => onerr(new Error("stream destroyed")); return new Promise((res2, rej) => { reject2 = rej; - resolve4 = res2; + resolve8 = res2; this.once(DESTROYED, ondestroy); this.once("error", onerr); this.once("end", onend); @@ -187079,24 +191589,24 @@ var ENOREADLINK = 256; var ENOREALPATH = 512; var ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH; var TYPEMASK = 1023; -var entToType = (s6) => s6.isFile() ? IFREG : s6.isDirectory() ? IFDIR : s6.isSymbolicLink() ? IFLNK : s6.isCharacterDevice() ? IFCHR : s6.isBlockDevice() ? IFBLK : s6.isSocket() ? IFSOCK : s6.isFIFO() ? IFIFO : UNKNOWN; +var entToType = (s) => s.isFile() ? IFREG : s.isDirectory() ? IFDIR : s.isSymbolicLink() ? IFLNK : s.isCharacterDevice() ? IFCHR : s.isBlockDevice() ? IFBLK : s.isSocket() ? IFSOCK : s.isFIFO() ? IFIFO : UNKNOWN; var normalizeCache = new LRUCache({ max: 2 ** 12 }); -var normalize2 = (s6) => { - const c6 = normalizeCache.get(s6); +var normalize2 = (s) => { + const c6 = normalizeCache.get(s); if (c6) return c6; - const n12 = s6.normalize("NFKD"); - normalizeCache.set(s6, n12); - return n12; + const n8 = s.normalize("NFKD"); + normalizeCache.set(s, n8); + return n8; }; var normalizeNocaseCache = new LRUCache({ max: 2 ** 12 }); -var normalizeNocase = (s6) => { - const c6 = normalizeNocaseCache.get(s6); +var normalizeNocase = (s) => { + const c6 = normalizeNocaseCache.get(s); if (c6) return c6; - const n12 = normalize2(s6.toLowerCase()); - normalizeNocaseCache.set(s6, n12); - return n12; + const n8 = normalize2(s.toLowerCase()); + normalizeNocaseCache.set(s, n8); + return n8; }; var ResolveCache = class extends LRUCache { constructor() { @@ -187263,13 +191773,13 @@ var PathBase = class { * * @internal */ - constructor(name, type = UNKNOWN, root, roots, nocase, children2, opts) { + constructor(name, type = UNKNOWN, root6, roots, nocase, children2, opts) { this.name = name; this.#matchName = nocase ? normalizeNocase(name) : normalize2(name); this.#type = type & TYPEMASK; this.nocase = nocase; this.roots = roots; - this.root = root || this; + this.root = root6 || this; this.#children = children2; this.#fullpath = opts.fullpath; this.#relative = opts.relative; @@ -187313,11 +191823,11 @@ var PathBase = class { return result; } #resolveParts(dirParts) { - let p6 = this; + let p2 = this; for (const part of dirParts) { - p6 = p6.child(part); + p2 = p2.child(part); } - return p6; + return p2; } /** * Returns the cached children Path objects, if still available. If they @@ -187359,13 +191869,13 @@ var PathBase = class { } const children2 = this.children(); const name = this.nocase ? normalizeNocase(pathPart) : normalize2(pathPart); - for (const p6 of children2) { - if (p6.#matchName === name) { - return p6; + for (const p2 of children2) { + if (p2.#matchName === name) { + return p2; } } - const s6 = this.parent ? this.sep : ""; - const fullpath = this.#fullpath ? this.#fullpath + s6 + pathPart : void 0; + const s = this.parent ? this.sep : ""; + const fullpath = this.#fullpath ? this.#fullpath + s + pathPart : void 0; const pchild = this.newChild(pathPart, UNKNOWN, { ...opts, parent: this, @@ -187388,12 +191898,12 @@ var PathBase = class { return this.#relative; } const name = this.name; - const p6 = this.parent; - if (!p6) { + const p2 = this.parent; + if (!p2) { return this.#relative = this.name; } - const pv = p6.relative(); - return pv + (!pv || !p6.parent ? "" : this.sep) + name; + const pv = p2.relative(); + return pv + (!pv || !p2.parent ? "" : this.sep) + name; } /** * The relative path from the cwd, using / as the path separator. @@ -187409,12 +191919,12 @@ var PathBase = class { if (this.#relativePosix !== void 0) return this.#relativePosix; const name = this.name; - const p6 = this.parent; - if (!p6) { + const p2 = this.parent; + if (!p2) { return this.#relativePosix = this.fullpathPosix(); } - const pv = p6.relativePosix(); - return pv + (!pv || !p6.parent ? "" : "/") + name; + const pv = p2.relativePosix(); + return pv + (!pv || !p2.parent ? "" : "/") + name; } /** * The fully resolved path string for this Path entry @@ -187424,12 +191934,12 @@ var PathBase = class { return this.#fullpath; } const name = this.name; - const p6 = this.parent; - if (!p6) { + const p2 = this.parent; + if (!p2) { return this.#fullpath = this.name; } - const pv = p6.fullpath(); - const fp = pv + (!p6.parent ? "" : this.sep) + name; + const pv = p2.fullpath(); + const fp = pv + (!p2.parent ? "" : this.sep) + name; return this.#fullpath = fp; } /** @@ -187444,16 +191954,16 @@ var PathBase = class { if (this.sep === "/") return this.#fullpathPosix = this.fullpath(); if (!this.parent) { - const p7 = this.fullpath().replace(/\\/g, "/"); - if (/^[a-z]:\//i.test(p7)) { - return this.#fullpathPosix = `//?/${p7}`; + const p3 = this.fullpath().replace(/\\/g, "/"); + if (/^[a-z]:\//i.test(p3)) { + return this.#fullpathPosix = `//?/${p3}`; } else { - return this.#fullpathPosix = p7; + return this.#fullpathPosix = p3; } } - const p6 = this.parent; - const pfpp = p6.fullpathPosix(); - const fpp = pfpp + (!pfpp || !p6.parent ? "" : "/") + this.name; + const p2 = this.parent; + const pfpp = p2.fullpathPosix(); + const fpp = pfpp + (!pfpp || !p2.parent ? "" : "/") + this.name; return this.#fullpathPosix = fpp; } /** @@ -187602,8 +192112,8 @@ var PathBase = class { * Always use this method instead of testing the `path.name` property * directly. */ - isNamed(n12) { - return !this.nocase ? this.#matchName === normalize2(n12) : this.#matchName === normalizeNocase(n12); + isNamed(n8) { + return !this.nocase ? this.#matchName === normalize2(n8) : this.#matchName === normalizeNocase(n8); } /** * Return the Path object corresponding to the target of a symbolic link. @@ -187662,8 +192172,8 @@ var PathBase = class { } #readdirSuccess(children2) { this.#type |= READDIR_CALLED; - for (let p6 = children2.provisional; p6 < children2.length; p6++) { - const c6 = children2[p6]; + for (let p2 = children2.provisional; p2 < children2.length; p2++) { + const c6 = children2[p2]; if (c6) c6.#markENOENT(); } @@ -187677,8 +192187,8 @@ var PathBase = class { #markChildrenENOENT() { const children2 = this.children(); children2.provisional = 0; - for (const p6 of children2) { - p6.#markENOENT(); + for (const p2 of children2) { + p2.#markENOENT(); } } #markENOREALPATH() { @@ -187689,10 +192199,10 @@ var PathBase = class { #markENOTDIR() { if (this.#type & ENOTDIR) return; - let t6 = this.#type; - if ((t6 & IFMT) === IFDIR) - t6 &= IFMT_UNKNOWN; - this.#type = t6 | ENOTDIR; + let t = this.#type; + if ((t & IFMT) === IFDIR) + t &= IFMT_UNKNOWN; + this.#type = t | ENOTDIR; this.#markChildrenENOENT(); } #readdirFail(code = "") { @@ -187706,8 +192216,8 @@ var PathBase = class { } #lstatFail(code = "") { if (code === "ENOTDIR") { - const p6 = this.parent; - p6.#markENOTDIR(); + const p2 = this.parent; + p2.#markENOTDIR(); } else if (code === "ENOENT") { this.#markENOENT(); } @@ -187740,29 +192250,29 @@ var PathBase = class { return child; } #readdirMaybePromoteChild(e6, c6) { - for (let p6 = c6.provisional; p6 < c6.length; p6++) { - const pchild = c6[p6]; + for (let p2 = c6.provisional; p2 < c6.length; p2++) { + const pchild = c6[p2]; const name = this.nocase ? normalizeNocase(e6.name) : normalize2(e6.name); if (name !== pchild.#matchName) { continue; } - return this.#readdirPromoteChild(e6, pchild, p6, c6); + return this.#readdirPromoteChild(e6, pchild, p2, c6); } } - #readdirPromoteChild(e6, p6, index2, c6) { - const v8 = p6.name; - p6.#type = p6.#type & IFMT_UNKNOWN | entToType(e6); - if (v8 !== e6.name) - p6.name = e6.name; + #readdirPromoteChild(e6, p2, index2, c6) { + const v2 = p2.name; + p2.#type = p2.#type & IFMT_UNKNOWN | entToType(e6); + if (v2 !== e6.name) + p2.name = e6.name; if (index2 !== c6.provisional) { if (index2 === c6.length - 1) c6.pop(); else c6.splice(index2, 1); - c6.unshift(p6); + c6.unshift(p2); } c6.provisional++; - return p6; + return p2; } /** * Call lstat() on this Path, and update all known information that can be @@ -187911,9 +192421,9 @@ var PathBase = class { if (this.#asyncReaddirInFlight) { await this.#asyncReaddirInFlight; } else { - let resolve4 = () => { + let resolve8 = () => { }; - this.#asyncReaddirInFlight = new Promise((res) => resolve4 = res); + this.#asyncReaddirInFlight = new Promise((res) => resolve8 = res); try { for (const e6 of await this.#fs.promises.readdir(fullpath, { withFileTypes: true @@ -187926,7 +192436,7 @@ var PathBase = class { children2.provisional = 0; } this.#asyncReaddirInFlight = void 0; - resolve4(); + resolve8(); } return children2.slice(0, children2.provisional); } @@ -188016,19 +192526,19 @@ var PathBase = class { this.isCWD = true; const changed = /* @__PURE__ */ new Set([]); let rp = []; - let p6 = this; - while (p6 && p6.parent) { - changed.add(p6); - p6.#relative = rp.join(this.sep); - p6.#relativePosix = rp.join("/"); - p6 = p6.parent; + let p2 = this; + while (p2 && p2.parent) { + changed.add(p2); + p2.#relative = rp.join(this.sep); + p2.#relativePosix = rp.join("/"); + p2 = p2.parent; rp.push(".."); } - p6 = oldCwd; - while (p6 && p6.parent && !changed.has(p6)) { - p6.#relative = void 0; - p6.#relativePosix = void 0; - p6 = p6.parent; + p2 = oldCwd; + while (p2 && p2.parent && !changed.has(p2)) { + p2.#relative = void 0; + p2.#relativePosix = void 0; + p2 = p2.parent; } } }; @@ -188047,8 +192557,8 @@ var PathWin32 = class _PathWin32 extends PathBase { * * @internal */ - constructor(name, type = UNKNOWN, root, roots, nocase, children2, opts) { - super(name, type, root, roots, nocase, children2, opts); + constructor(name, type = UNKNOWN, root6, roots, nocase, children2, opts) { + super(name, type, root6, roots, nocase, children2, opts); } /** * @internal @@ -188070,9 +192580,9 @@ var PathWin32 = class _PathWin32 extends PathBase { if (rootPath === this.root.name) { return this.root; } - for (const [compare, root] of Object.entries(this.roots)) { + for (const [compare, root6] of Object.entries(this.roots)) { if (this.sameRoot(rootPath, compare)) { - return this.roots[rootPath] = root; + return this.roots[rootPath] = root6; } } return this.roots[rootPath] = new PathScurryWin32(rootPath, this).root; @@ -188100,8 +192610,8 @@ var PathPosix = class _PathPosix extends PathBase { * * @internal */ - constructor(name, type = UNKNOWN, root, roots, nocase, children2, opts) { - super(name, type, root, roots, nocase, children2, opts); + constructor(name, type = UNKNOWN, root6, roots, nocase, children2, opts) { + super(name, type, root6, roots, nocase, children2, opts); } /** * @internal @@ -188167,9 +192677,9 @@ var PathScurryBase = class { this.#resolveCache = new ResolveCache(); this.#resolvePosixCache = new ResolveCache(); this.#children = new ChildrenCache(childrenCacheSize); - const split = cwdPath.substring(this.rootPath.length).split(sep7); - if (split.length === 1 && !split[0]) { - split.pop(); + const split2 = cwdPath.substring(this.rootPath.length).split(sep7); + if (split2.length === 1 && !split2[0]) { + split2.pop(); } if (nocase === void 0) { throw new TypeError("must provide nocase setting to PathScurryBase ctor"); @@ -188178,15 +192688,15 @@ var PathScurryBase = class { this.root = this.newRoot(this.#fs); this.roots[this.rootPath] = this.root; let prev = this.root; - let len = split.length - 1; + let len = split2.length - 1; const joinSep = pathImpl.sep; let abs = this.rootPath; let sawFirst = false; - for (const part of split) { - const l6 = len--; + for (const part of split2) { + const l3 = len--; prev = prev.child(part, { - relative: new Array(l6).fill("..").join(joinSep), - relativePosix: new Array(l6).fill("..").join("/"), + relative: new Array(l3).fill("..").join(joinSep), + relativePosix: new Array(l3).fill("..").join("/"), fullpath: abs += (sawFirst ? "" : joinSep) + part }); sawFirst = true; @@ -188223,11 +192733,11 @@ var PathScurryBase = class { resolve(...paths) { let r6 = ""; for (let i6 = paths.length - 1; i6 >= 0; i6--) { - const p6 = paths[i6]; - if (!p6 || p6 === ".") + const p2 = paths[i6]; + if (!p2 || p2 === ".") continue; - r6 = r6 ? `${p6}/${r6}` : p6; - if (this.isAbsolute(p6)) { + r6 = r6 ? `${p2}/${r6}` : p2; + if (this.isAbsolute(p2)) { break; } } @@ -188253,11 +192763,11 @@ var PathScurryBase = class { resolvePosix(...paths) { let r6 = ""; for (let i6 = paths.length - 1; i6 >= 0; i6--) { - const p6 = paths[i6]; - if (!p6 || p6 === ".") + const p2 = paths[i6]; + if (!p2 || p2 === ".") continue; - r6 = r6 ? `${p6}/${r6}` : p6; - if (this.isAbsolute(p6)) { + r6 = r6 ? `${p2}/${r6}` : p2; + if (this.isAbsolute(p2)) { break; } } @@ -188319,8 +192829,8 @@ var PathScurryBase = class { if (!entry.canReaddir()) { return []; } else { - const p6 = await entry.readdir(); - return withFileTypes ? p6 : p6.map((e6) => e6.name); + const p2 = await entry.readdir(); + return withFileTypes ? p2 : p2.map((e6) => e6.name); } } readdirSync(entry = this.cwd, opts = { @@ -188702,8 +193212,8 @@ var PathScurryWin32 = class extends PathScurryBase { const { nocase = true } = opts; super(cwd, win32, "\\", { ...opts, nocase }); this.nocase = nocase; - for (let p6 = this.cwd; p6; p6 = p6.parent) { - p6.nocase = this.nocase; + for (let p2 = this.cwd; p2; p2 = p2.parent) { + p2.nocase = this.nocase; } } /** @@ -188721,8 +193231,8 @@ var PathScurryWin32 = class extends PathScurryBase { /** * Return true if the provided path string is an absolute path */ - isAbsolute(p6) { - return p6.startsWith("/") || p6.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(p6); + isAbsolute(p2) { + return p2.startsWith("/") || p2.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(p2); } }; var PathScurryPosix = class extends PathScurryBase { @@ -188750,8 +193260,8 @@ var PathScurryPosix = class extends PathScurryBase { /** * Return true if the provided path string is an absolute path */ - isAbsolute(p6) { - return p6.startsWith("/"); + isAbsolute(p2) { + return p2.startsWith("/"); } }; var PathScurryDarwin = class extends PathScurryPosix { @@ -188798,15 +193308,15 @@ var Pattern = class _Pattern { this.#platform = platform3; if (this.#index === 0) { if (this.isUNC()) { - const [p0, p1, p22, p32, ...prest] = this.#patternList; + const [p0, p1, p2, p3, ...prest] = this.#patternList; const [g0, g1, g22, g32, ...grest] = this.#globList; if (prest[0] === "") { prest.shift(); grest.shift(); } - const p6 = [p0, p1, p22, p32, ""].join("/"); + const p4 = [p0, p1, p2, p3, ""].join("/"); const g6 = [g0, g1, g22, g32, ""].join("/"); - this.#patternList = [p6, ...prest]; + this.#patternList = [p4, ...prest]; this.#globList = [g6, ...grest]; this.length = this.#patternList.length; } else if (this.isDrive() || this.isAbsolute()) { @@ -188816,9 +193326,9 @@ var Pattern = class _Pattern { prest.shift(); grest.shift(); } - const p6 = p1 + "/"; + const p2 = p1 + "/"; const g6 = g1 + "/"; - this.#patternList = [p6, ...prest]; + this.#patternList = [p2, ...prest]; this.#globList = [g6, ...grest]; this.length = this.#patternList.length; } @@ -188907,8 +193417,8 @@ var Pattern = class _Pattern { * consume the root of the pattern, and return it */ root() { - const p6 = this.#patternList[0]; - return typeof p6 === "string" && this.isAbsolute() && this.#index === 0 ? p6 : ""; + const p2 = this.#patternList[0]; + return typeof p2 === "string" && this.isAbsolute() && this.#index === 0 ? p2 : ""; } /** * Check to see if the current globstar pattern is allowed to follow @@ -188969,46 +193479,46 @@ var Ignore = class { parsed.shift(); globParts.shift(); } - const p6 = new Pattern(parsed, globParts, 0, this.platform); - const m6 = new Minimatch(p6.globString(), this.mmopts); + const p2 = new Pattern(parsed, globParts, 0, this.platform); + const m3 = new Minimatch(p2.globString(), this.mmopts); const children2 = globParts[globParts.length - 1] === "**"; - const absolute = p6.isAbsolute(); + const absolute = p2.isAbsolute(); if (absolute) - this.absolute.push(m6); + this.absolute.push(m3); else - this.relative.push(m6); + this.relative.push(m3); if (children2) { if (absolute) - this.absoluteChildren.push(m6); + this.absoluteChildren.push(m3); else - this.relativeChildren.push(m6); + this.relativeChildren.push(m3); } } } - ignored(p6) { - const fullpath = p6.fullpath(); + ignored(p2) { + const fullpath = p2.fullpath(); const fullpaths = `${fullpath}/`; - const relative2 = p6.relative() || "."; - const relatives = `${relative2}/`; - for (const m6 of this.relative) { - if (m6.match(relative2) || m6.match(relatives)) + const relative3 = p2.relative() || "."; + const relatives = `${relative3}/`; + for (const m3 of this.relative) { + if (m3.match(relative3) || m3.match(relatives)) return true; } - for (const m6 of this.absolute) { - if (m6.match(fullpath) || m6.match(fullpaths)) + for (const m3 of this.absolute) { + if (m3.match(fullpath) || m3.match(fullpaths)) return true; } return false; } - childrenIgnored(p6) { - const fullpath = p6.fullpath() + "/"; - const relative2 = (p6.relative() || ".") + "/"; - for (const m6 of this.relativeChildren) { - if (m6.match(relative2)) + childrenIgnored(p2) { + const fullpath = p2.fullpath() + "/"; + const relative3 = (p2.relative() || ".") + "/"; + for (const m3 of this.relativeChildren) { + if (m3.match(relative3)) return true; } - for (const m6 of this.absoluteChildren) { - if (m6.match(fullpath)) + for (const m3 of this.absoluteChildren) { + if (m3.match(fullpath)) return true; } return false; @@ -189039,16 +193549,16 @@ var HasWalkedCache = class _HasWalkedCache { var MatchRecord = class { store = /* @__PURE__ */ new Map(); add(target, absolute, ifDir) { - const n12 = (absolute ? 2 : 0) | (ifDir ? 1 : 0); + const n8 = (absolute ? 2 : 0) | (ifDir ? 1 : 0); const current = this.store.get(target); - this.store.set(target, current === void 0 ? n12 : n12 & current); + this.store.set(target, current === void 0 ? n8 : n8 & current); } // match, absolute, ifdir entries() { - return [...this.store.entries()].map(([path10, n12]) => [ + return [...this.store.entries()].map(([path10, n8]) => [ path10, - !!(n12 & 2), - !!(n12 & 1) + !!(n8 & 2), + !!(n8 & 1) ]); } }; @@ -189060,7 +193570,7 @@ var SubWalks = class { } const subs = this.store.get(target); if (subs) { - if (!subs.find((p6) => p6.globString() === pattern.globString())) { + if (!subs.find((p2) => p2.globString() === pattern.globString())) { subs.push(pattern); } } else @@ -189077,7 +193587,7 @@ var SubWalks = class { return this.keys().map((k7) => [k7, this.store.get(k7)]); } keys() { - return [...this.store.keys()].filter((t6) => t6.canReaddir()); + return [...this.store.keys()].filter((t) => t.canReaddir()); } }; var Processor = class _Processor { @@ -189096,54 +193606,54 @@ var Processor = class _Processor { } processPatterns(target, patterns) { this.patterns = patterns; - const processingSet = patterns.map((p6) => [target, p6]); - for (let [t6, pattern] of processingSet) { - this.hasWalkedCache.storeWalked(t6, pattern); - const root = pattern.root(); + const processingSet = patterns.map((p2) => [target, p2]); + for (let [t, pattern] of processingSet) { + this.hasWalkedCache.storeWalked(t, pattern); + const root6 = pattern.root(); const absolute = pattern.isAbsolute() && this.opts.absolute !== false; - if (root) { - t6 = t6.resolve(root === "/" && this.opts.root !== void 0 ? this.opts.root : root); + if (root6) { + t = t.resolve(root6 === "/" && this.opts.root !== void 0 ? this.opts.root : root6); const rest2 = pattern.rest(); if (!rest2) { - this.matches.add(t6, true, false); + this.matches.add(t, true, false); continue; } else { pattern = rest2; } } - if (t6.isENOENT()) + if (t.isENOENT()) continue; - let p6; + let p2; let rest; let changed = false; - while (typeof (p6 = pattern.pattern()) === "string" && (rest = pattern.rest())) { - const c6 = t6.resolve(p6); - t6 = c6; + while (typeof (p2 = pattern.pattern()) === "string" && (rest = pattern.rest())) { + const c6 = t.resolve(p2); + t = c6; pattern = rest; changed = true; } - p6 = pattern.pattern(); + p2 = pattern.pattern(); rest = pattern.rest(); if (changed) { - if (this.hasWalkedCache.hasWalked(t6, pattern)) + if (this.hasWalkedCache.hasWalked(t, pattern)) continue; - this.hasWalkedCache.storeWalked(t6, pattern); + this.hasWalkedCache.storeWalked(t, pattern); } - if (typeof p6 === "string") { - const ifDir = p6 === ".." || p6 === "" || p6 === "."; - this.matches.add(t6.resolve(p6), absolute, ifDir); + if (typeof p2 === "string") { + const ifDir = p2 === ".." || p2 === "" || p2 === "."; + this.matches.add(t.resolve(p2), absolute, ifDir); continue; - } else if (p6 === GLOBSTAR) { - if (!t6.isSymbolicLink() || this.follow || pattern.checkFollowGlobstar()) { - this.subwalks.add(t6, pattern); + } else if (p2 === GLOBSTAR) { + if (!t.isSymbolicLink() || this.follow || pattern.checkFollowGlobstar()) { + this.subwalks.add(t, pattern); } const rp = rest?.pattern(); const rrest = rest?.rest(); if (!rest || (rp === "" || rp === ".") && !rrest) { - this.matches.add(t6, absolute, rp === "" || rp === "."); + this.matches.add(t, absolute, rp === "" || rp === "."); } else { if (rp === "..") { - const tp = t6.parent || t6; + const tp = t.parent || t; if (!rrest) this.matches.add(tp, absolute, true); else if (!this.hasWalkedCache.hasWalked(tp, rrest)) { @@ -189151,8 +193661,8 @@ var Processor = class _Processor { } } } - } else if (p6 instanceof RegExp) { - this.subwalks.add(t6, pattern); + } else if (p2 instanceof RegExp) { + this.subwalks.add(t, pattern); } } return this; @@ -189173,14 +193683,14 @@ var Processor = class _Processor { for (const e6 of entries) { for (const pattern of patterns) { const absolute = pattern.isAbsolute(); - const p6 = pattern.pattern(); + const p2 = pattern.pattern(); const rest = pattern.rest(); - if (p6 === GLOBSTAR) { + if (p2 === GLOBSTAR) { results.testGlobstar(e6, pattern, rest, absolute); - } else if (p6 instanceof RegExp) { - results.testRegExp(e6, p6, rest, absolute); + } else if (p2 instanceof RegExp) { + results.testRegExp(e6, p2, rest, absolute); } else { - results.testString(e6, p6, rest, absolute); + results.testString(e6, p2, rest, absolute); } } } @@ -189216,8 +193726,8 @@ var Processor = class _Processor { } } } - testRegExp(e6, p6, rest, absolute) { - if (!p6.test(e6.name)) + testRegExp(e6, p2, rest, absolute) { + if (!p2.test(e6.name)) return; if (!rest) { this.matches.add(e6, absolute, false); @@ -189225,8 +193735,8 @@ var Processor = class _Processor { this.subwalks.add(e6, rest); } } - testString(e6, p6, rest, absolute) { - if (!e6.isNamed(p6)) + testString(e6, p2, rest, absolute) { + if (!e6.isNamed(p2)) return; if (!rest) { this.matches.add(e6, absolute, false); @@ -189260,8 +193770,8 @@ var GlobUtil = class { if (opts.ignore || !this.includeChildMatches) { this.#ignore = makeIgnore(opts.ignore ?? [], opts); if (!this.includeChildMatches && typeof this.#ignore.add !== "function") { - const m6 = "cannot ignore child matches, ignore lacks add() method."; - throw new Error(m6); + const m3 = "cannot ignore child matches, ignore lacks add() method."; + throw new Error(m3); } } this.maxDepth = opts.maxDepth || Infinity; @@ -189313,14 +193823,14 @@ var GlobUtil = class { e6 = rpc; } const needStat = e6.isUnknown() || this.opts.stat; - const s6 = needStat ? await e6.lstat() : e6; - if (this.opts.follow && this.opts.nodir && s6?.isSymbolicLink()) { - const target = await s6.realpath(); + const s = needStat ? await e6.lstat() : e6; + if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) { + const target = await s.realpath(); if (target && (target.isUnknown() || this.opts.stat)) { await target.lstat(); } } - return this.matchCheckTest(s6, ifDir); + return this.matchCheckTest(s, ifDir); } matchCheckTest(e6, ifDir) { return e6 && (this.maxDepth === Infinity || e6.depth() <= this.maxDepth) && (!ifDir || e6.canReaddir()) && (!this.opts.nodir || !e6.isDirectory()) && (!this.opts.nodir || !this.opts.follow || !e6.isSymbolicLink() || !e6.realpathCached()?.isDirectory()) && !this.#ignored(e6) ? e6 : void 0; @@ -189336,14 +193846,14 @@ var GlobUtil = class { e6 = rpc; } const needStat = e6.isUnknown() || this.opts.stat; - const s6 = needStat ? e6.lstatSync() : e6; - if (this.opts.follow && this.opts.nodir && s6?.isSymbolicLink()) { - const target = s6.realpathSync(); + const s = needStat ? e6.lstatSync() : e6; + if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) { + const target = s.realpathSync(); if (target && (target?.isUnknown() || this.opts.stat)) { target.lstatSync(); } } - return this.matchCheckTest(s6, ifDir); + return this.matchCheckTest(s, ifDir); } matchFinish(e6, absolute) { if (this.#ignored(e6)) @@ -189367,14 +193877,14 @@ var GlobUtil = class { } } async match(e6, absolute, ifDir) { - const p6 = await this.matchCheck(e6, ifDir); - if (p6) - this.matchFinish(p6, absolute); + const p2 = await this.matchCheck(e6, ifDir); + if (p2) + this.matchFinish(p2, absolute); } matchSync(e6, absolute, ifDir) { - const p6 = this.matchCheckSync(e6, ifDir); - if (p6) - this.matchFinish(p6, absolute); + const p2 = this.matchCheckSync(e6, ifDir); + if (p2) + this.matchFinish(p2, absolute); } walkCB(target, patterns, cb) { if (this.signal?.aborted) @@ -189396,22 +193906,22 @@ var GlobUtil = class { if (--tasks === 0) cb(); }; - for (const [m6, absolute, ifDir] of processor.matches.entries()) { - if (this.#ignored(m6)) + for (const [m3, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m3)) continue; tasks++; - this.match(m6, absolute, ifDir).then(() => next()); + this.match(m3, absolute, ifDir).then(() => next()); } - for (const t6 of processor.subwalkTargets()) { - if (this.maxDepth !== Infinity && t6.depth() >= this.maxDepth) { + for (const t of processor.subwalkTargets()) { + if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) { continue; } tasks++; - const childrenCached = t6.readdirCached(); - if (t6.calledReaddir()) - this.walkCB3(t6, childrenCached, processor, next); + const childrenCached = t.readdirCached(); + if (t.calledReaddir()) + this.walkCB3(t, childrenCached, processor, next); else { - t6.readdirCB((_3, entries) => this.walkCB3(t6, entries, processor, next), true); + t.readdirCB((_3, entries) => this.walkCB3(t, entries, processor, next), true); } } next(); @@ -189423,11 +193933,11 @@ var GlobUtil = class { if (--tasks === 0) cb(); }; - for (const [m6, absolute, ifDir] of processor.matches.entries()) { - if (this.#ignored(m6)) + for (const [m3, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m3)) continue; tasks++; - this.match(m6, absolute, ifDir).then(() => next()); + this.match(m3, absolute, ifDir).then(() => next()); } for (const [target2, patterns] of processor.subwalks.entries()) { tasks++; @@ -189455,18 +193965,18 @@ var GlobUtil = class { if (--tasks === 0) cb(); }; - for (const [m6, absolute, ifDir] of processor.matches.entries()) { - if (this.#ignored(m6)) + for (const [m3, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m3)) continue; - this.matchSync(m6, absolute, ifDir); + this.matchSync(m3, absolute, ifDir); } - for (const t6 of processor.subwalkTargets()) { - if (this.maxDepth !== Infinity && t6.depth() >= this.maxDepth) { + for (const t of processor.subwalkTargets()) { + if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) { continue; } tasks++; - const children2 = t6.readdirSync(); - this.walkCB3Sync(t6, children2, processor, next); + const children2 = t.readdirSync(); + this.walkCB3Sync(t, children2, processor, next); } next(); } @@ -189477,10 +193987,10 @@ var GlobUtil = class { if (--tasks === 0) cb(); }; - for (const [m6, absolute, ifDir] of processor.matches.entries()) { - if (this.#ignored(m6)) + for (const [m3, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m3)) continue; - this.matchSync(m6, absolute, ifDir); + this.matchSync(m3, absolute, ifDir); } for (const [target2, patterns] of processor.subwalks.entries()) { tasks++; @@ -189647,13 +194157,13 @@ var Glob = class { } this.windowsPathsNoEscape = !!opts.windowsPathsNoEscape || opts.allowWindowsEscape === false; if (this.windowsPathsNoEscape) { - pattern = pattern.map((p6) => p6.replace(/\\/g, "/")); + pattern = pattern.map((p2) => p2.replace(/\\/g, "/")); } if (this.matchBase) { if (opts.noglobstar) { throw new TypeError("base matching requires globstar"); } - pattern = pattern.map((p6) => p6.includes("/") ? p6 : `./**/${p6}`); + pattern = pattern.map((p2) => p2.includes("/") ? p2 : `./**/${p2}`); } this.pattern = pattern; this.platform = opts.platform || defaultPlatform3; @@ -189688,10 +194198,10 @@ var Glob = class { windowsPathsNoEscape: this.windowsPathsNoEscape, debug: !!this.opts.debug }; - const mms = this.pattern.map((p6) => new Minimatch(p6, mmo)); - const [matchSet, globParts] = mms.reduce((set, m6) => { - set[0].push(...m6.set); - set[1].push(...m6.globParts); + const mms = this.pattern.map((p2) => new Minimatch(p2, mmo)); + const [matchSet, globParts] = mms.reduce((set, m3) => { + set[0].push(...m3.set); + set[1].push(...m3.globParts); return set; }, [[], []]); this.patterns = matchSet.map((set, i6) => { @@ -189768,8 +194278,8 @@ var hasMagic = (pattern, options = {}) => { if (!Array.isArray(pattern)) { pattern = [pattern]; } - for (const p6 of pattern) { - if (new Minimatch(p6, options).hasMagic()) + for (const p2 of pattern) { + if (new Minimatch(p2, options).hasMagic()) return true; } return false; @@ -189993,17 +194503,17 @@ function serializeCTRFReport(report) { function sanitizeString(str) { if (str == null) return void 0; - let s6 = str; - s6 = s6.replace(/\uFEFF/g, ""); - s6 = s6.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, " "); - s6 = s6.replace(/[\uD800-\uDFFF]/g, "\uFFFD"); + let s = str; + s = s.replace(/\uFEFF/g, ""); + s = s.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, " "); + s = s.replace(/[\uD800-\uDFFF]/g, "\uFFFD"); try { - s6 = s6.normalize("NFC"); + s = s.normalize("NFC"); } catch { } - if (/^\s*$/.test(s6)) + if (/^\s*$/.test(s)) return void 0; - return s6; + return s; } function convertOutputToArray(output) { if (!output || output.trim() === "") { @@ -190729,14 +195239,14 @@ function registerAllHelpers() { // src/github/context.ts function getAllGitHubContext() { - const root = getRootContext(); + const root6 = getRootContext(); const additional = getAdditionalContext(); const repository = getRepositoryContext(); const pullRequest = getPullRequestContext(); const sender = getSenderContext(); const ghContext = context2.payload; return { - ...root, + ...root6, ...additional, repository, pullRequest, @@ -191102,10 +195612,10 @@ var HelperRegistry = class { var afterHelper = { name: "after", category: "Array", - fn: (array, n12) => { + fn: (array, n8) => { if (!Array.isArray(array)) return []; - const idx = typeof n12 === "number" ? n12 : parseInt(String(n12), 10); + const idx = typeof n8 === "number" ? n8 : parseInt(String(n8), 10); return array.slice(idx); } }; @@ -191123,10 +195633,10 @@ var arrayifyHelper = { var beforeHelper = { name: "before", category: "Array", - fn: (array, n12) => { + fn: (array, n8) => { if (!Array.isArray(array)) return []; - const idx = typeof n12 === "number" ? n12 : parseInt(String(n12), 10); + const idx = typeof n8 === "number" ? n8 : parseInt(String(n8), 10); return array.slice(0, idx); } }; @@ -191158,12 +195668,12 @@ var filterHelper = { var firstHelper = { name: "first", category: "Array", - fn: (array, n12) => { + fn: (array, n8) => { if (!Array.isArray(array)) return void 0; - if (n12 == null) + if (n8 == null) return array[0]; - const count = typeof n12 === "number" ? n12 : parseInt(String(n12), 10); + const count = typeof n8 === "number" ? n8 : parseInt(String(n8), 10); return array.slice(0, count); } }; @@ -191237,13 +195747,13 @@ var equalsLengthHelper = { var lastHelper = { name: "last", category: "Array", - fn: (value, n12) => { + fn: (value, n8) => { if (!Array.isArray(value) && typeof value !== "string") return void 0; const arr = typeof value === "string" ? value.split("") : value; - if (n12 == null) + if (n8 == null) return arr[arr.length - 1]; - const count = typeof n12 === "number" ? n12 : parseInt(String(n12), 10); + const count = typeof n8 === "number" ? n8 : parseInt(String(n8), 10); return arr.slice(-count); } }; @@ -191411,7 +195921,7 @@ var withGroupHelper = { for (let i6 = 0; i6 < array.length; i6 += groupSize) { groups.push(array.slice(i6, i6 + groupSize)); } - return groups.map((group4) => options.fn(group4)).join(""); + return groups.map((group3) => options.fn(group3)).join(""); } }; var withLastHelper = { @@ -192313,11 +196823,11 @@ var balanced2 = (a6, b6, str) => { }; }; var maybeMatch2 = (reg, str) => { - const m6 = str.match(reg); - return m6 ? m6[0] : null; + const m3 = str.match(reg); + return m3 ? m3[0] : null; }; var range4 = (a6, b6, str) => { - let begs, beg, left, right = void 0, result; + let begs, beg, left2, right2 = void 0, result; let ai2 = str.indexOf(a6); let bi2 = str.indexOf(b6, ai2 + 1); let i6 = ai2; @@ -192326,7 +196836,7 @@ var range4 = (a6, b6, str) => { return [ai2, bi2]; } begs = []; - left = str.length; + left2 = str.length; while (i6 >= 0 && !result) { if (i6 === ai2) { begs.push(i6); @@ -192337,16 +196847,16 @@ var range4 = (a6, b6, str) => { result = [r6, bi2]; } else { beg = begs.pop(); - if (beg !== void 0 && beg < left) { - left = beg; - right = bi2; + if (beg !== void 0 && beg < left2) { + left2 = beg; + right2 = bi2; } bi2 = str.indexOf(b6, i6 + 1); } i6 = ai2 < bi2 && ai2 >= 0 ? ai2 : bi2; } - if (begs.length && right !== void 0) { - result = [left, right]; + if (begs.length && right2 !== void 0) { + result = [left2, right2]; } } return result; @@ -192383,20 +196893,20 @@ function parseCommaParts2(str) { return [""]; } const parts = []; - const m6 = balanced2("{", "}", str); - if (!m6) { + const m3 = balanced2("{", "}", str); + if (!m3) { return str.split(","); } - const { pre, body: body2, post } = m6; - const p6 = pre.split(","); - p6[p6.length - 1] += "{" + body2 + "}"; + const { pre, body: body2, post } = m3; + const p2 = pre.split(","); + p2[p2.length - 1] += "{" + body2 + "}"; const postParts = parseCommaParts2(post); if (post.length) { ; - p6[p6.length - 1] += postParts.shift(); - p6.push.apply(p6, postParts); + p2[p2.length - 1] += postParts.shift(); + p2.push.apply(p2, postParts); } - parts.push.apply(parts, p6); + parts.push.apply(parts, p2); return parts; } function expand3(str, options = {}) { @@ -192415,63 +196925,63 @@ function embrace2(str) { function isPadded2(el) { return /^-?0\d/.test(el); } -function lte2(i6, y2) { - return i6 <= y2; +function lte2(i6, y) { + return i6 <= y; } -function gte2(i6, y2) { - return i6 >= y2; +function gte2(i6, y) { + return i6 >= y; } function expand_2(str, max, isTop) { const expansions = []; - const m6 = balanced2("{", "}", str); - if (!m6) + const m3 = balanced2("{", "}", str); + if (!m3) return [str]; - const pre = m6.pre; - const post = m6.post.length ? expand_2(m6.post, max, false) : [""]; - if (/\$$/.test(m6.pre)) { + const pre = m3.pre; + const post = m3.post.length ? expand_2(m3.post, max, false) : [""]; + if (/\$$/.test(m3.pre)) { for (let k7 = 0; k7 < post.length && k7 < max; k7++) { - const expansion = pre + "{" + m6.body + "}" + post[k7]; + const expansion = pre + "{" + m3.body + "}" + post[k7]; expansions.push(expansion); } } else { - const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m6.body); - const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m6.body); + const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m3.body); + const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m3.body); const isSequence = isNumericSequence || isAlphaSequence; - const isOptions = m6.body.indexOf(",") >= 0; + const isOptions = m3.body.indexOf(",") >= 0; if (!isSequence && !isOptions) { - if (m6.post.match(/,(?!,).*\}/)) { - str = m6.pre + "{" + m6.body + escClose2 + m6.post; + if (m3.post.match(/,(?!,).*\}/)) { + str = m3.pre + "{" + m3.body + escClose2 + m3.post; return expand_2(str, max, true); } return [str]; } - let n12; + let n8; if (isSequence) { - n12 = m6.body.split(/\.\./); + n8 = m3.body.split(/\.\./); } else { - n12 = parseCommaParts2(m6.body); - if (n12.length === 1 && n12[0] !== void 0) { - n12 = expand_2(n12[0], max, false).map(embrace2); - if (n12.length === 1) { - return post.map((p6) => m6.pre + n12[0] + p6); + n8 = parseCommaParts2(m3.body); + if (n8.length === 1 && n8[0] !== void 0) { + n8 = expand_2(n8[0], max, false).map(embrace2); + if (n8.length === 1) { + return post.map((p2) => m3.pre + n8[0] + p2); } } } let N2; - if (isSequence && n12[0] !== void 0 && n12[1] !== void 0) { - const x6 = numeric2(n12[0]); - const y2 = numeric2(n12[1]); - const width = Math.max(n12[0].length, n12[1].length); - let incr = n12.length === 3 && n12[2] !== void 0 ? Math.max(Math.abs(numeric2(n12[2])), 1) : 1; + if (isSequence && n8[0] !== void 0 && n8[1] !== void 0) { + const x2 = numeric2(n8[0]); + const y = numeric2(n8[1]); + const width = Math.max(n8[0].length, n8[1].length); + let incr = n8.length === 3 && n8[2] !== void 0 ? Math.max(Math.abs(numeric2(n8[2])), 1) : 1; let test = lte2; - const reverse = y2 < x6; + const reverse = y < x2; if (reverse) { incr *= -1; test = gte2; } - const pad = n12.some(isPadded2); + const pad = n8.some(isPadded2); N2 = []; - for (let i6 = x6; test(i6, y2); i6 += incr) { + for (let i6 = x2; test(i6, y) && N2.length < max; i6 += incr) { let c6; if (isAlphaSequence) { c6 = String.fromCharCode(i6); @@ -192483,11 +196993,11 @@ function expand_2(str, max, isTop) { if (pad) { const need = width - c6.length; if (need > 0) { - const z2 = new Array(need + 1).join("0"); + const z = new Array(need + 1).join("0"); if (i6 < 0) { - c6 = "-" + z2 + c6.slice(1); + c6 = "-" + z + c6.slice(1); } else { - c6 = z2 + c6; + c6 = z + c6; } } } @@ -192496,8 +197006,8 @@ function expand_2(str, max, isTop) { } } else { N2 = []; - for (let j7 = 0; j7 < n12.length; j7++) { - N2.push.apply(N2, expand_2(n12[j7], max, false)); + for (let j7 = 0; j7 < n8.length; j7++) { + N2.push.apply(N2, expand_2(n8[j7], max, false)); } } for (let j7 = 0; j7 < N2.length; j7++) { @@ -192540,8 +197050,8 @@ var posixClasses2 = { "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true], "[:xdigit:]": ["A-Fa-f0-9", false] }; -var braceEscape2 = (s6) => s6.replace(/[[\]\\-]/g, "\\$&"); -var regexpEscape2 = (s6) => s6.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); +var braceEscape2 = (s) => s.replace(/[[\]\\-]/g, "\\$&"); +var regexpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); var rangesToString2 = (ranges) => ranges.join(""); var parseClass2 = (glob2, position) => { const pos = position; @@ -192577,7 +197087,7 @@ var parseClass2 = (glob2, position) => { } } if (c6 === "[" && !escaping) { - for (const [cls, [unip, u6, neg]] of Object.entries(posixClasses2)) { + for (const [cls, [unip, u, neg]] of Object.entries(posixClasses2)) { if (glob2.startsWith(cls, i6)) { if (rangeStart) { return ["$.", false, glob2.length - pos, true]; @@ -192587,7 +197097,7 @@ var parseClass2 = (glob2, position) => { negs.push(unip); else ranges.push(unip); - uflag = uflag || u6; + uflag = uflag || u; continue WHILE; } } @@ -192633,11 +197143,11 @@ var parseClass2 = (glob2, position) => { }; // node_modules/handlebars-helpers-ctrf/node_modules/minimatch/dist/esm/unescape.js -var unescape3 = (s6, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => { +var unescape3 = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => { if (magicalBraces) { - return windowsPathsNoEscape ? s6.replace(/\[([^/\\])\]/g, "$1") : s6.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1"); + return windowsPathsNoEscape ? s.replace(/\[([^/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1"); } - return windowsPathsNoEscape ? s6.replace(/\[([^/\\{}])\]/g, "$1") : s6.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1"); + return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1"); }; // node_modules/handlebars-helpers-ctrf/node_modules/minimatch/dist/esm/ast.js @@ -192696,7 +197206,7 @@ var startNoDot2 = "(?!\\.)"; var addPatternStart2 = /* @__PURE__ */ new Set(["[", "."]); var justDots2 = /* @__PURE__ */ new Set(["..", "."]); var reSpecials2 = new Set("().*{}+?[]^$\\!"); -var regExpEscape3 = (s6) => s6.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); +var regExpEscape3 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); var qmark3 = "[^/]"; var star3 = qmark3 + "*?"; var starNoEmpty2 = qmark3 + "+?"; @@ -192747,17 +197257,17 @@ var AST2 = class { get hasMagic() { if (this.#hasMagic !== void 0) return this.#hasMagic; - for (const p6 of this.#parts) { - if (typeof p6 === "string") + for (const p2 of this.#parts) { + if (typeof p2 === "string") continue; - if (p6.type || p6.hasMagic) + if (p2.type || p2.hasMagic) return this.#hasMagic = true; } return this.#hasMagic; } // reconstructs the pattern toString() { - return this.#toString !== void 0 ? this.#toString : !this.type ? this.#toString = this.#parts.map((p6) => String(p6)).join("") : this.#toString = this.type + "(" + this.#parts.map((p6) => String(p6)).join("|") + ")"; + return this.#toString !== void 0 ? this.#toString : !this.type ? this.#toString = this.#parts.map((p2) => String(p2)).join("") : this.#toString = this.type + "(" + this.#parts.map((p2) => String(p2)).join("|") + ")"; } #fillNegs() { if (this !== this.#root) @@ -192766,39 +197276,39 @@ var AST2 = class { return this; this.toString(); this.#filledNegs = true; - let n12; - while (n12 = this.#negs.pop()) { - if (n12.type !== "!") + let n8; + while (n8 = this.#negs.pop()) { + if (n8.type !== "!") continue; - let p6 = n12; - let pp = p6.#parent; + let p2 = n8; + let pp = p2.#parent; while (pp) { - for (let i6 = p6.#parentIndex + 1; !pp.type && i6 < pp.#parts.length; i6++) { - for (const part of n12.#parts) { + for (let i6 = p2.#parentIndex + 1; !pp.type && i6 < pp.#parts.length; i6++) { + for (const part of n8.#parts) { if (typeof part === "string") { throw new Error("string part in extglob AST??"); } part.copyIn(pp.#parts[i6]); } } - p6 = pp; - pp = p6.#parent; + p2 = pp; + pp = p2.#parent; } } return this; } push(...parts) { - for (const p6 of parts) { - if (p6 === "") + for (const p2 of parts) { + if (p2 === "") continue; - if (typeof p6 !== "string" && !(p6 instanceof _a2 && p6.#parent === this)) { - throw new Error("invalid part: " + p6); + if (typeof p2 !== "string" && !(p2 instanceof _a2 && p2.#parent === this)) { + throw new Error("invalid part: " + p2); } - this.#parts.push(p6); + this.#parts.push(p2); } } toJSON() { - const ret = this.type === null ? this.#parts.slice().map((p6) => typeof p6 === "string" ? p6 : p6.toJSON()) : [this.type, ...this.#parts.map((p6) => p6.toJSON())]; + const ret = this.type === null ? this.#parts.slice().map((p2) => typeof p2 === "string" ? p2 : p2.toJSON()) : [this.type, ...this.#parts.map((p2) => p2.toJSON())]; if (this.isStart() && !this.type) ret.unshift([]); if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && this.#parent?.type === "!")) { @@ -192813,9 +197323,9 @@ var AST2 = class { return false; if (this.#parentIndex === 0) return true; - const p6 = this.#parent; + const p2 = this.#parent; for (let i6 = 0; i6 < this.#parentIndex; i6++) { - const pp = p6.#parts[i6]; + const pp = p2.#parts[i6]; if (!(pp instanceof _a2 && pp.type === "!")) { return false; } @@ -192842,8 +197352,8 @@ var AST2 = class { } clone(parent2) { const c6 = new _a2(this.type, parent2); - for (const p6 of this.#parts) { - c6.copyIn(p6); + for (const p2 of this.#parts) { + c6.copyIn(p2); } return c6; } @@ -192982,15 +197492,15 @@ var AST2 = class { #adopt(child, index2) { const gc = child.#parts[0]; this.#parts.splice(index2, 1, ...gc.#parts); - for (const p6 of gc.#parts) { - if (typeof p6 === "object") - p6.#parent = this; + for (const p2 of gc.#parts) { + if (typeof p2 === "object") + p2.#parent = this; } this.#toString = void 0; } #canUsurpType(c6) { - const m6 = usurpMap2.get(this.type); - return !!m6?.has(c6); + const m3 = usurpMap2.get(this.type); + return !!m3?.has(c6); } #canUsurp(child) { if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) { @@ -193003,15 +197513,15 @@ var AST2 = class { return this.#canUsurpType(gc.type); } #usurp(child) { - const m6 = usurpMap2.get(this.type); + const m3 = usurpMap2.get(this.type); const gc = child.#parts[0]; - const nt2 = m6?.get(gc.type); + const nt2 = m3?.get(gc.type); if (!nt2) return false; this.#parts = gc.#parts; - for (const p6 of this.#parts) { - if (typeof p6 === "object") { - p6.#parent = this; + for (const p2 of this.#parts) { + if (typeof p2 === "object") { + p2.#parent = this; } } this.type = nt2; @@ -193119,9 +197629,9 @@ var AST2 = class { this.#fillNegs(); } if (!isExtglobAST2(this)) { - const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s6) => typeof s6 !== "string"); - const src = this.#parts.map((p6) => { - const [re2, _3, hasMagic2, uflag] = typeof p6 === "string" ? _a2.#parseGlob(p6, this.#hasMagic, noEmpty) : p6.toRegExpSource(allowDot); + const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string"); + const src = this.#parts.map((p2) => { + const [re2, _3, hasMagic2, uflag] = typeof p2 === "string" ? _a2.#parseGlob(p2, this.#hasMagic, noEmpty) : p2.toRegExpSource(allowDot); this.#hasMagic = this.#hasMagic || hasMagic2; this.#uflag = this.#uflag || uflag; return re2; @@ -193159,12 +197669,12 @@ var AST2 = class { const start = this.type === "!" ? "(?:(?!(?:" : "(?:"; let body2 = this.#partsToRegExp(dot); if (this.isStart() && this.isEnd() && !body2 && this.type !== "!") { - const s6 = this.toString(); + const s = this.toString(); const me2 = this; - me2.#parts = [s6]; + me2.#parts = [s]; me2.type = null; me2.#hasMagic = void 0; - return [s6, unescape3(this.toString()), false, false]; + return [s, unescape3(this.toString()), false, false]; } let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot2 ? "" : this.#partsToRegExp(true); if (bodyDotAllowed === body2) { @@ -193192,9 +197702,9 @@ var AST2 = class { } #flatten() { if (!isExtglobAST2(this)) { - for (const p6 of this.#parts) { - if (typeof p6 === "object") { - p6.#flatten(); + for (const p2 of this.#parts) { + if (typeof p2 === "object") { + p2.#flatten(); } } } else { @@ -193223,14 +197733,14 @@ var AST2 = class { this.#toString = void 0; } #partsToRegExp(dot) { - return this.#parts.map((p6) => { - if (typeof p6 === "string") { + return this.#parts.map((p2) => { + if (typeof p2 === "string") { throw new Error("string type in extglob ast??"); } - const [re2, _3, _hasMagic, uflag] = p6.toRegExpSource(dot); + const [re2, _3, _hasMagic, uflag] = p2.toRegExpSource(dot); this.#uflag = this.#uflag || uflag; return re2; - }).filter((p6) => !(this.isStart() && this.isEnd()) || !!p6).join("|"); + }).filter((p2) => !(this.isStart() && this.isEnd()) || !!p2).join("|"); } static #parseGlob(glob2, hasMagic2, noEmpty = false) { let escaping = false; @@ -193285,20 +197795,20 @@ var AST2 = class { _a2 = AST2; // node_modules/handlebars-helpers-ctrf/node_modules/minimatch/dist/esm/escape.js -var escape4 = (s6, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => { +var escape4 = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => { if (magicalBraces) { - return windowsPathsNoEscape ? s6.replace(/[?*()[\]{}]/g, "[$&]") : s6.replace(/[?*()[\]\\{}]/g, "\\$&"); + return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&"); } - return windowsPathsNoEscape ? s6.replace(/[?*()[\]]/g, "[$&]") : s6.replace(/[?*()[\]\\]/g, "\\$&"); + return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&"); }; // node_modules/handlebars-helpers-ctrf/node_modules/minimatch/dist/esm/index.js -var minimatch2 = (p6, pattern, options = {}) => { +var minimatch2 = (p2, pattern, options = {}) => { assertValidPattern2(pattern); if (!options.nocomment && pattern.charAt(0) === "#") { return false; } - return new Minimatch2(pattern, options).match(p6); + return new Minimatch2(pattern, options).match(p2); }; var starDotExtRE2 = /^\*+([^+@!?*[(]*)$/; var starDotExtTest2 = (ext3) => (f6) => !f6.startsWith(".") && f6.endsWith(ext3); @@ -193363,7 +197873,7 @@ var qmark4 = "[^/]"; var star4 = qmark4 + "*?"; var twoStarDot2 = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; var twoStarNoDot2 = "(?:(?!(?:\\/|^)\\.).)*?"; -var filter3 = (pattern, options = {}) => (p6) => minimatch2(p6, pattern, options); +var filter3 = (pattern, options = {}) => (p2) => minimatch2(p2, pattern, options); minimatch2.filter = filter3; var ext2 = (a6, b6 = {}) => Object.assign({}, a6, b6); var defaults3 = (def) => { @@ -193371,8 +197881,8 @@ var defaults3 = (def) => { return minimatch2; } const orig = minimatch2; - const m6 = (p6, pattern, options = {}) => orig(p6, pattern, ext2(def, options)); - return Object.assign(m6, { + const m3 = (p2, pattern, options = {}) => orig(p2, pattern, ext2(def, options)); + return Object.assign(m3, { Minimatch: class Minimatch extends orig.Minimatch { constructor(pattern, options = {}) { super(pattern, ext2(def, options)); @@ -193391,8 +197901,8 @@ var defaults3 = (def) => { return orig.AST.fromGlob(pattern, ext2(def, options)); } }, - unescape: (s6, options = {}) => orig.unescape(s6, ext2(def, options)), - escape: (s6, options = {}) => orig.escape(s6, ext2(def, options)), + unescape: (s, options = {}) => orig.unescape(s, ext2(def, options)), + escape: (s, options = {}) => orig.escape(s, ext2(def, options)), filter: (pattern, options = {}) => orig.filter(pattern, ext2(def, options)), defaults: (options) => orig.defaults(ext2(def, options)), makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext2(def, options)), @@ -193423,7 +197933,7 @@ var match2 = (list, pattern, options = {}) => { }; minimatch2.match = match2; var globMagic2 = /[?*]|[+@!]\(.*?\)|\[|\]/; -var regExpEscape4 = (s6) => s6.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); +var regExpEscape4 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); var Minimatch2 = class { options; set; @@ -193501,31 +198011,31 @@ var Minimatch2 = class { this.debug = (...args) => console.error(...args); } this.debug(this.pattern, this.globSet); - const rawGlobParts = this.globSet.map((s6) => this.slashSplit(s6)); + const rawGlobParts = this.globSet.map((s) => this.slashSplit(s)); this.globParts = this.preprocess(rawGlobParts); this.debug(this.pattern, this.globParts); - let set = this.globParts.map((s6, _3, __) => { + let set = this.globParts.map((s, _3, __) => { if (this.isWindows && this.windowsNoMagicRoot) { - const isUNC = s6[0] === "" && s6[1] === "" && (s6[2] === "?" || !globMagic2.test(s6[2])) && !globMagic2.test(s6[3]); - const isDrive = /^[a-z]:/i.test(s6[0]); + const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic2.test(s[2])) && !globMagic2.test(s[3]); + const isDrive = /^[a-z]:/i.test(s[0]); if (isUNC) { return [ - ...s6.slice(0, 4), - ...s6.slice(4).map((ss2) => this.parse(ss2)) + ...s.slice(0, 4), + ...s.slice(4).map((ss2) => this.parse(ss2)) ]; } else if (isDrive) { - return [s6[0], ...s6.slice(1).map((ss2) => this.parse(ss2))]; + return [s[0], ...s.slice(1).map((ss2) => this.parse(ss2))]; } } - return s6.map((ss2) => this.parse(ss2)); + return s.map((ss2) => this.parse(ss2)); }); this.debug(this.pattern, set); - this.set = set.filter((s6) => s6.indexOf(false) === -1); + this.set = set.filter((s) => s.indexOf(false) === -1); if (this.isWindows) { for (let i6 = 0; i6 < this.set.length; i6++) { - const p6 = this.set[i6]; - if (p6[0] === "" && p6[1] === "" && this.globParts[i6][2] === "?" && typeof p6[3] === "string" && /^[a-z]:$/i.test(p6[3])) { - p6[2] = "?"; + const p2 = this.set[i6]; + if (p2[0] === "" && p2[1] === "" && this.globParts[i6][2] === "?" && typeof p2[3] === "string" && /^[a-z]:$/i.test(p2[3])) { + p2[2] = "?"; } } } @@ -193602,10 +198112,10 @@ var Minimatch2 = class { didSomething = false; if (!this.preserveMultipleSlashes) { for (let i6 = 1; i6 < parts.length - 1; i6++) { - const p6 = parts[i6]; - if (i6 === 1 && p6 === "" && parts[0] === "") + const p2 = parts[i6]; + if (i6 === 1 && p2 === "" && parts[0] === "") continue; - if (p6 === "." || p6 === "") { + if (p2 === "." || p2 === "") { didSomething = true; parts.splice(i6, 1); i6--; @@ -193618,8 +198128,8 @@ var Minimatch2 = class { } let dd = 0; while (-1 !== (dd = parts.indexOf("..", dd + 1))) { - const p6 = parts[dd - 1]; - if (p6 && p6 !== "." && p6 !== ".." && p6 !== "**" && !(this.isWindows && /^[a-z]:$/i.test(p6))) { + const p2 = parts[dd - 1]; + if (p2 && p2 !== "." && p2 !== ".." && p2 !== "**" && !(this.isWindows && /^[a-z]:$/i.test(p2))) { didSomething = true; parts.splice(dd - 1, 2); dd -= 2; @@ -193661,11 +198171,11 @@ var Minimatch2 = class { parts.splice(gs2 + 1, gss - gs2); } let next = parts[gs2 + 1]; - const p6 = parts[gs2 + 2]; + const p2 = parts[gs2 + 2]; const p22 = parts[gs2 + 3]; if (next !== "..") continue; - if (!p6 || p6 === "." || p6 === ".." || !p22 || p22 === "." || p22 === "..") { + if (!p2 || p2 === "." || p2 === ".." || !p22 || p22 === "." || p22 === "..") { continue; } didSomething = true; @@ -193677,10 +198187,10 @@ var Minimatch2 = class { } if (!this.preserveMultipleSlashes) { for (let i6 = 1; i6 < parts.length - 1; i6++) { - const p6 = parts[i6]; - if (i6 === 1 && p6 === "" && parts[0] === "") + const p2 = parts[i6]; + if (i6 === 1 && p2 === "" && parts[0] === "") continue; - if (p6 === "." || p6 === "") { + if (p2 === "." || p2 === "") { didSomething = true; parts.splice(i6, 1); i6--; @@ -193693,8 +198203,8 @@ var Minimatch2 = class { } let dd = 0; while (-1 !== (dd = parts.indexOf("..", dd + 1))) { - const p6 = parts[dd - 1]; - if (p6 && p6 !== "." && p6 !== ".." && p6 !== "**") { + const p2 = parts[dd - 1]; + if (p2 && p2 !== "." && p2 !== ".." && p2 !== "**") { didSomething = true; const needDot = dd === 1 && parts[dd + 1] === "**"; const splin = needDot ? ["."] : []; @@ -193900,8 +198410,8 @@ var Minimatch2 = class { } const [body2, after] = bs2; while (fileIndex <= after) { - const m6 = this.#matchOne(file.slice(0, fileIndex + body2.length), body2, partial, fileIndex, 0); - if (m6 && globStarDepth < this.maxGlobstarRecursion) { + const m3 = this.#matchOne(file.slice(0, fileIndex + body2.length), body2, partial, fileIndex, 0); + if (m3 && globStarDepth < this.maxGlobstarRecursion) { const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body2.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail); if (sub !== false) { return sub; @@ -193922,19 +198432,19 @@ var Minimatch2 = class { let fl; for (fi2 = fileIndex, pi2 = patternIndex, fl = file.length, pl = pattern.length; fi2 < fl && pi2 < pl; fi2++, pi2++) { this.debug("matchOne loop"); - let p6 = pattern[pi2]; + let p2 = pattern[pi2]; let f6 = file[fi2]; - this.debug(pattern, p6, f6); - if (p6 === false || p6 === GLOBSTAR2) { + this.debug(pattern, p2, f6); + if (p2 === false || p2 === GLOBSTAR2) { return false; } let hit; - if (typeof p6 === "string") { - hit = f6 === p6; - this.debug("string match", p6, f6, hit); + if (typeof p2 === "string") { + hit = f6 === p2; + this.debug("string match", p2, f6, hit); } else { - hit = p6.test(f6); - this.debug("pattern match", p6, f6, hit); + hit = p2.test(f6); + this.debug("pattern match", p2, f6, hit); } if (!hit) return false; @@ -193959,17 +198469,17 @@ var Minimatch2 = class { return GLOBSTAR2; if (pattern === "") return ""; - let m6; + let m3; let fastTest = null; - if (m6 = pattern.match(starRE2)) { + if (m3 = pattern.match(starRE2)) { fastTest = options.dot ? starTestDot2 : starTest2; - } else if (m6 = pattern.match(starDotExtRE2)) { - fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot2 : starDotExtTestNocase2 : options.dot ? starDotExtTestDot2 : starDotExtTest2)(m6[1]); - } else if (m6 = pattern.match(qmarksRE2)) { - fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot2 : qmarksTestNocase2 : options.dot ? qmarksTestDot2 : qmarksTest2)(m6); - } else if (m6 = pattern.match(starDotStarRE2)) { + } else if (m3 = pattern.match(starDotExtRE2)) { + fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot2 : starDotExtTestNocase2 : options.dot ? starDotExtTestDot2 : starDotExtTest2)(m3[1]); + } else if (m3 = pattern.match(qmarksRE2)) { + fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot2 : qmarksTestNocase2 : options.dot ? qmarksTestDot2 : qmarksTest2)(m3); + } else if (m3 = pattern.match(starDotStarRE2)) { fastTest = options.dot ? starDotStarTestDot2 : starDotStarTest2; - } else if (m6 = pattern.match(dotStarRE2)) { + } else if (m3 = pattern.match(dotStarRE2)) { fastTest = dotStarTest2; } const re2 = AST2.fromGlob(pattern, this.options).toMMPattern(); @@ -193990,17 +198500,17 @@ var Minimatch2 = class { const twoStar = options.noglobstar ? star4 : options.dot ? twoStarDot2 : twoStarNoDot2; const flags = new Set(options.nocase ? ["i"] : []); let re2 = set.map((pattern) => { - const pp = pattern.map((p6) => { - if (p6 instanceof RegExp) { - for (const f6 of p6.flags.split("")) + const pp = pattern.map((p2) => { + if (p2 instanceof RegExp) { + for (const f6 of p2.flags.split("")) flags.add(f6); } - return typeof p6 === "string" ? regExpEscape4(p6) : p6 === GLOBSTAR2 ? GLOBSTAR2 : p6._src; + return typeof p2 === "string" ? regExpEscape4(p2) : p2 === GLOBSTAR2 ? GLOBSTAR2 : p2._src; }); - pp.forEach((p6, i6) => { + pp.forEach((p2, i6) => { const next = pp[i6 + 1]; const prev = pp[i6 - 1]; - if (p6 !== GLOBSTAR2 || prev === GLOBSTAR2) { + if (p2 !== GLOBSTAR2 || prev === GLOBSTAR2) { return; } if (prev === void 0) { @@ -194016,7 +198526,7 @@ var Minimatch2 = class { pp[i6 + 1] = GLOBSTAR2; } }); - const filtered = pp.filter((p6) => p6 !== GLOBSTAR2); + const filtered = pp.filter((p2) => p2 !== GLOBSTAR2); if (this.partial && filtered.length >= 1) { const prefixes = []; for (let i6 = 1; i6 <= filtered.length; i6++) { @@ -194040,13 +198550,13 @@ var Minimatch2 = class { } return this.regexp; } - slashSplit(p6) { + slashSplit(p2) { if (this.preserveMultipleSlashes) { - return p6.split("/"); - } else if (this.isWindows && /^\/\/[^/]+/.test(p6)) { - return ["", ...p6.split(/\/+/)]; + return p2.split("/"); + } else if (this.isWindows && /^\/\/[^/]+/.test(p2)) { + return ["", ...p2.split(/\/+/)]; } else { - return p6.split(/\/+/); + return p2.split(/\/+/); } } match(f6, partial = this.partial) { @@ -194145,8 +198655,8 @@ var absHelper = { name: "abs", category: "Math", fn: (a6) => { - const n12 = typeof a6 === "number" ? a6 : parseFloat(String(a6)); - return Number.isNaN(n12) ? 0 : Math.abs(n12); + const n8 = typeof a6 === "number" ? a6 : parseFloat(String(a6)); + return Number.isNaN(n8) ? 0 : Math.abs(n8); } }; var addHelper2 = { @@ -194183,7 +198693,7 @@ var avgHelper = { return 0; } } - const nums = array.map((x6) => typeof x6 === "number" ? x6 : parseFloat(String(x6))).filter((n12) => !Number.isNaN(n12)); + const nums = array.map((x2) => typeof x2 === "number" ? x2 : parseFloat(String(x2))).filter((n8) => !Number.isNaN(n8)); if (nums.length === 0) return 0; return nums.reduce((a6, b6) => a6 + b6, 0) / nums.length; @@ -194193,8 +198703,8 @@ var ceilHelper = { name: "ceil", category: "Math", fn: (value) => { - const n12 = typeof value === "number" ? value : parseFloat(String(value)); - return Number.isNaN(n12) ? 0 : Math.ceil(n12); + const n8 = typeof value === "number" ? value : parseFloat(String(value)); + return Number.isNaN(n8) ? 0 : Math.ceil(n8); } }; var divideHelper = { @@ -194212,8 +198722,8 @@ var floorHelper = { name: "floor", category: "Math", fn: (value) => { - const n12 = typeof value === "number" ? value : parseFloat(String(value)); - return Number.isNaN(n12) ? 0 : Math.floor(n12); + const n8 = typeof value === "number" ? value : parseFloat(String(value)); + return Number.isNaN(n8) ? 0 : Math.floor(n8); } }; var minusHelper = { @@ -194280,8 +198790,8 @@ var roundHelper = { name: "round", category: "Math", fn: (number) => { - const n12 = typeof number === "number" ? number : parseFloat(String(number)); - return Number.isNaN(n12) ? 0 : Math.round(n12); + const n8 = typeof number === "number" ? number : parseFloat(String(number)); + return Number.isNaN(n8) ? 0 : Math.round(n8); } }; var subtractHelper = { @@ -194307,7 +198817,7 @@ var sumHelper = { return 0; } } - const nums = array.map((x6) => typeof x6 === "number" ? x6 : parseFloat(String(x6))).filter((n12) => !Number.isNaN(n12)); + const nums = array.map((x2) => typeof x2 === "number" ? x2 : parseFloat(String(x2))).filter((n8) => !Number.isNaN(n8)); if (nums.length === 0) return 0; return nums.reduce((a6, b6) => a6 + b6, 0); @@ -194884,11 +199394,11 @@ var segmentsHelper = { if (typeof filepath !== "string") return ""; const parts = filepath.split(sep4).filter(Boolean); - const s6 = typeof start === "string" ? parseInt(start, 10) : Number(start); + const s = typeof start === "string" ? parseInt(start, 10) : Number(start); const e6 = typeof end === "string" ? parseInt(end, 10) : Number(end); - if (Number.isNaN(s6) || Number.isNaN(e6) || s6 < 0 || e6 < s6) + if (Number.isNaN(s) || Number.isNaN(e6) || s < 0 || e6 < s) return ""; - return parts.slice(s6, e6 + 1).join(sep4); + return parts.slice(s, e6 + 1).join(sep4); } }; var absoluteHelper = { @@ -194925,11 +199435,11 @@ var toRegexHelper = { var testHelper = { name: "test", category: "Regex", - fn: (str, regex) => { - if (typeof str !== "string" || !(regex instanceof RegExp)) { + fn: (str, regex3) => { + if (typeof str !== "string" || !(regex3 instanceof RegExp)) { return false; } - return regex.test(str); + return regex3.test(str); } }; var regexHelpers = [toRegexHelper, testHelper]; @@ -196067,7 +200577,7 @@ function getInputs() { const groupByInput = getInput("group-by") || "filePath"; const groupBy2 = groupByInput === "suite" ? "suite" : "filePath"; const reportOrderInput = getInput("report-order"); - const reportOrder = reportOrderInput ? reportOrderInput.split(",").map((s6) => s6.trim()) : []; + const reportOrder = reportOrderInput ? reportOrderInput.split(",").map((s) => s.trim()) : []; const baselineInput = getInput("baseline"); const baseline = baselineInput !== "" && !isNaN(Number(baselineInput)) ? Number(baselineInput) : baselineInput; return { @@ -196840,6 +201350,25 @@ archiver/index.js: sax/lib/sax.js: (*! http://mths.be/fromcodepoint v0.1.0 by @mathias *) +yargs-parser/build/lib/string-utils.js: +yargs-parser/build/lib/tokenize-arg-string.js: +yargs-parser/build/lib/yargs-parser-types.js: +yargs-parser/build/lib/yargs-parser.js: + (** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + *) + +yargs-parser/build/lib/index.js: + (** + * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js + * + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + *) + web-streams-polyfill/dist/ponyfill.js: (** * @license diff --git a/dist/index.js.map b/dist/index.js.map index 484efa2e..79e90a27 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["../node_modules/tunnel/lib/tunnel.js","../node_modules/tunnel/index.js","../node_modules/undici/lib/core/symbols.js","../node_modules/undici/lib/core/errors.js","../node_modules/undici/lib/core/constants.js","../node_modules/undici/lib/core/tree.js","../node_modules/undici/lib/core/util.js","../node_modules/undici/lib/core/diagnostics.js","../node_modules/undici/lib/core/request.js","../node_modules/undici/lib/dispatcher/dispatcher.js","../node_modules/undici/lib/dispatcher/dispatcher-base.js","../node_modules/undici/lib/util/timers.js","../node_modules/undici/lib/core/connect.js","../node_modules/undici/lib/llhttp/utils.js","../node_modules/undici/lib/llhttp/constants.js","../node_modules/undici/lib/llhttp/llhttp-wasm.js","../node_modules/undici/lib/llhttp/llhttp_simd-wasm.js","../node_modules/undici/lib/web/fetch/constants.js","../node_modules/undici/lib/web/fetch/global.js","../node_modules/undici/lib/web/fetch/data-url.js","../node_modules/undici/lib/web/fetch/webidl.js","../node_modules/undici/lib/web/fetch/util.js","../node_modules/undici/lib/web/fetch/symbols.js","../node_modules/undici/lib/web/fetch/file.js","../node_modules/undici/lib/web/fetch/formdata.js","../node_modules/undici/lib/web/fetch/formdata-parser.js","../node_modules/undici/lib/web/fetch/body.js","../node_modules/undici/lib/dispatcher/client-h1.js","../node_modules/undici/lib/dispatcher/client-h2.js","../node_modules/undici/lib/handler/redirect-handler.js","../node_modules/undici/lib/interceptor/redirect-interceptor.js","../node_modules/undici/lib/dispatcher/client.js","../node_modules/undici/lib/dispatcher/fixed-queue.js","../node_modules/undici/lib/dispatcher/pool-stats.js","../node_modules/undici/lib/dispatcher/pool-base.js","../node_modules/undici/lib/dispatcher/pool.js","../node_modules/undici/lib/dispatcher/balanced-pool.js","../node_modules/undici/lib/dispatcher/agent.js","../node_modules/undici/lib/dispatcher/proxy-agent.js","../node_modules/undici/lib/dispatcher/env-http-proxy-agent.js","../node_modules/undici/lib/handler/retry-handler.js","../node_modules/undici/lib/dispatcher/retry-agent.js","../node_modules/undici/lib/api/readable.js","../node_modules/undici/lib/api/util.js","../node_modules/undici/lib/api/api-request.js","../node_modules/undici/lib/api/abort-signal.js","../node_modules/undici/lib/api/api-stream.js","../node_modules/undici/lib/api/api-pipeline.js","../node_modules/undici/lib/api/api-upgrade.js","../node_modules/undici/lib/api/api-connect.js","../node_modules/undici/lib/api/index.js","../node_modules/undici/lib/mock/mock-errors.js","../node_modules/undici/lib/mock/mock-symbols.js","../node_modules/undici/lib/mock/mock-utils.js","../node_modules/undici/lib/mock/mock-interceptor.js","../node_modules/undici/lib/mock/mock-client.js","../node_modules/undici/lib/mock/mock-pool.js","../node_modules/undici/lib/mock/pluralizer.js","../node_modules/undici/lib/mock/pending-interceptors-formatter.js","../node_modules/undici/lib/mock/mock-agent.js","../node_modules/undici/lib/global.js","../node_modules/undici/lib/handler/decorator-handler.js","../node_modules/undici/lib/interceptor/redirect.js","../node_modules/undici/lib/interceptor/retry.js","../node_modules/undici/lib/interceptor/dump.js","../node_modules/undici/lib/interceptor/dns.js","../node_modules/undici/lib/web/fetch/headers.js","../node_modules/undici/lib/web/fetch/response.js","../node_modules/undici/lib/web/fetch/dispatcher-weakref.js","../node_modules/undici/lib/web/fetch/request.js","../node_modules/undici/lib/web/fetch/index.js","../node_modules/undici/lib/web/fileapi/symbols.js","../node_modules/undici/lib/web/fileapi/progressevent.js","../node_modules/undici/lib/web/fileapi/encoding.js","../node_modules/undici/lib/web/fileapi/util.js","../node_modules/undici/lib/web/fileapi/filereader.js","../node_modules/undici/lib/web/cache/symbols.js","../node_modules/undici/lib/web/cache/util.js","../node_modules/undici/lib/web/cache/cache.js","../node_modules/undici/lib/web/cache/cachestorage.js","../node_modules/undici/lib/web/cookies/constants.js","../node_modules/undici/lib/web/cookies/util.js","../node_modules/undici/lib/web/cookies/parse.js","../node_modules/undici/lib/web/cookies/index.js","../node_modules/undici/lib/web/websocket/events.js","../node_modules/undici/lib/web/websocket/constants.js","../node_modules/undici/lib/web/websocket/symbols.js","../node_modules/undici/lib/web/websocket/util.js","../node_modules/undici/lib/web/websocket/frame.js","../node_modules/undici/lib/web/websocket/connection.js","../node_modules/undici/lib/web/websocket/permessage-deflate.js","../node_modules/undici/lib/web/websocket/receiver.js","../node_modules/undici/lib/web/websocket/sender.js","../node_modules/undici/lib/web/websocket/websocket.js","../node_modules/undici/lib/web/eventsource/util.js","../node_modules/undici/lib/web/eventsource/eventsource-stream.js","../node_modules/undici/lib/web/eventsource/eventsource.js","../node_modules/undici/index.js","../node_modules/@actions/github/node_modules/@actions/http-client/src/proxy.ts","../node_modules/@actions/github/node_modules/@actions/http-client/src/index.ts","../node_modules/@octokit/core/node_modules/universal-user-agent/index.js","../node_modules/@octokit/core/node_modules/before-after-hook/lib/register.js","../node_modules/@octokit/core/node_modules/before-after-hook/lib/add.js","../node_modules/@octokit/core/node_modules/before-after-hook/lib/remove.js","../node_modules/@octokit/core/node_modules/before-after-hook/index.js","../node_modules/@octokit/endpoint/node_modules/universal-user-agent/index.js","../node_modules/@octokit/endpoint/dist-bundle/index.js","../node_modules/@octokit/request/node_modules/universal-user-agent/index.js","../node_modules/fast-content-type-parse/index.js","../node_modules/json-with-bigint/json-with-bigint.js","../node_modules/@octokit/request-error/dist-src/index.js","../node_modules/@octokit/request/dist-bundle/index.js","../node_modules/@octokit/graphql/node_modules/universal-user-agent/index.js","../node_modules/@octokit/graphql/dist-bundle/index.js","../node_modules/@octokit/auth-token/dist-bundle/index.js","../node_modules/@octokit/core/dist-src/version.js","../node_modules/@octokit/core/dist-src/index.js","../node_modules/@octokit/src/version.ts","../node_modules/@octokit/src/generated/endpoints.ts","../node_modules/@octokit/src/endpoints-to-methods.ts","../node_modules/@octokit/src/index.ts","../node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js","../node_modules/@octokit/plugin-request-log/dist-src/version.js","../node_modules/@octokit/plugin-request-log/dist-src/index.js","../node_modules/@octokit/rest/dist-src/version.js","../node_modules/@octokit/rest/dist-src/index.js","../node_modules/bottleneck/light.js","../node_modules/@octokit/plugin-retry/dist-bundle/index.js","../node_modules/adm-zip/util/constants.js","../node_modules/adm-zip/util/errors.js","../node_modules/adm-zip/util/utils.js","../node_modules/adm-zip/util/fattr.js","../node_modules/adm-zip/util/decoder.js","../node_modules/adm-zip/util/index.js","../node_modules/adm-zip/headers/entryHeader.js","../node_modules/adm-zip/headers/mainHeader.js","../node_modules/adm-zip/headers/index.js","../node_modules/adm-zip/methods/deflater.js","../node_modules/adm-zip/methods/inflater.js","../node_modules/adm-zip/methods/zipcrypto.js","../node_modules/adm-zip/methods/index.js","../node_modules/adm-zip/zipEntry.js","../node_modules/adm-zip/zipFile.js","../node_modules/adm-zip/adm-zip.js","../node_modules/@actions/artifact/package.json","../node_modules/@actions/artifact/lib/internal/shared/package-version.cjs","../node_modules/ms/index.js","../node_modules/debug/src/common.js","../node_modules/debug/src/browser.js","../node_modules/has-flag/index.js","../node_modules/supports-color/index.js","../node_modules/debug/src/node.js","../node_modules/debug/src/index.js","../node_modules/agent-base/src/helpers.ts","../node_modules/agent-base/src/index.ts","../node_modules/https-proxy-agent/src/parse-proxy-response.ts","../node_modules/https-proxy-agent/src/index.ts","../node_modules/http-proxy-agent/src/index.ts","../node_modules/@azure/core-tracing/src/state-cjs.cts","../node_modules/@azure/core-client/src/state-cjs.cts","../node_modules/fast-xml-parser/src/util.js","../node_modules/fast-xml-parser/src/validator.js","../node_modules/@nodable/entities/src/entities.js","../node_modules/@nodable/entities/src/EntityDecoder.js","../node_modules/@nodable/entities/src/index.js","../node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js","../node_modules/fast-xml-parser/src/xmlparser/xmlNode.js","../node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js","../node_modules/strnum/strnum.js","../node_modules/fast-xml-parser/src/ignoreAttributes.js","../node_modules/path-expression-matcher/src/Expression.js","../node_modules/path-expression-matcher/src/ExpressionSet.js","../node_modules/path-expression-matcher/src/Matcher.js","../node_modules/path-expression-matcher/src/index.js","../node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js","../node_modules/fast-xml-parser/src/xmlparser/node2json.js","../node_modules/fast-xml-parser/src/xmlparser/XMLParser.js","../node_modules/fast-xml-builder/src/orderedJs2Xml.js","../node_modules/fast-xml-builder/src/ignoreAttributes.js","../node_modules/fast-xml-builder/src/fxb.js","../node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js","../node_modules/fast-xml-parser/src/fxp.js","../node_modules/readdir-glob/node_modules/minimatch/lib/path.js","../node_modules/balanced-match/index.js","../node_modules/brace-expansion/index.js","../node_modules/readdir-glob/node_modules/minimatch/minimatch.js","../node_modules/readdir-glob/index.js","../node_modules/async/dist/async.mjs","../node_modules/graceful-fs/polyfills.js","../node_modules/graceful-fs/legacy-streams.js","../node_modules/graceful-fs/clone.js","../node_modules/graceful-fs/graceful-fs.js","../node_modules/is-stream/index.js","../node_modules/process-nextick-args/index.js","../node_modules/lazystream/node_modules/isarray/index.js","../node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/stream.js","../node_modules/safe-buffer/index.js","../node_modules/core-util-is/lib/util.js","../node_modules/inherits/inherits_browser.js","../node_modules/inherits/inherits.js","../node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/BufferList.js","../node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/destroy.js","../node_modules/util-deprecate/node.js","../node_modules/lazystream/node_modules/readable-stream/lib/_stream_writable.js","../node_modules/lazystream/node_modules/readable-stream/lib/_stream_duplex.js","../node_modules/lazystream/node_modules/string_decoder/lib/string_decoder.js","../node_modules/lazystream/node_modules/readable-stream/lib/_stream_readable.js","../node_modules/lazystream/node_modules/readable-stream/lib/_stream_transform.js","../node_modules/lazystream/node_modules/readable-stream/lib/_stream_passthrough.js","../node_modules/lazystream/node_modules/readable-stream/readable.js","../node_modules/lazystream/node_modules/readable-stream/passthrough.js","../node_modules/lazystream/lib/lazystream.js","../node_modules/normalize-path/index.js","../node_modules/lodash/identity.js","../node_modules/lodash/_apply.js","../node_modules/lodash/_overRest.js","../node_modules/lodash/constant.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_root.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/isObject.js","../node_modules/lodash/isFunction.js","../node_modules/lodash/_coreJsData.js","../node_modules/lodash/_isMasked.js","../node_modules/lodash/_toSource.js","../node_modules/lodash/_baseIsNative.js","../node_modules/lodash/_getValue.js","../node_modules/lodash/_getNative.js","../node_modules/lodash/_defineProperty.js","../node_modules/lodash/_baseSetToString.js","../node_modules/lodash/_shortOut.js","../node_modules/lodash/_setToString.js","../node_modules/lodash/_baseRest.js","../node_modules/lodash/eq.js","../node_modules/lodash/isLength.js","../node_modules/lodash/isArrayLike.js","../node_modules/lodash/_isIndex.js","../node_modules/lodash/_isIterateeCall.js","../node_modules/lodash/_baseTimes.js","../node_modules/lodash/isObjectLike.js","../node_modules/lodash/_baseIsArguments.js","../node_modules/lodash/isArguments.js","../node_modules/lodash/isArray.js","../node_modules/lodash/stubFalse.js","../node_modules/lodash/isBuffer.js","../node_modules/lodash/_baseIsTypedArray.js","../node_modules/lodash/_baseUnary.js","../node_modules/lodash/_nodeUtil.js","../node_modules/lodash/isTypedArray.js","../node_modules/lodash/_arrayLikeKeys.js","../node_modules/lodash/_isPrototype.js","../node_modules/lodash/_nativeKeysIn.js","../node_modules/lodash/_baseKeysIn.js","../node_modules/lodash/keysIn.js","../node_modules/lodash/defaults.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/ours/primordials.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/ours/util/inspect.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/ours/errors.js","../node_modules/event-target-shim/src/event.mjs","../node_modules/event-target-shim/src/event-target.mjs","../node_modules/abort-controller/src/abort-signal.ts","../node_modules/abort-controller/src/abort-controller.ts","../node_modules/archiver-utils/node_modules/readable-stream/lib/ours/util.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/validators.js","../node_modules/process/index.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/utils.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/end-of-stream.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/destroy.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/legacy.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/add-abort-signal.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/buffer_list.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/state.js","../node_modules/archiver-utils/node_modules/safe-buffer/index.js","../node_modules/archiver-utils/node_modules/string_decoder/lib/string_decoder.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/from.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/readable.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/writable.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/duplexify.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/duplex.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/transform.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/passthrough.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/pipeline.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/compose.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/operators.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/stream/promises.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/stream.js","../node_modules/archiver-utils/node_modules/readable-stream/lib/ours/index.js","../node_modules/lodash/_arrayPush.js","../node_modules/lodash/_isFlattenable.js","../node_modules/lodash/_baseFlatten.js","../node_modules/lodash/flatten.js","../node_modules/lodash/_nativeCreate.js","../node_modules/lodash/_hashClear.js","../node_modules/lodash/_hashDelete.js","../node_modules/lodash/_hashGet.js","../node_modules/lodash/_hashHas.js","../node_modules/lodash/_hashSet.js","../node_modules/lodash/_Hash.js","../node_modules/lodash/_listCacheClear.js","../node_modules/lodash/_assocIndexOf.js","../node_modules/lodash/_listCacheDelete.js","../node_modules/lodash/_listCacheGet.js","../node_modules/lodash/_listCacheHas.js","../node_modules/lodash/_listCacheSet.js","../node_modules/lodash/_ListCache.js","../node_modules/lodash/_Map.js","../node_modules/lodash/_mapCacheClear.js","../node_modules/lodash/_isKeyable.js","../node_modules/lodash/_getMapData.js","../node_modules/lodash/_mapCacheDelete.js","../node_modules/lodash/_mapCacheGet.js","../node_modules/lodash/_mapCacheHas.js","../node_modules/lodash/_mapCacheSet.js","../node_modules/lodash/_MapCache.js","../node_modules/lodash/_setCacheAdd.js","../node_modules/lodash/_setCacheHas.js","../node_modules/lodash/_SetCache.js","../node_modules/lodash/_baseFindIndex.js","../node_modules/lodash/_baseIsNaN.js","../node_modules/lodash/_strictIndexOf.js","../node_modules/lodash/_baseIndexOf.js","../node_modules/lodash/_arrayIncludes.js","../node_modules/lodash/_arrayIncludesWith.js","../node_modules/lodash/_arrayMap.js","../node_modules/lodash/_cacheHas.js","../node_modules/lodash/_baseDifference.js","../node_modules/lodash/isArrayLikeObject.js","../node_modules/lodash/difference.js","../node_modules/lodash/_Set.js","../node_modules/lodash/noop.js","../node_modules/lodash/_setToArray.js","../node_modules/lodash/_createSet.js","../node_modules/lodash/_baseUniq.js","../node_modules/lodash/union.js","../node_modules/lodash/_overArg.js","../node_modules/lodash/_getPrototype.js","../node_modules/lodash/isPlainObject.js","../node_modules/minimatch/src/assert-valid-pattern.ts","../node_modules/minimatch/src/brace-expressions.ts","../node_modules/minimatch/src/unescape.ts","../node_modules/minimatch/src/ast.ts","../node_modules/minimatch/src/escape.ts","../node_modules/minimatch/src/index.ts","../node_modules/archiver-utils/node_modules/lru-cache/src/index.ts","../node_modules/minipass/src/index.ts","../node_modules/archiver-utils/node_modules/path-scurry/src/index.ts","../node_modules/archiver-utils/node_modules/glob/src/pattern.ts","../node_modules/archiver-utils/node_modules/glob/src/ignore.ts","../node_modules/archiver-utils/node_modules/glob/src/processor.ts","../node_modules/archiver-utils/node_modules/glob/src/walker.ts","../node_modules/archiver-utils/node_modules/glob/src/glob.ts","../node_modules/archiver-utils/node_modules/glob/src/has-magic.ts","../node_modules/archiver-utils/node_modules/glob/src/index.ts","../node_modules/archiver-utils/file.js","../node_modules/archiver-utils/index.js","../node_modules/archiver/lib/error.js","../node_modules/archiver/node_modules/readable-stream/lib/ours/primordials.js","../node_modules/archiver/node_modules/readable-stream/lib/ours/util/inspect.js","../node_modules/archiver/node_modules/readable-stream/lib/ours/errors.js","../node_modules/archiver/node_modules/readable-stream/lib/ours/util.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/validators.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/utils.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/end-of-stream.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/destroy.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/legacy.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/add-abort-signal.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/buffer_list.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/state.js","../node_modules/archiver/node_modules/safe-buffer/index.js","../node_modules/archiver/node_modules/string_decoder/lib/string_decoder.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/from.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/readable.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/writable.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/duplexify.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/duplex.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/transform.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/passthrough.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/pipeline.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/compose.js","../node_modules/archiver/node_modules/readable-stream/lib/internal/streams/operators.js","../node_modules/archiver/node_modules/readable-stream/lib/stream/promises.js","../node_modules/archiver/node_modules/readable-stream/lib/stream.js","../node_modules/archiver/node_modules/readable-stream/lib/ours/index.js","../node_modules/archiver/lib/core.js","../node_modules/compress-commons/lib/archivers/archive-entry.js","../node_modules/compress-commons/lib/archivers/zip/util.js","../node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js","../node_modules/compress-commons/lib/archivers/zip/unix-stat.js","../node_modules/compress-commons/lib/archivers/zip/constants.js","../node_modules/compress-commons/lib/archivers/zip/zip-archive-entry.js","../node_modules/compress-commons/node_modules/readable-stream/lib/ours/primordials.js","../node_modules/compress-commons/node_modules/readable-stream/lib/ours/util/inspect.js","../node_modules/compress-commons/node_modules/readable-stream/lib/ours/errors.js","../node_modules/compress-commons/node_modules/readable-stream/lib/ours/util.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/validators.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/utils.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/end-of-stream.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/destroy.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/legacy.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/add-abort-signal.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/buffer_list.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/state.js","../node_modules/compress-commons/node_modules/safe-buffer/index.js","../node_modules/compress-commons/node_modules/string_decoder/lib/string_decoder.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/from.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/readable.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/writable.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/duplexify.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/duplex.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/transform.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/passthrough.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/pipeline.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/compose.js","../node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/operators.js","../node_modules/compress-commons/node_modules/readable-stream/lib/stream/promises.js","../node_modules/compress-commons/node_modules/readable-stream/lib/stream.js","../node_modules/compress-commons/node_modules/readable-stream/lib/ours/index.js","../node_modules/compress-commons/lib/util/index.js","../node_modules/compress-commons/lib/archivers/archive-output-stream.js","../node_modules/crc-32/crc32.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/ours/primordials.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/ours/util/inspect.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/ours/errors.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/ours/util.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/validators.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/utils.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/end-of-stream.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/destroy.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/legacy.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/add-abort-signal.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/buffer_list.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/state.js","../node_modules/crc32-stream/node_modules/safe-buffer/index.js","../node_modules/crc32-stream/node_modules/string_decoder/lib/string_decoder.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/from.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/readable.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/writable.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/duplexify.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/duplex.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/transform.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/passthrough.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/pipeline.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/compose.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/operators.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/stream/promises.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/stream.js","../node_modules/crc32-stream/node_modules/readable-stream/lib/ours/index.js","../node_modules/crc32-stream/lib/crc32-stream.js","../node_modules/crc32-stream/lib/deflate-crc32-stream.js","../node_modules/crc32-stream/lib/index.js","../node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js","../node_modules/compress-commons/lib/compress-commons.js","../node_modules/zip-stream/index.js","../node_modules/archiver/lib/plugins/zip.js","../node_modules/fast-fifo/fixed-size.js","../node_modules/fast-fifo/index.js","../node_modules/b4a/index.js","../node_modules/text-decoder/lib/pass-through-decoder.js","../node_modules/text-decoder/lib/utf8-decoder.js","../node_modules/text-decoder/index.js","../node_modules/streamx/index.js","../node_modules/tar-stream/headers.js","../node_modules/tar-stream/extract.js","../node_modules/tar-stream/constants.js","../node_modules/tar-stream/pack.js","../node_modules/tar-stream/index.js","../node_modules/archiver/lib/plugins/tar.js","../node_modules/buffer-crc32/dist/index.cjs","../node_modules/archiver/lib/plugins/json.js","../node_modules/archiver/index.js","../node_modules/traverse/index.js","../node_modules/chainsaw/index.js","../node_modules/buffers/index.js","../node_modules/binary/lib/vars.js","../node_modules/binary/index.js","../node_modules/unzip-stream/lib/matcher-stream.js","../node_modules/unzip-stream/lib/entry.js","../node_modules/unzip-stream/lib/unzip-stream.js","../node_modules/unzip-stream/lib/parser-stream.js","../node_modules/unzip-stream/node_modules/mkdirp/index.js","../node_modules/unzip-stream/lib/extract.js","../node_modules/unzip-stream/unzip.js","../node_modules/universalify/index.js","../node_modules/fs-extra/lib/fs/index.js","../node_modules/fs-extra/lib/mkdirs/utils.js","../node_modules/fs-extra/lib/mkdirs/make-dir.js","../node_modules/fs-extra/lib/mkdirs/index.js","../node_modules/fs-extra/lib/path-exists/index.js","../node_modules/fs-extra/lib/util/utimes.js","../node_modules/fs-extra/lib/util/stat.js","../node_modules/fs-extra/lib/copy/copy.js","../node_modules/fs-extra/lib/copy/copy-sync.js","../node_modules/fs-extra/lib/copy/index.js","../node_modules/fs-extra/lib/remove/index.js","../node_modules/fs-extra/lib/empty/index.js","../node_modules/fs-extra/lib/ensure/file.js","../node_modules/fs-extra/lib/ensure/link.js","../node_modules/fs-extra/lib/ensure/symlink-paths.js","../node_modules/fs-extra/lib/ensure/symlink-type.js","../node_modules/fs-extra/lib/ensure/symlink.js","../node_modules/fs-extra/lib/ensure/index.js","../node_modules/jsonfile/utils.js","../node_modules/jsonfile/index.js","../node_modules/fs-extra/lib/json/jsonfile.js","../node_modules/fs-extra/lib/output-file/index.js","../node_modules/fs-extra/lib/json/output-json.js","../node_modules/fs-extra/lib/json/output-json-sync.js","../node_modules/fs-extra/lib/json/index.js","../node_modules/fs-extra/lib/move/move.js","../node_modules/fs-extra/lib/move/move-sync.js","../node_modules/fs-extra/lib/move/index.js","../node_modules/fs-extra/lib/index.js","../node_modules/xml2js/lib/defaults.js","../node_modules/xmlbuilder/lib/Utility.js","../node_modules/xmlbuilder/lib/XMLDOMImplementation.js","../node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js","../node_modules/xmlbuilder/lib/XMLDOMStringList.js","../node_modules/xmlbuilder/lib/XMLDOMConfiguration.js","../node_modules/xmlbuilder/lib/NodeType.js","../node_modules/xmlbuilder/lib/XMLAttribute.js","../node_modules/xmlbuilder/lib/XMLNamedNodeMap.js","../node_modules/xmlbuilder/lib/XMLElement.js","../node_modules/xmlbuilder/lib/XMLCharacterData.js","../node_modules/xmlbuilder/lib/XMLCData.js","../node_modules/xmlbuilder/lib/XMLComment.js","../node_modules/xmlbuilder/lib/XMLDeclaration.js","../node_modules/xmlbuilder/lib/XMLDTDAttList.js","../node_modules/xmlbuilder/lib/XMLDTDEntity.js","../node_modules/xmlbuilder/lib/XMLDTDElement.js","../node_modules/xmlbuilder/lib/XMLDTDNotation.js","../node_modules/xmlbuilder/lib/XMLDocType.js","../node_modules/xmlbuilder/lib/XMLRaw.js","../node_modules/xmlbuilder/lib/XMLText.js","../node_modules/xmlbuilder/lib/XMLProcessingInstruction.js","../node_modules/xmlbuilder/lib/XMLDummy.js","../node_modules/xmlbuilder/lib/XMLNodeList.js","../node_modules/xmlbuilder/lib/DocumentPosition.js","../node_modules/xmlbuilder/lib/XMLNode.js","../node_modules/xmlbuilder/lib/XMLStringifier.js","../node_modules/xmlbuilder/lib/WriterState.js","../node_modules/xmlbuilder/lib/XMLWriterBase.js","../node_modules/xmlbuilder/lib/XMLStringWriter.js","../node_modules/xmlbuilder/lib/XMLDocument.js","../node_modules/xmlbuilder/lib/XMLDocumentCB.js","../node_modules/xmlbuilder/lib/XMLStreamWriter.js","../node_modules/xmlbuilder/lib/index.js","../node_modules/xml2js/lib/builder.js","../node_modules/sax/lib/sax.js","../node_modules/xml2js/lib/bom.js","../node_modules/xml2js/lib/processors.js","../node_modules/xml2js/lib/parser.js","../node_modules/xml2js/lib/xml2js.js","../node_modules/handlebars/lib/handlebars/utils.js","../node_modules/handlebars/lib/handlebars/exception.js","../node_modules/handlebars/lib/handlebars/helpers/block-helper-missing.js","../node_modules/handlebars/lib/handlebars/helpers/each.js","../node_modules/handlebars/lib/handlebars/helpers/helper-missing.js","../node_modules/handlebars/lib/handlebars/helpers/if.js","../node_modules/handlebars/lib/handlebars/helpers/log.js","../node_modules/handlebars/lib/handlebars/helpers/lookup.js","../node_modules/handlebars/lib/handlebars/helpers/with.js","../node_modules/handlebars/lib/handlebars/helpers.js","../node_modules/handlebars/lib/handlebars/decorators/inline.js","../node_modules/handlebars/lib/handlebars/decorators.js","../node_modules/handlebars/lib/handlebars/logger.js","../node_modules/handlebars/lib/handlebars/internal/proto-access.js","../node_modules/handlebars/lib/handlebars/base.js","../node_modules/handlebars/lib/handlebars/safe-string.js","../node_modules/handlebars/lib/handlebars/internal/wrapHelper.js","../node_modules/handlebars/lib/handlebars/runtime.js","../node_modules/handlebars/lib/handlebars/no-conflict.js","../node_modules/handlebars/lib/handlebars.runtime.js","../node_modules/handlebars/lib/handlebars/compiler/ast.js","../node_modules/handlebars/lib/handlebars/compiler/parser.js","../node_modules/handlebars/lib/handlebars/compiler/visitor.js","../node_modules/handlebars/lib/handlebars/compiler/whitespace-control.js","../node_modules/handlebars/lib/handlebars/compiler/helpers.js","../node_modules/handlebars/lib/handlebars/compiler/base.js","../node_modules/handlebars/lib/handlebars/compiler/compiler.js","../node_modules/source-map/lib/base64.js","../node_modules/source-map/lib/base64-vlq.js","../node_modules/source-map/lib/util.js","../node_modules/source-map/lib/array-set.js","../node_modules/source-map/lib/mapping-list.js","../node_modules/source-map/lib/source-map-generator.js","../node_modules/source-map/lib/binary-search.js","../node_modules/source-map/lib/quick-sort.js","../node_modules/source-map/lib/source-map-consumer.js","../node_modules/source-map/lib/source-node.js","../node_modules/source-map/source-map.js","../node_modules/handlebars/lib/handlebars/compiler/code-gen.js","../node_modules/handlebars/lib/handlebars/compiler/javascript-compiler.js","../node_modules/handlebars/lib/handlebars.js","../node_modules/handlebars/lib/handlebars/compiler/printer.js","../node_modules/handlebars/lib/index.js","../node_modules/entities/lib/maps/entities.json","../node_modules/entities/lib/maps/legacy.json","../node_modules/entities/lib/maps/xml.json","../node_modules/entities/lib/maps/decode.json","../node_modules/entities/lib/decode_codepoint.js","../node_modules/entities/lib/decode.js","../node_modules/entities/lib/encode.js","../node_modules/entities/lib/index.js","../node_modules/ansi-to-html/src/ansi_to_html.js","../node_modules/slack-ctrf/dist/message-formatter.js","../node_modules/slack-ctrf/dist/slack-notify.js","../node_modules/slack-ctrf/dist/utils/common.js","../node_modules/slack-ctrf/dist/slack-reporter.js","../node_modules/slack-ctrf/dist/index.js","../node_modules/teams-ctrf/dist/message-formatter.js","../node_modules/teams-ctrf/dist/teams-notify.js","../node_modules/teams-ctrf/dist/teams-reporter.js","../node_modules/teams-ctrf/dist/index.js","../node_modules/y18n/build/index.cjs","../node_modules/yargs-parser/build/index.cjs","../node_modules/ansi-regex/index.js","../node_modules/strip-ansi/index.js","../node_modules/is-fullwidth-code-point/index.js","../node_modules/emoji-regex/index.js","../node_modules/string-width/index.js","../node_modules/color-name/index.js","../node_modules/color-convert/conversions.js","../node_modules/color-convert/route.js","../node_modules/color-convert/index.js","../node_modules/ansi-styles/index.js","../node_modules/wrap-ansi/index.js","../node_modules/ai-ctrf/node_modules/cliui/build/index.cjs","../node_modules/escalade/sync/index.js","../node_modules/get-caller-file/index.ts","../node_modules/require-directory/index.js","../node_modules/ai-ctrf/node_modules/yargs/build/index.cjs","../node_modules/ai-ctrf/node_modules/yargs/yargs","../node_modules/ai-ctrf/node_modules/yargs/helpers/index.js","../node_modules/ai-ctrf/dist/assess.js","../node_modules/ai-ctrf/dist/common.js","../node_modules/ai-ctrf/dist/constants.js","../node_modules/openai/src/internal/qs/formats.ts","../node_modules/openai/src/internal/qs/utils.ts","../node_modules/openai/src/internal/qs/stringify.ts","../node_modules/openai/src/internal/qs/index.ts","../node_modules/openai/src/version.ts","../node_modules/openai/src/_shims/registry.ts","../node_modules/webidl-conversions/lib/index.js","../node_modules/whatwg-url/lib/utils.js","../node_modules/tr46/lib/mappingTable.json","../node_modules/tr46/index.js","../node_modules/whatwg-url/lib/url-state-machine.js","../node_modules/whatwg-url/lib/URL-impl.js","../node_modules/whatwg-url/lib/URL.js","../node_modules/whatwg-url/lib/public-api.js","../node_modules/node-fetch/lib/index.mjs","../node_modules/web-streams-polyfill/dist/ponyfill.js","../node_modules/formdata-node/lib/cjs/isFunction.js","../node_modules/formdata-node/lib/cjs/blobHelpers.js","../node_modules/formdata-node/lib/cjs/Blob.js","../node_modules/formdata-node/lib/cjs/File.js","../node_modules/formdata-node/lib/cjs/isFile.js","../node_modules/formdata-node/lib/cjs/isBlob.js","../node_modules/formdata-node/lib/cjs/deprecateConstructorEntries.js","../node_modules/formdata-node/lib/cjs/FormData.js","../node_modules/formdata-node/lib/cjs/index.js","../node_modules/humanize-ms/index.js","../node_modules/agentkeepalive/lib/constants.js","../node_modules/agentkeepalive/lib/agent.js","../node_modules/agentkeepalive/lib/https_agent.js","../node_modules/agentkeepalive/index.js","../node_modules/form-data-encoder/lib/cjs/util/createBoundary.js","../node_modules/form-data-encoder/lib/cjs/util/isPlainObject.js","../node_modules/form-data-encoder/lib/cjs/util/normalizeValue.js","../node_modules/form-data-encoder/lib/cjs/util/escapeName.js","../node_modules/form-data-encoder/lib/cjs/util/isFunction.js","../node_modules/form-data-encoder/lib/cjs/util/isFileLike.js","../node_modules/form-data-encoder/lib/cjs/util/isFormData.js","../node_modules/form-data-encoder/lib/cjs/FormDataEncoder.js","../node_modules/form-data-encoder/lib/cjs/FileLike.js","../node_modules/form-data-encoder/lib/cjs/FormDataLike.js","../node_modules/form-data-encoder/lib/cjs/index.js","../node_modules/openai/src/_shims/MultipartBody.ts","../node_modules/node-domexception/index.js","../node_modules/formdata-node/lib/cjs/isPlainObject.js","../node_modules/formdata-node/lib/cjs/fileFromPath.js","../node_modules/openai/src/_shims/node-runtime.ts","../node_modules/openai/src/_shims/auto/runtime-node.ts","../node_modules/openai/_shims/index.js","../node_modules/openai/src/error.ts","../node_modules/openai/src/internal/decoders/line.ts","../node_modules/openai/src/internal/stream-utils.ts","../node_modules/openai/src/streaming.ts","../node_modules/openai/src/uploads.ts","../node_modules/openai/src/core.ts","../node_modules/openai/src/pagination.ts","../node_modules/openai/src/resource.ts","../node_modules/openai/src/resources/chat/completions/messages.ts","../node_modules/openai/src/resources/chat/completions/completions.ts","../node_modules/openai/src/resources/chat/chat.ts","../node_modules/openai/src/resources/chat/completions/index.ts","../node_modules/openai/src/resources/chat/index.ts","../node_modules/openai/src/resources/audio/speech.ts","../node_modules/openai/src/resources/audio/transcriptions.ts","../node_modules/openai/src/resources/audio/translations.ts","../node_modules/openai/src/resources/audio/audio.ts","../node_modules/openai/src/resources/batches.ts","../node_modules/openai/src/lib/EventStream.ts","../node_modules/openai/src/lib/AssistantStream.ts","../node_modules/openai/src/resources/beta/assistants.ts","../node_modules/openai/src/lib/RunnableFunction.ts","../node_modules/openai/src/lib/chatCompletionUtils.ts","../node_modules/openai/src/lib/parser.ts","../node_modules/openai/src/lib/AbstractChatCompletionRunner.ts","../node_modules/openai/src/lib/ChatCompletionRunner.ts","../node_modules/openai/src/_vendor/partial-json-parser/parser.ts","../node_modules/openai/src/lib/ChatCompletionStream.ts","../node_modules/openai/src/lib/ChatCompletionStreamingRunner.ts","../node_modules/openai/src/resources/beta/chat/completions.ts","../node_modules/openai/src/resources/beta/chat/chat.ts","../node_modules/openai/src/resources/beta/realtime/sessions.ts","../node_modules/openai/src/resources/beta/realtime/transcription-sessions.ts","../node_modules/openai/src/resources/beta/realtime/realtime.ts","../node_modules/openai/src/resources/beta/threads/messages.ts","../node_modules/openai/src/resources/beta/threads/runs/steps.ts","../node_modules/openai/src/resources/beta/threads/runs/runs.ts","../node_modules/openai/src/resources/beta/threads/threads.ts","../node_modules/openai/src/resources/beta/beta.ts","../node_modules/openai/src/resources/completions.ts","../node_modules/openai/src/resources/containers/files/content.ts","../node_modules/openai/src/resources/containers/files/files.ts","../node_modules/openai/src/resources/containers/containers.ts","../node_modules/openai/src/resources/embeddings.ts","../node_modules/openai/src/resources/evals/runs/output-items.ts","../node_modules/openai/src/resources/evals/runs/runs.ts","../node_modules/openai/src/resources/evals/evals.ts","../node_modules/openai/src/resources/files.ts","../node_modules/openai/src/resources/fine-tuning/methods.ts","../node_modules/openai/src/resources/fine-tuning/alpha/graders.ts","../node_modules/openai/src/resources/fine-tuning/alpha/alpha.ts","../node_modules/openai/src/resources/fine-tuning/checkpoints/permissions.ts","../node_modules/openai/src/resources/fine-tuning/checkpoints/checkpoints.ts","../node_modules/openai/src/resources/fine-tuning/jobs/checkpoints.ts","../node_modules/openai/src/resources/fine-tuning/jobs/jobs.ts","../node_modules/openai/src/resources/fine-tuning/fine-tuning.ts","../node_modules/openai/src/resources/graders/grader-models.ts","../node_modules/openai/src/resources/graders/graders.ts","../node_modules/openai/src/resources/images.ts","../node_modules/openai/src/resources/models.ts","../node_modules/openai/src/resources/moderations.ts","../node_modules/openai/src/lib/ResponsesParser.ts","../node_modules/openai/src/resources/responses/input-items.ts","../node_modules/openai/src/lib/responses/ResponseStream.ts","../node_modules/openai/src/resources/responses/responses.ts","../node_modules/openai/src/resources/uploads/parts.ts","../node_modules/openai/src/resources/uploads/uploads.ts","../node_modules/openai/src/lib/Util.ts","../node_modules/openai/src/resources/vector-stores/files.ts","../node_modules/openai/src/resources/vector-stores/file-batches.ts","../node_modules/openai/src/resources/vector-stores/vector-stores.ts","../node_modules/openai/src/resources/index.ts","../node_modules/openai/src/index.ts","../node_modules/@anthropic-ai/sdk/src/version.ts","../node_modules/@anthropic-ai/sdk/src/_shims/registry.ts","../node_modules/@anthropic-ai/sdk/src/_shims/MultipartBody.ts","../node_modules/@anthropic-ai/sdk/src/_shims/node-runtime.ts","../node_modules/@anthropic-ai/sdk/src/_shims/auto/runtime-node.ts","../node_modules/@anthropic-ai/sdk/_shims/index.js","../node_modules/@anthropic-ai/sdk/src/streaming.ts","../node_modules/@anthropic-ai/sdk/src/uploads.ts","../node_modules/@anthropic-ai/sdk/src/core.ts","../node_modules/@anthropic-ai/sdk/src/error.ts","../node_modules/@anthropic-ai/sdk/src/resource.ts","../node_modules/@anthropic-ai/sdk/src/_vendor/partial-json-parser/parser.ts","../node_modules/@anthropic-ai/sdk/src/lib/PromptCachingBetaMessageStream.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/prompt-caching/messages.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/prompt-caching/prompt-caching.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/beta.ts","../node_modules/@anthropic-ai/sdk/src/resources/completions.ts","../node_modules/@anthropic-ai/sdk/src/lib/MessageStream.ts","../node_modules/@anthropic-ai/sdk/src/resources/messages.ts","../node_modules/@anthropic-ai/sdk/src/resources/index.ts","../node_modules/@anthropic-ai/sdk/src/index.ts","../node_modules/ai-ctrf/dist/models/claude.js","../node_modules/ai-ctrf/dist/models/azure-openai.js","../node_modules/ai-ctrf/dist/models/grok.js","../node_modules/ai-ctrf/dist/models/deepseek.js","../node_modules/@google/generative-ai/dist/index.js","../node_modules/ai-ctrf/dist/models/gemini.js","../node_modules/ai-ctrf/dist/models/perplexity.js","../node_modules/ai-ctrf/dist/models/openrouter.js","../node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamConfiguration.js","../node_modules/@smithy/protocol-http/dist-es/extensions/httpExtensionConfiguration.js","../node_modules/@smithy/protocol-http/dist-es/extensions/index.js","../node_modules/@smithy/types/dist-es/abort.js","../node_modules/@smithy/types/dist-es/auth/auth.js","../node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js","../node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js","../node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js","../node_modules/@smithy/types/dist-es/auth/HttpSigner.js","../node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js","../node_modules/@smithy/types/dist-es/auth/index.js","../node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js","../node_modules/@smithy/types/dist-es/checksum.js","../node_modules/@smithy/types/dist-es/client.js","../node_modules/@smithy/types/dist-es/command.js","../node_modules/@smithy/types/dist-es/connection/config.js","../node_modules/@smithy/types/dist-es/connection/manager.js","../node_modules/@smithy/types/dist-es/connection/pool.js","../node_modules/@smithy/types/dist-es/connection/index.js","../node_modules/@smithy/types/dist-es/crypto.js","../node_modules/@smithy/types/dist-es/encode.js","../node_modules/@smithy/types/dist-es/endpoint.js","../node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js","../node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js","../node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js","../node_modules/@smithy/types/dist-es/endpoints/shared.js","../node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js","../node_modules/@smithy/types/dist-es/endpoints/index.js","../node_modules/@smithy/types/dist-es/eventStream.js","../node_modules/@smithy/types/dist-es/extensions/checksum.js","../node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js","../node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js","../node_modules/@smithy/types/dist-es/extensions/index.js","../node_modules/@smithy/types/dist-es/feature-ids.js","../node_modules/@smithy/types/dist-es/http.js","../node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js","../node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js","../node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js","../node_modules/@smithy/types/dist-es/identity/identity.js","../node_modules/@smithy/types/dist-es/identity/tokenIdentity.js","../node_modules/@smithy/types/dist-es/identity/index.js","../node_modules/@smithy/types/dist-es/logger.js","../node_modules/@smithy/types/dist-es/middleware.js","../node_modules/@smithy/types/dist-es/pagination.js","../node_modules/@smithy/types/dist-es/profile.js","../node_modules/@smithy/types/dist-es/response.js","../node_modules/@smithy/types/dist-es/retry.js","../node_modules/@smithy/types/dist-es/schema/schema.js","../node_modules/@smithy/types/dist-es/schema/traits.js","../node_modules/@smithy/types/dist-es/schema/schema-deprecated.js","../node_modules/@smithy/types/dist-es/schema/sentinels.js","../node_modules/@smithy/types/dist-es/schema/static-schemas.js","../node_modules/@smithy/types/dist-es/serde.js","../node_modules/@smithy/types/dist-es/shapes.js","../node_modules/@smithy/types/dist-es/signature.js","../node_modules/@smithy/types/dist-es/stream.js","../node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js","../node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js","../node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js","../node_modules/@smithy/types/dist-es/transfer.js","../node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js","../node_modules/@smithy/types/dist-es/transform/mutable.js","../node_modules/@smithy/types/dist-es/transform/no-undefined.js","../node_modules/@smithy/types/dist-es/transform/type-transform.js","../node_modules/@smithy/types/dist-es/uri.js","../node_modules/@smithy/types/dist-es/util.js","../node_modules/@smithy/types/dist-es/waiter.js","../node_modules/@smithy/types/dist-es/index.js","../node_modules/@smithy/protocol-http/dist-es/Field.js","../node_modules/@smithy/protocol-http/dist-es/Fields.js","../node_modules/@smithy/protocol-http/dist-es/httpHandler.js","../node_modules/@smithy/protocol-http/dist-es/httpRequest.js","../node_modules/@smithy/protocol-http/dist-es/httpResponse.js","../node_modules/@smithy/protocol-http/dist-es/isValidHostname.js","../node_modules/@smithy/protocol-http/dist-es/types.js","../node_modules/@smithy/protocol-http/dist-es/index.js","../node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHandlingMiddleware.js","../node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHeaderMiddleware.js","../node_modules/@aws-sdk/middleware-eventstream/dist-es/getEventStreamPlugin.js","../node_modules/@aws-sdk/middleware-eventstream/dist-es/index.js","../node_modules/@aws-sdk/middleware-host-header/dist-es/index.js","../node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js","../node_modules/@aws-sdk/middleware-logger/dist-es/index.js","../node_modules/@aws-sdk/middleware-recursion-detection/dist-es/configuration.js","../node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js","../node_modules/@aws-sdk/middleware-recursion-detection/dist-es/recursionDetectionMiddleware.js","../node_modules/@aws-sdk/middleware-recursion-detection/dist-es/getRecursionDetectionPlugin.js","../node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js","../node_modules/@smithy/core/dist-es/getSmithyContext.js","../node_modules/@smithy/util-middleware/dist-es/getSmithyContext.js","../node_modules/@smithy/util-middleware/dist-es/normalizeProvider.js","../node_modules/@smithy/util-middleware/dist-es/index.js","../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/resolveAuthOptions.js","../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js","../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js","../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js","../node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js","../node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js","../node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js","../node_modules/@smithy/core/dist-es/middleware-http-signing/index.js","../node_modules/@smithy/core/dist-es/normalizeProvider.js","../node_modules/@smithy/core/dist-es/pagination/createPaginator.js","../node_modules/@smithy/is-array-buffer/dist-es/index.js","../node_modules/@smithy/util-buffer-from/dist-es/index.js","../node_modules/@smithy/util-base64/dist-es/fromBase64.js","../node_modules/@smithy/util-utf8/dist-es/fromUtf8.js","../node_modules/@smithy/util-utf8/dist-es/toUint8Array.js","../node_modules/@smithy/util-utf8/dist-es/toUtf8.js","../node_modules/@smithy/util-utf8/dist-es/index.js","../node_modules/@smithy/util-base64/dist-es/toBase64.js","../node_modules/@smithy/util-base64/dist-es/index.js","../node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js","../node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.js","../node_modules/@smithy/util-stream/dist-es/stream-type-check.js","../node_modules/@smithy/util-stream/dist-es/checksum/createChecksumStream.js","../node_modules/@smithy/util-stream/dist-es/createBufferedReadable.js","../node_modules/@smithy/util-stream/dist-es/getAwsChunkedEncodingStream.js","../node_modules/@smithy/util-stream/dist-es/headStream.js","../node_modules/@smithy/util-uri-escape/dist-es/escape-uri.js","../node_modules/@smithy/util-uri-escape/dist-es/escape-uri-path.js","../node_modules/@smithy/util-uri-escape/dist-es/index.js","../node_modules/@smithy/querystring-builder/dist-es/index.js","../node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js","../node_modules/@smithy/node-http-handler/dist-es/constants.js","../node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js","../node_modules/@smithy/node-http-handler/dist-es/timing.js","../node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js","../node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js","../node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js","../node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js","../node_modules/@smithy/node-http-handler/dist-es/write-request-body.js","../node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js","../node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js","../node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js","../node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js","../node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js","../node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js","../node_modules/@smithy/node-http-handler/dist-es/index.js","../node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js","../node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js","../node_modules/@smithy/fetch-http-handler/dist-es/index.js","../node_modules/@smithy/util-hex-encoding/dist-es/index.js","../node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js","../node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.js","../node_modules/@smithy/util-stream/dist-es/splitStream.js","../node_modules/@smithy/util-stream/dist-es/index.js","../node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js","../node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js","../node_modules/@smithy/core/dist-es/submodules/schema/deref.js","../node_modules/@smithy/core/dist-es/submodules/schema/schemas/operation.js","../node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js","../node_modules/@smithy/querystring-parser/dist-es/index.js","../node_modules/@smithy/url-parser/dist-es/index.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/toEndpointV1.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/index.js","../node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js","../node_modules/@smithy/core/dist-es/submodules/schema/middleware/getSchemaSerdePlugin.js","../node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js","../node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js","../node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js","../node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js","../node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js","../node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js","../node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js","../node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js","../node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js","../node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js","../node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js","../node_modules/@smithy/core/dist-es/submodules/schema/index.js","../node_modules/@smithy/core/dist-es/submodules/serde/copyDocumentWithTransform.js","../node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js","../node_modules/@smithy/core/dist-es/submodules/serde/date-utils.js","../node_modules/@smithy/uuid/dist-es/randomUUID.js","../node_modules/@smithy/uuid/dist-es/v4.js","../node_modules/@smithy/uuid/dist-es/index.js","../node_modules/@smithy/core/dist-es/submodules/serde/generateIdempotencyToken.js","../node_modules/@smithy/core/dist-es/submodules/serde/lazy-json.js","../node_modules/@smithy/core/dist-es/submodules/serde/quote-header.js","../node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js","../node_modules/@smithy/core/dist-es/submodules/serde/split-every.js","../node_modules/@smithy/core/dist-es/submodules/serde/split-header.js","../node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js","../node_modules/@smithy/core/dist-es/submodules/serde/index.js","../node_modules/@smithy/core/dist-es/submodules/protocols/SerdeContext.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/index.js","../node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js","../node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js","../node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js","../node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js","../node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js","../node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js","../node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js","../node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js","../node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js","../node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js","../node_modules/@smithy/core/dist-es/submodules/protocols/index.js","../node_modules/@smithy/core/dist-es/request-builder/requestBuilder.js","../node_modules/@smithy/core/dist-es/setFeature.js","../node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js","../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js","../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js","../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/noAuth.js","../node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js","../node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js","../node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js","../node_modules/@smithy/core/dist-es/index.js","../node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js","../node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js","../node_modules/@smithy/util-endpoints/dist-es/lib/isIpAddress.js","../node_modules/@smithy/util-endpoints/dist-es/lib/isValidHostLabel.js","../node_modules/@smithy/util-endpoints/dist-es/utils/customEndpointFunctions.js","../node_modules/@smithy/util-endpoints/dist-es/debug/debugId.js","../node_modules/@smithy/util-endpoints/dist-es/debug/toDebugString.js","../node_modules/@smithy/util-endpoints/dist-es/debug/index.js","../node_modules/@smithy/util-endpoints/dist-es/types/EndpointError.js","../node_modules/@smithy/util-endpoints/dist-es/types/EndpointFunctions.js","../node_modules/@smithy/util-endpoints/dist-es/types/EndpointRuleObject.js","../node_modules/@smithy/util-endpoints/dist-es/types/ErrorRuleObject.js","../node_modules/@smithy/util-endpoints/dist-es/types/RuleSetObject.js","../node_modules/@smithy/util-endpoints/dist-es/types/TreeRuleObject.js","../node_modules/@smithy/util-endpoints/dist-es/types/shared.js","../node_modules/@smithy/util-endpoints/dist-es/types/index.js","../node_modules/@smithy/util-endpoints/dist-es/lib/booleanEquals.js","../node_modules/@smithy/util-endpoints/dist-es/lib/getAttrPathList.js","../node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js","../node_modules/@smithy/util-endpoints/dist-es/lib/isSet.js","../node_modules/@smithy/util-endpoints/dist-es/lib/not.js","../node_modules/@smithy/util-endpoints/dist-es/lib/parseURL.js","../node_modules/@smithy/util-endpoints/dist-es/lib/stringEquals.js","../node_modules/@smithy/util-endpoints/dist-es/lib/substring.js","../node_modules/@smithy/util-endpoints/dist-es/lib/uriEncode.js","../node_modules/@smithy/util-endpoints/dist-es/lib/index.js","../node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js","../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js","../node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js","../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js","../node_modules/@smithy/util-endpoints/dist-es/utils/callFunction.js","../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js","../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js","../node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js","../node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js","../node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointUrl.js","../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js","../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js","../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js","../node_modules/@smithy/util-endpoints/dist-es/utils/index.js","../node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js","../node_modules/@smithy/util-endpoints/dist-es/index.js","../node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js","../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js","../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js","../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json","../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js","../node_modules/@aws-sdk/util-endpoints/dist-es/aws.js","../node_modules/@aws-sdk/util-endpoints/dist-es/resolveDefaultAwsRegionalEndpointsConfig.js","../node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js","../node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js","../node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointRuleObject.js","../node_modules/@aws-sdk/util-endpoints/dist-es/types/ErrorRuleObject.js","../node_modules/@aws-sdk/util-endpoints/dist-es/types/RuleSetObject.js","../node_modules/@aws-sdk/util-endpoints/dist-es/types/TreeRuleObject.js","../node_modules/@aws-sdk/util-endpoints/dist-es/types/shared.js","../node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js","../node_modules/@aws-sdk/util-endpoints/dist-es/index.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/setTokenFeature.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/index.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js","../node_modules/@smithy/property-provider/dist-es/ProviderError.js","../node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js","../node_modules/@smithy/property-provider/dist-es/TokenProviderError.js","../node_modules/@smithy/property-provider/dist-es/chain.js","../node_modules/@smithy/property-provider/dist-es/fromStatic.js","../node_modules/@smithy/property-provider/dist-es/memoize.js","../node_modules/@smithy/property-provider/dist-es/index.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js","../node_modules/@smithy/signature-v4/dist-es/constants.js","../node_modules/@smithy/signature-v4/dist-es/credentialDerivation.js","../node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js","../node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js","../node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js","../node_modules/@smithy/signature-v4/dist-es/headerUtil.js","../node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js","../node_modules/@smithy/signature-v4/dist-es/prepareRequest.js","../node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js","../node_modules/@smithy/signature-v4/dist-es/utilDate.js","../node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js","../node_modules/@smithy/signature-v4/dist-es/SignatureV4.js","../node_modules/@smithy/signature-v4/dist-es/signature-v4a-container.js","../node_modules/@smithy/signature-v4/dist-es/index.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js","../node_modules/@smithy/middleware-stack/dist-es/MiddlewareStack.js","../node_modules/@smithy/middleware-stack/dist-es/index.js","../node_modules/@smithy/smithy-client/dist-es/client.js","../node_modules/@smithy/smithy-client/dist-es/collect-stream-body.js","../node_modules/@smithy/smithy-client/dist-es/schemaLogFilter.js","../node_modules/@smithy/smithy-client/dist-es/command.js","../node_modules/@smithy/smithy-client/dist-es/constants.js","../node_modules/@smithy/smithy-client/dist-es/create-aggregated-client.js","../node_modules/@smithy/smithy-client/dist-es/exceptions.js","../node_modules/@smithy/smithy-client/dist-es/default-error-handler.js","../node_modules/@smithy/smithy-client/dist-es/defaults-mode.js","../node_modules/@smithy/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js","../node_modules/@smithy/smithy-client/dist-es/extended-encode-uri-component.js","../node_modules/@smithy/smithy-client/dist-es/extensions/checksum.js","../node_modules/@smithy/smithy-client/dist-es/extensions/retry.js","../node_modules/@smithy/smithy-client/dist-es/extensions/defaultExtensionConfiguration.js","../node_modules/@smithy/smithy-client/dist-es/extensions/index.js","../node_modules/@smithy/smithy-client/dist-es/get-array-if-single-item.js","../node_modules/@smithy/smithy-client/dist-es/get-value-from-text-node.js","../node_modules/@smithy/smithy-client/dist-es/is-serializable-header-value.js","../node_modules/@smithy/smithy-client/dist-es/NoOpLogger.js","../node_modules/@smithy/smithy-client/dist-es/object-mapping.js","../node_modules/@smithy/smithy-client/dist-es/resolve-path.js","../node_modules/@smithy/smithy-client/dist-es/ser-utils.js","../node_modules/@smithy/smithy-client/dist-es/serde-json.js","../node_modules/@smithy/smithy-client/dist-es/index.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/UnionSerde.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReplacer.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonCodec.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_0Protocol.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_1Protocol.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js","../node_modules/@aws-sdk/xml-builder/dist-es/XmlText.js","../node_modules/@aws-sdk/xml-builder/dist-es/XmlNode.js","../node_modules/@aws-sdk/xml-builder/dist-es/xml-external/nodable_entities.js","../node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js","../node_modules/@aws-sdk/xml-builder/dist-es/index.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QuerySerializerSettings.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlCodec.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js","../node_modules/@aws-sdk/core/dist-es/index.js","../node_modules/@smithy/util-retry/dist-es/config.js","../node_modules/@smithy/service-error-classification/dist-es/constants.js","../node_modules/@smithy/service-error-classification/dist-es/index.js","../node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js","../node_modules/@smithy/util-retry/dist-es/constants.js","../node_modules/@smithy/util-retry/dist-es/defaultRetryBackoffStrategy.js","../node_modules/@smithy/util-retry/dist-es/defaultRetryToken.js","../node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js","../node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js","../node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js","../node_modules/@smithy/util-retry/dist-es/types.js","../node_modules/@smithy/util-retry/dist-es/index.js","../node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js","../node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js","../node_modules/@aws-sdk/middleware-user-agent/dist-es/encode-features.js","../node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js","../node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js","../node_modules/tslib/tslib.es6.mjs","../node_modules/@aws-crypto/util/node_modules/@smithy/is-array-buffer/dist-es/index.js","../node_modules/@aws-crypto/util/node_modules/@smithy/util-buffer-from/dist-es/index.js","../node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/fromUtf8.js","../node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js","../node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUtf8.js","../node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/index.js","../node_modules/@aws-crypto/util/src/convertToBuffer.ts","../node_modules/@aws-crypto/util/src/isEmptyData.ts","../node_modules/@aws-crypto/util/src/numToUint8.ts","../node_modules/@aws-crypto/util/src/uint32ArrayFrom.ts","../node_modules/@aws-crypto/util/src/index.ts","../node_modules/@aws-crypto/crc32/src/aws_crc32.ts","../node_modules/@aws-crypto/crc32/src/index.ts","../node_modules/@smithy/eventstream-codec/dist-es/Int64.js","../node_modules/@smithy/eventstream-codec/dist-es/HeaderMarshaller.js","../node_modules/@smithy/eventstream-codec/dist-es/splitMessage.js","../node_modules/@smithy/eventstream-codec/dist-es/EventStreamCodec.js","../node_modules/@smithy/eventstream-codec/dist-es/Message.js","../node_modules/@smithy/eventstream-codec/dist-es/MessageDecoderStream.js","../node_modules/@smithy/eventstream-codec/dist-es/MessageEncoderStream.js","../node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageDecoderStream.js","../node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageEncoderStream.js","../node_modules/@smithy/eventstream-codec/dist-es/index.js","../node_modules/@smithy/eventstream-serde-universal/dist-es/getChunkedStream.js","../node_modules/@smithy/eventstream-serde-universal/dist-es/getUnmarshalledStream.js","../node_modules/@smithy/eventstream-serde-universal/dist-es/EventStreamMarshaller.js","../node_modules/@smithy/eventstream-serde-universal/dist-es/provider.js","../node_modules/@smithy/eventstream-serde-universal/dist-es/index.js","../node_modules/@aws-sdk/middleware-websocket/dist-es/utils.js","../node_modules/@aws-sdk/middleware-websocket/dist-es/WebSocketFetchHandler.js","../node_modules/@aws-sdk/middleware-websocket/dist-es/middlewares/websocketEndpointMiddleware.js","../node_modules/@aws-sdk/middleware-websocket/dist-es/middlewares/websocketInjectSessionIdMiddleware.js","../node_modules/@aws-sdk/middleware-websocket/dist-es/getWebSocketPlugin.js","../node_modules/@aws-sdk/middleware-websocket/dist-es/WebsocketSignatureV4.js","../node_modules/@aws-sdk/middleware-websocket/dist-es/resolveWebSocketConfig.js","../node_modules/@aws-sdk/middleware-websocket/dist-es/ws-eventstream/eventStreamPayloadHandlerProvider.js","../node_modules/@aws-sdk/middleware-websocket/dist-es/index.js","../node_modules/@smithy/util-config-provider/dist-es/booleanSelector.js","../node_modules/@smithy/util-config-provider/dist-es/numberSelector.js","../node_modules/@smithy/util-config-provider/dist-es/types.js","../node_modules/@smithy/util-config-provider/dist-es/index.js","../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js","../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js","../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveCustomEndpointsConfig.js","../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveEndpointsConfig.js","../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/index.js","../node_modules/@smithy/config-resolver/dist-es/regionConfig/config.js","../node_modules/@smithy/config-resolver/dist-es/regionConfig/checkRegion.js","../node_modules/@smithy/config-resolver/dist-es/regionConfig/isFipsRegion.js","../node_modules/@smithy/config-resolver/dist-es/regionConfig/getRealRegion.js","../node_modules/@smithy/config-resolver/dist-es/regionConfig/resolveRegionConfig.js","../node_modules/@smithy/config-resolver/dist-es/regionConfig/index.js","../node_modules/@smithy/config-resolver/dist-es/regionInfo/PartitionHash.js","../node_modules/@smithy/config-resolver/dist-es/regionInfo/RegionHash.js","../node_modules/@smithy/config-resolver/dist-es/regionInfo/getRegionInfo.js","../node_modules/@smithy/config-resolver/dist-es/regionInfo/index.js","../node_modules/@smithy/config-resolver/dist-es/index.js","../node_modules/@smithy/eventstream-serde-config-resolver/dist-es/EventStreamSerdeConfig.js","../node_modules/@smithy/eventstream-serde-config-resolver/dist-es/index.js","../node_modules/@smithy/middleware-content-length/dist-es/index.js","../node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/s3.js","../node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/index.js","../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js","../node_modules/@smithy/node-config-provider/dist-es/getSelectorName.js","../node_modules/@smithy/node-config-provider/dist-es/fromEnv.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/getHomeDir.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/getProfileName.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/constants.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigData.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigFilepath.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/getCredentialsFilepath.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/parseIni.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/readFile.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/getSsoSessionData.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/loadSsoSessionData.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/mergeConfigFiles.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/parseKnownFiles.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/externalDataInterceptor.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/types.js","../node_modules/@smithy/shared-ini-file-loader/dist-es/index.js","../node_modules/@smithy/node-config-provider/dist-es/fromSharedConfigFiles.js","../node_modules/@smithy/node-config-provider/dist-es/fromStatic.js","../node_modules/@smithy/node-config-provider/dist-es/configLoader.js","../node_modules/@smithy/node-config-provider/dist-es/index.js","../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointUrlConfig.js","../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromConfig.js","../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/toEndpointV1.js","../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js","../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/index.js","../node_modules/@smithy/middleware-endpoint/dist-es/endpointMiddleware.js","../node_modules/@smithy/middleware-serde/dist-es/deserializerMiddleware.js","../node_modules/@smithy/middleware-serde/dist-es/serializerMiddleware.js","../node_modules/@smithy/middleware-serde/dist-es/serdePlugin.js","../node_modules/@smithy/middleware-serde/dist-es/index.js","../node_modules/@smithy/middleware-endpoint/dist-es/getEndpointPlugin.js","../node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointConfig.js","../node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointRequiredConfig.js","../node_modules/@smithy/middleware-endpoint/dist-es/types.js","../node_modules/@smithy/middleware-endpoint/dist-es/index.js","../node_modules/@smithy/middleware-retry/dist-es/delayDecider.js","../node_modules/@smithy/middleware-retry/dist-es/retryDecider.js","../node_modules/@smithy/middleware-retry/dist-es/util.js","../node_modules/@smithy/middleware-retry/dist-es/StandardRetryStrategy.js","../node_modules/@smithy/middleware-retry/dist-es/AdaptiveRetryStrategy.js","../node_modules/@smithy/middleware-retry/dist-es/configurations.js","../node_modules/@smithy/middleware-retry/dist-es/omitRetryHeadersMiddleware.js","../node_modules/@smithy/middleware-retry/dist-es/isStreamingPayload/isStreamingPayload.js","../node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js","../node_modules/@smithy/middleware-retry/dist-es/index.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/auth/httpAuthSchemeProvider.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/endpoint/EndpointParameters.js","../node_modules/@aws-sdk/client-bedrock-runtime/package.json","../node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js","../node_modules/@aws-sdk/credential-provider-env/dist-es/index.js","../node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js","../node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js","../node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js","../node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/retry.js","../node_modules/@smithy/credential-provider-imds/dist-es/fromContainerMetadata.js","../node_modules/@smithy/credential-provider-imds/dist-es/error/InstanceMetadataV1FallbackError.js","../node_modules/@smithy/credential-provider-imds/dist-es/config/Endpoint.js","../node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointConfigOptions.js","../node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointMode.js","../node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointModeConfigOptions.js","../node_modules/@smithy/credential-provider-imds/dist-es/utils/getInstanceMetadataEndpoint.js","../node_modules/@smithy/credential-provider-imds/dist-es/utils/getExtendedInstanceMetadataCredentials.js","../node_modules/@smithy/credential-provider-imds/dist-es/utils/staticStabilityProvider.js","../node_modules/@smithy/credential-provider-imds/dist-es/fromInstanceMetadata.js","../node_modules/@smithy/credential-provider-imds/dist-es/types.js","../node_modules/@smithy/credential-provider-imds/dist-es/index.js","../node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/checkUrl.js","../node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/requestHelpers.js","../node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/retry-wrapper.js","../node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js","../node_modules/@aws-sdk/credential-provider-http/dist-es/index.js","../node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js","../node_modules/@aws-sdk/credential-provider-node/dist-es/runtime/memoize-chain.js","../node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js","../node_modules/@aws-sdk/token-providers/dist-es/fromEnvSigningName.js","../node_modules/@aws-sdk/token-providers/dist-es/constants.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthSchemeProvider.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/EndpointParameters.js","../node_modules/@aws-sdk/nested-clients/package.json","../node_modules/@aws-sdk/util-user-agent-node/dist-es/getRuntimeUserAgentPair.js","../node_modules/@aws-sdk/util-user-agent-node/dist-es/getNodeModulesParentDirs.js","../node_modules/@aws-sdk/util-user-agent-node/dist-es/getSanitizedTypeScriptVersion.js","../node_modules/@aws-sdk/util-user-agent-node/dist-es/getSanitizedDevTypeScriptVersion.js","../node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptUserAgentPair.js","../node_modules/@aws-sdk/util-user-agent-node/dist-es/crt-availability.js","../node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js","../node_modules/@aws-sdk/util-user-agent-node/dist-es/defaultUserAgent.js","../node_modules/@aws-sdk/util-user-agent-node/dist-es/nodeAppIdConfigOptions.js","../node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js","../node_modules/@smithy/hash-node/dist-es/index.js","../node_modules/@smithy/util-body-length-node/dist-es/calculateBodyLength.js","../node_modules/@smithy/util-body-length-node/dist-es/index.js","../node_modules/@smithy/util-defaults-mode-node/dist-es/constants.js","../node_modules/@smithy/util-defaults-mode-node/dist-es/defaultsModeConfig.js","../node_modules/@smithy/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js","../node_modules/@smithy/util-defaults-mode-node/dist-es/index.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/ruleset.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/endpointResolver.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/SSOOIDCServiceException.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/errors.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/schemas/schemas_0.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.shared.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js","../node_modules/@aws-sdk/region-config-resolver/dist-es/extensions/index.js","../node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/awsRegionConfig.js","../node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/stsRegionDefaultResolver.js","../node_modules/@aws-sdk/region-config-resolver/dist-es/index.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeExtensions.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDCClient.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/CreateTokenCommand.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDC.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/index.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/enums.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/models_0.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/index.js","../node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js","../node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js","../node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js","../node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js","../node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js","../node_modules/@aws-sdk/token-providers/dist-es/fromSso.js","../node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js","../node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js","../node_modules/@aws-sdk/token-providers/dist-es/index.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/auth/httpAuthSchemeProvider.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/EndpointParameters.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/ruleset.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/endpointResolver.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/SSOServiceException.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/errors.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/schemas/schemas_0.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.shared.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/auth/httpAuthExtensionConfiguration.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeExtensions.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSOClient.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commands/GetRoleCredentialsCommand.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSO.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commands/index.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/models_0.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/index.js","../node_modules/@aws-sdk/credential-provider-sso/dist-es/loadSso.js","../node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js","../node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js","../node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js","../node_modules/@aws-sdk/credential-provider-sso/dist-es/types.js","../node_modules/@aws-sdk/credential-provider-sso/dist-es/index.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveCredentialSource.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/EndpointParameters.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/ruleset.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.shared.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthExtensionConfiguration.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeExtensions.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STSClient.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleCommand.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STS.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/index.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/models_0.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultStsRoleAssumers.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultRoleAssumers.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/index.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthSchemeProvider.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/EndpointParameters.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/ruleset.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/SigninServiceException.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/errors.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/schemas/schemas_0.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.shared.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthExtensionConfiguration.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeExtensions.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/SigninClient.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/Signin.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/index.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/enums.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/models_0.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/index.js","../node_modules/@aws-sdk/credential-provider-login/dist-es/LoginCredentialsFetcher.js","../node_modules/@aws-sdk/credential-provider-login/dist-es/fromLoginCredentials.js","../node_modules/@aws-sdk/credential-provider-login/dist-es/types.js","../node_modules/@aws-sdk/credential-provider-login/dist-es/index.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveLoginCredentials.js","../node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js","../node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js","../node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js","../node_modules/@aws-sdk/credential-provider-process/dist-es/index.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveSsoCredentials.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveStaticCredentials.js","../node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js","../node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js","../node_modules/@aws-sdk/credential-provider-web-identity/dist-es/index.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProfileData.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/fromIni.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/index.js","../node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js","../node_modules/@aws-sdk/credential-provider-node/dist-es/index.js","../node_modules/@aws-sdk/eventstream-handler-node/dist-es/EventSigningTransformStream.js","../node_modules/@aws-sdk/eventstream-handler-node/dist-es/EventStreamPayloadHandler.js","../node_modules/@aws-sdk/eventstream-handler-node/dist-es/eventStreamPayloadHandlerProvider.js","../node_modules/@aws-sdk/eventstream-handler-node/dist-es/index.js","../node_modules/@smithy/eventstream-serde-node/dist-es/utils.js","../node_modules/@smithy/eventstream-serde-node/dist-es/EventStreamMarshaller.js","../node_modules/@smithy/eventstream-serde-node/dist-es/provider.js","../node_modules/@smithy/eventstream-serde-node/dist-es/index.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/endpoint/ruleset.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/endpoint/endpointResolver.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/models/BedrockRuntimeServiceException.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/models/errors.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/schemas/schemas_0.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeConfig.shared.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeConfig.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/auth/httpAuthExtensionConfiguration.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeExtensions.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/BedrockRuntimeClient.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/ApplyGuardrailCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/ConverseCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/ConverseStreamCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/CountTokensCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/GetAsyncInvokeCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/InvokeModelCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/InvokeModelWithBidirectionalStreamCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/InvokeModelWithResponseStreamCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/ListAsyncInvokesCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/StartAsyncInvokeCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/pagination/ListAsyncInvokesPaginator.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/BedrockRuntime.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/index.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/pagination/Interfaces.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/pagination/index.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/models/enums.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/models/models_0.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/index.js","../node_modules/ai-ctrf/dist/models/bedrock.js","../node_modules/ai-ctrf/dist/models/custom.js","../node_modules/ai-ctrf/dist/consolidated-summary.js","../node_modules/ai-ctrf/dist/models/openai.js","../node_modules/ai-ctrf/dist/json-summary.js","../node_modules/ai-ctrf/dist/report-insights.js","../node_modules/ai-ctrf/dist/models/mistral.js","../node_modules/ai-ctrf/dist/models/ollama.js","../node_modules/ai-ctrf/dist/index.js","../node_modules/@actions/core/src/command.ts","../node_modules/@actions/core/src/utils.ts","../node_modules/@actions/core/src/file-command.ts","../node_modules/@actions/core/src/core.ts","../node_modules/@actions/http-client/src/index.ts","../node_modules/@actions/http-client/src/proxy.ts","../node_modules/@actions/http-client/src/auth.ts","../node_modules/@actions/core/src/summary.ts","../node_modules/@actions/core/src/platform.ts","../node_modules/@actions/io/src/io-util.ts","../node_modules/@actions/exec/src/toolrunner.ts","../src/ctrf/enrichers.ts","../src/ctrf/helpers.ts","../node_modules/@actions/github/src/context.ts","../node_modules/@actions/github/src/internal/utils.ts","../node_modules/@actions/github/src/utils.ts","../node_modules/@actions/github/src/github.ts","../src/config/index.ts","../src/client/github/client.ts","../src/client/github/issues.ts","../src/client/github/workflows.ts","../src/client/github/artifacts.ts","../node_modules/@actions/artifact/src/internal/shared/config.ts","../node_modules/@actions/artifact/src/internal/upload/upload-artifact.ts","../node_modules/@protobuf-ts/runtime/build/es2015/json-typings.js","../node_modules/@protobuf-ts/runtime/build/es2015/base64.js","../node_modules/@protobuf-ts/runtime/build/es2015/binary-format-contract.js","../node_modules/@protobuf-ts/runtime/build/es2015/goog-varint.js","../node_modules/@protobuf-ts/runtime/build/es2015/pb-long.js","../node_modules/@protobuf-ts/runtime/build/es2015/binary-reader.js","../node_modules/@protobuf-ts/runtime/build/es2015/assert.js","../node_modules/@protobuf-ts/runtime/build/es2015/binary-writer.js","../node_modules/@protobuf-ts/runtime/build/es2015/json-format-contract.js","../node_modules/@protobuf-ts/runtime/build/es2015/message-type-contract.js","../node_modules/@protobuf-ts/runtime/build/es2015/lower-camel-case.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-info.js","../node_modules/@protobuf-ts/runtime/build/es2015/oneof.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-type-check.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-long-convert.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-json-reader.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-json-writer.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-scalar-default.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-binary-reader.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-binary-writer.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-create.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-merge-partial.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-equals.js","../node_modules/@protobuf-ts/runtime/build/es2015/message-type.js","../node_modules/@actions/artifact/src/generated/google/protobuf/timestamp.ts","../node_modules/@actions/artifact/src/generated/google/protobuf/wrappers.ts","../node_modules/@protobuf-ts/runtime-rpc/build/es2015/reflection-info.js","../node_modules/@protobuf-ts/runtime-rpc/build/es2015/service-type.js","../node_modules/@actions/artifact/src/generated/results/api/v1/artifact.ts","../node_modules/@actions/artifact/src/generated/results/api/v1/artifact.twirp-client.ts","../node_modules/@actions/artifact/src/internal/upload/retention.ts","../node_modules/@actions/artifact/src/internal/upload/path-and-artifact-name-validation.ts","../node_modules/@actions/artifact/src/internal/shared/user-agent.ts","../node_modules/@actions/artifact/src/internal/shared/errors.ts","../node_modules/jwt-decode/build/esm/index.js","../node_modules/@actions/artifact/src/internal/shared/util.ts","../node_modules/@actions/artifact/src/internal/shared/artifact-twirp-client.ts","../node_modules/@actions/artifact/src/internal/upload/upload-zip-specification.ts","../node_modules/@typespec/ts-http-runtime/src/abort-controller/AbortError.ts","../node_modules/@typespec/ts-http-runtime/src/logger/log.ts","../node_modules/@typespec/ts-http-runtime/src/logger/debug.ts","../node_modules/@typespec/ts-http-runtime/src/logger/logger.ts","../node_modules/@typespec/ts-http-runtime/src/httpHeaders.ts","../node_modules/@typespec/ts-http-runtime/src/util/uuidUtils.ts","../node_modules/@typespec/ts-http-runtime/src/pipelineRequest.ts","../node_modules/@typespec/ts-http-runtime/src/pipeline.ts","../node_modules/@typespec/ts-http-runtime/src/util/object.ts","../node_modules/@typespec/ts-http-runtime/src/util/error.ts","../node_modules/@typespec/ts-http-runtime/src/util/inspect.ts","../node_modules/@typespec/ts-http-runtime/src/util/sanitizer.ts","../node_modules/@typespec/ts-http-runtime/src/restError.ts","../node_modules/@typespec/ts-http-runtime/src/util/bytesEncoding.ts","../node_modules/@typespec/ts-http-runtime/src/nodeHttpClient.ts","../node_modules/@typespec/ts-http-runtime/src/log.ts","../node_modules/@typespec/ts-http-runtime/src/defaultHttpClient.ts","../node_modules/@typespec/ts-http-runtime/src/policies/logPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/redirectPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/util/userAgentPlatform.ts","../node_modules/@typespec/ts-http-runtime/src/constants.ts","../node_modules/@typespec/ts-http-runtime/src/util/userAgent.ts","../node_modules/@typespec/ts-http-runtime/src/policies/userAgentPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/decompressResponsePolicy.ts","../node_modules/@typespec/ts-http-runtime/src/util/random.ts","../node_modules/@typespec/ts-http-runtime/src/util/delay.ts","../node_modules/@typespec/ts-http-runtime/src/util/helpers.ts","../node_modules/@typespec/ts-http-runtime/src/retryStrategies/throttlingRetryStrategy.ts","../node_modules/@typespec/ts-http-runtime/src/retryStrategies/exponentialRetryStrategy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/retryPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/defaultRetryPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/util/checkEnvironment.ts","../node_modules/@typespec/ts-http-runtime/src/policies/formDataPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/proxyPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/agentPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/tlsPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/util/typeGuards.ts","../node_modules/@typespec/ts-http-runtime/src/util/concat.ts","../node_modules/@typespec/ts-http-runtime/src/policies/multipartPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/pipeline.ts","../node_modules/@azure/logger/src/index.ts","../node_modules/@azure/core-rest-pipeline/src/log.ts","../node_modules/@azure/core-rest-pipeline/src/policies/logPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/redirectPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/util/userAgentPlatform.ts","../node_modules/@azure/core-rest-pipeline/src/constants.ts","../node_modules/@azure/core-rest-pipeline/src/util/userAgent.ts","../node_modules/@azure/core-rest-pipeline/src/policies/userAgentPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/util/sha256.ts","../node_modules/@azure/abort-controller/src/AbortError.ts","../node_modules/@azure/core-util/src/createAbortablePromise.ts","../node_modules/@azure/core-util/src/delay.ts","../node_modules/@azure/core-util/src/error.ts","../node_modules/@azure/core-util/src/index.ts","../node_modules/@azure/core-rest-pipeline/src/util/file.ts","../node_modules/@azure/core-rest-pipeline/src/policies/multipartPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/decompressResponsePolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/defaultRetryPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/formDataPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/proxyPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/setClientRequestIdPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/agentPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/tlsPolicy.ts","../node_modules/@azure/core-tracing/src/tracingContext.ts","../node_modules/@azure/core-tracing/src/state.ts","../node_modules/@azure/core-tracing/src/instrumenter.ts","../node_modules/@azure/core-tracing/src/tracingClient.ts","../node_modules/@azure/core-rest-pipeline/src/restError.ts","../node_modules/@azure/core-rest-pipeline/src/policies/tracingPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/util/wrapAbortSignal.ts","../node_modules/@azure/core-rest-pipeline/src/policies/wrapAbortSignalLikePolicy.ts","../node_modules/@azure/core-rest-pipeline/src/createPipelineFromOptions.ts","../node_modules/@azure/core-rest-pipeline/src/defaultHttpClient.ts","../node_modules/@azure/core-rest-pipeline/src/httpHeaders.ts","../node_modules/@azure/core-rest-pipeline/src/pipelineRequest.ts","../node_modules/@azure/core-rest-pipeline/src/policies/retryPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/util/tokenCycler.ts","../node_modules/@azure/core-rest-pipeline/src/policies/bearerTokenAuthenticationPolicy.ts","../node_modules/@azure/core-auth/src/tokenCredential.ts","../node_modules/@azure/core-http-compat/src/policies/disableKeepAlivePolicy.ts","../node_modules/@azure/core-client/src/base64.ts","../node_modules/@azure/core-client/src/interfaces.ts","../node_modules/@azure/core-client/src/utils.ts","../node_modules/@azure/core-client/src/serializer.ts","../node_modules/@azure/core-client/src/state.ts","../node_modules/@azure/core-client/src/operationHelpers.ts","../node_modules/@azure/core-client/src/deserializationPolicy.ts","../node_modules/@azure/core-client/src/interfaceHelpers.ts","../node_modules/@azure/core-client/src/serializationPolicy.ts","../node_modules/@azure/core-client/src/pipeline.ts","../node_modules/@azure/core-client/src/httpClientCache.ts","../node_modules/@azure/core-client/src/urlHelpers.ts","../node_modules/@azure/core-client/src/log.ts","../node_modules/@azure/core-client/src/serviceClient.ts","../node_modules/@azure/core-client/src/authorizeRequestOnTenantChallenge.ts","../node_modules/@azure/core-http-compat/src/util.ts","../node_modules/@azure/core-http-compat/src/response.ts","../node_modules/@azure/core-http-compat/src/extendedClient.ts","../node_modules/@azure/core-http-compat/src/policies/requestPolicyFactoryPolicy.ts","../node_modules/@azure/core-http-compat/src/httpClientAdapter.ts","../node_modules/@azure/core-xml/src/xml.ts","../node_modules/@azure/core-xml/src/xml.common.ts","../node_modules/@azure/storage-blob/src/log.ts","../node_modules/@azure/storage-common/src/BufferScheduler.ts","../node_modules/@azure/storage-common/src/BuffersStream.ts","../node_modules/@azure/storage-common/src/PooledBuffer.ts","../node_modules/@azure/storage-common/src/cache.ts","../node_modules/@azure/storage-common/src/policies/RequestPolicy.ts","../node_modules/@azure/storage-common/src/utils/constants.ts","../node_modules/@azure/storage-common/src/utils/utils.common.ts","../node_modules/@azure/storage-common/src/policies/StorageBrowserPolicy.ts","../node_modules/@azure/storage-common/src/StorageBrowserPolicyFactory.ts","../node_modules/@azure/storage-common/src/policies/CredentialPolicy.ts","../node_modules/@azure/storage-common/src/policies/AnonymousCredentialPolicy.ts","../node_modules/@azure/storage-common/src/credentials/Credential.ts","../node_modules/@azure/storage-common/src/credentials/AnonymousCredential.ts","../node_modules/@azure/storage-common/src/credentials/StorageSharedKeyCredential.ts","../node_modules/@azure/storage-common/src/utils/SharedKeyComparator.ts","../node_modules/@azure/storage-common/src/policies/StorageSharedKeyCredentialPolicy.ts","../node_modules/@azure/storage-common/src/log.ts","../node_modules/@azure/storage-common/src/policies/StorageRetryPolicyType.ts","../node_modules/@azure/storage-common/src/policies/StorageRetryPolicy.ts","../node_modules/@azure/storage-common/src/StorageRetryPolicyFactory.ts","../node_modules/@azure/storage-common/src/policies/StorageBrowserPolicyV2.ts","../node_modules/@azure/storage-common/src/policies/StorageCorrectContentLengthPolicy.ts","../node_modules/@azure/storage-common/src/policies/StorageRetryPolicyV2.ts","../node_modules/@azure/storage-common/src/policies/StorageSharedKeyCredentialPolicyV2.ts","../node_modules/@azure/storage-common/src/policies/StorageRequestFailureDetailsParserPolicy.ts","../node_modules/@azure/storage-common/src/credentials/UserDelegationKeyCredential.ts","../node_modules/@azure/storage-blob/src/utils/constants.ts","../node_modules/@azure/storage-blob/src/Pipeline.ts","../node_modules/@azure/storage-blob/src/generated/src/models/index.ts","../node_modules/@azure/storage-blob/src/generated/src/models/mappers.ts","../node_modules/@azure/storage-blob/src/generated/src/models/parameters.ts","../node_modules/@azure/storage-blob/src/generated/src/operations/service.ts","../node_modules/@azure/storage-blob/src/generated/src/operations/container.ts","../node_modules/@azure/storage-blob/src/generated/src/operations/blob.ts","../node_modules/@azure/storage-blob/src/generated/src/operations/pageBlob.ts","../node_modules/@azure/storage-blob/src/generated/src/operations/appendBlob.ts","../node_modules/@azure/storage-blob/src/generated/src/operations/blockBlob.ts","../node_modules/@azure/storage-blob/src/generated/src/storageClient.ts","../node_modules/@azure/storage-blob/src/StorageContextClient.ts","../node_modules/@azure/storage-blob/src/utils/utils.common.ts","../node_modules/@azure/storage-blob/src/StorageClient.ts","../node_modules/@azure/storage-blob/src/utils/tracing.ts","../node_modules/@azure/storage-blob/src/sas/BlobSASPermissions.ts","../node_modules/@azure/storage-blob/src/sas/ContainerSASPermissions.ts","../node_modules/@azure/storage-blob/src/sas/SasIPRange.ts","../node_modules/@azure/storage-blob/src/sas/SASQueryParameters.ts","../node_modules/@azure/storage-blob/src/sas/BlobSASSignatureValues.ts","../node_modules/@azure/storage-blob/src/BlobLeaseClient.ts","../node_modules/@azure/storage-blob/src/utils/RetriableReadableStream.ts","../node_modules/@azure/storage-blob/src/BlobDownloadResponse.ts","../node_modules/@azure/storage-blob/src/utils/BlobQuickQueryStream.ts","../node_modules/@azure/storage-blob/src/internal-avro/AvroConstants.ts","../node_modules/@azure/storage-blob/src/internal-avro/AvroParser.ts","../node_modules/@azure/storage-blob/src/internal-avro/utils/utils.common.ts","../node_modules/@azure/storage-blob/src/internal-avro/AvroReader.ts","../node_modules/@azure/storage-blob/src/internal-avro/AvroReadable.ts","../node_modules/@azure/storage-blob/src/internal-avro/AvroReadableFromStream.ts","../node_modules/@azure/storage-blob/src/BlobQueryResponse.ts","../node_modules/@azure/storage-blob/src/models.ts","../node_modules/@azure/storage-blob/src/PageBlobRangeResponse.ts","../node_modules/@azure/core-lro/src/logger.ts","../node_modules/@azure/core-lro/src/legacy/poller.ts","../node_modules/@azure/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.ts","../node_modules/@azure/storage-blob/src/Range.ts","../node_modules/@azure/storage-blob/src/utils/Batch.ts","../node_modules/@azure/storage-blob/src/utils/utils.ts","../node_modules/@azure/storage-blob/src/Clients.ts","../node_modules/@azure/storage-blob/src/utils/Mutex.ts","../node_modules/@azure/storage-blob/src/generatedModels.ts","../node_modules/@actions/artifact/src/internal/upload/blob-upload.ts","../node_modules/@actions/artifact/src/internal/upload/zip.ts","../node_modules/@actions/artifact/src/internal/upload/stream.ts","../node_modules/@actions/artifact/src/internal/upload/types.ts","../node_modules/@actions/artifact/src/internal/download/download-artifact.ts","../node_modules/@actions/artifact/src/internal/find/retry-options.ts","../node_modules/@actions/artifact/src/internal/delete/delete-artifact.ts","../node_modules/@actions/artifact/src/internal/find/get-artifact.ts","../node_modules/@actions/artifact/src/internal/find/list-artifacts.ts","../node_modules/@actions/artifact/src/internal/client.ts","../node_modules/@actions/artifact/src/artifact.ts","../src/ctrf/core/src/methods/utilities/sort-reports.ts","../src/ctrf/core/src/methods/run-insights.ts","../src/ctrf/previous-results.ts","../src/ctrf/slowest-tests.ts","../src/ctrf/average-test-duration.ts","../src/ctrf/core/src/methods/read-reports.ts","../node_modules/glob/node_modules/balanced-match/src/index.ts","../node_modules/glob/node_modules/brace-expansion/src/index.ts","../node_modules/glob/node_modules/minimatch/src/assert-valid-pattern.ts","../node_modules/glob/node_modules/minimatch/src/brace-expressions.ts","../node_modules/glob/node_modules/minimatch/src/unescape.ts","../node_modules/glob/node_modules/minimatch/src/ast.ts","../node_modules/glob/node_modules/minimatch/src/escape.ts","../node_modules/glob/node_modules/minimatch/src/index.ts","../node_modules/glob/src/glob.ts","../node_modules/glob/node_modules/lru-cache/src/index.ts","../node_modules/glob/node_modules/path-scurry/src/index.ts","../node_modules/glob/node_modules/minipass/src/index.ts","../node_modules/glob/src/pattern.ts","../node_modules/glob/src/ignore.ts","../node_modules/glob/src/processor.ts","../node_modules/glob/src/walker.ts","../node_modules/glob/src/has-magic.ts","../node_modules/glob/src/index.ts","../src/ctrf/adapter/normalize.ts","../src/ctrf/handle-baseline.ts","../src/ctrf/summary-insights.ts","../src/ctrf/metrics.ts","../src/utils/file-system.ts","../src/ctrf/core/src/constants.ts","../src/ctrf/core/src/methods/merge-reports.ts","../src/utils/report-utils.ts","../node_modules/junit-to-ctrf/dist/convert.js","../node_modules/junit-to-ctrf/dist/read.js","../node_modules/junit-to-ctrf/node_modules/balanced-match/src/index.ts","../node_modules/junit-to-ctrf/node_modules/brace-expansion/src/index.ts","../node_modules/junit-to-ctrf/node_modules/minimatch/src/assert-valid-pattern.ts","../node_modules/junit-to-ctrf/node_modules/minimatch/src/brace-expressions.ts","../node_modules/junit-to-ctrf/node_modules/minimatch/src/unescape.ts","../node_modules/junit-to-ctrf/node_modules/minimatch/src/ast.ts","../node_modules/junit-to-ctrf/node_modules/minimatch/src/escape.ts","../node_modules/junit-to-ctrf/node_modules/minimatch/src/index.ts","../node_modules/junit-to-ctrf/node_modules/glob/src/glob.ts","../node_modules/path-scurry/node_modules/lru-cache/src/index.ts","../node_modules/path-scurry/src/index.ts","../node_modules/minipass/src/index.ts","../node_modules/junit-to-ctrf/node_modules/glob/src/pattern.ts","../node_modules/junit-to-ctrf/node_modules/glob/src/ignore.ts","../node_modules/junit-to-ctrf/node_modules/glob/src/processor.ts","../node_modules/junit-to-ctrf/node_modules/glob/src/walker.ts","../node_modules/junit-to-ctrf/node_modules/glob/src/has-magic.ts","../node_modules/junit-to-ctrf/node_modules/glob/src/index.ts","../src/ctrf/report-conditionals.ts","../src/ctrf/prefix-test-names-with-suite.ts","../src/ctrf/group-test-results.ts","../src/ctrf/report-preparation.ts","../src/handlebars/core.ts","../src/handlebars/helpers/string.ts","../src/handlebars/helpers/ctrf.ts","../src/handlebars/helpers/ansi.ts","../src/handlebars/helpers/array.ts","../src/handlebars/helpers/math.ts","../src/handlebars/helpers/index.ts","../src/github/context.ts","../node_modules/handlebars-helpers-ctrf/dist/index.js","../node_modules/handlebars-helpers-ctrf/dist/helper-registry.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/array.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/collections.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/comparison.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/ctrf.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/date.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/fs.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/github.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/inflection.js","../node_modules/handlebars-helpers-ctrf/node_modules/balanced-match/src/index.ts","../node_modules/handlebars-helpers-ctrf/node_modules/brace-expansion/src/index.ts","../node_modules/handlebars-helpers-ctrf/node_modules/minimatch/src/assert-valid-pattern.ts","../node_modules/handlebars-helpers-ctrf/node_modules/minimatch/src/brace-expressions.ts","../node_modules/handlebars-helpers-ctrf/node_modules/minimatch/src/unescape.ts","../node_modules/handlebars-helpers-ctrf/node_modules/minimatch/src/ast.ts","../node_modules/handlebars-helpers-ctrf/node_modules/minimatch/src/escape.ts","../node_modules/handlebars-helpers-ctrf/node_modules/minimatch/src/index.ts","../node_modules/handlebars-helpers-ctrf/dist/helpers/match.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/math.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/misc.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/number.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/object.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/path.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/regex.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/string.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/timestamp.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/url.js","../src/reports/core.ts","../src/reports/constants.ts","../src/github/core.ts","../src/github/helpers.ts","../src/core/inputs.ts","../src/client/github/checks.ts","../src/github/handler.ts","../src/integrations/slack.ts","../src/integrations/teams.ts","../src/integrations/ai.ts","../src/integrations/handler.ts","../src/core/action-handler.ts","../src/index.ts"],"sourcesContent":["'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","module.exports = require('./lib/tunnel');\n","module.exports = {\n kClose: Symbol('close'),\n kDestroy: Symbol('destroy'),\n kDispatch: Symbol('dispatch'),\n kUrl: Symbol('url'),\n kWriting: Symbol('writing'),\n kResuming: Symbol('resuming'),\n kQueue: Symbol('queue'),\n kConnect: Symbol('connect'),\n kConnecting: Symbol('connecting'),\n kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),\n kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),\n kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),\n kKeepAliveTimeoutValue: Symbol('keep alive timeout'),\n kKeepAlive: Symbol('keep alive'),\n kHeadersTimeout: Symbol('headers timeout'),\n kBodyTimeout: Symbol('body timeout'),\n kServerName: Symbol('server name'),\n kLocalAddress: Symbol('local address'),\n kHost: Symbol('host'),\n kNoRef: Symbol('no ref'),\n kBodyUsed: Symbol('used'),\n kBody: Symbol('abstracted request body'),\n kRunning: Symbol('running'),\n kBlocking: Symbol('blocking'),\n kPending: Symbol('pending'),\n kSize: Symbol('size'),\n kBusy: Symbol('busy'),\n kQueued: Symbol('queued'),\n kFree: Symbol('free'),\n kConnected: Symbol('connected'),\n kClosed: Symbol('closed'),\n kNeedDrain: Symbol('need drain'),\n kReset: Symbol('reset'),\n kDestroyed: Symbol.for('nodejs.stream.destroyed'),\n kResume: Symbol('resume'),\n kOnError: Symbol('on error'),\n kMaxHeadersSize: Symbol('max headers size'),\n kRunningIdx: Symbol('running index'),\n kPendingIdx: Symbol('pending index'),\n kError: Symbol('error'),\n kClients: Symbol('clients'),\n kClient: Symbol('client'),\n kParser: Symbol('parser'),\n kOnDestroyed: Symbol('destroy callbacks'),\n kPipelining: Symbol('pipelining'),\n kSocket: Symbol('socket'),\n kHostHeader: Symbol('host header'),\n kConnector: Symbol('connector'),\n kStrictContentLength: Symbol('strict content length'),\n kMaxRedirections: Symbol('maxRedirections'),\n kMaxRequests: Symbol('maxRequestsPerClient'),\n kProxy: Symbol('proxy agent options'),\n kCounter: Symbol('socket request counter'),\n kInterceptors: Symbol('dispatch interceptors'),\n kMaxResponseSize: Symbol('max response size'),\n kHTTP2Session: Symbol('http2Session'),\n kHTTP2SessionState: Symbol('http2Session state'),\n kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),\n kConstruct: Symbol('constructable'),\n kListeners: Symbol('listeners'),\n kHTTPContext: Symbol('http context'),\n kMaxConcurrentStreams: Symbol('max concurrent streams'),\n kNoProxyAgent: Symbol('no proxy agent'),\n kHttpProxyAgent: Symbol('http proxy agent'),\n kHttpsProxyAgent: Symbol('https proxy agent')\n}\n","'use strict'\n\nconst kUndiciError = Symbol.for('undici.error.UND_ERR')\nclass UndiciError extends Error {\n constructor (message) {\n super(message)\n this.name = 'UndiciError'\n this.code = 'UND_ERR'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kUndiciError] === true\n }\n\n [kUndiciError] = true\n}\n\nconst kConnectTimeoutError = Symbol.for('undici.error.UND_ERR_CONNECT_TIMEOUT')\nclass ConnectTimeoutError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'ConnectTimeoutError'\n this.message = message || 'Connect Timeout Error'\n this.code = 'UND_ERR_CONNECT_TIMEOUT'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kConnectTimeoutError] === true\n }\n\n [kConnectTimeoutError] = true\n}\n\nconst kHeadersTimeoutError = Symbol.for('undici.error.UND_ERR_HEADERS_TIMEOUT')\nclass HeadersTimeoutError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'HeadersTimeoutError'\n this.message = message || 'Headers Timeout Error'\n this.code = 'UND_ERR_HEADERS_TIMEOUT'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kHeadersTimeoutError] === true\n }\n\n [kHeadersTimeoutError] = true\n}\n\nconst kHeadersOverflowError = Symbol.for('undici.error.UND_ERR_HEADERS_OVERFLOW')\nclass HeadersOverflowError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'HeadersOverflowError'\n this.message = message || 'Headers Overflow Error'\n this.code = 'UND_ERR_HEADERS_OVERFLOW'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kHeadersOverflowError] === true\n }\n\n [kHeadersOverflowError] = true\n}\n\nconst kBodyTimeoutError = Symbol.for('undici.error.UND_ERR_BODY_TIMEOUT')\nclass BodyTimeoutError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'BodyTimeoutError'\n this.message = message || 'Body Timeout Error'\n this.code = 'UND_ERR_BODY_TIMEOUT'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kBodyTimeoutError] === true\n }\n\n [kBodyTimeoutError] = true\n}\n\nconst kResponseStatusCodeError = Symbol.for('undici.error.UND_ERR_RESPONSE_STATUS_CODE')\nclass ResponseStatusCodeError extends UndiciError {\n constructor (message, statusCode, headers, body) {\n super(message)\n this.name = 'ResponseStatusCodeError'\n this.message = message || 'Response Status Code Error'\n this.code = 'UND_ERR_RESPONSE_STATUS_CODE'\n this.body = body\n this.status = statusCode\n this.statusCode = statusCode\n this.headers = headers\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kResponseStatusCodeError] === true\n }\n\n [kResponseStatusCodeError] = true\n}\n\nconst kInvalidArgumentError = Symbol.for('undici.error.UND_ERR_INVALID_ARG')\nclass InvalidArgumentError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'InvalidArgumentError'\n this.message = message || 'Invalid Argument Error'\n this.code = 'UND_ERR_INVALID_ARG'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kInvalidArgumentError] === true\n }\n\n [kInvalidArgumentError] = true\n}\n\nconst kInvalidReturnValueError = Symbol.for('undici.error.UND_ERR_INVALID_RETURN_VALUE')\nclass InvalidReturnValueError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'InvalidReturnValueError'\n this.message = message || 'Invalid Return Value Error'\n this.code = 'UND_ERR_INVALID_RETURN_VALUE'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kInvalidReturnValueError] === true\n }\n\n [kInvalidReturnValueError] = true\n}\n\nconst kAbortError = Symbol.for('undici.error.UND_ERR_ABORT')\nclass AbortError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'AbortError'\n this.message = message || 'The operation was aborted'\n this.code = 'UND_ERR_ABORT'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kAbortError] === true\n }\n\n [kAbortError] = true\n}\n\nconst kRequestAbortedError = Symbol.for('undici.error.UND_ERR_ABORTED')\nclass RequestAbortedError extends AbortError {\n constructor (message) {\n super(message)\n this.name = 'AbortError'\n this.message = message || 'Request aborted'\n this.code = 'UND_ERR_ABORTED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kRequestAbortedError] === true\n }\n\n [kRequestAbortedError] = true\n}\n\nconst kInformationalError = Symbol.for('undici.error.UND_ERR_INFO')\nclass InformationalError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'InformationalError'\n this.message = message || 'Request information'\n this.code = 'UND_ERR_INFO'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kInformationalError] === true\n }\n\n [kInformationalError] = true\n}\n\nconst kRequestContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH')\nclass RequestContentLengthMismatchError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'RequestContentLengthMismatchError'\n this.message = message || 'Request body length does not match content-length header'\n this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kRequestContentLengthMismatchError] === true\n }\n\n [kRequestContentLengthMismatchError] = true\n}\n\nconst kResponseContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH')\nclass ResponseContentLengthMismatchError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'ResponseContentLengthMismatchError'\n this.message = message || 'Response body length does not match content-length header'\n this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kResponseContentLengthMismatchError] === true\n }\n\n [kResponseContentLengthMismatchError] = true\n}\n\nconst kClientDestroyedError = Symbol.for('undici.error.UND_ERR_DESTROYED')\nclass ClientDestroyedError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'ClientDestroyedError'\n this.message = message || 'The client is destroyed'\n this.code = 'UND_ERR_DESTROYED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kClientDestroyedError] === true\n }\n\n [kClientDestroyedError] = true\n}\n\nconst kClientClosedError = Symbol.for('undici.error.UND_ERR_CLOSED')\nclass ClientClosedError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'ClientClosedError'\n this.message = message || 'The client is closed'\n this.code = 'UND_ERR_CLOSED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kClientClosedError] === true\n }\n\n [kClientClosedError] = true\n}\n\nconst kSocketError = Symbol.for('undici.error.UND_ERR_SOCKET')\nclass SocketError extends UndiciError {\n constructor (message, socket) {\n super(message)\n this.name = 'SocketError'\n this.message = message || 'Socket error'\n this.code = 'UND_ERR_SOCKET'\n this.socket = socket\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kSocketError] === true\n }\n\n [kSocketError] = true\n}\n\nconst kNotSupportedError = Symbol.for('undici.error.UND_ERR_NOT_SUPPORTED')\nclass NotSupportedError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'NotSupportedError'\n this.message = message || 'Not supported error'\n this.code = 'UND_ERR_NOT_SUPPORTED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kNotSupportedError] === true\n }\n\n [kNotSupportedError] = true\n}\n\nconst kBalancedPoolMissingUpstreamError = Symbol.for('undici.error.UND_ERR_BPL_MISSING_UPSTREAM')\nclass BalancedPoolMissingUpstreamError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'MissingUpstreamError'\n this.message = message || 'No upstream has been added to the BalancedPool'\n this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kBalancedPoolMissingUpstreamError] === true\n }\n\n [kBalancedPoolMissingUpstreamError] = true\n}\n\nconst kHTTPParserError = Symbol.for('undici.error.UND_ERR_HTTP_PARSER')\nclass HTTPParserError extends Error {\n constructor (message, code, data) {\n super(message)\n this.name = 'HTTPParserError'\n this.code = code ? `HPE_${code}` : undefined\n this.data = data ? data.toString() : undefined\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kHTTPParserError] === true\n }\n\n [kHTTPParserError] = true\n}\n\nconst kResponseExceededMaxSizeError = Symbol.for('undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE')\nclass ResponseExceededMaxSizeError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'ResponseExceededMaxSizeError'\n this.message = message || 'Response content exceeded max size'\n this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kResponseExceededMaxSizeError] === true\n }\n\n [kResponseExceededMaxSizeError] = true\n}\n\nconst kRequestRetryError = Symbol.for('undici.error.UND_ERR_REQ_RETRY')\nclass RequestRetryError extends UndiciError {\n constructor (message, code, { headers, data }) {\n super(message)\n this.name = 'RequestRetryError'\n this.message = message || 'Request retry error'\n this.code = 'UND_ERR_REQ_RETRY'\n this.statusCode = code\n this.data = data\n this.headers = headers\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kRequestRetryError] === true\n }\n\n [kRequestRetryError] = true\n}\n\nconst kResponseError = Symbol.for('undici.error.UND_ERR_RESPONSE')\nclass ResponseError extends UndiciError {\n constructor (message, code, { headers, data }) {\n super(message)\n this.name = 'ResponseError'\n this.message = message || 'Response error'\n this.code = 'UND_ERR_RESPONSE'\n this.statusCode = code\n this.data = data\n this.headers = headers\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kResponseError] === true\n }\n\n [kResponseError] = true\n}\n\nconst kSecureProxyConnectionError = Symbol.for('undici.error.UND_ERR_PRX_TLS')\nclass SecureProxyConnectionError extends UndiciError {\n constructor (cause, message, options) {\n super(message, { cause, ...(options ?? {}) })\n this.name = 'SecureProxyConnectionError'\n this.message = message || 'Secure Proxy Connection failed'\n this.code = 'UND_ERR_PRX_TLS'\n this.cause = cause\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kSecureProxyConnectionError] === true\n }\n\n [kSecureProxyConnectionError] = true\n}\n\nconst kMessageSizeExceededError = Symbol.for('undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED')\nclass MessageSizeExceededError extends UndiciError {\n constructor (message) {\n super(message)\n this.name = 'MessageSizeExceededError'\n this.message = message || 'Max decompressed message size exceeded'\n this.code = 'UND_ERR_WS_MESSAGE_SIZE_EXCEEDED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kMessageSizeExceededError] === true\n }\n\n get [kMessageSizeExceededError] () {\n return true\n }\n}\n\nmodule.exports = {\n AbortError,\n HTTPParserError,\n UndiciError,\n HeadersTimeoutError,\n HeadersOverflowError,\n BodyTimeoutError,\n RequestContentLengthMismatchError,\n ConnectTimeoutError,\n ResponseStatusCodeError,\n InvalidArgumentError,\n InvalidReturnValueError,\n RequestAbortedError,\n ClientDestroyedError,\n ClientClosedError,\n InformationalError,\n SocketError,\n NotSupportedError,\n ResponseContentLengthMismatchError,\n BalancedPoolMissingUpstreamError,\n ResponseExceededMaxSizeError,\n RequestRetryError,\n ResponseError,\n SecureProxyConnectionError,\n MessageSizeExceededError\n}\n","'use strict'\n\n/** @type {Record} */\nconst headerNameLowerCasedRecord = {}\n\n// https://developer.mozilla.org/docs/Web/HTTP/Headers\nconst wellknownHeaderNames = [\n 'Accept',\n 'Accept-Encoding',\n 'Accept-Language',\n 'Accept-Ranges',\n 'Access-Control-Allow-Credentials',\n 'Access-Control-Allow-Headers',\n 'Access-Control-Allow-Methods',\n 'Access-Control-Allow-Origin',\n 'Access-Control-Expose-Headers',\n 'Access-Control-Max-Age',\n 'Access-Control-Request-Headers',\n 'Access-Control-Request-Method',\n 'Age',\n 'Allow',\n 'Alt-Svc',\n 'Alt-Used',\n 'Authorization',\n 'Cache-Control',\n 'Clear-Site-Data',\n 'Connection',\n 'Content-Disposition',\n 'Content-Encoding',\n 'Content-Language',\n 'Content-Length',\n 'Content-Location',\n 'Content-Range',\n 'Content-Security-Policy',\n 'Content-Security-Policy-Report-Only',\n 'Content-Type',\n 'Cookie',\n 'Cross-Origin-Embedder-Policy',\n 'Cross-Origin-Opener-Policy',\n 'Cross-Origin-Resource-Policy',\n 'Date',\n 'Device-Memory',\n 'Downlink',\n 'ECT',\n 'ETag',\n 'Expect',\n 'Expect-CT',\n 'Expires',\n 'Forwarded',\n 'From',\n 'Host',\n 'If-Match',\n 'If-Modified-Since',\n 'If-None-Match',\n 'If-Range',\n 'If-Unmodified-Since',\n 'Keep-Alive',\n 'Last-Modified',\n 'Link',\n 'Location',\n 'Max-Forwards',\n 'Origin',\n 'Permissions-Policy',\n 'Pragma',\n 'Proxy-Authenticate',\n 'Proxy-Authorization',\n 'RTT',\n 'Range',\n 'Referer',\n 'Referrer-Policy',\n 'Refresh',\n 'Retry-After',\n 'Sec-WebSocket-Accept',\n 'Sec-WebSocket-Extensions',\n 'Sec-WebSocket-Key',\n 'Sec-WebSocket-Protocol',\n 'Sec-WebSocket-Version',\n 'Server',\n 'Server-Timing',\n 'Service-Worker-Allowed',\n 'Service-Worker-Navigation-Preload',\n 'Set-Cookie',\n 'SourceMap',\n 'Strict-Transport-Security',\n 'Supports-Loading-Mode',\n 'TE',\n 'Timing-Allow-Origin',\n 'Trailer',\n 'Transfer-Encoding',\n 'Upgrade',\n 'Upgrade-Insecure-Requests',\n 'User-Agent',\n 'Vary',\n 'Via',\n 'WWW-Authenticate',\n 'X-Content-Type-Options',\n 'X-DNS-Prefetch-Control',\n 'X-Frame-Options',\n 'X-Permitted-Cross-Domain-Policies',\n 'X-Powered-By',\n 'X-Requested-With',\n 'X-XSS-Protection'\n]\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n const key = wellknownHeaderNames[i]\n const lowerCasedKey = key.toLowerCase()\n headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =\n lowerCasedKey\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(headerNameLowerCasedRecord, null)\n\nmodule.exports = {\n wellknownHeaderNames,\n headerNameLowerCasedRecord\n}\n","'use strict'\n\nconst {\n wellknownHeaderNames,\n headerNameLowerCasedRecord\n} = require('./constants')\n\nclass TstNode {\n /** @type {any} */\n value = null\n /** @type {null | TstNode} */\n left = null\n /** @type {null | TstNode} */\n middle = null\n /** @type {null | TstNode} */\n right = null\n /** @type {number} */\n code\n /**\n * @param {string} key\n * @param {any} value\n * @param {number} index\n */\n constructor (key, value, index) {\n if (index === undefined || index >= key.length) {\n throw new TypeError('Unreachable')\n }\n const code = this.code = key.charCodeAt(index)\n // check code is ascii string\n if (code > 0x7F) {\n throw new TypeError('key must be ascii string')\n }\n if (key.length !== ++index) {\n this.middle = new TstNode(key, value, index)\n } else {\n this.value = value\n }\n }\n\n /**\n * @param {string} key\n * @param {any} value\n */\n add (key, value) {\n const length = key.length\n if (length === 0) {\n throw new TypeError('Unreachable')\n }\n let index = 0\n let node = this\n while (true) {\n const code = key.charCodeAt(index)\n // check code is ascii string\n if (code > 0x7F) {\n throw new TypeError('key must be ascii string')\n }\n if (node.code === code) {\n if (length === ++index) {\n node.value = value\n break\n } else if (node.middle !== null) {\n node = node.middle\n } else {\n node.middle = new TstNode(key, value, index)\n break\n }\n } else if (node.code < code) {\n if (node.left !== null) {\n node = node.left\n } else {\n node.left = new TstNode(key, value, index)\n break\n }\n } else if (node.right !== null) {\n node = node.right\n } else {\n node.right = new TstNode(key, value, index)\n break\n }\n }\n }\n\n /**\n * @param {Uint8Array} key\n * @return {TstNode | null}\n */\n search (key) {\n const keylength = key.length\n let index = 0\n let node = this\n while (node !== null && index < keylength) {\n let code = key[index]\n // A-Z\n // First check if it is bigger than 0x5a.\n // Lowercase letters have higher char codes than uppercase ones.\n // Also we assume that headers will mostly contain lowercase characters.\n if (code <= 0x5a && code >= 0x41) {\n // Lowercase for uppercase.\n code |= 32\n }\n while (node !== null) {\n if (code === node.code) {\n if (keylength === ++index) {\n // Returns Node since it is the last key.\n return node\n }\n node = node.middle\n break\n }\n node = node.code < code ? node.left : node.right\n }\n }\n return null\n }\n}\n\nclass TernarySearchTree {\n /** @type {TstNode | null} */\n node = null\n\n /**\n * @param {string} key\n * @param {any} value\n * */\n insert (key, value) {\n if (this.node === null) {\n this.node = new TstNode(key, value, 0)\n } else {\n this.node.add(key, value)\n }\n }\n\n /**\n * @param {Uint8Array} key\n * @return {any}\n */\n lookup (key) {\n return this.node?.search(key)?.value ?? null\n }\n}\n\nconst tree = new TernarySearchTree()\n\nfor (let i = 0; i < wellknownHeaderNames.length; ++i) {\n const key = headerNameLowerCasedRecord[wellknownHeaderNames[i]]\n tree.insert(key, key)\n}\n\nmodule.exports = {\n TernarySearchTree,\n tree\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { kDestroyed, kBodyUsed, kListeners, kBody } = require('./symbols')\nconst { IncomingMessage } = require('node:http')\nconst stream = require('node:stream')\nconst net = require('node:net')\nconst { Blob } = require('node:buffer')\nconst nodeUtil = require('node:util')\nconst { stringify } = require('node:querystring')\nconst { EventEmitter: EE } = require('node:events')\nconst { InvalidArgumentError } = require('./errors')\nconst { headerNameLowerCasedRecord } = require('./constants')\nconst { tree } = require('./tree')\n\nconst [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))\n\nclass BodyAsyncIterable {\n constructor (body) {\n this[kBody] = body\n this[kBodyUsed] = false\n }\n\n async * [Symbol.asyncIterator] () {\n assert(!this[kBodyUsed], 'disturbed')\n this[kBodyUsed] = true\n yield * this[kBody]\n }\n}\n\nfunction wrapRequestBody (body) {\n if (isStream(body)) {\n // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n // so that it can be dispatched again?\n // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n if (bodyLength(body) === 0) {\n body\n .on('data', function () {\n assert(false)\n })\n }\n\n if (typeof body.readableDidRead !== 'boolean') {\n body[kBodyUsed] = false\n EE.prototype.on.call(body, 'data', function () {\n this[kBodyUsed] = true\n })\n }\n\n return body\n } else if (body && typeof body.pipeTo === 'function') {\n // TODO (fix): We can't access ReadableStream internal state\n // to determine whether or not it has been disturbed. This is just\n // a workaround.\n return new BodyAsyncIterable(body)\n } else if (\n body &&\n typeof body !== 'string' &&\n !ArrayBuffer.isView(body) &&\n isIterable(body)\n ) {\n // TODO: Should we allow re-using iterable if !this.opts.idempotent\n // or through some other flag?\n return new BodyAsyncIterable(body)\n } else {\n return body\n }\n}\n\nfunction nop () {}\n\nfunction isStream (obj) {\n return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'\n}\n\n// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)\nfunction isBlobLike (object) {\n if (object === null) {\n return false\n } else if (object instanceof Blob) {\n return true\n } else if (typeof object !== 'object') {\n return false\n } else {\n const sTag = object[Symbol.toStringTag]\n\n return (sTag === 'Blob' || sTag === 'File') && (\n ('stream' in object && typeof object.stream === 'function') ||\n ('arrayBuffer' in object && typeof object.arrayBuffer === 'function')\n )\n }\n}\n\nfunction buildURL (url, queryParams) {\n if (url.includes('?') || url.includes('#')) {\n throw new Error('Query params cannot be passed when url already contains \"?\" or \"#\".')\n }\n\n const stringified = stringify(queryParams)\n\n if (stringified) {\n url += '?' + stringified\n }\n\n return url\n}\n\nfunction isValidPort (port) {\n const value = parseInt(port, 10)\n return (\n value === Number(port) &&\n value >= 0 &&\n value <= 65535\n )\n}\n\nfunction isHttpOrHttpsPrefixed (value) {\n return (\n value != null &&\n value[0] === 'h' &&\n value[1] === 't' &&\n value[2] === 't' &&\n value[3] === 'p' &&\n (\n value[4] === ':' ||\n (\n value[4] === 's' &&\n value[5] === ':'\n )\n )\n )\n}\n\nfunction parseURL (url) {\n if (typeof url === 'string') {\n url = new URL(url)\n\n if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n }\n\n return url\n }\n\n if (!url || typeof url !== 'object') {\n throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')\n }\n\n if (!(url instanceof URL)) {\n if (url.port != null && url.port !== '' && isValidPort(url.port) === false) {\n throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')\n }\n\n if (url.path != null && typeof url.path !== 'string') {\n throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')\n }\n\n if (url.pathname != null && typeof url.pathname !== 'string') {\n throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')\n }\n\n if (url.hostname != null && typeof url.hostname !== 'string') {\n throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')\n }\n\n if (url.origin != null && typeof url.origin !== 'string') {\n throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')\n }\n\n if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n }\n\n const port = url.port != null\n ? url.port\n : (url.protocol === 'https:' ? 443 : 80)\n let origin = url.origin != null\n ? url.origin\n : `${url.protocol || ''}//${url.hostname || ''}:${port}`\n let path = url.path != null\n ? url.path\n : `${url.pathname || ''}${url.search || ''}`\n\n if (origin[origin.length - 1] === '/') {\n origin = origin.slice(0, origin.length - 1)\n }\n\n if (path && path[0] !== '/') {\n path = `/${path}`\n }\n // new URL(path, origin) is unsafe when `path` contains an absolute URL\n // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:\n // If first parameter is a relative URL, second param is required, and will be used as the base URL.\n // If first parameter is an absolute URL, a given second param will be ignored.\n return new URL(`${origin}${path}`)\n }\n\n if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {\n throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n }\n\n return url\n}\n\nfunction parseOrigin (url) {\n url = parseURL(url)\n\n if (url.pathname !== '/' || url.search || url.hash) {\n throw new InvalidArgumentError('invalid url')\n }\n\n return url\n}\n\nfunction getHostname (host) {\n if (host[0] === '[') {\n const idx = host.indexOf(']')\n\n assert(idx !== -1)\n return host.substring(1, idx)\n }\n\n const idx = host.indexOf(':')\n if (idx === -1) return host\n\n return host.substring(0, idx)\n}\n\n// IP addresses are not valid server names per RFC6066\n// > Currently, the only server names supported are DNS hostnames\nfunction getServerName (host) {\n if (!host) {\n return null\n }\n\n assert(typeof host === 'string')\n\n const servername = getHostname(host)\n if (net.isIP(servername)) {\n return ''\n }\n\n return servername\n}\n\nfunction deepClone (obj) {\n return JSON.parse(JSON.stringify(obj))\n}\n\nfunction isAsyncIterable (obj) {\n return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')\n}\n\nfunction isIterable (obj) {\n return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))\n}\n\nfunction bodyLength (body) {\n if (body == null) {\n return 0\n } else if (isStream(body)) {\n const state = body._readableState\n return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)\n ? state.length\n : null\n } else if (isBlobLike(body)) {\n return body.size != null ? body.size : null\n } else if (isBuffer(body)) {\n return body.byteLength\n }\n\n return null\n}\n\nfunction isDestroyed (body) {\n return body && !!(body.destroyed || body[kDestroyed] || (stream.isDestroyed?.(body)))\n}\n\nfunction destroy (stream, err) {\n if (stream == null || !isStream(stream) || isDestroyed(stream)) {\n return\n }\n\n if (typeof stream.destroy === 'function') {\n if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {\n // See: https://github.com/nodejs/node/pull/38505/files\n stream.socket = null\n }\n\n stream.destroy(err)\n } else if (err) {\n queueMicrotask(() => {\n stream.emit('error', err)\n })\n }\n\n if (stream.destroyed !== true) {\n stream[kDestroyed] = true\n }\n}\n\nconst KEEPALIVE_TIMEOUT_EXPR = /timeout=(\\d+)/\nfunction parseKeepAliveTimeout (val) {\n const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)\n return m ? parseInt(m[1], 10) * 1000 : null\n}\n\n/**\n * Retrieves a header name and returns its lowercase value.\n * @param {string | Buffer} value Header name\n * @returns {string}\n */\nfunction headerNameToString (value) {\n return typeof value === 'string'\n ? headerNameLowerCasedRecord[value] ?? value.toLowerCase()\n : tree.lookup(value) ?? value.toString('latin1').toLowerCase()\n}\n\n/**\n * Receive the buffer as a string and return its lowercase value.\n * @param {Buffer} value Header name\n * @returns {string}\n */\nfunction bufferToLowerCasedHeaderName (value) {\n return tree.lookup(value) ?? value.toString('latin1').toLowerCase()\n}\n\n/**\n * @param {Record | (Buffer | string | (Buffer | string)[])[]} headers\n * @param {Record} [obj]\n * @returns {Record}\n */\nfunction parseHeaders (headers, obj) {\n if (obj === undefined) obj = {}\n for (let i = 0; i < headers.length; i += 2) {\n const key = headerNameToString(headers[i])\n let val = obj[key]\n\n if (val) {\n if (typeof val === 'string') {\n val = [val]\n obj[key] = val\n }\n val.push(headers[i + 1].toString('utf8'))\n } else {\n const headersValue = headers[i + 1]\n if (typeof headersValue === 'string') {\n obj[key] = headersValue\n } else {\n obj[key] = Array.isArray(headersValue) ? headersValue.map(x => x.toString('utf8')) : headersValue.toString('utf8')\n }\n }\n }\n\n // See https://github.com/nodejs/node/pull/46528\n if ('content-length' in obj && 'content-disposition' in obj) {\n obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')\n }\n\n return obj\n}\n\nfunction parseRawHeaders (headers) {\n const len = headers.length\n const ret = new Array(len)\n\n let hasContentLength = false\n let contentDispositionIdx = -1\n let key\n let val\n let kLen = 0\n\n for (let n = 0; n < headers.length; n += 2) {\n key = headers[n]\n val = headers[n + 1]\n\n typeof key !== 'string' && (key = key.toString())\n typeof val !== 'string' && (val = val.toString('utf8'))\n\n kLen = key.length\n if (kLen === 14 && key[7] === '-' && (key === 'content-length' || key.toLowerCase() === 'content-length')) {\n hasContentLength = true\n } else if (kLen === 19 && key[7] === '-' && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {\n contentDispositionIdx = n + 1\n }\n ret[n] = key\n ret[n + 1] = val\n }\n\n // See https://github.com/nodejs/node/pull/46528\n if (hasContentLength && contentDispositionIdx !== -1) {\n ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')\n }\n\n return ret\n}\n\nfunction isBuffer (buffer) {\n // See, https://github.com/mcollina/undici/pull/319\n return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)\n}\n\nfunction validateHandler (handler, method, upgrade) {\n if (!handler || typeof handler !== 'object') {\n throw new InvalidArgumentError('handler must be an object')\n }\n\n if (typeof handler.onConnect !== 'function') {\n throw new InvalidArgumentError('invalid onConnect method')\n }\n\n if (typeof handler.onError !== 'function') {\n throw new InvalidArgumentError('invalid onError method')\n }\n\n if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {\n throw new InvalidArgumentError('invalid onBodySent method')\n }\n\n if (upgrade || method === 'CONNECT') {\n if (typeof handler.onUpgrade !== 'function') {\n throw new InvalidArgumentError('invalid onUpgrade method')\n }\n } else {\n if (typeof handler.onHeaders !== 'function') {\n throw new InvalidArgumentError('invalid onHeaders method')\n }\n\n if (typeof handler.onData !== 'function') {\n throw new InvalidArgumentError('invalid onData method')\n }\n\n if (typeof handler.onComplete !== 'function') {\n throw new InvalidArgumentError('invalid onComplete method')\n }\n }\n}\n\n// A body is disturbed if it has been read from and it cannot\n// be re-used without losing state or data.\nfunction isDisturbed (body) {\n // TODO (fix): Why is body[kBodyUsed] needed?\n return !!(body && (stream.isDisturbed(body) || body[kBodyUsed]))\n}\n\nfunction isErrored (body) {\n return !!(body && stream.isErrored(body))\n}\n\nfunction isReadable (body) {\n return !!(body && stream.isReadable(body))\n}\n\nfunction getSocketInfo (socket) {\n return {\n localAddress: socket.localAddress,\n localPort: socket.localPort,\n remoteAddress: socket.remoteAddress,\n remotePort: socket.remotePort,\n remoteFamily: socket.remoteFamily,\n timeout: socket.timeout,\n bytesWritten: socket.bytesWritten,\n bytesRead: socket.bytesRead\n }\n}\n\n/** @type {globalThis['ReadableStream']} */\nfunction ReadableStreamFrom (iterable) {\n // We cannot use ReadableStream.from here because it does not return a byte stream.\n\n let iterator\n return new ReadableStream(\n {\n async start () {\n iterator = iterable[Symbol.asyncIterator]()\n },\n async pull (controller) {\n const { done, value } = await iterator.next()\n if (done) {\n queueMicrotask(() => {\n controller.close()\n controller.byobRequest?.respond(0)\n })\n } else {\n const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)\n if (buf.byteLength) {\n controller.enqueue(new Uint8Array(buf))\n }\n }\n return controller.desiredSize > 0\n },\n async cancel (reason) {\n await iterator.return()\n },\n type: 'bytes'\n }\n )\n}\n\n// The chunk should be a FormData instance and contains\n// all the required methods.\nfunction isFormDataLike (object) {\n return (\n object &&\n typeof object === 'object' &&\n typeof object.append === 'function' &&\n typeof object.delete === 'function' &&\n typeof object.get === 'function' &&\n typeof object.getAll === 'function' &&\n typeof object.has === 'function' &&\n typeof object.set === 'function' &&\n object[Symbol.toStringTag] === 'FormData'\n )\n}\n\nfunction addAbortListener (signal, listener) {\n if ('addEventListener' in signal) {\n signal.addEventListener('abort', listener, { once: true })\n return () => signal.removeEventListener('abort', listener)\n }\n signal.addListener('abort', listener)\n return () => signal.removeListener('abort', listener)\n}\n\nconst hasToWellFormed = typeof String.prototype.toWellFormed === 'function'\nconst hasIsWellFormed = typeof String.prototype.isWellFormed === 'function'\n\n/**\n * @param {string} val\n */\nfunction toUSVString (val) {\n return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val)\n}\n\n/**\n * @param {string} val\n */\n// TODO: move this to webidl\nfunction isUSVString (val) {\n return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}`\n}\n\n/**\n * @see https://tools.ietf.org/html/rfc7230#section-3.2.6\n * @param {number} c\n */\nfunction isTokenCharCode (c) {\n switch (c) {\n case 0x22:\n case 0x28:\n case 0x29:\n case 0x2c:\n case 0x2f:\n case 0x3a:\n case 0x3b:\n case 0x3c:\n case 0x3d:\n case 0x3e:\n case 0x3f:\n case 0x40:\n case 0x5b:\n case 0x5c:\n case 0x5d:\n case 0x7b:\n case 0x7d:\n // DQUOTE and \"(),/:;<=>?@[\\]{}\"\n return false\n default:\n // VCHAR %x21-7E\n return c >= 0x21 && c <= 0x7e\n }\n}\n\n/**\n * @param {string} characters\n */\nfunction isValidHTTPToken (characters) {\n if (characters.length === 0) {\n return false\n }\n for (let i = 0; i < characters.length; ++i) {\n if (!isTokenCharCode(characters.charCodeAt(i))) {\n return false\n }\n }\n return true\n}\n\n// headerCharRegex have been lifted from\n// https://github.com/nodejs/node/blob/main/lib/_http_common.js\n\n/**\n * Matches if val contains an invalid field-vchar\n * field-value = *( field-content / obs-fold )\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n */\nconst headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/\n\n/**\n * @param {string} characters\n */\nfunction isValidHeaderValue (characters) {\n return !headerCharRegex.test(characters)\n}\n\n// Parsed accordingly to RFC 9110\n// https://www.rfc-editor.org/rfc/rfc9110#field.content-range\nfunction parseRangeHeader (range) {\n if (range == null || range === '') return { start: 0, end: null, size: null }\n\n const m = range ? range.match(/^bytes (\\d+)-(\\d+)\\/(\\d+)?$/) : null\n return m\n ? {\n start: parseInt(m[1]),\n end: m[2] ? parseInt(m[2]) : null,\n size: m[3] ? parseInt(m[3]) : null\n }\n : null\n}\n\nfunction addListener (obj, name, listener) {\n const listeners = (obj[kListeners] ??= [])\n listeners.push([name, listener])\n obj.on(name, listener)\n return obj\n}\n\nfunction removeAllListeners (obj) {\n for (const [name, listener] of obj[kListeners] ?? []) {\n obj.removeListener(name, listener)\n }\n obj[kListeners] = null\n}\n\nfunction errorRequest (client, request, err) {\n try {\n request.onError(err)\n assert(request.aborted)\n } catch (err) {\n client.emit('error', err)\n }\n}\n\nconst kEnumerableProperty = Object.create(null)\nkEnumerableProperty.enumerable = true\n\nconst normalizedMethodRecordsBase = {\n delete: 'DELETE',\n DELETE: 'DELETE',\n get: 'GET',\n GET: 'GET',\n head: 'HEAD',\n HEAD: 'HEAD',\n options: 'OPTIONS',\n OPTIONS: 'OPTIONS',\n post: 'POST',\n POST: 'POST',\n put: 'PUT',\n PUT: 'PUT'\n}\n\nconst normalizedMethodRecords = {\n ...normalizedMethodRecordsBase,\n patch: 'patch',\n PATCH: 'PATCH'\n}\n\n// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.\nObject.setPrototypeOf(normalizedMethodRecordsBase, null)\nObject.setPrototypeOf(normalizedMethodRecords, null)\n\nmodule.exports = {\n kEnumerableProperty,\n nop,\n isDisturbed,\n isErrored,\n isReadable,\n toUSVString,\n isUSVString,\n isBlobLike,\n parseOrigin,\n parseURL,\n getServerName,\n isStream,\n isIterable,\n isAsyncIterable,\n isDestroyed,\n headerNameToString,\n bufferToLowerCasedHeaderName,\n addListener,\n removeAllListeners,\n errorRequest,\n parseRawHeaders,\n parseHeaders,\n parseKeepAliveTimeout,\n destroy,\n bodyLength,\n deepClone,\n ReadableStreamFrom,\n isBuffer,\n validateHandler,\n getSocketInfo,\n isFormDataLike,\n buildURL,\n addAbortListener,\n isValidHTTPToken,\n isValidHeaderValue,\n isTokenCharCode,\n parseRangeHeader,\n normalizedMethodRecordsBase,\n normalizedMethodRecords,\n isValidPort,\n isHttpOrHttpsPrefixed,\n nodeMajor,\n nodeMinor,\n safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'],\n wrapRequestBody\n}\n","'use strict'\nconst diagnosticsChannel = require('node:diagnostics_channel')\nconst util = require('node:util')\n\nconst undiciDebugLog = util.debuglog('undici')\nconst fetchDebuglog = util.debuglog('fetch')\nconst websocketDebuglog = util.debuglog('websocket')\nlet isClientSet = false\nconst channels = {\n // Client\n beforeConnect: diagnosticsChannel.channel('undici:client:beforeConnect'),\n connected: diagnosticsChannel.channel('undici:client:connected'),\n connectError: diagnosticsChannel.channel('undici:client:connectError'),\n sendHeaders: diagnosticsChannel.channel('undici:client:sendHeaders'),\n // Request\n create: diagnosticsChannel.channel('undici:request:create'),\n bodySent: diagnosticsChannel.channel('undici:request:bodySent'),\n headers: diagnosticsChannel.channel('undici:request:headers'),\n trailers: diagnosticsChannel.channel('undici:request:trailers'),\n error: diagnosticsChannel.channel('undici:request:error'),\n // WebSocket\n open: diagnosticsChannel.channel('undici:websocket:open'),\n close: diagnosticsChannel.channel('undici:websocket:close'),\n socketError: diagnosticsChannel.channel('undici:websocket:socket_error'),\n ping: diagnosticsChannel.channel('undici:websocket:ping'),\n pong: diagnosticsChannel.channel('undici:websocket:pong')\n}\n\nif (undiciDebugLog.enabled || fetchDebuglog.enabled) {\n const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog\n\n // Track all Client events\n diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {\n const {\n connectParams: { version, protocol, port, host }\n } = evt\n debuglog(\n 'connecting to %s using %s%s',\n `${host}${port ? `:${port}` : ''}`,\n protocol,\n version\n )\n })\n\n diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {\n const {\n connectParams: { version, protocol, port, host }\n } = evt\n debuglog(\n 'connected to %s using %s%s',\n `${host}${port ? `:${port}` : ''}`,\n protocol,\n version\n )\n })\n\n diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {\n const {\n connectParams: { version, protocol, port, host },\n error\n } = evt\n debuglog(\n 'connection to %s using %s%s errored - %s',\n `${host}${port ? `:${port}` : ''}`,\n protocol,\n version,\n error.message\n )\n })\n\n diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {\n const {\n request: { method, path, origin }\n } = evt\n debuglog('sending request to %s %s/%s', method, origin, path)\n })\n\n // Track Request events\n diagnosticsChannel.channel('undici:request:headers').subscribe(evt => {\n const {\n request: { method, path, origin },\n response: { statusCode }\n } = evt\n debuglog(\n 'received response to %s %s/%s - HTTP %d',\n method,\n origin,\n path,\n statusCode\n )\n })\n\n diagnosticsChannel.channel('undici:request:trailers').subscribe(evt => {\n const {\n request: { method, path, origin }\n } = evt\n debuglog('trailers received from %s %s/%s', method, origin, path)\n })\n\n diagnosticsChannel.channel('undici:request:error').subscribe(evt => {\n const {\n request: { method, path, origin },\n error\n } = evt\n debuglog(\n 'request to %s %s/%s errored - %s',\n method,\n origin,\n path,\n error.message\n )\n })\n\n isClientSet = true\n}\n\nif (websocketDebuglog.enabled) {\n if (!isClientSet) {\n const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog\n diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {\n const {\n connectParams: { version, protocol, port, host }\n } = evt\n debuglog(\n 'connecting to %s%s using %s%s',\n host,\n port ? `:${port}` : '',\n protocol,\n version\n )\n })\n\n diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {\n const {\n connectParams: { version, protocol, port, host }\n } = evt\n debuglog(\n 'connected to %s%s using %s%s',\n host,\n port ? `:${port}` : '',\n protocol,\n version\n )\n })\n\n diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {\n const {\n connectParams: { version, protocol, port, host },\n error\n } = evt\n debuglog(\n 'connection to %s%s using %s%s errored - %s',\n host,\n port ? `:${port}` : '',\n protocol,\n version,\n error.message\n )\n })\n\n diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {\n const {\n request: { method, path, origin }\n } = evt\n debuglog('sending request to %s %s/%s', method, origin, path)\n })\n }\n\n // Track all WebSocket events\n diagnosticsChannel.channel('undici:websocket:open').subscribe(evt => {\n const {\n address: { address, port }\n } = evt\n websocketDebuglog('connection opened %s%s', address, port ? `:${port}` : '')\n })\n\n diagnosticsChannel.channel('undici:websocket:close').subscribe(evt => {\n const { websocket, code, reason } = evt\n websocketDebuglog(\n 'closed connection to %s - %s %s',\n websocket.url,\n code,\n reason\n )\n })\n\n diagnosticsChannel.channel('undici:websocket:socket_error').subscribe(err => {\n websocketDebuglog('connection errored - %s', err.message)\n })\n\n diagnosticsChannel.channel('undici:websocket:ping').subscribe(evt => {\n websocketDebuglog('ping received')\n })\n\n diagnosticsChannel.channel('undici:websocket:pong').subscribe(evt => {\n websocketDebuglog('pong received')\n })\n}\n\nmodule.exports = {\n channels\n}\n","'use strict'\n\nconst {\n InvalidArgumentError,\n NotSupportedError\n} = require('./errors')\nconst assert = require('node:assert')\nconst {\n isValidHTTPToken,\n isValidHeaderValue,\n isStream,\n destroy,\n isBuffer,\n isFormDataLike,\n isIterable,\n isBlobLike,\n buildURL,\n validateHandler,\n getServerName,\n normalizedMethodRecords\n} = require('./util')\nconst { channels } = require('./diagnostics.js')\nconst { headerNameLowerCasedRecord } = require('./constants')\n\n// Verifies that a given path is valid does not contain control chars \\x00 to \\x20\nconst invalidPathRegex = /[^\\u0021-\\u00ff]/\n\nconst kHandler = Symbol('handler')\n\nclass Request {\n constructor (origin, {\n path,\n method,\n body,\n headers,\n query,\n idempotent,\n blocking,\n upgrade,\n headersTimeout,\n bodyTimeout,\n reset,\n throwOnError,\n expectContinue,\n servername\n }, handler) {\n if (typeof path !== 'string') {\n throw new InvalidArgumentError('path must be a string')\n } else if (\n path[0] !== '/' &&\n !(path.startsWith('http://') || path.startsWith('https://')) &&\n method !== 'CONNECT'\n ) {\n throw new InvalidArgumentError('path must be an absolute URL or start with a slash')\n } else if (invalidPathRegex.test(path)) {\n throw new InvalidArgumentError('invalid request path')\n }\n\n if (typeof method !== 'string') {\n throw new InvalidArgumentError('method must be a string')\n } else if (normalizedMethodRecords[method] === undefined && !isValidHTTPToken(method)) {\n throw new InvalidArgumentError('invalid request method')\n }\n\n if (upgrade && typeof upgrade !== 'string') {\n throw new InvalidArgumentError('upgrade must be a string')\n }\n\n if (upgrade && !isValidHeaderValue(upgrade)) {\n throw new InvalidArgumentError('invalid upgrade header')\n }\n\n if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {\n throw new InvalidArgumentError('invalid headersTimeout')\n }\n\n if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {\n throw new InvalidArgumentError('invalid bodyTimeout')\n }\n\n if (reset != null && typeof reset !== 'boolean') {\n throw new InvalidArgumentError('invalid reset')\n }\n\n if (expectContinue != null && typeof expectContinue !== 'boolean') {\n throw new InvalidArgumentError('invalid expectContinue')\n }\n\n this.headersTimeout = headersTimeout\n\n this.bodyTimeout = bodyTimeout\n\n this.throwOnError = throwOnError === true\n\n this.method = method\n\n this.abort = null\n\n if (body == null) {\n this.body = null\n } else if (isStream(body)) {\n this.body = body\n\n const rState = this.body._readableState\n if (!rState || !rState.autoDestroy) {\n this.endHandler = function autoDestroy () {\n destroy(this)\n }\n this.body.on('end', this.endHandler)\n }\n\n this.errorHandler = err => {\n if (this.abort) {\n this.abort(err)\n } else {\n this.error = err\n }\n }\n this.body.on('error', this.errorHandler)\n } else if (isBuffer(body)) {\n this.body = body.byteLength ? body : null\n } else if (ArrayBuffer.isView(body)) {\n this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null\n } else if (body instanceof ArrayBuffer) {\n this.body = body.byteLength ? Buffer.from(body) : null\n } else if (typeof body === 'string') {\n this.body = body.length ? Buffer.from(body) : null\n } else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) {\n this.body = body\n } else {\n throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')\n }\n\n this.completed = false\n\n this.aborted = false\n\n this.upgrade = upgrade || null\n\n this.path = query ? buildURL(path, query) : path\n\n this.origin = origin\n\n this.idempotent = idempotent == null\n ? method === 'HEAD' || method === 'GET'\n : idempotent\n\n this.blocking = blocking == null ? false : blocking\n\n this.reset = reset == null ? null : reset\n\n this.host = null\n\n this.contentLength = null\n\n this.contentType = null\n\n this.headers = []\n\n // Only for H2\n this.expectContinue = expectContinue != null ? expectContinue : false\n\n if (Array.isArray(headers)) {\n if (headers.length % 2 !== 0) {\n throw new InvalidArgumentError('headers array must be even')\n }\n for (let i = 0; i < headers.length; i += 2) {\n processHeader(this, headers[i], headers[i + 1])\n }\n } else if (headers && typeof headers === 'object') {\n if (headers[Symbol.iterator]) {\n for (const header of headers) {\n if (!Array.isArray(header) || header.length !== 2) {\n throw new InvalidArgumentError('headers must be in key-value pair format')\n }\n processHeader(this, header[0], header[1])\n }\n } else {\n const keys = Object.keys(headers)\n for (let i = 0; i < keys.length; ++i) {\n processHeader(this, keys[i], headers[keys[i]])\n }\n }\n } else if (headers != null) {\n throw new InvalidArgumentError('headers must be an object or an array')\n }\n\n validateHandler(handler, method, upgrade)\n\n this.servername = servername || getServerName(this.host)\n\n this[kHandler] = handler\n\n if (channels.create.hasSubscribers) {\n channels.create.publish({ request: this })\n }\n }\n\n onBodySent (chunk) {\n if (this[kHandler].onBodySent) {\n try {\n return this[kHandler].onBodySent(chunk)\n } catch (err) {\n this.abort(err)\n }\n }\n }\n\n onRequestSent () {\n if (channels.bodySent.hasSubscribers) {\n channels.bodySent.publish({ request: this })\n }\n\n if (this[kHandler].onRequestSent) {\n try {\n return this[kHandler].onRequestSent()\n } catch (err) {\n this.abort(err)\n }\n }\n }\n\n onConnect (abort) {\n assert(!this.aborted)\n assert(!this.completed)\n\n if (this.error) {\n abort(this.error)\n } else {\n this.abort = abort\n return this[kHandler].onConnect(abort)\n }\n }\n\n onResponseStarted () {\n return this[kHandler].onResponseStarted?.()\n }\n\n onHeaders (statusCode, headers, resume, statusText) {\n assert(!this.aborted)\n assert(!this.completed)\n\n if (channels.headers.hasSubscribers) {\n channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })\n }\n\n try {\n return this[kHandler].onHeaders(statusCode, headers, resume, statusText)\n } catch (err) {\n this.abort(err)\n }\n }\n\n onData (chunk) {\n assert(!this.aborted)\n assert(!this.completed)\n\n try {\n return this[kHandler].onData(chunk)\n } catch (err) {\n this.abort(err)\n return false\n }\n }\n\n onUpgrade (statusCode, headers, socket) {\n assert(!this.aborted)\n assert(!this.completed)\n\n return this[kHandler].onUpgrade(statusCode, headers, socket)\n }\n\n onComplete (trailers) {\n this.onFinally()\n\n assert(!this.aborted)\n\n this.completed = true\n if (channels.trailers.hasSubscribers) {\n channels.trailers.publish({ request: this, trailers })\n }\n\n try {\n return this[kHandler].onComplete(trailers)\n } catch (err) {\n // TODO (fix): This might be a bad idea?\n this.onError(err)\n }\n }\n\n onError (error) {\n this.onFinally()\n\n if (channels.error.hasSubscribers) {\n channels.error.publish({ request: this, error })\n }\n\n if (this.aborted) {\n return\n }\n this.aborted = true\n\n return this[kHandler].onError(error)\n }\n\n onFinally () {\n if (this.errorHandler) {\n this.body.off('error', this.errorHandler)\n this.errorHandler = null\n }\n\n if (this.endHandler) {\n this.body.off('end', this.endHandler)\n this.endHandler = null\n }\n }\n\n addHeader (key, value) {\n processHeader(this, key, value)\n return this\n }\n}\n\nfunction processHeader (request, key, val) {\n if (val && (typeof val === 'object' && !Array.isArray(val))) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n } else if (val === undefined) {\n return\n }\n\n let headerName = headerNameLowerCasedRecord[key]\n\n if (headerName === undefined) {\n headerName = key.toLowerCase()\n if (headerNameLowerCasedRecord[headerName] === undefined && !isValidHTTPToken(headerName)) {\n throw new InvalidArgumentError('invalid header key')\n }\n }\n\n if (Array.isArray(val)) {\n const arr = []\n for (let i = 0; i < val.length; i++) {\n if (typeof val[i] === 'string') {\n if (!isValidHeaderValue(val[i])) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n }\n arr.push(val[i])\n } else if (val[i] === null) {\n arr.push('')\n } else if (typeof val[i] === 'object') {\n throw new InvalidArgumentError(`invalid ${key} header`)\n } else {\n arr.push(`${val[i]}`)\n }\n }\n val = arr\n } else if (typeof val === 'string') {\n if (!isValidHeaderValue(val)) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n }\n } else if (val === null) {\n val = ''\n } else {\n val = `${val}`\n }\n\n if (headerName === 'host') {\n if (request.host !== null) {\n throw new InvalidArgumentError('duplicate host header')\n }\n if (typeof val !== 'string') {\n throw new InvalidArgumentError('invalid host header')\n }\n // Consumed by Client\n request.host = val\n } else if (headerName === 'content-length') {\n if (request.contentLength !== null) {\n throw new InvalidArgumentError('duplicate content-length header')\n }\n request.contentLength = parseInt(val, 10)\n if (!Number.isFinite(request.contentLength)) {\n throw new InvalidArgumentError('invalid content-length header')\n }\n } else if (request.contentType === null && headerName === 'content-type') {\n request.contentType = val\n request.headers.push(key, val)\n } else if (headerName === 'transfer-encoding' || headerName === 'keep-alive' || headerName === 'upgrade') {\n throw new InvalidArgumentError(`invalid ${headerName} header`)\n } else if (headerName === 'connection') {\n const value = typeof val === 'string' ? val.toLowerCase() : null\n if (value !== 'close' && value !== 'keep-alive') {\n throw new InvalidArgumentError('invalid connection header')\n }\n\n if (value === 'close') {\n request.reset = true\n }\n } else if (headerName === 'expect') {\n throw new NotSupportedError('expect header not supported')\n } else {\n request.headers.push(key, val)\n }\n}\n\nmodule.exports = Request\n","'use strict'\nconst EventEmitter = require('node:events')\n\nclass Dispatcher extends EventEmitter {\n dispatch () {\n throw new Error('not implemented')\n }\n\n close () {\n throw new Error('not implemented')\n }\n\n destroy () {\n throw new Error('not implemented')\n }\n\n compose (...args) {\n // So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ...\n const interceptors = Array.isArray(args[0]) ? args[0] : args\n let dispatch = this.dispatch.bind(this)\n\n for (const interceptor of interceptors) {\n if (interceptor == null) {\n continue\n }\n\n if (typeof interceptor !== 'function') {\n throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`)\n }\n\n dispatch = interceptor(dispatch)\n\n if (dispatch == null || typeof dispatch !== 'function' || dispatch.length !== 2) {\n throw new TypeError('invalid interceptor')\n }\n }\n\n return new ComposedDispatcher(this, dispatch)\n }\n}\n\nclass ComposedDispatcher extends Dispatcher {\n #dispatcher = null\n #dispatch = null\n\n constructor (dispatcher, dispatch) {\n super()\n this.#dispatcher = dispatcher\n this.#dispatch = dispatch\n }\n\n dispatch (...args) {\n this.#dispatch(...args)\n }\n\n close (...args) {\n return this.#dispatcher.close(...args)\n }\n\n destroy (...args) {\n return this.#dispatcher.destroy(...args)\n }\n}\n\nmodule.exports = Dispatcher\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst {\n ClientDestroyedError,\n ClientClosedError,\n InvalidArgumentError\n} = require('../core/errors')\nconst { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = require('../core/symbols')\n\nconst kOnDestroyed = Symbol('onDestroyed')\nconst kOnClosed = Symbol('onClosed')\nconst kInterceptedDispatch = Symbol('Intercepted Dispatch')\nconst kWebSocketOptions = Symbol('webSocketOptions')\n\nclass DispatcherBase extends Dispatcher {\n constructor (opts) {\n super()\n\n this[kDestroyed] = false\n this[kOnDestroyed] = null\n this[kClosed] = false\n this[kOnClosed] = []\n this[kWebSocketOptions] = opts?.webSocket ?? {}\n }\n\n get webSocketOptions () {\n return {\n maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024\n }\n }\n\n get destroyed () {\n return this[kDestroyed]\n }\n\n get closed () {\n return this[kClosed]\n }\n\n get interceptors () {\n return this[kInterceptors]\n }\n\n set interceptors (newInterceptors) {\n if (newInterceptors) {\n for (let i = newInterceptors.length - 1; i >= 0; i--) {\n const interceptor = this[kInterceptors][i]\n if (typeof interceptor !== 'function') {\n throw new InvalidArgumentError('interceptor must be an function')\n }\n }\n }\n\n this[kInterceptors] = newInterceptors\n }\n\n close (callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n this.close((err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (this[kDestroyed]) {\n queueMicrotask(() => callback(new ClientDestroyedError(), null))\n return\n }\n\n if (this[kClosed]) {\n if (this[kOnClosed]) {\n this[kOnClosed].push(callback)\n } else {\n queueMicrotask(() => callback(null, null))\n }\n return\n }\n\n this[kClosed] = true\n this[kOnClosed].push(callback)\n\n const onClosed = () => {\n const callbacks = this[kOnClosed]\n this[kOnClosed] = null\n for (let i = 0; i < callbacks.length; i++) {\n callbacks[i](null, null)\n }\n }\n\n // Should not error.\n this[kClose]()\n .then(() => this.destroy())\n .then(() => {\n queueMicrotask(onClosed)\n })\n }\n\n destroy (err, callback) {\n if (typeof err === 'function') {\n callback = err\n err = null\n }\n\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n this.destroy(err, (err, data) => {\n return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)\n })\n })\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (this[kDestroyed]) {\n if (this[kOnDestroyed]) {\n this[kOnDestroyed].push(callback)\n } else {\n queueMicrotask(() => callback(null, null))\n }\n return\n }\n\n if (!err) {\n err = new ClientDestroyedError()\n }\n\n this[kDestroyed] = true\n this[kOnDestroyed] = this[kOnDestroyed] || []\n this[kOnDestroyed].push(callback)\n\n const onDestroyed = () => {\n const callbacks = this[kOnDestroyed]\n this[kOnDestroyed] = null\n for (let i = 0; i < callbacks.length; i++) {\n callbacks[i](null, null)\n }\n }\n\n // Should not error.\n this[kDestroy](err).then(() => {\n queueMicrotask(onDestroyed)\n })\n }\n\n [kInterceptedDispatch] (opts, handler) {\n if (!this[kInterceptors] || this[kInterceptors].length === 0) {\n this[kInterceptedDispatch] = this[kDispatch]\n return this[kDispatch](opts, handler)\n }\n\n let dispatch = this[kDispatch].bind(this)\n for (let i = this[kInterceptors].length - 1; i >= 0; i--) {\n dispatch = this[kInterceptors][i](dispatch)\n }\n this[kInterceptedDispatch] = dispatch\n return dispatch(opts, handler)\n }\n\n dispatch (opts, handler) {\n if (!handler || typeof handler !== 'object') {\n throw new InvalidArgumentError('handler must be an object')\n }\n\n try {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('opts must be an object.')\n }\n\n if (this[kDestroyed] || this[kOnDestroyed]) {\n throw new ClientDestroyedError()\n }\n\n if (this[kClosed]) {\n throw new ClientClosedError()\n }\n\n return this[kInterceptedDispatch](opts, handler)\n } catch (err) {\n if (typeof handler.onError !== 'function') {\n throw new InvalidArgumentError('invalid onError method')\n }\n\n handler.onError(err)\n\n return false\n }\n }\n}\n\nmodule.exports = DispatcherBase\n","'use strict'\n\n/**\n * This module offers an optimized timer implementation designed for scenarios\n * where high precision is not critical.\n *\n * The timer achieves faster performance by using a low-resolution approach,\n * with an accuracy target of within 500ms. This makes it particularly useful\n * for timers with delays of 1 second or more, where exact timing is less\n * crucial.\n *\n * It's important to note that Node.js timers are inherently imprecise, as\n * delays can occur due to the event loop being blocked by other operations.\n * Consequently, timers may trigger later than their scheduled time.\n */\n\n/**\n * The fastNow variable contains the internal fast timer clock value.\n *\n * @type {number}\n */\nlet fastNow = 0\n\n/**\n * RESOLUTION_MS represents the target resolution time in milliseconds.\n *\n * @type {number}\n * @default 1000\n */\nconst RESOLUTION_MS = 1e3\n\n/**\n * TICK_MS defines the desired interval in milliseconds between each tick.\n * The target value is set to half the resolution time, minus 1 ms, to account\n * for potential event loop overhead.\n *\n * @type {number}\n * @default 499\n */\nconst TICK_MS = (RESOLUTION_MS >> 1) - 1\n\n/**\n * fastNowTimeout is a Node.js timer used to manage and process\n * the FastTimers stored in the `fastTimers` array.\n *\n * @type {NodeJS.Timeout}\n */\nlet fastNowTimeout\n\n/**\n * The kFastTimer symbol is used to identify FastTimer instances.\n *\n * @type {Symbol}\n */\nconst kFastTimer = Symbol('kFastTimer')\n\n/**\n * The fastTimers array contains all active FastTimers.\n *\n * @type {FastTimer[]}\n */\nconst fastTimers = []\n\n/**\n * These constants represent the various states of a FastTimer.\n */\n\n/**\n * The `NOT_IN_LIST` constant indicates that the FastTimer is not included\n * in the `fastTimers` array. Timers with this status will not be processed\n * during the next tick by the `onTick` function.\n *\n * A FastTimer can be re-added to the `fastTimers` array by invoking the\n * `refresh` method on the FastTimer instance.\n *\n * @type {-2}\n */\nconst NOT_IN_LIST = -2\n\n/**\n * The `TO_BE_CLEARED` constant indicates that the FastTimer is scheduled\n * for removal from the `fastTimers` array. A FastTimer in this state will\n * be removed in the next tick by the `onTick` function and will no longer\n * be processed.\n *\n * This status is also set when the `clear` method is called on the FastTimer instance.\n *\n * @type {-1}\n */\nconst TO_BE_CLEARED = -1\n\n/**\n * The `PENDING` constant signifies that the FastTimer is awaiting processing\n * in the next tick by the `onTick` function. Timers with this status will have\n * their `_idleStart` value set and their status updated to `ACTIVE` in the next tick.\n *\n * @type {0}\n */\nconst PENDING = 0\n\n/**\n * The `ACTIVE` constant indicates that the FastTimer is active and waiting\n * for its timer to expire. During the next tick, the `onTick` function will\n * check if the timer has expired, and if so, it will execute the associated callback.\n *\n * @type {1}\n */\nconst ACTIVE = 1\n\n/**\n * The onTick function processes the fastTimers array.\n *\n * @returns {void}\n */\nfunction onTick () {\n /**\n * Increment the fastNow value by the TICK_MS value, despite the actual time\n * that has passed since the last tick. This approach ensures independence\n * from the system clock and delays caused by a blocked event loop.\n *\n * @type {number}\n */\n fastNow += TICK_MS\n\n /**\n * The `idx` variable is used to iterate over the `fastTimers` array.\n * Expired timers are removed by replacing them with the last element in the array.\n * Consequently, `idx` is only incremented when the current element is not removed.\n *\n * @type {number}\n */\n let idx = 0\n\n /**\n * The len variable will contain the length of the fastTimers array\n * and will be decremented when a FastTimer should be removed from the\n * fastTimers array.\n *\n * @type {number}\n */\n let len = fastTimers.length\n\n while (idx < len) {\n /**\n * @type {FastTimer}\n */\n const timer = fastTimers[idx]\n\n // If the timer is in the ACTIVE state and the timer has expired, it will\n // be processed in the next tick.\n if (timer._state === PENDING) {\n // Set the _idleStart value to the fastNow value minus the TICK_MS value\n // to account for the time the timer was in the PENDING state.\n timer._idleStart = fastNow - TICK_MS\n timer._state = ACTIVE\n } else if (\n timer._state === ACTIVE &&\n fastNow >= timer._idleStart + timer._idleTimeout\n ) {\n timer._state = TO_BE_CLEARED\n timer._idleStart = -1\n timer._onTimeout(timer._timerArg)\n }\n\n if (timer._state === TO_BE_CLEARED) {\n timer._state = NOT_IN_LIST\n\n // Move the last element to the current index and decrement len if it is\n // not the only element in the array.\n if (--len !== 0) {\n fastTimers[idx] = fastTimers[len]\n }\n } else {\n ++idx\n }\n }\n\n // Set the length of the fastTimers array to the new length and thus\n // removing the excess FastTimers elements from the array.\n fastTimers.length = len\n\n // If there are still active FastTimers in the array, refresh the Timer.\n // If there are no active FastTimers, the timer will be refreshed again\n // when a new FastTimer is instantiated.\n if (fastTimers.length !== 0) {\n refreshTimeout()\n }\n}\n\nfunction refreshTimeout () {\n // If the fastNowTimeout is already set, refresh it.\n if (fastNowTimeout) {\n fastNowTimeout.refresh()\n // fastNowTimeout is not instantiated yet, create a new Timer.\n } else {\n clearTimeout(fastNowTimeout)\n fastNowTimeout = setTimeout(onTick, TICK_MS)\n\n // If the Timer has an unref method, call it to allow the process to exit if\n // there are no other active handles.\n if (fastNowTimeout.unref) {\n fastNowTimeout.unref()\n }\n }\n}\n\n/**\n * The `FastTimer` class is a data structure designed to store and manage\n * timer information.\n */\nclass FastTimer {\n [kFastTimer] = true\n\n /**\n * The state of the timer, which can be one of the following:\n * - NOT_IN_LIST (-2)\n * - TO_BE_CLEARED (-1)\n * - PENDING (0)\n * - ACTIVE (1)\n *\n * @type {-2|-1|0|1}\n * @private\n */\n _state = NOT_IN_LIST\n\n /**\n * The number of milliseconds to wait before calling the callback.\n *\n * @type {number}\n * @private\n */\n _idleTimeout = -1\n\n /**\n * The time in milliseconds when the timer was started. This value is used to\n * calculate when the timer should expire.\n *\n * @type {number}\n * @default -1\n * @private\n */\n _idleStart = -1\n\n /**\n * The function to be executed when the timer expires.\n * @type {Function}\n * @private\n */\n _onTimeout\n\n /**\n * The argument to be passed to the callback when the timer expires.\n *\n * @type {*}\n * @private\n */\n _timerArg\n\n /**\n * @constructor\n * @param {Function} callback A function to be executed after the timer\n * expires.\n * @param {number} delay The time, in milliseconds that the timer should wait\n * before the specified function or code is executed.\n * @param {*} arg\n */\n constructor (callback, delay, arg) {\n this._onTimeout = callback\n this._idleTimeout = delay\n this._timerArg = arg\n\n this.refresh()\n }\n\n /**\n * Sets the timer's start time to the current time, and reschedules the timer\n * to call its callback at the previously specified duration adjusted to the\n * current time.\n * Using this on a timer that has already called its callback will reactivate\n * the timer.\n *\n * @returns {void}\n */\n refresh () {\n // In the special case that the timer is not in the list of active timers,\n // add it back to the array to be processed in the next tick by the onTick\n // function.\n if (this._state === NOT_IN_LIST) {\n fastTimers.push(this)\n }\n\n // If the timer is the only active timer, refresh the fastNowTimeout for\n // better resolution.\n if (!fastNowTimeout || fastTimers.length === 1) {\n refreshTimeout()\n }\n\n // Setting the state to PENDING will cause the timer to be reset in the\n // next tick by the onTick function.\n this._state = PENDING\n }\n\n /**\n * The `clear` method cancels the timer, preventing it from executing.\n *\n * @returns {void}\n * @private\n */\n clear () {\n // Set the state to TO_BE_CLEARED to mark the timer for removal in the next\n // tick by the onTick function.\n this._state = TO_BE_CLEARED\n\n // Reset the _idleStart value to -1 to indicate that the timer is no longer\n // active.\n this._idleStart = -1\n }\n}\n\n/**\n * This module exports a setTimeout and clearTimeout function that can be\n * used as a drop-in replacement for the native functions.\n */\nmodule.exports = {\n /**\n * The setTimeout() method sets a timer which executes a function once the\n * timer expires.\n * @param {Function} callback A function to be executed after the timer\n * expires.\n * @param {number} delay The time, in milliseconds that the timer should\n * wait before the specified function or code is executed.\n * @param {*} [arg] An optional argument to be passed to the callback function\n * when the timer expires.\n * @returns {NodeJS.Timeout|FastTimer}\n */\n setTimeout (callback, delay, arg) {\n // If the delay is less than or equal to the RESOLUTION_MS value return a\n // native Node.js Timer instance.\n return delay <= RESOLUTION_MS\n ? setTimeout(callback, delay, arg)\n : new FastTimer(callback, delay, arg)\n },\n /**\n * The clearTimeout method cancels an instantiated Timer previously created\n * by calling setTimeout.\n *\n * @param {NodeJS.Timeout|FastTimer} timeout\n */\n clearTimeout (timeout) {\n // If the timeout is a FastTimer, call its own clear method.\n if (timeout[kFastTimer]) {\n /**\n * @type {FastTimer}\n */\n timeout.clear()\n // Otherwise it is an instance of a native NodeJS.Timeout, so call the\n // Node.js native clearTimeout function.\n } else {\n clearTimeout(timeout)\n }\n },\n /**\n * The setFastTimeout() method sets a fastTimer which executes a function once\n * the timer expires.\n * @param {Function} callback A function to be executed after the timer\n * expires.\n * @param {number} delay The time, in milliseconds that the timer should\n * wait before the specified function or code is executed.\n * @param {*} [arg] An optional argument to be passed to the callback function\n * when the timer expires.\n * @returns {FastTimer}\n */\n setFastTimeout (callback, delay, arg) {\n return new FastTimer(callback, delay, arg)\n },\n /**\n * The clearTimeout method cancels an instantiated FastTimer previously\n * created by calling setFastTimeout.\n *\n * @param {FastTimer} timeout\n */\n clearFastTimeout (timeout) {\n timeout.clear()\n },\n /**\n * The now method returns the value of the internal fast timer clock.\n *\n * @returns {number}\n */\n now () {\n return fastNow\n },\n /**\n * Trigger the onTick function to process the fastTimers array.\n * Exported for testing purposes only.\n * Marking as deprecated to discourage any use outside of testing.\n * @deprecated\n * @param {number} [delay=0] The delay in milliseconds to add to the now value.\n */\n tick (delay = 0) {\n fastNow += delay - RESOLUTION_MS + 1\n onTick()\n onTick()\n },\n /**\n * Reset FastTimers.\n * Exported for testing purposes only.\n * Marking as deprecated to discourage any use outside of testing.\n * @deprecated\n */\n reset () {\n fastNow = 0\n fastTimers.length = 0\n clearTimeout(fastNowTimeout)\n fastNowTimeout = null\n },\n /**\n * Exporting for testing purposes only.\n * Marking as deprecated to discourage any use outside of testing.\n * @deprecated\n */\n kFastTimer\n}\n","'use strict'\n\nconst net = require('node:net')\nconst assert = require('node:assert')\nconst util = require('./util')\nconst { InvalidArgumentError, ConnectTimeoutError } = require('./errors')\nconst timers = require('../util/timers')\n\nfunction noop () {}\n\nlet tls // include tls conditionally since it is not always available\n\n// TODO: session re-use does not wait for the first\n// connection to resolve the session and might therefore\n// resolve the same servername multiple times even when\n// re-use is enabled.\n\nlet SessionCache\n// FIXME: remove workaround when the Node bug is fixed\n// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\nif (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) {\n SessionCache = class WeakSessionCache {\n constructor (maxCachedSessions) {\n this._maxCachedSessions = maxCachedSessions\n this._sessionCache = new Map()\n this._sessionRegistry = new global.FinalizationRegistry((key) => {\n if (this._sessionCache.size < this._maxCachedSessions) {\n return\n }\n\n const ref = this._sessionCache.get(key)\n if (ref !== undefined && ref.deref() === undefined) {\n this._sessionCache.delete(key)\n }\n })\n }\n\n get (sessionKey) {\n const ref = this._sessionCache.get(sessionKey)\n return ref ? ref.deref() : null\n }\n\n set (sessionKey, session) {\n if (this._maxCachedSessions === 0) {\n return\n }\n\n this._sessionCache.set(sessionKey, new WeakRef(session))\n this._sessionRegistry.register(session, sessionKey)\n }\n }\n} else {\n SessionCache = class SimpleSessionCache {\n constructor (maxCachedSessions) {\n this._maxCachedSessions = maxCachedSessions\n this._sessionCache = new Map()\n }\n\n get (sessionKey) {\n return this._sessionCache.get(sessionKey)\n }\n\n set (sessionKey, session) {\n if (this._maxCachedSessions === 0) {\n return\n }\n\n if (this._sessionCache.size >= this._maxCachedSessions) {\n // remove the oldest session\n const { value: oldestKey } = this._sessionCache.keys().next()\n this._sessionCache.delete(oldestKey)\n }\n\n this._sessionCache.set(sessionKey, session)\n }\n }\n}\n\nfunction buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {\n if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {\n throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')\n }\n\n const options = { path: socketPath, ...opts }\n const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)\n timeout = timeout == null ? 10e3 : timeout\n allowH2 = allowH2 != null ? allowH2 : false\n return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {\n let socket\n if (protocol === 'https:') {\n if (!tls) {\n tls = require('node:tls')\n }\n servername = servername || options.servername || util.getServerName(host) || null\n\n const sessionKey = servername || hostname\n assert(sessionKey)\n\n const session = customSession || sessionCache.get(sessionKey) || null\n\n port = port || 443\n\n socket = tls.connect({\n highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...\n ...options,\n servername,\n session,\n localAddress,\n // TODO(HTTP/2): Add support for h2c\n ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],\n socket: httpSocket, // upgrade socket connection\n port,\n host: hostname\n })\n\n socket\n .on('session', function (session) {\n // TODO (fix): Can a session become invalid once established? Don't think so?\n sessionCache.set(sessionKey, session)\n })\n } else {\n assert(!httpSocket, 'httpSocket can only be sent on TLS update')\n\n port = port || 80\n\n socket = net.connect({\n highWaterMark: 64 * 1024, // Same as nodejs fs streams.\n ...options,\n localAddress,\n port,\n host: hostname\n })\n }\n\n // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket\n if (options.keepAlive == null || options.keepAlive) {\n const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay\n socket.setKeepAlive(true, keepAliveInitialDelay)\n }\n\n const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port })\n\n socket\n .setNoDelay(true)\n .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {\n queueMicrotask(clearConnectTimeout)\n\n if (callback) {\n const cb = callback\n callback = null\n cb(null, this)\n }\n })\n .on('error', function (err) {\n queueMicrotask(clearConnectTimeout)\n\n if (callback) {\n const cb = callback\n callback = null\n cb(err)\n }\n })\n\n return socket\n }\n}\n\n/**\n * @param {WeakRef} socketWeakRef\n * @param {object} opts\n * @param {number} opts.timeout\n * @param {string} opts.hostname\n * @param {number} opts.port\n * @returns {() => void}\n */\nconst setupConnectTimeout = process.platform === 'win32'\n ? (socketWeakRef, opts) => {\n if (!opts.timeout) {\n return noop\n }\n\n let s1 = null\n let s2 = null\n const fastTimer = timers.setFastTimeout(() => {\n // setImmediate is added to make sure that we prioritize socket error events over timeouts\n s1 = setImmediate(() => {\n // Windows needs an extra setImmediate probably due to implementation differences in the socket logic\n s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts))\n })\n }, opts.timeout)\n return () => {\n timers.clearFastTimeout(fastTimer)\n clearImmediate(s1)\n clearImmediate(s2)\n }\n }\n : (socketWeakRef, opts) => {\n if (!opts.timeout) {\n return noop\n }\n\n let s1 = null\n const fastTimer = timers.setFastTimeout(() => {\n // setImmediate is added to make sure that we prioritize socket error events over timeouts\n s1 = setImmediate(() => {\n onConnectTimeout(socketWeakRef.deref(), opts)\n })\n }, opts.timeout)\n return () => {\n timers.clearFastTimeout(fastTimer)\n clearImmediate(s1)\n }\n }\n\n/**\n * @param {net.Socket} socket\n * @param {object} opts\n * @param {number} opts.timeout\n * @param {string} opts.hostname\n * @param {number} opts.port\n */\nfunction onConnectTimeout (socket, opts) {\n // The socket could be already garbage collected\n if (socket == null) {\n return\n }\n\n let message = 'Connect Timeout Error'\n if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {\n message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},`\n } else {\n message += ` (attempted address: ${opts.hostname}:${opts.port},`\n }\n\n message += ` timeout: ${opts.timeout}ms)`\n\n util.destroy(socket, new ConnectTimeoutError(message))\n}\n\nmodule.exports = buildConnector\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enumToMap = void 0;\nfunction enumToMap(obj) {\n const res = {};\n Object.keys(obj).forEach((key) => {\n const value = obj[key];\n if (typeof value === 'number') {\n res[key] = value;\n }\n });\n return res;\n}\nexports.enumToMap = enumToMap;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;\nconst utils_1 = require(\"./utils\");\n// C headers\nvar ERROR;\n(function (ERROR) {\n ERROR[ERROR[\"OK\"] = 0] = \"OK\";\n ERROR[ERROR[\"INTERNAL\"] = 1] = \"INTERNAL\";\n ERROR[ERROR[\"STRICT\"] = 2] = \"STRICT\";\n ERROR[ERROR[\"LF_EXPECTED\"] = 3] = \"LF_EXPECTED\";\n ERROR[ERROR[\"UNEXPECTED_CONTENT_LENGTH\"] = 4] = \"UNEXPECTED_CONTENT_LENGTH\";\n ERROR[ERROR[\"CLOSED_CONNECTION\"] = 5] = \"CLOSED_CONNECTION\";\n ERROR[ERROR[\"INVALID_METHOD\"] = 6] = \"INVALID_METHOD\";\n ERROR[ERROR[\"INVALID_URL\"] = 7] = \"INVALID_URL\";\n ERROR[ERROR[\"INVALID_CONSTANT\"] = 8] = \"INVALID_CONSTANT\";\n ERROR[ERROR[\"INVALID_VERSION\"] = 9] = \"INVALID_VERSION\";\n ERROR[ERROR[\"INVALID_HEADER_TOKEN\"] = 10] = \"INVALID_HEADER_TOKEN\";\n ERROR[ERROR[\"INVALID_CONTENT_LENGTH\"] = 11] = \"INVALID_CONTENT_LENGTH\";\n ERROR[ERROR[\"INVALID_CHUNK_SIZE\"] = 12] = \"INVALID_CHUNK_SIZE\";\n ERROR[ERROR[\"INVALID_STATUS\"] = 13] = \"INVALID_STATUS\";\n ERROR[ERROR[\"INVALID_EOF_STATE\"] = 14] = \"INVALID_EOF_STATE\";\n ERROR[ERROR[\"INVALID_TRANSFER_ENCODING\"] = 15] = \"INVALID_TRANSFER_ENCODING\";\n ERROR[ERROR[\"CB_MESSAGE_BEGIN\"] = 16] = \"CB_MESSAGE_BEGIN\";\n ERROR[ERROR[\"CB_HEADERS_COMPLETE\"] = 17] = \"CB_HEADERS_COMPLETE\";\n ERROR[ERROR[\"CB_MESSAGE_COMPLETE\"] = 18] = \"CB_MESSAGE_COMPLETE\";\n ERROR[ERROR[\"CB_CHUNK_HEADER\"] = 19] = \"CB_CHUNK_HEADER\";\n ERROR[ERROR[\"CB_CHUNK_COMPLETE\"] = 20] = \"CB_CHUNK_COMPLETE\";\n ERROR[ERROR[\"PAUSED\"] = 21] = \"PAUSED\";\n ERROR[ERROR[\"PAUSED_UPGRADE\"] = 22] = \"PAUSED_UPGRADE\";\n ERROR[ERROR[\"PAUSED_H2_UPGRADE\"] = 23] = \"PAUSED_H2_UPGRADE\";\n ERROR[ERROR[\"USER\"] = 24] = \"USER\";\n})(ERROR = exports.ERROR || (exports.ERROR = {}));\nvar TYPE;\n(function (TYPE) {\n TYPE[TYPE[\"BOTH\"] = 0] = \"BOTH\";\n TYPE[TYPE[\"REQUEST\"] = 1] = \"REQUEST\";\n TYPE[TYPE[\"RESPONSE\"] = 2] = \"RESPONSE\";\n})(TYPE = exports.TYPE || (exports.TYPE = {}));\nvar FLAGS;\n(function (FLAGS) {\n FLAGS[FLAGS[\"CONNECTION_KEEP_ALIVE\"] = 1] = \"CONNECTION_KEEP_ALIVE\";\n FLAGS[FLAGS[\"CONNECTION_CLOSE\"] = 2] = \"CONNECTION_CLOSE\";\n FLAGS[FLAGS[\"CONNECTION_UPGRADE\"] = 4] = \"CONNECTION_UPGRADE\";\n FLAGS[FLAGS[\"CHUNKED\"] = 8] = \"CHUNKED\";\n FLAGS[FLAGS[\"UPGRADE\"] = 16] = \"UPGRADE\";\n FLAGS[FLAGS[\"CONTENT_LENGTH\"] = 32] = \"CONTENT_LENGTH\";\n FLAGS[FLAGS[\"SKIPBODY\"] = 64] = \"SKIPBODY\";\n FLAGS[FLAGS[\"TRAILING\"] = 128] = \"TRAILING\";\n // 1 << 8 is unused\n FLAGS[FLAGS[\"TRANSFER_ENCODING\"] = 512] = \"TRANSFER_ENCODING\";\n})(FLAGS = exports.FLAGS || (exports.FLAGS = {}));\nvar LENIENT_FLAGS;\n(function (LENIENT_FLAGS) {\n LENIENT_FLAGS[LENIENT_FLAGS[\"HEADERS\"] = 1] = \"HEADERS\";\n LENIENT_FLAGS[LENIENT_FLAGS[\"CHUNKED_LENGTH\"] = 2] = \"CHUNKED_LENGTH\";\n LENIENT_FLAGS[LENIENT_FLAGS[\"KEEP_ALIVE\"] = 4] = \"KEEP_ALIVE\";\n})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));\nvar METHODS;\n(function (METHODS) {\n METHODS[METHODS[\"DELETE\"] = 0] = \"DELETE\";\n METHODS[METHODS[\"GET\"] = 1] = \"GET\";\n METHODS[METHODS[\"HEAD\"] = 2] = \"HEAD\";\n METHODS[METHODS[\"POST\"] = 3] = \"POST\";\n METHODS[METHODS[\"PUT\"] = 4] = \"PUT\";\n /* pathological */\n METHODS[METHODS[\"CONNECT\"] = 5] = \"CONNECT\";\n METHODS[METHODS[\"OPTIONS\"] = 6] = \"OPTIONS\";\n METHODS[METHODS[\"TRACE\"] = 7] = \"TRACE\";\n /* WebDAV */\n METHODS[METHODS[\"COPY\"] = 8] = \"COPY\";\n METHODS[METHODS[\"LOCK\"] = 9] = \"LOCK\";\n METHODS[METHODS[\"MKCOL\"] = 10] = \"MKCOL\";\n METHODS[METHODS[\"MOVE\"] = 11] = \"MOVE\";\n METHODS[METHODS[\"PROPFIND\"] = 12] = \"PROPFIND\";\n METHODS[METHODS[\"PROPPATCH\"] = 13] = \"PROPPATCH\";\n METHODS[METHODS[\"SEARCH\"] = 14] = \"SEARCH\";\n METHODS[METHODS[\"UNLOCK\"] = 15] = \"UNLOCK\";\n METHODS[METHODS[\"BIND\"] = 16] = \"BIND\";\n METHODS[METHODS[\"REBIND\"] = 17] = \"REBIND\";\n METHODS[METHODS[\"UNBIND\"] = 18] = \"UNBIND\";\n METHODS[METHODS[\"ACL\"] = 19] = \"ACL\";\n /* subversion */\n METHODS[METHODS[\"REPORT\"] = 20] = \"REPORT\";\n METHODS[METHODS[\"MKACTIVITY\"] = 21] = \"MKACTIVITY\";\n METHODS[METHODS[\"CHECKOUT\"] = 22] = \"CHECKOUT\";\n METHODS[METHODS[\"MERGE\"] = 23] = \"MERGE\";\n /* upnp */\n METHODS[METHODS[\"M-SEARCH\"] = 24] = \"M-SEARCH\";\n METHODS[METHODS[\"NOTIFY\"] = 25] = \"NOTIFY\";\n METHODS[METHODS[\"SUBSCRIBE\"] = 26] = \"SUBSCRIBE\";\n METHODS[METHODS[\"UNSUBSCRIBE\"] = 27] = \"UNSUBSCRIBE\";\n /* RFC-5789 */\n METHODS[METHODS[\"PATCH\"] = 28] = \"PATCH\";\n METHODS[METHODS[\"PURGE\"] = 29] = \"PURGE\";\n /* CalDAV */\n METHODS[METHODS[\"MKCALENDAR\"] = 30] = \"MKCALENDAR\";\n /* RFC-2068, section 19.6.1.2 */\n METHODS[METHODS[\"LINK\"] = 31] = \"LINK\";\n METHODS[METHODS[\"UNLINK\"] = 32] = \"UNLINK\";\n /* icecast */\n METHODS[METHODS[\"SOURCE\"] = 33] = \"SOURCE\";\n /* RFC-7540, section 11.6 */\n METHODS[METHODS[\"PRI\"] = 34] = \"PRI\";\n /* RFC-2326 RTSP */\n METHODS[METHODS[\"DESCRIBE\"] = 35] = \"DESCRIBE\";\n METHODS[METHODS[\"ANNOUNCE\"] = 36] = \"ANNOUNCE\";\n METHODS[METHODS[\"SETUP\"] = 37] = \"SETUP\";\n METHODS[METHODS[\"PLAY\"] = 38] = \"PLAY\";\n METHODS[METHODS[\"PAUSE\"] = 39] = \"PAUSE\";\n METHODS[METHODS[\"TEARDOWN\"] = 40] = \"TEARDOWN\";\n METHODS[METHODS[\"GET_PARAMETER\"] = 41] = \"GET_PARAMETER\";\n METHODS[METHODS[\"SET_PARAMETER\"] = 42] = \"SET_PARAMETER\";\n METHODS[METHODS[\"REDIRECT\"] = 43] = \"REDIRECT\";\n METHODS[METHODS[\"RECORD\"] = 44] = \"RECORD\";\n /* RAOP */\n METHODS[METHODS[\"FLUSH\"] = 45] = \"FLUSH\";\n})(METHODS = exports.METHODS || (exports.METHODS = {}));\nexports.METHODS_HTTP = [\n METHODS.DELETE,\n METHODS.GET,\n METHODS.HEAD,\n METHODS.POST,\n METHODS.PUT,\n METHODS.CONNECT,\n METHODS.OPTIONS,\n METHODS.TRACE,\n METHODS.COPY,\n METHODS.LOCK,\n METHODS.MKCOL,\n METHODS.MOVE,\n METHODS.PROPFIND,\n METHODS.PROPPATCH,\n METHODS.SEARCH,\n METHODS.UNLOCK,\n METHODS.BIND,\n METHODS.REBIND,\n METHODS.UNBIND,\n METHODS.ACL,\n METHODS.REPORT,\n METHODS.MKACTIVITY,\n METHODS.CHECKOUT,\n METHODS.MERGE,\n METHODS['M-SEARCH'],\n METHODS.NOTIFY,\n METHODS.SUBSCRIBE,\n METHODS.UNSUBSCRIBE,\n METHODS.PATCH,\n METHODS.PURGE,\n METHODS.MKCALENDAR,\n METHODS.LINK,\n METHODS.UNLINK,\n METHODS.PRI,\n // TODO(indutny): should we allow it with HTTP?\n METHODS.SOURCE,\n];\nexports.METHODS_ICE = [\n METHODS.SOURCE,\n];\nexports.METHODS_RTSP = [\n METHODS.OPTIONS,\n METHODS.DESCRIBE,\n METHODS.ANNOUNCE,\n METHODS.SETUP,\n METHODS.PLAY,\n METHODS.PAUSE,\n METHODS.TEARDOWN,\n METHODS.GET_PARAMETER,\n METHODS.SET_PARAMETER,\n METHODS.REDIRECT,\n METHODS.RECORD,\n METHODS.FLUSH,\n // For AirPlay\n METHODS.GET,\n METHODS.POST,\n];\nexports.METHOD_MAP = utils_1.enumToMap(METHODS);\nexports.H_METHOD_MAP = {};\nObject.keys(exports.METHOD_MAP).forEach((key) => {\n if (/^H/.test(key)) {\n exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];\n }\n});\nvar FINISH;\n(function (FINISH) {\n FINISH[FINISH[\"SAFE\"] = 0] = \"SAFE\";\n FINISH[FINISH[\"SAFE_WITH_CB\"] = 1] = \"SAFE_WITH_CB\";\n FINISH[FINISH[\"UNSAFE\"] = 2] = \"UNSAFE\";\n})(FINISH = exports.FINISH || (exports.FINISH = {}));\nexports.ALPHA = [];\nfor (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {\n // Upper case\n exports.ALPHA.push(String.fromCharCode(i));\n // Lower case\n exports.ALPHA.push(String.fromCharCode(i + 0x20));\n}\nexports.NUM_MAP = {\n 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n};\nexports.HEX_MAP = {\n 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,\n a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,\n};\nexports.NUM = [\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n];\nexports.ALPHANUM = exports.ALPHA.concat(exports.NUM);\nexports.MARK = ['-', '_', '.', '!', '~', '*', '\\'', '(', ')'];\nexports.USERINFO_CHARS = exports.ALPHANUM\n .concat(exports.MARK)\n .concat(['%', ';', ':', '&', '=', '+', '$', ',']);\n// TODO(indutny): use RFC\nexports.STRICT_URL_CHAR = [\n '!', '\"', '$', '%', '&', '\\'',\n '(', ')', '*', '+', ',', '-', '.', '/',\n ':', ';', '<', '=', '>',\n '@', '[', '\\\\', ']', '^', '_',\n '`',\n '{', '|', '}', '~',\n].concat(exports.ALPHANUM);\nexports.URL_CHAR = exports.STRICT_URL_CHAR\n .concat(['\\t', '\\f']);\n// All characters with 0x80 bit set to 1\nfor (let i = 0x80; i <= 0xff; i++) {\n exports.URL_CHAR.push(i);\n}\nexports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);\n/* Tokens as defined by rfc 2616. Also lowercases them.\n * token = 1*\n * separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n * | \",\" | \";\" | \":\" | \"\\\" | <\">\n * | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n * | \"{\" | \"}\" | SP | HT\n */\nexports.STRICT_TOKEN = [\n '!', '#', '$', '%', '&', '\\'',\n '*', '+', '-', '.',\n '^', '_', '`',\n '|', '~',\n].concat(exports.ALPHANUM);\nexports.TOKEN = exports.STRICT_TOKEN.concat([' ']);\n/*\n * Verify that a char is a valid visible (printable) US-ASCII\n * character or %x80-FF\n */\nexports.HEADER_CHARS = ['\\t'];\nfor (let i = 32; i <= 255; i++) {\n if (i !== 127) {\n exports.HEADER_CHARS.push(i);\n }\n}\n// ',' = \\x44\nexports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);\nexports.MAJOR = exports.NUM_MAP;\nexports.MINOR = exports.MAJOR;\nvar HEADER_STATE;\n(function (HEADER_STATE) {\n HEADER_STATE[HEADER_STATE[\"GENERAL\"] = 0] = \"GENERAL\";\n HEADER_STATE[HEADER_STATE[\"CONNECTION\"] = 1] = \"CONNECTION\";\n HEADER_STATE[HEADER_STATE[\"CONTENT_LENGTH\"] = 2] = \"CONTENT_LENGTH\";\n HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING\"] = 3] = \"TRANSFER_ENCODING\";\n HEADER_STATE[HEADER_STATE[\"UPGRADE\"] = 4] = \"UPGRADE\";\n HEADER_STATE[HEADER_STATE[\"CONNECTION_KEEP_ALIVE\"] = 5] = \"CONNECTION_KEEP_ALIVE\";\n HEADER_STATE[HEADER_STATE[\"CONNECTION_CLOSE\"] = 6] = \"CONNECTION_CLOSE\";\n HEADER_STATE[HEADER_STATE[\"CONNECTION_UPGRADE\"] = 7] = \"CONNECTION_UPGRADE\";\n HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING_CHUNKED\"] = 8] = \"TRANSFER_ENCODING_CHUNKED\";\n})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));\nexports.SPECIAL_HEADERS = {\n 'connection': HEADER_STATE.CONNECTION,\n 'content-length': HEADER_STATE.CONTENT_LENGTH,\n 'proxy-connection': HEADER_STATE.CONNECTION,\n 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,\n 'upgrade': HEADER_STATE.UPGRADE,\n};\n//# sourceMappingURL=constants.js.map","'use strict'\n\nconst { Buffer } = require('node:buffer')\n\nmodule.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK07MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtXACAAQRhqQgA3AwAgAEIANwMAIABBOGpCADcDACAAQTBqQgA3AwAgAEEoakIANwMAIABBIGpCADcDACAAQRBqQgA3AwAgAEEIakIANwMAIABB3QE2AhwLBgAgABAyC5otAQt/IwBBEGsiCiQAQaTQACgCACIJRQRAQeTTACgCACIFRQRAQfDTAEJ/NwIAQejTAEKAgISAgIDAADcCAEHk0wAgCkEIakFwcUHYqtWqBXMiBTYCAEH40wBBADYCAEHI0wBBADYCAAtBzNMAQYDUBDYCAEGc0ABBgNQENgIAQbDQACAFNgIAQazQAEF/NgIAQdDTAEGArAM2AgADQCABQcjQAGogAUG80ABqIgI2AgAgAiABQbTQAGoiAzYCACABQcDQAGogAzYCACABQdDQAGogAUHE0ABqIgM2AgAgAyACNgIAIAFB2NAAaiABQczQAGoiAjYCACACIAM2AgAgAUHU0ABqIAI2AgAgAUEgaiIBQYACRw0AC0GM1ARBwasDNgIAQajQAEH00wAoAgA2AgBBmNAAQcCrAzYCAEGk0ABBiNQENgIAQcz/B0E4NgIAQYjUBCEJCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFNBEBBjNAAKAIAIgZBECAAQRNqQXBxIABBC0kbIgRBA3YiAHYiAUEDcQRAAkAgAUEBcSAAckEBcyICQQN0IgBBtNAAaiIBIABBvNAAaigCACIAKAIIIgNGBEBBjNAAIAZBfiACd3E2AgAMAQsgASADNgIIIAMgATYCDAsgAEEIaiEBIAAgAkEDdCICQQNyNgIEIAAgAmoiACAAKAIEQQFyNgIEDBELQZTQACgCACIIIARPDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxaCIAQQN0IgJBtNAAaiIBIAJBvNAAaigCACICKAIIIgNGBEBBjNAAIAZBfiAAd3EiBjYCAAwBCyABIAM2AgggAyABNgIMCyACIARBA3I2AgQgAEEDdCIAIARrIQUgACACaiAFNgIAIAIgBGoiBCAFQQFyNgIEIAgEQCAIQXhxQbTQAGohAEGg0AAoAgAhAwJ/QQEgCEEDdnQiASAGcUUEQEGM0AAgASAGcjYCACAADAELIAAoAggLIgEgAzYCDCAAIAM2AgggAyAANgIMIAMgATYCCAsgAkEIaiEBQaDQACAENgIAQZTQACAFNgIADBELQZDQACgCACILRQ0BIAtoQQJ0QbzSAGooAgAiACgCBEF4cSAEayEFIAAhAgNAAkAgAigCECIBRQRAIAJBFGooAgAiAUUNAQsgASgCBEF4cSAEayIDIAVJIQIgAyAFIAIbIQUgASAAIAIbIQAgASECDAELCyAAKAIYIQkgACgCDCIDIABHBEBBnNAAKAIAGiADIAAoAggiATYCCCABIAM2AgwMEAsgAEEUaiICKAIAIgFFBEAgACgCECIBRQ0DIABBEGohAgsDQCACIQcgASIDQRRqIgIoAgAiAQ0AIANBEGohAiADKAIQIgENAAsgB0EANgIADA8LQX8hBCAAQb9/Sw0AIABBE2oiAUFwcSEEQZDQACgCACIIRQ0AQQAgBGshBQJAAkACQAJ/QQAgBEGAAkkNABpBHyAEQf///wdLDQAaIARBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgZBAnRBvNIAaigCACICRQRAQQAhAUEAIQMMAQtBACEBIARBGSAGQQF2a0EAIAZBH0cbdCEAQQAhAwNAAkAgAigCBEF4cSAEayIHIAVPDQAgAiEDIAciBQ0AQQAhBSACIQEMAwsgASACQRRqKAIAIgcgByACIABBHXZBBHFqQRBqKAIAIgJGGyABIAcbIQEgAEEBdCEAIAINAAsLIAEgA3JFBEBBACEDQQIgBnQiAEEAIABrciAIcSIARQ0DIABoQQJ0QbzSAGooAgAhAQsgAUUNAQsDQCABKAIEQXhxIARrIgIgBUkhACACIAUgABshBSABIAMgABshAyABKAIQIgAEfyAABSABQRRqKAIACyIBDQALCyADRQ0AIAVBlNAAKAIAIARrTw0AIAMoAhghByADIAMoAgwiAEcEQEGc0AAoAgAaIAAgAygCCCIBNgIIIAEgADYCDAwOCyADQRRqIgIoAgAiAUUEQCADKAIQIgFFDQMgA0EQaiECCwNAIAIhBiABIgBBFGoiAigCACIBDQAgAEEQaiECIAAoAhAiAQ0ACyAGQQA2AgAMDQtBlNAAKAIAIgMgBE8EQEGg0AAoAgAhAQJAIAMgBGsiAkEQTwRAIAEgBGoiACACQQFyNgIEIAEgA2ogAjYCACABIARBA3I2AgQMAQsgASADQQNyNgIEIAEgA2oiACAAKAIEQQFyNgIEQQAhAEEAIQILQZTQACACNgIAQaDQACAANgIAIAFBCGohAQwPC0GY0AAoAgAiAyAESwRAIAQgCWoiACADIARrIgFBAXI2AgRBpNAAIAA2AgBBmNAAIAE2AgAgCSAEQQNyNgIEIAlBCGohAQwPC0EAIQEgBAJ/QeTTACgCAARAQezTACgCAAwBC0Hw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBDGpBcHFB2KrVqgVzNgIAQfjTAEEANgIAQcjTAEEANgIAQYCABAsiACAEQccAaiIFaiIGQQAgAGsiB3EiAk8EQEH80wBBMDYCAAwPCwJAQcTTACgCACIBRQ0AQbzTACgCACIIIAJqIQAgACABTSAAIAhLcQ0AQQAhAUH80wBBMDYCAAwPC0HI0wAtAABBBHENBAJAAkAgCQRAQczTACEBA0AgASgCACIAIAlNBEAgACABKAIEaiAJSw0DCyABKAIIIgENAAsLQQAQMyIAQX9GDQUgAiEGQejTACgCACIBQQFrIgMgAHEEQCACIABrIAAgA2pBACABa3FqIQYLIAQgBk8NBSAGQf7///8HSw0FQcTTACgCACIDBEBBvNMAKAIAIgcgBmohASABIAdNDQYgASADSw0GCyAGEDMiASAARw0BDAcLIAYgA2sgB3EiBkH+////B0sNBCAGEDMhACAAIAEoAgAgASgCBGpGDQMgACEBCwJAIAYgBEHIAGpPDQAgAUF/Rg0AQezTACgCACIAIAUgBmtqQQAgAGtxIgBB/v///wdLBEAgASEADAcLIAAQM0F/RwRAIAAgBmohBiABIQAMBwtBACAGaxAzGgwECyABIgBBf0cNBQwDC0EAIQMMDAtBACEADAoLIABBf0cNAgtByNMAQcjTACgCAEEEcjYCAAsgAkH+////B0sNASACEDMhAEEAEDMhASAAQX9GDQEgAUF/Rg0BIAAgAU8NASABIABrIgYgBEE4ak0NAQtBvNMAQbzTACgCACAGaiIBNgIAQcDTACgCACABSQRAQcDTACABNgIACwJAAkACQEGk0AAoAgAiAgRAQczTACEBA0AgACABKAIAIgMgASgCBCIFakYNAiABKAIIIgENAAsMAgtBnNAAKAIAIgFBAEcgACABT3FFBEBBnNAAIAA2AgALQQAhAUHQ0wAgBjYCAEHM0wAgADYCAEGs0ABBfzYCAEGw0ABB5NMAKAIANgIAQdjTAEEANgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBeCAAa0EPcSIBIABqIgIgBkE4ayIDIAFrIgFBAXI2AgRBqNAAQfTTACgCADYCAEGY0AAgATYCAEGk0AAgAjYCACAAIANqQTg2AgQMAgsgACACTQ0AIAIgA0kNACABKAIMQQhxDQBBeCACa0EPcSIAIAJqIgNBmNAAKAIAIAZqIgcgAGsiAEEBcjYCBCABIAUgBmo2AgRBqNAAQfTTACgCADYCAEGY0AAgADYCAEGk0AAgAzYCACACIAdqQTg2AgQMAQsgAEGc0AAoAgBJBEBBnNAAIAA2AgALIAAgBmohA0HM0wAhAQJAAkACQANAIAMgASgCAEcEQCABKAIIIgENAQwCCwsgAS0ADEEIcUUNAQtBzNMAIQEDQCABKAIAIgMgAk0EQCADIAEoAgRqIgUgAksNAwsgASgCCCEBDAALAAsgASAANgIAIAEgASgCBCAGajYCBCAAQXggAGtBD3FqIgkgBEEDcjYCBCADQXggA2tBD3FqIgYgBCAJaiIEayEBIAIgBkYEQEGk0AAgBDYCAEGY0ABBmNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEDAgLQaDQACgCACAGRgRAQaDQACAENgIAQZTQAEGU0AAoAgAgAWoiADYCACAEIABBAXI2AgQgACAEaiAANgIADAgLIAYoAgQiBUEDcUEBRw0GIAVBeHEhCCAFQf8BTQRAIAVBA3YhAyAGKAIIIgAgBigCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBwsgAiAANgIIIAAgAjYCDAwGCyAGKAIYIQcgBiAGKAIMIgBHBEAgACAGKAIIIgI2AgggAiAANgIMDAULIAZBFGoiAigCACIFRQRAIAYoAhAiBUUNBCAGQRBqIQILA0AgAiEDIAUiAEEUaiICKAIAIgUNACAAQRBqIQIgACgCECIFDQALIANBADYCAAwEC0F4IABrQQ9xIgEgAGoiByAGQThrIgMgAWsiAUEBcjYCBCAAIANqQTg2AgQgAiAFQTcgBWtBD3FqQT9rIgMgAyACQRBqSRsiA0EjNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAc2AgAgA0EQakHU0wApAgA3AgAgA0HM0wApAgA3AghB1NMAIANBCGo2AgBB0NMAIAY2AgBBzNMAIAA2AgBB2NMAQQA2AgAgA0EkaiEBA0AgAUEHNgIAIAUgAUEEaiIBSw0ACyACIANGDQAgAyADKAIEQX5xNgIEIAMgAyACayIFNgIAIAIgBUEBcjYCBCAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIDcUUEQEGM0AAgASADcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEGQ0AAoAgAiA0EBIAF0IgZxRQRAIAAgAjYCAEGQ0AAgAyAGcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQMCQANAIAMiACgCBEF4cSAFRg0BIAFBHXYhAyABQQF0IQEgACADQQRxakEQaiIGKAIAIgMNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAtBmNAAKAIAIgEgBE0NAEGk0AAoAgAiACAEaiICIAEgBGsiAUEBcjYCBEGY0AAgATYCAEGk0AAgAjYCACAAIARBA3I2AgQgAEEIaiEBDAgLQQAhAUH80wBBMDYCAAwHC0EAIQALIAdFDQACQCAGKAIcIgJBAnRBvNIAaiIDKAIAIAZGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAdBEEEUIAcoAhAgBkYbaiAANgIAIABFDQELIAAgBzYCGCAGKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAGQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAIaiEBIAYgCGoiBigCBCEFCyAGIAVBfnE2AgQgASAEaiABNgIAIAQgAUEBcjYCBCABQf8BTQRAIAFBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASABQQN2dCIBcUUEQEGM0AAgASACcjYCACAADAELIAAoAggLIgEgBDYCDCAAIAQ2AgggBCAANgIMIAQgATYCCAwBC0EfIQUgAUH///8HTQRAIAFBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBQsgBCAFNgIcIARCADcCECAFQQJ0QbzSAGohAEGQ0AAoAgAiAkEBIAV0IgNxRQRAIAAgBDYCAEGQ0AAgAiADcjYCACAEIAA2AhggBCAENgIIIAQgBDYCDAwBCyABQRkgBUEBdmtBACAFQR9HG3QhBSAAKAIAIQACQANAIAAiAigCBEF4cSABRg0BIAVBHXYhACAFQQF0IQUgAiAAQQRxakEQaiIDKAIAIgANAAsgAyAENgIAIAQgAjYCGCAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgCUEIaiEBDAILAkAgB0UNAAJAIAMoAhwiAUECdEG80gBqIgIoAgAgA0YEQCACIAA2AgAgAA0BQZDQACAIQX4gAXdxIgg2AgAMAgsgB0EQQRQgBygCECADRhtqIAA2AgAgAEUNAQsgACAHNgIYIAMoAhAiAQRAIAAgATYCECABIAA2AhgLIANBFGooAgAiAUUNACAAQRRqIAE2AgAgASAANgIYCwJAIAVBD00EQCADIAQgBWoiAEEDcjYCBCAAIANqIgAgACgCBEEBcjYCBAwBCyADIARqIgIgBUEBcjYCBCADIARBA3I2AgQgAiAFaiAFNgIAIAVB/wFNBEAgBUF4cUG00ABqIQACf0GM0AAoAgAiAUEBIAVBA3Z0IgVxRQRAQYzQACABIAVyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRBvNIAaiEAQQEgAXQiBCAIcUUEQCAAIAI2AgBBkNAAIAQgCHI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEEAkADQCAEIgAoAgRBeHEgBUYNASABQR12IQQgAUEBdCEBIAAgBEEEcWpBEGoiBigCACIEDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLIANBCGohAQwBCwJAIAlFDQACQCAAKAIcIgFBAnRBvNIAaiICKAIAIABGBEAgAiADNgIAIAMNAUGQ0AAgC0F+IAF3cTYCAAwCCyAJQRBBFCAJKAIQIABGG2ogAzYCACADRQ0BCyADIAk2AhggACgCECIBBEAgAyABNgIQIAEgAzYCGAsgAEEUaigCACIBRQ0AIANBFGogATYCACABIAM2AhgLAkAgBUEPTQRAIAAgBCAFaiIBQQNyNgIEIAAgAWoiASABKAIEQQFyNgIEDAELIAAgBGoiByAFQQFyNgIEIAAgBEEDcjYCBCAFIAdqIAU2AgAgCARAIAhBeHFBtNAAaiEBQaDQACgCACEDAn9BASAIQQN2dCICIAZxRQRAQYzQACACIAZyNgIAIAEMAQsgASgCCAsiAiADNgIMIAEgAzYCCCADIAE2AgwgAyACNgIIC0Gg0AAgBzYCAEGU0AAgBTYCAAsgAEEIaiEBCyAKQRBqJAAgAQtDACAARQRAPwBBEHQPCwJAIABB//8DcQ0AIABBAEgNACAAQRB2QAAiAEF/RgRAQfzTAEEwNgIAQX8PCyAAQRB0DwsACwvcPyIAQYAICwkBAAAAAgAAAAMAQZQICwUEAAAABQBBpAgLCQYAAAAHAAAACABB3AgLii1JbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AFJlc3BvbnNlIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zAFVzZXIgY2FsbGJhY2sgZXJyb3IAYG9uX3Jlc2V0YCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfaGVhZGVyYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9iZWdpbmAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3N0YXR1c19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3ZlcnNpb25fY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl91cmxfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXRob2RfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfZmllbGRfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fbmFtZWAgY2FsbGJhY2sgZXJyb3IAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzZXJ2ZXIASW52YWxpZCBoZWFkZXIgdmFsdWUgY2hhcgBJbnZhbGlkIGhlYWRlciBmaWVsZCBjaGFyAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdmVyc2lvbgBJbnZhbGlkIG1pbm9yIHZlcnNpb24ASW52YWxpZCBtYWpvciB2ZXJzaW9uAEV4cGVjdGVkIHNwYWNlIGFmdGVyIHZlcnNpb24ARXhwZWN0ZWQgQ1JMRiBhZnRlciB2ZXJzaW9uAEludmFsaWQgSFRUUCB2ZXJzaW9uAEludmFsaWQgaGVhZGVyIHRva2VuAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdXJsAEludmFsaWQgY2hhcmFjdGVycyBpbiB1cmwAVW5leHBlY3RlZCBzdGFydCBjaGFyIGluIHVybABEb3VibGUgQCBpbiB1cmwARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgARHVwbGljYXRlIENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhciBpbiB1cmwgcGF0aABDb250ZW50LUxlbmd0aCBjYW4ndCBiZSBwcmVzZW50IHdpdGggVHJhbnNmZXItRW5jb2RpbmcASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgc2l6ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl92YWx1ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlZCB2YWx1ZQBQYXVzZWQgYnkgb25faGVhZGVyc19jb21wbGV0ZQBJbnZhbGlkIEVPRiBzdGF0ZQBvbl9yZXNldCBwYXVzZQBvbl9jaHVua19oZWFkZXIgcGF1c2UAb25fbWVzc2FnZV9iZWdpbiBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fdmFsdWUgcGF1c2UAb25fc3RhdHVzX2NvbXBsZXRlIHBhdXNlAG9uX3ZlcnNpb25fY29tcGxldGUgcGF1c2UAb25fdXJsX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXNzYWdlX2NvbXBsZXRlIHBhdXNlAG9uX21ldGhvZF9jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfZmllbGRfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUgcGF1c2UAVW5leHBlY3RlZCBzcGFjZSBhZnRlciBzdGFydCBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAFBhdXNlIG9uIENPTk5FQ1QvVXBncmFkZQBQYXVzZSBvbiBQUkkvVXBncmFkZQBFeHBlY3RlZCBIVFRQLzIgQ29ubmVjdGlvbiBQcmVmYWNlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fbWV0aG9kAEV4cGVjdGVkIHNwYWNlIGFmdGVyIG1ldGhvZABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl9maWVsZABQYXVzZWQASW52YWxpZCB3b3JkIGVuY291bnRlcmVkAEludmFsaWQgbWV0aG9kIGVuY291bnRlcmVkAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2NoZW1hAFJlcXVlc3QgaGFzIGludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYABTV0lUQ0hfUFJPWFkAVVNFX1BST1hZAE1LQUNUSVZJVFkAVU5QUk9DRVNTQUJMRV9FTlRJVFkAQ09QWQBNT1ZFRF9QRVJNQU5FTlRMWQBUT09fRUFSTFkATk9USUZZAEZBSUxFRF9ERVBFTkRFTkNZAEJBRF9HQVRFV0FZAFBMQVkAUFVUAENIRUNLT1VUAEdBVEVXQVlfVElNRU9VVABSRVFVRVNUX1RJTUVPVVQATkVUV09SS19DT05ORUNUX1RJTUVPVVQAQ09OTkVDVElPTl9USU1FT1VUAExPR0lOX1RJTUVPVVQATkVUV09SS19SRUFEX1RJTUVPVVQAUE9TVABNSVNESVJFQ1RFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX0xPQURfQkFMQU5DRURfUkVRVUVTVABCQURfUkVRVUVTVABIVFRQX1JFUVVFU1RfU0VOVF9UT19IVFRQU19QT1JUAFJFUE9SVABJTV9BX1RFQVBPVABSRVNFVF9DT05URU5UAE5PX0NPTlRFTlQAUEFSVElBTF9DT05URU5UAEhQRV9JTlZBTElEX0NPTlNUQU5UAEhQRV9DQl9SRVNFVABHRVQASFBFX1NUUklDVABDT05GTElDVABURU1QT1JBUllfUkVESVJFQ1QAUEVSTUFORU5UX1JFRElSRUNUAENPTk5FQ1QATVVMVElfU1RBVFVTAEhQRV9JTlZBTElEX1NUQVRVUwBUT09fTUFOWV9SRVFVRVNUUwBFQVJMWV9ISU5UUwBVTkFWQUlMQUJMRV9GT1JfTEVHQUxfUkVBU09OUwBPUFRJT05TAFNXSVRDSElOR19QUk9UT0NPTFMAVkFSSUFOVF9BTFNPX05FR09USUFURVMATVVMVElQTEVfQ0hPSUNFUwBJTlRFUk5BTF9TRVJWRVJfRVJST1IAV0VCX1NFUlZFUl9VTktOT1dOX0VSUk9SAFJBSUxHVU5fRVJST1IASURFTlRJVFlfUFJPVklERVJfQVVUSEVOVElDQVRJT05fRVJST1IAU1NMX0NFUlRJRklDQVRFX0VSUk9SAElOVkFMSURfWF9GT1JXQVJERURfRk9SAFNFVF9QQVJBTUVURVIAR0VUX1BBUkFNRVRFUgBIUEVfVVNFUgBTRUVfT1RIRVIASFBFX0NCX0NIVU5LX0hFQURFUgBNS0NBTEVOREFSAFNFVFVQAFdFQl9TRVJWRVJfSVNfRE9XTgBURUFSRE9XTgBIUEVfQ0xPU0VEX0NPTk5FQ1RJT04ASEVVUklTVElDX0VYUElSQVRJT04ARElTQ09OTkVDVEVEX09QRVJBVElPTgBOT05fQVVUSE9SSVRBVElWRV9JTkZPUk1BVElPTgBIUEVfSU5WQUxJRF9WRVJTSU9OAEhQRV9DQl9NRVNTQUdFX0JFR0lOAFNJVEVfSVNfRlJPWkVOAEhQRV9JTlZBTElEX0hFQURFUl9UT0tFTgBJTlZBTElEX1RPS0VOAEZPUkJJRERFTgBFTkhBTkNFX1lPVVJfQ0FMTQBIUEVfSU5WQUxJRF9VUkwAQkxPQ0tFRF9CWV9QQVJFTlRBTF9DT05UUk9MAE1LQ09MAEFDTABIUEVfSU5URVJOQUwAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRV9VTk9GRklDSUFMAEhQRV9PSwBVTkxJTksAVU5MT0NLAFBSSQBSRVRSWV9XSVRIAEhQRV9JTlZBTElEX0NPTlRFTlRfTEVOR1RIAEhQRV9VTkVYUEVDVEVEX0NPTlRFTlRfTEVOR1RIAEZMVVNIAFBST1BQQVRDSABNLVNFQVJDSABVUklfVE9PX0xPTkcAUFJPQ0VTU0lORwBNSVNDRUxMQU5FT1VTX1BFUlNJU1RFTlRfV0FSTklORwBNSVNDRUxMQU5FT1VTX1dBUk5JTkcASFBFX0lOVkFMSURfVFJBTlNGRVJfRU5DT0RJTkcARXhwZWN0ZWQgQ1JMRgBIUEVfSU5WQUxJRF9DSFVOS19TSVpFAE1PVkUAQ09OVElOVUUASFBFX0NCX1NUQVRVU19DT01QTEVURQBIUEVfQ0JfSEVBREVSU19DT01QTEVURQBIUEVfQ0JfVkVSU0lPTl9DT01QTEVURQBIUEVfQ0JfVVJMX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8AAF4TAAAmEwAAMBAAAPAXAACdEwAAFRIAADkXAADwEgAAChAAAHUSAACtEgAAghMAAE8UAAB/EAAAoBUAACMUAACJEgAAixQAAE0VAADUEQAAzxQAABAYAADJFgAA3BYAAMERAADgFwAAuxQAAHQUAAB8FQAA5RQAAAgXAAAfEAAAZRUAAKMUAAAoFQAAAhUAAJkVAAAsEAAAixkAAE8PAADUDgAAahAAAM4QAAACFwAAiQ4AAG4TAAAcEwAAZhQAAFYXAADBEwAAzRMAAGwTAABoFwAAZhcAAF8XAAAiEwAAzg8AAGkOAADYDgAAYxYAAMsTAACqDgAAKBcAACYXAADFEwAAXRYAAOgRAABnEwAAZRMAAPIWAABzEwAAHRcAAPkWAADzEQAAzw4AAM4VAAAMEgAAsxEAAKURAABhEAAAMhcAALsTAEH5NQsBAQBBkDYL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB/TcLAQEAQZE4C14CAwICAgICAAACAgACAgACAgICAgICAgICAAQAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEH9OQsBAQBBkToLXgIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAQfA7Cw1sb3NlZWVwLWFsaXZlAEGJPAsBAQBBoDwL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBiT4LAQEAQaA+C+cBAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAEGwwAALXwEBAAEBAQEBAAABAQABAQABAQEBAQEBAQEBAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAEGQwgALIWVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgBBwMIACy1yYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AQfnCAAsFAQIAAQMAQZDDAAvgAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH5xAALBQECAAEDAEGQxQAL4AEEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cYACwQBAAABAEGRxwAL3wEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv', 'base64')\n","'use strict'\n\nconst { Buffer } = require('node:buffer')\n\nmodule.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK77MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtzACAAQRBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAA/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQTBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQSBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQd0BNgIcCwYAIAAQMguaLQELfyMAQRBrIgokAEGk0AAoAgAiCUUEQEHk0wAoAgAiBUUEQEHw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBCGpBcHFB2KrVqgVzIgU2AgBB+NMAQQA2AgBByNMAQQA2AgALQczTAEGA1AQ2AgBBnNAAQYDUBDYCAEGw0AAgBTYCAEGs0ABBfzYCAEHQ0wBBgKwDNgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBjNQEQcGrAzYCAEGo0ABB9NMAKAIANgIAQZjQAEHAqwM2AgBBpNAAQYjUBDYCAEHM/wdBODYCAEGI1AQhCQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQewBTQRAQYzQACgCACIGQRAgAEETakFwcSAAQQtJGyIEQQN2IgB2IgFBA3EEQAJAIAFBAXEgAHJBAXMiAkEDdCIAQbTQAGoiASAAQbzQAGooAgAiACgCCCIDRgRAQYzQACAGQX4gAndxNgIADAELIAEgAzYCCCADIAE2AgwLIABBCGohASAAIAJBA3QiAkEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwRC0GU0AAoAgAiCCAETw0BIAEEQAJAQQIgAHQiAkEAIAJrciABIAB0cWgiAEEDdCICQbTQAGoiASACQbzQAGooAgAiAigCCCIDRgRAQYzQACAGQX4gAHdxIgY2AgAMAQsgASADNgIIIAMgATYCDAsgAiAEQQNyNgIEIABBA3QiACAEayEFIAAgAmogBTYCACACIARqIgQgBUEBcjYCBCAIBEAgCEF4cUG00ABqIQBBoNAAKAIAIQMCf0EBIAhBA3Z0IgEgBnFFBEBBjNAAIAEgBnI2AgAgAAwBCyAAKAIICyIBIAM2AgwgACADNgIIIAMgADYCDCADIAE2AggLIAJBCGohAUGg0AAgBDYCAEGU0AAgBTYCAAwRC0GQ0AAoAgAiC0UNASALaEECdEG80gBqKAIAIgAoAgRBeHEgBGshBSAAIQIDQAJAIAIoAhAiAUUEQCACQRRqKAIAIgFFDQELIAEoAgRBeHEgBGsiAyAFSSECIAMgBSACGyEFIAEgACACGyEAIAEhAgwBCwsgACgCGCEJIAAoAgwiAyAARwRAQZzQACgCABogAyAAKAIIIgE2AgggASADNgIMDBALIABBFGoiAigCACIBRQRAIAAoAhAiAUUNAyAAQRBqIQILA0AgAiEHIAEiA0EUaiICKAIAIgENACADQRBqIQIgAygCECIBDQALIAdBADYCAAwPC0F/IQQgAEG/f0sNACAAQRNqIgFBcHEhBEGQ0AAoAgAiCEUNAEEAIARrIQUCQAJAAkACf0EAIARBgAJJDQAaQR8gBEH///8HSw0AGiAEQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qCyIGQQJ0QbzSAGooAgAiAkUEQEEAIQFBACEDDAELQQAhASAEQRkgBkEBdmtBACAGQR9HG3QhAEEAIQMDQAJAIAIoAgRBeHEgBGsiByAFTw0AIAIhAyAHIgUNAEEAIQUgAiEBDAMLIAEgAkEUaigCACIHIAcgAiAAQR12QQRxakEQaigCACICRhsgASAHGyEBIABBAXQhACACDQALCyABIANyRQRAQQAhA0ECIAZ0IgBBACAAa3IgCHEiAEUNAyAAaEECdEG80gBqKAIAIQELIAFFDQELA0AgASgCBEF4cSAEayICIAVJIQAgAiAFIAAbIQUgASADIAAbIQMgASgCECIABH8gAAUgAUEUaigCAAsiAQ0ACwsgA0UNACAFQZTQACgCACAEa08NACADKAIYIQcgAyADKAIMIgBHBEBBnNAAKAIAGiAAIAMoAggiATYCCCABIAA2AgwMDgsgA0EUaiICKAIAIgFFBEAgAygCECIBRQ0DIANBEGohAgsDQCACIQYgASIAQRRqIgIoAgAiAQ0AIABBEGohAiAAKAIQIgENAAsgBkEANgIADA0LQZTQACgCACIDIARPBEBBoNAAKAIAIQECQCADIARrIgJBEE8EQCABIARqIgAgAkEBcjYCBCABIANqIAI2AgAgASAEQQNyNgIEDAELIAEgA0EDcjYCBCABIANqIgAgACgCBEEBcjYCBEEAIQBBACECC0GU0AAgAjYCAEGg0AAgADYCACABQQhqIQEMDwtBmNAAKAIAIgMgBEsEQCAEIAlqIgAgAyAEayIBQQFyNgIEQaTQACAANgIAQZjQACABNgIAIAkgBEEDcjYCBCAJQQhqIQEMDwtBACEBIAQCf0Hk0wAoAgAEQEHs0wAoAgAMAQtB8NMAQn83AgBB6NMAQoCAhICAgMAANwIAQeTTACAKQQxqQXBxQdiq1aoFczYCAEH40wBBADYCAEHI0wBBADYCAEGAgAQLIgAgBEHHAGoiBWoiBkEAIABrIgdxIgJPBEBB/NMAQTA2AgAMDwsCQEHE0wAoAgAiAUUNAEG80wAoAgAiCCACaiEAIAAgAU0gACAIS3ENAEEAIQFB/NMAQTA2AgAMDwtByNMALQAAQQRxDQQCQAJAIAkEQEHM0wAhAQNAIAEoAgAiACAJTQRAIAAgASgCBGogCUsNAwsgASgCCCIBDQALC0EAEDMiAEF/Rg0FIAIhBkHo0wAoAgAiAUEBayIDIABxBEAgAiAAayAAIANqQQAgAWtxaiEGCyAEIAZPDQUgBkH+////B0sNBUHE0wAoAgAiAwRAQbzTACgCACIHIAZqIQEgASAHTQ0GIAEgA0sNBgsgBhAzIgEgAEcNAQwHCyAGIANrIAdxIgZB/v///wdLDQQgBhAzIQAgACABKAIAIAEoAgRqRg0DIAAhAQsCQCAGIARByABqTw0AIAFBf0YNAEHs0wAoAgAiACAFIAZrakEAIABrcSIAQf7///8HSwRAIAEhAAwHCyAAEDNBf0cEQCAAIAZqIQYgASEADAcLQQAgBmsQMxoMBAsgASIAQX9HDQUMAwtBACEDDAwLQQAhAAwKCyAAQX9HDQILQcjTAEHI0wAoAgBBBHI2AgALIAJB/v///wdLDQEgAhAzIQBBABAzIQEgAEF/Rg0BIAFBf0YNASAAIAFPDQEgASAAayIGIARBOGpNDQELQbzTAEG80wAoAgAgBmoiATYCAEHA0wAoAgAgAUkEQEHA0wAgATYCAAsCQAJAAkBBpNAAKAIAIgIEQEHM0wAhAQNAIAAgASgCACIDIAEoAgQiBWpGDQIgASgCCCIBDQALDAILQZzQACgCACIBQQBHIAAgAU9xRQRAQZzQACAANgIAC0EAIQFB0NMAIAY2AgBBzNMAIAA2AgBBrNAAQX82AgBBsNAAQeTTACgCADYCAEHY0wBBADYCAANAIAFByNAAaiABQbzQAGoiAjYCACACIAFBtNAAaiIDNgIAIAFBwNAAaiADNgIAIAFB0NAAaiABQcTQAGoiAzYCACADIAI2AgAgAUHY0ABqIAFBzNAAaiICNgIAIAIgAzYCACABQdTQAGogAjYCACABQSBqIgFBgAJHDQALQXggAGtBD3EiASAAaiICIAZBOGsiAyABayIBQQFyNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAI2AgAgACADakE4NgIEDAILIAAgAk0NACACIANJDQAgASgCDEEIcQ0AQXggAmtBD3EiACACaiIDQZjQACgCACAGaiIHIABrIgBBAXI2AgQgASAFIAZqNgIEQajQAEH00wAoAgA2AgBBmNAAIAA2AgBBpNAAIAM2AgAgAiAHakE4NgIEDAELIABBnNAAKAIASQRAQZzQACAANgIACyAAIAZqIQNBzNMAIQECQAJAAkADQCADIAEoAgBHBEAgASgCCCIBDQEMAgsLIAEtAAxBCHFFDQELQczTACEBA0AgASgCACIDIAJNBEAgAyABKAIEaiIFIAJLDQMLIAEoAgghAQwACwALIAEgADYCACABIAEoAgQgBmo2AgQgAEF4IABrQQ9xaiIJIARBA3I2AgQgA0F4IANrQQ9xaiIGIAQgCWoiBGshASACIAZGBEBBpNAAIAQ2AgBBmNAAQZjQACgCACABaiIANgIAIAQgAEEBcjYCBAwIC0Gg0AAoAgAgBkYEQEGg0AAgBDYCAEGU0ABBlNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEIAAgBGogADYCAAwICyAGKAIEIgVBA3FBAUcNBiAFQXhxIQggBUH/AU0EQCAFQQN2IQMgBigCCCIAIAYoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAcLIAIgADYCCCAAIAI2AgwMBgsgBigCGCEHIAYgBigCDCIARwRAIAAgBigCCCICNgIIIAIgADYCDAwFCyAGQRRqIgIoAgAiBUUEQCAGKAIQIgVFDQQgBkEQaiECCwNAIAIhAyAFIgBBFGoiAigCACIFDQAgAEEQaiECIAAoAhAiBQ0ACyADQQA2AgAMBAtBeCAAa0EPcSIBIABqIgcgBkE4ayIDIAFrIgFBAXI2AgQgACADakE4NgIEIAIgBUE3IAVrQQ9xakE/ayIDIAMgAkEQakkbIgNBIzYCBEGo0ABB9NMAKAIANgIAQZjQACABNgIAQaTQACAHNgIAIANBEGpB1NMAKQIANwIAIANBzNMAKQIANwIIQdTTACADQQhqNgIAQdDTACAGNgIAQczTACAANgIAQdjTAEEANgIAIANBJGohAQNAIAFBBzYCACAFIAFBBGoiAUsNAAsgAiADRg0AIAMgAygCBEF+cTYCBCADIAMgAmsiBTYCACACIAVBAXI2AgQgBUH/AU0EQCAFQXhxQbTQAGohAAJ/QYzQACgCACIBQQEgBUEDdnQiA3FFBEBBjNAAIAEgA3I2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEG80gBqIQBBkNAAKAIAIgNBASABdCIGcUUEQCAAIAI2AgBBkNAAIAMgBnI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEDAkADQCADIgAoAgRBeHEgBUYNASABQR12IQMgAUEBdCEBIAAgA0EEcWpBEGoiBigCACIDDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLQZjQACgCACIBIARNDQBBpNAAKAIAIgAgBGoiAiABIARrIgFBAXI2AgRBmNAAIAE2AgBBpNAAIAI2AgAgACAEQQNyNgIEIABBCGohAQwIC0EAIQFB/NMAQTA2AgAMBwtBACEACyAHRQ0AAkAgBigCHCICQQJ0QbzSAGoiAygCACAGRgRAIAMgADYCACAADQFBkNAAQZDQACgCAEF+IAJ3cTYCAAwCCyAHQRBBFCAHKAIQIAZGG2ogADYCACAARQ0BCyAAIAc2AhggBigCECICBEAgACACNgIQIAIgADYCGAsgBkEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgCGohASAGIAhqIgYoAgQhBQsgBiAFQX5xNgIEIAEgBGogATYCACAEIAFBAXI2AgQgAUH/AU0EQCABQXhxQbTQAGohAAJ/QYzQACgCACICQQEgAUEDdnQiAXFFBEBBjNAAIAEgAnI2AgAgAAwBCyAAKAIICyIBIAQ2AgwgACAENgIIIAQgADYCDCAEIAE2AggMAQtBHyEFIAFB////B00EQCABQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQULIAQgBTYCHCAEQgA3AhAgBUECdEG80gBqIQBBkNAAKAIAIgJBASAFdCIDcUUEQCAAIAQ2AgBBkNAAIAIgA3I2AgAgBCAANgIYIAQgBDYCCCAEIAQ2AgwMAQsgAUEZIAVBAXZrQQAgBUEfRxt0IQUgACgCACEAAkADQCAAIgIoAgRBeHEgAUYNASAFQR12IQAgBUEBdCEFIAIgAEEEcWpBEGoiAygCACIADQALIAMgBDYCACAEIAI2AhggBCAENgIMIAQgBDYCCAwBCyACKAIIIgAgBDYCDCACIAQ2AgggBEEANgIYIAQgAjYCDCAEIAA2AggLIAlBCGohAQwCCwJAIAdFDQACQCADKAIcIgFBAnRBvNIAaiICKAIAIANGBEAgAiAANgIAIAANAUGQ0AAgCEF+IAF3cSIINgIADAILIAdBEEEUIAcoAhAgA0YbaiAANgIAIABFDQELIAAgBzYCGCADKAIQIgEEQCAAIAE2AhAgASAANgIYCyADQRRqKAIAIgFFDQAgAEEUaiABNgIAIAEgADYCGAsCQCAFQQ9NBEAgAyAEIAVqIgBBA3I2AgQgACADaiIAIAAoAgRBAXI2AgQMAQsgAyAEaiICIAVBAXI2AgQgAyAEQQNyNgIEIAIgBWogBTYCACAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIFcUUEQEGM0AAgASAFcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEEBIAF0IgQgCHFFBEAgACACNgIAQZDQACAEIAhyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhBAJAA0AgBCIAKAIEQXhxIAVGDQEgAUEddiEEIAFBAXQhASAAIARBBHFqQRBqIgYoAgAiBA0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIICyADQQhqIQEMAQsCQCAJRQ0AAkAgACgCHCIBQQJ0QbzSAGoiAigCACAARgRAIAIgAzYCACADDQFBkNAAIAtBfiABd3E2AgAMAgsgCUEQQRQgCSgCECAARhtqIAM2AgAgA0UNAQsgAyAJNgIYIAAoAhAiAQRAIAMgATYCECABIAM2AhgLIABBFGooAgAiAUUNACADQRRqIAE2AgAgASADNgIYCwJAIAVBD00EQCAAIAQgBWoiAUEDcjYCBCAAIAFqIgEgASgCBEEBcjYCBAwBCyAAIARqIgcgBUEBcjYCBCAAIARBA3I2AgQgBSAHaiAFNgIAIAgEQCAIQXhxQbTQAGohAUGg0AAoAgAhAwJ/QQEgCEEDdnQiAiAGcUUEQEGM0AAgAiAGcjYCACABDAELIAEoAggLIgIgAzYCDCABIAM2AgggAyABNgIMIAMgAjYCCAtBoNAAIAc2AgBBlNAAIAU2AgALIABBCGohAQsgCkEQaiQAIAELQwAgAEUEQD8AQRB0DwsCQCAAQf//A3ENACAAQQBIDQAgAEEQdkAAIgBBf0YEQEH80wBBMDYCAEF/DwsgAEEQdA8LAAsL3D8iAEGACAsJAQAAAAIAAAADAEGUCAsFBAAAAAUAQaQICwkGAAAABwAAAAgAQdwIC4otSW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwBB+TULAQEAQZA2C+ABAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQf03CwEBAEGROAteAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgBB/TkLAQEAQZE6C14CAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEHwOwsNbG9zZWVlcC1hbGl2ZQBBiTwLAQEAQaA8C+ABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQYk+CwEBAEGgPgvnAQEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZABBsMAAC18BAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBBkMIACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQcDCAAstcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQoNClNNDQoNClRUUC9DRS9UU1AvAEH5wgALBQECAAEDAEGQwwAL4AEEAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cQACwUBAgABAwBBkMUAC+ABBAEBBQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQfnGAAsEAQAAAQBBkccAC98BAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+sgACwQBAAACAEGQyQALXwMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==', 'base64')\n","'use strict'\n\nconst corsSafeListedMethods = /** @type {const} */ (['GET', 'HEAD', 'POST'])\nconst corsSafeListedMethodsSet = new Set(corsSafeListedMethods)\n\nconst nullBodyStatus = /** @type {const} */ ([101, 204, 205, 304])\n\nconst redirectStatus = /** @type {const} */ ([301, 302, 303, 307, 308])\nconst redirectStatusSet = new Set(redirectStatus)\n\n/**\n * @see https://fetch.spec.whatwg.org/#block-bad-port\n */\nconst badPorts = /** @type {const} */ ([\n '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',\n '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',\n '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',\n '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',\n '2049', '3659', '4045', '4190', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6679',\n '6697', '10080'\n])\nconst badPortsSet = new Set(badPorts)\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#referrer-policies\n */\nconst referrerPolicy = /** @type {const} */ ([\n '',\n 'no-referrer',\n 'no-referrer-when-downgrade',\n 'same-origin',\n 'origin',\n 'strict-origin',\n 'origin-when-cross-origin',\n 'strict-origin-when-cross-origin',\n 'unsafe-url'\n])\nconst referrerPolicySet = new Set(referrerPolicy)\n\nconst requestRedirect = /** @type {const} */ (['follow', 'manual', 'error'])\n\nconst safeMethods = /** @type {const} */ (['GET', 'HEAD', 'OPTIONS', 'TRACE'])\nconst safeMethodsSet = new Set(safeMethods)\n\nconst requestMode = /** @type {const} */ (['navigate', 'same-origin', 'no-cors', 'cors'])\n\nconst requestCredentials = /** @type {const} */ (['omit', 'same-origin', 'include'])\n\nconst requestCache = /** @type {const} */ ([\n 'default',\n 'no-store',\n 'reload',\n 'no-cache',\n 'force-cache',\n 'only-if-cached'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-body-header-name\n */\nconst requestBodyHeader = /** @type {const} */ ([\n 'content-encoding',\n 'content-language',\n 'content-location',\n 'content-type',\n // See https://github.com/nodejs/undici/issues/2021\n // 'Content-Length' is a forbidden header name, which is typically\n // removed in the Headers implementation. However, undici doesn't\n // filter out headers, so we add it here.\n 'content-length'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#enumdef-requestduplex\n */\nconst requestDuplex = /** @type {const} */ ([\n 'half'\n])\n\n/**\n * @see http://fetch.spec.whatwg.org/#forbidden-method\n */\nconst forbiddenMethods = /** @type {const} */ (['CONNECT', 'TRACE', 'TRACK'])\nconst forbiddenMethodsSet = new Set(forbiddenMethods)\n\nconst subresource = /** @type {const} */ ([\n 'audio',\n 'audioworklet',\n 'font',\n 'image',\n 'manifest',\n 'paintworklet',\n 'script',\n 'style',\n 'track',\n 'video',\n 'xslt',\n ''\n])\nconst subresourceSet = new Set(subresource)\n\nmodule.exports = {\n subresource,\n forbiddenMethods,\n requestBodyHeader,\n referrerPolicy,\n requestRedirect,\n requestMode,\n requestCredentials,\n requestCache,\n redirectStatus,\n corsSafeListedMethods,\n nullBodyStatus,\n safeMethods,\n badPorts,\n requestDuplex,\n subresourceSet,\n badPortsSet,\n redirectStatusSet,\n corsSafeListedMethodsSet,\n safeMethodsSet,\n forbiddenMethodsSet,\n referrerPolicySet\n}\n","'use strict'\n\n// In case of breaking changes, increase the version\n// number to avoid conflicts.\nconst globalOrigin = Symbol.for('undici.globalOrigin.1')\n\nfunction getGlobalOrigin () {\n return globalThis[globalOrigin]\n}\n\nfunction setGlobalOrigin (newOrigin) {\n if (newOrigin === undefined) {\n Object.defineProperty(globalThis, globalOrigin, {\n value: undefined,\n writable: true,\n enumerable: false,\n configurable: false\n })\n\n return\n }\n\n const parsedURL = new URL(newOrigin)\n\n if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {\n throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)\n }\n\n Object.defineProperty(globalThis, globalOrigin, {\n value: parsedURL,\n writable: true,\n enumerable: false,\n configurable: false\n })\n}\n\nmodule.exports = {\n getGlobalOrigin,\n setGlobalOrigin\n}\n","'use strict'\n\nconst assert = require('node:assert')\n\nconst encoder = new TextEncoder()\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-token-code-point\n */\nconst HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\\-.^_|~A-Za-z0-9]+$/\nconst HTTP_WHITESPACE_REGEX = /[\\u000A\\u000D\\u0009\\u0020]/ // eslint-disable-line\nconst ASCII_WHITESPACE_REPLACE_REGEX = /[\\u0009\\u000A\\u000C\\u000D\\u0020]/g // eslint-disable-line\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point\n */\nconst HTTP_QUOTED_STRING_TOKENS = /^[\\u0009\\u0020-\\u007E\\u0080-\\u00FF]+$/ // eslint-disable-line\n\n// https://fetch.spec.whatwg.org/#data-url-processor\n/** @param {URL} dataURL */\nfunction dataURLProcessor (dataURL) {\n // 1. Assert: dataURL’s scheme is \"data\".\n assert(dataURL.protocol === 'data:')\n\n // 2. Let input be the result of running the URL\n // serializer on dataURL with exclude fragment\n // set to true.\n let input = URLSerializer(dataURL, true)\n\n // 3. Remove the leading \"data:\" string from input.\n input = input.slice(5)\n\n // 4. Let position point at the start of input.\n const position = { position: 0 }\n\n // 5. Let mimeType be the result of collecting a\n // sequence of code points that are not equal\n // to U+002C (,), given position.\n let mimeType = collectASequenceOfCodePointsFast(\n ',',\n input,\n position\n )\n\n // 6. Strip leading and trailing ASCII whitespace\n // from mimeType.\n // Undici implementation note: we need to store the\n // length because if the mimetype has spaces removed,\n // the wrong amount will be sliced from the input in\n // step #9\n const mimeTypeLength = mimeType.length\n mimeType = removeASCIIWhitespace(mimeType, true, true)\n\n // 7. If position is past the end of input, then\n // return failure\n if (position.position >= input.length) {\n return 'failure'\n }\n\n // 8. Advance position by 1.\n position.position++\n\n // 9. Let encodedBody be the remainder of input.\n const encodedBody = input.slice(mimeTypeLength + 1)\n\n // 10. Let body be the percent-decoding of encodedBody.\n let body = stringPercentDecode(encodedBody)\n\n // 11. If mimeType ends with U+003B (;), followed by\n // zero or more U+0020 SPACE, followed by an ASCII\n // case-insensitive match for \"base64\", then:\n if (/;(\\u0020){0,}base64$/i.test(mimeType)) {\n // 1. Let stringBody be the isomorphic decode of body.\n const stringBody = isomorphicDecode(body)\n\n // 2. Set body to the forgiving-base64 decode of\n // stringBody.\n body = forgivingBase64(stringBody)\n\n // 3. If body is failure, then return failure.\n if (body === 'failure') {\n return 'failure'\n }\n\n // 4. Remove the last 6 code points from mimeType.\n mimeType = mimeType.slice(0, -6)\n\n // 5. Remove trailing U+0020 SPACE code points from mimeType,\n // if any.\n mimeType = mimeType.replace(/(\\u0020)+$/, '')\n\n // 6. Remove the last U+003B (;) code point from mimeType.\n mimeType = mimeType.slice(0, -1)\n }\n\n // 12. If mimeType starts with U+003B (;), then prepend\n // \"text/plain\" to mimeType.\n if (mimeType.startsWith(';')) {\n mimeType = 'text/plain' + mimeType\n }\n\n // 13. Let mimeTypeRecord be the result of parsing\n // mimeType.\n let mimeTypeRecord = parseMIMEType(mimeType)\n\n // 14. If mimeTypeRecord is failure, then set\n // mimeTypeRecord to text/plain;charset=US-ASCII.\n if (mimeTypeRecord === 'failure') {\n mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')\n }\n\n // 15. Return a new data: URL struct whose MIME\n // type is mimeTypeRecord and body is body.\n // https://fetch.spec.whatwg.org/#data-url-struct\n return { mimeType: mimeTypeRecord, body }\n}\n\n// https://url.spec.whatwg.org/#concept-url-serializer\n/**\n * @param {URL} url\n * @param {boolean} excludeFragment\n */\nfunction URLSerializer (url, excludeFragment = false) {\n if (!excludeFragment) {\n return url.href\n }\n\n const href = url.href\n const hashLength = url.hash.length\n\n const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength)\n\n if (!hashLength && href.endsWith('#')) {\n return serialized.slice(0, -1)\n }\n\n return serialized\n}\n\n// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points\n/**\n * @param {(char: string) => boolean} condition\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePoints (condition, input, position) {\n // 1. Let result be the empty string.\n let result = ''\n\n // 2. While position doesn’t point past the end of input and the\n // code point at position within input meets the condition condition:\n while (position.position < input.length && condition(input[position.position])) {\n // 1. Append that code point to the end of result.\n result += input[position.position]\n\n // 2. Advance position by 1.\n position.position++\n }\n\n // 3. Return result.\n return result\n}\n\n/**\n * A faster collectASequenceOfCodePoints that only works when comparing a single character.\n * @param {string} char\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePointsFast (char, input, position) {\n const idx = input.indexOf(char, position.position)\n const start = position.position\n\n if (idx === -1) {\n position.position = input.length\n return input.slice(start)\n }\n\n position.position = idx\n return input.slice(start, position.position)\n}\n\n// https://url.spec.whatwg.org/#string-percent-decode\n/** @param {string} input */\nfunction stringPercentDecode (input) {\n // 1. Let bytes be the UTF-8 encoding of input.\n const bytes = encoder.encode(input)\n\n // 2. Return the percent-decoding of bytes.\n return percentDecode(bytes)\n}\n\n/**\n * @param {number} byte\n */\nfunction isHexCharByte (byte) {\n // 0-9 A-F a-f\n return (byte >= 0x30 && byte <= 0x39) || (byte >= 0x41 && byte <= 0x46) || (byte >= 0x61 && byte <= 0x66)\n}\n\n/**\n * @param {number} byte\n */\nfunction hexByteToNumber (byte) {\n return (\n // 0-9\n byte >= 0x30 && byte <= 0x39\n ? (byte - 48)\n // Convert to uppercase\n // ((byte & 0xDF) - 65) + 10\n : ((byte & 0xDF) - 55)\n )\n}\n\n// https://url.spec.whatwg.org/#percent-decode\n/** @param {Uint8Array} input */\nfunction percentDecode (input) {\n const length = input.length\n // 1. Let output be an empty byte sequence.\n /** @type {Uint8Array} */\n const output = new Uint8Array(length)\n let j = 0\n // 2. For each byte byte in input:\n for (let i = 0; i < length; ++i) {\n const byte = input[i]\n\n // 1. If byte is not 0x25 (%), then append byte to output.\n if (byte !== 0x25) {\n output[j++] = byte\n\n // 2. Otherwise, if byte is 0x25 (%) and the next two bytes\n // after byte in input are not in the ranges\n // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),\n // and 0x61 (a) to 0x66 (f), all inclusive, append byte\n // to output.\n } else if (\n byte === 0x25 &&\n !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2]))\n ) {\n output[j++] = 0x25\n\n // 3. Otherwise:\n } else {\n // 1. Let bytePoint be the two bytes after byte in input,\n // decoded, and then interpreted as hexadecimal number.\n // 2. Append a byte whose value is bytePoint to output.\n output[j++] = (hexByteToNumber(input[i + 1]) << 4) | hexByteToNumber(input[i + 2])\n\n // 3. Skip the next two bytes in input.\n i += 2\n }\n }\n\n // 3. Return output.\n return length === j ? output : output.subarray(0, j)\n}\n\n// https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n/** @param {string} input */\nfunction parseMIMEType (input) {\n // 1. Remove any leading and trailing HTTP whitespace\n // from input.\n input = removeHTTPWhitespace(input, true, true)\n\n // 2. Let position be a position variable for input,\n // initially pointing at the start of input.\n const position = { position: 0 }\n\n // 3. Let type be the result of collecting a sequence\n // of code points that are not U+002F (/) from\n // input, given position.\n const type = collectASequenceOfCodePointsFast(\n '/',\n input,\n position\n )\n\n // 4. If type is the empty string or does not solely\n // contain HTTP token code points, then return failure.\n // https://mimesniff.spec.whatwg.org/#http-token-code-point\n if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {\n return 'failure'\n }\n\n // 5. If position is past the end of input, then return\n // failure\n if (position.position > input.length) {\n return 'failure'\n }\n\n // 6. Advance position by 1. (This skips past U+002F (/).)\n position.position++\n\n // 7. Let subtype be the result of collecting a sequence of\n // code points that are not U+003B (;) from input, given\n // position.\n let subtype = collectASequenceOfCodePointsFast(\n ';',\n input,\n position\n )\n\n // 8. Remove any trailing HTTP whitespace from subtype.\n subtype = removeHTTPWhitespace(subtype, false, true)\n\n // 9. If subtype is the empty string or does not solely\n // contain HTTP token code points, then return failure.\n if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {\n return 'failure'\n }\n\n const typeLowercase = type.toLowerCase()\n const subtypeLowercase = subtype.toLowerCase()\n\n // 10. Let mimeType be a new MIME type record whose type\n // is type, in ASCII lowercase, and subtype is subtype,\n // in ASCII lowercase.\n // https://mimesniff.spec.whatwg.org/#mime-type\n const mimeType = {\n type: typeLowercase,\n subtype: subtypeLowercase,\n /** @type {Map} */\n parameters: new Map(),\n // https://mimesniff.spec.whatwg.org/#mime-type-essence\n essence: `${typeLowercase}/${subtypeLowercase}`\n }\n\n // 11. While position is not past the end of input:\n while (position.position < input.length) {\n // 1. Advance position by 1. (This skips past U+003B (;).)\n position.position++\n\n // 2. Collect a sequence of code points that are HTTP\n // whitespace from input given position.\n collectASequenceOfCodePoints(\n // https://fetch.spec.whatwg.org/#http-whitespace\n char => HTTP_WHITESPACE_REGEX.test(char),\n input,\n position\n )\n\n // 3. Let parameterName be the result of collecting a\n // sequence of code points that are not U+003B (;)\n // or U+003D (=) from input, given position.\n let parameterName = collectASequenceOfCodePoints(\n (char) => char !== ';' && char !== '=',\n input,\n position\n )\n\n // 4. Set parameterName to parameterName, in ASCII\n // lowercase.\n parameterName = parameterName.toLowerCase()\n\n // 5. If position is not past the end of input, then:\n if (position.position < input.length) {\n // 1. If the code point at position within input is\n // U+003B (;), then continue.\n if (input[position.position] === ';') {\n continue\n }\n\n // 2. Advance position by 1. (This skips past U+003D (=).)\n position.position++\n }\n\n // 6. If position is past the end of input, then break.\n if (position.position > input.length) {\n break\n }\n\n // 7. Let parameterValue be null.\n let parameterValue = null\n\n // 8. If the code point at position within input is\n // U+0022 (\"), then:\n if (input[position.position] === '\"') {\n // 1. Set parameterValue to the result of collecting\n // an HTTP quoted string from input, given position\n // and the extract-value flag.\n parameterValue = collectAnHTTPQuotedString(input, position, true)\n\n // 2. Collect a sequence of code points that are not\n // U+003B (;) from input, given position.\n collectASequenceOfCodePointsFast(\n ';',\n input,\n position\n )\n\n // 9. Otherwise:\n } else {\n // 1. Set parameterValue to the result of collecting\n // a sequence of code points that are not U+003B (;)\n // from input, given position.\n parameterValue = collectASequenceOfCodePointsFast(\n ';',\n input,\n position\n )\n\n // 2. Remove any trailing HTTP whitespace from parameterValue.\n parameterValue = removeHTTPWhitespace(parameterValue, false, true)\n\n // 3. If parameterValue is the empty string, then continue.\n if (parameterValue.length === 0) {\n continue\n }\n }\n\n // 10. If all of the following are true\n // - parameterName is not the empty string\n // - parameterName solely contains HTTP token code points\n // - parameterValue solely contains HTTP quoted-string token code points\n // - mimeType’s parameters[parameterName] does not exist\n // then set mimeType’s parameters[parameterName] to parameterValue.\n if (\n parameterName.length !== 0 &&\n HTTP_TOKEN_CODEPOINTS.test(parameterName) &&\n (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&\n !mimeType.parameters.has(parameterName)\n ) {\n mimeType.parameters.set(parameterName, parameterValue)\n }\n }\n\n // 12. Return mimeType.\n return mimeType\n}\n\n// https://infra.spec.whatwg.org/#forgiving-base64-decode\n/** @param {string} data */\nfunction forgivingBase64 (data) {\n // 1. Remove all ASCII whitespace from data.\n data = data.replace(ASCII_WHITESPACE_REPLACE_REGEX, '') // eslint-disable-line\n\n let dataLength = data.length\n // 2. If data’s code point length divides by 4 leaving\n // no remainder, then:\n if (dataLength % 4 === 0) {\n // 1. If data ends with one or two U+003D (=) code points,\n // then remove them from data.\n if (data.charCodeAt(dataLength - 1) === 0x003D) {\n --dataLength\n if (data.charCodeAt(dataLength - 1) === 0x003D) {\n --dataLength\n }\n }\n }\n\n // 3. If data’s code point length divides by 4 leaving\n // a remainder of 1, then return failure.\n if (dataLength % 4 === 1) {\n return 'failure'\n }\n\n // 4. If data contains a code point that is not one of\n // U+002B (+)\n // U+002F (/)\n // ASCII alphanumeric\n // then return failure.\n if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) {\n return 'failure'\n }\n\n const buffer = Buffer.from(data, 'base64')\n return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\n// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string\n// tests: https://fetch.spec.whatwg.org/#example-http-quoted-string\n/**\n * @param {string} input\n * @param {{ position: number }} position\n * @param {boolean?} extractValue\n */\nfunction collectAnHTTPQuotedString (input, position, extractValue) {\n // 1. Let positionStart be position.\n const positionStart = position.position\n\n // 2. Let value be the empty string.\n let value = ''\n\n // 3. Assert: the code point at position within input\n // is U+0022 (\").\n assert(input[position.position] === '\"')\n\n // 4. Advance position by 1.\n position.position++\n\n // 5. While true:\n while (true) {\n // 1. Append the result of collecting a sequence of code points\n // that are not U+0022 (\") or U+005C (\\) from input, given\n // position, to value.\n value += collectASequenceOfCodePoints(\n (char) => char !== '\"' && char !== '\\\\',\n input,\n position\n )\n\n // 2. If position is past the end of input, then break.\n if (position.position >= input.length) {\n break\n }\n\n // 3. Let quoteOrBackslash be the code point at position within\n // input.\n const quoteOrBackslash = input[position.position]\n\n // 4. Advance position by 1.\n position.position++\n\n // 5. If quoteOrBackslash is U+005C (\\), then:\n if (quoteOrBackslash === '\\\\') {\n // 1. If position is past the end of input, then append\n // U+005C (\\) to value and break.\n if (position.position >= input.length) {\n value += '\\\\'\n break\n }\n\n // 2. Append the code point at position within input to value.\n value += input[position.position]\n\n // 3. Advance position by 1.\n position.position++\n\n // 6. Otherwise:\n } else {\n // 1. Assert: quoteOrBackslash is U+0022 (\").\n assert(quoteOrBackslash === '\"')\n\n // 2. Break.\n break\n }\n }\n\n // 6. If the extract-value flag is set, then return value.\n if (extractValue) {\n return value\n }\n\n // 7. Return the code points from positionStart to position,\n // inclusive, within input.\n return input.slice(positionStart, position.position)\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serializeAMimeType (mimeType) {\n assert(mimeType !== 'failure')\n const { parameters, essence } = mimeType\n\n // 1. Let serialization be the concatenation of mimeType’s\n // type, U+002F (/), and mimeType’s subtype.\n let serialization = essence\n\n // 2. For each name → value of mimeType’s parameters:\n for (let [name, value] of parameters.entries()) {\n // 1. Append U+003B (;) to serialization.\n serialization += ';'\n\n // 2. Append name to serialization.\n serialization += name\n\n // 3. Append U+003D (=) to serialization.\n serialization += '='\n\n // 4. If value does not solely contain HTTP token code\n // points or value is the empty string, then:\n if (!HTTP_TOKEN_CODEPOINTS.test(value)) {\n // 1. Precede each occurrence of U+0022 (\") or\n // U+005C (\\) in value with U+005C (\\).\n value = value.replace(/(\\\\|\")/g, '\\\\$1')\n\n // 2. Prepend U+0022 (\") to value.\n value = '\"' + value\n\n // 3. Append U+0022 (\") to value.\n value += '\"'\n }\n\n // 5. Append value to serialization.\n serialization += value\n }\n\n // 3. Return serialization.\n return serialization\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {number} char\n */\nfunction isHTTPWhiteSpace (char) {\n // \"\\r\\n\\t \"\n return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x020\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {string} str\n * @param {boolean} [leading=true]\n * @param {boolean} [trailing=true]\n */\nfunction removeHTTPWhitespace (str, leading = true, trailing = true) {\n return removeChars(str, leading, trailing, isHTTPWhiteSpace)\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n * @param {number} char\n */\nfunction isASCIIWhitespace (char) {\n // \"\\r\\n\\t\\f \"\n return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x00c || char === 0x020\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace\n * @param {string} str\n * @param {boolean} [leading=true]\n * @param {boolean} [trailing=true]\n */\nfunction removeASCIIWhitespace (str, leading = true, trailing = true) {\n return removeChars(str, leading, trailing, isASCIIWhitespace)\n}\n\n/**\n * @param {string} str\n * @param {boolean} leading\n * @param {boolean} trailing\n * @param {(charCode: number) => boolean} predicate\n * @returns\n */\nfunction removeChars (str, leading, trailing, predicate) {\n let lead = 0\n let trail = str.length - 1\n\n if (leading) {\n while (lead < str.length && predicate(str.charCodeAt(lead))) lead++\n }\n\n if (trailing) {\n while (trail > 0 && predicate(str.charCodeAt(trail))) trail--\n }\n\n return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1)\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-decode\n * @param {Uint8Array} input\n * @returns {string}\n */\nfunction isomorphicDecode (input) {\n // 1. To isomorphic decode a byte sequence input, return a string whose code point\n // length is equal to input’s length and whose code points have the same values\n // as the values of input’s bytes, in the same order.\n const length = input.length\n if ((2 << 15) - 1 > length) {\n return String.fromCharCode.apply(null, input)\n }\n let result = ''; let i = 0\n let addition = (2 << 15) - 1\n while (i < length) {\n if (i + addition > length) {\n addition = length - i\n }\n result += String.fromCharCode.apply(null, input.subarray(i, i += addition))\n }\n return result\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#minimize-a-supported-mime-type\n * @param {Exclude, 'failure'>} mimeType\n */\nfunction minimizeSupportedMimeType (mimeType) {\n switch (mimeType.essence) {\n case 'application/ecmascript':\n case 'application/javascript':\n case 'application/x-ecmascript':\n case 'application/x-javascript':\n case 'text/ecmascript':\n case 'text/javascript':\n case 'text/javascript1.0':\n case 'text/javascript1.1':\n case 'text/javascript1.2':\n case 'text/javascript1.3':\n case 'text/javascript1.4':\n case 'text/javascript1.5':\n case 'text/jscript':\n case 'text/livescript':\n case 'text/x-ecmascript':\n case 'text/x-javascript':\n // 1. If mimeType is a JavaScript MIME type, then return \"text/javascript\".\n return 'text/javascript'\n case 'application/json':\n case 'text/json':\n // 2. If mimeType is a JSON MIME type, then return \"application/json\".\n return 'application/json'\n case 'image/svg+xml':\n // 3. If mimeType’s essence is \"image/svg+xml\", then return \"image/svg+xml\".\n return 'image/svg+xml'\n case 'text/xml':\n case 'application/xml':\n // 4. If mimeType is an XML MIME type, then return \"application/xml\".\n return 'application/xml'\n }\n\n // 2. If mimeType is a JSON MIME type, then return \"application/json\".\n if (mimeType.subtype.endsWith('+json')) {\n return 'application/json'\n }\n\n // 4. If mimeType is an XML MIME type, then return \"application/xml\".\n if (mimeType.subtype.endsWith('+xml')) {\n return 'application/xml'\n }\n\n // 5. If mimeType is supported by the user agent, then return mimeType’s essence.\n // Technically, node doesn't support any mimetypes.\n\n // 6. Return the empty string.\n return ''\n}\n\nmodule.exports = {\n dataURLProcessor,\n URLSerializer,\n collectASequenceOfCodePoints,\n collectASequenceOfCodePointsFast,\n stringPercentDecode,\n parseMIMEType,\n collectAnHTTPQuotedString,\n serializeAMimeType,\n removeChars,\n removeHTTPWhitespace,\n minimizeSupportedMimeType,\n HTTP_TOKEN_CODEPOINTS,\n isomorphicDecode\n}\n","'use strict'\n\nconst { types, inspect } = require('node:util')\nconst { markAsUncloneable } = require('node:worker_threads')\nconst { toUSVString } = require('../../core/util')\n\n/** @type {import('../../../types/webidl').Webidl} */\nconst webidl = {}\nwebidl.converters = {}\nwebidl.util = {}\nwebidl.errors = {}\n\nwebidl.errors.exception = function (message) {\n return new TypeError(`${message.header}: ${message.message}`)\n}\n\nwebidl.errors.conversionFailed = function (context) {\n const plural = context.types.length === 1 ? '' : ' one of'\n const message =\n `${context.argument} could not be converted to` +\n `${plural}: ${context.types.join(', ')}.`\n\n return webidl.errors.exception({\n header: context.prefix,\n message\n })\n}\n\nwebidl.errors.invalidArgument = function (context) {\n return webidl.errors.exception({\n header: context.prefix,\n message: `\"${context.value}\" is an invalid ${context.type}.`\n })\n}\n\n// https://webidl.spec.whatwg.org/#implements\nwebidl.brandCheck = function (V, I, opts) {\n if (opts?.strict !== false) {\n if (!(V instanceof I)) {\n const err = new TypeError('Illegal invocation')\n err.code = 'ERR_INVALID_THIS' // node compat.\n throw err\n }\n } else {\n if (V?.[Symbol.toStringTag] !== I.prototype[Symbol.toStringTag]) {\n const err = new TypeError('Illegal invocation')\n err.code = 'ERR_INVALID_THIS' // node compat.\n throw err\n }\n }\n}\n\nwebidl.argumentLengthCheck = function ({ length }, min, ctx) {\n if (length < min) {\n throw webidl.errors.exception({\n message: `${min} argument${min !== 1 ? 's' : ''} required, ` +\n `but${length ? ' only' : ''} ${length} found.`,\n header: ctx\n })\n }\n}\n\nwebidl.illegalConstructor = function () {\n throw webidl.errors.exception({\n header: 'TypeError',\n message: 'Illegal constructor'\n })\n}\n\n// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values\nwebidl.util.Type = function (V) {\n switch (typeof V) {\n case 'undefined': return 'Undefined'\n case 'boolean': return 'Boolean'\n case 'string': return 'String'\n case 'symbol': return 'Symbol'\n case 'number': return 'Number'\n case 'bigint': return 'BigInt'\n case 'function':\n case 'object': {\n if (V === null) {\n return 'Null'\n }\n\n return 'Object'\n }\n }\n}\n\nwebidl.util.markAsUncloneable = markAsUncloneable || (() => {})\n// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint\nwebidl.util.ConvertToInt = function (V, bitLength, signedness, opts) {\n let upperBound\n let lowerBound\n\n // 1. If bitLength is 64, then:\n if (bitLength === 64) {\n // 1. Let upperBound be 2^53 − 1.\n upperBound = Math.pow(2, 53) - 1\n\n // 2. If signedness is \"unsigned\", then let lowerBound be 0.\n if (signedness === 'unsigned') {\n lowerBound = 0\n } else {\n // 3. Otherwise let lowerBound be −2^53 + 1.\n lowerBound = Math.pow(-2, 53) + 1\n }\n } else if (signedness === 'unsigned') {\n // 2. Otherwise, if signedness is \"unsigned\", then:\n\n // 1. Let lowerBound be 0.\n lowerBound = 0\n\n // 2. Let upperBound be 2^bitLength − 1.\n upperBound = Math.pow(2, bitLength) - 1\n } else {\n // 3. Otherwise:\n\n // 1. Let lowerBound be -2^bitLength − 1.\n lowerBound = Math.pow(-2, bitLength) - 1\n\n // 2. Let upperBound be 2^bitLength − 1 − 1.\n upperBound = Math.pow(2, bitLength - 1) - 1\n }\n\n // 4. Let x be ? ToNumber(V).\n let x = Number(V)\n\n // 5. If x is −0, then set x to +0.\n if (x === 0) {\n x = 0\n }\n\n // 6. If the conversion is to an IDL type associated\n // with the [EnforceRange] extended attribute, then:\n if (opts?.enforceRange === true) {\n // 1. If x is NaN, +∞, or −∞, then throw a TypeError.\n if (\n Number.isNaN(x) ||\n x === Number.POSITIVE_INFINITY ||\n x === Number.NEGATIVE_INFINITY\n ) {\n throw webidl.errors.exception({\n header: 'Integer conversion',\n message: `Could not convert ${webidl.util.Stringify(V)} to an integer.`\n })\n }\n\n // 2. Set x to IntegerPart(x).\n x = webidl.util.IntegerPart(x)\n\n // 3. If x < lowerBound or x > upperBound, then\n // throw a TypeError.\n if (x < lowerBound || x > upperBound) {\n throw webidl.errors.exception({\n header: 'Integer conversion',\n message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`\n })\n }\n\n // 4. Return x.\n return x\n }\n\n // 7. If x is not NaN and the conversion is to an IDL\n // type associated with the [Clamp] extended\n // attribute, then:\n if (!Number.isNaN(x) && opts?.clamp === true) {\n // 1. Set x to min(max(x, lowerBound), upperBound).\n x = Math.min(Math.max(x, lowerBound), upperBound)\n\n // 2. Round x to the nearest integer, choosing the\n // even integer if it lies halfway between two,\n // and choosing +0 rather than −0.\n if (Math.floor(x) % 2 === 0) {\n x = Math.floor(x)\n } else {\n x = Math.ceil(x)\n }\n\n // 3. Return x.\n return x\n }\n\n // 8. If x is NaN, +0, +∞, or −∞, then return +0.\n if (\n Number.isNaN(x) ||\n (x === 0 && Object.is(0, x)) ||\n x === Number.POSITIVE_INFINITY ||\n x === Number.NEGATIVE_INFINITY\n ) {\n return 0\n }\n\n // 9. Set x to IntegerPart(x).\n x = webidl.util.IntegerPart(x)\n\n // 10. Set x to x modulo 2^bitLength.\n x = x % Math.pow(2, bitLength)\n\n // 11. If signedness is \"signed\" and x ≥ 2^bitLength − 1,\n // then return x − 2^bitLength.\n if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {\n return x - Math.pow(2, bitLength)\n }\n\n // 12. Otherwise, return x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart\nwebidl.util.IntegerPart = function (n) {\n // 1. Let r be floor(abs(n)).\n const r = Math.floor(Math.abs(n))\n\n // 2. If n < 0, then return -1 × r.\n if (n < 0) {\n return -1 * r\n }\n\n // 3. Otherwise, return r.\n return r\n}\n\nwebidl.util.Stringify = function (V) {\n const type = webidl.util.Type(V)\n\n switch (type) {\n case 'Symbol':\n return `Symbol(${V.description})`\n case 'Object':\n return inspect(V)\n case 'String':\n return `\"${V}\"`\n default:\n return `${V}`\n }\n}\n\n// https://webidl.spec.whatwg.org/#es-sequence\nwebidl.sequenceConverter = function (converter) {\n return (V, prefix, argument, Iterable) => {\n // 1. If Type(V) is not Object, throw a TypeError.\n if (webidl.util.Type(V) !== 'Object') {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} (${webidl.util.Stringify(V)}) is not iterable.`\n })\n }\n\n // 2. Let method be ? GetMethod(V, @@iterator).\n /** @type {Generator} */\n const method = typeof Iterable === 'function' ? Iterable() : V?.[Symbol.iterator]?.()\n const seq = []\n let index = 0\n\n // 3. If method is undefined, throw a TypeError.\n if (\n method === undefined ||\n typeof method.next !== 'function'\n ) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} is not iterable.`\n })\n }\n\n // https://webidl.spec.whatwg.org/#create-sequence-from-iterable\n while (true) {\n const { done, value } = method.next()\n\n if (done) {\n break\n }\n\n seq.push(converter(value, prefix, `${argument}[${index++}]`))\n }\n\n return seq\n }\n}\n\n// https://webidl.spec.whatwg.org/#es-to-record\nwebidl.recordConverter = function (keyConverter, valueConverter) {\n return (O, prefix, argument) => {\n // 1. If Type(O) is not Object, throw a TypeError.\n if (webidl.util.Type(O) !== 'Object') {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} (\"${webidl.util.Type(O)}\") is not an Object.`\n })\n }\n\n // 2. Let result be a new empty instance of record.\n const result = {}\n\n if (!types.isProxy(O)) {\n // 1. Let desc be ? O.[[GetOwnProperty]](key).\n const keys = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)]\n\n for (const key of keys) {\n // 1. Let typedKey be key converted to an IDL value of type K.\n const typedKey = keyConverter(key, prefix, argument)\n\n // 2. Let value be ? Get(O, key).\n // 3. Let typedValue be value converted to an IDL value of type V.\n const typedValue = valueConverter(O[key], prefix, argument)\n\n // 4. Set result[typedKey] to typedValue.\n result[typedKey] = typedValue\n }\n\n // 5. Return result.\n return result\n }\n\n // 3. Let keys be ? O.[[OwnPropertyKeys]]().\n const keys = Reflect.ownKeys(O)\n\n // 4. For each key of keys.\n for (const key of keys) {\n // 1. Let desc be ? O.[[GetOwnProperty]](key).\n const desc = Reflect.getOwnPropertyDescriptor(O, key)\n\n // 2. If desc is not undefined and desc.[[Enumerable]] is true:\n if (desc?.enumerable) {\n // 1. Let typedKey be key converted to an IDL value of type K.\n const typedKey = keyConverter(key, prefix, argument)\n\n // 2. Let value be ? Get(O, key).\n // 3. Let typedValue be value converted to an IDL value of type V.\n const typedValue = valueConverter(O[key], prefix, argument)\n\n // 4. Set result[typedKey] to typedValue.\n result[typedKey] = typedValue\n }\n }\n\n // 5. Return result.\n return result\n }\n}\n\nwebidl.interfaceConverter = function (i) {\n return (V, prefix, argument, opts) => {\n if (opts?.strict !== false && !(V instanceof i)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `Expected ${argument} (\"${webidl.util.Stringify(V)}\") to be an instance of ${i.name}.`\n })\n }\n\n return V\n }\n}\n\nwebidl.dictionaryConverter = function (converters) {\n return (dictionary, prefix, argument) => {\n const type = webidl.util.Type(dictionary)\n const dict = {}\n\n if (type === 'Null' || type === 'Undefined') {\n return dict\n } else if (type !== 'Object') {\n throw webidl.errors.exception({\n header: prefix,\n message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`\n })\n }\n\n for (const options of converters) {\n const { key, defaultValue, required, converter } = options\n\n if (required === true) {\n if (!Object.hasOwn(dictionary, key)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `Missing required key \"${key}\".`\n })\n }\n }\n\n let value = dictionary[key]\n const hasDefault = Object.hasOwn(options, 'defaultValue')\n\n // Only use defaultValue if value is undefined and\n // a defaultValue options was provided.\n if (hasDefault && value !== null) {\n value ??= defaultValue()\n }\n\n // A key can be optional and have no default value.\n // When this happens, do not perform a conversion,\n // and do not assign the key a value.\n if (required || hasDefault || value !== undefined) {\n value = converter(value, prefix, `${argument}.${key}`)\n\n if (\n options.allowedValues &&\n !options.allowedValues.includes(value)\n ) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`\n })\n }\n\n dict[key] = value\n }\n }\n\n return dict\n }\n}\n\nwebidl.nullableConverter = function (converter) {\n return (V, prefix, argument) => {\n if (V === null) {\n return V\n }\n\n return converter(V, prefix, argument)\n }\n}\n\n// https://webidl.spec.whatwg.org/#es-DOMString\nwebidl.converters.DOMString = function (V, prefix, argument, opts) {\n // 1. If V is null and the conversion is to an IDL type\n // associated with the [LegacyNullToEmptyString]\n // extended attribute, then return the DOMString value\n // that represents the empty string.\n if (V === null && opts?.legacyNullToEmptyString) {\n return ''\n }\n\n // 2. Let x be ? ToString(V).\n if (typeof V === 'symbol') {\n throw webidl.errors.exception({\n header: prefix,\n message: `${argument} is a symbol, which cannot be converted to a DOMString.`\n })\n }\n\n // 3. Return the IDL DOMString value that represents the\n // same sequence of code units as the one the\n // ECMAScript String value x represents.\n return String(V)\n}\n\n// https://webidl.spec.whatwg.org/#es-ByteString\nwebidl.converters.ByteString = function (V, prefix, argument) {\n // 1. Let x be ? ToString(V).\n // Note: DOMString converter perform ? ToString(V)\n const x = webidl.converters.DOMString(V, prefix, argument)\n\n // 2. If the value of any element of x is greater than\n // 255, then throw a TypeError.\n for (let index = 0; index < x.length; index++) {\n if (x.charCodeAt(index) > 255) {\n throw new TypeError(\n 'Cannot convert argument to a ByteString because the character at ' +\n `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`\n )\n }\n }\n\n // 3. Return an IDL ByteString value whose length is the\n // length of x, and where the value of each element is\n // the value of the corresponding element of x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-USVString\n// TODO: rewrite this so we can control the errors thrown\nwebidl.converters.USVString = toUSVString\n\n// https://webidl.spec.whatwg.org/#es-boolean\nwebidl.converters.boolean = function (V) {\n // 1. Let x be the result of computing ToBoolean(V).\n const x = Boolean(V)\n\n // 2. Return the IDL boolean value that is the one that represents\n // the same truth value as the ECMAScript Boolean value x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-any\nwebidl.converters.any = function (V) {\n return V\n}\n\n// https://webidl.spec.whatwg.org/#es-long-long\nwebidl.converters['long long'] = function (V, prefix, argument) {\n // 1. Let x be ? ConvertToInt(V, 64, \"signed\").\n const x = webidl.util.ConvertToInt(V, 64, 'signed', undefined, prefix, argument)\n\n // 2. Return the IDL long long value that represents\n // the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long-long\nwebidl.converters['unsigned long long'] = function (V, prefix, argument) {\n // 1. Let x be ? ConvertToInt(V, 64, \"unsigned\").\n const x = webidl.util.ConvertToInt(V, 64, 'unsigned', undefined, prefix, argument)\n\n // 2. Return the IDL unsigned long long value that\n // represents the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long\nwebidl.converters['unsigned long'] = function (V, prefix, argument) {\n // 1. Let x be ? ConvertToInt(V, 32, \"unsigned\").\n const x = webidl.util.ConvertToInt(V, 32, 'unsigned', undefined, prefix, argument)\n\n // 2. Return the IDL unsigned long value that\n // represents the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-short\nwebidl.converters['unsigned short'] = function (V, prefix, argument, opts) {\n // 1. Let x be ? ConvertToInt(V, 16, \"unsigned\").\n const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts, prefix, argument)\n\n // 2. Return the IDL unsigned short value that represents\n // the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#idl-ArrayBuffer\nwebidl.converters.ArrayBuffer = function (V, prefix, argument, opts) {\n // 1. If Type(V) is not Object, or V does not have an\n // [[ArrayBufferData]] internal slot, then throw a\n // TypeError.\n // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances\n // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances\n if (\n webidl.util.Type(V) !== 'Object' ||\n !types.isAnyArrayBuffer(V)\n ) {\n throw webidl.errors.conversionFailed({\n prefix,\n argument: `${argument} (\"${webidl.util.Stringify(V)}\")`,\n types: ['ArrayBuffer']\n })\n }\n\n // 2. If the conversion is not to an IDL type associated\n // with the [AllowShared] extended attribute, and\n // IsSharedArrayBuffer(V) is true, then throw a\n // TypeError.\n if (opts?.allowShared === false && types.isSharedArrayBuffer(V)) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'SharedArrayBuffer is not allowed.'\n })\n }\n\n // 3. If the conversion is not to an IDL type associated\n // with the [AllowResizable] extended attribute, and\n // IsResizableArrayBuffer(V) is true, then throw a\n // TypeError.\n if (V.resizable || V.growable) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'Received a resizable ArrayBuffer.'\n })\n }\n\n // 4. Return the IDL ArrayBuffer value that is a\n // reference to the same object as V.\n return V\n}\n\nwebidl.converters.TypedArray = function (V, T, prefix, name, opts) {\n // 1. Let T be the IDL type V is being converted to.\n\n // 2. If Type(V) is not Object, or V does not have a\n // [[TypedArrayName]] internal slot with a value\n // equal to T’s name, then throw a TypeError.\n if (\n webidl.util.Type(V) !== 'Object' ||\n !types.isTypedArray(V) ||\n V.constructor.name !== T.name\n ) {\n throw webidl.errors.conversionFailed({\n prefix,\n argument: `${name} (\"${webidl.util.Stringify(V)}\")`,\n types: [T.name]\n })\n }\n\n // 3. If the conversion is not to an IDL type associated\n // with the [AllowShared] extended attribute, and\n // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is\n // true, then throw a TypeError.\n if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'SharedArrayBuffer is not allowed.'\n })\n }\n\n // 4. If the conversion is not to an IDL type associated\n // with the [AllowResizable] extended attribute, and\n // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n // true, then throw a TypeError.\n if (V.buffer.resizable || V.buffer.growable) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'Received a resizable ArrayBuffer.'\n })\n }\n\n // 5. Return the IDL value of type T that is a reference\n // to the same object as V.\n return V\n}\n\nwebidl.converters.DataView = function (V, prefix, name, opts) {\n // 1. If Type(V) is not Object, or V does not have a\n // [[DataView]] internal slot, then throw a TypeError.\n if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {\n throw webidl.errors.exception({\n header: prefix,\n message: `${name} is not a DataView.`\n })\n }\n\n // 2. If the conversion is not to an IDL type associated\n // with the [AllowShared] extended attribute, and\n // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,\n // then throw a TypeError.\n if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'SharedArrayBuffer is not allowed.'\n })\n }\n\n // 3. If the conversion is not to an IDL type associated\n // with the [AllowResizable] extended attribute, and\n // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n // true, then throw a TypeError.\n if (V.buffer.resizable || V.buffer.growable) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'Received a resizable ArrayBuffer.'\n })\n }\n\n // 4. Return the IDL DataView value that is a reference\n // to the same object as V.\n return V\n}\n\n// https://webidl.spec.whatwg.org/#BufferSource\nwebidl.converters.BufferSource = function (V, prefix, name, opts) {\n if (types.isAnyArrayBuffer(V)) {\n return webidl.converters.ArrayBuffer(V, prefix, name, { ...opts, allowShared: false })\n }\n\n if (types.isTypedArray(V)) {\n return webidl.converters.TypedArray(V, V.constructor, prefix, name, { ...opts, allowShared: false })\n }\n\n if (types.isDataView(V)) {\n return webidl.converters.DataView(V, prefix, name, { ...opts, allowShared: false })\n }\n\n throw webidl.errors.conversionFailed({\n prefix,\n argument: `${name} (\"${webidl.util.Stringify(V)}\")`,\n types: ['BufferSource']\n })\n}\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.ByteString\n)\n\nwebidl.converters['sequence>'] = webidl.sequenceConverter(\n webidl.converters['sequence']\n)\n\nwebidl.converters['record'] = webidl.recordConverter(\n webidl.converters.ByteString,\n webidl.converters.ByteString\n)\n\nmodule.exports = {\n webidl\n}\n","'use strict'\n\nconst { Transform } = require('node:stream')\nconst zlib = require('node:zlib')\nconst { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require('./constants')\nconst { getGlobalOrigin } = require('./global')\nconst { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require('./data-url')\nconst { performance } = require('node:perf_hooks')\nconst { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require('../../core/util')\nconst assert = require('node:assert')\nconst { isUint8Array } = require('node:util/types')\nconst { webidl } = require('./webidl')\n\nlet supportedHashes = []\n\n// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable\n/** @type {import('crypto')} */\nlet crypto\ntry {\n crypto = require('node:crypto')\n const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']\n supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))\n/* c8 ignore next 3 */\n} catch {\n\n}\n\nfunction responseURL (response) {\n // https://fetch.spec.whatwg.org/#responses\n // A response has an associated URL. It is a pointer to the last URL\n // in response’s URL list and null if response’s URL list is empty.\n const urlList = response.urlList\n const length = urlList.length\n return length === 0 ? null : urlList[length - 1].toString()\n}\n\n// https://fetch.spec.whatwg.org/#concept-response-location-url\nfunction responseLocationURL (response, requestFragment) {\n // 1. If response’s status is not a redirect status, then return null.\n if (!redirectStatusSet.has(response.status)) {\n return null\n }\n\n // 2. Let location be the result of extracting header list values given\n // `Location` and response’s header list.\n let location = response.headersList.get('location', true)\n\n // 3. If location is a header value, then set location to the result of\n // parsing location with response’s URL.\n if (location !== null && isValidHeaderValue(location)) {\n if (!isValidEncodedURL(location)) {\n // Some websites respond location header in UTF-8 form without encoding them as ASCII\n // and major browsers redirect them to correctly UTF-8 encoded addresses.\n // Here, we handle that behavior in the same way.\n location = normalizeBinaryStringToUtf8(location)\n }\n location = new URL(location, responseURL(response))\n }\n\n // 4. If location is a URL whose fragment is null, then set location’s\n // fragment to requestFragment.\n if (location && !location.hash) {\n location.hash = requestFragment\n }\n\n // 5. Return location.\n return location\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc1738#section-2.2\n * @param {string} url\n * @returns {boolean}\n */\nfunction isValidEncodedURL (url) {\n for (let i = 0; i < url.length; ++i) {\n const code = url.charCodeAt(i)\n\n if (\n code > 0x7E || // Non-US-ASCII + DEL\n code < 0x20 // Control characters NUL - US\n ) {\n return false\n }\n }\n return true\n}\n\n/**\n * If string contains non-ASCII characters, assumes it's UTF-8 encoded and decodes it.\n * Since UTF-8 is a superset of ASCII, this will work for ASCII strings as well.\n * @param {string} value\n * @returns {string}\n */\nfunction normalizeBinaryStringToUtf8 (value) {\n return Buffer.from(value, 'binary').toString('utf8')\n}\n\n/** @returns {URL} */\nfunction requestCurrentURL (request) {\n return request.urlList[request.urlList.length - 1]\n}\n\nfunction requestBadPort (request) {\n // 1. Let url be request’s current URL.\n const url = requestCurrentURL(request)\n\n // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,\n // then return blocked.\n if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {\n return 'blocked'\n }\n\n // 3. Return allowed.\n return 'allowed'\n}\n\nfunction isErrorLike (object) {\n return object instanceof Error || (\n object?.constructor?.name === 'Error' ||\n object?.constructor?.name === 'DOMException'\n )\n}\n\n// Check whether |statusText| is a ByteString and\n// matches the Reason-Phrase token production.\n// RFC 2616: https://tools.ietf.org/html/rfc2616\n// RFC 7230: https://tools.ietf.org/html/rfc7230\n// \"reason-phrase = *( HTAB / SP / VCHAR / obs-text )\"\n// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116\nfunction isValidReasonPhrase (statusText) {\n for (let i = 0; i < statusText.length; ++i) {\n const c = statusText.charCodeAt(i)\n if (\n !(\n (\n c === 0x09 || // HTAB\n (c >= 0x20 && c <= 0x7e) || // SP / VCHAR\n (c >= 0x80 && c <= 0xff)\n ) // obs-text\n )\n ) {\n return false\n }\n }\n return true\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-name\n * @param {string} potentialValue\n */\nconst isValidHeaderName = isValidHTTPToken\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value\n * @param {string} potentialValue\n */\nfunction isValidHeaderValue (potentialValue) {\n // - Has no leading or trailing HTTP tab or space bytes.\n // - Contains no 0x00 (NUL) or HTTP newline bytes.\n return (\n potentialValue[0] === '\\t' ||\n potentialValue[0] === ' ' ||\n potentialValue[potentialValue.length - 1] === '\\t' ||\n potentialValue[potentialValue.length - 1] === ' ' ||\n potentialValue.includes('\\n') ||\n potentialValue.includes('\\r') ||\n potentialValue.includes('\\0')\n ) === false\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect\nfunction setRequestReferrerPolicyOnRedirect (request, actualResponse) {\n // Given a request request and a response actualResponse, this algorithm\n // updates request’s referrer policy according to the Referrer-Policy\n // header (if any) in actualResponse.\n\n // 1. Let policy be the result of executing § 8.1 Parse a referrer policy\n // from a Referrer-Policy header on actualResponse.\n\n // 8.1 Parse a referrer policy from a Referrer-Policy header\n // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.\n const { headersList } = actualResponse\n // 2. Let policy be the empty string.\n // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token.\n // 4. Return policy.\n const policyHeader = (headersList.get('referrer-policy', true) ?? '').split(',')\n\n // Note: As the referrer-policy can contain multiple policies\n // separated by comma, we need to loop through all of them\n // and pick the first valid one.\n // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy\n let policy = ''\n if (policyHeader.length > 0) {\n // The right-most policy takes precedence.\n // The left-most policy is the fallback.\n for (let i = policyHeader.length; i !== 0; i--) {\n const token = policyHeader[i - 1].trim()\n if (referrerPolicyTokens.has(token)) {\n policy = token\n break\n }\n }\n }\n\n // 2. If policy is not the empty string, then set request’s referrer policy to policy.\n if (policy !== '') {\n request.referrerPolicy = policy\n }\n}\n\n// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check\nfunction crossOriginResourcePolicyCheck () {\n // TODO\n return 'allowed'\n}\n\n// https://fetch.spec.whatwg.org/#concept-cors-check\nfunction corsCheck () {\n // TODO\n return 'success'\n}\n\n// https://fetch.spec.whatwg.org/#concept-tao-check\nfunction TAOCheck () {\n // TODO\n return 'success'\n}\n\nfunction appendFetchMetadata (httpRequest) {\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header\n // TODO\n\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header\n\n // 1. Assert: r’s url is a potentially trustworthy URL.\n // TODO\n\n // 2. Let header be a Structured Header whose value is a token.\n let header = null\n\n // 3. Set header’s value to r’s mode.\n header = httpRequest.mode\n\n // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.\n httpRequest.headersList.set('sec-fetch-mode', header, true)\n\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header\n // TODO\n\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header\n // TODO\n}\n\n// https://fetch.spec.whatwg.org/#append-a-request-origin-header\nfunction appendRequestOriginHeader (request) {\n // 1. Let serializedOrigin be the result of byte-serializing a request origin\n // with request.\n // TODO: implement \"byte-serializing a request origin\"\n let serializedOrigin = request.origin\n\n // - \"'client' is changed to an origin during fetching.\"\n // This doesn't happen in undici (in most cases) because undici, by default,\n // has no concept of origin.\n // - request.origin can also be set to request.client.origin (client being\n // an environment settings object), which is undefined without using\n // setGlobalOrigin.\n if (serializedOrigin === 'client' || serializedOrigin === undefined) {\n return\n }\n\n // 2. If request’s response tainting is \"cors\" or request’s mode is \"websocket\",\n // then append (`Origin`, serializedOrigin) to request’s header list.\n // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:\n if (request.responseTainting === 'cors' || request.mode === 'websocket') {\n request.headersList.append('origin', serializedOrigin, true)\n } else if (request.method !== 'GET' && request.method !== 'HEAD') {\n // 1. Switch on request’s referrer policy:\n switch (request.referrerPolicy) {\n case 'no-referrer':\n // Set serializedOrigin to `null`.\n serializedOrigin = null\n break\n case 'no-referrer-when-downgrade':\n case 'strict-origin':\n case 'strict-origin-when-cross-origin':\n // If request’s origin is a tuple origin, its scheme is \"https\", and\n // request’s current URL’s scheme is not \"https\", then set\n // serializedOrigin to `null`.\n if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {\n serializedOrigin = null\n }\n break\n case 'same-origin':\n // If request’s origin is not same origin with request’s current URL’s\n // origin, then set serializedOrigin to `null`.\n if (!sameOrigin(request, requestCurrentURL(request))) {\n serializedOrigin = null\n }\n break\n default:\n // Do nothing.\n }\n\n // 2. Append (`Origin`, serializedOrigin) to request’s header list.\n request.headersList.append('origin', serializedOrigin, true)\n }\n}\n\n// https://w3c.github.io/hr-time/#dfn-coarsen-time\nfunction coarsenTime (timestamp, crossOriginIsolatedCapability) {\n // TODO\n return timestamp\n}\n\n// https://fetch.spec.whatwg.org/#clamp-and-coarsen-connection-timing-info\nfunction clampAndCoarsenConnectionTimingInfo (connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) {\n if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) {\n return {\n domainLookupStartTime: defaultStartTime,\n domainLookupEndTime: defaultStartTime,\n connectionStartTime: defaultStartTime,\n connectionEndTime: defaultStartTime,\n secureConnectionStartTime: defaultStartTime,\n ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol\n }\n }\n\n return {\n domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability),\n domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability),\n connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability),\n connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability),\n secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability),\n ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol\n }\n}\n\n// https://w3c.github.io/hr-time/#dfn-coarsened-shared-current-time\nfunction coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {\n return coarsenTime(performance.now(), crossOriginIsolatedCapability)\n}\n\n// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info\nfunction createOpaqueTimingInfo (timingInfo) {\n return {\n startTime: timingInfo.startTime ?? 0,\n redirectStartTime: 0,\n redirectEndTime: 0,\n postRedirectStartTime: timingInfo.startTime ?? 0,\n finalServiceWorkerStartTime: 0,\n finalNetworkResponseStartTime: 0,\n finalNetworkRequestStartTime: 0,\n endTime: 0,\n encodedBodySize: 0,\n decodedBodySize: 0,\n finalConnectionTimingInfo: null\n }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#policy-container\nfunction makePolicyContainer () {\n // Note: the fetch spec doesn't make use of embedder policy or CSP list\n return {\n referrerPolicy: 'strict-origin-when-cross-origin'\n }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container\nfunction clonePolicyContainer (policyContainer) {\n return {\n referrerPolicy: policyContainer.referrerPolicy\n }\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer\nfunction determineRequestsReferrer (request) {\n // 1. Let policy be request's referrer policy.\n const policy = request.referrerPolicy\n\n // Note: policy cannot (shouldn't) be null or an empty string.\n assert(policy)\n\n // 2. Let environment be request’s client.\n\n let referrerSource = null\n\n // 3. Switch on request’s referrer:\n if (request.referrer === 'client') {\n // Note: node isn't a browser and doesn't implement document/iframes,\n // so we bypass this step and replace it with our own.\n\n const globalOrigin = getGlobalOrigin()\n\n if (!globalOrigin || globalOrigin.origin === 'null') {\n return 'no-referrer'\n }\n\n // note: we need to clone it as it's mutated\n referrerSource = new URL(globalOrigin)\n } else if (request.referrer instanceof URL) {\n // Let referrerSource be request’s referrer.\n referrerSource = request.referrer\n }\n\n // 4. Let request’s referrerURL be the result of stripping referrerSource for\n // use as a referrer.\n let referrerURL = stripURLForReferrer(referrerSource)\n\n // 5. Let referrerOrigin be the result of stripping referrerSource for use as\n // a referrer, with the origin-only flag set to true.\n const referrerOrigin = stripURLForReferrer(referrerSource, true)\n\n // 6. If the result of serializing referrerURL is a string whose length is\n // greater than 4096, set referrerURL to referrerOrigin.\n if (referrerURL.toString().length > 4096) {\n referrerURL = referrerOrigin\n }\n\n const areSameOrigin = sameOrigin(request, referrerURL)\n const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&\n !isURLPotentiallyTrustworthy(request.url)\n\n // 8. Execute the switch statements corresponding to the value of policy:\n switch (policy) {\n case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)\n case 'unsafe-url': return referrerURL\n case 'same-origin':\n return areSameOrigin ? referrerOrigin : 'no-referrer'\n case 'origin-when-cross-origin':\n return areSameOrigin ? referrerURL : referrerOrigin\n case 'strict-origin-when-cross-origin': {\n const currentURL = requestCurrentURL(request)\n\n // 1. If the origin of referrerURL and the origin of request’s current\n // URL are the same, then return referrerURL.\n if (sameOrigin(referrerURL, currentURL)) {\n return referrerURL\n }\n\n // 2. If referrerURL is a potentially trustworthy URL and request’s\n // current URL is not a potentially trustworthy URL, then return no\n // referrer.\n if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {\n return 'no-referrer'\n }\n\n // 3. Return referrerOrigin.\n return referrerOrigin\n }\n case 'strict-origin': // eslint-disable-line\n /**\n * 1. If referrerURL is a potentially trustworthy URL and\n * request’s current URL is not a potentially trustworthy URL,\n * then return no referrer.\n * 2. Return referrerOrigin\n */\n case 'no-referrer-when-downgrade': // eslint-disable-line\n /**\n * 1. If referrerURL is a potentially trustworthy URL and\n * request’s current URL is not a potentially trustworthy URL,\n * then return no referrer.\n * 2. Return referrerOrigin\n */\n\n default: // eslint-disable-line\n return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin\n }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url\n * @param {URL} url\n * @param {boolean|undefined} originOnly\n */\nfunction stripURLForReferrer (url, originOnly) {\n // 1. Assert: url is a URL.\n assert(url instanceof URL)\n\n url = new URL(url)\n\n // 2. If url’s scheme is a local scheme, then return no referrer.\n if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {\n return 'no-referrer'\n }\n\n // 3. Set url’s username to the empty string.\n url.username = ''\n\n // 4. Set url’s password to the empty string.\n url.password = ''\n\n // 5. Set url’s fragment to null.\n url.hash = ''\n\n // 6. If the origin-only flag is true, then:\n if (originOnly) {\n // 1. Set url’s path to « the empty string ».\n url.pathname = ''\n\n // 2. Set url’s query to null.\n url.search = ''\n }\n\n // 7. Return url.\n return url\n}\n\nfunction isURLPotentiallyTrustworthy (url) {\n if (!(url instanceof URL)) {\n return false\n }\n\n // If child of about, return true\n if (url.href === 'about:blank' || url.href === 'about:srcdoc') {\n return true\n }\n\n // If scheme is data, return true\n if (url.protocol === 'data:') return true\n\n // If file, return true\n if (url.protocol === 'file:') return true\n\n return isOriginPotentiallyTrustworthy(url.origin)\n\n function isOriginPotentiallyTrustworthy (origin) {\n // If origin is explicitly null, return false\n if (origin == null || origin === 'null') return false\n\n const originAsURL = new URL(origin)\n\n // If secure, return true\n if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {\n return true\n }\n\n // If localhost or variants, return true\n if (/^127(?:\\.[0-9]+){0,2}\\.[0-9]+$|^\\[(?:0*:)*?:?0*1\\]$/.test(originAsURL.hostname) ||\n (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||\n (originAsURL.hostname.endsWith('.localhost'))) {\n return true\n }\n\n // If any other, return false\n return false\n }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist\n * @param {Uint8Array} bytes\n * @param {string} metadataList\n */\nfunction bytesMatch (bytes, metadataList) {\n // If node is not built with OpenSSL support, we cannot check\n // a request's integrity, so allow it by default (the spec will\n // allow requests if an invalid hash is given, as precedence).\n /* istanbul ignore if: only if node is built with --without-ssl */\n if (crypto === undefined) {\n return true\n }\n\n // 1. Let parsedMetadata be the result of parsing metadataList.\n const parsedMetadata = parseMetadata(metadataList)\n\n // 2. If parsedMetadata is no metadata, return true.\n if (parsedMetadata === 'no metadata') {\n return true\n }\n\n // 3. If response is not eligible for integrity validation, return false.\n // TODO\n\n // 4. If parsedMetadata is the empty set, return true.\n if (parsedMetadata.length === 0) {\n return true\n }\n\n // 5. Let metadata be the result of getting the strongest\n // metadata from parsedMetadata.\n const strongest = getStrongestMetadata(parsedMetadata)\n const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)\n\n // 6. For each item in metadata:\n for (const item of metadata) {\n // 1. Let algorithm be the alg component of item.\n const algorithm = item.algo\n\n // 2. Let expectedValue be the val component of item.\n const expectedValue = item.hash\n\n // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e\n // \"be liberal with padding\". This is annoying, and it's not even in the spec.\n\n // 3. Let actualValue be the result of applying algorithm to bytes.\n let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')\n\n if (actualValue[actualValue.length - 1] === '=') {\n if (actualValue[actualValue.length - 2] === '=') {\n actualValue = actualValue.slice(0, -2)\n } else {\n actualValue = actualValue.slice(0, -1)\n }\n }\n\n // 4. If actualValue is a case-sensitive match for expectedValue,\n // return true.\n if (compareBase64Mixed(actualValue, expectedValue)) {\n return true\n }\n }\n\n // 7. Return false.\n return false\n}\n\n// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options\n// https://www.w3.org/TR/CSP2/#source-list-syntax\n// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1\nconst parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\\s|$)( +[!-~]*)?)?/i\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata\n * @param {string} metadata\n */\nfunction parseMetadata (metadata) {\n // 1. Let result be the empty set.\n /** @type {{ algo: string, hash: string }[]} */\n const result = []\n\n // 2. Let empty be equal to true.\n let empty = true\n\n // 3. For each token returned by splitting metadata on spaces:\n for (const token of metadata.split(' ')) {\n // 1. Set empty to false.\n empty = false\n\n // 2. Parse token as a hash-with-options.\n const parsedToken = parseHashWithOptions.exec(token)\n\n // 3. If token does not parse, continue to the next token.\n if (\n parsedToken === null ||\n parsedToken.groups === undefined ||\n parsedToken.groups.algo === undefined\n ) {\n // Note: Chromium blocks the request at this point, but Firefox\n // gives a warning that an invalid integrity was given. The\n // correct behavior is to ignore these, and subsequently not\n // check the integrity of the resource.\n continue\n }\n\n // 4. Let algorithm be the hash-algo component of token.\n const algorithm = parsedToken.groups.algo.toLowerCase()\n\n // 5. If algorithm is a hash function recognized by the user\n // agent, add the parsed token to result.\n if (supportedHashes.includes(algorithm)) {\n result.push(parsedToken.groups)\n }\n }\n\n // 4. Return no metadata if empty is true, otherwise return result.\n if (empty === true) {\n return 'no metadata'\n }\n\n return result\n}\n\n/**\n * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList\n */\nfunction getStrongestMetadata (metadataList) {\n // Let algorithm be the algo component of the first item in metadataList.\n // Can be sha256\n let algorithm = metadataList[0].algo\n // If the algorithm is sha512, then it is the strongest\n // and we can return immediately\n if (algorithm[3] === '5') {\n return algorithm\n }\n\n for (let i = 1; i < metadataList.length; ++i) {\n const metadata = metadataList[i]\n // If the algorithm is sha512, then it is the strongest\n // and we can break the loop immediately\n if (metadata.algo[3] === '5') {\n algorithm = 'sha512'\n break\n // If the algorithm is sha384, then a potential sha256 or sha384 is ignored\n } else if (algorithm[3] === '3') {\n continue\n // algorithm is sha256, check if algorithm is sha384 and if so, set it as\n // the strongest\n } else if (metadata.algo[3] === '3') {\n algorithm = 'sha384'\n }\n }\n return algorithm\n}\n\nfunction filterMetadataListByAlgorithm (metadataList, algorithm) {\n if (metadataList.length === 1) {\n return metadataList\n }\n\n let pos = 0\n for (let i = 0; i < metadataList.length; ++i) {\n if (metadataList[i].algo === algorithm) {\n metadataList[pos++] = metadataList[i]\n }\n }\n\n metadataList.length = pos\n\n return metadataList\n}\n\n/**\n * Compares two base64 strings, allowing for base64url\n * in the second string.\n *\n* @param {string} actualValue always base64\n * @param {string} expectedValue base64 or base64url\n * @returns {boolean}\n */\nfunction compareBase64Mixed (actualValue, expectedValue) {\n if (actualValue.length !== expectedValue.length) {\n return false\n }\n for (let i = 0; i < actualValue.length; ++i) {\n if (actualValue[i] !== expectedValue[i]) {\n if (\n (actualValue[i] === '+' && expectedValue[i] === '-') ||\n (actualValue[i] === '/' && expectedValue[i] === '_')\n ) {\n continue\n }\n return false\n }\n }\n\n return true\n}\n\n// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request\nfunction tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {\n // TODO\n}\n\n/**\n * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}\n * @param {URL} A\n * @param {URL} B\n */\nfunction sameOrigin (A, B) {\n // 1. If A and B are the same opaque origin, then return true.\n if (A.origin === B.origin && A.origin === 'null') {\n return true\n }\n\n // 2. If A and B are both tuple origins and their schemes,\n // hosts, and port are identical, then return true.\n if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {\n return true\n }\n\n // 3. Return false.\n return false\n}\n\nfunction createDeferredPromise () {\n let res\n let rej\n const promise = new Promise((resolve, reject) => {\n res = resolve\n rej = reject\n })\n\n return { promise, resolve: res, reject: rej }\n}\n\nfunction isAborted (fetchParams) {\n return fetchParams.controller.state === 'aborted'\n}\n\nfunction isCancelled (fetchParams) {\n return fetchParams.controller.state === 'aborted' ||\n fetchParams.controller.state === 'terminated'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-method-normalize\n * @param {string} method\n */\nfunction normalizeMethod (method) {\n return normalizedMethodRecordsBase[method.toLowerCase()] ?? method\n}\n\n// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string\nfunction serializeJavascriptValueToJSONString (value) {\n // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).\n const result = JSON.stringify(value)\n\n // 2. If result is undefined, then throw a TypeError.\n if (result === undefined) {\n throw new TypeError('Value is not JSON serializable')\n }\n\n // 3. Assert: result is a string.\n assert(typeof result === 'string')\n\n // 4. Return result.\n return result\n}\n\n// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object\nconst esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {string} name name of the instance\n * @param {symbol} kInternalIterator\n * @param {string | number} [keyIndex]\n * @param {string | number} [valueIndex]\n */\nfunction createIterator (name, kInternalIterator, keyIndex = 0, valueIndex = 1) {\n class FastIterableIterator {\n /** @type {any} */\n #target\n /** @type {'key' | 'value' | 'key+value'} */\n #kind\n /** @type {number} */\n #index\n\n /**\n * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object\n * @param {unknown} target\n * @param {'key' | 'value' | 'key+value'} kind\n */\n constructor (target, kind) {\n this.#target = target\n this.#kind = kind\n this.#index = 0\n }\n\n next () {\n // 1. Let interface be the interface for which the iterator prototype object exists.\n // 2. Let thisValue be the this value.\n // 3. Let object be ? ToObject(thisValue).\n // 4. If object is a platform object, then perform a security\n // check, passing:\n // 5. If object is not a default iterator object for interface,\n // then throw a TypeError.\n if (typeof this !== 'object' || this === null || !(#target in this)) {\n throw new TypeError(\n `'next' called on an object that does not implement interface ${name} Iterator.`\n )\n }\n\n // 6. Let index be object’s index.\n // 7. Let kind be object’s kind.\n // 8. Let values be object’s target's value pairs to iterate over.\n const index = this.#index\n const values = this.#target[kInternalIterator]\n\n // 9. Let len be the length of values.\n const len = values.length\n\n // 10. If index is greater than or equal to len, then return\n // CreateIterResultObject(undefined, true).\n if (index >= len) {\n return {\n value: undefined,\n done: true\n }\n }\n\n // 11. Let pair be the entry in values at index index.\n const { [keyIndex]: key, [valueIndex]: value } = values[index]\n\n // 12. Set object’s index to index + 1.\n this.#index = index + 1\n\n // 13. Return the iterator result for pair and kind.\n\n // https://webidl.spec.whatwg.org/#iterator-result\n\n // 1. Let result be a value determined by the value of kind:\n let result\n switch (this.#kind) {\n case 'key':\n // 1. Let idlKey be pair’s key.\n // 2. Let key be the result of converting idlKey to an\n // ECMAScript value.\n // 3. result is key.\n result = key\n break\n case 'value':\n // 1. Let idlValue be pair’s value.\n // 2. Let value be the result of converting idlValue to\n // an ECMAScript value.\n // 3. result is value.\n result = value\n break\n case 'key+value':\n // 1. Let idlKey be pair’s key.\n // 2. Let idlValue be pair’s value.\n // 3. Let key be the result of converting idlKey to an\n // ECMAScript value.\n // 4. Let value be the result of converting idlValue to\n // an ECMAScript value.\n // 5. Let array be ! ArrayCreate(2).\n // 6. Call ! CreateDataProperty(array, \"0\", key).\n // 7. Call ! CreateDataProperty(array, \"1\", value).\n // 8. result is array.\n result = [key, value]\n break\n }\n\n // 2. Return CreateIterResultObject(result, false).\n return {\n value: result,\n done: false\n }\n }\n }\n\n // https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n // @ts-ignore\n delete FastIterableIterator.prototype.constructor\n\n Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype)\n\n Object.defineProperties(FastIterableIterator.prototype, {\n [Symbol.toStringTag]: {\n writable: false,\n enumerable: false,\n configurable: true,\n value: `${name} Iterator`\n },\n next: { writable: true, enumerable: true, configurable: true }\n })\n\n /**\n * @param {unknown} target\n * @param {'key' | 'value' | 'key+value'} kind\n * @returns {IterableIterator}\n */\n return function (target, kind) {\n return new FastIterableIterator(target, kind)\n }\n}\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {string} name name of the instance\n * @param {any} object class\n * @param {symbol} kInternalIterator\n * @param {string | number} [keyIndex]\n * @param {string | number} [valueIndex]\n */\nfunction iteratorMixin (name, object, kInternalIterator, keyIndex = 0, valueIndex = 1) {\n const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex)\n\n const properties = {\n keys: {\n writable: true,\n enumerable: true,\n configurable: true,\n value: function keys () {\n webidl.brandCheck(this, object)\n return makeIterator(this, 'key')\n }\n },\n values: {\n writable: true,\n enumerable: true,\n configurable: true,\n value: function values () {\n webidl.brandCheck(this, object)\n return makeIterator(this, 'value')\n }\n },\n entries: {\n writable: true,\n enumerable: true,\n configurable: true,\n value: function entries () {\n webidl.brandCheck(this, object)\n return makeIterator(this, 'key+value')\n }\n },\n forEach: {\n writable: true,\n enumerable: true,\n configurable: true,\n value: function forEach (callbackfn, thisArg = globalThis) {\n webidl.brandCheck(this, object)\n webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`)\n if (typeof callbackfn !== 'function') {\n throw new TypeError(\n `Failed to execute 'forEach' on '${name}': parameter 1 is not of type 'Function'.`\n )\n }\n for (const { 0: key, 1: value } of makeIterator(this, 'key+value')) {\n callbackfn.call(thisArg, value, key, this)\n }\n }\n }\n }\n\n return Object.defineProperties(object.prototype, {\n ...properties,\n [Symbol.iterator]: {\n writable: true,\n enumerable: false,\n configurable: true,\n value: properties.entries.value\n }\n })\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#body-fully-read\n */\nasync function fullyReadBody (body, processBody, processBodyError) {\n // 1. If taskDestination is null, then set taskDestination to\n // the result of starting a new parallel queue.\n\n // 2. Let successSteps given a byte sequence bytes be to queue a\n // fetch task to run processBody given bytes, with taskDestination.\n const successSteps = processBody\n\n // 3. Let errorSteps be to queue a fetch task to run processBodyError,\n // with taskDestination.\n const errorSteps = processBodyError\n\n // 4. Let reader be the result of getting a reader for body’s stream.\n // If that threw an exception, then run errorSteps with that\n // exception and return.\n let reader\n\n try {\n reader = body.stream.getReader()\n } catch (e) {\n errorSteps(e)\n return\n }\n\n // 5. Read all bytes from reader, given successSteps and errorSteps.\n try {\n successSteps(await readAllBytes(reader))\n } catch (e) {\n errorSteps(e)\n }\n}\n\nfunction isReadableStreamLike (stream) {\n return stream instanceof ReadableStream || (\n stream[Symbol.toStringTag] === 'ReadableStream' &&\n typeof stream.tee === 'function'\n )\n}\n\n/**\n * @param {ReadableStreamController} controller\n */\nfunction readableStreamClose (controller) {\n try {\n controller.close()\n controller.byobRequest?.respond(0)\n } catch (err) {\n // TODO: add comment explaining why this error occurs.\n if (!err.message.includes('Controller is already closed') && !err.message.includes('ReadableStream is already closed')) {\n throw err\n }\n }\n}\n\nconst invalidIsomorphicEncodeValueRegex = /[^\\x00-\\xFF]/ // eslint-disable-line\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-encode\n * @param {string} input\n */\nfunction isomorphicEncode (input) {\n // 1. Assert: input contains no code points greater than U+00FF.\n assert(!invalidIsomorphicEncodeValueRegex.test(input))\n\n // 2. Return a byte sequence whose length is equal to input’s code\n // point length and whose bytes have the same values as the\n // values of input’s code points, in the same order\n return input\n}\n\n/**\n * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes\n * @see https://streams.spec.whatwg.org/#read-loop\n * @param {ReadableStreamDefaultReader} reader\n */\nasync function readAllBytes (reader) {\n const bytes = []\n let byteLength = 0\n\n while (true) {\n const { done, value: chunk } = await reader.read()\n\n if (done) {\n // 1. Call successSteps with bytes.\n return Buffer.concat(bytes, byteLength)\n }\n\n // 1. If chunk is not a Uint8Array object, call failureSteps\n // with a TypeError and abort these steps.\n if (!isUint8Array(chunk)) {\n throw new TypeError('Received non-Uint8Array chunk')\n }\n\n // 2. Append the bytes represented by chunk to bytes.\n bytes.push(chunk)\n byteLength += chunk.length\n\n // 3. Read-loop given reader, bytes, successSteps, and failureSteps.\n }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#is-local\n * @param {URL} url\n */\nfunction urlIsLocal (url) {\n assert('protocol' in url) // ensure it's a url object\n\n const protocol = url.protocol\n\n return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'\n}\n\n/**\n * @param {string|URL} url\n * @returns {boolean}\n */\nfunction urlHasHttpsScheme (url) {\n return (\n (\n typeof url === 'string' &&\n url[5] === ':' &&\n url[0] === 'h' &&\n url[1] === 't' &&\n url[2] === 't' &&\n url[3] === 'p' &&\n url[4] === 's'\n ) ||\n url.protocol === 'https:'\n )\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-scheme\n * @param {URL} url\n */\nfunction urlIsHttpHttpsScheme (url) {\n assert('protocol' in url) // ensure it's a url object\n\n const protocol = url.protocol\n\n return protocol === 'http:' || protocol === 'https:'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#simple-range-header-value\n * @param {string} value\n * @param {boolean} allowWhitespace\n */\nfunction simpleRangeHeaderValue (value, allowWhitespace) {\n // 1. Let data be the isomorphic decoding of value.\n // Note: isomorphic decoding takes a sequence of bytes (ie. a Uint8Array) and turns it into a string,\n // nothing more. We obviously don't need to do that if value is a string already.\n const data = value\n\n // 2. If data does not start with \"bytes\", then return failure.\n if (!data.startsWith('bytes')) {\n return 'failure'\n }\n\n // 3. Let position be a position variable for data, initially pointing at the 5th code point of data.\n const position = { position: 5 }\n\n // 4. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,\n // from data given position.\n if (allowWhitespace) {\n collectASequenceOfCodePoints(\n (char) => char === '\\t' || char === ' ',\n data,\n position\n )\n }\n\n // 5. If the code point at position within data is not U+003D (=), then return failure.\n if (data.charCodeAt(position.position) !== 0x3D) {\n return 'failure'\n }\n\n // 6. Advance position by 1.\n position.position++\n\n // 7. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space, from\n // data given position.\n if (allowWhitespace) {\n collectASequenceOfCodePoints(\n (char) => char === '\\t' || char === ' ',\n data,\n position\n )\n }\n\n // 8. Let rangeStart be the result of collecting a sequence of code points that are ASCII digits,\n // from data given position.\n const rangeStart = collectASequenceOfCodePoints(\n (char) => {\n const code = char.charCodeAt(0)\n\n return code >= 0x30 && code <= 0x39\n },\n data,\n position\n )\n\n // 9. Let rangeStartValue be rangeStart, interpreted as decimal number, if rangeStart is not the\n // empty string; otherwise null.\n const rangeStartValue = rangeStart.length ? Number(rangeStart) : null\n\n // 10. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,\n // from data given position.\n if (allowWhitespace) {\n collectASequenceOfCodePoints(\n (char) => char === '\\t' || char === ' ',\n data,\n position\n )\n }\n\n // 11. If the code point at position within data is not U+002D (-), then return failure.\n if (data.charCodeAt(position.position) !== 0x2D) {\n return 'failure'\n }\n\n // 12. Advance position by 1.\n position.position++\n\n // 13. If allowWhitespace is true, collect a sequence of code points that are HTTP tab\n // or space, from data given position.\n // Note from Khafra: its the same step as in #8 again lol\n if (allowWhitespace) {\n collectASequenceOfCodePoints(\n (char) => char === '\\t' || char === ' ',\n data,\n position\n )\n }\n\n // 14. Let rangeEnd be the result of collecting a sequence of code points that are\n // ASCII digits, from data given position.\n // Note from Khafra: you wouldn't guess it, but this is also the same step as #8\n const rangeEnd = collectASequenceOfCodePoints(\n (char) => {\n const code = char.charCodeAt(0)\n\n return code >= 0x30 && code <= 0x39\n },\n data,\n position\n )\n\n // 15. Let rangeEndValue be rangeEnd, interpreted as decimal number, if rangeEnd\n // is not the empty string; otherwise null.\n // Note from Khafra: THE SAME STEP, AGAIN!!!\n // Note: why interpret as a decimal if we only collect ascii digits?\n const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null\n\n // 16. If position is not past the end of data, then return failure.\n if (position.position < data.length) {\n return 'failure'\n }\n\n // 17. If rangeEndValue and rangeStartValue are null, then return failure.\n if (rangeEndValue === null && rangeStartValue === null) {\n return 'failure'\n }\n\n // 18. If rangeStartValue and rangeEndValue are numbers, and rangeStartValue is\n // greater than rangeEndValue, then return failure.\n // Note: ... when can they not be numbers?\n if (rangeStartValue > rangeEndValue) {\n return 'failure'\n }\n\n // 19. Return (rangeStartValue, rangeEndValue).\n return { rangeStartValue, rangeEndValue }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#build-a-content-range\n * @param {number} rangeStart\n * @param {number} rangeEnd\n * @param {number} fullLength\n */\nfunction buildContentRange (rangeStart, rangeEnd, fullLength) {\n // 1. Let contentRange be `bytes `.\n let contentRange = 'bytes '\n\n // 2. Append rangeStart, serialized and isomorphic encoded, to contentRange.\n contentRange += isomorphicEncode(`${rangeStart}`)\n\n // 3. Append 0x2D (-) to contentRange.\n contentRange += '-'\n\n // 4. Append rangeEnd, serialized and isomorphic encoded to contentRange.\n contentRange += isomorphicEncode(`${rangeEnd}`)\n\n // 5. Append 0x2F (/) to contentRange.\n contentRange += '/'\n\n // 6. Append fullLength, serialized and isomorphic encoded to contentRange.\n contentRange += isomorphicEncode(`${fullLength}`)\n\n // 7. Return contentRange.\n return contentRange\n}\n\n// A Stream, which pipes the response to zlib.createInflate() or\n// zlib.createInflateRaw() depending on the first byte of the Buffer.\n// If the lower byte of the first byte is 0x08, then the stream is\n// interpreted as a zlib stream, otherwise it's interpreted as a\n// raw deflate stream.\nclass InflateStream extends Transform {\n #zlibOptions\n\n /** @param {zlib.ZlibOptions} [zlibOptions] */\n constructor (zlibOptions) {\n super()\n this.#zlibOptions = zlibOptions\n }\n\n _transform (chunk, encoding, callback) {\n if (!this._inflateStream) {\n if (chunk.length === 0) {\n callback()\n return\n }\n this._inflateStream = (chunk[0] & 0x0F) === 0x08\n ? zlib.createInflate(this.#zlibOptions)\n : zlib.createInflateRaw(this.#zlibOptions)\n\n this._inflateStream.on('data', this.push.bind(this))\n this._inflateStream.on('end', () => this.push(null))\n this._inflateStream.on('error', (err) => this.destroy(err))\n }\n\n this._inflateStream.write(chunk, encoding, callback)\n }\n\n _final (callback) {\n if (this._inflateStream) {\n this._inflateStream.end()\n this._inflateStream = null\n }\n callback()\n }\n}\n\n/**\n * @param {zlib.ZlibOptions} [zlibOptions]\n * @returns {InflateStream}\n */\nfunction createInflate (zlibOptions) {\n return new InflateStream(zlibOptions)\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-extract-mime-type\n * @param {import('./headers').HeadersList} headers\n */\nfunction extractMimeType (headers) {\n // 1. Let charset be null.\n let charset = null\n\n // 2. Let essence be null.\n let essence = null\n\n // 3. Let mimeType be null.\n let mimeType = null\n\n // 4. Let values be the result of getting, decoding, and splitting `Content-Type` from headers.\n const values = getDecodeSplit('content-type', headers)\n\n // 5. If values is null, then return failure.\n if (values === null) {\n return 'failure'\n }\n\n // 6. For each value of values:\n for (const value of values) {\n // 6.1. Let temporaryMimeType be the result of parsing value.\n const temporaryMimeType = parseMIMEType(value)\n\n // 6.2. If temporaryMimeType is failure or its essence is \"*/*\", then continue.\n if (temporaryMimeType === 'failure' || temporaryMimeType.essence === '*/*') {\n continue\n }\n\n // 6.3. Set mimeType to temporaryMimeType.\n mimeType = temporaryMimeType\n\n // 6.4. If mimeType’s essence is not essence, then:\n if (mimeType.essence !== essence) {\n // 6.4.1. Set charset to null.\n charset = null\n\n // 6.4.2. If mimeType’s parameters[\"charset\"] exists, then set charset to\n // mimeType’s parameters[\"charset\"].\n if (mimeType.parameters.has('charset')) {\n charset = mimeType.parameters.get('charset')\n }\n\n // 6.4.3. Set essence to mimeType’s essence.\n essence = mimeType.essence\n } else if (!mimeType.parameters.has('charset') && charset !== null) {\n // 6.5. Otherwise, if mimeType’s parameters[\"charset\"] does not exist, and\n // charset is non-null, set mimeType’s parameters[\"charset\"] to charset.\n mimeType.parameters.set('charset', charset)\n }\n }\n\n // 7. If mimeType is null, then return failure.\n if (mimeType == null) {\n return 'failure'\n }\n\n // 8. Return mimeType.\n return mimeType\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value-get-decode-and-split\n * @param {string|null} value\n */\nfunction gettingDecodingSplitting (value) {\n // 1. Let input be the result of isomorphic decoding value.\n const input = value\n\n // 2. Let position be a position variable for input, initially pointing at the start of input.\n const position = { position: 0 }\n\n // 3. Let values be a list of strings, initially empty.\n const values = []\n\n // 4. Let temporaryValue be the empty string.\n let temporaryValue = ''\n\n // 5. While position is not past the end of input:\n while (position.position < input.length) {\n // 5.1. Append the result of collecting a sequence of code points that are not U+0022 (\")\n // or U+002C (,) from input, given position, to temporaryValue.\n temporaryValue += collectASequenceOfCodePoints(\n (char) => char !== '\"' && char !== ',',\n input,\n position\n )\n\n // 5.2. If position is not past the end of input, then:\n if (position.position < input.length) {\n // 5.2.1. If the code point at position within input is U+0022 (\"), then:\n if (input.charCodeAt(position.position) === 0x22) {\n // 5.2.1.1. Append the result of collecting an HTTP quoted string from input, given position, to temporaryValue.\n temporaryValue += collectAnHTTPQuotedString(\n input,\n position\n )\n\n // 5.2.1.2. If position is not past the end of input, then continue.\n if (position.position < input.length) {\n continue\n }\n } else {\n // 5.2.2. Otherwise:\n\n // 5.2.2.1. Assert: the code point at position within input is U+002C (,).\n assert(input.charCodeAt(position.position) === 0x2C)\n\n // 5.2.2.2. Advance position by 1.\n position.position++\n }\n }\n\n // 5.3. Remove all HTTP tab or space from the start and end of temporaryValue.\n temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 0x9 || char === 0x20)\n\n // 5.4. Append temporaryValue to values.\n values.push(temporaryValue)\n\n // 5.6. Set temporaryValue to the empty string.\n temporaryValue = ''\n }\n\n // 6. Return values.\n return values\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split\n * @param {string} name lowercase header name\n * @param {import('./headers').HeadersList} list\n */\nfunction getDecodeSplit (name, list) {\n // 1. Let value be the result of getting name from list.\n const value = list.get(name, true)\n\n // 2. If value is null, then return null.\n if (value === null) {\n return null\n }\n\n // 3. Return the result of getting, decoding, and splitting value.\n return gettingDecodingSplitting(value)\n}\n\nconst textDecoder = new TextDecoder()\n\n/**\n * @see https://encoding.spec.whatwg.org/#utf-8-decode\n * @param {Buffer} buffer\n */\nfunction utf8DecodeBytes (buffer) {\n if (buffer.length === 0) {\n return ''\n }\n\n // 1. Let buffer be the result of peeking three bytes from\n // ioQueue, converted to a byte sequence.\n\n // 2. If buffer is 0xEF 0xBB 0xBF, then read three\n // bytes from ioQueue. (Do nothing with those bytes.)\n if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {\n buffer = buffer.subarray(3)\n }\n\n // 3. Process a queue with an instance of UTF-8’s\n // decoder, ioQueue, output, and \"replacement\".\n const output = textDecoder.decode(buffer)\n\n // 4. Return output.\n return output\n}\n\nclass EnvironmentSettingsObjectBase {\n get baseUrl () {\n return getGlobalOrigin()\n }\n\n get origin () {\n return this.baseUrl?.origin\n }\n\n policyContainer = makePolicyContainer()\n}\n\nclass EnvironmentSettingsObject {\n settingsObject = new EnvironmentSettingsObjectBase()\n}\n\nconst environmentSettingsObject = new EnvironmentSettingsObject()\n\nmodule.exports = {\n isAborted,\n isCancelled,\n isValidEncodedURL,\n createDeferredPromise,\n ReadableStreamFrom,\n tryUpgradeRequestToAPotentiallyTrustworthyURL,\n clampAndCoarsenConnectionTimingInfo,\n coarsenedSharedCurrentTime,\n determineRequestsReferrer,\n makePolicyContainer,\n clonePolicyContainer,\n appendFetchMetadata,\n appendRequestOriginHeader,\n TAOCheck,\n corsCheck,\n crossOriginResourcePolicyCheck,\n createOpaqueTimingInfo,\n setRequestReferrerPolicyOnRedirect,\n isValidHTTPToken,\n requestBadPort,\n requestCurrentURL,\n responseURL,\n responseLocationURL,\n isBlobLike,\n isURLPotentiallyTrustworthy,\n isValidReasonPhrase,\n sameOrigin,\n normalizeMethod,\n serializeJavascriptValueToJSONString,\n iteratorMixin,\n createIterator,\n isValidHeaderName,\n isValidHeaderValue,\n isErrorLike,\n fullyReadBody,\n bytesMatch,\n isReadableStreamLike,\n readableStreamClose,\n isomorphicEncode,\n urlIsLocal,\n urlHasHttpsScheme,\n urlIsHttpHttpsScheme,\n readAllBytes,\n simpleRangeHeaderValue,\n buildContentRange,\n parseMetadata,\n createInflate,\n extractMimeType,\n getDecodeSplit,\n utf8DecodeBytes,\n environmentSettingsObject\n}\n","'use strict'\n\nmodule.exports = {\n kUrl: Symbol('url'),\n kHeaders: Symbol('headers'),\n kSignal: Symbol('signal'),\n kState: Symbol('state'),\n kDispatcher: Symbol('dispatcher')\n}\n","'use strict'\n\nconst { Blob, File } = require('node:buffer')\nconst { kState } = require('./symbols')\nconst { webidl } = require('./webidl')\n\n// TODO(@KhafraDev): remove\nclass FileLike {\n constructor (blobLike, fileName, options = {}) {\n // TODO: argument idl type check\n\n // The File constructor is invoked with two or three parameters, depending\n // on whether the optional dictionary parameter is used. When the File()\n // constructor is invoked, user agents must run the following steps:\n\n // 1. Let bytes be the result of processing blob parts given fileBits and\n // options.\n\n // 2. Let n be the fileName argument to the constructor.\n const n = fileName\n\n // 3. Process FilePropertyBag dictionary argument by running the following\n // substeps:\n\n // 1. If the type member is provided and is not the empty string, let t\n // be set to the type dictionary member. If t contains any characters\n // outside the range U+0020 to U+007E, then set t to the empty string\n // and return from these substeps.\n // TODO\n const t = options.type\n\n // 2. Convert every character in t to ASCII lowercase.\n // TODO\n\n // 3. If the lastModified member is provided, let d be set to the\n // lastModified dictionary member. If it is not provided, set d to the\n // current date and time represented as the number of milliseconds since\n // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).\n const d = options.lastModified ?? Date.now()\n\n // 4. Return a new File object F such that:\n // F refers to the bytes byte sequence.\n // F.size is set to the number of total bytes in bytes.\n // F.name is set to n.\n // F.type is set to t.\n // F.lastModified is set to d.\n\n this[kState] = {\n blobLike,\n name: n,\n type: t,\n lastModified: d\n }\n }\n\n stream (...args) {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.stream(...args)\n }\n\n arrayBuffer (...args) {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.arrayBuffer(...args)\n }\n\n slice (...args) {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.slice(...args)\n }\n\n text (...args) {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.text(...args)\n }\n\n get size () {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.size\n }\n\n get type () {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.type\n }\n\n get name () {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].name\n }\n\n get lastModified () {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].lastModified\n }\n\n get [Symbol.toStringTag] () {\n return 'File'\n }\n}\n\nwebidl.converters.Blob = webidl.interfaceConverter(Blob)\n\n// If this function is moved to ./util.js, some tools (such as\n// rollup) will warn about circular dependencies. See:\n// https://github.com/nodejs/undici/issues/1629\nfunction isFileLike (object) {\n return (\n (object instanceof File) ||\n (\n object &&\n (typeof object.stream === 'function' ||\n typeof object.arrayBuffer === 'function') &&\n object[Symbol.toStringTag] === 'File'\n )\n )\n}\n\nmodule.exports = { FileLike, isFileLike }\n","'use strict'\n\nconst { isBlobLike, iteratorMixin } = require('./util')\nconst { kState } = require('./symbols')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { FileLike, isFileLike } = require('./file')\nconst { webidl } = require('./webidl')\nconst { File: NativeFile } = require('node:buffer')\nconst nodeUtil = require('node:util')\n\n/** @type {globalThis['File']} */\nconst File = globalThis.File ?? NativeFile\n\n// https://xhr.spec.whatwg.org/#formdata\nclass FormData {\n constructor (form) {\n webidl.util.markAsUncloneable(this)\n\n if (form !== undefined) {\n throw webidl.errors.conversionFailed({\n prefix: 'FormData constructor',\n argument: 'Argument 1',\n types: ['undefined']\n })\n }\n\n this[kState] = []\n }\n\n append (name, value, filename = undefined) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.append'\n webidl.argumentLengthCheck(arguments, 2, prefix)\n\n if (arguments.length === 3 && !isBlobLike(value)) {\n throw new TypeError(\n \"Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'\"\n )\n }\n\n // 1. Let value be value if given; otherwise blobValue.\n\n name = webidl.converters.USVString(name, prefix, 'name')\n value = isBlobLike(value)\n ? webidl.converters.Blob(value, prefix, 'value', { strict: false })\n : webidl.converters.USVString(value, prefix, 'value')\n filename = arguments.length === 3\n ? webidl.converters.USVString(filename, prefix, 'filename')\n : undefined\n\n // 2. Let entry be the result of creating an entry with\n // name, value, and filename if given.\n const entry = makeEntry(name, value, filename)\n\n // 3. Append entry to this’s entry list.\n this[kState].push(entry)\n }\n\n delete (name) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.delete'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n name = webidl.converters.USVString(name, prefix, 'name')\n\n // The delete(name) method steps are to remove all entries whose name\n // is name from this’s entry list.\n this[kState] = this[kState].filter(entry => entry.name !== name)\n }\n\n get (name) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.get'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n name = webidl.converters.USVString(name, prefix, 'name')\n\n // 1. If there is no entry whose name is name in this’s entry list,\n // then return null.\n const idx = this[kState].findIndex((entry) => entry.name === name)\n if (idx === -1) {\n return null\n }\n\n // 2. Return the value of the first entry whose name is name from\n // this’s entry list.\n return this[kState][idx].value\n }\n\n getAll (name) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.getAll'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n name = webidl.converters.USVString(name, prefix, 'name')\n\n // 1. If there is no entry whose name is name in this’s entry list,\n // then return the empty list.\n // 2. Return the values of all entries whose name is name, in order,\n // from this’s entry list.\n return this[kState]\n .filter((entry) => entry.name === name)\n .map((entry) => entry.value)\n }\n\n has (name) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.has'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n name = webidl.converters.USVString(name, prefix, 'name')\n\n // The has(name) method steps are to return true if there is an entry\n // whose name is name in this’s entry list; otherwise false.\n return this[kState].findIndex((entry) => entry.name === name) !== -1\n }\n\n set (name, value, filename = undefined) {\n webidl.brandCheck(this, FormData)\n\n const prefix = 'FormData.set'\n webidl.argumentLengthCheck(arguments, 2, prefix)\n\n if (arguments.length === 3 && !isBlobLike(value)) {\n throw new TypeError(\n \"Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'\"\n )\n }\n\n // The set(name, value) and set(name, blobValue, filename) method steps\n // are:\n\n // 1. Let value be value if given; otherwise blobValue.\n\n name = webidl.converters.USVString(name, prefix, 'name')\n value = isBlobLike(value)\n ? webidl.converters.Blob(value, prefix, 'name', { strict: false })\n : webidl.converters.USVString(value, prefix, 'name')\n filename = arguments.length === 3\n ? webidl.converters.USVString(filename, prefix, 'name')\n : undefined\n\n // 2. Let entry be the result of creating an entry with name, value, and\n // filename if given.\n const entry = makeEntry(name, value, filename)\n\n // 3. If there are entries in this’s entry list whose name is name, then\n // replace the first such entry with entry and remove the others.\n const idx = this[kState].findIndex((entry) => entry.name === name)\n if (idx !== -1) {\n this[kState] = [\n ...this[kState].slice(0, idx),\n entry,\n ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)\n ]\n } else {\n // 4. Otherwise, append entry to this’s entry list.\n this[kState].push(entry)\n }\n }\n\n [nodeUtil.inspect.custom] (depth, options) {\n const state = this[kState].reduce((a, b) => {\n if (a[b.name]) {\n if (Array.isArray(a[b.name])) {\n a[b.name].push(b.value)\n } else {\n a[b.name] = [a[b.name], b.value]\n }\n } else {\n a[b.name] = b.value\n }\n\n return a\n }, { __proto__: null })\n\n options.depth ??= depth\n options.colors ??= true\n\n const output = nodeUtil.formatWithOptions(options, state)\n\n // remove [Object null prototype]\n return `FormData ${output.slice(output.indexOf(']') + 2)}`\n }\n}\n\niteratorMixin('FormData', FormData, kState, 'name', 'value')\n\nObject.defineProperties(FormData.prototype, {\n append: kEnumerableProperty,\n delete: kEnumerableProperty,\n get: kEnumerableProperty,\n getAll: kEnumerableProperty,\n has: kEnumerableProperty,\n set: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'FormData',\n configurable: true\n }\n})\n\n/**\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry\n * @param {string} name\n * @param {string|Blob} value\n * @param {?string} filename\n * @returns\n */\nfunction makeEntry (name, value, filename) {\n // 1. Set name to the result of converting name into a scalar value string.\n // Note: This operation was done by the webidl converter USVString.\n\n // 2. If value is a string, then set value to the result of converting\n // value into a scalar value string.\n if (typeof value === 'string') {\n // Note: This operation was done by the webidl converter USVString.\n } else {\n // 3. Otherwise:\n\n // 1. If value is not a File object, then set value to a new File object,\n // representing the same bytes, whose name attribute value is \"blob\"\n if (!isFileLike(value)) {\n value = value instanceof Blob\n ? new File([value], 'blob', { type: value.type })\n : new FileLike(value, 'blob', { type: value.type })\n }\n\n // 2. If filename is given, then set value to a new File object,\n // representing the same bytes, whose name attribute is filename.\n if (filename !== undefined) {\n /** @type {FilePropertyBag} */\n const options = {\n type: value.type,\n lastModified: value.lastModified\n }\n\n value = value instanceof NativeFile\n ? new File([value], filename, options)\n : new FileLike(value, filename, options)\n }\n }\n\n // 4. Return an entry whose name is name and whose value is value.\n return { name, value }\n}\n\nmodule.exports = { FormData, makeEntry }\n","'use strict'\n\nconst { isUSVString, bufferToLowerCasedHeaderName } = require('../../core/util')\nconst { utf8DecodeBytes } = require('./util')\nconst { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require('./data-url')\nconst { isFileLike } = require('./file')\nconst { makeEntry } = require('./formdata')\nconst assert = require('node:assert')\nconst { File: NodeFile } = require('node:buffer')\n\nconst File = globalThis.File ?? NodeFile\n\nconst formDataNameBuffer = Buffer.from('form-data; name=\"')\nconst filenameBuffer = Buffer.from('; filename')\nconst dd = Buffer.from('--')\nconst ddcrlf = Buffer.from('--\\r\\n')\n\n/**\n * @param {string} chars\n */\nfunction isAsciiString (chars) {\n for (let i = 0; i < chars.length; ++i) {\n if ((chars.charCodeAt(i) & ~0x7F) !== 0) {\n return false\n }\n }\n return true\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-boundary\n * @param {string} boundary\n */\nfunction validateBoundary (boundary) {\n const length = boundary.length\n\n // - its length is greater or equal to 27 and lesser or equal to 70, and\n if (length < 27 || length > 70) {\n return false\n }\n\n // - it is composed by bytes in the ranges 0x30 to 0x39, 0x41 to 0x5A, or\n // 0x61 to 0x7A, inclusive (ASCII alphanumeric), or which are 0x27 ('),\n // 0x2D (-) or 0x5F (_).\n for (let i = 0; i < length; ++i) {\n const cp = boundary.charCodeAt(i)\n\n if (!(\n (cp >= 0x30 && cp <= 0x39) ||\n (cp >= 0x41 && cp <= 0x5a) ||\n (cp >= 0x61 && cp <= 0x7a) ||\n cp === 0x27 ||\n cp === 0x2d ||\n cp === 0x5f\n )) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-parser\n * @param {Buffer} input\n * @param {ReturnType} mimeType\n */\nfunction multipartFormDataParser (input, mimeType) {\n // 1. Assert: mimeType’s essence is \"multipart/form-data\".\n assert(mimeType !== 'failure' && mimeType.essence === 'multipart/form-data')\n\n const boundaryString = mimeType.parameters.get('boundary')\n\n // 2. If mimeType’s parameters[\"boundary\"] does not exist, return failure.\n // Otherwise, let boundary be the result of UTF-8 decoding mimeType’s\n // parameters[\"boundary\"].\n if (boundaryString === undefined) {\n return 'failure'\n }\n\n const boundary = Buffer.from(`--${boundaryString}`, 'utf8')\n\n // 3. Let entry list be an empty entry list.\n const entryList = []\n\n // 4. Let position be a pointer to a byte in input, initially pointing at\n // the first byte.\n const position = { position: 0 }\n\n // Note: undici addition, allows leading and trailing CRLFs.\n while (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {\n position.position += 2\n }\n\n let trailing = input.length\n\n while (input[trailing - 1] === 0x0a && input[trailing - 2] === 0x0d) {\n trailing -= 2\n }\n\n if (trailing !== input.length) {\n input = input.subarray(0, trailing)\n }\n\n // 5. While true:\n while (true) {\n // 5.1. If position points to a sequence of bytes starting with 0x2D 0x2D\n // (`--`) followed by boundary, advance position by 2 + the length of\n // boundary. Otherwise, return failure.\n // Note: boundary is padded with 2 dashes already, no need to add 2.\n if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) {\n position.position += boundary.length\n } else {\n return 'failure'\n }\n\n // 5.2. If position points to the sequence of bytes 0x2D 0x2D 0x0D 0x0A\n // (`--` followed by CR LF) followed by the end of input, return entry list.\n // Note: a body does NOT need to end with CRLF. It can end with --.\n if (\n (position.position === input.length - 2 && bufferStartsWith(input, dd, position)) ||\n (position.position === input.length - 4 && bufferStartsWith(input, ddcrlf, position))\n ) {\n return entryList\n }\n\n // 5.3. If position does not point to a sequence of bytes starting with 0x0D\n // 0x0A (CR LF), return failure.\n if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n return 'failure'\n }\n\n // 5.4. Advance position by 2. (This skips past the newline.)\n position.position += 2\n\n // 5.5. Let name, filename and contentType be the result of parsing\n // multipart/form-data headers on input and position, if the result\n // is not failure. Otherwise, return failure.\n const result = parseMultipartFormDataHeaders(input, position)\n\n if (result === 'failure') {\n return 'failure'\n }\n\n let { name, filename, contentType, encoding } = result\n\n // 5.6. Advance position by 2. (This skips past the empty line that marks\n // the end of the headers.)\n position.position += 2\n\n // 5.7. Let body be the empty byte sequence.\n let body\n\n // 5.8. Body loop: While position is not past the end of input:\n // TODO: the steps here are completely wrong\n {\n const boundaryIndex = input.indexOf(boundary.subarray(2), position.position)\n\n if (boundaryIndex === -1) {\n return 'failure'\n }\n\n body = input.subarray(position.position, boundaryIndex - 4)\n\n position.position += body.length\n\n // Note: position must be advanced by the body's length before being\n // decoded, otherwise the parsing will fail.\n if (encoding === 'base64') {\n body = Buffer.from(body.toString(), 'base64')\n }\n }\n\n // 5.9. If position does not point to a sequence of bytes starting with\n // 0x0D 0x0A (CR LF), return failure. Otherwise, advance position by 2.\n if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {\n return 'failure'\n } else {\n position.position += 2\n }\n\n // 5.10. If filename is not null:\n let value\n\n if (filename !== null) {\n // 5.10.1. If contentType is null, set contentType to \"text/plain\".\n contentType ??= 'text/plain'\n\n // 5.10.2. If contentType is not an ASCII string, set contentType to the empty string.\n\n // Note: `buffer.isAscii` can be used at zero-cost, but converting a string to a buffer is a high overhead.\n // Content-Type is a relatively small string, so it is faster to use `String#charCodeAt`.\n if (!isAsciiString(contentType)) {\n contentType = ''\n }\n\n // 5.10.3. Let value be a new File object with name filename, type contentType, and body body.\n value = new File([body], filename, { type: contentType })\n } else {\n // 5.11. Otherwise:\n\n // 5.11.1. Let value be the UTF-8 decoding without BOM of body.\n value = utf8DecodeBytes(Buffer.from(body))\n }\n\n // 5.12. Assert: name is a scalar value string and value is either a scalar value string or a File object.\n assert(isUSVString(name))\n assert((typeof value === 'string' && isUSVString(value)) || isFileLike(value))\n\n // 5.13. Create an entry with name and value, and append it to entry list.\n entryList.push(makeEntry(name, value, filename))\n }\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#parse-multipart-form-data-headers\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction parseMultipartFormDataHeaders (input, position) {\n // 1. Let name, filename and contentType be null.\n let name = null\n let filename = null\n let contentType = null\n let encoding = null\n\n // 2. While true:\n while (true) {\n // 2.1. If position points to a sequence of bytes starting with 0x0D 0x0A (CR LF):\n if (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {\n // 2.1.1. If name is null, return failure.\n if (name === null) {\n return 'failure'\n }\n\n // 2.1.2. Return name, filename and contentType.\n return { name, filename, contentType, encoding }\n }\n\n // 2.2. Let header name be the result of collecting a sequence of bytes that are\n // not 0x0A (LF), 0x0D (CR) or 0x3A (:), given position.\n let headerName = collectASequenceOfBytes(\n (char) => char !== 0x0a && char !== 0x0d && char !== 0x3a,\n input,\n position\n )\n\n // 2.3. Remove any HTTP tab or space bytes from the start or end of header name.\n headerName = removeChars(headerName, true, true, (char) => char === 0x9 || char === 0x20)\n\n // 2.4. If header name does not match the field-name token production, return failure.\n if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) {\n return 'failure'\n }\n\n // 2.5. If the byte at position is not 0x3A (:), return failure.\n if (input[position.position] !== 0x3a) {\n return 'failure'\n }\n\n // 2.6. Advance position by 1.\n position.position++\n\n // 2.7. Collect a sequence of bytes that are HTTP tab or space bytes given position.\n // (Do nothing with those bytes.)\n collectASequenceOfBytes(\n (char) => char === 0x20 || char === 0x09,\n input,\n position\n )\n\n // 2.8. Byte-lowercase header name and switch on the result:\n switch (bufferToLowerCasedHeaderName(headerName)) {\n case 'content-disposition': {\n // 1. Set name and filename to null.\n name = filename = null\n\n // 2. If position does not point to a sequence of bytes starting with\n // `form-data; name=\"`, return failure.\n if (!bufferStartsWith(input, formDataNameBuffer, position)) {\n return 'failure'\n }\n\n // 3. Advance position so it points at the byte after the next 0x22 (\")\n // byte (the one in the sequence of bytes matched above).\n position.position += 17\n\n // 4. Set name to the result of parsing a multipart/form-data name given\n // input and position, if the result is not failure. Otherwise, return\n // failure.\n name = parseMultipartFormDataName(input, position)\n\n if (name === null) {\n return 'failure'\n }\n\n // 5. If position points to a sequence of bytes starting with `; filename=\"`:\n if (bufferStartsWith(input, filenameBuffer, position)) {\n // Note: undici also handles filename*\n let check = position.position + filenameBuffer.length\n\n if (input[check] === 0x2a) {\n position.position += 1\n check += 1\n }\n\n if (input[check] !== 0x3d || input[check + 1] !== 0x22) { // =\"\n return 'failure'\n }\n\n // 1. Advance position so it points at the byte after the next 0x22 (\") byte\n // (the one in the sequence of bytes matched above).\n position.position += 12\n\n // 2. Set filename to the result of parsing a multipart/form-data name given\n // input and position, if the result is not failure. Otherwise, return failure.\n filename = parseMultipartFormDataName(input, position)\n\n if (filename === null) {\n return 'failure'\n }\n }\n\n break\n }\n case 'content-type': {\n // 1. Let header value be the result of collecting a sequence of bytes that are\n // not 0x0A (LF) or 0x0D (CR), given position.\n let headerValue = collectASequenceOfBytes(\n (char) => char !== 0x0a && char !== 0x0d,\n input,\n position\n )\n\n // 2. Remove any HTTP tab or space bytes from the end of header value.\n headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)\n\n // 3. Set contentType to the isomorphic decoding of header value.\n contentType = isomorphicDecode(headerValue)\n\n break\n }\n case 'content-transfer-encoding': {\n let headerValue = collectASequenceOfBytes(\n (char) => char !== 0x0a && char !== 0x0d,\n input,\n position\n )\n\n headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)\n\n encoding = isomorphicDecode(headerValue)\n\n break\n }\n default: {\n // Collect a sequence of bytes that are not 0x0A (LF) or 0x0D (CR), given position.\n // (Do nothing with those bytes.)\n collectASequenceOfBytes(\n (char) => char !== 0x0a && char !== 0x0d,\n input,\n position\n )\n }\n }\n\n // 2.9. If position does not point to a sequence of bytes starting with 0x0D 0x0A\n // (CR LF), return failure. Otherwise, advance position by 2 (past the newline).\n if (input[position.position] !== 0x0d && input[position.position + 1] !== 0x0a) {\n return 'failure'\n } else {\n position.position += 2\n }\n }\n}\n\n/**\n * @see https://andreubotella.github.io/multipart-form-data/#parse-a-multipart-form-data-name\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction parseMultipartFormDataName (input, position) {\n // 1. Assert: The byte at (position - 1) is 0x22 (\").\n assert(input[position.position - 1] === 0x22)\n\n // 2. Let name be the result of collecting a sequence of bytes that are not 0x0A (LF), 0x0D (CR) or 0x22 (\"), given position.\n /** @type {string | Buffer} */\n let name = collectASequenceOfBytes(\n (char) => char !== 0x0a && char !== 0x0d && char !== 0x22,\n input,\n position\n )\n\n // 3. If the byte at position is not 0x22 (\"), return failure. Otherwise, advance position by 1.\n if (input[position.position] !== 0x22) {\n return null // name could be 'failure'\n } else {\n position.position++\n }\n\n // 4. Replace any occurrence of the following subsequences in name with the given byte:\n // - `%0A`: 0x0A (LF)\n // - `%0D`: 0x0D (CR)\n // - `%22`: 0x22 (\")\n name = new TextDecoder().decode(name)\n .replace(/%0A/ig, '\\n')\n .replace(/%0D/ig, '\\r')\n .replace(/%22/g, '\"')\n\n // 5. Return the UTF-8 decoding without BOM of name.\n return name\n}\n\n/**\n * @param {(char: number) => boolean} condition\n * @param {Buffer} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfBytes (condition, input, position) {\n let start = position.position\n\n while (start < input.length && condition(input[start])) {\n ++start\n }\n\n return input.subarray(position.position, (position.position = start))\n}\n\n/**\n * @param {Buffer} buf\n * @param {boolean} leading\n * @param {boolean} trailing\n * @param {(charCode: number) => boolean} predicate\n * @returns {Buffer}\n */\nfunction removeChars (buf, leading, trailing, predicate) {\n let lead = 0\n let trail = buf.length - 1\n\n if (leading) {\n while (lead < buf.length && predicate(buf[lead])) lead++\n }\n\n if (trailing) {\n while (trail > 0 && predicate(buf[trail])) trail--\n }\n\n return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1)\n}\n\n/**\n * Checks if {@param buffer} starts with {@param start}\n * @param {Buffer} buffer\n * @param {Buffer} start\n * @param {{ position: number }} position\n */\nfunction bufferStartsWith (buffer, start, position) {\n if (buffer.length < start.length) {\n return false\n }\n\n for (let i = 0; i < start.length; i++) {\n if (start[i] !== buffer[position.position + i]) {\n return false\n }\n }\n\n return true\n}\n\nmodule.exports = {\n multipartFormDataParser,\n validateBoundary\n}\n","'use strict'\n\nconst util = require('../../core/util')\nconst {\n ReadableStreamFrom,\n isBlobLike,\n isReadableStreamLike,\n readableStreamClose,\n createDeferredPromise,\n fullyReadBody,\n extractMimeType,\n utf8DecodeBytes\n} = require('./util')\nconst { FormData } = require('./formdata')\nconst { kState } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { Blob } = require('node:buffer')\nconst assert = require('node:assert')\nconst { isErrored, isDisturbed } = require('node:stream')\nconst { isArrayBuffer } = require('node:util/types')\nconst { serializeAMimeType } = require('./data-url')\nconst { multipartFormDataParser } = require('./formdata-parser')\nlet random\n\ntry {\n const crypto = require('node:crypto')\n random = (max) => crypto.randomInt(0, max)\n} catch {\n random = (max) => Math.floor(Math.random(max))\n}\n\nconst textEncoder = new TextEncoder()\nfunction noop () {}\n\nconst hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf('v18') !== 0\nlet streamRegistry\n\nif (hasFinalizationRegistry) {\n streamRegistry = new FinalizationRegistry((weakRef) => {\n const stream = weakRef.deref()\n if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {\n stream.cancel('Response object has been garbage collected').catch(noop)\n }\n })\n}\n\n// https://fetch.spec.whatwg.org/#concept-bodyinit-extract\nfunction extractBody (object, keepalive = false) {\n // 1. Let stream be null.\n let stream = null\n\n // 2. If object is a ReadableStream object, then set stream to object.\n if (object instanceof ReadableStream) {\n stream = object\n } else if (isBlobLike(object)) {\n // 3. Otherwise, if object is a Blob object, set stream to the\n // result of running object’s get stream.\n stream = object.stream()\n } else {\n // 4. Otherwise, set stream to a new ReadableStream object, and set\n // up stream with byte reading support.\n stream = new ReadableStream({\n async pull (controller) {\n const buffer = typeof source === 'string' ? textEncoder.encode(source) : source\n\n if (buffer.byteLength) {\n controller.enqueue(buffer)\n }\n\n queueMicrotask(() => readableStreamClose(controller))\n },\n start () {},\n type: 'bytes'\n })\n }\n\n // 5. Assert: stream is a ReadableStream object.\n assert(isReadableStreamLike(stream))\n\n // 6. Let action be null.\n let action = null\n\n // 7. Let source be null.\n let source = null\n\n // 8. Let length be null.\n let length = null\n\n // 9. Let type be null.\n let type = null\n\n // 10. Switch on object:\n if (typeof object === 'string') {\n // Set source to the UTF-8 encoding of object.\n // Note: setting source to a Uint8Array here breaks some mocking assumptions.\n source = object\n\n // Set type to `text/plain;charset=UTF-8`.\n type = 'text/plain;charset=UTF-8'\n } else if (object instanceof URLSearchParams) {\n // URLSearchParams\n\n // spec says to run application/x-www-form-urlencoded on body.list\n // this is implemented in Node.js as apart of an URLSearchParams instance toString method\n // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490\n // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100\n\n // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.\n source = object.toString()\n\n // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.\n type = 'application/x-www-form-urlencoded;charset=UTF-8'\n } else if (isArrayBuffer(object)) {\n // BufferSource/ArrayBuffer\n\n // Set source to a copy of the bytes held by object.\n source = new Uint8Array(object.slice())\n } else if (ArrayBuffer.isView(object)) {\n // BufferSource/ArrayBufferView\n\n // Set source to a copy of the bytes held by object.\n source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))\n } else if (util.isFormDataLike(object)) {\n const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`\n const prefix = `--${boundary}\\r\\nContent-Disposition: form-data`\n\n /*! formdata-polyfill. MIT License. Jimmy Wärting */\n const escape = (str) =>\n str.replace(/\\n/g, '%0A').replace(/\\r/g, '%0D').replace(/\"/g, '%22')\n const normalizeLinefeeds = (value) => value.replace(/\\r?\\n|\\r/g, '\\r\\n')\n\n // Set action to this step: run the multipart/form-data\n // encoding algorithm, with object’s entry list and UTF-8.\n // - This ensures that the body is immutable and can't be changed afterwords\n // - That the content-length is calculated in advance.\n // - And that all parts are pre-encoded and ready to be sent.\n\n const blobParts = []\n const rn = new Uint8Array([13, 10]) // '\\r\\n'\n length = 0\n let hasUnknownSizeValue = false\n\n for (const [name, value] of object) {\n if (typeof value === 'string') {\n const chunk = textEncoder.encode(prefix +\n `; name=\"${escape(normalizeLinefeeds(name))}\"` +\n `\\r\\n\\r\\n${normalizeLinefeeds(value)}\\r\\n`)\n blobParts.push(chunk)\n length += chunk.byteLength\n } else {\n const chunk = textEncoder.encode(`${prefix}; name=\"${escape(normalizeLinefeeds(name))}\"` +\n (value.name ? `; filename=\"${escape(value.name)}\"` : '') + '\\r\\n' +\n `Content-Type: ${\n value.type || 'application/octet-stream'\n }\\r\\n\\r\\n`)\n blobParts.push(chunk, value, rn)\n if (typeof value.size === 'number') {\n length += chunk.byteLength + value.size + rn.byteLength\n } else {\n hasUnknownSizeValue = true\n }\n }\n }\n\n // CRLF is appended to the body to function with legacy servers and match other implementations.\n // https://github.com/curl/curl/blob/3434c6b46e682452973972e8313613dfa58cd690/lib/mime.c#L1029-L1030\n // https://github.com/form-data/form-data/issues/63\n const chunk = textEncoder.encode(`--${boundary}--\\r\\n`)\n blobParts.push(chunk)\n length += chunk.byteLength\n if (hasUnknownSizeValue) {\n length = null\n }\n\n // Set source to object.\n source = object\n\n action = async function * () {\n for (const part of blobParts) {\n if (part.stream) {\n yield * part.stream()\n } else {\n yield part\n }\n }\n }\n\n // Set type to `multipart/form-data; boundary=`,\n // followed by the multipart/form-data boundary string generated\n // by the multipart/form-data encoding algorithm.\n type = `multipart/form-data; boundary=${boundary}`\n } else if (isBlobLike(object)) {\n // Blob\n\n // Set source to object.\n source = object\n\n // Set length to object’s size.\n length = object.size\n\n // If object’s type attribute is not the empty byte sequence, set\n // type to its value.\n if (object.type) {\n type = object.type\n }\n } else if (typeof object[Symbol.asyncIterator] === 'function') {\n // If keepalive is true, then throw a TypeError.\n if (keepalive) {\n throw new TypeError('keepalive')\n }\n\n // If object is disturbed or locked, then throw a TypeError.\n if (util.isDisturbed(object) || object.locked) {\n throw new TypeError(\n 'Response body object should not be disturbed or locked'\n )\n }\n\n stream =\n object instanceof ReadableStream ? object : ReadableStreamFrom(object)\n }\n\n // 11. If source is a byte sequence, then set action to a\n // step that returns source and length to source’s length.\n if (typeof source === 'string' || util.isBuffer(source)) {\n length = Buffer.byteLength(source)\n }\n\n // 12. If action is non-null, then run these steps in in parallel:\n if (action != null) {\n // Run action.\n let iterator\n stream = new ReadableStream({\n async start () {\n iterator = action(object)[Symbol.asyncIterator]()\n },\n async pull (controller) {\n const { value, done } = await iterator.next()\n if (done) {\n // When running action is done, close stream.\n queueMicrotask(() => {\n controller.close()\n controller.byobRequest?.respond(0)\n })\n } else {\n // Whenever one or more bytes are available and stream is not errored,\n // enqueue a Uint8Array wrapping an ArrayBuffer containing the available\n // bytes into stream.\n if (!isErrored(stream)) {\n const buffer = new Uint8Array(value)\n if (buffer.byteLength) {\n controller.enqueue(buffer)\n }\n }\n }\n return controller.desiredSize > 0\n },\n async cancel (reason) {\n await iterator.return()\n },\n type: 'bytes'\n })\n }\n\n // 13. Let body be a body whose stream is stream, source is source,\n // and length is length.\n const body = { stream, source, length }\n\n // 14. Return (body, type).\n return [body, type]\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit-safely-extract\nfunction safelyExtractBody (object, keepalive = false) {\n // To safely extract a body and a `Content-Type` value from\n // a byte sequence or BodyInit object object, run these steps:\n\n // 1. If object is a ReadableStream object, then:\n if (object instanceof ReadableStream) {\n // Assert: object is neither disturbed nor locked.\n // istanbul ignore next\n assert(!util.isDisturbed(object), 'The body has already been consumed.')\n // istanbul ignore next\n assert(!object.locked, 'The stream is locked.')\n }\n\n // 2. Return the results of extracting object.\n return extractBody(object, keepalive)\n}\n\nfunction cloneBody (instance, body) {\n // To clone a body body, run these steps:\n\n // https://fetch.spec.whatwg.org/#concept-body-clone\n\n // 1. Let « out1, out2 » be the result of teeing body’s stream.\n const [out1, out2] = body.stream.tee()\n\n // 2. Set body’s stream to out1.\n body.stream = out1\n\n // 3. Return a body whose stream is out2 and other members are copied from body.\n return {\n stream: out2,\n length: body.length,\n source: body.source\n }\n}\n\nfunction throwIfAborted (state) {\n if (state.aborted) {\n throw new DOMException('The operation was aborted.', 'AbortError')\n }\n}\n\nfunction bodyMixinMethods (instance) {\n const methods = {\n blob () {\n // The blob() method steps are to return the result of\n // running consume body with this and the following step\n // given a byte sequence bytes: return a Blob whose\n // contents are bytes and whose type attribute is this’s\n // MIME type.\n return consumeBody(this, (bytes) => {\n let mimeType = bodyMimeType(this)\n\n if (mimeType === null) {\n mimeType = ''\n } else if (mimeType) {\n mimeType = serializeAMimeType(mimeType)\n }\n\n // Return a Blob whose contents are bytes and type attribute\n // is mimeType.\n return new Blob([bytes], { type: mimeType })\n }, instance)\n },\n\n arrayBuffer () {\n // The arrayBuffer() method steps are to return the result\n // of running consume body with this and the following step\n // given a byte sequence bytes: return a new ArrayBuffer\n // whose contents are bytes.\n return consumeBody(this, (bytes) => {\n return new Uint8Array(bytes).buffer\n }, instance)\n },\n\n text () {\n // The text() method steps are to return the result of running\n // consume body with this and UTF-8 decode.\n return consumeBody(this, utf8DecodeBytes, instance)\n },\n\n json () {\n // The json() method steps are to return the result of running\n // consume body with this and parse JSON from bytes.\n return consumeBody(this, parseJSONFromBytes, instance)\n },\n\n formData () {\n // The formData() method steps are to return the result of running\n // consume body with this and the following step given a byte sequence bytes:\n return consumeBody(this, (value) => {\n // 1. Let mimeType be the result of get the MIME type with this.\n const mimeType = bodyMimeType(this)\n\n // 2. If mimeType is non-null, then switch on mimeType’s essence and run\n // the corresponding steps:\n if (mimeType !== null) {\n switch (mimeType.essence) {\n case 'multipart/form-data': {\n // 1. ... [long step]\n const parsed = multipartFormDataParser(value, mimeType)\n\n // 2. If that fails for some reason, then throw a TypeError.\n if (parsed === 'failure') {\n throw new TypeError('Failed to parse body as FormData.')\n }\n\n // 3. Return a new FormData object, appending each entry,\n // resulting from the parsing operation, to its entry list.\n const fd = new FormData()\n fd[kState] = parsed\n\n return fd\n }\n case 'application/x-www-form-urlencoded': {\n // 1. Let entries be the result of parsing bytes.\n const entries = new URLSearchParams(value.toString())\n\n // 2. If entries is failure, then throw a TypeError.\n\n // 3. Return a new FormData object whose entry list is entries.\n const fd = new FormData()\n\n for (const [name, value] of entries) {\n fd.append(name, value)\n }\n\n return fd\n }\n }\n }\n\n // 3. Throw a TypeError.\n throw new TypeError(\n 'Content-Type was not one of \"multipart/form-data\" or \"application/x-www-form-urlencoded\".'\n )\n }, instance)\n },\n\n bytes () {\n // The bytes() method steps are to return the result of running consume body\n // with this and the following step given a byte sequence bytes: return the\n // result of creating a Uint8Array from bytes in this’s relevant realm.\n return consumeBody(this, (bytes) => {\n return new Uint8Array(bytes)\n }, instance)\n }\n }\n\n return methods\n}\n\nfunction mixinBody (prototype) {\n Object.assign(prototype.prototype, bodyMixinMethods(prototype))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-consume-body\n * @param {Response|Request} object\n * @param {(value: unknown) => unknown} convertBytesToJSValue\n * @param {Response|Request} instance\n */\nasync function consumeBody (object, convertBytesToJSValue, instance) {\n webidl.brandCheck(object, instance)\n\n // 1. If object is unusable, then return a promise rejected\n // with a TypeError.\n if (bodyUnusable(object)) {\n throw new TypeError('Body is unusable: Body has already been read')\n }\n\n throwIfAborted(object[kState])\n\n // 2. Let promise be a new promise.\n const promise = createDeferredPromise()\n\n // 3. Let errorSteps given error be to reject promise with error.\n const errorSteps = (error) => promise.reject(error)\n\n // 4. Let successSteps given a byte sequence data be to resolve\n // promise with the result of running convertBytesToJSValue\n // with data. If that threw an exception, then run errorSteps\n // with that exception.\n const successSteps = (data) => {\n try {\n promise.resolve(convertBytesToJSValue(data))\n } catch (e) {\n errorSteps(e)\n }\n }\n\n // 5. If object’s body is null, then run successSteps with an\n // empty byte sequence.\n if (object[kState].body == null) {\n successSteps(Buffer.allocUnsafe(0))\n return promise.promise\n }\n\n // 6. Otherwise, fully read object’s body given successSteps,\n // errorSteps, and object’s relevant global object.\n await fullyReadBody(object[kState].body, successSteps, errorSteps)\n\n // 7. Return promise.\n return promise.promise\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction bodyUnusable (object) {\n const body = object[kState].body\n\n // An object including the Body interface mixin is\n // said to be unusable if its body is non-null and\n // its body’s stream is disturbed or locked.\n return body != null && (body.stream.locked || util.isDisturbed(body.stream))\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value\n * @param {Uint8Array} bytes\n */\nfunction parseJSONFromBytes (bytes) {\n return JSON.parse(utf8DecodeBytes(bytes))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-mime-type\n * @param {import('./response').Response|import('./request').Request} requestOrResponse\n */\nfunction bodyMimeType (requestOrResponse) {\n // 1. Let headers be null.\n // 2. If requestOrResponse is a Request object, then set headers to requestOrResponse’s request’s header list.\n // 3. Otherwise, set headers to requestOrResponse’s response’s header list.\n /** @type {import('./headers').HeadersList} */\n const headers = requestOrResponse[kState].headersList\n\n // 4. Let mimeType be the result of extracting a MIME type from headers.\n const mimeType = extractMimeType(headers)\n\n // 5. If mimeType is failure, then return null.\n if (mimeType === 'failure') {\n return null\n }\n\n // 6. Return mimeType.\n return mimeType\n}\n\nmodule.exports = {\n extractBody,\n safelyExtractBody,\n cloneBody,\n mixinBody,\n streamRegistry,\n hasFinalizationRegistry,\n bodyUnusable\n}\n","'use strict'\n\n/* global WebAssembly */\n\nconst assert = require('node:assert')\nconst util = require('../core/util.js')\nconst { channels } = require('../core/diagnostics.js')\nconst timers = require('../util/timers.js')\nconst {\n RequestContentLengthMismatchError,\n ResponseContentLengthMismatchError,\n RequestAbortedError,\n HeadersTimeoutError,\n HeadersOverflowError,\n SocketError,\n InformationalError,\n BodyTimeoutError,\n HTTPParserError,\n ResponseExceededMaxSizeError\n} = require('../core/errors.js')\nconst {\n kUrl,\n kReset,\n kClient,\n kParser,\n kBlocking,\n kRunning,\n kPending,\n kSize,\n kWriting,\n kQueue,\n kNoRef,\n kKeepAliveDefaultTimeout,\n kHostHeader,\n kPendingIdx,\n kRunningIdx,\n kError,\n kPipelining,\n kSocket,\n kKeepAliveTimeoutValue,\n kMaxHeadersSize,\n kKeepAliveMaxTimeout,\n kKeepAliveTimeoutThreshold,\n kHeadersTimeout,\n kBodyTimeout,\n kStrictContentLength,\n kMaxRequests,\n kCounter,\n kMaxResponseSize,\n kOnError,\n kResume,\n kHTTPContext\n} = require('../core/symbols.js')\n\nconst constants = require('../llhttp/constants.js')\nconst EMPTY_BUF = Buffer.alloc(0)\nconst FastBuffer = Buffer[Symbol.species]\nconst addListener = util.addListener\nconst removeAllListeners = util.removeAllListeners\n\nlet extractBody\n\nasync function lazyllhttp () {\n const llhttpWasmData = process.env.JEST_WORKER_ID ? require('../llhttp/llhttp-wasm.js') : undefined\n\n let mod\n try {\n mod = await WebAssembly.compile(require('../llhttp/llhttp_simd-wasm.js'))\n } catch (e) {\n /* istanbul ignore next */\n\n // We could check if the error was caused by the simd option not\n // being enabled, but the occurring of this other error\n // * https://github.com/emscripten-core/emscripten/issues/11495\n // got me to remove that check to avoid breaking Node 12.\n mod = await WebAssembly.compile(llhttpWasmData || require('../llhttp/llhttp-wasm.js'))\n }\n\n return await WebAssembly.instantiate(mod, {\n env: {\n /* eslint-disable camelcase */\n\n wasm_on_url: (p, at, len) => {\n /* istanbul ignore next */\n return 0\n },\n wasm_on_status: (p, at, len) => {\n assert(currentParser.ptr === p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n },\n wasm_on_message_begin: (p) => {\n assert(currentParser.ptr === p)\n return currentParser.onMessageBegin() || 0\n },\n wasm_on_header_field: (p, at, len) => {\n assert(currentParser.ptr === p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n },\n wasm_on_header_value: (p, at, len) => {\n assert(currentParser.ptr === p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n },\n wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {\n assert(currentParser.ptr === p)\n return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0\n },\n wasm_on_body: (p, at, len) => {\n assert(currentParser.ptr === p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n },\n wasm_on_message_complete: (p) => {\n assert(currentParser.ptr === p)\n return currentParser.onMessageComplete() || 0\n }\n\n /* eslint-enable camelcase */\n }\n })\n}\n\nlet llhttpInstance = null\nlet llhttpPromise = lazyllhttp()\nllhttpPromise.catch()\n\nlet currentParser = null\nlet currentBufferRef = null\nlet currentBufferSize = 0\nlet currentBufferPtr = null\n\nconst USE_NATIVE_TIMER = 0\nconst USE_FAST_TIMER = 1\n\n// Use fast timers for headers and body to take eventual event loop\n// latency into account.\nconst TIMEOUT_HEADERS = 2 | USE_FAST_TIMER\nconst TIMEOUT_BODY = 4 | USE_FAST_TIMER\n\n// Use native timers to ignore event loop latency for keep-alive\n// handling.\nconst TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER\n\nclass Parser {\n constructor (client, socket, { exports }) {\n assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)\n\n this.llhttp = exports\n this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)\n this.client = client\n this.socket = socket\n this.timeout = null\n this.timeoutValue = null\n this.timeoutType = null\n this.statusCode = null\n this.statusText = ''\n this.upgrade = false\n this.headers = []\n this.headersSize = 0\n this.headersMaxSize = client[kMaxHeadersSize]\n this.shouldKeepAlive = false\n this.paused = false\n this.resume = this.resume.bind(this)\n\n this.bytesRead = 0\n\n this.keepAlive = ''\n this.contentLength = ''\n this.connection = ''\n this.maxResponseSize = client[kMaxResponseSize]\n }\n\n setTimeout (delay, type) {\n // If the existing timer and the new timer are of different timer type\n // (fast or native) or have different delay, we need to clear the existing\n // timer and set a new one.\n if (\n delay !== this.timeoutValue ||\n (type & USE_FAST_TIMER) ^ (this.timeoutType & USE_FAST_TIMER)\n ) {\n // If a timeout is already set, clear it with clearTimeout of the fast\n // timer implementation, as it can clear fast and native timers.\n if (this.timeout) {\n timers.clearTimeout(this.timeout)\n this.timeout = null\n }\n\n if (delay) {\n if (type & USE_FAST_TIMER) {\n this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this))\n } else {\n this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this))\n this.timeout.unref()\n }\n }\n\n this.timeoutValue = delay\n } else if (this.timeout) {\n // istanbul ignore else: only for jest\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n this.timeoutType = type\n }\n\n resume () {\n if (this.socket.destroyed || !this.paused) {\n return\n }\n\n assert(this.ptr != null)\n assert(currentParser == null)\n\n this.llhttp.llhttp_resume(this.ptr)\n\n assert(this.timeoutType === TIMEOUT_BODY)\n if (this.timeout) {\n // istanbul ignore else: only for jest\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n this.paused = false\n this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.\n this.readMore()\n }\n\n readMore () {\n while (!this.paused && this.ptr) {\n const chunk = this.socket.read()\n if (chunk === null) {\n break\n }\n this.execute(chunk)\n }\n }\n\n execute (data) {\n assert(this.ptr != null)\n assert(currentParser == null)\n assert(!this.paused)\n\n const { socket, llhttp } = this\n\n if (data.length > currentBufferSize) {\n if (currentBufferPtr) {\n llhttp.free(currentBufferPtr)\n }\n currentBufferSize = Math.ceil(data.length / 4096) * 4096\n currentBufferPtr = llhttp.malloc(currentBufferSize)\n }\n\n new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)\n\n // Call `execute` on the wasm parser.\n // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,\n // and finally the length of bytes to parse.\n // The return value is an error code or `constants.ERROR.OK`.\n try {\n let ret\n\n try {\n currentBufferRef = data\n currentParser = this\n ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)\n /* eslint-disable-next-line no-useless-catch */\n } catch (err) {\n /* istanbul ignore next: difficult to make a test case for */\n throw err\n } finally {\n currentParser = null\n currentBufferRef = null\n }\n\n const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr\n\n if (ret === constants.ERROR.PAUSED_UPGRADE) {\n this.onUpgrade(data.slice(offset))\n } else if (ret === constants.ERROR.PAUSED) {\n this.paused = true\n socket.unshift(data.slice(offset))\n } else if (ret !== constants.ERROR.OK) {\n const ptr = llhttp.llhttp_get_error_reason(this.ptr)\n let message = ''\n /* istanbul ignore else: difficult to make a test case for */\n if (ptr) {\n const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)\n message =\n 'Response does not match the HTTP/1.1 protocol (' +\n Buffer.from(llhttp.memory.buffer, ptr, len).toString() +\n ')'\n }\n throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))\n }\n } catch (err) {\n util.destroy(socket, err)\n }\n }\n\n destroy () {\n assert(this.ptr != null)\n assert(currentParser == null)\n\n this.llhttp.llhttp_free(this.ptr)\n this.ptr = null\n\n this.timeout && timers.clearTimeout(this.timeout)\n this.timeout = null\n this.timeoutValue = null\n this.timeoutType = null\n\n this.paused = false\n }\n\n onStatus (buf) {\n this.statusText = buf.toString()\n }\n\n onMessageBegin () {\n const { socket, client } = this\n\n /* istanbul ignore next: difficult to make a test case for */\n if (socket.destroyed) {\n return -1\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n if (!request) {\n return -1\n }\n request.onResponseStarted()\n }\n\n onHeaderField (buf) {\n const len = this.headers.length\n\n if ((len & 1) === 0) {\n this.headers.push(buf)\n } else {\n this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n }\n\n this.trackHeader(buf.length)\n }\n\n onHeaderValue (buf) {\n let len = this.headers.length\n\n if ((len & 1) === 1) {\n this.headers.push(buf)\n len += 1\n } else {\n this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n }\n\n const key = this.headers[len - 2]\n if (key.length === 10) {\n const headerName = util.bufferToLowerCasedHeaderName(key)\n if (headerName === 'keep-alive') {\n this.keepAlive += buf.toString()\n } else if (headerName === 'connection') {\n this.connection += buf.toString()\n }\n } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === 'content-length') {\n this.contentLength += buf.toString()\n }\n\n this.trackHeader(buf.length)\n }\n\n trackHeader (len) {\n this.headersSize += len\n if (this.headersSize >= this.headersMaxSize) {\n util.destroy(this.socket, new HeadersOverflowError())\n }\n }\n\n onUpgrade (head) {\n const { upgrade, client, socket, headers, statusCode } = this\n\n assert(upgrade)\n assert(client[kSocket] === socket)\n assert(!socket.destroyed)\n assert(!this.paused)\n assert((headers.length & 1) === 0)\n\n const request = client[kQueue][client[kRunningIdx]]\n assert(request)\n assert(request.upgrade || request.method === 'CONNECT')\n\n this.statusCode = null\n this.statusText = ''\n this.shouldKeepAlive = null\n\n this.headers = []\n this.headersSize = 0\n\n socket.unshift(head)\n\n socket[kParser].destroy()\n socket[kParser] = null\n\n socket[kClient] = null\n socket[kError] = null\n\n removeAllListeners(socket)\n\n client[kSocket] = null\n client[kHTTPContext] = null // TODO (fix): This is hacky...\n client[kQueue][client[kRunningIdx]++] = null\n client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))\n\n try {\n request.onUpgrade(statusCode, headers, socket)\n } catch (err) {\n util.destroy(socket, err)\n }\n\n client[kResume]()\n }\n\n onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {\n const { client, socket, headers, statusText } = this\n\n /* istanbul ignore next: difficult to make a test case for */\n if (socket.destroyed) {\n return -1\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n\n /* istanbul ignore next: difficult to make a test case for */\n if (!request) {\n return -1\n }\n\n assert(!this.upgrade)\n assert(this.statusCode < 200)\n\n if (statusCode === 100) {\n util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n return -1\n }\n\n /* this can only happen if server is misbehaving */\n if (upgrade && !request.upgrade) {\n util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))\n return -1\n }\n\n assert(this.timeoutType === TIMEOUT_HEADERS)\n\n this.statusCode = statusCode\n this.shouldKeepAlive = (\n shouldKeepAlive ||\n // Override llhttp value which does not allow keepAlive for HEAD.\n (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')\n )\n\n if (this.statusCode >= 200) {\n const bodyTimeout = request.bodyTimeout != null\n ? request.bodyTimeout\n : client[kBodyTimeout]\n this.setTimeout(bodyTimeout, TIMEOUT_BODY)\n } else if (this.timeout) {\n // istanbul ignore else: only for jest\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n if (request.method === 'CONNECT') {\n assert(client[kRunning] === 1)\n this.upgrade = true\n return 2\n }\n\n if (upgrade) {\n assert(client[kRunning] === 1)\n this.upgrade = true\n return 2\n }\n\n assert((this.headers.length & 1) === 0)\n this.headers = []\n this.headersSize = 0\n\n if (this.shouldKeepAlive && client[kPipelining]) {\n const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null\n\n if (keepAliveTimeout != null) {\n const timeout = Math.min(\n keepAliveTimeout - client[kKeepAliveTimeoutThreshold],\n client[kKeepAliveMaxTimeout]\n )\n if (timeout <= 0) {\n socket[kReset] = true\n } else {\n client[kKeepAliveTimeoutValue] = timeout\n }\n } else {\n client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]\n }\n } else {\n // Stop more requests from being dispatched.\n socket[kReset] = true\n }\n\n const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false\n\n if (request.aborted) {\n return -1\n }\n\n if (request.method === 'HEAD') {\n return 1\n }\n\n if (statusCode < 200) {\n return 1\n }\n\n if (socket[kBlocking]) {\n socket[kBlocking] = false\n client[kResume]()\n }\n\n return pause ? constants.ERROR.PAUSED : 0\n }\n\n onBody (buf) {\n const { client, socket, statusCode, maxResponseSize } = this\n\n if (socket.destroyed) {\n return -1\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n assert(request)\n\n assert(this.timeoutType === TIMEOUT_BODY)\n if (this.timeout) {\n // istanbul ignore else: only for jest\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n assert(statusCode >= 200)\n\n if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {\n util.destroy(socket, new ResponseExceededMaxSizeError())\n return -1\n }\n\n this.bytesRead += buf.length\n\n if (request.onData(buf) === false) {\n return constants.ERROR.PAUSED\n }\n }\n\n onMessageComplete () {\n const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this\n\n if (socket.destroyed && (!statusCode || shouldKeepAlive)) {\n return -1\n }\n\n if (upgrade) {\n return\n }\n\n assert(statusCode >= 100)\n assert((this.headers.length & 1) === 0)\n\n const request = client[kQueue][client[kRunningIdx]]\n assert(request)\n\n this.statusCode = null\n this.statusText = ''\n this.bytesRead = 0\n this.contentLength = ''\n this.keepAlive = ''\n this.connection = ''\n\n this.headers = []\n this.headersSize = 0\n\n if (statusCode < 200) {\n return\n }\n\n /* istanbul ignore next: should be handled by llhttp? */\n if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {\n util.destroy(socket, new ResponseContentLengthMismatchError())\n return -1\n }\n\n request.onComplete(headers)\n\n client[kQueue][client[kRunningIdx]++] = null\n\n if (socket[kWriting]) {\n assert(client[kRunning] === 0)\n // Response completed before request.\n util.destroy(socket, new InformationalError('reset'))\n return constants.ERROR.PAUSED\n } else if (!shouldKeepAlive) {\n util.destroy(socket, new InformationalError('reset'))\n return constants.ERROR.PAUSED\n } else if (socket[kReset] && client[kRunning] === 0) {\n // Destroy socket once all requests have completed.\n // The request at the tail of the pipeline is the one\n // that requested reset and no further requests should\n // have been queued since then.\n util.destroy(socket, new InformationalError('reset'))\n return constants.ERROR.PAUSED\n } else if (client[kPipelining] == null || client[kPipelining] === 1) {\n // We must wait a full event loop cycle to reuse this socket to make sure\n // that non-spec compliant servers are not closing the connection even if they\n // said they won't.\n setImmediate(() => client[kResume]())\n } else {\n client[kResume]()\n }\n }\n}\n\nfunction onParserTimeout (parser) {\n const { socket, timeoutType, client, paused } = parser.deref()\n\n /* istanbul ignore else */\n if (timeoutType === TIMEOUT_HEADERS) {\n if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {\n assert(!paused, 'cannot be paused while waiting for headers')\n util.destroy(socket, new HeadersTimeoutError())\n }\n } else if (timeoutType === TIMEOUT_BODY) {\n if (!paused) {\n util.destroy(socket, new BodyTimeoutError())\n }\n } else if (timeoutType === TIMEOUT_KEEP_ALIVE) {\n assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])\n util.destroy(socket, new InformationalError('socket idle timeout'))\n }\n}\n\nasync function connectH1 (client, socket) {\n client[kSocket] = socket\n\n if (!llhttpInstance) {\n llhttpInstance = await llhttpPromise\n llhttpPromise = null\n }\n\n socket[kNoRef] = false\n socket[kWriting] = false\n socket[kReset] = false\n socket[kBlocking] = false\n socket[kParser] = new Parser(client, socket, llhttpInstance)\n\n addListener(socket, 'error', function (err) {\n assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n const parser = this[kParser]\n\n // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded\n // to the user.\n if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {\n // We treat all incoming data so for as a valid response.\n parser.onMessageComplete()\n return\n }\n\n this[kError] = err\n\n this[kClient][kOnError](err)\n })\n addListener(socket, 'readable', function () {\n const parser = this[kParser]\n\n if (parser) {\n parser.readMore()\n }\n })\n addListener(socket, 'end', function () {\n const parser = this[kParser]\n\n if (parser.statusCode && !parser.shouldKeepAlive) {\n // We treat all incoming data so far as a valid response.\n parser.onMessageComplete()\n return\n }\n\n util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n })\n addListener(socket, 'close', function () {\n const client = this[kClient]\n const parser = this[kParser]\n\n if (parser) {\n if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {\n // We treat all incoming data so far as a valid response.\n parser.onMessageComplete()\n }\n\n this[kParser].destroy()\n this[kParser] = null\n }\n\n const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n client[kSocket] = null\n client[kHTTPContext] = null // TODO (fix): This is hacky...\n\n if (client.destroyed) {\n assert(client[kPending] === 0)\n\n // Fail entire queue.\n const requests = client[kQueue].splice(client[kRunningIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n util.errorRequest(client, request, err)\n }\n } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {\n // Fail head of pipeline.\n const request = client[kQueue][client[kRunningIdx]]\n client[kQueue][client[kRunningIdx]++] = null\n\n util.errorRequest(client, request, err)\n }\n\n client[kPendingIdx] = client[kRunningIdx]\n\n assert(client[kRunning] === 0)\n\n client.emit('disconnect', client[kUrl], [client], err)\n\n client[kResume]()\n })\n\n let closed = false\n socket.on('close', () => {\n closed = true\n })\n\n return {\n version: 'h1',\n defaultPipelining: 1,\n write (...args) {\n return writeH1(client, ...args)\n },\n resume () {\n resumeH1(client)\n },\n destroy (err, callback) {\n if (closed) {\n queueMicrotask(callback)\n } else {\n socket.destroy(err).on('close', callback)\n }\n },\n get destroyed () {\n return socket.destroyed\n },\n busy (request) {\n if (socket[kWriting] || socket[kReset] || socket[kBlocking]) {\n return true\n }\n\n if (request) {\n if (client[kRunning] > 0 && !request.idempotent) {\n // Non-idempotent request cannot be retried.\n // Ensure that no other requests are inflight and\n // could cause failure.\n return true\n }\n\n if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {\n // Don't dispatch an upgrade until all preceding requests have completed.\n // A misbehaving server might upgrade the connection before all pipelined\n // request has completed.\n return true\n }\n\n if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&\n (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) {\n // Request with stream or iterator body can error while other requests\n // are inflight and indirectly error those as well.\n // Ensure this doesn't happen by waiting for inflight\n // to complete before dispatching.\n\n // Request with stream or iterator body cannot be retried.\n // Ensure that no other requests are inflight and\n // could cause failure.\n return true\n }\n }\n\n return false\n }\n }\n}\n\nfunction resumeH1 (client) {\n const socket = client[kSocket]\n\n if (socket && !socket.destroyed) {\n if (client[kSize] === 0) {\n if (!socket[kNoRef] && socket.unref) {\n socket.unref()\n socket[kNoRef] = true\n }\n } else if (socket[kNoRef] && socket.ref) {\n socket.ref()\n socket[kNoRef] = false\n }\n\n if (client[kSize] === 0) {\n if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) {\n socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE)\n }\n } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {\n if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {\n const request = client[kQueue][client[kRunningIdx]]\n const headersTimeout = request.headersTimeout != null\n ? request.headersTimeout\n : client[kHeadersTimeout]\n socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)\n }\n }\n }\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction writeH1 (client, request) {\n const { method, path, host, upgrade, blocking, reset } = request\n\n let { body, headers, contentLength } = request\n\n // https://tools.ietf.org/html/rfc7231#section-4.3.1\n // https://tools.ietf.org/html/rfc7231#section-4.3.2\n // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n // Sending a payload body on a request that does not\n // expect it can cause undefined behavior on some\n // servers and corrupt connection state. Do not\n // re-use the connection for further requests.\n\n const expectsPayload = (\n method === 'PUT' ||\n method === 'POST' ||\n method === 'PATCH' ||\n method === 'QUERY' ||\n method === 'PROPFIND' ||\n method === 'PROPPATCH'\n )\n\n if (util.isFormDataLike(body)) {\n if (!extractBody) {\n extractBody = require('../web/fetch/body.js').extractBody\n }\n\n const [bodyStream, contentType] = extractBody(body)\n if (request.contentType == null) {\n headers.push('content-type', contentType)\n }\n body = bodyStream.stream\n contentLength = bodyStream.length\n } else if (util.isBlobLike(body) && request.contentType == null && body.type) {\n headers.push('content-type', body.type)\n }\n\n if (body && typeof body.read === 'function') {\n // Try to read EOF in order to get length.\n body.read(0)\n }\n\n const bodyLength = util.bodyLength(body)\n\n contentLength = bodyLength ?? contentLength\n\n if (contentLength === null) {\n contentLength = request.contentLength\n }\n\n if (contentLength === 0 && !expectsPayload) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD NOT send a Content-Length header field when\n // the request message does not contain a payload body and the method\n // semantics do not anticipate such a body.\n\n contentLength = null\n }\n\n // https://github.com/nodejs/undici/issues/2046\n // A user agent may send a Content-Length header with 0 value, this should be allowed.\n if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {\n if (client[kStrictContentLength]) {\n util.errorRequest(client, request, new RequestContentLengthMismatchError())\n return false\n }\n\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n\n const socket = client[kSocket]\n\n const abort = (err) => {\n if (request.aborted || request.completed) {\n return\n }\n\n util.errorRequest(client, request, err || new RequestAbortedError())\n\n util.destroy(body)\n util.destroy(socket, new InformationalError('aborted'))\n }\n\n try {\n request.onConnect(abort)\n } catch (err) {\n util.errorRequest(client, request, err)\n }\n\n if (request.aborted) {\n return false\n }\n\n if (method === 'HEAD') {\n // https://github.com/mcollina/undici/issues/258\n // Close after a HEAD request to interop with misbehaving servers\n // that may send a body in the response.\n\n socket[kReset] = true\n }\n\n if (upgrade || method === 'CONNECT') {\n // On CONNECT or upgrade, block pipeline from dispatching further\n // requests on this connection.\n\n socket[kReset] = true\n }\n\n if (reset != null) {\n socket[kReset] = reset\n }\n\n if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {\n socket[kReset] = true\n }\n\n if (blocking) {\n socket[kBlocking] = true\n }\n\n let header = `${method} ${path} HTTP/1.1\\r\\n`\n\n if (typeof host === 'string') {\n header += `host: ${host}\\r\\n`\n } else {\n header += client[kHostHeader]\n }\n\n if (upgrade) {\n header += `connection: upgrade\\r\\nupgrade: ${upgrade}\\r\\n`\n } else if (client[kPipelining] && !socket[kReset]) {\n header += 'connection: keep-alive\\r\\n'\n } else {\n header += 'connection: close\\r\\n'\n }\n\n if (Array.isArray(headers)) {\n for (let n = 0; n < headers.length; n += 2) {\n const key = headers[n + 0]\n const val = headers[n + 1]\n\n if (Array.isArray(val)) {\n for (let i = 0; i < val.length; i++) {\n header += `${key}: ${val[i]}\\r\\n`\n }\n } else {\n header += `${key}: ${val}\\r\\n`\n }\n }\n }\n\n if (channels.sendHeaders.hasSubscribers) {\n channels.sendHeaders.publish({ request, headers: header, socket })\n }\n\n /* istanbul ignore else: assertion */\n if (!body || bodyLength === 0) {\n writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload)\n } else if (util.isBuffer(body)) {\n writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload)\n } else if (util.isBlobLike(body)) {\n if (typeof body.stream === 'function') {\n writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload)\n } else {\n writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload)\n }\n } else if (util.isStream(body)) {\n writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload)\n } else if (util.isIterable(body)) {\n writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload)\n } else {\n assert(false)\n }\n\n return true\n}\n\nfunction writeStream (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n let finished = false\n\n const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })\n\n const onData = function (chunk) {\n if (finished) {\n return\n }\n\n try {\n if (!writer.write(chunk) && this.pause) {\n this.pause()\n }\n } catch (err) {\n util.destroy(this, err)\n }\n }\n const onDrain = function () {\n if (finished) {\n return\n }\n\n if (body.resume) {\n body.resume()\n }\n }\n const onClose = function () {\n // 'close' might be emitted *before* 'error' for\n // broken streams. Wait a tick to avoid this case.\n queueMicrotask(() => {\n // It's only safe to remove 'error' listener after\n // 'close'.\n body.removeListener('error', onFinished)\n })\n\n if (!finished) {\n const err = new RequestAbortedError()\n queueMicrotask(() => onFinished(err))\n }\n }\n const onFinished = function (err) {\n if (finished) {\n return\n }\n\n finished = true\n\n assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))\n\n socket\n .off('drain', onDrain)\n .off('error', onFinished)\n\n body\n .removeListener('data', onData)\n .removeListener('end', onFinished)\n .removeListener('close', onClose)\n\n if (!err) {\n try {\n writer.end()\n } catch (er) {\n err = er\n }\n }\n\n writer.destroy(err)\n\n if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {\n util.destroy(body, err)\n } else {\n util.destroy(body)\n }\n }\n\n body\n .on('data', onData)\n .on('end', onFinished)\n .on('error', onFinished)\n .on('close', onClose)\n\n if (body.resume) {\n body.resume()\n }\n\n socket\n .on('drain', onDrain)\n .on('error', onFinished)\n\n if (body.errorEmitted ?? body.errored) {\n setImmediate(() => onFinished(body.errored))\n } else if (body.endEmitted ?? body.readableEnded) {\n setImmediate(() => onFinished(null))\n }\n\n if (body.closeEmitted ?? body.closed) {\n setImmediate(onClose)\n }\n}\n\nfunction writeBuffer (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n try {\n if (!body) {\n if (contentLength === 0) {\n socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n } else {\n assert(contentLength === null, 'no body must not have content length')\n socket.write(`${header}\\r\\n`, 'latin1')\n }\n } else if (util.isBuffer(body)) {\n assert(contentLength === body.byteLength, 'buffer body must have content length')\n\n socket.cork()\n socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n socket.write(body)\n socket.uncork()\n request.onBodySent(body)\n\n if (!expectsPayload && request.reset !== false) {\n socket[kReset] = true\n }\n }\n request.onRequestSent()\n\n client[kResume]()\n } catch (err) {\n abort(err)\n }\n}\n\nasync function writeBlob (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n assert(contentLength === body.size, 'blob body must have content length')\n\n try {\n if (contentLength != null && contentLength !== body.size) {\n throw new RequestContentLengthMismatchError()\n }\n\n const buffer = Buffer.from(await body.arrayBuffer())\n\n socket.cork()\n socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n socket.write(buffer)\n socket.uncork()\n\n request.onBodySent(buffer)\n request.onRequestSent()\n\n if (!expectsPayload && request.reset !== false) {\n socket[kReset] = true\n }\n\n client[kResume]()\n } catch (err) {\n abort(err)\n }\n}\n\nasync function writeIterable (abort, body, client, request, socket, contentLength, header, expectsPayload) {\n assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n let callback = null\n function onDrain () {\n if (callback) {\n const cb = callback\n callback = null\n cb()\n }\n }\n\n const waitForDrain = () => new Promise((resolve, reject) => {\n assert(callback === null)\n\n if (socket[kError]) {\n reject(socket[kError])\n } else {\n callback = resolve\n }\n })\n\n socket\n .on('close', onDrain)\n .on('drain', onDrain)\n\n const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })\n try {\n // It's up to the user to somehow abort the async iterable.\n for await (const chunk of body) {\n if (socket[kError]) {\n throw socket[kError]\n }\n\n if (!writer.write(chunk)) {\n await waitForDrain()\n }\n }\n\n writer.end()\n } catch (err) {\n writer.destroy(err)\n } finally {\n socket\n .off('close', onDrain)\n .off('drain', onDrain)\n }\n}\n\nclass AsyncWriter {\n constructor ({ abort, socket, request, contentLength, client, expectsPayload, header }) {\n this.socket = socket\n this.request = request\n this.contentLength = contentLength\n this.client = client\n this.bytesWritten = 0\n this.expectsPayload = expectsPayload\n this.header = header\n this.abort = abort\n\n socket[kWriting] = true\n }\n\n write (chunk) {\n const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this\n\n if (socket[kError]) {\n throw socket[kError]\n }\n\n if (socket.destroyed) {\n return false\n }\n\n const len = Buffer.byteLength(chunk)\n if (!len) {\n return true\n }\n\n // We should defer writing chunks.\n if (contentLength !== null && bytesWritten + len > contentLength) {\n if (client[kStrictContentLength]) {\n throw new RequestContentLengthMismatchError()\n }\n\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n\n socket.cork()\n\n if (bytesWritten === 0) {\n if (!expectsPayload && request.reset !== false) {\n socket[kReset] = true\n }\n\n if (contentLength === null) {\n socket.write(`${header}transfer-encoding: chunked\\r\\n`, 'latin1')\n } else {\n socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n }\n }\n\n if (contentLength === null) {\n socket.write(`\\r\\n${len.toString(16)}\\r\\n`, 'latin1')\n }\n\n this.bytesWritten += len\n\n const ret = socket.write(chunk)\n\n socket.uncork()\n\n request.onBodySent(chunk)\n\n if (!ret) {\n if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n // istanbul ignore else: only for jest\n if (socket[kParser].timeout.refresh) {\n socket[kParser].timeout.refresh()\n }\n }\n }\n\n return ret\n }\n\n end () {\n const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this\n request.onRequestSent()\n\n socket[kWriting] = false\n\n if (socket[kError]) {\n throw socket[kError]\n }\n\n if (socket.destroyed) {\n return\n }\n\n if (bytesWritten === 0) {\n if (expectsPayload) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD send a Content-Length in a request message when\n // no Transfer-Encoding is sent and the request method defines a meaning\n // for an enclosed payload body.\n\n socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n } else {\n socket.write(`${header}\\r\\n`, 'latin1')\n }\n } else if (contentLength === null) {\n socket.write('\\r\\n0\\r\\n\\r\\n', 'latin1')\n }\n\n if (contentLength !== null && bytesWritten !== contentLength) {\n if (client[kStrictContentLength]) {\n throw new RequestContentLengthMismatchError()\n } else {\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n }\n\n if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n // istanbul ignore else: only for jest\n if (socket[kParser].timeout.refresh) {\n socket[kParser].timeout.refresh()\n }\n }\n\n client[kResume]()\n }\n\n destroy (err) {\n const { socket, client, abort } = this\n\n socket[kWriting] = false\n\n if (err) {\n assert(client[kRunning] <= 1, 'pipeline should only contain this request')\n abort(err)\n }\n }\n}\n\nmodule.exports = connectH1\n","'use strict'\n\nconst assert = require('node:assert')\nconst { pipeline } = require('node:stream')\nconst util = require('../core/util.js')\nconst {\n RequestContentLengthMismatchError,\n RequestAbortedError,\n SocketError,\n InformationalError\n} = require('../core/errors.js')\nconst {\n kUrl,\n kReset,\n kClient,\n kRunning,\n kPending,\n kQueue,\n kPendingIdx,\n kRunningIdx,\n kError,\n kSocket,\n kStrictContentLength,\n kOnError,\n kMaxConcurrentStreams,\n kHTTP2Session,\n kResume,\n kSize,\n kHTTPContext\n} = require('../core/symbols.js')\n\nconst kOpenStreams = Symbol('open streams')\n\nlet extractBody\n\n// Experimental\nlet h2ExperimentalWarned = false\n\n/** @type {import('http2')} */\nlet http2\ntry {\n http2 = require('node:http2')\n} catch {\n // @ts-ignore\n http2 = { constants: {} }\n}\n\nconst {\n constants: {\n HTTP2_HEADER_AUTHORITY,\n HTTP2_HEADER_METHOD,\n HTTP2_HEADER_PATH,\n HTTP2_HEADER_SCHEME,\n HTTP2_HEADER_CONTENT_LENGTH,\n HTTP2_HEADER_EXPECT,\n HTTP2_HEADER_STATUS\n }\n} = http2\n\nfunction parseH2Headers (headers) {\n const result = []\n\n for (const [name, value] of Object.entries(headers)) {\n // h2 may concat the header value by array\n // e.g. Set-Cookie\n if (Array.isArray(value)) {\n for (const subvalue of value) {\n // we need to provide each header value of header name\n // because the headers handler expect name-value pair\n result.push(Buffer.from(name), Buffer.from(subvalue))\n }\n } else {\n result.push(Buffer.from(name), Buffer.from(value))\n }\n }\n\n return result\n}\n\nasync function connectH2 (client, socket) {\n client[kSocket] = socket\n\n if (!h2ExperimentalWarned) {\n h2ExperimentalWarned = true\n process.emitWarning('H2 support is experimental, expect them to change at any time.', {\n code: 'UNDICI-H2'\n })\n }\n\n const session = http2.connect(client[kUrl], {\n createConnection: () => socket,\n peerMaxConcurrentStreams: client[kMaxConcurrentStreams]\n })\n\n session[kOpenStreams] = 0\n session[kClient] = client\n session[kSocket] = socket\n\n util.addListener(session, 'error', onHttp2SessionError)\n util.addListener(session, 'frameError', onHttp2FrameError)\n util.addListener(session, 'end', onHttp2SessionEnd)\n util.addListener(session, 'goaway', onHTTP2GoAway)\n util.addListener(session, 'close', function () {\n const { [kClient]: client } = this\n const { [kSocket]: socket } = client\n\n const err = this[kSocket][kError] || this[kError] || new SocketError('closed', util.getSocketInfo(socket))\n\n client[kHTTP2Session] = null\n\n if (client.destroyed) {\n assert(client[kPending] === 0)\n\n // Fail entire queue.\n const requests = client[kQueue].splice(client[kRunningIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n util.errorRequest(client, request, err)\n }\n }\n })\n\n session.unref()\n\n client[kHTTP2Session] = session\n socket[kHTTP2Session] = session\n\n util.addListener(socket, 'error', function (err) {\n assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n this[kError] = err\n\n this[kClient][kOnError](err)\n })\n\n util.addListener(socket, 'end', function () {\n util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n })\n\n util.addListener(socket, 'close', function () {\n const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n client[kSocket] = null\n\n if (this[kHTTP2Session] != null) {\n this[kHTTP2Session].destroy(err)\n }\n\n client[kPendingIdx] = client[kRunningIdx]\n\n assert(client[kRunning] === 0)\n\n client.emit('disconnect', client[kUrl], [client], err)\n\n client[kResume]()\n })\n\n let closed = false\n socket.on('close', () => {\n closed = true\n })\n\n return {\n version: 'h2',\n defaultPipelining: Infinity,\n write (...args) {\n return writeH2(client, ...args)\n },\n resume () {\n resumeH2(client)\n },\n destroy (err, callback) {\n if (closed) {\n queueMicrotask(callback)\n } else {\n // Destroying the socket will trigger the session close\n socket.destroy(err).on('close', callback)\n }\n },\n get destroyed () {\n return socket.destroyed\n },\n busy () {\n return false\n }\n }\n}\n\nfunction resumeH2 (client) {\n const socket = client[kSocket]\n\n if (socket?.destroyed === false) {\n if (client[kSize] === 0 && client[kMaxConcurrentStreams] === 0) {\n socket.unref()\n client[kHTTP2Session].unref()\n } else {\n socket.ref()\n client[kHTTP2Session].ref()\n }\n }\n}\n\nfunction onHttp2SessionError (err) {\n assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n this[kSocket][kError] = err\n this[kClient][kOnError](err)\n}\n\nfunction onHttp2FrameError (type, code, id) {\n if (id === 0) {\n const err = new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`)\n this[kSocket][kError] = err\n this[kClient][kOnError](err)\n }\n}\n\nfunction onHttp2SessionEnd () {\n const err = new SocketError('other side closed', util.getSocketInfo(this[kSocket]))\n this.destroy(err)\n util.destroy(this[kSocket], err)\n}\n\n/**\n * This is the root cause of #3011\n * We need to handle GOAWAY frames properly, and trigger the session close\n * along with the socket right away\n */\nfunction onHTTP2GoAway (code) {\n // We cannot recover, so best to close the session and the socket\n const err = this[kError] || new SocketError(`HTTP/2: \"GOAWAY\" frame received with code ${code}`, util.getSocketInfo(this))\n const client = this[kClient]\n\n client[kSocket] = null\n client[kHTTPContext] = null\n\n if (this[kHTTP2Session] != null) {\n this[kHTTP2Session].destroy(err)\n this[kHTTP2Session] = null\n }\n\n util.destroy(this[kSocket], err)\n\n // Fail head of pipeline.\n if (client[kRunningIdx] < client[kQueue].length) {\n const request = client[kQueue][client[kRunningIdx]]\n client[kQueue][client[kRunningIdx]++] = null\n util.errorRequest(client, request, err)\n client[kPendingIdx] = client[kRunningIdx]\n }\n\n assert(client[kRunning] === 0)\n\n client.emit('disconnect', client[kUrl], [client], err)\n\n client[kResume]()\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction writeH2 (client, request) {\n const session = client[kHTTP2Session]\n const { method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request\n let { body } = request\n\n if (upgrade) {\n util.errorRequest(client, request, new Error('Upgrade not supported for H2'))\n return false\n }\n\n const headers = {}\n for (let n = 0; n < reqHeaders.length; n += 2) {\n const key = reqHeaders[n + 0]\n const val = reqHeaders[n + 1]\n\n if (Array.isArray(val)) {\n for (let i = 0; i < val.length; i++) {\n if (headers[key]) {\n headers[key] += `,${val[i]}`\n } else {\n headers[key] = val[i]\n }\n }\n } else {\n headers[key] = val\n }\n }\n\n /** @type {import('node:http2').ClientHttp2Stream} */\n let stream\n\n const { hostname, port } = client[kUrl]\n\n headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}`\n headers[HTTP2_HEADER_METHOD] = method\n\n const abort = (err) => {\n if (request.aborted || request.completed) {\n return\n }\n\n err = err || new RequestAbortedError()\n\n util.errorRequest(client, request, err)\n\n if (stream != null) {\n util.destroy(stream, err)\n }\n\n // We do not destroy the socket as we can continue using the session\n // the stream get's destroyed and the session remains to create new streams\n util.destroy(body, err)\n client[kQueue][client[kRunningIdx]++] = null\n client[kResume]()\n }\n\n try {\n // We are already connected, streams are pending.\n // We can call on connect, and wait for abort\n request.onConnect(abort)\n } catch (err) {\n util.errorRequest(client, request, err)\n }\n\n if (request.aborted) {\n return false\n }\n\n if (method === 'CONNECT') {\n session.ref()\n // We are already connected, streams are pending, first request\n // will create a new stream. We trigger a request to create the stream and wait until\n // `ready` event is triggered\n // We disabled endStream to allow the user to write to the stream\n stream = session.request(headers, { endStream: false, signal })\n\n if (stream.id && !stream.pending) {\n request.onUpgrade(null, null, stream)\n ++session[kOpenStreams]\n client[kQueue][client[kRunningIdx]++] = null\n } else {\n stream.once('ready', () => {\n request.onUpgrade(null, null, stream)\n ++session[kOpenStreams]\n client[kQueue][client[kRunningIdx]++] = null\n })\n }\n\n stream.once('close', () => {\n session[kOpenStreams] -= 1\n if (session[kOpenStreams] === 0) session.unref()\n })\n\n return true\n }\n\n // https://tools.ietf.org/html/rfc7540#section-8.3\n // :path and :scheme headers must be omitted when sending CONNECT\n\n headers[HTTP2_HEADER_PATH] = path\n headers[HTTP2_HEADER_SCHEME] = 'https'\n\n // https://tools.ietf.org/html/rfc7231#section-4.3.1\n // https://tools.ietf.org/html/rfc7231#section-4.3.2\n // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n // Sending a payload body on a request that does not\n // expect it can cause undefined behavior on some\n // servers and corrupt connection state. Do not\n // re-use the connection for further requests.\n\n const expectsPayload = (\n method === 'PUT' ||\n method === 'POST' ||\n method === 'PATCH'\n )\n\n if (body && typeof body.read === 'function') {\n // Try to read EOF in order to get length.\n body.read(0)\n }\n\n let contentLength = util.bodyLength(body)\n\n if (util.isFormDataLike(body)) {\n extractBody ??= require('../web/fetch/body.js').extractBody\n\n const [bodyStream, contentType] = extractBody(body)\n headers['content-type'] = contentType\n\n body = bodyStream.stream\n contentLength = bodyStream.length\n }\n\n if (contentLength == null) {\n contentLength = request.contentLength\n }\n\n if (contentLength === 0 || !expectsPayload) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD NOT send a Content-Length header field when\n // the request message does not contain a payload body and the method\n // semantics do not anticipate such a body.\n\n contentLength = null\n }\n\n // https://github.com/nodejs/undici/issues/2046\n // A user agent may send a Content-Length header with 0 value, this should be allowed.\n if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {\n if (client[kStrictContentLength]) {\n util.errorRequest(client, request, new RequestContentLengthMismatchError())\n return false\n }\n\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n\n if (contentLength != null) {\n assert(body, 'no body must not have content length')\n headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`\n }\n\n session.ref()\n\n const shouldEndStream = method === 'GET' || method === 'HEAD' || body === null\n if (expectContinue) {\n headers[HTTP2_HEADER_EXPECT] = '100-continue'\n stream = session.request(headers, { endStream: shouldEndStream, signal })\n\n stream.once('continue', writeBodyH2)\n } else {\n stream = session.request(headers, {\n endStream: shouldEndStream,\n signal\n })\n writeBodyH2()\n }\n\n // Increment counter as we have new streams open\n ++session[kOpenStreams]\n\n stream.once('response', headers => {\n const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers\n request.onResponseStarted()\n\n // Due to the stream nature, it is possible we face a race condition\n // where the stream has been assigned, but the request has been aborted\n // the request remains in-flight and headers hasn't been received yet\n // for those scenarios, best effort is to destroy the stream immediately\n // as there's no value to keep it open.\n if (request.aborted) {\n const err = new RequestAbortedError()\n util.errorRequest(client, request, err)\n util.destroy(stream, err)\n return\n }\n\n if (request.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), '') === false) {\n stream.pause()\n }\n\n stream.on('data', (chunk) => {\n if (request.onData(chunk) === false) {\n stream.pause()\n }\n })\n })\n\n stream.once('end', () => {\n // When state is null, it means we haven't consumed body and the stream still do not have\n // a state.\n // Present specially when using pipeline or stream\n if (stream.state?.state == null || stream.state.state < 6) {\n request.onComplete([])\n }\n\n if (session[kOpenStreams] === 0) {\n // Stream is closed or half-closed-remote (6), decrement counter and cleanup\n // It does not have sense to continue working with the stream as we do not\n // have yet RST_STREAM support on client-side\n\n session.unref()\n }\n\n abort(new InformationalError('HTTP/2: stream half-closed (remote)'))\n client[kQueue][client[kRunningIdx]++] = null\n client[kPendingIdx] = client[kRunningIdx]\n client[kResume]()\n })\n\n stream.once('close', () => {\n session[kOpenStreams] -= 1\n if (session[kOpenStreams] === 0) {\n session.unref()\n }\n })\n\n stream.once('error', function (err) {\n abort(err)\n })\n\n stream.once('frameError', (type, code) => {\n abort(new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`))\n })\n\n // stream.on('aborted', () => {\n // // TODO(HTTP/2): Support aborted\n // })\n\n // stream.on('timeout', () => {\n // // TODO(HTTP/2): Support timeout\n // })\n\n // stream.on('push', headers => {\n // // TODO(HTTP/2): Support push\n // })\n\n // stream.on('trailers', headers => {\n // // TODO(HTTP/2): Support trailers\n // })\n\n return true\n\n function writeBodyH2 () {\n /* istanbul ignore else: assertion */\n if (!body || contentLength === 0) {\n writeBuffer(\n abort,\n stream,\n null,\n client,\n request,\n client[kSocket],\n contentLength,\n expectsPayload\n )\n } else if (util.isBuffer(body)) {\n writeBuffer(\n abort,\n stream,\n body,\n client,\n request,\n client[kSocket],\n contentLength,\n expectsPayload\n )\n } else if (util.isBlobLike(body)) {\n if (typeof body.stream === 'function') {\n writeIterable(\n abort,\n stream,\n body.stream(),\n client,\n request,\n client[kSocket],\n contentLength,\n expectsPayload\n )\n } else {\n writeBlob(\n abort,\n stream,\n body,\n client,\n request,\n client[kSocket],\n contentLength,\n expectsPayload\n )\n }\n } else if (util.isStream(body)) {\n writeStream(\n abort,\n client[kSocket],\n expectsPayload,\n stream,\n body,\n client,\n request,\n contentLength\n )\n } else if (util.isIterable(body)) {\n writeIterable(\n abort,\n stream,\n body,\n client,\n request,\n client[kSocket],\n contentLength,\n expectsPayload\n )\n } else {\n assert(false)\n }\n }\n}\n\nfunction writeBuffer (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n try {\n if (body != null && util.isBuffer(body)) {\n assert(contentLength === body.byteLength, 'buffer body must have content length')\n h2stream.cork()\n h2stream.write(body)\n h2stream.uncork()\n h2stream.end()\n\n request.onBodySent(body)\n }\n\n if (!expectsPayload) {\n socket[kReset] = true\n }\n\n request.onRequestSent()\n client[kResume]()\n } catch (error) {\n abort(error)\n }\n}\n\nfunction writeStream (abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {\n assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n // For HTTP/2, is enough to pipe the stream\n const pipe = pipeline(\n body,\n h2stream,\n (err) => {\n if (err) {\n util.destroy(pipe, err)\n abort(err)\n } else {\n util.removeAllListeners(pipe)\n request.onRequestSent()\n\n if (!expectsPayload) {\n socket[kReset] = true\n }\n\n client[kResume]()\n }\n }\n )\n\n util.addListener(pipe, 'data', onPipeData)\n\n function onPipeData (chunk) {\n request.onBodySent(chunk)\n }\n}\n\nasync function writeBlob (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n assert(contentLength === body.size, 'blob body must have content length')\n\n try {\n if (contentLength != null && contentLength !== body.size) {\n throw new RequestContentLengthMismatchError()\n }\n\n const buffer = Buffer.from(await body.arrayBuffer())\n\n h2stream.cork()\n h2stream.write(buffer)\n h2stream.uncork()\n h2stream.end()\n\n request.onBodySent(buffer)\n request.onRequestSent()\n\n if (!expectsPayload) {\n socket[kReset] = true\n }\n\n client[kResume]()\n } catch (err) {\n abort(err)\n }\n}\n\nasync function writeIterable (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {\n assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n let callback = null\n function onDrain () {\n if (callback) {\n const cb = callback\n callback = null\n cb()\n }\n }\n\n const waitForDrain = () => new Promise((resolve, reject) => {\n assert(callback === null)\n\n if (socket[kError]) {\n reject(socket[kError])\n } else {\n callback = resolve\n }\n })\n\n h2stream\n .on('close', onDrain)\n .on('drain', onDrain)\n\n try {\n // It's up to the user to somehow abort the async iterable.\n for await (const chunk of body) {\n if (socket[kError]) {\n throw socket[kError]\n }\n\n const res = h2stream.write(chunk)\n request.onBodySent(chunk)\n if (!res) {\n await waitForDrain()\n }\n }\n\n h2stream.end()\n\n request.onRequestSent()\n\n if (!expectsPayload) {\n socket[kReset] = true\n }\n\n client[kResume]()\n } catch (err) {\n abort(err)\n } finally {\n h2stream\n .off('close', onDrain)\n .off('drain', onDrain)\n }\n}\n\nmodule.exports = connectH2\n","'use strict'\n\nconst util = require('../core/util')\nconst { kBodyUsed } = require('../core/symbols')\nconst assert = require('node:assert')\nconst { InvalidArgumentError } = require('../core/errors')\nconst EE = require('node:events')\n\nconst redirectableStatusCodes = [300, 301, 302, 303, 307, 308]\n\nconst kBody = Symbol('body')\n\nclass BodyAsyncIterable {\n constructor (body) {\n this[kBody] = body\n this[kBodyUsed] = false\n }\n\n async * [Symbol.asyncIterator] () {\n assert(!this[kBodyUsed], 'disturbed')\n this[kBodyUsed] = true\n yield * this[kBody]\n }\n}\n\nclass RedirectHandler {\n constructor (dispatch, maxRedirections, opts, handler) {\n if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n throw new InvalidArgumentError('maxRedirections must be a positive number')\n }\n\n util.validateHandler(handler, opts.method, opts.upgrade)\n\n this.dispatch = dispatch\n this.location = null\n this.abort = null\n this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy\n this.maxRedirections = maxRedirections\n this.handler = handler\n this.history = []\n this.redirectionLimitReached = false\n\n if (util.isStream(this.opts.body)) {\n // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n // so that it can be dispatched again?\n // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n if (util.bodyLength(this.opts.body) === 0) {\n this.opts.body\n .on('data', function () {\n assert(false)\n })\n }\n\n if (typeof this.opts.body.readableDidRead !== 'boolean') {\n this.opts.body[kBodyUsed] = false\n EE.prototype.on.call(this.opts.body, 'data', function () {\n this[kBodyUsed] = true\n })\n }\n } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {\n // TODO (fix): We can't access ReadableStream internal state\n // to determine whether or not it has been disturbed. This is just\n // a workaround.\n this.opts.body = new BodyAsyncIterable(this.opts.body)\n } else if (\n this.opts.body &&\n typeof this.opts.body !== 'string' &&\n !ArrayBuffer.isView(this.opts.body) &&\n util.isIterable(this.opts.body)\n ) {\n // TODO: Should we allow re-using iterable if !this.opts.idempotent\n // or through some other flag?\n this.opts.body = new BodyAsyncIterable(this.opts.body)\n }\n }\n\n onConnect (abort) {\n this.abort = abort\n this.handler.onConnect(abort, { history: this.history })\n }\n\n onUpgrade (statusCode, headers, socket) {\n this.handler.onUpgrade(statusCode, headers, socket)\n }\n\n onError (error) {\n this.handler.onError(error)\n }\n\n onHeaders (statusCode, headers, resume, statusText) {\n this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)\n ? null\n : parseLocation(statusCode, headers)\n\n if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) {\n if (this.request) {\n this.request.abort(new Error('max redirects'))\n }\n\n this.redirectionLimitReached = true\n this.abort(new Error('max redirects'))\n return\n }\n\n if (this.opts.origin) {\n this.history.push(new URL(this.opts.path, this.opts.origin))\n }\n\n if (!this.location) {\n return this.handler.onHeaders(statusCode, headers, resume, statusText)\n }\n\n const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))\n const path = search ? `${pathname}${search}` : pathname\n\n // Remove headers referring to the original URL.\n // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.\n // https://tools.ietf.org/html/rfc7231#section-6.4\n this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)\n this.opts.path = path\n this.opts.origin = origin\n this.opts.maxRedirections = 0\n this.opts.query = null\n\n // https://tools.ietf.org/html/rfc7231#section-6.4.4\n // In case of HTTP 303, always replace method to be either HEAD or GET\n if (statusCode === 303 && this.opts.method !== 'HEAD') {\n this.opts.method = 'GET'\n this.opts.body = null\n }\n }\n\n onData (chunk) {\n if (this.location) {\n /*\n https://tools.ietf.org/html/rfc7231#section-6.4\n\n TLDR: undici always ignores 3xx response bodies.\n\n Redirection is used to serve the requested resource from another URL, so it is assumes that\n no body is generated (and thus can be ignored). Even though generating a body is not prohibited.\n\n For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually\n (which means it's optional and not mandated) contain just an hyperlink to the value of\n the Location response header, so the body can be ignored safely.\n\n For status 300, which is \"Multiple Choices\", the spec mentions both generating a Location\n response header AND a response body with the other possible location to follow.\n Since the spec explicitly chooses not to specify a format for such body and leave it to\n servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.\n */\n } else {\n return this.handler.onData(chunk)\n }\n }\n\n onComplete (trailers) {\n if (this.location) {\n /*\n https://tools.ietf.org/html/rfc7231#section-6.4\n\n TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections\n and neither are useful if present.\n\n See comment on onData method above for more detailed information.\n */\n\n this.location = null\n this.abort = null\n\n this.dispatch(this.opts, this)\n } else {\n this.handler.onComplete(trailers)\n }\n }\n\n onBodySent (chunk) {\n if (this.handler.onBodySent) {\n this.handler.onBodySent(chunk)\n }\n }\n}\n\nfunction parseLocation (statusCode, headers) {\n if (redirectableStatusCodes.indexOf(statusCode) === -1) {\n return null\n }\n\n for (let i = 0; i < headers.length; i += 2) {\n if (headers[i].length === 8 && util.headerNameToString(headers[i]) === 'location') {\n return headers[i + 1]\n }\n }\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4.4\nfunction shouldRemoveHeader (header, removeContent, unknownOrigin) {\n if (header.length === 4) {\n return util.headerNameToString(header) === 'host'\n }\n if (removeContent && util.headerNameToString(header).startsWith('content-')) {\n return true\n }\n if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {\n const name = util.headerNameToString(header)\n return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'\n }\n return false\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4\nfunction cleanRequestHeaders (headers, removeContent, unknownOrigin) {\n const ret = []\n if (Array.isArray(headers)) {\n for (let i = 0; i < headers.length; i += 2) {\n if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {\n ret.push(headers[i], headers[i + 1])\n }\n }\n } else if (headers && typeof headers === 'object') {\n for (const key of Object.keys(headers)) {\n if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {\n ret.push(key, headers[key])\n }\n }\n } else {\n assert(headers == null, 'headers must be an object or an array')\n }\n return ret\n}\n\nmodule.exports = RedirectHandler\n","'use strict'\n\nconst RedirectHandler = require('../handler/redirect-handler')\n\nfunction createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {\n return (dispatch) => {\n return function Intercept (opts, handler) {\n const { maxRedirections = defaultMaxRedirections } = opts\n\n if (!maxRedirections) {\n return dispatch(opts, handler)\n }\n\n const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)\n opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.\n return dispatch(opts, redirectHandler)\n }\n }\n}\n\nmodule.exports = createRedirectInterceptor\n","// @ts-check\n\n'use strict'\n\nconst assert = require('node:assert')\nconst net = require('node:net')\nconst http = require('node:http')\nconst util = require('../core/util.js')\nconst { channels } = require('../core/diagnostics.js')\nconst Request = require('../core/request.js')\nconst DispatcherBase = require('./dispatcher-base')\nconst {\n InvalidArgumentError,\n InformationalError,\n ClientDestroyedError\n} = require('../core/errors.js')\nconst buildConnector = require('../core/connect.js')\nconst {\n kUrl,\n kServerName,\n kClient,\n kBusy,\n kConnect,\n kResuming,\n kRunning,\n kPending,\n kSize,\n kQueue,\n kConnected,\n kConnecting,\n kNeedDrain,\n kKeepAliveDefaultTimeout,\n kHostHeader,\n kPendingIdx,\n kRunningIdx,\n kError,\n kPipelining,\n kKeepAliveTimeoutValue,\n kMaxHeadersSize,\n kKeepAliveMaxTimeout,\n kKeepAliveTimeoutThreshold,\n kHeadersTimeout,\n kBodyTimeout,\n kStrictContentLength,\n kConnector,\n kMaxRedirections,\n kMaxRequests,\n kCounter,\n kClose,\n kDestroy,\n kDispatch,\n kInterceptors,\n kLocalAddress,\n kMaxResponseSize,\n kOnError,\n kHTTPContext,\n kMaxConcurrentStreams,\n kResume\n} = require('../core/symbols.js')\nconst connectH1 = require('./client-h1.js')\nconst connectH2 = require('./client-h2.js')\nlet deprecatedInterceptorWarned = false\n\nconst kClosedResolve = Symbol('kClosedResolve')\n\nconst noop = () => {}\n\nfunction getPipelining (client) {\n return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1\n}\n\n/**\n * @type {import('../../types/client.js').default}\n */\nclass Client extends DispatcherBase {\n /**\n *\n * @param {string|URL} url\n * @param {import('../../types/client.js').Client.Options} options\n */\n constructor (url, {\n interceptors,\n maxHeaderSize,\n headersTimeout,\n socketTimeout,\n requestTimeout,\n connectTimeout,\n bodyTimeout,\n idleTimeout,\n keepAlive,\n keepAliveTimeout,\n maxKeepAliveTimeout,\n keepAliveMaxTimeout,\n keepAliveTimeoutThreshold,\n socketPath,\n pipelining,\n tls,\n strictContentLength,\n maxCachedSessions,\n maxRedirections,\n connect,\n maxRequestsPerClient,\n localAddress,\n maxResponseSize,\n autoSelectFamily,\n autoSelectFamilyAttemptTimeout,\n // h2\n maxConcurrentStreams,\n allowH2,\n webSocket\n } = {}) {\n super({ webSocket })\n\n if (keepAlive !== undefined) {\n throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')\n }\n\n if (socketTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')\n }\n\n if (requestTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')\n }\n\n if (idleTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')\n }\n\n if (maxKeepAliveTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')\n }\n\n if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {\n throw new InvalidArgumentError('invalid maxHeaderSize')\n }\n\n if (socketPath != null && typeof socketPath !== 'string') {\n throw new InvalidArgumentError('invalid socketPath')\n }\n\n if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {\n throw new InvalidArgumentError('invalid connectTimeout')\n }\n\n if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {\n throw new InvalidArgumentError('invalid keepAliveTimeout')\n }\n\n if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {\n throw new InvalidArgumentError('invalid keepAliveMaxTimeout')\n }\n\n if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {\n throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')\n }\n\n if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {\n throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')\n }\n\n if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {\n throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')\n }\n\n if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n throw new InvalidArgumentError('connect must be a function or an object')\n }\n\n if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n throw new InvalidArgumentError('maxRedirections must be a positive number')\n }\n\n if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {\n throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')\n }\n\n if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {\n throw new InvalidArgumentError('localAddress must be valid string IP address')\n }\n\n if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {\n throw new InvalidArgumentError('maxResponseSize must be a positive number')\n }\n\n if (\n autoSelectFamilyAttemptTimeout != null &&\n (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)\n ) {\n throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')\n }\n\n // h2\n if (allowH2 != null && typeof allowH2 !== 'boolean') {\n throw new InvalidArgumentError('allowH2 must be a valid boolean value')\n }\n\n if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {\n throw new InvalidArgumentError('maxConcurrentStreams must be a positive integer, greater than 0')\n }\n\n if (typeof connect !== 'function') {\n connect = buildConnector({\n ...tls,\n maxCachedSessions,\n allowH2,\n socketPath,\n timeout: connectTimeout,\n ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n ...connect\n })\n }\n\n if (interceptors?.Client && Array.isArray(interceptors.Client)) {\n this[kInterceptors] = interceptors.Client\n if (!deprecatedInterceptorWarned) {\n deprecatedInterceptorWarned = true\n process.emitWarning('Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.', {\n code: 'UNDICI-CLIENT-INTERCEPTOR-DEPRECATED'\n })\n }\n } else {\n this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })]\n }\n\n this[kUrl] = util.parseOrigin(url)\n this[kConnector] = connect\n this[kPipelining] = pipelining != null ? pipelining : 1\n this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize\n this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout\n this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout\n this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold\n this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]\n this[kServerName] = null\n this[kLocalAddress] = localAddress != null ? localAddress : null\n this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming\n this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming\n this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\\r\\n`\n this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3\n this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3\n this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength\n this[kMaxRedirections] = maxRedirections\n this[kMaxRequests] = maxRequestsPerClient\n this[kClosedResolve] = null\n this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1\n this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server\n this[kHTTPContext] = null\n\n // kQueue is built up of 3 sections separated by\n // the kRunningIdx and kPendingIdx indices.\n // | complete | running | pending |\n // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length\n // kRunningIdx points to the first running element.\n // kPendingIdx points to the first pending element.\n // This implements a fast queue with an amortized\n // time of O(1).\n\n this[kQueue] = []\n this[kRunningIdx] = 0\n this[kPendingIdx] = 0\n\n this[kResume] = (sync) => resume(this, sync)\n this[kOnError] = (err) => onError(this, err)\n }\n\n get pipelining () {\n return this[kPipelining]\n }\n\n set pipelining (value) {\n this[kPipelining] = value\n this[kResume](true)\n }\n\n get [kPending] () {\n return this[kQueue].length - this[kPendingIdx]\n }\n\n get [kRunning] () {\n return this[kPendingIdx] - this[kRunningIdx]\n }\n\n get [kSize] () {\n return this[kQueue].length - this[kRunningIdx]\n }\n\n get [kConnected] () {\n return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed\n }\n\n get [kBusy] () {\n return Boolean(\n this[kHTTPContext]?.busy(null) ||\n (this[kSize] >= (getPipelining(this) || 1)) ||\n this[kPending] > 0\n )\n }\n\n /* istanbul ignore: only used for test */\n [kConnect] (cb) {\n connect(this)\n this.once('connect', cb)\n }\n\n [kDispatch] (opts, handler) {\n const origin = opts.origin || this[kUrl].origin\n const request = new Request(origin, opts, handler)\n\n this[kQueue].push(request)\n if (this[kResuming]) {\n // Do nothing.\n } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {\n // Wait a tick in case stream/iterator is ended in the same tick.\n this[kResuming] = 1\n queueMicrotask(() => resume(this))\n } else {\n this[kResume](true)\n }\n\n if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {\n this[kNeedDrain] = 2\n }\n\n return this[kNeedDrain] < 2\n }\n\n async [kClose] () {\n // TODO: for H2 we need to gracefully flush the remaining enqueued\n // request and close each stream.\n return new Promise((resolve) => {\n if (this[kSize]) {\n this[kClosedResolve] = resolve\n } else {\n resolve(null)\n }\n })\n }\n\n async [kDestroy] (err) {\n return new Promise((resolve) => {\n const requests = this[kQueue].splice(this[kPendingIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n util.errorRequest(this, request, err)\n }\n\n const callback = () => {\n if (this[kClosedResolve]) {\n // TODO (fix): Should we error here with ClientDestroyedError?\n this[kClosedResolve]()\n this[kClosedResolve] = null\n }\n resolve(null)\n }\n\n if (this[kHTTPContext]) {\n this[kHTTPContext].destroy(err, callback)\n this[kHTTPContext] = null\n } else {\n queueMicrotask(callback)\n }\n\n this[kResume]()\n })\n }\n}\n\nconst createRedirectInterceptor = require('../interceptor/redirect-interceptor.js')\n\nfunction onError (client, err) {\n if (\n client[kRunning] === 0 &&\n err.code !== 'UND_ERR_INFO' &&\n err.code !== 'UND_ERR_SOCKET'\n ) {\n // Error is not caused by running request and not a recoverable\n // socket error.\n\n assert(client[kPendingIdx] === client[kRunningIdx])\n\n const requests = client[kQueue].splice(client[kRunningIdx])\n\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n util.errorRequest(client, request, err)\n }\n assert(client[kSize] === 0)\n }\n}\n\n/**\n * @param {Client} client\n * @returns\n */\nasync function connect (client) {\n assert(!client[kConnecting])\n assert(!client[kHTTPContext])\n\n let { host, hostname, protocol, port } = client[kUrl]\n\n // Resolve ipv6\n if (hostname[0] === '[') {\n const idx = hostname.indexOf(']')\n\n assert(idx !== -1)\n const ip = hostname.substring(1, idx)\n\n assert(net.isIP(ip))\n hostname = ip\n }\n\n client[kConnecting] = true\n\n if (channels.beforeConnect.hasSubscribers) {\n channels.beforeConnect.publish({\n connectParams: {\n host,\n hostname,\n protocol,\n port,\n version: client[kHTTPContext]?.version,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n },\n connector: client[kConnector]\n })\n }\n\n try {\n const socket = await new Promise((resolve, reject) => {\n client[kConnector]({\n host,\n hostname,\n protocol,\n port,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n }, (err, socket) => {\n if (err) {\n reject(err)\n } else {\n resolve(socket)\n }\n })\n })\n\n if (client.destroyed) {\n util.destroy(socket.on('error', noop), new ClientDestroyedError())\n return\n }\n\n assert(socket)\n\n try {\n client[kHTTPContext] = socket.alpnProtocol === 'h2'\n ? await connectH2(client, socket)\n : await connectH1(client, socket)\n } catch (err) {\n socket.destroy().on('error', noop)\n throw err\n }\n\n client[kConnecting] = false\n\n socket[kCounter] = 0\n socket[kMaxRequests] = client[kMaxRequests]\n socket[kClient] = client\n socket[kError] = null\n\n if (channels.connected.hasSubscribers) {\n channels.connected.publish({\n connectParams: {\n host,\n hostname,\n protocol,\n port,\n version: client[kHTTPContext]?.version,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n },\n connector: client[kConnector],\n socket\n })\n }\n client.emit('connect', client[kUrl], [client])\n } catch (err) {\n if (client.destroyed) {\n return\n }\n\n client[kConnecting] = false\n\n if (channels.connectError.hasSubscribers) {\n channels.connectError.publish({\n connectParams: {\n host,\n hostname,\n protocol,\n port,\n version: client[kHTTPContext]?.version,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n },\n connector: client[kConnector],\n error: err\n })\n }\n\n if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n assert(client[kRunning] === 0)\n while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {\n const request = client[kQueue][client[kPendingIdx]++]\n util.errorRequest(client, request, err)\n }\n } else {\n onError(client, err)\n }\n\n client.emit('connectionError', client[kUrl], [client], err)\n }\n\n client[kResume]()\n}\n\nfunction emitDrain (client) {\n client[kNeedDrain] = 0\n client.emit('drain', client[kUrl], [client])\n}\n\nfunction resume (client, sync) {\n if (client[kResuming] === 2) {\n return\n }\n\n client[kResuming] = 2\n\n _resume(client, sync)\n client[kResuming] = 0\n\n if (client[kRunningIdx] > 256) {\n client[kQueue].splice(0, client[kRunningIdx])\n client[kPendingIdx] -= client[kRunningIdx]\n client[kRunningIdx] = 0\n }\n}\n\nfunction _resume (client, sync) {\n while (true) {\n if (client.destroyed) {\n assert(client[kPending] === 0)\n return\n }\n\n if (client[kClosedResolve] && !client[kSize]) {\n client[kClosedResolve]()\n client[kClosedResolve] = null\n return\n }\n\n if (client[kHTTPContext]) {\n client[kHTTPContext].resume()\n }\n\n if (client[kBusy]) {\n client[kNeedDrain] = 2\n } else if (client[kNeedDrain] === 2) {\n if (sync) {\n client[kNeedDrain] = 1\n queueMicrotask(() => emitDrain(client))\n } else {\n emitDrain(client)\n }\n continue\n }\n\n if (client[kPending] === 0) {\n return\n }\n\n if (client[kRunning] >= (getPipelining(client) || 1)) {\n return\n }\n\n const request = client[kQueue][client[kPendingIdx]]\n\n if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {\n if (client[kRunning] > 0) {\n return\n }\n\n client[kServerName] = request.servername\n client[kHTTPContext]?.destroy(new InformationalError('servername changed'), () => {\n client[kHTTPContext] = null\n resume(client)\n })\n }\n\n if (client[kConnecting]) {\n return\n }\n\n if (!client[kHTTPContext]) {\n connect(client)\n return\n }\n\n if (client[kHTTPContext].destroyed) {\n return\n }\n\n if (client[kHTTPContext].busy(request)) {\n return\n }\n\n if (!request.aborted && client[kHTTPContext].write(request)) {\n client[kPendingIdx]++\n } else {\n client[kQueue].splice(client[kPendingIdx], 1)\n }\n }\n}\n\nmodule.exports = Client\n","/* eslint-disable */\n\n'use strict'\n\n// Extracted from node/lib/internal/fixed_queue.js\n\n// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.\nconst kSize = 2048;\nconst kMask = kSize - 1;\n\n// The FixedQueue is implemented as a singly-linked list of fixed-size\n// circular buffers. It looks something like this:\n//\n// head tail\n// | |\n// v v\n// +-----------+ <-----\\ +-----------+ <------\\ +-----------+\n// | [null] | \\----- | next | \\------- | next |\n// +-----------+ +-----------+ +-----------+\n// | item | <-- bottom | item | <-- bottom | [empty] |\n// | item | | item | | [empty] |\n// | item | | item | | [empty] |\n// | item | | item | | [empty] |\n// | item | | item | bottom --> | item |\n// | item | | item | | item |\n// | ... | | ... | | ... |\n// | item | | item | | item |\n// | item | | item | | item |\n// | [empty] | <-- top | item | | item |\n// | [empty] | | item | | item |\n// | [empty] | | [empty] | <-- top top --> | [empty] |\n// +-----------+ +-----------+ +-----------+\n//\n// Or, if there is only one circular buffer, it looks something\n// like either of these:\n//\n// head tail head tail\n// | | | |\n// v v v v\n// +-----------+ +-----------+\n// | [null] | | [null] |\n// +-----------+ +-----------+\n// | [empty] | | item |\n// | [empty] | | item |\n// | item | <-- bottom top --> | [empty] |\n// | item | | [empty] |\n// | [empty] | <-- top bottom --> | item |\n// | [empty] | | item |\n// +-----------+ +-----------+\n//\n// Adding a value means moving `top` forward by one, removing means\n// moving `bottom` forward by one. After reaching the end, the queue\n// wraps around.\n//\n// When `top === bottom` the current queue is empty and when\n// `top + 1 === bottom` it's full. This wastes a single space of storage\n// but allows much quicker checks.\n\nclass FixedCircularBuffer {\n constructor() {\n this.bottom = 0;\n this.top = 0;\n this.list = new Array(kSize);\n this.next = null;\n }\n\n isEmpty() {\n return this.top === this.bottom;\n }\n\n isFull() {\n return ((this.top + 1) & kMask) === this.bottom;\n }\n\n push(data) {\n this.list[this.top] = data;\n this.top = (this.top + 1) & kMask;\n }\n\n shift() {\n const nextItem = this.list[this.bottom];\n if (nextItem === undefined)\n return null;\n this.list[this.bottom] = undefined;\n this.bottom = (this.bottom + 1) & kMask;\n return nextItem;\n }\n}\n\nmodule.exports = class FixedQueue {\n constructor() {\n this.head = this.tail = new FixedCircularBuffer();\n }\n\n isEmpty() {\n return this.head.isEmpty();\n }\n\n push(data) {\n if (this.head.isFull()) {\n // Head is full: Creates a new queue, sets the old queue's `.next` to it,\n // and sets it as the new main queue.\n this.head = this.head.next = new FixedCircularBuffer();\n }\n this.head.push(data);\n }\n\n shift() {\n const tail = this.tail;\n const next = tail.shift();\n if (tail.isEmpty() && tail.next !== null) {\n // If there is another queue, it forms the new tail.\n this.tail = tail.next;\n }\n return next;\n }\n};\n","const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require('../core/symbols')\nconst kPool = Symbol('pool')\n\nclass PoolStats {\n constructor (pool) {\n this[kPool] = pool\n }\n\n get connected () {\n return this[kPool][kConnected]\n }\n\n get free () {\n return this[kPool][kFree]\n }\n\n get pending () {\n return this[kPool][kPending]\n }\n\n get queued () {\n return this[kPool][kQueued]\n }\n\n get running () {\n return this[kPool][kRunning]\n }\n\n get size () {\n return this[kPool][kSize]\n }\n}\n\nmodule.exports = PoolStats\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst FixedQueue = require('./fixed-queue')\nconst { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require('../core/symbols')\nconst PoolStats = require('./pool-stats')\n\nconst kClients = Symbol('clients')\nconst kNeedDrain = Symbol('needDrain')\nconst kQueue = Symbol('queue')\nconst kClosedResolve = Symbol('closed resolve')\nconst kOnDrain = Symbol('onDrain')\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kGetDispatcher = Symbol('get dispatcher')\nconst kAddClient = Symbol('add client')\nconst kRemoveClient = Symbol('remove client')\nconst kStats = Symbol('stats')\n\nclass PoolBase extends DispatcherBase {\n constructor (opts) {\n super(opts)\n\n this[kQueue] = new FixedQueue()\n this[kClients] = []\n this[kQueued] = 0\n\n const pool = this\n\n this[kOnDrain] = function onDrain (origin, targets) {\n const queue = pool[kQueue]\n\n let needDrain = false\n\n while (!needDrain) {\n const item = queue.shift()\n if (!item) {\n break\n }\n pool[kQueued]--\n needDrain = !this.dispatch(item.opts, item.handler)\n }\n\n this[kNeedDrain] = needDrain\n\n if (!this[kNeedDrain] && pool[kNeedDrain]) {\n pool[kNeedDrain] = false\n pool.emit('drain', origin, [pool, ...targets])\n }\n\n if (pool[kClosedResolve] && queue.isEmpty()) {\n Promise\n .all(pool[kClients].map(c => c.close()))\n .then(pool[kClosedResolve])\n }\n }\n\n this[kOnConnect] = (origin, targets) => {\n pool.emit('connect', origin, [pool, ...targets])\n }\n\n this[kOnDisconnect] = (origin, targets, err) => {\n pool.emit('disconnect', origin, [pool, ...targets], err)\n }\n\n this[kOnConnectionError] = (origin, targets, err) => {\n pool.emit('connectionError', origin, [pool, ...targets], err)\n }\n\n this[kStats] = new PoolStats(this)\n }\n\n get [kBusy] () {\n return this[kNeedDrain]\n }\n\n get [kConnected] () {\n return this[kClients].filter(client => client[kConnected]).length\n }\n\n get [kFree] () {\n return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length\n }\n\n get [kPending] () {\n let ret = this[kQueued]\n for (const { [kPending]: pending } of this[kClients]) {\n ret += pending\n }\n return ret\n }\n\n get [kRunning] () {\n let ret = 0\n for (const { [kRunning]: running } of this[kClients]) {\n ret += running\n }\n return ret\n }\n\n get [kSize] () {\n let ret = this[kQueued]\n for (const { [kSize]: size } of this[kClients]) {\n ret += size\n }\n return ret\n }\n\n get stats () {\n return this[kStats]\n }\n\n async [kClose] () {\n if (this[kQueue].isEmpty()) {\n await Promise.all(this[kClients].map(c => c.close()))\n } else {\n await new Promise((resolve) => {\n this[kClosedResolve] = resolve\n })\n }\n }\n\n async [kDestroy] (err) {\n while (true) {\n const item = this[kQueue].shift()\n if (!item) {\n break\n }\n item.handler.onError(err)\n }\n\n await Promise.all(this[kClients].map(c => c.destroy(err)))\n }\n\n [kDispatch] (opts, handler) {\n const dispatcher = this[kGetDispatcher]()\n\n if (!dispatcher) {\n this[kNeedDrain] = true\n this[kQueue].push({ opts, handler })\n this[kQueued]++\n } else if (!dispatcher.dispatch(opts, handler)) {\n dispatcher[kNeedDrain] = true\n this[kNeedDrain] = !this[kGetDispatcher]()\n }\n\n return !this[kNeedDrain]\n }\n\n [kAddClient] (client) {\n client\n .on('drain', this[kOnDrain])\n .on('connect', this[kOnConnect])\n .on('disconnect', this[kOnDisconnect])\n .on('connectionError', this[kOnConnectionError])\n\n this[kClients].push(client)\n\n if (this[kNeedDrain]) {\n queueMicrotask(() => {\n if (this[kNeedDrain]) {\n this[kOnDrain](client[kUrl], [this, client])\n }\n })\n }\n\n return this\n }\n\n [kRemoveClient] (client) {\n client.close(() => {\n const idx = this[kClients].indexOf(client)\n if (idx !== -1) {\n this[kClients].splice(idx, 1)\n }\n })\n\n this[kNeedDrain] = this[kClients].some(dispatcher => (\n !dispatcher[kNeedDrain] &&\n dispatcher.closed !== true &&\n dispatcher.destroyed !== true\n ))\n }\n}\n\nmodule.exports = {\n PoolBase,\n kClients,\n kNeedDrain,\n kAddClient,\n kRemoveClient,\n kGetDispatcher\n}\n","'use strict'\n\nconst {\n PoolBase,\n kClients,\n kNeedDrain,\n kAddClient,\n kGetDispatcher\n} = require('./pool-base')\nconst Client = require('./client')\nconst {\n InvalidArgumentError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { kUrl, kInterceptors } = require('../core/symbols')\nconst buildConnector = require('../core/connect')\n\nconst kOptions = Symbol('options')\nconst kConnections = Symbol('connections')\nconst kFactory = Symbol('factory')\n\nfunction defaultFactory (origin, opts) {\n return new Client(origin, opts)\n}\n\nclass Pool extends PoolBase {\n constructor (origin, {\n connections,\n factory = defaultFactory,\n connect,\n connectTimeout,\n tls,\n maxCachedSessions,\n socketPath,\n autoSelectFamily,\n autoSelectFamilyAttemptTimeout,\n allowH2,\n ...options\n } = {}) {\n if (connections != null && (!Number.isFinite(connections) || connections < 0)) {\n throw new InvalidArgumentError('invalid connections')\n }\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('factory must be a function.')\n }\n\n if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n throw new InvalidArgumentError('connect must be a function or an object')\n }\n\n if (typeof connect !== 'function') {\n connect = buildConnector({\n ...tls,\n maxCachedSessions,\n allowH2,\n socketPath,\n timeout: connectTimeout,\n ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n ...connect\n })\n }\n\n super(options)\n\n this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool)\n ? options.interceptors.Pool\n : []\n this[kConnections] = connections || null\n this[kUrl] = util.parseOrigin(origin)\n this[kOptions] = { ...util.deepClone(options), connect, allowH2 }\n this[kOptions].interceptors = options.interceptors\n ? { ...options.interceptors }\n : undefined\n this[kFactory] = factory\n\n this.on('connectionError', (origin, targets, error) => {\n // If a connection error occurs, we remove the client from the pool,\n // and emit a connectionError event. They will not be re-used.\n // Fixes https://github.com/nodejs/undici/issues/3895\n for (const target of targets) {\n // Do not use kRemoveClient here, as it will close the client,\n // but the client cannot be closed in this state.\n const idx = this[kClients].indexOf(target)\n if (idx !== -1) {\n this[kClients].splice(idx, 1)\n }\n }\n })\n }\n\n [kGetDispatcher] () {\n for (const client of this[kClients]) {\n if (!client[kNeedDrain]) {\n return client\n }\n }\n\n if (!this[kConnections] || this[kClients].length < this[kConnections]) {\n const dispatcher = this[kFactory](this[kUrl], this[kOptions])\n this[kAddClient](dispatcher)\n return dispatcher\n }\n }\n}\n\nmodule.exports = Pool\n","'use strict'\n\nconst {\n BalancedPoolMissingUpstreamError,\n InvalidArgumentError\n} = require('../core/errors')\nconst {\n PoolBase,\n kClients,\n kNeedDrain,\n kAddClient,\n kRemoveClient,\n kGetDispatcher\n} = require('./pool-base')\nconst Pool = require('./pool')\nconst { kUrl, kInterceptors } = require('../core/symbols')\nconst { parseOrigin } = require('../core/util')\nconst kFactory = Symbol('factory')\n\nconst kOptions = Symbol('options')\nconst kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')\nconst kCurrentWeight = Symbol('kCurrentWeight')\nconst kIndex = Symbol('kIndex')\nconst kWeight = Symbol('kWeight')\nconst kMaxWeightPerServer = Symbol('kMaxWeightPerServer')\nconst kErrorPenalty = Symbol('kErrorPenalty')\n\n/**\n * Calculate the greatest common divisor of two numbers by\n * using the Euclidean algorithm.\n *\n * @param {number} a\n * @param {number} b\n * @returns {number}\n */\nfunction getGreatestCommonDivisor (a, b) {\n if (a === 0) return b\n\n while (b !== 0) {\n const t = b\n b = a % b\n a = t\n }\n return a\n}\n\nfunction defaultFactory (origin, opts) {\n return new Pool(origin, opts)\n}\n\nclass BalancedPool extends PoolBase {\n constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {\n super()\n\n this[kOptions] = opts\n this[kIndex] = -1\n this[kCurrentWeight] = 0\n\n this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100\n this[kErrorPenalty] = this[kOptions].errorPenalty || 15\n\n if (!Array.isArray(upstreams)) {\n upstreams = [upstreams]\n }\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('factory must be a function.')\n }\n\n this[kInterceptors] = opts.interceptors?.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)\n ? opts.interceptors.BalancedPool\n : []\n this[kFactory] = factory\n\n for (const upstream of upstreams) {\n this.addUpstream(upstream)\n }\n this._updateBalancedPoolStats()\n }\n\n addUpstream (upstream) {\n const upstreamOrigin = parseOrigin(upstream).origin\n\n if (this[kClients].find((pool) => (\n pool[kUrl].origin === upstreamOrigin &&\n pool.closed !== true &&\n pool.destroyed !== true\n ))) {\n return this\n }\n const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))\n\n this[kAddClient](pool)\n pool.on('connect', () => {\n pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])\n })\n\n pool.on('connectionError', () => {\n pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n this._updateBalancedPoolStats()\n })\n\n pool.on('disconnect', (...args) => {\n const err = args[2]\n if (err && err.code === 'UND_ERR_SOCKET') {\n // decrease the weight of the pool.\n pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n this._updateBalancedPoolStats()\n }\n })\n\n for (const client of this[kClients]) {\n client[kWeight] = this[kMaxWeightPerServer]\n }\n\n this._updateBalancedPoolStats()\n\n return this\n }\n\n _updateBalancedPoolStats () {\n let result = 0\n for (let i = 0; i < this[kClients].length; i++) {\n result = getGreatestCommonDivisor(this[kClients][i][kWeight], result)\n }\n\n this[kGreatestCommonDivisor] = result\n }\n\n removeUpstream (upstream) {\n const upstreamOrigin = parseOrigin(upstream).origin\n\n const pool = this[kClients].find((pool) => (\n pool[kUrl].origin === upstreamOrigin &&\n pool.closed !== true &&\n pool.destroyed !== true\n ))\n\n if (pool) {\n this[kRemoveClient](pool)\n }\n\n return this\n }\n\n get upstreams () {\n return this[kClients]\n .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)\n .map((p) => p[kUrl].origin)\n }\n\n [kGetDispatcher] () {\n // We validate that pools is greater than 0,\n // otherwise we would have to wait until an upstream\n // is added, which might never happen.\n if (this[kClients].length === 0) {\n throw new BalancedPoolMissingUpstreamError()\n }\n\n const dispatcher = this[kClients].find(dispatcher => (\n !dispatcher[kNeedDrain] &&\n dispatcher.closed !== true &&\n dispatcher.destroyed !== true\n ))\n\n if (!dispatcher) {\n return\n }\n\n const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)\n\n if (allClientsBusy) {\n return\n }\n\n let counter = 0\n\n let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])\n\n while (counter++ < this[kClients].length) {\n this[kIndex] = (this[kIndex] + 1) % this[kClients].length\n const pool = this[kClients][this[kIndex]]\n\n // find pool index with the largest weight\n if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {\n maxWeightIndex = this[kIndex]\n }\n\n // decrease the current weight every `this[kClients].length`.\n if (this[kIndex] === 0) {\n // Set the current weight to the next lower weight.\n this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]\n\n if (this[kCurrentWeight] <= 0) {\n this[kCurrentWeight] = this[kMaxWeightPerServer]\n }\n }\n if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {\n return pool\n }\n }\n\n this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]\n this[kIndex] = maxWeightIndex\n return this[kClients][maxWeightIndex]\n }\n}\n\nmodule.exports = BalancedPool\n","'use strict'\n\nconst { InvalidArgumentError } = require('../core/errors')\nconst { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require('../core/symbols')\nconst DispatcherBase = require('./dispatcher-base')\nconst Pool = require('./pool')\nconst Client = require('./client')\nconst util = require('../core/util')\nconst createRedirectInterceptor = require('../interceptor/redirect-interceptor')\n\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kMaxRedirections = Symbol('maxRedirections')\nconst kOnDrain = Symbol('onDrain')\nconst kFactory = Symbol('factory')\nconst kOptions = Symbol('options')\n\nfunction defaultFactory (origin, opts) {\n return opts && opts.connections === 1\n ? new Client(origin, opts)\n : new Pool(origin, opts)\n}\n\nclass Agent extends DispatcherBase {\n constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('factory must be a function.')\n }\n\n if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n throw new InvalidArgumentError('connect must be a function or an object')\n }\n\n if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {\n throw new InvalidArgumentError('maxRedirections must be a positive number')\n }\n\n super(options)\n\n if (connect && typeof connect !== 'function') {\n connect = { ...connect }\n }\n\n this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent)\n ? options.interceptors.Agent\n : [createRedirectInterceptor({ maxRedirections })]\n\n this[kOptions] = { ...util.deepClone(options), connect }\n this[kOptions].interceptors = options.interceptors\n ? { ...options.interceptors }\n : undefined\n this[kMaxRedirections] = maxRedirections\n this[kFactory] = factory\n this[kClients] = new Map()\n\n this[kOnDrain] = (origin, targets) => {\n this.emit('drain', origin, [this, ...targets])\n }\n\n this[kOnConnect] = (origin, targets) => {\n this.emit('connect', origin, [this, ...targets])\n }\n\n this[kOnDisconnect] = (origin, targets, err) => {\n this.emit('disconnect', origin, [this, ...targets], err)\n }\n\n this[kOnConnectionError] = (origin, targets, err) => {\n this.emit('connectionError', origin, [this, ...targets], err)\n }\n }\n\n get [kRunning] () {\n let ret = 0\n for (const client of this[kClients].values()) {\n ret += client[kRunning]\n }\n return ret\n }\n\n [kDispatch] (opts, handler) {\n let key\n if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {\n key = String(opts.origin)\n } else {\n throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')\n }\n\n let dispatcher = this[kClients].get(key)\n\n if (!dispatcher) {\n dispatcher = this[kFactory](opts.origin, this[kOptions])\n .on('drain', this[kOnDrain])\n .on('connect', this[kOnConnect])\n .on('disconnect', this[kOnDisconnect])\n .on('connectionError', this[kOnConnectionError])\n\n // This introduces a tiny memory leak, as dispatchers are never removed from the map.\n // TODO(mcollina): remove te timer when the client/pool do not have any more\n // active connections.\n this[kClients].set(key, dispatcher)\n }\n\n return dispatcher.dispatch(opts, handler)\n }\n\n async [kClose] () {\n const closePromises = []\n for (const client of this[kClients].values()) {\n closePromises.push(client.close())\n }\n this[kClients].clear()\n\n await Promise.all(closePromises)\n }\n\n async [kDestroy] (err) {\n const destroyPromises = []\n for (const client of this[kClients].values()) {\n destroyPromises.push(client.destroy(err))\n }\n this[kClients].clear()\n\n await Promise.all(destroyPromises)\n }\n}\n\nmodule.exports = Agent\n","'use strict'\n\nconst { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = require('../core/symbols')\nconst { URL } = require('node:url')\nconst Agent = require('./agent')\nconst Pool = require('./pool')\nconst DispatcherBase = require('./dispatcher-base')\nconst { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require('../core/errors')\nconst buildConnector = require('../core/connect')\nconst Client = require('./client')\n\nconst kAgent = Symbol('proxy agent')\nconst kClient = Symbol('proxy client')\nconst kProxyHeaders = Symbol('proxy headers')\nconst kRequestTls = Symbol('request tls settings')\nconst kProxyTls = Symbol('proxy tls settings')\nconst kConnectEndpoint = Symbol('connect endpoint function')\nconst kTunnelProxy = Symbol('tunnel proxy')\n\nfunction defaultProtocolPort (protocol) {\n return protocol === 'https:' ? 443 : 80\n}\n\nfunction defaultFactory (origin, opts) {\n return new Pool(origin, opts)\n}\n\nconst noop = () => {}\n\nfunction defaultAgentFactory (origin, opts) {\n if (opts.connections === 1) {\n return new Client(origin, opts)\n }\n return new Pool(origin, opts)\n}\n\nclass Http1ProxyWrapper extends DispatcherBase {\n #client\n\n constructor (proxyUrl, { headers = {}, connect, factory }) {\n super()\n if (!proxyUrl) {\n throw new InvalidArgumentError('Proxy URL is mandatory')\n }\n\n this[kProxyHeaders] = headers\n if (factory) {\n this.#client = factory(proxyUrl, { connect })\n } else {\n this.#client = new Client(proxyUrl, { connect })\n }\n }\n\n [kDispatch] (opts, handler) {\n const onHeaders = handler.onHeaders\n handler.onHeaders = function (statusCode, data, resume) {\n if (statusCode === 407) {\n if (typeof handler.onError === 'function') {\n handler.onError(new InvalidArgumentError('Proxy Authentication Required (407)'))\n }\n return\n }\n if (onHeaders) onHeaders.call(this, statusCode, data, resume)\n }\n\n // Rewrite request as an HTTP1 Proxy request, without tunneling.\n const {\n origin,\n path = '/',\n headers = {}\n } = opts\n\n opts.path = origin + path\n\n if (!('host' in headers) && !('Host' in headers)) {\n const { host } = new URL(origin)\n headers.host = host\n }\n opts.headers = { ...this[kProxyHeaders], ...headers }\n\n return this.#client[kDispatch](opts, handler)\n }\n\n async [kClose] () {\n return this.#client.close()\n }\n\n async [kDestroy] (err) {\n return this.#client.destroy(err)\n }\n}\n\nclass ProxyAgent extends DispatcherBase {\n constructor (opts) {\n super()\n\n if (!opts || (typeof opts === 'object' && !(opts instanceof URL) && !opts.uri)) {\n throw new InvalidArgumentError('Proxy uri is mandatory')\n }\n\n const { clientFactory = defaultFactory } = opts\n if (typeof clientFactory !== 'function') {\n throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')\n }\n\n const { proxyTunnel = true } = opts\n\n const url = this.#getUrl(opts)\n const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url\n\n this[kProxy] = { uri: href, protocol }\n this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)\n ? opts.interceptors.ProxyAgent\n : []\n this[kRequestTls] = opts.requestTls\n this[kProxyTls] = opts.proxyTls\n this[kProxyHeaders] = opts.headers || {}\n this[kTunnelProxy] = proxyTunnel\n\n if (opts.auth && opts.token) {\n throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')\n } else if (opts.auth) {\n /* @deprecated in favour of opts.token */\n this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`\n } else if (opts.token) {\n this[kProxyHeaders]['proxy-authorization'] = opts.token\n } else if (username && password) {\n this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`\n }\n\n const connect = buildConnector({ ...opts.proxyTls })\n this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })\n\n const agentFactory = opts.factory || defaultAgentFactory\n const factory = (origin, options) => {\n const { protocol } = new URL(origin)\n if (!this[kTunnelProxy] && protocol === 'http:' && this[kProxy].protocol === 'http:') {\n return new Http1ProxyWrapper(this[kProxy].uri, {\n headers: this[kProxyHeaders],\n connect,\n factory: agentFactory\n })\n }\n return agentFactory(origin, options)\n }\n this[kClient] = clientFactory(url, { connect })\n this[kAgent] = new Agent({\n ...opts,\n factory,\n connect: async (opts, callback) => {\n let requestedPath = opts.host\n if (!opts.port) {\n requestedPath += `:${defaultProtocolPort(opts.protocol)}`\n }\n try {\n const { socket, statusCode } = await this[kClient].connect({\n origin,\n port,\n path: requestedPath,\n signal: opts.signal,\n headers: {\n ...this[kProxyHeaders],\n host: opts.host\n },\n servername: this[kProxyTls]?.servername || proxyHostname\n })\n if (statusCode !== 200) {\n socket.on('error', noop).destroy()\n callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))\n }\n if (opts.protocol !== 'https:') {\n callback(null, socket)\n return\n }\n let servername\n if (this[kRequestTls]) {\n servername = this[kRequestTls].servername\n } else {\n servername = opts.servername\n }\n this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)\n } catch (err) {\n if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n // Throw a custom error to avoid loop in client.js#connect\n callback(new SecureProxyConnectionError(err))\n } else {\n callback(err)\n }\n }\n }\n })\n }\n\n dispatch (opts, handler) {\n const headers = buildHeaders(opts.headers)\n throwIfProxyAuthIsSent(headers)\n\n if (headers && !('host' in headers) && !('Host' in headers)) {\n const { host } = new URL(opts.origin)\n headers.host = host\n }\n\n return this[kAgent].dispatch(\n {\n ...opts,\n headers\n },\n handler\n )\n }\n\n /**\n * @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts\n * @returns {URL}\n */\n #getUrl (opts) {\n if (typeof opts === 'string') {\n return new URL(opts)\n } else if (opts instanceof URL) {\n return opts\n } else {\n return new URL(opts.uri)\n }\n }\n\n async [kClose] () {\n await this[kAgent].close()\n await this[kClient].close()\n }\n\n async [kDestroy] () {\n await this[kAgent].destroy()\n await this[kClient].destroy()\n }\n}\n\n/**\n * @param {string[] | Record} headers\n * @returns {Record}\n */\nfunction buildHeaders (headers) {\n // When using undici.fetch, the headers list is stored\n // as an array.\n if (Array.isArray(headers)) {\n /** @type {Record} */\n const headersPair = {}\n\n for (let i = 0; i < headers.length; i += 2) {\n headersPair[headers[i]] = headers[i + 1]\n }\n\n return headersPair\n }\n\n return headers\n}\n\n/**\n * @param {Record} headers\n *\n * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers\n * Nevertheless, it was changed and to avoid a security vulnerability by end users\n * this check was created.\n * It should be removed in the next major version for performance reasons\n */\nfunction throwIfProxyAuthIsSent (headers) {\n const existProxyAuth = headers && Object.keys(headers)\n .find((key) => key.toLowerCase() === 'proxy-authorization')\n if (existProxyAuth) {\n throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')\n }\n}\n\nmodule.exports = ProxyAgent\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require('../core/symbols')\nconst ProxyAgent = require('./proxy-agent')\nconst Agent = require('./agent')\n\nconst DEFAULT_PORTS = {\n 'http:': 80,\n 'https:': 443\n}\n\nlet experimentalWarned = false\n\nclass EnvHttpProxyAgent extends DispatcherBase {\n #noProxyValue = null\n #noProxyEntries = null\n #opts = null\n\n constructor (opts = {}) {\n super()\n this.#opts = opts\n\n if (!experimentalWarned) {\n experimentalWarned = true\n process.emitWarning('EnvHttpProxyAgent is experimental, expect them to change at any time.', {\n code: 'UNDICI-EHPA'\n })\n }\n\n const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts\n\n this[kNoProxyAgent] = new Agent(agentOpts)\n\n const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY\n if (HTTP_PROXY) {\n this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY })\n } else {\n this[kHttpProxyAgent] = this[kNoProxyAgent]\n }\n\n const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY\n if (HTTPS_PROXY) {\n this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY })\n } else {\n this[kHttpsProxyAgent] = this[kHttpProxyAgent]\n }\n\n this.#parseNoProxy()\n }\n\n [kDispatch] (opts, handler) {\n const url = new URL(opts.origin)\n const agent = this.#getProxyAgentForUrl(url)\n return agent.dispatch(opts, handler)\n }\n\n async [kClose] () {\n await this[kNoProxyAgent].close()\n if (!this[kHttpProxyAgent][kClosed]) {\n await this[kHttpProxyAgent].close()\n }\n if (!this[kHttpsProxyAgent][kClosed]) {\n await this[kHttpsProxyAgent].close()\n }\n }\n\n async [kDestroy] (err) {\n await this[kNoProxyAgent].destroy(err)\n if (!this[kHttpProxyAgent][kDestroyed]) {\n await this[kHttpProxyAgent].destroy(err)\n }\n if (!this[kHttpsProxyAgent][kDestroyed]) {\n await this[kHttpsProxyAgent].destroy(err)\n }\n }\n\n #getProxyAgentForUrl (url) {\n let { protocol, host: hostname, port } = url\n\n // Stripping ports in this way instead of using parsedUrl.hostname to make\n // sure that the brackets around IPv6 addresses are kept.\n hostname = hostname.replace(/:\\d*$/, '').toLowerCase()\n port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0\n if (!this.#shouldProxy(hostname, port)) {\n return this[kNoProxyAgent]\n }\n if (protocol === 'https:') {\n return this[kHttpsProxyAgent]\n }\n return this[kHttpProxyAgent]\n }\n\n #shouldProxy (hostname, port) {\n if (this.#noProxyChanged) {\n this.#parseNoProxy()\n }\n\n if (this.#noProxyEntries.length === 0) {\n return true // Always proxy if NO_PROXY is not set or empty.\n }\n if (this.#noProxyValue === '*') {\n return false // Never proxy if wildcard is set.\n }\n\n for (let i = 0; i < this.#noProxyEntries.length; i++) {\n const entry = this.#noProxyEntries[i]\n if (entry.port && entry.port !== port) {\n continue // Skip if ports don't match.\n }\n if (!/^[.*]/.test(entry.hostname)) {\n // No wildcards, so don't proxy only if there is not an exact match.\n if (hostname === entry.hostname) {\n return false\n }\n } else {\n // Don't proxy if the hostname ends with the no_proxy host.\n if (hostname.endsWith(entry.hostname.replace(/^\\*/, ''))) {\n return false\n }\n }\n }\n\n return true\n }\n\n #parseNoProxy () {\n const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv\n const noProxySplit = noProxyValue.split(/[,\\s]/)\n const noProxyEntries = []\n\n for (let i = 0; i < noProxySplit.length; i++) {\n const entry = noProxySplit[i]\n if (!entry) {\n continue\n }\n const parsed = entry.match(/^(.+):(\\d+)$/)\n noProxyEntries.push({\n hostname: (parsed ? parsed[1] : entry).toLowerCase(),\n port: parsed ? Number.parseInt(parsed[2], 10) : 0\n })\n }\n\n this.#noProxyValue = noProxyValue\n this.#noProxyEntries = noProxyEntries\n }\n\n get #noProxyChanged () {\n if (this.#opts.noProxy !== undefined) {\n return false\n }\n return this.#noProxyValue !== this.#noProxyEnv\n }\n\n get #noProxyEnv () {\n return process.env.no_proxy ?? process.env.NO_PROXY ?? ''\n }\n}\n\nmodule.exports = EnvHttpProxyAgent\n","'use strict'\nconst assert = require('node:assert')\n\nconst { kRetryHandlerDefaultRetry } = require('../core/symbols')\nconst { RequestRetryError } = require('../core/errors')\nconst {\n isDisturbed,\n parseHeaders,\n parseRangeHeader,\n wrapRequestBody\n} = require('../core/util')\n\nfunction calculateRetryAfterHeader (retryAfter) {\n const current = Date.now()\n return new Date(retryAfter).getTime() - current\n}\n\nclass RetryHandler {\n constructor (opts, handlers) {\n const { retryOptions, ...dispatchOpts } = opts\n const {\n // Retry scoped\n retry: retryFn,\n maxRetries,\n maxTimeout,\n minTimeout,\n timeoutFactor,\n // Response scoped\n methods,\n errorCodes,\n retryAfter,\n statusCodes\n } = retryOptions ?? {}\n\n this.dispatch = handlers.dispatch\n this.handler = handlers.handler\n this.opts = { ...dispatchOpts, body: wrapRequestBody(opts.body) }\n this.abort = null\n this.aborted = false\n this.retryOpts = {\n retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],\n retryAfter: retryAfter ?? true,\n maxTimeout: maxTimeout ?? 30 * 1000, // 30s,\n minTimeout: minTimeout ?? 500, // .5s\n timeoutFactor: timeoutFactor ?? 2,\n maxRetries: maxRetries ?? 5,\n // What errors we should retry\n methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],\n // Indicates which errors to retry\n statusCodes: statusCodes ?? [500, 502, 503, 504, 429],\n // List of errors to retry\n errorCodes: errorCodes ?? [\n 'ECONNRESET',\n 'ECONNREFUSED',\n 'ENOTFOUND',\n 'ENETDOWN',\n 'ENETUNREACH',\n 'EHOSTDOWN',\n 'EHOSTUNREACH',\n 'EPIPE',\n 'UND_ERR_SOCKET'\n ]\n }\n\n this.retryCount = 0\n this.retryCountCheckpoint = 0\n this.start = 0\n this.end = null\n this.etag = null\n this.resume = null\n\n // Handle possible onConnect duplication\n this.handler.onConnect(reason => {\n this.aborted = true\n if (this.abort) {\n this.abort(reason)\n } else {\n this.reason = reason\n }\n })\n }\n\n onRequestSent () {\n if (this.handler.onRequestSent) {\n this.handler.onRequestSent()\n }\n }\n\n onUpgrade (statusCode, headers, socket) {\n if (this.handler.onUpgrade) {\n this.handler.onUpgrade(statusCode, headers, socket)\n }\n }\n\n onConnect (abort) {\n if (this.aborted) {\n abort(this.reason)\n } else {\n this.abort = abort\n }\n }\n\n onBodySent (chunk) {\n if (this.handler.onBodySent) return this.handler.onBodySent(chunk)\n }\n\n static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {\n const { statusCode, code, headers } = err\n const { method, retryOptions } = opts\n const {\n maxRetries,\n minTimeout,\n maxTimeout,\n timeoutFactor,\n statusCodes,\n errorCodes,\n methods\n } = retryOptions\n const { counter } = state\n\n // Any code that is not a Undici's originated and allowed to retry\n if (code && code !== 'UND_ERR_REQ_RETRY' && !errorCodes.includes(code)) {\n cb(err)\n return\n }\n\n // If a set of method are provided and the current method is not in the list\n if (Array.isArray(methods) && !methods.includes(method)) {\n cb(err)\n return\n }\n\n // If a set of status code are provided and the current status code is not in the list\n if (\n statusCode != null &&\n Array.isArray(statusCodes) &&\n !statusCodes.includes(statusCode)\n ) {\n cb(err)\n return\n }\n\n // If we reached the max number of retries\n if (counter > maxRetries) {\n cb(err)\n return\n }\n\n let retryAfterHeader = headers?.['retry-after']\n if (retryAfterHeader) {\n retryAfterHeader = Number(retryAfterHeader)\n retryAfterHeader = Number.isNaN(retryAfterHeader)\n ? calculateRetryAfterHeader(retryAfterHeader)\n : retryAfterHeader * 1e3 // Retry-After is in seconds\n }\n\n const retryTimeout =\n retryAfterHeader > 0\n ? Math.min(retryAfterHeader, maxTimeout)\n : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout)\n\n setTimeout(() => cb(null), retryTimeout)\n }\n\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n const headers = parseHeaders(rawHeaders)\n\n this.retryCount += 1\n\n if (statusCode >= 300) {\n if (this.retryOpts.statusCodes.includes(statusCode) === false) {\n return this.handler.onHeaders(\n statusCode,\n rawHeaders,\n resume,\n statusMessage\n )\n } else {\n this.abort(\n new RequestRetryError('Request failed', statusCode, {\n headers,\n data: {\n count: this.retryCount\n }\n })\n )\n return false\n }\n }\n\n // Checkpoint for resume from where we left it\n if (this.resume != null) {\n this.resume = null\n\n // Only Partial Content 206 supposed to provide Content-Range,\n // any other status code that partially consumed the payload\n // should not be retry because it would result in downstream\n // wrongly concatanete multiple responses.\n if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) {\n this.abort(\n new RequestRetryError('server does not support the range header and the payload was partially consumed', statusCode, {\n headers,\n data: { count: this.retryCount }\n })\n )\n return false\n }\n\n const contentRange = parseRangeHeader(headers['content-range'])\n // If no content range\n if (!contentRange) {\n this.abort(\n new RequestRetryError('Content-Range mismatch', statusCode, {\n headers,\n data: { count: this.retryCount }\n })\n )\n return false\n }\n\n // Let's start with a weak etag check\n if (this.etag != null && this.etag !== headers.etag) {\n this.abort(\n new RequestRetryError('ETag mismatch', statusCode, {\n headers,\n data: { count: this.retryCount }\n })\n )\n return false\n }\n\n const { start, size, end = size - 1 } = contentRange\n\n assert(this.start === start, 'content-range mismatch')\n assert(this.end == null || this.end === end, 'content-range mismatch')\n\n this.resume = resume\n return true\n }\n\n if (this.end == null) {\n if (statusCode === 206) {\n // First time we receive 206\n const range = parseRangeHeader(headers['content-range'])\n\n if (range == null) {\n return this.handler.onHeaders(\n statusCode,\n rawHeaders,\n resume,\n statusMessage\n )\n }\n\n const { start, size, end = size - 1 } = range\n assert(\n start != null && Number.isFinite(start),\n 'content-range mismatch'\n )\n assert(end != null && Number.isFinite(end), 'invalid content-length')\n\n this.start = start\n this.end = end\n }\n\n // We make our best to checkpoint the body for further range headers\n if (this.end == null) {\n const contentLength = headers['content-length']\n this.end = contentLength != null ? Number(contentLength) - 1 : null\n }\n\n assert(Number.isFinite(this.start))\n assert(\n this.end == null || Number.isFinite(this.end),\n 'invalid content-length'\n )\n\n this.resume = resume\n this.etag = headers.etag != null ? headers.etag : null\n\n // Weak etags are not useful for comparison nor cache\n // for instance not safe to assume if the response is byte-per-byte\n // equal\n if (this.etag != null && this.etag.startsWith('W/')) {\n this.etag = null\n }\n\n return this.handler.onHeaders(\n statusCode,\n rawHeaders,\n resume,\n statusMessage\n )\n }\n\n const err = new RequestRetryError('Request failed', statusCode, {\n headers,\n data: { count: this.retryCount }\n })\n\n this.abort(err)\n\n return false\n }\n\n onData (chunk) {\n this.start += chunk.length\n\n return this.handler.onData(chunk)\n }\n\n onComplete (rawTrailers) {\n this.retryCount = 0\n return this.handler.onComplete(rawTrailers)\n }\n\n onError (err) {\n if (this.aborted || isDisturbed(this.opts.body)) {\n return this.handler.onError(err)\n }\n\n // We reconcile in case of a mix between network errors\n // and server error response\n if (this.retryCount - this.retryCountCheckpoint > 0) {\n // We count the difference between the last checkpoint and the current retry count\n this.retryCount =\n this.retryCountCheckpoint +\n (this.retryCount - this.retryCountCheckpoint)\n } else {\n this.retryCount += 1\n }\n\n this.retryOpts.retry(\n err,\n {\n state: { counter: this.retryCount },\n opts: { retryOptions: this.retryOpts, ...this.opts }\n },\n onRetry.bind(this)\n )\n\n function onRetry (err) {\n if (err != null || this.aborted || isDisturbed(this.opts.body)) {\n return this.handler.onError(err)\n }\n\n if (this.start !== 0) {\n const headers = { range: `bytes=${this.start}-${this.end ?? ''}` }\n\n // Weak etag check - weak etags will make comparison algorithms never match\n if (this.etag != null) {\n headers['if-match'] = this.etag\n }\n\n this.opts = {\n ...this.opts,\n headers: {\n ...this.opts.headers,\n ...headers\n }\n }\n }\n\n try {\n this.retryCountCheckpoint = this.retryCount\n this.dispatch(this.opts, this)\n } catch (err) {\n this.handler.onError(err)\n }\n }\n }\n}\n\nmodule.exports = RetryHandler\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst RetryHandler = require('../handler/retry-handler')\n\nclass RetryAgent extends Dispatcher {\n #agent = null\n #options = null\n constructor (agent, options = {}) {\n super(options)\n this.#agent = agent\n this.#options = options\n }\n\n dispatch (opts, handler) {\n const retry = new RetryHandler({\n ...opts,\n retryOptions: this.#options\n }, {\n dispatch: this.#agent.dispatch.bind(this.#agent),\n handler\n })\n return this.#agent.dispatch(opts, retry)\n }\n\n close () {\n return this.#agent.close()\n }\n\n destroy () {\n return this.#agent.destroy()\n }\n}\n\nmodule.exports = RetryAgent\n","// Ported from https://github.com/nodejs/undici/pull/907\n\n'use strict'\n\nconst assert = require('node:assert')\nconst { Readable } = require('node:stream')\nconst { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require('../core/errors')\nconst util = require('../core/util')\nconst { ReadableStreamFrom } = require('../core/util')\n\nconst kConsume = Symbol('kConsume')\nconst kReading = Symbol('kReading')\nconst kBody = Symbol('kBody')\nconst kAbort = Symbol('kAbort')\nconst kContentType = Symbol('kContentType')\nconst kContentLength = Symbol('kContentLength')\n\nconst noop = () => {}\n\nclass BodyReadable extends Readable {\n constructor ({\n resume,\n abort,\n contentType = '',\n contentLength,\n highWaterMark = 64 * 1024 // Same as nodejs fs streams.\n }) {\n super({\n autoDestroy: true,\n read: resume,\n highWaterMark\n })\n\n this._readableState.dataEmitted = false\n\n this[kAbort] = abort\n this[kConsume] = null\n this[kBody] = null\n this[kContentType] = contentType\n this[kContentLength] = contentLength\n\n // Is stream being consumed through Readable API?\n // This is an optimization so that we avoid checking\n // for 'data' and 'readable' listeners in the hot path\n // inside push().\n this[kReading] = false\n }\n\n destroy (err) {\n if (!err && !this._readableState.endEmitted) {\n err = new RequestAbortedError()\n }\n\n if (err) {\n this[kAbort]()\n }\n\n return super.destroy(err)\n }\n\n _destroy (err, callback) {\n // Workaround for Node \"bug\". If the stream is destroyed in same\n // tick as it is created, then a user who is waiting for a\n // promise (i.e micro tick) for installing a 'error' listener will\n // never get a chance and will always encounter an unhandled exception.\n if (!this[kReading]) {\n setImmediate(() => {\n callback(err)\n })\n } else {\n callback(err)\n }\n }\n\n on (ev, ...args) {\n if (ev === 'data' || ev === 'readable') {\n this[kReading] = true\n }\n return super.on(ev, ...args)\n }\n\n addListener (ev, ...args) {\n return this.on(ev, ...args)\n }\n\n off (ev, ...args) {\n const ret = super.off(ev, ...args)\n if (ev === 'data' || ev === 'readable') {\n this[kReading] = (\n this.listenerCount('data') > 0 ||\n this.listenerCount('readable') > 0\n )\n }\n return ret\n }\n\n removeListener (ev, ...args) {\n return this.off(ev, ...args)\n }\n\n push (chunk) {\n if (this[kConsume] && chunk !== null) {\n consumePush(this[kConsume], chunk)\n return this[kReading] ? super.push(chunk) : true\n }\n return super.push(chunk)\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-text\n async text () {\n return consume(this, 'text')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-json\n async json () {\n return consume(this, 'json')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-blob\n async blob () {\n return consume(this, 'blob')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-bytes\n async bytes () {\n return consume(this, 'bytes')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-arraybuffer\n async arrayBuffer () {\n return consume(this, 'arrayBuffer')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-formdata\n async formData () {\n // TODO: Implement.\n throw new NotSupportedError()\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-bodyused\n get bodyUsed () {\n return util.isDisturbed(this)\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-body\n get body () {\n if (!this[kBody]) {\n this[kBody] = ReadableStreamFrom(this)\n if (this[kConsume]) {\n // TODO: Is this the best way to force a lock?\n this[kBody].getReader() // Ensure stream is locked.\n assert(this[kBody].locked)\n }\n }\n return this[kBody]\n }\n\n async dump (opts) {\n let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024\n const signal = opts?.signal\n\n if (signal != null && (typeof signal !== 'object' || !('aborted' in signal))) {\n throw new InvalidArgumentError('signal must be an AbortSignal')\n }\n\n signal?.throwIfAborted()\n\n if (this._readableState.closeEmitted) {\n return null\n }\n\n return await new Promise((resolve, reject) => {\n if (this[kContentLength] > limit) {\n this.destroy(new AbortError())\n }\n\n const onAbort = () => {\n this.destroy(signal.reason ?? new AbortError())\n }\n signal?.addEventListener('abort', onAbort)\n\n this\n .on('close', function () {\n signal?.removeEventListener('abort', onAbort)\n if (signal?.aborted) {\n reject(signal.reason ?? new AbortError())\n } else {\n resolve(null)\n }\n })\n .on('error', noop)\n .on('data', function (chunk) {\n limit -= chunk.length\n if (limit <= 0) {\n this.destroy()\n }\n })\n .resume()\n })\n }\n}\n\n// https://streams.spec.whatwg.org/#readablestream-locked\nfunction isLocked (self) {\n // Consume is an implicit lock.\n return (self[kBody] && self[kBody].locked === true) || self[kConsume]\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction isUnusable (self) {\n return util.isDisturbed(self) || isLocked(self)\n}\n\nasync function consume (stream, type) {\n assert(!stream[kConsume])\n\n return new Promise((resolve, reject) => {\n if (isUnusable(stream)) {\n const rState = stream._readableState\n if (rState.destroyed && rState.closeEmitted === false) {\n stream\n .on('error', err => {\n reject(err)\n })\n .on('close', () => {\n reject(new TypeError('unusable'))\n })\n } else {\n reject(rState.errored ?? new TypeError('unusable'))\n }\n } else {\n queueMicrotask(() => {\n stream[kConsume] = {\n type,\n stream,\n resolve,\n reject,\n length: 0,\n body: []\n }\n\n stream\n .on('error', function (err) {\n consumeFinish(this[kConsume], err)\n })\n .on('close', function () {\n if (this[kConsume].body !== null) {\n consumeFinish(this[kConsume], new RequestAbortedError())\n }\n })\n\n consumeStart(stream[kConsume])\n })\n }\n })\n}\n\nfunction consumeStart (consume) {\n if (consume.body === null) {\n return\n }\n\n const { _readableState: state } = consume.stream\n\n if (state.bufferIndex) {\n const start = state.bufferIndex\n const end = state.buffer.length\n for (let n = start; n < end; n++) {\n consumePush(consume, state.buffer[n])\n }\n } else {\n for (const chunk of state.buffer) {\n consumePush(consume, chunk)\n }\n }\n\n if (state.endEmitted) {\n consumeEnd(this[kConsume])\n } else {\n consume.stream.on('end', function () {\n consumeEnd(this[kConsume])\n })\n }\n\n consume.stream.resume()\n\n while (consume.stream.read() != null) {\n // Loop\n }\n}\n\n/**\n * @param {Buffer[]} chunks\n * @param {number} length\n */\nfunction chunksDecode (chunks, length) {\n if (chunks.length === 0 || length === 0) {\n return ''\n }\n const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length)\n const bufferLength = buffer.length\n\n // Skip BOM.\n const start =\n bufferLength > 2 &&\n buffer[0] === 0xef &&\n buffer[1] === 0xbb &&\n buffer[2] === 0xbf\n ? 3\n : 0\n return buffer.utf8Slice(start, bufferLength)\n}\n\n/**\n * @param {Buffer[]} chunks\n * @param {number} length\n * @returns {Uint8Array}\n */\nfunction chunksConcat (chunks, length) {\n if (chunks.length === 0 || length === 0) {\n return new Uint8Array(0)\n }\n if (chunks.length === 1) {\n // fast-path\n return new Uint8Array(chunks[0])\n }\n const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer)\n\n let offset = 0\n for (let i = 0; i < chunks.length; ++i) {\n const chunk = chunks[i]\n buffer.set(chunk, offset)\n offset += chunk.length\n }\n\n return buffer\n}\n\nfunction consumeEnd (consume) {\n const { type, body, resolve, stream, length } = consume\n\n try {\n if (type === 'text') {\n resolve(chunksDecode(body, length))\n } else if (type === 'json') {\n resolve(JSON.parse(chunksDecode(body, length)))\n } else if (type === 'arrayBuffer') {\n resolve(chunksConcat(body, length).buffer)\n } else if (type === 'blob') {\n resolve(new Blob(body, { type: stream[kContentType] }))\n } else if (type === 'bytes') {\n resolve(chunksConcat(body, length))\n }\n\n consumeFinish(consume)\n } catch (err) {\n stream.destroy(err)\n }\n}\n\nfunction consumePush (consume, chunk) {\n consume.length += chunk.length\n consume.body.push(chunk)\n}\n\nfunction consumeFinish (consume, err) {\n if (consume.body === null) {\n return\n }\n\n if (err) {\n consume.reject(err)\n } else {\n consume.resolve()\n }\n\n consume.type = null\n consume.stream = null\n consume.resolve = null\n consume.reject = null\n consume.length = 0\n consume.body = null\n}\n\nmodule.exports = { Readable: BodyReadable, chunksDecode }\n","const assert = require('node:assert')\nconst {\n ResponseStatusCodeError\n} = require('../core/errors')\n\nconst { chunksDecode } = require('./readable')\nconst CHUNK_LIMIT = 128 * 1024\n\nasync function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {\n assert(body)\n\n let chunks = []\n let length = 0\n\n try {\n for await (const chunk of body) {\n chunks.push(chunk)\n length += chunk.length\n if (length > CHUNK_LIMIT) {\n chunks = []\n length = 0\n break\n }\n }\n } catch {\n chunks = []\n length = 0\n // Do nothing....\n }\n\n const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`\n\n if (statusCode === 204 || !contentType || !length) {\n queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers)))\n return\n }\n\n const stackTraceLimit = Error.stackTraceLimit\n Error.stackTraceLimit = 0\n let payload\n\n try {\n if (isContentTypeApplicationJson(contentType)) {\n payload = JSON.parse(chunksDecode(chunks, length))\n } else if (isContentTypeText(contentType)) {\n payload = chunksDecode(chunks, length)\n }\n } catch {\n // process in a callback to avoid throwing in the microtask queue\n } finally {\n Error.stackTraceLimit = stackTraceLimit\n }\n queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload)))\n}\n\nconst isContentTypeApplicationJson = (contentType) => {\n return (\n contentType.length > 15 &&\n contentType[11] === '/' &&\n contentType[0] === 'a' &&\n contentType[1] === 'p' &&\n contentType[2] === 'p' &&\n contentType[3] === 'l' &&\n contentType[4] === 'i' &&\n contentType[5] === 'c' &&\n contentType[6] === 'a' &&\n contentType[7] === 't' &&\n contentType[8] === 'i' &&\n contentType[9] === 'o' &&\n contentType[10] === 'n' &&\n contentType[12] === 'j' &&\n contentType[13] === 's' &&\n contentType[14] === 'o' &&\n contentType[15] === 'n'\n )\n}\n\nconst isContentTypeText = (contentType) => {\n return (\n contentType.length > 4 &&\n contentType[4] === '/' &&\n contentType[0] === 't' &&\n contentType[1] === 'e' &&\n contentType[2] === 'x' &&\n contentType[3] === 't'\n )\n}\n\nmodule.exports = {\n getResolveErrorBodyCallback,\n isContentTypeApplicationJson,\n isContentTypeText\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { Readable } = require('./readable')\nconst { InvalidArgumentError, RequestAbortedError } = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('node:async_hooks')\n\nclass RequestHandler extends AsyncResource {\n constructor (opts, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts\n\n try {\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {\n throw new InvalidArgumentError('invalid highWaterMark')\n }\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n if (method === 'CONNECT') {\n throw new InvalidArgumentError('invalid method')\n }\n\n if (onInfo && typeof onInfo !== 'function') {\n throw new InvalidArgumentError('invalid onInfo callback')\n }\n\n super('UNDICI_REQUEST')\n } catch (err) {\n if (util.isStream(body)) {\n util.destroy(body.on('error', util.nop), err)\n }\n throw err\n }\n\n this.method = method\n this.responseHeaders = responseHeaders || null\n this.opaque = opaque || null\n this.callback = callback\n this.res = null\n this.abort = null\n this.body = body\n this.trailers = {}\n this.context = null\n this.onInfo = onInfo || null\n this.throwOnError = throwOnError\n this.highWaterMark = highWaterMark\n this.signal = signal\n this.reason = null\n this.removeAbortListener = null\n\n if (util.isStream(body)) {\n body.on('error', (err) => {\n this.onError(err)\n })\n }\n\n if (this.signal) {\n if (this.signal.aborted) {\n this.reason = this.signal.reason ?? new RequestAbortedError()\n } else {\n this.removeAbortListener = util.addAbortListener(this.signal, () => {\n this.reason = this.signal.reason ?? new RequestAbortedError()\n if (this.res) {\n util.destroy(this.res.on('error', util.nop), this.reason)\n } else if (this.abort) {\n this.abort(this.reason)\n }\n\n if (this.removeAbortListener) {\n this.res?.off('close', this.removeAbortListener)\n this.removeAbortListener()\n this.removeAbortListener = null\n }\n })\n }\n }\n }\n\n onConnect (abort, context) {\n if (this.reason) {\n abort(this.reason)\n return\n }\n\n assert(this.callback)\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this\n\n const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n if (statusCode < 200) {\n if (this.onInfo) {\n this.onInfo({ statusCode, headers })\n }\n return\n }\n\n const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n const contentType = parsedHeaders['content-type']\n const contentLength = parsedHeaders['content-length']\n const res = new Readable({\n resume,\n abort,\n contentType,\n contentLength: this.method !== 'HEAD' && contentLength\n ? Number(contentLength)\n : null,\n highWaterMark\n })\n\n if (this.removeAbortListener) {\n res.on('close', this.removeAbortListener)\n }\n\n this.callback = null\n this.res = res\n if (callback !== null) {\n if (this.throwOnError && statusCode >= 400) {\n this.runInAsyncScope(getResolveErrorBodyCallback, null,\n { callback, body: res, contentType, statusCode, statusMessage, headers }\n )\n } else {\n this.runInAsyncScope(callback, null, null, {\n statusCode,\n headers,\n trailers: this.trailers,\n opaque,\n body: res,\n context\n })\n }\n }\n }\n\n onData (chunk) {\n return this.res.push(chunk)\n }\n\n onComplete (trailers) {\n util.parseHeaders(trailers, this.trailers)\n this.res.push(null)\n }\n\n onError (err) {\n const { res, callback, body, opaque } = this\n\n if (callback) {\n // TODO: Does this need queueMicrotask?\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n\n if (res) {\n this.res = null\n // Ensure all queued handlers are invoked before destroying res.\n queueMicrotask(() => {\n util.destroy(res, err)\n })\n }\n\n if (body) {\n this.body = null\n util.destroy(body, err)\n }\n\n if (this.removeAbortListener) {\n res?.off('close', this.removeAbortListener)\n this.removeAbortListener()\n this.removeAbortListener = null\n }\n }\n}\n\nfunction request (opts, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n request.call(this, opts, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n this.dispatch(opts, new RequestHandler(opts, callback))\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts?.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = request\nmodule.exports.RequestHandler = RequestHandler\n","const { addAbortListener } = require('../core/util')\nconst { RequestAbortedError } = require('../core/errors')\n\nconst kListener = Symbol('kListener')\nconst kSignal = Symbol('kSignal')\n\nfunction abort (self) {\n if (self.abort) {\n self.abort(self[kSignal]?.reason)\n } else {\n self.reason = self[kSignal]?.reason ?? new RequestAbortedError()\n }\n removeSignal(self)\n}\n\nfunction addSignal (self, signal) {\n self.reason = null\n\n self[kSignal] = null\n self[kListener] = null\n\n if (!signal) {\n return\n }\n\n if (signal.aborted) {\n abort(self)\n return\n }\n\n self[kSignal] = signal\n self[kListener] = () => {\n abort(self)\n }\n\n addAbortListener(self[kSignal], self[kListener])\n}\n\nfunction removeSignal (self) {\n if (!self[kSignal]) {\n return\n }\n\n if ('removeEventListener' in self[kSignal]) {\n self[kSignal].removeEventListener('abort', self[kListener])\n } else {\n self[kSignal].removeListener('abort', self[kListener])\n }\n\n self[kSignal] = null\n self[kListener] = null\n}\n\nmodule.exports = {\n addSignal,\n removeSignal\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { finished, PassThrough } = require('node:stream')\nconst { InvalidArgumentError, InvalidReturnValueError } = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('node:async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass StreamHandler extends AsyncResource {\n constructor (opts, factory, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts\n\n try {\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('invalid factory')\n }\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n if (method === 'CONNECT') {\n throw new InvalidArgumentError('invalid method')\n }\n\n if (onInfo && typeof onInfo !== 'function') {\n throw new InvalidArgumentError('invalid onInfo callback')\n }\n\n super('UNDICI_STREAM')\n } catch (err) {\n if (util.isStream(body)) {\n util.destroy(body.on('error', util.nop), err)\n }\n throw err\n }\n\n this.responseHeaders = responseHeaders || null\n this.opaque = opaque || null\n this.factory = factory\n this.callback = callback\n this.res = null\n this.abort = null\n this.context = null\n this.trailers = null\n this.body = body\n this.onInfo = onInfo || null\n this.throwOnError = throwOnError || false\n\n if (util.isStream(body)) {\n body.on('error', (err) => {\n this.onError(err)\n })\n }\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (this.reason) {\n abort(this.reason)\n return\n }\n\n assert(this.callback)\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n const { factory, opaque, context, callback, responseHeaders } = this\n\n const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n if (statusCode < 200) {\n if (this.onInfo) {\n this.onInfo({ statusCode, headers })\n }\n return\n }\n\n this.factory = null\n\n let res\n\n if (this.throwOnError && statusCode >= 400) {\n const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n const contentType = parsedHeaders['content-type']\n res = new PassThrough()\n\n this.callback = null\n this.runInAsyncScope(getResolveErrorBodyCallback, null,\n { callback, body: res, contentType, statusCode, statusMessage, headers }\n )\n } else {\n if (factory === null) {\n return\n }\n\n res = this.runInAsyncScope(factory, null, {\n statusCode,\n headers,\n opaque,\n context\n })\n\n if (\n !res ||\n typeof res.write !== 'function' ||\n typeof res.end !== 'function' ||\n typeof res.on !== 'function'\n ) {\n throw new InvalidReturnValueError('expected Writable')\n }\n\n // TODO: Avoid finished. It registers an unnecessary amount of listeners.\n finished(res, { readable: false }, (err) => {\n const { callback, res, opaque, trailers, abort } = this\n\n this.res = null\n if (err || !res.readable) {\n util.destroy(res, err)\n }\n\n this.callback = null\n this.runInAsyncScope(callback, null, err || null, { opaque, trailers })\n\n if (err) {\n abort()\n }\n })\n }\n\n res.on('drain', resume)\n\n this.res = res\n\n const needDrain = res.writableNeedDrain !== undefined\n ? res.writableNeedDrain\n : res._writableState?.needDrain\n\n return needDrain !== true\n }\n\n onData (chunk) {\n const { res } = this\n\n return res ? res.write(chunk) : true\n }\n\n onComplete (trailers) {\n const { res } = this\n\n removeSignal(this)\n\n if (!res) {\n return\n }\n\n this.trailers = util.parseHeaders(trailers)\n\n res.end()\n }\n\n onError (err) {\n const { res, callback, opaque, body } = this\n\n removeSignal(this)\n\n this.factory = null\n\n if (res) {\n this.res = null\n util.destroy(res, err)\n } else if (callback) {\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n\n if (body) {\n this.body = null\n util.destroy(body, err)\n }\n }\n}\n\nfunction stream (opts, factory, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n stream.call(this, opts, factory, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n this.dispatch(opts, new StreamHandler(opts, factory, callback))\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts?.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = stream\n","'use strict'\n\nconst {\n Readable,\n Duplex,\n PassThrough\n} = require('node:stream')\nconst {\n InvalidArgumentError,\n InvalidReturnValueError,\n RequestAbortedError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { AsyncResource } = require('node:async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('node:assert')\n\nconst kResume = Symbol('resume')\n\nclass PipelineRequest extends Readable {\n constructor () {\n super({ autoDestroy: true })\n\n this[kResume] = null\n }\n\n _read () {\n const { [kResume]: resume } = this\n\n if (resume) {\n this[kResume] = null\n resume()\n }\n }\n\n _destroy (err, callback) {\n this._read()\n\n callback(err)\n }\n}\n\nclass PipelineResponse extends Readable {\n constructor (resume) {\n super({ autoDestroy: true })\n this[kResume] = resume\n }\n\n _read () {\n this[kResume]()\n }\n\n _destroy (err, callback) {\n if (!err && !this._readableState.endEmitted) {\n err = new RequestAbortedError()\n }\n\n callback(err)\n }\n}\n\nclass PipelineHandler extends AsyncResource {\n constructor (opts, handler) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (typeof handler !== 'function') {\n throw new InvalidArgumentError('invalid handler')\n }\n\n const { signal, method, opaque, onInfo, responseHeaders } = opts\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n if (method === 'CONNECT') {\n throw new InvalidArgumentError('invalid method')\n }\n\n if (onInfo && typeof onInfo !== 'function') {\n throw new InvalidArgumentError('invalid onInfo callback')\n }\n\n super('UNDICI_PIPELINE')\n\n this.opaque = opaque || null\n this.responseHeaders = responseHeaders || null\n this.handler = handler\n this.abort = null\n this.context = null\n this.onInfo = onInfo || null\n\n this.req = new PipelineRequest().on('error', util.nop)\n\n this.ret = new Duplex({\n readableObjectMode: opts.objectMode,\n autoDestroy: true,\n read: () => {\n const { body } = this\n\n if (body?.resume) {\n body.resume()\n }\n },\n write: (chunk, encoding, callback) => {\n const { req } = this\n\n if (req.push(chunk, encoding) || req._readableState.destroyed) {\n callback()\n } else {\n req[kResume] = callback\n }\n },\n destroy: (err, callback) => {\n const { body, req, res, ret, abort } = this\n\n if (!err && !ret._readableState.endEmitted) {\n err = new RequestAbortedError()\n }\n\n if (abort && err) {\n abort()\n }\n\n util.destroy(body, err)\n util.destroy(req, err)\n util.destroy(res, err)\n\n removeSignal(this)\n\n callback(err)\n }\n }).on('prefinish', () => {\n const { req } = this\n\n // Node < 15 does not call _final in same tick.\n req.push(null)\n })\n\n this.res = null\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n const { ret, res } = this\n\n if (this.reason) {\n abort(this.reason)\n return\n }\n\n assert(!res, 'pipeline cannot be retried')\n assert(!ret.destroyed)\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders (statusCode, rawHeaders, resume) {\n const { opaque, handler, context } = this\n\n if (statusCode < 200) {\n if (this.onInfo) {\n const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n this.onInfo({ statusCode, headers })\n }\n return\n }\n\n this.res = new PipelineResponse(resume)\n\n let body\n try {\n this.handler = null\n const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n body = this.runInAsyncScope(handler, null, {\n statusCode,\n headers,\n opaque,\n body: this.res,\n context\n })\n } catch (err) {\n this.res.on('error', util.nop)\n throw err\n }\n\n if (!body || typeof body.on !== 'function') {\n throw new InvalidReturnValueError('expected Readable')\n }\n\n body\n .on('data', (chunk) => {\n const { ret, body } = this\n\n if (!ret.push(chunk) && body.pause) {\n body.pause()\n }\n })\n .on('error', (err) => {\n const { ret } = this\n\n util.destroy(ret, err)\n })\n .on('end', () => {\n const { ret } = this\n\n ret.push(null)\n })\n .on('close', () => {\n const { ret } = this\n\n if (!ret._readableState.ended) {\n util.destroy(ret, new RequestAbortedError())\n }\n })\n\n this.body = body\n }\n\n onData (chunk) {\n const { res } = this\n return res.push(chunk)\n }\n\n onComplete (trailers) {\n const { res } = this\n res.push(null)\n }\n\n onError (err) {\n const { ret } = this\n this.handler = null\n util.destroy(ret, err)\n }\n}\n\nfunction pipeline (opts, handler) {\n try {\n const pipelineHandler = new PipelineHandler(opts, handler)\n this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)\n return pipelineHandler.ret\n } catch (err) {\n return new PassThrough().destroy(err)\n }\n}\n\nmodule.exports = pipeline\n","'use strict'\n\nconst { InvalidArgumentError, SocketError } = require('../core/errors')\nconst { AsyncResource } = require('node:async_hooks')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('node:assert')\n\nclass UpgradeHandler extends AsyncResource {\n constructor (opts, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n const { signal, opaque, responseHeaders } = opts\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n super('UNDICI_UPGRADE')\n\n this.responseHeaders = responseHeaders || null\n this.opaque = opaque || null\n this.callback = callback\n this.abort = null\n this.context = null\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (this.reason) {\n abort(this.reason)\n return\n }\n\n assert(this.callback)\n\n this.abort = abort\n this.context = null\n }\n\n onHeaders () {\n throw new SocketError('bad upgrade', null)\n }\n\n onUpgrade (statusCode, rawHeaders, socket) {\n assert(statusCode === 101)\n\n const { callback, opaque, context } = this\n\n removeSignal(this)\n\n this.callback = null\n const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n this.runInAsyncScope(callback, null, null, {\n headers,\n socket,\n opaque,\n context\n })\n }\n\n onError (err) {\n const { callback, opaque } = this\n\n removeSignal(this)\n\n if (callback) {\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n }\n}\n\nfunction upgrade (opts, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n upgrade.call(this, opts, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n const upgradeHandler = new UpgradeHandler(opts, callback)\n this.dispatch({\n ...opts,\n method: opts.method || 'GET',\n upgrade: opts.protocol || 'Websocket'\n }, upgradeHandler)\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts?.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = upgrade\n","'use strict'\n\nconst assert = require('node:assert')\nconst { AsyncResource } = require('node:async_hooks')\nconst { InvalidArgumentError, SocketError } = require('../core/errors')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass ConnectHandler extends AsyncResource {\n constructor (opts, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n const { signal, opaque, responseHeaders } = opts\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n super('UNDICI_CONNECT')\n\n this.opaque = opaque || null\n this.responseHeaders = responseHeaders || null\n this.callback = callback\n this.abort = null\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (this.reason) {\n abort(this.reason)\n return\n }\n\n assert(this.callback)\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders () {\n throw new SocketError('bad connect', null)\n }\n\n onUpgrade (statusCode, rawHeaders, socket) {\n const { callback, opaque, context } = this\n\n removeSignal(this)\n\n this.callback = null\n\n let headers = rawHeaders\n // Indicates is an HTTP2Session\n if (headers != null) {\n headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n }\n\n this.runInAsyncScope(callback, null, null, {\n statusCode,\n headers,\n socket,\n opaque,\n context\n })\n }\n\n onError (err) {\n const { callback, opaque } = this\n\n removeSignal(this)\n\n if (callback) {\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n }\n}\n\nfunction connect (opts, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n connect.call(this, opts, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n const connectHandler = new ConnectHandler(opts, callback)\n this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts?.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = connect\n","'use strict'\n\nmodule.exports.request = require('./api-request')\nmodule.exports.stream = require('./api-stream')\nmodule.exports.pipeline = require('./api-pipeline')\nmodule.exports.upgrade = require('./api-upgrade')\nmodule.exports.connect = require('./api-connect')\n","'use strict'\n\nconst { UndiciError } = require('../core/errors')\n\nconst kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED')\n\n/**\n * The request does not match any registered mock dispatches.\n */\nclass MockNotMatchedError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, MockNotMatchedError)\n this.name = 'MockNotMatchedError'\n this.message = message || 'The request does not match any registered mock dispatches'\n this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'\n }\n\n static [Symbol.hasInstance] (instance) {\n return instance && instance[kMockNotMatchedError] === true\n }\n\n [kMockNotMatchedError] = true\n}\n\nmodule.exports = {\n MockNotMatchedError\n}\n","'use strict'\n\nmodule.exports = {\n kAgent: Symbol('agent'),\n kOptions: Symbol('options'),\n kFactory: Symbol('factory'),\n kDispatches: Symbol('dispatches'),\n kDispatchKey: Symbol('dispatch key'),\n kDefaultHeaders: Symbol('default headers'),\n kDefaultTrailers: Symbol('default trailers'),\n kContentLength: Symbol('content length'),\n kMockAgent: Symbol('mock agent'),\n kMockAgentSet: Symbol('mock agent set'),\n kMockAgentGet: Symbol('mock agent get'),\n kMockDispatch: Symbol('mock dispatch'),\n kClose: Symbol('close'),\n kOriginalClose: Symbol('original agent close'),\n kOrigin: Symbol('origin'),\n kIsMockActive: Symbol('is mock active'),\n kNetConnect: Symbol('net connect'),\n kGetNetConnect: Symbol('get net connect'),\n kConnected: Symbol('connected')\n}\n","'use strict'\n\nconst { MockNotMatchedError } = require('./mock-errors')\nconst {\n kDispatches,\n kMockAgent,\n kOriginalDispatch,\n kOrigin,\n kGetNetConnect\n} = require('./mock-symbols')\nconst { buildURL } = require('../core/util')\nconst { STATUS_CODES } = require('node:http')\nconst {\n types: {\n isPromise\n }\n} = require('node:util')\n\nfunction matchValue (match, value) {\n if (typeof match === 'string') {\n return match === value\n }\n if (match instanceof RegExp) {\n return match.test(value)\n }\n if (typeof match === 'function') {\n return match(value) === true\n }\n return false\n}\n\nfunction lowerCaseEntries (headers) {\n return Object.fromEntries(\n Object.entries(headers).map(([headerName, headerValue]) => {\n return [headerName.toLocaleLowerCase(), headerValue]\n })\n )\n}\n\n/**\n * @param {import('../../index').Headers|string[]|Record} headers\n * @param {string} key\n */\nfunction getHeaderByName (headers, key) {\n if (Array.isArray(headers)) {\n for (let i = 0; i < headers.length; i += 2) {\n if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {\n return headers[i + 1]\n }\n }\n\n return undefined\n } else if (typeof headers.get === 'function') {\n return headers.get(key)\n } else {\n return lowerCaseEntries(headers)[key.toLocaleLowerCase()]\n }\n}\n\n/** @param {string[]} headers */\nfunction buildHeadersFromArray (headers) { // fetch HeadersList\n const clone = headers.slice()\n const entries = []\n for (let index = 0; index < clone.length; index += 2) {\n entries.push([clone[index], clone[index + 1]])\n }\n return Object.fromEntries(entries)\n}\n\nfunction matchHeaders (mockDispatch, headers) {\n if (typeof mockDispatch.headers === 'function') {\n if (Array.isArray(headers)) { // fetch HeadersList\n headers = buildHeadersFromArray(headers)\n }\n return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})\n }\n if (typeof mockDispatch.headers === 'undefined') {\n return true\n }\n if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {\n return false\n }\n\n for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {\n const headerValue = getHeaderByName(headers, matchHeaderName)\n\n if (!matchValue(matchHeaderValue, headerValue)) {\n return false\n }\n }\n return true\n}\n\nfunction safeUrl (path) {\n if (typeof path !== 'string') {\n return path\n }\n\n const pathSegments = path.split('?')\n\n if (pathSegments.length !== 2) {\n return path\n }\n\n const qp = new URLSearchParams(pathSegments.pop())\n qp.sort()\n return [...pathSegments, qp.toString()].join('?')\n}\n\nfunction matchKey (mockDispatch, { path, method, body, headers }) {\n const pathMatch = matchValue(mockDispatch.path, path)\n const methodMatch = matchValue(mockDispatch.method, method)\n const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true\n const headersMatch = matchHeaders(mockDispatch, headers)\n return pathMatch && methodMatch && bodyMatch && headersMatch\n}\n\nfunction getResponseData (data) {\n if (Buffer.isBuffer(data)) {\n return data\n } else if (data instanceof Uint8Array) {\n return data\n } else if (data instanceof ArrayBuffer) {\n return data\n } else if (typeof data === 'object') {\n return JSON.stringify(data)\n } else {\n return data.toString()\n }\n}\n\nfunction getMockDispatch (mockDispatches, key) {\n const basePath = key.query ? buildURL(key.path, key.query) : key.path\n const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath\n\n // Match path\n let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)\n }\n\n // Match method\n matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath}'`)\n }\n\n // Match body\n matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`)\n }\n\n // Match headers\n matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))\n if (matchedMockDispatches.length === 0) {\n const headers = typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers\n throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath}'`)\n }\n\n return matchedMockDispatches[0]\n}\n\nfunction addMockDispatch (mockDispatches, key, data) {\n const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }\n const replyData = typeof data === 'function' ? { callback: data } : { ...data }\n const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }\n mockDispatches.push(newMockDispatch)\n return newMockDispatch\n}\n\nfunction deleteMockDispatch (mockDispatches, key) {\n const index = mockDispatches.findIndex(dispatch => {\n if (!dispatch.consumed) {\n return false\n }\n return matchKey(dispatch, key)\n })\n if (index !== -1) {\n mockDispatches.splice(index, 1)\n }\n}\n\nfunction buildKey (opts) {\n const { path, method, body, headers, query } = opts\n return {\n path,\n method,\n body,\n headers,\n query\n }\n}\n\nfunction generateKeyValues (data) {\n const keys = Object.keys(data)\n const result = []\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n const value = data[key]\n const name = Buffer.from(`${key}`)\n if (Array.isArray(value)) {\n for (let j = 0; j < value.length; ++j) {\n result.push(name, Buffer.from(`${value[j]}`))\n }\n } else {\n result.push(name, Buffer.from(`${value}`))\n }\n }\n return result\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status\n * @param {number} statusCode\n */\nfunction getStatusText (statusCode) {\n return STATUS_CODES[statusCode] || 'unknown'\n}\n\nasync function getResponse (body) {\n const buffers = []\n for await (const data of body) {\n buffers.push(data)\n }\n return Buffer.concat(buffers).toString('utf8')\n}\n\n/**\n * Mock dispatch function used to simulate undici dispatches\n */\nfunction mockDispatch (opts, handler) {\n // Get mock dispatch from built key\n const key = buildKey(opts)\n const mockDispatch = getMockDispatch(this[kDispatches], key)\n\n mockDispatch.timesInvoked++\n\n // Here's where we resolve a callback if a callback is present for the dispatch data.\n if (mockDispatch.data.callback) {\n mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }\n }\n\n // Parse mockDispatch data\n const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch\n const { timesInvoked, times } = mockDispatch\n\n // If it's used up and not persistent, mark as consumed\n mockDispatch.consumed = !persist && timesInvoked >= times\n mockDispatch.pending = timesInvoked < times\n\n // If specified, trigger dispatch error\n if (error !== null) {\n deleteMockDispatch(this[kDispatches], key)\n handler.onError(error)\n return true\n }\n\n // Handle the request with a delay if necessary\n if (typeof delay === 'number' && delay > 0) {\n setTimeout(() => {\n handleReply(this[kDispatches])\n }, delay)\n } else {\n handleReply(this[kDispatches])\n }\n\n function handleReply (mockDispatches, _data = data) {\n // fetch's HeadersList is a 1D string array\n const optsHeaders = Array.isArray(opts.headers)\n ? buildHeadersFromArray(opts.headers)\n : opts.headers\n const body = typeof _data === 'function'\n ? _data({ ...opts, headers: optsHeaders })\n : _data\n\n // util.types.isPromise is likely needed for jest.\n if (isPromise(body)) {\n // If handleReply is asynchronous, throwing an error\n // in the callback will reject the promise, rather than\n // synchronously throw the error, which breaks some tests.\n // Rather, we wait for the callback to resolve if it is a\n // promise, and then re-run handleReply with the new body.\n body.then((newData) => handleReply(mockDispatches, newData))\n return\n }\n\n const responseData = getResponseData(body)\n const responseHeaders = generateKeyValues(headers)\n const responseTrailers = generateKeyValues(trailers)\n\n handler.onConnect?.(err => handler.onError(err), null)\n handler.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode))\n handler.onData?.(Buffer.from(responseData))\n handler.onComplete?.(responseTrailers)\n deleteMockDispatch(mockDispatches, key)\n }\n\n function resume () {}\n\n return true\n}\n\nfunction buildMockDispatch () {\n const agent = this[kMockAgent]\n const origin = this[kOrigin]\n const originalDispatch = this[kOriginalDispatch]\n\n return function dispatch (opts, handler) {\n if (agent.isMockActive) {\n try {\n mockDispatch.call(this, opts, handler)\n } catch (error) {\n if (error instanceof MockNotMatchedError) {\n const netConnect = agent[kGetNetConnect]()\n if (netConnect === false) {\n throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)\n }\n if (checkNetConnect(netConnect, origin)) {\n originalDispatch.call(this, opts, handler)\n } else {\n throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)\n }\n } else {\n throw error\n }\n }\n } else {\n originalDispatch.call(this, opts, handler)\n }\n }\n}\n\nfunction checkNetConnect (netConnect, origin) {\n const url = new URL(origin)\n if (netConnect === true) {\n return true\n } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {\n return true\n }\n return false\n}\n\nfunction buildMockOptions (opts) {\n if (opts) {\n const { agent, ...mockOptions } = opts\n return mockOptions\n }\n}\n\nmodule.exports = {\n getResponseData,\n getMockDispatch,\n addMockDispatch,\n deleteMockDispatch,\n buildKey,\n generateKeyValues,\n matchValue,\n getResponse,\n getStatusText,\n mockDispatch,\n buildMockDispatch,\n checkNetConnect,\n buildMockOptions,\n getHeaderByName,\n buildHeadersFromArray\n}\n","'use strict'\n\nconst { getResponseData, buildKey, addMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kDispatchKey,\n kDefaultHeaders,\n kDefaultTrailers,\n kContentLength,\n kMockDispatch\n} = require('./mock-symbols')\nconst { InvalidArgumentError } = require('../core/errors')\nconst { buildURL } = require('../core/util')\n\n/**\n * Defines the scope API for an interceptor reply\n */\nclass MockScope {\n constructor (mockDispatch) {\n this[kMockDispatch] = mockDispatch\n }\n\n /**\n * Delay a reply by a set amount in ms.\n */\n delay (waitInMs) {\n if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {\n throw new InvalidArgumentError('waitInMs must be a valid integer > 0')\n }\n\n this[kMockDispatch].delay = waitInMs\n return this\n }\n\n /**\n * For a defined reply, never mark as consumed.\n */\n persist () {\n this[kMockDispatch].persist = true\n return this\n }\n\n /**\n * Allow one to define a reply for a set amount of matching requests.\n */\n times (repeatTimes) {\n if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {\n throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')\n }\n\n this[kMockDispatch].times = repeatTimes\n return this\n }\n}\n\n/**\n * Defines an interceptor for a Mock\n */\nclass MockInterceptor {\n constructor (opts, mockDispatches) {\n if (typeof opts !== 'object') {\n throw new InvalidArgumentError('opts must be an object')\n }\n if (typeof opts.path === 'undefined') {\n throw new InvalidArgumentError('opts.path must be defined')\n }\n if (typeof opts.method === 'undefined') {\n opts.method = 'GET'\n }\n // See https://github.com/nodejs/undici/issues/1245\n // As per RFC 3986, clients are not supposed to send URI\n // fragments to servers when they retrieve a document,\n if (typeof opts.path === 'string') {\n if (opts.query) {\n opts.path = buildURL(opts.path, opts.query)\n } else {\n // Matches https://github.com/nodejs/undici/blob/main/lib/web/fetch/index.js#L1811\n const parsedURL = new URL(opts.path, 'data://')\n opts.path = parsedURL.pathname + parsedURL.search\n }\n }\n if (typeof opts.method === 'string') {\n opts.method = opts.method.toUpperCase()\n }\n\n this[kDispatchKey] = buildKey(opts)\n this[kDispatches] = mockDispatches\n this[kDefaultHeaders] = {}\n this[kDefaultTrailers] = {}\n this[kContentLength] = false\n }\n\n createMockScopeDispatchData ({ statusCode, data, responseOptions }) {\n const responseData = getResponseData(data)\n const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}\n const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }\n const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }\n\n return { statusCode, data, headers, trailers }\n }\n\n validateReplyParameters (replyParameters) {\n if (typeof replyParameters.statusCode === 'undefined') {\n throw new InvalidArgumentError('statusCode must be defined')\n }\n if (typeof replyParameters.responseOptions !== 'object' || replyParameters.responseOptions === null) {\n throw new InvalidArgumentError('responseOptions must be an object')\n }\n }\n\n /**\n * Mock an undici request with a defined reply.\n */\n reply (replyOptionsCallbackOrStatusCode) {\n // Values of reply aren't available right now as they\n // can only be available when the reply callback is invoked.\n if (typeof replyOptionsCallbackOrStatusCode === 'function') {\n // We'll first wrap the provided callback in another function,\n // this function will properly resolve the data from the callback\n // when invoked.\n const wrappedDefaultsCallback = (opts) => {\n // Our reply options callback contains the parameter for statusCode, data and options.\n const resolvedData = replyOptionsCallbackOrStatusCode(opts)\n\n // Check if it is in the right format\n if (typeof resolvedData !== 'object' || resolvedData === null) {\n throw new InvalidArgumentError('reply options callback must return an object')\n }\n\n const replyParameters = { data: '', responseOptions: {}, ...resolvedData }\n this.validateReplyParameters(replyParameters)\n // Since the values can be obtained immediately we return them\n // from this higher order function that will be resolved later.\n return {\n ...this.createMockScopeDispatchData(replyParameters)\n }\n }\n\n // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)\n return new MockScope(newMockDispatch)\n }\n\n // We can have either one or three parameters, if we get here,\n // we should have 1-3 parameters. So we spread the arguments of\n // this function to obtain the parameters, since replyData will always\n // just be the statusCode.\n const replyParameters = {\n statusCode: replyOptionsCallbackOrStatusCode,\n data: arguments[1] === undefined ? '' : arguments[1],\n responseOptions: arguments[2] === undefined ? {} : arguments[2]\n }\n this.validateReplyParameters(replyParameters)\n\n // Send in-already provided data like usual\n const dispatchData = this.createMockScopeDispatchData(replyParameters)\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)\n return new MockScope(newMockDispatch)\n }\n\n /**\n * Mock an undici request with a defined error.\n */\n replyWithError (error) {\n if (typeof error === 'undefined') {\n throw new InvalidArgumentError('error must be defined')\n }\n\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })\n return new MockScope(newMockDispatch)\n }\n\n /**\n * Set default reply headers on the interceptor for subsequent replies\n */\n defaultReplyHeaders (headers) {\n if (typeof headers === 'undefined') {\n throw new InvalidArgumentError('headers must be defined')\n }\n\n this[kDefaultHeaders] = headers\n return this\n }\n\n /**\n * Set default reply trailers on the interceptor for subsequent replies\n */\n defaultReplyTrailers (trailers) {\n if (typeof trailers === 'undefined') {\n throw new InvalidArgumentError('trailers must be defined')\n }\n\n this[kDefaultTrailers] = trailers\n return this\n }\n\n /**\n * Set reply content length header for replies on the interceptor\n */\n replyContentLength () {\n this[kContentLength] = true\n return this\n }\n}\n\nmodule.exports.MockInterceptor = MockInterceptor\nmodule.exports.MockScope = MockScope\n","'use strict'\n\nconst { promisify } = require('node:util')\nconst Client = require('../dispatcher/client')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kMockAgent,\n kClose,\n kOriginalClose,\n kOrigin,\n kOriginalDispatch,\n kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockClient provides an API that extends the Client to influence the mockDispatches.\n */\nclass MockClient extends Client {\n constructor (origin, opts) {\n super(origin, opts)\n\n if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n\n this[kMockAgent] = opts.agent\n this[kOrigin] = origin\n this[kDispatches] = []\n this[kConnected] = 1\n this[kOriginalDispatch] = this.dispatch\n this[kOriginalClose] = this.close.bind(this)\n\n this.dispatch = buildMockDispatch.call(this)\n this.close = this[kClose]\n }\n\n get [Symbols.kConnected] () {\n return this[kConnected]\n }\n\n /**\n * Sets up the base interceptor for mocking replies from undici.\n */\n intercept (opts) {\n return new MockInterceptor(opts, this[kDispatches])\n }\n\n async [kClose] () {\n await promisify(this[kOriginalClose])()\n this[kConnected] = 0\n this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n }\n}\n\nmodule.exports = MockClient\n","'use strict'\n\nconst { promisify } = require('node:util')\nconst Pool = require('../dispatcher/pool')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kMockAgent,\n kClose,\n kOriginalClose,\n kOrigin,\n kOriginalDispatch,\n kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockPool provides an API that extends the Pool to influence the mockDispatches.\n */\nclass MockPool extends Pool {\n constructor (origin, opts) {\n super(origin, opts)\n\n if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n\n this[kMockAgent] = opts.agent\n this[kOrigin] = origin\n this[kDispatches] = []\n this[kConnected] = 1\n this[kOriginalDispatch] = this.dispatch\n this[kOriginalClose] = this.close.bind(this)\n\n this.dispatch = buildMockDispatch.call(this)\n this.close = this[kClose]\n }\n\n get [Symbols.kConnected] () {\n return this[kConnected]\n }\n\n /**\n * Sets up the base interceptor for mocking replies from undici.\n */\n intercept (opts) {\n return new MockInterceptor(opts, this[kDispatches])\n }\n\n async [kClose] () {\n await promisify(this[kOriginalClose])()\n this[kConnected] = 0\n this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n }\n}\n\nmodule.exports = MockPool\n","'use strict'\n\nconst singulars = {\n pronoun: 'it',\n is: 'is',\n was: 'was',\n this: 'this'\n}\n\nconst plurals = {\n pronoun: 'they',\n is: 'are',\n was: 'were',\n this: 'these'\n}\n\nmodule.exports = class Pluralizer {\n constructor (singular, plural) {\n this.singular = singular\n this.plural = plural\n }\n\n pluralize (count) {\n const one = count === 1\n const keys = one ? singulars : plurals\n const noun = one ? this.singular : this.plural\n return { ...keys, count, noun }\n }\n}\n","'use strict'\n\nconst { Transform } = require('node:stream')\nconst { Console } = require('node:console')\n\nconst PERSISTENT = process.versions.icu ? '✅' : 'Y '\nconst NOT_PERSISTENT = process.versions.icu ? '❌' : 'N '\n\n/**\n * Gets the output of `console.table(…)` as a string.\n */\nmodule.exports = class PendingInterceptorsFormatter {\n constructor ({ disableColors } = {}) {\n this.transform = new Transform({\n transform (chunk, _enc, cb) {\n cb(null, chunk)\n }\n })\n\n this.logger = new Console({\n stdout: this.transform,\n inspectOptions: {\n colors: !disableColors && !process.env.CI\n }\n })\n }\n\n format (pendingInterceptors) {\n const withPrettyHeaders = pendingInterceptors.map(\n ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({\n Method: method,\n Origin: origin,\n Path: path,\n 'Status code': statusCode,\n Persistent: persist ? PERSISTENT : NOT_PERSISTENT,\n Invocations: timesInvoked,\n Remaining: persist ? Infinity : times - timesInvoked\n }))\n\n this.logger.table(withPrettyHeaders)\n return this.transform.read().toString()\n }\n}\n","'use strict'\n\nconst { kClients } = require('../core/symbols')\nconst Agent = require('../dispatcher/agent')\nconst {\n kAgent,\n kMockAgentSet,\n kMockAgentGet,\n kDispatches,\n kIsMockActive,\n kNetConnect,\n kGetNetConnect,\n kOptions,\n kFactory\n} = require('./mock-symbols')\nconst MockClient = require('./mock-client')\nconst MockPool = require('./mock-pool')\nconst { matchValue, buildMockOptions } = require('./mock-utils')\nconst { InvalidArgumentError, UndiciError } = require('../core/errors')\nconst Dispatcher = require('../dispatcher/dispatcher')\nconst Pluralizer = require('./pluralizer')\nconst PendingInterceptorsFormatter = require('./pending-interceptors-formatter')\n\nclass MockAgent extends Dispatcher {\n constructor (opts) {\n super(opts)\n\n this[kNetConnect] = true\n this[kIsMockActive] = true\n\n // Instantiate Agent and encapsulate\n if ((opts?.agent && typeof opts.agent.dispatch !== 'function')) {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n const agent = opts?.agent ? opts.agent : new Agent(opts)\n this[kAgent] = agent\n\n this[kClients] = agent[kClients]\n this[kOptions] = buildMockOptions(opts)\n }\n\n get (origin) {\n let dispatcher = this[kMockAgentGet](origin)\n\n if (!dispatcher) {\n dispatcher = this[kFactory](origin)\n this[kMockAgentSet](origin, dispatcher)\n }\n return dispatcher\n }\n\n dispatch (opts, handler) {\n // Call MockAgent.get to perform additional setup before dispatching as normal\n this.get(opts.origin)\n return this[kAgent].dispatch(opts, handler)\n }\n\n async close () {\n await this[kAgent].close()\n this[kClients].clear()\n }\n\n deactivate () {\n this[kIsMockActive] = false\n }\n\n activate () {\n this[kIsMockActive] = true\n }\n\n enableNetConnect (matcher) {\n if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {\n if (Array.isArray(this[kNetConnect])) {\n this[kNetConnect].push(matcher)\n } else {\n this[kNetConnect] = [matcher]\n }\n } else if (typeof matcher === 'undefined') {\n this[kNetConnect] = true\n } else {\n throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')\n }\n }\n\n disableNetConnect () {\n this[kNetConnect] = false\n }\n\n // This is required to bypass issues caused by using global symbols - see:\n // https://github.com/nodejs/undici/issues/1447\n get isMockActive () {\n return this[kIsMockActive]\n }\n\n [kMockAgentSet] (origin, dispatcher) {\n this[kClients].set(origin, dispatcher)\n }\n\n [kFactory] (origin) {\n const mockOptions = Object.assign({ agent: this }, this[kOptions])\n return this[kOptions] && this[kOptions].connections === 1\n ? new MockClient(origin, mockOptions)\n : new MockPool(origin, mockOptions)\n }\n\n [kMockAgentGet] (origin) {\n // First check if we can immediately find it\n const client = this[kClients].get(origin)\n if (client) {\n return client\n }\n\n // If the origin is not a string create a dummy parent pool and return to user\n if (typeof origin !== 'string') {\n const dispatcher = this[kFactory]('http://localhost:9999')\n this[kMockAgentSet](origin, dispatcher)\n return dispatcher\n }\n\n // If we match, create a pool and assign the same dispatches\n for (const [keyMatcher, nonExplicitDispatcher] of Array.from(this[kClients])) {\n if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {\n const dispatcher = this[kFactory](origin)\n this[kMockAgentSet](origin, dispatcher)\n dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]\n return dispatcher\n }\n }\n }\n\n [kGetNetConnect] () {\n return this[kNetConnect]\n }\n\n pendingInterceptors () {\n const mockAgentClients = this[kClients]\n\n return Array.from(mockAgentClients.entries())\n .flatMap(([origin, scope]) => scope[kDispatches].map(dispatch => ({ ...dispatch, origin })))\n .filter(({ pending }) => pending)\n }\n\n assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {\n const pending = this.pendingInterceptors()\n\n if (pending.length === 0) {\n return\n }\n\n const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)\n\n throw new UndiciError(`\n${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:\n\n${pendingInterceptorsFormatter.format(pending)}\n`.trim())\n }\n}\n\nmodule.exports = MockAgent\n","'use strict'\n\n// We include a version number for the Dispatcher API. In case of breaking changes,\n// this version number must be increased to avoid conflicts.\nconst globalDispatcher = Symbol.for('undici.globalDispatcher.1')\nconst { InvalidArgumentError } = require('./core/errors')\nconst Agent = require('./dispatcher/agent')\n\nif (getGlobalDispatcher() === undefined) {\n setGlobalDispatcher(new Agent())\n}\n\nfunction setGlobalDispatcher (agent) {\n if (!agent || typeof agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument agent must implement Agent')\n }\n Object.defineProperty(globalThis, globalDispatcher, {\n value: agent,\n writable: true,\n enumerable: false,\n configurable: false\n })\n}\n\nfunction getGlobalDispatcher () {\n return globalThis[globalDispatcher]\n}\n\nmodule.exports = {\n setGlobalDispatcher,\n getGlobalDispatcher\n}\n","'use strict'\n\nmodule.exports = class DecoratorHandler {\n #handler\n\n constructor (handler) {\n if (typeof handler !== 'object' || handler === null) {\n throw new TypeError('handler must be an object')\n }\n this.#handler = handler\n }\n\n onConnect (...args) {\n return this.#handler.onConnect?.(...args)\n }\n\n onError (...args) {\n return this.#handler.onError?.(...args)\n }\n\n onUpgrade (...args) {\n return this.#handler.onUpgrade?.(...args)\n }\n\n onResponseStarted (...args) {\n return this.#handler.onResponseStarted?.(...args)\n }\n\n onHeaders (...args) {\n return this.#handler.onHeaders?.(...args)\n }\n\n onData (...args) {\n return this.#handler.onData?.(...args)\n }\n\n onComplete (...args) {\n return this.#handler.onComplete?.(...args)\n }\n\n onBodySent (...args) {\n return this.#handler.onBodySent?.(...args)\n }\n}\n","'use strict'\nconst RedirectHandler = require('../handler/redirect-handler')\n\nmodule.exports = opts => {\n const globalMaxRedirections = opts?.maxRedirections\n return dispatch => {\n return function redirectInterceptor (opts, handler) {\n const { maxRedirections = globalMaxRedirections, ...baseOpts } = opts\n\n if (!maxRedirections) {\n return dispatch(opts, handler)\n }\n\n const redirectHandler = new RedirectHandler(\n dispatch,\n maxRedirections,\n opts,\n handler\n )\n\n return dispatch(baseOpts, redirectHandler)\n }\n }\n}\n","'use strict'\nconst RetryHandler = require('../handler/retry-handler')\n\nmodule.exports = globalOpts => {\n return dispatch => {\n return function retryInterceptor (opts, handler) {\n return dispatch(\n opts,\n new RetryHandler(\n { ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } },\n {\n handler,\n dispatch\n }\n )\n )\n }\n }\n}\n","'use strict'\n\nconst util = require('../core/util')\nconst { InvalidArgumentError, RequestAbortedError } = require('../core/errors')\nconst DecoratorHandler = require('../handler/decorator-handler')\n\nclass DumpHandler extends DecoratorHandler {\n #maxSize = 1024 * 1024\n #abort = null\n #dumped = false\n #aborted = false\n #size = 0\n #reason = null\n #handler = null\n\n constructor ({ maxSize }, handler) {\n super(handler)\n\n if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) {\n throw new InvalidArgumentError('maxSize must be a number greater than 0')\n }\n\n this.#maxSize = maxSize ?? this.#maxSize\n this.#handler = handler\n }\n\n onConnect (abort) {\n this.#abort = abort\n\n this.#handler.onConnect(this.#customAbort.bind(this))\n }\n\n #customAbort (reason) {\n this.#aborted = true\n this.#reason = reason\n }\n\n // TODO: will require adjustment after new hooks are out\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n const headers = util.parseHeaders(rawHeaders)\n const contentLength = headers['content-length']\n\n if (contentLength != null && contentLength > this.#maxSize) {\n throw new RequestAbortedError(\n `Response size (${contentLength}) larger than maxSize (${\n this.#maxSize\n })`\n )\n }\n\n if (this.#aborted) {\n return true\n }\n\n return this.#handler.onHeaders(\n statusCode,\n rawHeaders,\n resume,\n statusMessage\n )\n }\n\n onError (err) {\n if (this.#dumped) {\n return\n }\n\n err = this.#reason ?? err\n\n this.#handler.onError(err)\n }\n\n onData (chunk) {\n this.#size = this.#size + chunk.length\n\n if (this.#size >= this.#maxSize) {\n this.#dumped = true\n\n if (this.#aborted) {\n this.#handler.onError(this.#reason)\n } else {\n this.#handler.onComplete([])\n }\n }\n\n return true\n }\n\n onComplete (trailers) {\n if (this.#dumped) {\n return\n }\n\n if (this.#aborted) {\n this.#handler.onError(this.reason)\n return\n }\n\n this.#handler.onComplete(trailers)\n }\n}\n\nfunction createDumpInterceptor (\n { maxSize: defaultMaxSize } = {\n maxSize: 1024 * 1024\n }\n) {\n return dispatch => {\n return function Intercept (opts, handler) {\n const { dumpMaxSize = defaultMaxSize } =\n opts\n\n const dumpHandler = new DumpHandler(\n { maxSize: dumpMaxSize },\n handler\n )\n\n return dispatch(opts, dumpHandler)\n }\n }\n}\n\nmodule.exports = createDumpInterceptor\n","'use strict'\nconst { isIP } = require('node:net')\nconst { lookup } = require('node:dns')\nconst DecoratorHandler = require('../handler/decorator-handler')\nconst { InvalidArgumentError, InformationalError } = require('../core/errors')\nconst maxInt = Math.pow(2, 31) - 1\n\nclass DNSInstance {\n #maxTTL = 0\n #maxItems = 0\n #records = new Map()\n dualStack = true\n affinity = null\n lookup = null\n pick = null\n\n constructor (opts) {\n this.#maxTTL = opts.maxTTL\n this.#maxItems = opts.maxItems\n this.dualStack = opts.dualStack\n this.affinity = opts.affinity\n this.lookup = opts.lookup ?? this.#defaultLookup\n this.pick = opts.pick ?? this.#defaultPick\n }\n\n get full () {\n return this.#records.size === this.#maxItems\n }\n\n runLookup (origin, opts, cb) {\n const ips = this.#records.get(origin.hostname)\n\n // If full, we just return the origin\n if (ips == null && this.full) {\n cb(null, origin.origin)\n return\n }\n\n const newOpts = {\n affinity: this.affinity,\n dualStack: this.dualStack,\n lookup: this.lookup,\n pick: this.pick,\n ...opts.dns,\n maxTTL: this.#maxTTL,\n maxItems: this.#maxItems\n }\n\n // If no IPs we lookup\n if (ips == null) {\n this.lookup(origin, newOpts, (err, addresses) => {\n if (err || addresses == null || addresses.length === 0) {\n cb(err ?? new InformationalError('No DNS entries found'))\n return\n }\n\n this.setRecords(origin, addresses)\n const records = this.#records.get(origin.hostname)\n\n const ip = this.pick(\n origin,\n records,\n newOpts.affinity\n )\n\n let port\n if (typeof ip.port === 'number') {\n port = `:${ip.port}`\n } else if (origin.port !== '') {\n port = `:${origin.port}`\n } else {\n port = ''\n }\n\n cb(\n null,\n `${origin.protocol}//${\n ip.family === 6 ? `[${ip.address}]` : ip.address\n }${port}`\n )\n })\n } else {\n // If there's IPs we pick\n const ip = this.pick(\n origin,\n ips,\n newOpts.affinity\n )\n\n // If no IPs we lookup - deleting old records\n if (ip == null) {\n this.#records.delete(origin.hostname)\n this.runLookup(origin, opts, cb)\n return\n }\n\n let port\n if (typeof ip.port === 'number') {\n port = `:${ip.port}`\n } else if (origin.port !== '') {\n port = `:${origin.port}`\n } else {\n port = ''\n }\n\n cb(\n null,\n `${origin.protocol}//${\n ip.family === 6 ? `[${ip.address}]` : ip.address\n }${port}`\n )\n }\n }\n\n #defaultLookup (origin, opts, cb) {\n lookup(\n origin.hostname,\n {\n all: true,\n family: this.dualStack === false ? this.affinity : 0,\n order: 'ipv4first'\n },\n (err, addresses) => {\n if (err) {\n return cb(err)\n }\n\n const results = new Map()\n\n for (const addr of addresses) {\n // On linux we found duplicates, we attempt to remove them with\n // the latest record\n results.set(`${addr.address}:${addr.family}`, addr)\n }\n\n cb(null, results.values())\n }\n )\n }\n\n #defaultPick (origin, hostnameRecords, affinity) {\n let ip = null\n const { records, offset } = hostnameRecords\n\n let family\n if (this.dualStack) {\n if (affinity == null) {\n // Balance between ip families\n if (offset == null || offset === maxInt) {\n hostnameRecords.offset = 0\n affinity = 4\n } else {\n hostnameRecords.offset++\n affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4\n }\n }\n\n if (records[affinity] != null && records[affinity].ips.length > 0) {\n family = records[affinity]\n } else {\n family = records[affinity === 4 ? 6 : 4]\n }\n } else {\n family = records[affinity]\n }\n\n // If no IPs we return null\n if (family == null || family.ips.length === 0) {\n return ip\n }\n\n if (family.offset == null || family.offset === maxInt) {\n family.offset = 0\n } else {\n family.offset++\n }\n\n const position = family.offset % family.ips.length\n ip = family.ips[position] ?? null\n\n if (ip == null) {\n return ip\n }\n\n if (Date.now() - ip.timestamp > ip.ttl) { // record TTL is already in ms\n // We delete expired records\n // It is possible that they have different TTL, so we manage them individually\n family.ips.splice(position, 1)\n return this.pick(origin, hostnameRecords, affinity)\n }\n\n return ip\n }\n\n setRecords (origin, addresses) {\n const timestamp = Date.now()\n const records = { records: { 4: null, 6: null } }\n for (const record of addresses) {\n record.timestamp = timestamp\n if (typeof record.ttl === 'number') {\n // The record TTL is expected to be in ms\n record.ttl = Math.min(record.ttl, this.#maxTTL)\n } else {\n record.ttl = this.#maxTTL\n }\n\n const familyRecords = records.records[record.family] ?? { ips: [] }\n\n familyRecords.ips.push(record)\n records.records[record.family] = familyRecords\n }\n\n this.#records.set(origin.hostname, records)\n }\n\n getHandler (meta, opts) {\n return new DNSDispatchHandler(this, meta, opts)\n }\n}\n\nclass DNSDispatchHandler extends DecoratorHandler {\n #state = null\n #opts = null\n #dispatch = null\n #handler = null\n #origin = null\n\n constructor (state, { origin, handler, dispatch }, opts) {\n super(handler)\n this.#origin = origin\n this.#handler = handler\n this.#opts = { ...opts }\n this.#state = state\n this.#dispatch = dispatch\n }\n\n onError (err) {\n switch (err.code) {\n case 'ETIMEDOUT':\n case 'ECONNREFUSED': {\n if (this.#state.dualStack) {\n // We delete the record and retry\n this.#state.runLookup(this.#origin, this.#opts, (err, newOrigin) => {\n if (err) {\n return this.#handler.onError(err)\n }\n\n const dispatchOpts = {\n ...this.#opts,\n origin: newOrigin\n }\n\n this.#dispatch(dispatchOpts, this)\n })\n\n // if dual-stack disabled, we error out\n return\n }\n\n this.#handler.onError(err)\n return\n }\n case 'ENOTFOUND':\n this.#state.deleteRecord(this.#origin)\n // eslint-disable-next-line no-fallthrough\n default:\n this.#handler.onError(err)\n break\n }\n }\n}\n\nmodule.exports = interceptorOpts => {\n if (\n interceptorOpts?.maxTTL != null &&\n (typeof interceptorOpts?.maxTTL !== 'number' || interceptorOpts?.maxTTL < 0)\n ) {\n throw new InvalidArgumentError('Invalid maxTTL. Must be a positive number')\n }\n\n if (\n interceptorOpts?.maxItems != null &&\n (typeof interceptorOpts?.maxItems !== 'number' ||\n interceptorOpts?.maxItems < 1)\n ) {\n throw new InvalidArgumentError(\n 'Invalid maxItems. Must be a positive number and greater than zero'\n )\n }\n\n if (\n interceptorOpts?.affinity != null &&\n interceptorOpts?.affinity !== 4 &&\n interceptorOpts?.affinity !== 6\n ) {\n throw new InvalidArgumentError('Invalid affinity. Must be either 4 or 6')\n }\n\n if (\n interceptorOpts?.dualStack != null &&\n typeof interceptorOpts?.dualStack !== 'boolean'\n ) {\n throw new InvalidArgumentError('Invalid dualStack. Must be a boolean')\n }\n\n if (\n interceptorOpts?.lookup != null &&\n typeof interceptorOpts?.lookup !== 'function'\n ) {\n throw new InvalidArgumentError('Invalid lookup. Must be a function')\n }\n\n if (\n interceptorOpts?.pick != null &&\n typeof interceptorOpts?.pick !== 'function'\n ) {\n throw new InvalidArgumentError('Invalid pick. Must be a function')\n }\n\n const dualStack = interceptorOpts?.dualStack ?? true\n let affinity\n if (dualStack) {\n affinity = interceptorOpts?.affinity ?? null\n } else {\n affinity = interceptorOpts?.affinity ?? 4\n }\n\n const opts = {\n maxTTL: interceptorOpts?.maxTTL ?? 10e3, // Expressed in ms\n lookup: interceptorOpts?.lookup ?? null,\n pick: interceptorOpts?.pick ?? null,\n dualStack,\n affinity,\n maxItems: interceptorOpts?.maxItems ?? Infinity\n }\n\n const instance = new DNSInstance(opts)\n\n return dispatch => {\n return function dnsInterceptor (origDispatchOpts, handler) {\n const origin =\n origDispatchOpts.origin.constructor === URL\n ? origDispatchOpts.origin\n : new URL(origDispatchOpts.origin)\n\n if (isIP(origin.hostname) !== 0) {\n return dispatch(origDispatchOpts, handler)\n }\n\n instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => {\n if (err) {\n return handler.onError(err)\n }\n\n let dispatchOpts = null\n dispatchOpts = {\n ...origDispatchOpts,\n servername: origin.hostname, // For SNI on TLS\n origin: newOrigin,\n headers: {\n host: origin.hostname,\n ...origDispatchOpts.headers\n }\n }\n\n dispatch(\n dispatchOpts,\n instance.getHandler({ origin, dispatch, handler }, origDispatchOpts)\n )\n })\n\n return true\n }\n }\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst { kConstruct } = require('../../core/symbols')\nconst { kEnumerableProperty } = require('../../core/util')\nconst {\n iteratorMixin,\n isValidHeaderName,\n isValidHeaderValue\n} = require('./util')\nconst { webidl } = require('./webidl')\nconst assert = require('node:assert')\nconst util = require('node:util')\n\nconst kHeadersMap = Symbol('headers map')\nconst kHeadersSortedMap = Symbol('headers map sorted')\n\n/**\n * @param {number} code\n */\nfunction isHTTPWhiteSpaceCharCode (code) {\n return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize\n * @param {string} potentialValue\n */\nfunction headerValueNormalize (potentialValue) {\n // To normalize a byte sequence potentialValue, remove\n // any leading and trailing HTTP whitespace bytes from\n // potentialValue.\n let i = 0; let j = potentialValue.length\n\n while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j\n while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i\n\n return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)\n}\n\nfunction fill (headers, object) {\n // To fill a Headers object headers with a given object object, run these steps:\n\n // 1. If object is a sequence, then for each header in object:\n // Note: webidl conversion to array has already been done.\n if (Array.isArray(object)) {\n for (let i = 0; i < object.length; ++i) {\n const header = object[i]\n // 1. If header does not contain exactly two items, then throw a TypeError.\n if (header.length !== 2) {\n throw webidl.errors.exception({\n header: 'Headers constructor',\n message: `expected name/value pair to be length 2, found ${header.length}.`\n })\n }\n\n // 2. Append (header’s first item, header’s second item) to headers.\n appendHeader(headers, header[0], header[1])\n }\n } else if (typeof object === 'object' && object !== null) {\n // Note: null should throw\n\n // 2. Otherwise, object is a record, then for each key → value in object,\n // append (key, value) to headers\n const keys = Object.keys(object)\n for (let i = 0; i < keys.length; ++i) {\n appendHeader(headers, keys[i], object[keys[i]])\n }\n } else {\n throw webidl.errors.conversionFailed({\n prefix: 'Headers constructor',\n argument: 'Argument 1',\n types: ['sequence>', 'record']\n })\n }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-headers-append\n */\nfunction appendHeader (headers, name, value) {\n // 1. Normalize value.\n value = headerValueNormalize(value)\n\n // 2. If name is not a header name or value is not a\n // header value, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.append',\n value: name,\n type: 'header name'\n })\n } else if (!isValidHeaderValue(value)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.append',\n value,\n type: 'header value'\n })\n }\n\n // 3. If headers’s guard is \"immutable\", then throw a TypeError.\n // 4. Otherwise, if headers’s guard is \"request\" and name is a\n // forbidden header name, return.\n // 5. Otherwise, if headers’s guard is \"request-no-cors\":\n // TODO\n // Note: undici does not implement forbidden header names\n if (getHeadersGuard(headers) === 'immutable') {\n throw new TypeError('immutable')\n }\n\n // 6. Otherwise, if headers’s guard is \"response\" and name is a\n // forbidden response-header name, return.\n\n // 7. Append (name, value) to headers’s header list.\n return getHeadersList(headers).append(name, value, false)\n\n // 8. If headers’s guard is \"request-no-cors\", then remove\n // privileged no-CORS request headers from headers\n}\n\nfunction compareHeaderName (a, b) {\n return a[0] < b[0] ? -1 : 1\n}\n\nclass HeadersList {\n /** @type {[string, string][]|null} */\n cookies = null\n\n constructor (init) {\n if (init instanceof HeadersList) {\n this[kHeadersMap] = new Map(init[kHeadersMap])\n this[kHeadersSortedMap] = init[kHeadersSortedMap]\n this.cookies = init.cookies === null ? null : [...init.cookies]\n } else {\n this[kHeadersMap] = new Map(init)\n this[kHeadersSortedMap] = null\n }\n }\n\n /**\n * @see https://fetch.spec.whatwg.org/#header-list-contains\n * @param {string} name\n * @param {boolean} isLowerCase\n */\n contains (name, isLowerCase) {\n // A header list list contains a header name name if list\n // contains a header whose name is a byte-case-insensitive\n // match for name.\n\n return this[kHeadersMap].has(isLowerCase ? name : name.toLowerCase())\n }\n\n clear () {\n this[kHeadersMap].clear()\n this[kHeadersSortedMap] = null\n this.cookies = null\n }\n\n /**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-append\n * @param {string} name\n * @param {string} value\n * @param {boolean} isLowerCase\n */\n append (name, value, isLowerCase) {\n this[kHeadersSortedMap] = null\n\n // 1. If list contains name, then set name to the first such\n // header’s name.\n const lowercaseName = isLowerCase ? name : name.toLowerCase()\n const exists = this[kHeadersMap].get(lowercaseName)\n\n // 2. Append (name, value) to list.\n if (exists) {\n const delimiter = lowercaseName === 'cookie' ? '; ' : ', '\n this[kHeadersMap].set(lowercaseName, {\n name: exists.name,\n value: `${exists.value}${delimiter}${value}`\n })\n } else {\n this[kHeadersMap].set(lowercaseName, { name, value })\n }\n\n if (lowercaseName === 'set-cookie') {\n (this.cookies ??= []).push(value)\n }\n }\n\n /**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-set\n * @param {string} name\n * @param {string} value\n * @param {boolean} isLowerCase\n */\n set (name, value, isLowerCase) {\n this[kHeadersSortedMap] = null\n const lowercaseName = isLowerCase ? name : name.toLowerCase()\n\n if (lowercaseName === 'set-cookie') {\n this.cookies = [value]\n }\n\n // 1. If list contains name, then set the value of\n // the first such header to value and remove the\n // others.\n // 2. Otherwise, append header (name, value) to list.\n this[kHeadersMap].set(lowercaseName, { name, value })\n }\n\n /**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-delete\n * @param {string} name\n * @param {boolean} isLowerCase\n */\n delete (name, isLowerCase) {\n this[kHeadersSortedMap] = null\n if (!isLowerCase) name = name.toLowerCase()\n\n if (name === 'set-cookie') {\n this.cookies = null\n }\n\n this[kHeadersMap].delete(name)\n }\n\n /**\n * @see https://fetch.spec.whatwg.org/#concept-header-list-get\n * @param {string} name\n * @param {boolean} isLowerCase\n * @returns {string | null}\n */\n get (name, isLowerCase) {\n // 1. If list does not contain name, then return null.\n // 2. Return the values of all headers in list whose name\n // is a byte-case-insensitive match for name,\n // separated from each other by 0x2C 0x20, in order.\n return this[kHeadersMap].get(isLowerCase ? name : name.toLowerCase())?.value ?? null\n }\n\n * [Symbol.iterator] () {\n // use the lowercased name\n for (const { 0: name, 1: { value } } of this[kHeadersMap]) {\n yield [name, value]\n }\n }\n\n get entries () {\n const headers = {}\n\n if (this[kHeadersMap].size !== 0) {\n for (const { name, value } of this[kHeadersMap].values()) {\n headers[name] = value\n }\n }\n\n return headers\n }\n\n rawValues () {\n return this[kHeadersMap].values()\n }\n\n get entriesList () {\n const headers = []\n\n if (this[kHeadersMap].size !== 0) {\n for (const { 0: lowerName, 1: { name, value } } of this[kHeadersMap]) {\n if (lowerName === 'set-cookie') {\n for (const cookie of this.cookies) {\n headers.push([name, cookie])\n }\n } else {\n headers.push([name, value])\n }\n }\n }\n\n return headers\n }\n\n // https://fetch.spec.whatwg.org/#convert-header-names-to-a-sorted-lowercase-set\n toSortedArray () {\n const size = this[kHeadersMap].size\n const array = new Array(size)\n // In most cases, you will use the fast-path.\n // fast-path: Use binary insertion sort for small arrays.\n if (size <= 32) {\n if (size === 0) {\n // If empty, it is an empty array. To avoid the first index assignment.\n return array\n }\n // Improve performance by unrolling loop and avoiding double-loop.\n // Double-loop-less version of the binary insertion sort.\n const iterator = this[kHeadersMap][Symbol.iterator]()\n const firstValue = iterator.next().value\n // set [name, value] to first index.\n array[0] = [firstValue[0], firstValue[1].value]\n // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n // 3.2.2. Assert: value is non-null.\n assert(firstValue[1].value !== null)\n for (\n let i = 1, j = 0, right = 0, left = 0, pivot = 0, x, value;\n i < size;\n ++i\n ) {\n // get next value\n value = iterator.next().value\n // set [name, value] to current index.\n x = array[i] = [value[0], value[1].value]\n // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n // 3.2.2. Assert: value is non-null.\n assert(x[1] !== null)\n left = 0\n right = i\n // binary search\n while (left < right) {\n // middle index\n pivot = left + ((right - left) >> 1)\n // compare header name\n if (array[pivot][0] <= x[0]) {\n left = pivot + 1\n } else {\n right = pivot\n }\n }\n if (i !== pivot) {\n j = i\n while (j > left) {\n array[j] = array[--j]\n }\n array[left] = x\n }\n }\n /* c8 ignore next 4 */\n if (!iterator.next().done) {\n // This is for debugging and will never be called.\n throw new TypeError('Unreachable')\n }\n return array\n } else {\n // This case would be a rare occurrence.\n // slow-path: fallback\n let i = 0\n for (const { 0: name, 1: { value } } of this[kHeadersMap]) {\n array[i++] = [name, value]\n // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n // 3.2.2. Assert: value is non-null.\n assert(value !== null)\n }\n return array.sort(compareHeaderName)\n }\n }\n}\n\n// https://fetch.spec.whatwg.org/#headers-class\nclass Headers {\n #guard\n #headersList\n\n constructor (init = undefined) {\n webidl.util.markAsUncloneable(this)\n\n if (init === kConstruct) {\n return\n }\n\n this.#headersList = new HeadersList()\n\n // The new Headers(init) constructor steps are:\n\n // 1. Set this’s guard to \"none\".\n this.#guard = 'none'\n\n // 2. If init is given, then fill this with init.\n if (init !== undefined) {\n init = webidl.converters.HeadersInit(init, 'Headers contructor', 'init')\n fill(this, init)\n }\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-append\n append (name, value) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 2, 'Headers.append')\n\n const prefix = 'Headers.append'\n name = webidl.converters.ByteString(name, prefix, 'name')\n value = webidl.converters.ByteString(value, prefix, 'value')\n\n return appendHeader(this, name, value)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-delete\n delete (name) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, 'Headers.delete')\n\n const prefix = 'Headers.delete'\n name = webidl.converters.ByteString(name, prefix, 'name')\n\n // 1. If name is not a header name, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.delete',\n value: name,\n type: 'header name'\n })\n }\n\n // 2. If this’s guard is \"immutable\", then throw a TypeError.\n // 3. Otherwise, if this’s guard is \"request\" and name is a\n // forbidden header name, return.\n // 4. Otherwise, if this’s guard is \"request-no-cors\", name\n // is not a no-CORS-safelisted request-header name, and\n // name is not a privileged no-CORS request-header name,\n // return.\n // 5. Otherwise, if this’s guard is \"response\" and name is\n // a forbidden response-header name, return.\n // Note: undici does not implement forbidden header names\n if (this.#guard === 'immutable') {\n throw new TypeError('immutable')\n }\n\n // 6. If this’s header list does not contain name, then\n // return.\n if (!this.#headersList.contains(name, false)) {\n return\n }\n\n // 7. Delete name from this’s header list.\n // 8. If this’s guard is \"request-no-cors\", then remove\n // privileged no-CORS request headers from this.\n this.#headersList.delete(name, false)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-get\n get (name) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, 'Headers.get')\n\n const prefix = 'Headers.get'\n name = webidl.converters.ByteString(name, prefix, 'name')\n\n // 1. If name is not a header name, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix,\n value: name,\n type: 'header name'\n })\n }\n\n // 2. Return the result of getting name from this’s header\n // list.\n return this.#headersList.get(name, false)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-has\n has (name) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, 'Headers.has')\n\n const prefix = 'Headers.has'\n name = webidl.converters.ByteString(name, prefix, 'name')\n\n // 1. If name is not a header name, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix,\n value: name,\n type: 'header name'\n })\n }\n\n // 2. Return true if this’s header list contains name;\n // otherwise false.\n return this.#headersList.contains(name, false)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-set\n set (name, value) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 2, 'Headers.set')\n\n const prefix = 'Headers.set'\n name = webidl.converters.ByteString(name, prefix, 'name')\n value = webidl.converters.ByteString(value, prefix, 'value')\n\n // 1. Normalize value.\n value = headerValueNormalize(value)\n\n // 2. If name is not a header name or value is not a\n // header value, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix,\n value: name,\n type: 'header name'\n })\n } else if (!isValidHeaderValue(value)) {\n throw webidl.errors.invalidArgument({\n prefix,\n value,\n type: 'header value'\n })\n }\n\n // 3. If this’s guard is \"immutable\", then throw a TypeError.\n // 4. Otherwise, if this’s guard is \"request\" and name is a\n // forbidden header name, return.\n // 5. Otherwise, if this’s guard is \"request-no-cors\" and\n // name/value is not a no-CORS-safelisted request-header,\n // return.\n // 6. Otherwise, if this’s guard is \"response\" and name is a\n // forbidden response-header name, return.\n // Note: undici does not implement forbidden header names\n if (this.#guard === 'immutable') {\n throw new TypeError('immutable')\n }\n\n // 7. Set (name, value) in this’s header list.\n // 8. If this’s guard is \"request-no-cors\", then remove\n // privileged no-CORS request headers from this\n this.#headersList.set(name, value, false)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie\n getSetCookie () {\n webidl.brandCheck(this, Headers)\n\n // 1. If this’s header list does not contain `Set-Cookie`, then return « ».\n // 2. Return the values of all headers in this’s header list whose name is\n // a byte-case-insensitive match for `Set-Cookie`, in order.\n\n const list = this.#headersList.cookies\n\n if (list) {\n return [...list]\n }\n\n return []\n }\n\n // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n get [kHeadersSortedMap] () {\n if (this.#headersList[kHeadersSortedMap]) {\n return this.#headersList[kHeadersSortedMap]\n }\n\n // 1. Let headers be an empty list of headers with the key being the name\n // and value the value.\n const headers = []\n\n // 2. Let names be the result of convert header names to a sorted-lowercase\n // set with all the names of the headers in list.\n const names = this.#headersList.toSortedArray()\n\n const cookies = this.#headersList.cookies\n\n // fast-path\n if (cookies === null || cookies.length === 1) {\n // Note: The non-null assertion of value has already been done by `HeadersList#toSortedArray`\n return (this.#headersList[kHeadersSortedMap] = names)\n }\n\n // 3. For each name of names:\n for (let i = 0; i < names.length; ++i) {\n const { 0: name, 1: value } = names[i]\n // 1. If name is `set-cookie`, then:\n if (name === 'set-cookie') {\n // 1. Let values be a list of all values of headers in list whose name\n // is a byte-case-insensitive match for name, in order.\n\n // 2. For each value of values:\n // 1. Append (name, value) to headers.\n for (let j = 0; j < cookies.length; ++j) {\n headers.push([name, cookies[j]])\n }\n } else {\n // 2. Otherwise:\n\n // 1. Let value be the result of getting name from list.\n\n // 2. Assert: value is non-null.\n // Note: This operation was done by `HeadersList#toSortedArray`.\n\n // 3. Append (name, value) to headers.\n headers.push([name, value])\n }\n }\n\n // 4. Return headers.\n return (this.#headersList[kHeadersSortedMap] = headers)\n }\n\n [util.inspect.custom] (depth, options) {\n options.depth ??= depth\n\n return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`\n }\n\n static getHeadersGuard (o) {\n return o.#guard\n }\n\n static setHeadersGuard (o, guard) {\n o.#guard = guard\n }\n\n static getHeadersList (o) {\n return o.#headersList\n }\n\n static setHeadersList (o, list) {\n o.#headersList = list\n }\n}\n\nconst { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers\nReflect.deleteProperty(Headers, 'getHeadersGuard')\nReflect.deleteProperty(Headers, 'setHeadersGuard')\nReflect.deleteProperty(Headers, 'getHeadersList')\nReflect.deleteProperty(Headers, 'setHeadersList')\n\niteratorMixin('Headers', Headers, kHeadersSortedMap, 0, 1)\n\nObject.defineProperties(Headers.prototype, {\n append: kEnumerableProperty,\n delete: kEnumerableProperty,\n get: kEnumerableProperty,\n has: kEnumerableProperty,\n set: kEnumerableProperty,\n getSetCookie: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'Headers',\n configurable: true\n },\n [util.inspect.custom]: {\n enumerable: false\n }\n})\n\nwebidl.converters.HeadersInit = function (V, prefix, argument) {\n if (webidl.util.Type(V) === 'Object') {\n const iterator = Reflect.get(V, Symbol.iterator)\n\n // A work-around to ensure we send the properly-cased Headers when V is a Headers object.\n // Read https://github.com/nodejs/undici/pull/3159#issuecomment-2075537226 before touching, please.\n if (!util.types.isProxy(V) && iterator === Headers.prototype.entries) { // Headers object\n try {\n return getHeadersList(V).entriesList\n } catch {\n // fall-through\n }\n }\n\n if (typeof iterator === 'function') {\n return webidl.converters['sequence>'](V, prefix, argument, iterator.bind(V))\n }\n\n return webidl.converters['record'](V, prefix, argument)\n }\n\n throw webidl.errors.conversionFailed({\n prefix: 'Headers constructor',\n argument: 'Argument 1',\n types: ['sequence>', 'record']\n })\n}\n\nmodule.exports = {\n fill,\n // for test.\n compareHeaderName,\n Headers,\n HeadersList,\n getHeadersGuard,\n setHeadersGuard,\n setHeadersList,\n getHeadersList\n}\n","'use strict'\n\nconst { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require('./headers')\nconst { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = require('./body')\nconst util = require('../../core/util')\nconst nodeUtil = require('node:util')\nconst { kEnumerableProperty } = util\nconst {\n isValidReasonPhrase,\n isCancelled,\n isAborted,\n isBlobLike,\n serializeJavascriptValueToJSONString,\n isErrorLike,\n isomorphicEncode,\n environmentSettingsObject: relevantRealm\n} = require('./util')\nconst {\n redirectStatusSet,\n nullBodyStatus\n} = require('./constants')\nconst { kState, kHeaders } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { FormData } = require('./formdata')\nconst { URLSerializer } = require('./data-url')\nconst { kConstruct } = require('../../core/symbols')\nconst assert = require('node:assert')\nconst { types } = require('node:util')\n\nconst textEncoder = new TextEncoder('utf-8')\n\n// https://fetch.spec.whatwg.org/#response-class\nclass Response {\n // Creates network error Response.\n static error () {\n // The static error() method steps are to return the result of creating a\n // Response object, given a new network error, \"immutable\", and this’s\n // relevant Realm.\n const responseObject = fromInnerResponse(makeNetworkError(), 'immutable')\n\n return responseObject\n }\n\n // https://fetch.spec.whatwg.org/#dom-response-json\n static json (data, init = {}) {\n webidl.argumentLengthCheck(arguments, 1, 'Response.json')\n\n if (init !== null) {\n init = webidl.converters.ResponseInit(init)\n }\n\n // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.\n const bytes = textEncoder.encode(\n serializeJavascriptValueToJSONString(data)\n )\n\n // 2. Let body be the result of extracting bytes.\n const body = extractBody(bytes)\n\n // 3. Let responseObject be the result of creating a Response object, given a new response,\n // \"response\", and this’s relevant Realm.\n const responseObject = fromInnerResponse(makeResponse({}), 'response')\n\n // 4. Perform initialize a response given responseObject, init, and (body, \"application/json\").\n initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })\n\n // 5. Return responseObject.\n return responseObject\n }\n\n // Creates a redirect Response that redirects to url with status status.\n static redirect (url, status = 302) {\n webidl.argumentLengthCheck(arguments, 1, 'Response.redirect')\n\n url = webidl.converters.USVString(url)\n status = webidl.converters['unsigned short'](status)\n\n // 1. Let parsedURL be the result of parsing url with current settings\n // object’s API base URL.\n // 2. If parsedURL is failure, then throw a TypeError.\n // TODO: base-URL?\n let parsedURL\n try {\n parsedURL = new URL(url, relevantRealm.settingsObject.baseUrl)\n } catch (err) {\n throw new TypeError(`Failed to parse URL from ${url}`, { cause: err })\n }\n\n // 3. If status is not a redirect status, then throw a RangeError.\n if (!redirectStatusSet.has(status)) {\n throw new RangeError(`Invalid status code ${status}`)\n }\n\n // 4. Let responseObject be the result of creating a Response object,\n // given a new response, \"immutable\", and this’s relevant Realm.\n const responseObject = fromInnerResponse(makeResponse({}), 'immutable')\n\n // 5. Set responseObject’s response’s status to status.\n responseObject[kState].status = status\n\n // 6. Let value be parsedURL, serialized and isomorphic encoded.\n const value = isomorphicEncode(URLSerializer(parsedURL))\n\n // 7. Append `Location`/value to responseObject’s response’s header list.\n responseObject[kState].headersList.append('location', value, true)\n\n // 8. Return responseObject.\n return responseObject\n }\n\n // https://fetch.spec.whatwg.org/#dom-response\n constructor (body = null, init = {}) {\n webidl.util.markAsUncloneable(this)\n if (body === kConstruct) {\n return\n }\n\n if (body !== null) {\n body = webidl.converters.BodyInit(body)\n }\n\n init = webidl.converters.ResponseInit(init)\n\n // 1. Set this’s response to a new response.\n this[kState] = makeResponse({})\n\n // 2. Set this’s headers to a new Headers object with this’s relevant\n // Realm, whose header list is this’s response’s header list and guard\n // is \"response\".\n this[kHeaders] = new Headers(kConstruct)\n setHeadersGuard(this[kHeaders], 'response')\n setHeadersList(this[kHeaders], this[kState].headersList)\n\n // 3. Let bodyWithType be null.\n let bodyWithType = null\n\n // 4. If body is non-null, then set bodyWithType to the result of extracting body.\n if (body != null) {\n const [extractedBody, type] = extractBody(body)\n bodyWithType = { body: extractedBody, type }\n }\n\n // 5. Perform initialize a response given this, init, and bodyWithType.\n initializeResponse(this, init, bodyWithType)\n }\n\n // Returns response’s type, e.g., \"cors\".\n get type () {\n webidl.brandCheck(this, Response)\n\n // The type getter steps are to return this’s response’s type.\n return this[kState].type\n }\n\n // Returns response’s URL, if it has one; otherwise the empty string.\n get url () {\n webidl.brandCheck(this, Response)\n\n const urlList = this[kState].urlList\n\n // The url getter steps are to return the empty string if this’s\n // response’s URL is null; otherwise this’s response’s URL,\n // serialized with exclude fragment set to true.\n const url = urlList[urlList.length - 1] ?? null\n\n if (url === null) {\n return ''\n }\n\n return URLSerializer(url, true)\n }\n\n // Returns whether response was obtained through a redirect.\n get redirected () {\n webidl.brandCheck(this, Response)\n\n // The redirected getter steps are to return true if this’s response’s URL\n // list has more than one item; otherwise false.\n return this[kState].urlList.length > 1\n }\n\n // Returns response’s status.\n get status () {\n webidl.brandCheck(this, Response)\n\n // The status getter steps are to return this’s response’s status.\n return this[kState].status\n }\n\n // Returns whether response’s status is an ok status.\n get ok () {\n webidl.brandCheck(this, Response)\n\n // The ok getter steps are to return true if this’s response’s status is an\n // ok status; otherwise false.\n return this[kState].status >= 200 && this[kState].status <= 299\n }\n\n // Returns response’s status message.\n get statusText () {\n webidl.brandCheck(this, Response)\n\n // The statusText getter steps are to return this’s response’s status\n // message.\n return this[kState].statusText\n }\n\n // Returns response’s headers as Headers.\n get headers () {\n webidl.brandCheck(this, Response)\n\n // The headers getter steps are to return this’s headers.\n return this[kHeaders]\n }\n\n get body () {\n webidl.brandCheck(this, Response)\n\n return this[kState].body ? this[kState].body.stream : null\n }\n\n get bodyUsed () {\n webidl.brandCheck(this, Response)\n\n return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n }\n\n // Returns a clone of response.\n clone () {\n webidl.brandCheck(this, Response)\n\n // 1. If this is unusable, then throw a TypeError.\n if (bodyUnusable(this)) {\n throw webidl.errors.exception({\n header: 'Response.clone',\n message: 'Body has already been consumed.'\n })\n }\n\n // 2. Let clonedResponse be the result of cloning this’s response.\n const clonedResponse = cloneResponse(this[kState])\n\n // Note: To re-register because of a new stream.\n if (hasFinalizationRegistry && this[kState].body?.stream) {\n streamRegistry.register(this, new WeakRef(this[kState].body.stream))\n }\n\n // 3. Return the result of creating a Response object, given\n // clonedResponse, this’s headers’s guard, and this’s relevant Realm.\n return fromInnerResponse(clonedResponse, getHeadersGuard(this[kHeaders]))\n }\n\n [nodeUtil.inspect.custom] (depth, options) {\n if (options.depth === null) {\n options.depth = 2\n }\n\n options.colors ??= true\n\n const properties = {\n status: this.status,\n statusText: this.statusText,\n headers: this.headers,\n body: this.body,\n bodyUsed: this.bodyUsed,\n ok: this.ok,\n redirected: this.redirected,\n type: this.type,\n url: this.url\n }\n\n return `Response ${nodeUtil.formatWithOptions(options, properties)}`\n }\n}\n\nmixinBody(Response)\n\nObject.defineProperties(Response.prototype, {\n type: kEnumerableProperty,\n url: kEnumerableProperty,\n status: kEnumerableProperty,\n ok: kEnumerableProperty,\n redirected: kEnumerableProperty,\n statusText: kEnumerableProperty,\n headers: kEnumerableProperty,\n clone: kEnumerableProperty,\n body: kEnumerableProperty,\n bodyUsed: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'Response',\n configurable: true\n }\n})\n\nObject.defineProperties(Response, {\n json: kEnumerableProperty,\n redirect: kEnumerableProperty,\n error: kEnumerableProperty\n})\n\n// https://fetch.spec.whatwg.org/#concept-response-clone\nfunction cloneResponse (response) {\n // To clone a response response, run these steps:\n\n // 1. If response is a filtered response, then return a new identical\n // filtered response whose internal response is a clone of response’s\n // internal response.\n if (response.internalResponse) {\n return filterResponse(\n cloneResponse(response.internalResponse),\n response.type\n )\n }\n\n // 2. Let newResponse be a copy of response, except for its body.\n const newResponse = makeResponse({ ...response, body: null })\n\n // 3. If response’s body is non-null, then set newResponse’s body to the\n // result of cloning response’s body.\n if (response.body != null) {\n newResponse.body = cloneBody(newResponse, response.body)\n }\n\n // 4. Return newResponse.\n return newResponse\n}\n\nfunction makeResponse (init) {\n return {\n aborted: false,\n rangeRequested: false,\n timingAllowPassed: false,\n requestIncludesCredentials: false,\n type: 'default',\n status: 200,\n timingInfo: null,\n cacheState: '',\n statusText: '',\n ...init,\n headersList: init?.headersList\n ? new HeadersList(init?.headersList)\n : new HeadersList(),\n urlList: init?.urlList ? [...init.urlList] : []\n }\n}\n\nfunction makeNetworkError (reason) {\n const isError = isErrorLike(reason)\n return makeResponse({\n type: 'error',\n status: 0,\n error: isError\n ? reason\n : new Error(reason ? String(reason) : reason),\n aborted: reason && reason.name === 'AbortError'\n })\n}\n\n// @see https://fetch.spec.whatwg.org/#concept-network-error\nfunction isNetworkError (response) {\n return (\n // A network error is a response whose type is \"error\",\n response.type === 'error' &&\n // status is 0\n response.status === 0\n )\n}\n\nfunction makeFilteredResponse (response, state) {\n state = {\n internalResponse: response,\n ...state\n }\n\n return new Proxy(response, {\n get (target, p) {\n return p in state ? state[p] : target[p]\n },\n set (target, p, value) {\n assert(!(p in state))\n target[p] = value\n return true\n }\n })\n}\n\n// https://fetch.spec.whatwg.org/#concept-filtered-response\nfunction filterResponse (response, type) {\n // Set response to the following filtered response with response as its\n // internal response, depending on request’s response tainting:\n if (type === 'basic') {\n // A basic filtered response is a filtered response whose type is \"basic\"\n // and header list excludes any headers in internal response’s header list\n // whose name is a forbidden response-header name.\n\n // Note: undici does not implement forbidden response-header names\n return makeFilteredResponse(response, {\n type: 'basic',\n headersList: response.headersList\n })\n } else if (type === 'cors') {\n // A CORS filtered response is a filtered response whose type is \"cors\"\n // and header list excludes any headers in internal response’s header\n // list whose name is not a CORS-safelisted response-header name, given\n // internal response’s CORS-exposed header-name list.\n\n // Note: undici does not implement CORS-safelisted response-header names\n return makeFilteredResponse(response, {\n type: 'cors',\n headersList: response.headersList\n })\n } else if (type === 'opaque') {\n // An opaque filtered response is a filtered response whose type is\n // \"opaque\", URL list is the empty list, status is 0, status message\n // is the empty byte sequence, header list is empty, and body is null.\n\n return makeFilteredResponse(response, {\n type: 'opaque',\n urlList: Object.freeze([]),\n status: 0,\n statusText: '',\n body: null\n })\n } else if (type === 'opaqueredirect') {\n // An opaque-redirect filtered response is a filtered response whose type\n // is \"opaqueredirect\", status is 0, status message is the empty byte\n // sequence, header list is empty, and body is null.\n\n return makeFilteredResponse(response, {\n type: 'opaqueredirect',\n status: 0,\n statusText: '',\n headersList: [],\n body: null\n })\n } else {\n assert(false)\n }\n}\n\n// https://fetch.spec.whatwg.org/#appropriate-network-error\nfunction makeAppropriateNetworkError (fetchParams, err = null) {\n // 1. Assert: fetchParams is canceled.\n assert(isCancelled(fetchParams))\n\n // 2. Return an aborted network error if fetchParams is aborted;\n // otherwise return a network error.\n return isAborted(fetchParams)\n ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))\n : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))\n}\n\n// https://whatpr.org/fetch/1392.html#initialize-a-response\nfunction initializeResponse (response, init, body) {\n // 1. If init[\"status\"] is not in the range 200 to 599, inclusive, then\n // throw a RangeError.\n if (init.status !== null && (init.status < 200 || init.status > 599)) {\n throw new RangeError('init[\"status\"] must be in the range of 200 to 599, inclusive.')\n }\n\n // 2. If init[\"statusText\"] does not match the reason-phrase token production,\n // then throw a TypeError.\n if ('statusText' in init && init.statusText != null) {\n // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:\n // reason-phrase = *( HTAB / SP / VCHAR / obs-text )\n if (!isValidReasonPhrase(String(init.statusText))) {\n throw new TypeError('Invalid statusText')\n }\n }\n\n // 3. Set response’s response’s status to init[\"status\"].\n if ('status' in init && init.status != null) {\n response[kState].status = init.status\n }\n\n // 4. Set response’s response’s status message to init[\"statusText\"].\n if ('statusText' in init && init.statusText != null) {\n response[kState].statusText = init.statusText\n }\n\n // 5. If init[\"headers\"] exists, then fill response’s headers with init[\"headers\"].\n if ('headers' in init && init.headers != null) {\n fill(response[kHeaders], init.headers)\n }\n\n // 6. If body was given, then:\n if (body) {\n // 1. If response's status is a null body status, then throw a TypeError.\n if (nullBodyStatus.includes(response.status)) {\n throw webidl.errors.exception({\n header: 'Response constructor',\n message: `Invalid response status code ${response.status}`\n })\n }\n\n // 2. Set response's body to body's body.\n response[kState].body = body.body\n\n // 3. If body's type is non-null and response's header list does not contain\n // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.\n if (body.type != null && !response[kState].headersList.contains('content-type', true)) {\n response[kState].headersList.append('content-type', body.type, true)\n }\n }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#response-create\n * @param {any} innerResponse\n * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard\n * @returns {Response}\n */\nfunction fromInnerResponse (innerResponse, guard) {\n const response = new Response(kConstruct)\n response[kState] = innerResponse\n response[kHeaders] = new Headers(kConstruct)\n setHeadersList(response[kHeaders], innerResponse.headersList)\n setHeadersGuard(response[kHeaders], guard)\n\n if (hasFinalizationRegistry && innerResponse.body?.stream) {\n // If the target (response) is reclaimed, the cleanup callback may be called at some point with\n // the held value provided for it (innerResponse.body.stream). The held value can be any value:\n // a primitive or an object, even undefined. If the held value is an object, the registry keeps\n // a strong reference to it (so it can pass it to the cleanup callback later). Reworded from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n streamRegistry.register(response, new WeakRef(innerResponse.body.stream))\n }\n\n return response\n}\n\nwebidl.converters.ReadableStream = webidl.interfaceConverter(\n ReadableStream\n)\n\nwebidl.converters.FormData = webidl.interfaceConverter(\n FormData\n)\n\nwebidl.converters.URLSearchParams = webidl.interfaceConverter(\n URLSearchParams\n)\n\n// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit\nwebidl.converters.XMLHttpRequestBodyInit = function (V, prefix, name) {\n if (typeof V === 'string') {\n return webidl.converters.USVString(V, prefix, name)\n }\n\n if (isBlobLike(V)) {\n return webidl.converters.Blob(V, prefix, name, { strict: false })\n }\n\n if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {\n return webidl.converters.BufferSource(V, prefix, name)\n }\n\n if (util.isFormDataLike(V)) {\n return webidl.converters.FormData(V, prefix, name, { strict: false })\n }\n\n if (V instanceof URLSearchParams) {\n return webidl.converters.URLSearchParams(V, prefix, name)\n }\n\n return webidl.converters.DOMString(V, prefix, name)\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit\nwebidl.converters.BodyInit = function (V, prefix, argument) {\n if (V instanceof ReadableStream) {\n return webidl.converters.ReadableStream(V, prefix, argument)\n }\n\n // Note: the spec doesn't include async iterables,\n // this is an undici extension.\n if (V?.[Symbol.asyncIterator]) {\n return V\n }\n\n return webidl.converters.XMLHttpRequestBodyInit(V, prefix, argument)\n}\n\nwebidl.converters.ResponseInit = webidl.dictionaryConverter([\n {\n key: 'status',\n converter: webidl.converters['unsigned short'],\n defaultValue: () => 200\n },\n {\n key: 'statusText',\n converter: webidl.converters.ByteString,\n defaultValue: () => ''\n },\n {\n key: 'headers',\n converter: webidl.converters.HeadersInit\n }\n])\n\nmodule.exports = {\n isNetworkError,\n makeNetworkError,\n makeResponse,\n makeAppropriateNetworkError,\n filterResponse,\n Response,\n cloneResponse,\n fromInnerResponse\n}\n","'use strict'\n\nconst { kConnected, kSize } = require('../../core/symbols')\n\nclass CompatWeakRef {\n constructor (value) {\n this.value = value\n }\n\n deref () {\n return this.value[kConnected] === 0 && this.value[kSize] === 0\n ? undefined\n : this.value\n }\n}\n\nclass CompatFinalizer {\n constructor (finalizer) {\n this.finalizer = finalizer\n }\n\n register (dispatcher, key) {\n if (dispatcher.on) {\n dispatcher.on('disconnect', () => {\n if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {\n this.finalizer(key)\n }\n })\n }\n }\n\n unregister (key) {}\n}\n\nmodule.exports = function () {\n // FIXME: remove workaround when the Node bug is backported to v18\n // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\n if (process.env.NODE_V8_COVERAGE && process.version.startsWith('v18')) {\n process._rawDebug('Using compatibility WeakRef and FinalizationRegistry')\n return {\n WeakRef: CompatWeakRef,\n FinalizationRegistry: CompatFinalizer\n }\n }\n return { WeakRef, FinalizationRegistry }\n}\n","/* globals AbortController */\n\n'use strict'\n\nconst { extractBody, mixinBody, cloneBody, bodyUnusable } = require('./body')\nconst { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require('./headers')\nconst { FinalizationRegistry } = require('./dispatcher-weakref')()\nconst util = require('../../core/util')\nconst nodeUtil = require('node:util')\nconst {\n isValidHTTPToken,\n sameOrigin,\n environmentSettingsObject\n} = require('./util')\nconst {\n forbiddenMethodsSet,\n corsSafeListedMethodsSet,\n referrerPolicy,\n requestRedirect,\n requestMode,\n requestCredentials,\n requestCache,\n requestDuplex\n} = require('./constants')\nconst { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util\nconst { kHeaders, kSignal, kState, kDispatcher } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { URLSerializer } = require('./data-url')\nconst { kConstruct } = require('../../core/symbols')\nconst assert = require('node:assert')\nconst { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require('node:events')\n\nconst kAbortController = Symbol('abortController')\n\nconst requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {\n signal.removeEventListener('abort', abort)\n})\n\nconst dependentControllerMap = new WeakMap()\n\nfunction buildAbort (acRef) {\n return abort\n\n function abort () {\n const ac = acRef.deref()\n if (ac !== undefined) {\n // Currently, there is a problem with FinalizationRegistry.\n // https://github.com/nodejs/node/issues/49344\n // https://github.com/nodejs/node/issues/47748\n // In the case of abort, the first step is to unregister from it.\n // If the controller can refer to it, it is still registered.\n // It will be removed in the future.\n requestFinalizer.unregister(abort)\n\n // Unsubscribe a listener.\n // FinalizationRegistry will no longer be called, so this must be done.\n this.removeEventListener('abort', abort)\n\n ac.abort(this.reason)\n\n const controllerList = dependentControllerMap.get(ac.signal)\n\n if (controllerList !== undefined) {\n if (controllerList.size !== 0) {\n for (const ref of controllerList) {\n const ctrl = ref.deref()\n if (ctrl !== undefined) {\n ctrl.abort(this.reason)\n }\n }\n controllerList.clear()\n }\n dependentControllerMap.delete(ac.signal)\n }\n }\n }\n}\n\nlet patchMethodWarning = false\n\n// https://fetch.spec.whatwg.org/#request-class\nclass Request {\n // https://fetch.spec.whatwg.org/#dom-request\n constructor (input, init = {}) {\n webidl.util.markAsUncloneable(this)\n if (input === kConstruct) {\n return\n }\n\n const prefix = 'Request constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n input = webidl.converters.RequestInfo(input, prefix, 'input')\n init = webidl.converters.RequestInit(init, prefix, 'init')\n\n // 1. Let request be null.\n let request = null\n\n // 2. Let fallbackMode be null.\n let fallbackMode = null\n\n // 3. Let baseURL be this’s relevant settings object’s API base URL.\n const baseUrl = environmentSettingsObject.settingsObject.baseUrl\n\n // 4. Let signal be null.\n let signal = null\n\n // 5. If input is a string, then:\n if (typeof input === 'string') {\n this[kDispatcher] = init.dispatcher\n\n // 1. Let parsedURL be the result of parsing input with baseURL.\n // 2. If parsedURL is failure, then throw a TypeError.\n let parsedURL\n try {\n parsedURL = new URL(input, baseUrl)\n } catch (err) {\n throw new TypeError('Failed to parse URL from ' + input, { cause: err })\n }\n\n // 3. If parsedURL includes credentials, then throw a TypeError.\n if (parsedURL.username || parsedURL.password) {\n throw new TypeError(\n 'Request cannot be constructed from a URL that includes credentials: ' +\n input\n )\n }\n\n // 4. Set request to a new request whose URL is parsedURL.\n request = makeRequest({ urlList: [parsedURL] })\n\n // 5. Set fallbackMode to \"cors\".\n fallbackMode = 'cors'\n } else {\n this[kDispatcher] = init.dispatcher || input[kDispatcher]\n\n // 6. Otherwise:\n\n // 7. Assert: input is a Request object.\n assert(input instanceof Request)\n\n // 8. Set request to input’s request.\n request = input[kState]\n\n // 9. Set signal to input’s signal.\n signal = input[kSignal]\n }\n\n // 7. Let origin be this’s relevant settings object’s origin.\n const origin = environmentSettingsObject.settingsObject.origin\n\n // 8. Let window be \"client\".\n let window = 'client'\n\n // 9. If request’s window is an environment settings object and its origin\n // is same origin with origin, then set window to request’s window.\n if (\n request.window?.constructor?.name === 'EnvironmentSettingsObject' &&\n sameOrigin(request.window, origin)\n ) {\n window = request.window\n }\n\n // 10. If init[\"window\"] exists and is non-null, then throw a TypeError.\n if (init.window != null) {\n throw new TypeError(`'window' option '${window}' must be null`)\n }\n\n // 11. If init[\"window\"] exists, then set window to \"no-window\".\n if ('window' in init) {\n window = 'no-window'\n }\n\n // 12. Set request to a new request with the following properties:\n request = makeRequest({\n // URL request’s URL.\n // undici implementation note: this is set as the first item in request's urlList in makeRequest\n // method request’s method.\n method: request.method,\n // header list A copy of request’s header list.\n // undici implementation note: headersList is cloned in makeRequest\n headersList: request.headersList,\n // unsafe-request flag Set.\n unsafeRequest: request.unsafeRequest,\n // client This’s relevant settings object.\n client: environmentSettingsObject.settingsObject,\n // window window.\n window,\n // priority request’s priority.\n priority: request.priority,\n // origin request’s origin. The propagation of the origin is only significant for navigation requests\n // being handled by a service worker. In this scenario a request can have an origin that is different\n // from the current client.\n origin: request.origin,\n // referrer request’s referrer.\n referrer: request.referrer,\n // referrer policy request’s referrer policy.\n referrerPolicy: request.referrerPolicy,\n // mode request’s mode.\n mode: request.mode,\n // credentials mode request’s credentials mode.\n credentials: request.credentials,\n // cache mode request’s cache mode.\n cache: request.cache,\n // redirect mode request’s redirect mode.\n redirect: request.redirect,\n // integrity metadata request’s integrity metadata.\n integrity: request.integrity,\n // keepalive request’s keepalive.\n keepalive: request.keepalive,\n // reload-navigation flag request’s reload-navigation flag.\n reloadNavigation: request.reloadNavigation,\n // history-navigation flag request’s history-navigation flag.\n historyNavigation: request.historyNavigation,\n // URL list A clone of request’s URL list.\n urlList: [...request.urlList]\n })\n\n const initHasKey = Object.keys(init).length !== 0\n\n // 13. If init is not empty, then:\n if (initHasKey) {\n // 1. If request’s mode is \"navigate\", then set it to \"same-origin\".\n if (request.mode === 'navigate') {\n request.mode = 'same-origin'\n }\n\n // 2. Unset request’s reload-navigation flag.\n request.reloadNavigation = false\n\n // 3. Unset request’s history-navigation flag.\n request.historyNavigation = false\n\n // 4. Set request’s origin to \"client\".\n request.origin = 'client'\n\n // 5. Set request’s referrer to \"client\"\n request.referrer = 'client'\n\n // 6. Set request’s referrer policy to the empty string.\n request.referrerPolicy = ''\n\n // 7. Set request’s URL to request’s current URL.\n request.url = request.urlList[request.urlList.length - 1]\n\n // 8. Set request’s URL list to « request’s URL ».\n request.urlList = [request.url]\n }\n\n // 14. If init[\"referrer\"] exists, then:\n if (init.referrer !== undefined) {\n // 1. Let referrer be init[\"referrer\"].\n const referrer = init.referrer\n\n // 2. If referrer is the empty string, then set request’s referrer to \"no-referrer\".\n if (referrer === '') {\n request.referrer = 'no-referrer'\n } else {\n // 1. Let parsedReferrer be the result of parsing referrer with\n // baseURL.\n // 2. If parsedReferrer is failure, then throw a TypeError.\n let parsedReferrer\n try {\n parsedReferrer = new URL(referrer, baseUrl)\n } catch (err) {\n throw new TypeError(`Referrer \"${referrer}\" is not a valid URL.`, { cause: err })\n }\n\n // 3. If one of the following is true\n // - parsedReferrer’s scheme is \"about\" and path is the string \"client\"\n // - parsedReferrer’s origin is not same origin with origin\n // then set request’s referrer to \"client\".\n if (\n (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||\n (origin && !sameOrigin(parsedReferrer, environmentSettingsObject.settingsObject.baseUrl))\n ) {\n request.referrer = 'client'\n } else {\n // 4. Otherwise, set request’s referrer to parsedReferrer.\n request.referrer = parsedReferrer\n }\n }\n }\n\n // 15. If init[\"referrerPolicy\"] exists, then set request’s referrer policy\n // to it.\n if (init.referrerPolicy !== undefined) {\n request.referrerPolicy = init.referrerPolicy\n }\n\n // 16. Let mode be init[\"mode\"] if it exists, and fallbackMode otherwise.\n let mode\n if (init.mode !== undefined) {\n mode = init.mode\n } else {\n mode = fallbackMode\n }\n\n // 17. If mode is \"navigate\", then throw a TypeError.\n if (mode === 'navigate') {\n throw webidl.errors.exception({\n header: 'Request constructor',\n message: 'invalid request mode navigate.'\n })\n }\n\n // 18. If mode is non-null, set request’s mode to mode.\n if (mode != null) {\n request.mode = mode\n }\n\n // 19. If init[\"credentials\"] exists, then set request’s credentials mode\n // to it.\n if (init.credentials !== undefined) {\n request.credentials = init.credentials\n }\n\n // 18. If init[\"cache\"] exists, then set request’s cache mode to it.\n if (init.cache !== undefined) {\n request.cache = init.cache\n }\n\n // 21. If request’s cache mode is \"only-if-cached\" and request’s mode is\n // not \"same-origin\", then throw a TypeError.\n if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {\n throw new TypeError(\n \"'only-if-cached' can be set only with 'same-origin' mode\"\n )\n }\n\n // 22. If init[\"redirect\"] exists, then set request’s redirect mode to it.\n if (init.redirect !== undefined) {\n request.redirect = init.redirect\n }\n\n // 23. If init[\"integrity\"] exists, then set request’s integrity metadata to it.\n if (init.integrity != null) {\n request.integrity = String(init.integrity)\n }\n\n // 24. If init[\"keepalive\"] exists, then set request’s keepalive to it.\n if (init.keepalive !== undefined) {\n request.keepalive = Boolean(init.keepalive)\n }\n\n // 25. If init[\"method\"] exists, then:\n if (init.method !== undefined) {\n // 1. Let method be init[\"method\"].\n let method = init.method\n\n const mayBeNormalized = normalizedMethodRecords[method]\n\n if (mayBeNormalized !== undefined) {\n // Note: Bypass validation DELETE, GET, HEAD, OPTIONS, POST, PUT, PATCH and these lowercase ones\n request.method = mayBeNormalized\n } else {\n // 2. If method is not a method or method is a forbidden method, then\n // throw a TypeError.\n if (!isValidHTTPToken(method)) {\n throw new TypeError(`'${method}' is not a valid HTTP method.`)\n }\n\n const upperCase = method.toUpperCase()\n\n if (forbiddenMethodsSet.has(upperCase)) {\n throw new TypeError(`'${method}' HTTP method is unsupported.`)\n }\n\n // 3. Normalize method.\n // https://fetch.spec.whatwg.org/#concept-method-normalize\n // Note: must be in uppercase\n method = normalizedMethodRecordsBase[upperCase] ?? method\n\n // 4. Set request’s method to method.\n request.method = method\n }\n\n if (!patchMethodWarning && request.method === 'patch') {\n process.emitWarning('Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.', {\n code: 'UNDICI-FETCH-patch'\n })\n\n patchMethodWarning = true\n }\n }\n\n // 26. If init[\"signal\"] exists, then set signal to it.\n if (init.signal !== undefined) {\n signal = init.signal\n }\n\n // 27. Set this’s request to request.\n this[kState] = request\n\n // 28. Set this’s signal to a new AbortSignal object with this’s relevant\n // Realm.\n // TODO: could this be simplified with AbortSignal.any\n // (https://dom.spec.whatwg.org/#dom-abortsignal-any)\n const ac = new AbortController()\n this[kSignal] = ac.signal\n\n // 29. If signal is not null, then make this’s signal follow signal.\n if (signal != null) {\n if (\n !signal ||\n typeof signal.aborted !== 'boolean' ||\n typeof signal.addEventListener !== 'function'\n ) {\n throw new TypeError(\n \"Failed to construct 'Request': member signal is not of type AbortSignal.\"\n )\n }\n\n if (signal.aborted) {\n ac.abort(signal.reason)\n } else {\n // Keep a strong ref to ac while request object\n // is alive. This is needed to prevent AbortController\n // from being prematurely garbage collected.\n // See, https://github.com/nodejs/undici/issues/1926.\n this[kAbortController] = ac\n\n const acRef = new WeakRef(ac)\n const abort = buildAbort(acRef)\n\n // Third-party AbortControllers may not work with these.\n // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.\n try {\n // If the max amount of listeners is equal to the default, increase it\n // This is only available in node >= v19.9.0\n if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {\n setMaxListeners(1500, signal)\n } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {\n setMaxListeners(1500, signal)\n }\n } catch {}\n\n util.addAbortListener(signal, abort)\n // The third argument must be a registry key to be unregistered.\n // Without it, you cannot unregister.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n // abort is used as the unregister key. (because it is unique)\n requestFinalizer.register(ac, { signal, abort }, abort)\n }\n }\n\n // 30. Set this’s headers to a new Headers object with this’s relevant\n // Realm, whose header list is request’s header list and guard is\n // \"request\".\n this[kHeaders] = new Headers(kConstruct)\n setHeadersList(this[kHeaders], request.headersList)\n setHeadersGuard(this[kHeaders], 'request')\n\n // 31. If this’s request’s mode is \"no-cors\", then:\n if (mode === 'no-cors') {\n // 1. If this’s request’s method is not a CORS-safelisted method,\n // then throw a TypeError.\n if (!corsSafeListedMethodsSet.has(request.method)) {\n throw new TypeError(\n `'${request.method} is unsupported in no-cors mode.`\n )\n }\n\n // 2. Set this’s headers’s guard to \"request-no-cors\".\n setHeadersGuard(this[kHeaders], 'request-no-cors')\n }\n\n // 32. If init is not empty, then:\n if (initHasKey) {\n /** @type {HeadersList} */\n const headersList = getHeadersList(this[kHeaders])\n // 1. Let headers be a copy of this’s headers and its associated header\n // list.\n // 2. If init[\"headers\"] exists, then set headers to init[\"headers\"].\n const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)\n\n // 3. Empty this’s headers’s header list.\n headersList.clear()\n\n // 4. If headers is a Headers object, then for each header in its header\n // list, append header’s name/header’s value to this’s headers.\n if (headers instanceof HeadersList) {\n for (const { name, value } of headers.rawValues()) {\n headersList.append(name, value, false)\n }\n // Note: Copy the `set-cookie` meta-data.\n headersList.cookies = headers.cookies\n } else {\n // 5. Otherwise, fill this’s headers with headers.\n fillHeaders(this[kHeaders], headers)\n }\n }\n\n // 33. Let inputBody be input’s request’s body if input is a Request\n // object; otherwise null.\n const inputBody = input instanceof Request ? input[kState].body : null\n\n // 34. If either init[\"body\"] exists and is non-null or inputBody is\n // non-null, and request’s method is `GET` or `HEAD`, then throw a\n // TypeError.\n if (\n (init.body != null || inputBody != null) &&\n (request.method === 'GET' || request.method === 'HEAD')\n ) {\n throw new TypeError('Request with GET/HEAD method cannot have body.')\n }\n\n // 35. Let initBody be null.\n let initBody = null\n\n // 36. If init[\"body\"] exists and is non-null, then:\n if (init.body != null) {\n // 1. Let Content-Type be null.\n // 2. Set initBody and Content-Type to the result of extracting\n // init[\"body\"], with keepalive set to request’s keepalive.\n const [extractedBody, contentType] = extractBody(\n init.body,\n request.keepalive\n )\n initBody = extractedBody\n\n // 3, If Content-Type is non-null and this’s headers’s header list does\n // not contain `Content-Type`, then append `Content-Type`/Content-Type to\n // this’s headers.\n if (contentType && !getHeadersList(this[kHeaders]).contains('content-type', true)) {\n this[kHeaders].append('content-type', contentType)\n }\n }\n\n // 37. Let inputOrInitBody be initBody if it is non-null; otherwise\n // inputBody.\n const inputOrInitBody = initBody ?? inputBody\n\n // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is\n // null, then:\n if (inputOrInitBody != null && inputOrInitBody.source == null) {\n // 1. If initBody is non-null and init[\"duplex\"] does not exist,\n // then throw a TypeError.\n if (initBody != null && init.duplex == null) {\n throw new TypeError('RequestInit: duplex option is required when sending a body.')\n }\n\n // 2. If this’s request’s mode is neither \"same-origin\" nor \"cors\",\n // then throw a TypeError.\n if (request.mode !== 'same-origin' && request.mode !== 'cors') {\n throw new TypeError(\n 'If request is made from ReadableStream, mode should be \"same-origin\" or \"cors\"'\n )\n }\n\n // 3. Set this’s request’s use-CORS-preflight flag.\n request.useCORSPreflightFlag = true\n }\n\n // 39. Let finalBody be inputOrInitBody.\n let finalBody = inputOrInitBody\n\n // 40. If initBody is null and inputBody is non-null, then:\n if (initBody == null && inputBody != null) {\n // 1. If input is unusable, then throw a TypeError.\n if (bodyUnusable(input)) {\n throw new TypeError(\n 'Cannot construct a Request with a Request object that has already been used.'\n )\n }\n\n // 2. Set finalBody to the result of creating a proxy for inputBody.\n // https://streams.spec.whatwg.org/#readablestream-create-a-proxy\n const identityTransform = new TransformStream()\n inputBody.stream.pipeThrough(identityTransform)\n finalBody = {\n source: inputBody.source,\n length: inputBody.length,\n stream: identityTransform.readable\n }\n }\n\n // 41. Set this’s request’s body to finalBody.\n this[kState].body = finalBody\n }\n\n // Returns request’s HTTP method, which is \"GET\" by default.\n get method () {\n webidl.brandCheck(this, Request)\n\n // The method getter steps are to return this’s request’s method.\n return this[kState].method\n }\n\n // Returns the URL of request as a string.\n get url () {\n webidl.brandCheck(this, Request)\n\n // The url getter steps are to return this’s request’s URL, serialized.\n return URLSerializer(this[kState].url)\n }\n\n // Returns a Headers object consisting of the headers associated with request.\n // Note that headers added in the network layer by the user agent will not\n // be accounted for in this object, e.g., the \"Host\" header.\n get headers () {\n webidl.brandCheck(this, Request)\n\n // The headers getter steps are to return this’s headers.\n return this[kHeaders]\n }\n\n // Returns the kind of resource requested by request, e.g., \"document\"\n // or \"script\".\n get destination () {\n webidl.brandCheck(this, Request)\n\n // The destination getter are to return this’s request’s destination.\n return this[kState].destination\n }\n\n // Returns the referrer of request. Its value can be a same-origin URL if\n // explicitly set in init, the empty string to indicate no referrer, and\n // \"about:client\" when defaulting to the global’s default. This is used\n // during fetching to determine the value of the `Referer` header of the\n // request being made.\n get referrer () {\n webidl.brandCheck(this, Request)\n\n // 1. If this’s request’s referrer is \"no-referrer\", then return the\n // empty string.\n if (this[kState].referrer === 'no-referrer') {\n return ''\n }\n\n // 2. If this’s request’s referrer is \"client\", then return\n // \"about:client\".\n if (this[kState].referrer === 'client') {\n return 'about:client'\n }\n\n // Return this’s request’s referrer, serialized.\n return this[kState].referrer.toString()\n }\n\n // Returns the referrer policy associated with request.\n // This is used during fetching to compute the value of the request’s\n // referrer.\n get referrerPolicy () {\n webidl.brandCheck(this, Request)\n\n // The referrerPolicy getter steps are to return this’s request’s referrer policy.\n return this[kState].referrerPolicy\n }\n\n // Returns the mode associated with request, which is a string indicating\n // whether the request will use CORS, or will be restricted to same-origin\n // URLs.\n get mode () {\n webidl.brandCheck(this, Request)\n\n // The mode getter steps are to return this’s request’s mode.\n return this[kState].mode\n }\n\n // Returns the credentials mode associated with request,\n // which is a string indicating whether credentials will be sent with the\n // request always, never, or only when sent to a same-origin URL.\n get credentials () {\n // The credentials getter steps are to return this’s request’s credentials mode.\n return this[kState].credentials\n }\n\n // Returns the cache mode associated with request,\n // which is a string indicating how the request will\n // interact with the browser’s cache when fetching.\n get cache () {\n webidl.brandCheck(this, Request)\n\n // The cache getter steps are to return this’s request’s cache mode.\n return this[kState].cache\n }\n\n // Returns the redirect mode associated with request,\n // which is a string indicating how redirects for the\n // request will be handled during fetching. A request\n // will follow redirects by default.\n get redirect () {\n webidl.brandCheck(this, Request)\n\n // The redirect getter steps are to return this’s request’s redirect mode.\n return this[kState].redirect\n }\n\n // Returns request’s subresource integrity metadata, which is a\n // cryptographic hash of the resource being fetched. Its value\n // consists of multiple hashes separated by whitespace. [SRI]\n get integrity () {\n webidl.brandCheck(this, Request)\n\n // The integrity getter steps are to return this’s request’s integrity\n // metadata.\n return this[kState].integrity\n }\n\n // Returns a boolean indicating whether or not request can outlive the\n // global in which it was created.\n get keepalive () {\n webidl.brandCheck(this, Request)\n\n // The keepalive getter steps are to return this’s request’s keepalive.\n return this[kState].keepalive\n }\n\n // Returns a boolean indicating whether or not request is for a reload\n // navigation.\n get isReloadNavigation () {\n webidl.brandCheck(this, Request)\n\n // The isReloadNavigation getter steps are to return true if this’s\n // request’s reload-navigation flag is set; otherwise false.\n return this[kState].reloadNavigation\n }\n\n // Returns a boolean indicating whether or not request is for a history\n // navigation (a.k.a. back-forward navigation).\n get isHistoryNavigation () {\n webidl.brandCheck(this, Request)\n\n // The isHistoryNavigation getter steps are to return true if this’s request’s\n // history-navigation flag is set; otherwise false.\n return this[kState].historyNavigation\n }\n\n // Returns the signal associated with request, which is an AbortSignal\n // object indicating whether or not request has been aborted, and its\n // abort event handler.\n get signal () {\n webidl.brandCheck(this, Request)\n\n // The signal getter steps are to return this’s signal.\n return this[kSignal]\n }\n\n get body () {\n webidl.brandCheck(this, Request)\n\n return this[kState].body ? this[kState].body.stream : null\n }\n\n get bodyUsed () {\n webidl.brandCheck(this, Request)\n\n return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n }\n\n get duplex () {\n webidl.brandCheck(this, Request)\n\n return 'half'\n }\n\n // Returns a clone of request.\n clone () {\n webidl.brandCheck(this, Request)\n\n // 1. If this is unusable, then throw a TypeError.\n if (bodyUnusable(this)) {\n throw new TypeError('unusable')\n }\n\n // 2. Let clonedRequest be the result of cloning this’s request.\n const clonedRequest = cloneRequest(this[kState])\n\n // 3. Let clonedRequestObject be the result of creating a Request object,\n // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.\n // 4. Make clonedRequestObject’s signal follow this’s signal.\n const ac = new AbortController()\n if (this.signal.aborted) {\n ac.abort(this.signal.reason)\n } else {\n let list = dependentControllerMap.get(this.signal)\n if (list === undefined) {\n list = new Set()\n dependentControllerMap.set(this.signal, list)\n }\n const acRef = new WeakRef(ac)\n list.add(acRef)\n util.addAbortListener(\n ac.signal,\n buildAbort(acRef)\n )\n }\n\n // 4. Return clonedRequestObject.\n return fromInnerRequest(clonedRequest, ac.signal, getHeadersGuard(this[kHeaders]))\n }\n\n [nodeUtil.inspect.custom] (depth, options) {\n if (options.depth === null) {\n options.depth = 2\n }\n\n options.colors ??= true\n\n const properties = {\n method: this.method,\n url: this.url,\n headers: this.headers,\n destination: this.destination,\n referrer: this.referrer,\n referrerPolicy: this.referrerPolicy,\n mode: this.mode,\n credentials: this.credentials,\n cache: this.cache,\n redirect: this.redirect,\n integrity: this.integrity,\n keepalive: this.keepalive,\n isReloadNavigation: this.isReloadNavigation,\n isHistoryNavigation: this.isHistoryNavigation,\n signal: this.signal\n }\n\n return `Request ${nodeUtil.formatWithOptions(options, properties)}`\n }\n}\n\nmixinBody(Request)\n\n// https://fetch.spec.whatwg.org/#requests\nfunction makeRequest (init) {\n return {\n method: init.method ?? 'GET',\n localURLsOnly: init.localURLsOnly ?? false,\n unsafeRequest: init.unsafeRequest ?? false,\n body: init.body ?? null,\n client: init.client ?? null,\n reservedClient: init.reservedClient ?? null,\n replacesClientId: init.replacesClientId ?? '',\n window: init.window ?? 'client',\n keepalive: init.keepalive ?? false,\n serviceWorkers: init.serviceWorkers ?? 'all',\n initiator: init.initiator ?? '',\n destination: init.destination ?? '',\n priority: init.priority ?? null,\n origin: init.origin ?? 'client',\n policyContainer: init.policyContainer ?? 'client',\n referrer: init.referrer ?? 'client',\n referrerPolicy: init.referrerPolicy ?? '',\n mode: init.mode ?? 'no-cors',\n useCORSPreflightFlag: init.useCORSPreflightFlag ?? false,\n credentials: init.credentials ?? 'same-origin',\n useCredentials: init.useCredentials ?? false,\n cache: init.cache ?? 'default',\n redirect: init.redirect ?? 'follow',\n integrity: init.integrity ?? '',\n cryptoGraphicsNonceMetadata: init.cryptoGraphicsNonceMetadata ?? '',\n parserMetadata: init.parserMetadata ?? '',\n reloadNavigation: init.reloadNavigation ?? false,\n historyNavigation: init.historyNavigation ?? false,\n userActivation: init.userActivation ?? false,\n taintedOrigin: init.taintedOrigin ?? false,\n redirectCount: init.redirectCount ?? 0,\n responseTainting: init.responseTainting ?? 'basic',\n preventNoCacheCacheControlHeaderModification: init.preventNoCacheCacheControlHeaderModification ?? false,\n done: init.done ?? false,\n timingAllowFailed: init.timingAllowFailed ?? false,\n urlList: init.urlList,\n url: init.urlList[0],\n headersList: init.headersList\n ? new HeadersList(init.headersList)\n : new HeadersList()\n }\n}\n\n// https://fetch.spec.whatwg.org/#concept-request-clone\nfunction cloneRequest (request) {\n // To clone a request request, run these steps:\n\n // 1. Let newRequest be a copy of request, except for its body.\n const newRequest = makeRequest({ ...request, body: null })\n\n // 2. If request’s body is non-null, set newRequest’s body to the\n // result of cloning request’s body.\n if (request.body != null) {\n newRequest.body = cloneBody(newRequest, request.body)\n }\n\n // 3. Return newRequest.\n return newRequest\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-create\n * @param {any} innerRequest\n * @param {AbortSignal} signal\n * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard\n * @returns {Request}\n */\nfunction fromInnerRequest (innerRequest, signal, guard) {\n const request = new Request(kConstruct)\n request[kState] = innerRequest\n request[kSignal] = signal\n request[kHeaders] = new Headers(kConstruct)\n setHeadersList(request[kHeaders], innerRequest.headersList)\n setHeadersGuard(request[kHeaders], guard)\n return request\n}\n\nObject.defineProperties(Request.prototype, {\n method: kEnumerableProperty,\n url: kEnumerableProperty,\n headers: kEnumerableProperty,\n redirect: kEnumerableProperty,\n clone: kEnumerableProperty,\n signal: kEnumerableProperty,\n duplex: kEnumerableProperty,\n destination: kEnumerableProperty,\n body: kEnumerableProperty,\n bodyUsed: kEnumerableProperty,\n isHistoryNavigation: kEnumerableProperty,\n isReloadNavigation: kEnumerableProperty,\n keepalive: kEnumerableProperty,\n integrity: kEnumerableProperty,\n cache: kEnumerableProperty,\n credentials: kEnumerableProperty,\n attribute: kEnumerableProperty,\n referrerPolicy: kEnumerableProperty,\n referrer: kEnumerableProperty,\n mode: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'Request',\n configurable: true\n }\n})\n\nwebidl.converters.Request = webidl.interfaceConverter(\n Request\n)\n\n// https://fetch.spec.whatwg.org/#requestinfo\nwebidl.converters.RequestInfo = function (V, prefix, argument) {\n if (typeof V === 'string') {\n return webidl.converters.USVString(V, prefix, argument)\n }\n\n if (V instanceof Request) {\n return webidl.converters.Request(V, prefix, argument)\n }\n\n return webidl.converters.USVString(V, prefix, argument)\n}\n\nwebidl.converters.AbortSignal = webidl.interfaceConverter(\n AbortSignal\n)\n\n// https://fetch.spec.whatwg.org/#requestinit\nwebidl.converters.RequestInit = webidl.dictionaryConverter([\n {\n key: 'method',\n converter: webidl.converters.ByteString\n },\n {\n key: 'headers',\n converter: webidl.converters.HeadersInit\n },\n {\n key: 'body',\n converter: webidl.nullableConverter(\n webidl.converters.BodyInit\n )\n },\n {\n key: 'referrer',\n converter: webidl.converters.USVString\n },\n {\n key: 'referrerPolicy',\n converter: webidl.converters.DOMString,\n // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy\n allowedValues: referrerPolicy\n },\n {\n key: 'mode',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#concept-request-mode\n allowedValues: requestMode\n },\n {\n key: 'credentials',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#requestcredentials\n allowedValues: requestCredentials\n },\n {\n key: 'cache',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#requestcache\n allowedValues: requestCache\n },\n {\n key: 'redirect',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#requestredirect\n allowedValues: requestRedirect\n },\n {\n key: 'integrity',\n converter: webidl.converters.DOMString\n },\n {\n key: 'keepalive',\n converter: webidl.converters.boolean\n },\n {\n key: 'signal',\n converter: webidl.nullableConverter(\n (signal) => webidl.converters.AbortSignal(\n signal,\n 'RequestInit',\n 'signal',\n { strict: false }\n )\n )\n },\n {\n key: 'window',\n converter: webidl.converters.any\n },\n {\n key: 'duplex',\n converter: webidl.converters.DOMString,\n allowedValues: requestDuplex\n },\n {\n key: 'dispatcher', // undici specific option\n converter: webidl.converters.any\n }\n])\n\nmodule.exports = { Request, makeRequest, fromInnerRequest, cloneRequest }\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst {\n makeNetworkError,\n makeAppropriateNetworkError,\n filterResponse,\n makeResponse,\n fromInnerResponse\n} = require('./response')\nconst { HeadersList } = require('./headers')\nconst { Request, cloneRequest } = require('./request')\nconst zlib = require('node:zlib')\nconst {\n bytesMatch,\n makePolicyContainer,\n clonePolicyContainer,\n requestBadPort,\n TAOCheck,\n appendRequestOriginHeader,\n responseLocationURL,\n requestCurrentURL,\n setRequestReferrerPolicyOnRedirect,\n tryUpgradeRequestToAPotentiallyTrustworthyURL,\n createOpaqueTimingInfo,\n appendFetchMetadata,\n corsCheck,\n crossOriginResourcePolicyCheck,\n determineRequestsReferrer,\n coarsenedSharedCurrentTime,\n createDeferredPromise,\n isBlobLike,\n sameOrigin,\n isCancelled,\n isAborted,\n isErrorLike,\n fullyReadBody,\n readableStreamClose,\n isomorphicEncode,\n urlIsLocal,\n urlIsHttpHttpsScheme,\n urlHasHttpsScheme,\n clampAndCoarsenConnectionTimingInfo,\n simpleRangeHeaderValue,\n buildContentRange,\n createInflate,\n extractMimeType\n} = require('./util')\nconst { kState, kDispatcher } = require('./symbols')\nconst assert = require('node:assert')\nconst { safelyExtractBody, extractBody } = require('./body')\nconst {\n redirectStatusSet,\n nullBodyStatus,\n safeMethodsSet,\n requestBodyHeader,\n subresourceSet\n} = require('./constants')\nconst EE = require('node:events')\nconst { Readable, pipeline, finished } = require('node:stream')\nconst { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require('../../core/util')\nconst { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require('./data-url')\nconst { getGlobalDispatcher } = require('../../global')\nconst { webidl } = require('./webidl')\nconst { STATUS_CODES } = require('node:http')\nconst GET_OR_HEAD = ['GET', 'HEAD']\n\nconst defaultUserAgent = typeof __UNDICI_IS_NODE__ !== 'undefined' || typeof esbuildDetection !== 'undefined'\n ? 'node'\n : 'undici'\n\n/** @type {import('buffer').resolveObjectURL} */\nlet resolveObjectURL\n\nclass Fetch extends EE {\n constructor (dispatcher) {\n super()\n\n this.dispatcher = dispatcher\n this.connection = null\n this.dump = false\n this.state = 'ongoing'\n }\n\n terminate (reason) {\n if (this.state !== 'ongoing') {\n return\n }\n\n this.state = 'terminated'\n this.connection?.destroy(reason)\n this.emit('terminated', reason)\n }\n\n // https://fetch.spec.whatwg.org/#fetch-controller-abort\n abort (error) {\n if (this.state !== 'ongoing') {\n return\n }\n\n // 1. Set controller’s state to \"aborted\".\n this.state = 'aborted'\n\n // 2. Let fallbackError be an \"AbortError\" DOMException.\n // 3. Set error to fallbackError if it is not given.\n if (!error) {\n error = new DOMException('The operation was aborted.', 'AbortError')\n }\n\n // 4. Let serializedError be StructuredSerialize(error).\n // If that threw an exception, catch it, and let\n // serializedError be StructuredSerialize(fallbackError).\n\n // 5. Set controller’s serialized abort reason to serializedError.\n this.serializedAbortReason = error\n\n this.connection?.destroy(error)\n this.emit('terminated', error)\n }\n}\n\nfunction handleFetchDone (response) {\n finalizeAndReportTiming(response, 'fetch')\n}\n\n// https://fetch.spec.whatwg.org/#fetch-method\nfunction fetch (input, init = undefined) {\n webidl.argumentLengthCheck(arguments, 1, 'globalThis.fetch')\n\n // 1. Let p be a new promise.\n let p = createDeferredPromise()\n\n // 2. Let requestObject be the result of invoking the initial value of\n // Request as constructor with input and init as arguments. If this throws\n // an exception, reject p with it and return p.\n let requestObject\n\n try {\n requestObject = new Request(input, init)\n } catch (e) {\n p.reject(e)\n return p.promise\n }\n\n // 3. Let request be requestObject’s request.\n const request = requestObject[kState]\n\n // 4. If requestObject’s signal’s aborted flag is set, then:\n if (requestObject.signal.aborted) {\n // 1. Abort the fetch() call with p, request, null, and\n // requestObject’s signal’s abort reason.\n abortFetch(p, request, null, requestObject.signal.reason)\n\n // 2. Return p.\n return p.promise\n }\n\n // 5. Let globalObject be request’s client’s global object.\n const globalObject = request.client.globalObject\n\n // 6. If globalObject is a ServiceWorkerGlobalScope object, then set\n // request’s service-workers mode to \"none\".\n if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {\n request.serviceWorkers = 'none'\n }\n\n // 7. Let responseObject be null.\n let responseObject = null\n\n // 8. Let relevantRealm be this’s relevant Realm.\n\n // 9. Let locallyAborted be false.\n let locallyAborted = false\n\n // 10. Let controller be null.\n let controller = null\n\n // 11. Add the following abort steps to requestObject’s signal:\n addAbortListener(\n requestObject.signal,\n () => {\n // 1. Set locallyAborted to true.\n locallyAborted = true\n\n // 2. Assert: controller is non-null.\n assert(controller != null)\n\n // 3. Abort controller with requestObject’s signal’s abort reason.\n controller.abort(requestObject.signal.reason)\n\n const realResponse = responseObject?.deref()\n\n // 4. Abort the fetch() call with p, request, responseObject,\n // and requestObject’s signal’s abort reason.\n abortFetch(p, request, realResponse, requestObject.signal.reason)\n }\n )\n\n // 12. Let handleFetchDone given response response be to finalize and\n // report timing with response, globalObject, and \"fetch\".\n // see function handleFetchDone\n\n // 13. Set controller to the result of calling fetch given request,\n // with processResponseEndOfBody set to handleFetchDone, and processResponse\n // given response being these substeps:\n\n const processResponse = (response) => {\n // 1. If locallyAborted is true, terminate these substeps.\n if (locallyAborted) {\n return\n }\n\n // 2. If response’s aborted flag is set, then:\n if (response.aborted) {\n // 1. Let deserializedError be the result of deserialize a serialized\n // abort reason given controller’s serialized abort reason and\n // relevantRealm.\n\n // 2. Abort the fetch() call with p, request, responseObject, and\n // deserializedError.\n\n abortFetch(p, request, responseObject, controller.serializedAbortReason)\n return\n }\n\n // 3. If response is a network error, then reject p with a TypeError\n // and terminate these substeps.\n if (response.type === 'error') {\n p.reject(new TypeError('fetch failed', { cause: response.error }))\n return\n }\n\n // 4. Set responseObject to the result of creating a Response object,\n // given response, \"immutable\", and relevantRealm.\n responseObject = new WeakRef(fromInnerResponse(response, 'immutable'))\n\n // 5. Resolve p with responseObject.\n p.resolve(responseObject.deref())\n p = null\n }\n\n controller = fetching({\n request,\n processResponseEndOfBody: handleFetchDone,\n processResponse,\n dispatcher: requestObject[kDispatcher] // undici\n })\n\n // 14. Return p.\n return p.promise\n}\n\n// https://fetch.spec.whatwg.org/#finalize-and-report-timing\nfunction finalizeAndReportTiming (response, initiatorType = 'other') {\n // 1. If response is an aborted network error, then return.\n if (response.type === 'error' && response.aborted) {\n return\n }\n\n // 2. If response’s URL list is null or empty, then return.\n if (!response.urlList?.length) {\n return\n }\n\n // 3. Let originalURL be response’s URL list[0].\n const originalURL = response.urlList[0]\n\n // 4. Let timingInfo be response’s timing info.\n let timingInfo = response.timingInfo\n\n // 5. Let cacheState be response’s cache state.\n let cacheState = response.cacheState\n\n // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.\n if (!urlIsHttpHttpsScheme(originalURL)) {\n return\n }\n\n // 7. If timingInfo is null, then return.\n if (timingInfo === null) {\n return\n }\n\n // 8. If response’s timing allow passed flag is not set, then:\n if (!response.timingAllowPassed) {\n // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.\n timingInfo = createOpaqueTimingInfo({\n startTime: timingInfo.startTime\n })\n\n // 2. Set cacheState to the empty string.\n cacheState = ''\n }\n\n // 9. Set timingInfo’s end time to the coarsened shared current time\n // given global’s relevant settings object’s cross-origin isolated\n // capability.\n // TODO: given global’s relevant settings object’s cross-origin isolated\n // capability?\n timingInfo.endTime = coarsenedSharedCurrentTime()\n\n // 10. Set response’s timing info to timingInfo.\n response.timingInfo = timingInfo\n\n // 11. Mark resource timing for timingInfo, originalURL, initiatorType,\n // global, and cacheState.\n markResourceTiming(\n timingInfo,\n originalURL.href,\n initiatorType,\n globalThis,\n cacheState\n )\n}\n\n// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing\nconst markResourceTiming = performance.markResourceTiming\n\n// https://fetch.spec.whatwg.org/#abort-fetch\nfunction abortFetch (p, request, responseObject, error) {\n // 1. Reject promise with error.\n if (p) {\n // We might have already resolved the promise at this stage\n p.reject(error)\n }\n\n // 2. If request’s body is not null and is readable, then cancel request’s\n // body with error.\n if (request.body != null && isReadable(request.body?.stream)) {\n request.body.stream.cancel(error).catch((err) => {\n if (err.code === 'ERR_INVALID_STATE') {\n // Node bug?\n return\n }\n throw err\n })\n }\n\n // 3. If responseObject is null, then return.\n if (responseObject == null) {\n return\n }\n\n // 4. Let response be responseObject’s response.\n const response = responseObject[kState]\n\n // 5. If response’s body is not null and is readable, then error response’s\n // body with error.\n if (response.body != null && isReadable(response.body?.stream)) {\n response.body.stream.cancel(error).catch((err) => {\n if (err.code === 'ERR_INVALID_STATE') {\n // Node bug?\n return\n }\n throw err\n })\n }\n}\n\n// https://fetch.spec.whatwg.org/#fetching\nfunction fetching ({\n request,\n processRequestBodyChunkLength,\n processRequestEndOfBody,\n processResponse,\n processResponseEndOfBody,\n processResponseConsumeBody,\n useParallelQueue = false,\n dispatcher = getGlobalDispatcher() // undici\n}) {\n // Ensure that the dispatcher is set accordingly\n assert(dispatcher)\n\n // 1. Let taskDestination be null.\n let taskDestination = null\n\n // 2. Let crossOriginIsolatedCapability be false.\n let crossOriginIsolatedCapability = false\n\n // 3. If request’s client is non-null, then:\n if (request.client != null) {\n // 1. Set taskDestination to request’s client’s global object.\n taskDestination = request.client.globalObject\n\n // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin\n // isolated capability.\n crossOriginIsolatedCapability =\n request.client.crossOriginIsolatedCapability\n }\n\n // 4. If useParallelQueue is true, then set taskDestination to the result of\n // starting a new parallel queue.\n // TODO\n\n // 5. Let timingInfo be a new fetch timing info whose start time and\n // post-redirect start time are the coarsened shared current time given\n // crossOriginIsolatedCapability.\n const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)\n const timingInfo = createOpaqueTimingInfo({\n startTime: currentTime\n })\n\n // 6. Let fetchParams be a new fetch params whose\n // request is request,\n // timing info is timingInfo,\n // process request body chunk length is processRequestBodyChunkLength,\n // process request end-of-body is processRequestEndOfBody,\n // process response is processResponse,\n // process response consume body is processResponseConsumeBody,\n // process response end-of-body is processResponseEndOfBody,\n // task destination is taskDestination,\n // and cross-origin isolated capability is crossOriginIsolatedCapability.\n const fetchParams = {\n controller: new Fetch(dispatcher),\n request,\n timingInfo,\n processRequestBodyChunkLength,\n processRequestEndOfBody,\n processResponse,\n processResponseConsumeBody,\n processResponseEndOfBody,\n taskDestination,\n crossOriginIsolatedCapability\n }\n\n // 7. If request’s body is a byte sequence, then set request’s body to\n // request’s body as a body.\n // NOTE: Since fetching is only called from fetch, body should already be\n // extracted.\n assert(!request.body || request.body.stream)\n\n // 8. If request’s window is \"client\", then set request’s window to request’s\n // client, if request’s client’s global object is a Window object; otherwise\n // \"no-window\".\n if (request.window === 'client') {\n // TODO: What if request.client is null?\n request.window =\n request.client?.globalObject?.constructor?.name === 'Window'\n ? request.client\n : 'no-window'\n }\n\n // 9. If request’s origin is \"client\", then set request’s origin to request’s\n // client’s origin.\n if (request.origin === 'client') {\n request.origin = request.client.origin\n }\n\n // 10. If all of the following conditions are true:\n // TODO\n\n // 11. If request’s policy container is \"client\", then:\n if (request.policyContainer === 'client') {\n // 1. If request’s client is non-null, then set request’s policy\n // container to a clone of request’s client’s policy container. [HTML]\n if (request.client != null) {\n request.policyContainer = clonePolicyContainer(\n request.client.policyContainer\n )\n } else {\n // 2. Otherwise, set request’s policy container to a new policy\n // container.\n request.policyContainer = makePolicyContainer()\n }\n }\n\n // 12. If request’s header list does not contain `Accept`, then:\n if (!request.headersList.contains('accept', true)) {\n // 1. Let value be `*/*`.\n const value = '*/*'\n\n // 2. A user agent should set value to the first matching statement, if\n // any, switching on request’s destination:\n // \"document\"\n // \"frame\"\n // \"iframe\"\n // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`\n // \"image\"\n // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`\n // \"style\"\n // `text/css,*/*;q=0.1`\n // TODO\n\n // 3. Append `Accept`/value to request’s header list.\n request.headersList.append('accept', value, true)\n }\n\n // 13. If request’s header list does not contain `Accept-Language`, then\n // user agents should append `Accept-Language`/an appropriate value to\n // request’s header list.\n if (!request.headersList.contains('accept-language', true)) {\n request.headersList.append('accept-language', '*', true)\n }\n\n // 14. If request’s priority is null, then use request’s initiator and\n // destination appropriately in setting request’s priority to a\n // user-agent-defined object.\n if (request.priority === null) {\n // TODO\n }\n\n // 15. If request is a subresource request, then:\n if (subresourceSet.has(request.destination)) {\n // TODO\n }\n\n // 16. Run main fetch given fetchParams.\n mainFetch(fetchParams)\n .catch(err => {\n fetchParams.controller.terminate(err)\n })\n\n // 17. Return fetchParam's controller\n return fetchParams.controller\n}\n\n// https://fetch.spec.whatwg.org/#concept-main-fetch\nasync function mainFetch (fetchParams, recursive = false) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let response be null.\n let response = null\n\n // 3. If request’s local-URLs-only flag is set and request’s current URL is\n // not local, then set response to a network error.\n if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {\n response = makeNetworkError('local URLs only')\n }\n\n // 4. Run report Content Security Policy violations for request.\n // TODO\n\n // 5. Upgrade request to a potentially trustworthy URL, if appropriate.\n tryUpgradeRequestToAPotentiallyTrustworthyURL(request)\n\n // 6. If should request be blocked due to a bad port, should fetching request\n // be blocked as mixed content, or should request be blocked by Content\n // Security Policy returns blocked, then set response to a network error.\n if (requestBadPort(request) === 'blocked') {\n response = makeNetworkError('bad port')\n }\n // TODO: should fetching request be blocked as mixed content?\n // TODO: should request be blocked by Content Security Policy?\n\n // 7. If request’s referrer policy is the empty string, then set request’s\n // referrer policy to request’s policy container’s referrer policy.\n if (request.referrerPolicy === '') {\n request.referrerPolicy = request.policyContainer.referrerPolicy\n }\n\n // 8. If request’s referrer is not \"no-referrer\", then set request’s\n // referrer to the result of invoking determine request’s referrer.\n if (request.referrer !== 'no-referrer') {\n request.referrer = determineRequestsReferrer(request)\n }\n\n // 9. Set request’s current URL’s scheme to \"https\" if all of the following\n // conditions are true:\n // - request’s current URL’s scheme is \"http\"\n // - request’s current URL’s host is a domain\n // - Matching request’s current URL’s host per Known HSTS Host Domain Name\n // Matching results in either a superdomain match with an asserted\n // includeSubDomains directive or a congruent match (with or without an\n // asserted includeSubDomains directive). [HSTS]\n // TODO\n\n // 10. If recursive is false, then run the remaining steps in parallel.\n // TODO\n\n // 11. If response is null, then set response to the result of running\n // the steps corresponding to the first matching statement:\n if (response === null) {\n response = await (async () => {\n const currentURL = requestCurrentURL(request)\n\n if (\n // - request’s current URL’s origin is same origin with request’s origin,\n // and request’s response tainting is \"basic\"\n (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||\n // request’s current URL’s scheme is \"data\"\n (currentURL.protocol === 'data:') ||\n // - request’s mode is \"navigate\" or \"websocket\"\n (request.mode === 'navigate' || request.mode === 'websocket')\n ) {\n // 1. Set request’s response tainting to \"basic\".\n request.responseTainting = 'basic'\n\n // 2. Return the result of running scheme fetch given fetchParams.\n return await schemeFetch(fetchParams)\n }\n\n // request’s mode is \"same-origin\"\n if (request.mode === 'same-origin') {\n // 1. Return a network error.\n return makeNetworkError('request mode cannot be \"same-origin\"')\n }\n\n // request’s mode is \"no-cors\"\n if (request.mode === 'no-cors') {\n // 1. If request’s redirect mode is not \"follow\", then return a network\n // error.\n if (request.redirect !== 'follow') {\n return makeNetworkError(\n 'redirect mode cannot be \"follow\" for \"no-cors\" request'\n )\n }\n\n // 2. Set request’s response tainting to \"opaque\".\n request.responseTainting = 'opaque'\n\n // 3. Return the result of running scheme fetch given fetchParams.\n return await schemeFetch(fetchParams)\n }\n\n // request’s current URL’s scheme is not an HTTP(S) scheme\n if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {\n // Return a network error.\n return makeNetworkError('URL scheme must be a HTTP(S) scheme')\n }\n\n // - request’s use-CORS-preflight flag is set\n // - request’s unsafe-request flag is set and either request’s method is\n // not a CORS-safelisted method or CORS-unsafe request-header names with\n // request’s header list is not empty\n // 1. Set request’s response tainting to \"cors\".\n // 2. Let corsWithPreflightResponse be the result of running HTTP fetch\n // given fetchParams and true.\n // 3. If corsWithPreflightResponse is a network error, then clear cache\n // entries using request.\n // 4. Return corsWithPreflightResponse.\n // TODO\n\n // Otherwise\n // 1. Set request’s response tainting to \"cors\".\n request.responseTainting = 'cors'\n\n // 2. Return the result of running HTTP fetch given fetchParams.\n return await httpFetch(fetchParams)\n })()\n }\n\n // 12. If recursive is true, then return response.\n if (recursive) {\n return response\n }\n\n // 13. If response is not a network error and response is not a filtered\n // response, then:\n if (response.status !== 0 && !response.internalResponse) {\n // If request’s response tainting is \"cors\", then:\n if (request.responseTainting === 'cors') {\n // 1. Let headerNames be the result of extracting header list values\n // given `Access-Control-Expose-Headers` and response’s header list.\n // TODO\n // 2. If request’s credentials mode is not \"include\" and headerNames\n // contains `*`, then set response’s CORS-exposed header-name list to\n // all unique header names in response’s header list.\n // TODO\n // 3. Otherwise, if headerNames is not null or failure, then set\n // response’s CORS-exposed header-name list to headerNames.\n // TODO\n }\n\n // Set response to the following filtered response with response as its\n // internal response, depending on request’s response tainting:\n if (request.responseTainting === 'basic') {\n response = filterResponse(response, 'basic')\n } else if (request.responseTainting === 'cors') {\n response = filterResponse(response, 'cors')\n } else if (request.responseTainting === 'opaque') {\n response = filterResponse(response, 'opaque')\n } else {\n assert(false)\n }\n }\n\n // 14. Let internalResponse be response, if response is a network error,\n // and response’s internal response otherwise.\n let internalResponse =\n response.status === 0 ? response : response.internalResponse\n\n // 15. If internalResponse’s URL list is empty, then set it to a clone of\n // request’s URL list.\n if (internalResponse.urlList.length === 0) {\n internalResponse.urlList.push(...request.urlList)\n }\n\n // 16. If request’s timing allow failed flag is unset, then set\n // internalResponse’s timing allow passed flag.\n if (!request.timingAllowFailed) {\n response.timingAllowPassed = true\n }\n\n // 17. If response is not a network error and any of the following returns\n // blocked\n // - should internalResponse to request be blocked as mixed content\n // - should internalResponse to request be blocked by Content Security Policy\n // - should internalResponse to request be blocked due to its MIME type\n // - should internalResponse to request be blocked due to nosniff\n // TODO\n\n // 18. If response’s type is \"opaque\", internalResponse’s status is 206,\n // internalResponse’s range-requested flag is set, and request’s header\n // list does not contain `Range`, then set response and internalResponse\n // to a network error.\n if (\n response.type === 'opaque' &&\n internalResponse.status === 206 &&\n internalResponse.rangeRequested &&\n !request.headers.contains('range', true)\n ) {\n response = internalResponse = makeNetworkError()\n }\n\n // 19. If response is not a network error and either request’s method is\n // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,\n // set internalResponse’s body to null and disregard any enqueuing toward\n // it (if any).\n if (\n response.status !== 0 &&\n (request.method === 'HEAD' ||\n request.method === 'CONNECT' ||\n nullBodyStatus.includes(internalResponse.status))\n ) {\n internalResponse.body = null\n fetchParams.controller.dump = true\n }\n\n // 20. If request’s integrity metadata is not the empty string, then:\n if (request.integrity) {\n // 1. Let processBodyError be this step: run fetch finale given fetchParams\n // and a network error.\n const processBodyError = (reason) =>\n fetchFinale(fetchParams, makeNetworkError(reason))\n\n // 2. If request’s response tainting is \"opaque\", or response’s body is null,\n // then run processBodyError and abort these steps.\n if (request.responseTainting === 'opaque' || response.body == null) {\n processBodyError(response.error)\n return\n }\n\n // 3. Let processBody given bytes be these steps:\n const processBody = (bytes) => {\n // 1. If bytes do not match request’s integrity metadata,\n // then run processBodyError and abort these steps. [SRI]\n if (!bytesMatch(bytes, request.integrity)) {\n processBodyError('integrity mismatch')\n return\n }\n\n // 2. Set response’s body to bytes as a body.\n response.body = safelyExtractBody(bytes)[0]\n\n // 3. Run fetch finale given fetchParams and response.\n fetchFinale(fetchParams, response)\n }\n\n // 4. Fully read response’s body given processBody and processBodyError.\n await fullyReadBody(response.body, processBody, processBodyError)\n } else {\n // 21. Otherwise, run fetch finale given fetchParams and response.\n fetchFinale(fetchParams, response)\n }\n}\n\n// https://fetch.spec.whatwg.org/#concept-scheme-fetch\n// given a fetch params fetchParams\nfunction schemeFetch (fetchParams) {\n // Note: since the connection is destroyed on redirect, which sets fetchParams to a\n // cancelled state, we do not want this condition to trigger *unless* there have been\n // no redirects. See https://github.com/nodejs/undici/issues/1776\n // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {\n return Promise.resolve(makeAppropriateNetworkError(fetchParams))\n }\n\n // 2. Let request be fetchParams’s request.\n const { request } = fetchParams\n\n const { protocol: scheme } = requestCurrentURL(request)\n\n // 3. Switch on request’s current URL’s scheme and run the associated steps:\n switch (scheme) {\n case 'about:': {\n // If request’s current URL’s path is the string \"blank\", then return a new response\n // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,\n // and body is the empty byte sequence as a body.\n\n // Otherwise, return a network error.\n return Promise.resolve(makeNetworkError('about scheme is not supported'))\n }\n case 'blob:': {\n if (!resolveObjectURL) {\n resolveObjectURL = require('node:buffer').resolveObjectURL\n }\n\n // 1. Let blobURLEntry be request’s current URL’s blob URL entry.\n const blobURLEntry = requestCurrentURL(request)\n\n // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56\n // Buffer.resolveObjectURL does not ignore URL queries.\n if (blobURLEntry.search.length !== 0) {\n return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))\n }\n\n const blob = resolveObjectURL(blobURLEntry.toString())\n\n // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s\n // object is not a Blob object, then return a network error.\n if (request.method !== 'GET' || !isBlobLike(blob)) {\n return Promise.resolve(makeNetworkError('invalid method'))\n }\n\n // 3. Let blob be blobURLEntry’s object.\n // Note: done above\n\n // 4. Let response be a new response.\n const response = makeResponse()\n\n // 5. Let fullLength be blob’s size.\n const fullLength = blob.size\n\n // 6. Let serializedFullLength be fullLength, serialized and isomorphic encoded.\n const serializedFullLength = isomorphicEncode(`${fullLength}`)\n\n // 7. Let type be blob’s type.\n const type = blob.type\n\n // 8. If request’s header list does not contain `Range`:\n // 9. Otherwise:\n if (!request.headersList.contains('range', true)) {\n // 1. Let bodyWithType be the result of safely extracting blob.\n // Note: in the FileAPI a blob \"object\" is a Blob *or* a MediaSource.\n // In node, this can only ever be a Blob. Therefore we can safely\n // use extractBody directly.\n const bodyWithType = extractBody(blob)\n\n // 2. Set response’s status message to `OK`.\n response.statusText = 'OK'\n\n // 3. Set response’s body to bodyWithType’s body.\n response.body = bodyWithType[0]\n\n // 4. Set response’s header list to « (`Content-Length`, serializedFullLength), (`Content-Type`, type) ».\n response.headersList.set('content-length', serializedFullLength, true)\n response.headersList.set('content-type', type, true)\n } else {\n // 1. Set response’s range-requested flag.\n response.rangeRequested = true\n\n // 2. Let rangeHeader be the result of getting `Range` from request’s header list.\n const rangeHeader = request.headersList.get('range', true)\n\n // 3. Let rangeValue be the result of parsing a single range header value given rangeHeader and true.\n const rangeValue = simpleRangeHeaderValue(rangeHeader, true)\n\n // 4. If rangeValue is failure, then return a network error.\n if (rangeValue === 'failure') {\n return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n }\n\n // 5. Let (rangeStart, rangeEnd) be rangeValue.\n let { rangeStartValue: rangeStart, rangeEndValue: rangeEnd } = rangeValue\n\n // 6. If rangeStart is null:\n // 7. Otherwise:\n if (rangeStart === null) {\n // 1. Set rangeStart to fullLength − rangeEnd.\n rangeStart = fullLength - rangeEnd\n\n // 2. Set rangeEnd to rangeStart + rangeEnd − 1.\n rangeEnd = rangeStart + rangeEnd - 1\n } else {\n // 1. If rangeStart is greater than or equal to fullLength, then return a network error.\n if (rangeStart >= fullLength) {\n return Promise.resolve(makeNetworkError('Range start is greater than the blob\\'s size.'))\n }\n\n // 2. If rangeEnd is null or rangeEnd is greater than or equal to fullLength, then set\n // rangeEnd to fullLength − 1.\n if (rangeEnd === null || rangeEnd >= fullLength) {\n rangeEnd = fullLength - 1\n }\n }\n\n // 8. Let slicedBlob be the result of invoking slice blob given blob, rangeStart,\n // rangeEnd + 1, and type.\n const slicedBlob = blob.slice(rangeStart, rangeEnd, type)\n\n // 9. Let slicedBodyWithType be the result of safely extracting slicedBlob.\n // Note: same reason as mentioned above as to why we use extractBody\n const slicedBodyWithType = extractBody(slicedBlob)\n\n // 10. Set response’s body to slicedBodyWithType’s body.\n response.body = slicedBodyWithType[0]\n\n // 11. Let serializedSlicedLength be slicedBlob’s size, serialized and isomorphic encoded.\n const serializedSlicedLength = isomorphicEncode(`${slicedBlob.size}`)\n\n // 12. Let contentRange be the result of invoking build a content range given rangeStart,\n // rangeEnd, and fullLength.\n const contentRange = buildContentRange(rangeStart, rangeEnd, fullLength)\n\n // 13. Set response’s status to 206.\n response.status = 206\n\n // 14. Set response’s status message to `Partial Content`.\n response.statusText = 'Partial Content'\n\n // 15. Set response’s header list to « (`Content-Length`, serializedSlicedLength),\n // (`Content-Type`, type), (`Content-Range`, contentRange) ».\n response.headersList.set('content-length', serializedSlicedLength, true)\n response.headersList.set('content-type', type, true)\n response.headersList.set('content-range', contentRange, true)\n }\n\n // 10. Return response.\n return Promise.resolve(response)\n }\n case 'data:': {\n // 1. Let dataURLStruct be the result of running the\n // data: URL processor on request’s current URL.\n const currentURL = requestCurrentURL(request)\n const dataURLStruct = dataURLProcessor(currentURL)\n\n // 2. If dataURLStruct is failure, then return a\n // network error.\n if (dataURLStruct === 'failure') {\n return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n }\n\n // 3. Let mimeType be dataURLStruct’s MIME type, serialized.\n const mimeType = serializeAMimeType(dataURLStruct.mimeType)\n\n // 4. Return a response whose status message is `OK`,\n // header list is « (`Content-Type`, mimeType) »,\n // and body is dataURLStruct’s body as a body.\n return Promise.resolve(makeResponse({\n statusText: 'OK',\n headersList: [\n ['content-type', { name: 'Content-Type', value: mimeType }]\n ],\n body: safelyExtractBody(dataURLStruct.body)[0]\n }))\n }\n case 'file:': {\n // For now, unfortunate as it is, file URLs are left as an exercise for the reader.\n // When in doubt, return a network error.\n return Promise.resolve(makeNetworkError('not implemented... yet...'))\n }\n case 'http:':\n case 'https:': {\n // Return the result of running HTTP fetch given fetchParams.\n\n return httpFetch(fetchParams)\n .catch((err) => makeNetworkError(err))\n }\n default: {\n return Promise.resolve(makeNetworkError('unknown scheme'))\n }\n }\n}\n\n// https://fetch.spec.whatwg.org/#finalize-response\nfunction finalizeResponse (fetchParams, response) {\n // 1. Set fetchParams’s request’s done flag.\n fetchParams.request.done = true\n\n // 2, If fetchParams’s process response done is not null, then queue a fetch\n // task to run fetchParams’s process response done given response, with\n // fetchParams’s task destination.\n if (fetchParams.processResponseDone != null) {\n queueMicrotask(() => fetchParams.processResponseDone(response))\n }\n}\n\n// https://fetch.spec.whatwg.org/#fetch-finale\nfunction fetchFinale (fetchParams, response) {\n // 1. Let timingInfo be fetchParams’s timing info.\n let timingInfo = fetchParams.timingInfo\n\n // 2. If response is not a network error and fetchParams’s request’s client is a secure context,\n // then set timingInfo’s server-timing headers to the result of getting, decoding, and splitting\n // `Server-Timing` from response’s internal response’s header list.\n // TODO\n\n // 3. Let processResponseEndOfBody be the following steps:\n const processResponseEndOfBody = () => {\n // 1. Let unsafeEndTime be the unsafe shared current time.\n const unsafeEndTime = Date.now() // ?\n\n // 2. If fetchParams’s request’s destination is \"document\", then set fetchParams’s controller’s\n // full timing info to fetchParams’s timing info.\n if (fetchParams.request.destination === 'document') {\n fetchParams.controller.fullTimingInfo = timingInfo\n }\n\n // 3. Set fetchParams’s controller’s report timing steps to the following steps given a global object global:\n fetchParams.controller.reportTimingSteps = () => {\n // 1. If fetchParams’s request’s URL’s scheme is not an HTTP(S) scheme, then return.\n if (fetchParams.request.url.protocol !== 'https:') {\n return\n }\n\n // 2. Set timingInfo’s end time to the relative high resolution time given unsafeEndTime and global.\n timingInfo.endTime = unsafeEndTime\n\n // 3. Let cacheState be response’s cache state.\n let cacheState = response.cacheState\n\n // 4. Let bodyInfo be response’s body info.\n const bodyInfo = response.bodyInfo\n\n // 5. If response’s timing allow passed flag is not set, then set timingInfo to the result of creating an\n // opaque timing info for timingInfo and set cacheState to the empty string.\n if (!response.timingAllowPassed) {\n timingInfo = createOpaqueTimingInfo(timingInfo)\n\n cacheState = ''\n }\n\n // 6. Let responseStatus be 0.\n let responseStatus = 0\n\n // 7. If fetchParams’s request’s mode is not \"navigate\" or response’s has-cross-origin-redirects is false:\n if (fetchParams.request.mode !== 'navigator' || !response.hasCrossOriginRedirects) {\n // 1. Set responseStatus to response’s status.\n responseStatus = response.status\n\n // 2. Let mimeType be the result of extracting a MIME type from response’s header list.\n const mimeType = extractMimeType(response.headersList)\n\n // 3. If mimeType is not failure, then set bodyInfo’s content type to the result of minimizing a supported MIME type given mimeType.\n if (mimeType !== 'failure') {\n bodyInfo.contentType = minimizeSupportedMimeType(mimeType)\n }\n }\n\n // 8. If fetchParams’s request’s initiator type is non-null, then mark resource timing given timingInfo,\n // fetchParams’s request’s URL, fetchParams’s request’s initiator type, global, cacheState, bodyInfo,\n // and responseStatus.\n if (fetchParams.request.initiatorType != null) {\n // TODO: update markresourcetiming\n markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus)\n }\n }\n\n // 4. Let processResponseEndOfBodyTask be the following steps:\n const processResponseEndOfBodyTask = () => {\n // 1. Set fetchParams’s request’s done flag.\n fetchParams.request.done = true\n\n // 2. If fetchParams’s process response end-of-body is non-null, then run fetchParams’s process\n // response end-of-body given response.\n if (fetchParams.processResponseEndOfBody != null) {\n queueMicrotask(() => fetchParams.processResponseEndOfBody(response))\n }\n\n // 3. If fetchParams’s request’s initiator type is non-null and fetchParams’s request’s client’s\n // global object is fetchParams’s task destination, then run fetchParams’s controller’s report\n // timing steps given fetchParams’s request’s client’s global object.\n if (fetchParams.request.initiatorType != null) {\n fetchParams.controller.reportTimingSteps()\n }\n }\n\n // 5. Queue a fetch task to run processResponseEndOfBodyTask with fetchParams’s task destination\n queueMicrotask(() => processResponseEndOfBodyTask())\n }\n\n // 4. If fetchParams’s process response is non-null, then queue a fetch task to run fetchParams’s\n // process response given response, with fetchParams’s task destination.\n if (fetchParams.processResponse != null) {\n queueMicrotask(() => {\n fetchParams.processResponse(response)\n fetchParams.processResponse = null\n })\n }\n\n // 5. Let internalResponse be response, if response is a network error; otherwise response’s internal response.\n const internalResponse = response.type === 'error' ? response : (response.internalResponse ?? response)\n\n // 6. If internalResponse’s body is null, then run processResponseEndOfBody.\n // 7. Otherwise:\n if (internalResponse.body == null) {\n processResponseEndOfBody()\n } else {\n // mcollina: all the following steps of the specs are skipped.\n // The internal transform stream is not needed.\n // See https://github.com/nodejs/undici/pull/3093#issuecomment-2050198541\n\n // 1. Let transformStream be a new TransformStream.\n // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, enqueues chunk in transformStream.\n // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm and flushAlgorithm\n // set to processResponseEndOfBody.\n // 4. Set internalResponse’s body’s stream to the result of internalResponse’s body’s stream piped through transformStream.\n\n finished(internalResponse.body.stream, () => {\n processResponseEndOfBody()\n })\n }\n}\n\n// https://fetch.spec.whatwg.org/#http-fetch\nasync function httpFetch (fetchParams) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let response be null.\n let response = null\n\n // 3. Let actualResponse be null.\n let actualResponse = null\n\n // 4. Let timingInfo be fetchParams’s timing info.\n const timingInfo = fetchParams.timingInfo\n\n // 5. If request’s service-workers mode is \"all\", then:\n if (request.serviceWorkers === 'all') {\n // TODO\n }\n\n // 6. If response is null, then:\n if (response === null) {\n // 1. If makeCORSPreflight is true and one of these conditions is true:\n // TODO\n\n // 2. If request’s redirect mode is \"follow\", then set request’s\n // service-workers mode to \"none\".\n if (request.redirect === 'follow') {\n request.serviceWorkers = 'none'\n }\n\n // 3. Set response and actualResponse to the result of running\n // HTTP-network-or-cache fetch given fetchParams.\n actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)\n\n // 4. If request’s response tainting is \"cors\" and a CORS check\n // for request and response returns failure, then return a network error.\n if (\n request.responseTainting === 'cors' &&\n corsCheck(request, response) === 'failure'\n ) {\n return makeNetworkError('cors failure')\n }\n\n // 5. If the TAO check for request and response returns failure, then set\n // request’s timing allow failed flag.\n if (TAOCheck(request, response) === 'failure') {\n request.timingAllowFailed = true\n }\n }\n\n // 7. If either request’s response tainting or response’s type\n // is \"opaque\", and the cross-origin resource policy check with\n // request’s origin, request’s client, request’s destination,\n // and actualResponse returns blocked, then return a network error.\n if (\n (request.responseTainting === 'opaque' || response.type === 'opaque') &&\n crossOriginResourcePolicyCheck(\n request.origin,\n request.client,\n request.destination,\n actualResponse\n ) === 'blocked'\n ) {\n return makeNetworkError('blocked')\n }\n\n // 8. If actualResponse’s status is a redirect status, then:\n if (redirectStatusSet.has(actualResponse.status)) {\n // 1. If actualResponse’s status is not 303, request’s body is not null,\n // and the connection uses HTTP/2, then user agents may, and are even\n // encouraged to, transmit an RST_STREAM frame.\n // See, https://github.com/whatwg/fetch/issues/1288\n if (request.redirect !== 'manual') {\n fetchParams.controller.connection.destroy(undefined, false)\n }\n\n // 2. Switch on request’s redirect mode:\n if (request.redirect === 'error') {\n // Set response to a network error.\n response = makeNetworkError('unexpected redirect')\n } else if (request.redirect === 'manual') {\n // Set response to an opaque-redirect filtered response whose internal\n // response is actualResponse.\n // NOTE(spec): On the web this would return an `opaqueredirect` response,\n // but that doesn't make sense server side.\n // See https://github.com/nodejs/undici/issues/1193.\n response = actualResponse\n } else if (request.redirect === 'follow') {\n // Set response to the result of running HTTP-redirect fetch given\n // fetchParams and response.\n response = await httpRedirectFetch(fetchParams, response)\n } else {\n assert(false)\n }\n }\n\n // 9. Set response’s timing info to timingInfo.\n response.timingInfo = timingInfo\n\n // 10. Return response.\n return response\n}\n\n// https://fetch.spec.whatwg.org/#http-redirect-fetch\nfunction httpRedirectFetch (fetchParams, response) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let actualResponse be response, if response is not a filtered response,\n // and response’s internal response otherwise.\n const actualResponse = response.internalResponse\n ? response.internalResponse\n : response\n\n // 3. Let locationURL be actualResponse’s location URL given request’s current\n // URL’s fragment.\n let locationURL\n\n try {\n locationURL = responseLocationURL(\n actualResponse,\n requestCurrentURL(request).hash\n )\n\n // 4. If locationURL is null, then return response.\n if (locationURL == null) {\n return response\n }\n } catch (err) {\n // 5. If locationURL is failure, then return a network error.\n return Promise.resolve(makeNetworkError(err))\n }\n\n // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network\n // error.\n if (!urlIsHttpHttpsScheme(locationURL)) {\n return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))\n }\n\n // 7. If request’s redirect count is 20, then return a network error.\n if (request.redirectCount === 20) {\n return Promise.resolve(makeNetworkError('redirect count exceeded'))\n }\n\n // 8. Increase request’s redirect count by 1.\n request.redirectCount += 1\n\n // 9. If request’s mode is \"cors\", locationURL includes credentials, and\n // request’s origin is not same origin with locationURL’s origin, then return\n // a network error.\n if (\n request.mode === 'cors' &&\n (locationURL.username || locationURL.password) &&\n !sameOrigin(request, locationURL)\n ) {\n return Promise.resolve(makeNetworkError('cross origin not allowed for request mode \"cors\"'))\n }\n\n // 10. If request’s response tainting is \"cors\" and locationURL includes\n // credentials, then return a network error.\n if (\n request.responseTainting === 'cors' &&\n (locationURL.username || locationURL.password)\n ) {\n return Promise.resolve(makeNetworkError(\n 'URL cannot contain credentials for request mode \"cors\"'\n ))\n }\n\n // 11. If actualResponse’s status is not 303, request’s body is non-null,\n // and request’s body’s source is null, then return a network error.\n if (\n actualResponse.status !== 303 &&\n request.body != null &&\n request.body.source == null\n ) {\n return Promise.resolve(makeNetworkError())\n }\n\n // 12. If one of the following is true\n // - actualResponse’s status is 301 or 302 and request’s method is `POST`\n // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`\n if (\n ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||\n (actualResponse.status === 303 &&\n !GET_OR_HEAD.includes(request.method))\n ) {\n // then:\n // 1. Set request’s method to `GET` and request’s body to null.\n request.method = 'GET'\n request.body = null\n\n // 2. For each headerName of request-body-header name, delete headerName from\n // request’s header list.\n for (const headerName of requestBodyHeader) {\n request.headersList.delete(headerName)\n }\n }\n\n // 13. If request’s current URL’s origin is not same origin with locationURL’s\n // origin, then for each headerName of CORS non-wildcard request-header name,\n // delete headerName from request’s header list.\n if (!sameOrigin(requestCurrentURL(request), locationURL)) {\n // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name\n request.headersList.delete('authorization', true)\n\n // https://fetch.spec.whatwg.org/#authentication-entries\n request.headersList.delete('proxy-authorization', true)\n\n // \"Cookie\" and \"Host\" are forbidden request-headers, which undici doesn't implement.\n request.headersList.delete('cookie', true)\n request.headersList.delete('host', true)\n }\n\n // 14. If request’s body is non-null, then set request’s body to the first return\n // value of safely extracting request’s body’s source.\n if (request.body != null) {\n assert(request.body.source != null)\n request.body = safelyExtractBody(request.body.source)[0]\n }\n\n // 15. Let timingInfo be fetchParams’s timing info.\n const timingInfo = fetchParams.timingInfo\n\n // 16. Set timingInfo’s redirect end time and post-redirect start time to the\n // coarsened shared current time given fetchParams’s cross-origin isolated\n // capability.\n timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =\n coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n\n // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s\n // redirect start time to timingInfo’s start time.\n if (timingInfo.redirectStartTime === 0) {\n timingInfo.redirectStartTime = timingInfo.startTime\n }\n\n // 18. Append locationURL to request’s URL list.\n request.urlList.push(locationURL)\n\n // 19. Invoke set request’s referrer policy on redirect on request and\n // actualResponse.\n setRequestReferrerPolicyOnRedirect(request, actualResponse)\n\n // 20. Return the result of running main fetch given fetchParams and true.\n return mainFetch(fetchParams, true)\n}\n\n// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch\nasync function httpNetworkOrCacheFetch (\n fetchParams,\n isAuthenticationFetch = false,\n isNewConnectionFetch = false\n) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let httpFetchParams be null.\n let httpFetchParams = null\n\n // 3. Let httpRequest be null.\n let httpRequest = null\n\n // 4. Let response be null.\n let response = null\n\n // 5. Let storedResponse be null.\n // TODO: cache\n\n // 6. Let httpCache be null.\n const httpCache = null\n\n // 7. Let the revalidatingFlag be unset.\n const revalidatingFlag = false\n\n // 8. Run these steps, but abort when the ongoing fetch is terminated:\n\n // 1. If request’s window is \"no-window\" and request’s redirect mode is\n // \"error\", then set httpFetchParams to fetchParams and httpRequest to\n // request.\n if (request.window === 'no-window' && request.redirect === 'error') {\n httpFetchParams = fetchParams\n httpRequest = request\n } else {\n // Otherwise:\n\n // 1. Set httpRequest to a clone of request.\n httpRequest = cloneRequest(request)\n\n // 2. Set httpFetchParams to a copy of fetchParams.\n httpFetchParams = { ...fetchParams }\n\n // 3. Set httpFetchParams’s request to httpRequest.\n httpFetchParams.request = httpRequest\n }\n\n // 3. Let includeCredentials be true if one of\n const includeCredentials =\n request.credentials === 'include' ||\n (request.credentials === 'same-origin' &&\n request.responseTainting === 'basic')\n\n // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s\n // body is non-null; otherwise null.\n const contentLength = httpRequest.body ? httpRequest.body.length : null\n\n // 5. Let contentLengthHeaderValue be null.\n let contentLengthHeaderValue = null\n\n // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or\n // `PUT`, then set contentLengthHeaderValue to `0`.\n if (\n httpRequest.body == null &&\n ['POST', 'PUT'].includes(httpRequest.method)\n ) {\n contentLengthHeaderValue = '0'\n }\n\n // 7. If contentLength is non-null, then set contentLengthHeaderValue to\n // contentLength, serialized and isomorphic encoded.\n if (contentLength != null) {\n contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)\n }\n\n // 8. If contentLengthHeaderValue is non-null, then append\n // `Content-Length`/contentLengthHeaderValue to httpRequest’s header\n // list.\n if (contentLengthHeaderValue != null) {\n httpRequest.headersList.append('content-length', contentLengthHeaderValue, true)\n }\n\n // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,\n // contentLengthHeaderValue) to httpRequest’s header list.\n\n // 10. If contentLength is non-null and httpRequest’s keepalive is true,\n // then:\n if (contentLength != null && httpRequest.keepalive) {\n // NOTE: keepalive is a noop outside of browser context.\n }\n\n // 11. If httpRequest’s referrer is a URL, then append\n // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,\n // to httpRequest’s header list.\n if (httpRequest.referrer instanceof URL) {\n httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href), true)\n }\n\n // 12. Append a request `Origin` header for httpRequest.\n appendRequestOriginHeader(httpRequest)\n\n // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]\n appendFetchMetadata(httpRequest)\n\n // 14. If httpRequest’s header list does not contain `User-Agent`, then\n // user agents should append `User-Agent`/default `User-Agent` value to\n // httpRequest’s header list.\n if (!httpRequest.headersList.contains('user-agent', true)) {\n httpRequest.headersList.append('user-agent', defaultUserAgent)\n }\n\n // 15. If httpRequest’s cache mode is \"default\" and httpRequest’s header\n // list contains `If-Modified-Since`, `If-None-Match`,\n // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set\n // httpRequest’s cache mode to \"no-store\".\n if (\n httpRequest.cache === 'default' &&\n (httpRequest.headersList.contains('if-modified-since', true) ||\n httpRequest.headersList.contains('if-none-match', true) ||\n httpRequest.headersList.contains('if-unmodified-since', true) ||\n httpRequest.headersList.contains('if-match', true) ||\n httpRequest.headersList.contains('if-range', true))\n ) {\n httpRequest.cache = 'no-store'\n }\n\n // 16. If httpRequest’s cache mode is \"no-cache\", httpRequest’s prevent\n // no-cache cache-control header modification flag is unset, and\n // httpRequest’s header list does not contain `Cache-Control`, then append\n // `Cache-Control`/`max-age=0` to httpRequest’s header list.\n if (\n httpRequest.cache === 'no-cache' &&\n !httpRequest.preventNoCacheCacheControlHeaderModification &&\n !httpRequest.headersList.contains('cache-control', true)\n ) {\n httpRequest.headersList.append('cache-control', 'max-age=0', true)\n }\n\n // 17. If httpRequest’s cache mode is \"no-store\" or \"reload\", then:\n if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {\n // 1. If httpRequest’s header list does not contain `Pragma`, then append\n // `Pragma`/`no-cache` to httpRequest’s header list.\n if (!httpRequest.headersList.contains('pragma', true)) {\n httpRequest.headersList.append('pragma', 'no-cache', true)\n }\n\n // 2. If httpRequest’s header list does not contain `Cache-Control`,\n // then append `Cache-Control`/`no-cache` to httpRequest’s header list.\n if (!httpRequest.headersList.contains('cache-control', true)) {\n httpRequest.headersList.append('cache-control', 'no-cache', true)\n }\n }\n\n // 18. If httpRequest’s header list contains `Range`, then append\n // `Accept-Encoding`/`identity` to httpRequest’s header list.\n if (httpRequest.headersList.contains('range', true)) {\n httpRequest.headersList.append('accept-encoding', 'identity', true)\n }\n\n // 19. Modify httpRequest’s header list per HTTP. Do not append a given\n // header if httpRequest’s header list contains that header’s name.\n // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129\n if (!httpRequest.headersList.contains('accept-encoding', true)) {\n if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {\n httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate', true)\n } else {\n httpRequest.headersList.append('accept-encoding', 'gzip, deflate', true)\n }\n }\n\n httpRequest.headersList.delete('host', true)\n\n // 20. If includeCredentials is true, then:\n if (includeCredentials) {\n // 1. If the user agent is not configured to block cookies for httpRequest\n // (see section 7 of [COOKIES]), then:\n // TODO: credentials\n // 2. If httpRequest’s header list does not contain `Authorization`, then:\n // TODO: credentials\n }\n\n // 21. If there’s a proxy-authentication entry, use it as appropriate.\n // TODO: proxy-authentication\n\n // 22. Set httpCache to the result of determining the HTTP cache\n // partition, given httpRequest.\n // TODO: cache\n\n // 23. If httpCache is null, then set httpRequest’s cache mode to\n // \"no-store\".\n if (httpCache == null) {\n httpRequest.cache = 'no-store'\n }\n\n // 24. If httpRequest’s cache mode is neither \"no-store\" nor \"reload\",\n // then:\n if (httpRequest.cache !== 'no-store' && httpRequest.cache !== 'reload') {\n // TODO: cache\n }\n\n // 9. If aborted, then return the appropriate network error for fetchParams.\n // TODO\n\n // 10. If response is null, then:\n if (response == null) {\n // 1. If httpRequest’s cache mode is \"only-if-cached\", then return a\n // network error.\n if (httpRequest.cache === 'only-if-cached') {\n return makeNetworkError('only if cached')\n }\n\n // 2. Let forwardResponse be the result of running HTTP-network fetch\n // given httpFetchParams, includeCredentials, and isNewConnectionFetch.\n const forwardResponse = await httpNetworkFetch(\n httpFetchParams,\n includeCredentials,\n isNewConnectionFetch\n )\n\n // 3. If httpRequest’s method is unsafe and forwardResponse’s status is\n // in the range 200 to 399, inclusive, invalidate appropriate stored\n // responses in httpCache, as per the \"Invalidation\" chapter of HTTP\n // Caching, and set storedResponse to null. [HTTP-CACHING]\n if (\n !safeMethodsSet.has(httpRequest.method) &&\n forwardResponse.status >= 200 &&\n forwardResponse.status <= 399\n ) {\n // TODO: cache\n }\n\n // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,\n // then:\n if (revalidatingFlag && forwardResponse.status === 304) {\n // TODO: cache\n }\n\n // 5. If response is null, then:\n if (response == null) {\n // 1. Set response to forwardResponse.\n response = forwardResponse\n\n // 2. Store httpRequest and forwardResponse in httpCache, as per the\n // \"Storing Responses in Caches\" chapter of HTTP Caching. [HTTP-CACHING]\n // TODO: cache\n }\n }\n\n // 11. Set response’s URL list to a clone of httpRequest’s URL list.\n response.urlList = [...httpRequest.urlList]\n\n // 12. If httpRequest’s header list contains `Range`, then set response’s\n // range-requested flag.\n if (httpRequest.headersList.contains('range', true)) {\n response.rangeRequested = true\n }\n\n // 13. Set response’s request-includes-credentials to includeCredentials.\n response.requestIncludesCredentials = includeCredentials\n\n // 14. If response’s status is 401, httpRequest’s response tainting is not\n // \"cors\", includeCredentials is true, and request’s window is an environment\n // settings object, then:\n // TODO\n\n // 15. If response’s status is 407, then:\n if (response.status === 407) {\n // 1. If request’s window is \"no-window\", then return a network error.\n if (request.window === 'no-window') {\n return makeNetworkError()\n }\n\n // 2. ???\n\n // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n if (isCancelled(fetchParams)) {\n return makeAppropriateNetworkError(fetchParams)\n }\n\n // 4. Prompt the end user as appropriate in request’s window and store\n // the result as a proxy-authentication entry. [HTTP-AUTH]\n // TODO: Invoke some kind of callback?\n\n // 5. Set response to the result of running HTTP-network-or-cache fetch given\n // fetchParams.\n // TODO\n return makeNetworkError('proxy authentication required')\n }\n\n // 16. If all of the following are true\n if (\n // response’s status is 421\n response.status === 421 &&\n // isNewConnectionFetch is false\n !isNewConnectionFetch &&\n // request’s body is null, or request’s body is non-null and request’s body’s source is non-null\n (request.body == null || request.body.source != null)\n ) {\n // then:\n\n // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n if (isCancelled(fetchParams)) {\n return makeAppropriateNetworkError(fetchParams)\n }\n\n // 2. Set response to the result of running HTTP-network-or-cache\n // fetch given fetchParams, isAuthenticationFetch, and true.\n\n // TODO (spec): The spec doesn't specify this but we need to cancel\n // the active response before we can start a new one.\n // https://github.com/whatwg/fetch/issues/1293\n fetchParams.controller.connection.destroy()\n\n response = await httpNetworkOrCacheFetch(\n fetchParams,\n isAuthenticationFetch,\n true\n )\n }\n\n // 17. If isAuthenticationFetch is true, then create an authentication entry\n if (isAuthenticationFetch) {\n // TODO\n }\n\n // 18. Return response.\n return response\n}\n\n// https://fetch.spec.whatwg.org/#http-network-fetch\nasync function httpNetworkFetch (\n fetchParams,\n includeCredentials = false,\n forceNewConnection = false\n) {\n assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)\n\n fetchParams.controller.connection = {\n abort: null,\n destroyed: false,\n destroy (err, abort = true) {\n if (!this.destroyed) {\n this.destroyed = true\n if (abort) {\n this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))\n }\n }\n }\n }\n\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let response be null.\n let response = null\n\n // 3. Let timingInfo be fetchParams’s timing info.\n const timingInfo = fetchParams.timingInfo\n\n // 4. Let httpCache be the result of determining the HTTP cache partition,\n // given request.\n // TODO: cache\n const httpCache = null\n\n // 5. If httpCache is null, then set request’s cache mode to \"no-store\".\n if (httpCache == null) {\n request.cache = 'no-store'\n }\n\n // 6. Let networkPartitionKey be the result of determining the network\n // partition key given request.\n // TODO\n\n // 7. Let newConnection be \"yes\" if forceNewConnection is true; otherwise\n // \"no\".\n const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars\n\n // 8. Switch on request’s mode:\n if (request.mode === 'websocket') {\n // Let connection be the result of obtaining a WebSocket connection,\n // given request’s current URL.\n // TODO\n } else {\n // Let connection be the result of obtaining a connection, given\n // networkPartitionKey, request’s current URL’s origin,\n // includeCredentials, and forceNewConnection.\n // TODO\n }\n\n // 9. Run these steps, but abort when the ongoing fetch is terminated:\n\n // 1. If connection is failure, then return a network error.\n\n // 2. Set timingInfo’s final connection timing info to the result of\n // calling clamp and coarsen connection timing info with connection’s\n // timing info, timingInfo’s post-redirect start time, and fetchParams’s\n // cross-origin isolated capability.\n\n // 3. If connection is not an HTTP/2 connection, request’s body is non-null,\n // and request’s body’s source is null, then append (`Transfer-Encoding`,\n // `chunked`) to request’s header list.\n\n // 4. Set timingInfo’s final network-request start time to the coarsened\n // shared current time given fetchParams’s cross-origin isolated\n // capability.\n\n // 5. Set response to the result of making an HTTP request over connection\n // using request with the following caveats:\n\n // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]\n // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]\n\n // - If request’s body is non-null, and request’s body’s source is null,\n // then the user agent may have a buffer of up to 64 kibibytes and store\n // a part of request’s body in that buffer. If the user agent reads from\n // request’s body beyond that buffer’s size and the user agent needs to\n // resend request, then instead return a network error.\n\n // - Set timingInfo’s final network-response start time to the coarsened\n // shared current time given fetchParams’s cross-origin isolated capability,\n // immediately after the user agent’s HTTP parser receives the first byte\n // of the response (e.g., frame header bytes for HTTP/2 or response status\n // line for HTTP/1.x).\n\n // - Wait until all the headers are transmitted.\n\n // - Any responses whose status is in the range 100 to 199, inclusive,\n // and is not 101, are to be ignored, except for the purposes of setting\n // timingInfo’s final network-response start time above.\n\n // - If request’s header list contains `Transfer-Encoding`/`chunked` and\n // response is transferred via HTTP/1.0 or older, then return a network\n // error.\n\n // - If the HTTP request results in a TLS client certificate dialog, then:\n\n // 1. If request’s window is an environment settings object, make the\n // dialog available in request’s window.\n\n // 2. Otherwise, return a network error.\n\n // To transmit request’s body body, run these steps:\n let requestBody = null\n // 1. If body is null and fetchParams’s process request end-of-body is\n // non-null, then queue a fetch task given fetchParams’s process request\n // end-of-body and fetchParams’s task destination.\n if (request.body == null && fetchParams.processRequestEndOfBody) {\n queueMicrotask(() => fetchParams.processRequestEndOfBody())\n } else if (request.body != null) {\n // 2. Otherwise, if body is non-null:\n\n // 1. Let processBodyChunk given bytes be these steps:\n const processBodyChunk = async function * (bytes) {\n // 1. If the ongoing fetch is terminated, then abort these steps.\n if (isCancelled(fetchParams)) {\n return\n }\n\n // 2. Run this step in parallel: transmit bytes.\n yield bytes\n\n // 3. If fetchParams’s process request body is non-null, then run\n // fetchParams’s process request body given bytes’s length.\n fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)\n }\n\n // 2. Let processEndOfBody be these steps:\n const processEndOfBody = () => {\n // 1. If fetchParams is canceled, then abort these steps.\n if (isCancelled(fetchParams)) {\n return\n }\n\n // 2. If fetchParams’s process request end-of-body is non-null,\n // then run fetchParams’s process request end-of-body.\n if (fetchParams.processRequestEndOfBody) {\n fetchParams.processRequestEndOfBody()\n }\n }\n\n // 3. Let processBodyError given e be these steps:\n const processBodyError = (e) => {\n // 1. If fetchParams is canceled, then abort these steps.\n if (isCancelled(fetchParams)) {\n return\n }\n\n // 2. If e is an \"AbortError\" DOMException, then abort fetchParams’s controller.\n if (e.name === 'AbortError') {\n fetchParams.controller.abort()\n } else {\n fetchParams.controller.terminate(e)\n }\n }\n\n // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,\n // processBodyError, and fetchParams’s task destination.\n requestBody = (async function * () {\n try {\n for await (const bytes of request.body.stream) {\n yield * processBodyChunk(bytes)\n }\n processEndOfBody()\n } catch (err) {\n processBodyError(err)\n }\n })()\n }\n\n try {\n // socket is only provided for websockets\n const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })\n\n if (socket) {\n response = makeResponse({ status, statusText, headersList, socket })\n } else {\n const iterator = body[Symbol.asyncIterator]()\n fetchParams.controller.next = () => iterator.next()\n\n response = makeResponse({ status, statusText, headersList })\n }\n } catch (err) {\n // 10. If aborted, then:\n if (err.name === 'AbortError') {\n // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n fetchParams.controller.connection.destroy()\n\n // 2. Return the appropriate network error for fetchParams.\n return makeAppropriateNetworkError(fetchParams, err)\n }\n\n return makeNetworkError(err)\n }\n\n // 11. Let pullAlgorithm be an action that resumes the ongoing fetch\n // if it is suspended.\n const pullAlgorithm = async () => {\n await fetchParams.controller.resume()\n }\n\n // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s\n // controller with reason, given reason.\n const cancelAlgorithm = (reason) => {\n // If the aborted fetch was already terminated, then we do not\n // need to do anything.\n if (!isCancelled(fetchParams)) {\n fetchParams.controller.abort(reason)\n }\n }\n\n // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by\n // the user agent.\n // TODO\n\n // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object\n // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.\n // TODO\n\n // 15. Let stream be a new ReadableStream.\n // 16. Set up stream with byte reading support with pullAlgorithm set to pullAlgorithm,\n // cancelAlgorithm set to cancelAlgorithm.\n const stream = new ReadableStream(\n {\n async start (controller) {\n fetchParams.controller.controller = controller\n },\n async pull (controller) {\n await pullAlgorithm(controller)\n },\n async cancel (reason) {\n await cancelAlgorithm(reason)\n },\n type: 'bytes'\n }\n )\n\n // 17. Run these steps, but abort when the ongoing fetch is terminated:\n\n // 1. Set response’s body to a new body whose stream is stream.\n response.body = { stream, source: null, length: null }\n\n // 2. If response is not a network error and request’s cache mode is\n // not \"no-store\", then update response in httpCache for request.\n // TODO\n\n // 3. If includeCredentials is true and the user agent is not configured\n // to block cookies for request (see section 7 of [COOKIES]), then run the\n // \"set-cookie-string\" parsing algorithm (see section 5.2 of [COOKIES]) on\n // the value of each header whose name is a byte-case-insensitive match for\n // `Set-Cookie` in response’s header list, if any, and request’s current URL.\n // TODO\n\n // 18. If aborted, then:\n // TODO\n\n // 19. Run these steps in parallel:\n\n // 1. Run these steps, but abort when fetchParams is canceled:\n fetchParams.controller.onAborted = onAborted\n fetchParams.controller.on('terminated', onAborted)\n fetchParams.controller.resume = async () => {\n // 1. While true\n while (true) {\n // 1-3. See onData...\n\n // 4. Set bytes to the result of handling content codings given\n // codings and bytes.\n let bytes\n let isFailure\n try {\n const { done, value } = await fetchParams.controller.next()\n\n if (isAborted(fetchParams)) {\n break\n }\n\n bytes = done ? undefined : value\n } catch (err) {\n if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {\n // zlib doesn't like empty streams.\n bytes = undefined\n } else {\n bytes = err\n\n // err may be propagated from the result of calling readablestream.cancel,\n // which might not be an error. https://github.com/nodejs/undici/issues/2009\n isFailure = true\n }\n }\n\n if (bytes === undefined) {\n // 2. Otherwise, if the bytes transmission for response’s message\n // body is done normally and stream is readable, then close\n // stream, finalize response for fetchParams and response, and\n // abort these in-parallel steps.\n readableStreamClose(fetchParams.controller.controller)\n\n finalizeResponse(fetchParams, response)\n\n return\n }\n\n // 5. Increase timingInfo’s decoded body size by bytes’s length.\n timingInfo.decodedBodySize += bytes?.byteLength ?? 0\n\n // 6. If bytes is failure, then terminate fetchParams’s controller.\n if (isFailure) {\n fetchParams.controller.terminate(bytes)\n return\n }\n\n // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes\n // into stream.\n const buffer = new Uint8Array(bytes)\n if (buffer.byteLength) {\n fetchParams.controller.controller.enqueue(buffer)\n }\n\n // 8. If stream is errored, then terminate the ongoing fetch.\n if (isErrored(stream)) {\n fetchParams.controller.terminate()\n return\n }\n\n // 9. If stream doesn’t need more data ask the user agent to suspend\n // the ongoing fetch.\n if (fetchParams.controller.controller.desiredSize <= 0) {\n return\n }\n }\n }\n\n // 2. If aborted, then:\n function onAborted (reason) {\n // 2. If fetchParams is aborted, then:\n if (isAborted(fetchParams)) {\n // 1. Set response’s aborted flag.\n response.aborted = true\n\n // 2. If stream is readable, then error stream with the result of\n // deserialize a serialized abort reason given fetchParams’s\n // controller’s serialized abort reason and an\n // implementation-defined realm.\n if (isReadable(stream)) {\n fetchParams.controller.controller.error(\n fetchParams.controller.serializedAbortReason\n )\n }\n } else {\n // 3. Otherwise, if stream is readable, error stream with a TypeError.\n if (isReadable(stream)) {\n fetchParams.controller.controller.error(new TypeError('terminated', {\n cause: isErrorLike(reason) ? reason : undefined\n }))\n }\n }\n\n // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.\n fetchParams.controller.connection.destroy()\n }\n\n // 20. Return response.\n return response\n\n function dispatch ({ body }) {\n const url = requestCurrentURL(request)\n /** @type {import('../..').Agent} */\n const agent = fetchParams.controller.dispatcher\n\n return new Promise((resolve, reject) => agent.dispatch(\n {\n path: url.pathname + url.search,\n origin: url.origin,\n method: request.method,\n body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,\n headers: request.headersList.entries,\n maxRedirections: 0,\n upgrade: request.mode === 'websocket' ? 'websocket' : undefined\n },\n {\n body: null,\n abort: null,\n\n onConnect (abort) {\n // TODO (fix): Do we need connection here?\n const { connection } = fetchParams.controller\n\n // Set timingInfo’s final connection timing info to the result of calling clamp and coarsen\n // connection timing info with connection’s timing info, timingInfo’s post-redirect start\n // time, and fetchParams’s cross-origin isolated capability.\n // TODO: implement connection timing\n timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(undefined, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability)\n\n if (connection.destroyed) {\n abort(new DOMException('The operation was aborted.', 'AbortError'))\n } else {\n fetchParams.controller.on('terminated', abort)\n this.abort = connection.abort = abort\n }\n\n // Set timingInfo’s final network-request start time to the coarsened shared current time given\n // fetchParams’s cross-origin isolated capability.\n timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n },\n\n onResponseStarted () {\n // Set timingInfo’s final network-response start time to the coarsened shared current\n // time given fetchParams’s cross-origin isolated capability, immediately after the\n // user agent’s HTTP parser receives the first byte of the response (e.g., frame header\n // bytes for HTTP/2 or response status line for HTTP/1.x).\n timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n },\n\n onHeaders (status, rawHeaders, resume, statusText) {\n if (status < 200) {\n return\n }\n\n let location = ''\n\n const headersList = new HeadersList()\n\n for (let i = 0; i < rawHeaders.length; i += 2) {\n headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)\n }\n location = headersList.get('location', true)\n\n this.body = new Readable({ read: resume })\n\n const decoders = []\n\n const willFollow = location && request.redirect === 'follow' &&\n redirectStatusSet.has(status)\n\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding\n if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {\n // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1\n const contentEncoding = headersList.get('content-encoding', true)\n // \"All content-coding values are case-insensitive...\"\n /** @type {string[]} */\n const codings = contentEncoding ? contentEncoding.toLowerCase().split(',') : []\n\n // Limit the number of content-encodings to prevent resource exhaustion.\n // CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).\n const maxContentEncodings = 5\n if (codings.length > maxContentEncodings) {\n reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))\n return true\n }\n\n for (let i = codings.length - 1; i >= 0; --i) {\n const coding = codings[i].trim()\n // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2\n if (coding === 'x-gzip' || coding === 'gzip') {\n decoders.push(zlib.createGunzip({\n // Be less strict when decoding compressed responses, since sometimes\n // servers send slightly invalid responses that are still accepted\n // by common browsers.\n // Always using Z_SYNC_FLUSH is what cURL does.\n flush: zlib.constants.Z_SYNC_FLUSH,\n finishFlush: zlib.constants.Z_SYNC_FLUSH\n }))\n } else if (coding === 'deflate') {\n decoders.push(createInflate({\n flush: zlib.constants.Z_SYNC_FLUSH,\n finishFlush: zlib.constants.Z_SYNC_FLUSH\n }))\n } else if (coding === 'br') {\n decoders.push(zlib.createBrotliDecompress({\n flush: zlib.constants.BROTLI_OPERATION_FLUSH,\n finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH\n }))\n } else {\n decoders.length = 0\n break\n }\n }\n }\n\n const onError = this.onError.bind(this)\n\n resolve({\n status,\n statusText,\n headersList,\n body: decoders.length\n ? pipeline(this.body, ...decoders, (err) => {\n if (err) {\n this.onError(err)\n }\n }).on('error', onError)\n : this.body.on('error', onError)\n })\n\n return true\n },\n\n onData (chunk) {\n if (fetchParams.controller.dump) {\n return\n }\n\n // 1. If one or more bytes have been transmitted from response’s\n // message body, then:\n\n // 1. Let bytes be the transmitted bytes.\n const bytes = chunk\n\n // 2. Let codings be the result of extracting header list values\n // given `Content-Encoding` and response’s header list.\n // See pullAlgorithm.\n\n // 3. Increase timingInfo’s encoded body size by bytes’s length.\n timingInfo.encodedBodySize += bytes.byteLength\n\n // 4. See pullAlgorithm...\n\n return this.body.push(bytes)\n },\n\n onComplete () {\n if (this.abort) {\n fetchParams.controller.off('terminated', this.abort)\n }\n\n if (fetchParams.controller.onAborted) {\n fetchParams.controller.off('terminated', fetchParams.controller.onAborted)\n }\n\n fetchParams.controller.ended = true\n\n this.body.push(null)\n },\n\n onError (error) {\n if (this.abort) {\n fetchParams.controller.off('terminated', this.abort)\n }\n\n this.body?.destroy(error)\n\n fetchParams.controller.terminate(error)\n\n reject(error)\n },\n\n onUpgrade (status, rawHeaders, socket) {\n if (status !== 101) {\n return\n }\n\n const headersList = new HeadersList()\n\n for (let i = 0; i < rawHeaders.length; i += 2) {\n headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)\n }\n\n resolve({\n status,\n statusText: STATUS_CODES[status],\n headersList,\n socket\n })\n\n return true\n }\n }\n ))\n }\n}\n\nmodule.exports = {\n fetch,\n Fetch,\n fetching,\n finalizeAndReportTiming\n}\n","'use strict'\n\nmodule.exports = {\n kState: Symbol('FileReader state'),\n kResult: Symbol('FileReader result'),\n kError: Symbol('FileReader error'),\n kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),\n kEvents: Symbol('FileReader events'),\n kAborted: Symbol('FileReader aborted')\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\n\nconst kState = Symbol('ProgressEvent state')\n\n/**\n * @see https://xhr.spec.whatwg.org/#progressevent\n */\nclass ProgressEvent extends Event {\n constructor (type, eventInitDict = {}) {\n type = webidl.converters.DOMString(type, 'ProgressEvent constructor', 'type')\n eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})\n\n super(type, eventInitDict)\n\n this[kState] = {\n lengthComputable: eventInitDict.lengthComputable,\n loaded: eventInitDict.loaded,\n total: eventInitDict.total\n }\n }\n\n get lengthComputable () {\n webidl.brandCheck(this, ProgressEvent)\n\n return this[kState].lengthComputable\n }\n\n get loaded () {\n webidl.brandCheck(this, ProgressEvent)\n\n return this[kState].loaded\n }\n\n get total () {\n webidl.brandCheck(this, ProgressEvent)\n\n return this[kState].total\n }\n}\n\nwebidl.converters.ProgressEventInit = webidl.dictionaryConverter([\n {\n key: 'lengthComputable',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'loaded',\n converter: webidl.converters['unsigned long long'],\n defaultValue: () => 0\n },\n {\n key: 'total',\n converter: webidl.converters['unsigned long long'],\n defaultValue: () => 0\n },\n {\n key: 'bubbles',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'cancelable',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'composed',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n }\n])\n\nmodule.exports = {\n ProgressEvent\n}\n","'use strict'\n\n/**\n * @see https://encoding.spec.whatwg.org/#concept-encoding-get\n * @param {string|undefined} label\n */\nfunction getEncoding (label) {\n if (!label) {\n return 'failure'\n }\n\n // 1. Remove any leading and trailing ASCII whitespace from label.\n // 2. If label is an ASCII case-insensitive match for any of the\n // labels listed in the table below, then return the\n // corresponding encoding; otherwise return failure.\n switch (label.trim().toLowerCase()) {\n case 'unicode-1-1-utf-8':\n case 'unicode11utf8':\n case 'unicode20utf8':\n case 'utf-8':\n case 'utf8':\n case 'x-unicode20utf8':\n return 'UTF-8'\n case '866':\n case 'cp866':\n case 'csibm866':\n case 'ibm866':\n return 'IBM866'\n case 'csisolatin2':\n case 'iso-8859-2':\n case 'iso-ir-101':\n case 'iso8859-2':\n case 'iso88592':\n case 'iso_8859-2':\n case 'iso_8859-2:1987':\n case 'l2':\n case 'latin2':\n return 'ISO-8859-2'\n case 'csisolatin3':\n case 'iso-8859-3':\n case 'iso-ir-109':\n case 'iso8859-3':\n case 'iso88593':\n case 'iso_8859-3':\n case 'iso_8859-3:1988':\n case 'l3':\n case 'latin3':\n return 'ISO-8859-3'\n case 'csisolatin4':\n case 'iso-8859-4':\n case 'iso-ir-110':\n case 'iso8859-4':\n case 'iso88594':\n case 'iso_8859-4':\n case 'iso_8859-4:1988':\n case 'l4':\n case 'latin4':\n return 'ISO-8859-4'\n case 'csisolatincyrillic':\n case 'cyrillic':\n case 'iso-8859-5':\n case 'iso-ir-144':\n case 'iso8859-5':\n case 'iso88595':\n case 'iso_8859-5':\n case 'iso_8859-5:1988':\n return 'ISO-8859-5'\n case 'arabic':\n case 'asmo-708':\n case 'csiso88596e':\n case 'csiso88596i':\n case 'csisolatinarabic':\n case 'ecma-114':\n case 'iso-8859-6':\n case 'iso-8859-6-e':\n case 'iso-8859-6-i':\n case 'iso-ir-127':\n case 'iso8859-6':\n case 'iso88596':\n case 'iso_8859-6':\n case 'iso_8859-6:1987':\n return 'ISO-8859-6'\n case 'csisolatingreek':\n case 'ecma-118':\n case 'elot_928':\n case 'greek':\n case 'greek8':\n case 'iso-8859-7':\n case 'iso-ir-126':\n case 'iso8859-7':\n case 'iso88597':\n case 'iso_8859-7':\n case 'iso_8859-7:1987':\n case 'sun_eu_greek':\n return 'ISO-8859-7'\n case 'csiso88598e':\n case 'csisolatinhebrew':\n case 'hebrew':\n case 'iso-8859-8':\n case 'iso-8859-8-e':\n case 'iso-ir-138':\n case 'iso8859-8':\n case 'iso88598':\n case 'iso_8859-8':\n case 'iso_8859-8:1988':\n case 'visual':\n return 'ISO-8859-8'\n case 'csiso88598i':\n case 'iso-8859-8-i':\n case 'logical':\n return 'ISO-8859-8-I'\n case 'csisolatin6':\n case 'iso-8859-10':\n case 'iso-ir-157':\n case 'iso8859-10':\n case 'iso885910':\n case 'l6':\n case 'latin6':\n return 'ISO-8859-10'\n case 'iso-8859-13':\n case 'iso8859-13':\n case 'iso885913':\n return 'ISO-8859-13'\n case 'iso-8859-14':\n case 'iso8859-14':\n case 'iso885914':\n return 'ISO-8859-14'\n case 'csisolatin9':\n case 'iso-8859-15':\n case 'iso8859-15':\n case 'iso885915':\n case 'iso_8859-15':\n case 'l9':\n return 'ISO-8859-15'\n case 'iso-8859-16':\n return 'ISO-8859-16'\n case 'cskoi8r':\n case 'koi':\n case 'koi8':\n case 'koi8-r':\n case 'koi8_r':\n return 'KOI8-R'\n case 'koi8-ru':\n case 'koi8-u':\n return 'KOI8-U'\n case 'csmacintosh':\n case 'mac':\n case 'macintosh':\n case 'x-mac-roman':\n return 'macintosh'\n case 'iso-8859-11':\n case 'iso8859-11':\n case 'iso885911':\n case 'tis-620':\n case 'windows-874':\n return 'windows-874'\n case 'cp1250':\n case 'windows-1250':\n case 'x-cp1250':\n return 'windows-1250'\n case 'cp1251':\n case 'windows-1251':\n case 'x-cp1251':\n return 'windows-1251'\n case 'ansi_x3.4-1968':\n case 'ascii':\n case 'cp1252':\n case 'cp819':\n case 'csisolatin1':\n case 'ibm819':\n case 'iso-8859-1':\n case 'iso-ir-100':\n case 'iso8859-1':\n case 'iso88591':\n case 'iso_8859-1':\n case 'iso_8859-1:1987':\n case 'l1':\n case 'latin1':\n case 'us-ascii':\n case 'windows-1252':\n case 'x-cp1252':\n return 'windows-1252'\n case 'cp1253':\n case 'windows-1253':\n case 'x-cp1253':\n return 'windows-1253'\n case 'cp1254':\n case 'csisolatin5':\n case 'iso-8859-9':\n case 'iso-ir-148':\n case 'iso8859-9':\n case 'iso88599':\n case 'iso_8859-9':\n case 'iso_8859-9:1989':\n case 'l5':\n case 'latin5':\n case 'windows-1254':\n case 'x-cp1254':\n return 'windows-1254'\n case 'cp1255':\n case 'windows-1255':\n case 'x-cp1255':\n return 'windows-1255'\n case 'cp1256':\n case 'windows-1256':\n case 'x-cp1256':\n return 'windows-1256'\n case 'cp1257':\n case 'windows-1257':\n case 'x-cp1257':\n return 'windows-1257'\n case 'cp1258':\n case 'windows-1258':\n case 'x-cp1258':\n return 'windows-1258'\n case 'x-mac-cyrillic':\n case 'x-mac-ukrainian':\n return 'x-mac-cyrillic'\n case 'chinese':\n case 'csgb2312':\n case 'csiso58gb231280':\n case 'gb2312':\n case 'gb_2312':\n case 'gb_2312-80':\n case 'gbk':\n case 'iso-ir-58':\n case 'x-gbk':\n return 'GBK'\n case 'gb18030':\n return 'gb18030'\n case 'big5':\n case 'big5-hkscs':\n case 'cn-big5':\n case 'csbig5':\n case 'x-x-big5':\n return 'Big5'\n case 'cseucpkdfmtjapanese':\n case 'euc-jp':\n case 'x-euc-jp':\n return 'EUC-JP'\n case 'csiso2022jp':\n case 'iso-2022-jp':\n return 'ISO-2022-JP'\n case 'csshiftjis':\n case 'ms932':\n case 'ms_kanji':\n case 'shift-jis':\n case 'shift_jis':\n case 'sjis':\n case 'windows-31j':\n case 'x-sjis':\n return 'Shift_JIS'\n case 'cseuckr':\n case 'csksc56011987':\n case 'euc-kr':\n case 'iso-ir-149':\n case 'korean':\n case 'ks_c_5601-1987':\n case 'ks_c_5601-1989':\n case 'ksc5601':\n case 'ksc_5601':\n case 'windows-949':\n return 'EUC-KR'\n case 'csiso2022kr':\n case 'hz-gb-2312':\n case 'iso-2022-cn':\n case 'iso-2022-cn-ext':\n case 'iso-2022-kr':\n case 'replacement':\n return 'replacement'\n case 'unicodefffe':\n case 'utf-16be':\n return 'UTF-16BE'\n case 'csunicode':\n case 'iso-10646-ucs-2':\n case 'ucs-2':\n case 'unicode':\n case 'unicodefeff':\n case 'utf-16':\n case 'utf-16le':\n return 'UTF-16LE'\n case 'x-user-defined':\n return 'x-user-defined'\n default: return 'failure'\n }\n}\n\nmodule.exports = {\n getEncoding\n}\n","'use strict'\n\nconst {\n kState,\n kError,\n kResult,\n kAborted,\n kLastProgressEventFired\n} = require('./symbols')\nconst { ProgressEvent } = require('./progressevent')\nconst { getEncoding } = require('./encoding')\nconst { serializeAMimeType, parseMIMEType } = require('../fetch/data-url')\nconst { types } = require('node:util')\nconst { StringDecoder } = require('string_decoder')\nconst { btoa } = require('node:buffer')\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n enumerable: true,\n writable: false,\n configurable: false\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#readOperation\n * @param {import('./filereader').FileReader} fr\n * @param {import('buffer').Blob} blob\n * @param {string} type\n * @param {string?} encodingName\n */\nfunction readOperation (fr, blob, type, encodingName) {\n // 1. If fr’s state is \"loading\", throw an InvalidStateError\n // DOMException.\n if (fr[kState] === 'loading') {\n throw new DOMException('Invalid state', 'InvalidStateError')\n }\n\n // 2. Set fr’s state to \"loading\".\n fr[kState] = 'loading'\n\n // 3. Set fr’s result to null.\n fr[kResult] = null\n\n // 4. Set fr’s error to null.\n fr[kError] = null\n\n // 5. Let stream be the result of calling get stream on blob.\n /** @type {import('stream/web').ReadableStream} */\n const stream = blob.stream()\n\n // 6. Let reader be the result of getting a reader from stream.\n const reader = stream.getReader()\n\n // 7. Let bytes be an empty byte sequence.\n /** @type {Uint8Array[]} */\n const bytes = []\n\n // 8. Let chunkPromise be the result of reading a chunk from\n // stream with reader.\n let chunkPromise = reader.read()\n\n // 9. Let isFirstChunk be true.\n let isFirstChunk = true\n\n // 10. In parallel, while true:\n // Note: \"In parallel\" just means non-blocking\n // Note 2: readOperation itself cannot be async as double\n // reading the body would then reject the promise, instead\n // of throwing an error.\n ;(async () => {\n while (!fr[kAborted]) {\n // 1. Wait for chunkPromise to be fulfilled or rejected.\n try {\n const { done, value } = await chunkPromise\n\n // 2. If chunkPromise is fulfilled, and isFirstChunk is\n // true, queue a task to fire a progress event called\n // loadstart at fr.\n if (isFirstChunk && !fr[kAborted]) {\n queueMicrotask(() => {\n fireAProgressEvent('loadstart', fr)\n })\n }\n\n // 3. Set isFirstChunk to false.\n isFirstChunk = false\n\n // 4. If chunkPromise is fulfilled with an object whose\n // done property is false and whose value property is\n // a Uint8Array object, run these steps:\n if (!done && types.isUint8Array(value)) {\n // 1. Let bs be the byte sequence represented by the\n // Uint8Array object.\n\n // 2. Append bs to bytes.\n bytes.push(value)\n\n // 3. If roughly 50ms have passed since these steps\n // were last invoked, queue a task to fire a\n // progress event called progress at fr.\n if (\n (\n fr[kLastProgressEventFired] === undefined ||\n Date.now() - fr[kLastProgressEventFired] >= 50\n ) &&\n !fr[kAborted]\n ) {\n fr[kLastProgressEventFired] = Date.now()\n queueMicrotask(() => {\n fireAProgressEvent('progress', fr)\n })\n }\n\n // 4. Set chunkPromise to the result of reading a\n // chunk from stream with reader.\n chunkPromise = reader.read()\n } else if (done) {\n // 5. Otherwise, if chunkPromise is fulfilled with an\n // object whose done property is true, queue a task\n // to run the following steps and abort this algorithm:\n queueMicrotask(() => {\n // 1. Set fr’s state to \"done\".\n fr[kState] = 'done'\n\n // 2. Let result be the result of package data given\n // bytes, type, blob’s type, and encodingName.\n try {\n const result = packageData(bytes, type, blob.type, encodingName)\n\n // 4. Else:\n\n if (fr[kAborted]) {\n return\n }\n\n // 1. Set fr’s result to result.\n fr[kResult] = result\n\n // 2. Fire a progress event called load at the fr.\n fireAProgressEvent('load', fr)\n } catch (error) {\n // 3. If package data threw an exception error:\n\n // 1. Set fr’s error to error.\n fr[kError] = error\n\n // 2. Fire a progress event called error at fr.\n fireAProgressEvent('error', fr)\n }\n\n // 5. If fr’s state is not \"loading\", fire a progress\n // event called loadend at the fr.\n if (fr[kState] !== 'loading') {\n fireAProgressEvent('loadend', fr)\n }\n })\n\n break\n }\n } catch (error) {\n if (fr[kAborted]) {\n return\n }\n\n // 6. Otherwise, if chunkPromise is rejected with an\n // error error, queue a task to run the following\n // steps and abort this algorithm:\n queueMicrotask(() => {\n // 1. Set fr’s state to \"done\".\n fr[kState] = 'done'\n\n // 2. Set fr’s error to error.\n fr[kError] = error\n\n // 3. Fire a progress event called error at fr.\n fireAProgressEvent('error', fr)\n\n // 4. If fr’s state is not \"loading\", fire a progress\n // event called loadend at fr.\n if (fr[kState] !== 'loading') {\n fireAProgressEvent('loadend', fr)\n }\n })\n\n break\n }\n }\n })()\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#fire-a-progress-event\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e The name of the event\n * @param {import('./filereader').FileReader} reader\n */\nfunction fireAProgressEvent (e, reader) {\n // The progress event e does not bubble. e.bubbles must be false\n // The progress event e is NOT cancelable. e.cancelable must be false\n const event = new ProgressEvent(e, {\n bubbles: false,\n cancelable: false\n })\n\n reader.dispatchEvent(event)\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#blob-package-data\n * @param {Uint8Array[]} bytes\n * @param {string} type\n * @param {string?} mimeType\n * @param {string?} encodingName\n */\nfunction packageData (bytes, type, mimeType, encodingName) {\n // 1. A Blob has an associated package data algorithm, given\n // bytes, a type, a optional mimeType, and a optional\n // encodingName, which switches on type and runs the\n // associated steps:\n\n switch (type) {\n case 'DataURL': {\n // 1. Return bytes as a DataURL [RFC2397] subject to\n // the considerations below:\n // * Use mimeType as part of the Data URL if it is\n // available in keeping with the Data URL\n // specification [RFC2397].\n // * If mimeType is not available return a Data URL\n // without a media-type. [RFC2397].\n\n // https://datatracker.ietf.org/doc/html/rfc2397#section-3\n // dataurl := \"data:\" [ mediatype ] [ \";base64\" ] \",\" data\n // mediatype := [ type \"/\" subtype ] *( \";\" parameter )\n // data := *urlchar\n // parameter := attribute \"=\" value\n let dataURL = 'data:'\n\n const parsed = parseMIMEType(mimeType || 'application/octet-stream')\n\n if (parsed !== 'failure') {\n dataURL += serializeAMimeType(parsed)\n }\n\n dataURL += ';base64,'\n\n const decoder = new StringDecoder('latin1')\n\n for (const chunk of bytes) {\n dataURL += btoa(decoder.write(chunk))\n }\n\n dataURL += btoa(decoder.end())\n\n return dataURL\n }\n case 'Text': {\n // 1. Let encoding be failure\n let encoding = 'failure'\n\n // 2. If the encodingName is present, set encoding to the\n // result of getting an encoding from encodingName.\n if (encodingName) {\n encoding = getEncoding(encodingName)\n }\n\n // 3. If encoding is failure, and mimeType is present:\n if (encoding === 'failure' && mimeType) {\n // 1. Let type be the result of parse a MIME type\n // given mimeType.\n const type = parseMIMEType(mimeType)\n\n // 2. If type is not failure, set encoding to the result\n // of getting an encoding from type’s parameters[\"charset\"].\n if (type !== 'failure') {\n encoding = getEncoding(type.parameters.get('charset'))\n }\n }\n\n // 4. If encoding is failure, then set encoding to UTF-8.\n if (encoding === 'failure') {\n encoding = 'UTF-8'\n }\n\n // 5. Decode bytes using fallback encoding encoding, and\n // return the result.\n return decode(bytes, encoding)\n }\n case 'ArrayBuffer': {\n // Return a new ArrayBuffer whose contents are bytes.\n const sequence = combineByteSequences(bytes)\n\n return sequence.buffer\n }\n case 'BinaryString': {\n // Return bytes as a binary string, in which every byte\n // is represented by a code unit of equal value [0..255].\n let binaryString = ''\n\n const decoder = new StringDecoder('latin1')\n\n for (const chunk of bytes) {\n binaryString += decoder.write(chunk)\n }\n\n binaryString += decoder.end()\n\n return binaryString\n }\n }\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#decode\n * @param {Uint8Array[]} ioQueue\n * @param {string} encoding\n */\nfunction decode (ioQueue, encoding) {\n const bytes = combineByteSequences(ioQueue)\n\n // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.\n const BOMEncoding = BOMSniffing(bytes)\n\n let slice = 0\n\n // 2. If BOMEncoding is non-null:\n if (BOMEncoding !== null) {\n // 1. Set encoding to BOMEncoding.\n encoding = BOMEncoding\n\n // 2. Read three bytes from ioQueue, if BOMEncoding is\n // UTF-8; otherwise read two bytes.\n // (Do nothing with those bytes.)\n slice = BOMEncoding === 'UTF-8' ? 3 : 2\n }\n\n // 3. Process a queue with an instance of encoding’s\n // decoder, ioQueue, output, and \"replacement\".\n\n // 4. Return output.\n\n const sliced = bytes.slice(slice)\n return new TextDecoder(encoding).decode(sliced)\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#bom-sniff\n * @param {Uint8Array} ioQueue\n */\nfunction BOMSniffing (ioQueue) {\n // 1. Let BOM be the result of peeking 3 bytes from ioQueue,\n // converted to a byte sequence.\n const [a, b, c] = ioQueue\n\n // 2. For each of the rows in the table below, starting with\n // the first one and going down, if BOM starts with the\n // bytes given in the first column, then return the\n // encoding given in the cell in the second column of that\n // row. Otherwise, return null.\n if (a === 0xEF && b === 0xBB && c === 0xBF) {\n return 'UTF-8'\n } else if (a === 0xFE && b === 0xFF) {\n return 'UTF-16BE'\n } else if (a === 0xFF && b === 0xFE) {\n return 'UTF-16LE'\n }\n\n return null\n}\n\n/**\n * @param {Uint8Array[]} sequences\n */\nfunction combineByteSequences (sequences) {\n const size = sequences.reduce((a, b) => {\n return a + b.byteLength\n }, 0)\n\n let offset = 0\n\n return sequences.reduce((a, b) => {\n a.set(b, offset)\n offset += b.byteLength\n return a\n }, new Uint8Array(size))\n}\n\nmodule.exports = {\n staticPropertyDescriptors,\n readOperation,\n fireAProgressEvent\n}\n","'use strict'\n\nconst {\n staticPropertyDescriptors,\n readOperation,\n fireAProgressEvent\n} = require('./util')\nconst {\n kState,\n kError,\n kResult,\n kEvents,\n kAborted\n} = require('./symbols')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\n\nclass FileReader extends EventTarget {\n constructor () {\n super()\n\n this[kState] = 'empty'\n this[kResult] = null\n this[kError] = null\n this[kEvents] = {\n loadend: null,\n error: null,\n abort: null,\n load: null,\n progress: null,\n loadstart: null\n }\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer\n * @param {import('buffer').Blob} blob\n */\n readAsArrayBuffer (blob) {\n webidl.brandCheck(this, FileReader)\n\n webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsArrayBuffer')\n\n blob = webidl.converters.Blob(blob, { strict: false })\n\n // The readAsArrayBuffer(blob) method, when invoked,\n // must initiate a read operation for blob with ArrayBuffer.\n readOperation(this, blob, 'ArrayBuffer')\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#readAsBinaryString\n * @param {import('buffer').Blob} blob\n */\n readAsBinaryString (blob) {\n webidl.brandCheck(this, FileReader)\n\n webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsBinaryString')\n\n blob = webidl.converters.Blob(blob, { strict: false })\n\n // The readAsBinaryString(blob) method, when invoked,\n // must initiate a read operation for blob with BinaryString.\n readOperation(this, blob, 'BinaryString')\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#readAsDataText\n * @param {import('buffer').Blob} blob\n * @param {string?} encoding\n */\n readAsText (blob, encoding = undefined) {\n webidl.brandCheck(this, FileReader)\n\n webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsText')\n\n blob = webidl.converters.Blob(blob, { strict: false })\n\n if (encoding !== undefined) {\n encoding = webidl.converters.DOMString(encoding, 'FileReader.readAsText', 'encoding')\n }\n\n // The readAsText(blob, encoding) method, when invoked,\n // must initiate a read operation for blob with Text and encoding.\n readOperation(this, blob, 'Text', encoding)\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL\n * @param {import('buffer').Blob} blob\n */\n readAsDataURL (blob) {\n webidl.brandCheck(this, FileReader)\n\n webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsDataURL')\n\n blob = webidl.converters.Blob(blob, { strict: false })\n\n // The readAsDataURL(blob) method, when invoked, must\n // initiate a read operation for blob with DataURL.\n readOperation(this, blob, 'DataURL')\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dfn-abort\n */\n abort () {\n // 1. If this's state is \"empty\" or if this's state is\n // \"done\" set this's result to null and terminate\n // this algorithm.\n if (this[kState] === 'empty' || this[kState] === 'done') {\n this[kResult] = null\n return\n }\n\n // 2. If this's state is \"loading\" set this's state to\n // \"done\" and set this's result to null.\n if (this[kState] === 'loading') {\n this[kState] = 'done'\n this[kResult] = null\n }\n\n // 3. If there are any tasks from this on the file reading\n // task source in an affiliated task queue, then remove\n // those tasks from that task queue.\n this[kAborted] = true\n\n // 4. Terminate the algorithm for the read method being processed.\n // TODO\n\n // 5. Fire a progress event called abort at this.\n fireAProgressEvent('abort', this)\n\n // 6. If this's state is not \"loading\", fire a progress\n // event called loadend at this.\n if (this[kState] !== 'loading') {\n fireAProgressEvent('loadend', this)\n }\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate\n */\n get readyState () {\n webidl.brandCheck(this, FileReader)\n\n switch (this[kState]) {\n case 'empty': return this.EMPTY\n case 'loading': return this.LOADING\n case 'done': return this.DONE\n }\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dom-filereader-result\n */\n get result () {\n webidl.brandCheck(this, FileReader)\n\n // The result attribute’s getter, when invoked, must return\n // this's result.\n return this[kResult]\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dom-filereader-error\n */\n get error () {\n webidl.brandCheck(this, FileReader)\n\n // The error attribute’s getter, when invoked, must return\n // this's error.\n return this[kError]\n }\n\n get onloadend () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].loadend\n }\n\n set onloadend (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].loadend) {\n this.removeEventListener('loadend', this[kEvents].loadend)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].loadend = fn\n this.addEventListener('loadend', fn)\n } else {\n this[kEvents].loadend = null\n }\n }\n\n get onerror () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].error\n }\n\n set onerror (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].error) {\n this.removeEventListener('error', this[kEvents].error)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].error = fn\n this.addEventListener('error', fn)\n } else {\n this[kEvents].error = null\n }\n }\n\n get onloadstart () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].loadstart\n }\n\n set onloadstart (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].loadstart) {\n this.removeEventListener('loadstart', this[kEvents].loadstart)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].loadstart = fn\n this.addEventListener('loadstart', fn)\n } else {\n this[kEvents].loadstart = null\n }\n }\n\n get onprogress () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].progress\n }\n\n set onprogress (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].progress) {\n this.removeEventListener('progress', this[kEvents].progress)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].progress = fn\n this.addEventListener('progress', fn)\n } else {\n this[kEvents].progress = null\n }\n }\n\n get onload () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].load\n }\n\n set onload (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].load) {\n this.removeEventListener('load', this[kEvents].load)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].load = fn\n this.addEventListener('load', fn)\n } else {\n this[kEvents].load = null\n }\n }\n\n get onabort () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].abort\n }\n\n set onabort (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].abort) {\n this.removeEventListener('abort', this[kEvents].abort)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].abort = fn\n this.addEventListener('abort', fn)\n } else {\n this[kEvents].abort = null\n }\n }\n}\n\n// https://w3c.github.io/FileAPI/#dom-filereader-empty\nFileReader.EMPTY = FileReader.prototype.EMPTY = 0\n// https://w3c.github.io/FileAPI/#dom-filereader-loading\nFileReader.LOADING = FileReader.prototype.LOADING = 1\n// https://w3c.github.io/FileAPI/#dom-filereader-done\nFileReader.DONE = FileReader.prototype.DONE = 2\n\nObject.defineProperties(FileReader.prototype, {\n EMPTY: staticPropertyDescriptors,\n LOADING: staticPropertyDescriptors,\n DONE: staticPropertyDescriptors,\n readAsArrayBuffer: kEnumerableProperty,\n readAsBinaryString: kEnumerableProperty,\n readAsText: kEnumerableProperty,\n readAsDataURL: kEnumerableProperty,\n abort: kEnumerableProperty,\n readyState: kEnumerableProperty,\n result: kEnumerableProperty,\n error: kEnumerableProperty,\n onloadstart: kEnumerableProperty,\n onprogress: kEnumerableProperty,\n onload: kEnumerableProperty,\n onabort: kEnumerableProperty,\n onerror: kEnumerableProperty,\n onloadend: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'FileReader',\n writable: false,\n enumerable: false,\n configurable: true\n }\n})\n\nObject.defineProperties(FileReader, {\n EMPTY: staticPropertyDescriptors,\n LOADING: staticPropertyDescriptors,\n DONE: staticPropertyDescriptors\n})\n\nmodule.exports = {\n FileReader\n}\n","'use strict'\n\nmodule.exports = {\n kConstruct: require('../../core/symbols').kConstruct\n}\n","'use strict'\n\nconst assert = require('node:assert')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { isValidHeaderName } = require('../fetch/util')\n\n/**\n * @see https://url.spec.whatwg.org/#concept-url-equals\n * @param {URL} A\n * @param {URL} B\n * @param {boolean | undefined} excludeFragment\n * @returns {boolean}\n */\nfunction urlEquals (A, B, excludeFragment = false) {\n const serializedA = URLSerializer(A, excludeFragment)\n\n const serializedB = URLSerializer(B, excludeFragment)\n\n return serializedA === serializedB\n}\n\n/**\n * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262\n * @param {string} header\n */\nfunction getFieldValues (header) {\n assert(header !== null)\n\n const values = []\n\n for (let value of header.split(',')) {\n value = value.trim()\n\n if (isValidHeaderName(value)) {\n values.push(value)\n }\n }\n\n return values\n}\n\nmodule.exports = {\n urlEquals,\n getFieldValues\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { urlEquals, getFieldValues } = require('./util')\nconst { kEnumerableProperty, isDisturbed } = require('../../core/util')\nconst { webidl } = require('../fetch/webidl')\nconst { Response, cloneResponse, fromInnerResponse } = require('../fetch/response')\nconst { Request, fromInnerRequest } = require('../fetch/request')\nconst { kState } = require('../fetch/symbols')\nconst { fetching } = require('../fetch/index')\nconst { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require('../fetch/util')\nconst assert = require('node:assert')\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation\n * @typedef {Object} CacheBatchOperation\n * @property {'delete' | 'put'} type\n * @property {any} request\n * @property {any} response\n * @property {import('../../types/cache').CacheQueryOptions} options\n */\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list\n * @typedef {[any, any][]} requestResponseList\n */\n\nclass Cache {\n /**\n * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list\n * @type {requestResponseList}\n */\n #relevantRequestResponseList\n\n constructor () {\n if (arguments[0] !== kConstruct) {\n webidl.illegalConstructor()\n }\n\n webidl.util.markAsUncloneable(this)\n this.#relevantRequestResponseList = arguments[1]\n }\n\n async match (request, options = {}) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.match'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n request = webidl.converters.RequestInfo(request, prefix, 'request')\n options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n const p = this.#internalMatchAll(request, options, 1)\n\n if (p.length === 0) {\n return\n }\n\n return p[0]\n }\n\n async matchAll (request = undefined, options = {}) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.matchAll'\n if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')\n options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n return this.#internalMatchAll(request, options)\n }\n\n async add (request) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.add'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n request = webidl.converters.RequestInfo(request, prefix, 'request')\n\n // 1.\n const requests = [request]\n\n // 2.\n const responseArrayPromise = this.addAll(requests)\n\n // 3.\n return await responseArrayPromise\n }\n\n async addAll (requests) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.addAll'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n // 1.\n const responsePromises = []\n\n // 2.\n const requestList = []\n\n // 3.\n for (let request of requests) {\n if (request === undefined) {\n throw webidl.errors.conversionFailed({\n prefix,\n argument: 'Argument 1',\n types: ['undefined is not allowed']\n })\n }\n\n request = webidl.converters.RequestInfo(request)\n\n if (typeof request === 'string') {\n continue\n }\n\n // 3.1\n const r = request[kState]\n\n // 3.2\n if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Expected http/s scheme when method is not GET.'\n })\n }\n }\n\n // 4.\n /** @type {ReturnType[]} */\n const fetchControllers = []\n\n // 5.\n for (const request of requests) {\n // 5.1\n const r = new Request(request)[kState]\n\n // 5.2\n if (!urlIsHttpHttpsScheme(r.url)) {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Expected http/s scheme.'\n })\n }\n\n // 5.4\n r.initiator = 'fetch'\n r.destination = 'subresource'\n\n // 5.5\n requestList.push(r)\n\n // 5.6\n const responsePromise = createDeferredPromise()\n\n // 5.7\n fetchControllers.push(fetching({\n request: r,\n processResponse (response) {\n // 1.\n if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {\n responsePromise.reject(webidl.errors.exception({\n header: 'Cache.addAll',\n message: 'Received an invalid status code or the request failed.'\n }))\n } else if (response.headersList.contains('vary')) { // 2.\n // 2.1\n const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n // 2.2\n for (const fieldValue of fieldValues) {\n // 2.2.1\n if (fieldValue === '*') {\n responsePromise.reject(webidl.errors.exception({\n header: 'Cache.addAll',\n message: 'invalid vary field value'\n }))\n\n for (const controller of fetchControllers) {\n controller.abort()\n }\n\n return\n }\n }\n }\n },\n processResponseEndOfBody (response) {\n // 1.\n if (response.aborted) {\n responsePromise.reject(new DOMException('aborted', 'AbortError'))\n return\n }\n\n // 2.\n responsePromise.resolve(response)\n }\n }))\n\n // 5.8\n responsePromises.push(responsePromise.promise)\n }\n\n // 6.\n const p = Promise.all(responsePromises)\n\n // 7.\n const responses = await p\n\n // 7.1\n const operations = []\n\n // 7.2\n let index = 0\n\n // 7.3\n for (const response of responses) {\n // 7.3.1\n /** @type {CacheBatchOperation} */\n const operation = {\n type: 'put', // 7.3.2\n request: requestList[index], // 7.3.3\n response // 7.3.4\n }\n\n operations.push(operation) // 7.3.5\n\n index++ // 7.3.6\n }\n\n // 7.5\n const cacheJobPromise = createDeferredPromise()\n\n // 7.6.1\n let errorData = null\n\n // 7.6.2\n try {\n this.#batchCacheOperations(operations)\n } catch (e) {\n errorData = e\n }\n\n // 7.6.3\n queueMicrotask(() => {\n // 7.6.3.1\n if (errorData === null) {\n cacheJobPromise.resolve(undefined)\n } else {\n // 7.6.3.2\n cacheJobPromise.reject(errorData)\n }\n })\n\n // 7.7\n return cacheJobPromise.promise\n }\n\n async put (request, response) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.put'\n webidl.argumentLengthCheck(arguments, 2, prefix)\n\n request = webidl.converters.RequestInfo(request, prefix, 'request')\n response = webidl.converters.Response(response, prefix, 'response')\n\n // 1.\n let innerRequest = null\n\n // 2.\n if (request instanceof Request) {\n innerRequest = request[kState]\n } else { // 3.\n innerRequest = new Request(request)[kState]\n }\n\n // 4.\n if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Expected an http/s scheme when method is not GET'\n })\n }\n\n // 5.\n const innerResponse = response[kState]\n\n // 6.\n if (innerResponse.status === 206) {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Got 206 status'\n })\n }\n\n // 7.\n if (innerResponse.headersList.contains('vary')) {\n // 7.1.\n const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))\n\n // 7.2.\n for (const fieldValue of fieldValues) {\n // 7.2.1\n if (fieldValue === '*') {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Got * vary field value'\n })\n }\n }\n }\n\n // 8.\n if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {\n throw webidl.errors.exception({\n header: prefix,\n message: 'Response body is locked or disturbed'\n })\n }\n\n // 9.\n const clonedResponse = cloneResponse(innerResponse)\n\n // 10.\n const bodyReadPromise = createDeferredPromise()\n\n // 11.\n if (innerResponse.body != null) {\n // 11.1\n const stream = innerResponse.body.stream\n\n // 11.2\n const reader = stream.getReader()\n\n // 11.3\n readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)\n } else {\n bodyReadPromise.resolve(undefined)\n }\n\n // 12.\n /** @type {CacheBatchOperation[]} */\n const operations = []\n\n // 13.\n /** @type {CacheBatchOperation} */\n const operation = {\n type: 'put', // 14.\n request: innerRequest, // 15.\n response: clonedResponse // 16.\n }\n\n // 17.\n operations.push(operation)\n\n // 19.\n const bytes = await bodyReadPromise.promise\n\n if (clonedResponse.body != null) {\n clonedResponse.body.source = bytes\n }\n\n // 19.1\n const cacheJobPromise = createDeferredPromise()\n\n // 19.2.1\n let errorData = null\n\n // 19.2.2\n try {\n this.#batchCacheOperations(operations)\n } catch (e) {\n errorData = e\n }\n\n // 19.2.3\n queueMicrotask(() => {\n // 19.2.3.1\n if (errorData === null) {\n cacheJobPromise.resolve()\n } else { // 19.2.3.2\n cacheJobPromise.reject(errorData)\n }\n })\n\n return cacheJobPromise.promise\n }\n\n async delete (request, options = {}) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.delete'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n request = webidl.converters.RequestInfo(request, prefix, 'request')\n options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n /**\n * @type {Request}\n */\n let r = null\n\n if (request instanceof Request) {\n r = request[kState]\n\n if (r.method !== 'GET' && !options.ignoreMethod) {\n return false\n }\n } else {\n assert(typeof request === 'string')\n\n r = new Request(request)[kState]\n }\n\n /** @type {CacheBatchOperation[]} */\n const operations = []\n\n /** @type {CacheBatchOperation} */\n const operation = {\n type: 'delete',\n request: r,\n options\n }\n\n operations.push(operation)\n\n const cacheJobPromise = createDeferredPromise()\n\n let errorData = null\n let requestResponses\n\n try {\n requestResponses = this.#batchCacheOperations(operations)\n } catch (e) {\n errorData = e\n }\n\n queueMicrotask(() => {\n if (errorData === null) {\n cacheJobPromise.resolve(!!requestResponses?.length)\n } else {\n cacheJobPromise.reject(errorData)\n }\n })\n\n return cacheJobPromise.promise\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys\n * @param {any} request\n * @param {import('../../types/cache').CacheQueryOptions} options\n * @returns {Promise}\n */\n async keys (request = undefined, options = {}) {\n webidl.brandCheck(this, Cache)\n\n const prefix = 'Cache.keys'\n\n if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')\n options = webidl.converters.CacheQueryOptions(options, prefix, 'options')\n\n // 1.\n let r = null\n\n // 2.\n if (request !== undefined) {\n // 2.1\n if (request instanceof Request) {\n // 2.1.1\n r = request[kState]\n\n // 2.1.2\n if (r.method !== 'GET' && !options.ignoreMethod) {\n return []\n }\n } else if (typeof request === 'string') { // 2.2\n r = new Request(request)[kState]\n }\n }\n\n // 4.\n const promise = createDeferredPromise()\n\n // 5.\n // 5.1\n const requests = []\n\n // 5.2\n if (request === undefined) {\n // 5.2.1\n for (const requestResponse of this.#relevantRequestResponseList) {\n // 5.2.1.1\n requests.push(requestResponse[0])\n }\n } else { // 5.3\n // 5.3.1\n const requestResponses = this.#queryCache(r, options)\n\n // 5.3.2\n for (const requestResponse of requestResponses) {\n // 5.3.2.1\n requests.push(requestResponse[0])\n }\n }\n\n // 5.4\n queueMicrotask(() => {\n // 5.4.1\n const requestList = []\n\n // 5.4.2\n for (const request of requests) {\n const requestObject = fromInnerRequest(\n request,\n new AbortController().signal,\n 'immutable'\n )\n // 5.4.2.1\n requestList.push(requestObject)\n }\n\n // 5.4.3\n promise.resolve(Object.freeze(requestList))\n })\n\n return promise.promise\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm\n * @param {CacheBatchOperation[]} operations\n * @returns {requestResponseList}\n */\n #batchCacheOperations (operations) {\n // 1.\n const cache = this.#relevantRequestResponseList\n\n // 2.\n const backupCache = [...cache]\n\n // 3.\n const addedItems = []\n\n // 4.1\n const resultList = []\n\n try {\n // 4.2\n for (const operation of operations) {\n // 4.2.1\n if (operation.type !== 'delete' && operation.type !== 'put') {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'operation type does not match \"delete\" or \"put\"'\n })\n }\n\n // 4.2.2\n if (operation.type === 'delete' && operation.response != null) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'delete operation should not have an associated response'\n })\n }\n\n // 4.2.3\n if (this.#queryCache(operation.request, operation.options, addedItems).length) {\n throw new DOMException('???', 'InvalidStateError')\n }\n\n // 4.2.4\n let requestResponses\n\n // 4.2.5\n if (operation.type === 'delete') {\n // 4.2.5.1\n requestResponses = this.#queryCache(operation.request, operation.options)\n\n // TODO: the spec is wrong, this is needed to pass WPTs\n if (requestResponses.length === 0) {\n return []\n }\n\n // 4.2.5.2\n for (const requestResponse of requestResponses) {\n const idx = cache.indexOf(requestResponse)\n assert(idx !== -1)\n\n // 4.2.5.2.1\n cache.splice(idx, 1)\n }\n } else if (operation.type === 'put') { // 4.2.6\n // 4.2.6.1\n if (operation.response == null) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'put operation should have an associated response'\n })\n }\n\n // 4.2.6.2\n const r = operation.request\n\n // 4.2.6.3\n if (!urlIsHttpHttpsScheme(r.url)) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'expected http or https scheme'\n })\n }\n\n // 4.2.6.4\n if (r.method !== 'GET') {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'not get method'\n })\n }\n\n // 4.2.6.5\n if (operation.options != null) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'options must not be defined'\n })\n }\n\n // 4.2.6.6\n requestResponses = this.#queryCache(operation.request)\n\n // 4.2.6.7\n for (const requestResponse of requestResponses) {\n const idx = cache.indexOf(requestResponse)\n assert(idx !== -1)\n\n // 4.2.6.7.1\n cache.splice(idx, 1)\n }\n\n // 4.2.6.8\n cache.push([operation.request, operation.response])\n\n // 4.2.6.10\n addedItems.push([operation.request, operation.response])\n }\n\n // 4.2.7\n resultList.push([operation.request, operation.response])\n }\n\n // 4.3\n return resultList\n } catch (e) { // 5.\n // 5.1\n this.#relevantRequestResponseList.length = 0\n\n // 5.2\n this.#relevantRequestResponseList = backupCache\n\n // 5.3\n throw e\n }\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#query-cache\n * @param {any} requestQuery\n * @param {import('../../types/cache').CacheQueryOptions} options\n * @param {requestResponseList} targetStorage\n * @returns {requestResponseList}\n */\n #queryCache (requestQuery, options, targetStorage) {\n /** @type {requestResponseList} */\n const resultList = []\n\n const storage = targetStorage ?? this.#relevantRequestResponseList\n\n for (const requestResponse of storage) {\n const [cachedRequest, cachedResponse] = requestResponse\n if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {\n resultList.push(requestResponse)\n }\n }\n\n return resultList\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm\n * @param {any} requestQuery\n * @param {any} request\n * @param {any | null} response\n * @param {import('../../types/cache').CacheQueryOptions | undefined} options\n * @returns {boolean}\n */\n #requestMatchesCachedItem (requestQuery, request, response = null, options) {\n // if (options?.ignoreMethod === false && request.method === 'GET') {\n // return false\n // }\n\n const queryURL = new URL(requestQuery.url)\n\n const cachedURL = new URL(request.url)\n\n if (options?.ignoreSearch) {\n cachedURL.search = ''\n\n queryURL.search = ''\n }\n\n if (!urlEquals(queryURL, cachedURL, true)) {\n return false\n }\n\n if (\n response == null ||\n options?.ignoreVary ||\n !response.headersList.contains('vary')\n ) {\n return true\n }\n\n const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n for (const fieldValue of fieldValues) {\n if (fieldValue === '*') {\n return false\n }\n\n const requestValue = request.headersList.get(fieldValue)\n const queryValue = requestQuery.headersList.get(fieldValue)\n\n // If one has the header and the other doesn't, or one has\n // a different value than the other, return false\n if (requestValue !== queryValue) {\n return false\n }\n }\n\n return true\n }\n\n #internalMatchAll (request, options, maxResponses = Infinity) {\n // 1.\n let r = null\n\n // 2.\n if (request !== undefined) {\n if (request instanceof Request) {\n // 2.1.1\n r = request[kState]\n\n // 2.1.2\n if (r.method !== 'GET' && !options.ignoreMethod) {\n return []\n }\n } else if (typeof request === 'string') {\n // 2.2.1\n r = new Request(request)[kState]\n }\n }\n\n // 5.\n // 5.1\n const responses = []\n\n // 5.2\n if (request === undefined) {\n // 5.2.1\n for (const requestResponse of this.#relevantRequestResponseList) {\n responses.push(requestResponse[1])\n }\n } else { // 5.3\n // 5.3.1\n const requestResponses = this.#queryCache(r, options)\n\n // 5.3.2\n for (const requestResponse of requestResponses) {\n responses.push(requestResponse[1])\n }\n }\n\n // 5.4\n // We don't implement CORs so we don't need to loop over the responses, yay!\n\n // 5.5.1\n const responseList = []\n\n // 5.5.2\n for (const response of responses) {\n // 5.5.2.1\n const responseObject = fromInnerResponse(response, 'immutable')\n\n responseList.push(responseObject.clone())\n\n if (responseList.length >= maxResponses) {\n break\n }\n }\n\n // 6.\n return Object.freeze(responseList)\n }\n}\n\nObject.defineProperties(Cache.prototype, {\n [Symbol.toStringTag]: {\n value: 'Cache',\n configurable: true\n },\n match: kEnumerableProperty,\n matchAll: kEnumerableProperty,\n add: kEnumerableProperty,\n addAll: kEnumerableProperty,\n put: kEnumerableProperty,\n delete: kEnumerableProperty,\n keys: kEnumerableProperty\n})\n\nconst cacheQueryOptionConverters = [\n {\n key: 'ignoreSearch',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'ignoreMethod',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'ignoreVary',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n }\n]\n\nwebidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)\n\nwebidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([\n ...cacheQueryOptionConverters,\n {\n key: 'cacheName',\n converter: webidl.converters.DOMString\n }\n])\n\nwebidl.converters.Response = webidl.interfaceConverter(Response)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.RequestInfo\n)\n\nmodule.exports = {\n Cache\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { Cache } = require('./cache')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\n\nclass CacheStorage {\n /**\n * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map\n * @type {Map}\n */\n async has (cacheName) {\n webidl.brandCheck(this, CacheStorage)\n\n const prefix = 'CacheStorage.has'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n // 2.1.1\n // 2.2\n return this.#caches.has(cacheName)\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open\n * @param {string} cacheName\n * @returns {Promise}\n */\n async open (cacheName) {\n webidl.brandCheck(this, CacheStorage)\n\n const prefix = 'CacheStorage.open'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n // 2.1\n if (this.#caches.has(cacheName)) {\n // await caches.open('v1') !== await caches.open('v1')\n\n // 2.1.1\n const cache = this.#caches.get(cacheName)\n\n // 2.1.1.1\n return new Cache(kConstruct, cache)\n }\n\n // 2.2\n const cache = []\n\n // 2.3\n this.#caches.set(cacheName, cache)\n\n // 2.4\n return new Cache(kConstruct, cache)\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete\n * @param {string} cacheName\n * @returns {Promise}\n */\n async delete (cacheName) {\n webidl.brandCheck(this, CacheStorage)\n\n const prefix = 'CacheStorage.delete'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')\n\n return this.#caches.delete(cacheName)\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys\n * @returns {Promise}\n */\n async keys () {\n webidl.brandCheck(this, CacheStorage)\n\n // 2.1\n const keys = this.#caches.keys()\n\n // 2.2\n return [...keys]\n }\n}\n\nObject.defineProperties(CacheStorage.prototype, {\n [Symbol.toStringTag]: {\n value: 'CacheStorage',\n configurable: true\n },\n match: kEnumerableProperty,\n has: kEnumerableProperty,\n open: kEnumerableProperty,\n delete: kEnumerableProperty,\n keys: kEnumerableProperty\n})\n\nmodule.exports = {\n CacheStorage\n}\n","'use strict'\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size\nconst maxAttributeValueSize = 1024\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size\nconst maxNameValuePairSize = 4096\n\nmodule.exports = {\n maxAttributeValueSize,\n maxNameValuePairSize\n}\n","'use strict'\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nfunction isCTLExcludingHtab (value) {\n for (let i = 0; i < value.length; ++i) {\n const code = value.charCodeAt(i)\n\n if (\n (code >= 0x00 && code <= 0x08) ||\n (code >= 0x0A && code <= 0x1F) ||\n code === 0x7F\n ) {\n return true\n }\n }\n return false\n}\n\n/**\n CHAR = \n token = 1*\n separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n | \",\" | \";\" | \":\" | \"\\\" | <\">\n | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n | \"{\" | \"}\" | SP | HT\n * @param {string} name\n */\nfunction validateCookieName (name) {\n for (let i = 0; i < name.length; ++i) {\n const code = name.charCodeAt(i)\n\n if (\n code < 0x21 || // exclude CTLs (0-31), SP and HT\n code > 0x7E || // exclude non-ascii and DEL\n code === 0x22 || // \"\n code === 0x28 || // (\n code === 0x29 || // )\n code === 0x3C || // <\n code === 0x3E || // >\n code === 0x40 || // @\n code === 0x2C || // ,\n code === 0x3B || // ;\n code === 0x3A || // :\n code === 0x5C || // \\\n code === 0x2F || // /\n code === 0x5B || // [\n code === 0x5D || // ]\n code === 0x3F || // ?\n code === 0x3D || // =\n code === 0x7B || // {\n code === 0x7D // }\n ) {\n throw new Error('Invalid cookie name')\n }\n }\n}\n\n/**\n cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n ; US-ASCII characters excluding CTLs,\n ; whitespace DQUOTE, comma, semicolon,\n ; and backslash\n * @param {string} value\n */\nfunction validateCookieValue (value) {\n let len = value.length\n let i = 0\n\n // if the value is wrapped in DQUOTE\n if (value[0] === '\"') {\n if (len === 1 || value[len - 1] !== '\"') {\n throw new Error('Invalid cookie value')\n }\n --len\n ++i\n }\n\n while (i < len) {\n const code = value.charCodeAt(i++)\n\n if (\n code < 0x21 || // exclude CTLs (0-31)\n code > 0x7E || // non-ascii and DEL (127)\n code === 0x22 || // \"\n code === 0x2C || // ,\n code === 0x3B || // ;\n code === 0x5C // \\\n ) {\n throw new Error('Invalid cookie value')\n }\n }\n}\n\n/**\n * path-value = \n * @param {string} path\n */\nfunction validateCookiePath (path) {\n for (let i = 0; i < path.length; ++i) {\n const code = path.charCodeAt(i)\n\n if (\n code < 0x20 || // exclude CTLs (0-31)\n code === 0x7F || // DEL\n code === 0x3B // ;\n ) {\n throw new Error('Invalid cookie path')\n }\n }\n}\n\n/**\n * I have no idea why these values aren't allowed to be honest,\n * but Deno tests these. - Khafra\n * @param {string} domain\n */\nfunction validateCookieDomain (domain) {\n if (\n domain.startsWith('-') ||\n domain.endsWith('.') ||\n domain.endsWith('-')\n ) {\n throw new Error('Invalid cookie domain')\n }\n}\n\nconst IMFDays = [\n 'Sun', 'Mon', 'Tue', 'Wed',\n 'Thu', 'Fri', 'Sat'\n]\n\nconst IMFMonths = [\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\n]\n\nconst IMFPaddedNumbers = Array(61).fill(0).map((_, i) => i.toString().padStart(2, '0'))\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1\n * @param {number|Date} date\n IMF-fixdate = day-name \",\" SP date1 SP time-of-day SP GMT\n ; fixed length/zone/capitalization subset of the format\n ; see Section 3.3 of [RFC5322]\n\n day-name = %x4D.6F.6E ; \"Mon\", case-sensitive\n / %x54.75.65 ; \"Tue\", case-sensitive\n / %x57.65.64 ; \"Wed\", case-sensitive\n / %x54.68.75 ; \"Thu\", case-sensitive\n / %x46.72.69 ; \"Fri\", case-sensitive\n / %x53.61.74 ; \"Sat\", case-sensitive\n / %x53.75.6E ; \"Sun\", case-sensitive\n date1 = day SP month SP year\n ; e.g., 02 Jun 1982\n\n day = 2DIGIT\n month = %x4A.61.6E ; \"Jan\", case-sensitive\n / %x46.65.62 ; \"Feb\", case-sensitive\n / %x4D.61.72 ; \"Mar\", case-sensitive\n / %x41.70.72 ; \"Apr\", case-sensitive\n / %x4D.61.79 ; \"May\", case-sensitive\n / %x4A.75.6E ; \"Jun\", case-sensitive\n / %x4A.75.6C ; \"Jul\", case-sensitive\n / %x41.75.67 ; \"Aug\", case-sensitive\n / %x53.65.70 ; \"Sep\", case-sensitive\n / %x4F.63.74 ; \"Oct\", case-sensitive\n / %x4E.6F.76 ; \"Nov\", case-sensitive\n / %x44.65.63 ; \"Dec\", case-sensitive\n year = 4DIGIT\n\n GMT = %x47.4D.54 ; \"GMT\", case-sensitive\n\n time-of-day = hour \":\" minute \":\" second\n ; 00:00:00 - 23:59:60 (leap second)\n\n hour = 2DIGIT\n minute = 2DIGIT\n second = 2DIGIT\n */\nfunction toIMFDate (date) {\n if (typeof date === 'number') {\n date = new Date(date)\n }\n\n return `${IMFDays[date.getUTCDay()]}, ${IMFPaddedNumbers[date.getUTCDate()]} ${IMFMonths[date.getUTCMonth()]} ${date.getUTCFullYear()} ${IMFPaddedNumbers[date.getUTCHours()]}:${IMFPaddedNumbers[date.getUTCMinutes()]}:${IMFPaddedNumbers[date.getUTCSeconds()]} GMT`\n}\n\n/**\n max-age-av = \"Max-Age=\" non-zero-digit *DIGIT\n ; In practice, both expires-av and max-age-av\n ; are limited to dates representable by the\n ; user agent.\n * @param {number} maxAge\n */\nfunction validateCookieMaxAge (maxAge) {\n if (maxAge < 0) {\n throw new Error('Invalid cookie max-age')\n }\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1\n * @param {import('./index').Cookie} cookie\n */\nfunction stringify (cookie) {\n if (cookie.name.length === 0) {\n return null\n }\n\n validateCookieName(cookie.name)\n validateCookieValue(cookie.value)\n\n const out = [`${cookie.name}=${cookie.value}`]\n\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2\n if (cookie.name.startsWith('__Secure-')) {\n cookie.secure = true\n }\n\n if (cookie.name.startsWith('__Host-')) {\n cookie.secure = true\n cookie.domain = null\n cookie.path = '/'\n }\n\n if (cookie.secure) {\n out.push('Secure')\n }\n\n if (cookie.httpOnly) {\n out.push('HttpOnly')\n }\n\n if (typeof cookie.maxAge === 'number') {\n validateCookieMaxAge(cookie.maxAge)\n out.push(`Max-Age=${cookie.maxAge}`)\n }\n\n if (cookie.domain) {\n validateCookieDomain(cookie.domain)\n out.push(`Domain=${cookie.domain}`)\n }\n\n if (cookie.path) {\n validateCookiePath(cookie.path)\n out.push(`Path=${cookie.path}`)\n }\n\n if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {\n out.push(`Expires=${toIMFDate(cookie.expires)}`)\n }\n\n if (cookie.sameSite) {\n out.push(`SameSite=${cookie.sameSite}`)\n }\n\n for (const part of cookie.unparsed) {\n if (!part.includes('=')) {\n throw new Error('Invalid unparsed')\n }\n\n const [key, ...value] = part.split('=')\n\n out.push(`${key.trim()}=${value.join('=')}`)\n }\n\n return out.join('; ')\n}\n\nmodule.exports = {\n isCTLExcludingHtab,\n validateCookieName,\n validateCookiePath,\n validateCookieValue,\n toIMFDate,\n stringify\n}\n","'use strict'\n\nconst { maxNameValuePairSize, maxAttributeValueSize } = require('./constants')\nconst { isCTLExcludingHtab } = require('./util')\nconst { collectASequenceOfCodePointsFast } = require('../fetch/data-url')\nconst assert = require('node:assert')\n\n/**\n * @description Parses the field-value attributes of a set-cookie header string.\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} header\n * @returns if the header is invalid, null will be returned\n */\nfunction parseSetCookie (header) {\n // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F\n // character (CTL characters excluding HTAB): Abort these steps and\n // ignore the set-cookie-string entirely.\n if (isCTLExcludingHtab(header)) {\n return null\n }\n\n let nameValuePair = ''\n let unparsedAttributes = ''\n let name = ''\n let value = ''\n\n // 2. If the set-cookie-string contains a %x3B (\";\") character:\n if (header.includes(';')) {\n // 1. The name-value-pair string consists of the characters up to,\n // but not including, the first %x3B (\";\"), and the unparsed-\n // attributes consist of the remainder of the set-cookie-string\n // (including the %x3B (\";\") in question).\n const position = { position: 0 }\n\n nameValuePair = collectASequenceOfCodePointsFast(';', header, position)\n unparsedAttributes = header.slice(position.position)\n } else {\n // Otherwise:\n\n // 1. The name-value-pair string consists of all the characters\n // contained in the set-cookie-string, and the unparsed-\n // attributes is the empty string.\n nameValuePair = header\n }\n\n // 3. If the name-value-pair string lacks a %x3D (\"=\") character, then\n // the name string is empty, and the value string is the value of\n // name-value-pair.\n if (!nameValuePair.includes('=')) {\n value = nameValuePair\n } else {\n // Otherwise, the name string consists of the characters up to, but\n // not including, the first %x3D (\"=\") character, and the (possibly\n // empty) value string consists of the characters after the first\n // %x3D (\"=\") character.\n const position = { position: 0 }\n name = collectASequenceOfCodePointsFast(\n '=',\n nameValuePair,\n position\n )\n value = nameValuePair.slice(position.position + 1)\n }\n\n // 4. Remove any leading or trailing WSP characters from the name\n // string and the value string.\n name = name.trim()\n value = value.trim()\n\n // 5. If the sum of the lengths of the name string and the value string\n // is more than 4096 octets, abort these steps and ignore the set-\n // cookie-string entirely.\n if (name.length + value.length > maxNameValuePairSize) {\n return null\n }\n\n // 6. The cookie-name is the name string, and the cookie-value is the\n // value string.\n return {\n name, value, ...parseUnparsedAttributes(unparsedAttributes)\n }\n}\n\n/**\n * Parses the remaining attributes of a set-cookie header\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} unparsedAttributes\n * @param {[Object.]={}} cookieAttributeList\n */\nfunction parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {\n // 1. If the unparsed-attributes string is empty, skip the rest of\n // these steps.\n if (unparsedAttributes.length === 0) {\n return cookieAttributeList\n }\n\n // 2. Discard the first character of the unparsed-attributes (which\n // will be a %x3B (\";\") character).\n assert(unparsedAttributes[0] === ';')\n unparsedAttributes = unparsedAttributes.slice(1)\n\n let cookieAv = ''\n\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n if (unparsedAttributes.includes(';')) {\n // 1. Consume the characters of the unparsed-attributes up to, but\n // not including, the first %x3B (\";\") character.\n cookieAv = collectASequenceOfCodePointsFast(\n ';',\n unparsedAttributes,\n { position: 0 }\n )\n unparsedAttributes = unparsedAttributes.slice(cookieAv.length)\n } else {\n // Otherwise:\n\n // 1. Consume the remainder of the unparsed-attributes.\n cookieAv = unparsedAttributes\n unparsedAttributes = ''\n }\n\n // Let the cookie-av string be the characters consumed in this step.\n\n let attributeName = ''\n let attributeValue = ''\n\n // 4. If the cookie-av string contains a %x3D (\"=\") character:\n if (cookieAv.includes('=')) {\n // 1. The (possibly empty) attribute-name string consists of the\n // characters up to, but not including, the first %x3D (\"=\")\n // character, and the (possibly empty) attribute-value string\n // consists of the characters after the first %x3D (\"=\")\n // character.\n const position = { position: 0 }\n\n attributeName = collectASequenceOfCodePointsFast(\n '=',\n cookieAv,\n position\n )\n attributeValue = cookieAv.slice(position.position + 1)\n } else {\n // Otherwise:\n\n // 1. The attribute-name string consists of the entire cookie-av\n // string, and the attribute-value string is empty.\n attributeName = cookieAv\n }\n\n // 5. Remove any leading or trailing WSP characters from the attribute-\n // name string and the attribute-value string.\n attributeName = attributeName.trim()\n attributeValue = attributeValue.trim()\n\n // 6. If the attribute-value is longer than 1024 octets, ignore the\n // cookie-av string and return to Step 1 of this algorithm.\n if (attributeValue.length > maxAttributeValueSize) {\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n }\n\n // 7. Process the attribute-name and attribute-value according to the\n // requirements in the following subsections. (Notice that\n // attributes with unrecognized attribute-names are ignored.)\n const attributeNameLowercase = attributeName.toLowerCase()\n\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1\n // If the attribute-name case-insensitively matches the string\n // \"Expires\", the user agent MUST process the cookie-av as follows.\n if (attributeNameLowercase === 'expires') {\n // 1. Let the expiry-time be the result of parsing the attribute-value\n // as cookie-date (see Section 5.1.1).\n const expiryTime = new Date(attributeValue)\n\n // 2. If the attribute-value failed to parse as a cookie date, ignore\n // the cookie-av.\n\n cookieAttributeList.expires = expiryTime\n } else if (attributeNameLowercase === 'max-age') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2\n // If the attribute-name case-insensitively matches the string \"Max-\n // Age\", the user agent MUST process the cookie-av as follows.\n\n // 1. If the first character of the attribute-value is not a DIGIT or a\n // \"-\" character, ignore the cookie-av.\n const charCode = attributeValue.charCodeAt(0)\n\n if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n }\n\n // 2. If the remainder of attribute-value contains a non-DIGIT\n // character, ignore the cookie-av.\n if (!/^\\d+$/.test(attributeValue)) {\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n }\n\n // 3. Let delta-seconds be the attribute-value converted to an integer.\n const deltaSeconds = Number(attributeValue)\n\n // 4. Let cookie-age-limit be the maximum age of the cookie (which\n // SHOULD be 400 days or less, see Section 4.1.2.2).\n\n // 5. Set delta-seconds to the smaller of its present value and cookie-\n // age-limit.\n // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)\n\n // 6. If delta-seconds is less than or equal to zero (0), let expiry-\n // time be the earliest representable date and time. Otherwise, let\n // the expiry-time be the current date and time plus delta-seconds\n // seconds.\n // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds\n\n // 7. Append an attribute to the cookie-attribute-list with an\n // attribute-name of Max-Age and an attribute-value of expiry-time.\n cookieAttributeList.maxAge = deltaSeconds\n } else if (attributeNameLowercase === 'domain') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3\n // If the attribute-name case-insensitively matches the string \"Domain\",\n // the user agent MUST process the cookie-av as follows.\n\n // 1. Let cookie-domain be the attribute-value.\n let cookieDomain = attributeValue\n\n // 2. If cookie-domain starts with %x2E (\".\"), let cookie-domain be\n // cookie-domain without its leading %x2E (\".\").\n if (cookieDomain[0] === '.') {\n cookieDomain = cookieDomain.slice(1)\n }\n\n // 3. Convert the cookie-domain to lower case.\n cookieDomain = cookieDomain.toLowerCase()\n\n // 4. Append an attribute to the cookie-attribute-list with an\n // attribute-name of Domain and an attribute-value of cookie-domain.\n cookieAttributeList.domain = cookieDomain\n } else if (attributeNameLowercase === 'path') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4\n // If the attribute-name case-insensitively matches the string \"Path\",\n // the user agent MUST process the cookie-av as follows.\n\n // 1. If the attribute-value is empty or if the first character of the\n // attribute-value is not %x2F (\"/\"):\n let cookiePath = ''\n if (attributeValue.length === 0 || attributeValue[0] !== '/') {\n // 1. Let cookie-path be the default-path.\n cookiePath = '/'\n } else {\n // Otherwise:\n\n // 1. Let cookie-path be the attribute-value.\n cookiePath = attributeValue\n }\n\n // 2. Append an attribute to the cookie-attribute-list with an\n // attribute-name of Path and an attribute-value of cookie-path.\n cookieAttributeList.path = cookiePath\n } else if (attributeNameLowercase === 'secure') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5\n // If the attribute-name case-insensitively matches the string \"Secure\",\n // the user agent MUST append an attribute to the cookie-attribute-list\n // with an attribute-name of Secure and an empty attribute-value.\n\n cookieAttributeList.secure = true\n } else if (attributeNameLowercase === 'httponly') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6\n // If the attribute-name case-insensitively matches the string\n // \"HttpOnly\", the user agent MUST append an attribute to the cookie-\n // attribute-list with an attribute-name of HttpOnly and an empty\n // attribute-value.\n\n cookieAttributeList.httpOnly = true\n } else if (attributeNameLowercase === 'samesite') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7\n // If the attribute-name case-insensitively matches the string\n // \"SameSite\", the user agent MUST process the cookie-av as follows:\n\n // 1. Let enforcement be \"Default\".\n let enforcement = 'Default'\n\n const attributeValueLowercase = attributeValue.toLowerCase()\n // 2. If cookie-av's attribute-value is a case-insensitive match for\n // \"None\", set enforcement to \"None\".\n if (attributeValueLowercase.includes('none')) {\n enforcement = 'None'\n }\n\n // 3. If cookie-av's attribute-value is a case-insensitive match for\n // \"Strict\", set enforcement to \"Strict\".\n if (attributeValueLowercase.includes('strict')) {\n enforcement = 'Strict'\n }\n\n // 4. If cookie-av's attribute-value is a case-insensitive match for\n // \"Lax\", set enforcement to \"Lax\".\n if (attributeValueLowercase.includes('lax')) {\n enforcement = 'Lax'\n }\n\n // 5. Append an attribute to the cookie-attribute-list with an\n // attribute-name of \"SameSite\" and an attribute-value of\n // enforcement.\n cookieAttributeList.sameSite = enforcement\n } else {\n cookieAttributeList.unparsed ??= []\n\n cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)\n }\n\n // 8. Return to Step 1 of this algorithm.\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n}\n\nmodule.exports = {\n parseSetCookie,\n parseUnparsedAttributes\n}\n","'use strict'\n\nconst { parseSetCookie } = require('./parse')\nconst { stringify } = require('./util')\nconst { webidl } = require('../fetch/webidl')\nconst { Headers } = require('../fetch/headers')\n\n/**\n * @typedef {Object} Cookie\n * @property {string} name\n * @property {string} value\n * @property {Date|number|undefined} expires\n * @property {number|undefined} maxAge\n * @property {string|undefined} domain\n * @property {string|undefined} path\n * @property {boolean|undefined} secure\n * @property {boolean|undefined} httpOnly\n * @property {'Strict'|'Lax'|'None'} sameSite\n * @property {string[]} unparsed\n */\n\n/**\n * @param {Headers} headers\n * @returns {Record}\n */\nfunction getCookies (headers) {\n webidl.argumentLengthCheck(arguments, 1, 'getCookies')\n\n webidl.brandCheck(headers, Headers, { strict: false })\n\n const cookie = headers.get('cookie')\n const out = {}\n\n if (!cookie) {\n return out\n }\n\n for (const piece of cookie.split(';')) {\n const [name, ...value] = piece.split('=')\n\n out[name.trim()] = value.join('=')\n }\n\n return out\n}\n\n/**\n * @param {Headers} headers\n * @param {string} name\n * @param {{ path?: string, domain?: string }|undefined} attributes\n * @returns {void}\n */\nfunction deleteCookie (headers, name, attributes) {\n webidl.brandCheck(headers, Headers, { strict: false })\n\n const prefix = 'deleteCookie'\n webidl.argumentLengthCheck(arguments, 2, prefix)\n\n name = webidl.converters.DOMString(name, prefix, 'name')\n attributes = webidl.converters.DeleteCookieAttributes(attributes)\n\n // Matches behavior of\n // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278\n setCookie(headers, {\n name,\n value: '',\n expires: new Date(0),\n ...attributes\n })\n}\n\n/**\n * @param {Headers} headers\n * @returns {Cookie[]}\n */\nfunction getSetCookies (headers) {\n webidl.argumentLengthCheck(arguments, 1, 'getSetCookies')\n\n webidl.brandCheck(headers, Headers, { strict: false })\n\n const cookies = headers.getSetCookie()\n\n if (!cookies) {\n return []\n }\n\n return cookies.map((pair) => parseSetCookie(pair))\n}\n\n/**\n * @param {Headers} headers\n * @param {Cookie} cookie\n * @returns {void}\n */\nfunction setCookie (headers, cookie) {\n webidl.argumentLengthCheck(arguments, 2, 'setCookie')\n\n webidl.brandCheck(headers, Headers, { strict: false })\n\n cookie = webidl.converters.Cookie(cookie)\n\n const str = stringify(cookie)\n\n if (str) {\n headers.append('Set-Cookie', str)\n }\n}\n\nwebidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'path',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'domain',\n defaultValue: () => null\n }\n])\n\nwebidl.converters.Cookie = webidl.dictionaryConverter([\n {\n converter: webidl.converters.DOMString,\n key: 'name'\n },\n {\n converter: webidl.converters.DOMString,\n key: 'value'\n },\n {\n converter: webidl.nullableConverter((value) => {\n if (typeof value === 'number') {\n return webidl.converters['unsigned long long'](value)\n }\n\n return new Date(value)\n }),\n key: 'expires',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters['long long']),\n key: 'maxAge',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'domain',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'path',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.boolean),\n key: 'secure',\n defaultValue: () => null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.boolean),\n key: 'httpOnly',\n defaultValue: () => null\n },\n {\n converter: webidl.converters.USVString,\n key: 'sameSite',\n allowedValues: ['Strict', 'Lax', 'None']\n },\n {\n converter: webidl.sequenceConverter(webidl.converters.DOMString),\n key: 'unparsed',\n defaultValue: () => new Array(0)\n }\n])\n\nmodule.exports = {\n getCookies,\n deleteCookie,\n getSetCookies,\n setCookie\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { kConstruct } = require('../../core/symbols')\nconst { MessagePort } = require('node:worker_threads')\n\n/**\n * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent\n */\nclass MessageEvent extends Event {\n #eventInit\n\n constructor (type, eventInitDict = {}) {\n if (type === kConstruct) {\n super(arguments[1], arguments[2])\n webidl.util.markAsUncloneable(this)\n return\n }\n\n const prefix = 'MessageEvent constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n type = webidl.converters.DOMString(type, prefix, 'type')\n eventInitDict = webidl.converters.MessageEventInit(eventInitDict, prefix, 'eventInitDict')\n\n super(type, eventInitDict)\n\n this.#eventInit = eventInitDict\n webidl.util.markAsUncloneable(this)\n }\n\n get data () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.data\n }\n\n get origin () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.origin\n }\n\n get lastEventId () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.lastEventId\n }\n\n get source () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.source\n }\n\n get ports () {\n webidl.brandCheck(this, MessageEvent)\n\n if (!Object.isFrozen(this.#eventInit.ports)) {\n Object.freeze(this.#eventInit.ports)\n }\n\n return this.#eventInit.ports\n }\n\n initMessageEvent (\n type,\n bubbles = false,\n cancelable = false,\n data = null,\n origin = '',\n lastEventId = '',\n source = null,\n ports = []\n ) {\n webidl.brandCheck(this, MessageEvent)\n\n webidl.argumentLengthCheck(arguments, 1, 'MessageEvent.initMessageEvent')\n\n return new MessageEvent(type, {\n bubbles, cancelable, data, origin, lastEventId, source, ports\n })\n }\n\n static createFastMessageEvent (type, init) {\n const messageEvent = new MessageEvent(kConstruct, type, init)\n messageEvent.#eventInit = init\n messageEvent.#eventInit.data ??= null\n messageEvent.#eventInit.origin ??= ''\n messageEvent.#eventInit.lastEventId ??= ''\n messageEvent.#eventInit.source ??= null\n messageEvent.#eventInit.ports ??= []\n return messageEvent\n }\n}\n\nconst { createFastMessageEvent } = MessageEvent\ndelete MessageEvent.createFastMessageEvent\n\n/**\n * @see https://websockets.spec.whatwg.org/#the-closeevent-interface\n */\nclass CloseEvent extends Event {\n #eventInit\n\n constructor (type, eventInitDict = {}) {\n const prefix = 'CloseEvent constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n type = webidl.converters.DOMString(type, prefix, 'type')\n eventInitDict = webidl.converters.CloseEventInit(eventInitDict)\n\n super(type, eventInitDict)\n\n this.#eventInit = eventInitDict\n webidl.util.markAsUncloneable(this)\n }\n\n get wasClean () {\n webidl.brandCheck(this, CloseEvent)\n\n return this.#eventInit.wasClean\n }\n\n get code () {\n webidl.brandCheck(this, CloseEvent)\n\n return this.#eventInit.code\n }\n\n get reason () {\n webidl.brandCheck(this, CloseEvent)\n\n return this.#eventInit.reason\n }\n}\n\n// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface\nclass ErrorEvent extends Event {\n #eventInit\n\n constructor (type, eventInitDict) {\n const prefix = 'ErrorEvent constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n super(type, eventInitDict)\n webidl.util.markAsUncloneable(this)\n\n type = webidl.converters.DOMString(type, prefix, 'type')\n eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})\n\n this.#eventInit = eventInitDict\n }\n\n get message () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.message\n }\n\n get filename () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.filename\n }\n\n get lineno () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.lineno\n }\n\n get colno () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.colno\n }\n\n get error () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.error\n }\n}\n\nObject.defineProperties(MessageEvent.prototype, {\n [Symbol.toStringTag]: {\n value: 'MessageEvent',\n configurable: true\n },\n data: kEnumerableProperty,\n origin: kEnumerableProperty,\n lastEventId: kEnumerableProperty,\n source: kEnumerableProperty,\n ports: kEnumerableProperty,\n initMessageEvent: kEnumerableProperty\n})\n\nObject.defineProperties(CloseEvent.prototype, {\n [Symbol.toStringTag]: {\n value: 'CloseEvent',\n configurable: true\n },\n reason: kEnumerableProperty,\n code: kEnumerableProperty,\n wasClean: kEnumerableProperty\n})\n\nObject.defineProperties(ErrorEvent.prototype, {\n [Symbol.toStringTag]: {\n value: 'ErrorEvent',\n configurable: true\n },\n message: kEnumerableProperty,\n filename: kEnumerableProperty,\n lineno: kEnumerableProperty,\n colno: kEnumerableProperty,\n error: kEnumerableProperty\n})\n\nwebidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.MessagePort\n)\n\nconst eventInit = [\n {\n key: 'bubbles',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'cancelable',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'composed',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n }\n]\n\nwebidl.converters.MessageEventInit = webidl.dictionaryConverter([\n ...eventInit,\n {\n key: 'data',\n converter: webidl.converters.any,\n defaultValue: () => null\n },\n {\n key: 'origin',\n converter: webidl.converters.USVString,\n defaultValue: () => ''\n },\n {\n key: 'lastEventId',\n converter: webidl.converters.DOMString,\n defaultValue: () => ''\n },\n {\n key: 'source',\n // Node doesn't implement WindowProxy or ServiceWorker, so the only\n // valid value for source is a MessagePort.\n converter: webidl.nullableConverter(webidl.converters.MessagePort),\n defaultValue: () => null\n },\n {\n key: 'ports',\n converter: webidl.converters['sequence'],\n defaultValue: () => new Array(0)\n }\n])\n\nwebidl.converters.CloseEventInit = webidl.dictionaryConverter([\n ...eventInit,\n {\n key: 'wasClean',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'code',\n converter: webidl.converters['unsigned short'],\n defaultValue: () => 0\n },\n {\n key: 'reason',\n converter: webidl.converters.USVString,\n defaultValue: () => ''\n }\n])\n\nwebidl.converters.ErrorEventInit = webidl.dictionaryConverter([\n ...eventInit,\n {\n key: 'message',\n converter: webidl.converters.DOMString,\n defaultValue: () => ''\n },\n {\n key: 'filename',\n converter: webidl.converters.USVString,\n defaultValue: () => ''\n },\n {\n key: 'lineno',\n converter: webidl.converters['unsigned long'],\n defaultValue: () => 0\n },\n {\n key: 'colno',\n converter: webidl.converters['unsigned long'],\n defaultValue: () => 0\n },\n {\n key: 'error',\n converter: webidl.converters.any\n }\n])\n\nmodule.exports = {\n MessageEvent,\n CloseEvent,\n ErrorEvent,\n createFastMessageEvent\n}\n","'use strict'\n\n// This is a Globally Unique Identifier unique used\n// to validate that the endpoint accepts websocket\n// connections.\n// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3\nconst uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n enumerable: true,\n writable: false,\n configurable: false\n}\n\nconst states = {\n CONNECTING: 0,\n OPEN: 1,\n CLOSING: 2,\n CLOSED: 3\n}\n\nconst sentCloseFrameState = {\n NOT_SENT: 0,\n PROCESSING: 1,\n SENT: 2\n}\n\nconst opcodes = {\n CONTINUATION: 0x0,\n TEXT: 0x1,\n BINARY: 0x2,\n CLOSE: 0x8,\n PING: 0x9,\n PONG: 0xA\n}\n\nconst maxUnsigned16Bit = 2 ** 16 - 1 // 65535\n\nconst parserStates = {\n INFO: 0,\n PAYLOADLENGTH_16: 2,\n PAYLOADLENGTH_64: 3,\n READ_DATA: 4\n}\n\nconst emptyBuffer = Buffer.allocUnsafe(0)\n\nconst sendHints = {\n string: 1,\n typedArray: 2,\n arrayBuffer: 3,\n blob: 4\n}\n\nmodule.exports = {\n uid,\n sentCloseFrameState,\n staticPropertyDescriptors,\n states,\n opcodes,\n maxUnsigned16Bit,\n parserStates,\n emptyBuffer,\n sendHints\n}\n","'use strict'\n\nmodule.exports = {\n kWebSocketURL: Symbol('url'),\n kReadyState: Symbol('ready state'),\n kController: Symbol('controller'),\n kResponse: Symbol('response'),\n kBinaryType: Symbol('binary type'),\n kSentClose: Symbol('sent close'),\n kReceivedClose: Symbol('received close'),\n kByteParser: Symbol('byte parser')\n}\n","'use strict'\n\nconst { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require('./symbols')\nconst { states, opcodes } = require('./constants')\nconst { ErrorEvent, createFastMessageEvent } = require('./events')\nconst { isUtf8 } = require('node:buffer')\nconst { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = require('../fetch/data-url')\n\n/* globals Blob */\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isConnecting (ws) {\n // If the WebSocket connection is not yet established, and the connection\n // is not yet closed, then the WebSocket connection is in the CONNECTING state.\n return ws[kReadyState] === states.CONNECTING\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isEstablished (ws) {\n // If the server's response is validated as provided for above, it is\n // said that _The WebSocket Connection is Established_ and that the\n // WebSocket Connection is in the OPEN state.\n return ws[kReadyState] === states.OPEN\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isClosing (ws) {\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n return ws[kReadyState] === states.CLOSING\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @returns {boolean}\n */\nfunction isClosed (ws) {\n return ws[kReadyState] === states.CLOSED\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e\n * @param {EventTarget} target\n * @param {(...args: ConstructorParameters) => Event} eventFactory\n * @param {EventInit | undefined} eventInitDict\n */\nfunction fireEvent (e, target, eventFactory = (type, init) => new Event(type, init), eventInitDict = {}) {\n // 1. If eventConstructor is not given, then let eventConstructor be Event.\n\n // 2. Let event be the result of creating an event given eventConstructor,\n // in the relevant realm of target.\n // 3. Initialize event’s type attribute to e.\n const event = eventFactory(e, eventInitDict)\n\n // 4. Initialize any other IDL attributes of event as described in the\n // invocation of this algorithm.\n\n // 5. Return the result of dispatching event at target, with legacy target\n // override flag set if set.\n target.dispatchEvent(event)\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @param {import('./websocket').WebSocket} ws\n * @param {number} type Opcode\n * @param {Buffer} data application data\n */\nfunction websocketMessageReceived (ws, type, data) {\n // 1. If ready state is not OPEN (1), then return.\n if (ws[kReadyState] !== states.OPEN) {\n return\n }\n\n // 2. Let dataForEvent be determined by switching on type and binary type:\n let dataForEvent\n\n if (type === opcodes.TEXT) {\n // -> type indicates that the data is Text\n // a new DOMString containing data\n try {\n dataForEvent = utf8Decode(data)\n } catch {\n failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')\n return\n }\n } else if (type === opcodes.BINARY) {\n if (ws[kBinaryType] === 'blob') {\n // -> type indicates that the data is Binary and binary type is \"blob\"\n // a new Blob object, created in the relevant Realm of the WebSocket\n // object, that represents data as its raw data\n dataForEvent = new Blob([data])\n } else {\n // -> type indicates that the data is Binary and binary type is \"arraybuffer\"\n // a new ArrayBuffer object, created in the relevant Realm of the\n // WebSocket object, whose contents are data\n dataForEvent = toArrayBuffer(data)\n }\n }\n\n // 3. Fire an event named message at the WebSocket object, using MessageEvent,\n // with the origin attribute initialized to the serialization of the WebSocket\n // object’s url's origin, and the data attribute initialized to dataForEvent.\n fireEvent('message', ws, createFastMessageEvent, {\n origin: ws[kWebSocketURL].origin,\n data: dataForEvent\n })\n}\n\nfunction toArrayBuffer (buffer) {\n if (buffer.byteLength === buffer.buffer.byteLength) {\n return buffer.buffer\n }\n return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength)\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455\n * @see https://datatracker.ietf.org/doc/html/rfc2616\n * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407\n * @param {string} protocol\n */\nfunction isValidSubprotocol (protocol) {\n // If present, this value indicates one\n // or more comma-separated subprotocol the client wishes to speak,\n // ordered by preference. The elements that comprise this value\n // MUST be non-empty strings with characters in the range U+0021 to\n // U+007E not including separator characters as defined in\n // [RFC2616] and MUST all be unique strings.\n if (protocol.length === 0) {\n return false\n }\n\n for (let i = 0; i < protocol.length; ++i) {\n const code = protocol.charCodeAt(i)\n\n if (\n code < 0x21 || // CTL, contains SP (0x20) and HT (0x09)\n code > 0x7E ||\n code === 0x22 || // \"\n code === 0x28 || // (\n code === 0x29 || // )\n code === 0x2C || // ,\n code === 0x2F || // /\n code === 0x3A || // :\n code === 0x3B || // ;\n code === 0x3C || // <\n code === 0x3D || // =\n code === 0x3E || // >\n code === 0x3F || // ?\n code === 0x40 || // @\n code === 0x5B || // [\n code === 0x5C || // \\\n code === 0x5D || // ]\n code === 0x7B || // {\n code === 0x7D // }\n ) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4\n * @param {number} code\n */\nfunction isValidStatusCode (code) {\n if (code >= 1000 && code < 1015) {\n return (\n code !== 1004 && // reserved\n code !== 1005 && // \"MUST NOT be set as a status code\"\n code !== 1006 // \"MUST NOT be set as a status code\"\n )\n }\n\n return code >= 3000 && code <= 4999\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @param {string|undefined} reason\n */\nfunction failWebsocketConnection (ws, reason) {\n const { [kController]: controller, [kResponse]: response } = ws\n\n controller.abort()\n\n if (response?.socket && !response.socket.destroyed) {\n response.socket.destroy()\n }\n\n if (reason) {\n // TODO: process.nextTick\n fireEvent('error', ws, (type, init) => new ErrorEvent(type, init), {\n error: new Error(reason),\n message: reason\n })\n }\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-5.5\n * @param {number} opcode\n */\nfunction isControlFrame (opcode) {\n return (\n opcode === opcodes.CLOSE ||\n opcode === opcodes.PING ||\n opcode === opcodes.PONG\n )\n}\n\nfunction isContinuationFrame (opcode) {\n return opcode === opcodes.CONTINUATION\n}\n\nfunction isTextBinaryFrame (opcode) {\n return opcode === opcodes.TEXT || opcode === opcodes.BINARY\n}\n\nfunction isValidOpcode (opcode) {\n return isTextBinaryFrame(opcode) || isContinuationFrame(opcode) || isControlFrame(opcode)\n}\n\n/**\n * Parses a Sec-WebSocket-Extensions header value.\n * @param {string} extensions\n * @returns {Map}\n */\n// TODO(@Uzlopak, @KhafraDev): make compliant https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\nfunction parseExtensions (extensions) {\n const position = { position: 0 }\n const extensionList = new Map()\n\n while (position.position < extensions.length) {\n const pair = collectASequenceOfCodePointsFast(';', extensions, position)\n const [name, value = ''] = pair.split('=')\n\n extensionList.set(\n removeHTTPWhitespace(name, true, false),\n removeHTTPWhitespace(value, false, true)\n )\n\n position.position++\n }\n\n return extensionList\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7692#section-7.1.2.2\n * @description \"client-max-window-bits = 1*DIGIT\"\n * @param {string} value\n */\nfunction isValidClientWindowBits (value) {\n // Must have at least one character\n if (value.length === 0) {\n return false\n }\n\n // Check all characters are ASCII digits\n for (let i = 0; i < value.length; i++) {\n const byte = value.charCodeAt(i)\n\n if (byte < 0x30 || byte > 0x39) {\n return false\n }\n }\n\n // Check numeric range: zlib requires windowBits in range 8-15\n const num = Number.parseInt(value, 10)\n return num >= 8 && num <= 15\n}\n\n// https://nodejs.org/api/intl.html#detecting-internationalization-support\nconst hasIntl = typeof process.versions.icu === 'string'\nconst fatalDecoder = hasIntl ? new TextDecoder('utf-8', { fatal: true }) : undefined\n\n/**\n * Converts a Buffer to utf-8, even on platforms without icu.\n * @param {Buffer} buffer\n */\nconst utf8Decode = hasIntl\n ? fatalDecoder.decode.bind(fatalDecoder)\n : function (buffer) {\n if (isUtf8(buffer)) {\n return buffer.toString('utf-8')\n }\n throw new TypeError('Invalid utf-8 received.')\n }\n\nmodule.exports = {\n isConnecting,\n isEstablished,\n isClosing,\n isClosed,\n fireEvent,\n isValidSubprotocol,\n isValidStatusCode,\n failWebsocketConnection,\n websocketMessageReceived,\n utf8Decode,\n isControlFrame,\n isContinuationFrame,\n isTextBinaryFrame,\n isValidOpcode,\n parseExtensions,\n isValidClientWindowBits\n}\n","'use strict'\n\nconst { maxUnsigned16Bit } = require('./constants')\n\nconst BUFFER_SIZE = 16386\n\n/** @type {import('crypto')} */\nlet crypto\nlet buffer = null\nlet bufIdx = BUFFER_SIZE\n\ntry {\n crypto = require('node:crypto')\n/* c8 ignore next 3 */\n} catch {\n crypto = {\n // not full compatibility, but minimum.\n randomFillSync: function randomFillSync (buffer, _offset, _size) {\n for (let i = 0; i < buffer.length; ++i) {\n buffer[i] = Math.random() * 255 | 0\n }\n return buffer\n }\n }\n}\n\nfunction generateMask () {\n if (bufIdx === BUFFER_SIZE) {\n bufIdx = 0\n crypto.randomFillSync((buffer ??= Buffer.allocUnsafe(BUFFER_SIZE)), 0, BUFFER_SIZE)\n }\n return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]]\n}\n\nclass WebsocketFrameSend {\n /**\n * @param {Buffer|undefined} data\n */\n constructor (data) {\n this.frameData = data\n }\n\n createFrame (opcode) {\n const frameData = this.frameData\n const maskKey = generateMask()\n const bodyLength = frameData?.byteLength ?? 0\n\n /** @type {number} */\n let payloadLength = bodyLength // 0-125\n let offset = 6\n\n if (bodyLength > maxUnsigned16Bit) {\n offset += 8 // payload length is next 8 bytes\n payloadLength = 127\n } else if (bodyLength > 125) {\n offset += 2 // payload length is next 2 bytes\n payloadLength = 126\n }\n\n const buffer = Buffer.allocUnsafe(bodyLength + offset)\n\n // Clear first 2 bytes, everything else is overwritten\n buffer[0] = buffer[1] = 0\n buffer[0] |= 0x80 // FIN\n buffer[0] = (buffer[0] & 0xF0) + opcode // opcode\n\n /*! ws. MIT License. Einar Otto Stangvik */\n buffer[offset - 4] = maskKey[0]\n buffer[offset - 3] = maskKey[1]\n buffer[offset - 2] = maskKey[2]\n buffer[offset - 1] = maskKey[3]\n\n buffer[1] = payloadLength\n\n if (payloadLength === 126) {\n buffer.writeUInt16BE(bodyLength, 2)\n } else if (payloadLength === 127) {\n // Clear extended payload length\n buffer[2] = buffer[3] = 0\n buffer.writeUIntBE(bodyLength, 4, 6)\n }\n\n buffer[1] |= 0x80 // MASK\n\n // mask body\n for (let i = 0; i < bodyLength; ++i) {\n buffer[offset + i] = frameData[i] ^ maskKey[i & 3]\n }\n\n return buffer\n }\n}\n\nmodule.exports = {\n WebsocketFrameSend\n}\n","'use strict'\n\nconst { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = require('./constants')\nconst {\n kReadyState,\n kSentClose,\n kByteParser,\n kReceivedClose,\n kResponse\n} = require('./symbols')\nconst { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = require('./util')\nconst { channels } = require('../../core/diagnostics')\nconst { CloseEvent } = require('./events')\nconst { makeRequest } = require('../fetch/request')\nconst { fetching } = require('../fetch/index')\nconst { Headers, getHeadersList } = require('../fetch/headers')\nconst { getDecodeSplit } = require('../fetch/util')\nconst { WebsocketFrameSend } = require('./frame')\n\n/** @type {import('crypto')} */\nlet crypto\ntry {\n crypto = require('node:crypto')\n/* c8 ignore next 3 */\n} catch {\n\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#concept-websocket-establish\n * @param {URL} url\n * @param {string|string[]} protocols\n * @param {import('./websocket').WebSocket} ws\n * @param {(response: any, extensions: string[] | undefined) => void} onEstablish\n * @param {Partial} options\n */\nfunction establishWebSocketConnection (url, protocols, client, ws, onEstablish, options) {\n // 1. Let requestURL be a copy of url, with its scheme set to \"http\", if url’s\n // scheme is \"ws\", and to \"https\" otherwise.\n const requestURL = url\n\n requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'\n\n // 2. Let request be a new request, whose URL is requestURL, client is client,\n // service-workers mode is \"none\", referrer is \"no-referrer\", mode is\n // \"websocket\", credentials mode is \"include\", cache mode is \"no-store\" ,\n // and redirect mode is \"error\".\n const request = makeRequest({\n urlList: [requestURL],\n client,\n serviceWorkers: 'none',\n referrer: 'no-referrer',\n mode: 'websocket',\n credentials: 'include',\n cache: 'no-store',\n redirect: 'error'\n })\n\n // Note: undici extension, allow setting custom headers.\n if (options.headers) {\n const headersList = getHeadersList(new Headers(options.headers))\n\n request.headersList = headersList\n }\n\n // 3. Append (`Upgrade`, `websocket`) to request’s header list.\n // 4. Append (`Connection`, `Upgrade`) to request’s header list.\n // Note: both of these are handled by undici currently.\n // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397\n\n // 5. Let keyValue be a nonce consisting of a randomly selected\n // 16-byte value that has been forgiving-base64-encoded and\n // isomorphic encoded.\n const keyValue = crypto.randomBytes(16).toString('base64')\n\n // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s\n // header list.\n request.headersList.append('sec-websocket-key', keyValue)\n\n // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s\n // header list.\n request.headersList.append('sec-websocket-version', '13')\n\n // 8. For each protocol in protocols, combine\n // (`Sec-WebSocket-Protocol`, protocol) in request’s header\n // list.\n for (const protocol of protocols) {\n request.headersList.append('sec-websocket-protocol', protocol)\n }\n\n // 9. Let permessageDeflate be a user-agent defined\n // \"permessage-deflate\" extension header value.\n // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673\n const permessageDeflate = 'permessage-deflate; client_max_window_bits'\n\n // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to\n // request’s header list.\n request.headersList.append('sec-websocket-extensions', permessageDeflate)\n\n // 11. Fetch request with useParallelQueue set to true, and\n // processResponse given response being these steps:\n const controller = fetching({\n request,\n useParallelQueue: true,\n dispatcher: options.dispatcher,\n processResponse (response) {\n // 1. If response is a network error or its status is not 101,\n // fail the WebSocket connection.\n if (response.type === 'error' || response.status !== 101) {\n failWebsocketConnection(ws, 'Received network error or non-101 status code.')\n return\n }\n\n // 2. If protocols is not the empty list and extracting header\n // list values given `Sec-WebSocket-Protocol` and response’s\n // header list results in null, failure, or the empty byte\n // sequence, then fail the WebSocket connection.\n if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {\n failWebsocketConnection(ws, 'Server did not respond with sent protocols.')\n return\n }\n\n // 3. Follow the requirements stated step 2 to step 6, inclusive,\n // of the last set of steps in section 4.1 of The WebSocket\n // Protocol to validate response. This either results in fail\n // the WebSocket connection or the WebSocket connection is\n // established.\n\n // 2. If the response lacks an |Upgrade| header field or the |Upgrade|\n // header field contains a value that is not an ASCII case-\n // insensitive match for the value \"websocket\", the client MUST\n // _Fail the WebSocket Connection_.\n if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {\n failWebsocketConnection(ws, 'Server did not set Upgrade header to \"websocket\".')\n return\n }\n\n // 3. If the response lacks a |Connection| header field or the\n // |Connection| header field doesn't contain a token that is an\n // ASCII case-insensitive match for the value \"Upgrade\", the client\n // MUST _Fail the WebSocket Connection_.\n if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {\n failWebsocketConnection(ws, 'Server did not set Connection header to \"upgrade\".')\n return\n }\n\n // 4. If the response lacks a |Sec-WebSocket-Accept| header field or\n // the |Sec-WebSocket-Accept| contains a value other than the\n // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-\n // Key| (as a string, not base64-decoded) with the string \"258EAFA5-\n // E914-47DA-95CA-C5AB0DC85B11\" but ignoring any leading and\n // trailing whitespace, the client MUST _Fail the WebSocket\n // Connection_.\n const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')\n const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')\n if (secWSAccept !== digest) {\n failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')\n return\n }\n\n // 5. If the response includes a |Sec-WebSocket-Extensions| header\n // field and this header field indicates the use of an extension\n // that was not present in the client's handshake (the server has\n // indicated an extension not requested by the client), the client\n // MUST _Fail the WebSocket Connection_. (The parsing of this\n // header field to determine which extensions are requested is\n // discussed in Section 9.1.)\n const secExtension = response.headersList.get('Sec-WebSocket-Extensions')\n let extensions\n\n if (secExtension !== null) {\n extensions = parseExtensions(secExtension)\n\n if (!extensions.has('permessage-deflate')) {\n failWebsocketConnection(ws, 'Sec-WebSocket-Extensions header does not match.')\n return\n }\n }\n\n // 6. If the response includes a |Sec-WebSocket-Protocol| header field\n // and this header field indicates the use of a subprotocol that was\n // not present in the client's handshake (the server has indicated a\n // subprotocol not requested by the client), the client MUST _Fail\n // the WebSocket Connection_.\n const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')\n\n if (secProtocol !== null) {\n const requestProtocols = getDecodeSplit('sec-websocket-protocol', request.headersList)\n\n // The client can request that the server use a specific subprotocol by\n // including the |Sec-WebSocket-Protocol| field in its handshake. If it\n // is specified, the server needs to include the same field and one of\n // the selected subprotocol values in its response for the connection to\n // be established.\n if (!requestProtocols.includes(secProtocol)) {\n failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')\n return\n }\n }\n\n response.socket.on('data', onSocketData)\n response.socket.on('close', onSocketClose)\n response.socket.on('error', onSocketError)\n\n if (channels.open.hasSubscribers) {\n channels.open.publish({\n address: response.socket.address(),\n protocol: secProtocol,\n extensions: secExtension\n })\n }\n\n onEstablish(response, extensions)\n }\n })\n\n return controller\n}\n\nfunction closeWebSocketConnection (ws, code, reason, reasonByteLength) {\n if (isClosing(ws) || isClosed(ws)) {\n // If this's ready state is CLOSING (2) or CLOSED (3)\n // Do nothing.\n } else if (!isEstablished(ws)) {\n // If the WebSocket connection is not yet established\n // Fail the WebSocket connection and set this's ready state\n // to CLOSING (2).\n failWebsocketConnection(ws, 'Connection was closed before it was established.')\n ws[kReadyState] = states.CLOSING\n } else if (ws[kSentClose] === sentCloseFrameState.NOT_SENT) {\n // If the WebSocket closing handshake has not yet been started\n // Start the WebSocket closing handshake and set this's ready\n // state to CLOSING (2).\n // - If neither code nor reason is present, the WebSocket Close\n // message must not have a body.\n // - If code is present, then the status code to use in the\n // WebSocket Close message must be the integer given by code.\n // - If reason is also present, then reasonBytes must be\n // provided in the Close message after the status code.\n\n ws[kSentClose] = sentCloseFrameState.PROCESSING\n\n const frame = new WebsocketFrameSend()\n\n // If neither code nor reason is present, the WebSocket Close\n // message must not have a body.\n\n // If code is present, then the status code to use in the\n // WebSocket Close message must be the integer given by code.\n if (code !== undefined && reason === undefined) {\n frame.frameData = Buffer.allocUnsafe(2)\n frame.frameData.writeUInt16BE(code, 0)\n } else if (code !== undefined && reason !== undefined) {\n // If reason is also present, then reasonBytes must be\n // provided in the Close message after the status code.\n frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)\n frame.frameData.writeUInt16BE(code, 0)\n // the body MAY contain UTF-8-encoded data with value /reason/\n frame.frameData.write(reason, 2, 'utf-8')\n } else {\n frame.frameData = emptyBuffer\n }\n\n /** @type {import('stream').Duplex} */\n const socket = ws[kResponse].socket\n\n socket.write(frame.createFrame(opcodes.CLOSE))\n\n ws[kSentClose] = sentCloseFrameState.SENT\n\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n ws[kReadyState] = states.CLOSING\n } else {\n // Otherwise\n // Set this's ready state to CLOSING (2).\n ws[kReadyState] = states.CLOSING\n }\n}\n\n/**\n * @param {Buffer} chunk\n */\nfunction onSocketData (chunk) {\n if (!this.ws[kByteParser].write(chunk)) {\n this.pause()\n }\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4\n */\nfunction onSocketClose () {\n const { ws } = this\n const { [kResponse]: response } = ws\n\n response.socket.off('data', onSocketData)\n response.socket.off('close', onSocketClose)\n response.socket.off('error', onSocketError)\n\n // If the TCP connection was closed after the\n // WebSocket closing handshake was completed, the WebSocket connection\n // is said to have been closed _cleanly_.\n const wasClean = ws[kSentClose] === sentCloseFrameState.SENT && ws[kReceivedClose]\n\n let code = 1005\n let reason = ''\n\n const result = ws[kByteParser].closingInfo\n\n if (result && !result.error) {\n code = result.code ?? 1005\n reason = result.reason\n } else if (!ws[kReceivedClose]) {\n // If _The WebSocket\n // Connection is Closed_ and no Close control frame was received by the\n // endpoint (such as could occur if the underlying transport connection\n // is lost), _The WebSocket Connection Close Code_ is considered to be\n // 1006.\n code = 1006\n }\n\n // 1. Change the ready state to CLOSED (3).\n ws[kReadyState] = states.CLOSED\n\n // 2. If the user agent was required to fail the WebSocket\n // connection, or if the WebSocket connection was closed\n // after being flagged as full, fire an event named error\n // at the WebSocket object.\n // TODO\n\n // 3. Fire an event named close at the WebSocket object,\n // using CloseEvent, with the wasClean attribute\n // initialized to true if the connection closed cleanly\n // and false otherwise, the code attribute initialized to\n // the WebSocket connection close code, and the reason\n // attribute initialized to the result of applying UTF-8\n // decode without BOM to the WebSocket connection close\n // reason.\n // TODO: process.nextTick\n fireEvent('close', ws, (type, init) => new CloseEvent(type, init), {\n wasClean, code, reason\n })\n\n if (channels.close.hasSubscribers) {\n channels.close.publish({\n websocket: ws,\n code,\n reason\n })\n }\n}\n\nfunction onSocketError (error) {\n const { ws } = this\n\n ws[kReadyState] = states.CLOSING\n\n if (channels.socketError.hasSubscribers) {\n channels.socketError.publish(error)\n }\n\n this.destroy()\n}\n\nmodule.exports = {\n establishWebSocketConnection,\n closeWebSocketConnection\n}\n","'use strict'\n\nconst { createInflateRaw, Z_DEFAULT_WINDOWBITS } = require('node:zlib')\nconst { isValidClientWindowBits } = require('./util')\nconst { MessageSizeExceededError } = require('../../core/errors')\n\nconst tail = Buffer.from([0x00, 0x00, 0xff, 0xff])\nconst kBuffer = Symbol('kBuffer')\nconst kLength = Symbol('kLength')\n\nclass PerMessageDeflate {\n /** @type {import('node:zlib').InflateRaw} */\n #inflate\n\n #options = {}\n\n #maxPayloadSize = 0\n\n /**\n * @param {Map} extensions\n */\n constructor (extensions, options) {\n this.#options.serverNoContextTakeover = extensions.has('server_no_context_takeover')\n this.#options.serverMaxWindowBits = extensions.get('server_max_window_bits')\n\n this.#maxPayloadSize = options.maxPayloadSize\n }\n\n /**\n * Decompress a compressed payload.\n * @param {Buffer} chunk Compressed data\n * @param {boolean} fin Final fragment flag\n * @param {Function} callback Callback function\n */\n decompress (chunk, fin, callback) {\n // An endpoint uses the following algorithm to decompress a message.\n // 1. Append 4 octets of 0x00 0x00 0xff 0xff to the tail end of the\n // payload of the message.\n // 2. Decompress the resulting data using DEFLATE.\n if (!this.#inflate) {\n let windowBits = Z_DEFAULT_WINDOWBITS\n\n if (this.#options.serverMaxWindowBits) { // empty values default to Z_DEFAULT_WINDOWBITS\n if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) {\n callback(new Error('Invalid server_max_window_bits'))\n return\n }\n\n windowBits = Number.parseInt(this.#options.serverMaxWindowBits)\n }\n\n try {\n this.#inflate = createInflateRaw({ windowBits })\n } catch (err) {\n callback(err)\n return\n }\n this.#inflate[kBuffer] = []\n this.#inflate[kLength] = 0\n\n this.#inflate.on('data', (data) => {\n this.#inflate[kLength] += data.length\n\n if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {\n callback(new MessageSizeExceededError())\n this.#inflate.removeAllListeners()\n this.#inflate = null\n return\n }\n\n this.#inflate[kBuffer].push(data)\n })\n\n this.#inflate.on('error', (err) => {\n this.#inflate = null\n callback(err)\n })\n }\n\n this.#inflate.write(chunk)\n if (fin) {\n this.#inflate.write(tail)\n }\n\n this.#inflate.flush(() => {\n if (!this.#inflate) {\n return\n }\n\n const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength])\n\n this.#inflate[kBuffer].length = 0\n this.#inflate[kLength] = 0\n\n callback(null, full)\n })\n }\n}\n\nmodule.exports = { PerMessageDeflate }\n","'use strict'\n\nconst { Writable } = require('node:stream')\nconst assert = require('node:assert')\nconst { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require('./constants')\nconst { kReadyState, kSentClose, kResponse, kReceivedClose } = require('./symbols')\nconst { channels } = require('../../core/diagnostics')\nconst {\n isValidStatusCode,\n isValidOpcode,\n failWebsocketConnection,\n websocketMessageReceived,\n utf8Decode,\n isControlFrame,\n isTextBinaryFrame,\n isContinuationFrame\n} = require('./util')\nconst { WebsocketFrameSend } = require('./frame')\nconst { closeWebSocketConnection } = require('./connection')\nconst { PerMessageDeflate } = require('./permessage-deflate')\nconst { MessageSizeExceededError } = require('../../core/errors')\n\n// This code was influenced by ws released under the MIT license.\n// Copyright (c) 2011 Einar Otto Stangvik \n// Copyright (c) 2013 Arnout Kazemier and contributors\n// Copyright (c) 2016 Luigi Pinca and contributors\n\nclass ByteParser extends Writable {\n #buffers = []\n #fragmentsBytes = 0\n #byteOffset = 0\n #loop = false\n\n #state = parserStates.INFO\n\n #info = {}\n #fragments = []\n\n /** @type {Map} */\n #extensions\n\n /** @type {number} */\n #maxPayloadSize\n\n /**\n * @param {import('./websocket').WebSocket} ws\n * @param {Map|null} extensions\n * @param {{ maxPayloadSize?: number }} [options]\n */\n constructor (ws, extensions, options = {}) {\n super()\n\n this.ws = ws\n this.#extensions = extensions == null ? new Map() : extensions\n this.#maxPayloadSize = options.maxPayloadSize ?? 0\n\n if (this.#extensions.has('permessage-deflate')) {\n this.#extensions.set('permessage-deflate', new PerMessageDeflate(extensions, options))\n }\n }\n\n /**\n * @param {Buffer} chunk\n * @param {() => void} callback\n */\n _write (chunk, _, callback) {\n this.#buffers.push(chunk)\n this.#byteOffset += chunk.length\n this.#loop = true\n\n this.run(callback)\n }\n\n #validatePayloadLength () {\n if (\n this.#maxPayloadSize > 0 &&\n !isControlFrame(this.#info.opcode) &&\n this.#info.payloadLength > this.#maxPayloadSize\n ) {\n failWebsocketConnection(this.ws, 'Payload size exceeds maximum allowed size')\n return false\n }\n\n return true\n }\n\n /**\n * Runs whenever a new chunk is received.\n * Callback is called whenever there are no more chunks buffering,\n * or not enough bytes are buffered to parse.\n */\n run (callback) {\n while (this.#loop) {\n if (this.#state === parserStates.INFO) {\n // If there aren't enough bytes to parse the payload length, etc.\n if (this.#byteOffset < 2) {\n return callback()\n }\n\n const buffer = this.consume(2)\n const fin = (buffer[0] & 0x80) !== 0\n const opcode = buffer[0] & 0x0F\n const masked = (buffer[1] & 0x80) === 0x80\n\n const fragmented = !fin && opcode !== opcodes.CONTINUATION\n const payloadLength = buffer[1] & 0x7F\n\n const rsv1 = buffer[0] & 0x40\n const rsv2 = buffer[0] & 0x20\n const rsv3 = buffer[0] & 0x10\n\n if (!isValidOpcode(opcode)) {\n failWebsocketConnection(this.ws, 'Invalid opcode received')\n return callback()\n }\n\n if (masked) {\n failWebsocketConnection(this.ws, 'Frame cannot be masked')\n return callback()\n }\n\n // MUST be 0 unless an extension is negotiated that defines meanings\n // for non-zero values. If a nonzero value is received and none of\n // the negotiated extensions defines the meaning of such a nonzero\n // value, the receiving endpoint MUST _Fail the WebSocket\n // Connection_.\n // This document allocates the RSV1 bit of the WebSocket header for\n // PMCEs and calls the bit the \"Per-Message Compressed\" bit. On a\n // WebSocket connection where a PMCE is in use, this bit indicates\n // whether a message is compressed or not.\n if (rsv1 !== 0 && !this.#extensions.has('permessage-deflate')) {\n failWebsocketConnection(this.ws, 'Expected RSV1 to be clear.')\n return\n }\n\n if (rsv2 !== 0 || rsv3 !== 0) {\n failWebsocketConnection(this.ws, 'RSV1, RSV2, RSV3 must be clear')\n return\n }\n\n if (fragmented && !isTextBinaryFrame(opcode)) {\n // Only text and binary frames can be fragmented\n failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')\n return\n }\n\n // If we are already parsing a text/binary frame and do not receive either\n // a continuation frame or close frame, fail the connection.\n if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) {\n failWebsocketConnection(this.ws, 'Expected continuation frame')\n return\n }\n\n if (this.#info.fragmented && fragmented) {\n // A fragmented frame can't be fragmented itself\n failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')\n return\n }\n\n // \"All control frames MUST have a payload length of 125 bytes or less\n // and MUST NOT be fragmented.\"\n if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) {\n failWebsocketConnection(this.ws, 'Control frame either too large or fragmented')\n return\n }\n\n if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) {\n failWebsocketConnection(this.ws, 'Unexpected continuation frame')\n return\n }\n\n if (payloadLength <= 125) {\n this.#info.payloadLength = payloadLength\n this.#state = parserStates.READ_DATA\n\n if (!this.#validatePayloadLength()) {\n return\n }\n } else if (payloadLength === 126) {\n this.#state = parserStates.PAYLOADLENGTH_16\n } else if (payloadLength === 127) {\n this.#state = parserStates.PAYLOADLENGTH_64\n }\n\n if (isTextBinaryFrame(opcode)) {\n this.#info.binaryType = opcode\n this.#info.compressed = rsv1 !== 0\n }\n\n this.#info.opcode = opcode\n this.#info.masked = masked\n this.#info.fin = fin\n this.#info.fragmented = fragmented\n } else if (this.#state === parserStates.PAYLOADLENGTH_16) {\n if (this.#byteOffset < 2) {\n return callback()\n }\n\n const buffer = this.consume(2)\n\n this.#info.payloadLength = buffer.readUInt16BE(0)\n this.#state = parserStates.READ_DATA\n\n if (!this.#validatePayloadLength()) {\n return\n }\n } else if (this.#state === parserStates.PAYLOADLENGTH_64) {\n if (this.#byteOffset < 8) {\n return callback()\n }\n\n const buffer = this.consume(8)\n const upper = buffer.readUInt32BE(0)\n const lower = buffer.readUInt32BE(4)\n\n // 2^31 is the maximum bytes an arraybuffer can contain\n // on 32-bit systems. Although, on 64-bit systems, this is\n // 2^53-1 bytes.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length\n // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275\n // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e\n if (upper !== 0 || lower > 2 ** 31 - 1) {\n failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')\n return\n }\n\n this.#info.payloadLength = lower\n this.#state = parserStates.READ_DATA\n\n if (!this.#validatePayloadLength()) {\n return\n }\n } else if (this.#state === parserStates.READ_DATA) {\n if (this.#byteOffset < this.#info.payloadLength) {\n return callback()\n }\n\n const body = this.consume(this.#info.payloadLength)\n\n if (isControlFrame(this.#info.opcode)) {\n this.#loop = this.parseControlFrame(body)\n this.#state = parserStates.INFO\n } else {\n if (!this.#info.compressed) {\n this.writeFragments(body)\n\n if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {\n failWebsocketConnection(this.ws, new MessageSizeExceededError().message)\n return\n }\n\n // If the frame is not fragmented, a message has been received.\n // If the frame is fragmented, it will terminate with a fin bit set\n // and an opcode of 0 (continuation), therefore we handle that when\n // parsing continuation frames, not here.\n if (!this.#info.fragmented && this.#info.fin) {\n websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())\n }\n\n this.#state = parserStates.INFO\n } else {\n this.#extensions.get('permessage-deflate').decompress(\n body,\n this.#info.fin,\n (error, data) => {\n if (error) {\n failWebsocketConnection(this.ws, error.message)\n return\n }\n\n this.writeFragments(data)\n\n if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {\n failWebsocketConnection(this.ws, new MessageSizeExceededError().message)\n return\n }\n\n if (!this.#info.fin) {\n this.#state = parserStates.INFO\n this.#loop = true\n this.run(callback)\n return\n }\n\n websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())\n\n this.#loop = true\n this.#state = parserStates.INFO\n this.run(callback)\n }\n )\n\n this.#loop = false\n break\n }\n }\n }\n }\n }\n\n /**\n * Take n bytes from the buffered Buffers\n * @param {number} n\n * @returns {Buffer}\n */\n consume (n) {\n if (n > this.#byteOffset) {\n throw new Error('Called consume() before buffers satiated.')\n } else if (n === 0) {\n return emptyBuffer\n }\n\n if (this.#buffers[0].length === n) {\n this.#byteOffset -= this.#buffers[0].length\n return this.#buffers.shift()\n }\n\n const buffer = Buffer.allocUnsafe(n)\n let offset = 0\n\n while (offset !== n) {\n const next = this.#buffers[0]\n const { length } = next\n\n if (length + offset === n) {\n buffer.set(this.#buffers.shift(), offset)\n break\n } else if (length + offset > n) {\n buffer.set(next.subarray(0, n - offset), offset)\n this.#buffers[0] = next.subarray(n - offset)\n break\n } else {\n buffer.set(this.#buffers.shift(), offset)\n offset += next.length\n }\n }\n\n this.#byteOffset -= n\n\n return buffer\n }\n\n writeFragments (fragment) {\n this.#fragmentsBytes += fragment.length\n this.#fragments.push(fragment)\n }\n\n consumeFragments () {\n const fragments = this.#fragments\n\n if (fragments.length === 1) {\n this.#fragmentsBytes = 0\n return fragments.shift()\n }\n\n const output = Buffer.concat(fragments, this.#fragmentsBytes)\n this.#fragments = []\n this.#fragmentsBytes = 0\n\n return output\n }\n\n parseCloseBody (data) {\n assert(data.length !== 1)\n\n // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5\n /** @type {number|undefined} */\n let code\n\n if (data.length >= 2) {\n // _The WebSocket Connection Close Code_ is\n // defined as the status code (Section 7.4) contained in the first Close\n // control frame received by the application\n code = data.readUInt16BE(0)\n }\n\n if (code !== undefined && !isValidStatusCode(code)) {\n return { code: 1002, reason: 'Invalid status code', error: true }\n }\n\n // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6\n /** @type {Buffer} */\n let reason = data.subarray(2)\n\n // Remove BOM\n if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {\n reason = reason.subarray(3)\n }\n\n try {\n reason = utf8Decode(reason)\n } catch {\n return { code: 1007, reason: 'Invalid UTF-8', error: true }\n }\n\n return { code, reason, error: false }\n }\n\n /**\n * Parses control frames.\n * @param {Buffer} body\n */\n parseControlFrame (body) {\n const { opcode, payloadLength } = this.#info\n\n if (opcode === opcodes.CLOSE) {\n if (payloadLength === 1) {\n failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')\n return false\n }\n\n this.#info.closeInfo = this.parseCloseBody(body)\n\n if (this.#info.closeInfo.error) {\n const { code, reason } = this.#info.closeInfo\n\n closeWebSocketConnection(this.ws, code, reason, reason.length)\n failWebsocketConnection(this.ws, reason)\n return false\n }\n\n if (this.ws[kSentClose] !== sentCloseFrameState.SENT) {\n // If an endpoint receives a Close frame and did not previously send a\n // Close frame, the endpoint MUST send a Close frame in response. (When\n // sending a Close frame in response, the endpoint typically echos the\n // status code it received.)\n let body = emptyBuffer\n if (this.#info.closeInfo.code) {\n body = Buffer.allocUnsafe(2)\n body.writeUInt16BE(this.#info.closeInfo.code, 0)\n }\n const closeFrame = new WebsocketFrameSend(body)\n\n this.ws[kResponse].socket.write(\n closeFrame.createFrame(opcodes.CLOSE),\n (err) => {\n if (!err) {\n this.ws[kSentClose] = sentCloseFrameState.SENT\n }\n }\n )\n }\n\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n this.ws[kReadyState] = states.CLOSING\n this.ws[kReceivedClose] = true\n\n return false\n } else if (opcode === opcodes.PING) {\n // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in\n // response, unless it already received a Close frame.\n // A Pong frame sent in response to a Ping frame must have identical\n // \"Application data\"\n\n if (!this.ws[kReceivedClose]) {\n const frame = new WebsocketFrameSend(body)\n\n this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))\n\n if (channels.ping.hasSubscribers) {\n channels.ping.publish({\n payload: body\n })\n }\n }\n } else if (opcode === opcodes.PONG) {\n // A Pong frame MAY be sent unsolicited. This serves as a\n // unidirectional heartbeat. A response to an unsolicited Pong frame is\n // not expected.\n\n if (channels.pong.hasSubscribers) {\n channels.pong.publish({\n payload: body\n })\n }\n }\n\n return true\n }\n\n get closingInfo () {\n return this.#info.closeInfo\n }\n}\n\nmodule.exports = {\n ByteParser\n}\n","'use strict'\n\nconst { WebsocketFrameSend } = require('./frame')\nconst { opcodes, sendHints } = require('./constants')\nconst FixedQueue = require('../../dispatcher/fixed-queue')\n\n/** @type {typeof Uint8Array} */\nconst FastBuffer = Buffer[Symbol.species]\n\n/**\n * @typedef {object} SendQueueNode\n * @property {Promise | null} promise\n * @property {((...args: any[]) => any)} callback\n * @property {Buffer | null} frame\n */\n\nclass SendQueue {\n /**\n * @type {FixedQueue}\n */\n #queue = new FixedQueue()\n\n /**\n * @type {boolean}\n */\n #running = false\n\n /** @type {import('node:net').Socket} */\n #socket\n\n constructor (socket) {\n this.#socket = socket\n }\n\n add (item, cb, hint) {\n if (hint !== sendHints.blob) {\n const frame = createFrame(item, hint)\n if (!this.#running) {\n // fast-path\n this.#socket.write(frame, cb)\n } else {\n /** @type {SendQueueNode} */\n const node = {\n promise: null,\n callback: cb,\n frame\n }\n this.#queue.push(node)\n }\n return\n }\n\n /** @type {SendQueueNode} */\n const node = {\n promise: item.arrayBuffer().then((ab) => {\n node.promise = null\n node.frame = createFrame(ab, hint)\n }),\n callback: cb,\n frame: null\n }\n\n this.#queue.push(node)\n\n if (!this.#running) {\n this.#run()\n }\n }\n\n async #run () {\n this.#running = true\n const queue = this.#queue\n while (!queue.isEmpty()) {\n const node = queue.shift()\n // wait pending promise\n if (node.promise !== null) {\n await node.promise\n }\n // write\n this.#socket.write(node.frame, node.callback)\n // cleanup\n node.callback = node.frame = null\n }\n this.#running = false\n }\n}\n\nfunction createFrame (data, hint) {\n return new WebsocketFrameSend(toBuffer(data, hint)).createFrame(hint === sendHints.string ? opcodes.TEXT : opcodes.BINARY)\n}\n\nfunction toBuffer (data, hint) {\n switch (hint) {\n case sendHints.string:\n return Buffer.from(data)\n case sendHints.arrayBuffer:\n case sendHints.blob:\n return new FastBuffer(data)\n case sendHints.typedArray:\n return new FastBuffer(data.buffer, data.byteOffset, data.byteLength)\n }\n}\n\nmodule.exports = { SendQueue }\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { URLSerializer } = require('../fetch/data-url')\nconst { environmentSettingsObject } = require('../fetch/util')\nconst { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = require('./constants')\nconst {\n kWebSocketURL,\n kReadyState,\n kController,\n kBinaryType,\n kResponse,\n kSentClose,\n kByteParser\n} = require('./symbols')\nconst {\n isConnecting,\n isEstablished,\n isClosing,\n isValidSubprotocol,\n fireEvent\n} = require('./util')\nconst { establishWebSocketConnection, closeWebSocketConnection } = require('./connection')\nconst { ByteParser } = require('./receiver')\nconst { kEnumerableProperty, isBlobLike } = require('../../core/util')\nconst { getGlobalDispatcher } = require('../../global')\nconst { types } = require('node:util')\nconst { ErrorEvent, CloseEvent } = require('./events')\nconst { SendQueue } = require('./sender')\n\n// https://websockets.spec.whatwg.org/#interface-definition\nclass WebSocket extends EventTarget {\n #events = {\n open: null,\n error: null,\n close: null,\n message: null\n }\n\n #bufferedAmount = 0\n #protocol = ''\n #extensions = ''\n\n /** @type {SendQueue} */\n #sendQueue\n\n /**\n * @param {string} url\n * @param {string|string[]} protocols\n */\n constructor (url, protocols = []) {\n super()\n\n webidl.util.markAsUncloneable(this)\n\n const prefix = 'WebSocket constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols, prefix, 'options')\n\n url = webidl.converters.USVString(url, prefix, 'url')\n protocols = options.protocols\n\n // 1. Let baseURL be this's relevant settings object's API base URL.\n const baseURL = environmentSettingsObject.settingsObject.baseUrl\n\n // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.\n let urlRecord\n\n try {\n urlRecord = new URL(url, baseURL)\n } catch (e) {\n // 3. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n throw new DOMException(e, 'SyntaxError')\n }\n\n // 4. If urlRecord’s scheme is \"http\", then set urlRecord’s scheme to \"ws\".\n if (urlRecord.protocol === 'http:') {\n urlRecord.protocol = 'ws:'\n } else if (urlRecord.protocol === 'https:') {\n // 5. Otherwise, if urlRecord’s scheme is \"https\", set urlRecord’s scheme to \"wss\".\n urlRecord.protocol = 'wss:'\n }\n\n // 6. If urlRecord’s scheme is not \"ws\" or \"wss\", then throw a \"SyntaxError\" DOMException.\n if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {\n throw new DOMException(\n `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,\n 'SyntaxError'\n )\n }\n\n // 7. If urlRecord’s fragment is non-null, then throw a \"SyntaxError\"\n // DOMException.\n if (urlRecord.hash || urlRecord.href.endsWith('#')) {\n throw new DOMException('Got fragment', 'SyntaxError')\n }\n\n // 8. If protocols is a string, set protocols to a sequence consisting\n // of just that string.\n if (typeof protocols === 'string') {\n protocols = [protocols]\n }\n\n // 9. If any of the values in protocols occur more than once or otherwise\n // fail to match the requirements for elements that comprise the value\n // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket\n // protocol, then throw a \"SyntaxError\" DOMException.\n if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {\n throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n }\n\n if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {\n throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n }\n\n // 10. Set this's url to urlRecord.\n this[kWebSocketURL] = new URL(urlRecord.href)\n\n // 11. Let client be this's relevant settings object.\n const client = environmentSettingsObject.settingsObject\n\n // 12. Run this step in parallel:\n\n // 1. Establish a WebSocket connection given urlRecord, protocols,\n // and client.\n this[kController] = establishWebSocketConnection(\n urlRecord,\n protocols,\n client,\n this,\n (response, extensions) => this.#onConnectionEstablished(response, extensions),\n options\n )\n\n // Each WebSocket object has an associated ready state, which is a\n // number representing the state of the connection. Initially it must\n // be CONNECTING (0).\n this[kReadyState] = WebSocket.CONNECTING\n\n this[kSentClose] = sentCloseFrameState.NOT_SENT\n\n // The extensions attribute must initially return the empty string.\n\n // The protocol attribute must initially return the empty string.\n\n // Each WebSocket object has an associated binary type, which is a\n // BinaryType. Initially it must be \"blob\".\n this[kBinaryType] = 'blob'\n }\n\n /**\n * @see https://websockets.spec.whatwg.org/#dom-websocket-close\n * @param {number|undefined} code\n * @param {string|undefined} reason\n */\n close (code = undefined, reason = undefined) {\n webidl.brandCheck(this, WebSocket)\n\n const prefix = 'WebSocket.close'\n\n if (code !== undefined) {\n code = webidl.converters['unsigned short'](code, prefix, 'code', { clamp: true })\n }\n\n if (reason !== undefined) {\n reason = webidl.converters.USVString(reason, prefix, 'reason')\n }\n\n // 1. If code is present, but is neither an integer equal to 1000 nor an\n // integer in the range 3000 to 4999, inclusive, throw an\n // \"InvalidAccessError\" DOMException.\n if (code !== undefined) {\n if (code !== 1000 && (code < 3000 || code > 4999)) {\n throw new DOMException('invalid code', 'InvalidAccessError')\n }\n }\n\n let reasonByteLength = 0\n\n // 2. If reason is present, then run these substeps:\n if (reason !== undefined) {\n // 1. Let reasonBytes be the result of encoding reason.\n // 2. If reasonBytes is longer than 123 bytes, then throw a\n // \"SyntaxError\" DOMException.\n reasonByteLength = Buffer.byteLength(reason)\n\n if (reasonByteLength > 123) {\n throw new DOMException(\n `Reason must be less than 123 bytes; received ${reasonByteLength}`,\n 'SyntaxError'\n )\n }\n }\n\n // 3. Run the first matching steps from the following list:\n closeWebSocketConnection(this, code, reason, reasonByteLength)\n }\n\n /**\n * @see https://websockets.spec.whatwg.org/#dom-websocket-send\n * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data\n */\n send (data) {\n webidl.brandCheck(this, WebSocket)\n\n const prefix = 'WebSocket.send'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n data = webidl.converters.WebSocketSendData(data, prefix, 'data')\n\n // 1. If this's ready state is CONNECTING, then throw an\n // \"InvalidStateError\" DOMException.\n if (isConnecting(this)) {\n throw new DOMException('Sent before connected.', 'InvalidStateError')\n }\n\n // 2. Run the appropriate set of steps from the following list:\n // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1\n // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2\n\n if (!isEstablished(this) || isClosing(this)) {\n return\n }\n\n // If data is a string\n if (typeof data === 'string') {\n // If the WebSocket connection is established and the WebSocket\n // closing handshake has not yet started, then the user agent\n // must send a WebSocket Message comprised of the data argument\n // using a text frame opcode; if the data cannot be sent, e.g.\n // because it would need to be buffered but the buffer is full,\n // the user agent must flag the WebSocket as full and then close\n // the WebSocket connection. Any invocation of this method with a\n // string argument that does not throw an exception must increase\n // the bufferedAmount attribute by the number of bytes needed to\n // express the argument as UTF-8.\n\n const length = Buffer.byteLength(data)\n\n this.#bufferedAmount += length\n this.#sendQueue.add(data, () => {\n this.#bufferedAmount -= length\n }, sendHints.string)\n } else if (types.isArrayBuffer(data)) {\n // If the WebSocket connection is established, and the WebSocket\n // closing handshake has not yet started, then the user agent must\n // send a WebSocket Message comprised of data using a binary frame\n // opcode; if the data cannot be sent, e.g. because it would need\n // to be buffered but the buffer is full, the user agent must flag\n // the WebSocket as full and then close the WebSocket connection.\n // The data to be sent is the data stored in the buffer described\n // by the ArrayBuffer object. Any invocation of this method with an\n // ArrayBuffer argument that does not throw an exception must\n // increase the bufferedAmount attribute by the length of the\n // ArrayBuffer in bytes.\n\n this.#bufferedAmount += data.byteLength\n this.#sendQueue.add(data, () => {\n this.#bufferedAmount -= data.byteLength\n }, sendHints.arrayBuffer)\n } else if (ArrayBuffer.isView(data)) {\n // If the WebSocket connection is established, and the WebSocket\n // closing handshake has not yet started, then the user agent must\n // send a WebSocket Message comprised of data using a binary frame\n // opcode; if the data cannot be sent, e.g. because it would need to\n // be buffered but the buffer is full, the user agent must flag the\n // WebSocket as full and then close the WebSocket connection. The\n // data to be sent is the data stored in the section of the buffer\n // described by the ArrayBuffer object that data references. Any\n // invocation of this method with this kind of argument that does\n // not throw an exception must increase the bufferedAmount attribute\n // by the length of data’s buffer in bytes.\n\n this.#bufferedAmount += data.byteLength\n this.#sendQueue.add(data, () => {\n this.#bufferedAmount -= data.byteLength\n }, sendHints.typedArray)\n } else if (isBlobLike(data)) {\n // If the WebSocket connection is established, and the WebSocket\n // closing handshake has not yet started, then the user agent must\n // send a WebSocket Message comprised of data using a binary frame\n // opcode; if the data cannot be sent, e.g. because it would need to\n // be buffered but the buffer is full, the user agent must flag the\n // WebSocket as full and then close the WebSocket connection. The data\n // to be sent is the raw data represented by the Blob object. Any\n // invocation of this method with a Blob argument that does not throw\n // an exception must increase the bufferedAmount attribute by the size\n // of the Blob object’s raw data, in bytes.\n\n this.#bufferedAmount += data.size\n this.#sendQueue.add(data, () => {\n this.#bufferedAmount -= data.size\n }, sendHints.blob)\n }\n }\n\n get readyState () {\n webidl.brandCheck(this, WebSocket)\n\n // The readyState getter steps are to return this's ready state.\n return this[kReadyState]\n }\n\n get bufferedAmount () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#bufferedAmount\n }\n\n get url () {\n webidl.brandCheck(this, WebSocket)\n\n // The url getter steps are to return this's url, serialized.\n return URLSerializer(this[kWebSocketURL])\n }\n\n get extensions () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#extensions\n }\n\n get protocol () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#protocol\n }\n\n get onopen () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.open\n }\n\n set onopen (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.open) {\n this.removeEventListener('open', this.#events.open)\n }\n\n if (typeof fn === 'function') {\n this.#events.open = fn\n this.addEventListener('open', fn)\n } else {\n this.#events.open = null\n }\n }\n\n get onerror () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.error\n }\n\n set onerror (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.error) {\n this.removeEventListener('error', this.#events.error)\n }\n\n if (typeof fn === 'function') {\n this.#events.error = fn\n this.addEventListener('error', fn)\n } else {\n this.#events.error = null\n }\n }\n\n get onclose () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.close\n }\n\n set onclose (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.close) {\n this.removeEventListener('close', this.#events.close)\n }\n\n if (typeof fn === 'function') {\n this.#events.close = fn\n this.addEventListener('close', fn)\n } else {\n this.#events.close = null\n }\n }\n\n get onmessage () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.message\n }\n\n set onmessage (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.message) {\n this.removeEventListener('message', this.#events.message)\n }\n\n if (typeof fn === 'function') {\n this.#events.message = fn\n this.addEventListener('message', fn)\n } else {\n this.#events.message = null\n }\n }\n\n get binaryType () {\n webidl.brandCheck(this, WebSocket)\n\n return this[kBinaryType]\n }\n\n set binaryType (type) {\n webidl.brandCheck(this, WebSocket)\n\n if (type !== 'blob' && type !== 'arraybuffer') {\n this[kBinaryType] = 'blob'\n } else {\n this[kBinaryType] = type\n }\n }\n\n /**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n */\n #onConnectionEstablished (response, parsedExtensions) {\n // processResponse is called when the \"response's header list has been received and initialized.\"\n // once this happens, the connection is open\n this[kResponse] = response\n\n const maxPayloadSize = this[kController]?.dispatcher?.webSocketOptions?.maxPayloadSize\n\n const parser = new ByteParser(this, parsedExtensions, {\n maxPayloadSize\n })\n parser.on('drain', onParserDrain)\n parser.on('error', onParserError.bind(this))\n\n response.socket.ws = this\n this[kByteParser] = parser\n\n this.#sendQueue = new SendQueue(response.socket)\n\n // 1. Change the ready state to OPEN (1).\n this[kReadyState] = states.OPEN\n\n // 2. Change the extensions attribute’s value to the extensions in use, if\n // it is not the null value.\n // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\n const extensions = response.headersList.get('sec-websocket-extensions')\n\n if (extensions !== null) {\n this.#extensions = extensions\n }\n\n // 3. Change the protocol attribute’s value to the subprotocol in use, if\n // it is not the null value.\n // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9\n const protocol = response.headersList.get('sec-websocket-protocol')\n\n if (protocol !== null) {\n this.#protocol = protocol\n }\n\n // 4. Fire an event named open at the WebSocket object.\n fireEvent('open', this)\n }\n}\n\n// https://websockets.spec.whatwg.org/#dom-websocket-connecting\nWebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING\n// https://websockets.spec.whatwg.org/#dom-websocket-open\nWebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN\n// https://websockets.spec.whatwg.org/#dom-websocket-closing\nWebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING\n// https://websockets.spec.whatwg.org/#dom-websocket-closed\nWebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED\n\nObject.defineProperties(WebSocket.prototype, {\n CONNECTING: staticPropertyDescriptors,\n OPEN: staticPropertyDescriptors,\n CLOSING: staticPropertyDescriptors,\n CLOSED: staticPropertyDescriptors,\n url: kEnumerableProperty,\n readyState: kEnumerableProperty,\n bufferedAmount: kEnumerableProperty,\n onopen: kEnumerableProperty,\n onerror: kEnumerableProperty,\n onclose: kEnumerableProperty,\n close: kEnumerableProperty,\n onmessage: kEnumerableProperty,\n binaryType: kEnumerableProperty,\n send: kEnumerableProperty,\n extensions: kEnumerableProperty,\n protocol: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'WebSocket',\n writable: false,\n enumerable: false,\n configurable: true\n }\n})\n\nObject.defineProperties(WebSocket, {\n CONNECTING: staticPropertyDescriptors,\n OPEN: staticPropertyDescriptors,\n CLOSING: staticPropertyDescriptors,\n CLOSED: staticPropertyDescriptors\n})\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.DOMString\n)\n\nwebidl.converters['DOMString or sequence'] = function (V, prefix, argument) {\n if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {\n return webidl.converters['sequence'](V)\n }\n\n return webidl.converters.DOMString(V, prefix, argument)\n}\n\n// This implements the proposal made in https://github.com/whatwg/websockets/issues/42\nwebidl.converters.WebSocketInit = webidl.dictionaryConverter([\n {\n key: 'protocols',\n converter: webidl.converters['DOMString or sequence'],\n defaultValue: () => new Array(0)\n },\n {\n key: 'dispatcher',\n converter: webidl.converters.any,\n defaultValue: () => getGlobalDispatcher()\n },\n {\n key: 'headers',\n converter: webidl.nullableConverter(webidl.converters.HeadersInit)\n }\n])\n\nwebidl.converters['DOMString or sequence or WebSocketInit'] = function (V) {\n if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {\n return webidl.converters.WebSocketInit(V)\n }\n\n return { protocols: webidl.converters['DOMString or sequence'](V) }\n}\n\nwebidl.converters.WebSocketSendData = function (V) {\n if (webidl.util.Type(V) === 'Object') {\n if (isBlobLike(V)) {\n return webidl.converters.Blob(V, { strict: false })\n }\n\n if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {\n return webidl.converters.BufferSource(V)\n }\n }\n\n return webidl.converters.USVString(V)\n}\n\nfunction onParserDrain () {\n this.ws[kResponse].socket.resume()\n}\n\nfunction onParserError (err) {\n let message\n let code\n\n if (err instanceof CloseEvent) {\n message = err.reason\n code = err.code\n } else {\n message = err.message\n }\n\n fireEvent('error', this, () => new ErrorEvent('error', { error: err, message }))\n\n closeWebSocketConnection(this, code)\n}\n\nmodule.exports = {\n WebSocket\n}\n","'use strict'\n\n/**\n * Checks if the given value is a valid LastEventId.\n * @param {string} value\n * @returns {boolean}\n */\nfunction isValidLastEventId (value) {\n // LastEventId should not contain U+0000 NULL\n return value.indexOf('\\u0000') === -1\n}\n\n/**\n * Checks if the given value is a base 10 digit.\n * @param {string} value\n * @returns {boolean}\n */\nfunction isASCIINumber (value) {\n if (value.length === 0) return false\n for (let i = 0; i < value.length; i++) {\n if (value.charCodeAt(i) < 0x30 || value.charCodeAt(i) > 0x39) return false\n }\n return true\n}\n\n// https://github.com/nodejs/undici/issues/2664\nfunction delay (ms) {\n return new Promise((resolve) => {\n setTimeout(resolve, ms).unref()\n })\n}\n\nmodule.exports = {\n isValidLastEventId,\n isASCIINumber,\n delay\n}\n","'use strict'\nconst { Transform } = require('node:stream')\nconst { isASCIINumber, isValidLastEventId } = require('./util')\n\n/**\n * @type {number[]} BOM\n */\nconst BOM = [0xEF, 0xBB, 0xBF]\n/**\n * @type {10} LF\n */\nconst LF = 0x0A\n/**\n * @type {13} CR\n */\nconst CR = 0x0D\n/**\n * @type {58} COLON\n */\nconst COLON = 0x3A\n/**\n * @type {32} SPACE\n */\nconst SPACE = 0x20\n\n/**\n * @typedef {object} EventSourceStreamEvent\n * @type {object}\n * @property {string} [event] The event type.\n * @property {string} [data] The data of the message.\n * @property {string} [id] A unique ID for the event.\n * @property {string} [retry] The reconnection time, in milliseconds.\n */\n\n/**\n * @typedef eventSourceSettings\n * @type {object}\n * @property {string} lastEventId The last event ID received from the server.\n * @property {string} origin The origin of the event source.\n * @property {number} reconnectionTime The reconnection time, in milliseconds.\n */\n\nclass EventSourceStream extends Transform {\n /**\n * @type {eventSourceSettings}\n */\n state = null\n\n /**\n * Leading byte-order-mark check.\n * @type {boolean}\n */\n checkBOM = true\n\n /**\n * @type {boolean}\n */\n crlfCheck = false\n\n /**\n * @type {boolean}\n */\n eventEndCheck = false\n\n /**\n * @type {Buffer}\n */\n buffer = null\n\n pos = 0\n\n event = {\n data: undefined,\n event: undefined,\n id: undefined,\n retry: undefined\n }\n\n /**\n * @param {object} options\n * @param {eventSourceSettings} options.eventSourceSettings\n * @param {Function} [options.push]\n */\n constructor (options = {}) {\n // Enable object mode as EventSourceStream emits objects of shape\n // EventSourceStreamEvent\n options.readableObjectMode = true\n\n super(options)\n\n this.state = options.eventSourceSettings || {}\n if (options.push) {\n this.push = options.push\n }\n }\n\n /**\n * @param {Buffer} chunk\n * @param {string} _encoding\n * @param {Function} callback\n * @returns {void}\n */\n _transform (chunk, _encoding, callback) {\n if (chunk.length === 0) {\n callback()\n return\n }\n\n // Cache the chunk in the buffer, as the data might not be complete while\n // processing it\n // TODO: Investigate if there is a more performant way to handle\n // incoming chunks\n // see: https://github.com/nodejs/undici/issues/2630\n if (this.buffer) {\n this.buffer = Buffer.concat([this.buffer, chunk])\n } else {\n this.buffer = chunk\n }\n\n // Strip leading byte-order-mark if we opened the stream and started\n // the processing of the incoming data\n if (this.checkBOM) {\n switch (this.buffer.length) {\n case 1:\n // Check if the first byte is the same as the first byte of the BOM\n if (this.buffer[0] === BOM[0]) {\n // If it is, we need to wait for more data\n callback()\n return\n }\n // Set the checkBOM flag to false as we don't need to check for the\n // BOM anymore\n this.checkBOM = false\n\n // The buffer only contains one byte so we need to wait for more data\n callback()\n return\n case 2:\n // Check if the first two bytes are the same as the first two bytes\n // of the BOM\n if (\n this.buffer[0] === BOM[0] &&\n this.buffer[1] === BOM[1]\n ) {\n // If it is, we need to wait for more data, because the third byte\n // is needed to determine if it is the BOM or not\n callback()\n return\n }\n\n // Set the checkBOM flag to false as we don't need to check for the\n // BOM anymore\n this.checkBOM = false\n break\n case 3:\n // Check if the first three bytes are the same as the first three\n // bytes of the BOM\n if (\n this.buffer[0] === BOM[0] &&\n this.buffer[1] === BOM[1] &&\n this.buffer[2] === BOM[2]\n ) {\n // If it is, we can drop the buffered data, as it is only the BOM\n this.buffer = Buffer.alloc(0)\n // Set the checkBOM flag to false as we don't need to check for the\n // BOM anymore\n this.checkBOM = false\n\n // Await more data\n callback()\n return\n }\n // If it is not the BOM, we can start processing the data\n this.checkBOM = false\n break\n default:\n // The buffer is longer than 3 bytes, so we can drop the BOM if it is\n // present\n if (\n this.buffer[0] === BOM[0] &&\n this.buffer[1] === BOM[1] &&\n this.buffer[2] === BOM[2]\n ) {\n // Remove the BOM from the buffer\n this.buffer = this.buffer.subarray(3)\n }\n\n // Set the checkBOM flag to false as we don't need to check for the\n this.checkBOM = false\n break\n }\n }\n\n while (this.pos < this.buffer.length) {\n // If the previous line ended with an end-of-line, we need to check\n // if the next character is also an end-of-line.\n if (this.eventEndCheck) {\n // If the the current character is an end-of-line, then the event\n // is finished and we can process it\n\n // If the previous line ended with a carriage return, we need to\n // check if the current character is a line feed and remove it\n // from the buffer.\n if (this.crlfCheck) {\n // If the current character is a line feed, we can remove it\n // from the buffer and reset the crlfCheck flag\n if (this.buffer[this.pos] === LF) {\n this.buffer = this.buffer.subarray(this.pos + 1)\n this.pos = 0\n this.crlfCheck = false\n\n // It is possible that the line feed is not the end of the\n // event. We need to check if the next character is an\n // end-of-line character to determine if the event is\n // finished. We simply continue the loop to check the next\n // character.\n\n // As we removed the line feed from the buffer and set the\n // crlfCheck flag to false, we basically don't make any\n // distinction between a line feed and a carriage return.\n continue\n }\n this.crlfCheck = false\n }\n\n if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {\n // If the current character is a carriage return, we need to\n // set the crlfCheck flag to true, as we need to check if the\n // next character is a line feed so we can remove it from the\n // buffer\n if (this.buffer[this.pos] === CR) {\n this.crlfCheck = true\n }\n\n this.buffer = this.buffer.subarray(this.pos + 1)\n this.pos = 0\n if (\n this.event.data !== undefined || this.event.event || this.event.id || this.event.retry) {\n this.processEvent(this.event)\n }\n this.clearEvent()\n continue\n }\n // If the current character is not an end-of-line, then the event\n // is not finished and we have to reset the eventEndCheck flag\n this.eventEndCheck = false\n continue\n }\n\n // If the current character is an end-of-line, we can process the\n // line\n if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {\n // If the current character is a carriage return, we need to\n // set the crlfCheck flag to true, as we need to check if the\n // next character is a line feed\n if (this.buffer[this.pos] === CR) {\n this.crlfCheck = true\n }\n\n // In any case, we can process the line as we reached an\n // end-of-line character\n this.parseLine(this.buffer.subarray(0, this.pos), this.event)\n\n // Remove the processed line from the buffer\n this.buffer = this.buffer.subarray(this.pos + 1)\n // Reset the position as we removed the processed line from the buffer\n this.pos = 0\n // A line was processed and this could be the end of the event. We need\n // to check if the next line is empty to determine if the event is\n // finished.\n this.eventEndCheck = true\n continue\n }\n\n this.pos++\n }\n\n callback()\n }\n\n /**\n * @param {Buffer} line\n * @param {EventStreamEvent} event\n */\n parseLine (line, event) {\n // If the line is empty (a blank line)\n // Dispatch the event, as defined below.\n // This will be handled in the _transform method\n if (line.length === 0) {\n return\n }\n\n // If the line starts with a U+003A COLON character (:)\n // Ignore the line.\n const colonPosition = line.indexOf(COLON)\n if (colonPosition === 0) {\n return\n }\n\n let field = ''\n let value = ''\n\n // If the line contains a U+003A COLON character (:)\n if (colonPosition !== -1) {\n // Collect the characters on the line before the first U+003A COLON\n // character (:), and let field be that string.\n // TODO: Investigate if there is a more performant way to extract the\n // field\n // see: https://github.com/nodejs/undici/issues/2630\n field = line.subarray(0, colonPosition).toString('utf8')\n\n // Collect the characters on the line after the first U+003A COLON\n // character (:), and let value be that string.\n // If value starts with a U+0020 SPACE character, remove it from value.\n let valueStart = colonPosition + 1\n if (line[valueStart] === SPACE) {\n ++valueStart\n }\n // TODO: Investigate if there is a more performant way to extract the\n // value\n // see: https://github.com/nodejs/undici/issues/2630\n value = line.subarray(valueStart).toString('utf8')\n\n // Otherwise, the string is not empty but does not contain a U+003A COLON\n // character (:)\n } else {\n // Process the field using the steps described below, using the whole\n // line as the field name, and the empty string as the field value.\n field = line.toString('utf8')\n value = ''\n }\n\n // Modify the event with the field name and value. The value is also\n // decoded as UTF-8\n switch (field) {\n case 'data':\n if (event[field] === undefined) {\n event[field] = value\n } else {\n event[field] += `\\n${value}`\n }\n break\n case 'retry':\n if (isASCIINumber(value)) {\n event[field] = value\n }\n break\n case 'id':\n if (isValidLastEventId(value)) {\n event[field] = value\n }\n break\n case 'event':\n if (value.length > 0) {\n event[field] = value\n }\n break\n }\n }\n\n /**\n * @param {EventSourceStreamEvent} event\n */\n processEvent (event) {\n if (event.retry && isASCIINumber(event.retry)) {\n this.state.reconnectionTime = parseInt(event.retry, 10)\n }\n\n if (event.id && isValidLastEventId(event.id)) {\n this.state.lastEventId = event.id\n }\n\n // only dispatch event, when data is provided\n if (event.data !== undefined) {\n this.push({\n type: event.event || 'message',\n options: {\n data: event.data,\n lastEventId: this.state.lastEventId,\n origin: this.state.origin\n }\n })\n }\n }\n\n clearEvent () {\n this.event = {\n data: undefined,\n event: undefined,\n id: undefined,\n retry: undefined\n }\n }\n}\n\nmodule.exports = {\n EventSourceStream\n}\n","'use strict'\n\nconst { pipeline } = require('node:stream')\nconst { fetching } = require('../fetch')\nconst { makeRequest } = require('../fetch/request')\nconst { webidl } = require('../fetch/webidl')\nconst { EventSourceStream } = require('./eventsource-stream')\nconst { parseMIMEType } = require('../fetch/data-url')\nconst { createFastMessageEvent } = require('../websocket/events')\nconst { isNetworkError } = require('../fetch/response')\nconst { delay } = require('./util')\nconst { kEnumerableProperty } = require('../../core/util')\nconst { environmentSettingsObject } = require('../fetch/util')\n\nlet experimentalWarned = false\n\n/**\n * A reconnection time, in milliseconds. This must initially be an implementation-defined value,\n * probably in the region of a few seconds.\n *\n * In Comparison:\n * - Chrome uses 3000ms.\n * - Deno uses 5000ms.\n *\n * @type {3000}\n */\nconst defaultReconnectionTime = 3000\n\n/**\n * The readyState attribute represents the state of the connection.\n * @enum\n * @readonly\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate-dev\n */\n\n/**\n * The connection has not yet been established, or it was closed and the user\n * agent is reconnecting.\n * @type {0}\n */\nconst CONNECTING = 0\n\n/**\n * The user agent has an open connection and is dispatching events as it\n * receives them.\n * @type {1}\n */\nconst OPEN = 1\n\n/**\n * The connection is not open, and the user agent is not trying to reconnect.\n * @type {2}\n */\nconst CLOSED = 2\n\n/**\n * Requests for the element will have their mode set to \"cors\" and their credentials mode set to \"same-origin\".\n * @type {'anonymous'}\n */\nconst ANONYMOUS = 'anonymous'\n\n/**\n * Requests for the element will have their mode set to \"cors\" and their credentials mode set to \"include\".\n * @type {'use-credentials'}\n */\nconst USE_CREDENTIALS = 'use-credentials'\n\n/**\n * The EventSource interface is used to receive server-sent events. It\n * connects to a server over HTTP and receives events in text/event-stream\n * format without closing the connection.\n * @extends {EventTarget}\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events\n * @api public\n */\nclass EventSource extends EventTarget {\n #events = {\n open: null,\n error: null,\n message: null\n }\n\n #url = null\n #withCredentials = false\n\n #readyState = CONNECTING\n\n #request = null\n #controller = null\n\n #dispatcher\n\n /**\n * @type {import('./eventsource-stream').eventSourceSettings}\n */\n #state\n\n /**\n * Creates a new EventSource object.\n * @param {string} url\n * @param {EventSourceInit} [eventSourceInitDict]\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface\n */\n constructor (url, eventSourceInitDict = {}) {\n // 1. Let ev be a new EventSource object.\n super()\n\n webidl.util.markAsUncloneable(this)\n\n const prefix = 'EventSource constructor'\n webidl.argumentLengthCheck(arguments, 1, prefix)\n\n if (!experimentalWarned) {\n experimentalWarned = true\n process.emitWarning('EventSource is experimental, expect them to change at any time.', {\n code: 'UNDICI-ES'\n })\n }\n\n url = webidl.converters.USVString(url, prefix, 'url')\n eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, 'eventSourceInitDict')\n\n this.#dispatcher = eventSourceInitDict.dispatcher\n this.#state = {\n lastEventId: '',\n reconnectionTime: defaultReconnectionTime\n }\n\n // 2. Let settings be ev's relevant settings object.\n // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object\n const settings = environmentSettingsObject\n\n let urlRecord\n\n try {\n // 3. Let urlRecord be the result of encoding-parsing a URL given url, relative to settings.\n urlRecord = new URL(url, settings.settingsObject.baseUrl)\n this.#state.origin = urlRecord.origin\n } catch (e) {\n // 4. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n throw new DOMException(e, 'SyntaxError')\n }\n\n // 5. Set ev's url to urlRecord.\n this.#url = urlRecord.href\n\n // 6. Let corsAttributeState be Anonymous.\n let corsAttributeState = ANONYMOUS\n\n // 7. If the value of eventSourceInitDict's withCredentials member is true,\n // then set corsAttributeState to Use Credentials and set ev's\n // withCredentials attribute to true.\n if (eventSourceInitDict.withCredentials) {\n corsAttributeState = USE_CREDENTIALS\n this.#withCredentials = true\n }\n\n // 8. Let request be the result of creating a potential-CORS request given\n // urlRecord, the empty string, and corsAttributeState.\n const initRequest = {\n redirect: 'follow',\n keepalive: true,\n // @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes\n mode: 'cors',\n credentials: corsAttributeState === 'anonymous'\n ? 'same-origin'\n : 'omit',\n referrer: 'no-referrer'\n }\n\n // 9. Set request's client to settings.\n initRequest.client = environmentSettingsObject.settingsObject\n\n // 10. User agents may set (`Accept`, `text/event-stream`) in request's header list.\n initRequest.headersList = [['accept', { name: 'accept', value: 'text/event-stream' }]]\n\n // 11. Set request's cache mode to \"no-store\".\n initRequest.cache = 'no-store'\n\n // 12. Set request's initiator type to \"other\".\n initRequest.initiator = 'other'\n\n initRequest.urlList = [new URL(this.#url)]\n\n // 13. Set ev's request to request.\n this.#request = makeRequest(initRequest)\n\n this.#connect()\n }\n\n /**\n * Returns the state of this EventSource object's connection. It can have the\n * values described below.\n * @returns {0|1|2}\n * @readonly\n */\n get readyState () {\n return this.#readyState\n }\n\n /**\n * Returns the URL providing the event stream.\n * @readonly\n * @returns {string}\n */\n get url () {\n return this.#url\n }\n\n /**\n * Returns a boolean indicating whether the EventSource object was\n * instantiated with CORS credentials set (true), or not (false, the default).\n */\n get withCredentials () {\n return this.#withCredentials\n }\n\n #connect () {\n if (this.#readyState === CLOSED) return\n\n this.#readyState = CONNECTING\n\n const fetchParams = {\n request: this.#request,\n dispatcher: this.#dispatcher\n }\n\n // 14. Let processEventSourceEndOfBody given response res be the following step: if res is not a network error, then reestablish the connection.\n const processEventSourceEndOfBody = (response) => {\n if (isNetworkError(response)) {\n this.dispatchEvent(new Event('error'))\n this.close()\n }\n\n this.#reconnect()\n }\n\n // 15. Fetch request, with processResponseEndOfBody set to processEventSourceEndOfBody...\n fetchParams.processResponseEndOfBody = processEventSourceEndOfBody\n\n // and processResponse set to the following steps given response res:\n fetchParams.processResponse = (response) => {\n // 1. If res is an aborted network error, then fail the connection.\n\n if (isNetworkError(response)) {\n // 1. When a user agent is to fail the connection, the user agent\n // must queue a task which, if the readyState attribute is set to a\n // value other than CLOSED, sets the readyState attribute to CLOSED\n // and fires an event named error at the EventSource object. Once the\n // user agent has failed the connection, it does not attempt to\n // reconnect.\n if (response.aborted) {\n this.close()\n this.dispatchEvent(new Event('error'))\n return\n // 2. Otherwise, if res is a network error, then reestablish the\n // connection, unless the user agent knows that to be futile, in\n // which case the user agent may fail the connection.\n } else {\n this.#reconnect()\n return\n }\n }\n\n // 3. Otherwise, if res's status is not 200, or if res's `Content-Type`\n // is not `text/event-stream`, then fail the connection.\n const contentType = response.headersList.get('content-type', true)\n const mimeType = contentType !== null ? parseMIMEType(contentType) : 'failure'\n const contentTypeValid = mimeType !== 'failure' && mimeType.essence === 'text/event-stream'\n if (\n response.status !== 200 ||\n contentTypeValid === false\n ) {\n this.close()\n this.dispatchEvent(new Event('error'))\n return\n }\n\n // 4. Otherwise, announce the connection and interpret res's body\n // line by line.\n\n // When a user agent is to announce the connection, the user agent\n // must queue a task which, if the readyState attribute is set to a\n // value other than CLOSED, sets the readyState attribute to OPEN\n // and fires an event named open at the EventSource object.\n // @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model\n this.#readyState = OPEN\n this.dispatchEvent(new Event('open'))\n\n // If redirected to a different origin, set the origin to the new origin.\n this.#state.origin = response.urlList[response.urlList.length - 1].origin\n\n const eventSourceStream = new EventSourceStream({\n eventSourceSettings: this.#state,\n push: (event) => {\n this.dispatchEvent(createFastMessageEvent(\n event.type,\n event.options\n ))\n }\n })\n\n pipeline(response.body.stream,\n eventSourceStream,\n (error) => {\n if (\n error?.aborted === false\n ) {\n this.close()\n this.dispatchEvent(new Event('error'))\n }\n })\n }\n\n this.#controller = fetching(fetchParams)\n }\n\n /**\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model\n * @returns {Promise}\n */\n async #reconnect () {\n // When a user agent is to reestablish the connection, the user agent must\n // run the following steps. These steps are run in parallel, not as part of\n // a task. (The tasks that it queues, of course, are run like normal tasks\n // and not themselves in parallel.)\n\n // 1. Queue a task to run the following steps:\n\n // 1. If the readyState attribute is set to CLOSED, abort the task.\n if (this.#readyState === CLOSED) return\n\n // 2. Set the readyState attribute to CONNECTING.\n this.#readyState = CONNECTING\n\n // 3. Fire an event named error at the EventSource object.\n this.dispatchEvent(new Event('error'))\n\n // 2. Wait a delay equal to the reconnection time of the event source.\n await delay(this.#state.reconnectionTime)\n\n // 5. Queue a task to run the following steps:\n\n // 1. If the EventSource object's readyState attribute is not set to\n // CONNECTING, then return.\n if (this.#readyState !== CONNECTING) return\n\n // 2. Let request be the EventSource object's request.\n // 3. If the EventSource object's last event ID string is not the empty\n // string, then:\n // 1. Let lastEventIDValue be the EventSource object's last event ID\n // string, encoded as UTF-8.\n // 2. Set (`Last-Event-ID`, lastEventIDValue) in request's header\n // list.\n if (this.#state.lastEventId.length) {\n this.#request.headersList.set('last-event-id', this.#state.lastEventId, true)\n }\n\n // 4. Fetch request and process the response obtained in this fashion, if any, as described earlier in this section.\n this.#connect()\n }\n\n /**\n * Closes the connection, if any, and sets the readyState attribute to\n * CLOSED.\n */\n close () {\n webidl.brandCheck(this, EventSource)\n\n if (this.#readyState === CLOSED) return\n this.#readyState = CLOSED\n this.#controller.abort()\n this.#request = null\n }\n\n get onopen () {\n return this.#events.open\n }\n\n set onopen (fn) {\n if (this.#events.open) {\n this.removeEventListener('open', this.#events.open)\n }\n\n if (typeof fn === 'function') {\n this.#events.open = fn\n this.addEventListener('open', fn)\n } else {\n this.#events.open = null\n }\n }\n\n get onmessage () {\n return this.#events.message\n }\n\n set onmessage (fn) {\n if (this.#events.message) {\n this.removeEventListener('message', this.#events.message)\n }\n\n if (typeof fn === 'function') {\n this.#events.message = fn\n this.addEventListener('message', fn)\n } else {\n this.#events.message = null\n }\n }\n\n get onerror () {\n return this.#events.error\n }\n\n set onerror (fn) {\n if (this.#events.error) {\n this.removeEventListener('error', this.#events.error)\n }\n\n if (typeof fn === 'function') {\n this.#events.error = fn\n this.addEventListener('error', fn)\n } else {\n this.#events.error = null\n }\n }\n}\n\nconst constantsPropertyDescriptors = {\n CONNECTING: {\n __proto__: null,\n configurable: false,\n enumerable: true,\n value: CONNECTING,\n writable: false\n },\n OPEN: {\n __proto__: null,\n configurable: false,\n enumerable: true,\n value: OPEN,\n writable: false\n },\n CLOSED: {\n __proto__: null,\n configurable: false,\n enumerable: true,\n value: CLOSED,\n writable: false\n }\n}\n\nObject.defineProperties(EventSource, constantsPropertyDescriptors)\nObject.defineProperties(EventSource.prototype, constantsPropertyDescriptors)\n\nObject.defineProperties(EventSource.prototype, {\n close: kEnumerableProperty,\n onerror: kEnumerableProperty,\n onmessage: kEnumerableProperty,\n onopen: kEnumerableProperty,\n readyState: kEnumerableProperty,\n url: kEnumerableProperty,\n withCredentials: kEnumerableProperty\n})\n\nwebidl.converters.EventSourceInitDict = webidl.dictionaryConverter([\n {\n key: 'withCredentials',\n converter: webidl.converters.boolean,\n defaultValue: () => false\n },\n {\n key: 'dispatcher', // undici only\n converter: webidl.converters.any\n }\n])\n\nmodule.exports = {\n EventSource,\n defaultReconnectionTime\n}\n","'use strict'\n\nconst Client = require('./lib/dispatcher/client')\nconst Dispatcher = require('./lib/dispatcher/dispatcher')\nconst Pool = require('./lib/dispatcher/pool')\nconst BalancedPool = require('./lib/dispatcher/balanced-pool')\nconst Agent = require('./lib/dispatcher/agent')\nconst ProxyAgent = require('./lib/dispatcher/proxy-agent')\nconst EnvHttpProxyAgent = require('./lib/dispatcher/env-http-proxy-agent')\nconst RetryAgent = require('./lib/dispatcher/retry-agent')\nconst errors = require('./lib/core/errors')\nconst util = require('./lib/core/util')\nconst { InvalidArgumentError } = errors\nconst api = require('./lib/api')\nconst buildConnector = require('./lib/core/connect')\nconst MockClient = require('./lib/mock/mock-client')\nconst MockAgent = require('./lib/mock/mock-agent')\nconst MockPool = require('./lib/mock/mock-pool')\nconst mockErrors = require('./lib/mock/mock-errors')\nconst RetryHandler = require('./lib/handler/retry-handler')\nconst { getGlobalDispatcher, setGlobalDispatcher } = require('./lib/global')\nconst DecoratorHandler = require('./lib/handler/decorator-handler')\nconst RedirectHandler = require('./lib/handler/redirect-handler')\nconst createRedirectInterceptor = require('./lib/interceptor/redirect-interceptor')\n\nObject.assign(Dispatcher.prototype, api)\n\nmodule.exports.Dispatcher = Dispatcher\nmodule.exports.Client = Client\nmodule.exports.Pool = Pool\nmodule.exports.BalancedPool = BalancedPool\nmodule.exports.Agent = Agent\nmodule.exports.ProxyAgent = ProxyAgent\nmodule.exports.EnvHttpProxyAgent = EnvHttpProxyAgent\nmodule.exports.RetryAgent = RetryAgent\nmodule.exports.RetryHandler = RetryHandler\n\nmodule.exports.DecoratorHandler = DecoratorHandler\nmodule.exports.RedirectHandler = RedirectHandler\nmodule.exports.createRedirectInterceptor = createRedirectInterceptor\nmodule.exports.interceptors = {\n redirect: require('./lib/interceptor/redirect'),\n retry: require('./lib/interceptor/retry'),\n dump: require('./lib/interceptor/dump'),\n dns: require('./lib/interceptor/dns')\n}\n\nmodule.exports.buildConnector = buildConnector\nmodule.exports.errors = errors\nmodule.exports.util = {\n parseHeaders: util.parseHeaders,\n headerNameToString: util.headerNameToString\n}\n\nfunction makeDispatcher (fn) {\n return (url, opts, handler) => {\n if (typeof opts === 'function') {\n handler = opts\n opts = null\n }\n\n if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {\n throw new InvalidArgumentError('invalid url')\n }\n\n if (opts != null && typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (opts && opts.path != null) {\n if (typeof opts.path !== 'string') {\n throw new InvalidArgumentError('invalid opts.path')\n }\n\n let path = opts.path\n if (!opts.path.startsWith('/')) {\n path = `/${path}`\n }\n\n url = new URL(util.parseOrigin(url).origin + path)\n } else {\n if (!opts) {\n opts = typeof url === 'object' ? url : {}\n }\n\n url = util.parseURL(url)\n }\n\n const { agent, dispatcher = getGlobalDispatcher() } = opts\n\n if (agent) {\n throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')\n }\n\n return fn.call(dispatcher, {\n ...opts,\n origin: url.origin,\n path: url.search ? `${url.pathname}${url.search}` : url.pathname,\n method: opts.method || (opts.body ? 'PUT' : 'GET')\n }, handler)\n }\n}\n\nmodule.exports.setGlobalDispatcher = setGlobalDispatcher\nmodule.exports.getGlobalDispatcher = getGlobalDispatcher\n\nconst fetchImpl = require('./lib/web/fetch').fetch\nmodule.exports.fetch = async function fetch (init, options = undefined) {\n try {\n return await fetchImpl(init, options)\n } catch (err) {\n if (err && typeof err === 'object') {\n Error.captureStackTrace(err)\n }\n\n throw err\n }\n}\nmodule.exports.Headers = require('./lib/web/fetch/headers').Headers\nmodule.exports.Response = require('./lib/web/fetch/response').Response\nmodule.exports.Request = require('./lib/web/fetch/request').Request\nmodule.exports.FormData = require('./lib/web/fetch/formdata').FormData\nmodule.exports.File = globalThis.File ?? require('node:buffer').File\nmodule.exports.FileReader = require('./lib/web/fileapi/filereader').FileReader\n\nconst { setGlobalOrigin, getGlobalOrigin } = require('./lib/web/fetch/global')\n\nmodule.exports.setGlobalOrigin = setGlobalOrigin\nmodule.exports.getGlobalOrigin = getGlobalOrigin\n\nconst { CacheStorage } = require('./lib/web/cache/cachestorage')\nconst { kConstruct } = require('./lib/web/cache/symbols')\n\n// Cache & CacheStorage are tightly coupled with fetch. Even if it may run\n// in an older version of Node, it doesn't have any use without fetch.\nmodule.exports.caches = new CacheStorage(kConstruct)\n\nconst { deleteCookie, getCookies, getSetCookies, setCookie } = require('./lib/web/cookies')\n\nmodule.exports.deleteCookie = deleteCookie\nmodule.exports.getCookies = getCookies\nmodule.exports.getSetCookies = getSetCookies\nmodule.exports.setCookie = setCookie\n\nconst { parseMIMEType, serializeAMimeType } = require('./lib/web/fetch/data-url')\n\nmodule.exports.parseMIMEType = parseMIMEType\nmodule.exports.serializeAMimeType = serializeAMimeType\n\nconst { CloseEvent, ErrorEvent, MessageEvent } = require('./lib/web/websocket/events')\nmodule.exports.WebSocket = require('./lib/web/websocket/websocket').WebSocket\nmodule.exports.CloseEvent = CloseEvent\nmodule.exports.ErrorEvent = ErrorEvent\nmodule.exports.MessageEvent = MessageEvent\n\nmodule.exports.request = makeDispatcher(api.request)\nmodule.exports.stream = makeDispatcher(api.stream)\nmodule.exports.pipeline = makeDispatcher(api.pipeline)\nmodule.exports.connect = makeDispatcher(api.connect)\nmodule.exports.upgrade = makeDispatcher(api.upgrade)\n\nmodule.exports.MockClient = MockClient\nmodule.exports.MockPool = MockPool\nmodule.exports.MockAgent = MockAgent\nmodule.exports.mockErrors = mockErrors\n\nconst { EventSource } = require('./lib/web/eventsource/eventsource')\n\nmodule.exports.EventSource = EventSource\n",null,null,"export function getUserAgent() {\n if (typeof navigator === \"object\" && \"userAgent\" in navigator) {\n return navigator.userAgent;\n }\n\n if (typeof process === \"object\" && process.version !== undefined) {\n return `Node.js/${process.version.substr(1)} (${process.platform}; ${\n process.arch\n })`;\n }\n\n return \"\";\n}\n","// @ts-check\n\nexport function register(state, name, method, options) {\n if (typeof method !== \"function\") {\n throw new Error(\"method for before hook must be a function\");\n }\n\n if (!options) {\n options = {};\n }\n\n if (Array.isArray(name)) {\n return name.reverse().reduce((callback, name) => {\n return register.bind(null, state, name, callback, options);\n }, method)();\n }\n\n return Promise.resolve().then(() => {\n if (!state.registry[name]) {\n return method(options);\n }\n\n return state.registry[name].reduce((method, registered) => {\n return registered.hook.bind(null, method, options);\n }, method)();\n });\n}\n","// @ts-check\n\nexport function addHook(state, kind, name, hook) {\n const orig = hook;\n if (!state.registry[name]) {\n state.registry[name] = [];\n }\n\n if (kind === \"before\") {\n hook = (method, options) => {\n return Promise.resolve()\n .then(orig.bind(null, options))\n .then(method.bind(null, options));\n };\n }\n\n if (kind === \"after\") {\n hook = (method, options) => {\n let result;\n return Promise.resolve()\n .then(method.bind(null, options))\n .then((result_) => {\n result = result_;\n return orig(result, options);\n })\n .then(() => {\n return result;\n });\n };\n }\n\n if (kind === \"error\") {\n hook = (method, options) => {\n return Promise.resolve()\n .then(method.bind(null, options))\n .catch((error) => {\n return orig(error, options);\n });\n };\n }\n\n state.registry[name].push({\n hook: hook,\n orig: orig,\n });\n}\n","// @ts-check\n\nexport function removeHook(state, name, method) {\n if (!state.registry[name]) {\n return;\n }\n\n const index = state.registry[name]\n .map((registered) => {\n return registered.orig;\n })\n .indexOf(method);\n\n if (index === -1) {\n return;\n }\n\n state.registry[name].splice(index, 1);\n}\n","// @ts-check\n\nimport { register } from \"./lib/register.js\";\nimport { addHook } from \"./lib/add.js\";\nimport { removeHook } from \"./lib/remove.js\";\n\n// bind with array of arguments: https://stackoverflow.com/a/21792913\nconst bind = Function.bind;\nconst bindable = bind.bind(bind);\n\nfunction bindApi(hook, state, name) {\n const removeHookRef = bindable(removeHook, null).apply(\n null,\n name ? [state, name] : [state]\n );\n hook.api = { remove: removeHookRef };\n hook.remove = removeHookRef;\n [\"before\", \"error\", \"after\", \"wrap\"].forEach((kind) => {\n const args = name ? [state, kind, name] : [state, kind];\n hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);\n });\n}\n\nfunction Singular() {\n const singularHookName = Symbol(\"Singular\");\n const singularHookState = {\n registry: {},\n };\n const singularHook = register.bind(null, singularHookState, singularHookName);\n bindApi(singularHook, singularHookState, singularHookName);\n return singularHook;\n}\n\nfunction Collection() {\n const state = {\n registry: {},\n };\n\n const hook = register.bind(null, state);\n bindApi(hook, state);\n\n return hook;\n}\n\nexport default { Singular, Collection };\n","export function getUserAgent() {\n if (typeof navigator === \"object\" && \"userAgent\" in navigator) {\n return navigator.userAgent;\n }\n\n if (typeof process === \"object\" && process.version !== undefined) {\n return `Node.js/${process.version.substr(1)} (${process.platform}; ${\n process.arch\n })`;\n }\n\n return \"\";\n}\n","// pkg/dist-src/defaults.js\nimport { getUserAgent } from \"universal-user-agent\";\n\n// pkg/dist-src/version.js\nvar VERSION = \"0.0.0-development\";\n\n// pkg/dist-src/defaults.js\nvar userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`;\nvar DEFAULTS = {\n method: \"GET\",\n baseUrl: \"https://api.github.com\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"user-agent\": userAgent\n },\n mediaType: {\n format: \"\"\n }\n};\n\n// pkg/dist-src/util/lowercase-keys.js\nfunction lowercaseKeys(object) {\n if (!object) {\n return {};\n }\n return Object.keys(object).reduce((newObj, key) => {\n newObj[key.toLowerCase()] = object[key];\n return newObj;\n }, {});\n}\n\n// pkg/dist-src/util/is-plain-object.js\nfunction isPlainObject(value) {\n if (typeof value !== \"object\" || value === null) return false;\n if (Object.prototype.toString.call(value) !== \"[object Object]\") return false;\n const proto = Object.getPrototypeOf(value);\n if (proto === null) return true;\n const Ctor = Object.prototype.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof Ctor === \"function\" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);\n}\n\n// pkg/dist-src/util/merge-deep.js\nfunction mergeDeep(defaults, options) {\n const result = Object.assign({}, defaults);\n Object.keys(options).forEach((key) => {\n if (isPlainObject(options[key])) {\n if (!(key in defaults)) Object.assign(result, { [key]: options[key] });\n else result[key] = mergeDeep(defaults[key], options[key]);\n } else {\n Object.assign(result, { [key]: options[key] });\n }\n });\n return result;\n}\n\n// pkg/dist-src/util/remove-undefined-properties.js\nfunction removeUndefinedProperties(obj) {\n for (const key in obj) {\n if (obj[key] === void 0) {\n delete obj[key];\n }\n }\n return obj;\n}\n\n// pkg/dist-src/merge.js\nfunction merge(defaults, route, options) {\n if (typeof route === \"string\") {\n let [method, url] = route.split(\" \");\n options = Object.assign(url ? { method, url } : { url: method }, options);\n } else {\n options = Object.assign({}, route);\n }\n options.headers = lowercaseKeys(options.headers);\n removeUndefinedProperties(options);\n removeUndefinedProperties(options.headers);\n const mergedOptions = mergeDeep(defaults || {}, options);\n if (options.url === \"/graphql\") {\n if (defaults && defaults.mediaType.previews?.length) {\n mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(\n (preview) => !mergedOptions.mediaType.previews.includes(preview)\n ).concat(mergedOptions.mediaType.previews);\n }\n mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, \"\"));\n }\n return mergedOptions;\n}\n\n// pkg/dist-src/util/add-query-parameters.js\nfunction addQueryParameters(url, parameters) {\n const separator = /\\?/.test(url) ? \"&\" : \"?\";\n const names = Object.keys(parameters);\n if (names.length === 0) {\n return url;\n }\n return url + separator + names.map((name) => {\n if (name === \"q\") {\n return \"q=\" + parameters.q.split(\"+\").map(encodeURIComponent).join(\"+\");\n }\n return `${name}=${encodeURIComponent(parameters[name])}`;\n }).join(\"&\");\n}\n\n// pkg/dist-src/util/extract-url-variable-names.js\nvar urlVariableRegex = /\\{[^{}}]+\\}/g;\nfunction removeNonChars(variableName) {\n return variableName.replace(/(?:^\\W+)|(?:(? a.concat(b), []);\n}\n\n// pkg/dist-src/util/omit.js\nfunction omit(object, keysToOmit) {\n const result = { __proto__: null };\n for (const key of Object.keys(object)) {\n if (keysToOmit.indexOf(key) === -1) {\n result[key] = object[key];\n }\n }\n return result;\n}\n\n// pkg/dist-src/util/url-template.js\nfunction encodeReserved(str) {\n return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n }\n return part;\n }).join(\"\");\n}\nfunction encodeUnreserved(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\nfunction encodeValue(operator, value, key) {\n value = operator === \"+\" || operator === \"#\" ? encodeReserved(value) : encodeUnreserved(value);\n if (key) {\n return encodeUnreserved(key) + \"=\" + value;\n } else {\n return value;\n }\n}\nfunction isDefined(value) {\n return value !== void 0 && value !== null;\n}\nfunction isKeyOperator(operator) {\n return operator === \";\" || operator === \"&\" || operator === \"?\";\n}\nfunction getValues(context, operator, key, modifier) {\n var value = context[key], result = [];\n if (isDefined(value) && value !== \"\") {\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"bigint\" || typeof value === \"boolean\") {\n value = value.toString();\n if (modifier && modifier !== \"*\") {\n value = value.substring(0, parseInt(modifier, 10));\n }\n result.push(\n encodeValue(operator, value, isKeyOperator(operator) ? key : \"\")\n );\n } else {\n if (modifier === \"*\") {\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function(value2) {\n result.push(\n encodeValue(operator, value2, isKeyOperator(operator) ? key : \"\")\n );\n });\n } else {\n Object.keys(value).forEach(function(k) {\n if (isDefined(value[k])) {\n result.push(encodeValue(operator, value[k], k));\n }\n });\n }\n } else {\n const tmp = [];\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function(value2) {\n tmp.push(encodeValue(operator, value2));\n });\n } else {\n Object.keys(value).forEach(function(k) {\n if (isDefined(value[k])) {\n tmp.push(encodeUnreserved(k));\n tmp.push(encodeValue(operator, value[k].toString()));\n }\n });\n }\n if (isKeyOperator(operator)) {\n result.push(encodeUnreserved(key) + \"=\" + tmp.join(\",\"));\n } else if (tmp.length !== 0) {\n result.push(tmp.join(\",\"));\n }\n }\n }\n } else {\n if (operator === \";\") {\n if (isDefined(value)) {\n result.push(encodeUnreserved(key));\n }\n } else if (value === \"\" && (operator === \"&\" || operator === \"?\")) {\n result.push(encodeUnreserved(key) + \"=\");\n } else if (value === \"\") {\n result.push(\"\");\n }\n }\n return result;\n}\nfunction parseUrl(template) {\n return {\n expand: expand.bind(null, template)\n };\n}\nfunction expand(template, context) {\n var operators = [\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"];\n template = template.replace(\n /\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g,\n function(_, expression, literal) {\n if (expression) {\n let operator = \"\";\n const values = [];\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n expression.split(/,/g).forEach(function(variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n if (operator && operator !== \"+\") {\n var separator = \",\";\n if (operator === \"?\") {\n separator = \"&\";\n } else if (operator !== \"#\") {\n separator = operator;\n }\n return (values.length !== 0 ? operator : \"\") + values.join(separator);\n } else {\n return values.join(\",\");\n }\n } else {\n return encodeReserved(literal);\n }\n }\n );\n if (template === \"/\") {\n return template;\n } else {\n return template.replace(/\\/$/, \"\");\n }\n}\n\n// pkg/dist-src/parse.js\nfunction parse(options) {\n let method = options.method.toUpperCase();\n let url = (options.url || \"/\").replace(/:([a-z]\\w+)/g, \"{$1}\");\n let headers = Object.assign({}, options.headers);\n let body;\n let parameters = omit(options, [\n \"method\",\n \"baseUrl\",\n \"url\",\n \"headers\",\n \"request\",\n \"mediaType\"\n ]);\n const urlVariableNames = extractUrlVariableNames(url);\n url = parseUrl(url).expand(parameters);\n if (!/^http/.test(url)) {\n url = options.baseUrl + url;\n }\n const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat(\"baseUrl\");\n const remainingParameters = omit(parameters, omittedParameters);\n const isBinaryRequest = /application\\/octet-stream/i.test(headers.accept);\n if (!isBinaryRequest) {\n if (options.mediaType.format) {\n headers.accept = headers.accept.split(/,/).map(\n (format) => format.replace(\n /application\\/vnd(\\.\\w+)(\\.v3)?(\\.\\w+)?(\\+json)?$/,\n `application/vnd$1$2.${options.mediaType.format}`\n )\n ).join(\",\");\n }\n if (url.endsWith(\"/graphql\")) {\n if (options.mediaType.previews?.length) {\n const previewsFromAcceptHeader = headers.accept.match(/(? {\n const format = options.mediaType.format ? `.${options.mediaType.format}` : \"+json\";\n return `application/vnd.github.${preview}-preview${format}`;\n }).join(\",\");\n }\n }\n }\n if ([\"GET\", \"HEAD\"].includes(method)) {\n url = addQueryParameters(url, remainingParameters);\n } else {\n if (\"data\" in remainingParameters) {\n body = remainingParameters.data;\n } else {\n if (Object.keys(remainingParameters).length) {\n body = remainingParameters;\n }\n }\n }\n if (!headers[\"content-type\"] && typeof body !== \"undefined\") {\n headers[\"content-type\"] = \"application/json; charset=utf-8\";\n }\n if ([\"PATCH\", \"PUT\"].includes(method) && typeof body === \"undefined\") {\n body = \"\";\n }\n return Object.assign(\n { method, url, headers },\n typeof body !== \"undefined\" ? { body } : null,\n options.request ? { request: options.request } : null\n );\n}\n\n// pkg/dist-src/endpoint-with-defaults.js\nfunction endpointWithDefaults(defaults, route, options) {\n return parse(merge(defaults, route, options));\n}\n\n// pkg/dist-src/with-defaults.js\nfunction withDefaults(oldDefaults, newDefaults) {\n const DEFAULTS2 = merge(oldDefaults, newDefaults);\n const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);\n return Object.assign(endpoint2, {\n DEFAULTS: DEFAULTS2,\n defaults: withDefaults.bind(null, DEFAULTS2),\n merge: merge.bind(null, DEFAULTS2),\n parse\n });\n}\n\n// pkg/dist-src/index.js\nvar endpoint = withDefaults(null, DEFAULTS);\nexport {\n endpoint\n};\n","export function getUserAgent() {\n if (typeof navigator === \"object\" && \"userAgent\" in navigator) {\n return navigator.userAgent;\n }\n\n if (typeof process === \"object\" && process.version !== undefined) {\n return `Node.js/${process.version.substr(1)} (${process.platform}; ${\n process.arch\n })`;\n }\n\n return \"\";\n}\n","'use strict'\n\nconst NullObject = function NullObject () { }\nNullObject.prototype = Object.create(null)\n\n/**\n * RegExp to match *( \";\" parameter ) in RFC 7231 sec 3.1.1.1\n *\n * parameter = token \"=\" ( token / quoted-string )\n * token = 1*tchar\n * tchar = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" / \"*\"\n * / \"+\" / \"-\" / \".\" / \"^\" / \"_\" / \"`\" / \"|\" / \"~\"\n * / DIGIT / ALPHA\n * ; any VCHAR, except delimiters\n * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE\n * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text\n * obs-text = %x80-FF\n * quoted-pair = \"\\\" ( HTAB / SP / VCHAR / obs-text )\n */\nconst paramRE = /; *([!#$%&'*+.^\\w`|~-]+)=(\"(?:[\\v\\u0020\\u0021\\u0023-\\u005b\\u005d-\\u007e\\u0080-\\u00ff]|\\\\[\\v\\u0020-\\u00ff])*\"|[!#$%&'*+.^\\w`|~-]+) */gu\n\n/**\n * RegExp to match quoted-pair in RFC 7230 sec 3.2.6\n *\n * quoted-pair = \"\\\" ( HTAB / SP / VCHAR / obs-text )\n * obs-text = %x80-FF\n */\nconst quotedPairRE = /\\\\([\\v\\u0020-\\u00ff])/gu\n\n/**\n * RegExp to match type in RFC 7231 sec 3.1.1.1\n *\n * media-type = type \"/\" subtype\n * type = token\n * subtype = token\n */\nconst mediaTypeRE = /^[!#$%&'*+.^\\w|~-]+\\/[!#$%&'*+.^\\w|~-]+$/u\n\n// default ContentType to prevent repeated object creation\nconst defaultContentType = { type: '', parameters: new NullObject() }\nObject.freeze(defaultContentType.parameters)\nObject.freeze(defaultContentType)\n\n/**\n * Parse media type to object.\n *\n * @param {string|object} header\n * @return {Object}\n * @public\n */\n\nfunction parse (header) {\n if (typeof header !== 'string') {\n throw new TypeError('argument header is required and must be a string')\n }\n\n let index = header.indexOf(';')\n const type = index !== -1\n ? header.slice(0, index).trim()\n : header.trim()\n\n if (mediaTypeRE.test(type) === false) {\n throw new TypeError('invalid media type')\n }\n\n const result = {\n type: type.toLowerCase(),\n parameters: new NullObject()\n }\n\n // parse parameters\n if (index === -1) {\n return result\n }\n\n let key\n let match\n let value\n\n paramRE.lastIndex = index\n\n while ((match = paramRE.exec(header))) {\n if (match.index !== index) {\n throw new TypeError('invalid parameter format')\n }\n\n index += match[0].length\n key = match[1].toLowerCase()\n value = match[2]\n\n if (value[0] === '\"') {\n // remove quotes and escapes\n value = value\n .slice(1, value.length - 1)\n\n quotedPairRE.test(value) && (value = value.replace(quotedPairRE, '$1'))\n }\n\n result.parameters[key] = value\n }\n\n if (index !== header.length) {\n throw new TypeError('invalid parameter format')\n }\n\n return result\n}\n\nfunction safeParse (header) {\n if (typeof header !== 'string') {\n return defaultContentType\n }\n\n let index = header.indexOf(';')\n const type = index !== -1\n ? header.slice(0, index).trim()\n : header.trim()\n\n if (mediaTypeRE.test(type) === false) {\n return defaultContentType\n }\n\n const result = {\n type: type.toLowerCase(),\n parameters: new NullObject()\n }\n\n // parse parameters\n if (index === -1) {\n return result\n }\n\n let key\n let match\n let value\n\n paramRE.lastIndex = index\n\n while ((match = paramRE.exec(header))) {\n if (match.index !== index) {\n return defaultContentType\n }\n\n index += match[0].length\n key = match[1].toLowerCase()\n value = match[2]\n\n if (value[0] === '\"') {\n // remove quotes and escapes\n value = value\n .slice(1, value.length - 1)\n\n quotedPairRE.test(value) && (value = value.replace(quotedPairRE, '$1'))\n }\n\n result.parameters[key] = value\n }\n\n if (index !== header.length) {\n return defaultContentType\n }\n\n return result\n}\n\nmodule.exports.default = { parse, safeParse }\nmodule.exports.parse = parse\nmodule.exports.safeParse = safeParse\nmodule.exports.defaultContentType = defaultContentType\n","const intRegex = /^-?\\d+$/;\nconst noiseValue = /^-?\\d+n+$/; // Noise - strings that match the custom format before being converted to it\nconst originalStringify = JSON.stringify;\nconst originalParse = JSON.parse;\nconst customFormat = /^-?\\d+n$/;\n\nconst bigIntsStringify = /([\\[:])?\"(-?\\d+)n\"($|([\\\\n]|\\s)*(\\s|[\\\\n])*[,\\}\\]])/g;\nconst noiseStringify =\n /([\\[:])?(\"-?\\d+n+)n(\"$|\"([\\\\n]|\\s)*(\\s|[\\\\n])*[,\\}\\]])/g;\n\n/**\n * @typedef {(this: any, key: string | number | undefined, value: any) => any} Replacer\n * @typedef {(key: string | number | undefined, value: any, context?: { source: string }) => any} Reviver\n */\n\n/**\n * Converts a JavaScript value to a JSON string.\n *\n * Supports serialization of BigInt values using two strategies:\n * 1. Custom format \"123n\" → \"123\" (universal fallback)\n * 2. Native JSON.rawJSON() (Node.js 22+, fastest) when available\n *\n * All other values are serialized exactly like native JSON.stringify().\n *\n * @param {*} value The value to convert to a JSON string.\n * @param {Replacer | Array | null} [replacer]\n * A function that alters the behavior of the stringification process,\n * or an array of strings/numbers to indicate properties to exclude.\n * @param {string | number} [space]\n * A string or number to specify indentation or pretty-printing.\n * @returns {string} The JSON string representation.\n */\nconst JSONStringify = (value, replacer, space) => {\n if (\"rawJSON\" in JSON) {\n return originalStringify(\n value,\n (key, value) => {\n if (typeof value === \"bigint\") return JSON.rawJSON(value.toString());\n\n if (typeof replacer === \"function\") return replacer(key, value);\n\n if (Array.isArray(replacer) && replacer.includes(key)) return value;\n\n return value;\n },\n space,\n );\n }\n\n if (!value) return originalStringify(value, replacer, space);\n\n const convertedToCustomJSON = originalStringify(\n value,\n (key, value) => {\n const isNoise = typeof value === \"string\" && noiseValue.test(value);\n\n if (isNoise) return value.toString() + \"n\"; // Mark noise values with additional \"n\" to offset the deletion of one \"n\" during the processing\n\n if (typeof value === \"bigint\") return value.toString() + \"n\";\n\n if (typeof replacer === \"function\") return replacer(key, value);\n\n if (Array.isArray(replacer) && replacer.includes(key)) return value;\n\n return value;\n },\n space,\n );\n const processedJSON = convertedToCustomJSON.replace(\n bigIntsStringify,\n \"$1$2$3\",\n ); // Delete one \"n\" off the end of every BigInt value\n const denoisedJSON = processedJSON.replace(noiseStringify, \"$1$2$3\"); // Remove one \"n\" off the end of every noisy string\n\n return denoisedJSON;\n};\n\nconst featureCache = new Map();\n\n/**\n * Detects if the current JSON.parse implementation supports the context.source feature.\n *\n * Uses toString() fingerprinting to cache results and automatically detect runtime\n * replacements of JSON.parse (polyfills, mocks, etc.).\n *\n * @returns {boolean} true if context.source is supported, false otherwise.\n */\nconst isContextSourceSupported = () => {\n const parseFingerprint = JSON.parse.toString();\n\n if (featureCache.has(parseFingerprint)) {\n return featureCache.get(parseFingerprint);\n }\n\n try {\n const result = JSON.parse(\n \"1\",\n (_, __, context) => !!context?.source && context.source === \"1\",\n );\n featureCache.set(parseFingerprint, result);\n\n return result;\n } catch {\n featureCache.set(parseFingerprint, false);\n\n return false;\n }\n};\n\n/**\n * Reviver function that converts custom-format BigInt strings back to BigInt values.\n * Also handles \"noise\" strings that accidentally match the BigInt format.\n *\n * @param {string | number | undefined} key The object key.\n * @param {*} value The value being parsed.\n * @param {object} [context] Parse context (if supported by JSON.parse).\n * @param {Reviver} [userReviver] User's custom reviver function.\n * @returns {any} The transformed value.\n */\nconst convertMarkedBigIntsReviver = (key, value, context, userReviver) => {\n const isCustomFormatBigInt =\n typeof value === \"string\" && customFormat.test(value);\n if (isCustomFormatBigInt) return BigInt(value.slice(0, -1));\n\n const isNoiseValue = typeof value === \"string\" && noiseValue.test(value);\n if (isNoiseValue) return value.slice(0, -1);\n\n if (typeof userReviver !== \"function\") return value;\n\n return userReviver(key, value, context);\n};\n\n/**\n * Fast JSON.parse implementation (~2x faster than classic fallback).\n * Uses JSON.parse's context.source feature to detect integers and convert\n * large numbers directly to BigInt without string manipulation.\n *\n * Does not support legacy custom format from v1 of this library.\n *\n * @param {string} text JSON string to parse.\n * @param {Reviver} [reviver] Transform function to apply to each value.\n * @returns {any} Parsed JavaScript value.\n */\nconst JSONParseV2 = (text, reviver) => {\n return JSON.parse(text, (key, value, context) => {\n const isBigNumber =\n typeof value === \"number\" &&\n (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER);\n const isInt = context && intRegex.test(context.source);\n const isBigInt = isBigNumber && isInt;\n\n if (isBigInt) return BigInt(context.source);\n\n if (typeof reviver !== \"function\") return value;\n\n return reviver(key, value, context);\n });\n};\n\nconst MAX_INT = Number.MAX_SAFE_INTEGER.toString();\nconst MAX_DIGITS = MAX_INT.length;\nconst stringsOrLargeNumbers =\n /\"(?:\\\\.|[^\"])*\"|-?(0|[1-9][0-9]*)(\\.[0-9]+)?([eE][+-]?[0-9]+)?/g;\nconst noiseValueWithQuotes = /^\"-?\\d+n+\"$/; // Noise - strings that match the custom format before being converted to it\n\n/**\n * Converts a JSON string into a JavaScript value.\n *\n * Supports parsing of large integers using two strategies:\n * 1. Classic fallback: Marks large numbers with \"123n\" format, then converts to BigInt\n * 2. Fast path (JSONParseV2): Uses context.source feature (~2x faster) when available\n *\n * All other JSON values are parsed exactly like native JSON.parse().\n *\n * @param {string} text A valid JSON string.\n * @param {Reviver} [reviver]\n * A function that transforms the results. This function is called for each member\n * of the object. If a member contains nested objects, the nested objects are\n * transformed before the parent object is.\n * @returns {any} The parsed JavaScript value.\n * @throws {SyntaxError} If text is not valid JSON.\n */\nconst JSONParse = (text, reviver) => {\n if (!text) return originalParse(text, reviver);\n\n if (isContextSourceSupported()) return JSONParseV2(text, reviver); // Shortcut to a faster (2x) and simpler version\n\n // Find and mark big numbers with \"n\"\n const serializedData = text.replace(\n stringsOrLargeNumbers,\n (text, digits, fractional, exponential) => {\n const isString = text[0] === '\"';\n const isNoise = isString && noiseValueWithQuotes.test(text);\n\n if (isNoise) return text.substring(0, text.length - 1) + 'n\"'; // Mark noise values with additional \"n\" to offset the deletion of one \"n\" during the processing\n\n const isFractionalOrExponential = fractional || exponential;\n const isLessThanMaxSafeInt =\n digits &&\n (digits.length < MAX_DIGITS ||\n (digits.length === MAX_DIGITS && digits <= MAX_INT)); // With a fixed number of digits, we can correctly use lexicographical comparison to do a numeric comparison\n\n if (isString || isFractionalOrExponential || isLessThanMaxSafeInt)\n return text;\n\n return '\"' + text + 'n\"';\n },\n );\n\n return originalParse(serializedData, (key, value, context) =>\n convertMarkedBigIntsReviver(key, value, context, reviver),\n );\n};\n\nexport { JSONStringify, JSONParse };\n","class RequestError extends Error {\n name;\n /**\n * http status code\n */\n status;\n /**\n * Request options that lead to the error.\n */\n request;\n /**\n * Response object if a response was received\n */\n response;\n constructor(message, statusCode, options) {\n super(message, { cause: options.cause });\n this.name = \"HttpError\";\n this.status = Number.parseInt(statusCode);\n if (Number.isNaN(this.status)) {\n this.status = 0;\n }\n /* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist */\n if (\"response\" in options) {\n this.response = options.response;\n }\n const requestCopy = Object.assign({}, options.request);\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(\n /(? \"\";\nasync function fetchWrapper(requestOptions) {\n const fetch = requestOptions.request?.fetch || globalThis.fetch;\n if (!fetch) {\n throw new Error(\n \"fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing\"\n );\n }\n const log = requestOptions.request?.log || console;\n const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;\n const body = isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body) ? JSONStringify(requestOptions.body) : requestOptions.body;\n const requestHeaders = Object.fromEntries(\n Object.entries(requestOptions.headers).map(([name, value]) => [\n name,\n String(value)\n ])\n );\n let fetchResponse;\n try {\n fetchResponse = await fetch(requestOptions.url, {\n method: requestOptions.method,\n body,\n redirect: requestOptions.request?.redirect,\n headers: requestHeaders,\n signal: requestOptions.request?.signal,\n // duplex must be set if request.body is ReadableStream or Async Iterables.\n // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.\n ...requestOptions.body && { duplex: \"half\" }\n });\n } catch (error) {\n let message = \"Unknown Error\";\n if (error instanceof Error) {\n if (error.name === \"AbortError\") {\n error.status = 500;\n throw error;\n }\n message = error.message;\n if (error.name === \"TypeError\" && \"cause\" in error) {\n if (error.cause instanceof Error) {\n message = error.cause.message;\n } else if (typeof error.cause === \"string\") {\n message = error.cause;\n }\n }\n }\n const requestError = new RequestError(message, 500, {\n request: requestOptions\n });\n requestError.cause = error;\n throw requestError;\n }\n const status = fetchResponse.status;\n const url = fetchResponse.url;\n const responseHeaders = {};\n for (const [key, value] of fetchResponse.headers) {\n responseHeaders[key] = value;\n }\n const octokitResponse = {\n url,\n status,\n headers: responseHeaders,\n data: \"\"\n };\n if (\"deprecation\" in responseHeaders) {\n const matches = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel=\"deprecation\"/);\n const deprecationLink = matches && matches.pop();\n log.warn(\n `[@octokit/request] \"${requestOptions.method} ${requestOptions.url}\" is deprecated. It is scheduled to be removed on ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : \"\"}`\n );\n }\n if (status === 204 || status === 205) {\n return octokitResponse;\n }\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return octokitResponse;\n }\n throw new RequestError(fetchResponse.statusText, status, {\n response: octokitResponse,\n request: requestOptions\n });\n }\n if (status === 304) {\n octokitResponse.data = await getResponseData(fetchResponse);\n throw new RequestError(\"Not modified\", status, {\n response: octokitResponse,\n request: requestOptions\n });\n }\n if (status >= 400) {\n octokitResponse.data = await getResponseData(fetchResponse);\n throw new RequestError(toErrorMessage(octokitResponse.data), status, {\n response: octokitResponse,\n request: requestOptions\n });\n }\n octokitResponse.data = parseSuccessResponseBody ? await getResponseData(fetchResponse) : fetchResponse.body;\n return octokitResponse;\n}\nasync function getResponseData(response) {\n const contentType = response.headers.get(\"content-type\");\n if (!contentType) {\n return response.text().catch(noop);\n }\n const mimetype = safeParse(contentType);\n if (isJSONResponse(mimetype)) {\n let text = \"\";\n try {\n text = await response.text();\n return JSONParse(text);\n } catch (err) {\n return text;\n }\n } else if (mimetype.type.startsWith(\"text/\") || mimetype.parameters.charset?.toLowerCase() === \"utf-8\") {\n return response.text().catch(noop);\n } else {\n return response.arrayBuffer().catch(\n /* v8 ignore next -- @preserve */\n () => new ArrayBuffer(0)\n );\n }\n}\nfunction isJSONResponse(mimetype) {\n return mimetype.type === \"application/json\" || mimetype.type === \"application/scim+json\";\n}\nfunction toErrorMessage(data) {\n if (typeof data === \"string\") {\n return data;\n }\n if (data instanceof ArrayBuffer) {\n return \"Unknown error\";\n }\n if (\"message\" in data) {\n const suffix = \"documentation_url\" in data ? ` - ${data.documentation_url}` : \"\";\n return Array.isArray(data.errors) ? `${data.message}: ${data.errors.map((v) => JSON.stringify(v)).join(\", \")}${suffix}` : `${data.message}${suffix}`;\n }\n return `Unknown error: ${JSON.stringify(data)}`;\n}\n\n// pkg/dist-src/with-defaults.js\nfunction withDefaults(oldEndpoint, newDefaults) {\n const endpoint2 = oldEndpoint.defaults(newDefaults);\n const newApi = function(route, parameters) {\n const endpointOptions = endpoint2.merge(route, parameters);\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint2.parse(endpointOptions));\n }\n const request2 = (route2, parameters2) => {\n return fetchWrapper(\n endpoint2.parse(endpoint2.merge(route2, parameters2))\n );\n };\n Object.assign(request2, {\n endpoint: endpoint2,\n defaults: withDefaults.bind(null, endpoint2)\n });\n return endpointOptions.request.hook(request2, endpointOptions);\n };\n return Object.assign(newApi, {\n endpoint: endpoint2,\n defaults: withDefaults.bind(null, endpoint2)\n });\n}\n\n// pkg/dist-src/index.js\nvar request = withDefaults(endpoint, defaults_default);\nexport {\n request\n};\n/* v8 ignore next -- @preserve */\n/* v8 ignore else -- @preserve */\n","export function getUserAgent() {\n if (typeof navigator === \"object\" && \"userAgent\" in navigator) {\n return navigator.userAgent;\n }\n\n if (typeof process === \"object\" && process.version !== undefined) {\n return `Node.js/${process.version.substr(1)} (${process.platform}; ${\n process.arch\n })`;\n }\n\n return \"\";\n}\n","// pkg/dist-src/index.js\nimport { request } from \"@octokit/request\";\nimport { getUserAgent } from \"universal-user-agent\";\n\n// pkg/dist-src/version.js\nvar VERSION = \"0.0.0-development\";\n\n// pkg/dist-src/with-defaults.js\nimport { request as Request2 } from \"@octokit/request\";\n\n// pkg/dist-src/graphql.js\nimport { request as Request } from \"@octokit/request\";\n\n// pkg/dist-src/error.js\nfunction _buildMessageForResponseErrors(data) {\n return `Request failed due to following response errors:\n` + data.errors.map((e) => ` - ${e.message}`).join(\"\\n\");\n}\nvar GraphqlResponseError = class extends Error {\n constructor(request2, headers, response) {\n super(_buildMessageForResponseErrors(response));\n this.request = request2;\n this.headers = headers;\n this.response = response;\n this.errors = response.errors;\n this.data = response.data;\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n name = \"GraphqlResponseError\";\n errors;\n data;\n};\n\n// pkg/dist-src/graphql.js\nvar NON_VARIABLE_OPTIONS = [\n \"method\",\n \"baseUrl\",\n \"url\",\n \"headers\",\n \"request\",\n \"query\",\n \"mediaType\",\n \"operationName\"\n];\nvar FORBIDDEN_VARIABLE_OPTIONS = [\"query\", \"method\", \"url\"];\nvar GHES_V3_SUFFIX_REGEX = /\\/api\\/v3\\/?$/;\nfunction graphql(request2, query, options) {\n if (options) {\n if (typeof query === \"string\" && \"query\" in options) {\n return Promise.reject(\n new Error(`[@octokit/graphql] \"query\" cannot be used as variable name`)\n );\n }\n for (const key in options) {\n if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;\n return Promise.reject(\n new Error(\n `[@octokit/graphql] \"${key}\" cannot be used as variable name`\n )\n );\n }\n }\n const parsedOptions = typeof query === \"string\" ? Object.assign({ query }, options) : query;\n const requestOptions = Object.keys(\n parsedOptions\n ).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = parsedOptions[key];\n return result;\n }\n if (!result.variables) {\n result.variables = {};\n }\n result.variables[key] = parsedOptions[key];\n return result;\n }, {});\n const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;\n if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {\n requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, \"/api/graphql\");\n }\n return request2(requestOptions).then((response) => {\n if (response.data.errors) {\n const headers = {};\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n throw new GraphqlResponseError(\n requestOptions,\n headers,\n response.data\n );\n }\n return response.data.data;\n });\n}\n\n// pkg/dist-src/with-defaults.js\nfunction withDefaults(request2, newDefaults) {\n const newRequest = request2.defaults(newDefaults);\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: newRequest.endpoint\n });\n}\n\n// pkg/dist-src/index.js\nvar graphql2 = withDefaults(request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${getUserAgent()}`\n },\n method: \"POST\",\n url: \"/graphql\"\n});\nfunction withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\"\n });\n}\nexport {\n GraphqlResponseError,\n graphql2 as graphql,\n withCustomRequest\n};\n","// pkg/dist-src/is-jwt.js\nvar b64url = \"(?:[a-zA-Z0-9_-]+)\";\nvar sep = \"\\\\.\";\nvar jwtRE = new RegExp(`^${b64url}${sep}${b64url}${sep}${b64url}$`);\nvar isJWT = jwtRE.test.bind(jwtRE);\n\n// pkg/dist-src/auth.js\nasync function auth(token) {\n const isApp = isJWT(token);\n const isInstallation = token.startsWith(\"v1.\") || token.startsWith(\"ghs_\");\n const isUserToServer = token.startsWith(\"ghu_\");\n const tokenType = isApp ? \"app\" : isInstallation ? \"installation\" : isUserToServer ? \"user-to-server\" : \"oauth\";\n return {\n type: \"token\",\n token,\n tokenType\n };\n}\n\n// pkg/dist-src/with-authorization-prefix.js\nfunction withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n return `token ${token}`;\n}\n\n// pkg/dist-src/hook.js\nasync function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(\n route,\n parameters\n );\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n\n// pkg/dist-src/index.js\nvar createTokenAuth = function createTokenAuth2(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n if (typeof token !== \"string\") {\n throw new Error(\n \"[@octokit/auth-token] Token passed to createTokenAuth is not a string\"\n );\n }\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\nexport {\n createTokenAuth\n};\n","const VERSION = \"7.0.6\";\nexport {\n VERSION\n};\n","import { getUserAgent } from \"universal-user-agent\";\nimport Hook from \"before-after-hook\";\nimport { request } from \"@octokit/request\";\nimport { withCustomRequest } from \"@octokit/graphql\";\nimport { createTokenAuth } from \"@octokit/auth-token\";\nimport { VERSION } from \"./version.js\";\nconst noop = () => {\n};\nconst consoleWarn = console.warn.bind(console);\nconst consoleError = console.error.bind(console);\nfunction createLogger(logger = {}) {\n if (typeof logger.debug !== \"function\") {\n logger.debug = noop;\n }\n if (typeof logger.info !== \"function\") {\n logger.info = noop;\n }\n if (typeof logger.warn !== \"function\") {\n logger.warn = consoleWarn;\n }\n if (typeof logger.error !== \"function\") {\n logger.error = consoleError;\n }\n return logger;\n}\nconst userAgentTrail = `octokit-core.js/${VERSION} ${getUserAgent()}`;\nclass Octokit {\n static VERSION = VERSION;\n static defaults(defaults) {\n const OctokitWithDefaults = class extends this {\n constructor(...args) {\n const options = args[0] || {};\n if (typeof defaults === \"function\") {\n super(defaults(options));\n return;\n }\n super(\n Object.assign(\n {},\n defaults,\n options,\n options.userAgent && defaults.userAgent ? {\n userAgent: `${options.userAgent} ${defaults.userAgent}`\n } : null\n )\n );\n }\n };\n return OctokitWithDefaults;\n }\n static plugins = [];\n /**\n * Attach a plugin (or many) to your Octokit instance.\n *\n * @example\n * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)\n */\n static plugin(...newPlugins) {\n const currentPlugins = this.plugins;\n const NewOctokit = class extends this {\n static plugins = currentPlugins.concat(\n newPlugins.filter((plugin) => !currentPlugins.includes(plugin))\n );\n };\n return NewOctokit;\n }\n constructor(options = {}) {\n const hook = new Hook.Collection();\n const requestDefaults = {\n baseUrl: request.endpoint.DEFAULTS.baseUrl,\n headers: {},\n request: Object.assign({}, options.request, {\n // @ts-ignore internal usage only, no need to type\n hook: hook.bind(null, \"request\")\n }),\n mediaType: {\n previews: [],\n format: \"\"\n }\n };\n requestDefaults.headers[\"user-agent\"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;\n if (options.baseUrl) {\n requestDefaults.baseUrl = options.baseUrl;\n }\n if (options.previews) {\n requestDefaults.mediaType.previews = options.previews;\n }\n if (options.timeZone) {\n requestDefaults.headers[\"time-zone\"] = options.timeZone;\n }\n this.request = request.defaults(requestDefaults);\n this.graphql = withCustomRequest(this.request).defaults(requestDefaults);\n this.log = createLogger(options.log);\n this.hook = hook;\n if (!options.authStrategy) {\n if (!options.auth) {\n this.auth = async () => ({\n type: \"unauthenticated\"\n });\n } else {\n const auth = createTokenAuth(options.auth);\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n } else {\n const { authStrategy, ...otherOptions } = options;\n const auth = authStrategy(\n Object.assign(\n {\n request: this.request,\n log: this.log,\n // we pass the current octokit instance as well as its constructor options\n // to allow for authentication strategies that return a new octokit instance\n // that shares the same internal state as the current one. The original\n // requirement for this was the \"event-octokit\" authentication strategy\n // of https://github.com/probot/octokit-auth-probot.\n octokit: this,\n octokitOptions: otherOptions\n },\n options.auth\n )\n );\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n const classConstructor = this.constructor;\n for (let i = 0; i < classConstructor.plugins.length; ++i) {\n Object.assign(this, classConstructor.plugins[i](this, options));\n }\n }\n // assigned during constructor\n request;\n graphql;\n log;\n hook;\n // TODO: type `octokit.auth` based on passed options.authStrategy\n auth;\n}\nexport {\n Octokit\n};\n","export const VERSION = \"17.0.0\";\n","import type { EndpointsDefaultsAndDecorations } from \"../types.js\";\nconst Endpoints: EndpointsDefaultsAndDecorations = {\n actions: {\n addCustomLabelsToSelfHostedRunnerForOrg: [\n \"POST /orgs/{org}/actions/runners/{runner_id}/labels\",\n ],\n addCustomLabelsToSelfHostedRunnerForRepo: [\n \"POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\",\n ],\n addRepoAccessToSelfHostedRunnerGroupInOrg: [\n \"PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}\",\n ],\n addSelectedRepoToOrgSecret: [\n \"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\",\n ],\n addSelectedRepoToOrgVariable: [\n \"PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}\",\n ],\n approveWorkflowRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve\",\n ],\n cancelWorkflowRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\",\n ],\n createEnvironmentVariable: [\n \"POST /repos/{owner}/{repo}/environments/{environment_name}/variables\",\n ],\n createHostedRunnerForOrg: [\"POST /orgs/{org}/actions/hosted-runners\"],\n createOrUpdateEnvironmentSecret: [\n \"PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}\",\n ],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\n \"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\",\n ],\n createOrgVariable: [\"POST /orgs/{org}/actions/variables\"],\n createRegistrationTokenForOrg: [\n \"POST /orgs/{org}/actions/runners/registration-token\",\n ],\n createRegistrationTokenForRepo: [\n \"POST /repos/{owner}/{repo}/actions/runners/registration-token\",\n ],\n createRemoveTokenForOrg: [\"POST /orgs/{org}/actions/runners/remove-token\"],\n createRemoveTokenForRepo: [\n \"POST /repos/{owner}/{repo}/actions/runners/remove-token\",\n ],\n createRepoVariable: [\"POST /repos/{owner}/{repo}/actions/variables\"],\n createWorkflowDispatch: [\n \"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\",\n ],\n deleteActionsCacheById: [\n \"DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}\",\n ],\n deleteActionsCacheByKey: [\n \"DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}\",\n ],\n deleteArtifact: [\n \"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\",\n ],\n deleteCustomImageFromOrg: [\n \"DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}\",\n ],\n deleteCustomImageVersionFromOrg: [\n \"DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}\",\n ],\n deleteEnvironmentSecret: [\n \"DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}\",\n ],\n deleteEnvironmentVariable: [\n \"DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}\",\n ],\n deleteHostedRunnerForOrg: [\n \"DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}\",\n ],\n deleteOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}\"],\n deleteOrgVariable: [\"DELETE /orgs/{org}/actions/variables/{name}\"],\n deleteRepoSecret: [\n \"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\",\n ],\n deleteRepoVariable: [\n \"DELETE /repos/{owner}/{repo}/actions/variables/{name}\",\n ],\n deleteSelfHostedRunnerFromOrg: [\n \"DELETE /orgs/{org}/actions/runners/{runner_id}\",\n ],\n deleteSelfHostedRunnerFromRepo: [\n \"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\",\n ],\n deleteWorkflowRun: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n deleteWorkflowRunLogs: [\n \"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\",\n ],\n disableSelectedRepositoryGithubActionsOrganization: [\n \"DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}\",\n ],\n disableWorkflow: [\n \"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\",\n ],\n downloadArtifact: [\n \"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\",\n ],\n downloadJobLogsForWorkflowRun: [\n \"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\",\n ],\n downloadWorkflowRunAttemptLogs: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs\",\n ],\n downloadWorkflowRunLogs: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\",\n ],\n enableSelectedRepositoryGithubActionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions/repositories/{repository_id}\",\n ],\n enableWorkflow: [\n \"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\",\n ],\n forceCancelWorkflowRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel\",\n ],\n generateRunnerJitconfigForOrg: [\n \"POST /orgs/{org}/actions/runners/generate-jitconfig\",\n ],\n generateRunnerJitconfigForRepo: [\n \"POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig\",\n ],\n getActionsCacheList: [\"GET /repos/{owner}/{repo}/actions/caches\"],\n getActionsCacheUsage: [\"GET /repos/{owner}/{repo}/actions/cache/usage\"],\n getActionsCacheUsageByRepoForOrg: [\n \"GET /orgs/{org}/actions/cache/usage-by-repository\",\n ],\n getActionsCacheUsageForOrg: [\"GET /orgs/{org}/actions/cache/usage\"],\n getAllowedActionsOrganization: [\n \"GET /orgs/{org}/actions/permissions/selected-actions\",\n ],\n getAllowedActionsRepository: [\n \"GET /repos/{owner}/{repo}/actions/permissions/selected-actions\",\n ],\n getArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n getCustomImageForOrg: [\n \"GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}\",\n ],\n getCustomImageVersionForOrg: [\n \"GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}\",\n ],\n getCustomOidcSubClaimForRepo: [\n \"GET /repos/{owner}/{repo}/actions/oidc/customization/sub\",\n ],\n getEnvironmentPublicKey: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key\",\n ],\n getEnvironmentSecret: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}\",\n ],\n getEnvironmentVariable: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}\",\n ],\n getGithubActionsDefaultWorkflowPermissionsOrganization: [\n \"GET /orgs/{org}/actions/permissions/workflow\",\n ],\n getGithubActionsDefaultWorkflowPermissionsRepository: [\n \"GET /repos/{owner}/{repo}/actions/permissions/workflow\",\n ],\n getGithubActionsPermissionsOrganization: [\n \"GET /orgs/{org}/actions/permissions\",\n ],\n getGithubActionsPermissionsRepository: [\n \"GET /repos/{owner}/{repo}/actions/permissions\",\n ],\n getHostedRunnerForOrg: [\n \"GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}\",\n ],\n getHostedRunnersGithubOwnedImagesForOrg: [\n \"GET /orgs/{org}/actions/hosted-runners/images/github-owned\",\n ],\n getHostedRunnersLimitsForOrg: [\n \"GET /orgs/{org}/actions/hosted-runners/limits\",\n ],\n getHostedRunnersMachineSpecsForOrg: [\n \"GET /orgs/{org}/actions/hosted-runners/machine-sizes\",\n ],\n getHostedRunnersPartnerImagesForOrg: [\n \"GET /orgs/{org}/actions/hosted-runners/images/partner\",\n ],\n getHostedRunnersPlatformsForOrg: [\n \"GET /orgs/{org}/actions/hosted-runners/platforms\",\n ],\n getJobForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/actions/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}\"],\n getOrgVariable: [\"GET /orgs/{org}/actions/variables/{name}\"],\n getPendingDeploymentsForRun: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\",\n ],\n getRepoPermissions: [\n \"GET /repos/{owner}/{repo}/actions/permissions\",\n {},\n { renamed: [\"actions\", \"getGithubActionsPermissionsRepository\"] },\n ],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/actions/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n getRepoVariable: [\"GET /repos/{owner}/{repo}/actions/variables/{name}\"],\n getReviewsForRun: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals\",\n ],\n getSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}\"],\n getSelfHostedRunnerForRepo: [\n \"GET /repos/{owner}/{repo}/actions/runners/{runner_id}\",\n ],\n getWorkflow: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\"],\n getWorkflowAccessToRepository: [\n \"GET /repos/{owner}/{repo}/actions/permissions/access\",\n ],\n getWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n getWorkflowRunAttempt: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}\",\n ],\n getWorkflowRunUsage: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\",\n ],\n getWorkflowUsage: [\n \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\",\n ],\n listArtifactsForRepo: [\"GET /repos/{owner}/{repo}/actions/artifacts\"],\n listCustomImageVersionsForOrg: [\n \"GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions\",\n ],\n listCustomImagesForOrg: [\n \"GET /orgs/{org}/actions/hosted-runners/images/custom\",\n ],\n listEnvironmentSecrets: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/secrets\",\n ],\n listEnvironmentVariables: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/variables\",\n ],\n listGithubHostedRunnersInGroupForOrg: [\n \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners\",\n ],\n listHostedRunnersForOrg: [\"GET /orgs/{org}/actions/hosted-runners\"],\n listJobsForWorkflowRun: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\",\n ],\n listJobsForWorkflowRunAttempt: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\",\n ],\n listLabelsForSelfHostedRunnerForOrg: [\n \"GET /orgs/{org}/actions/runners/{runner_id}/labels\",\n ],\n listLabelsForSelfHostedRunnerForRepo: [\n \"GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\",\n ],\n listOrgSecrets: [\"GET /orgs/{org}/actions/secrets\"],\n listOrgVariables: [\"GET /orgs/{org}/actions/variables\"],\n listRepoOrganizationSecrets: [\n \"GET /repos/{owner}/{repo}/actions/organization-secrets\",\n ],\n listRepoOrganizationVariables: [\n \"GET /repos/{owner}/{repo}/actions/organization-variables\",\n ],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/actions/secrets\"],\n listRepoVariables: [\"GET /repos/{owner}/{repo}/actions/variables\"],\n listRepoWorkflows: [\"GET /repos/{owner}/{repo}/actions/workflows\"],\n listRunnerApplicationsForOrg: [\"GET /orgs/{org}/actions/runners/downloads\"],\n listRunnerApplicationsForRepo: [\n \"GET /repos/{owner}/{repo}/actions/runners/downloads\",\n ],\n listSelectedReposForOrgSecret: [\n \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\",\n ],\n listSelectedReposForOrgVariable: [\n \"GET /orgs/{org}/actions/variables/{name}/repositories\",\n ],\n listSelectedRepositoriesEnabledGithubActionsOrganization: [\n \"GET /orgs/{org}/actions/permissions/repositories\",\n ],\n listSelfHostedRunnersForOrg: [\"GET /orgs/{org}/actions/runners\"],\n listSelfHostedRunnersForRepo: [\"GET /repos/{owner}/{repo}/actions/runners\"],\n listWorkflowRunArtifacts: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\",\n ],\n listWorkflowRuns: [\n \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\",\n ],\n listWorkflowRunsForRepo: [\"GET /repos/{owner}/{repo}/actions/runs\"],\n reRunJobForWorkflowRun: [\n \"POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun\",\n ],\n reRunWorkflow: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun\"],\n reRunWorkflowFailedJobs: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs\",\n ],\n removeAllCustomLabelsFromSelfHostedRunnerForOrg: [\n \"DELETE /orgs/{org}/actions/runners/{runner_id}/labels\",\n ],\n removeAllCustomLabelsFromSelfHostedRunnerForRepo: [\n \"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\",\n ],\n removeCustomLabelFromSelfHostedRunnerForOrg: [\n \"DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}\",\n ],\n removeCustomLabelFromSelfHostedRunnerForRepo: [\n \"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}\",\n ],\n removeSelectedRepoFromOrgSecret: [\n \"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\",\n ],\n removeSelectedRepoFromOrgVariable: [\n \"DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}\",\n ],\n reviewCustomGatesForRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule\",\n ],\n reviewPendingDeploymentsForRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\",\n ],\n setAllowedActionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions/selected-actions\",\n ],\n setAllowedActionsRepository: [\n \"PUT /repos/{owner}/{repo}/actions/permissions/selected-actions\",\n ],\n setCustomLabelsForSelfHostedRunnerForOrg: [\n \"PUT /orgs/{org}/actions/runners/{runner_id}/labels\",\n ],\n setCustomLabelsForSelfHostedRunnerForRepo: [\n \"PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\",\n ],\n setCustomOidcSubClaimForRepo: [\n \"PUT /repos/{owner}/{repo}/actions/oidc/customization/sub\",\n ],\n setGithubActionsDefaultWorkflowPermissionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions/workflow\",\n ],\n setGithubActionsDefaultWorkflowPermissionsRepository: [\n \"PUT /repos/{owner}/{repo}/actions/permissions/workflow\",\n ],\n setGithubActionsPermissionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions\",\n ],\n setGithubActionsPermissionsRepository: [\n \"PUT /repos/{owner}/{repo}/actions/permissions\",\n ],\n setSelectedReposForOrgSecret: [\n \"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\",\n ],\n setSelectedReposForOrgVariable: [\n \"PUT /orgs/{org}/actions/variables/{name}/repositories\",\n ],\n setSelectedRepositoriesEnabledGithubActionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions/repositories\",\n ],\n setWorkflowAccessToRepository: [\n \"PUT /repos/{owner}/{repo}/actions/permissions/access\",\n ],\n updateEnvironmentVariable: [\n \"PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}\",\n ],\n updateHostedRunnerForOrg: [\n \"PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}\",\n ],\n updateOrgVariable: [\"PATCH /orgs/{org}/actions/variables/{name}\"],\n updateRepoVariable: [\n \"PATCH /repos/{owner}/{repo}/actions/variables/{name}\",\n ],\n },\n activity: {\n checkRepoIsStarredByAuthenticatedUser: [\"GET /user/starred/{owner}/{repo}\"],\n deleteRepoSubscription: [\"DELETE /repos/{owner}/{repo}/subscription\"],\n deleteThreadSubscription: [\n \"DELETE /notifications/threads/{thread_id}/subscription\",\n ],\n getFeeds: [\"GET /feeds\"],\n getRepoSubscription: [\"GET /repos/{owner}/{repo}/subscription\"],\n getThread: [\"GET /notifications/threads/{thread_id}\"],\n getThreadSubscriptionForAuthenticatedUser: [\n \"GET /notifications/threads/{thread_id}/subscription\",\n ],\n listEventsForAuthenticatedUser: [\"GET /users/{username}/events\"],\n listNotificationsForAuthenticatedUser: [\"GET /notifications\"],\n listOrgEventsForAuthenticatedUser: [\n \"GET /users/{username}/events/orgs/{org}\",\n ],\n listPublicEvents: [\"GET /events\"],\n listPublicEventsForRepoNetwork: [\"GET /networks/{owner}/{repo}/events\"],\n listPublicEventsForUser: [\"GET /users/{username}/events/public\"],\n listPublicOrgEvents: [\"GET /orgs/{org}/events\"],\n listReceivedEventsForUser: [\"GET /users/{username}/received_events\"],\n listReceivedPublicEventsForUser: [\n \"GET /users/{username}/received_events/public\",\n ],\n listRepoEvents: [\"GET /repos/{owner}/{repo}/events\"],\n listRepoNotificationsForAuthenticatedUser: [\n \"GET /repos/{owner}/{repo}/notifications\",\n ],\n listReposStarredByAuthenticatedUser: [\"GET /user/starred\"],\n listReposStarredByUser: [\"GET /users/{username}/starred\"],\n listReposWatchedByUser: [\"GET /users/{username}/subscriptions\"],\n listStargazersForRepo: [\"GET /repos/{owner}/{repo}/stargazers\"],\n listWatchedReposForAuthenticatedUser: [\"GET /user/subscriptions\"],\n listWatchersForRepo: [\"GET /repos/{owner}/{repo}/subscribers\"],\n markNotificationsAsRead: [\"PUT /notifications\"],\n markRepoNotificationsAsRead: [\"PUT /repos/{owner}/{repo}/notifications\"],\n markThreadAsDone: [\"DELETE /notifications/threads/{thread_id}\"],\n markThreadAsRead: [\"PATCH /notifications/threads/{thread_id}\"],\n setRepoSubscription: [\"PUT /repos/{owner}/{repo}/subscription\"],\n setThreadSubscription: [\n \"PUT /notifications/threads/{thread_id}/subscription\",\n ],\n starRepoForAuthenticatedUser: [\"PUT /user/starred/{owner}/{repo}\"],\n unstarRepoForAuthenticatedUser: [\"DELETE /user/starred/{owner}/{repo}\"],\n },\n apps: {\n addRepoToInstallation: [\n \"PUT /user/installations/{installation_id}/repositories/{repository_id}\",\n {},\n { renamed: [\"apps\", \"addRepoToInstallationForAuthenticatedUser\"] },\n ],\n addRepoToInstallationForAuthenticatedUser: [\n \"PUT /user/installations/{installation_id}/repositories/{repository_id}\",\n ],\n checkToken: [\"POST /applications/{client_id}/token\"],\n createFromManifest: [\"POST /app-manifests/{code}/conversions\"],\n createInstallationAccessToken: [\n \"POST /app/installations/{installation_id}/access_tokens\",\n ],\n deleteAuthorization: [\"DELETE /applications/{client_id}/grant\"],\n deleteInstallation: [\"DELETE /app/installations/{installation_id}\"],\n deleteToken: [\"DELETE /applications/{client_id}/token\"],\n getAuthenticated: [\"GET /app\"],\n getBySlug: [\"GET /apps/{app_slug}\"],\n getInstallation: [\"GET /app/installations/{installation_id}\"],\n getOrgInstallation: [\"GET /orgs/{org}/installation\"],\n getRepoInstallation: [\"GET /repos/{owner}/{repo}/installation\"],\n getSubscriptionPlanForAccount: [\n \"GET /marketplace_listing/accounts/{account_id}\",\n ],\n getSubscriptionPlanForAccountStubbed: [\n \"GET /marketplace_listing/stubbed/accounts/{account_id}\",\n ],\n getUserInstallation: [\"GET /users/{username}/installation\"],\n getWebhookConfigForApp: [\"GET /app/hook/config\"],\n getWebhookDelivery: [\"GET /app/hook/deliveries/{delivery_id}\"],\n listAccountsForPlan: [\"GET /marketplace_listing/plans/{plan_id}/accounts\"],\n listAccountsForPlanStubbed: [\n \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\",\n ],\n listInstallationReposForAuthenticatedUser: [\n \"GET /user/installations/{installation_id}/repositories\",\n ],\n listInstallationRequestsForAuthenticatedApp: [\n \"GET /app/installation-requests\",\n ],\n listInstallations: [\"GET /app/installations\"],\n listInstallationsForAuthenticatedUser: [\"GET /user/installations\"],\n listPlans: [\"GET /marketplace_listing/plans\"],\n listPlansStubbed: [\"GET /marketplace_listing/stubbed/plans\"],\n listReposAccessibleToInstallation: [\"GET /installation/repositories\"],\n listSubscriptionsForAuthenticatedUser: [\"GET /user/marketplace_purchases\"],\n listSubscriptionsForAuthenticatedUserStubbed: [\n \"GET /user/marketplace_purchases/stubbed\",\n ],\n listWebhookDeliveries: [\"GET /app/hook/deliveries\"],\n redeliverWebhookDelivery: [\n \"POST /app/hook/deliveries/{delivery_id}/attempts\",\n ],\n removeRepoFromInstallation: [\n \"DELETE /user/installations/{installation_id}/repositories/{repository_id}\",\n {},\n { renamed: [\"apps\", \"removeRepoFromInstallationForAuthenticatedUser\"] },\n ],\n removeRepoFromInstallationForAuthenticatedUser: [\n \"DELETE /user/installations/{installation_id}/repositories/{repository_id}\",\n ],\n resetToken: [\"PATCH /applications/{client_id}/token\"],\n revokeInstallationAccessToken: [\"DELETE /installation/token\"],\n scopeToken: [\"POST /applications/{client_id}/token/scoped\"],\n suspendInstallation: [\"PUT /app/installations/{installation_id}/suspended\"],\n unsuspendInstallation: [\n \"DELETE /app/installations/{installation_id}/suspended\",\n ],\n updateWebhookConfigForApp: [\"PATCH /app/hook/config\"],\n },\n billing: {\n getGithubActionsBillingOrg: [\"GET /orgs/{org}/settings/billing/actions\"],\n getGithubActionsBillingUser: [\n \"GET /users/{username}/settings/billing/actions\",\n ],\n getGithubBillingPremiumRequestUsageReportOrg: [\n \"GET /organizations/{org}/settings/billing/premium_request/usage\",\n ],\n getGithubBillingPremiumRequestUsageReportUser: [\n \"GET /users/{username}/settings/billing/premium_request/usage\",\n ],\n getGithubBillingUsageReportOrg: [\n \"GET /organizations/{org}/settings/billing/usage\",\n ],\n getGithubBillingUsageReportUser: [\n \"GET /users/{username}/settings/billing/usage\",\n ],\n getGithubPackagesBillingOrg: [\"GET /orgs/{org}/settings/billing/packages\"],\n getGithubPackagesBillingUser: [\n \"GET /users/{username}/settings/billing/packages\",\n ],\n getSharedStorageBillingOrg: [\n \"GET /orgs/{org}/settings/billing/shared-storage\",\n ],\n getSharedStorageBillingUser: [\n \"GET /users/{username}/settings/billing/shared-storage\",\n ],\n },\n campaigns: {\n createCampaign: [\"POST /orgs/{org}/campaigns\"],\n deleteCampaign: [\"DELETE /orgs/{org}/campaigns/{campaign_number}\"],\n getCampaignSummary: [\"GET /orgs/{org}/campaigns/{campaign_number}\"],\n listOrgCampaigns: [\"GET /orgs/{org}/campaigns\"],\n updateCampaign: [\"PATCH /orgs/{org}/campaigns/{campaign_number}\"],\n },\n checks: {\n create: [\"POST /repos/{owner}/{repo}/check-runs\"],\n createSuite: [\"POST /repos/{owner}/{repo}/check-suites\"],\n get: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}\"],\n getSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\"],\n listAnnotations: [\n \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\",\n ],\n listForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\"],\n listForSuite: [\n \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\",\n ],\n listSuitesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\"],\n rerequestRun: [\n \"POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest\",\n ],\n rerequestSuite: [\n \"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\",\n ],\n setSuitesPreferences: [\n \"PATCH /repos/{owner}/{repo}/check-suites/preferences\",\n ],\n update: [\"PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\"],\n },\n codeScanning: {\n commitAutofix: [\n \"POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits\",\n ],\n createAutofix: [\n \"POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix\",\n ],\n createVariantAnalysis: [\n \"POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses\",\n ],\n deleteAnalysis: [\n \"DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}\",\n ],\n deleteCodeqlDatabase: [\n \"DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}\",\n ],\n getAlert: [\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\",\n {},\n { renamedParameters: { alert_id: \"alert_number\" } },\n ],\n getAnalysis: [\n \"GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}\",\n ],\n getAutofix: [\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix\",\n ],\n getCodeqlDatabase: [\n \"GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}\",\n ],\n getDefaultSetup: [\"GET /repos/{owner}/{repo}/code-scanning/default-setup\"],\n getSarif: [\"GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}\"],\n getVariantAnalysis: [\n \"GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}\",\n ],\n getVariantAnalysisRepoTask: [\n \"GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}\",\n ],\n listAlertInstances: [\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\",\n ],\n listAlertsForOrg: [\"GET /orgs/{org}/code-scanning/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/code-scanning/alerts\"],\n listAlertsInstances: [\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\",\n {},\n { renamed: [\"codeScanning\", \"listAlertInstances\"] },\n ],\n listCodeqlDatabases: [\n \"GET /repos/{owner}/{repo}/code-scanning/codeql/databases\",\n ],\n listRecentAnalyses: [\"GET /repos/{owner}/{repo}/code-scanning/analyses\"],\n updateAlert: [\n \"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\",\n ],\n updateDefaultSetup: [\n \"PATCH /repos/{owner}/{repo}/code-scanning/default-setup\",\n ],\n uploadSarif: [\"POST /repos/{owner}/{repo}/code-scanning/sarifs\"],\n },\n codeSecurity: {\n attachConfiguration: [\n \"POST /orgs/{org}/code-security/configurations/{configuration_id}/attach\",\n ],\n attachEnterpriseConfiguration: [\n \"POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach\",\n ],\n createConfiguration: [\"POST /orgs/{org}/code-security/configurations\"],\n createConfigurationForEnterprise: [\n \"POST /enterprises/{enterprise}/code-security/configurations\",\n ],\n deleteConfiguration: [\n \"DELETE /orgs/{org}/code-security/configurations/{configuration_id}\",\n ],\n deleteConfigurationForEnterprise: [\n \"DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}\",\n ],\n detachConfiguration: [\n \"DELETE /orgs/{org}/code-security/configurations/detach\",\n ],\n getConfiguration: [\n \"GET /orgs/{org}/code-security/configurations/{configuration_id}\",\n ],\n getConfigurationForRepository: [\n \"GET /repos/{owner}/{repo}/code-security-configuration\",\n ],\n getConfigurationsForEnterprise: [\n \"GET /enterprises/{enterprise}/code-security/configurations\",\n ],\n getConfigurationsForOrg: [\"GET /orgs/{org}/code-security/configurations\"],\n getDefaultConfigurations: [\n \"GET /orgs/{org}/code-security/configurations/defaults\",\n ],\n getDefaultConfigurationsForEnterprise: [\n \"GET /enterprises/{enterprise}/code-security/configurations/defaults\",\n ],\n getRepositoriesForConfiguration: [\n \"GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories\",\n ],\n getRepositoriesForEnterpriseConfiguration: [\n \"GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories\",\n ],\n getSingleConfigurationForEnterprise: [\n \"GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}\",\n ],\n setConfigurationAsDefault: [\n \"PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults\",\n ],\n setConfigurationAsDefaultForEnterprise: [\n \"PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults\",\n ],\n updateConfiguration: [\n \"PATCH /orgs/{org}/code-security/configurations/{configuration_id}\",\n ],\n updateEnterpriseConfiguration: [\n \"PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}\",\n ],\n },\n codesOfConduct: {\n getAllCodesOfConduct: [\"GET /codes_of_conduct\"],\n getConductCode: [\"GET /codes_of_conduct/{key}\"],\n },\n codespaces: {\n addRepositoryForSecretForAuthenticatedUser: [\n \"PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}\",\n ],\n addSelectedRepoToOrgSecret: [\n \"PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}\",\n ],\n checkPermissionsForDevcontainer: [\n \"GET /repos/{owner}/{repo}/codespaces/permissions_check\",\n ],\n codespaceMachinesForAuthenticatedUser: [\n \"GET /user/codespaces/{codespace_name}/machines\",\n ],\n createForAuthenticatedUser: [\"POST /user/codespaces\"],\n createOrUpdateOrgSecret: [\n \"PUT /orgs/{org}/codespaces/secrets/{secret_name}\",\n ],\n createOrUpdateRepoSecret: [\n \"PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\",\n ],\n createOrUpdateSecretForAuthenticatedUser: [\n \"PUT /user/codespaces/secrets/{secret_name}\",\n ],\n createWithPrForAuthenticatedUser: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces\",\n ],\n createWithRepoForAuthenticatedUser: [\n \"POST /repos/{owner}/{repo}/codespaces\",\n ],\n deleteForAuthenticatedUser: [\"DELETE /user/codespaces/{codespace_name}\"],\n deleteFromOrganization: [\n \"DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}\",\n ],\n deleteOrgSecret: [\"DELETE /orgs/{org}/codespaces/secrets/{secret_name}\"],\n deleteRepoSecret: [\n \"DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\",\n ],\n deleteSecretForAuthenticatedUser: [\n \"DELETE /user/codespaces/secrets/{secret_name}\",\n ],\n exportForAuthenticatedUser: [\n \"POST /user/codespaces/{codespace_name}/exports\",\n ],\n getCodespacesForUserInOrg: [\n \"GET /orgs/{org}/members/{username}/codespaces\",\n ],\n getExportDetailsForAuthenticatedUser: [\n \"GET /user/codespaces/{codespace_name}/exports/{export_id}\",\n ],\n getForAuthenticatedUser: [\"GET /user/codespaces/{codespace_name}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/codespaces/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/codespaces/secrets/{secret_name}\"],\n getPublicKeyForAuthenticatedUser: [\n \"GET /user/codespaces/secrets/public-key\",\n ],\n getRepoPublicKey: [\n \"GET /repos/{owner}/{repo}/codespaces/secrets/public-key\",\n ],\n getRepoSecret: [\n \"GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\",\n ],\n getSecretForAuthenticatedUser: [\n \"GET /user/codespaces/secrets/{secret_name}\",\n ],\n listDevcontainersInRepositoryForAuthenticatedUser: [\n \"GET /repos/{owner}/{repo}/codespaces/devcontainers\",\n ],\n listForAuthenticatedUser: [\"GET /user/codespaces\"],\n listInOrganization: [\n \"GET /orgs/{org}/codespaces\",\n {},\n { renamedParameters: { org_id: \"org\" } },\n ],\n listInRepositoryForAuthenticatedUser: [\n \"GET /repos/{owner}/{repo}/codespaces\",\n ],\n listOrgSecrets: [\"GET /orgs/{org}/codespaces/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/codespaces/secrets\"],\n listRepositoriesForSecretForAuthenticatedUser: [\n \"GET /user/codespaces/secrets/{secret_name}/repositories\",\n ],\n listSecretsForAuthenticatedUser: [\"GET /user/codespaces/secrets\"],\n listSelectedReposForOrgSecret: [\n \"GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories\",\n ],\n preFlightWithRepoForAuthenticatedUser: [\n \"GET /repos/{owner}/{repo}/codespaces/new\",\n ],\n publishForAuthenticatedUser: [\n \"POST /user/codespaces/{codespace_name}/publish\",\n ],\n removeRepositoryForSecretForAuthenticatedUser: [\n \"DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}\",\n ],\n removeSelectedRepoFromOrgSecret: [\n \"DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}\",\n ],\n repoMachinesForAuthenticatedUser: [\n \"GET /repos/{owner}/{repo}/codespaces/machines\",\n ],\n setRepositoriesForSecretForAuthenticatedUser: [\n \"PUT /user/codespaces/secrets/{secret_name}/repositories\",\n ],\n setSelectedReposForOrgSecret: [\n \"PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories\",\n ],\n startForAuthenticatedUser: [\"POST /user/codespaces/{codespace_name}/start\"],\n stopForAuthenticatedUser: [\"POST /user/codespaces/{codespace_name}/stop\"],\n stopInOrganization: [\n \"POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop\",\n ],\n updateForAuthenticatedUser: [\"PATCH /user/codespaces/{codespace_name}\"],\n },\n copilot: {\n addCopilotSeatsForTeams: [\n \"POST /orgs/{org}/copilot/billing/selected_teams\",\n ],\n addCopilotSeatsForUsers: [\n \"POST /orgs/{org}/copilot/billing/selected_users\",\n ],\n cancelCopilotSeatAssignmentForTeams: [\n \"DELETE /orgs/{org}/copilot/billing/selected_teams\",\n ],\n cancelCopilotSeatAssignmentForUsers: [\n \"DELETE /orgs/{org}/copilot/billing/selected_users\",\n ],\n copilotMetricsForOrganization: [\"GET /orgs/{org}/copilot/metrics\"],\n copilotMetricsForTeam: [\"GET /orgs/{org}/team/{team_slug}/copilot/metrics\"],\n getCopilotOrganizationDetails: [\"GET /orgs/{org}/copilot/billing\"],\n getCopilotSeatDetailsForUser: [\n \"GET /orgs/{org}/members/{username}/copilot\",\n ],\n listCopilotSeats: [\"GET /orgs/{org}/copilot/billing/seats\"],\n },\n credentials: { revoke: [\"POST /credentials/revoke\"] },\n dependabot: {\n addSelectedRepoToOrgSecret: [\n \"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}\",\n ],\n createOrUpdateOrgSecret: [\n \"PUT /orgs/{org}/dependabot/secrets/{secret_name}\",\n ],\n createOrUpdateRepoSecret: [\n \"PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\",\n ],\n deleteOrgSecret: [\"DELETE /orgs/{org}/dependabot/secrets/{secret_name}\"],\n deleteRepoSecret: [\n \"DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\",\n ],\n getAlert: [\"GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/dependabot/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/dependabot/secrets/{secret_name}\"],\n getRepoPublicKey: [\n \"GET /repos/{owner}/{repo}/dependabot/secrets/public-key\",\n ],\n getRepoSecret: [\n \"GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\",\n ],\n listAlertsForEnterprise: [\n \"GET /enterprises/{enterprise}/dependabot/alerts\",\n ],\n listAlertsForOrg: [\"GET /orgs/{org}/dependabot/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/dependabot/alerts\"],\n listOrgSecrets: [\"GET /orgs/{org}/dependabot/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/dependabot/secrets\"],\n listSelectedReposForOrgSecret: [\n \"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories\",\n ],\n removeSelectedRepoFromOrgSecret: [\n \"DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}\",\n ],\n repositoryAccessForOrg: [\n \"GET /organizations/{org}/dependabot/repository-access\",\n ],\n setRepositoryAccessDefaultLevel: [\n \"PUT /organizations/{org}/dependabot/repository-access/default-level\",\n ],\n setSelectedReposForOrgSecret: [\n \"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories\",\n ],\n updateAlert: [\n \"PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}\",\n ],\n updateRepositoryAccessForOrg: [\n \"PATCH /organizations/{org}/dependabot/repository-access\",\n ],\n },\n dependencyGraph: {\n createRepositorySnapshot: [\n \"POST /repos/{owner}/{repo}/dependency-graph/snapshots\",\n ],\n diffRange: [\n \"GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}\",\n ],\n exportSbom: [\"GET /repos/{owner}/{repo}/dependency-graph/sbom\"],\n },\n emojis: { get: [\"GET /emojis\"] },\n enterpriseTeamMemberships: {\n add: [\n \"PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}\",\n ],\n bulkAdd: [\n \"POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add\",\n ],\n bulkRemove: [\n \"POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove\",\n ],\n get: [\n \"GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}\",\n ],\n list: [\"GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships\"],\n remove: [\n \"DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}\",\n ],\n },\n enterpriseTeamOrganizations: {\n add: [\n \"PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}\",\n ],\n bulkAdd: [\n \"POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add\",\n ],\n bulkRemove: [\n \"POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove\",\n ],\n delete: [\n \"DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}\",\n ],\n getAssignment: [\n \"GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}\",\n ],\n getAssignments: [\n \"GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations\",\n ],\n },\n enterpriseTeams: {\n create: [\"POST /enterprises/{enterprise}/teams\"],\n delete: [\"DELETE /enterprises/{enterprise}/teams/{team_slug}\"],\n get: [\"GET /enterprises/{enterprise}/teams/{team_slug}\"],\n list: [\"GET /enterprises/{enterprise}/teams\"],\n update: [\"PATCH /enterprises/{enterprise}/teams/{team_slug}\"],\n },\n gists: {\n checkIsStarred: [\"GET /gists/{gist_id}/star\"],\n create: [\"POST /gists\"],\n createComment: [\"POST /gists/{gist_id}/comments\"],\n delete: [\"DELETE /gists/{gist_id}\"],\n deleteComment: [\"DELETE /gists/{gist_id}/comments/{comment_id}\"],\n fork: [\"POST /gists/{gist_id}/forks\"],\n get: [\"GET /gists/{gist_id}\"],\n getComment: [\"GET /gists/{gist_id}/comments/{comment_id}\"],\n getRevision: [\"GET /gists/{gist_id}/{sha}\"],\n list: [\"GET /gists\"],\n listComments: [\"GET /gists/{gist_id}/comments\"],\n listCommits: [\"GET /gists/{gist_id}/commits\"],\n listForUser: [\"GET /users/{username}/gists\"],\n listForks: [\"GET /gists/{gist_id}/forks\"],\n listPublic: [\"GET /gists/public\"],\n listStarred: [\"GET /gists/starred\"],\n star: [\"PUT /gists/{gist_id}/star\"],\n unstar: [\"DELETE /gists/{gist_id}/star\"],\n update: [\"PATCH /gists/{gist_id}\"],\n updateComment: [\"PATCH /gists/{gist_id}/comments/{comment_id}\"],\n },\n git: {\n createBlob: [\"POST /repos/{owner}/{repo}/git/blobs\"],\n createCommit: [\"POST /repos/{owner}/{repo}/git/commits\"],\n createRef: [\"POST /repos/{owner}/{repo}/git/refs\"],\n createTag: [\"POST /repos/{owner}/{repo}/git/tags\"],\n createTree: [\"POST /repos/{owner}/{repo}/git/trees\"],\n deleteRef: [\"DELETE /repos/{owner}/{repo}/git/refs/{ref}\"],\n getBlob: [\"GET /repos/{owner}/{repo}/git/blobs/{file_sha}\"],\n getCommit: [\"GET /repos/{owner}/{repo}/git/commits/{commit_sha}\"],\n getRef: [\"GET /repos/{owner}/{repo}/git/ref/{ref}\"],\n getTag: [\"GET /repos/{owner}/{repo}/git/tags/{tag_sha}\"],\n getTree: [\"GET /repos/{owner}/{repo}/git/trees/{tree_sha}\"],\n listMatchingRefs: [\"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\"],\n updateRef: [\"PATCH /repos/{owner}/{repo}/git/refs/{ref}\"],\n },\n gitignore: {\n getAllTemplates: [\"GET /gitignore/templates\"],\n getTemplate: [\"GET /gitignore/templates/{name}\"],\n },\n hostedCompute: {\n createNetworkConfigurationForOrg: [\n \"POST /orgs/{org}/settings/network-configurations\",\n ],\n deleteNetworkConfigurationFromOrg: [\n \"DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}\",\n ],\n getNetworkConfigurationForOrg: [\n \"GET /orgs/{org}/settings/network-configurations/{network_configuration_id}\",\n ],\n getNetworkSettingsForOrg: [\n \"GET /orgs/{org}/settings/network-settings/{network_settings_id}\",\n ],\n listNetworkConfigurationsForOrg: [\n \"GET /orgs/{org}/settings/network-configurations\",\n ],\n updateNetworkConfigurationForOrg: [\n \"PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}\",\n ],\n },\n interactions: {\n getRestrictionsForAuthenticatedUser: [\"GET /user/interaction-limits\"],\n getRestrictionsForOrg: [\"GET /orgs/{org}/interaction-limits\"],\n getRestrictionsForRepo: [\"GET /repos/{owner}/{repo}/interaction-limits\"],\n getRestrictionsForYourPublicRepos: [\n \"GET /user/interaction-limits\",\n {},\n { renamed: [\"interactions\", \"getRestrictionsForAuthenticatedUser\"] },\n ],\n removeRestrictionsForAuthenticatedUser: [\"DELETE /user/interaction-limits\"],\n removeRestrictionsForOrg: [\"DELETE /orgs/{org}/interaction-limits\"],\n removeRestrictionsForRepo: [\n \"DELETE /repos/{owner}/{repo}/interaction-limits\",\n ],\n removeRestrictionsForYourPublicRepos: [\n \"DELETE /user/interaction-limits\",\n {},\n { renamed: [\"interactions\", \"removeRestrictionsForAuthenticatedUser\"] },\n ],\n setRestrictionsForAuthenticatedUser: [\"PUT /user/interaction-limits\"],\n setRestrictionsForOrg: [\"PUT /orgs/{org}/interaction-limits\"],\n setRestrictionsForRepo: [\"PUT /repos/{owner}/{repo}/interaction-limits\"],\n setRestrictionsForYourPublicRepos: [\n \"PUT /user/interaction-limits\",\n {},\n { renamed: [\"interactions\", \"setRestrictionsForAuthenticatedUser\"] },\n ],\n },\n issues: {\n addAssignees: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\",\n ],\n addBlockedByDependency: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by\",\n ],\n addLabels: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n addSubIssue: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues\",\n ],\n checkUserCanBeAssigned: [\"GET /repos/{owner}/{repo}/assignees/{assignee}\"],\n checkUserCanBeAssignedToIssue: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}\",\n ],\n create: [\"POST /repos/{owner}/{repo}/issues\"],\n createComment: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/comments\",\n ],\n createLabel: [\"POST /repos/{owner}/{repo}/labels\"],\n createMilestone: [\"POST /repos/{owner}/{repo}/milestones\"],\n deleteComment: [\n \"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\",\n ],\n deleteLabel: [\"DELETE /repos/{owner}/{repo}/labels/{name}\"],\n deleteMilestone: [\n \"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\",\n ],\n get: [\"GET /repos/{owner}/{repo}/issues/{issue_number}\"],\n getComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n getEvent: [\"GET /repos/{owner}/{repo}/issues/events/{event_id}\"],\n getLabel: [\"GET /repos/{owner}/{repo}/labels/{name}\"],\n getMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n getParent: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/parent\"],\n list: [\"GET /issues\"],\n listAssignees: [\"GET /repos/{owner}/{repo}/assignees\"],\n listComments: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n listCommentsForRepo: [\"GET /repos/{owner}/{repo}/issues/comments\"],\n listDependenciesBlockedBy: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by\",\n ],\n listDependenciesBlocking: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking\",\n ],\n listEvents: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/events\"],\n listEventsForRepo: [\"GET /repos/{owner}/{repo}/issues/events\"],\n listEventsForTimeline: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\",\n ],\n listForAuthenticatedUser: [\"GET /user/issues\"],\n listForOrg: [\"GET /orgs/{org}/issues\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/issues\"],\n listLabelsForMilestone: [\n \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\",\n ],\n listLabelsForRepo: [\"GET /repos/{owner}/{repo}/labels\"],\n listLabelsOnIssue: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\",\n ],\n listMilestones: [\"GET /repos/{owner}/{repo}/milestones\"],\n listSubIssues: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues\",\n ],\n lock: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n removeAllLabels: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\",\n ],\n removeAssignees: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\",\n ],\n removeDependencyBlockedBy: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}\",\n ],\n removeLabel: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\",\n ],\n removeSubIssue: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue\",\n ],\n reprioritizeSubIssue: [\n \"PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority\",\n ],\n setLabels: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n unlock: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n update: [\"PATCH /repos/{owner}/{repo}/issues/{issue_number}\"],\n updateComment: [\"PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n updateLabel: [\"PATCH /repos/{owner}/{repo}/labels/{name}\"],\n updateMilestone: [\n \"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\",\n ],\n },\n licenses: {\n get: [\"GET /licenses/{license}\"],\n getAllCommonlyUsed: [\"GET /licenses\"],\n getForRepo: [\"GET /repos/{owner}/{repo}/license\"],\n },\n markdown: {\n render: [\"POST /markdown\"],\n renderRaw: [\n \"POST /markdown/raw\",\n { headers: { \"content-type\": \"text/plain; charset=utf-8\" } },\n ],\n },\n meta: {\n get: [\"GET /meta\"],\n getAllVersions: [\"GET /versions\"],\n getOctocat: [\"GET /octocat\"],\n getZen: [\"GET /zen\"],\n root: [\"GET /\"],\n },\n migrations: {\n deleteArchiveForAuthenticatedUser: [\n \"DELETE /user/migrations/{migration_id}/archive\",\n ],\n deleteArchiveForOrg: [\n \"DELETE /orgs/{org}/migrations/{migration_id}/archive\",\n ],\n downloadArchiveForOrg: [\n \"GET /orgs/{org}/migrations/{migration_id}/archive\",\n ],\n getArchiveForAuthenticatedUser: [\n \"GET /user/migrations/{migration_id}/archive\",\n ],\n getStatusForAuthenticatedUser: [\"GET /user/migrations/{migration_id}\"],\n getStatusForOrg: [\"GET /orgs/{org}/migrations/{migration_id}\"],\n listForAuthenticatedUser: [\"GET /user/migrations\"],\n listForOrg: [\"GET /orgs/{org}/migrations\"],\n listReposForAuthenticatedUser: [\n \"GET /user/migrations/{migration_id}/repositories\",\n ],\n listReposForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/repositories\"],\n listReposForUser: [\n \"GET /user/migrations/{migration_id}/repositories\",\n {},\n { renamed: [\"migrations\", \"listReposForAuthenticatedUser\"] },\n ],\n startForAuthenticatedUser: [\"POST /user/migrations\"],\n startForOrg: [\"POST /orgs/{org}/migrations\"],\n unlockRepoForAuthenticatedUser: [\n \"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\",\n ],\n unlockRepoForOrg: [\n \"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\",\n ],\n },\n oidc: {\n getOidcCustomSubTemplateForOrg: [\n \"GET /orgs/{org}/actions/oidc/customization/sub\",\n ],\n updateOidcCustomSubTemplateForOrg: [\n \"PUT /orgs/{org}/actions/oidc/customization/sub\",\n ],\n },\n orgs: {\n addSecurityManagerTeam: [\n \"PUT /orgs/{org}/security-managers/teams/{team_slug}\",\n {},\n {\n deprecated:\n \"octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team\",\n },\n ],\n assignTeamToOrgRole: [\n \"PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}\",\n ],\n assignUserToOrgRole: [\n \"PUT /orgs/{org}/organization-roles/users/{username}/{role_id}\",\n ],\n blockUser: [\"PUT /orgs/{org}/blocks/{username}\"],\n cancelInvitation: [\"DELETE /orgs/{org}/invitations/{invitation_id}\"],\n checkBlockedUser: [\"GET /orgs/{org}/blocks/{username}\"],\n checkMembershipForUser: [\"GET /orgs/{org}/members/{username}\"],\n checkPublicMembershipForUser: [\"GET /orgs/{org}/public_members/{username}\"],\n convertMemberToOutsideCollaborator: [\n \"PUT /orgs/{org}/outside_collaborators/{username}\",\n ],\n createArtifactStorageRecord: [\n \"POST /orgs/{org}/artifacts/metadata/storage-record\",\n ],\n createInvitation: [\"POST /orgs/{org}/invitations\"],\n createIssueType: [\"POST /orgs/{org}/issue-types\"],\n createWebhook: [\"POST /orgs/{org}/hooks\"],\n customPropertiesForOrgsCreateOrUpdateOrganizationValues: [\n \"PATCH /organizations/{org}/org-properties/values\",\n ],\n customPropertiesForOrgsGetOrganizationValues: [\n \"GET /organizations/{org}/org-properties/values\",\n ],\n customPropertiesForReposCreateOrUpdateOrganizationDefinition: [\n \"PUT /orgs/{org}/properties/schema/{custom_property_name}\",\n ],\n customPropertiesForReposCreateOrUpdateOrganizationDefinitions: [\n \"PATCH /orgs/{org}/properties/schema\",\n ],\n customPropertiesForReposCreateOrUpdateOrganizationValues: [\n \"PATCH /orgs/{org}/properties/values\",\n ],\n customPropertiesForReposDeleteOrganizationDefinition: [\n \"DELETE /orgs/{org}/properties/schema/{custom_property_name}\",\n ],\n customPropertiesForReposGetOrganizationDefinition: [\n \"GET /orgs/{org}/properties/schema/{custom_property_name}\",\n ],\n customPropertiesForReposGetOrganizationDefinitions: [\n \"GET /orgs/{org}/properties/schema\",\n ],\n customPropertiesForReposGetOrganizationValues: [\n \"GET /orgs/{org}/properties/values\",\n ],\n delete: [\"DELETE /orgs/{org}\"],\n deleteAttestationsBulk: [\"POST /orgs/{org}/attestations/delete-request\"],\n deleteAttestationsById: [\n \"DELETE /orgs/{org}/attestations/{attestation_id}\",\n ],\n deleteAttestationsBySubjectDigest: [\n \"DELETE /orgs/{org}/attestations/digest/{subject_digest}\",\n ],\n deleteIssueType: [\"DELETE /orgs/{org}/issue-types/{issue_type_id}\"],\n deleteWebhook: [\"DELETE /orgs/{org}/hooks/{hook_id}\"],\n disableSelectedRepositoryImmutableReleasesOrganization: [\n \"DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}\",\n ],\n enableSelectedRepositoryImmutableReleasesOrganization: [\n \"PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}\",\n ],\n get: [\"GET /orgs/{org}\"],\n getImmutableReleasesSettings: [\n \"GET /orgs/{org}/settings/immutable-releases\",\n ],\n getImmutableReleasesSettingsRepositories: [\n \"GET /orgs/{org}/settings/immutable-releases/repositories\",\n ],\n getMembershipForAuthenticatedUser: [\"GET /user/memberships/orgs/{org}\"],\n getMembershipForUser: [\"GET /orgs/{org}/memberships/{username}\"],\n getOrgRole: [\"GET /orgs/{org}/organization-roles/{role_id}\"],\n getOrgRulesetHistory: [\"GET /orgs/{org}/rulesets/{ruleset_id}/history\"],\n getOrgRulesetVersion: [\n \"GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}\",\n ],\n getWebhook: [\"GET /orgs/{org}/hooks/{hook_id}\"],\n getWebhookConfigForOrg: [\"GET /orgs/{org}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\n \"GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}\",\n ],\n list: [\"GET /organizations\"],\n listAppInstallations: [\"GET /orgs/{org}/installations\"],\n listArtifactStorageRecords: [\n \"GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records\",\n ],\n listAttestationRepositories: [\"GET /orgs/{org}/attestations/repositories\"],\n listAttestations: [\"GET /orgs/{org}/attestations/{subject_digest}\"],\n listAttestationsBulk: [\n \"POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}\",\n ],\n listBlockedUsers: [\"GET /orgs/{org}/blocks\"],\n listFailedInvitations: [\"GET /orgs/{org}/failed_invitations\"],\n listForAuthenticatedUser: [\"GET /user/orgs\"],\n listForUser: [\"GET /users/{username}/orgs\"],\n listInvitationTeams: [\"GET /orgs/{org}/invitations/{invitation_id}/teams\"],\n listIssueTypes: [\"GET /orgs/{org}/issue-types\"],\n listMembers: [\"GET /orgs/{org}/members\"],\n listMembershipsForAuthenticatedUser: [\"GET /user/memberships/orgs\"],\n listOrgRoleTeams: [\"GET /orgs/{org}/organization-roles/{role_id}/teams\"],\n listOrgRoleUsers: [\"GET /orgs/{org}/organization-roles/{role_id}/users\"],\n listOrgRoles: [\"GET /orgs/{org}/organization-roles\"],\n listOrganizationFineGrainedPermissions: [\n \"GET /orgs/{org}/organization-fine-grained-permissions\",\n ],\n listOutsideCollaborators: [\"GET /orgs/{org}/outside_collaborators\"],\n listPatGrantRepositories: [\n \"GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories\",\n ],\n listPatGrantRequestRepositories: [\n \"GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories\",\n ],\n listPatGrantRequests: [\"GET /orgs/{org}/personal-access-token-requests\"],\n listPatGrants: [\"GET /orgs/{org}/personal-access-tokens\"],\n listPendingInvitations: [\"GET /orgs/{org}/invitations\"],\n listPublicMembers: [\"GET /orgs/{org}/public_members\"],\n listSecurityManagerTeams: [\n \"GET /orgs/{org}/security-managers\",\n {},\n {\n deprecated:\n \"octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams\",\n },\n ],\n listWebhookDeliveries: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /orgs/{org}/hooks\"],\n pingWebhook: [\"POST /orgs/{org}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\n \"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\",\n ],\n removeMember: [\"DELETE /orgs/{org}/members/{username}\"],\n removeMembershipForUser: [\"DELETE /orgs/{org}/memberships/{username}\"],\n removeOutsideCollaborator: [\n \"DELETE /orgs/{org}/outside_collaborators/{username}\",\n ],\n removePublicMembershipForAuthenticatedUser: [\n \"DELETE /orgs/{org}/public_members/{username}\",\n ],\n removeSecurityManagerTeam: [\n \"DELETE /orgs/{org}/security-managers/teams/{team_slug}\",\n {},\n {\n deprecated:\n \"octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team\",\n },\n ],\n reviewPatGrantRequest: [\n \"POST /orgs/{org}/personal-access-token-requests/{pat_request_id}\",\n ],\n reviewPatGrantRequestsInBulk: [\n \"POST /orgs/{org}/personal-access-token-requests\",\n ],\n revokeAllOrgRolesTeam: [\n \"DELETE /orgs/{org}/organization-roles/teams/{team_slug}\",\n ],\n revokeAllOrgRolesUser: [\n \"DELETE /orgs/{org}/organization-roles/users/{username}\",\n ],\n revokeOrgRoleTeam: [\n \"DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}\",\n ],\n revokeOrgRoleUser: [\n \"DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}\",\n ],\n setImmutableReleasesSettings: [\n \"PUT /orgs/{org}/settings/immutable-releases\",\n ],\n setImmutableReleasesSettingsRepositories: [\n \"PUT /orgs/{org}/settings/immutable-releases/repositories\",\n ],\n setMembershipForUser: [\"PUT /orgs/{org}/memberships/{username}\"],\n setPublicMembershipForAuthenticatedUser: [\n \"PUT /orgs/{org}/public_members/{username}\",\n ],\n unblockUser: [\"DELETE /orgs/{org}/blocks/{username}\"],\n update: [\"PATCH /orgs/{org}\"],\n updateIssueType: [\"PUT /orgs/{org}/issue-types/{issue_type_id}\"],\n updateMembershipForAuthenticatedUser: [\n \"PATCH /user/memberships/orgs/{org}\",\n ],\n updatePatAccess: [\"POST /orgs/{org}/personal-access-tokens/{pat_id}\"],\n updatePatAccesses: [\"POST /orgs/{org}/personal-access-tokens\"],\n updateWebhook: [\"PATCH /orgs/{org}/hooks/{hook_id}\"],\n updateWebhookConfigForOrg: [\"PATCH /orgs/{org}/hooks/{hook_id}/config\"],\n },\n packages: {\n deletePackageForAuthenticatedUser: [\n \"DELETE /user/packages/{package_type}/{package_name}\",\n ],\n deletePackageForOrg: [\n \"DELETE /orgs/{org}/packages/{package_type}/{package_name}\",\n ],\n deletePackageForUser: [\n \"DELETE /users/{username}/packages/{package_type}/{package_name}\",\n ],\n deletePackageVersionForAuthenticatedUser: [\n \"DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}\",\n ],\n deletePackageVersionForOrg: [\n \"DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\",\n ],\n deletePackageVersionForUser: [\n \"DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\",\n ],\n getAllPackageVersionsForAPackageOwnedByAnOrg: [\n \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\",\n {},\n { renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByOrg\"] },\n ],\n getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [\n \"GET /user/packages/{package_type}/{package_name}/versions\",\n {},\n {\n renamed: [\n \"packages\",\n \"getAllPackageVersionsForPackageOwnedByAuthenticatedUser\",\n ],\n },\n ],\n getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [\n \"GET /user/packages/{package_type}/{package_name}/versions\",\n ],\n getAllPackageVersionsForPackageOwnedByOrg: [\n \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\",\n ],\n getAllPackageVersionsForPackageOwnedByUser: [\n \"GET /users/{username}/packages/{package_type}/{package_name}/versions\",\n ],\n getPackageForAuthenticatedUser: [\n \"GET /user/packages/{package_type}/{package_name}\",\n ],\n getPackageForOrganization: [\n \"GET /orgs/{org}/packages/{package_type}/{package_name}\",\n ],\n getPackageForUser: [\n \"GET /users/{username}/packages/{package_type}/{package_name}\",\n ],\n getPackageVersionForAuthenticatedUser: [\n \"GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}\",\n ],\n getPackageVersionForOrganization: [\n \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\",\n ],\n getPackageVersionForUser: [\n \"GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\",\n ],\n listDockerMigrationConflictingPackagesForAuthenticatedUser: [\n \"GET /user/docker/conflicts\",\n ],\n listDockerMigrationConflictingPackagesForOrganization: [\n \"GET /orgs/{org}/docker/conflicts\",\n ],\n listDockerMigrationConflictingPackagesForUser: [\n \"GET /users/{username}/docker/conflicts\",\n ],\n listPackagesForAuthenticatedUser: [\"GET /user/packages\"],\n listPackagesForOrganization: [\"GET /orgs/{org}/packages\"],\n listPackagesForUser: [\"GET /users/{username}/packages\"],\n restorePackageForAuthenticatedUser: [\n \"POST /user/packages/{package_type}/{package_name}/restore{?token}\",\n ],\n restorePackageForOrg: [\n \"POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}\",\n ],\n restorePackageForUser: [\n \"POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}\",\n ],\n restorePackageVersionForAuthenticatedUser: [\n \"POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\",\n ],\n restorePackageVersionForOrg: [\n \"POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\",\n ],\n restorePackageVersionForUser: [\n \"POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\",\n ],\n },\n privateRegistries: {\n createOrgPrivateRegistry: [\"POST /orgs/{org}/private-registries\"],\n deleteOrgPrivateRegistry: [\n \"DELETE /orgs/{org}/private-registries/{secret_name}\",\n ],\n getOrgPrivateRegistry: [\"GET /orgs/{org}/private-registries/{secret_name}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/private-registries/public-key\"],\n listOrgPrivateRegistries: [\"GET /orgs/{org}/private-registries\"],\n updateOrgPrivateRegistry: [\n \"PATCH /orgs/{org}/private-registries/{secret_name}\",\n ],\n },\n projects: {\n addItemForOrg: [\"POST /orgs/{org}/projectsV2/{project_number}/items\"],\n addItemForUser: [\n \"POST /users/{username}/projectsV2/{project_number}/items\",\n ],\n deleteItemForOrg: [\n \"DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}\",\n ],\n deleteItemForUser: [\n \"DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}\",\n ],\n getFieldForOrg: [\n \"GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}\",\n ],\n getFieldForUser: [\n \"GET /users/{username}/projectsV2/{project_number}/fields/{field_id}\",\n ],\n getForOrg: [\"GET /orgs/{org}/projectsV2/{project_number}\"],\n getForUser: [\"GET /users/{username}/projectsV2/{project_number}\"],\n getOrgItem: [\"GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}\"],\n getUserItem: [\n \"GET /users/{username}/projectsV2/{project_number}/items/{item_id}\",\n ],\n listFieldsForOrg: [\"GET /orgs/{org}/projectsV2/{project_number}/fields\"],\n listFieldsForUser: [\n \"GET /users/{username}/projectsV2/{project_number}/fields\",\n ],\n listForOrg: [\"GET /orgs/{org}/projectsV2\"],\n listForUser: [\"GET /users/{username}/projectsV2\"],\n listItemsForOrg: [\"GET /orgs/{org}/projectsV2/{project_number}/items\"],\n listItemsForUser: [\n \"GET /users/{username}/projectsV2/{project_number}/items\",\n ],\n updateItemForOrg: [\n \"PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}\",\n ],\n updateItemForUser: [\n \"PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}\",\n ],\n },\n pulls: {\n checkIfMerged: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n create: [\"POST /repos/{owner}/{repo}/pulls\"],\n createReplyForReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\",\n ],\n createReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n createReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\",\n ],\n deletePendingReview: [\n \"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\",\n ],\n deleteReviewComment: [\n \"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\",\n ],\n dismissReview: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\",\n ],\n get: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}\"],\n getReview: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\",\n ],\n getReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n list: [\"GET /repos/{owner}/{repo}/pulls\"],\n listCommentsForReview: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\",\n ],\n listCommits: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\"],\n listFiles: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\"],\n listRequestedReviewers: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n ],\n listReviewComments: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\",\n ],\n listReviewCommentsForRepo: [\"GET /repos/{owner}/{repo}/pulls/comments\"],\n listReviews: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n merge: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n removeRequestedReviewers: [\n \"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n ],\n requestReviewers: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n ],\n submitReview: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\",\n ],\n update: [\"PATCH /repos/{owner}/{repo}/pulls/{pull_number}\"],\n updateBranch: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\",\n ],\n updateReview: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\",\n ],\n updateReviewComment: [\n \"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\",\n ],\n },\n rateLimit: { get: [\"GET /rate_limit\"] },\n reactions: {\n createForCommitComment: [\n \"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\",\n ],\n createForIssue: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\",\n ],\n createForIssueComment: [\n \"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\",\n ],\n createForPullRequestReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\",\n ],\n createForRelease: [\n \"POST /repos/{owner}/{repo}/releases/{release_id}/reactions\",\n ],\n createForTeamDiscussionCommentInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n ],\n createForTeamDiscussionInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\",\n ],\n deleteForCommitComment: [\n \"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\",\n ],\n deleteForIssue: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\",\n ],\n deleteForIssueComment: [\n \"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\",\n ],\n deleteForPullRequestComment: [\n \"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\",\n ],\n deleteForRelease: [\n \"DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}\",\n ],\n deleteForTeamDiscussion: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\",\n ],\n deleteForTeamDiscussionComment: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\",\n ],\n listForCommitComment: [\n \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\",\n ],\n listForIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\"],\n listForIssueComment: [\n \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\",\n ],\n listForPullRequestReviewComment: [\n \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\",\n ],\n listForRelease: [\n \"GET /repos/{owner}/{repo}/releases/{release_id}/reactions\",\n ],\n listForTeamDiscussionCommentInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n ],\n listForTeamDiscussionInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\",\n ],\n },\n repos: {\n acceptInvitation: [\n \"PATCH /user/repository_invitations/{invitation_id}\",\n {},\n { renamed: [\"repos\", \"acceptInvitationForAuthenticatedUser\"] },\n ],\n acceptInvitationForAuthenticatedUser: [\n \"PATCH /user/repository_invitations/{invitation_id}\",\n ],\n addAppAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" },\n ],\n addCollaborator: [\"PUT /repos/{owner}/{repo}/collaborators/{username}\"],\n addStatusCheckContexts: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" },\n ],\n addTeamAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" },\n ],\n addUserAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" },\n ],\n cancelPagesDeployment: [\n \"POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel\",\n ],\n checkAutomatedSecurityFixes: [\n \"GET /repos/{owner}/{repo}/automated-security-fixes\",\n ],\n checkCollaborator: [\"GET /repos/{owner}/{repo}/collaborators/{username}\"],\n checkImmutableReleases: [\"GET /repos/{owner}/{repo}/immutable-releases\"],\n checkPrivateVulnerabilityReporting: [\n \"GET /repos/{owner}/{repo}/private-vulnerability-reporting\",\n ],\n checkVulnerabilityAlerts: [\n \"GET /repos/{owner}/{repo}/vulnerability-alerts\",\n ],\n codeownersErrors: [\"GET /repos/{owner}/{repo}/codeowners/errors\"],\n compareCommits: [\"GET /repos/{owner}/{repo}/compare/{base}...{head}\"],\n compareCommitsWithBasehead: [\n \"GET /repos/{owner}/{repo}/compare/{basehead}\",\n ],\n createAttestation: [\"POST /repos/{owner}/{repo}/attestations\"],\n createAutolink: [\"POST /repos/{owner}/{repo}/autolinks\"],\n createCommitComment: [\n \"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\",\n ],\n createCommitSignatureProtection: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\",\n ],\n createCommitStatus: [\"POST /repos/{owner}/{repo}/statuses/{sha}\"],\n createDeployKey: [\"POST /repos/{owner}/{repo}/keys\"],\n createDeployment: [\"POST /repos/{owner}/{repo}/deployments\"],\n createDeploymentBranchPolicy: [\n \"POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies\",\n ],\n createDeploymentProtectionRule: [\n \"POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules\",\n ],\n createDeploymentStatus: [\n \"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\",\n ],\n createDispatchEvent: [\"POST /repos/{owner}/{repo}/dispatches\"],\n createForAuthenticatedUser: [\"POST /user/repos\"],\n createFork: [\"POST /repos/{owner}/{repo}/forks\"],\n createInOrg: [\"POST /orgs/{org}/repos\"],\n createOrUpdateEnvironment: [\n \"PUT /repos/{owner}/{repo}/environments/{environment_name}\",\n ],\n createOrUpdateFileContents: [\"PUT /repos/{owner}/{repo}/contents/{path}\"],\n createOrgRuleset: [\"POST /orgs/{org}/rulesets\"],\n createPagesDeployment: [\"POST /repos/{owner}/{repo}/pages/deployments\"],\n createPagesSite: [\"POST /repos/{owner}/{repo}/pages\"],\n createRelease: [\"POST /repos/{owner}/{repo}/releases\"],\n createRepoRuleset: [\"POST /repos/{owner}/{repo}/rulesets\"],\n createUsingTemplate: [\n \"POST /repos/{template_owner}/{template_repo}/generate\",\n ],\n createWebhook: [\"POST /repos/{owner}/{repo}/hooks\"],\n customPropertiesForReposCreateOrUpdateRepositoryValues: [\n \"PATCH /repos/{owner}/{repo}/properties/values\",\n ],\n customPropertiesForReposGetRepositoryValues: [\n \"GET /repos/{owner}/{repo}/properties/values\",\n ],\n declineInvitation: [\n \"DELETE /user/repository_invitations/{invitation_id}\",\n {},\n { renamed: [\"repos\", \"declineInvitationForAuthenticatedUser\"] },\n ],\n declineInvitationForAuthenticatedUser: [\n \"DELETE /user/repository_invitations/{invitation_id}\",\n ],\n delete: [\"DELETE /repos/{owner}/{repo}\"],\n deleteAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\",\n ],\n deleteAdminBranchProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\",\n ],\n deleteAnEnvironment: [\n \"DELETE /repos/{owner}/{repo}/environments/{environment_name}\",\n ],\n deleteAutolink: [\"DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n deleteBranchProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection\",\n ],\n deleteCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}\"],\n deleteCommitSignatureProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\",\n ],\n deleteDeployKey: [\"DELETE /repos/{owner}/{repo}/keys/{key_id}\"],\n deleteDeployment: [\n \"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\",\n ],\n deleteDeploymentBranchPolicy: [\n \"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\",\n ],\n deleteFile: [\"DELETE /repos/{owner}/{repo}/contents/{path}\"],\n deleteInvitation: [\n \"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\",\n ],\n deleteOrgRuleset: [\"DELETE /orgs/{org}/rulesets/{ruleset_id}\"],\n deletePagesSite: [\"DELETE /repos/{owner}/{repo}/pages\"],\n deletePullRequestReviewProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\",\n ],\n deleteRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}\"],\n deleteReleaseAsset: [\n \"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\",\n ],\n deleteRepoRuleset: [\"DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}\"],\n deleteWebhook: [\"DELETE /repos/{owner}/{repo}/hooks/{hook_id}\"],\n disableAutomatedSecurityFixes: [\n \"DELETE /repos/{owner}/{repo}/automated-security-fixes\",\n ],\n disableDeploymentProtectionRule: [\n \"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}\",\n ],\n disableImmutableReleases: [\n \"DELETE /repos/{owner}/{repo}/immutable-releases\",\n ],\n disablePrivateVulnerabilityReporting: [\n \"DELETE /repos/{owner}/{repo}/private-vulnerability-reporting\",\n ],\n disableVulnerabilityAlerts: [\n \"DELETE /repos/{owner}/{repo}/vulnerability-alerts\",\n ],\n downloadArchive: [\n \"GET /repos/{owner}/{repo}/zipball/{ref}\",\n {},\n { renamed: [\"repos\", \"downloadZipballArchive\"] },\n ],\n downloadTarballArchive: [\"GET /repos/{owner}/{repo}/tarball/{ref}\"],\n downloadZipballArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\"],\n enableAutomatedSecurityFixes: [\n \"PUT /repos/{owner}/{repo}/automated-security-fixes\",\n ],\n enableImmutableReleases: [\"PUT /repos/{owner}/{repo}/immutable-releases\"],\n enablePrivateVulnerabilityReporting: [\n \"PUT /repos/{owner}/{repo}/private-vulnerability-reporting\",\n ],\n enableVulnerabilityAlerts: [\n \"PUT /repos/{owner}/{repo}/vulnerability-alerts\",\n ],\n generateReleaseNotes: [\n \"POST /repos/{owner}/{repo}/releases/generate-notes\",\n ],\n get: [\"GET /repos/{owner}/{repo}\"],\n getAccessRestrictions: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\",\n ],\n getAdminBranchProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\",\n ],\n getAllDeploymentProtectionRules: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules\",\n ],\n getAllEnvironments: [\"GET /repos/{owner}/{repo}/environments\"],\n getAllStatusCheckContexts: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n ],\n getAllTopics: [\"GET /repos/{owner}/{repo}/topics\"],\n getAppsWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n ],\n getAutolink: [\"GET /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n getBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}\"],\n getBranchProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection\",\n ],\n getBranchRules: [\"GET /repos/{owner}/{repo}/rules/branches/{branch}\"],\n getClones: [\"GET /repos/{owner}/{repo}/traffic/clones\"],\n getCodeFrequencyStats: [\"GET /repos/{owner}/{repo}/stats/code_frequency\"],\n getCollaboratorPermissionLevel: [\n \"GET /repos/{owner}/{repo}/collaborators/{username}/permission\",\n ],\n getCombinedStatusForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/status\"],\n getCommit: [\"GET /repos/{owner}/{repo}/commits/{ref}\"],\n getCommitActivityStats: [\"GET /repos/{owner}/{repo}/stats/commit_activity\"],\n getCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}\"],\n getCommitSignatureProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\",\n ],\n getCommunityProfileMetrics: [\"GET /repos/{owner}/{repo}/community/profile\"],\n getContent: [\"GET /repos/{owner}/{repo}/contents/{path}\"],\n getContributorsStats: [\"GET /repos/{owner}/{repo}/stats/contributors\"],\n getCustomDeploymentProtectionRule: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}\",\n ],\n getDeployKey: [\"GET /repos/{owner}/{repo}/keys/{key_id}\"],\n getDeployment: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n getDeploymentBranchPolicy: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\",\n ],\n getDeploymentStatus: [\n \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\",\n ],\n getEnvironment: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}\",\n ],\n getLatestPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/latest\"],\n getLatestRelease: [\"GET /repos/{owner}/{repo}/releases/latest\"],\n getOrgRuleSuite: [\"GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}\"],\n getOrgRuleSuites: [\"GET /orgs/{org}/rulesets/rule-suites\"],\n getOrgRuleset: [\"GET /orgs/{org}/rulesets/{ruleset_id}\"],\n getOrgRulesets: [\"GET /orgs/{org}/rulesets\"],\n getPages: [\"GET /repos/{owner}/{repo}/pages\"],\n getPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/{build_id}\"],\n getPagesDeployment: [\n \"GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}\",\n ],\n getPagesHealthCheck: [\"GET /repos/{owner}/{repo}/pages/health\"],\n getParticipationStats: [\"GET /repos/{owner}/{repo}/stats/participation\"],\n getPullRequestReviewProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\",\n ],\n getPunchCardStats: [\"GET /repos/{owner}/{repo}/stats/punch_card\"],\n getReadme: [\"GET /repos/{owner}/{repo}/readme\"],\n getReadmeInDirectory: [\"GET /repos/{owner}/{repo}/readme/{dir}\"],\n getRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}\"],\n getReleaseAsset: [\"GET /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n getReleaseByTag: [\"GET /repos/{owner}/{repo}/releases/tags/{tag}\"],\n getRepoRuleSuite: [\n \"GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}\",\n ],\n getRepoRuleSuites: [\"GET /repos/{owner}/{repo}/rulesets/rule-suites\"],\n getRepoRuleset: [\"GET /repos/{owner}/{repo}/rulesets/{ruleset_id}\"],\n getRepoRulesetHistory: [\n \"GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history\",\n ],\n getRepoRulesetVersion: [\n \"GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}\",\n ],\n getRepoRulesets: [\"GET /repos/{owner}/{repo}/rulesets\"],\n getStatusChecksProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n ],\n getTeamsWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n ],\n getTopPaths: [\"GET /repos/{owner}/{repo}/traffic/popular/paths\"],\n getTopReferrers: [\"GET /repos/{owner}/{repo}/traffic/popular/referrers\"],\n getUsersWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n ],\n getViews: [\"GET /repos/{owner}/{repo}/traffic/views\"],\n getWebhook: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}\"],\n getWebhookConfigForRepo: [\n \"GET /repos/{owner}/{repo}/hooks/{hook_id}/config\",\n ],\n getWebhookDelivery: [\n \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}\",\n ],\n listActivities: [\"GET /repos/{owner}/{repo}/activity\"],\n listAttestations: [\n \"GET /repos/{owner}/{repo}/attestations/{subject_digest}\",\n ],\n listAutolinks: [\"GET /repos/{owner}/{repo}/autolinks\"],\n listBranches: [\"GET /repos/{owner}/{repo}/branches\"],\n listBranchesForHeadCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\",\n ],\n listCollaborators: [\"GET /repos/{owner}/{repo}/collaborators\"],\n listCommentsForCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\",\n ],\n listCommitCommentsForRepo: [\"GET /repos/{owner}/{repo}/comments\"],\n listCommitStatusesForRef: [\n \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\",\n ],\n listCommits: [\"GET /repos/{owner}/{repo}/commits\"],\n listContributors: [\"GET /repos/{owner}/{repo}/contributors\"],\n listCustomDeploymentRuleIntegrations: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps\",\n ],\n listDeployKeys: [\"GET /repos/{owner}/{repo}/keys\"],\n listDeploymentBranchPolicies: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies\",\n ],\n listDeploymentStatuses: [\n \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\",\n ],\n listDeployments: [\"GET /repos/{owner}/{repo}/deployments\"],\n listForAuthenticatedUser: [\"GET /user/repos\"],\n listForOrg: [\"GET /orgs/{org}/repos\"],\n listForUser: [\"GET /users/{username}/repos\"],\n listForks: [\"GET /repos/{owner}/{repo}/forks\"],\n listInvitations: [\"GET /repos/{owner}/{repo}/invitations\"],\n listInvitationsForAuthenticatedUser: [\"GET /user/repository_invitations\"],\n listLanguages: [\"GET /repos/{owner}/{repo}/languages\"],\n listPagesBuilds: [\"GET /repos/{owner}/{repo}/pages/builds\"],\n listPublic: [\"GET /repositories\"],\n listPullRequestsAssociatedWithCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\",\n ],\n listReleaseAssets: [\n \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\",\n ],\n listReleases: [\"GET /repos/{owner}/{repo}/releases\"],\n listTags: [\"GET /repos/{owner}/{repo}/tags\"],\n listTeams: [\"GET /repos/{owner}/{repo}/teams\"],\n listWebhookDeliveries: [\n \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\",\n ],\n listWebhooks: [\"GET /repos/{owner}/{repo}/hooks\"],\n merge: [\"POST /repos/{owner}/{repo}/merges\"],\n mergeUpstream: [\"POST /repos/{owner}/{repo}/merge-upstream\"],\n pingWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\n \"POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\",\n ],\n removeAppAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" },\n ],\n removeCollaborator: [\n \"DELETE /repos/{owner}/{repo}/collaborators/{username}\",\n ],\n removeStatusCheckContexts: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" },\n ],\n removeStatusCheckProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n ],\n removeTeamAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" },\n ],\n removeUserAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" },\n ],\n renameBranch: [\"POST /repos/{owner}/{repo}/branches/{branch}/rename\"],\n replaceAllTopics: [\"PUT /repos/{owner}/{repo}/topics\"],\n requestPagesBuild: [\"POST /repos/{owner}/{repo}/pages/builds\"],\n setAdminBranchProtection: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\",\n ],\n setAppAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" },\n ],\n setStatusCheckContexts: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" },\n ],\n setTeamAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" },\n ],\n setUserAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" },\n ],\n testPushWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\"],\n transfer: [\"POST /repos/{owner}/{repo}/transfer\"],\n update: [\"PATCH /repos/{owner}/{repo}\"],\n updateBranchProtection: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection\",\n ],\n updateCommitComment: [\"PATCH /repos/{owner}/{repo}/comments/{comment_id}\"],\n updateDeploymentBranchPolicy: [\n \"PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\",\n ],\n updateInformationAboutPagesSite: [\"PUT /repos/{owner}/{repo}/pages\"],\n updateInvitation: [\n \"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\",\n ],\n updateOrgRuleset: [\"PUT /orgs/{org}/rulesets/{ruleset_id}\"],\n updatePullRequestReviewProtection: [\n \"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\",\n ],\n updateRelease: [\"PATCH /repos/{owner}/{repo}/releases/{release_id}\"],\n updateReleaseAsset: [\n \"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\",\n ],\n updateRepoRuleset: [\"PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}\"],\n updateStatusCheckPotection: [\n \"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n {},\n { renamed: [\"repos\", \"updateStatusCheckProtection\"] },\n ],\n updateStatusCheckProtection: [\n \"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n ],\n updateWebhook: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}\"],\n updateWebhookConfigForRepo: [\n \"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config\",\n ],\n uploadReleaseAsset: [\n \"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}\",\n { baseUrl: \"https://uploads.github.com\" },\n ],\n },\n search: {\n code: [\"GET /search/code\"],\n commits: [\"GET /search/commits\"],\n issuesAndPullRequests: [\"GET /search/issues\"],\n labels: [\"GET /search/labels\"],\n repos: [\"GET /search/repositories\"],\n topics: [\"GET /search/topics\"],\n users: [\"GET /search/users\"],\n },\n secretScanning: {\n createPushProtectionBypass: [\n \"POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses\",\n ],\n getAlert: [\n \"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\",\n ],\n getScanHistory: [\"GET /repos/{owner}/{repo}/secret-scanning/scan-history\"],\n listAlertsForOrg: [\"GET /orgs/{org}/secret-scanning/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts\"],\n listLocationsForAlert: [\n \"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations\",\n ],\n listOrgPatternConfigs: [\n \"GET /orgs/{org}/secret-scanning/pattern-configurations\",\n ],\n updateAlert: [\n \"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\",\n ],\n updateOrgPatternConfigs: [\n \"PATCH /orgs/{org}/secret-scanning/pattern-configurations\",\n ],\n },\n securityAdvisories: {\n createFork: [\n \"POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks\",\n ],\n createPrivateVulnerabilityReport: [\n \"POST /repos/{owner}/{repo}/security-advisories/reports\",\n ],\n createRepositoryAdvisory: [\n \"POST /repos/{owner}/{repo}/security-advisories\",\n ],\n createRepositoryAdvisoryCveRequest: [\n \"POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve\",\n ],\n getGlobalAdvisory: [\"GET /advisories/{ghsa_id}\"],\n getRepositoryAdvisory: [\n \"GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}\",\n ],\n listGlobalAdvisories: [\"GET /advisories\"],\n listOrgRepositoryAdvisories: [\"GET /orgs/{org}/security-advisories\"],\n listRepositoryAdvisories: [\"GET /repos/{owner}/{repo}/security-advisories\"],\n updateRepositoryAdvisory: [\n \"PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}\",\n ],\n },\n teams: {\n addOrUpdateMembershipForUserInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\",\n ],\n addOrUpdateRepoPermissionsInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\",\n ],\n checkPermissionsForRepoInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\",\n ],\n create: [\"POST /orgs/{org}/teams\"],\n createDiscussionCommentInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\",\n ],\n createDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions\"],\n deleteDiscussionCommentInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\",\n ],\n deleteDiscussionInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\",\n ],\n deleteInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}\"],\n getByName: [\"GET /orgs/{org}/teams/{team_slug}\"],\n getDiscussionCommentInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\",\n ],\n getDiscussionInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\",\n ],\n getMembershipForUserInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/memberships/{username}\",\n ],\n list: [\"GET /orgs/{org}/teams\"],\n listChildInOrg: [\"GET /orgs/{org}/teams/{team_slug}/teams\"],\n listDiscussionCommentsInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\",\n ],\n listDiscussionsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions\"],\n listForAuthenticatedUser: [\"GET /user/teams\"],\n listMembersInOrg: [\"GET /orgs/{org}/teams/{team_slug}/members\"],\n listPendingInvitationsInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/invitations\",\n ],\n listReposInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos\"],\n removeMembershipForUserInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\",\n ],\n removeRepoInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\",\n ],\n updateDiscussionCommentInOrg: [\n \"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\",\n ],\n updateDiscussionInOrg: [\n \"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\",\n ],\n updateInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}\"],\n },\n users: {\n addEmailForAuthenticated: [\n \"POST /user/emails\",\n {},\n { renamed: [\"users\", \"addEmailForAuthenticatedUser\"] },\n ],\n addEmailForAuthenticatedUser: [\"POST /user/emails\"],\n addSocialAccountForAuthenticatedUser: [\"POST /user/social_accounts\"],\n block: [\"PUT /user/blocks/{username}\"],\n checkBlocked: [\"GET /user/blocks/{username}\"],\n checkFollowingForUser: [\"GET /users/{username}/following/{target_user}\"],\n checkPersonIsFollowedByAuthenticated: [\"GET /user/following/{username}\"],\n createGpgKeyForAuthenticated: [\n \"POST /user/gpg_keys\",\n {},\n { renamed: [\"users\", \"createGpgKeyForAuthenticatedUser\"] },\n ],\n createGpgKeyForAuthenticatedUser: [\"POST /user/gpg_keys\"],\n createPublicSshKeyForAuthenticated: [\n \"POST /user/keys\",\n {},\n { renamed: [\"users\", \"createPublicSshKeyForAuthenticatedUser\"] },\n ],\n createPublicSshKeyForAuthenticatedUser: [\"POST /user/keys\"],\n createSshSigningKeyForAuthenticatedUser: [\"POST /user/ssh_signing_keys\"],\n deleteAttestationsBulk: [\n \"POST /users/{username}/attestations/delete-request\",\n ],\n deleteAttestationsById: [\n \"DELETE /users/{username}/attestations/{attestation_id}\",\n ],\n deleteAttestationsBySubjectDigest: [\n \"DELETE /users/{username}/attestations/digest/{subject_digest}\",\n ],\n deleteEmailForAuthenticated: [\n \"DELETE /user/emails\",\n {},\n { renamed: [\"users\", \"deleteEmailForAuthenticatedUser\"] },\n ],\n deleteEmailForAuthenticatedUser: [\"DELETE /user/emails\"],\n deleteGpgKeyForAuthenticated: [\n \"DELETE /user/gpg_keys/{gpg_key_id}\",\n {},\n { renamed: [\"users\", \"deleteGpgKeyForAuthenticatedUser\"] },\n ],\n deleteGpgKeyForAuthenticatedUser: [\"DELETE /user/gpg_keys/{gpg_key_id}\"],\n deletePublicSshKeyForAuthenticated: [\n \"DELETE /user/keys/{key_id}\",\n {},\n { renamed: [\"users\", \"deletePublicSshKeyForAuthenticatedUser\"] },\n ],\n deletePublicSshKeyForAuthenticatedUser: [\"DELETE /user/keys/{key_id}\"],\n deleteSocialAccountForAuthenticatedUser: [\"DELETE /user/social_accounts\"],\n deleteSshSigningKeyForAuthenticatedUser: [\n \"DELETE /user/ssh_signing_keys/{ssh_signing_key_id}\",\n ],\n follow: [\"PUT /user/following/{username}\"],\n getAuthenticated: [\"GET /user\"],\n getById: [\"GET /user/{account_id}\"],\n getByUsername: [\"GET /users/{username}\"],\n getContextForUser: [\"GET /users/{username}/hovercard\"],\n getGpgKeyForAuthenticated: [\n \"GET /user/gpg_keys/{gpg_key_id}\",\n {},\n { renamed: [\"users\", \"getGpgKeyForAuthenticatedUser\"] },\n ],\n getGpgKeyForAuthenticatedUser: [\"GET /user/gpg_keys/{gpg_key_id}\"],\n getPublicSshKeyForAuthenticated: [\n \"GET /user/keys/{key_id}\",\n {},\n { renamed: [\"users\", \"getPublicSshKeyForAuthenticatedUser\"] },\n ],\n getPublicSshKeyForAuthenticatedUser: [\"GET /user/keys/{key_id}\"],\n getSshSigningKeyForAuthenticatedUser: [\n \"GET /user/ssh_signing_keys/{ssh_signing_key_id}\",\n ],\n list: [\"GET /users\"],\n listAttestations: [\"GET /users/{username}/attestations/{subject_digest}\"],\n listAttestationsBulk: [\n \"POST /users/{username}/attestations/bulk-list{?per_page,before,after}\",\n ],\n listBlockedByAuthenticated: [\n \"GET /user/blocks\",\n {},\n { renamed: [\"users\", \"listBlockedByAuthenticatedUser\"] },\n ],\n listBlockedByAuthenticatedUser: [\"GET /user/blocks\"],\n listEmailsForAuthenticated: [\n \"GET /user/emails\",\n {},\n { renamed: [\"users\", \"listEmailsForAuthenticatedUser\"] },\n ],\n listEmailsForAuthenticatedUser: [\"GET /user/emails\"],\n listFollowedByAuthenticated: [\n \"GET /user/following\",\n {},\n { renamed: [\"users\", \"listFollowedByAuthenticatedUser\"] },\n ],\n listFollowedByAuthenticatedUser: [\"GET /user/following\"],\n listFollowersForAuthenticatedUser: [\"GET /user/followers\"],\n listFollowersForUser: [\"GET /users/{username}/followers\"],\n listFollowingForUser: [\"GET /users/{username}/following\"],\n listGpgKeysForAuthenticated: [\n \"GET /user/gpg_keys\",\n {},\n { renamed: [\"users\", \"listGpgKeysForAuthenticatedUser\"] },\n ],\n listGpgKeysForAuthenticatedUser: [\"GET /user/gpg_keys\"],\n listGpgKeysForUser: [\"GET /users/{username}/gpg_keys\"],\n listPublicEmailsForAuthenticated: [\n \"GET /user/public_emails\",\n {},\n { renamed: [\"users\", \"listPublicEmailsForAuthenticatedUser\"] },\n ],\n listPublicEmailsForAuthenticatedUser: [\"GET /user/public_emails\"],\n listPublicKeysForUser: [\"GET /users/{username}/keys\"],\n listPublicSshKeysForAuthenticated: [\n \"GET /user/keys\",\n {},\n { renamed: [\"users\", \"listPublicSshKeysForAuthenticatedUser\"] },\n ],\n listPublicSshKeysForAuthenticatedUser: [\"GET /user/keys\"],\n listSocialAccountsForAuthenticatedUser: [\"GET /user/social_accounts\"],\n listSocialAccountsForUser: [\"GET /users/{username}/social_accounts\"],\n listSshSigningKeysForAuthenticatedUser: [\"GET /user/ssh_signing_keys\"],\n listSshSigningKeysForUser: [\"GET /users/{username}/ssh_signing_keys\"],\n setPrimaryEmailVisibilityForAuthenticated: [\n \"PATCH /user/email/visibility\",\n {},\n { renamed: [\"users\", \"setPrimaryEmailVisibilityForAuthenticatedUser\"] },\n ],\n setPrimaryEmailVisibilityForAuthenticatedUser: [\n \"PATCH /user/email/visibility\",\n ],\n unblock: [\"DELETE /user/blocks/{username}\"],\n unfollow: [\"DELETE /user/following/{username}\"],\n updateAuthenticated: [\"PATCH /user\"],\n },\n};\n\nexport default Endpoints;\n","import type { Octokit } from \"@octokit/core\";\nimport type { EndpointOptions, RequestParameters, Route } from \"@octokit/types\";\nimport ENDPOINTS from \"./generated/endpoints.js\";\nimport type { RestEndpointMethods } from \"./generated/method-types.js\";\nimport type { EndpointDecorations } from \"./types.js\";\n\n// The following code was refactored in: https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/622\n// to optimise the runtime performance of Octokit initialization.\n//\n// This optimization involves two key changes:\n// 1. Pre-Computation: The endpoint methods are pre-computed once at module load\n// time instead of each invocation of `endpointsToMethods()`.\n// 2. Lazy initialization and caching: We use a Proxy for each scope to only\n// initialize methods that are actually called. This reduces runtime overhead\n// as the initialization involves deep merging of objects. The initialized\n// methods are then cached for future use.\n\nconst endpointMethodsMap = new Map();\nfor (const [scope, endpoints] of Object.entries(ENDPOINTS)) {\n for (const [methodName, endpoint] of Object.entries(endpoints)) {\n const [route, defaults, decorations] = endpoint;\n const [method, url] = route.split(/ /);\n const endpointDefaults = Object.assign(\n {\n method,\n url,\n },\n defaults,\n );\n\n if (!endpointMethodsMap.has(scope)) {\n endpointMethodsMap.set(scope, new Map());\n }\n\n endpointMethodsMap.get(scope).set(methodName, {\n scope,\n methodName,\n endpointDefaults,\n decorations,\n });\n }\n}\n\ntype ProxyTarget = {\n octokit: Octokit;\n scope: string;\n cache: Record any>;\n};\n\nconst handler = {\n has({ scope }: ProxyTarget, methodName: string) {\n return endpointMethodsMap.get(scope).has(methodName);\n },\n getOwnPropertyDescriptor(target: ProxyTarget, methodName: string) {\n return {\n value: this.get(target, methodName), // ensures method is in the cache\n configurable: true,\n writable: true,\n enumerable: true,\n };\n },\n defineProperty(\n target: ProxyTarget,\n methodName: string,\n descriptor: PropertyDescriptor,\n ) {\n Object.defineProperty(target.cache, methodName, descriptor);\n return true;\n },\n deleteProperty(target: ProxyTarget, methodName: string) {\n delete target.cache[methodName];\n return true;\n },\n ownKeys({ scope }: ProxyTarget) {\n return [...endpointMethodsMap.get(scope).keys()];\n },\n set(target: ProxyTarget, methodName: string, value: any) {\n return (target.cache[methodName] = value);\n },\n get({ octokit, scope, cache }: ProxyTarget, methodName: string) {\n if (cache[methodName]) {\n return cache[methodName];\n }\n\n const method = endpointMethodsMap.get(scope).get(methodName);\n if (!method) {\n return undefined;\n }\n\n const { endpointDefaults, decorations } = method;\n\n if (decorations) {\n cache[methodName] = decorate(\n octokit,\n scope,\n methodName,\n endpointDefaults,\n decorations,\n );\n } else {\n cache[methodName] = octokit.request.defaults(endpointDefaults);\n }\n\n return cache[methodName];\n },\n};\n\nexport function endpointsToMethods(octokit: Octokit): RestEndpointMethods {\n const newMethods = {} as { [key: string]: object };\n\n for (const scope of endpointMethodsMap.keys()) {\n newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);\n }\n\n return newMethods as RestEndpointMethods;\n}\n\nfunction decorate(\n octokit: Octokit,\n scope: string,\n methodName: string,\n defaults: EndpointOptions,\n decorations: EndpointDecorations,\n) {\n const requestWithDefaults = octokit.request.defaults(defaults);\n\n /* istanbul ignore next */\n function withDecorations(\n ...args: [Route, RequestParameters?] | [EndpointOptions]\n ) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n let options = requestWithDefaults.endpoint.merge(...args);\n\n // There are currently no other decorations than `.mapToData`\n if (decorations.mapToData) {\n options = Object.assign({}, options, {\n data: options[decorations.mapToData],\n [decorations.mapToData]: undefined,\n });\n return requestWithDefaults(options);\n }\n\n if (decorations.renamed) {\n const [newScope, newMethodName] = decorations.renamed;\n octokit.log.warn(\n `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`,\n );\n }\n if (decorations.deprecated) {\n octokit.log.warn(decorations.deprecated);\n }\n\n if (decorations.renamedParameters) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n const options = requestWithDefaults.endpoint.merge(...args);\n\n for (const [name, alias] of Object.entries(\n decorations.renamedParameters,\n )) {\n if (name in options) {\n octokit.log.warn(\n `\"${name}\" parameter is deprecated for \"octokit.${scope}.${methodName}()\". Use \"${alias}\" instead`,\n );\n if (!(alias in options)) {\n options[alias] = options[name];\n }\n delete options[name];\n }\n }\n return requestWithDefaults(options);\n }\n\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n return requestWithDefaults(...args);\n }\n return Object.assign(withDecorations, requestWithDefaults);\n}\n","import type { Octokit } from \"@octokit/core\";\n\nexport type { RestEndpointMethodTypes } from \"./generated/parameters-and-response-types.js\";\nimport { VERSION } from \"./version.js\";\nimport type { Api } from \"./types.js\";\nimport { endpointsToMethods } from \"./endpoints-to-methods.js\";\n\n// Export the type for downstream users in order to fix a TypeScript error\n// The inferred type of 'Octokit' cannot be named without a reference to '../node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/types.js'. This is likely not portable. A type annotation is necessary.\nexport type { Api };\n\nexport function restEndpointMethods(octokit: Octokit): Api {\n const api = endpointsToMethods(octokit);\n return {\n rest: api,\n };\n}\nrestEndpointMethods.VERSION = VERSION;\n\nexport function legacyRestEndpointMethods(octokit: Octokit): Api[\"rest\"] & Api {\n const api = endpointsToMethods(octokit);\n return {\n ...api,\n rest: api,\n };\n}\nlegacyRestEndpointMethods.VERSION = VERSION;\n","// pkg/dist-src/version.js\nvar VERSION = \"0.0.0-development\";\n\n// pkg/dist-src/normalize-paginated-list-response.js\nfunction normalizePaginatedListResponse(response) {\n if (!response.data) {\n return {\n ...response,\n data: []\n };\n }\n const responseNeedsNormalization = (\"total_count\" in response.data || \"total_commits\" in response.data) && !(\"url\" in response.data);\n if (!responseNeedsNormalization) return response;\n const incompleteResults = response.data.incomplete_results;\n const repositorySelection = response.data.repository_selection;\n const totalCount = response.data.total_count;\n const totalCommits = response.data.total_commits;\n delete response.data.incomplete_results;\n delete response.data.repository_selection;\n delete response.data.total_count;\n delete response.data.total_commits;\n const namespaceKey = Object.keys(response.data)[0];\n const data = response.data[namespaceKey];\n response.data = data;\n if (typeof incompleteResults !== \"undefined\") {\n response.data.incomplete_results = incompleteResults;\n }\n if (typeof repositorySelection !== \"undefined\") {\n response.data.repository_selection = repositorySelection;\n }\n response.data.total_count = totalCount;\n response.data.total_commits = totalCommits;\n return response;\n}\n\n// pkg/dist-src/iterator.js\nfunction iterator(octokit, route, parameters) {\n const options = typeof route === \"function\" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);\n const requestMethod = typeof route === \"function\" ? route : octokit.request;\n const method = options.method;\n const headers = options.headers;\n let url = options.url;\n return {\n [Symbol.asyncIterator]: () => ({\n async next() {\n if (!url) return { done: true };\n try {\n const response = await requestMethod({ method, url, headers });\n const normalizedResponse = normalizePaginatedListResponse(response);\n url = ((normalizedResponse.headers.link || \"\").match(\n /<([^<>]+)>;\\s*rel=\"next\"/\n ) || [])[1];\n if (!url && \"total_commits\" in normalizedResponse.data) {\n const parsedUrl = new URL(normalizedResponse.url);\n const params = parsedUrl.searchParams;\n const page = parseInt(params.get(\"page\") || \"1\", 10);\n const per_page = parseInt(params.get(\"per_page\") || \"250\", 10);\n if (page * per_page < normalizedResponse.data.total_commits) {\n params.set(\"page\", String(page + 1));\n url = parsedUrl.toString();\n }\n }\n return { value: normalizedResponse };\n } catch (error) {\n if (error.status !== 409) throw error;\n url = \"\";\n return {\n value: {\n status: 200,\n headers: {},\n data: []\n }\n };\n }\n }\n })\n };\n}\n\n// pkg/dist-src/paginate.js\nfunction paginate(octokit, route, parameters, mapFn) {\n if (typeof parameters === \"function\") {\n mapFn = parameters;\n parameters = void 0;\n }\n return gather(\n octokit,\n [],\n iterator(octokit, route, parameters)[Symbol.asyncIterator](),\n mapFn\n );\n}\nfunction gather(octokit, results, iterator2, mapFn) {\n return iterator2.next().then((result) => {\n if (result.done) {\n return results;\n }\n let earlyExit = false;\n function done() {\n earlyExit = true;\n }\n results = results.concat(\n mapFn ? mapFn(result.value, done) : result.value.data\n );\n if (earlyExit) {\n return results;\n }\n return gather(octokit, results, iterator2, mapFn);\n });\n}\n\n// pkg/dist-src/compose-paginate.js\nvar composePaginateRest = Object.assign(paginate, {\n iterator\n});\n\n// pkg/dist-src/generated/paginating-endpoints.js\nvar paginatingEndpoints = [\n \"GET /advisories\",\n \"GET /app/hook/deliveries\",\n \"GET /app/installation-requests\",\n \"GET /app/installations\",\n \"GET /assignments/{assignment_id}/accepted_assignments\",\n \"GET /classrooms\",\n \"GET /classrooms/{classroom_id}/assignments\",\n \"GET /enterprises/{enterprise}/code-security/configurations\",\n \"GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories\",\n \"GET /enterprises/{enterprise}/dependabot/alerts\",\n \"GET /enterprises/{enterprise}/teams\",\n \"GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships\",\n \"GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations\",\n \"GET /events\",\n \"GET /gists\",\n \"GET /gists/public\",\n \"GET /gists/starred\",\n \"GET /gists/{gist_id}/comments\",\n \"GET /gists/{gist_id}/commits\",\n \"GET /gists/{gist_id}/forks\",\n \"GET /installation/repositories\",\n \"GET /issues\",\n \"GET /licenses\",\n \"GET /marketplace_listing/plans\",\n \"GET /marketplace_listing/plans/{plan_id}/accounts\",\n \"GET /marketplace_listing/stubbed/plans\",\n \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\",\n \"GET /networks/{owner}/{repo}/events\",\n \"GET /notifications\",\n \"GET /organizations\",\n \"GET /organizations/{org}/dependabot/repository-access\",\n \"GET /orgs/{org}/actions/cache/usage-by-repository\",\n \"GET /orgs/{org}/actions/hosted-runners\",\n \"GET /orgs/{org}/actions/permissions/repositories\",\n \"GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories\",\n \"GET /orgs/{org}/actions/runner-groups\",\n \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners\",\n \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories\",\n \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners\",\n \"GET /orgs/{org}/actions/runners\",\n \"GET /orgs/{org}/actions/secrets\",\n \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\",\n \"GET /orgs/{org}/actions/variables\",\n \"GET /orgs/{org}/actions/variables/{name}/repositories\",\n \"GET /orgs/{org}/attestations/repositories\",\n \"GET /orgs/{org}/attestations/{subject_digest}\",\n \"GET /orgs/{org}/blocks\",\n \"GET /orgs/{org}/campaigns\",\n \"GET /orgs/{org}/code-scanning/alerts\",\n \"GET /orgs/{org}/code-security/configurations\",\n \"GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories\",\n \"GET /orgs/{org}/codespaces\",\n \"GET /orgs/{org}/codespaces/secrets\",\n \"GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories\",\n \"GET /orgs/{org}/copilot/billing/seats\",\n \"GET /orgs/{org}/copilot/metrics\",\n \"GET /orgs/{org}/dependabot/alerts\",\n \"GET /orgs/{org}/dependabot/secrets\",\n \"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories\",\n \"GET /orgs/{org}/events\",\n \"GET /orgs/{org}/failed_invitations\",\n \"GET /orgs/{org}/hooks\",\n \"GET /orgs/{org}/hooks/{hook_id}/deliveries\",\n \"GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}\",\n \"GET /orgs/{org}/insights/api/subject-stats\",\n \"GET /orgs/{org}/insights/api/user-stats/{user_id}\",\n \"GET /orgs/{org}/installations\",\n \"GET /orgs/{org}/invitations\",\n \"GET /orgs/{org}/invitations/{invitation_id}/teams\",\n \"GET /orgs/{org}/issues\",\n \"GET /orgs/{org}/members\",\n \"GET /orgs/{org}/members/{username}/codespaces\",\n \"GET /orgs/{org}/migrations\",\n \"GET /orgs/{org}/migrations/{migration_id}/repositories\",\n \"GET /orgs/{org}/organization-roles/{role_id}/teams\",\n \"GET /orgs/{org}/organization-roles/{role_id}/users\",\n \"GET /orgs/{org}/outside_collaborators\",\n \"GET /orgs/{org}/packages\",\n \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\",\n \"GET /orgs/{org}/personal-access-token-requests\",\n \"GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories\",\n \"GET /orgs/{org}/personal-access-tokens\",\n \"GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories\",\n \"GET /orgs/{org}/private-registries\",\n \"GET /orgs/{org}/projects\",\n \"GET /orgs/{org}/projectsV2\",\n \"GET /orgs/{org}/projectsV2/{project_number}/fields\",\n \"GET /orgs/{org}/projectsV2/{project_number}/items\",\n \"GET /orgs/{org}/properties/values\",\n \"GET /orgs/{org}/public_members\",\n \"GET /orgs/{org}/repos\",\n \"GET /orgs/{org}/rulesets\",\n \"GET /orgs/{org}/rulesets/rule-suites\",\n \"GET /orgs/{org}/rulesets/{ruleset_id}/history\",\n \"GET /orgs/{org}/secret-scanning/alerts\",\n \"GET /orgs/{org}/security-advisories\",\n \"GET /orgs/{org}/settings/immutable-releases/repositories\",\n \"GET /orgs/{org}/settings/network-configurations\",\n \"GET /orgs/{org}/team/{team_slug}/copilot/metrics\",\n \"GET /orgs/{org}/teams\",\n \"GET /orgs/{org}/teams/{team_slug}/discussions\",\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\",\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\",\n \"GET /orgs/{org}/teams/{team_slug}/invitations\",\n \"GET /orgs/{org}/teams/{team_slug}/members\",\n \"GET /orgs/{org}/teams/{team_slug}/projects\",\n \"GET /orgs/{org}/teams/{team_slug}/repos\",\n \"GET /orgs/{org}/teams/{team_slug}/teams\",\n \"GET /projects/{project_id}/collaborators\",\n \"GET /repos/{owner}/{repo}/actions/artifacts\",\n \"GET /repos/{owner}/{repo}/actions/caches\",\n \"GET /repos/{owner}/{repo}/actions/organization-secrets\",\n \"GET /repos/{owner}/{repo}/actions/organization-variables\",\n \"GET /repos/{owner}/{repo}/actions/runners\",\n \"GET /repos/{owner}/{repo}/actions/runs\",\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\",\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\",\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\",\n \"GET /repos/{owner}/{repo}/actions/secrets\",\n \"GET /repos/{owner}/{repo}/actions/variables\",\n \"GET /repos/{owner}/{repo}/actions/workflows\",\n \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\",\n \"GET /repos/{owner}/{repo}/activity\",\n \"GET /repos/{owner}/{repo}/assignees\",\n \"GET /repos/{owner}/{repo}/attestations/{subject_digest}\",\n \"GET /repos/{owner}/{repo}/branches\",\n \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\",\n \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\",\n \"GET /repos/{owner}/{repo}/code-scanning/alerts\",\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\",\n \"GET /repos/{owner}/{repo}/code-scanning/analyses\",\n \"GET /repos/{owner}/{repo}/codespaces\",\n \"GET /repos/{owner}/{repo}/codespaces/devcontainers\",\n \"GET /repos/{owner}/{repo}/codespaces/secrets\",\n \"GET /repos/{owner}/{repo}/collaborators\",\n \"GET /repos/{owner}/{repo}/comments\",\n \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\",\n \"GET /repos/{owner}/{repo}/commits\",\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\",\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\",\n \"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\",\n \"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\",\n \"GET /repos/{owner}/{repo}/commits/{ref}/status\",\n \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\",\n \"GET /repos/{owner}/{repo}/compare/{basehead}\",\n \"GET /repos/{owner}/{repo}/compare/{base}...{head}\",\n \"GET /repos/{owner}/{repo}/contributors\",\n \"GET /repos/{owner}/{repo}/dependabot/alerts\",\n \"GET /repos/{owner}/{repo}/dependabot/secrets\",\n \"GET /repos/{owner}/{repo}/deployments\",\n \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\",\n \"GET /repos/{owner}/{repo}/environments\",\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies\",\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps\",\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/secrets\",\n \"GET /repos/{owner}/{repo}/environments/{environment_name}/variables\",\n \"GET /repos/{owner}/{repo}/events\",\n \"GET /repos/{owner}/{repo}/forks\",\n \"GET /repos/{owner}/{repo}/hooks\",\n \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\",\n \"GET /repos/{owner}/{repo}/invitations\",\n \"GET /repos/{owner}/{repo}/issues\",\n \"GET /repos/{owner}/{repo}/issues/comments\",\n \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\",\n \"GET /repos/{owner}/{repo}/issues/events\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/events\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\",\n \"GET /repos/{owner}/{repo}/keys\",\n \"GET /repos/{owner}/{repo}/labels\",\n \"GET /repos/{owner}/{repo}/milestones\",\n \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\",\n \"GET /repos/{owner}/{repo}/notifications\",\n \"GET /repos/{owner}/{repo}/pages/builds\",\n \"GET /repos/{owner}/{repo}/projects\",\n \"GET /repos/{owner}/{repo}/pulls\",\n \"GET /repos/{owner}/{repo}/pulls/comments\",\n \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\",\n \"GET /repos/{owner}/{repo}/releases\",\n \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\",\n \"GET /repos/{owner}/{repo}/releases/{release_id}/reactions\",\n \"GET /repos/{owner}/{repo}/rules/branches/{branch}\",\n \"GET /repos/{owner}/{repo}/rulesets\",\n \"GET /repos/{owner}/{repo}/rulesets/rule-suites\",\n \"GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history\",\n \"GET /repos/{owner}/{repo}/secret-scanning/alerts\",\n \"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations\",\n \"GET /repos/{owner}/{repo}/security-advisories\",\n \"GET /repos/{owner}/{repo}/stargazers\",\n \"GET /repos/{owner}/{repo}/subscribers\",\n \"GET /repos/{owner}/{repo}/tags\",\n \"GET /repos/{owner}/{repo}/teams\",\n \"GET /repos/{owner}/{repo}/topics\",\n \"GET /repositories\",\n \"GET /search/code\",\n \"GET /search/commits\",\n \"GET /search/issues\",\n \"GET /search/labels\",\n \"GET /search/repositories\",\n \"GET /search/topics\",\n \"GET /search/users\",\n \"GET /teams/{team_id}/discussions\",\n \"GET /teams/{team_id}/discussions/{discussion_number}/comments\",\n \"GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n \"GET /teams/{team_id}/discussions/{discussion_number}/reactions\",\n \"GET /teams/{team_id}/invitations\",\n \"GET /teams/{team_id}/members\",\n \"GET /teams/{team_id}/projects\",\n \"GET /teams/{team_id}/repos\",\n \"GET /teams/{team_id}/teams\",\n \"GET /user/blocks\",\n \"GET /user/codespaces\",\n \"GET /user/codespaces/secrets\",\n \"GET /user/emails\",\n \"GET /user/followers\",\n \"GET /user/following\",\n \"GET /user/gpg_keys\",\n \"GET /user/installations\",\n \"GET /user/installations/{installation_id}/repositories\",\n \"GET /user/issues\",\n \"GET /user/keys\",\n \"GET /user/marketplace_purchases\",\n \"GET /user/marketplace_purchases/stubbed\",\n \"GET /user/memberships/orgs\",\n \"GET /user/migrations\",\n \"GET /user/migrations/{migration_id}/repositories\",\n \"GET /user/orgs\",\n \"GET /user/packages\",\n \"GET /user/packages/{package_type}/{package_name}/versions\",\n \"GET /user/public_emails\",\n \"GET /user/repos\",\n \"GET /user/repository_invitations\",\n \"GET /user/social_accounts\",\n \"GET /user/ssh_signing_keys\",\n \"GET /user/starred\",\n \"GET /user/subscriptions\",\n \"GET /user/teams\",\n \"GET /users\",\n \"GET /users/{username}/attestations/{subject_digest}\",\n \"GET /users/{username}/events\",\n \"GET /users/{username}/events/orgs/{org}\",\n \"GET /users/{username}/events/public\",\n \"GET /users/{username}/followers\",\n \"GET /users/{username}/following\",\n \"GET /users/{username}/gists\",\n \"GET /users/{username}/gpg_keys\",\n \"GET /users/{username}/keys\",\n \"GET /users/{username}/orgs\",\n \"GET /users/{username}/packages\",\n \"GET /users/{username}/projects\",\n \"GET /users/{username}/projectsV2\",\n \"GET /users/{username}/projectsV2/{project_number}/fields\",\n \"GET /users/{username}/projectsV2/{project_number}/items\",\n \"GET /users/{username}/received_events\",\n \"GET /users/{username}/received_events/public\",\n \"GET /users/{username}/repos\",\n \"GET /users/{username}/social_accounts\",\n \"GET /users/{username}/ssh_signing_keys\",\n \"GET /users/{username}/starred\",\n \"GET /users/{username}/subscriptions\"\n];\n\n// pkg/dist-src/paginating-endpoints.js\nfunction isPaginatingEndpoint(arg) {\n if (typeof arg === \"string\") {\n return paginatingEndpoints.includes(arg);\n } else {\n return false;\n }\n}\n\n// pkg/dist-src/index.js\nfunction paginateRest(octokit) {\n return {\n paginate: Object.assign(paginate.bind(null, octokit), {\n iterator: iterator.bind(null, octokit)\n })\n };\n}\npaginateRest.VERSION = VERSION;\nexport {\n composePaginateRest,\n isPaginatingEndpoint,\n paginateRest,\n paginatingEndpoints\n};\n","const VERSION = \"6.0.0\";\nexport {\n VERSION\n};\n","import { VERSION } from \"./version.js\";\nfunction requestLog(octokit) {\n octokit.hook.wrap(\"request\", (request, options) => {\n octokit.log.debug(\"request\", options);\n const start = Date.now();\n const requestOptions = octokit.request.endpoint.parse(options);\n const path = requestOptions.url.replace(options.baseUrl, \"\");\n return request(options).then((response) => {\n const requestId = response.headers[\"x-github-request-id\"];\n octokit.log.info(\n `${requestOptions.method} ${path} - ${response.status} with id ${requestId} in ${Date.now() - start}ms`\n );\n return response;\n }).catch((error) => {\n const requestId = error.response?.headers[\"x-github-request-id\"] || \"UNKNOWN\";\n octokit.log.error(\n `${requestOptions.method} ${path} - ${error.status} with id ${requestId} in ${Date.now() - start}ms`\n );\n throw error;\n });\n });\n}\nrequestLog.VERSION = VERSION;\nexport {\n requestLog\n};\n","const VERSION = \"22.0.1\";\nexport {\n VERSION\n};\n","import { Octokit as Core } from \"@octokit/core\";\nimport { requestLog } from \"@octokit/plugin-request-log\";\nimport {\n paginateRest\n} from \"@octokit/plugin-paginate-rest\";\nimport { legacyRestEndpointMethods } from \"@octokit/plugin-rest-endpoint-methods\";\nimport { VERSION } from \"./version.js\";\nconst Octokit = Core.plugin(requestLog, legacyRestEndpointMethods, paginateRest).defaults(\n {\n userAgent: `octokit-rest.js/${VERSION}`\n }\n);\nexport {\n Octokit\n};\n","/**\n * This file contains the Bottleneck library (MIT), compiled to ES2017, and without Clustering support.\n * https://github.com/SGrondin/bottleneck\n */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.Bottleneck = factory());\n}(this, (function () { 'use strict';\n\n\tvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\n\tfunction getCjsExportFromNamespace (n) {\n\t\treturn n && n['default'] || n;\n\t}\n\n\tvar load = function(received, defaults, onto = {}) {\n\t var k, ref, v;\n\t for (k in defaults) {\n\t v = defaults[k];\n\t onto[k] = (ref = received[k]) != null ? ref : v;\n\t }\n\t return onto;\n\t};\n\n\tvar overwrite = function(received, defaults, onto = {}) {\n\t var k, v;\n\t for (k in received) {\n\t v = received[k];\n\t if (defaults[k] !== void 0) {\n\t onto[k] = v;\n\t }\n\t }\n\t return onto;\n\t};\n\n\tvar parser = {\n\t\tload: load,\n\t\toverwrite: overwrite\n\t};\n\n\tvar DLList;\n\n\tDLList = class DLList {\n\t constructor(incr, decr) {\n\t this.incr = incr;\n\t this.decr = decr;\n\t this._first = null;\n\t this._last = null;\n\t this.length = 0;\n\t }\n\n\t push(value) {\n\t var node;\n\t this.length++;\n\t if (typeof this.incr === \"function\") {\n\t this.incr();\n\t }\n\t node = {\n\t value,\n\t prev: this._last,\n\t next: null\n\t };\n\t if (this._last != null) {\n\t this._last.next = node;\n\t this._last = node;\n\t } else {\n\t this._first = this._last = node;\n\t }\n\t return void 0;\n\t }\n\n\t shift() {\n\t var value;\n\t if (this._first == null) {\n\t return;\n\t } else {\n\t this.length--;\n\t if (typeof this.decr === \"function\") {\n\t this.decr();\n\t }\n\t }\n\t value = this._first.value;\n\t if ((this._first = this._first.next) != null) {\n\t this._first.prev = null;\n\t } else {\n\t this._last = null;\n\t }\n\t return value;\n\t }\n\n\t first() {\n\t if (this._first != null) {\n\t return this._first.value;\n\t }\n\t }\n\n\t getArray() {\n\t var node, ref, results;\n\t node = this._first;\n\t results = [];\n\t while (node != null) {\n\t results.push((ref = node, node = node.next, ref.value));\n\t }\n\t return results;\n\t }\n\n\t forEachShift(cb) {\n\t var node;\n\t node = this.shift();\n\t while (node != null) {\n\t (cb(node), node = this.shift());\n\t }\n\t return void 0;\n\t }\n\n\t debug() {\n\t var node, ref, ref1, ref2, results;\n\t node = this._first;\n\t results = [];\n\t while (node != null) {\n\t results.push((ref = node, node = node.next, {\n\t value: ref.value,\n\t prev: (ref1 = ref.prev) != null ? ref1.value : void 0,\n\t next: (ref2 = ref.next) != null ? ref2.value : void 0\n\t }));\n\t }\n\t return results;\n\t }\n\n\t};\n\n\tvar DLList_1 = DLList;\n\n\tvar Events;\n\n\tEvents = class Events {\n\t constructor(instance) {\n\t this.instance = instance;\n\t this._events = {};\n\t if ((this.instance.on != null) || (this.instance.once != null) || (this.instance.removeAllListeners != null)) {\n\t throw new Error(\"An Emitter already exists for this object\");\n\t }\n\t this.instance.on = (name, cb) => {\n\t return this._addListener(name, \"many\", cb);\n\t };\n\t this.instance.once = (name, cb) => {\n\t return this._addListener(name, \"once\", cb);\n\t };\n\t this.instance.removeAllListeners = (name = null) => {\n\t if (name != null) {\n\t return delete this._events[name];\n\t } else {\n\t return this._events = {};\n\t }\n\t };\n\t }\n\n\t _addListener(name, status, cb) {\n\t var base;\n\t if ((base = this._events)[name] == null) {\n\t base[name] = [];\n\t }\n\t this._events[name].push({cb, status});\n\t return this.instance;\n\t }\n\n\t listenerCount(name) {\n\t if (this._events[name] != null) {\n\t return this._events[name].length;\n\t } else {\n\t return 0;\n\t }\n\t }\n\n\t async trigger(name, ...args) {\n\t var e, promises;\n\t try {\n\t if (name !== \"debug\") {\n\t this.trigger(\"debug\", `Event triggered: ${name}`, args);\n\t }\n\t if (this._events[name] == null) {\n\t return;\n\t }\n\t this._events[name] = this._events[name].filter(function(listener) {\n\t return listener.status !== \"none\";\n\t });\n\t promises = this._events[name].map(async(listener) => {\n\t var e, returned;\n\t if (listener.status === \"none\") {\n\t return;\n\t }\n\t if (listener.status === \"once\") {\n\t listener.status = \"none\";\n\t }\n\t try {\n\t returned = typeof listener.cb === \"function\" ? listener.cb(...args) : void 0;\n\t if (typeof (returned != null ? returned.then : void 0) === \"function\") {\n\t return (await returned);\n\t } else {\n\t return returned;\n\t }\n\t } catch (error) {\n\t e = error;\n\t {\n\t this.trigger(\"error\", e);\n\t }\n\t return null;\n\t }\n\t });\n\t return ((await Promise.all(promises))).find(function(x) {\n\t return x != null;\n\t });\n\t } catch (error) {\n\t e = error;\n\t {\n\t this.trigger(\"error\", e);\n\t }\n\t return null;\n\t }\n\t }\n\n\t};\n\n\tvar Events_1 = Events;\n\n\tvar DLList$1, Events$1, Queues;\n\n\tDLList$1 = DLList_1;\n\n\tEvents$1 = Events_1;\n\n\tQueues = class Queues {\n\t constructor(num_priorities) {\n\t var i;\n\t this.Events = new Events$1(this);\n\t this._length = 0;\n\t this._lists = (function() {\n\t var j, ref, results;\n\t results = [];\n\t for (i = j = 1, ref = num_priorities; (1 <= ref ? j <= ref : j >= ref); i = 1 <= ref ? ++j : --j) {\n\t results.push(new DLList$1((() => {\n\t return this.incr();\n\t }), (() => {\n\t return this.decr();\n\t })));\n\t }\n\t return results;\n\t }).call(this);\n\t }\n\n\t incr() {\n\t if (this._length++ === 0) {\n\t return this.Events.trigger(\"leftzero\");\n\t }\n\t }\n\n\t decr() {\n\t if (--this._length === 0) {\n\t return this.Events.trigger(\"zero\");\n\t }\n\t }\n\n\t push(job) {\n\t return this._lists[job.options.priority].push(job);\n\t }\n\n\t queued(priority) {\n\t if (priority != null) {\n\t return this._lists[priority].length;\n\t } else {\n\t return this._length;\n\t }\n\t }\n\n\t shiftAll(fn) {\n\t return this._lists.forEach(function(list) {\n\t return list.forEachShift(fn);\n\t });\n\t }\n\n\t getFirst(arr = this._lists) {\n\t var j, len, list;\n\t for (j = 0, len = arr.length; j < len; j++) {\n\t list = arr[j];\n\t if (list.length > 0) {\n\t return list;\n\t }\n\t }\n\t return [];\n\t }\n\n\t shiftLastFrom(priority) {\n\t return this.getFirst(this._lists.slice(priority).reverse()).shift();\n\t }\n\n\t};\n\n\tvar Queues_1 = Queues;\n\n\tvar BottleneckError;\n\n\tBottleneckError = class BottleneckError extends Error {};\n\n\tvar BottleneckError_1 = BottleneckError;\n\n\tvar BottleneckError$1, DEFAULT_PRIORITY, Job, NUM_PRIORITIES, parser$1;\n\n\tNUM_PRIORITIES = 10;\n\n\tDEFAULT_PRIORITY = 5;\n\n\tparser$1 = parser;\n\n\tBottleneckError$1 = BottleneckError_1;\n\n\tJob = class Job {\n\t constructor(task, args, options, jobDefaults, rejectOnDrop, Events, _states, Promise) {\n\t this.task = task;\n\t this.args = args;\n\t this.rejectOnDrop = rejectOnDrop;\n\t this.Events = Events;\n\t this._states = _states;\n\t this.Promise = Promise;\n\t this.options = parser$1.load(options, jobDefaults);\n\t this.options.priority = this._sanitizePriority(this.options.priority);\n\t if (this.options.id === jobDefaults.id) {\n\t this.options.id = `${this.options.id}-${this._randomIndex()}`;\n\t }\n\t this.promise = new this.Promise((_resolve, _reject) => {\n\t this._resolve = _resolve;\n\t this._reject = _reject;\n\t });\n\t this.retryCount = 0;\n\t }\n\n\t _sanitizePriority(priority) {\n\t var sProperty;\n\t sProperty = ~~priority !== priority ? DEFAULT_PRIORITY : priority;\n\t if (sProperty < 0) {\n\t return 0;\n\t } else if (sProperty > NUM_PRIORITIES - 1) {\n\t return NUM_PRIORITIES - 1;\n\t } else {\n\t return sProperty;\n\t }\n\t }\n\n\t _randomIndex() {\n\t return Math.random().toString(36).slice(2);\n\t }\n\n\t doDrop({error, message = \"This job has been dropped by Bottleneck\"} = {}) {\n\t if (this._states.remove(this.options.id)) {\n\t if (this.rejectOnDrop) {\n\t this._reject(error != null ? error : new BottleneckError$1(message));\n\t }\n\t this.Events.trigger(\"dropped\", {args: this.args, options: this.options, task: this.task, promise: this.promise});\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t }\n\n\t _assertStatus(expected) {\n\t var status;\n\t status = this._states.jobStatus(this.options.id);\n\t if (!(status === expected || (expected === \"DONE\" && status === null))) {\n\t throw new BottleneckError$1(`Invalid job status ${status}, expected ${expected}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`);\n\t }\n\t }\n\n\t doReceive() {\n\t this._states.start(this.options.id);\n\t return this.Events.trigger(\"received\", {args: this.args, options: this.options});\n\t }\n\n\t doQueue(reachedHWM, blocked) {\n\t this._assertStatus(\"RECEIVED\");\n\t this._states.next(this.options.id);\n\t return this.Events.trigger(\"queued\", {args: this.args, options: this.options, reachedHWM, blocked});\n\t }\n\n\t doRun() {\n\t if (this.retryCount === 0) {\n\t this._assertStatus(\"QUEUED\");\n\t this._states.next(this.options.id);\n\t } else {\n\t this._assertStatus(\"EXECUTING\");\n\t }\n\t return this.Events.trigger(\"scheduled\", {args: this.args, options: this.options});\n\t }\n\n\t async doExecute(chained, clearGlobalState, run, free) {\n\t var error, eventInfo, passed;\n\t if (this.retryCount === 0) {\n\t this._assertStatus(\"RUNNING\");\n\t this._states.next(this.options.id);\n\t } else {\n\t this._assertStatus(\"EXECUTING\");\n\t }\n\t eventInfo = {args: this.args, options: this.options, retryCount: this.retryCount};\n\t this.Events.trigger(\"executing\", eventInfo);\n\t try {\n\t passed = (await (chained != null ? chained.schedule(this.options, this.task, ...this.args) : this.task(...this.args)));\n\t if (clearGlobalState()) {\n\t this.doDone(eventInfo);\n\t await free(this.options, eventInfo);\n\t this._assertStatus(\"DONE\");\n\t return this._resolve(passed);\n\t }\n\t } catch (error1) {\n\t error = error1;\n\t return this._onFailure(error, eventInfo, clearGlobalState, run, free);\n\t }\n\t }\n\n\t doExpire(clearGlobalState, run, free) {\n\t var error, eventInfo;\n\t if (this._states.jobStatus(this.options.id === \"RUNNING\")) {\n\t this._states.next(this.options.id);\n\t }\n\t this._assertStatus(\"EXECUTING\");\n\t eventInfo = {args: this.args, options: this.options, retryCount: this.retryCount};\n\t error = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`);\n\t return this._onFailure(error, eventInfo, clearGlobalState, run, free);\n\t }\n\n\t async _onFailure(error, eventInfo, clearGlobalState, run, free) {\n\t var retry, retryAfter;\n\t if (clearGlobalState()) {\n\t retry = (await this.Events.trigger(\"failed\", error, eventInfo));\n\t if (retry != null) {\n\t retryAfter = ~~retry;\n\t this.Events.trigger(\"retry\", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo);\n\t this.retryCount++;\n\t return run(retryAfter);\n\t } else {\n\t this.doDone(eventInfo);\n\t await free(this.options, eventInfo);\n\t this._assertStatus(\"DONE\");\n\t return this._reject(error);\n\t }\n\t }\n\t }\n\n\t doDone(eventInfo) {\n\t this._assertStatus(\"EXECUTING\");\n\t this._states.next(this.options.id);\n\t return this.Events.trigger(\"done\", eventInfo);\n\t }\n\n\t};\n\n\tvar Job_1 = Job;\n\n\tvar BottleneckError$2, LocalDatastore, parser$2;\n\n\tparser$2 = parser;\n\n\tBottleneckError$2 = BottleneckError_1;\n\n\tLocalDatastore = class LocalDatastore {\n\t constructor(instance, storeOptions, storeInstanceOptions) {\n\t this.instance = instance;\n\t this.storeOptions = storeOptions;\n\t this.clientId = this.instance._randomIndex();\n\t parser$2.load(storeInstanceOptions, storeInstanceOptions, this);\n\t this._nextRequest = this._lastReservoirRefresh = this._lastReservoirIncrease = Date.now();\n\t this._running = 0;\n\t this._done = 0;\n\t this._unblockTime = 0;\n\t this.ready = this.Promise.resolve();\n\t this.clients = {};\n\t this._startHeartbeat();\n\t }\n\n\t _startHeartbeat() {\n\t var base;\n\t if ((this.heartbeat == null) && (((this.storeOptions.reservoirRefreshInterval != null) && (this.storeOptions.reservoirRefreshAmount != null)) || ((this.storeOptions.reservoirIncreaseInterval != null) && (this.storeOptions.reservoirIncreaseAmount != null)))) {\n\t return typeof (base = (this.heartbeat = setInterval(() => {\n\t var amount, incr, maximum, now, reservoir;\n\t now = Date.now();\n\t if ((this.storeOptions.reservoirRefreshInterval != null) && now >= this._lastReservoirRefresh + this.storeOptions.reservoirRefreshInterval) {\n\t this._lastReservoirRefresh = now;\n\t this.storeOptions.reservoir = this.storeOptions.reservoirRefreshAmount;\n\t this.instance._drainAll(this.computeCapacity());\n\t }\n\t if ((this.storeOptions.reservoirIncreaseInterval != null) && now >= this._lastReservoirIncrease + this.storeOptions.reservoirIncreaseInterval) {\n\t ({\n\t reservoirIncreaseAmount: amount,\n\t reservoirIncreaseMaximum: maximum,\n\t reservoir\n\t } = this.storeOptions);\n\t this._lastReservoirIncrease = now;\n\t incr = maximum != null ? Math.min(amount, maximum - reservoir) : amount;\n\t if (incr > 0) {\n\t this.storeOptions.reservoir += incr;\n\t return this.instance._drainAll(this.computeCapacity());\n\t }\n\t }\n\t }, this.heartbeatInterval))).unref === \"function\" ? base.unref() : void 0;\n\t } else {\n\t return clearInterval(this.heartbeat);\n\t }\n\t }\n\n\t async __publish__(message) {\n\t await this.yieldLoop();\n\t return this.instance.Events.trigger(\"message\", message.toString());\n\t }\n\n\t async __disconnect__(flush) {\n\t await this.yieldLoop();\n\t clearInterval(this.heartbeat);\n\t return this.Promise.resolve();\n\t }\n\n\t yieldLoop(t = 0) {\n\t return new this.Promise(function(resolve, reject) {\n\t return setTimeout(resolve, t);\n\t });\n\t }\n\n\t computePenalty() {\n\t var ref;\n\t return (ref = this.storeOptions.penalty) != null ? ref : (15 * this.storeOptions.minTime) || 5000;\n\t }\n\n\t async __updateSettings__(options) {\n\t await this.yieldLoop();\n\t parser$2.overwrite(options, options, this.storeOptions);\n\t this._startHeartbeat();\n\t this.instance._drainAll(this.computeCapacity());\n\t return true;\n\t }\n\n\t async __running__() {\n\t await this.yieldLoop();\n\t return this._running;\n\t }\n\n\t async __queued__() {\n\t await this.yieldLoop();\n\t return this.instance.queued();\n\t }\n\n\t async __done__() {\n\t await this.yieldLoop();\n\t return this._done;\n\t }\n\n\t async __groupCheck__(time) {\n\t await this.yieldLoop();\n\t return (this._nextRequest + this.timeout) < time;\n\t }\n\n\t computeCapacity() {\n\t var maxConcurrent, reservoir;\n\t ({maxConcurrent, reservoir} = this.storeOptions);\n\t if ((maxConcurrent != null) && (reservoir != null)) {\n\t return Math.min(maxConcurrent - this._running, reservoir);\n\t } else if (maxConcurrent != null) {\n\t return maxConcurrent - this._running;\n\t } else if (reservoir != null) {\n\t return reservoir;\n\t } else {\n\t return null;\n\t }\n\t }\n\n\t conditionsCheck(weight) {\n\t var capacity;\n\t capacity = this.computeCapacity();\n\t return (capacity == null) || weight <= capacity;\n\t }\n\n\t async __incrementReservoir__(incr) {\n\t var reservoir;\n\t await this.yieldLoop();\n\t reservoir = this.storeOptions.reservoir += incr;\n\t this.instance._drainAll(this.computeCapacity());\n\t return reservoir;\n\t }\n\n\t async __currentReservoir__() {\n\t await this.yieldLoop();\n\t return this.storeOptions.reservoir;\n\t }\n\n\t isBlocked(now) {\n\t return this._unblockTime >= now;\n\t }\n\n\t check(weight, now) {\n\t return this.conditionsCheck(weight) && (this._nextRequest - now) <= 0;\n\t }\n\n\t async __check__(weight) {\n\t var now;\n\t await this.yieldLoop();\n\t now = Date.now();\n\t return this.check(weight, now);\n\t }\n\n\t async __register__(index, weight, expiration) {\n\t var now, wait;\n\t await this.yieldLoop();\n\t now = Date.now();\n\t if (this.conditionsCheck(weight)) {\n\t this._running += weight;\n\t if (this.storeOptions.reservoir != null) {\n\t this.storeOptions.reservoir -= weight;\n\t }\n\t wait = Math.max(this._nextRequest - now, 0);\n\t this._nextRequest = now + wait + this.storeOptions.minTime;\n\t return {\n\t success: true,\n\t wait,\n\t reservoir: this.storeOptions.reservoir\n\t };\n\t } else {\n\t return {\n\t success: false\n\t };\n\t }\n\t }\n\n\t strategyIsBlock() {\n\t return this.storeOptions.strategy === 3;\n\t }\n\n\t async __submit__(queueLength, weight) {\n\t var blocked, now, reachedHWM;\n\t await this.yieldLoop();\n\t if ((this.storeOptions.maxConcurrent != null) && weight > this.storeOptions.maxConcurrent) {\n\t throw new BottleneckError$2(`Impossible to add a job having a weight of ${weight} to a limiter having a maxConcurrent setting of ${this.storeOptions.maxConcurrent}`);\n\t }\n\t now = Date.now();\n\t reachedHWM = (this.storeOptions.highWater != null) && queueLength === this.storeOptions.highWater && !this.check(weight, now);\n\t blocked = this.strategyIsBlock() && (reachedHWM || this.isBlocked(now));\n\t if (blocked) {\n\t this._unblockTime = now + this.computePenalty();\n\t this._nextRequest = this._unblockTime + this.storeOptions.minTime;\n\t this.instance._dropAllQueued();\n\t }\n\t return {\n\t reachedHWM,\n\t blocked,\n\t strategy: this.storeOptions.strategy\n\t };\n\t }\n\n\t async __free__(index, weight) {\n\t await this.yieldLoop();\n\t this._running -= weight;\n\t this._done += weight;\n\t this.instance._drainAll(this.computeCapacity());\n\t return {\n\t running: this._running\n\t };\n\t }\n\n\t};\n\n\tvar LocalDatastore_1 = LocalDatastore;\n\n\tvar BottleneckError$3, States;\n\n\tBottleneckError$3 = BottleneckError_1;\n\n\tStates = class States {\n\t constructor(status1) {\n\t this.status = status1;\n\t this._jobs = {};\n\t this.counts = this.status.map(function() {\n\t return 0;\n\t });\n\t }\n\n\t next(id) {\n\t var current, next;\n\t current = this._jobs[id];\n\t next = current + 1;\n\t if ((current != null) && next < this.status.length) {\n\t this.counts[current]--;\n\t this.counts[next]++;\n\t return this._jobs[id]++;\n\t } else if (current != null) {\n\t this.counts[current]--;\n\t return delete this._jobs[id];\n\t }\n\t }\n\n\t start(id) {\n\t var initial;\n\t initial = 0;\n\t this._jobs[id] = initial;\n\t return this.counts[initial]++;\n\t }\n\n\t remove(id) {\n\t var current;\n\t current = this._jobs[id];\n\t if (current != null) {\n\t this.counts[current]--;\n\t delete this._jobs[id];\n\t }\n\t return current != null;\n\t }\n\n\t jobStatus(id) {\n\t var ref;\n\t return (ref = this.status[this._jobs[id]]) != null ? ref : null;\n\t }\n\n\t statusJobs(status) {\n\t var k, pos, ref, results, v;\n\t if (status != null) {\n\t pos = this.status.indexOf(status);\n\t if (pos < 0) {\n\t throw new BottleneckError$3(`status must be one of ${this.status.join(', ')}`);\n\t }\n\t ref = this._jobs;\n\t results = [];\n\t for (k in ref) {\n\t v = ref[k];\n\t if (v === pos) {\n\t results.push(k);\n\t }\n\t }\n\t return results;\n\t } else {\n\t return Object.keys(this._jobs);\n\t }\n\t }\n\n\t statusCounts() {\n\t return this.counts.reduce(((acc, v, i) => {\n\t acc[this.status[i]] = v;\n\t return acc;\n\t }), {});\n\t }\n\n\t};\n\n\tvar States_1 = States;\n\n\tvar DLList$2, Sync;\n\n\tDLList$2 = DLList_1;\n\n\tSync = class Sync {\n\t constructor(name, Promise) {\n\t this.schedule = this.schedule.bind(this);\n\t this.name = name;\n\t this.Promise = Promise;\n\t this._running = 0;\n\t this._queue = new DLList$2();\n\t }\n\n\t isEmpty() {\n\t return this._queue.length === 0;\n\t }\n\n\t async _tryToRun() {\n\t var args, cb, error, reject, resolve, returned, task;\n\t if ((this._running < 1) && this._queue.length > 0) {\n\t this._running++;\n\t ({task, args, resolve, reject} = this._queue.shift());\n\t cb = (await (async function() {\n\t try {\n\t returned = (await task(...args));\n\t return function() {\n\t return resolve(returned);\n\t };\n\t } catch (error1) {\n\t error = error1;\n\t return function() {\n\t return reject(error);\n\t };\n\t }\n\t })());\n\t this._running--;\n\t this._tryToRun();\n\t return cb();\n\t }\n\t }\n\n\t schedule(task, ...args) {\n\t var promise, reject, resolve;\n\t resolve = reject = null;\n\t promise = new this.Promise(function(_resolve, _reject) {\n\t resolve = _resolve;\n\t return reject = _reject;\n\t });\n\t this._queue.push({task, args, resolve, reject});\n\t this._tryToRun();\n\t return promise;\n\t }\n\n\t};\n\n\tvar Sync_1 = Sync;\n\n\tvar version = \"2.19.5\";\n\tvar version$1 = {\n\t\tversion: version\n\t};\n\n\tvar version$2 = /*#__PURE__*/Object.freeze({\n\t\tversion: version,\n\t\tdefault: version$1\n\t});\n\n\tvar require$$2 = () => console.log('You must import the full version of Bottleneck in order to use this feature.');\n\n\tvar require$$3 = () => console.log('You must import the full version of Bottleneck in order to use this feature.');\n\n\tvar require$$4 = () => console.log('You must import the full version of Bottleneck in order to use this feature.');\n\n\tvar Events$2, Group, IORedisConnection$1, RedisConnection$1, Scripts$1, parser$3;\n\n\tparser$3 = parser;\n\n\tEvents$2 = Events_1;\n\n\tRedisConnection$1 = require$$2;\n\n\tIORedisConnection$1 = require$$3;\n\n\tScripts$1 = require$$4;\n\n\tGroup = (function() {\n\t class Group {\n\t constructor(limiterOptions = {}) {\n\t this.deleteKey = this.deleteKey.bind(this);\n\t this.limiterOptions = limiterOptions;\n\t parser$3.load(this.limiterOptions, this.defaults, this);\n\t this.Events = new Events$2(this);\n\t this.instances = {};\n\t this.Bottleneck = Bottleneck_1;\n\t this._startAutoCleanup();\n\t this.sharedConnection = this.connection != null;\n\t if (this.connection == null) {\n\t if (this.limiterOptions.datastore === \"redis\") {\n\t this.connection = new RedisConnection$1(Object.assign({}, this.limiterOptions, {Events: this.Events}));\n\t } else if (this.limiterOptions.datastore === \"ioredis\") {\n\t this.connection = new IORedisConnection$1(Object.assign({}, this.limiterOptions, {Events: this.Events}));\n\t }\n\t }\n\t }\n\n\t key(key = \"\") {\n\t var ref;\n\t return (ref = this.instances[key]) != null ? ref : (() => {\n\t var limiter;\n\t limiter = this.instances[key] = new this.Bottleneck(Object.assign(this.limiterOptions, {\n\t id: `${this.id}-${key}`,\n\t timeout: this.timeout,\n\t connection: this.connection\n\t }));\n\t this.Events.trigger(\"created\", limiter, key);\n\t return limiter;\n\t })();\n\t }\n\n\t async deleteKey(key = \"\") {\n\t var deleted, instance;\n\t instance = this.instances[key];\n\t if (this.connection) {\n\t deleted = (await this.connection.__runCommand__(['del', ...Scripts$1.allKeys(`${this.id}-${key}`)]));\n\t }\n\t if (instance != null) {\n\t delete this.instances[key];\n\t await instance.disconnect();\n\t }\n\t return (instance != null) || deleted > 0;\n\t }\n\n\t limiters() {\n\t var k, ref, results, v;\n\t ref = this.instances;\n\t results = [];\n\t for (k in ref) {\n\t v = ref[k];\n\t results.push({\n\t key: k,\n\t limiter: v\n\t });\n\t }\n\t return results;\n\t }\n\n\t keys() {\n\t return Object.keys(this.instances);\n\t }\n\n\t async clusterKeys() {\n\t var cursor, end, found, i, k, keys, len, next, start;\n\t if (this.connection == null) {\n\t return this.Promise.resolve(this.keys());\n\t }\n\t keys = [];\n\t cursor = null;\n\t start = `b_${this.id}-`.length;\n\t end = \"_settings\".length;\n\t while (cursor !== 0) {\n\t [next, found] = (await this.connection.__runCommand__([\"scan\", cursor != null ? cursor : 0, \"match\", `b_${this.id}-*_settings`, \"count\", 10000]));\n\t cursor = ~~next;\n\t for (i = 0, len = found.length; i < len; i++) {\n\t k = found[i];\n\t keys.push(k.slice(start, -end));\n\t }\n\t }\n\t return keys;\n\t }\n\n\t _startAutoCleanup() {\n\t var base;\n\t clearInterval(this.interval);\n\t return typeof (base = (this.interval = setInterval(async() => {\n\t var e, k, ref, results, time, v;\n\t time = Date.now();\n\t ref = this.instances;\n\t results = [];\n\t for (k in ref) {\n\t v = ref[k];\n\t try {\n\t if ((await v._store.__groupCheck__(time))) {\n\t results.push(this.deleteKey(k));\n\t } else {\n\t results.push(void 0);\n\t }\n\t } catch (error) {\n\t e = error;\n\t results.push(v.Events.trigger(\"error\", e));\n\t }\n\t }\n\t return results;\n\t }, this.timeout / 2))).unref === \"function\" ? base.unref() : void 0;\n\t }\n\n\t updateSettings(options = {}) {\n\t parser$3.overwrite(options, this.defaults, this);\n\t parser$3.overwrite(options, options, this.limiterOptions);\n\t if (options.timeout != null) {\n\t return this._startAutoCleanup();\n\t }\n\t }\n\n\t disconnect(flush = true) {\n\t var ref;\n\t if (!this.sharedConnection) {\n\t return (ref = this.connection) != null ? ref.disconnect(flush) : void 0;\n\t }\n\t }\n\n\t }\n\t Group.prototype.defaults = {\n\t timeout: 1000 * 60 * 5,\n\t connection: null,\n\t Promise: Promise,\n\t id: \"group-key\"\n\t };\n\n\t return Group;\n\n\t}).call(commonjsGlobal);\n\n\tvar Group_1 = Group;\n\n\tvar Batcher, Events$3, parser$4;\n\n\tparser$4 = parser;\n\n\tEvents$3 = Events_1;\n\n\tBatcher = (function() {\n\t class Batcher {\n\t constructor(options = {}) {\n\t this.options = options;\n\t parser$4.load(this.options, this.defaults, this);\n\t this.Events = new Events$3(this);\n\t this._arr = [];\n\t this._resetPromise();\n\t this._lastFlush = Date.now();\n\t }\n\n\t _resetPromise() {\n\t return this._promise = new this.Promise((res, rej) => {\n\t return this._resolve = res;\n\t });\n\t }\n\n\t _flush() {\n\t clearTimeout(this._timeout);\n\t this._lastFlush = Date.now();\n\t this._resolve();\n\t this.Events.trigger(\"batch\", this._arr);\n\t this._arr = [];\n\t return this._resetPromise();\n\t }\n\n\t add(data) {\n\t var ret;\n\t this._arr.push(data);\n\t ret = this._promise;\n\t if (this._arr.length === this.maxSize) {\n\t this._flush();\n\t } else if ((this.maxTime != null) && this._arr.length === 1) {\n\t this._timeout = setTimeout(() => {\n\t return this._flush();\n\t }, this.maxTime);\n\t }\n\t return ret;\n\t }\n\n\t }\n\t Batcher.prototype.defaults = {\n\t maxTime: null,\n\t maxSize: null,\n\t Promise: Promise\n\t };\n\n\t return Batcher;\n\n\t}).call(commonjsGlobal);\n\n\tvar Batcher_1 = Batcher;\n\n\tvar require$$4$1 = () => console.log('You must import the full version of Bottleneck in order to use this feature.');\n\n\tvar require$$8 = getCjsExportFromNamespace(version$2);\n\n\tvar Bottleneck, DEFAULT_PRIORITY$1, Events$4, Job$1, LocalDatastore$1, NUM_PRIORITIES$1, Queues$1, RedisDatastore$1, States$1, Sync$1, parser$5,\n\t splice = [].splice;\n\n\tNUM_PRIORITIES$1 = 10;\n\n\tDEFAULT_PRIORITY$1 = 5;\n\n\tparser$5 = parser;\n\n\tQueues$1 = Queues_1;\n\n\tJob$1 = Job_1;\n\n\tLocalDatastore$1 = LocalDatastore_1;\n\n\tRedisDatastore$1 = require$$4$1;\n\n\tEvents$4 = Events_1;\n\n\tStates$1 = States_1;\n\n\tSync$1 = Sync_1;\n\n\tBottleneck = (function() {\n\t class Bottleneck {\n\t constructor(options = {}, ...invalid) {\n\t var storeInstanceOptions, storeOptions;\n\t this._addToQueue = this._addToQueue.bind(this);\n\t this._validateOptions(options, invalid);\n\t parser$5.load(options, this.instanceDefaults, this);\n\t this._queues = new Queues$1(NUM_PRIORITIES$1);\n\t this._scheduled = {};\n\t this._states = new States$1([\"RECEIVED\", \"QUEUED\", \"RUNNING\", \"EXECUTING\"].concat(this.trackDoneStatus ? [\"DONE\"] : []));\n\t this._limiter = null;\n\t this.Events = new Events$4(this);\n\t this._submitLock = new Sync$1(\"submit\", this.Promise);\n\t this._registerLock = new Sync$1(\"register\", this.Promise);\n\t storeOptions = parser$5.load(options, this.storeDefaults, {});\n\t this._store = (function() {\n\t if (this.datastore === \"redis\" || this.datastore === \"ioredis\" || (this.connection != null)) {\n\t storeInstanceOptions = parser$5.load(options, this.redisStoreDefaults, {});\n\t return new RedisDatastore$1(this, storeOptions, storeInstanceOptions);\n\t } else if (this.datastore === \"local\") {\n\t storeInstanceOptions = parser$5.load(options, this.localStoreDefaults, {});\n\t return new LocalDatastore$1(this, storeOptions, storeInstanceOptions);\n\t } else {\n\t throw new Bottleneck.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`);\n\t }\n\t }).call(this);\n\t this._queues.on(\"leftzero\", () => {\n\t var ref;\n\t return (ref = this._store.heartbeat) != null ? typeof ref.ref === \"function\" ? ref.ref() : void 0 : void 0;\n\t });\n\t this._queues.on(\"zero\", () => {\n\t var ref;\n\t return (ref = this._store.heartbeat) != null ? typeof ref.unref === \"function\" ? ref.unref() : void 0 : void 0;\n\t });\n\t }\n\n\t _validateOptions(options, invalid) {\n\t if (!((options != null) && typeof options === \"object\" && invalid.length === 0)) {\n\t throw new Bottleneck.prototype.BottleneckError(\"Bottleneck v2 takes a single object argument. Refer to https://github.com/SGrondin/bottleneck#upgrading-to-v2 if you're upgrading from Bottleneck v1.\");\n\t }\n\t }\n\n\t ready() {\n\t return this._store.ready;\n\t }\n\n\t clients() {\n\t return this._store.clients;\n\t }\n\n\t channel() {\n\t return `b_${this.id}`;\n\t }\n\n\t channel_client() {\n\t return `b_${this.id}_${this._store.clientId}`;\n\t }\n\n\t publish(message) {\n\t return this._store.__publish__(message);\n\t }\n\n\t disconnect(flush = true) {\n\t return this._store.__disconnect__(flush);\n\t }\n\n\t chain(_limiter) {\n\t this._limiter = _limiter;\n\t return this;\n\t }\n\n\t queued(priority) {\n\t return this._queues.queued(priority);\n\t }\n\n\t clusterQueued() {\n\t return this._store.__queued__();\n\t }\n\n\t empty() {\n\t return this.queued() === 0 && this._submitLock.isEmpty();\n\t }\n\n\t running() {\n\t return this._store.__running__();\n\t }\n\n\t done() {\n\t return this._store.__done__();\n\t }\n\n\t jobStatus(id) {\n\t return this._states.jobStatus(id);\n\t }\n\n\t jobs(status) {\n\t return this._states.statusJobs(status);\n\t }\n\n\t counts() {\n\t return this._states.statusCounts();\n\t }\n\n\t _randomIndex() {\n\t return Math.random().toString(36).slice(2);\n\t }\n\n\t check(weight = 1) {\n\t return this._store.__check__(weight);\n\t }\n\n\t _clearGlobalState(index) {\n\t if (this._scheduled[index] != null) {\n\t clearTimeout(this._scheduled[index].expiration);\n\t delete this._scheduled[index];\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t }\n\n\t async _free(index, job, options, eventInfo) {\n\t var e, running;\n\t try {\n\t ({running} = (await this._store.__free__(index, options.weight)));\n\t this.Events.trigger(\"debug\", `Freed ${options.id}`, eventInfo);\n\t if (running === 0 && this.empty()) {\n\t return this.Events.trigger(\"idle\");\n\t }\n\t } catch (error1) {\n\t e = error1;\n\t return this.Events.trigger(\"error\", e);\n\t }\n\t }\n\n\t _run(index, job, wait) {\n\t var clearGlobalState, free, run;\n\t job.doRun();\n\t clearGlobalState = this._clearGlobalState.bind(this, index);\n\t run = this._run.bind(this, index, job);\n\t free = this._free.bind(this, index, job);\n\t return this._scheduled[index] = {\n\t timeout: setTimeout(() => {\n\t return job.doExecute(this._limiter, clearGlobalState, run, free);\n\t }, wait),\n\t expiration: job.options.expiration != null ? setTimeout(function() {\n\t return job.doExpire(clearGlobalState, run, free);\n\t }, wait + job.options.expiration) : void 0,\n\t job: job\n\t };\n\t }\n\n\t _drainOne(capacity) {\n\t return this._registerLock.schedule(() => {\n\t var args, index, next, options, queue;\n\t if (this.queued() === 0) {\n\t return this.Promise.resolve(null);\n\t }\n\t queue = this._queues.getFirst();\n\t ({options, args} = next = queue.first());\n\t if ((capacity != null) && options.weight > capacity) {\n\t return this.Promise.resolve(null);\n\t }\n\t this.Events.trigger(\"debug\", `Draining ${options.id}`, {args, options});\n\t index = this._randomIndex();\n\t return this._store.__register__(index, options.weight, options.expiration).then(({success, wait, reservoir}) => {\n\t var empty;\n\t this.Events.trigger(\"debug\", `Drained ${options.id}`, {success, args, options});\n\t if (success) {\n\t queue.shift();\n\t empty = this.empty();\n\t if (empty) {\n\t this.Events.trigger(\"empty\");\n\t }\n\t if (reservoir === 0) {\n\t this.Events.trigger(\"depleted\", empty);\n\t }\n\t this._run(index, next, wait);\n\t return this.Promise.resolve(options.weight);\n\t } else {\n\t return this.Promise.resolve(null);\n\t }\n\t });\n\t });\n\t }\n\n\t _drainAll(capacity, total = 0) {\n\t return this._drainOne(capacity).then((drained) => {\n\t var newCapacity;\n\t if (drained != null) {\n\t newCapacity = capacity != null ? capacity - drained : capacity;\n\t return this._drainAll(newCapacity, total + drained);\n\t } else {\n\t return this.Promise.resolve(total);\n\t }\n\t }).catch((e) => {\n\t return this.Events.trigger(\"error\", e);\n\t });\n\t }\n\n\t _dropAllQueued(message) {\n\t return this._queues.shiftAll(function(job) {\n\t return job.doDrop({message});\n\t });\n\t }\n\n\t stop(options = {}) {\n\t var done, waitForExecuting;\n\t options = parser$5.load(options, this.stopDefaults);\n\t waitForExecuting = (at) => {\n\t var finished;\n\t finished = () => {\n\t var counts;\n\t counts = this._states.counts;\n\t return (counts[0] + counts[1] + counts[2] + counts[3]) === at;\n\t };\n\t return new this.Promise((resolve, reject) => {\n\t if (finished()) {\n\t return resolve();\n\t } else {\n\t return this.on(\"done\", () => {\n\t if (finished()) {\n\t this.removeAllListeners(\"done\");\n\t return resolve();\n\t }\n\t });\n\t }\n\t });\n\t };\n\t done = options.dropWaitingJobs ? (this._run = function(index, next) {\n\t return next.doDrop({\n\t message: options.dropErrorMessage\n\t });\n\t }, this._drainOne = () => {\n\t return this.Promise.resolve(null);\n\t }, this._registerLock.schedule(() => {\n\t return this._submitLock.schedule(() => {\n\t var k, ref, v;\n\t ref = this._scheduled;\n\t for (k in ref) {\n\t v = ref[k];\n\t if (this.jobStatus(v.job.options.id) === \"RUNNING\") {\n\t clearTimeout(v.timeout);\n\t clearTimeout(v.expiration);\n\t v.job.doDrop({\n\t message: options.dropErrorMessage\n\t });\n\t }\n\t }\n\t this._dropAllQueued(options.dropErrorMessage);\n\t return waitForExecuting(0);\n\t });\n\t })) : this.schedule({\n\t priority: NUM_PRIORITIES$1 - 1,\n\t weight: 0\n\t }, () => {\n\t return waitForExecuting(1);\n\t });\n\t this._receive = function(job) {\n\t return job._reject(new Bottleneck.prototype.BottleneckError(options.enqueueErrorMessage));\n\t };\n\t this.stop = () => {\n\t return this.Promise.reject(new Bottleneck.prototype.BottleneckError(\"stop() has already been called\"));\n\t };\n\t return done;\n\t }\n\n\t async _addToQueue(job) {\n\t var args, blocked, error, options, reachedHWM, shifted, strategy;\n\t ({args, options} = job);\n\t try {\n\t ({reachedHWM, blocked, strategy} = (await this._store.__submit__(this.queued(), options.weight)));\n\t } catch (error1) {\n\t error = error1;\n\t this.Events.trigger(\"debug\", `Could not queue ${options.id}`, {args, options, error});\n\t job.doDrop({error});\n\t return false;\n\t }\n\t if (blocked) {\n\t job.doDrop();\n\t return true;\n\t } else if (reachedHWM) {\n\t shifted = strategy === Bottleneck.prototype.strategy.LEAK ? this._queues.shiftLastFrom(options.priority) : strategy === Bottleneck.prototype.strategy.OVERFLOW_PRIORITY ? this._queues.shiftLastFrom(options.priority + 1) : strategy === Bottleneck.prototype.strategy.OVERFLOW ? job : void 0;\n\t if (shifted != null) {\n\t shifted.doDrop();\n\t }\n\t if ((shifted == null) || strategy === Bottleneck.prototype.strategy.OVERFLOW) {\n\t if (shifted == null) {\n\t job.doDrop();\n\t }\n\t return reachedHWM;\n\t }\n\t }\n\t job.doQueue(reachedHWM, blocked);\n\t this._queues.push(job);\n\t await this._drainAll();\n\t return reachedHWM;\n\t }\n\n\t _receive(job) {\n\t if (this._states.jobStatus(job.options.id) != null) {\n\t job._reject(new Bottleneck.prototype.BottleneckError(`A job with the same id already exists (id=${job.options.id})`));\n\t return false;\n\t } else {\n\t job.doReceive();\n\t return this._submitLock.schedule(this._addToQueue, job);\n\t }\n\t }\n\n\t submit(...args) {\n\t var cb, fn, job, options, ref, ref1, task;\n\t if (typeof args[0] === \"function\") {\n\t ref = args, [fn, ...args] = ref, [cb] = splice.call(args, -1);\n\t options = parser$5.load({}, this.jobDefaults);\n\t } else {\n\t ref1 = args, [options, fn, ...args] = ref1, [cb] = splice.call(args, -1);\n\t options = parser$5.load(options, this.jobDefaults);\n\t }\n\t task = (...args) => {\n\t return new this.Promise(function(resolve, reject) {\n\t return fn(...args, function(...args) {\n\t return (args[0] != null ? reject : resolve)(args);\n\t });\n\t });\n\t };\n\t job = new Job$1(task, args, options, this.jobDefaults, this.rejectOnDrop, this.Events, this._states, this.Promise);\n\t job.promise.then(function(args) {\n\t return typeof cb === \"function\" ? cb(...args) : void 0;\n\t }).catch(function(args) {\n\t if (Array.isArray(args)) {\n\t return typeof cb === \"function\" ? cb(...args) : void 0;\n\t } else {\n\t return typeof cb === \"function\" ? cb(args) : void 0;\n\t }\n\t });\n\t return this._receive(job);\n\t }\n\n\t schedule(...args) {\n\t var job, options, task;\n\t if (typeof args[0] === \"function\") {\n\t [task, ...args] = args;\n\t options = {};\n\t } else {\n\t [options, task, ...args] = args;\n\t }\n\t job = new Job$1(task, args, options, this.jobDefaults, this.rejectOnDrop, this.Events, this._states, this.Promise);\n\t this._receive(job);\n\t return job.promise;\n\t }\n\n\t wrap(fn) {\n\t var schedule, wrapped;\n\t schedule = this.schedule.bind(this);\n\t wrapped = function(...args) {\n\t return schedule(fn.bind(this), ...args);\n\t };\n\t wrapped.withOptions = function(options, ...args) {\n\t return schedule(options, fn, ...args);\n\t };\n\t return wrapped;\n\t }\n\n\t async updateSettings(options = {}) {\n\t await this._store.__updateSettings__(parser$5.overwrite(options, this.storeDefaults));\n\t parser$5.overwrite(options, this.instanceDefaults, this);\n\t return this;\n\t }\n\n\t currentReservoir() {\n\t return this._store.__currentReservoir__();\n\t }\n\n\t incrementReservoir(incr = 0) {\n\t return this._store.__incrementReservoir__(incr);\n\t }\n\n\t }\n\t Bottleneck.default = Bottleneck;\n\n\t Bottleneck.Events = Events$4;\n\n\t Bottleneck.version = Bottleneck.prototype.version = require$$8.version;\n\n\t Bottleneck.strategy = Bottleneck.prototype.strategy = {\n\t LEAK: 1,\n\t OVERFLOW: 2,\n\t OVERFLOW_PRIORITY: 4,\n\t BLOCK: 3\n\t };\n\n\t Bottleneck.BottleneckError = Bottleneck.prototype.BottleneckError = BottleneckError_1;\n\n\t Bottleneck.Group = Bottleneck.prototype.Group = Group_1;\n\n\t Bottleneck.RedisConnection = Bottleneck.prototype.RedisConnection = require$$2;\n\n\t Bottleneck.IORedisConnection = Bottleneck.prototype.IORedisConnection = require$$3;\n\n\t Bottleneck.Batcher = Bottleneck.prototype.Batcher = Batcher_1;\n\n\t Bottleneck.prototype.jobDefaults = {\n\t priority: DEFAULT_PRIORITY$1,\n\t weight: 1,\n\t expiration: null,\n\t id: \"\"\n\t };\n\n\t Bottleneck.prototype.storeDefaults = {\n\t maxConcurrent: null,\n\t minTime: 0,\n\t highWater: null,\n\t strategy: Bottleneck.prototype.strategy.LEAK,\n\t penalty: null,\n\t reservoir: null,\n\t reservoirRefreshInterval: null,\n\t reservoirRefreshAmount: null,\n\t reservoirIncreaseInterval: null,\n\t reservoirIncreaseAmount: null,\n\t reservoirIncreaseMaximum: null\n\t };\n\n\t Bottleneck.prototype.localStoreDefaults = {\n\t Promise: Promise,\n\t timeout: null,\n\t heartbeatInterval: 250\n\t };\n\n\t Bottleneck.prototype.redisStoreDefaults = {\n\t Promise: Promise,\n\t timeout: null,\n\t heartbeatInterval: 5000,\n\t clientTimeout: 10000,\n\t Redis: null,\n\t clientOptions: {},\n\t clusterNodes: null,\n\t clearDatastore: false,\n\t connection: null\n\t };\n\n\t Bottleneck.prototype.instanceDefaults = {\n\t datastore: \"local\",\n\t connection: null,\n\t id: \"\",\n\t rejectOnDrop: true,\n\t trackDoneStatus: false,\n\t Promise: Promise\n\t };\n\n\t Bottleneck.prototype.stopDefaults = {\n\t enqueueErrorMessage: \"This limiter has been stopped and cannot accept new jobs.\",\n\t dropWaitingJobs: true,\n\t dropErrorMessage: \"This limiter has been stopped.\"\n\t };\n\n\t return Bottleneck;\n\n\t}).call(commonjsGlobal);\n\n\tvar Bottleneck_1 = Bottleneck;\n\n\tvar lib = Bottleneck_1;\n\n\treturn lib;\n\n})));\n","// pkg/dist-src/version.js\nvar VERSION = \"0.0.0-development\";\n\n// pkg/dist-src/error-request.js\nfunction isRequestError(error) {\n return error.request !== void 0;\n}\nasync function errorRequest(state, octokit, error, options) {\n if (!isRequestError(error) || !error?.request.request) {\n throw error;\n }\n if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {\n const retries = options.request.retries != null ? options.request.retries : state.retries;\n const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);\n throw octokit.retry.retryRequest(error, retries, retryAfter);\n }\n throw error;\n}\n\n// pkg/dist-src/wrap-request.js\nimport Bottleneck, {} from \"bottleneck/light.js\";\nimport { RequestError } from \"@octokit/request-error\";\nasync function wrapRequest(state, octokit, request, options) {\n const limiter = new Bottleneck();\n limiter.on(\"failed\", function(error, info) {\n const maxRetries = ~~error.request.request?.retries;\n const after = ~~error.request.request?.retryAfter;\n options.request.retryCount = info.retryCount + 1;\n if (maxRetries > info.retryCount) {\n return after * state.retryAfterBaseValue;\n }\n });\n return limiter.schedule(\n requestWithGraphqlErrorHandling.bind(null, state, octokit, request),\n options\n );\n}\nasync function requestWithGraphqlErrorHandling(state, octokit, request, options) {\n const response = await request(options);\n if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test(\n response.data.errors[0].message\n )) {\n const error = new RequestError(response.data.errors[0].message, 500, {\n request: options,\n response\n });\n return errorRequest(state, octokit, error, options);\n }\n return response;\n}\n\n// pkg/dist-src/index.js\nfunction retry(octokit, octokitOptions) {\n const state = Object.assign(\n {\n enabled: true,\n retryAfterBaseValue: 1e3,\n doNotRetry: [400, 401, 403, 404, 410, 422, 451],\n retries: 3\n },\n octokitOptions.retry\n );\n const retryPlugin = {\n retry: {\n retryRequest: (error, retries, retryAfter) => {\n error.request.request = Object.assign({}, error.request.request, {\n retries,\n retryAfter\n });\n return error;\n }\n }\n };\n if (state.enabled) {\n octokit.hook.error(\"request\", errorRequest.bind(null, state, retryPlugin));\n octokit.hook.wrap(\"request\", wrapRequest.bind(null, state, retryPlugin));\n }\n return retryPlugin;\n}\nretry.VERSION = VERSION;\nexport {\n VERSION,\n retry\n};\n","module.exports = {\n /* The local file header */\n LOCHDR : 30, // LOC header size\n LOCSIG : 0x04034b50, // \"PK\\003\\004\"\n LOCVER : 4,\t// version needed to extract\n LOCFLG : 6, // general purpose bit flag\n LOCHOW : 8, // compression method\n LOCTIM : 10, // modification time (2 bytes time, 2 bytes date)\n LOCCRC : 14, // uncompressed file crc-32 value\n LOCSIZ : 18, // compressed size\n LOCLEN : 22, // uncompressed size\n LOCNAM : 26, // filename length\n LOCEXT : 28, // extra field length\n\n /* The Data descriptor */\n EXTSIG : 0x08074b50, // \"PK\\007\\008\"\n EXTHDR : 16, // EXT header size\n EXTCRC : 4, // uncompressed file crc-32 value\n EXTSIZ : 8, // compressed size\n EXTLEN : 12, // uncompressed size\n\n /* The central directory file header */\n CENHDR : 46, // CEN header size\n CENSIG : 0x02014b50, // \"PK\\001\\002\"\n CENVEM : 4, // version made by\n CENVER : 6, // version needed to extract\n CENFLG : 8, // encrypt, decrypt flags\n CENHOW : 10, // compression method\n CENTIM : 12, // modification time (2 bytes time, 2 bytes date)\n CENCRC : 16, // uncompressed file crc-32 value\n CENSIZ : 20, // compressed size\n CENLEN : 24, // uncompressed size\n CENNAM : 28, // filename length\n CENEXT : 30, // extra field length\n CENCOM : 32, // file comment length\n CENDSK : 34, // volume number start\n CENATT : 36, // internal file attributes\n CENATX : 38, // external file attributes (host system dependent)\n CENOFF : 42, // LOC header offset\n\n /* The entries in the end of central directory */\n ENDHDR : 22, // END header size\n ENDSIG : 0x06054b50, // \"PK\\005\\006\"\n ENDSUB : 8, // number of entries on this disk\n ENDTOT : 10, // total number of entries\n ENDSIZ : 12, // central directory size in bytes\n ENDOFF : 16, // offset of first CEN header\n ENDCOM : 20, // zip file comment length\n\n END64HDR : 20, // zip64 END header size\n END64SIG : 0x07064b50, // zip64 Locator signature, \"PK\\006\\007\"\n END64START : 4, // number of the disk with the start of the zip64\n END64OFF : 8, // relative offset of the zip64 end of central directory\n END64NUMDISKS : 16, // total number of disks\n\n ZIP64SIG : 0x06064b50, // zip64 signature, \"PK\\006\\006\"\n ZIP64HDR : 56, // zip64 record minimum size\n ZIP64LEAD : 12, // leading bytes at the start of the record, not counted by the value stored in ZIP64SIZE\n ZIP64SIZE : 4, // zip64 size of the central directory record\n ZIP64VEM : 12, // zip64 version made by\n ZIP64VER : 14, // zip64 version needed to extract\n ZIP64DSK : 16, // zip64 number of this disk\n ZIP64DSKDIR : 20, // number of the disk with the start of the record directory\n ZIP64SUB : 24, // number of entries on this disk\n ZIP64TOT : 32, // total number of entries\n ZIP64SIZB : 40, // zip64 central directory size in bytes\n ZIP64OFF : 48, // offset of start of central directory with respect to the starting disk number\n ZIP64EXTRA : 56, // extensible data sector\n\n /* Compression methods */\n STORED : 0, // no compression\n SHRUNK : 1, // shrunk\n REDUCED1 : 2, // reduced with compression factor 1\n REDUCED2 : 3, // reduced with compression factor 2\n REDUCED3 : 4, // reduced with compression factor 3\n REDUCED4 : 5, // reduced with compression factor 4\n IMPLODED : 6, // imploded\n // 7 reserved for Tokenizing compression algorithm\n DEFLATED : 8, // deflated\n ENHANCED_DEFLATED: 9, // enhanced deflated\n PKWARE : 10,// PKWare DCL imploded\n // 11 reserved by PKWARE\n BZIP2 : 12, // compressed using BZIP2\n // 13 reserved by PKWARE\n LZMA : 14, // LZMA\n // 15-17 reserved by PKWARE\n IBM_TERSE : 18, // compressed using IBM TERSE\n IBM_LZ77 : 19, // IBM LZ77 z\n AES_ENCRYPT : 99, // WinZIP AES encryption method\n\n /* General purpose bit flag */\n // values can obtained with expression 2**bitnr\n FLG_ENC : 1, // Bit 0: encrypted file\n FLG_COMP1 : 2, // Bit 1, compression option\n FLG_COMP2 : 4, // Bit 2, compression option\n FLG_DESC : 8, // Bit 3, data descriptor\n FLG_ENH : 16, // Bit 4, enhanced deflating\n FLG_PATCH : 32, // Bit 5, indicates that the file is compressed patched data.\n FLG_STR : 64, // Bit 6, strong encryption (patented)\n // Bits 7-10: Currently unused.\n FLG_EFS : 2048, // Bit 11: Language encoding flag (EFS)\n // Bit 12: Reserved by PKWARE for enhanced compression.\n // Bit 13: encrypted the Central Directory (patented).\n // Bits 14-15: Reserved by PKWARE.\n FLG_MSK : 4096, // mask header values\n\n /* Load type */\n FILE : 2,\n BUFFER : 1,\n NONE : 0,\n\n /* 4.5 Extensible data fields */\n EF_ID : 0,\n EF_SIZE : 2,\n\n /* Header IDs */\n ID_ZIP64 : 0x0001,\n ID_AVINFO : 0x0007,\n ID_PFS : 0x0008,\n ID_OS2 : 0x0009,\n ID_NTFS : 0x000a,\n ID_OPENVMS : 0x000c,\n ID_UNIX : 0x000d,\n ID_FORK : 0x000e,\n ID_PATCH : 0x000f,\n ID_X509_PKCS7 : 0x0014,\n ID_X509_CERTID_F : 0x0015,\n ID_X509_CERTID_C : 0x0016,\n ID_STRONGENC : 0x0017,\n ID_RECORD_MGT : 0x0018,\n ID_X509_PKCS7_RL : 0x0019,\n ID_IBM1 : 0x0065,\n ID_IBM2 : 0x0066,\n ID_POSZIP : 0x4690,\n\n EF_ZIP64_OR_32 : 0xffffffff,\n EF_ZIP64_OR_16 : 0xffff,\n EF_ZIP64_SUNCOMP : 0,\n EF_ZIP64_SCOMP : 8,\n EF_ZIP64_RHO : 16,\n EF_ZIP64_DSN : 24\n};\n","const errors = {\n /* Header error messages */\n INVALID_LOC: \"Invalid LOC header (bad signature)\",\n INVALID_CEN: \"Invalid CEN header (bad signature)\",\n INVALID_END: \"Invalid END header (bad signature)\",\n\n /* Descriptor */\n DESCRIPTOR_NOT_EXIST: \"No descriptor present\",\n DESCRIPTOR_UNKNOWN: \"Unknown descriptor format\",\n DESCRIPTOR_FAULTY: \"Descriptor data is malformed\",\n\n /* ZipEntry error messages*/\n NO_DATA: \"Nothing to decompress\",\n BAD_CRC: \"CRC32 checksum failed {0}\",\n FILE_IN_THE_WAY: \"There is a file in the way: {0}\",\n UNKNOWN_METHOD: \"Invalid/unsupported compression method\",\n\n /* Inflater error messages */\n AVAIL_DATA: \"inflate::Available inflate data did not terminate\",\n INVALID_DISTANCE: \"inflate::Invalid literal/length or distance code in fixed or dynamic block\",\n TO_MANY_CODES: \"inflate::Dynamic block code description: too many length or distance codes\",\n INVALID_REPEAT_LEN: \"inflate::Dynamic block code description: repeat more than specified lengths\",\n INVALID_REPEAT_FIRST: \"inflate::Dynamic block code description: repeat lengths with no first length\",\n INCOMPLETE_CODES: \"inflate::Dynamic block code description: code lengths codes incomplete\",\n INVALID_DYN_DISTANCE: \"inflate::Dynamic block code description: invalid distance code lengths\",\n INVALID_CODES_LEN: \"inflate::Dynamic block code description: invalid literal/length code lengths\",\n INVALID_STORE_BLOCK: \"inflate::Stored block length did not match one's complement\",\n INVALID_BLOCK_TYPE: \"inflate::Invalid block type (type == 3)\",\n\n /* ADM-ZIP error messages */\n CANT_EXTRACT_FILE: \"Could not extract the file\",\n CANT_OVERRIDE: \"Target file already exists\",\n DISK_ENTRY_TOO_LARGE: \"Number of disk entries is too large\",\n NO_ZIP: \"No zip file was loaded\",\n NO_ENTRY: \"Entry doesn't exist\",\n DIRECTORY_CONTENT_ERROR: \"A directory cannot have content\",\n FILE_NOT_FOUND: 'File not found: \"{0}\"',\n NOT_IMPLEMENTED: \"Not implemented\",\n INVALID_FILENAME: \"Invalid filename\",\n INVALID_FORMAT: \"Invalid or unsupported zip format. No END header found\",\n INVALID_PASS_PARAM: \"Incompatible password parameter\",\n WRONG_PASSWORD: \"Wrong Password\",\n\n /* ADM-ZIP */\n COMMENT_TOO_LONG: \"Comment is too long\", // Comment can be max 65535 bytes long (NOTE: some non-US characters may take more space)\n EXTRA_FIELD_PARSE_ERROR: \"Extra field parsing error\"\n};\n\n// template\nfunction E(message) {\n return function (...args) {\n if (args.length) { // Allow {0} .. {9} arguments in error message, based on argument number\n message = message.replace(/\\{(\\d)\\}/g, (_, n) => args[n] || '');\n }\n\n return new Error('ADM-ZIP: ' + message);\n };\n}\n\n// Init errors with template\nfor (const msg of Object.keys(errors)) {\n exports[msg] = E(errors[msg]);\n}\n","const fsystem = require(\"fs\");\nconst pth = require(\"path\");\nconst Constants = require(\"./constants\");\nconst Errors = require(\"./errors\");\nconst isWin = typeof process === \"object\" && \"win32\" === process.platform;\n\nconst is_Obj = (obj) => typeof obj === \"object\" && obj !== null;\n\n// generate CRC32 lookup table\nconst crcTable = new Uint32Array(256).map((t, c) => {\n for (let k = 0; k < 8; k++) {\n if ((c & 1) !== 0) {\n c = 0xedb88320 ^ (c >>> 1);\n } else {\n c >>>= 1;\n }\n }\n return c >>> 0;\n});\n\n// UTILS functions\n\nfunction Utils(opts) {\n this.sep = pth.sep;\n this.fs = fsystem;\n\n if (is_Obj(opts)) {\n // custom filesystem\n if (is_Obj(opts.fs) && typeof opts.fs.statSync === \"function\") {\n this.fs = opts.fs;\n }\n }\n}\n\nmodule.exports = Utils;\n\n// INSTANTIABLE functions\n\nUtils.prototype.makeDir = function (/*String*/ folder) {\n const self = this;\n\n // Sync - make directories tree\n function mkdirSync(/*String*/ fpath) {\n let resolvedPath = fpath.split(self.sep)[0];\n fpath.split(self.sep).forEach(function (name) {\n if (!name || name.substr(-1, 1) === \":\") return;\n resolvedPath += self.sep + name;\n var stat;\n try {\n stat = self.fs.statSync(resolvedPath);\n } catch (e) {\n if (e.message && e.message.startsWith('ENOENT')) {\n self.fs.mkdirSync(resolvedPath);\n } else {\n throw e;\n }\n }\n if (stat && stat.isFile()) throw Errors.FILE_IN_THE_WAY(`\"${resolvedPath}\"`);\n });\n }\n\n mkdirSync(folder);\n};\n\nUtils.prototype.writeFileTo = function (/*String*/ path, /*Buffer*/ content, /*Boolean*/ overwrite, /*Number*/ attr) {\n const self = this;\n if (self.fs.existsSync(path)) {\n if (!overwrite) return false; // cannot overwrite\n\n var stat = self.fs.statSync(path);\n if (stat.isDirectory()) {\n return false;\n }\n }\n var folder = pth.dirname(path);\n if (!self.fs.existsSync(folder)) {\n self.makeDir(folder);\n }\n\n var fd;\n try {\n fd = self.fs.openSync(path, \"w\", 0o666); // 0666\n } catch (e) {\n self.fs.chmodSync(path, 0o666);\n fd = self.fs.openSync(path, \"w\", 0o666);\n }\n if (fd) {\n try {\n self.fs.writeSync(fd, content, 0, content.length, 0);\n } finally {\n self.fs.closeSync(fd);\n }\n }\n self.fs.chmodSync(path, attr || 0o666);\n return true;\n};\n\nUtils.prototype.writeFileToAsync = function (/*String*/ path, /*Buffer*/ content, /*Boolean*/ overwrite, /*Number*/ attr, /*Function*/ callback) {\n if (typeof attr === \"function\") {\n callback = attr;\n attr = undefined;\n }\n\n const self = this;\n\n self.fs.exists(path, function (exist) {\n if (exist && !overwrite) return callback(false);\n\n self.fs.stat(path, function (err, stat) {\n if (exist && stat.isDirectory()) {\n return callback(false);\n }\n\n var folder = pth.dirname(path);\n self.fs.exists(folder, function (exists) {\n if (!exists) self.makeDir(folder);\n\n self.fs.open(path, \"w\", 0o666, function (err, fd) {\n if (err) {\n self.fs.chmod(path, 0o666, function () {\n self.fs.open(path, \"w\", 0o666, function (err, fd) {\n self.fs.write(fd, content, 0, content.length, 0, function () {\n self.fs.close(fd, function () {\n self.fs.chmod(path, attr || 0o666, function () {\n callback(true);\n });\n });\n });\n });\n });\n } else if (fd) {\n self.fs.write(fd, content, 0, content.length, 0, function () {\n self.fs.close(fd, function () {\n self.fs.chmod(path, attr || 0o666, function () {\n callback(true);\n });\n });\n });\n } else {\n self.fs.chmod(path, attr || 0o666, function () {\n callback(true);\n });\n }\n });\n });\n });\n });\n};\n\nUtils.prototype.findFiles = function (/*String*/ path) {\n const self = this;\n\n function findSync(/*String*/ dir, /*RegExp*/ pattern, /*Boolean*/ recursive) {\n if (typeof pattern === \"boolean\") {\n recursive = pattern;\n pattern = undefined;\n }\n let files = [];\n self.fs.readdirSync(dir).forEach(function (file) {\n const path = pth.join(dir, file);\n const stat = self.fs.statSync(path);\n\n if (!pattern || pattern.test(path)) {\n files.push(pth.normalize(path) + (stat.isDirectory() ? self.sep : \"\"));\n }\n\n if (stat.isDirectory() && recursive) files = files.concat(findSync(path, pattern, recursive));\n });\n return files;\n }\n\n return findSync(path, undefined, true);\n};\n\n/**\n * Callback for showing if everything was done.\n *\n * @callback filelistCallback\n * @param {Error} err - Error object\n * @param {string[]} list - was request fully completed\n */\n\n/**\n *\n * @param {string} dir\n * @param {filelistCallback} cb\n */\nUtils.prototype.findFilesAsync = function (dir, cb) {\n const self = this;\n let results = [];\n self.fs.readdir(dir, function (err, list) {\n if (err) return cb(err);\n let list_length = list.length;\n if (!list_length) return cb(null, results);\n list.forEach(function (file) {\n file = pth.join(dir, file);\n self.fs.stat(file, function (err, stat) {\n if (err) return cb(err);\n if (stat) {\n results.push(pth.normalize(file) + (stat.isDirectory() ? self.sep : \"\"));\n if (stat.isDirectory()) {\n self.findFilesAsync(file, function (err, res) {\n if (err) return cb(err);\n results = results.concat(res);\n if (!--list_length) cb(null, results);\n });\n } else {\n if (!--list_length) cb(null, results);\n }\n }\n });\n });\n });\n};\n\nUtils.prototype.getAttributes = function () {};\n\nUtils.prototype.setAttributes = function () {};\n\n// STATIC functions\n\n// crc32 single update (it is part of crc32)\nUtils.crc32update = function (crc, byte) {\n return crcTable[(crc ^ byte) & 0xff] ^ (crc >>> 8);\n};\n\nUtils.crc32 = function (buf) {\n if (typeof buf === \"string\") {\n buf = Buffer.from(buf, \"utf8\");\n }\n\n let len = buf.length;\n let crc = ~0;\n for (let off = 0; off < len; ) crc = Utils.crc32update(crc, buf[off++]);\n // xor and cast as uint32 number\n return ~crc >>> 0;\n};\n\nUtils.methodToString = function (/*Number*/ method) {\n switch (method) {\n case Constants.STORED:\n return \"STORED (\" + method + \")\";\n case Constants.DEFLATED:\n return \"DEFLATED (\" + method + \")\";\n default:\n return \"UNSUPPORTED (\" + method + \")\";\n }\n};\n\n/**\n * removes \"..\" style path elements\n * @param {string} path - fixable path\n * @returns string - fixed filepath\n */\nUtils.canonical = function (/*string*/ path) {\n if (!path) return \"\";\n // trick normalize think path is absolute\n const safeSuffix = pth.posix.normalize(\"/\" + path.split(\"\\\\\").join(\"/\"));\n return pth.join(\".\", safeSuffix);\n};\n\n/**\n * fix file names in achive\n * @param {string} path - fixable path\n * @returns string - fixed filepath\n */\n\nUtils.zipnamefix = function (path) {\n if (!path) return \"\";\n // trick normalize think path is absolute\n const safeSuffix = pth.posix.normalize(\"/\" + path.split(\"\\\\\").join(\"/\"));\n return pth.posix.join(\".\", safeSuffix);\n};\n\n/**\n *\n * @param {Array} arr\n * @param {function} callback\n * @returns\n */\nUtils.findLast = function (arr, callback) {\n if (!Array.isArray(arr)) throw new TypeError(\"arr is not array\");\n\n const len = arr.length >>> 0;\n for (let i = len - 1; i >= 0; i--) {\n if (callback(arr[i], i, arr)) {\n return arr[i];\n }\n }\n return void 0;\n};\n\n// make abolute paths taking prefix as root folder\nUtils.sanitize = function (/*string*/ prefix, /*string*/ name) {\n prefix = pth.resolve(pth.normalize(prefix));\n var parts = name.split(\"/\");\n for (var i = 0, l = parts.length; i < l; i++) {\n var path = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep)));\n if (path.indexOf(prefix) === 0) {\n return path;\n }\n }\n return pth.normalize(pth.join(prefix, pth.basename(name)));\n};\n\n// converts buffer, Uint8Array, string types to buffer\nUtils.toBuffer = function toBuffer(/*buffer, Uint8Array, string*/ input, /* function */ encoder) {\n if (Buffer.isBuffer(input)) {\n return input;\n } else if (input instanceof Uint8Array) {\n return Buffer.from(input);\n } else {\n // expect string all other values are invalid and return empty buffer\n return typeof input === \"string\" ? encoder(input) : Buffer.alloc(0);\n }\n};\n\nUtils.readBigUInt64LE = function (/*Buffer*/ buffer, /*int*/ index) {\n const lo = buffer.readUInt32LE(index);\n const hi = buffer.readUInt32LE(index + 4);\n return hi * 0x100000000 + lo;\n};\n\nUtils.fromDOS2Date = function (val) {\n return new Date(((val >> 25) & 0x7f) + 1980, Math.max(((val >> 21) & 0x0f) - 1, 0), Math.max((val >> 16) & 0x1f, 1), (val >> 11) & 0x1f, (val >> 5) & 0x3f, (val & 0x1f) << 1);\n};\n\nUtils.fromDate2DOS = function (val) {\n let date = 0;\n let time = 0;\n if (val.getFullYear() > 1979) {\n date = (((val.getFullYear() - 1980) & 0x7f) << 9) | ((val.getMonth() + 1) << 5) | val.getDate();\n time = (val.getHours() << 11) | (val.getMinutes() << 5) | (val.getSeconds() >> 1);\n }\n return (date << 16) | time;\n};\n\nUtils.isWin = isWin; // Do we have windows system\nUtils.crcTable = crcTable;\n","const pth = require(\"path\");\n\nmodule.exports = function (/*String*/ path, /*Utils object*/ { fs }) {\n var _path = path || \"\",\n _obj = newAttr(),\n _stat = null;\n\n function newAttr() {\n return {\n directory: false,\n readonly: false,\n hidden: false,\n executable: false,\n mtime: 0,\n atime: 0\n };\n }\n\n if (_path && fs.existsSync(_path)) {\n _stat = fs.statSync(_path);\n _obj.directory = _stat.isDirectory();\n _obj.mtime = _stat.mtime;\n _obj.atime = _stat.atime;\n _obj.executable = (0o111 & _stat.mode) !== 0; // file is executable who ever har right not just owner\n _obj.readonly = (0o200 & _stat.mode) === 0; // readonly if owner has no write right\n _obj.hidden = pth.basename(_path)[0] === \".\";\n } else {\n console.warn(\"Invalid path: \" + _path);\n }\n\n return {\n get directory() {\n return _obj.directory;\n },\n\n get readOnly() {\n return _obj.readonly;\n },\n\n get hidden() {\n return _obj.hidden;\n },\n\n get mtime() {\n return _obj.mtime;\n },\n\n get atime() {\n return _obj.atime;\n },\n\n get executable() {\n return _obj.executable;\n },\n\n decodeAttributes: function () {},\n\n encodeAttributes: function () {},\n\n toJSON: function () {\n return {\n path: _path,\n isDirectory: _obj.directory,\n isReadOnly: _obj.readonly,\n isHidden: _obj.hidden,\n isExecutable: _obj.executable,\n mTime: _obj.mtime,\n aTime: _obj.atime\n };\n },\n\n toString: function () {\n return JSON.stringify(this.toJSON(), null, \"\\t\");\n }\n };\n};\n","module.exports = {\n efs: true,\n encode: (data) => Buffer.from(data, \"utf8\"),\n decode: (data) => data.toString(\"utf8\")\n};\n","module.exports = require(\"./utils\");\nmodule.exports.Constants = require(\"./constants\");\nmodule.exports.Errors = require(\"./errors\");\nmodule.exports.FileAttr = require(\"./fattr\");\nmodule.exports.decoder = require(\"./decoder\");\n","var Utils = require(\"../util\"),\n Constants = Utils.Constants;\n\n/* The central directory file header */\nmodule.exports = function () {\n var _verMade = 20, // v2.0\n _version = 10, // v1.0\n _flags = 0,\n _method = 0,\n _time = 0,\n _crc = 0,\n _compressedSize = 0,\n _size = 0,\n _fnameLen = 0,\n _extraLen = 0,\n _comLen = 0,\n _diskStart = 0,\n _inattr = 0,\n _attr = 0,\n _offset = 0;\n\n _verMade |= Utils.isWin ? 0x0a00 : 0x0300;\n\n // Set EFS flag since filename and comment fields are all by default encoded using UTF-8.\n // Without it file names may be corrupted for other apps when file names use unicode chars\n _flags |= Constants.FLG_EFS;\n\n const _localHeader = {\n extraLen: 0\n };\n\n // casting\n const uint32 = (val) => Math.max(0, val) >>> 0;\n const uint16 = (val) => Math.max(0, val) & 0xffff;\n const uint8 = (val) => Math.max(0, val) & 0xff;\n\n _time = Utils.fromDate2DOS(new Date());\n\n return {\n get made() {\n return _verMade;\n },\n set made(val) {\n _verMade = val;\n },\n\n get version() {\n return _version;\n },\n set version(val) {\n _version = val;\n },\n\n get flags() {\n return _flags;\n },\n set flags(val) {\n _flags = val;\n },\n\n get flags_efs() {\n return (_flags & Constants.FLG_EFS) > 0;\n },\n set flags_efs(val) {\n if (val) {\n _flags |= Constants.FLG_EFS;\n } else {\n _flags &= ~Constants.FLG_EFS;\n }\n },\n\n get flags_desc() {\n return (_flags & Constants.FLG_DESC) > 0;\n },\n set flags_desc(val) {\n if (val) {\n _flags |= Constants.FLG_DESC;\n } else {\n _flags &= ~Constants.FLG_DESC;\n }\n },\n\n get method() {\n return _method;\n },\n set method(val) {\n switch (val) {\n case Constants.STORED:\n this.version = 10;\n case Constants.DEFLATED:\n default:\n this.version = 20;\n }\n _method = val;\n },\n\n get time() {\n return Utils.fromDOS2Date(this.timeval);\n },\n set time(val) {\n val = new Date(val);\n this.timeval = Utils.fromDate2DOS(val);\n },\n\n get timeval() {\n return _time;\n },\n set timeval(val) {\n _time = uint32(val);\n },\n\n get timeHighByte() {\n return uint8(_time >>> 8);\n },\n get crc() {\n return _crc;\n },\n set crc(val) {\n _crc = uint32(val);\n },\n\n get compressedSize() {\n return _compressedSize;\n },\n set compressedSize(val) {\n _compressedSize = uint32(val);\n },\n\n get size() {\n return _size;\n },\n set size(val) {\n _size = uint32(val);\n },\n\n get fileNameLength() {\n return _fnameLen;\n },\n set fileNameLength(val) {\n _fnameLen = val;\n },\n\n get extraLength() {\n return _extraLen;\n },\n set extraLength(val) {\n _extraLen = val;\n },\n\n get extraLocalLength() {\n return _localHeader.extraLen;\n },\n set extraLocalLength(val) {\n _localHeader.extraLen = val;\n },\n\n get commentLength() {\n return _comLen;\n },\n set commentLength(val) {\n _comLen = val;\n },\n\n get diskNumStart() {\n return _diskStart;\n },\n set diskNumStart(val) {\n _diskStart = uint32(val);\n },\n\n get inAttr() {\n return _inattr;\n },\n set inAttr(val) {\n _inattr = uint32(val);\n },\n\n get attr() {\n return _attr;\n },\n set attr(val) {\n _attr = uint32(val);\n },\n\n // get Unix file permissions\n get fileAttr() {\n return (_attr || 0) >> 16 & 0xfff;\n },\n\n get offset() {\n return _offset;\n },\n set offset(val) {\n _offset = uint32(val);\n },\n\n get encrypted() {\n return (_flags & Constants.FLG_ENC) === Constants.FLG_ENC;\n },\n\n get centralHeaderSize() {\n return Constants.CENHDR + _fnameLen + _extraLen + _comLen;\n },\n\n get realDataOffset() {\n return _offset + Constants.LOCHDR + _localHeader.fnameLen + _localHeader.extraLen;\n },\n\n get localHeader() {\n return _localHeader;\n },\n\n loadLocalHeaderFromBinary: function (/*Buffer*/ input) {\n var data = input.slice(_offset, _offset + Constants.LOCHDR);\n // 30 bytes and should start with \"PK\\003\\004\"\n if (data.readUInt32LE(0) !== Constants.LOCSIG) {\n throw Utils.Errors.INVALID_LOC();\n }\n\n // version needed to extract\n _localHeader.version = data.readUInt16LE(Constants.LOCVER);\n // general purpose bit flag\n _localHeader.flags = data.readUInt16LE(Constants.LOCFLG);\n // desc flag\n _localHeader.flags_desc = (_localHeader.flags & Constants.FLG_DESC) > 0;\n // compression method\n _localHeader.method = data.readUInt16LE(Constants.LOCHOW);\n // modification time (2 bytes time, 2 bytes date)\n _localHeader.time = data.readUInt32LE(Constants.LOCTIM);\n // uncompressed file crc-32 valu\n _localHeader.crc = data.readUInt32LE(Constants.LOCCRC);\n // compressed size\n _localHeader.compressedSize = data.readUInt32LE(Constants.LOCSIZ);\n // uncompressed size\n _localHeader.size = data.readUInt32LE(Constants.LOCLEN);\n // filename length\n _localHeader.fnameLen = data.readUInt16LE(Constants.LOCNAM);\n // extra field length\n _localHeader.extraLen = data.readUInt16LE(Constants.LOCEXT);\n\n // read extra data\n const extraStart = _offset + Constants.LOCHDR + _localHeader.fnameLen;\n const extraEnd = extraStart + _localHeader.extraLen;\n return input.slice(extraStart, extraEnd);\n },\n\n loadFromBinary: function (/*Buffer*/ data) {\n // data should be 46 bytes and start with \"PK 01 02\"\n if (data.length !== Constants.CENHDR || data.readUInt32LE(0) !== Constants.CENSIG) {\n throw Utils.Errors.INVALID_CEN();\n }\n // version made by\n _verMade = data.readUInt16LE(Constants.CENVEM);\n // version needed to extract\n _version = data.readUInt16LE(Constants.CENVER);\n // encrypt, decrypt flags\n _flags = data.readUInt16LE(Constants.CENFLG);\n // compression method\n _method = data.readUInt16LE(Constants.CENHOW);\n // modification time (2 bytes time, 2 bytes date)\n _time = data.readUInt32LE(Constants.CENTIM);\n // uncompressed file crc-32 value\n _crc = data.readUInt32LE(Constants.CENCRC);\n // compressed size\n _compressedSize = data.readUInt32LE(Constants.CENSIZ);\n // uncompressed size\n _size = data.readUInt32LE(Constants.CENLEN);\n // filename length\n _fnameLen = data.readUInt16LE(Constants.CENNAM);\n // extra field length\n _extraLen = data.readUInt16LE(Constants.CENEXT);\n // file comment length\n _comLen = data.readUInt16LE(Constants.CENCOM);\n // volume number start\n _diskStart = data.readUInt16LE(Constants.CENDSK);\n // internal file attributes\n _inattr = data.readUInt16LE(Constants.CENATT);\n // external file attributes\n _attr = data.readUInt32LE(Constants.CENATX);\n // LOC header offset\n _offset = data.readUInt32LE(Constants.CENOFF);\n },\n\n localHeaderToBinary: function () {\n // LOC header size (30 bytes)\n var data = Buffer.alloc(Constants.LOCHDR);\n // \"PK\\003\\004\"\n data.writeUInt32LE(Constants.LOCSIG, 0);\n // version needed to extract\n data.writeUInt16LE(_version, Constants.LOCVER);\n // general purpose bit flag\n data.writeUInt16LE(_flags, Constants.LOCFLG);\n // compression method\n data.writeUInt16LE(_method, Constants.LOCHOW);\n // modification time (2 bytes time, 2 bytes date)\n data.writeUInt32LE(_time, Constants.LOCTIM);\n // uncompressed file crc-32 value\n data.writeUInt32LE(_crc, Constants.LOCCRC);\n // compressed size\n data.writeUInt32LE(_compressedSize, Constants.LOCSIZ);\n // uncompressed size\n data.writeUInt32LE(_size, Constants.LOCLEN);\n // filename length\n data.writeUInt16LE(_fnameLen, Constants.LOCNAM);\n // extra field length\n data.writeUInt16LE(_localHeader.extraLen, Constants.LOCEXT);\n return data;\n },\n\n centralHeaderToBinary: function () {\n // CEN header size (46 bytes)\n var data = Buffer.alloc(Constants.CENHDR + _fnameLen + _extraLen + _comLen);\n // \"PK\\001\\002\"\n data.writeUInt32LE(Constants.CENSIG, 0);\n // version made by\n data.writeUInt16LE(_verMade, Constants.CENVEM);\n // version needed to extract\n data.writeUInt16LE(_version, Constants.CENVER);\n // encrypt, decrypt flags\n data.writeUInt16LE(_flags, Constants.CENFLG);\n // compression method\n data.writeUInt16LE(_method, Constants.CENHOW);\n // modification time (2 bytes time, 2 bytes date)\n data.writeUInt32LE(_time, Constants.CENTIM);\n // uncompressed file crc-32 value\n data.writeUInt32LE(_crc, Constants.CENCRC);\n // compressed size\n data.writeUInt32LE(_compressedSize, Constants.CENSIZ);\n // uncompressed size\n data.writeUInt32LE(_size, Constants.CENLEN);\n // filename length\n data.writeUInt16LE(_fnameLen, Constants.CENNAM);\n // extra field length\n data.writeUInt16LE(_extraLen, Constants.CENEXT);\n // file comment length\n data.writeUInt16LE(_comLen, Constants.CENCOM);\n // volume number start\n data.writeUInt16LE(_diskStart, Constants.CENDSK);\n // internal file attributes\n data.writeUInt16LE(_inattr, Constants.CENATT);\n // external file attributes\n data.writeUInt32LE(_attr, Constants.CENATX);\n // LOC header offset\n data.writeUInt32LE(_offset, Constants.CENOFF);\n return data;\n },\n\n toJSON: function () {\n const bytes = function (nr) {\n return nr + \" bytes\";\n };\n\n return {\n made: _verMade,\n version: _version,\n flags: _flags,\n method: Utils.methodToString(_method),\n time: this.time,\n crc: \"0x\" + _crc.toString(16).toUpperCase(),\n compressedSize: bytes(_compressedSize),\n size: bytes(_size),\n fileNameLength: bytes(_fnameLen),\n extraLength: bytes(_extraLen),\n commentLength: bytes(_comLen),\n diskNumStart: _diskStart,\n inAttr: _inattr,\n attr: _attr,\n offset: _offset,\n centralHeaderSize: bytes(Constants.CENHDR + _fnameLen + _extraLen + _comLen)\n };\n },\n\n toString: function () {\n return JSON.stringify(this.toJSON(), null, \"\\t\");\n }\n };\n};\n","var Utils = require(\"../util\"),\n Constants = Utils.Constants;\n\n/* The entries in the end of central directory */\nmodule.exports = function () {\n var _volumeEntries = 0,\n _totalEntries = 0,\n _size = 0,\n _offset = 0,\n _commentLength = 0;\n\n return {\n get diskEntries() {\n return _volumeEntries;\n },\n set diskEntries(/*Number*/ val) {\n _volumeEntries = _totalEntries = val;\n },\n\n get totalEntries() {\n return _totalEntries;\n },\n set totalEntries(/*Number*/ val) {\n _totalEntries = _volumeEntries = val;\n },\n\n get size() {\n return _size;\n },\n set size(/*Number*/ val) {\n _size = val;\n },\n\n get offset() {\n return _offset;\n },\n set offset(/*Number*/ val) {\n _offset = val;\n },\n\n get commentLength() {\n return _commentLength;\n },\n set commentLength(/*Number*/ val) {\n _commentLength = val;\n },\n\n get mainHeaderSize() {\n return Constants.ENDHDR + _commentLength;\n },\n\n loadFromBinary: function (/*Buffer*/ data) {\n // data should be 22 bytes and start with \"PK 05 06\"\n // or be 56+ bytes and start with \"PK 06 06\" for Zip64\n if (\n (data.length !== Constants.ENDHDR || data.readUInt32LE(0) !== Constants.ENDSIG) &&\n (data.length < Constants.ZIP64HDR || data.readUInt32LE(0) !== Constants.ZIP64SIG)\n ) {\n throw Utils.Errors.INVALID_END();\n }\n\n if (data.readUInt32LE(0) === Constants.ENDSIG) {\n // number of entries on this volume\n _volumeEntries = data.readUInt16LE(Constants.ENDSUB);\n // total number of entries\n _totalEntries = data.readUInt16LE(Constants.ENDTOT);\n // central directory size in bytes\n _size = data.readUInt32LE(Constants.ENDSIZ);\n // offset of first CEN header\n _offset = data.readUInt32LE(Constants.ENDOFF);\n // zip file comment length\n _commentLength = data.readUInt16LE(Constants.ENDCOM);\n } else {\n // number of entries on this volume\n _volumeEntries = Utils.readBigUInt64LE(data, Constants.ZIP64SUB);\n // total number of entries\n _totalEntries = Utils.readBigUInt64LE(data, Constants.ZIP64TOT);\n // central directory size in bytes\n _size = Utils.readBigUInt64LE(data, Constants.ZIP64SIZE);\n // offset of first CEN header\n _offset = Utils.readBigUInt64LE(data, Constants.ZIP64OFF);\n\n _commentLength = 0;\n }\n },\n\n toBinary: function () {\n var b = Buffer.alloc(Constants.ENDHDR + _commentLength);\n // \"PK 05 06\" signature\n b.writeUInt32LE(Constants.ENDSIG, 0);\n b.writeUInt32LE(0, 4);\n // number of entries on this volume\n b.writeUInt16LE(_volumeEntries, Constants.ENDSUB);\n // total number of entries\n b.writeUInt16LE(_totalEntries, Constants.ENDTOT);\n // central directory size in bytes\n b.writeUInt32LE(_size, Constants.ENDSIZ);\n // offset of first CEN header\n b.writeUInt32LE(_offset, Constants.ENDOFF);\n // zip file comment length\n b.writeUInt16LE(_commentLength, Constants.ENDCOM);\n // fill comment memory with spaces so no garbage is left there\n b.fill(\" \", Constants.ENDHDR);\n\n return b;\n },\n\n toJSON: function () {\n // creates 0x0000 style output\n const offset = function (nr, len) {\n let offs = nr.toString(16).toUpperCase();\n while (offs.length < len) offs = \"0\" + offs;\n return \"0x\" + offs;\n };\n\n return {\n diskEntries: _volumeEntries,\n totalEntries: _totalEntries,\n size: _size + \" bytes\",\n offset: offset(_offset, 4),\n commentLength: _commentLength\n };\n },\n\n toString: function () {\n return JSON.stringify(this.toJSON(), null, \"\\t\");\n }\n };\n};\n// Misspelled\n","exports.EntryHeader = require(\"./entryHeader\");\nexports.MainHeader = require(\"./mainHeader\");\n","module.exports = function (/*Buffer*/ inbuf) {\n var zlib = require(\"zlib\");\n\n var opts = { chunkSize: (parseInt(inbuf.length / 1024) + 1) * 1024 };\n\n return {\n deflate: function () {\n return zlib.deflateRawSync(inbuf, opts);\n },\n\n deflateAsync: function (/*Function*/ callback) {\n var tmp = zlib.createDeflateRaw(opts),\n parts = [],\n total = 0;\n tmp.on(\"data\", function (data) {\n parts.push(data);\n total += data.length;\n });\n tmp.on(\"end\", function () {\n var buf = Buffer.alloc(total),\n written = 0;\n buf.fill(0);\n for (var i = 0; i < parts.length; i++) {\n var part = parts[i];\n part.copy(buf, written);\n written += part.length;\n }\n callback && callback(buf);\n });\n tmp.end(inbuf);\n }\n };\n};\n","const version = +(process.versions ? process.versions.node : \"\").split(\".\")[0] || 0;\n\nmodule.exports = function (/*Buffer*/ inbuf, /*number*/ expectedLength) {\n var zlib = require(\"zlib\");\n const option = version >= 15 && expectedLength > 0 ? { maxOutputLength: expectedLength } : {};\n\n return {\n inflate: function () {\n return zlib.inflateRawSync(inbuf, option);\n },\n\n inflateAsync: function (/*Function*/ callback) {\n var tmp = zlib.createInflateRaw(option),\n parts = [],\n total = 0;\n tmp.on(\"data\", function (data) {\n parts.push(data);\n total += data.length;\n });\n tmp.on(\"end\", function () {\n var buf = Buffer.alloc(total),\n written = 0;\n buf.fill(0);\n for (var i = 0; i < parts.length; i++) {\n var part = parts[i];\n part.copy(buf, written);\n written += part.length;\n }\n callback && callback(buf);\n });\n tmp.end(inbuf);\n }\n };\n};\n","\"use strict\";\n\n// node crypt, we use it for generate salt\n// eslint-disable-next-line node/no-unsupported-features/node-builtins\nconst { randomFillSync } = require(\"crypto\");\nconst Errors = require(\"../util/errors\");\n\n// generate CRC32 lookup table\nconst crctable = new Uint32Array(256).map((t, crc) => {\n for (let j = 0; j < 8; j++) {\n if (0 !== (crc & 1)) {\n crc = (crc >>> 1) ^ 0xedb88320;\n } else {\n crc >>>= 1;\n }\n }\n return crc >>> 0;\n});\n\n// C-style uInt32 Multiply (discards higher bits, when JS multiply discards lower bits)\nconst uMul = (a, b) => Math.imul(a, b) >>> 0;\n\n// crc32 byte single update (actually same function is part of utils.crc32 function :) )\nconst crc32update = (pCrc32, bval) => {\n return crctable[(pCrc32 ^ bval) & 0xff] ^ (pCrc32 >>> 8);\n};\n\n// function for generating salt for encrytion header\nconst genSalt = () => {\n if (\"function\" === typeof randomFillSync) {\n return randomFillSync(Buffer.alloc(12));\n } else {\n // fallback if function is not defined\n return genSalt.node();\n }\n};\n\n// salt generation with node random function (mainly as fallback)\ngenSalt.node = () => {\n const salt = Buffer.alloc(12);\n const len = salt.length;\n for (let i = 0; i < len; i++) salt[i] = (Math.random() * 256) & 0xff;\n return salt;\n};\n\n// general config\nconst config = {\n genSalt\n};\n\n// Class Initkeys handles same basic ops with keys\nfunction Initkeys(pw) {\n const pass = Buffer.isBuffer(pw) ? pw : Buffer.from(pw);\n this.keys = new Uint32Array([0x12345678, 0x23456789, 0x34567890]);\n for (let i = 0; i < pass.length; i++) {\n this.updateKeys(pass[i]);\n }\n}\n\nInitkeys.prototype.updateKeys = function (byteValue) {\n const keys = this.keys;\n keys[0] = crc32update(keys[0], byteValue);\n keys[1] += keys[0] & 0xff;\n keys[1] = uMul(keys[1], 134775813) + 1;\n keys[2] = crc32update(keys[2], keys[1] >>> 24);\n return byteValue;\n};\n\nInitkeys.prototype.next = function () {\n const k = (this.keys[2] | 2) >>> 0; // key\n return (uMul(k, k ^ 1) >> 8) & 0xff; // decode\n};\n\nfunction make_decrypter(/*Buffer*/ pwd) {\n // 1. Stage initialize key\n const keys = new Initkeys(pwd);\n\n // return decrypter function\n return function (/*Buffer*/ data) {\n // result - we create new Buffer for results\n const result = Buffer.alloc(data.length);\n let pos = 0;\n // process input data\n for (let c of data) {\n //c ^= keys.next();\n //result[pos++] = c; // decode & Save Value\n result[pos++] = keys.updateKeys(c ^ keys.next()); // update keys with decoded byte\n }\n return result;\n };\n}\n\nfunction make_encrypter(/*Buffer*/ pwd) {\n // 1. Stage initialize key\n const keys = new Initkeys(pwd);\n\n // return encrypting function, result and pos is here so we dont have to merge buffers later\n return function (/*Buffer*/ data, /*Buffer*/ result, /* Number */ pos = 0) {\n // result - we create new Buffer for results\n if (!result) result = Buffer.alloc(data.length);\n // process input data\n for (let c of data) {\n const k = keys.next(); // save key byte\n result[pos++] = c ^ k; // save val\n keys.updateKeys(c); // update keys with decoded byte\n }\n return result;\n };\n}\n\nfunction decrypt(/*Buffer*/ data, /*Object*/ header, /*String, Buffer*/ pwd) {\n if (!data || !Buffer.isBuffer(data) || data.length < 12) {\n return Buffer.alloc(0);\n }\n\n // 1. We Initialize and generate decrypting function\n const decrypter = make_decrypter(pwd);\n\n // 2. decrypt salt what is always 12 bytes and is a part of file content\n const salt = decrypter(data.slice(0, 12));\n\n // if bit 3 (0x08) of the general-purpose flags field is set, check salt[11] with the high byte of the header time\n // 2 byte data block (as per Info-Zip spec), otherwise check with the high byte of the header entry\n const verifyByte = (header.flags & 0x8) === 0x8 ? header.timeHighByte : header.crc >>> 24;\n\n //3. does password meet expectations\n if (salt[11] !== verifyByte) {\n throw Errors.WRONG_PASSWORD();\n }\n\n // 4. decode content\n return decrypter(data.slice(12));\n}\n\n// lets add way to populate salt, NOT RECOMMENDED for production but maybe useful for testing general functionality\nfunction _salter(data) {\n if (Buffer.isBuffer(data) && data.length >= 12) {\n // be aware - currently salting buffer data is modified\n config.genSalt = function () {\n return data.slice(0, 12);\n };\n } else if (data === \"node\") {\n // test salt generation with node random function\n config.genSalt = genSalt.node;\n } else {\n // if value is not acceptable config gets reset.\n config.genSalt = genSalt;\n }\n}\n\nfunction encrypt(/*Buffer*/ data, /*Object*/ header, /*String, Buffer*/ pwd, /*Boolean*/ oldlike = false) {\n // 1. test data if data is not Buffer we make buffer from it\n if (data == null) data = Buffer.alloc(0);\n // if data is not buffer be make buffer from it\n if (!Buffer.isBuffer(data)) data = Buffer.from(data.toString());\n\n // 2. We Initialize and generate encrypting function\n const encrypter = make_encrypter(pwd);\n\n // 3. generate salt (12-bytes of random data)\n const salt = config.genSalt();\n salt[11] = (header.crc >>> 24) & 0xff;\n\n // old implementations (before PKZip 2.04g) used two byte check\n if (oldlike) salt[10] = (header.crc >>> 16) & 0xff;\n\n // 4. create output\n const result = Buffer.alloc(data.length + 12);\n encrypter(salt, result);\n\n // finally encode content\n return encrypter(data, result, 12);\n}\n\nmodule.exports = { decrypt, encrypt, _salter };\n","exports.Deflater = require(\"./deflater\");\nexports.Inflater = require(\"./inflater\");\nexports.ZipCrypto = require(\"./zipcrypto\");\n","var Utils = require(\"./util\"),\n Headers = require(\"./headers\"),\n Constants = Utils.Constants,\n Methods = require(\"./methods\");\n\nmodule.exports = function (/** object */ options, /*Buffer*/ input) {\n var _centralHeader = new Headers.EntryHeader(),\n _entryName = Buffer.alloc(0),\n _comment = Buffer.alloc(0),\n _isDirectory = false,\n uncompressedData = null,\n _extra = Buffer.alloc(0),\n _extralocal = Buffer.alloc(0),\n _efs = true;\n\n // assign options\n const opts = options;\n\n const decoder = typeof opts.decoder === \"object\" ? opts.decoder : Utils.decoder;\n _efs = decoder.hasOwnProperty(\"efs\") ? decoder.efs : false;\n\n function getCompressedDataFromZip() {\n //if (!input || !Buffer.isBuffer(input)) {\n if (!input || !(input instanceof Uint8Array)) {\n return Buffer.alloc(0);\n }\n _extralocal = _centralHeader.loadLocalHeaderFromBinary(input);\n return input.slice(_centralHeader.realDataOffset, _centralHeader.realDataOffset + _centralHeader.compressedSize);\n }\n\n function crc32OK(data) {\n // if bit 3 (0x08) of the general-purpose flags field is set, then the CRC-32 and file sizes are not known when the local header is written\n if (!_centralHeader.flags_desc && !_centralHeader.localHeader.flags_desc) {\n if (Utils.crc32(data) !== _centralHeader.localHeader.crc) {\n return false;\n }\n } else {\n const descriptor = {};\n const dataEndOffset = _centralHeader.realDataOffset + _centralHeader.compressedSize;\n // no descriptor after compressed data, instead new local header\n if (input.readUInt32LE(dataEndOffset) == Constants.LOCSIG || input.readUInt32LE(dataEndOffset) == Constants.CENSIG) {\n throw Utils.Errors.DESCRIPTOR_NOT_EXIST();\n }\n\n // get decriptor data\n if (input.readUInt32LE(dataEndOffset) == Constants.EXTSIG) {\n // descriptor with signature\n descriptor.crc = input.readUInt32LE(dataEndOffset + Constants.EXTCRC);\n descriptor.compressedSize = input.readUInt32LE(dataEndOffset + Constants.EXTSIZ);\n descriptor.size = input.readUInt32LE(dataEndOffset + Constants.EXTLEN);\n } else if (input.readUInt16LE(dataEndOffset + 12) === 0x4b50) {\n // descriptor without signature (we check is new header starting where we expect)\n descriptor.crc = input.readUInt32LE(dataEndOffset + Constants.EXTCRC - 4);\n descriptor.compressedSize = input.readUInt32LE(dataEndOffset + Constants.EXTSIZ - 4);\n descriptor.size = input.readUInt32LE(dataEndOffset + Constants.EXTLEN - 4);\n } else {\n throw Utils.Errors.DESCRIPTOR_UNKNOWN();\n }\n\n // check data integrity\n if (descriptor.compressedSize !== _centralHeader.compressedSize || descriptor.size !== _centralHeader.size || descriptor.crc !== _centralHeader.crc) {\n throw Utils.Errors.DESCRIPTOR_FAULTY();\n }\n if (Utils.crc32(data) !== descriptor.crc) {\n return false;\n }\n\n // @TODO: zip64 bit descriptor fields\n // if bit 3 is set and any value in local header \"zip64 Extended information\" extra field are set 0 (place holder)\n // then 64-bit descriptor format is used instead of 32-bit\n // central header - \"zip64 Extended information\" extra field should store real values and not place holders\n }\n return true;\n }\n\n function decompress(/*Boolean*/ async, /*Function*/ callback, /*String, Buffer*/ pass) {\n if (typeof callback === \"undefined\" && typeof async === \"string\") {\n pass = async;\n async = void 0;\n }\n if (_isDirectory) {\n if (async && callback) {\n callback(Buffer.alloc(0), Utils.Errors.DIRECTORY_CONTENT_ERROR()); //si added error.\n }\n return Buffer.alloc(0);\n }\n\n var compressedData = getCompressedDataFromZip();\n\n if (compressedData.length === 0) {\n // File is empty, nothing to decompress.\n if (async && callback) callback(compressedData);\n return compressedData;\n }\n\n if (_centralHeader.encrypted) {\n if (\"string\" !== typeof pass && !Buffer.isBuffer(pass)) {\n throw Utils.Errors.INVALID_PASS_PARAM();\n }\n compressedData = Methods.ZipCrypto.decrypt(compressedData, _centralHeader, pass);\n }\n\n var data = Buffer.alloc(_centralHeader.size);\n\n switch (_centralHeader.method) {\n case Utils.Constants.STORED:\n compressedData.copy(data);\n if (!crc32OK(data)) {\n if (async && callback) callback(data, Utils.Errors.BAD_CRC()); //si added error\n throw Utils.Errors.BAD_CRC();\n } else {\n //si added otherwise did not seem to return data.\n if (async && callback) callback(data);\n return data;\n }\n case Utils.Constants.DEFLATED:\n var inflater = new Methods.Inflater(compressedData, _centralHeader.size);\n if (!async) {\n const result = inflater.inflate(data);\n result.copy(data, 0);\n if (!crc32OK(data)) {\n throw Utils.Errors.BAD_CRC(`\"${decoder.decode(_entryName)}\"`);\n }\n return data;\n } else {\n inflater.inflateAsync(function (result) {\n result.copy(result, 0);\n if (callback) {\n if (!crc32OK(result)) {\n callback(result, Utils.Errors.BAD_CRC()); //si added error\n } else {\n callback(result);\n }\n }\n });\n }\n break;\n default:\n if (async && callback) callback(Buffer.alloc(0), Utils.Errors.UNKNOWN_METHOD());\n throw Utils.Errors.UNKNOWN_METHOD();\n }\n }\n\n function compress(/*Boolean*/ async, /*Function*/ callback) {\n if ((!uncompressedData || !uncompressedData.length) && Buffer.isBuffer(input)) {\n // no data set or the data wasn't changed to require recompression\n if (async && callback) callback(getCompressedDataFromZip());\n return getCompressedDataFromZip();\n }\n\n if (uncompressedData.length && !_isDirectory) {\n var compressedData;\n // Local file header\n switch (_centralHeader.method) {\n case Utils.Constants.STORED:\n _centralHeader.compressedSize = _centralHeader.size;\n\n compressedData = Buffer.alloc(uncompressedData.length);\n uncompressedData.copy(compressedData);\n\n if (async && callback) callback(compressedData);\n return compressedData;\n default:\n case Utils.Constants.DEFLATED:\n var deflater = new Methods.Deflater(uncompressedData);\n if (!async) {\n var deflated = deflater.deflate();\n _centralHeader.compressedSize = deflated.length;\n return deflated;\n } else {\n deflater.deflateAsync(function (data) {\n compressedData = Buffer.alloc(data.length);\n _centralHeader.compressedSize = data.length;\n data.copy(compressedData);\n callback && callback(compressedData);\n });\n }\n deflater = null;\n break;\n }\n } else if (async && callback) {\n callback(Buffer.alloc(0));\n } else {\n return Buffer.alloc(0);\n }\n }\n\n function readUInt64LE(buffer, offset) {\n return Utils.readBigUInt64LE(buffer, offset);\n }\n\n function parseExtra(data) {\n try {\n var offset = 0;\n var signature, size, part;\n while (offset + 4 < data.length) {\n signature = data.readUInt16LE(offset);\n offset += 2;\n size = data.readUInt16LE(offset);\n offset += 2;\n part = data.slice(offset, offset + size);\n offset += size;\n if (Constants.ID_ZIP64 === signature) {\n parseZip64ExtendedInformation(part);\n }\n }\n } catch (error) {\n throw Utils.Errors.EXTRA_FIELD_PARSE_ERROR();\n }\n }\n\n //Override header field values with values from the ZIP64 extra field\n function parseZip64ExtendedInformation(data) {\n var size, compressedSize, offset, diskNumStart;\n\n if (data.length >= Constants.EF_ZIP64_SCOMP) {\n size = readUInt64LE(data, Constants.EF_ZIP64_SUNCOMP);\n if (_centralHeader.size === Constants.EF_ZIP64_OR_32) {\n _centralHeader.size = size;\n }\n }\n if (data.length >= Constants.EF_ZIP64_RHO) {\n compressedSize = readUInt64LE(data, Constants.EF_ZIP64_SCOMP);\n if (_centralHeader.compressedSize === Constants.EF_ZIP64_OR_32) {\n _centralHeader.compressedSize = compressedSize;\n }\n }\n if (data.length >= Constants.EF_ZIP64_DSN) {\n offset = readUInt64LE(data, Constants.EF_ZIP64_RHO);\n if (_centralHeader.offset === Constants.EF_ZIP64_OR_32) {\n _centralHeader.offset = offset;\n }\n }\n if (data.length >= Constants.EF_ZIP64_DSN + 4) {\n diskNumStart = data.readUInt32LE(Constants.EF_ZIP64_DSN);\n if (_centralHeader.diskNumStart === Constants.EF_ZIP64_OR_16) {\n _centralHeader.diskNumStart = diskNumStart;\n }\n }\n }\n\n return {\n get entryName() {\n return decoder.decode(_entryName);\n },\n get rawEntryName() {\n return _entryName;\n },\n set entryName(val) {\n _entryName = Utils.toBuffer(val, decoder.encode);\n var lastChar = _entryName[_entryName.length - 1];\n _isDirectory = lastChar === 47 || lastChar === 92;\n _centralHeader.fileNameLength = _entryName.length;\n },\n\n get efs() {\n if (typeof _efs === \"function\") {\n return _efs(this.entryName);\n } else {\n return _efs;\n }\n },\n\n get extra() {\n return _extra;\n },\n set extra(val) {\n _extra = val;\n _centralHeader.extraLength = val.length;\n parseExtra(val);\n },\n\n get comment() {\n return decoder.decode(_comment);\n },\n set comment(val) {\n _comment = Utils.toBuffer(val, decoder.encode);\n _centralHeader.commentLength = _comment.length;\n if (_comment.length > 0xffff) throw Utils.Errors.COMMENT_TOO_LONG();\n },\n\n get name() {\n var n = decoder.decode(_entryName);\n return _isDirectory\n ? n\n .substr(n.length - 1)\n .split(\"/\")\n .pop()\n : n.split(\"/\").pop();\n },\n get isDirectory() {\n return _isDirectory;\n },\n\n getCompressedData: function () {\n return compress(false, null);\n },\n\n getCompressedDataAsync: function (/*Function*/ callback) {\n compress(true, callback);\n },\n\n setData: function (value) {\n uncompressedData = Utils.toBuffer(value, Utils.decoder.encode);\n if (!_isDirectory && uncompressedData.length) {\n _centralHeader.size = uncompressedData.length;\n _centralHeader.method = Utils.Constants.DEFLATED;\n _centralHeader.crc = Utils.crc32(value);\n _centralHeader.changed = true;\n } else {\n // folders and blank files should be stored\n _centralHeader.method = Utils.Constants.STORED;\n }\n },\n\n getData: function (pass) {\n if (_centralHeader.changed) {\n return uncompressedData;\n } else {\n return decompress(false, null, pass);\n }\n },\n\n getDataAsync: function (/*Function*/ callback, pass) {\n if (_centralHeader.changed) {\n callback(uncompressedData);\n } else {\n decompress(true, callback, pass);\n }\n },\n\n set attr(attr) {\n _centralHeader.attr = attr;\n },\n get attr() {\n return _centralHeader.attr;\n },\n\n set header(/*Buffer*/ data) {\n _centralHeader.loadFromBinary(data);\n },\n\n get header() {\n return _centralHeader;\n },\n\n packCentralHeader: function () {\n _centralHeader.flags_efs = this.efs;\n _centralHeader.extraLength = _extra.length;\n // 1. create header (buffer)\n var header = _centralHeader.centralHeaderToBinary();\n var addpos = Utils.Constants.CENHDR;\n // 2. add file name\n _entryName.copy(header, addpos);\n addpos += _entryName.length;\n // 3. add extra data\n _extra.copy(header, addpos);\n addpos += _centralHeader.extraLength;\n // 4. add file comment\n _comment.copy(header, addpos);\n return header;\n },\n\n packLocalHeader: function () {\n let addpos = 0;\n _centralHeader.flags_efs = this.efs;\n _centralHeader.extraLocalLength = _extralocal.length;\n // 1. construct local header Buffer\n const localHeaderBuf = _centralHeader.localHeaderToBinary();\n // 2. localHeader - crate header buffer\n const localHeader = Buffer.alloc(localHeaderBuf.length + _entryName.length + _centralHeader.extraLocalLength);\n // 2.1 add localheader\n localHeaderBuf.copy(localHeader, addpos);\n addpos += localHeaderBuf.length;\n // 2.2 add file name\n _entryName.copy(localHeader, addpos);\n addpos += _entryName.length;\n // 2.3 add extra field\n _extralocal.copy(localHeader, addpos);\n addpos += _extralocal.length;\n\n return localHeader;\n },\n\n toJSON: function () {\n const bytes = function (nr) {\n return \"<\" + ((nr && nr.length + \" bytes buffer\") || \"null\") + \">\";\n };\n\n return {\n entryName: this.entryName,\n name: this.name,\n comment: this.comment,\n isDirectory: this.isDirectory,\n header: _centralHeader.toJSON(),\n compressedData: bytes(input),\n data: bytes(uncompressedData)\n };\n },\n\n toString: function () {\n return JSON.stringify(this.toJSON(), null, \"\\t\");\n }\n };\n};\n","const ZipEntry = require(\"./zipEntry\");\nconst Headers = require(\"./headers\");\nconst Utils = require(\"./util\");\n\nmodule.exports = function (/*Buffer|null*/ inBuffer, /** object */ options) {\n var entryList = [],\n entryTable = {},\n _comment = Buffer.alloc(0),\n mainHeader = new Headers.MainHeader(),\n loadedEntries = false;\n var password = null;\n const temporary = new Set();\n\n // assign options\n const opts = options;\n\n const { noSort, decoder } = opts;\n\n if (inBuffer) {\n // is a memory buffer\n readMainHeader(opts.readEntries);\n } else {\n // none. is a new file\n loadedEntries = true;\n }\n\n function makeTemporaryFolders() {\n const foldersList = new Set();\n\n // Make list of all folders in file\n for (const elem of Object.keys(entryTable)) {\n const elements = elem.split(\"/\");\n elements.pop(); // filename\n if (!elements.length) continue; // no folders\n for (let i = 0; i < elements.length; i++) {\n const sub = elements.slice(0, i + 1).join(\"/\") + \"/\";\n foldersList.add(sub);\n }\n }\n\n // create missing folders as temporary\n for (const elem of foldersList) {\n if (!(elem in entryTable)) {\n const tempfolder = new ZipEntry(opts);\n tempfolder.entryName = elem;\n tempfolder.attr = 0x10;\n tempfolder.temporary = true;\n entryList.push(tempfolder);\n entryTable[tempfolder.entryName] = tempfolder;\n temporary.add(tempfolder);\n }\n }\n }\n\n function readEntries() {\n loadedEntries = true;\n entryTable = {};\n if (mainHeader.diskEntries > (inBuffer.length - mainHeader.offset) / Utils.Constants.CENHDR) {\n throw Utils.Errors.DISK_ENTRY_TOO_LARGE();\n }\n entryList = new Array(mainHeader.diskEntries); // total number of entries\n var index = mainHeader.offset; // offset of first CEN header\n for (var i = 0; i < entryList.length; i++) {\n var tmp = index,\n entry = new ZipEntry(opts, inBuffer);\n entry.header = inBuffer.slice(tmp, (tmp += Utils.Constants.CENHDR));\n\n entry.entryName = inBuffer.slice(tmp, (tmp += entry.header.fileNameLength));\n\n if (entry.header.extraLength) {\n entry.extra = inBuffer.slice(tmp, (tmp += entry.header.extraLength));\n }\n\n if (entry.header.commentLength) entry.comment = inBuffer.slice(tmp, tmp + entry.header.commentLength);\n\n index += entry.header.centralHeaderSize;\n\n entryList[i] = entry;\n entryTable[entry.entryName] = entry;\n }\n temporary.clear();\n makeTemporaryFolders();\n }\n\n function readMainHeader(/*Boolean*/ readNow) {\n var i = inBuffer.length - Utils.Constants.ENDHDR, // END header size\n max = Math.max(0, i - 0xffff), // 0xFFFF is the max zip file comment length\n n = max,\n endStart = inBuffer.length,\n endOffset = -1, // Start offset of the END header\n commentEnd = 0;\n\n // option to search header form entire file\n const trailingSpace = typeof opts.trailingSpace === \"boolean\" ? opts.trailingSpace : false;\n if (trailingSpace) max = 0;\n\n for (i; i >= n; i--) {\n if (inBuffer[i] !== 0x50) continue; // quick check that the byte is 'P'\n if (inBuffer.readUInt32LE(i) === Utils.Constants.ENDSIG) {\n // \"PK\\005\\006\"\n endOffset = i;\n commentEnd = i;\n endStart = i + Utils.Constants.ENDHDR;\n // We already found a regular signature, let's look just a bit further to check if there's any zip64 signature\n n = i - Utils.Constants.END64HDR;\n continue;\n }\n\n if (inBuffer.readUInt32LE(i) === Utils.Constants.END64SIG) {\n // Found a zip64 signature, let's continue reading the whole zip64 record\n n = max;\n continue;\n }\n\n if (inBuffer.readUInt32LE(i) === Utils.Constants.ZIP64SIG) {\n // Found the zip64 record, let's determine it's size\n endOffset = i;\n endStart = i + Utils.readBigUInt64LE(inBuffer, i + Utils.Constants.ZIP64SIZE) + Utils.Constants.ZIP64LEAD;\n break;\n }\n }\n\n if (endOffset == -1) throw Utils.Errors.INVALID_FORMAT();\n\n mainHeader.loadFromBinary(inBuffer.slice(endOffset, endStart));\n if (mainHeader.commentLength) {\n _comment = inBuffer.slice(commentEnd + Utils.Constants.ENDHDR);\n }\n if (readNow) readEntries();\n }\n\n function sortEntries() {\n if (entryList.length > 1 && !noSort) {\n entryList.sort((a, b) => a.entryName.toLowerCase().localeCompare(b.entryName.toLowerCase()));\n }\n }\n\n return {\n /**\n * Returns an array of ZipEntry objects existent in the current opened archive\n * @return Array\n */\n get entries() {\n if (!loadedEntries) {\n readEntries();\n }\n return entryList.filter((e) => !temporary.has(e));\n },\n\n /**\n * Archive comment\n * @return {String}\n */\n get comment() {\n return decoder.decode(_comment);\n },\n set comment(val) {\n _comment = Utils.toBuffer(val, decoder.encode);\n mainHeader.commentLength = _comment.length;\n },\n\n getEntryCount: function () {\n if (!loadedEntries) {\n return mainHeader.diskEntries;\n }\n\n return entryList.length;\n },\n\n forEach: function (callback) {\n this.entries.forEach(callback);\n },\n\n /**\n * Returns a reference to the entry with the given name or null if entry is inexistent\n *\n * @param entryName\n * @return ZipEntry\n */\n getEntry: function (/*String*/ entryName) {\n if (!loadedEntries) {\n readEntries();\n }\n return entryTable[entryName] || null;\n },\n\n /**\n * Adds the given entry to the entry list\n *\n * @param entry\n */\n setEntry: function (/*ZipEntry*/ entry) {\n if (!loadedEntries) {\n readEntries();\n }\n entryList.push(entry);\n entryTable[entry.entryName] = entry;\n mainHeader.totalEntries = entryList.length;\n },\n\n /**\n * Removes the file with the given name from the entry list.\n *\n * If the entry is a directory, then all nested files and directories will be removed\n * @param entryName\n * @returns {void}\n */\n deleteFile: function (/*String*/ entryName, withsubfolders = true) {\n if (!loadedEntries) {\n readEntries();\n }\n const entry = entryTable[entryName];\n const list = this.getEntryChildren(entry, withsubfolders).map((child) => child.entryName);\n\n list.forEach(this.deleteEntry);\n },\n\n /**\n * Removes the entry with the given name from the entry list.\n *\n * @param {string} entryName\n * @returns {void}\n */\n deleteEntry: function (/*String*/ entryName) {\n if (!loadedEntries) {\n readEntries();\n }\n const entry = entryTable[entryName];\n const index = entryList.indexOf(entry);\n if (index >= 0) {\n entryList.splice(index, 1);\n delete entryTable[entryName];\n mainHeader.totalEntries = entryList.length;\n }\n },\n\n /**\n * Iterates and returns all nested files and directories of the given entry\n *\n * @param entry\n * @return Array\n */\n getEntryChildren: function (/*ZipEntry*/ entry, subfolders = true) {\n if (!loadedEntries) {\n readEntries();\n }\n if (typeof entry === \"object\") {\n if (entry.isDirectory && subfolders) {\n const list = [];\n const name = entry.entryName;\n\n for (const zipEntry of entryList) {\n if (zipEntry.entryName.startsWith(name)) {\n list.push(zipEntry);\n }\n }\n return list;\n } else {\n return [entry];\n }\n }\n return [];\n },\n\n /**\n * How many child elements entry has\n *\n * @param {ZipEntry} entry\n * @return {integer}\n */\n getChildCount: function (entry) {\n if (entry && entry.isDirectory) {\n const list = this.getEntryChildren(entry);\n return list.includes(entry) ? list.length - 1 : list.length;\n }\n return 0;\n },\n\n /**\n * Returns the zip file\n *\n * @return Buffer\n */\n compressToBuffer: function () {\n if (!loadedEntries) {\n readEntries();\n }\n sortEntries();\n\n const dataBlock = [];\n const headerBlocks = [];\n let totalSize = 0;\n let dindex = 0;\n\n mainHeader.size = 0;\n mainHeader.offset = 0;\n let totalEntries = 0;\n\n for (const entry of this.entries) {\n // compress data and set local and entry header accordingly. Reason why is called first\n const compressedData = entry.getCompressedData();\n entry.header.offset = dindex;\n\n // 1. construct local header\n const localHeader = entry.packLocalHeader();\n\n // 2. offsets\n const dataLength = localHeader.length + compressedData.length;\n dindex += dataLength;\n\n // 3. store values in sequence\n dataBlock.push(localHeader);\n dataBlock.push(compressedData);\n\n // 4. construct central header\n const centralHeader = entry.packCentralHeader();\n headerBlocks.push(centralHeader);\n // 5. update main header\n mainHeader.size += centralHeader.length;\n totalSize += dataLength + centralHeader.length;\n totalEntries++;\n }\n\n totalSize += mainHeader.mainHeaderSize; // also includes zip file comment length\n // point to end of data and beginning of central directory first record\n mainHeader.offset = dindex;\n mainHeader.totalEntries = totalEntries;\n\n dindex = 0;\n const outBuffer = Buffer.alloc(totalSize);\n // write data blocks\n for (const content of dataBlock) {\n content.copy(outBuffer, dindex);\n dindex += content.length;\n }\n\n // write central directory entries\n for (const content of headerBlocks) {\n content.copy(outBuffer, dindex);\n dindex += content.length;\n }\n\n // write main header\n const mh = mainHeader.toBinary();\n if (_comment) {\n _comment.copy(mh, Utils.Constants.ENDHDR); // add zip file comment\n }\n mh.copy(outBuffer, dindex);\n\n // Since we update entry and main header offsets,\n // they are no longer valid and we have to reset content\n // (Issue 64)\n\n inBuffer = outBuffer;\n loadedEntries = false;\n\n return outBuffer;\n },\n\n toAsyncBuffer: function (/*Function*/ onSuccess, /*Function*/ onFail, /*Function*/ onItemStart, /*Function*/ onItemEnd) {\n try {\n if (!loadedEntries) {\n readEntries();\n }\n sortEntries();\n\n const dataBlock = [];\n const centralHeaders = [];\n let totalSize = 0;\n let dindex = 0;\n let totalEntries = 0;\n\n mainHeader.size = 0;\n mainHeader.offset = 0;\n\n const compress2Buffer = function (entryLists) {\n if (entryLists.length > 0) {\n const entry = entryLists.shift();\n const name = entry.entryName + entry.extra.toString();\n if (onItemStart) onItemStart(name);\n entry.getCompressedDataAsync(function (compressedData) {\n if (onItemEnd) onItemEnd(name);\n entry.header.offset = dindex;\n\n // 1. construct local header\n const localHeader = entry.packLocalHeader();\n\n // 2. offsets\n const dataLength = localHeader.length + compressedData.length;\n dindex += dataLength;\n\n // 3. store values in sequence\n dataBlock.push(localHeader);\n dataBlock.push(compressedData);\n\n // central header\n const centalHeader = entry.packCentralHeader();\n centralHeaders.push(centalHeader);\n mainHeader.size += centalHeader.length;\n totalSize += dataLength + centalHeader.length;\n totalEntries++;\n\n compress2Buffer(entryLists);\n });\n } else {\n totalSize += mainHeader.mainHeaderSize; // also includes zip file comment length\n // point to end of data and beginning of central directory first record\n mainHeader.offset = dindex;\n mainHeader.totalEntries = totalEntries;\n\n dindex = 0;\n const outBuffer = Buffer.alloc(totalSize);\n dataBlock.forEach(function (content) {\n content.copy(outBuffer, dindex); // write data blocks\n dindex += content.length;\n });\n centralHeaders.forEach(function (content) {\n content.copy(outBuffer, dindex); // write central directory entries\n dindex += content.length;\n });\n\n const mh = mainHeader.toBinary();\n if (_comment) {\n _comment.copy(mh, Utils.Constants.ENDHDR); // add zip file comment\n }\n\n mh.copy(outBuffer, dindex); // write main header\n\n // Since we update entry and main header offsets, they are no\n // longer valid and we have to reset content using our new buffer\n // (Issue 64)\n\n inBuffer = outBuffer;\n loadedEntries = false;\n\n onSuccess(outBuffer);\n }\n };\n\n compress2Buffer(Array.from(this.entries));\n } catch (e) {\n onFail(e);\n }\n }\n };\n};\n","const Utils = require(\"./util\");\nconst pth = require(\"path\");\nconst ZipEntry = require(\"./zipEntry\");\nconst ZipFile = require(\"./zipFile\");\n\nconst get_Bool = (...val) => Utils.findLast(val, (c) => typeof c === \"boolean\");\nconst get_Str = (...val) => Utils.findLast(val, (c) => typeof c === \"string\");\nconst get_Fun = (...val) => Utils.findLast(val, (c) => typeof c === \"function\");\n\nconst defaultOptions = {\n // option \"noSort\" : if true it disables files sorting\n noSort: false,\n // read entries during load (initial loading may be slower)\n readEntries: false,\n // default method is none\n method: Utils.Constants.NONE,\n // file system\n fs: null\n};\n\nmodule.exports = function (/**String*/ input, /** object */ options) {\n let inBuffer = null;\n\n // create object based default options, allowing them to be overwritten\n const opts = Object.assign(Object.create(null), defaultOptions);\n\n // test input variable\n if (input && \"object\" === typeof input) {\n // if value is not buffer we accept it to be object with options\n if (!(input instanceof Uint8Array)) {\n Object.assign(opts, input);\n input = opts.input ? opts.input : undefined;\n if (opts.input) delete opts.input;\n }\n\n // if input is buffer\n if (Buffer.isBuffer(input)) {\n inBuffer = input;\n opts.method = Utils.Constants.BUFFER;\n input = undefined;\n }\n }\n\n // assign options\n Object.assign(opts, options);\n\n // instanciate utils filesystem\n const filetools = new Utils(opts);\n\n if (typeof opts.decoder !== \"object\" || typeof opts.decoder.encode !== \"function\" || typeof opts.decoder.decode !== \"function\") {\n opts.decoder = Utils.decoder;\n }\n\n // if input is file name we retrieve its content\n if (input && \"string\" === typeof input) {\n // load zip file\n if (filetools.fs.existsSync(input)) {\n opts.method = Utils.Constants.FILE;\n opts.filename = input;\n inBuffer = filetools.fs.readFileSync(input);\n } else {\n throw Utils.Errors.INVALID_FILENAME();\n }\n }\n\n // create variable\n const _zip = new ZipFile(inBuffer, opts);\n\n const { canonical, sanitize, zipnamefix } = Utils;\n\n function getEntry(/**Object*/ entry) {\n if (entry && _zip) {\n var item;\n // If entry was given as a file name\n if (typeof entry === \"string\") item = _zip.getEntry(pth.posix.normalize(entry));\n // if entry was given as a ZipEntry object\n if (typeof entry === \"object\" && typeof entry.entryName !== \"undefined\" && typeof entry.header !== \"undefined\") item = _zip.getEntry(entry.entryName);\n\n if (item) {\n return item;\n }\n }\n return null;\n }\n\n function fixPath(zipPath) {\n const { join, normalize, sep } = pth.posix;\n // convert windows file separators and normalize\n return join(pth.isAbsolute(zipPath) ? \"/\": '.', normalize(sep + zipPath.split(\"\\\\\").join(sep) + sep));\n }\n\n function filenameFilter(filterfn) {\n if (filterfn instanceof RegExp) {\n // if filter is RegExp wrap it\n return (function (rx) {\n return function (filename) {\n return rx.test(filename);\n };\n })(filterfn);\n } else if (\"function\" !== typeof filterfn) {\n // if filter is not function we will replace it\n return () => true;\n }\n return filterfn;\n }\n\n // keep last character on folders\n const relativePath = (local, entry) => {\n let lastChar = entry.slice(-1);\n lastChar = lastChar === filetools.sep ? filetools.sep : \"\";\n return pth.relative(local, entry) + lastChar;\n };\n\n return {\n /**\n * Extracts the given entry from the archive and returns the content as a Buffer object\n * @param {ZipEntry|string} entry ZipEntry object or String with the full path of the entry\n * @param {Buffer|string} [pass] - password\n * @return Buffer or Null in case of error\n */\n readFile: function (entry, pass) {\n var item = getEntry(entry);\n return (item && item.getData(pass)) || null;\n },\n\n /**\n * Returns how many child elements has on entry (directories) on files it is always 0\n * @param {ZipEntry|string} entry ZipEntry object or String with the full path of the entry\n * @returns {integer}\n */\n childCount: function (entry) {\n const item = getEntry(entry);\n if (item) {\n return _zip.getChildCount(item);\n }\n },\n\n /**\n * Asynchronous readFile\n * @param {ZipEntry|string} entry ZipEntry object or String with the full path of the entry\n * @param {callback} callback\n *\n * @return Buffer or Null in case of error\n */\n readFileAsync: function (entry, callback) {\n var item = getEntry(entry);\n if (item) {\n item.getDataAsync(callback);\n } else {\n callback(null, \"getEntry failed for:\" + entry);\n }\n },\n\n /**\n * Extracts the given entry from the archive and returns the content as plain text in the given encoding\n * @param {ZipEntry|string} entry - ZipEntry object or String with the full path of the entry\n * @param {string} encoding - Optional. If no encoding is specified utf8 is used\n *\n * @return String\n */\n readAsText: function (entry, encoding) {\n var item = getEntry(entry);\n if (item) {\n var data = item.getData();\n if (data && data.length) {\n return data.toString(encoding || \"utf8\");\n }\n }\n return \"\";\n },\n\n /**\n * Asynchronous readAsText\n * @param {ZipEntry|string} entry ZipEntry object or String with the full path of the entry\n * @param {callback} callback\n * @param {string} [encoding] - Optional. If no encoding is specified utf8 is used\n *\n * @return String\n */\n readAsTextAsync: function (entry, callback, encoding) {\n var item = getEntry(entry);\n if (item) {\n item.getDataAsync(function (data, err) {\n if (err) {\n callback(data, err);\n return;\n }\n\n if (data && data.length) {\n callback(data.toString(encoding || \"utf8\"));\n } else {\n callback(\"\");\n }\n });\n } else {\n callback(\"\");\n }\n },\n\n /**\n * Remove the entry from the file or the entry and all it's nested directories and files if the given entry is a directory\n *\n * @param {ZipEntry|string} entry\n * @returns {void}\n */\n deleteFile: function (entry, withsubfolders = true) {\n // @TODO: test deleteFile\n var item = getEntry(entry);\n if (item) {\n _zip.deleteFile(item.entryName, withsubfolders);\n }\n },\n\n /**\n * Remove the entry from the file or directory without affecting any nested entries\n *\n * @param {ZipEntry|string} entry\n * @returns {void}\n */\n deleteEntry: function (entry) {\n // @TODO: test deleteEntry\n var item = getEntry(entry);\n if (item) {\n _zip.deleteEntry(item.entryName);\n }\n },\n\n /**\n * Adds a comment to the zip. The zip must be rewritten after adding the comment.\n *\n * @param {string} comment\n */\n addZipComment: function (comment) {\n // @TODO: test addZipComment\n _zip.comment = comment;\n },\n\n /**\n * Returns the zip comment\n *\n * @return String\n */\n getZipComment: function () {\n return _zip.comment || \"\";\n },\n\n /**\n * Adds a comment to a specified zipEntry. The zip must be rewritten after adding the comment\n * The comment cannot exceed 65535 characters in length\n *\n * @param {ZipEntry} entry\n * @param {string} comment\n */\n addZipEntryComment: function (entry, comment) {\n var item = getEntry(entry);\n if (item) {\n item.comment = comment;\n }\n },\n\n /**\n * Returns the comment of the specified entry\n *\n * @param {ZipEntry} entry\n * @return String\n */\n getZipEntryComment: function (entry) {\n var item = getEntry(entry);\n if (item) {\n return item.comment || \"\";\n }\n return \"\";\n },\n\n /**\n * Updates the content of an existing entry inside the archive. The zip must be rewritten after updating the content\n *\n * @param {ZipEntry} entry\n * @param {Buffer} content\n */\n updateFile: function (entry, content) {\n var item = getEntry(entry);\n if (item) {\n item.setData(content);\n }\n },\n\n /**\n * Adds a file from the disk to the archive\n *\n * @param {string} localPath File to add to zip\n * @param {string} [zipPath] Optional path inside the zip\n * @param {string} [zipName] Optional name for the file\n * @param {string} [comment] Optional file comment\n */\n addLocalFile: function (localPath, zipPath, zipName, comment) {\n if (filetools.fs.existsSync(localPath)) {\n // fix ZipPath\n zipPath = zipPath ? fixPath(zipPath) : \"\";\n\n // p - local file name\n const p = pth.win32.basename(pth.win32.normalize(localPath));\n\n // add file name into zippath\n zipPath += zipName ? zipName : p;\n\n // read file attributes\n const _attr = filetools.fs.statSync(localPath);\n\n // get file content\n const data = _attr.isFile() ? filetools.fs.readFileSync(localPath) : Buffer.alloc(0);\n\n // if folder\n if (_attr.isDirectory()) zipPath += filetools.sep;\n\n // add file into zip file\n this.addFile(zipPath, data, comment, _attr);\n } else {\n throw Utils.Errors.FILE_NOT_FOUND(localPath);\n }\n },\n\n /**\n * Callback for showing if everything was done.\n *\n * @callback doneCallback\n * @param {Error} err - Error object\n * @param {boolean} done - was request fully completed\n */\n\n /**\n * Adds a file from the disk to the archive\n *\n * @param {(object|string)} options - options object, if it is string it us used as localPath.\n * @param {string} options.localPath - Local path to the file.\n * @param {string} [options.comment] - Optional file comment.\n * @param {string} [options.zipPath] - Optional path inside the zip\n * @param {string} [options.zipName] - Optional name for the file\n * @param {doneCallback} callback - The callback that handles the response.\n */\n addLocalFileAsync: function (options, callback) {\n options = typeof options === \"object\" ? options : { localPath: options };\n const localPath = pth.resolve(options.localPath);\n const { comment } = options;\n let { zipPath, zipName } = options;\n const self = this;\n\n filetools.fs.stat(localPath, function (err, stats) {\n if (err) return callback(err, false);\n // fix ZipPath\n zipPath = zipPath ? fixPath(zipPath) : \"\";\n // p - local file name\n const p = pth.win32.basename(pth.win32.normalize(localPath));\n // add file name into zippath\n zipPath += zipName ? zipName : p;\n\n if (stats.isFile()) {\n filetools.fs.readFile(localPath, function (err, data) {\n if (err) return callback(err, false);\n self.addFile(zipPath, data, comment, stats);\n return setImmediate(callback, undefined, true);\n });\n } else if (stats.isDirectory()) {\n zipPath += filetools.sep;\n self.addFile(zipPath, Buffer.alloc(0), comment, stats);\n return setImmediate(callback, undefined, true);\n }\n });\n },\n\n /**\n * Adds a local directory and all its nested files and directories to the archive\n *\n * @param {string} localPath - local path to the folder\n * @param {string} [zipPath] - optional path inside zip\n * @param {(RegExp|function)} [filter] - optional RegExp or Function if files match will be included.\n */\n addLocalFolder: function (localPath, zipPath, filter) {\n // Prepare filter\n filter = filenameFilter(filter);\n\n // fix ZipPath\n zipPath = zipPath ? fixPath(zipPath) : \"\";\n\n // normalize the path first\n localPath = pth.normalize(localPath);\n\n if (filetools.fs.existsSync(localPath)) {\n const items = filetools.findFiles(localPath);\n const self = this;\n\n if (items.length) {\n for (const filepath of items) {\n const p = pth.join(zipPath, relativePath(localPath, filepath));\n if (filter(p)) {\n self.addLocalFile(filepath, pth.dirname(p));\n }\n }\n }\n } else {\n throw Utils.Errors.FILE_NOT_FOUND(localPath);\n }\n },\n\n /**\n * Asynchronous addLocalFolder\n * @param {string} localPath\n * @param {callback} callback\n * @param {string} [zipPath] optional path inside zip\n * @param {RegExp|function} [filter] optional RegExp or Function if files match will\n * be included.\n */\n addLocalFolderAsync: function (localPath, callback, zipPath, filter) {\n // Prepare filter\n filter = filenameFilter(filter);\n\n // fix ZipPath\n zipPath = zipPath ? fixPath(zipPath) : \"\";\n\n // normalize the path first\n localPath = pth.normalize(localPath);\n\n var self = this;\n filetools.fs.open(localPath, \"r\", function (err) {\n if (err && err.code === \"ENOENT\") {\n callback(undefined, Utils.Errors.FILE_NOT_FOUND(localPath));\n } else if (err) {\n callback(undefined, err);\n } else {\n var items = filetools.findFiles(localPath);\n var i = -1;\n\n var next = function () {\n i += 1;\n if (i < items.length) {\n var filepath = items[i];\n var p = relativePath(localPath, filepath).split(\"\\\\\").join(\"/\"); //windows fix\n p = p\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/[^\\x20-\\x7E]/g, \"\"); // accent fix\n if (filter(p)) {\n filetools.fs.stat(filepath, function (er0, stats) {\n if (er0) callback(undefined, er0);\n if (stats.isFile()) {\n filetools.fs.readFile(filepath, function (er1, data) {\n if (er1) {\n callback(undefined, er1);\n } else {\n self.addFile(zipPath + p, data, \"\", stats);\n next();\n }\n });\n } else {\n self.addFile(zipPath + p + \"/\", Buffer.alloc(0), \"\", stats);\n next();\n }\n });\n } else {\n process.nextTick(() => {\n next();\n });\n }\n } else {\n callback(true, undefined);\n }\n };\n\n next();\n }\n });\n },\n\n /**\n * Adds a local directory and all its nested files and directories to the archive\n *\n * @param {object | string} options - options object, if it is string it us used as localPath.\n * @param {string} options.localPath - Local path to the folder.\n * @param {string} [options.zipPath] - optional path inside zip.\n * @param {RegExp|function} [options.filter] - optional RegExp or Function if files match will be included.\n * @param {function|string} [options.namefix] - optional function to help fix filename\n * @param {doneCallback} callback - The callback that handles the response.\n *\n */\n addLocalFolderAsync2: function (options, callback) {\n const self = this;\n options = typeof options === \"object\" ? options : { localPath: options };\n localPath = pth.resolve(fixPath(options.localPath));\n let { zipPath, filter, namefix } = options;\n\n if (filter instanceof RegExp) {\n filter = (function (rx) {\n return function (filename) {\n return rx.test(filename);\n };\n })(filter);\n } else if (\"function\" !== typeof filter) {\n filter = function () {\n return true;\n };\n }\n\n // fix ZipPath\n zipPath = zipPath ? fixPath(zipPath) : \"\";\n\n // Check Namefix function\n if (namefix == \"latin1\") {\n namefix = (str) =>\n str\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/[^\\x20-\\x7E]/g, \"\"); // accent fix (latin1 characers only)\n }\n\n if (typeof namefix !== \"function\") namefix = (str) => str;\n\n // internal, create relative path + fix the name\n const relPathFix = (entry) => pth.join(zipPath, namefix(relativePath(localPath, entry)));\n const fileNameFix = (entry) => pth.win32.basename(pth.win32.normalize(namefix(entry)));\n\n filetools.fs.open(localPath, \"r\", function (err) {\n if (err && err.code === \"ENOENT\") {\n callback(undefined, Utils.Errors.FILE_NOT_FOUND(localPath));\n } else if (err) {\n callback(undefined, err);\n } else {\n filetools.findFilesAsync(localPath, function (err, fileEntries) {\n if (err) return callback(err);\n fileEntries = fileEntries.filter((dir) => filter(relPathFix(dir)));\n if (!fileEntries.length) callback(undefined, false);\n\n setImmediate(\n fileEntries.reverse().reduce(function (next, entry) {\n return function (err, done) {\n if (err || done === false) return setImmediate(next, err, false);\n\n self.addLocalFileAsync(\n {\n localPath: entry,\n zipPath: pth.dirname(relPathFix(entry)),\n zipName: fileNameFix(entry)\n },\n next\n );\n };\n }, callback)\n );\n });\n }\n });\n },\n\n /**\n * Adds a local directory and all its nested files and directories to the archive\n *\n * @param {string} localPath - path where files will be extracted\n * @param {object} props - optional properties\n * @param {string} [props.zipPath] - optional path inside zip\n * @param {RegExp|function} [props.filter] - optional RegExp or Function if files match will be included.\n * @param {function|string} [props.namefix] - optional function to help fix filename\n */\n addLocalFolderPromise: function (localPath, props) {\n return new Promise((resolve, reject) => {\n this.addLocalFolderAsync2(Object.assign({ localPath }, props), (err, done) => {\n if (err) reject(err);\n if (done) resolve(this);\n });\n });\n },\n\n /**\n * Allows you to create a entry (file or directory) in the zip file.\n * If you want to create a directory the entryName must end in / and a null buffer should be provided.\n * Comment and attributes are optional\n *\n * @param {string} entryName\n * @param {Buffer | string} content - file content as buffer or utf8 coded string\n * @param {string} [comment] - file comment\n * @param {number | object} [attr] - number as unix file permissions, object as filesystem Stats object\n */\n addFile: function (entryName, content, comment, attr) {\n entryName = zipnamefix(entryName);\n let entry = getEntry(entryName);\n const update = entry != null;\n\n // prepare new entry\n if (!update) {\n entry = new ZipEntry(opts);\n entry.entryName = entryName;\n }\n entry.comment = comment || \"\";\n\n const isStat = \"object\" === typeof attr && attr instanceof filetools.fs.Stats;\n\n // last modification time from file stats\n if (isStat) {\n entry.header.time = attr.mtime;\n }\n\n // Set file attribute\n var fileattr = entry.isDirectory ? 0x10 : 0; // (MS-DOS directory flag)\n\n // extended attributes field for Unix\n // set file type either S_IFDIR / S_IFREG\n let unix = entry.isDirectory ? 0x4000 : 0x8000;\n\n if (isStat) {\n // File attributes from file stats\n unix |= 0xfff & attr.mode;\n } else if (\"number\" === typeof attr) {\n // attr from given attr values\n unix |= 0xfff & attr;\n } else {\n // Default values:\n unix |= entry.isDirectory ? 0o755 : 0o644; // permissions (drwxr-xr-x) or (-r-wr--r--)\n }\n\n fileattr = (fileattr | (unix << 16)) >>> 0; // add attributes\n\n entry.attr = fileattr;\n\n entry.setData(content);\n if (!update) _zip.setEntry(entry);\n\n return entry;\n },\n\n /**\n * Returns an array of ZipEntry objects representing the files and folders inside the archive\n *\n * @param {string} [password]\n * @returns Array\n */\n getEntries: function (password) {\n _zip.password = password;\n return _zip ? _zip.entries : [];\n },\n\n /**\n * Returns a ZipEntry object representing the file or folder specified by ``name``.\n *\n * @param {string} name\n * @return ZipEntry\n */\n getEntry: function (/**String*/ name) {\n return getEntry(name);\n },\n\n getEntryCount: function () {\n return _zip.getEntryCount();\n },\n\n forEach: function (callback) {\n return _zip.forEach(callback);\n },\n\n /**\n * Extracts the given entry to the given targetPath\n * If the entry is a directory inside the archive, the entire directory and it's subdirectories will be extracted\n *\n * @param {string|ZipEntry} entry - ZipEntry object or String with the full path of the entry\n * @param {string} targetPath - Target folder where to write the file\n * @param {boolean} [maintainEntryPath=true] - If maintainEntryPath is true and the entry is inside a folder, the entry folder will be created in targetPath as well. Default is TRUE\n * @param {boolean} [overwrite=false] - If the file already exists at the target path, the file will be overwriten if this is true.\n * @param {boolean} [keepOriginalPermission=false] - The file will be set as the permission from the entry if this is true.\n * @param {string} [outFileName] - String If set will override the filename of the extracted file (Only works if the entry is a file)\n *\n * @return Boolean\n */\n extractEntryTo: function (entry, targetPath, maintainEntryPath, overwrite, keepOriginalPermission, outFileName) {\n overwrite = get_Bool(false, overwrite);\n keepOriginalPermission = get_Bool(false, keepOriginalPermission);\n maintainEntryPath = get_Bool(true, maintainEntryPath);\n outFileName = get_Str(keepOriginalPermission, outFileName);\n\n var item = getEntry(entry);\n if (!item) {\n throw Utils.Errors.NO_ENTRY();\n }\n\n var entryName = canonical(item.entryName);\n\n var target = sanitize(targetPath, outFileName && !item.isDirectory ? outFileName : maintainEntryPath ? entryName : pth.basename(entryName));\n\n if (item.isDirectory) {\n var children = _zip.getEntryChildren(item);\n children.forEach(function (child) {\n if (child.isDirectory) return;\n var content = child.getData();\n if (!content) {\n throw Utils.Errors.CANT_EXTRACT_FILE();\n }\n var name = canonical(child.entryName);\n var childName = sanitize(targetPath, maintainEntryPath ? name : pth.basename(name));\n // The reverse operation for attr depend on method addFile()\n const fileAttr = keepOriginalPermission ? child.header.fileAttr : undefined;\n filetools.writeFileTo(childName, content, overwrite, fileAttr);\n });\n return true;\n }\n\n var content = item.getData(_zip.password);\n if (!content) throw Utils.Errors.CANT_EXTRACT_FILE();\n\n if (filetools.fs.existsSync(target) && !overwrite) {\n throw Utils.Errors.CANT_OVERRIDE();\n }\n // The reverse operation for attr depend on method addFile()\n const fileAttr = keepOriginalPermission ? entry.header.fileAttr : undefined;\n filetools.writeFileTo(target, content, overwrite, fileAttr);\n\n return true;\n },\n\n /**\n * Test the archive\n * @param {string} [pass]\n */\n test: function (pass) {\n if (!_zip) {\n return false;\n }\n\n for (var entry in _zip.entries) {\n try {\n if (entry.isDirectory) {\n continue;\n }\n var content = _zip.entries[entry].getData(pass);\n if (!content) {\n return false;\n }\n } catch (err) {\n return false;\n }\n }\n return true;\n },\n\n /**\n * Extracts the entire archive to the given location\n *\n * @param {string} targetPath Target location\n * @param {boolean} [overwrite=false] If the file already exists at the target path, the file will be overwriten if this is true.\n * Default is FALSE\n * @param {boolean} [keepOriginalPermission=false] The file will be set as the permission from the entry if this is true.\n * Default is FALSE\n * @param {string|Buffer} [pass] password\n */\n extractAllTo: function (targetPath, overwrite, keepOriginalPermission, pass) {\n keepOriginalPermission = get_Bool(false, keepOriginalPermission);\n pass = get_Str(keepOriginalPermission, pass);\n overwrite = get_Bool(false, overwrite);\n if (!_zip) throw Utils.Errors.NO_ZIP();\n\n _zip.entries.forEach(function (entry) {\n var entryName = sanitize(targetPath, canonical(entry.entryName));\n if (entry.isDirectory) {\n filetools.makeDir(entryName);\n return;\n }\n var content = entry.getData(pass);\n if (!content) {\n throw Utils.Errors.CANT_EXTRACT_FILE();\n }\n // The reverse operation for attr depend on method addFile()\n const fileAttr = keepOriginalPermission ? entry.header.fileAttr : undefined;\n filetools.writeFileTo(entryName, content, overwrite, fileAttr);\n try {\n filetools.fs.utimesSync(entryName, entry.header.time, entry.header.time);\n } catch (err) {\n throw Utils.Errors.CANT_EXTRACT_FILE();\n }\n });\n },\n\n /**\n * Asynchronous extractAllTo\n *\n * @param {string} targetPath Target location\n * @param {boolean} [overwrite=false] If the file already exists at the target path, the file will be overwriten if this is true.\n * Default is FALSE\n * @param {boolean} [keepOriginalPermission=false] The file will be set as the permission from the entry if this is true.\n * Default is FALSE\n * @param {function} callback The callback will be executed when all entries are extracted successfully or any error is thrown.\n */\n extractAllToAsync: function (targetPath, overwrite, keepOriginalPermission, callback) {\n callback = get_Fun(overwrite, keepOriginalPermission, callback);\n keepOriginalPermission = get_Bool(false, keepOriginalPermission);\n overwrite = get_Bool(false, overwrite);\n if (!callback) {\n return new Promise((resolve, reject) => {\n this.extractAllToAsync(targetPath, overwrite, keepOriginalPermission, function (err) {\n if (err) {\n reject(err);\n } else {\n resolve(this);\n }\n });\n });\n }\n if (!_zip) {\n callback(Utils.Errors.NO_ZIP());\n return;\n }\n\n targetPath = pth.resolve(targetPath);\n // convert entryName to\n const getPath = (entry) => sanitize(targetPath, pth.normalize(canonical(entry.entryName)));\n const getError = (msg, file) => new Error(msg + ': \"' + file + '\"');\n\n // separate directories from files\n const dirEntries = [];\n const fileEntries = [];\n _zip.entries.forEach((e) => {\n if (e.isDirectory) {\n dirEntries.push(e);\n } else {\n fileEntries.push(e);\n }\n });\n\n // Create directory entries first synchronously\n // this prevents race condition and assures folders are there before writing files\n for (const entry of dirEntries) {\n const dirPath = getPath(entry);\n // The reverse operation for attr depend on method addFile()\n const dirAttr = keepOriginalPermission ? entry.header.fileAttr : undefined;\n try {\n filetools.makeDir(dirPath);\n if (dirAttr) filetools.fs.chmodSync(dirPath, dirAttr);\n // in unix timestamp will change if files are later added to folder, but still\n filetools.fs.utimesSync(dirPath, entry.header.time, entry.header.time);\n } catch (er) {\n callback(getError(\"Unable to create folder\", dirPath));\n }\n }\n\n fileEntries.reverse().reduce(function (next, entry) {\n return function (err) {\n if (err) {\n next(err);\n } else {\n const entryName = pth.normalize(canonical(entry.entryName));\n const filePath = sanitize(targetPath, entryName);\n entry.getDataAsync(function (content, err_1) {\n if (err_1) {\n next(err_1);\n } else if (!content) {\n next(Utils.Errors.CANT_EXTRACT_FILE());\n } else {\n // The reverse operation for attr depend on method addFile()\n const fileAttr = keepOriginalPermission ? entry.header.fileAttr : undefined;\n filetools.writeFileToAsync(filePath, content, overwrite, fileAttr, function (succ) {\n if (!succ) {\n next(getError(\"Unable to write file\", filePath));\n }\n filetools.fs.utimes(filePath, entry.header.time, entry.header.time, function (err_2) {\n if (err_2) {\n next(getError(\"Unable to set times\", filePath));\n } else {\n next();\n }\n });\n });\n }\n });\n }\n };\n }, callback)();\n },\n\n /**\n * Writes the newly created zip file to disk at the specified location or if a zip was opened and no ``targetFileName`` is provided, it will overwrite the opened zip\n *\n * @param {string} targetFileName\n * @param {function} callback\n */\n writeZip: function (targetFileName, callback) {\n if (arguments.length === 1) {\n if (typeof targetFileName === \"function\") {\n callback = targetFileName;\n targetFileName = \"\";\n }\n }\n\n if (!targetFileName && opts.filename) {\n targetFileName = opts.filename;\n }\n if (!targetFileName) return;\n\n var zipData = _zip.compressToBuffer();\n if (zipData) {\n var ok = filetools.writeFileTo(targetFileName, zipData, true);\n if (typeof callback === \"function\") callback(!ok ? new Error(\"failed\") : null, \"\");\n }\n },\n\n /**\n *\n * @param {string} targetFileName\n * @param {object} [props]\n * @param {boolean} [props.overwrite=true] If the file already exists at the target path, the file will be overwriten if this is true.\n * @param {boolean} [props.perm] The file will be set as the permission from the entry if this is true.\n\n * @returns {Promise}\n */\n writeZipPromise: function (/**String*/ targetFileName, /* object */ props) {\n const { overwrite, perm } = Object.assign({ overwrite: true }, props);\n\n return new Promise((resolve, reject) => {\n // find file name\n if (!targetFileName && opts.filename) targetFileName = opts.filename;\n if (!targetFileName) reject(\"ADM-ZIP: ZIP File Name Missing\");\n\n this.toBufferPromise().then((zipData) => {\n const ret = (done) => (done ? resolve(done) : reject(\"ADM-ZIP: Wasn't able to write zip file\"));\n filetools.writeFileToAsync(targetFileName, zipData, overwrite, perm, ret);\n }, reject);\n });\n },\n\n /**\n * @returns {Promise} A promise to the Buffer.\n */\n toBufferPromise: function () {\n return new Promise((resolve, reject) => {\n _zip.toAsyncBuffer(resolve, reject);\n });\n },\n\n /**\n * Returns the content of the entire zip file as a Buffer object\n *\n * @prop {function} [onSuccess]\n * @prop {function} [onFail]\n * @prop {function} [onItemStart]\n * @prop {function} [onItemEnd]\n * @returns {Buffer}\n */\n toBuffer: function (onSuccess, onFail, onItemStart, onItemEnd) {\n if (typeof onSuccess === \"function\") {\n _zip.toAsyncBuffer(onSuccess, onFail, onItemStart, onItemEnd);\n return null;\n }\n return _zip.compressToBuffer();\n }\n };\n};\n","{\n \"name\": \"@actions/artifact\",\n \"version\": \"6.2.1\",\n \"preview\": true,\n \"description\": \"Actions artifact lib\",\n \"keywords\": [\n \"github\",\n \"actions\",\n \"artifact\"\n ],\n \"homepage\": \"https://github.com/actions/toolkit/tree/main/packages/artifact\",\n \"license\": \"MIT\",\n \"type\": \"module\",\n \"main\": \"lib/artifact.js\",\n \"types\": \"lib/artifact.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./lib/artifact.d.ts\",\n \"import\": \"./lib/artifact.js\"\n }\n },\n \"directories\": {\n \"lib\": \"lib\",\n \"test\": \"__tests__\"\n },\n \"files\": [\n \"lib\",\n \"!.DS_Store\"\n ],\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/actions/toolkit.git\",\n \"directory\": \"packages/artifact\"\n },\n \"scripts\": {\n \"audit-moderate\": \"npm install && npm audit --json --audit-level=moderate > audit.json\",\n \"test\": \"cd ../../ && npm run test ./packages/artifact\",\n \"bootstrap\": \"cd ../../ && npm run bootstrap\",\n \"tsc-run\": \"tsc && cp src/internal/shared/package-version.cjs lib/internal/shared/\",\n \"tsc\": \"npm run bootstrap && npm run tsc-run\",\n \"gen:docs\": \"typedoc --plugin typedoc-plugin-markdown --out docs/generated src/artifact.ts --githubPages false --readme none\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/actions/toolkit/issues\"\n },\n \"dependencies\": {\n \"@actions/core\": \"^3.0.0\",\n \"@actions/github\": \"^9.0.0\",\n \"@actions/http-client\": \"^4.0.0\",\n \"@azure/storage-blob\": \"^12.30.0\",\n \"@octokit/core\": \"^7.0.6\",\n \"@octokit/plugin-request-log\": \"^6.0.0\",\n \"@octokit/plugin-retry\": \"^8.0.0\",\n \"@octokit/request\": \"^10.0.7\",\n \"@octokit/request-error\": \"^7.1.0\",\n \"@protobuf-ts/plugin\": \"^2.2.3-alpha.1\",\n \"@protobuf-ts/runtime\": \"^2.9.4\",\n \"archiver\": \"^7.0.1\",\n \"jwt-decode\": \"^4.0.0\",\n \"unzip-stream\": \"^0.3.1\"\n },\n \"devDependencies\": {\n \"@types/archiver\": \"^7.0.0\",\n \"@types/unzip-stream\": \"^0.3.4\",\n \"typedoc\": \"^0.28.16\",\n \"typedoc-plugin-markdown\": \"^4.9.0\",\n \"typescript\": \"^5.9.3\"\n },\n \"overrides\": {\n \"uri-js\": \"npm:uri-js-replace@^1.0.1\",\n \"node-fetch\": \"^3.3.2\"\n }\n}\n","// This file exists as a CommonJS module to read the version from package.json.\n// In an ESM package, using `require()` directly in .ts files requires disabling\n// ESLint rules and doesn't work reliably across all Node.js versions.\n// By keeping this as a .cjs file, we can use require() naturally and export\n// the version for the ESM modules to import.\nconst packageJson = require('../../../package.json')\nmodule.exports = { version: packageJson.version }\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n 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(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","'use strict';\n\nmodule.exports = (flag, argv = process.argv) => {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n};\n","'use strict';\nconst os = require('os');\nconst tty = require('tty');\nconst hasFlag = require('has-flag');\n\nconst {env} = process;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false') ||\n\thasFlag('color=never')) {\n\tforceColor = 0;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = 1;\n}\n\nif ('FORCE_COLOR' in env) {\n\tif (env.FORCE_COLOR === 'true') {\n\t\tforceColor = 1;\n\t} else if (env.FORCE_COLOR === 'false') {\n\t\tforceColor = 0;\n\t} else {\n\t\tforceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(haveStream, streamIsTTY) {\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream, stream && stream.isTTY);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: translateLevel(supportsColor(true, tty.isatty(1))),\n\tstderr: translateLevel(supportsColor(true, tty.isatty(2)))\n};\n","/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n","/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n",null,null,null,null,null,"// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @internal\n *\n * Holds the singleton instrumenter, to be shared across CJS and ESM imports.\n */\nexport const state = {\n instrumenterImplementation: undefined,\n};\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Holds the singleton operationRequestMap, to be shared across CJS and ESM imports.\n */\nexport const state = {\n operationRequestMap: new WeakMap(),\n};\n","'use strict';\n\nconst nameStartChar = ':A-Za-z_\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD';\nconst nameChar = nameStartChar + '\\\\-.\\\\d\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040';\nexport const nameRegexp = '[' + nameStartChar + '][' + nameChar + ']*';\nconst regexName = new RegExp('^' + nameRegexp + '$');\n\nexport function getAllMatches(string, regex) {\n const matches = [];\n let match = regex.exec(string);\n while (match) {\n const allmatches = [];\n allmatches.startIndex = regex.lastIndex - match[0].length;\n const len = match.length;\n for (let index = 0; index < len; index++) {\n allmatches.push(match[index]);\n }\n matches.push(allmatches);\n match = regex.exec(string);\n }\n return matches;\n}\n\nexport const isName = function (string) {\n const match = regexName.exec(string);\n return !(match === null || typeof match === 'undefined');\n}\n\nexport function isExist(v) {\n return typeof v !== 'undefined';\n}\n\nexport function isEmptyObject(obj) {\n return Object.keys(obj).length === 0;\n}\n\nexport function getValue(v) {\n if (exports.isExist(v)) {\n return v;\n } else {\n return '';\n }\n}\n\n/**\n * Dangerous property names that could lead to prototype pollution or security issues\n */\nexport const DANGEROUS_PROPERTY_NAMES = [\n // '__proto__',\n // 'constructor',\n // 'prototype',\n 'hasOwnProperty',\n 'toString',\n 'valueOf',\n '__defineGetter__',\n '__defineSetter__',\n '__lookupGetter__',\n '__lookupSetter__'\n];\n\nexport const criticalProperties = [\"__proto__\", \"constructor\", \"prototype\"];","'use strict';\n\nimport { getAllMatches, isName } from './util.js';\n\nconst defaultOptions = {\n allowBooleanAttributes: false, //A tag can have attributes without any value\n unpairedTags: []\n};\n\n//const tagsPattern = new RegExp(\"<\\\\/?([\\\\w:\\\\-_\\.]+)\\\\s*\\/?>\",\"g\");\nexport function validate(xmlData, options) {\n options = Object.assign({}, defaultOptions, options);\n\n //xmlData = xmlData.replace(/(\\r\\n|\\n|\\r)/gm,\"\");//make it single line\n //xmlData = xmlData.replace(/(^\\s*<\\?xml.*?\\?>)/g,\"\");//Remove XML starting tag\n //xmlData = xmlData.replace(/()/g,\"\");//Remove DOCTYPE\n const tags = [];\n let tagFound = false;\n\n //indicates that the root tag has been closed (aka. depth 0 has been reached)\n let reachedRoot = false;\n\n if (xmlData[0] === '\\ufeff') {\n // check for byte order mark (BOM)\n xmlData = xmlData.substr(1);\n }\n\n for (let i = 0; i < xmlData.length; i++) {\n\n if (xmlData[i] === '<' && xmlData[i + 1] === '?') {\n i += 2;\n i = readPI(xmlData, i);\n if (i.err) return i;\n } else if (xmlData[i] === '<') {\n //starting of tag\n //read until you reach to '>' avoiding any '>' in attribute value\n let tagStartPos = i;\n i++;\n\n if (xmlData[i] === '!') {\n i = readCommentAndCDATA(xmlData, i);\n continue;\n } else {\n let closingTag = false;\n if (xmlData[i] === '/') {\n //closing tag\n closingTag = true;\n i++;\n }\n //read tagname\n let tagName = '';\n for (; i < xmlData.length &&\n xmlData[i] !== '>' &&\n xmlData[i] !== ' ' &&\n xmlData[i] !== '\\t' &&\n xmlData[i] !== '\\n' &&\n xmlData[i] !== '\\r'; i++\n ) {\n tagName += xmlData[i];\n }\n tagName = tagName.trim();\n //console.log(tagName);\n\n if (tagName[tagName.length - 1] === '/') {\n //self closing tag without attributes\n tagName = tagName.substring(0, tagName.length - 1);\n //continue;\n i--;\n }\n if (!validateTagName(tagName)) {\n let msg;\n if (tagName.trim().length === 0) {\n msg = \"Invalid space after '<'.\";\n } else {\n msg = \"Tag '\" + tagName + \"' is an invalid name.\";\n }\n return getErrorObject('InvalidTag', msg, getLineNumberForPosition(xmlData, i));\n }\n\n const result = readAttributeStr(xmlData, i);\n if (result === false) {\n return getErrorObject('InvalidAttr', \"Attributes for '\" + tagName + \"' have open quote.\", getLineNumberForPosition(xmlData, i));\n }\n let attrStr = result.value;\n i = result.index;\n\n if (attrStr[attrStr.length - 1] === '/') {\n //self closing tag\n const attrStrStart = i - attrStr.length;\n attrStr = attrStr.substring(0, attrStr.length - 1);\n const isValid = validateAttributeString(attrStr, options);\n if (isValid === true) {\n tagFound = true;\n //continue; //text may presents after self closing tag\n } else {\n //the result from the nested function returns the position of the error within the attribute\n //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute\n //this gives us the absolute index in the entire xml, which we can use to find the line at last\n return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line));\n }\n } else if (closingTag) {\n if (!result.tagClosed) {\n return getErrorObject('InvalidTag', \"Closing tag '\" + tagName + \"' doesn't have proper closing.\", getLineNumberForPosition(xmlData, i));\n } else if (attrStr.trim().length > 0) {\n return getErrorObject('InvalidTag', \"Closing tag '\" + tagName + \"' can't have attributes or invalid starting.\", getLineNumberForPosition(xmlData, tagStartPos));\n } else if (tags.length === 0) {\n return getErrorObject('InvalidTag', \"Closing tag '\" + tagName + \"' has not been opened.\", getLineNumberForPosition(xmlData, tagStartPos));\n } else {\n const otg = tags.pop();\n if (tagName !== otg.tagName) {\n let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos);\n return getErrorObject('InvalidTag',\n \"Expected closing tag '\" + otg.tagName + \"' (opened in line \" + openPos.line + \", col \" + openPos.col + \") instead of closing tag '\" + tagName + \"'.\",\n getLineNumberForPosition(xmlData, tagStartPos));\n }\n\n //when there are no more tags, we reached the root level.\n if (tags.length == 0) {\n reachedRoot = true;\n }\n }\n } else {\n const isValid = validateAttributeString(attrStr, options);\n if (isValid !== true) {\n //the result from the nested function returns the position of the error within the attribute\n //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute\n //this gives us the absolute index in the entire xml, which we can use to find the line at last\n return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line));\n }\n\n //if the root level has been reached before ...\n if (reachedRoot === true) {\n return getErrorObject('InvalidXml', 'Multiple possible root nodes found.', getLineNumberForPosition(xmlData, i));\n } else if (options.unpairedTags.indexOf(tagName) !== -1) {\n //don't push into stack\n } else {\n tags.push({ tagName, tagStartPos });\n }\n tagFound = true;\n }\n\n //skip tag text value\n //It may include comments and CDATA value\n for (i++; i < xmlData.length; i++) {\n if (xmlData[i] === '<') {\n if (xmlData[i + 1] === '!') {\n //comment or CADATA\n i++;\n i = readCommentAndCDATA(xmlData, i);\n continue;\n } else if (xmlData[i + 1] === '?') {\n i = readPI(xmlData, ++i);\n if (i.err) return i;\n } else {\n break;\n }\n } else if (xmlData[i] === '&') {\n const afterAmp = validateAmpersand(xmlData, i);\n if (afterAmp == -1)\n return getErrorObject('InvalidChar', \"char '&' is not expected.\", getLineNumberForPosition(xmlData, i));\n i = afterAmp;\n } else {\n if (reachedRoot === true && !isWhiteSpace(xmlData[i])) {\n return getErrorObject('InvalidXml', \"Extra text at the end\", getLineNumberForPosition(xmlData, i));\n }\n }\n } //end of reading tag text value\n if (xmlData[i] === '<') {\n i--;\n }\n }\n } else {\n if (isWhiteSpace(xmlData[i])) {\n continue;\n }\n return getErrorObject('InvalidChar', \"char '\" + xmlData[i] + \"' is not expected.\", getLineNumberForPosition(xmlData, i));\n }\n }\n\n if (!tagFound) {\n return getErrorObject('InvalidXml', 'Start tag expected.', 1);\n } else if (tags.length == 1) {\n return getErrorObject('InvalidTag', \"Unclosed tag '\" + tags[0].tagName + \"'.\", getLineNumberForPosition(xmlData, tags[0].tagStartPos));\n } else if (tags.length > 0) {\n return getErrorObject('InvalidXml', \"Invalid '\" +\n JSON.stringify(tags.map(t => t.tagName), null, 4).replace(/\\r?\\n/g, '') +\n \"' found.\", { line: 1, col: 1 });\n }\n\n return true;\n};\n\nfunction isWhiteSpace(char) {\n return char === ' ' || char === '\\t' || char === '\\n' || char === '\\r';\n}\n/**\n * Read Processing insstructions and skip\n * @param {*} xmlData\n * @param {*} i\n */\nfunction readPI(xmlData, i) {\n const start = i;\n for (; i < xmlData.length; i++) {\n if (xmlData[i] == '?' || xmlData[i] == ' ') {\n //tagname\n const tagname = xmlData.substr(start, i - start);\n if (i > 5 && tagname === 'xml') {\n return getErrorObject('InvalidXml', 'XML declaration allowed only at the start of the document.', getLineNumberForPosition(xmlData, i));\n } else if (xmlData[i] == '?' && xmlData[i + 1] == '>') {\n //check if valid attribut string\n i++;\n break;\n } else {\n continue;\n }\n }\n }\n return i;\n}\n\nfunction readCommentAndCDATA(xmlData, i) {\n if (xmlData.length > i + 5 && xmlData[i + 1] === '-' && xmlData[i + 2] === '-') {\n //comment\n for (i += 3; i < xmlData.length; i++) {\n if (xmlData[i] === '-' && xmlData[i + 1] === '-' && xmlData[i + 2] === '>') {\n i += 2;\n break;\n }\n }\n } else if (\n xmlData.length > i + 8 &&\n xmlData[i + 1] === 'D' &&\n xmlData[i + 2] === 'O' &&\n xmlData[i + 3] === 'C' &&\n xmlData[i + 4] === 'T' &&\n xmlData[i + 5] === 'Y' &&\n xmlData[i + 6] === 'P' &&\n xmlData[i + 7] === 'E'\n ) {\n let angleBracketsCount = 1;\n for (i += 8; i < xmlData.length; i++) {\n if (xmlData[i] === '<') {\n angleBracketsCount++;\n } else if (xmlData[i] === '>') {\n angleBracketsCount--;\n if (angleBracketsCount === 0) {\n break;\n }\n }\n }\n } else if (\n xmlData.length > i + 9 &&\n xmlData[i + 1] === '[' &&\n xmlData[i + 2] === 'C' &&\n xmlData[i + 3] === 'D' &&\n xmlData[i + 4] === 'A' &&\n xmlData[i + 5] === 'T' &&\n xmlData[i + 6] === 'A' &&\n xmlData[i + 7] === '['\n ) {\n for (i += 8; i < xmlData.length; i++) {\n if (xmlData[i] === ']' && xmlData[i + 1] === ']' && xmlData[i + 2] === '>') {\n i += 2;\n break;\n }\n }\n }\n\n return i;\n}\n\nconst doubleQuote = '\"';\nconst singleQuote = \"'\";\n\n/**\n * Keep reading xmlData until '<' is found outside the attribute value.\n * @param {string} xmlData\n * @param {number} i\n */\nfunction readAttributeStr(xmlData, i) {\n let attrStr = '';\n let startChar = '';\n let tagClosed = false;\n for (; i < xmlData.length; i++) {\n if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) {\n if (startChar === '') {\n startChar = xmlData[i];\n } else if (startChar !== xmlData[i]) {\n //if vaue is enclosed with double quote then single quotes are allowed inside the value and vice versa\n } else {\n startChar = '';\n }\n } else if (xmlData[i] === '>') {\n if (startChar === '') {\n tagClosed = true;\n break;\n }\n }\n attrStr += xmlData[i];\n }\n if (startChar !== '') {\n return false;\n }\n\n return {\n value: attrStr,\n index: i,\n tagClosed: tagClosed\n };\n}\n\n/**\n * Select all the attributes whether valid or invalid.\n */\nconst validAttrStrRegxp = new RegExp('(\\\\s*)([^\\\\s=]+)(\\\\s*=)?(\\\\s*([\\'\"])(([\\\\s\\\\S])*?)\\\\5)?', 'g');\n\n//attr, =\"sd\", a=\"amit's\", a=\"sd\"b=\"saf\", ab cd=\"\"\n\nfunction validateAttributeString(attrStr, options) {\n //console.log(\"start:\"+attrStr+\":end\");\n\n //if(attrStr.trim().length === 0) return true; //empty string\n\n const matches = getAllMatches(attrStr, validAttrStrRegxp);\n const attrNames = {};\n\n for (let i = 0; i < matches.length; i++) {\n if (matches[i][1].length === 0) {\n //nospace before attribute name: a=\"sd\"b=\"saf\"\n return getErrorObject('InvalidAttr', \"Attribute '\" + matches[i][2] + \"' has no space in starting.\", getPositionFromMatch(matches[i]))\n } else if (matches[i][3] !== undefined && matches[i][4] === undefined) {\n return getErrorObject('InvalidAttr', \"Attribute '\" + matches[i][2] + \"' is without value.\", getPositionFromMatch(matches[i]));\n } else if (matches[i][3] === undefined && !options.allowBooleanAttributes) {\n //independent attribute: ab\n return getErrorObject('InvalidAttr', \"boolean attribute '\" + matches[i][2] + \"' is not allowed.\", getPositionFromMatch(matches[i]));\n }\n /* else if(matches[i][6] === undefined){//attribute without value: ab=\n return { err: { code:\"InvalidAttr\",msg:\"attribute \" + matches[i][2] + \" has no value assigned.\"}};\n } */\n const attrName = matches[i][2];\n if (!validateAttrName(attrName)) {\n return getErrorObject('InvalidAttr', \"Attribute '\" + attrName + \"' is an invalid name.\", getPositionFromMatch(matches[i]));\n }\n if (!Object.prototype.hasOwnProperty.call(attrNames, attrName)) {\n //check for duplicate attribute.\n attrNames[attrName] = 1;\n } else {\n return getErrorObject('InvalidAttr', \"Attribute '\" + attrName + \"' is repeated.\", getPositionFromMatch(matches[i]));\n }\n }\n\n return true;\n}\n\nfunction validateNumberAmpersand(xmlData, i) {\n let re = /\\d/;\n if (xmlData[i] === 'x') {\n i++;\n re = /[\\da-fA-F]/;\n }\n for (; i < xmlData.length; i++) {\n if (xmlData[i] === ';')\n return i;\n if (!xmlData[i].match(re))\n break;\n }\n return -1;\n}\n\nfunction validateAmpersand(xmlData, i) {\n // https://www.w3.org/TR/xml/#dt-charref\n i++;\n if (xmlData[i] === ';')\n return -1;\n if (xmlData[i] === '#') {\n i++;\n return validateNumberAmpersand(xmlData, i);\n }\n let count = 0;\n for (; i < xmlData.length; i++, count++) {\n if (xmlData[i].match(/\\w/) && count < 20)\n continue;\n if (xmlData[i] === ';')\n break;\n return -1;\n }\n return i;\n}\n\nfunction getErrorObject(code, message, lineNumber) {\n return {\n err: {\n code: code,\n msg: message,\n line: lineNumber.line || lineNumber,\n col: lineNumber.col,\n },\n };\n}\n\nfunction validateAttrName(attrName) {\n return isName(attrName);\n}\n\n// const startsWithXML = /^xml/i;\n\nfunction validateTagName(tagname) {\n return isName(tagname) /* && !tagname.match(startsWithXML) */;\n}\n\n//this function returns the line number for the character at the given index\nfunction getLineNumberForPosition(xmlData, index) {\n const lines = xmlData.substring(0, index).split(/\\r?\\n/);\n return {\n line: lines.length,\n\n // column number is last line's length + 1, because column numbering starts at 1:\n col: lines[lines.length - 1].length + 1\n };\n}\n\n//this function returns the position of the first character of match within attrStr\nfunction getPositionFromMatch(match) {\n return match.startIndex + match[1].length;\n}\n","// ---------------------------------------------------------------------------\n// Complete HTML5 named entity reference\n// Organized by logical categories for easy maintenance and selective importing\n// ---------------------------------------------------------------------------\n\n/**\n * Basic Latin & Special Characters\n * @type {Record}\n */\nexport const BASIC_LATIN = {\n amp: '&',\n AMP: '&',\n lt: '<',\n LT: '<',\n gt: '>',\n GT: '>',\n quot: '\"',\n QUOT: '\"',\n apos: \"'\",\n lsquo: '‘',\n rsquo: '’',\n ldquo: '“',\n rdquo: '”',\n lsquor: '‚',\n rsquor: '’',\n ldquor: '„',\n bdquo: '„',\n comma: ',',\n period: '.',\n colon: ':',\n semi: ';',\n excl: '!',\n quest: '?',\n num: '#',\n dollar: '$',\n percent: '%',\n amp: '&',\n ast: '*',\n commat: '@',\n lowbar: '_',\n verbar: '|',\n vert: '|',\n sol: '/',\n bsol: '\\\\',\n lbrace: '{',\n rbrace: '}',\n lbrack: '[',\n rbrack: ']',\n lpar: '(',\n rpar: ')',\n nbsp: '\\u00a0',\n iexcl: '¡',\n cent: '¢',\n pound: '£',\n curren: '¤',\n yen: '¥',\n brvbar: '¦',\n sect: '§',\n uml: '¨',\n copy: '©',\n COPY: '©',\n ordf: 'ª',\n laquo: '«',\n not: '¬',\n shy: '\\u00ad',\n reg: '®',\n REG: '®',\n macr: '¯',\n deg: '°',\n plusmn: '±',\n sup2: '²',\n sup3: '³',\n acute: '´',\n micro: 'µ',\n para: '¶',\n middot: '·',\n cedil: '¸',\n sup1: '¹',\n ordm: 'º',\n raquo: '»',\n frac14: '¼',\n frac12: '½',\n half: '½',\n frac34: '¾',\n iquest: '¿',\n times: '×',\n div: '÷',\n divide: '÷',\n};\n\n/**\n * Latin Extended & Accented Letters (A-Z)\n * @type {Record}\n */\nexport const LATIN_ACCENTS = {\n Agrave: 'À',\n agrave: 'à',\n Aacute: 'Á',\n aacute: 'á',\n Acirc: 'Â',\n acirc: 'â',\n Atilde: 'Ã',\n atilde: 'ã',\n Auml: 'Ä',\n auml: 'ä',\n Aring: 'Å',\n aring: 'å',\n AElig: 'Æ',\n aelig: 'æ',\n Ccedil: 'Ç',\n ccedil: 'ç',\n Egrave: 'È',\n egrave: 'è',\n Eacute: 'É',\n eacute: 'é',\n Ecirc: 'Ê',\n ecirc: 'ê',\n Euml: 'Ë',\n euml: 'ë',\n Igrave: 'Ì',\n igrave: 'ì',\n Iacute: 'Í',\n iacute: 'í',\n Icirc: 'Î',\n icirc: 'î',\n Iuml: 'Ï',\n iuml: 'ï',\n ETH: 'Ð',\n eth: 'ð',\n Ntilde: 'Ñ',\n ntilde: 'ñ',\n Ograve: 'Ò',\n ograve: 'ò',\n Oacute: 'Ó',\n oacute: 'ó',\n Ocirc: 'Ô',\n ocirc: 'ô',\n Otilde: 'Õ',\n otilde: 'õ',\n Ouml: 'Ö',\n ouml: 'ö',\n Oslash: 'Ø',\n oslash: 'ø',\n Ugrave: 'Ù',\n ugrave: 'ù',\n Uacute: 'Ú',\n uacute: 'ú',\n Ucirc: 'Û',\n ucirc: 'û',\n Uuml: 'Ü',\n uuml: 'ü',\n Yacute: 'Ý',\n yacute: 'ý',\n THORN: 'Þ',\n thorn: 'þ',\n szlig: 'ß',\n yuml: 'ÿ',\n Yuml: 'Ÿ',\n};\n\n/**\n * Latin Extended (Letters with diacritics)\n * @type {Record}\n */\nexport const LATIN_EXTENDED = {\n Amacr: 'Ā',\n amacr: 'ā',\n Abreve: 'Ă',\n abreve: 'ă',\n Aogon: 'Ą',\n aogon: 'ą',\n Cacute: 'Ć',\n cacute: 'ć',\n Ccirc: 'Ĉ',\n ccirc: 'ĉ',\n Cdot: 'Ċ',\n cdot: 'ċ',\n Ccaron: 'Č',\n ccaron: 'č',\n Dcaron: 'Ď',\n dcaron: 'ď',\n Dstrok: 'Đ',\n dstrok: 'đ',\n Emacr: 'Ē',\n emacr: 'ē',\n Ecaron: 'Ě',\n ecaron: 'ě',\n Edot: 'Ė',\n edot: 'ė',\n Eogon: 'Ę',\n eogon: 'ę',\n Gcirc: 'Ĝ',\n gcirc: 'ĝ',\n Gbreve: 'Ğ',\n gbreve: 'ğ',\n Gdot: 'Ġ',\n gdot: 'ġ',\n Gcedil: 'Ģ',\n Hcirc: 'Ĥ',\n hcirc: 'ĥ',\n Hstrok: 'Ħ',\n hstrok: 'ħ',\n Itilde: 'Ĩ',\n itilde: 'ĩ',\n Imacr: 'Ī',\n imacr: 'ī',\n Iogon: 'Į',\n iogon: 'į',\n Idot: 'İ',\n IJlig: 'IJ',\n ijlig: 'ij',\n Jcirc: 'Ĵ',\n jcirc: 'ĵ',\n Kcedil: 'Ķ',\n kcedil: 'ķ',\n kgreen: 'ĸ',\n Lacute: 'Ĺ',\n lacute: 'ĺ',\n Lcedil: 'Ļ',\n lcedil: 'ļ',\n Lcaron: 'Ľ',\n lcaron: 'ľ',\n Lmidot: 'Ŀ',\n lmidot: 'ŀ',\n Lstrok: 'Ł',\n lstrok: 'ł',\n Nacute: 'Ń',\n nacute: 'ń',\n Ncaron: 'Ň',\n ncaron: 'ň',\n Ncedil: 'Ņ',\n ncedil: 'ņ',\n ENG: 'Ŋ',\n eng: 'ŋ',\n Omacr: 'Ō',\n omacr: 'ō',\n Odblac: 'Ő',\n odblac: 'ő',\n OElig: 'Œ',\n oelig: 'œ',\n Racute: 'Ŕ',\n racute: 'ŕ',\n Rcaron: 'Ř',\n rcaron: 'ř',\n Rcedil: 'Ŗ',\n rcedil: 'ŗ',\n Sacute: 'Ś',\n sacute: 'ś',\n Scirc: 'Ŝ',\n scirc: 'ŝ',\n Scedil: 'Ş',\n scedil: 'ş',\n Scaron: 'Š',\n scaron: 'š',\n Tcedil: 'Ţ',\n tcedil: 'ţ',\n Tcaron: 'Ť',\n tcaron: 'ť',\n Tstrok: 'Ŧ',\n tstrok: 'ŧ',\n Utilde: 'Ũ',\n utilde: 'ũ',\n Umacr: 'Ū',\n umacr: 'ū',\n Ubreve: 'Ŭ',\n ubreve: 'ŭ',\n Uring: 'Ů',\n uring: 'ů',\n Udblac: 'Ű',\n udblac: 'ű',\n Uogon: 'Ų',\n uogon: 'ų',\n Wcirc: 'Ŵ',\n wcirc: 'ŵ',\n Ycirc: 'Ŷ',\n ycirc: 'ŷ',\n Zacute: 'Ź',\n zacute: 'ź',\n Zdot: 'Ż',\n zdot: 'ż',\n Zcaron: 'Ž',\n zcaron: 'ž',\n};\n\n/**\n * Greek Letters\n * @type {Record}\n */\nexport const GREEK = {\n Alpha: 'Α',\n alpha: 'α',\n Beta: 'Β',\n beta: 'β',\n Gamma: 'Γ',\n gamma: 'γ',\n Delta: 'Δ',\n delta: 'δ',\n Epsilon: 'Ε',\n epsilon: 'ε',\n epsiv: 'ϵ',\n varepsilon: 'ϵ',\n Zeta: 'Ζ',\n zeta: 'ζ',\n Eta: 'Η',\n eta: 'η',\n Theta: 'Θ',\n theta: 'θ',\n thetasym: 'ϑ',\n vartheta: 'ϑ',\n Iota: 'Ι',\n iota: 'ι',\n Kappa: 'Κ',\n kappa: 'κ',\n kappav: 'ϰ',\n varkappa: 'ϰ',\n Lambda: 'Λ',\n lambda: 'λ',\n Mu: 'Μ',\n mu: 'μ',\n Nu: 'Ν',\n nu: 'ν',\n Xi: 'Ξ',\n xi: 'ξ',\n Omicron: 'Ο',\n omicron: 'ο',\n Pi: 'Π',\n pi: 'π',\n piv: 'ϖ',\n varpi: 'ϖ',\n Rho: 'Ρ',\n rho: 'ρ',\n rhov: 'ϱ',\n varrho: 'ϱ',\n Sigma: 'Σ',\n sigma: 'σ',\n sigmaf: 'ς',\n sigmav: 'ς',\n varsigma: 'ς',\n Tau: 'Τ',\n tau: 'τ',\n Upsilon: 'Υ',\n upsilon: 'υ',\n upsi: 'υ',\n Upsi: 'ϒ',\n upsih: 'ϒ',\n Phi: 'Φ',\n phi: 'φ',\n phiv: 'ϕ',\n varphi: 'ϕ',\n Chi: 'Χ',\n chi: 'χ',\n Psi: 'Ψ',\n psi: 'ψ',\n Omega: 'Ω',\n omega: 'ω',\n ohm: 'Ω',\n Gammad: 'Ϝ',\n gammad: 'ϝ',\n digamma: 'ϝ',\n};\n\n/**\n * Cyrillic Letters\n * @type {Record}\n */\nexport const CYRILLIC = {\n Afr: '𝔄',\n afr: '𝔞',\n Acy: 'А',\n acy: 'а',\n Bcy: 'Б',\n bcy: 'б',\n Vcy: 'В',\n vcy: 'в',\n Gcy: 'Г',\n gcy: 'г',\n Dcy: 'Д',\n dcy: 'д',\n IEcy: 'Е',\n iecy: 'е',\n IOcy: 'Ё',\n iocy: 'ё',\n ZHcy: 'Ж',\n zhcy: 'ж',\n Zcy: 'З',\n zcy: 'з',\n Icy: 'И',\n icy: 'и',\n Jcy: 'Й',\n jcy: 'й',\n Kcy: 'К',\n kcy: 'к',\n Lcy: 'Л',\n lcy: 'л',\n Mcy: 'М',\n mcy: 'м',\n Ncy: 'Н',\n ncy: 'н',\n Ocy: 'О',\n ocy: 'о',\n Pcy: 'П',\n pcy: 'п',\n Rcy: 'Р',\n rcy: 'р',\n Scy: 'С',\n scy: 'с',\n Tcy: 'Т',\n tcy: 'т',\n Ucy: 'У',\n ucy: 'у',\n Fcy: 'Ф',\n fcy: 'ф',\n KHcy: 'Х',\n khcy: 'х',\n TScy: 'Ц',\n tscy: 'ц',\n CHcy: 'Ч',\n chcy: 'ч',\n SHcy: 'Ш',\n shcy: 'ш',\n SHCHcy: 'Щ',\n shchcy: 'щ',\n HARDcy: 'Ъ',\n hardcy: 'ъ',\n Ycy: 'Ы',\n ycy: 'ы',\n SOFTcy: 'Ь',\n softcy: 'ь',\n Ecy: 'Э',\n ecy: 'э',\n YUcy: 'Ю',\n yucy: 'ю',\n YAcy: 'Я',\n yacy: 'я',\n DJcy: 'Ђ',\n djcy: 'ђ',\n GJcy: 'Ѓ',\n gjcy: 'ѓ',\n Jukcy: 'Є',\n jukcy: 'є',\n DScy: 'Ѕ',\n dscy: 'ѕ',\n Iukcy: 'І',\n iukcy: 'і',\n YIcy: 'Ї',\n yicy: 'ї',\n Jsercy: 'Ј',\n jsercy: 'ј',\n LJcy: 'Љ',\n ljcy: 'љ',\n NJcy: 'Њ',\n njcy: 'њ',\n TSHcy: 'Ћ',\n tshcy: 'ћ',\n KJcy: 'Ќ',\n kjcy: 'ќ',\n Ubrcy: 'Ў',\n ubrcy: 'ў',\n DZcy: 'Џ',\n dzcy: 'џ',\n};\n\n/**\n * Mathematical Operators & Relations\n * @type {Record}\n */\nexport const MATH = {\n plus: '+',\n minus: '−',\n mnplus: '∓',\n mp: '∓',\n pm: '±',\n times: '×',\n div: '÷',\n divide: '÷',\n sdot: '⋅',\n star: '☆',\n starf: '★',\n bigstar: '★',\n lowast: '∗',\n ast: '*',\n midast: '*',\n compfn: '∘',\n smallcircle: '∘',\n bullet: '•',\n bull: '•',\n nbsp: '\\u00a0',\n hellip: '…',\n mldr: '…',\n prime: '′',\n Prime: '″',\n tprime: '‴',\n bprime: '‵',\n backprime: '‵',\n minus: '−',\n minusd: '∸',\n dotminus: '∸',\n plusdo: '∔',\n dotplus: '∔',\n plusmn: '±',\n minusplus: '∓',\n mnplus: '∓',\n mp: '∓',\n setminus: '∖',\n smallsetminus: '∖',\n Backslash: '∖',\n setmn: '∖',\n ssetmn: '∖',\n lowbar: '_',\n verbar: '|',\n vert: '|',\n VerticalLine: '|',\n colon: ':',\n Colon: '∷',\n Proportion: '∷',\n ratio: '∶',\n equals: '=',\n ne: '≠',\n nequiv: '≢',\n equiv: '≡',\n Congruent: '≡',\n sim: '∼',\n thicksim: '∼',\n thksim: '∼',\n sime: '≃',\n simeq: '≃',\n TildeEqual: '≃',\n asymp: '≈',\n approx: '≈',\n thickapprox: '≈',\n thkap: '≈',\n TildeTilde: '≈',\n ncong: '≇',\n cong: '≅',\n TildeFullEqual: '≅',\n asympeq: '≍',\n CupCap: '≍',\n bump: '≎',\n Bumpeq: '≎',\n HumpDownHump: '≎',\n bumpe: '≏',\n bumpeq: '≏',\n HumpEqual: '≏',\n dotminus: '∸',\n minusd: '∸',\n plusdo: '∔',\n dotplus: '∔',\n le: '≤',\n LessEqual: '≤',\n ge: '≥',\n GreaterEqual: '≥',\n lesseqgtr: '⋚',\n lesseqqgtr: '⪋',\n greater: '>',\n less: '<',\n};\n\n/**\n * Mathematical Operators (Advanced)\n * @type {Record}\n */\nexport const MATH_ADVANCED = {\n alefsym: 'ℵ',\n aleph: 'ℵ',\n beth: 'ℶ',\n gimel: 'ℷ',\n daleth: 'ℸ',\n forall: '∀',\n ForAll: '∀',\n part: '∂',\n PartialD: '∂',\n exist: '∃',\n Exists: '∃',\n nexist: '∄',\n nexists: '∄',\n empty: '∅',\n emptyset: '∅',\n emptyv: '∅',\n varnothing: '∅',\n nabla: '∇',\n Del: '∇',\n isin: '∈',\n isinv: '∈',\n in: '∈',\n Element: '∈',\n notin: '∉',\n notinva: '∉',\n ni: '∋',\n niv: '∋',\n SuchThat: '∋',\n ReverseElement: '∋',\n notni: '∌',\n notniva: '∌',\n prod: '∏',\n Product: '∏',\n coprod: '∐',\n Coproduct: '∐',\n sum: '∑',\n Sum: '∑',\n minus: '−',\n mp: '∓',\n plusdo: '∔',\n dotplus: '∔',\n setminus: '∖',\n lowast: '∗',\n radic: '√',\n Sqrt: '√',\n prop: '∝',\n propto: '∝',\n Proportional: '∝',\n varpropto: '∝',\n infin: '∞',\n infintie: '⧝',\n ang: '∠',\n angle: '∠',\n angmsd: '∡',\n measuredangle: '∡',\n angsph: '∢',\n mid: '∣',\n VerticalBar: '∣',\n nmid: '∤',\n nsmid: '∤',\n npar: '∦',\n parallel: '∥',\n spar: '∥',\n nparallel: '∦',\n nspar: '∦',\n and: '∧',\n wedge: '∧',\n or: '∨',\n vee: '∨',\n cap: '∩',\n cup: '∪',\n int: '∫',\n Integral: '∫',\n conint: '∮',\n ContourIntegral: '∮',\n Conint: '∯',\n DoubleContourIntegral: '∯',\n Cconint: '∰',\n there4: '∴',\n therefore: '∴',\n Therefore: '∴',\n becaus: '∵',\n because: '∵',\n Because: '∵',\n ratio: '∶',\n Proportion: '∷',\n minusd: '∸',\n dotminus: '∸',\n mDDot: '∺',\n homtht: '∻',\n sim: '∼',\n bsimg: '∽',\n backsim: '∽',\n ac: '∾',\n mstpos: '∾',\n acd: '∿',\n VerticalTilde: '≀',\n wr: '≀',\n wreath: '≀',\n nsime: '≄',\n nsimeq: '≄',\n nsimeq: '≄',\n ncong: '≇',\n simne: '≆',\n ncongdot: '⩭̸',\n ngsim: '≵',\n nsim: '≁',\n napprox: '≉',\n nap: '≉',\n ngeq: '≱',\n nge: '≱',\n nleq: '≰',\n nle: '≰',\n ngtr: '≯',\n ngt: '≯',\n nless: '≮',\n nlt: '≮',\n nprec: '⊀',\n npr: '⊀',\n nsucc: '⊁',\n nsc: '⊁',\n};\n\n/**\n * Arrows\n * @type {Record}\n */\nexport const ARROWS = {\n larr: '←',\n leftarrow: '←',\n LeftArrow: '←',\n uarr: '↑',\n uparrow: '↑',\n UpArrow: '↑',\n rarr: '→',\n rightarrow: '→',\n RightArrow: '→',\n darr: '↓',\n downarrow: '↓',\n DownArrow: '↓',\n harr: '↔',\n leftrightarrow: '↔',\n LeftRightArrow: '↔',\n varr: '↕',\n updownarrow: '↕',\n UpDownArrow: '↕',\n nwarr: '↖',\n nwarrow: '↖',\n UpperLeftArrow: '↖',\n nearr: '↗',\n nearrow: '↗',\n UpperRightArrow: '↗',\n searr: '↘',\n searrow: '↘',\n LowerRightArrow: '↘',\n swarr: '↙',\n swarrow: '↙',\n LowerLeftArrow: '↙',\n lArr: '⇐',\n Leftarrow: '⇐',\n uArr: '⇑',\n Uparrow: '⇑',\n rArr: '⇒',\n Rightarrow: '⇒',\n dArr: '⇓',\n Downarrow: '⇓',\n hArr: '⇔',\n Leftrightarrow: '⇔',\n iff: '⇔',\n vArr: '⇕',\n Updownarrow: '⇕',\n lAarr: '⇚',\n Lleftarrow: '⇚',\n rAarr: '⇛',\n Rrightarrow: '⇛',\n lrarr: '⇆',\n leftrightarrows: '⇆',\n rlarr: '⇄',\n rightleftarrows: '⇄',\n lrhar: '⇋',\n leftrightharpoons: '⇋',\n ReverseEquilibrium: '⇋',\n rlhar: '⇌',\n rightleftharpoons: '⇌',\n Equilibrium: '⇌',\n udarr: '⇅',\n UpArrowDownArrow: '⇅',\n duarr: '⇵',\n DownArrowUpArrow: '⇵',\n llarr: '⇇',\n leftleftarrows: '⇇',\n rrarr: '⇉',\n rightrightarrows: '⇉',\n ddarr: '⇊',\n downdownarrows: '⇊',\n har: '↽',\n lhard: '↽',\n leftharpoondown: '↽',\n lharu: '↼',\n leftharpoonup: '↼',\n rhard: '⇁',\n rightharpoondown: '⇁',\n rharu: '⇀',\n rightharpoonup: '⇀',\n lsh: '↰',\n Lsh: '↰',\n rsh: '↱',\n Rsh: '↱',\n ldsh: '↲',\n rdsh: '↳',\n hookleftarrow: '↩',\n hookrightarrow: '↪',\n mapstoleft: '↤',\n mapstoup: '↥',\n map: '↦',\n mapsto: '↦',\n mapstodown: '↧',\n crarr: '↵',\n nwarrow: '↖',\n nearrow: '↗',\n searrow: '↘',\n swarrow: '↙',\n nleftarrow: '↚',\n nleftrightarrow: '↮',\n nrightarrow: '↛',\n nrarr: '↛',\n larrtl: '↢',\n rarrtl: '↣',\n leftarrowtail: '↢',\n rightarrowtail: '↣',\n twoheadleftarrow: '↞',\n twoheadrightarrow: '↠',\n Larr: '↞',\n Rarr: '↠',\n larrhk: '↩',\n rarrhk: '↪',\n larrlp: '↫',\n looparrowleft: '↫',\n rarrlp: '↬',\n looparrowright: '↬',\n harrw: '↭',\n leftrightsquigarrow: '↭',\n nrarrw: '↝̸',\n rarrw: '↝',\n rightsquigarrow: '↝',\n larrbfs: '⤟',\n rarrbfs: '⤠',\n nvHarr: '⤄',\n nvlArr: '⤂',\n nvrArr: '⤃',\n larrfs: '⤝',\n rarrfs: '⤞',\n Map: '⤅',\n larrsim: '⥳',\n rarrsim: '⥴',\n harrcir: '⥈',\n Uarrocir: '⥉',\n lurdshar: '⥊',\n ldrdhar: '⥧',\n ldrushar: '⥋',\n rdldhar: '⥩',\n lrhard: '⥭',\n rlhar: '⇌',\n uharr: '↾',\n uharl: '↿',\n dharr: '⇂',\n dharl: '⇃',\n Uarr: '↟',\n Darr: '↡',\n zigrarr: '⇝',\n nwArr: '⇖',\n neArr: '⇗',\n seArr: '⇘',\n swArr: '⇙',\n nharr: '↮',\n nhArr: '⇎',\n nlarr: '↚',\n nlArr: '⇍',\n nrarr: '↛',\n nrArr: '⇏',\n larrb: '⇤',\n LeftArrowBar: '⇤',\n rarrb: '⇥',\n RightArrowBar: '⇥',\n};\n\n/**\n * Geometric Shapes\n * @type {Record}\n */\nexport const SHAPES = {\n square: '□',\n Square: '□',\n squ: '□',\n squf: '▪',\n squarf: '▪',\n blacksquar: '▪',\n blacksquare: '▪',\n FilledVerySmallSquare: '▪',\n blk34: '▓',\n blk12: '▒',\n blk14: '░',\n block: '█',\n srect: '▭',\n rect: '▭',\n sdot: '⋅',\n sdotb: '⊡',\n dotsquare: '⊡',\n triangle: '▵',\n tri: '▵',\n trine: '▵',\n utri: '▵',\n triangledown: '▿',\n dtri: '▿',\n tridown: '▿',\n triangleleft: '◃',\n ltri: '◃',\n triangleright: '▹',\n rtri: '▹',\n blacktriangle: '▴',\n utrif: '▴',\n blacktriangledown: '▾',\n dtrif: '▾',\n blacktriangleleft: '◂',\n ltrif: '◂',\n blacktriangleright: '▸',\n rtrif: '▸',\n loz: '◊',\n lozenge: '◊',\n blacklozenge: '⧫',\n lozf: '⧫',\n bigcirc: '◯',\n xcirc: '◯',\n circ: 'ˆ',\n Circle: '○',\n cir: '○',\n o: '○',\n bullet: '•',\n bull: '•',\n hellip: '…',\n mldr: '…',\n nldr: '‥',\n boxh: '─',\n HorizontalLine: '─',\n boxv: '│',\n boxdr: '┌',\n boxdl: '┐',\n boxur: '└',\n boxul: '┘',\n boxvr: '├',\n boxvl: '┤',\n boxhd: '┬',\n boxhu: '┴',\n boxvh: '┼',\n boxH: '═',\n boxV: '║',\n boxdR: '╒',\n boxDr: '╓',\n boxDR: '╔',\n boxDl: '╕',\n boxdL: '╖',\n boxDL: '╗',\n boxuR: '╘',\n boxUr: '╙',\n boxUR: '╚',\n boxUl: '╜',\n boxuL: '╛',\n boxUL: '╝',\n boxvR: '╞',\n boxVr: '╟',\n boxVR: '╠',\n boxVl: '╢',\n boxvL: '╡',\n boxVL: '╣',\n boxHd: '╤',\n boxhD: '╥',\n boxHD: '╦',\n boxHu: '╧',\n boxhU: '╨',\n boxHU: '╩',\n boxvH: '╪',\n boxVh: '╫',\n boxVH: '╬',\n};\n\n/**\n * Punctuation & Diacritics\n * @type {Record}\n */\nexport const PUNCTUATION = {\n excl: '!',\n iexcl: '¡',\n brvbar: '¦',\n sect: '§',\n uml: '¨',\n copy: '©',\n ordf: 'ª',\n laquo: '«',\n not: '¬',\n shy: '\\u00ad',\n reg: '®',\n macr: '¯',\n deg: '°',\n plusmn: '±',\n sup2: '²',\n sup3: '³',\n acute: '´',\n micro: 'µ',\n para: '¶',\n middot: '·',\n cedil: '¸',\n sup1: '¹',\n ordm: 'º',\n raquo: '»',\n frac14: '¼',\n frac12: '½',\n frac34: '¾',\n iquest: '¿',\n nbsp: '\\u00a0',\n comma: ',',\n period: '.',\n colon: ':',\n semi: ';',\n vert: '|',\n Verbar: '‖',\n verbar: '|',\n dblac: '˝',\n circ: 'ˆ',\n caron: 'ˇ',\n breve: '˘',\n dot: '˙',\n ring: '˚',\n ogon: '˛',\n tilde: '˜',\n DiacriticalGrave: '`',\n DiacriticalAcute: '´',\n DiacriticalTilde: '˜',\n DiacriticalDot: '˙',\n DiacriticalDoubleAcute: '˝',\n grave: '`',\n acute: '´',\n};\n\n/**\n * Currency Symbols\n * @type {Record}\n */\nexport const CURRENCY = {\n cent: '¢',\n pound: '£',\n curren: '¤',\n yen: '¥',\n euro: '€',\n dollar: '$',\n euro: '€',\n fnof: 'ƒ',\n inr: '₹',\n af: '؋',\n birr: 'ብር',\n peso: '₱',\n rub: '₽',\n won: '₩',\n yuan: '¥',\n cedil: '¸',\n};\n\n/**\n * Fractions\n * @type {Record}\n */\nexport const FRACTIONS = {\n frac12: '½',\n half: '½',\n frac13: '⅓',\n frac14: '¼',\n frac15: '⅕',\n frac16: '⅙',\n frac18: '⅛',\n frac23: '⅔',\n frac25: '⅖',\n frac34: '¾',\n frac35: '⅗',\n frac38: '⅜',\n frac45: '⅘',\n frac56: '⅚',\n frac58: '⅝',\n frac78: '⅞',\n frasl: '⁄',\n};\n\n/**\n * Miscellaneous Symbols\n * @type {Record}\n */\nexport const MISC_SYMBOLS = {\n trade: '™',\n TRADE: '™',\n telrec: '⌕',\n target: '⌖',\n ulcorn: '⌜',\n ulcorner: '⌜',\n urcorn: '⌝',\n urcorner: '⌝',\n dlcorn: '⌞',\n llcorner: '⌞',\n drcorn: '⌟',\n lrcorner: '⌟',\n intercal: '⊺',\n intcal: '⊺',\n oplus: '⊕',\n CirclePlus: '⊕',\n ominus: '⊖',\n CircleMinus: '⊖',\n otimes: '⊗',\n CircleTimes: '⊗',\n osol: '⊘',\n odot: '⊙',\n CircleDot: '⊙',\n oast: '⊛',\n circledast: '⊛',\n odash: '⊝',\n circleddash: '⊝',\n ocirc: '⊚',\n circledcirc: '⊚',\n boxplus: '⊞',\n plusb: '⊞',\n boxminus: '⊟',\n minusb: '⊟',\n boxtimes: '⊠',\n timesb: '⊠',\n boxdot: '⊡',\n sdotb: '⊡',\n veebar: '⊻',\n vee: '∨',\n barvee: '⊽',\n and: '∧',\n wedge: '∧',\n Cap: '⋒',\n Cup: '⋓',\n Fork: '⋔',\n pitchfork: '⋔',\n epar: '⋕',\n ltlarr: '⥶',\n nvap: '≍⃒',\n nvsim: '∼⃒',\n nvge: '≥⃒',\n nvle: '≤⃒',\n nvlt: '<⃒',\n nvgt: '>⃒',\n nvltrie: '⊴⃒',\n nvrtrie: '⊵⃒',\n Vdash: '⊩',\n dashv: '⊣',\n vDash: '⊨',\n Vdash: '⊩',\n Vvdash: '⊪',\n nvdash: '⊬',\n nvDash: '⊭',\n nVdash: '⊮',\n nVDash: '⊯',\n};\n\n/**\n * All entities combined (if you need everything)\n * @type {Record}\n */\nexport const ALL_ENTITIES = {\n ...BASIC_LATIN,\n ...LATIN_ACCENTS,\n ...LATIN_EXTENDED,\n ...GREEK,\n ...CYRILLIC,\n ...MATH,\n ...MATH_ADVANCED,\n ...ARROWS,\n ...SHAPES,\n ...PUNCTUATION,\n ...CURRENCY,\n ...FRACTIONS,\n ...MISC_SYMBOLS,\n};\n\nexport const XML = {\n amp: \"&\",\n apos: \"'\",\n gt: \">\",\n lt: \"<\",\n quot: \"\\\"\"\n}\nexport const COMMON_HTML = {\n nbsp: '\\u00a0',\n copy: '\\u00a9',\n reg: '\\u00ae',\n trade: '\\u2122',\n mdash: '\\u2014',\n ndash: '\\u2013',\n hellip: '\\u2026',\n laquo: '\\u00ab',\n raquo: '\\u00bb',\n lsquo: '\\u2018',\n rsquo: '\\u2019',\n ldquo: '\\u201c',\n rdquo: '\\u201d',\n bull: '\\u2022',\n para: '\\u00b6',\n sect: '\\u00a7',\n deg: '\\u00b0',\n frac12: '\\u00bd',\n frac14: '\\u00bc',\n frac34: '\\u00be',\n}\n// ---------------------------------------------------------------------------\n// Note: NUMERIC_ENTITIES (&#NNN; / &#xHH;) are handled by the scanner directly\n// via String.fromCodePoint() without any map lookup.\n// ---------------------------------------------------------------------------","// ---------------------------------------------------------------------------\n// Built-in named entity map (name → replacement string)\n// No regex, no {regex,val} objects — just flat key/value pairs.\n// ---------------------------------------------------------------------------\n\nimport { XML as DEFAULT_XML_ENTITIES } from \"./entities.js\"\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nconst SPECIAL_CHARS = new Set('!?\\\\\\\\/[]$%{}^&*()<>|+');\n\n/**\n * Validate that an entity name contains no dangerous characters.\n * @param {string} name\n * @returns {string} the name, unchanged\n * @throws {Error} on invalid characters\n */\nfunction validateEntityName(name) {\n if (name[0] === '#') {\n throw new Error(`[EntityReplacer] Invalid character '#' in entity name: \"${name}\"`);\n }\n for (const ch of name) {\n if (SPECIAL_CHARS.has(ch)) {\n throw new Error(`[EntityReplacer] Invalid character '${ch}' in entity name: \"${name}\"`);\n }\n }\n return name;\n}\n\n/**\n * Merge one or more entity maps into a flat name→string map.\n * Accepts either:\n * - plain string values: { amp: '&' }\n * - legacy {regex,val} / {regx,val}: { lt: { regex: /.../, val: '<' } }\n *\n * Values containing '&' are skipped (recursive expansion risk).\n *\n * @param {...object} maps\n * @returns {Record}\n */\nfunction mergeEntityMaps(...maps) {\n const out = Object.create(null);\n for (const map of maps) {\n if (!map) continue;\n for (const key of Object.keys(map)) {\n const raw = map[key];\n if (typeof raw === 'string') {\n out[key] = raw;\n } else if (raw && typeof raw === 'object' && raw.val !== undefined) {\n // Legacy {regex,val} or {regx,val} — extract the string val only\n const val = raw.val;\n if (typeof val === 'string') {\n out[key] = val;\n }\n // function vals are not supported in the scanner — skip\n }\n }\n }\n return out;\n}\n\n// ---------------------------------------------------------------------------\n// applyLimitsTo helpers\n// ---------------------------------------------------------------------------\n\nconst LIMIT_TIER_EXTERNAL = 'external'; // input/runtime + persistent external maps\nconst LIMIT_TIER_BASE = 'base'; // DEFAULT_XML_ENTITIES + namedEntities (system) maps\nconst LIMIT_TIER_ALL = 'all'; // every entity regardless of tier\n\n/**\n * Resolve `applyLimitsTo` option into a normalised Set of tier strings.\n * Accepted values: 'external' | 'base' | 'all' | string[]\n * Default: 'external' (only untrusted injected entities are counted).\n * @param {string|string[]|undefined} raw\n * @returns {Set}\n */\nfunction parseLimitTiers(raw) {\n if (!raw || raw === LIMIT_TIER_EXTERNAL) return new Set([LIMIT_TIER_EXTERNAL]);\n if (raw === LIMIT_TIER_ALL) return new Set([LIMIT_TIER_ALL]);\n if (raw === LIMIT_TIER_BASE) return new Set([LIMIT_TIER_BASE]);\n if (Array.isArray(raw)) return new Set(raw);\n return new Set([LIMIT_TIER_EXTERNAL]); // safe default for unrecognised values\n}\n\n// ---------------------------------------------------------------------------\n// NCR (Numeric Character Reference) classification\n// ---------------------------------------------------------------------------\n\n// Severity order — higher number = stricter action.\n// Used to enforce minimum action levels for specific codepoint ranges.\nconst NCR_LEVEL = Object.freeze({ allow: 0, leave: 1, remove: 2, throw: 3 });\n\n// XML 1.0 §2.2: allowed chars are #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]\n// Restricted C0: U+0001–U+001F excluding U+0009, U+000A, U+000D\nconst XML10_ALLOWED_C0 = new Set([0x09, 0x0A, 0x0D]);\n\n/**\n * Parse the `ncr` constructor option into flat, hot-path-friendly fields.\n * @param {object|undefined} ncr\n * @returns {{ xmlVersion: number, onLevel: number, nullLevel: number }}\n */\nfunction parseNCRConfig(ncr) {\n if (!ncr) {\n return { xmlVersion: 1.0, onLevel: NCR_LEVEL.allow, nullLevel: NCR_LEVEL.remove };\n }\n const xmlVersion = ncr.xmlVersion === 1.1 ? 1.1 : 1.0;\n const onLevel = NCR_LEVEL[ncr.onNCR] ?? NCR_LEVEL.allow;\n const nullLevel = NCR_LEVEL[ncr.nullNCR] ?? NCR_LEVEL.remove;\n // 'allow' is not meaningful for null — clamp to at least 'remove'\n const clampedNull = Math.max(nullLevel, NCR_LEVEL.remove);\n return { xmlVersion, onLevel, nullLevel: clampedNull };\n}\n\n// ---------------------------------------------------------------------------\n// EntityReplacer\n// ---------------------------------------------------------------------------\n\n/**\n * Single-pass, zero-regex entity replacer for XML/HTML content.\n *\n * Algorithm: scan the string once for '&', read to ';', resolve via map\n * or direct codepoint conversion, build output chunks, join once at the end.\n *\n * Entity lookup priority (highest → lowest):\n * 1. input / runtime (DOCTYPE entities for current document)\n * 2. persistent external (survive across documents)\n * 3. base named map (DEFAULT_XML_ENTITIES + user-supplied namedEntities)\n *\n * Both input and external resolve as the 'external' tier for limit purposes.\n * Base map entities resolve as the 'base' tier.\n *\n * Numeric / hex references (&#NNN; / &#xHH;) are resolved directly via\n * String.fromCodePoint() — no map needed. They count as 'base' tier.\n *\n * @example\n * const replacer = new EntityReplacer({ namedEntities: COMMON_HTML });\n * replacer.setExternalEntities({ brand: 'Acme' });\n *\n * const instance = replacer.reset();\n * instance.addInputEntities({ version: '1.0' });\n * instance.encode('&brand; v&version; <'); // 'Acme v1.0 <'\n */\nexport default class EntityDecoder {\n /**\n * @param {object} [options]\n * @param {object|null} [options.namedEntities] — extra named entities merged into base map\n * @param {object} [options.limit] — security limits\n * @param {number} [options.limit.maxTotalExpansions=0] — 0 = unlimited\n * @param {number} [options.limit.maxExpandedLength=0] — 0 = unlimited\n * @param {'external'|'base'|'all'|string[]} [options.limit.applyLimitsTo='external']\n * Which entity tiers count against the security limits:\n * - 'external' (default) — only input/runtime + persistent external entities\n * - 'base' — only DEFAULT_XML_ENTITIES + namedEntities\n * - 'all' — every entity regardless of tier\n * - string[] — explicit combination, e.g. ['external', 'base']\n * @param {((resolved: string, original: string) => string)|null} [options.postCheck=null]\n * @param {string[]} [options.remove=[]] — entity names (e.g. ['nbsp', '#13']) to delete (replace with empty string)\n * @param {string[]} [options.leave=[]] — entity names to keep as literal (unchanged in output)\n * @param {object} [options.ncr] — Numeric Character Reference controls\n * @param {1.0|1.1} [options.ncr.xmlVersion=1.0]\n * XML version governing which codepoint ranges are restricted:\n * - 1.0 — C0 controls U+0001–U+001F (except U+0009/000A/000D) are prohibited\n * - 1.1 — C0 controls are allowed when written as NCRs; C1 (U+007F–U+009F) decoded as-is\n * @param {'allow'|'leave'|'remove'|'throw'} [options.ncr.onNCR='allow']\n * Base action for numeric references. Severity order: allow < leave < remove < throw.\n * For codepoint ranges that carry a minimum level (surrogates → remove, XML 1.0 C0 → remove),\n * the effective action is max(onNCR, rangeMinimum).\n * @param {'remove'|'throw'} [options.ncr.nullNCR='remove']\n * Action for U+0000 (null). 'allow' and 'leave' are clamped to 'remove' since null is never safe.\n */\n constructor(options = {}) {\n this._limit = options.limit || {};\n this._maxTotalExpansions = this._limit.maxTotalExpansions || 0;\n this._maxExpandedLength = this._limit.maxExpandedLength || 0;\n this._postCheck = typeof options.postCheck === 'function' ? options.postCheck : r => r;\n this._limitTiers = parseLimitTiers(this._limit.applyLimitsTo ?? LIMIT_TIER_EXTERNAL);\n this._numericAllowed = options.numericAllowed ?? true;\n // Base map: DEFAULT_XML_ENTITIES + user-supplied extras. Immutable after construction.\n this._baseMap = mergeEntityMaps(DEFAULT_XML_ENTITIES, options.namedEntities || null);\n\n // Persistent external entities — survive across documents.\n // Stored as a separate map so reset() never touches them.\n /** @type {Record} */\n this._externalMap = Object.create(null);\n\n // Input / runtime entities — current document only, wiped on reset().\n /** @type {Record} */\n this._inputMap = Object.create(null);\n\n // Per-document counters\n this._totalExpansions = 0;\n this._expandedLength = 0;\n\n // --- New: remove / leave sets ---\n /** @type {Set} */\n this._removeSet = new Set(options.remove && Array.isArray(options.remove) ? options.remove : []);\n /** @type {Set} */\n this._leaveSet = new Set(options.leave && Array.isArray(options.leave) ? options.leave : []);\n\n // --- NCR config (parsed into flat fields for hot-path speed) ---\n const ncrCfg = parseNCRConfig(options.ncr);\n this._ncrXmlVersion = ncrCfg.xmlVersion;\n this._ncrOnLevel = ncrCfg.onLevel;\n this._ncrNullLevel = ncrCfg.nullLevel;\n }\n\n // -------------------------------------------------------------------------\n // Persistent external entity registration\n // -------------------------------------------------------------------------\n\n /**\n * Replace the full set of persistent external entities.\n * All keys are validated — throws on invalid characters.\n * @param {Record} map\n */\n setExternalEntities(map) {\n if (map) {\n for (const key of Object.keys(map)) {\n validateEntityName(key);\n }\n }\n this._externalMap = mergeEntityMaps(map);\n }\n\n /**\n * Add a single persistent external entity.\n * @param {string} key\n * @param {string} value\n */\n addExternalEntity(key, value) {\n validateEntityName(key);\n if (typeof value === 'string' && value.indexOf('&') === -1) {\n this._externalMap[key] = value;\n }\n }\n\n // -------------------------------------------------------------------------\n // Input / runtime entity registration (per document)\n // -------------------------------------------------------------------------\n\n /**\n * Inject DOCTYPE entities for the current document.\n * Also resets per-document expansion counters.\n * @param {Record} map\n */\n addInputEntities(map) {\n this._totalExpansions = 0;\n this._expandedLength = 0;\n this._inputMap = mergeEntityMaps(map);\n }\n\n // -------------------------------------------------------------------------\n // Per-document reset\n // -------------------------------------------------------------------------\n\n /**\n * Wipe input/runtime entities and reset counters.\n * Call this before processing each new document.\n * @returns {this}\n */\n reset() {\n this._inputMap = Object.create(null);\n this._totalExpansions = 0;\n this._expandedLength = 0;\n return this;\n }\n\n // -------------------------------------------------------------------------\n // XML version (can be set after construction, e.g. once parser reads )\n // -------------------------------------------------------------------------\n\n /**\n * Update the XML version used for NCR classification.\n * Call this as soon as the document's `` declaration is parsed.\n * @param {1.0|1.1|number} version\n */\n setXmlVersion(version) {\n this._ncrXmlVersion = version === 1.1 ? 1.1 : 1.0;\n }\n\n // -------------------------------------------------------------------------\n // Primary API\n // -------------------------------------------------------------------------\n\n /**\n * Replace all entity references in `str` in a single pass.\n *\n * @param {string} str\n * @returns {string}\n */\n decode(str) {\n if (typeof str !== 'string' || str.length === 0) return str;\n //TODO: check if needed\n //if (str.indexOf('&') === -1) return str; // fast path — no entities at all\n\n const original = str;\n const chunks = [];\n const len = str.length;\n let last = 0; // start of next unprocessed literal chunk\n let i = 0;\n\n const limitExpansions = this._maxTotalExpansions > 0;\n const limitLength = this._maxExpandedLength > 0;\n const checkLimits = limitExpansions || limitLength;\n\n while (i < len) {\n // Scan forward to next '&'\n if (str.charCodeAt(i) !== 38 /* '&' */) { i++; continue; }\n\n // --- Found '&' at position i ---\n\n // Scan forward to ';'\n let j = i + 1;\n while (j < len && str.charCodeAt(j) !== 59 /* ';' */ && (j - i) <= 32) j++;\n\n if (j >= len || str.charCodeAt(j) !== 59) {\n // No closing ';' within window — treat '&' as literal\n i++;\n continue;\n }\n\n // Raw token between '&' and ';' (exclusive)\n const token = str.slice(i + 1, j);\n if (token.length === 0) { i++; continue; }\n\n let replacement;\n let tier; // which limit tier this entity belongs to\n\n if (this._removeSet.has(token)) {\n // Remove entity: replace with empty string\n replacement = '';\n // If entity was unknown (replacement undefined), we still need a tier for limits.\n // Treat as external tier because it's user-directed removal of an unknown reference.\n if (tier === undefined) {\n tier = LIMIT_TIER_EXTERNAL;\n }\n } else if (this._leaveSet.has(token)) {\n // Do not replace — keep original &token; as literal\n i++;\n continue;\n } else if (token.charCodeAt(0) === 35 /* '#' */) {\n // ---- Numeric / NCR reference ----\n // NCR classification always runs first — prohibited codepoints must be\n // caught regardless of numericAllowed.\n const ncrResult = this._resolveNCR(token);\n if (ncrResult === undefined) {\n // 'leave' action — keep original &token; as-is\n i++;\n continue;\n }\n replacement = ncrResult; // '' for remove, char string for allow\n tier = LIMIT_TIER_BASE;\n } else {\n // ---- Named reference ----\n const resolved = this._resolveName(token);\n replacement = resolved?.value;\n tier = resolved?.tier;\n }\n\n if (replacement === undefined) {\n // Unknown entity — leave as-is, advance past '&' only\n i++;\n continue;\n }\n\n // Flush literal chunk before this entity\n if (i > last) chunks.push(str.slice(last, i));\n chunks.push(replacement);\n last = j + 1; // skip past ';'\n i = last;\n\n // Apply expansion limits only if this tier is being tracked\n if (checkLimits && this._tierCounts(tier)) {\n if (limitExpansions) {\n this._totalExpansions++;\n if (this._totalExpansions > this._maxTotalExpansions) {\n throw new Error(\n `[EntityReplacer] Entity expansion count limit exceeded: ` +\n `${this._totalExpansions} > ${this._maxTotalExpansions}`\n );\n }\n }\n if (limitLength) {\n // delta: replacement.length minus the raw &token; length (token.length + 2 for '&' and ';')\n const delta = replacement.length - (token.length + 2);\n if (delta > 0) {\n this._expandedLength += delta;\n if (this._expandedLength > this._maxExpandedLength) {\n throw new Error(\n `[EntityReplacer] Expanded content length limit exceeded: ` +\n `${this._expandedLength} > ${this._maxExpandedLength}`\n );\n }\n }\n }\n }\n }\n\n // Flush trailing literal\n if (last < len) chunks.push(str.slice(last));\n\n // If nothing was replaced, chunks is empty — return original\n const result = chunks.length === 0 ? str : chunks.join('');\n\n return this._postCheck(result, original);\n }\n\n // -------------------------------------------------------------------------\n // Private: limit tier check\n // -------------------------------------------------------------------------\n\n /**\n * Returns true if a resolved entity of the given tier should count\n * against the expansion/length limits.\n * @param {string} tier — LIMIT_TIER_EXTERNAL | LIMIT_TIER_BASE\n * @returns {boolean}\n */\n _tierCounts(tier) {\n if (this._limitTiers.has(LIMIT_TIER_ALL)) return true;\n return this._limitTiers.has(tier);\n }\n\n // -------------------------------------------------------------------------\n // Private: entity resolution\n // -------------------------------------------------------------------------\n\n /**\n * Resolve a named entity token (without & and ;).\n * Priority: inputMap > externalMap > baseMap\n * Returns the resolved value tagged with its limit tier.\n *\n * @param {string} name\n * @returns {{ value: string, tier: string }|undefined}\n */\n _resolveName(name) {\n // input and external both count as 'external' tier for limit purposes —\n // they are injected at runtime and are the untrusted surface.\n if (name in this._inputMap) return { value: this._inputMap[name], tier: LIMIT_TIER_EXTERNAL };\n if (name in this._externalMap) return { value: this._externalMap[name], tier: LIMIT_TIER_EXTERNAL };\n if (name in this._baseMap) return { value: this._baseMap[name], tier: LIMIT_TIER_BASE };\n return undefined;\n }\n\n /**\n * Classify a codepoint and return the minimum action level that must be applied.\n * Returns -1 when no minimum is imposed (normal allow path).\n *\n * Ranges checked (in priority order):\n * 1. U+0000 — null, governed by nullNCR (always ≥ remove)\n * 2. U+D800–U+DFFF — surrogates, always prohibited (min: remove)\n * 3. U+0001–U+001F \\ {0x09,0x0A,0x0D} — XML 1.0 restricted C0 (min: remove)\n * (skipped in XML 1.1 — C0 controls are allowed when written as NCRs)\n *\n * @param {number} cp — codepoint\n * @returns {number} — minimum NCR_LEVEL value, or -1 for no restriction\n */\n _classifyNCR(cp) {\n // 1. Null\n if (cp === 0) return this._ncrNullLevel;\n\n // 2. Surrogates — always prohibited, minimum 'remove'\n if (cp >= 0xD800 && cp <= 0xDFFF) return NCR_LEVEL.remove;\n\n // 3. XML 1.0 restricted C0 controls\n if (this._ncrXmlVersion === 1.0) {\n if (cp >= 0x01 && cp <= 0x1F && !XML10_ALLOWED_C0.has(cp)) return NCR_LEVEL.remove;\n }\n\n return -1; // no restriction\n }\n\n /**\n * Execute a resolved NCR action.\n *\n * @param {number} action — NCR_LEVEL value\n * @param {string} token — raw token (e.g. '#38') for error messages\n * @param {number} cp — codepoint, used only for error messages\n * @returns {string|undefined}\n * - decoded character string → 'allow'\n * - '' → 'remove'\n * - undefined → 'leave' (caller must skip past '&' only)\n * - throws Error → 'throw'\n */\n _applyNCRAction(action, token, cp) {\n switch (action) {\n case NCR_LEVEL.allow: return String.fromCodePoint(cp);\n case NCR_LEVEL.remove: return '';\n case NCR_LEVEL.leave: return undefined; // signal: keep literal\n case NCR_LEVEL.throw:\n throw new Error(\n `[EntityDecoder] Prohibited numeric character reference ` +\n `&${token}; (U+${cp.toString(16).toUpperCase().padStart(4, '0')})`\n );\n default: return String.fromCodePoint(cp);\n }\n }\n\n /**\n * Full NCR resolution pipeline for a numeric token.\n *\n * Steps:\n * 1. Parse the codepoint (decimal or hex).\n * 2. Validate the raw codepoint range (NaN, <0, >0x10FFFF).\n * 3. If numericAllowed is false and no minimum restriction applies → leave as-is.\n * 4. Classify the codepoint to find the minimum required action level.\n * 5. Resolve effective action = max(onNCR, minimum).\n * 6. Apply and return.\n *\n * @param {string} token — e.g. '#38', '#x26', '#X26'\n * @returns {string|undefined}\n * - string (incl. '') — replacement ('' = remove)\n * - undefined — leave original &token; as-is\n */\n _resolveNCR(token) {\n // Step 1: parse codepoint\n const second = token.charCodeAt(1);\n let cp;\n if (second === 120 /* x */ || second === 88 /* X */) {\n cp = parseInt(token.slice(2), 16);\n } else {\n cp = parseInt(token.slice(1), 10);\n }\n\n // Step 2: out-of-range → leave as-is unconditionally\n if (Number.isNaN(cp) || cp < 0 || cp > 0x10FFFF) return undefined;\n\n // Step 3: classify to get minimum action level\n const minimum = this._classifyNCR(cp);\n\n // Step 4: if numericAllowed is false and no hard minimum → leave\n if (!this._numericAllowed && minimum < NCR_LEVEL.remove) return undefined;\n\n // Step 5: effective action = max(configured onNCR, range minimum)\n const effective = minimum === -1\n ? this._ncrOnLevel\n : Math.max(this._ncrOnLevel, minimum);\n\n // Step 6: apply\n return this._applyNCRAction(effective, token, cp);\n }\n}","/**\n * @nodable/entities\n *\n * Standalone, zero-dependency XML/HTML entity replacement.\n *\n\n */\n\nexport { default as EntityDecoder } from './EntityDecoder.js';\nexport {\n COMMON_HTML,\n XML,\n ALL_ENTITIES,\n ARROWS,\n BASIC_LATIN,\n CURRENCY,\n MATH,\n MATH_ADVANCED,\n CYRILLIC,\n FRACTIONS,\n GREEK,\n LATIN_ACCENTS,\n LATIN_EXTENDED,\n MISC_SYMBOLS,\n PUNCTUATION,\n SHAPES,\n} from './entities.js';\n\nexport { default as EntityEncoder } from './EntityEncoder.js';","import { DANGEROUS_PROPERTY_NAMES, criticalProperties } from \"../util.js\";\nimport { COMMON_HTML, CURRENCY } from '@nodable/entities';\n\nconst defaultOnDangerousProperty = (name) => {\n if (DANGEROUS_PROPERTY_NAMES.includes(name)) {\n return \"__\" + name;\n }\n return name;\n};\n\n\nexport const defaultOptions = {\n preserveOrder: false,\n attributeNamePrefix: '@_',\n attributesGroupName: false,\n textNodeName: '#text',\n ignoreAttributes: true,\n removeNSPrefix: false, // remove NS from tag name or attribute name if true\n allowBooleanAttributes: false, //a tag can have attributes without any value\n //ignoreRootElement : false,\n parseTagValue: true,\n parseAttributeValue: false,\n trimValues: true, //Trim string values of tag and attributes\n cdataPropName: false,\n numberParseOptions: {\n hex: true,\n leadingZeros: true,\n eNotation: true\n },\n tagValueProcessor: function (tagName, val) {\n return val;\n },\n attributeValueProcessor: function (attrName, val) {\n return val;\n },\n stopNodes: [], //nested tags will not be parsed even for errors\n alwaysCreateTextNode: false,\n isArray: () => false,\n commentPropName: false,\n unpairedTags: [],\n processEntities: true,\n htmlEntities: false,\n entityDecoder: null,\n ignoreDeclaration: false,\n ignorePiTags: false,\n transformTagName: false,\n transformAttributeName: false,\n updateTag: function (tagName, jPath, attrs) {\n return tagName\n },\n // skipEmptyListItem: false\n captureMetaData: false,\n maxNestedTags: 100,\n strictReservedNames: true,\n jPath: true, // if true, pass jPath string to callbacks; if false, pass matcher instance\n onDangerousProperty: defaultOnDangerousProperty\n};\n\n\n/**\n * Validates that a property name is safe to use\n * @param {string} propertyName - The property name to validate\n * @param {string} optionName - The option field name (for error message)\n * @throws {Error} If property name is dangerous\n */\nfunction validatePropertyName(propertyName, optionName) {\n if (typeof propertyName !== 'string') {\n return; // Only validate string property names\n }\n\n const normalized = propertyName.toLowerCase();\n if (DANGEROUS_PROPERTY_NAMES.some(dangerous => normalized === dangerous.toLowerCase())) {\n throw new Error(\n `[SECURITY] Invalid ${optionName}: \"${propertyName}\" is a reserved JavaScript keyword that could cause prototype pollution`\n );\n }\n\n if (criticalProperties.some(dangerous => normalized === dangerous.toLowerCase())) {\n throw new Error(\n `[SECURITY] Invalid ${optionName}: \"${propertyName}\" is a reserved JavaScript keyword that could cause prototype pollution`\n );\n }\n}\n\n/**\n * Normalizes processEntities option for backward compatibility\n * @param {boolean|object} value \n * @returns {object} Always returns normalized object\n */\nfunction normalizeProcessEntities(value, htmlEntities) {\n // Boolean backward compatibility\n if (typeof value === 'boolean') {\n return {\n enabled: value, // true or false\n maxEntitySize: 10000,\n maxExpansionDepth: 10000,\n maxTotalExpansions: Infinity,\n maxExpandedLength: 100000,\n maxEntityCount: 1000,\n allowedTags: null,\n tagFilter: null,\n appliesTo: \"all\",\n };\n }\n\n // Object config - merge with defaults\n if (typeof value === 'object' && value !== null) {\n return {\n enabled: value.enabled !== false,\n maxEntitySize: Math.max(1, value.maxEntitySize ?? 10000),\n maxExpansionDepth: Math.max(1, value.maxExpansionDepth ?? 10000),\n maxTotalExpansions: Math.max(1, value.maxTotalExpansions ?? Infinity),\n maxExpandedLength: Math.max(1, value.maxExpandedLength ?? 100000),\n maxEntityCount: Math.max(1, value.maxEntityCount ?? 1000),\n allowedTags: value.allowedTags ?? null,\n tagFilter: value.tagFilter ?? null,\n appliesTo: value.appliesTo ?? \"all\",\n };\n }\n\n // Default to enabled with limits\n return normalizeProcessEntities(true);\n}\n\nexport const buildOptions = function (options) {\n const built = Object.assign({}, defaultOptions, options);\n\n // Validate property names to prevent prototype pollution\n const propertyNameOptions = [\n { value: built.attributeNamePrefix, name: 'attributeNamePrefix' },\n { value: built.attributesGroupName, name: 'attributesGroupName' },\n { value: built.textNodeName, name: 'textNodeName' },\n { value: built.cdataPropName, name: 'cdataPropName' },\n { value: built.commentPropName, name: 'commentPropName' }\n ];\n\n for (const { value, name } of propertyNameOptions) {\n if (value) {\n validatePropertyName(value, name);\n }\n }\n\n if (built.onDangerousProperty === null) {\n built.onDangerousProperty = defaultOnDangerousProperty;\n }\n\n // Always normalize processEntities for backward compatibility and validation\n built.processEntities = normalizeProcessEntities(built.processEntities, built.htmlEntities);\n built.unpairedTagsSet = new Set(built.unpairedTags);\n // Convert old-style stopNodes for backward compatibility\n if (built.stopNodes && Array.isArray(built.stopNodes)) {\n built.stopNodes = built.stopNodes.map(node => {\n if (typeof node === 'string' && node.startsWith('*.')) {\n // Old syntax: *.tagname meant \"tagname anywhere\"\n // Convert to new syntax: ..tagname\n return '..' + node.substring(2);\n }\n return node;\n });\n }\n //console.debug(built.processEntities)\n return built;\n};","'use strict';\n\nlet METADATA_SYMBOL;\n\nif (typeof Symbol !== \"function\") {\n METADATA_SYMBOL = \"@@xmlMetadata\";\n} else {\n METADATA_SYMBOL = Symbol(\"XML Node Metadata\");\n}\n\nexport default class XmlNode {\n constructor(tagname) {\n this.tagname = tagname;\n this.child = []; //nested tags, text, cdata, comments in order\n this[\":@\"] = Object.create(null); //attributes map\n }\n add(key, val) {\n // this.child.push( {name : key, val: val, isCdata: isCdata });\n if (key === \"__proto__\") key = \"#__proto__\";\n this.child.push({ [key]: val });\n }\n addChild(node, startIndex) {\n if (node.tagname === \"__proto__\") node.tagname = \"#__proto__\";\n if (node[\":@\"] && Object.keys(node[\":@\"]).length > 0) {\n this.child.push({ [node.tagname]: node.child, [\":@\"]: node[\":@\"] });\n } else {\n this.child.push({ [node.tagname]: node.child });\n }\n // if requested, add the startIndex\n if (startIndex !== undefined) {\n // Note: for now we just overwrite the metadata. If we had more complex metadata,\n // we might need to do an object append here: metadata = { ...metadata, startIndex }\n this.child[this.child.length - 1][METADATA_SYMBOL] = { startIndex };\n }\n }\n /** symbol used for metadata */\n static getMetaDataSymbol() {\n return METADATA_SYMBOL;\n }\n}\n","import { isName } from '../util.js';\n\nexport default class DocTypeReader {\n constructor(options) {\n this.suppressValidationErr = !options;\n this.options = options;\n }\n\n readDocType(xmlData, i) {\n const entities = Object.create(null);\n let entityCount = 0;\n\n if (xmlData[i + 3] === 'O' &&\n xmlData[i + 4] === 'C' &&\n xmlData[i + 5] === 'T' &&\n xmlData[i + 6] === 'Y' &&\n xmlData[i + 7] === 'P' &&\n xmlData[i + 8] === 'E') {\n i = i + 9;\n let angleBracketsCount = 1;\n let hasBody = false, comment = false;\n let exp = \"\";\n for (; i < xmlData.length; i++) {\n if (xmlData[i] === '<' && !comment) { //Determine the tag type\n if (hasBody && hasSeq(xmlData, \"!ENTITY\", i)) {\n i += 7;\n let entityName, val;\n [entityName, val, i] = this.readEntityExp(xmlData, i + 1, this.suppressValidationErr);\n if (val.indexOf(\"&\") === -1) { //Parameter entities are not supported\n if (this.options.enabled !== false &&\n this.options.maxEntityCount != null &&\n entityCount >= this.options.maxEntityCount) {\n throw new Error(\n `Entity count (${entityCount + 1}) exceeds maximum allowed (${this.options.maxEntityCount})`\n );\n }\n //const escaped = entityName.replace(/[.\\-+*:]/g, '\\\\.');\n //const escaped = entityName.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n entities[entityName] = val;\n entityCount++;\n }\n }\n else if (hasBody && hasSeq(xmlData, \"!ELEMENT\", i)) {\n i += 8;//Not supported\n const { index } = this.readElementExp(xmlData, i + 1);\n i = index;\n } else if (hasBody && hasSeq(xmlData, \"!ATTLIST\", i)) {\n i += 8;//Not supported\n // const {index} = this.readAttlistExp(xmlData,i+1);\n // i = index;\n } else if (hasBody && hasSeq(xmlData, \"!NOTATION\", i)) {\n i += 9;//Not supported\n const { index } = this.readNotationExp(xmlData, i + 1, this.suppressValidationErr);\n i = index;\n } else if (hasSeq(xmlData, \"!--\", i)) comment = true;\n else throw new Error(`Invalid DOCTYPE`);\n\n angleBracketsCount++;\n exp = \"\";\n } else if (xmlData[i] === '>') { //Read tag content\n if (comment) {\n if (xmlData[i - 1] === \"-\" && xmlData[i - 2] === \"-\") {\n comment = false;\n angleBracketsCount--;\n }\n } else {\n angleBracketsCount--;\n }\n if (angleBracketsCount === 0) {\n break;\n }\n } else if (xmlData[i] === '[') {\n hasBody = true;\n } else {\n exp += xmlData[i];\n }\n }\n if (angleBracketsCount !== 0) {\n throw new Error(`Unclosed DOCTYPE`);\n }\n } else {\n throw new Error(`Invalid Tag instead of DOCTYPE`);\n }\n return { entities, i };\n }\n readEntityExp(xmlData, i) {\n //External entities are not supported\n // \n\n //Parameter entities are not supported\n // \n\n //Internal entities are supported\n // \n\n // Skip leading whitespace after this.options.maxEntitySize) {\n throw new Error(\n `Entity \"${entityName}\" size (${entityValue.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`\n );\n }\n\n i--;\n return [entityName, entityValue, i];\n }\n\n readNotationExp(xmlData, i) {\n // Skip leading whitespace after \n // \n // \n // \n // \n\n // Skip leading whitespace after {\n while (index < data.length && /\\s/.test(data[index])) {\n index++;\n }\n return index;\n};\n\n\n\nfunction hasSeq(data, seq, i) {\n for (let j = 0; j < seq.length; j++) {\n if (seq[j] !== data[i + j + 1]) return false;\n }\n return true;\n}\n\nfunction validateEntityName(name) {\n if (isName(name))\n return name;\n else\n throw new Error(`Invalid entity name ${name}`);\n}","const hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;\nconst numRegex = /^([\\-\\+])?(0*)([0-9]*(\\.[0-9]*)?)$/;\n// const octRegex = /^0x[a-z0-9]+/;\n// const binRegex = /0x[a-z0-9]+/;\n\n\nconst consider = {\n hex: true,\n // oct: false,\n leadingZeros: true,\n decimalPoint: \"\\.\",\n eNotation: true,\n //skipLike: /regex/,\n infinity: \"original\", // \"null\", \"infinity\" (Infinity type), \"string\" (\"Infinity\" (the string literal))\n};\n\nexport default function toNumber(str, options = {}) {\n options = Object.assign({}, consider, options);\n if (!str || typeof str !== \"string\") return str;\n\n let trimmedStr = str.trim();\n\n if (trimmedStr.length === 0) return str;\n else if (options.skipLike !== undefined && options.skipLike.test(trimmedStr)) return str;\n else if (trimmedStr === \"0\") return 0;\n else if (options.hex && hexRegex.test(trimmedStr)) {\n return parse_int(trimmedStr, 16);\n // }else if (options.oct && octRegex.test(str)) {\n // return Number.parseInt(val, 8);\n } else if (!isFinite(trimmedStr)) { //Infinity\n return handleInfinity(str, Number(trimmedStr), options);\n } else if (trimmedStr.includes('e') || trimmedStr.includes('E')) { //eNotation\n return resolveEnotation(str, trimmedStr, options);\n // }else if (options.parseBin && binRegex.test(str)) {\n // return Number.parseInt(val, 2);\n } else {\n //separate negative sign, leading zeros, and rest number\n const match = numRegex.exec(trimmedStr);\n // +00.123 => [ , '+', '00', '.123', ..\n if (match) {\n const sign = match[1] || \"\";\n const leadingZeros = match[2];\n let numTrimmedByZeros = trimZeros(match[3]); //complete num without leading zeros\n const decimalAdjacentToLeadingZeros = sign ? // 0., -00., 000.\n str[leadingZeros.length + 1] === \".\"\n : str[leadingZeros.length] === \".\";\n\n //trim ending zeros for floating number\n if (!options.leadingZeros //leading zeros are not allowed\n && (leadingZeros.length > 1\n || (leadingZeros.length === 1 && !decimalAdjacentToLeadingZeros))) {\n // 00, 00.3, +03.24, 03, 03.24\n return str;\n }\n else {//no leading zeros or leading zeros are allowed\n const num = Number(trimmedStr);\n const parsedStr = String(num);\n\n if (num === 0) return num;\n if (parsedStr.search(/[eE]/) !== -1) { //given number is long and parsed to eNotation\n if (options.eNotation) return num;\n else return str;\n } else if (trimmedStr.indexOf(\".\") !== -1) { //floating number\n if (parsedStr === \"0\") return num; //0.0\n else if (parsedStr === numTrimmedByZeros) return num; //0.456. 0.79000\n else if (parsedStr === `${sign}${numTrimmedByZeros}`) return num;\n else return str;\n }\n\n let n = leadingZeros ? numTrimmedByZeros : trimmedStr;\n if (leadingZeros) {\n // -009 => -9\n return (n === parsedStr) || (sign + n === parsedStr) ? num : str\n } else {\n // +9\n return (n === parsedStr) || (n === sign + parsedStr) ? num : str\n }\n }\n } else { //non-numeric string\n return str;\n }\n }\n}\n\nconst eNotationRegx = /^([-+])?(0*)(\\d*(\\.\\d*)?[eE][-\\+]?\\d+)$/;\nfunction resolveEnotation(str, trimmedStr, options) {\n if (!options.eNotation) return str;\n const notation = trimmedStr.match(eNotationRegx);\n if (notation) {\n let sign = notation[1] || \"\";\n const eChar = notation[3].indexOf(\"e\") === -1 ? \"E\" : \"e\";\n const leadingZeros = notation[2];\n const eAdjacentToLeadingZeros = sign ? // 0E.\n str[leadingZeros.length + 1] === eChar\n : str[leadingZeros.length] === eChar;\n\n if (leadingZeros.length > 1 && eAdjacentToLeadingZeros) return str;\n else if (leadingZeros.length === 1\n && (notation[3].startsWith(`.${eChar}`) || notation[3][0] === eChar)) {\n return Number(trimmedStr);\n } else if (leadingZeros.length > 0) {\n // Has leading zeros — only accept if leadingZeros option allows it\n if (options.leadingZeros && !eAdjacentToLeadingZeros) {\n trimmedStr = (notation[1] || \"\") + notation[3];\n return Number(trimmedStr);\n } else return str;\n } else {\n // No leading zeros — always valid e-notation, parse it\n return Number(trimmedStr);\n }\n } else {\n return str;\n }\n}\n\n/**\n * \n * @param {string} numStr without leading zeros\n * @returns \n */\nfunction trimZeros(numStr) {\n if (numStr && numStr.indexOf(\".\") !== -1) {//float\n numStr = numStr.replace(/0+$/, \"\"); //remove ending zeros\n if (numStr === \".\") numStr = \"0\";\n else if (numStr[0] === \".\") numStr = \"0\" + numStr;\n else if (numStr[numStr.length - 1] === \".\") numStr = numStr.substring(0, numStr.length - 1);\n return numStr;\n }\n return numStr;\n}\n\nfunction parse_int(numStr, base) {\n //polyfill\n if (parseInt) return parseInt(numStr, base);\n else if (Number.parseInt) return Number.parseInt(numStr, base);\n else if (window && window.parseInt) return window.parseInt(numStr, base);\n else throw new Error(\"parseInt, Number.parseInt, window.parseInt are not supported\")\n}\n\n/**\n * Handle infinite values based on user option\n * @param {string} str - original input string\n * @param {number} num - parsed number (Infinity or -Infinity)\n * @param {object} options - user options\n * @returns {string|number|null} based on infinity option\n */\nfunction handleInfinity(str, num, options) {\n const isPositive = num === Infinity;\n\n switch (options.infinity.toLowerCase()) {\n case \"null\":\n return null;\n case \"infinity\":\n return num; // Return Infinity or -Infinity\n case \"string\":\n return isPositive ? \"Infinity\" : \"-Infinity\";\n case \"original\":\n default:\n return str; // Return original string like \"1e1000\"\n }\n}","export default function getIgnoreAttributesFn(ignoreAttributes) {\n if (typeof ignoreAttributes === 'function') {\n return ignoreAttributes\n }\n if (Array.isArray(ignoreAttributes)) {\n return (attrName) => {\n for (const pattern of ignoreAttributes) {\n if (typeof pattern === 'string' && attrName === pattern) {\n return true\n }\n if (pattern instanceof RegExp && pattern.test(attrName)) {\n return true\n }\n }\n }\n }\n return () => false\n}","/**\n * Expression - Parses and stores a tag pattern expression\n * \n * Patterns are parsed once and stored in an optimized structure for fast matching.\n * \n * @example\n * const expr = new Expression(\"root.users.user\");\n * const expr2 = new Expression(\"..user[id]:first\");\n * const expr3 = new Expression(\"root/users/user\", { separator: '/' });\n */\nexport default class Expression {\n /**\n * Create a new Expression\n * @param {string} pattern - Pattern string (e.g., \"root.users.user\", \"..user[id]\")\n * @param {Object} options - Configuration options\n * @param {string} options.separator - Path separator (default: '.')\n */\n constructor(pattern, options = {}, data) {\n this.pattern = pattern;\n this.separator = options.separator || '.';\n this.segments = this._parse(pattern);\n this.data = data;\n // Cache expensive checks for performance (O(1) instead of O(n))\n this._hasDeepWildcard = this.segments.some(seg => seg.type === 'deep-wildcard');\n this._hasAttributeCondition = this.segments.some(seg => seg.attrName !== undefined);\n this._hasPositionSelector = this.segments.some(seg => seg.position !== undefined);\n }\n\n /**\n * Parse pattern string into segments\n * @private\n * @param {string} pattern - Pattern to parse\n * @returns {Array} Array of segment objects\n */\n _parse(pattern) {\n const segments = [];\n\n // Split by separator but handle \"..\" specially\n let i = 0;\n let currentPart = '';\n\n while (i < pattern.length) {\n if (pattern[i] === this.separator) {\n // Check if next char is also separator (deep wildcard)\n if (i + 1 < pattern.length && pattern[i + 1] === this.separator) {\n // Flush current part if any\n if (currentPart.trim()) {\n segments.push(this._parseSegment(currentPart.trim()));\n currentPart = '';\n }\n // Add deep wildcard\n segments.push({ type: 'deep-wildcard' });\n i += 2; // Skip both separators\n } else {\n // Regular separator\n if (currentPart.trim()) {\n segments.push(this._parseSegment(currentPart.trim()));\n }\n currentPart = '';\n i++;\n }\n } else {\n currentPart += pattern[i];\n i++;\n }\n }\n\n // Flush remaining part\n if (currentPart.trim()) {\n segments.push(this._parseSegment(currentPart.trim()));\n }\n\n return segments;\n }\n\n /**\n * Parse a single segment\n * @private\n * @param {string} part - Segment string (e.g., \"user\", \"ns::user\", \"user[id]\", \"ns::user:first\")\n * @returns {Object} Segment object\n */\n _parseSegment(part) {\n const segment = { type: 'tag' };\n\n // NEW NAMESPACE SYNTAX (v2.0):\n // ============================\n // Namespace uses DOUBLE colon (::)\n // Position uses SINGLE colon (:)\n // \n // Examples:\n // \"user\" → tag\n // \"user:first\" → tag + position\n // \"user[id]\" → tag + attribute\n // \"user[id]:first\" → tag + attribute + position\n // \"ns::user\" → namespace + tag\n // \"ns::user:first\" → namespace + tag + position\n // \"ns::user[id]\" → namespace + tag + attribute\n // \"ns::user[id]:first\" → namespace + tag + attribute + position\n // \"ns::first\" → namespace + tag named \"first\" (NO ambiguity!)\n //\n // This eliminates all ambiguity:\n // :: = namespace separator\n // : = position selector\n // [] = attributes\n\n // Step 1: Extract brackets [attr] or [attr=value]\n let bracketContent = null;\n let withoutBrackets = part;\n\n const bracketMatch = part.match(/^([^\\[]+)(\\[[^\\]]*\\])(.*)$/);\n if (bracketMatch) {\n withoutBrackets = bracketMatch[1] + bracketMatch[3];\n if (bracketMatch[2]) {\n const content = bracketMatch[2].slice(1, -1);\n if (content) {\n bracketContent = content;\n }\n }\n }\n\n // Step 2: Check for namespace (double colon ::)\n let namespace = undefined;\n let tagAndPosition = withoutBrackets;\n\n if (withoutBrackets.includes('::')) {\n const nsIndex = withoutBrackets.indexOf('::');\n namespace = withoutBrackets.substring(0, nsIndex).trim();\n tagAndPosition = withoutBrackets.substring(nsIndex + 2).trim(); // Skip ::\n\n if (!namespace) {\n throw new Error(`Invalid namespace in pattern: ${part}`);\n }\n }\n\n // Step 3: Parse tag and position (single colon :)\n let tag = undefined;\n let positionMatch = null;\n\n if (tagAndPosition.includes(':')) {\n const colonIndex = tagAndPosition.lastIndexOf(':'); // Use last colon for position\n const tagPart = tagAndPosition.substring(0, colonIndex).trim();\n const posPart = tagAndPosition.substring(colonIndex + 1).trim();\n\n // Verify position is a valid keyword\n const isPositionKeyword = ['first', 'last', 'odd', 'even'].includes(posPart) ||\n /^nth\\(\\d+\\)$/.test(posPart);\n\n if (isPositionKeyword) {\n tag = tagPart;\n positionMatch = posPart;\n } else {\n // Not a valid position keyword, treat whole thing as tag\n tag = tagAndPosition;\n }\n } else {\n tag = tagAndPosition;\n }\n\n if (!tag) {\n throw new Error(`Invalid segment pattern: ${part}`);\n }\n\n segment.tag = tag;\n if (namespace) {\n segment.namespace = namespace;\n }\n\n // Step 4: Parse attributes\n if (bracketContent) {\n if (bracketContent.includes('=')) {\n const eqIndex = bracketContent.indexOf('=');\n segment.attrName = bracketContent.substring(0, eqIndex).trim();\n segment.attrValue = bracketContent.substring(eqIndex + 1).trim();\n } else {\n segment.attrName = bracketContent.trim();\n }\n }\n\n // Step 5: Parse position selector\n if (positionMatch) {\n const nthMatch = positionMatch.match(/^nth\\((\\d+)\\)$/);\n if (nthMatch) {\n segment.position = 'nth';\n segment.positionValue = parseInt(nthMatch[1], 10);\n } else {\n segment.position = positionMatch;\n }\n }\n\n return segment;\n }\n\n /**\n * Get the number of segments\n * @returns {number}\n */\n get length() {\n return this.segments.length;\n }\n\n /**\n * Check if expression contains deep wildcard\n * @returns {boolean}\n */\n hasDeepWildcard() {\n return this._hasDeepWildcard;\n }\n\n /**\n * Check if expression has attribute conditions\n * @returns {boolean}\n */\n hasAttributeCondition() {\n return this._hasAttributeCondition;\n }\n\n /**\n * Check if expression has position selectors\n * @returns {boolean}\n */\n hasPositionSelector() {\n return this._hasPositionSelector;\n }\n\n /**\n * Get string representation\n * @returns {string}\n */\n toString() {\n return this.pattern;\n }\n}","/**\n * ExpressionSet - An indexed collection of Expressions for efficient bulk matching\n *\n * Instead of iterating all expressions on every tag, ExpressionSet pre-indexes\n * them at insertion time by depth and terminal tag name. At match time, only\n * the relevant bucket is evaluated — typically reducing checks from O(E) to O(1)\n * lookup plus O(small bucket) matches.\n *\n * Three buckets are maintained:\n * - `_byDepthAndTag` — exact depth + exact tag name (tightest, used first)\n * - `_wildcardByDepth` — exact depth + wildcard tag `*` (depth-matched only)\n * - `_deepWildcards` — expressions containing `..` (cannot be depth-indexed)\n *\n * @example\n * import { Expression, ExpressionSet } from 'fast-xml-tagger';\n *\n * // Build once at config time\n * const stopNodes = new ExpressionSet();\n * stopNodes.add(new Expression('root.users.user'));\n * stopNodes.add(new Expression('root.config.setting'));\n * stopNodes.add(new Expression('..script'));\n *\n * // Query on every tag — hot path\n * if (stopNodes.matchesAny(matcher)) { ... }\n */\nexport default class ExpressionSet {\n constructor() {\n /** @type {Map} depth:tag → expressions */\n this._byDepthAndTag = new Map();\n\n /** @type {Map} depth → wildcard-tag expressions */\n this._wildcardByDepth = new Map();\n\n /** @type {import('./Expression.js').default[]} expressions containing deep wildcard (..) */\n this._deepWildcards = [];\n\n /** @type {Set} pattern strings already added — used for deduplication */\n this._patterns = new Set();\n\n /** @type {boolean} whether the set is sealed against further additions */\n this._sealed = false;\n }\n\n /**\n * Add an Expression to the set.\n * Duplicate patterns (same pattern string) are silently ignored.\n *\n * @param {import('./Expression.js').default} expression - A pre-constructed Expression instance\n * @returns {this} for chaining\n * @throws {TypeError} if called after seal()\n *\n * @example\n * set.add(new Expression('root.users.user'));\n * set.add(new Expression('..script'));\n */\n add(expression) {\n if (this._sealed) {\n throw new TypeError(\n 'ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.'\n );\n }\n\n // Deduplicate by pattern string\n if (this._patterns.has(expression.pattern)) return this;\n this._patterns.add(expression.pattern);\n\n if (expression.hasDeepWildcard()) {\n this._deepWildcards.push(expression);\n return this;\n }\n\n const depth = expression.length;\n const lastSeg = expression.segments[expression.segments.length - 1];\n const tag = lastSeg?.tag;\n\n if (!tag || tag === '*') {\n // Can index by depth but not by tag\n if (!this._wildcardByDepth.has(depth)) this._wildcardByDepth.set(depth, []);\n this._wildcardByDepth.get(depth).push(expression);\n } else {\n // Tightest bucket: depth + tag\n const key = `${depth}:${tag}`;\n if (!this._byDepthAndTag.has(key)) this._byDepthAndTag.set(key, []);\n this._byDepthAndTag.get(key).push(expression);\n }\n\n return this;\n }\n\n /**\n * Add multiple expressions at once.\n *\n * @param {import('./Expression.js').default[]} expressions - Array of Expression instances\n * @returns {this} for chaining\n *\n * @example\n * set.addAll([\n * new Expression('root.users.user'),\n * new Expression('root.config.setting'),\n * ]);\n */\n addAll(expressions) {\n for (const expr of expressions) this.add(expr);\n return this;\n }\n\n /**\n * Check whether a pattern string is already present in the set.\n *\n * @param {import('./Expression.js').default} expression\n * @returns {boolean}\n */\n has(expression) {\n return this._patterns.has(expression.pattern);\n }\n\n /**\n * Number of expressions in the set.\n * @type {number}\n */\n get size() {\n return this._patterns.size;\n }\n\n /**\n * Seal the set against further modifications.\n * Useful to prevent accidental mutations after config is built.\n * Calling add() or addAll() on a sealed set throws a TypeError.\n *\n * @returns {this}\n */\n seal() {\n this._sealed = true;\n return this;\n }\n\n /**\n * Whether the set has been sealed.\n * @type {boolean}\n */\n get isSealed() {\n return this._sealed;\n }\n\n /**\n * Test whether the matcher's current path matches any expression in the set.\n *\n * Evaluation order (cheapest → most expensive):\n * 1. Exact depth + tag bucket — O(1) lookup, typically 0–2 expressions\n * 2. Depth-only wildcard bucket — O(1) lookup, rare\n * 3. Deep-wildcard list — always checked, but usually small\n *\n * @param {import('./Matcher.js').default} matcher - Matcher instance (or readOnly view)\n * @returns {boolean} true if any expression matches the current path\n *\n * @example\n * if (stopNodes.matchesAny(matcher)) {\n * // handle stop node\n * }\n */\n matchesAny(matcher) {\n return this.findMatch(matcher) !== null;\n }\n /**\n * Find and return the first Expression that matches the matcher's current path.\n *\n * Uses the same evaluation order as matchesAny (cheapest → most expensive):\n * 1. Exact depth + tag bucket\n * 2. Depth-only wildcard bucket\n * 3. Deep-wildcard list\n *\n * @param {import('./Matcher.js').default} matcher - Matcher instance (or readOnly view)\n * @returns {import('./Expression.js').default | null} the first matching Expression, or null\n *\n * @example\n * const expr = stopNodes.findMatch(matcher);\n * if (expr) {\n * // access expr.config, expr.pattern, etc.\n * }\n */\n findMatch(matcher) {\n const depth = matcher.getDepth();\n const tag = matcher.getCurrentTag();\n\n // 1. Tightest bucket — most expressions live here\n const exactKey = `${depth}:${tag}`;\n const exactBucket = this._byDepthAndTag.get(exactKey);\n if (exactBucket) {\n for (let i = 0; i < exactBucket.length; i++) {\n if (matcher.matches(exactBucket[i])) return exactBucket[i];\n }\n }\n\n // 2. Depth-matched wildcard-tag expressions\n const wildcardBucket = this._wildcardByDepth.get(depth);\n if (wildcardBucket) {\n for (let i = 0; i < wildcardBucket.length; i++) {\n if (matcher.matches(wildcardBucket[i])) return wildcardBucket[i];\n }\n }\n\n // 3. Deep wildcards — cannot be pre-filtered by depth or tag\n for (let i = 0; i < this._deepWildcards.length; i++) {\n if (matcher.matches(this._deepWildcards[i])) return this._deepWildcards[i];\n }\n\n return null;\n }\n}\n","import ExpressionSet from \"./ExpressionSet.js\";\n\n/**\n * MatcherView - A lightweight read-only view over a Matcher's internal state.\n *\n * Created once by Matcher and reused across all callbacks. Holds a direct\n * reference to the parent Matcher so it always reflects current parser state\n * with zero copying or freezing overhead.\n *\n * Users receive this via {@link Matcher#readOnly} or directly from parser\n * callbacks. It exposes all query and matching methods but has no mutation\n * methods — misuse is caught at the TypeScript level rather than at runtime.\n *\n * @example\n * const matcher = new Matcher();\n * const view = matcher.readOnly();\n *\n * matcher.push(\"root\", {});\n * view.getCurrentTag(); // \"root\"\n * view.getDepth(); // 1\n */\nexport class MatcherView {\n /**\n * @param {Matcher} matcher - The parent Matcher instance to read from.\n */\n constructor(matcher) {\n this._matcher = matcher;\n }\n\n /**\n * Get the path separator used by the parent matcher.\n * @returns {string}\n */\n get separator() {\n return this._matcher.separator;\n }\n\n /**\n * Get current tag name.\n * @returns {string|undefined}\n */\n getCurrentTag() {\n const path = this._matcher.path;\n return path.length > 0 ? path[path.length - 1].tag : undefined;\n }\n\n /**\n * Get current namespace.\n * @returns {string|undefined}\n */\n getCurrentNamespace() {\n const path = this._matcher.path;\n return path.length > 0 ? path[path.length - 1].namespace : undefined;\n }\n\n /**\n * Get current node's attribute value.\n * @param {string} attrName\n * @returns {*}\n */\n getAttrValue(attrName) {\n const path = this._matcher.path;\n if (path.length === 0) return undefined;\n return path[path.length - 1].values?.[attrName];\n }\n\n /**\n * Check if current node has an attribute.\n * @param {string} attrName\n * @returns {boolean}\n */\n hasAttr(attrName) {\n const path = this._matcher.path;\n if (path.length === 0) return false;\n const current = path[path.length - 1];\n return current.values !== undefined && attrName in current.values;\n }\n\n /**\n * Get current node's sibling position (child index in parent).\n * @returns {number}\n */\n getPosition() {\n const path = this._matcher.path;\n if (path.length === 0) return -1;\n return path[path.length - 1].position ?? 0;\n }\n\n /**\n * Get current node's repeat counter (occurrence count of this tag name).\n * @returns {number}\n */\n getCounter() {\n const path = this._matcher.path;\n if (path.length === 0) return -1;\n return path[path.length - 1].counter ?? 0;\n }\n\n /**\n * Get current node's sibling index (alias for getPosition).\n * @returns {number}\n * @deprecated Use getPosition() or getCounter() instead\n */\n getIndex() {\n return this.getPosition();\n }\n\n /**\n * Get current path depth.\n * @returns {number}\n */\n getDepth() {\n return this._matcher.path.length;\n }\n\n /**\n * Get path as string.\n * @param {string} [separator] - Optional separator (uses default if not provided)\n * @param {boolean} [includeNamespace=true]\n * @returns {string}\n */\n toString(separator, includeNamespace = true) {\n return this._matcher.toString(separator, includeNamespace);\n }\n\n /**\n * Get path as array of tag names.\n * @returns {string[]}\n */\n toArray() {\n return this._matcher.path.map(n => n.tag);\n }\n\n /**\n * Match current path against an Expression.\n * @param {Expression} expression\n * @returns {boolean}\n */\n matches(expression) {\n return this._matcher.matches(expression);\n }\n\n /**\n * Match any expression in the given set against the current path.\n * @param {ExpressionSet} exprSet\n * @returns {boolean}\n */\n matchesAny(exprSet) {\n return exprSet.matchesAny(this._matcher);\n }\n}\n\n/**\n * Matcher - Tracks current path in XML/JSON tree and matches against Expressions.\n *\n * The matcher maintains a stack of nodes representing the current path from root to\n * current tag. It only stores attribute values for the current (top) node to minimize\n * memory usage. Sibling tracking is used to auto-calculate position and counter.\n *\n * Use {@link Matcher#readOnly} to obtain a {@link MatcherView} safe to pass to\n * user callbacks — it always reflects current state with no Proxy overhead.\n *\n * @example\n * const matcher = new Matcher();\n * matcher.push(\"root\", {});\n * matcher.push(\"users\", {});\n * matcher.push(\"user\", { id: \"123\", type: \"admin\" });\n *\n * const expr = new Expression(\"root.users.user\");\n * matcher.matches(expr); // true\n */\nexport default class Matcher {\n /**\n * Create a new Matcher.\n * @param {Object} [options={}]\n * @param {string} [options.separator='.'] - Default path separator\n */\n constructor(options = {}) {\n this.separator = options.separator || '.';\n this.path = [];\n this.siblingStacks = [];\n // Each path node: { tag, values, position, counter, namespace? }\n // values only present for current (last) node\n // Each siblingStacks entry: Map tracking occurrences at each level\n this._pathStringCache = null;\n this._view = new MatcherView(this);\n }\n\n /**\n * Push a new tag onto the path.\n * @param {string} tagName\n * @param {Object|null} [attrValues=null]\n * @param {string|null} [namespace=null]\n */\n push(tagName, attrValues = null, namespace = null) {\n this._pathStringCache = null;\n\n // Remove values from previous current node (now becoming ancestor)\n if (this.path.length > 0) {\n this.path[this.path.length - 1].values = undefined;\n }\n\n // Get or create sibling tracking for current level\n const currentLevel = this.path.length;\n if (!this.siblingStacks[currentLevel]) {\n this.siblingStacks[currentLevel] = new Map();\n }\n\n const siblings = this.siblingStacks[currentLevel];\n\n // Create a unique key for sibling tracking that includes namespace\n const siblingKey = namespace ? `${namespace}:${tagName}` : tagName;\n\n // Calculate counter (how many times this tag appeared at this level)\n const counter = siblings.get(siblingKey) || 0;\n\n // Calculate position (total children at this level so far)\n let position = 0;\n for (const count of siblings.values()) {\n position += count;\n }\n\n // Update sibling count for this tag\n siblings.set(siblingKey, counter + 1);\n\n // Create new node\n const node = {\n tag: tagName,\n position: position,\n counter: counter\n };\n\n if (namespace !== null && namespace !== undefined) {\n node.namespace = namespace;\n }\n\n if (attrValues !== null && attrValues !== undefined) {\n node.values = attrValues;\n }\n\n this.path.push(node);\n }\n\n /**\n * Pop the last tag from the path.\n * @returns {Object|undefined} The popped node\n */\n pop() {\n if (this.path.length === 0) return undefined;\n this._pathStringCache = null;\n\n const node = this.path.pop();\n\n if (this.siblingStacks.length > this.path.length + 1) {\n this.siblingStacks.length = this.path.length + 1;\n }\n\n return node;\n }\n\n /**\n * Update current node's attribute values.\n * Useful when attributes are parsed after push.\n * @param {Object} attrValues\n */\n updateCurrent(attrValues) {\n if (this.path.length > 0) {\n const current = this.path[this.path.length - 1];\n if (attrValues !== null && attrValues !== undefined) {\n current.values = attrValues;\n }\n }\n }\n\n /**\n * Get current tag name.\n * @returns {string|undefined}\n */\n getCurrentTag() {\n return this.path.length > 0 ? this.path[this.path.length - 1].tag : undefined;\n }\n\n /**\n * Get current namespace.\n * @returns {string|undefined}\n */\n getCurrentNamespace() {\n return this.path.length > 0 ? this.path[this.path.length - 1].namespace : undefined;\n }\n\n /**\n * Get current node's attribute value.\n * @param {string} attrName\n * @returns {*}\n */\n getAttrValue(attrName) {\n if (this.path.length === 0) return undefined;\n return this.path[this.path.length - 1].values?.[attrName];\n }\n\n /**\n * Check if current node has an attribute.\n * @param {string} attrName\n * @returns {boolean}\n */\n hasAttr(attrName) {\n if (this.path.length === 0) return false;\n const current = this.path[this.path.length - 1];\n return current.values !== undefined && attrName in current.values;\n }\n\n /**\n * Get current node's sibling position (child index in parent).\n * @returns {number}\n */\n getPosition() {\n if (this.path.length === 0) return -1;\n return this.path[this.path.length - 1].position ?? 0;\n }\n\n /**\n * Get current node's repeat counter (occurrence count of this tag name).\n * @returns {number}\n */\n getCounter() {\n if (this.path.length === 0) return -1;\n return this.path[this.path.length - 1].counter ?? 0;\n }\n\n /**\n * Get current node's sibling index (alias for getPosition).\n * @returns {number}\n * @deprecated Use getPosition() or getCounter() instead\n */\n getIndex() {\n return this.getPosition();\n }\n\n /**\n * Get current path depth.\n * @returns {number}\n */\n getDepth() {\n return this.path.length;\n }\n\n /**\n * Get path as string.\n * @param {string} [separator] - Optional separator (uses default if not provided)\n * @param {boolean} [includeNamespace=true]\n * @returns {string}\n */\n toString(separator, includeNamespace = true) {\n const sep = separator || this.separator;\n const isDefault = (sep === this.separator && includeNamespace === true);\n\n if (isDefault) {\n if (this._pathStringCache !== null) {\n return this._pathStringCache;\n }\n const result = this.path.map(n =>\n (n.namespace) ? `${n.namespace}:${n.tag}` : n.tag\n ).join(sep);\n this._pathStringCache = result;\n return result;\n }\n\n return this.path.map(n =>\n (includeNamespace && n.namespace) ? `${n.namespace}:${n.tag}` : n.tag\n ).join(sep);\n }\n\n /**\n * Get path as array of tag names.\n * @returns {string[]}\n */\n toArray() {\n return this.path.map(n => n.tag);\n }\n\n /**\n * Reset the path to empty.\n */\n reset() {\n this._pathStringCache = null;\n this.path = [];\n this.siblingStacks = [];\n }\n\n /**\n * Match current path against an Expression.\n * @param {Expression} expression\n * @returns {boolean}\n */\n matches(expression) {\n const segments = expression.segments;\n\n if (segments.length === 0) {\n return false;\n }\n\n if (expression.hasDeepWildcard()) {\n return this._matchWithDeepWildcard(segments);\n }\n\n return this._matchSimple(segments);\n }\n\n /**\n * @private\n */\n _matchSimple(segments) {\n if (this.path.length !== segments.length) {\n return false;\n }\n\n for (let i = 0; i < segments.length; i++) {\n if (!this._matchSegment(segments[i], this.path[i], i === this.path.length - 1)) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * @private\n */\n _matchWithDeepWildcard(segments) {\n let pathIdx = this.path.length - 1;\n let segIdx = segments.length - 1;\n\n while (segIdx >= 0 && pathIdx >= 0) {\n const segment = segments[segIdx];\n\n if (segment.type === 'deep-wildcard') {\n segIdx--;\n\n if (segIdx < 0) {\n return true;\n }\n\n const nextSeg = segments[segIdx];\n let found = false;\n\n for (let i = pathIdx; i >= 0; i--) {\n if (this._matchSegment(nextSeg, this.path[i], i === this.path.length - 1)) {\n pathIdx = i - 1;\n segIdx--;\n found = true;\n break;\n }\n }\n\n if (!found) {\n return false;\n }\n } else {\n if (!this._matchSegment(segment, this.path[pathIdx], pathIdx === this.path.length - 1)) {\n return false;\n }\n pathIdx--;\n segIdx--;\n }\n }\n\n return segIdx < 0;\n }\n\n /**\n * @private\n */\n _matchSegment(segment, node, isCurrentNode) {\n if (segment.tag !== '*' && segment.tag !== node.tag) {\n return false;\n }\n\n if (segment.namespace !== undefined) {\n if (segment.namespace !== '*' && segment.namespace !== node.namespace) {\n return false;\n }\n }\n\n if (segment.attrName !== undefined) {\n if (!isCurrentNode) {\n return false;\n }\n\n if (!node.values || !(segment.attrName in node.values)) {\n return false;\n }\n\n if (segment.attrValue !== undefined) {\n if (String(node.values[segment.attrName]) !== String(segment.attrValue)) {\n return false;\n }\n }\n }\n\n if (segment.position !== undefined) {\n if (!isCurrentNode) {\n return false;\n }\n\n const counter = node.counter ?? 0;\n\n if (segment.position === 'first' && counter !== 0) {\n return false;\n } else if (segment.position === 'odd' && counter % 2 !== 1) {\n return false;\n } else if (segment.position === 'even' && counter % 2 !== 0) {\n return false;\n } else if (segment.position === 'nth' && counter !== segment.positionValue) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Match any expression in the given set against the current path.\n * @param {ExpressionSet} exprSet\n * @returns {boolean}\n */\n matchesAny(exprSet) {\n return exprSet.matchesAny(this);\n }\n\n /**\n * Create a snapshot of current state.\n * @returns {Object}\n */\n snapshot() {\n return {\n path: this.path.map(node => ({ ...node })),\n siblingStacks: this.siblingStacks.map(map => new Map(map))\n };\n }\n\n /**\n * Restore state from snapshot.\n * @param {Object} snapshot\n */\n restore(snapshot) {\n this._pathStringCache = null;\n this.path = snapshot.path.map(node => ({ ...node }));\n this.siblingStacks = snapshot.siblingStacks.map(map => new Map(map));\n }\n\n /**\n * Return the read-only {@link MatcherView} for this matcher.\n *\n * The same instance is returned on every call — no allocation occurs.\n * It always reflects the current parser state and is safe to pass to\n * user callbacks without risk of accidental mutation.\n *\n * @returns {MatcherView}\n *\n * @example\n * const view = matcher.readOnly();\n * // pass view to callbacks — it stays in sync automatically\n * view.matches(expr); // ✓\n * view.getCurrentTag(); // ✓\n * // view.push(...) // ✗ method does not exist — caught by TypeScript\n */\n readOnly() {\n return this._view;\n }\n}","/**\n * fast-xml-tagger - XML/JSON path matching library\n * \n * Provides efficient path tracking and pattern matching for XML/JSON parsers.\n * \n * @example\n * import { Expression, Matcher } from 'fast-xml-tagger';\n * \n * // Create expression (parse once)\n * const expr = new Expression(\"root.users.user[id]\");\n * \n * // Create matcher (track path)\n * const matcher = new Matcher();\n * matcher.push(\"root\", [], {}, 0);\n * matcher.push(\"users\", [], {}, 0);\n * matcher.push(\"user\", [\"id\", \"type\"], { id: \"123\", type: \"admin\" }, 0);\n * \n * // Match\n * if (matcher.matches(expr)) {\n * console.log(\"Match found!\");\n * }\n */\n\nimport Expression from './Expression.js';\nimport Matcher from './Matcher.js';\nimport ExpressionSet from './ExpressionSet.js';\n\nexport { Expression, Matcher, ExpressionSet };\nexport default { Expression, Matcher, ExpressionSet };\n","'use strict';\n///@ts-check\n\nimport { getAllMatches, isExist, DANGEROUS_PROPERTY_NAMES, criticalProperties } from '../util.js';\nimport xmlNode from './xmlNode.js';\nimport DocTypeReader from './DocTypeReader.js';\nimport toNumber from \"strnum\";\nimport getIgnoreAttributesFn from \"../ignoreAttributes.js\";\nimport { Expression, Matcher } from 'path-expression-matcher';\nimport { ExpressionSet } from 'path-expression-matcher';\nimport { EntityDecoder, XML, CURRENCY, COMMON_HTML } from '@nodable/entities';\n\n// const regx =\n// '<((!\\\\[CDATA\\\\[([\\\\s\\\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\\\/)(NAME)\\\\s*>))([^<]*)'\n// .replace(/NAME/g, util.nameRegexp);\n\n//const tagsRegx = new RegExp(\"<(\\\\/?[\\\\w:\\\\-\\._]+)([^>]*)>(\\\\s*\"+cdataRegx+\")*([^<]+)?\",\"g\");\n//const tagsRegx = new RegExp(\"<(\\\\/?)((\\\\w*:)?([\\\\w:\\\\-\\._]+))([^>]*)>([^<]*)(\"+cdataRegx+\"([^<]*))*([^<]+)?\",\"g\");\n\n// Helper functions for attribute and namespace handling\n\n/**\n * Extract raw attributes (without prefix) from prefixed attribute map\n * @param {object} prefixedAttrs - Attributes with prefix from buildAttributesMap\n * @param {object} options - Parser options containing attributeNamePrefix\n * @returns {object} Raw attributes for matcher\n */\nfunction extractRawAttributes(prefixedAttrs, options) {\n if (!prefixedAttrs) return {};\n\n // Handle attributesGroupName option\n const attrs = options.attributesGroupName\n ? prefixedAttrs[options.attributesGroupName]\n : prefixedAttrs;\n\n if (!attrs) return {};\n\n const rawAttrs = {};\n for (const key in attrs) {\n // Remove the attribute prefix to get raw name\n if (key.startsWith(options.attributeNamePrefix)) {\n const rawName = key.substring(options.attributeNamePrefix.length);\n rawAttrs[rawName] = attrs[key];\n } else {\n // Attribute without prefix (shouldn't normally happen, but be safe)\n rawAttrs[key] = attrs[key];\n }\n }\n return rawAttrs;\n}\n\n/**\n * Extract namespace from raw tag name\n * @param {string} rawTagName - Tag name possibly with namespace (e.g., \"soap:Envelope\")\n * @returns {string|undefined} Namespace or undefined\n */\nfunction extractNamespace(rawTagName) {\n if (!rawTagName || typeof rawTagName !== 'string') return undefined;\n\n const colonIndex = rawTagName.indexOf(':');\n if (colonIndex !== -1 && colonIndex > 0) {\n const ns = rawTagName.substring(0, colonIndex);\n // Don't treat xmlns as a namespace\n if (ns !== 'xmlns') {\n return ns;\n }\n }\n return undefined;\n}\n\nexport default class OrderedObjParser {\n constructor(options, externalEntities) {\n this.options = options;\n this.currentNode = null;\n this.tagsNodeStack = [];\n this.parseXml = parseXml;\n this.parseTextData = parseTextData;\n this.resolveNameSpace = resolveNameSpace;\n this.buildAttributesMap = buildAttributesMap;\n this.isItStopNode = isItStopNode;\n this.replaceEntitiesValue = replaceEntitiesValue;\n this.readStopNodeData = readStopNodeData;\n this.saveTextToParentTag = saveTextToParentTag;\n this.addChild = addChild;\n this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes)\n this.entityExpansionCount = 0;\n this.currentExpandedLength = 0;\n let namedEntities = { ...XML };\n if (this.options.entityDecoder) {\n this.entityDecoder = this.options.entityDecoder\n } else {\n if (typeof this.options.htmlEntities === \"object\") namedEntities = this.options.htmlEntities;\n else if (this.options.htmlEntities === true) namedEntities = { ...COMMON_HTML, ...CURRENCY };\n this.entityDecoder = new EntityDecoder({\n namedEntities: { ...namedEntities, ...externalEntities },\n numericAllowed: this.options.htmlEntities,\n limit: {\n maxTotalExpansions: this.options.processEntities.maxTotalExpansions,\n maxExpandedLength: this.options.processEntities.maxExpandedLength,\n applyLimitsTo: this.options.processEntities.appliesTo,\n }\n //postCheck: resolved => resolved\n });\n }\n\n // Initialize path matcher for path-expression-matcher\n this.matcher = new Matcher();\n\n // Live read-only proxy of matcher — PEM creates and caches this internally.\n // All user callbacks receive this instead of the mutable matcher.\n this.readonlyMatcher = this.matcher.readOnly();\n\n // Flag to track if current node is a stop node (optimization)\n this.isCurrentNodeStopNode = false;\n\n // Pre-compile stopNodes expressions\n this.stopNodeExpressionsSet = new ExpressionSet();\n const stopNodesOpts = this.options.stopNodes;\n if (stopNodesOpts && stopNodesOpts.length > 0) {\n for (let i = 0; i < stopNodesOpts.length; i++) {\n const stopNodeExp = stopNodesOpts[i];\n if (typeof stopNodeExp === 'string') {\n // Convert string to Expression object\n this.stopNodeExpressionsSet.add(new Expression(stopNodeExp));\n } else if (stopNodeExp instanceof Expression) {\n // Already an Expression object\n this.stopNodeExpressionsSet.add(stopNodeExp);\n }\n }\n this.stopNodeExpressionsSet.seal();\n }\n }\n\n}\n\n\n/**\n * @param {string} val\n * @param {string} tagName\n * @param {string|Matcher} jPath - jPath string or Matcher instance based on options.jPath\n * @param {boolean} dontTrim\n * @param {boolean} hasAttributes\n * @param {boolean} isLeafNode\n * @param {boolean} escapeEntities\n */\nfunction parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) {\n const options = this.options;\n if (val !== undefined) {\n if (options.trimValues && !dontTrim) {\n val = val.trim();\n }\n if (val.length > 0) {\n if (!escapeEntities) val = this.replaceEntitiesValue(val, tagName, jPath);\n\n // Pass jPath string or matcher based on options.jPath setting\n const jPathOrMatcher = options.jPath ? jPath.toString() : jPath;\n const newval = options.tagValueProcessor(tagName, val, jPathOrMatcher, hasAttributes, isLeafNode);\n if (newval === null || newval === undefined) {\n //don't parse\n return val;\n } else if (typeof newval !== typeof val || newval !== val) {\n //overwrite\n return newval;\n } else if (options.trimValues) {\n return parseValue(val, options.parseTagValue, options.numberParseOptions);\n } else {\n const trimmedVal = val.trim();\n if (trimmedVal === val) {\n return parseValue(val, options.parseTagValue, options.numberParseOptions);\n } else {\n return val;\n }\n }\n }\n }\n}\n\nfunction resolveNameSpace(tagname) {\n if (this.options.removeNSPrefix) {\n const tags = tagname.split(':');\n const prefix = tagname.charAt(0) === '/' ? '/' : '';\n if (tags[0] === 'xmlns') {\n return '';\n }\n if (tags.length === 2) {\n tagname = prefix + tags[1];\n }\n }\n return tagname;\n}\n\n//TODO: change regex to capture NS\n//const attrsRegx = new RegExp(\"([\\\\w\\\\-\\\\.\\\\:]+)\\\\s*=\\\\s*(['\\\"])((.|\\n)*?)\\\\2\",\"gm\");\nconst attrsRegx = new RegExp('([^\\\\s=]+)\\\\s*(=\\\\s*([\\'\"])([\\\\s\\\\S]*?)\\\\3)?', 'gm');\n\nfunction buildAttributesMap(attrStr, jPath, tagName, force = false) {\n const options = this.options;\n if (force === true || (options.ignoreAttributes !== true && typeof attrStr === 'string')) {\n // attrStr = attrStr.replace(/\\r?\\n/g, ' ');\n //attrStr = attrStr || attrStr.trim();\n\n const matches = getAllMatches(attrStr, attrsRegx);\n const len = matches.length; //don't make it inline\n const attrs = {};\n\n // Pre-process values once: trim + entity replacement\n // Reused in both matcher update and second pass\n const processedVals = new Array(len);\n let hasRawAttrs = false;\n const rawAttrsForMatcher = {};\n\n for (let i = 0; i < len; i++) {\n const attrName = this.resolveNameSpace(matches[i][1]);\n const oldVal = matches[i][4];\n\n if (attrName.length && oldVal !== undefined) {\n let val = oldVal;\n if (options.trimValues) val = val.trim();\n val = this.replaceEntitiesValue(val, tagName, this.readonlyMatcher);\n processedVals[i] = val;\n\n rawAttrsForMatcher[attrName] = val;\n hasRawAttrs = true;\n }\n }\n\n // Update matcher ONCE before second pass, if applicable\n if (hasRawAttrs && typeof jPath === 'object' && jPath.updateCurrent) {\n jPath.updateCurrent(rawAttrsForMatcher);\n }\n\n // Hoist toString() once — path doesn't change during attribute processing\n const jPathStr = options.jPath ? jPath.toString() : this.readonlyMatcher;\n\n // Second pass: apply processors, build final attrs\n let hasAttrs = false;\n for (let i = 0; i < len; i++) {\n const attrName = this.resolveNameSpace(matches[i][1]);\n\n if (this.ignoreAttributesFn(attrName, jPathStr)) continue;\n\n let aName = options.attributeNamePrefix + attrName;\n\n if (attrName.length) {\n if (options.transformAttributeName) {\n aName = options.transformAttributeName(aName);\n }\n aName = sanitizeName(aName, options);\n\n if (matches[i][4] !== undefined) {\n // Reuse already-processed value — no double entity replacement\n const oldVal = processedVals[i];\n\n const newVal = options.attributeValueProcessor(attrName, oldVal, jPathStr);\n if (newVal === null || newVal === undefined) {\n attrs[aName] = oldVal;\n } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) {\n attrs[aName] = newVal;\n } else {\n attrs[aName] = parseValue(oldVal, options.parseAttributeValue, options.numberParseOptions);\n }\n hasAttrs = true;\n } else if (options.allowBooleanAttributes) {\n attrs[aName] = true;\n hasAttrs = true;\n }\n }\n }\n\n if (!hasAttrs) return;\n\n if (options.attributesGroupName && !options.preserveOrder) {\n const attrCollection = {};\n attrCollection[options.attributesGroupName] = attrs;\n return attrCollection;\n }\n return attrs;\n }\n}\nconst parseXml = function (xmlData) {\n xmlData = xmlData.replace(/\\r\\n?/g, \"\\n\"); //TODO: remove this line\n const xmlObj = new xmlNode('!xml');\n let currentNode = xmlObj;\n let textData = \"\";\n\n // Reset matcher for new document\n this.matcher.reset();\n this.entityDecoder.reset();\n\n // Reset entity expansion counters for this document\n this.entityExpansionCount = 0;\n this.currentExpandedLength = 0;\n const options = this.options;\n const docTypeReader = new DocTypeReader(options.processEntities);\n const xmlLen = xmlData.length;\n for (let i = 0; i < xmlLen; i++) {//for each char in XML data\n const ch = xmlData[i];\n if (ch === '<') {\n // const nextIndex = i+1;\n // const _2ndChar = xmlData[nextIndex];\n const c1 = xmlData.charCodeAt(i + 1);\n if (c1 === 47) {//Closing Tag '/'\n const closeIndex = findClosingIndex(xmlData, \">\", i, \"Closing Tag is not closed.\")\n let tagName = xmlData.substring(i + 2, closeIndex).trim();\n\n if (options.removeNSPrefix) {\n const colonIndex = tagName.indexOf(\":\");\n if (colonIndex !== -1) {\n tagName = tagName.substr(colonIndex + 1);\n }\n }\n\n tagName = transformTagName(options.transformTagName, tagName, \"\", options).tagName;\n\n if (currentNode) {\n textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);\n }\n\n //check if last tag of nested tag was unpaired tag\n const lastTagName = this.matcher.getCurrentTag();\n if (tagName && options.unpairedTagsSet.has(tagName)) {\n throw new Error(`Unpaired tag can not be used as closing tag: `);\n }\n if (lastTagName && options.unpairedTagsSet.has(lastTagName)) {\n // Pop the unpaired tag\n this.matcher.pop();\n this.tagsNodeStack.pop();\n }\n // Pop the closing tag\n this.matcher.pop();\n this.isCurrentNodeStopNode = false; // Reset flag when closing tag\n\n currentNode = this.tagsNodeStack.pop();//avoid recursion, set the parent tag scope\n textData = \"\";\n i = closeIndex;\n } else if (c1 === 63) { //'?'\n\n let tagData = readTagExp(xmlData, i, false, \"?>\");\n if (!tagData) throw new Error(\"Pi Tag is not closed.\");\n\n textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);\n const attsMap = this.buildAttributesMap(tagData.tagExp, this.matcher, tagData.tagName, true);\n if (attsMap) {\n const ver = attsMap[this.options.attributeNamePrefix + \"version\"];\n this.entityDecoder.setXmlVersion(Number(ver) || 1.0);\n }\n if ((options.ignoreDeclaration && tagData.tagName === \"?xml\") || options.ignorePiTags) {\n //do nothing\n } else {\n\n const childNode = new xmlNode(tagData.tagName);\n childNode.add(options.textNodeName, \"\");\n\n if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent && options.ignoreAttributes !== true) {\n childNode[\":@\"] = attsMap\n }\n this.addChild(currentNode, childNode, this.readonlyMatcher, i);\n }\n\n\n i = tagData.closeIndex + 1;\n } else if (c1 === 33\n && xmlData.charCodeAt(i + 2) === 45\n && xmlData.charCodeAt(i + 3) === 45) { //'!--'\n const endIndex = findClosingIndex(xmlData, \"-->\", i + 4, \"Comment is not closed.\")\n if (options.commentPropName) {\n const comment = xmlData.substring(i + 4, endIndex - 2);\n\n textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);\n\n currentNode.add(options.commentPropName, [{ [options.textNodeName]: comment }]);\n }\n i = endIndex;\n } else if (c1 === 33\n && xmlData.charCodeAt(i + 2) === 68) { //'!D'\n const result = docTypeReader.readDocType(xmlData, i);\n this.entityDecoder.addInputEntities(result.entities);\n i = result.i;\n } else if (c1 === 33\n && xmlData.charCodeAt(i + 2) === 91) { // '!['\n const closeIndex = findClosingIndex(xmlData, \"]]>\", i, \"CDATA is not closed.\") - 2;\n const tagExp = xmlData.substring(i + 9, closeIndex);\n\n textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);\n\n let val = this.parseTextData(tagExp, currentNode.tagname, this.readonlyMatcher, true, false, true, true);\n if (val == undefined) val = \"\";\n\n //cdata should be set even if it is 0 length string\n if (options.cdataPropName) {\n currentNode.add(options.cdataPropName, [{ [options.textNodeName]: tagExp }]);\n } else {\n currentNode.add(options.textNodeName, val);\n }\n\n i = closeIndex + 2;\n } else {//Opening tag\n let result = readTagExp(xmlData, i, options.removeNSPrefix);\n\n // Safety check: readTagExp can return undefined\n if (!result) {\n // Log context for debugging\n const context = xmlData.substring(Math.max(0, i - 50), Math.min(xmlLen, i + 50));\n throw new Error(`readTagExp returned undefined at position ${i}. Context: \"${context}\"`);\n }\n\n let tagName = result.tagName;\n const rawTagName = result.rawTagName;\n let tagExp = result.tagExp;\n let attrExpPresent = result.attrExpPresent;\n let closeIndex = result.closeIndex;\n\n ({ tagName, tagExp } = transformTagName(options.transformTagName, tagName, tagExp, options));\n\n if (options.strictReservedNames &&\n (tagName === options.commentPropName\n || tagName === options.cdataPropName\n || tagName === options.textNodeName\n || tagName === options.attributesGroupName\n )) {\n throw new Error(`Invalid tag name: ${tagName}`);\n }\n\n //save text as child node\n if (currentNode && textData) {\n if (currentNode.tagname !== '!xml') {\n //when nested tag is found\n textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher, false);\n }\n }\n\n //check if last tag was unpaired tag\n const lastTag = currentNode;\n if (lastTag && options.unpairedTagsSet.has(lastTag.tagname)) {\n currentNode = this.tagsNodeStack.pop();\n this.matcher.pop();\n }\n\n // Clean up self-closing syntax BEFORE processing attributes\n // This is where tagExp gets the trailing / removed\n let isSelfClosing = false;\n if (tagExp.length > 0 && tagExp.lastIndexOf(\"/\") === tagExp.length - 1) {\n isSelfClosing = true;\n if (tagName[tagName.length - 1] === \"/\") {\n tagName = tagName.substr(0, tagName.length - 1);\n tagExp = tagName;\n } else {\n tagExp = tagExp.substr(0, tagExp.length - 1);\n }\n\n // Re-check attrExpPresent after cleaning\n attrExpPresent = (tagName !== tagExp);\n }\n\n // Now process attributes with CLEAN tagExp (no trailing /)\n let prefixedAttrs = null;\n let rawAttrs = {};\n let namespace = undefined;\n\n // Extract namespace from rawTagName\n namespace = extractNamespace(rawTagName);\n\n // Push tag to matcher FIRST (with empty attrs for now) so callbacks see correct path\n if (tagName !== xmlObj.tagname) {\n this.matcher.push(tagName, {}, namespace);\n }\n\n // Now build attributes - callbacks will see correct matcher state\n if (tagName !== tagExp && attrExpPresent) {\n // Build attributes (returns prefixed attributes for the tree)\n // Note: buildAttributesMap now internally updates the matcher with raw attributes\n prefixedAttrs = this.buildAttributesMap(tagExp, this.matcher, tagName);\n\n if (prefixedAttrs) {\n // Extract raw attributes (without prefix) for our use\n //TODO: seems a performance overhead\n rawAttrs = extractRawAttributes(prefixedAttrs, options);\n }\n }\n\n // Now check if this is a stop node (after attributes are set)\n if (tagName !== xmlObj.tagname) {\n this.isCurrentNodeStopNode = this.isItStopNode();\n }\n\n const startIndex = i;\n if (this.isCurrentNodeStopNode) {\n let tagContent = \"\";\n\n // For self-closing tags, content is empty\n if (isSelfClosing) {\n i = result.closeIndex;\n }\n //unpaired tag\n else if (options.unpairedTagsSet.has(tagName)) {\n i = result.closeIndex;\n }\n //normal tag\n else {\n //read until closing tag is found\n const result = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1);\n if (!result) throw new Error(`Unexpected end of ${rawTagName}`);\n i = result.i;\n tagContent = result.tagContent;\n }\n\n const childNode = new xmlNode(tagName);\n\n if (prefixedAttrs) {\n childNode[\":@\"] = prefixedAttrs;\n }\n\n // For stop nodes, store raw content as-is without any processing\n childNode.add(options.textNodeName, tagContent);\n\n this.matcher.pop(); // Pop the stop node tag\n this.isCurrentNodeStopNode = false; // Reset flag\n\n this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);\n } else {\n //selfClosing tag\n if (isSelfClosing) {\n ({ tagName, tagExp } = transformTagName(options.transformTagName, tagName, tagExp, options));\n\n const childNode = new xmlNode(tagName);\n if (prefixedAttrs) {\n childNode[\":@\"] = prefixedAttrs;\n }\n this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);\n this.matcher.pop(); // Pop self-closing tag\n this.isCurrentNodeStopNode = false; // Reset flag\n }\n else if (options.unpairedTagsSet.has(tagName)) {//unpaired tag\n const childNode = new xmlNode(tagName);\n if (prefixedAttrs) {\n childNode[\":@\"] = prefixedAttrs;\n }\n this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);\n this.matcher.pop(); // Pop unpaired tag\n this.isCurrentNodeStopNode = false; // Reset flag\n i = result.closeIndex;\n // Continue to next iteration without changing currentNode\n continue;\n }\n //opening tag\n else {\n const childNode = new xmlNode(tagName);\n if (this.tagsNodeStack.length > options.maxNestedTags) {\n throw new Error(\"Maximum nested tags exceeded\");\n }\n this.tagsNodeStack.push(currentNode);\n\n if (prefixedAttrs) {\n childNode[\":@\"] = prefixedAttrs;\n }\n this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);\n currentNode = childNode;\n }\n textData = \"\";\n i = closeIndex;\n }\n }\n } else {\n textData += xmlData[i];\n }\n }\n return xmlObj.child;\n}\n\nfunction addChild(currentNode, childNode, matcher, startIndex) {\n // unset startIndex if not requested\n if (!this.options.captureMetaData) startIndex = undefined;\n\n // Pass jPath string or matcher based on options.jPath setting\n const jPathOrMatcher = this.options.jPath ? matcher.toString() : matcher;\n const result = this.options.updateTag(childNode.tagname, jPathOrMatcher, childNode[\":@\"])\n if (result === false) {\n //do nothing\n } else if (typeof result === \"string\") {\n childNode.tagname = result\n currentNode.addChild(childNode, startIndex);\n } else {\n currentNode.addChild(childNode, startIndex);\n }\n}\n\n/**\n * @param {object} val - Entity object with regex and val properties\n * @param {string} tagName - Tag name\n * @param {string|Matcher} jPath - jPath string or Matcher instance based on options.jPath\n */\nfunction replaceEntitiesValue(val, tagName, jPath) {\n const entityConfig = this.options.processEntities;\n\n if (!entityConfig || !entityConfig.enabled) {\n return val;\n }\n\n // Check if tag is allowed to contain entities\n if (entityConfig.allowedTags) {\n const jPathOrMatcher = this.options.jPath ? jPath.toString() : jPath;\n const allowed = Array.isArray(entityConfig.allowedTags)\n ? entityConfig.allowedTags.includes(tagName)\n : entityConfig.allowedTags(tagName, jPathOrMatcher);\n\n if (!allowed) {\n return val;\n }\n }\n\n // Apply custom tag filter if provided\n if (entityConfig.tagFilter) {\n const jPathOrMatcher = this.options.jPath ? jPath.toString() : jPath;\n if (!entityConfig.tagFilter(tagName, jPathOrMatcher)) {\n return val; // Skip based on custom filter\n }\n }\n\n return this.entityDecoder.decode(val);\n}\n\n\nfunction saveTextToParentTag(textData, parentNode, matcher, isLeafNode) {\n if (textData) { //store previously collected data as textNode\n if (isLeafNode === undefined) isLeafNode = parentNode.child.length === 0\n\n textData = this.parseTextData(textData,\n parentNode.tagname,\n matcher,\n false,\n parentNode[\":@\"] ? Object.keys(parentNode[\":@\"]).length !== 0 : false,\n isLeafNode);\n\n if (textData !== undefined && textData !== \"\")\n parentNode.add(this.options.textNodeName, textData);\n textData = \"\";\n }\n return textData;\n}\n\n/**\n * @param {Array} stopNodeExpressions - Array of compiled Expression objects\n * @param {Matcher} matcher - Current path matcher\n */\nfunction isItStopNode() {\n if (this.stopNodeExpressionsSet.size === 0) return false;\n\n return this.matcher.matchesAny(this.stopNodeExpressionsSet);\n}\n\n/**\n * Returns the tag Expression and where it is ending handling single-double quotes situation\n * @param {string} xmlData \n * @param {number} i starting index\n * @returns \n */\nfunction tagExpWithClosingIndex(xmlData, i, closingChar = \">\") {\n //TODO: ignore boolean attributes in tag expression\n //TODO: if ignore attributes, dont read full attribute expression but the end. But read for xml declaration\n let attrBoundary = 0;\n const len = xmlData.length;\n const closeCode0 = closingChar.charCodeAt(0);\n const closeCode1 = closingChar.length > 1 ? closingChar.charCodeAt(1) : -1;\n\n let result = '';\n let segmentStart = i;\n\n for (let index = i; index < len; index++) {\n const code = xmlData.charCodeAt(index);\n\n if (attrBoundary) {\n if (code === attrBoundary) attrBoundary = 0;\n } else if (code === 34 || code === 39) { // \" or '\n attrBoundary = code;\n } else if (code === closeCode0) {\n if (closeCode1 !== -1) {\n if (xmlData.charCodeAt(index + 1) === closeCode1) {\n result += xmlData.substring(segmentStart, index);\n return { data: result, index };\n }\n } else {\n result += xmlData.substring(segmentStart, index);\n return { data: result, index };\n }\n } else if (code === 9 && !attrBoundary) { // \\t - only replace with space outside attribute values\n // Flush accumulated segment, add space, start new segment\n result += xmlData.substring(segmentStart, index) + ' ';\n segmentStart = index + 1;\n }\n }\n}\n\nfunction findClosingIndex(xmlData, str, i, errMsg) {\n const closingIndex = xmlData.indexOf(str, i);\n if (closingIndex === -1) {\n throw new Error(errMsg)\n } else {\n return closingIndex + str.length - 1;\n }\n}\n\nfunction findClosingChar(xmlData, char, i, errMsg) {\n const closingIndex = xmlData.indexOf(char, i);\n if (closingIndex === -1) throw new Error(errMsg);\n return closingIndex; // no offset needed\n}\n\nfunction readTagExp(xmlData, i, removeNSPrefix, closingChar = \">\") {\n const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);\n if (!result) return;\n let tagExp = result.data;\n const closeIndex = result.index;\n const separatorIndex = tagExp.search(/\\s/);\n let tagName = tagExp;\n let attrExpPresent = true;\n if (separatorIndex !== -1) {//separate tag name and attributes expression\n tagName = tagExp.substring(0, separatorIndex);\n tagExp = tagExp.substring(separatorIndex + 1).trimStart();\n }\n\n const rawTagName = tagName;\n if (removeNSPrefix) {\n const colonIndex = tagName.indexOf(\":\");\n if (colonIndex !== -1) {\n tagName = tagName.substr(colonIndex + 1);\n attrExpPresent = tagName !== result.data.substr(colonIndex + 1);\n }\n }\n\n return {\n tagName: tagName,\n tagExp: tagExp,\n closeIndex: closeIndex,\n attrExpPresent: attrExpPresent,\n rawTagName: rawTagName,\n }\n}\n/**\n * find paired tag for a stop node\n * @param {string} xmlData \n * @param {string} tagName \n * @param {number} i \n */\nfunction readStopNodeData(xmlData, tagName, i) {\n const startIndex = i;\n // Starting at 1 since we already have an open tag\n let openTagCount = 1;\n\n const xmllen = xmlData.length;\n for (; i < xmllen; i++) {\n if (xmlData[i] === \"<\") {\n const c1 = xmlData.charCodeAt(i + 1);\n if (c1 === 47) {//close tag '/'\n const closeIndex = findClosingChar(xmlData, \">\", i, `${tagName} is not closed`);\n let closeTagName = xmlData.substring(i + 2, closeIndex).trim();\n if (closeTagName === tagName) {\n openTagCount--;\n if (openTagCount === 0) {\n return {\n tagContent: xmlData.substring(startIndex, i),\n i: closeIndex\n }\n }\n }\n i = closeIndex;\n } else if (c1 === 63) { //?\n const closeIndex = findClosingIndex(xmlData, \"?>\", i + 1, \"StopNode is not closed.\")\n i = closeIndex;\n } else if (c1 === 33\n && xmlData.charCodeAt(i + 2) === 45\n && xmlData.charCodeAt(i + 3) === 45) { // '!--'\n const closeIndex = findClosingIndex(xmlData, \"-->\", i + 3, \"StopNode is not closed.\")\n i = closeIndex;\n } else if (c1 === 33\n && xmlData.charCodeAt(i + 2) === 91) { // '!['\n const closeIndex = findClosingIndex(xmlData, \"]]>\", i, \"StopNode is not closed.\") - 2;\n i = closeIndex;\n } else {\n const tagData = readTagExp(xmlData, i, '>')\n\n if (tagData) {\n const openTagName = tagData && tagData.tagName;\n if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== \"/\") {\n openTagCount++;\n }\n i = tagData.closeIndex;\n }\n }\n }\n }//end for loop\n}\n\nfunction parseValue(val, shouldParse, options) {\n if (shouldParse && typeof val === 'string') {\n //console.log(options)\n const newval = val.trim();\n if (newval === 'true') return true;\n else if (newval === 'false') return false;\n else return toNumber(val, options);\n } else {\n if (isExist(val)) {\n return val;\n } else {\n return '';\n }\n }\n}\n\nfunction fromCodePoint(str, base, prefix) {\n const codePoint = Number.parseInt(str, base);\n\n if (codePoint >= 0 && codePoint <= 0x10FFFF) {\n return String.fromCodePoint(codePoint);\n } else {\n return prefix + str + \";\";\n }\n}\n\nfunction transformTagName(fn, tagName, tagExp, options) {\n if (fn) {\n const newTagName = fn(tagName);\n if (tagExp === tagName) {\n tagExp = newTagName\n }\n tagName = newTagName;\n }\n tagName = sanitizeName(tagName, options);\n return { tagName, tagExp };\n}\n\n\n\nfunction sanitizeName(name, options) {\n if (criticalProperties.includes(name)) {\n throw new Error(`[SECURITY] Invalid name: \"${name}\" is a reserved JavaScript keyword that could cause prototype pollution`);\n } else if (DANGEROUS_PROPERTY_NAMES.includes(name)) {\n return options.onDangerousProperty(name);\n }\n return name;\n}","'use strict';\n\nimport XmlNode from './xmlNode.js';\nimport { Matcher } from 'path-expression-matcher';\n\nconst METADATA_SYMBOL = XmlNode.getMetaDataSymbol();\n\n/**\n * Helper function to strip attribute prefix from attribute map\n * @param {object} attrs - Attributes with prefix (e.g., {\"@_class\": \"code\"})\n * @param {string} prefix - Attribute prefix to remove (e.g., \"@_\")\n * @returns {object} Attributes without prefix (e.g., {\"class\": \"code\"})\n */\nfunction stripAttributePrefix(attrs, prefix) {\n if (!attrs || typeof attrs !== 'object') return {};\n if (!prefix) return attrs;\n\n const rawAttrs = {};\n for (const key in attrs) {\n if (key.startsWith(prefix)) {\n const rawName = key.substring(prefix.length);\n rawAttrs[rawName] = attrs[key];\n } else {\n // Attribute without prefix (shouldn't normally happen, but be safe)\n rawAttrs[key] = attrs[key];\n }\n }\n return rawAttrs;\n}\n\n/**\n * \n * @param {array} node \n * @param {any} options \n * @param {Matcher} matcher - Path matcher instance\n * @returns \n */\nexport default function prettify(node, options, matcher, readonlyMatcher) {\n return compress(node, options, matcher, readonlyMatcher);\n}\n\n/**\n * @param {array} arr \n * @param {object} options \n * @param {Matcher} matcher - Path matcher instance\n * @returns object\n */\nfunction compress(arr, options, matcher, readonlyMatcher) {\n let text;\n const compressedObj = {}; //This is intended to be a plain object\n for (let i = 0; i < arr.length; i++) {\n const tagObj = arr[i];\n const property = propName(tagObj);\n\n // Push current property to matcher WITH RAW ATTRIBUTES (no prefix)\n if (property !== undefined && property !== options.textNodeName) {\n const rawAttrs = stripAttributePrefix(\n tagObj[\":@\"] || {},\n options.attributeNamePrefix\n );\n matcher.push(property, rawAttrs);\n }\n\n if (property === options.textNodeName) {\n if (text === undefined) text = tagObj[property];\n else text += \"\" + tagObj[property];\n } else if (property === undefined) {\n continue;\n } else if (tagObj[property]) {\n\n let val = compress(tagObj[property], options, matcher, readonlyMatcher);\n const isLeaf = isLeafTag(val, options);\n\n if (tagObj[\":@\"]) {\n assignAttributes(val, tagObj[\":@\"], readonlyMatcher, options);\n } else if (Object.keys(val).length === 1 && val[options.textNodeName] !== undefined && !options.alwaysCreateTextNode) {\n val = val[options.textNodeName];\n } else if (Object.keys(val).length === 0) {\n if (options.alwaysCreateTextNode) val[options.textNodeName] = \"\";\n else val = \"\";\n }\n\n if (tagObj[METADATA_SYMBOL] !== undefined && typeof val === \"object\" && val !== null) {\n val[METADATA_SYMBOL] = tagObj[METADATA_SYMBOL]; // copy over metadata\n }\n\n\n if (compressedObj[property] !== undefined && Object.prototype.hasOwnProperty.call(compressedObj, property)) {\n if (!Array.isArray(compressedObj[property])) {\n compressedObj[property] = [compressedObj[property]];\n }\n compressedObj[property].push(val);\n } else {\n //TODO: if a node is not an array, then check if it should be an array\n //also determine if it is a leaf node\n\n // Pass jPath string or readonlyMatcher based on options.jPath setting\n const jPathOrMatcher = options.jPath ? readonlyMatcher.toString() : readonlyMatcher;\n if (options.isArray(property, jPathOrMatcher, isLeaf)) {\n compressedObj[property] = [val];\n } else {\n compressedObj[property] = val;\n }\n }\n\n // Pop property from matcher after processing\n if (property !== undefined && property !== options.textNodeName) {\n matcher.pop();\n }\n }\n\n }\n // if(text && text.length > 0) compressedObj[options.textNodeName] = text;\n if (typeof text === \"string\") {\n if (text.length > 0) compressedObj[options.textNodeName] = text;\n } else if (text !== undefined) compressedObj[options.textNodeName] = text;\n\n\n return compressedObj;\n}\n\nfunction propName(obj) {\n const keys = Object.keys(obj);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (key !== \":@\") return key;\n }\n}\n\nfunction assignAttributes(obj, attrMap, readonlyMatcher, options) {\n if (attrMap) {\n const keys = Object.keys(attrMap);\n const len = keys.length; //don't make it inline\n for (let i = 0; i < len; i++) {\n const atrrName = keys[i]; // This is the PREFIXED name (e.g., \"@_class\")\n\n // Strip prefix for matcher path (for isArray callback)\n const rawAttrName = atrrName.startsWith(options.attributeNamePrefix)\n ? atrrName.substring(options.attributeNamePrefix.length)\n : atrrName;\n\n // For attributes, we need to create a temporary path\n // Pass jPath string or matcher based on options.jPath setting\n const jPathOrMatcher = options.jPath\n ? readonlyMatcher.toString() + \".\" + rawAttrName\n : readonlyMatcher;\n\n if (options.isArray(atrrName, jPathOrMatcher, true, true)) {\n obj[atrrName] = [attrMap[atrrName]];\n } else {\n obj[atrrName] = attrMap[atrrName];\n }\n }\n }\n}\n\nfunction isLeafTag(obj, options) {\n const { textNodeName } = options;\n const propCount = Object.keys(obj).length;\n\n if (propCount === 0) {\n return true;\n }\n\n if (\n propCount === 1 &&\n (obj[textNodeName] || typeof obj[textNodeName] === \"boolean\" || obj[textNodeName] === 0)\n ) {\n return true;\n }\n\n return false;\n}","import { buildOptions } from './OptionsBuilder.js';\nimport OrderedObjParser from './OrderedObjParser.js';\nimport prettify from './node2json.js';\nimport { validate } from \"../validator.js\";\nimport XmlNode from './xmlNode.js';\n\nexport default class XMLParser {\n\n constructor(options) {\n this.externalEntities = {};\n this.options = buildOptions(options);\n\n }\n /**\n * Parse XML dats to JS object \n * @param {string|Uint8Array} xmlData \n * @param {boolean|Object} validationOption \n */\n parse(xmlData, validationOption) {\n if (typeof xmlData !== \"string\" && xmlData.toString) {\n xmlData = xmlData.toString();\n } else if (typeof xmlData !== \"string\") {\n throw new Error(\"XML data is accepted in String or Bytes[] form.\")\n }\n\n if (validationOption) {\n if (validationOption === true) validationOption = {}; //validate with default options\n\n const result = validate(xmlData, validationOption);\n if (result !== true) {\n throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`)\n }\n }\n const orderedObjParser = new OrderedObjParser(this.options, this.externalEntities);\n // orderedObjParser.entityDecoder.setExternalEntities(this.externalEntities);\n const orderedResult = orderedObjParser.parseXml(xmlData);\n if (this.options.preserveOrder || orderedResult === undefined) return orderedResult;\n else return prettify(orderedResult, this.options, orderedObjParser.matcher, orderedObjParser.readonlyMatcher);\n }\n\n /**\n * Add Entity which is not by default supported by this library\n * @param {string} key \n * @param {string} value \n */\n addEntity(key, value) {\n if (value.indexOf(\"&\") !== -1) {\n throw new Error(\"Entity value can't have '&'\")\n } else if (key.indexOf(\"&\") !== -1 || key.indexOf(\";\") !== -1) {\n throw new Error(\"An entity must be set without '&' and ';'. Eg. use '#xD' for ' '\")\n } else if (value === \"&\") {\n throw new Error(\"An entity with value '&' is not permitted\");\n } else {\n this.externalEntities[key] = value;\n }\n }\n\n /**\n * Returns a Symbol that can be used to access the metadata\n * property on a node.\n * \n * If Symbol is not available in the environment, an ordinary property is used\n * and the name of the property is here returned.\n * \n * The XMLMetaData property is only present when `captureMetaData`\n * is true in the options.\n */\n static getMetaDataSymbol() {\n return XmlNode.getMetaDataSymbol();\n }\n}","import { Expression, Matcher } from 'path-expression-matcher';\n\nconst EOL = \"\\n\";\n\n/**\n * \n * @param {array} jArray \n * @param {any} options \n * @returns \n */\nexport default function toXml(jArray, options) {\n let indentation = \"\";\n if (options.format && options.indentBy.length > 0) {\n indentation = EOL;\n }\n\n // Pre-compile stopNode expressions for pattern matching\n const stopNodeExpressions = [];\n if (options.stopNodes && Array.isArray(options.stopNodes)) {\n for (let i = 0; i < options.stopNodes.length; i++) {\n const node = options.stopNodes[i];\n if (typeof node === 'string') {\n stopNodeExpressions.push(new Expression(node));\n } else if (node instanceof Expression) {\n stopNodeExpressions.push(node);\n }\n }\n }\n\n // Initialize matcher for path tracking\n const matcher = new Matcher();\n\n return arrToStr(jArray, options, indentation, matcher, stopNodeExpressions);\n}\n\nfunction arrToStr(arr, options, indentation, matcher, stopNodeExpressions) {\n let xmlStr = \"\";\n let isPreviousElementTag = false;\n\n if (options.maxNestedTags && matcher.getDepth() > options.maxNestedTags) {\n throw new Error(\"Maximum nested tags exceeded\");\n }\n\n if (!Array.isArray(arr)) {\n // Non-array values (e.g. string tag values) should be treated as text content\n if (arr !== undefined && arr !== null) {\n let text = arr.toString();\n text = replaceEntitiesValue(text, options);\n return text;\n }\n return \"\";\n }\n\n for (let i = 0; i < arr.length; i++) {\n const tagObj = arr[i];\n const tagName = propName(tagObj);\n if (tagName === undefined) continue;\n\n // Extract attributes from \":@\" property\n const attrValues = extractAttributeValues(tagObj[\":@\"], options);\n\n // Push tag to matcher WITH attributes\n matcher.push(tagName, attrValues);\n\n // Check if this is a stop node using Expression matching\n const isStopNode = checkStopNode(matcher, stopNodeExpressions);\n\n if (tagName === options.textNodeName) {\n let tagText = tagObj[tagName];\n if (!isStopNode) {\n tagText = options.tagValueProcessor(tagName, tagText);\n tagText = replaceEntitiesValue(tagText, options);\n }\n if (isPreviousElementTag) {\n xmlStr += indentation;\n }\n xmlStr += tagText;\n isPreviousElementTag = false;\n matcher.pop();\n continue;\n } else if (tagName === options.cdataPropName) {\n if (isPreviousElementTag) {\n xmlStr += indentation;\n }\n const val = tagObj[tagName][0][options.textNodeName];\n const safeVal = String(val).replace(/\\]\\]>/g, ']]]]>');\n xmlStr += ``;\n isPreviousElementTag = false;\n matcher.pop();\n continue;\n } else if (tagName === options.commentPropName) {\n const val = tagObj[tagName][0][options.textNodeName]\n const safeVal = String(val)\n .replace(/--/g, '- -') // -- is illegal anywhere in comment content\n .replace(/-$/, '- '); // trailing - would form -- with the closing -->\n xmlStr += indentation + ``;\n isPreviousElementTag = true;\n matcher.pop();\n continue;\n } else if (tagName[0] === \"?\") {\n const attStr = attr_to_str(tagObj[\":@\"], options, isStopNode);\n const tempInd = tagName === \"?xml\" ? \"\" : indentation;\n let piTextNodeName = tagObj[tagName][0][options.textNodeName];\n piTextNodeName = piTextNodeName.length !== 0 ? \" \" + piTextNodeName : \"\"; //remove extra spacing\n xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr}?>`;\n isPreviousElementTag = true;\n matcher.pop();\n continue;\n }\n\n let newIdentation = indentation;\n if (newIdentation !== \"\") {\n newIdentation += options.indentBy;\n }\n\n // Pass isStopNode to attr_to_str so attributes are also not processed for stopNodes\n const attStr = attr_to_str(tagObj[\":@\"], options, isStopNode);\n const tagStart = indentation + `<${tagName}${attStr}`;\n\n // If this is a stopNode, get raw content without processing\n let tagValue;\n if (isStopNode) {\n tagValue = getRawContent(tagObj[tagName], options);\n } else {\n\n tagValue = arrToStr(tagObj[tagName], options, newIdentation, matcher, stopNodeExpressions);\n }\n\n if (options.unpairedTags.indexOf(tagName) !== -1) {\n if (options.suppressUnpairedNode) xmlStr += tagStart + \">\";\n else xmlStr += tagStart + \"/>\";\n } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) {\n xmlStr += tagStart + \"/>\";\n } else if (tagValue && tagValue.endsWith(\">\")) {\n xmlStr += tagStart + `>${tagValue}${indentation}`;\n } else {\n xmlStr += tagStart + \">\";\n if (tagValue && indentation !== \"\" && (tagValue.includes(\"/>\") || tagValue.includes(\"`;\n }\n isPreviousElementTag = true;\n\n // Pop tag from matcher\n matcher.pop();\n }\n\n return xmlStr;\n}\n\n/**\n * Extract attribute values from the \":@\" object and return as plain object\n * for passing to matcher.push()\n */\nfunction extractAttributeValues(attrMap, options) {\n if (!attrMap || options.ignoreAttributes) return null;\n\n const attrValues = {};\n let hasAttrs = false;\n\n for (let attr in attrMap) {\n if (!Object.prototype.hasOwnProperty.call(attrMap, attr)) continue;\n // Remove the attribute prefix to get clean attribute name\n const cleanAttrName = attr.startsWith(options.attributeNamePrefix)\n ? attr.substr(options.attributeNamePrefix.length)\n : attr;\n attrValues[cleanAttrName] = attrMap[attr];\n hasAttrs = true;\n }\n\n return hasAttrs ? attrValues : null;\n}\n\n/**\n * Extract raw content from a stopNode without any processing\n * This preserves the content exactly as-is, including special characters\n */\nfunction getRawContent(arr, options) {\n if (!Array.isArray(arr)) {\n // Non-array values return as-is\n if (arr !== undefined && arr !== null) {\n return arr.toString();\n }\n return \"\";\n }\n\n let content = \"\";\n for (let i = 0; i < arr.length; i++) {\n const item = arr[i];\n const tagName = propName(item);\n\n if (tagName === options.textNodeName) {\n // Raw text content - NO processing, NO entity replacement\n content += item[tagName];\n } else if (tagName === options.cdataPropName) {\n // CDATA content\n content += item[tagName][0][options.textNodeName];\n } else if (tagName === options.commentPropName) {\n // Comment content\n content += item[tagName][0][options.textNodeName];\n } else if (tagName && tagName[0] === \"?\") {\n // Processing instruction - skip for stopNodes\n continue;\n } else if (tagName) {\n // Nested tags within stopNode\n // Recursively get raw content and reconstruct the tag\n // For stopNodes, we don't process attributes either\n const attStr = attr_to_str_raw(item[\":@\"], options);\n const nestedContent = getRawContent(item[tagName], options);\n\n if (!nestedContent || nestedContent.length === 0) {\n content += `<${tagName}${attStr}/>`;\n } else {\n content += `<${tagName}${attStr}>${nestedContent}`;\n }\n }\n }\n return content;\n}\n\n/**\n * Build attribute string for stopNodes - NO entity replacement\n */\nfunction attr_to_str_raw(attrMap, options) {\n let attrStr = \"\";\n if (attrMap && !options.ignoreAttributes) {\n for (let attr in attrMap) {\n if (!Object.prototype.hasOwnProperty.call(attrMap, attr)) continue;\n // For stopNodes, use raw value without processing\n let attrVal = attrMap[attr];\n if (attrVal === true && options.suppressBooleanAttributes) {\n attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`;\n } else {\n attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}=\"${attrVal}\"`;\n }\n }\n }\n return attrStr;\n}\n\nfunction propName(obj) {\n const keys = Object.keys(obj);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;\n if (key !== \":@\") return key;\n }\n}\n\nfunction attr_to_str(attrMap, options, isStopNode) {\n let attrStr = \"\";\n if (attrMap && !options.ignoreAttributes) {\n for (let attr in attrMap) {\n if (!Object.prototype.hasOwnProperty.call(attrMap, attr)) continue;\n let attrVal;\n\n if (isStopNode) {\n // For stopNodes, use raw value without any processing\n attrVal = attrMap[attr];\n } else {\n // Normal processing: apply attributeValueProcessor and entity replacement\n attrVal = options.attributeValueProcessor(attr, attrMap[attr]);\n attrVal = replaceEntitiesValue(attrVal, options);\n }\n\n if (attrVal === true && options.suppressBooleanAttributes) {\n attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`;\n } else {\n attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}=\"${attrVal}\"`;\n }\n }\n }\n return attrStr;\n}\n\nfunction checkStopNode(matcher, stopNodeExpressions) {\n if (!stopNodeExpressions || stopNodeExpressions.length === 0) return false;\n\n for (let i = 0; i < stopNodeExpressions.length; i++) {\n if (matcher.matches(stopNodeExpressions[i])) {\n return true;\n }\n }\n return false;\n}\n\nfunction replaceEntitiesValue(textValue, options) {\n if (textValue && textValue.length > 0 && options.processEntities) {\n for (let i = 0; i < options.entities.length; i++) {\n const entity = options.entities[i];\n textValue = textValue.replace(entity.regex, entity.val);\n }\n }\n return textValue;\n}\n\nfunction cdataVal(val) {\n\n}\n\nfunction commentVal(val) {\n\n}","export default function getIgnoreAttributesFn(ignoreAttributes) {\n if (typeof ignoreAttributes === 'function') {\n return ignoreAttributes\n }\n if (Array.isArray(ignoreAttributes)) {\n return (attrName) => {\n for (const pattern of ignoreAttributes) {\n if (typeof pattern === 'string' && attrName === pattern) {\n return true\n }\n if (pattern instanceof RegExp && pattern.test(attrName)) {\n return true\n }\n }\n }\n }\n return () => false\n}","'use strict';\n//parse Empty Node as self closing node\nimport buildFromOrderedJs from './orderedJs2Xml.js';\nimport getIgnoreAttributesFn from \"./ignoreAttributes.js\";\nimport { Expression, Matcher } from 'path-expression-matcher';\n\nconst defaultOptions = {\n attributeNamePrefix: '@_',\n attributesGroupName: false,\n textNodeName: '#text',\n ignoreAttributes: true,\n cdataPropName: false,\n format: false,\n indentBy: ' ',\n suppressEmptyNode: false,\n suppressUnpairedNode: true,\n suppressBooleanAttributes: true,\n tagValueProcessor: function (key, a) {\n return a;\n },\n attributeValueProcessor: function (attrName, a) {\n return a;\n },\n preserveOrder: false,\n commentPropName: false,\n unpairedTags: [],\n entities: [\n { regex: new RegExp(\"&\", \"g\"), val: \"&\" },//it must be on top\n { regex: new RegExp(\">\", \"g\"), val: \">\" },\n { regex: new RegExp(\"<\", \"g\"), val: \"<\" },\n { regex: new RegExp(\"\\'\", \"g\"), val: \"'\" },\n { regex: new RegExp(\"\\\"\", \"g\"), val: \""\" }\n ],\n processEntities: true,\n stopNodes: [],\n // transformTagName: false,\n // transformAttributeName: false,\n oneListGroup: false,\n maxNestedTags: 100,\n jPath: true // When true, callbacks receive string jPath; when false, receive Matcher instance\n};\n\nexport default function Builder(options) {\n this.options = Object.assign({}, defaultOptions, options);\n\n // Convert old-style stopNodes for backward compatibility\n // Old syntax: \"*.tag\" meant \"tag anywhere in tree\"\n // New syntax: \"..tag\" means \"tag anywhere in tree\"\n if (this.options.stopNodes && Array.isArray(this.options.stopNodes)) {\n this.options.stopNodes = this.options.stopNodes.map(node => {\n if (typeof node === 'string' && node.startsWith('*.')) {\n // Convert old wildcard syntax to deep wildcard\n return '..' + node.substring(2);\n }\n return node;\n });\n }\n\n // Pre-compile stopNode expressions for pattern matching\n this.stopNodeExpressions = [];\n if (this.options.stopNodes && Array.isArray(this.options.stopNodes)) {\n for (let i = 0; i < this.options.stopNodes.length; i++) {\n const node = this.options.stopNodes[i];\n if (typeof node === 'string') {\n this.stopNodeExpressions.push(new Expression(node));\n } else if (node instanceof Expression) {\n this.stopNodeExpressions.push(node);\n }\n }\n }\n\n if (this.options.ignoreAttributes === true || this.options.attributesGroupName) {\n this.isAttribute = function (/*a*/) {\n return false;\n };\n } else {\n this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes)\n this.attrPrefixLen = this.options.attributeNamePrefix.length;\n this.isAttribute = isAttribute;\n }\n\n this.processTextOrObjNode = processTextOrObjNode\n\n if (this.options.format) {\n this.indentate = indentate;\n this.tagEndChar = '>\\n';\n this.newLine = '\\n';\n } else {\n this.indentate = function () {\n return '';\n };\n this.tagEndChar = '>';\n this.newLine = '';\n }\n}\n\nBuilder.prototype.build = function (jObj) {\n if (this.options.preserveOrder) {\n return buildFromOrderedJs(jObj, this.options);\n } else {\n if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) {\n jObj = {\n [this.options.arrayNodeName]: jObj\n }\n }\n // Initialize matcher for path tracking\n const matcher = new Matcher();\n return this.j2x(jObj, 0, matcher).val;\n }\n};\n\nBuilder.prototype.j2x = function (jObj, level, matcher) {\n let attrStr = '';\n let val = '';\n if (this.options.maxNestedTags && matcher.getDepth() >= this.options.maxNestedTags) {\n throw new Error(\"Maximum nested tags exceeded\");\n }\n // Get jPath based on option: string for backward compatibility, or Matcher for new features\n const jPath = this.options.jPath ? matcher.toString() : matcher;\n\n // Check if current node is a stopNode (will be used for attribute encoding)\n const isCurrentStopNode = this.checkStopNode(matcher);\n\n for (let key in jObj) {\n if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue;\n if (typeof jObj[key] === 'undefined') {\n // supress undefined node only if it is not an attribute\n if (this.isAttribute(key)) {\n val += '';\n }\n } else if (jObj[key] === null) {\n // null attribute should be ignored by the attribute list, but should not cause the tag closing\n if (this.isAttribute(key)) {\n val += '';\n } else if (key === this.options.cdataPropName) {\n val += '';\n } else if (key[0] === '?') {\n val += this.indentate(level) + '<' + key + '?' + this.tagEndChar;\n } else {\n val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;\n }\n // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;\n } else if (jObj[key] instanceof Date) {\n val += this.buildTextValNode(jObj[key], key, '', level, matcher);\n } else if (typeof jObj[key] !== 'object') {\n //premitive type\n const attr = this.isAttribute(key);\n if (attr && !this.ignoreAttributesFn(attr, jPath)) {\n attrStr += this.buildAttrPairStr(attr, '' + jObj[key], isCurrentStopNode);\n } else if (!attr) {\n //tag value\n if (key === this.options.textNodeName) {\n let newval = this.options.tagValueProcessor(key, '' + jObj[key]);\n val += this.replaceEntitiesValue(newval);\n } else {\n // Check if this is a stopNode before building\n matcher.push(key);\n const isStopNode = this.checkStopNode(matcher);\n matcher.pop();\n\n if (isStopNode) {\n // Build as raw content without encoding\n const textValue = '' + jObj[key];\n if (textValue === '') {\n val += this.indentate(level) + '<' + key + this.closeTag(key) + this.tagEndChar;\n } else {\n val += this.indentate(level) + '<' + key + '>' + textValue + '' + textValue + '${item}`;\n } else if (typeof item === 'object' && item !== null) {\n const nestedContent = this.buildRawContent(item);\n const nestedAttrs = this.buildAttributesForStopNode(item);\n if (nestedContent === '') {\n content += `<${key}${nestedAttrs}/>`;\n } else {\n content += `<${key}${nestedAttrs}>${nestedContent}`;\n }\n }\n }\n } else if (typeof value === 'object' && value !== null) {\n // Nested object\n const nestedContent = this.buildRawContent(value);\n const nestedAttrs = this.buildAttributesForStopNode(value);\n if (nestedContent === '') {\n content += `<${key}${nestedAttrs}/>`;\n } else {\n content += `<${key}${nestedAttrs}>${nestedContent}`;\n }\n } else {\n // Primitive value\n content += `<${key}>${value}`;\n }\n }\n\n return content;\n};\n\n// Build attribute string for stopNode (no entity encoding)\nBuilder.prototype.buildAttributesForStopNode = function (obj) {\n if (!obj || typeof obj !== 'object') return '';\n\n let attrStr = '';\n\n // Check for attributesGroupName (when attributes are grouped)\n if (this.options.attributesGroupName && obj[this.options.attributesGroupName]) {\n const attrGroup = obj[this.options.attributesGroupName];\n for (let attrKey in attrGroup) {\n if (!Object.prototype.hasOwnProperty.call(attrGroup, attrKey)) continue;\n const cleanKey = attrKey.startsWith(this.options.attributeNamePrefix)\n ? attrKey.substring(this.options.attributeNamePrefix.length)\n : attrKey;\n const val = attrGroup[attrKey];\n if (val === true && this.options.suppressBooleanAttributes) {\n attrStr += ' ' + cleanKey;\n } else {\n attrStr += ' ' + cleanKey + '=\"' + val + '\"'; // No encoding for stopNode\n }\n }\n } else {\n // Look for individual attributes\n for (let key in obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;\n const attr = this.isAttribute(key);\n if (attr) {\n const val = obj[key];\n if (val === true && this.options.suppressBooleanAttributes) {\n attrStr += ' ' + attr;\n } else {\n attrStr += ' ' + attr + '=\"' + val + '\"'; // No encoding for stopNode\n }\n }\n }\n }\n\n return attrStr;\n};\n\nBuilder.prototype.buildObjectNode = function (val, key, attrStr, level) {\n if (val === \"\") {\n if (key[0] === \"?\") return this.indentate(level) + '<' + key + attrStr + '?' + this.tagEndChar;\n else {\n return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar;\n }\n } else {\n\n let tagEndExp = '' + val + tagEndExp);\n } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) {\n return this.indentate(level) + `` + this.newLine;\n } else {\n return (\n this.indentate(level) + '<' + key + attrStr + piClosingChar + this.tagEndChar +\n val +\n this.indentate(level) + tagEndExp);\n }\n }\n}\n\nBuilder.prototype.closeTag = function (key) {\n let closeTag = \"\";\n if (this.options.unpairedTags.indexOf(key) !== -1) { //unpaired\n if (!this.options.suppressUnpairedNode) closeTag = \"/\"\n } else if (this.options.suppressEmptyNode) { //empty\n closeTag = \"/\";\n } else {\n closeTag = `>/g, ']]]]>');\n return this.indentate(level) + `` + this.newLine;\n } else if (this.options.commentPropName !== false && key === this.options.commentPropName) {\n const safeVal = String(val)\n .replace(/--/g, '- -') // -- is illegal anywhere in comment content\n .replace(/-$/, '- '); // trailing - would form -- with the closing -->\n return this.indentate(level) + `` + this.newLine;\n } else if (key[0] === \"?\") {//PI tag\n return this.indentate(level) + '<' + key + attrStr + '?' + this.tagEndChar;\n } else {\n // Normal processing: apply tagValueProcessor and entity replacement\n let textValue = this.options.tagValueProcessor(key, val);\n textValue = this.replaceEntitiesValue(textValue);\n\n if (textValue === '') {\n return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar;\n } else {\n return this.indentate(level) + '<' + key + attrStr + '>' +\n textValue +\n ' 0 && this.options.processEntities) {\n for (let i = 0; i < this.options.entities.length; i++) {\n const entity = this.options.entities[i];\n textValue = textValue.replace(entity.regex, entity.val);\n }\n }\n return textValue;\n}\n\nfunction indentate(level) {\n return this.options.indentBy.repeat(level);\n}\n\nfunction isAttribute(name /*, options*/) {\n if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) {\n return name.substr(this.attrPrefixLen);\n } else {\n return false;\n }\n}","// Re-export from fast-xml-builder for backward compatibility\nimport XMLBuilder from 'fast-xml-builder';\nexport default XMLBuilder;\n\n// If there are any named exports you also want to re-export:\nexport * from 'fast-xml-builder';","'use strict';\n\nimport { validate } from './validator.js';\nimport XMLParser from './xmlparser/XMLParser.js';\nimport XMLBuilder from './xmlbuilder/json2xml.js';\n\nconst XMLValidator = {\n validate: validate\n}\nexport {\n XMLParser,\n XMLValidator,\n XMLBuilder\n};","const isWindows = typeof process === 'object' &&\n process &&\n process.platform === 'win32'\nmodule.exports = isWindows ? { sep: '\\\\' } : { sep: '/' }\n","'use strict';\nmodule.exports = balanced;\nfunction balanced(a, b, str) {\n if (a instanceof RegExp) a = maybeMatch(a, str);\n if (b instanceof RegExp) b = maybeMatch(b, str);\n\n var r = range(a, b, str);\n\n return r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + a.length, r[1]),\n post: str.slice(r[1] + b.length)\n };\n}\n\nfunction maybeMatch(reg, str) {\n var m = str.match(reg);\n return m ? m[0] : null;\n}\n\nbalanced.range = range;\nfunction range(a, b, str) {\n var begs, beg, left, right, result;\n var ai = str.indexOf(a);\n var bi = str.indexOf(b, ai + 1);\n var i = ai;\n\n if (ai >= 0 && bi > 0) {\n if(a===b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n\n while (i >= 0 && !result) {\n if (i == ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n } else if (begs.length == 1) {\n result = [ begs.pop(), bi ];\n } else {\n beg = begs.pop();\n if (beg < left) {\n left = beg;\n right = bi;\n }\n\n bi = str.indexOf(b, i + 1);\n }\n\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n\n if (begs.length) {\n result = [ left, right ];\n }\n }\n\n return result;\n}\n","var balanced = require('balanced-match');\n\nmodule.exports = expandTop;\n\nvar escSlash = '\\0SLASH'+Math.random()+'\\0';\nvar escOpen = '\\0OPEN'+Math.random()+'\\0';\nvar escClose = '\\0CLOSE'+Math.random()+'\\0';\nvar escComma = '\\0COMMA'+Math.random()+'\\0';\nvar escPeriod = '\\0PERIOD'+Math.random()+'\\0';\n\nfunction numeric(str) {\n return parseInt(str, 10) == str\n ? parseInt(str, 10)\n : str.charCodeAt(0);\n}\n\nfunction escapeBraces(str) {\n return str.split('\\\\\\\\').join(escSlash)\n .split('\\\\{').join(escOpen)\n .split('\\\\}').join(escClose)\n .split('\\\\,').join(escComma)\n .split('\\\\.').join(escPeriod);\n}\n\nfunction unescapeBraces(str) {\n return str.split(escSlash).join('\\\\')\n .split(escOpen).join('{')\n .split(escClose).join('}')\n .split(escComma).join(',')\n .split(escPeriod).join('.');\n}\n\n\n// Basically just str.split(\",\"), but handling cases\n// where we have nested braced sections, which should be\n// treated as individual members, like {a,{b,c},d}\nfunction parseCommaParts(str) {\n if (!str)\n return [''];\n\n var parts = [];\n var m = balanced('{', '}', str);\n\n if (!m)\n return str.split(',');\n\n var pre = m.pre;\n var body = m.body;\n var post = m.post;\n var p = pre.split(',');\n\n p[p.length-1] += '{' + body + '}';\n var postParts = parseCommaParts(post);\n if (post.length) {\n p[p.length-1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n\n parts.push.apply(parts, p);\n\n return parts;\n}\n\nfunction expandTop(str, options) {\n if (!str)\n return [];\n\n options = options || {};\n var max = options.max == null ? Infinity : options.max;\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.substr(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.substr(2);\n }\n\n return expand(escapeBraces(str), max, true).map(unescapeBraces);\n}\n\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\n\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\n\nfunction expand(str, max, isTop) {\n var expansions = [];\n\n var m = balanced('{', '}', str);\n if (!m) return [str];\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n var pre = m.pre;\n var post = m.post.length\n ? expand(m.post, max, false)\n : [''];\n\n if (/\\$$/.test(m.pre)) { \n for (var k = 0; k < post.length && k < max; k++) {\n var expansion = pre+ '{' + m.body + '}' + post[k];\n expansions.push(expansion);\n }\n } else {\n var isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n var isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n var isSequence = isNumericSequence || isAlphaSequence;\n var isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand(str, max, true);\n }\n return [str];\n }\n\n var n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n } else {\n n = parseCommaParts(m.body);\n if (n.length === 1) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand(n[0], max, false).map(embrace);\n if (n.length === 1) {\n return post.map(function(p) {\n return m.pre + n[0] + p;\n });\n }\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n var N;\n\n if (isSequence) {\n var x = numeric(n[0]);\n var y = numeric(n[1]);\n var width = Math.max(n[0].length, n[1].length)\n var incr = n.length == 3\n ? Math.max(Math.abs(numeric(n[2])), 1)\n : 1;\n var test = lte;\n var reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n var pad = n.some(isPadded);\n\n N = [];\n\n for (var i = x; test(i, y); i += incr) {\n var c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\')\n c = '';\n } else {\n c = String(i);\n if (pad) {\n var need = width - c.length;\n if (need > 0) {\n var z = new Array(need + 1).join('0');\n if (i < 0)\n c = '-' + z + c.slice(1);\n else\n c = z + c;\n }\n }\n }\n N.push(c);\n }\n } else {\n N = [];\n\n for (var j = 0; j < n.length; j++) {\n N.push.apply(N, expand(n[j], max, false));\n }\n }\n\n for (var j = 0; j < N.length; j++) {\n for (var k = 0; k < post.length && expansions.length < max; k++) {\n var expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion)\n expansions.push(expansion);\n }\n }\n }\n\n return expansions;\n}\n","const minimatch = module.exports = (p, pattern, options = {}) => {\n assertValidPattern(pattern)\n\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false\n }\n\n return new Minimatch(pattern, options).match(p)\n}\n\nmodule.exports = minimatch\n\nconst path = require('./lib/path.js')\nminimatch.sep = path.sep\n\nconst GLOBSTAR = Symbol('globstar **')\nminimatch.GLOBSTAR = GLOBSTAR\nconst expand = require('brace-expansion')\n\nconst plTypes = {\n '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},\n '?': { open: '(?:', close: ')?' },\n '+': { open: '(?:', close: ')+' },\n '*': { open: '(?:', close: ')*' },\n '@': { open: '(?:', close: ')' }\n}\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\\\/|^)(?:\\\\.{1,2})($|\\\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\\\/|^)\\\\.).)*?'\n\n// \"abc\" -> { a:true, b:true, c:true }\nconst charSet = s => s.split('').reduce((set, c) => {\n set[c] = true\n return set\n}, {})\n\n// characters that need to be escaped in RegExp.\nconst reSpecials = charSet('().*{}+?[]^$\\\\!')\n\n// characters that indicate we have to add the pattern start\nconst addPatternStartSet = charSet('[.(')\n\n// normalizes slashes.\nconst slashSplit = /\\/+/\n\nminimatch.filter = (pattern, options = {}) =>\n (p, i, list) => minimatch(p, pattern, options)\n\nconst ext = (a, b = {}) => {\n const t = {}\n Object.keys(a).forEach(k => t[k] = a[k])\n Object.keys(b).forEach(k => t[k] = b[k])\n return t\n}\n\nminimatch.defaults = def => {\n if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n return minimatch\n }\n\n const orig = minimatch\n\n const m = (p, pattern, options) => orig(p, pattern, ext(def, options))\n m.Minimatch = class Minimatch extends orig.Minimatch {\n constructor (pattern, options) {\n super(pattern, ext(def, options))\n }\n }\n m.Minimatch.defaults = options => orig.defaults(ext(def, options)).Minimatch\n m.filter = (pattern, options) => orig.filter(pattern, ext(def, options))\n m.defaults = options => orig.defaults(ext(def, options))\n m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options))\n m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options))\n m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options))\n\n return m\n}\n\n\n\n\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nminimatch.braceExpand = (pattern, options) => braceExpand(pattern, options)\n\nconst braceExpand = (pattern, options = {}) => {\n assertValidPattern(pattern)\n\n // Thanks to Yeting Li for\n // improving this regexp to avoid a ReDOS vulnerability.\n if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n // shortcut. no need to expand.\n return [pattern]\n }\n\n return expand(pattern)\n}\n\nconst MAX_PATTERN_LENGTH = 1024 * 64\nconst assertValidPattern = pattern => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nconst SUBPARSE = Symbol('subparse')\n\nminimatch.makeRe = (pattern, options) =>\n new Minimatch(pattern, options || {}).makeRe()\n\nminimatch.match = (list, pattern, options = {}) => {\n const mm = new Minimatch(pattern, options)\n list = list.filter(f => mm.match(f))\n if (mm.options.nonull && !list.length) {\n list.push(pattern)\n }\n return list\n}\n\n// replace stuff like \\* with *\nconst globUnescape = s => s.replace(/\\\\(.)/g, '$1')\nconst charUnescape = s => s.replace(/\\\\([^-\\]])/g, '$1')\nconst regExpEscape = s => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\nconst braExpEscape = s => s.replace(/[[\\]\\\\]/g, '\\\\$&')\n\nclass Minimatch {\n constructor (pattern, options) {\n assertValidPattern(pattern)\n\n if (!options) options = {}\n\n this.options = options\n this.maxGlobstarRecursion = options.maxGlobstarRecursion !== undefined\n ? options.maxGlobstarRecursion : 200\n this.set = []\n this.pattern = pattern\n this.windowsPathsNoEscape = !!options.windowsPathsNoEscape ||\n options.allowWindowsEscape === false\n if (this.windowsPathsNoEscape) {\n this.pattern = this.pattern.replace(/\\\\/g, '/')\n }\n this.regexp = null\n this.negate = false\n this.comment = false\n this.empty = false\n this.partial = !!options.partial\n\n // make the set of regexps etc.\n this.make()\n }\n\n debug () {}\n\n make () {\n const pattern = this.pattern\n const options = this.options\n\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true\n return\n }\n if (!pattern) {\n this.empty = true\n return\n }\n\n // step 1: figure out negation, etc.\n this.parseNegate()\n\n // step 2: expand braces\n let set = this.globSet = this.braceExpand()\n\n if (options.debug) this.debug = (...args) => console.error(...args)\n\n this.debug(this.pattern, set)\n\n // step 3: now we have a set, so turn each one into a series of path-portion\n // matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n set = this.globParts = set.map(s => s.split(slashSplit))\n\n this.debug(this.pattern, set)\n\n // glob --> regexps\n set = set.map((s, si, set) => s.map(this.parse, this))\n\n this.debug(this.pattern, set)\n\n // filter out everything that didn't compile properly.\n set = set.filter(s => s.indexOf(false) === -1)\n\n this.debug(this.pattern, set)\n\n this.set = set\n }\n\n parseNegate () {\n if (this.options.nonegate) return\n\n const pattern = this.pattern\n let negate = false\n let negateOffset = 0\n\n for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n negate = !negate\n negateOffset++\n }\n\n if (negateOffset) this.pattern = pattern.slice(negateOffset)\n this.negate = negate\n }\n\n // set partial to true to test if, for example,\n // \"/a/b\" matches the start of \"/*/b/*/d\"\n // Partial means, if you run out of file before you run\n // out of pattern, then that's fine, as long as all\n // the parts match.\n matchOne (file, pattern, partial) {\n if (pattern.indexOf(GLOBSTAR) !== -1) {\n return this._matchGlobstar(file, pattern, partial, 0, 0)\n }\n return this._matchOne(file, pattern, partial, 0, 0)\n }\n\n _matchGlobstar (file, pattern, partial, fileIndex, patternIndex) {\n // find first globstar from patternIndex\n let firstgs = -1\n for (let i = patternIndex; i < pattern.length; i++) {\n if (pattern[i] === GLOBSTAR) { firstgs = i; break }\n }\n\n // find last globstar\n let lastgs = -1\n for (let i = pattern.length - 1; i >= 0; i--) {\n if (pattern[i] === GLOBSTAR) { lastgs = i; break }\n }\n\n const head = pattern.slice(patternIndex, firstgs)\n const body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs)\n const tail = partial ? [] : pattern.slice(lastgs + 1)\n\n // check the head\n if (head.length) {\n const fileHead = file.slice(fileIndex, fileIndex + head.length)\n if (!this._matchOne(fileHead, head, partial, 0, 0)) {\n return false\n }\n fileIndex += head.length\n }\n\n // check the tail\n let fileTailMatch = 0\n if (tail.length) {\n if (tail.length + fileIndex > file.length) return false\n\n const tailStart = file.length - tail.length\n if (this._matchOne(file, tail, partial, tailStart, 0)) {\n fileTailMatch = tail.length\n } else {\n // affordance for stuff like a/**/* matching a/b/\n if (file[file.length - 1] !== '' ||\n fileIndex + tail.length === file.length) {\n return false\n }\n if (!this._matchOne(file, tail, partial, tailStart - 1, 0)) {\n return false\n }\n fileTailMatch = tail.length + 1\n }\n }\n\n // if body is empty (single ** between head and tail)\n if (!body.length) {\n let sawSome = !!fileTailMatch\n for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n const f = String(file[i])\n sawSome = true\n if (f === '.' || f === '..' ||\n (!this.options.dot && f.charAt(0) === '.')) {\n return false\n }\n }\n return partial || sawSome\n }\n\n // split body into segments at each GLOBSTAR\n const bodySegments = [[[], 0]]\n let currentBody = bodySegments[0]\n let nonGsParts = 0\n const nonGsPartsSums = [0]\n for (const b of body) {\n if (b === GLOBSTAR) {\n nonGsPartsSums.push(nonGsParts)\n currentBody = [[], 0]\n bodySegments.push(currentBody)\n } else {\n currentBody[0].push(b)\n nonGsParts++\n }\n }\n\n let idx = bodySegments.length - 1\n const fileLength = file.length - fileTailMatch\n for (const b of bodySegments) {\n b[1] = fileLength - (nonGsPartsSums[idx--] + b[0].length)\n }\n\n return !!this._matchGlobStarBodySections(\n file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch\n )\n }\n\n // return false for \"nope, not matching\"\n // return null for \"not matching, cannot keep trying\"\n _matchGlobStarBodySections (\n file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail\n ) {\n const bs = bodySegments[bodyIndex]\n if (!bs) {\n // just make sure there are no bad dots\n for (let i = fileIndex; i < file.length; i++) {\n sawTail = true\n const f = file[i]\n if (f === '.' || f === '..' ||\n (!this.options.dot && f.charAt(0) === '.')) {\n return false\n }\n }\n return sawTail\n }\n\n const [body, after] = bs\n while (fileIndex <= after) {\n const m = this._matchOne(\n file.slice(0, fileIndex + body.length),\n body,\n partial,\n fileIndex,\n 0\n )\n // if limit exceeded, no match. intentional false negative,\n // acceptable break in correctness for security.\n if (m && globStarDepth < this.maxGlobstarRecursion) {\n const sub = this._matchGlobStarBodySections(\n file, bodySegments,\n fileIndex + body.length, bodyIndex + 1,\n partial, globStarDepth + 1, sawTail\n )\n if (sub !== false) {\n return sub\n }\n }\n const f = file[fileIndex]\n if (f === '.' || f === '..' ||\n (!this.options.dot && f.charAt(0) === '.')) {\n return false\n }\n fileIndex++\n }\n return partial || null\n }\n\n _matchOne (file, pattern, partial, fileIndex, patternIndex) {\n let fi, pi, fl, pl\n for (\n fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length\n ; (fi < fl) && (pi < pl)\n ; fi++, pi++\n ) {\n this.debug('matchOne loop')\n const p = pattern[pi]\n const f = file[fi]\n\n this.debug(pattern, p, f)\n\n // should be impossible.\n // some invalid regexp stuff in the set.\n /* istanbul ignore if */\n if (p === false || p === GLOBSTAR) return false\n\n // something other than **\n // non-magic patterns just have to match exactly\n // patterns with magic have been turned into regexps.\n let hit\n if (typeof p === 'string') {\n hit = f === p\n this.debug('string match', p, f, hit)\n } else {\n hit = f.match(p)\n this.debug('pattern match', p, f, hit)\n }\n\n if (!hit) return false\n }\n\n // now either we fell off the end of the pattern, or we're done.\n if (fi === fl && pi === pl) {\n // ran out of pattern and filename at the same time.\n // an exact hit!\n return true\n } else if (fi === fl) {\n // ran out of file, but still had pattern left.\n // this is ok if we're doing the match as part of\n // a glob fs traversal.\n return partial\n } else /* istanbul ignore else */ if (pi === pl) {\n // ran out of pattern, still have file left.\n // this is only acceptable if we're on the very last\n // empty segment of a file with a trailing slash.\n // a/* should match a/b/\n return (fi === fl - 1) && (file[fi] === '')\n }\n\n // should be unreachable.\n /* istanbul ignore next */\n throw new Error('wtf?')\n }\n\n braceExpand () {\n return braceExpand(this.pattern, this.options)\n }\n\n parse (pattern, isSub) {\n assertValidPattern(pattern)\n\n const options = this.options\n\n // shortcuts\n if (pattern === '**') {\n if (!options.noglobstar)\n return GLOBSTAR\n else\n pattern = '*'\n }\n if (pattern === '') return ''\n\n let re = ''\n let hasMagic = false\n let escaping = false\n // ? => one single character\n const patternListStack = []\n const negativeLists = []\n let stateChar\n let inClass = false\n let reClassStart = -1\n let classStart = -1\n let cs\n let pl\n let sp\n // . and .. never match anything that doesn't start with .,\n // even when options.dot is set. However, if the pattern\n // starts with ., then traversal patterns can match.\n let dotTravAllowed = pattern.charAt(0) === '.'\n let dotFileAllowed = options.dot || dotTravAllowed\n const patternStart = () =>\n dotTravAllowed\n ? ''\n : dotFileAllowed\n ? '(?!(?:^|\\\\/)\\\\.{1,2}(?:$|\\\\/))'\n : '(?!\\\\.)'\n const subPatternStart = (p) =>\n p.charAt(0) === '.'\n ? ''\n : options.dot\n ? '(?!(?:^|\\\\/)\\\\.{1,2}(?:$|\\\\/))'\n : '(?!\\\\.)'\n\n\n const clearStateChar = () => {\n if (stateChar) {\n // we had some state-tracking character\n // that wasn't consumed by this pass.\n switch (stateChar) {\n case '*':\n re += star\n hasMagic = true\n break\n case '?':\n re += qmark\n hasMagic = true\n break\n default:\n re += '\\\\' + stateChar\n break\n }\n this.debug('clearStateChar %j %j', stateChar, re)\n stateChar = false\n }\n }\n\n for (let i = 0, c; (i < pattern.length) && (c = pattern.charAt(i)); i++) {\n this.debug('%s\\t%s %s %j', pattern, i, re, c)\n\n // skip over any that are escaped.\n if (escaping) {\n /* istanbul ignore next - completely not allowed, even escaped. */\n if (c === '/') {\n return false\n }\n\n if (reSpecials[c]) {\n re += '\\\\'\n }\n re += c\n escaping = false\n continue\n }\n\n switch (c) {\n /* istanbul ignore next */\n case '/': {\n // Should already be path-split by now.\n return false\n }\n\n case '\\\\':\n if (inClass && pattern.charAt(i + 1) === '-') {\n re += c\n continue\n }\n\n clearStateChar()\n escaping = true\n continue\n\n // the various stateChar values\n // for the \"extglob\" stuff.\n case '?':\n case '*':\n case '+':\n case '@':\n case '!':\n this.debug('%s\\t%s %s %j <-- stateChar', pattern, i, re, c)\n\n // all of those are literals inside a class, except that\n // the glob [!a] means [^a] in regexp\n if (inClass) {\n this.debug(' in class')\n if (c === '!' && i === classStart + 1) c = '^'\n re += c\n continue\n }\n\n // coalesce consecutive non-globstar * characters\n if (c === '*' && stateChar === '*') continue\n\n // if we already have a stateChar, then it means\n // that there was something like ** or +? in there.\n // Handle the stateChar, then proceed with this one.\n this.debug('call clearStateChar %j', stateChar)\n clearStateChar()\n stateChar = c\n // if extglob is disabled, then +(asdf|foo) isn't a thing.\n // just clear the statechar *now*, rather than even diving into\n // the patternList stuff.\n if (options.noext) clearStateChar()\n continue\n\n case '(': {\n if (inClass) {\n re += '('\n continue\n }\n\n if (!stateChar) {\n re += '\\\\('\n continue\n }\n\n const plEntry = {\n type: stateChar,\n start: i - 1,\n reStart: re.length,\n open: plTypes[stateChar].open,\n close: plTypes[stateChar].close,\n }\n this.debug(this.pattern, '\\t', plEntry)\n patternListStack.push(plEntry)\n // negation is (?:(?!(?:js)(?:))[^/]*)\n re += plEntry.open\n // next entry starts with a dot maybe?\n if (plEntry.start === 0 && plEntry.type !== '!') {\n dotTravAllowed = true\n re += subPatternStart(pattern.slice(i + 1))\n }\n this.debug('plType %j %j', stateChar, re)\n stateChar = false\n continue\n }\n\n case ')': {\n const plEntry = patternListStack[patternListStack.length - 1]\n if (inClass || !plEntry) {\n re += '\\\\)'\n continue\n }\n patternListStack.pop()\n\n // closing an extglob\n clearStateChar()\n hasMagic = true\n pl = plEntry\n // negation is (?:(?!js)[^/]*)\n // The others are (?:)\n re += pl.close\n if (pl.type === '!') {\n negativeLists.push(Object.assign(pl, { reEnd: re.length }))\n }\n continue\n }\n\n case '|': {\n const plEntry = patternListStack[patternListStack.length - 1]\n if (inClass || !plEntry) {\n re += '\\\\|'\n continue\n }\n\n clearStateChar()\n re += '|'\n // next subpattern can start with a dot?\n if (plEntry.start === 0 && plEntry.type !== '!') {\n dotTravAllowed = true\n re += subPatternStart(pattern.slice(i + 1))\n }\n continue\n }\n\n // these are mostly the same in regexp and glob\n case '[':\n // swallow any state-tracking char before the [\n clearStateChar()\n\n if (inClass) {\n re += '\\\\' + c\n continue\n }\n\n inClass = true\n classStart = i\n reClassStart = re.length\n re += c\n continue\n\n case ']':\n // a right bracket shall lose its special\n // meaning and represent itself in\n // a bracket expression if it occurs\n // first in the list. -- POSIX.2 2.8.3.2\n if (i === classStart + 1 || !inClass) {\n re += '\\\\' + c\n continue\n }\n\n // split where the last [ was, make sure we don't have\n // an invalid re. if so, re-walk the contents of the\n // would-be class to re-translate any characters that\n // were passed through as-is\n // TODO: It would probably be faster to determine this\n // without a try/catch and a new RegExp, but it's tricky\n // to do safely. For now, this is safe and works.\n cs = pattern.substring(classStart + 1, i)\n try {\n RegExp('[' + braExpEscape(charUnescape(cs)) + ']')\n // looks good, finish up the class.\n re += c\n } catch (er) {\n // out of order ranges in JS are errors, but in glob syntax,\n // they're just a range that matches nothing.\n re = re.substring(0, reClassStart) + '(?:$.)' // match nothing ever\n }\n hasMagic = true\n inClass = false\n continue\n\n default:\n // swallow any state char that wasn't consumed\n clearStateChar()\n\n if (reSpecials[c] && !(c === '^' && inClass)) {\n re += '\\\\'\n }\n\n re += c\n break\n\n } // switch\n } // for\n\n // handle the case where we left a class open.\n // \"[abc\" is valid, equivalent to \"\\[abc\"\n if (inClass) {\n // split where the last [ was, and escape it\n // this is a huge pita. We now have to re-walk\n // the contents of the would-be class to re-translate\n // any characters that were passed through as-is\n cs = pattern.slice(classStart + 1)\n sp = this.parse(cs, SUBPARSE)\n re = re.substring(0, reClassStart) + '\\\\[' + sp[0]\n hasMagic = hasMagic || sp[1]\n }\n\n // handle the case where we had a +( thing at the *end*\n // of the pattern.\n // each pattern list stack adds 3 chars, and we need to go through\n // and escape any | chars that were passed through as-is for the regexp.\n // Go through and escape them, taking care not to double-escape any\n // | chars that were already escaped.\n for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {\n let tail\n tail = re.slice(pl.reStart + pl.open.length)\n this.debug('setting tail', re, pl)\n // maybe some even number of \\, then maybe 1 \\, followed by a |\n tail = tail.replace(/((?:\\\\{2}){0,64})(\\\\?)\\|/g, (_, $1, $2) => {\n /* istanbul ignore else - should already be done */\n if (!$2) {\n // the | isn't already escaped, so escape it.\n $2 = '\\\\'\n }\n\n // need to escape all those slashes *again*, without escaping the\n // one that we need for escaping the | character. As it works out,\n // escaping an even number of slashes can be done by simply repeating\n // it exactly after itself. That's why this trick works.\n //\n // I am sorry that you have to see this.\n return $1 + $1 + $2 + '|'\n })\n\n this.debug('tail=%j\\n %s', tail, tail, pl, re)\n const t = pl.type === '*' ? star\n : pl.type === '?' ? qmark\n : '\\\\' + pl.type\n\n hasMagic = true\n re = re.slice(0, pl.reStart) + t + '\\\\(' + tail\n }\n\n // handle trailing things that only matter at the very end.\n clearStateChar()\n if (escaping) {\n // trailing \\\\\n re += '\\\\\\\\'\n }\n\n // only need to apply the nodot start if the re starts with\n // something that could conceivably capture a dot\n const addPatternStart = addPatternStartSet[re.charAt(0)]\n\n // Hack to work around lack of negative lookbehind in JS\n // A pattern like: *.!(x).!(y|z) needs to ensure that a name\n // like 'a.xyz.yz' doesn't match. So, the first negative\n // lookahead, has to look ALL the way ahead, to the end of\n // the pattern.\n for (let n = negativeLists.length - 1; n > -1; n--) {\n const nl = negativeLists[n]\n\n const nlBefore = re.slice(0, nl.reStart)\n const nlFirst = re.slice(nl.reStart, nl.reEnd - 8)\n let nlAfter = re.slice(nl.reEnd)\n const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter\n\n // Handle nested stuff like *(*.js|!(*.json)), where open parens\n // mean that we should *not* include the ) in the bit that is considered\n // \"after\" the negated section.\n const closeParensBefore = nlBefore.split(')').length\n const openParensBefore = nlBefore.split('(').length - closeParensBefore\n let cleanAfter = nlAfter\n for (let i = 0; i < openParensBefore; i++) {\n cleanAfter = cleanAfter.replace(/\\)[+*?]?/, '')\n }\n nlAfter = cleanAfter\n\n const dollar = nlAfter === '' && isSub !== SUBPARSE ? '(?:$|\\\\/)' : ''\n\n re = nlBefore + nlFirst + nlAfter + dollar + nlLast\n }\n\n // if the re is not \"\" at this point, then we need to make sure\n // it doesn't match against an empty path part.\n // Otherwise a/* will match a/, which it should not.\n if (re !== '' && hasMagic) {\n re = '(?=.)' + re\n }\n\n if (addPatternStart) {\n re = patternStart() + re\n }\n\n // parsing just a piece of a larger pattern.\n if (isSub === SUBPARSE) {\n return [re, hasMagic]\n }\n\n // if it's nocase, and the lcase/uppercase don't match, it's magic\n if (options.nocase && !hasMagic) {\n hasMagic = pattern.toUpperCase() !== pattern.toLowerCase()\n }\n\n // skip the regexp for non-magical patterns\n // unescape anything in it, though, so that it'll be\n // an exact match against a file etc.\n if (!hasMagic) {\n return globUnescape(pattern)\n }\n\n const flags = options.nocase ? 'i' : ''\n try {\n return Object.assign(new RegExp('^' + re + '$', flags), {\n _glob: pattern,\n _src: re,\n })\n } catch (er) /* istanbul ignore next - should be impossible */ {\n // If it was an invalid regular expression, then it can't match\n // anything. This trick looks for a character after the end of\n // the string, which is of course impossible, except in multi-line\n // mode, but it's not a /m regex.\n return new RegExp('$.')\n }\n }\n\n makeRe () {\n if (this.regexp || this.regexp === false) return this.regexp\n\n // at this point, this.set is a 2d array of partial\n // pattern strings, or \"**\".\n //\n // It's better to use .match(). This function shouldn't\n // be used, really, but it's pretty convenient sometimes,\n // when you just want to work with a regex.\n const set = this.set\n\n if (!set.length) {\n this.regexp = false\n return this.regexp\n }\n const options = this.options\n\n const twoStar = options.noglobstar ? star\n : options.dot ? twoStarDot\n : twoStarNoDot\n const flags = options.nocase ? 'i' : ''\n\n // coalesce globstars and regexpify non-globstar patterns\n // if it's the only item, then we just do one twoStar\n // if it's the first, and there are more, prepend (\\/|twoStar\\/)? to next\n // if it's the last, append (\\/twoStar|) to previous\n // if it's in the middle, append (\\/|\\/twoStar\\/) to previous\n // then filter out GLOBSTAR symbols\n let re = set.map(pattern => {\n pattern = pattern.map(p =>\n typeof p === 'string' ? regExpEscape(p)\n : p === GLOBSTAR ? GLOBSTAR\n : p._src\n ).reduce((set, p) => {\n if (!(set[set.length - 1] === GLOBSTAR && p === GLOBSTAR)) {\n set.push(p)\n }\n return set\n }, [])\n pattern.forEach((p, i) => {\n if (p !== GLOBSTAR || pattern[i-1] === GLOBSTAR) {\n return\n }\n if (i === 0) {\n if (pattern.length > 1) {\n pattern[i+1] = '(?:\\\\\\/|' + twoStar + '\\\\\\/)?' + pattern[i+1]\n } else {\n pattern[i] = twoStar\n }\n } else if (i === pattern.length - 1) {\n pattern[i-1] += '(?:\\\\\\/|' + twoStar + ')?'\n } else {\n pattern[i-1] += '(?:\\\\\\/|\\\\\\/' + twoStar + '\\\\\\/)' + pattern[i+1]\n pattern[i+1] = GLOBSTAR\n }\n })\n return pattern.filter(p => p !== GLOBSTAR).join('/')\n }).join('|')\n\n // must match entire pattern\n // ending in a * or ** will make it less strict.\n re = '^(?:' + re + ')$'\n\n // can match anything, as long as it's not this.\n if (this.negate) re = '^(?!' + re + ').*$'\n\n try {\n this.regexp = new RegExp(re, flags)\n } catch (ex) /* istanbul ignore next - should be impossible */ {\n this.regexp = false\n }\n return this.regexp\n }\n\n match (f, partial = this.partial) {\n this.debug('match', f, this.pattern)\n // short-circuit in the case of busted things.\n // comments, etc.\n if (this.comment) return false\n if (this.empty) return f === ''\n\n if (f === '/' && partial) return true\n\n const options = this.options\n\n // windows: need to use /, not \\\n if (path.sep !== '/') {\n f = f.split(path.sep).join('/')\n }\n\n // treat the test path as a set of pathparts.\n f = f.split(slashSplit)\n this.debug(this.pattern, 'split', f)\n\n // just ONE of the pattern sets in this.set needs to match\n // in order for it to be valid. If negating, then just one\n // match means that we have failed.\n // Either way, return on the first hit.\n\n const set = this.set\n this.debug(this.pattern, 'set', set)\n\n // Find the basename of the path by looking for the last non-empty segment\n let filename\n for (let i = f.length - 1; i >= 0; i--) {\n filename = f[i]\n if (filename) break\n }\n\n for (let i = 0; i < set.length; i++) {\n const pattern = set[i]\n let file = f\n if (options.matchBase && pattern.length === 1) {\n file = [filename]\n }\n const hit = this.matchOne(file, pattern, partial)\n if (hit) {\n if (options.flipNegate) return true\n return !this.negate\n }\n }\n\n // didn't get any hits. this is success if it's a negative\n // pattern, failure otherwise.\n if (options.flipNegate) return false\n return this.negate\n }\n\n static defaults (def) {\n return minimatch.defaults(def).Minimatch\n }\n}\n\nminimatch.Minimatch = Minimatch\n","module.exports = readdirGlob;\n\nconst fs = require('fs');\nconst { EventEmitter } = require('events');\nconst { Minimatch } = require('minimatch');\nconst { resolve } = require('path');\n\nfunction readdir(dir, strict) {\n return new Promise((resolve, reject) => {\n fs.readdir(dir, {withFileTypes: true} ,(err, files) => {\n if(err) {\n switch (err.code) {\n case 'ENOTDIR': // Not a directory\n if(strict) {\n reject(err);\n } else {\n resolve([]);\n }\n break;\n case 'ENOTSUP': // Operation not supported\n case 'ENOENT': // No such file or directory\n case 'ENAMETOOLONG': // Filename too long\n case 'UNKNOWN':\n resolve([]);\n break;\n case 'ELOOP': // Too many levels of symbolic links\n default:\n reject(err);\n break;\n }\n } else {\n resolve(files);\n }\n });\n });\n}\nfunction stat(file, followSymlinks) {\n return new Promise((resolve, reject) => {\n const statFunc = followSymlinks ? fs.stat : fs.lstat;\n statFunc(file, (err, stats) => {\n if(err) {\n switch (err.code) {\n case 'ENOENT':\n if(followSymlinks) {\n // Fallback to lstat to handle broken links as files\n resolve(stat(file, false)); \n } else {\n resolve(null);\n }\n break;\n default:\n resolve(null);\n break;\n }\n } else {\n resolve(stats);\n }\n });\n });\n}\n\nasync function* exploreWalkAsync(dir, path, followSymlinks, useStat, shouldSkip, strict) {\n let files = await readdir(path + dir, strict);\n for(const file of files) {\n let name = file.name;\n if(name === undefined) {\n // undefined file.name means the `withFileTypes` options is not supported by node\n // we have to call the stat function to know if file is directory or not.\n name = file;\n useStat = true;\n }\n const filename = dir + '/' + name;\n const relative = filename.slice(1); // Remove the leading /\n const absolute = path + '/' + relative;\n let stats = null;\n if(useStat || followSymlinks) {\n stats = await stat(absolute, followSymlinks);\n }\n if(!stats && file.name !== undefined) {\n stats = file;\n }\n if(stats === null) {\n stats = { isDirectory: () => false };\n }\n\n if(stats.isDirectory()) {\n if(!shouldSkip(relative)) {\n yield {relative, absolute, stats};\n yield* exploreWalkAsync(filename, path, followSymlinks, useStat, shouldSkip, false);\n }\n } else {\n yield {relative, absolute, stats};\n }\n }\n}\nasync function* explore(path, followSymlinks, useStat, shouldSkip) {\n yield* exploreWalkAsync('', path, followSymlinks, useStat, shouldSkip, true);\n}\n\n\nfunction readOptions(options) {\n return {\n pattern: options.pattern,\n dot: !!options.dot,\n noglobstar: !!options.noglobstar,\n matchBase: !!options.matchBase,\n nocase: !!options.nocase,\n ignore: options.ignore,\n skip: options.skip,\n\n follow: !!options.follow,\n stat: !!options.stat,\n nodir: !!options.nodir,\n mark: !!options.mark,\n silent: !!options.silent,\n absolute: !!options.absolute\n };\n}\n\nclass ReaddirGlob extends EventEmitter {\n constructor(cwd, options, cb) {\n super();\n if(typeof options === 'function') {\n cb = options;\n options = null;\n }\n\n this.options = readOptions(options || {});\n \n this.matchers = [];\n if(this.options.pattern) {\n const matchers = Array.isArray(this.options.pattern) ? this.options.pattern : [this.options.pattern];\n this.matchers = matchers.map( m =>\n new Minimatch(m, {\n dot: this.options.dot,\n noglobstar:this.options.noglobstar,\n matchBase:this.options.matchBase,\n nocase:this.options.nocase\n })\n );\n }\n \n this.ignoreMatchers = [];\n if(this.options.ignore) {\n const ignorePatterns = Array.isArray(this.options.ignore) ? this.options.ignore : [this.options.ignore];\n this.ignoreMatchers = ignorePatterns.map( ignore =>\n new Minimatch(ignore, {dot: true})\n );\n }\n \n this.skipMatchers = [];\n if(this.options.skip) {\n const skipPatterns = Array.isArray(this.options.skip) ? this.options.skip : [this.options.skip];\n this.skipMatchers = skipPatterns.map( skip =>\n new Minimatch(skip, {dot: true})\n );\n }\n\n this.iterator = explore(resolve(cwd || '.'), this.options.follow, this.options.stat, this._shouldSkipDirectory.bind(this));\n this.paused = false;\n this.inactive = false;\n this.aborted = false;\n \n if(cb) {\n this._matches = []; \n this.on('match', match => this._matches.push(this.options.absolute ? match.absolute : match.relative));\n this.on('error', err => cb(err));\n this.on('end', () => cb(null, this._matches));\n }\n\n setTimeout( () => this._next(), 0);\n }\n\n _shouldSkipDirectory(relative) {\n //console.log(relative, this.skipMatchers.some(m => m.match(relative)));\n return this.skipMatchers.some(m => m.match(relative));\n }\n\n _fileMatches(relative, isDirectory) {\n const file = relative + (isDirectory ? '/' : '');\n return (this.matchers.length === 0 || this.matchers.some(m => m.match(file)))\n && !this.ignoreMatchers.some(m => m.match(file))\n && (!this.options.nodir || !isDirectory);\n }\n\n _next() {\n if(!this.paused && !this.aborted) {\n this.iterator.next()\n .then((obj)=> {\n if(!obj.done) {\n const isDirectory = obj.value.stats.isDirectory();\n if(this._fileMatches(obj.value.relative, isDirectory )) {\n let relative = obj.value.relative;\n let absolute = obj.value.absolute;\n if(this.options.mark && isDirectory) {\n relative += '/';\n absolute += '/';\n }\n if(this.options.stat) {\n this.emit('match', {relative, absolute, stat:obj.value.stats});\n } else {\n this.emit('match', {relative, absolute});\n }\n }\n this._next(this.iterator);\n } else {\n this.emit('end');\n }\n })\n .catch((err) => {\n this.abort();\n this.emit('error', err);\n if(!err.code && !this.options.silent) {\n console.error(err);\n }\n });\n } else {\n this.inactive = true;\n }\n }\n\n abort() {\n this.aborted = true;\n }\n\n pause() {\n this.paused = true;\n }\n\n resume() {\n this.paused = false;\n if(this.inactive) {\n this.inactive = false;\n this._next();\n }\n }\n}\n\n\nfunction readdirGlob(pattern, options, cb) {\n return new ReaddirGlob(pattern, options, cb);\n}\nreaddirGlob.ReaddirGlob = ReaddirGlob;","/**\n * Creates a continuation function with some arguments already applied.\n *\n * Useful as a shorthand when combined with other control flow functions. Any\n * arguments passed to the returned function are added to the arguments\n * originally passed to apply.\n *\n * @name apply\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {Function} fn - The function you want to eventually apply all\n * arguments to. Invokes with (arguments...).\n * @param {...*} arguments... - Any number of arguments to automatically apply\n * when the continuation is called.\n * @returns {Function} the partially-applied function\n * @example\n *\n * // using apply\n * async.parallel([\n * async.apply(fs.writeFile, 'testfile1', 'test1'),\n * async.apply(fs.writeFile, 'testfile2', 'test2')\n * ]);\n *\n *\n * // the same process without using apply\n * async.parallel([\n * function(callback) {\n * fs.writeFile('testfile1', 'test1', callback);\n * },\n * function(callback) {\n * fs.writeFile('testfile2', 'test2', callback);\n * }\n * ]);\n *\n * // It's possible to pass any number of additional arguments when calling the\n * // continuation:\n *\n * node> var fn = async.apply(sys.puts, 'one');\n * node> fn('two', 'three');\n * one\n * two\n * three\n */\nfunction apply(fn, ...args) {\n return (...callArgs) => fn(...args,...callArgs);\n}\n\nfunction initialParams (fn) {\n return function (...args/*, callback*/) {\n var callback = args.pop();\n return fn.call(this, args, callback);\n };\n}\n\n/* istanbul ignore file */\n\nvar hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask;\nvar hasSetImmediate = typeof setImmediate === 'function' && setImmediate;\nvar hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';\n\nfunction fallback(fn) {\n setTimeout(fn, 0);\n}\n\nfunction wrap(defer) {\n return (fn, ...args) => defer(() => fn(...args));\n}\n\nvar _defer$1;\n\nif (hasQueueMicrotask) {\n _defer$1 = queueMicrotask;\n} else if (hasSetImmediate) {\n _defer$1 = setImmediate;\n} else if (hasNextTick) {\n _defer$1 = process.nextTick;\n} else {\n _defer$1 = fallback;\n}\n\nvar setImmediate$1 = wrap(_defer$1);\n\n/**\n * Take a sync function and make it async, passing its return value to a\n * callback. This is useful for plugging sync functions into a waterfall,\n * series, or other async functions. Any arguments passed to the generated\n * function will be passed to the wrapped function (except for the final\n * callback argument). Errors thrown will be passed to the callback.\n *\n * If the function passed to `asyncify` returns a Promise, that promises's\n * resolved/rejected state will be used to call the callback, rather than simply\n * the synchronous return value.\n *\n * This also means you can asyncify ES2017 `async` functions.\n *\n * @name asyncify\n * @static\n * @memberOf module:Utils\n * @method\n * @alias wrapSync\n * @category Util\n * @param {Function} func - The synchronous function, or Promise-returning\n * function to convert to an {@link AsyncFunction}.\n * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be\n * invoked with `(args..., callback)`.\n * @example\n *\n * // passing a regular synchronous function\n * async.waterfall([\n * async.apply(fs.readFile, filename, \"utf8\"),\n * async.asyncify(JSON.parse),\n * function (data, next) {\n * // data is the result of parsing the text.\n * // If there was a parsing error, it would have been caught.\n * }\n * ], callback);\n *\n * // passing a function returning a promise\n * async.waterfall([\n * async.apply(fs.readFile, filename, \"utf8\"),\n * async.asyncify(function (contents) {\n * return db.model.create(contents);\n * }),\n * function (model, next) {\n * // `model` is the instantiated model object.\n * // If there was an error, this function would be skipped.\n * }\n * ], callback);\n *\n * // es2017 example, though `asyncify` is not needed if your JS environment\n * // supports async functions out of the box\n * var q = async.queue(async.asyncify(async function(file) {\n * var intermediateStep = await processFile(file);\n * return await somePromise(intermediateStep)\n * }));\n *\n * q.push(files);\n */\nfunction asyncify(func) {\n if (isAsync(func)) {\n return function (...args/*, callback*/) {\n const callback = args.pop();\n const promise = func.apply(this, args);\n return handlePromise(promise, callback)\n }\n }\n\n return initialParams(function (args, callback) {\n var result;\n try {\n result = func.apply(this, args);\n } catch (e) {\n return callback(e);\n }\n // if result is Promise object\n if (result && typeof result.then === 'function') {\n return handlePromise(result, callback)\n } else {\n callback(null, result);\n }\n });\n}\n\nfunction handlePromise(promise, callback) {\n return promise.then(value => {\n invokeCallback(callback, null, value);\n }, err => {\n invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err));\n });\n}\n\nfunction invokeCallback(callback, error, value) {\n try {\n callback(error, value);\n } catch (err) {\n setImmediate$1(e => { throw e }, err);\n }\n}\n\nfunction isAsync(fn) {\n return fn[Symbol.toStringTag] === 'AsyncFunction';\n}\n\nfunction isAsyncGenerator(fn) {\n return fn[Symbol.toStringTag] === 'AsyncGenerator';\n}\n\nfunction isAsyncIterable(obj) {\n return typeof obj[Symbol.asyncIterator] === 'function';\n}\n\nfunction wrapAsync(asyncFn) {\n if (typeof asyncFn !== 'function') throw new Error('expected a function')\n return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn;\n}\n\n// conditionally promisify a function.\n// only return a promise if a callback is omitted\nfunction awaitify (asyncFn, arity) {\n if (!arity) arity = asyncFn.length;\n if (!arity) throw new Error('arity is undefined')\n function awaitable (...args) {\n if (typeof args[arity - 1] === 'function') {\n return asyncFn.apply(this, args)\n }\n\n return new Promise((resolve, reject) => {\n args[arity - 1] = (err, ...cbArgs) => {\n if (err) return reject(err)\n resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]);\n };\n asyncFn.apply(this, args);\n })\n }\n\n return awaitable\n}\n\nfunction applyEach$1 (eachfn) {\n return function applyEach(fns, ...callArgs) {\n const go = awaitify(function (callback) {\n var that = this;\n return eachfn(fns, (fn, cb) => {\n wrapAsync(fn).apply(that, callArgs.concat(cb));\n }, callback);\n });\n return go;\n };\n}\n\nfunction _asyncMap(eachfn, arr, iteratee, callback) {\n arr = arr || [];\n var results = [];\n var counter = 0;\n var _iteratee = wrapAsync(iteratee);\n\n return eachfn(arr, (value, _, iterCb) => {\n var index = counter++;\n _iteratee(value, (err, v) => {\n results[index] = v;\n iterCb(err);\n });\n }, err => {\n callback(err, results);\n });\n}\n\nfunction isArrayLike(value) {\n return value &&\n typeof value.length === 'number' &&\n value.length >= 0 &&\n value.length % 1 === 0;\n}\n\n// A temporary value used to identify if the loop should be broken.\n// See #1064, #1293\nconst breakLoop = {};\n\nfunction once(fn) {\n function wrapper (...args) {\n if (fn === null) return;\n var callFn = fn;\n fn = null;\n callFn.apply(this, args);\n }\n Object.assign(wrapper, fn);\n return wrapper\n}\n\nfunction getIterator (coll) {\n return coll[Symbol.iterator] && coll[Symbol.iterator]();\n}\n\nfunction createArrayIterator(coll) {\n var i = -1;\n var len = coll.length;\n return function next() {\n return ++i < len ? {value: coll[i], key: i} : null;\n }\n}\n\nfunction createES2015Iterator(iterator) {\n var i = -1;\n return function next() {\n var item = iterator.next();\n if (item.done)\n return null;\n i++;\n return {value: item.value, key: i};\n }\n}\n\nfunction createObjectIterator(obj) {\n var okeys = obj ? Object.keys(obj) : [];\n var i = -1;\n var len = okeys.length;\n return function next() {\n var key = okeys[++i];\n if (key === '__proto__') {\n return next();\n }\n return i < len ? {value: obj[key], key} : null;\n };\n}\n\nfunction createIterator(coll) {\n if (isArrayLike(coll)) {\n return createArrayIterator(coll);\n }\n\n var iterator = getIterator(coll);\n return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);\n}\n\nfunction onlyOnce(fn) {\n return function (...args) {\n if (fn === null) throw new Error(\"Callback was already called.\");\n var callFn = fn;\n fn = null;\n callFn.apply(this, args);\n };\n}\n\n// for async generators\nfunction asyncEachOfLimit(generator, limit, iteratee, callback) {\n let done = false;\n let canceled = false;\n let awaiting = false;\n let running = 0;\n let idx = 0;\n\n function replenish() {\n //console.log('replenish')\n if (running >= limit || awaiting || done) return\n //console.log('replenish awaiting')\n awaiting = true;\n generator.next().then(({value, done: iterDone}) => {\n //console.log('got value', value)\n if (canceled || done) return\n awaiting = false;\n if (iterDone) {\n done = true;\n if (running <= 0) {\n //console.log('done nextCb')\n callback(null);\n }\n return;\n }\n running++;\n iteratee(value, idx, iterateeCallback);\n idx++;\n replenish();\n }).catch(handleError);\n }\n\n function iterateeCallback(err, result) {\n //console.log('iterateeCallback')\n running -= 1;\n if (canceled) return\n if (err) return handleError(err)\n\n if (err === false) {\n done = true;\n canceled = true;\n return\n }\n\n if (result === breakLoop || (done && running <= 0)) {\n done = true;\n //console.log('done iterCb')\n return callback(null);\n }\n replenish();\n }\n\n function handleError(err) {\n if (canceled) return\n awaiting = false;\n done = true;\n callback(err);\n }\n\n replenish();\n}\n\nvar eachOfLimit$2 = (limit) => {\n return (obj, iteratee, callback) => {\n callback = once(callback);\n if (limit <= 0) {\n throw new RangeError('concurrency limit cannot be less than 1')\n }\n if (!obj) {\n return callback(null);\n }\n if (isAsyncGenerator(obj)) {\n return asyncEachOfLimit(obj, limit, iteratee, callback)\n }\n if (isAsyncIterable(obj)) {\n return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback)\n }\n var nextElem = createIterator(obj);\n var done = false;\n var canceled = false;\n var running = 0;\n var looping = false;\n\n function iterateeCallback(err, value) {\n if (canceled) return\n running -= 1;\n if (err) {\n done = true;\n callback(err);\n }\n else if (err === false) {\n done = true;\n canceled = true;\n }\n else if (value === breakLoop || (done && running <= 0)) {\n done = true;\n return callback(null);\n }\n else if (!looping) {\n replenish();\n }\n }\n\n function replenish () {\n looping = true;\n while (running < limit && !done) {\n var elem = nextElem();\n if (elem === null) {\n done = true;\n if (running <= 0) {\n callback(null);\n }\n return;\n }\n running += 1;\n iteratee(elem.value, elem.key, onlyOnce(iterateeCallback));\n }\n looping = false;\n }\n\n replenish();\n };\n};\n\n/**\n * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name eachOfLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in `coll`. The `key` is the item's key, or index in the case of an\n * array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction eachOfLimit(coll, limit, iteratee, callback) {\n return eachOfLimit$2(limit)(coll, wrapAsync(iteratee), callback);\n}\n\nvar eachOfLimit$1 = awaitify(eachOfLimit, 4);\n\n// eachOf implementation optimized for array-likes\nfunction eachOfArrayLike(coll, iteratee, callback) {\n callback = once(callback);\n var index = 0,\n completed = 0,\n {length} = coll,\n canceled = false;\n if (length === 0) {\n callback(null);\n }\n\n function iteratorCallback(err, value) {\n if (err === false) {\n canceled = true;\n }\n if (canceled === true) return\n if (err) {\n callback(err);\n } else if ((++completed === length) || value === breakLoop) {\n callback(null);\n }\n }\n\n for (; index < length; index++) {\n iteratee(coll[index], index, onlyOnce(iteratorCallback));\n }\n}\n\n// a generic version of eachOf which can handle array, object, and iterator cases.\nfunction eachOfGeneric (coll, iteratee, callback) {\n return eachOfLimit$1(coll, Infinity, iteratee, callback);\n}\n\n/**\n * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument\n * to the iteratee.\n *\n * @name eachOf\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEachOf\n * @category Collection\n * @see [async.each]{@link module:Collections.each}\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each\n * item in `coll`.\n * The `key` is the item's key, or index in the case of an array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * // dev.json is a file containing a valid json object config for dev environment\n * // dev.json is a file containing a valid json object config for test environment\n * // prod.json is a file containing a valid json object config for prod environment\n * // invalid.json is a file with a malformed json object\n *\n * let configs = {}; //global variable\n * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'};\n * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'};\n *\n * // asynchronous function that reads a json file and parses the contents as json object\n * function parseFile(file, key, callback) {\n * fs.readFile(file, \"utf8\", function(err, data) {\n * if (err) return calback(err);\n * try {\n * configs[key] = JSON.parse(data);\n * } catch (e) {\n * return callback(e);\n * }\n * callback();\n * });\n * }\n *\n * // Using callbacks\n * async.forEachOf(validConfigFileMap, parseFile, function (err) {\n * if (err) {\n * console.error(err);\n * } else {\n * console.log(configs);\n * // configs is now a map of JSON data, e.g.\n * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json}\n * }\n * });\n *\n * //Error handing\n * async.forEachOf(invalidConfigFileMap, parseFile, function (err) {\n * if (err) {\n * console.error(err);\n * // JSON parse error exception\n * } else {\n * console.log(configs);\n * }\n * });\n *\n * // Using Promises\n * async.forEachOf(validConfigFileMap, parseFile)\n * .then( () => {\n * console.log(configs);\n * // configs is now a map of JSON data, e.g.\n * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json}\n * }).catch( err => {\n * console.error(err);\n * });\n *\n * //Error handing\n * async.forEachOf(invalidConfigFileMap, parseFile)\n * .then( () => {\n * console.log(configs);\n * }).catch( err => {\n * console.error(err);\n * // JSON parse error exception\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.forEachOf(validConfigFileMap, parseFile);\n * console.log(configs);\n * // configs is now a map of JSON data, e.g.\n * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json}\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * //Error handing\n * async () => {\n * try {\n * let result = await async.forEachOf(invalidConfigFileMap, parseFile);\n * console.log(configs);\n * }\n * catch (err) {\n * console.log(err);\n * // JSON parse error exception\n * }\n * }\n *\n */\nfunction eachOf(coll, iteratee, callback) {\n var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric;\n return eachOfImplementation(coll, wrapAsync(iteratee), callback);\n}\n\nvar eachOf$1 = awaitify(eachOf, 3);\n\n/**\n * Produces a new collection of values by mapping each value in `coll` through\n * the `iteratee` function. The `iteratee` is called with an item from `coll`\n * and a callback for when it has finished processing. Each of these callbacks\n * takes 2 arguments: an `error`, and the transformed item from `coll`. If\n * `iteratee` passes an error to its callback, the main `callback` (for the\n * `map` function) is immediately called with the error.\n *\n * Note, that since this function applies the `iteratee` to each item in\n * parallel, there is no guarantee that the `iteratee` functions will complete\n * in order. However, the results array will be in the same order as the\n * original `coll`.\n *\n * If `map` is passed an Object, the results will be an Array. The results\n * will roughly be in the order of the original Objects' keys (but this can\n * vary across JavaScript engines).\n *\n * @name map\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an Array of the\n * transformed items from the `coll`. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * // file1.txt is a file that is 1000 bytes in size\n * // file2.txt is a file that is 2000 bytes in size\n * // file3.txt is a file that is 3000 bytes in size\n * // file4.txt does not exist\n *\n * const fileList = ['file1.txt','file2.txt','file3.txt'];\n * const withMissingFileList = ['file1.txt','file2.txt','file4.txt'];\n *\n * // asynchronous function that returns the file size in bytes\n * function getFileSizeInBytes(file, callback) {\n * fs.stat(file, function(err, stat) {\n * if (err) {\n * return callback(err);\n * }\n * callback(null, stat.size);\n * });\n * }\n *\n * // Using callbacks\n * async.map(fileList, getFileSizeInBytes, function(err, results) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // results is now an array of the file size in bytes for each file, e.g.\n * // [ 1000, 2000, 3000]\n * }\n * });\n *\n * // Error Handling\n * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) {\n * if (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * } else {\n * console.log(results);\n * }\n * });\n *\n * // Using Promises\n * async.map(fileList, getFileSizeInBytes)\n * .then( results => {\n * console.log(results);\n * // results is now an array of the file size in bytes for each file, e.g.\n * // [ 1000, 2000, 3000]\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Error Handling\n * async.map(withMissingFileList, getFileSizeInBytes)\n * .then( results => {\n * console.log(results);\n * }).catch( err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let results = await async.map(fileList, getFileSizeInBytes);\n * console.log(results);\n * // results is now an array of the file size in bytes for each file, e.g.\n * // [ 1000, 2000, 3000]\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // Error Handling\n * async () => {\n * try {\n * let results = await async.map(withMissingFileList, getFileSizeInBytes);\n * console.log(results);\n * }\n * catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * }\n * }\n *\n */\nfunction map (coll, iteratee, callback) {\n return _asyncMap(eachOf$1, coll, iteratee, callback)\n}\nvar map$1 = awaitify(map, 3);\n\n/**\n * Applies the provided arguments to each function in the array, calling\n * `callback` after all functions have completed. If you only provide the first\n * argument, `fns`, then it will return a function which lets you pass in the\n * arguments as if it were a single function call. If more arguments are\n * provided, `callback` is required while `args` is still optional. The results\n * for each of the applied async functions are passed to the final callback\n * as an array.\n *\n * @name applyEach\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s\n * to all call with the same arguments\n * @param {...*} [args] - any number of separate arguments to pass to the\n * function.\n * @param {Function} [callback] - the final argument should be the callback,\n * called when all functions have completed processing.\n * @returns {AsyncFunction} - Returns a function that takes no args other than\n * an optional callback, that is the result of applying the `args` to each\n * of the functions.\n * @example\n *\n * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket')\n *\n * appliedFn((err, results) => {\n * // results[0] is the results for `enableSearch`\n * // results[1] is the results for `updateSchema`\n * });\n *\n * // partial application example:\n * async.each(\n * buckets,\n * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(),\n * callback\n * );\n */\nvar applyEach = applyEach$1(map$1);\n\n/**\n * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time.\n *\n * @name eachOfSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfSeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction eachOfSeries(coll, iteratee, callback) {\n return eachOfLimit$1(coll, 1, iteratee, callback)\n}\nvar eachOfSeries$1 = awaitify(eachOfSeries, 3);\n\n/**\n * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time.\n *\n * @name mapSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an array of the\n * transformed items from the `coll`. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction mapSeries (coll, iteratee, callback) {\n return _asyncMap(eachOfSeries$1, coll, iteratee, callback)\n}\nvar mapSeries$1 = awaitify(mapSeries, 3);\n\n/**\n * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.\n *\n * @name applyEachSeries\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.applyEach]{@link module:ControlFlow.applyEach}\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all\n * call with the same arguments\n * @param {...*} [args] - any number of separate arguments to pass to the\n * function.\n * @param {Function} [callback] - the final argument should be the callback,\n * called when all functions have completed processing.\n * @returns {AsyncFunction} - A function, that when called, is the result of\n * appling the `args` to the list of functions. It takes no args, other than\n * a callback.\n */\nvar applyEachSeries = applyEach$1(mapSeries$1);\n\nconst PROMISE_SYMBOL = Symbol('promiseCallback');\n\nfunction promiseCallback () {\n let resolve, reject;\n function callback (err, ...args) {\n if (err) return reject(err)\n resolve(args.length > 1 ? args : args[0]);\n }\n\n callback[PROMISE_SYMBOL] = new Promise((res, rej) => {\n resolve = res,\n reject = rej;\n });\n\n return callback\n}\n\n/**\n * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on\n * their requirements. Each function can optionally depend on other functions\n * being completed first, and each function is run as soon as its requirements\n * are satisfied.\n *\n * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence\n * will stop. Further tasks will not execute (so any other functions depending\n * on it will not run), and the main `callback` is immediately called with the\n * error.\n *\n * {@link AsyncFunction}s also receive an object containing the results of functions which\n * have completed so far as the first argument, if they have dependencies. If a\n * task function has no dependencies, it will only be passed a callback.\n *\n * @name auto\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Object} tasks - An object. Each of its properties is either a\n * function or an array of requirements, with the {@link AsyncFunction} itself the last item\n * in the array. The object's key of a property serves as the name of the task\n * defined by that property, i.e. can be used when specifying requirements for\n * other tasks. The function receives one or two arguments:\n * * a `results` object, containing the results of the previously executed\n * functions, only passed if the task has any dependencies,\n * * a `callback(err, result)` function, which must be called when finished,\n * passing an `error` (which can be `null`) and the result of the function's\n * execution.\n * @param {number} [concurrency=Infinity] - An optional `integer` for\n * determining the maximum number of tasks that can be run in parallel. By\n * default, as many as possible.\n * @param {Function} [callback] - An optional callback which is called when all\n * the tasks have been completed. It receives the `err` argument if any `tasks`\n * pass an error to their callback. Results are always returned; however, if an\n * error occurs, no further `tasks` will be performed, and the results object\n * will only contain partial results. Invoked with (err, results).\n * @returns {Promise} a promise, if a callback is not passed\n * @example\n *\n * //Using Callbacks\n * async.auto({\n * get_data: function(callback) {\n * // async code to get some data\n * callback(null, 'data', 'converted to array');\n * },\n * make_folder: function(callback) {\n * // async code to create a directory to store a file in\n * // this is run at the same time as getting the data\n * callback(null, 'folder');\n * },\n * write_file: ['get_data', 'make_folder', function(results, callback) {\n * // once there is some data and the directory exists,\n * // write the data to a file in the directory\n * callback(null, 'filename');\n * }],\n * email_link: ['write_file', function(results, callback) {\n * // once the file is written let's email a link to it...\n * callback(null, {'file':results.write_file, 'email':'user@example.com'});\n * }]\n * }, function(err, results) {\n * if (err) {\n * console.log('err = ', err);\n * }\n * console.log('results = ', results);\n * // results = {\n * // get_data: ['data', 'converted to array']\n * // make_folder; 'folder',\n * // write_file: 'filename'\n * // email_link: { file: 'filename', email: 'user@example.com' }\n * // }\n * });\n *\n * //Using Promises\n * async.auto({\n * get_data: function(callback) {\n * console.log('in get_data');\n * // async code to get some data\n * callback(null, 'data', 'converted to array');\n * },\n * make_folder: function(callback) {\n * console.log('in make_folder');\n * // async code to create a directory to store a file in\n * // this is run at the same time as getting the data\n * callback(null, 'folder');\n * },\n * write_file: ['get_data', 'make_folder', function(results, callback) {\n * // once there is some data and the directory exists,\n * // write the data to a file in the directory\n * callback(null, 'filename');\n * }],\n * email_link: ['write_file', function(results, callback) {\n * // once the file is written let's email a link to it...\n * callback(null, {'file':results.write_file, 'email':'user@example.com'});\n * }]\n * }).then(results => {\n * console.log('results = ', results);\n * // results = {\n * // get_data: ['data', 'converted to array']\n * // make_folder; 'folder',\n * // write_file: 'filename'\n * // email_link: { file: 'filename', email: 'user@example.com' }\n * // }\n * }).catch(err => {\n * console.log('err = ', err);\n * });\n *\n * //Using async/await\n * async () => {\n * try {\n * let results = await async.auto({\n * get_data: function(callback) {\n * // async code to get some data\n * callback(null, 'data', 'converted to array');\n * },\n * make_folder: function(callback) {\n * // async code to create a directory to store a file in\n * // this is run at the same time as getting the data\n * callback(null, 'folder');\n * },\n * write_file: ['get_data', 'make_folder', function(results, callback) {\n * // once there is some data and the directory exists,\n * // write the data to a file in the directory\n * callback(null, 'filename');\n * }],\n * email_link: ['write_file', function(results, callback) {\n * // once the file is written let's email a link to it...\n * callback(null, {'file':results.write_file, 'email':'user@example.com'});\n * }]\n * });\n * console.log('results = ', results);\n * // results = {\n * // get_data: ['data', 'converted to array']\n * // make_folder; 'folder',\n * // write_file: 'filename'\n * // email_link: { file: 'filename', email: 'user@example.com' }\n * // }\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction auto(tasks, concurrency, callback) {\n if (typeof concurrency !== 'number') {\n // concurrency is optional, shift the args.\n callback = concurrency;\n concurrency = null;\n }\n callback = once(callback || promiseCallback());\n var numTasks = Object.keys(tasks).length;\n if (!numTasks) {\n return callback(null);\n }\n if (!concurrency) {\n concurrency = numTasks;\n }\n\n var results = {};\n var runningTasks = 0;\n var canceled = false;\n var hasError = false;\n\n var listeners = Object.create(null);\n\n var readyTasks = [];\n\n // for cycle detection:\n var readyToCheck = []; // tasks that have been identified as reachable\n // without the possibility of returning to an ancestor task\n var uncheckedDependencies = {};\n\n Object.keys(tasks).forEach(key => {\n var task = tasks[key];\n if (!Array.isArray(task)) {\n // no dependencies\n enqueueTask(key, [task]);\n readyToCheck.push(key);\n return;\n }\n\n var dependencies = task.slice(0, task.length - 1);\n var remainingDependencies = dependencies.length;\n if (remainingDependencies === 0) {\n enqueueTask(key, task);\n readyToCheck.push(key);\n return;\n }\n uncheckedDependencies[key] = remainingDependencies;\n\n dependencies.forEach(dependencyName => {\n if (!tasks[dependencyName]) {\n throw new Error('async.auto task `' + key +\n '` has a non-existent dependency `' +\n dependencyName + '` in ' +\n dependencies.join(', '));\n }\n addListener(dependencyName, () => {\n remainingDependencies--;\n if (remainingDependencies === 0) {\n enqueueTask(key, task);\n }\n });\n });\n });\n\n checkForDeadlocks();\n processQueue();\n\n function enqueueTask(key, task) {\n readyTasks.push(() => runTask(key, task));\n }\n\n function processQueue() {\n if (canceled) return\n if (readyTasks.length === 0 && runningTasks === 0) {\n return callback(null, results);\n }\n while(readyTasks.length && runningTasks < concurrency) {\n var run = readyTasks.shift();\n run();\n }\n\n }\n\n function addListener(taskName, fn) {\n var taskListeners = listeners[taskName];\n if (!taskListeners) {\n taskListeners = listeners[taskName] = [];\n }\n\n taskListeners.push(fn);\n }\n\n function taskComplete(taskName) {\n var taskListeners = listeners[taskName] || [];\n taskListeners.forEach(fn => fn());\n processQueue();\n }\n\n\n function runTask(key, task) {\n if (hasError) return;\n\n var taskCallback = onlyOnce((err, ...result) => {\n runningTasks--;\n if (err === false) {\n canceled = true;\n return\n }\n if (result.length < 2) {\n [result] = result;\n }\n if (err) {\n var safeResults = {};\n Object.keys(results).forEach(rkey => {\n safeResults[rkey] = results[rkey];\n });\n safeResults[key] = result;\n hasError = true;\n listeners = Object.create(null);\n if (canceled) return\n callback(err, safeResults);\n } else {\n results[key] = result;\n taskComplete(key);\n }\n });\n\n runningTasks++;\n var taskFn = wrapAsync(task[task.length - 1]);\n if (task.length > 1) {\n taskFn(results, taskCallback);\n } else {\n taskFn(taskCallback);\n }\n }\n\n function checkForDeadlocks() {\n // Kahn's algorithm\n // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm\n // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html\n var currentTask;\n var counter = 0;\n while (readyToCheck.length) {\n currentTask = readyToCheck.pop();\n counter++;\n getDependents(currentTask).forEach(dependent => {\n if (--uncheckedDependencies[dependent] === 0) {\n readyToCheck.push(dependent);\n }\n });\n }\n\n if (counter !== numTasks) {\n throw new Error(\n 'async.auto cannot execute tasks due to a recursive dependency'\n );\n }\n }\n\n function getDependents(taskName) {\n var result = [];\n Object.keys(tasks).forEach(key => {\n const task = tasks[key];\n if (Array.isArray(task) && task.indexOf(taskName) >= 0) {\n result.push(key);\n }\n });\n return result;\n }\n\n return callback[PROMISE_SYMBOL]\n}\n\nvar FN_ARGS = /^(?:async\\s)?(?:function)?\\s*(?:\\w+\\s*)?\\(([^)]+)\\)(?:\\s*{)/;\nvar ARROW_FN_ARGS = /^(?:async\\s)?\\s*(?:\\(\\s*)?((?:[^)=\\s]\\s*)*)(?:\\)\\s*)?=>/;\nvar FN_ARG_SPLIT = /,/;\nvar FN_ARG = /(=.+)?(\\s*)$/;\n\nfunction stripComments(string) {\n let stripped = '';\n let index = 0;\n let endBlockComment = string.indexOf('*/');\n while (index < string.length) {\n if (string[index] === '/' && string[index+1] === '/') {\n // inline comment\n let endIndex = string.indexOf('\\n', index);\n index = (endIndex === -1) ? string.length : endIndex;\n } else if ((endBlockComment !== -1) && (string[index] === '/') && (string[index+1] === '*')) {\n // block comment\n let endIndex = string.indexOf('*/', index);\n if (endIndex !== -1) {\n index = endIndex + 2;\n endBlockComment = string.indexOf('*/', index);\n } else {\n stripped += string[index];\n index++;\n }\n } else {\n stripped += string[index];\n index++;\n }\n }\n return stripped;\n}\n\nfunction parseParams(func) {\n const src = stripComments(func.toString());\n let match = src.match(FN_ARGS);\n if (!match) {\n match = src.match(ARROW_FN_ARGS);\n }\n if (!match) throw new Error('could not parse args in autoInject\\nSource:\\n' + src)\n let [, args] = match;\n return args\n .replace(/\\s/g, '')\n .split(FN_ARG_SPLIT)\n .map((arg) => arg.replace(FN_ARG, '').trim());\n}\n\n/**\n * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent\n * tasks are specified as parameters to the function, after the usual callback\n * parameter, with the parameter names matching the names of the tasks it\n * depends on. This can provide even more readable task graphs which can be\n * easier to maintain.\n *\n * If a final callback is specified, the task results are similarly injected,\n * specified as named parameters after the initial error parameter.\n *\n * The autoInject function is purely syntactic sugar and its semantics are\n * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}.\n *\n * @name autoInject\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.auto]{@link module:ControlFlow.auto}\n * @category Control Flow\n * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of\n * the form 'func([dependencies...], callback). The object's key of a property\n * serves as the name of the task defined by that property, i.e. can be used\n * when specifying requirements for other tasks.\n * * The `callback` parameter is a `callback(err, result)` which must be called\n * when finished, passing an `error` (which can be `null`) and the result of\n * the function's execution. The remaining parameters name other tasks on\n * which the task is dependent, and the results from those tasks are the\n * arguments of those parameters.\n * @param {Function} [callback] - An optional callback which is called when all\n * the tasks have been completed. It receives the `err` argument if any `tasks`\n * pass an error to their callback, and a `results` object with any completed\n * task results, similar to `auto`.\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * // The example from `auto` can be rewritten as follows:\n * async.autoInject({\n * get_data: function(callback) {\n * // async code to get some data\n * callback(null, 'data', 'converted to array');\n * },\n * make_folder: function(callback) {\n * // async code to create a directory to store a file in\n * // this is run at the same time as getting the data\n * callback(null, 'folder');\n * },\n * write_file: function(get_data, make_folder, callback) {\n * // once there is some data and the directory exists,\n * // write the data to a file in the directory\n * callback(null, 'filename');\n * },\n * email_link: function(write_file, callback) {\n * // once the file is written let's email a link to it...\n * // write_file contains the filename returned by write_file.\n * callback(null, {'file':write_file, 'email':'user@example.com'});\n * }\n * }, function(err, results) {\n * console.log('err = ', err);\n * console.log('email_link = ', results.email_link);\n * });\n *\n * // If you are using a JS minifier that mangles parameter names, `autoInject`\n * // will not work with plain functions, since the parameter names will be\n * // collapsed to a single letter identifier. To work around this, you can\n * // explicitly specify the names of the parameters your task function needs\n * // in an array, similar to Angular.js dependency injection.\n *\n * // This still has an advantage over plain `auto`, since the results a task\n * // depends on are still spread into arguments.\n * async.autoInject({\n * //...\n * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) {\n * callback(null, 'filename');\n * }],\n * email_link: ['write_file', function(write_file, callback) {\n * callback(null, {'file':write_file, 'email':'user@example.com'});\n * }]\n * //...\n * }, function(err, results) {\n * console.log('err = ', err);\n * console.log('email_link = ', results.email_link);\n * });\n */\nfunction autoInject(tasks, callback) {\n var newTasks = {};\n\n Object.keys(tasks).forEach(key => {\n var taskFn = tasks[key];\n var params;\n var fnIsAsync = isAsync(taskFn);\n var hasNoDeps =\n (!fnIsAsync && taskFn.length === 1) ||\n (fnIsAsync && taskFn.length === 0);\n\n if (Array.isArray(taskFn)) {\n params = [...taskFn];\n taskFn = params.pop();\n\n newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn);\n } else if (hasNoDeps) {\n // no dependencies, use the function as-is\n newTasks[key] = taskFn;\n } else {\n params = parseParams(taskFn);\n if ((taskFn.length === 0 && !fnIsAsync) && params.length === 0) {\n throw new Error(\"autoInject task functions require explicit parameters.\");\n }\n\n // remove callback param\n if (!fnIsAsync) params.pop();\n\n newTasks[key] = params.concat(newTask);\n }\n\n function newTask(results, taskCb) {\n var newArgs = params.map(name => results[name]);\n newArgs.push(taskCb);\n wrapAsync(taskFn)(...newArgs);\n }\n });\n\n return auto(newTasks, callback);\n}\n\n// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation\n// used for queues. This implementation assumes that the node provided by the user can be modified\n// to adjust the next and last properties. We implement only the minimal functionality\n// for queue support.\nclass DLL {\n constructor() {\n this.head = this.tail = null;\n this.length = 0;\n }\n\n removeLink(node) {\n if (node.prev) node.prev.next = node.next;\n else this.head = node.next;\n if (node.next) node.next.prev = node.prev;\n else this.tail = node.prev;\n\n node.prev = node.next = null;\n this.length -= 1;\n return node;\n }\n\n empty () {\n while(this.head) this.shift();\n return this;\n }\n\n insertAfter(node, newNode) {\n newNode.prev = node;\n newNode.next = node.next;\n if (node.next) node.next.prev = newNode;\n else this.tail = newNode;\n node.next = newNode;\n this.length += 1;\n }\n\n insertBefore(node, newNode) {\n newNode.prev = node.prev;\n newNode.next = node;\n if (node.prev) node.prev.next = newNode;\n else this.head = newNode;\n node.prev = newNode;\n this.length += 1;\n }\n\n unshift(node) {\n if (this.head) this.insertBefore(this.head, node);\n else setInitial(this, node);\n }\n\n push(node) {\n if (this.tail) this.insertAfter(this.tail, node);\n else setInitial(this, node);\n }\n\n shift() {\n return this.head && this.removeLink(this.head);\n }\n\n pop() {\n return this.tail && this.removeLink(this.tail);\n }\n\n toArray() {\n return [...this]\n }\n\n *[Symbol.iterator] () {\n var cur = this.head;\n while (cur) {\n yield cur.data;\n cur = cur.next;\n }\n }\n\n remove (testFn) {\n var curr = this.head;\n while(curr) {\n var {next} = curr;\n if (testFn(curr)) {\n this.removeLink(curr);\n }\n curr = next;\n }\n return this;\n }\n}\n\nfunction setInitial(dll, node) {\n dll.length = 1;\n dll.head = dll.tail = node;\n}\n\nfunction queue$1(worker, concurrency, payload) {\n if (concurrency == null) {\n concurrency = 1;\n }\n else if(concurrency === 0) {\n throw new RangeError('Concurrency must not be zero');\n }\n\n var _worker = wrapAsync(worker);\n var numRunning = 0;\n var workersList = [];\n const events = {\n error: [],\n drain: [],\n saturated: [],\n unsaturated: [],\n empty: []\n };\n\n function on (event, handler) {\n events[event].push(handler);\n }\n\n function once (event, handler) {\n const handleAndRemove = (...args) => {\n off(event, handleAndRemove);\n handler(...args);\n };\n events[event].push(handleAndRemove);\n }\n\n function off (event, handler) {\n if (!event) return Object.keys(events).forEach(ev => events[ev] = [])\n if (!handler) return events[event] = []\n events[event] = events[event].filter(ev => ev !== handler);\n }\n\n function trigger (event, ...args) {\n events[event].forEach(handler => handler(...args));\n }\n\n var processingScheduled = false;\n function _insert(data, insertAtFront, rejectOnError, callback) {\n if (callback != null && typeof callback !== 'function') {\n throw new Error('task callback must be a function');\n }\n q.started = true;\n\n var res, rej;\n function promiseCallback (err, ...args) {\n // we don't care about the error, let the global error handler\n // deal with it\n if (err) return rejectOnError ? rej(err) : res()\n if (args.length <= 1) return res(args[0])\n res(args);\n }\n\n var item = q._createTaskItem(\n data,\n rejectOnError ? promiseCallback :\n (callback || promiseCallback)\n );\n\n if (insertAtFront) {\n q._tasks.unshift(item);\n } else {\n q._tasks.push(item);\n }\n\n if (!processingScheduled) {\n processingScheduled = true;\n setImmediate$1(() => {\n processingScheduled = false;\n q.process();\n });\n }\n\n if (rejectOnError || !callback) {\n return new Promise((resolve, reject) => {\n res = resolve;\n rej = reject;\n })\n }\n }\n\n function _createCB(tasks) {\n return function (err, ...args) {\n numRunning -= 1;\n\n for (var i = 0, l = tasks.length; i < l; i++) {\n var task = tasks[i];\n\n var index = workersList.indexOf(task);\n if (index === 0) {\n workersList.shift();\n } else if (index > 0) {\n workersList.splice(index, 1);\n }\n\n task.callback(err, ...args);\n\n if (err != null) {\n trigger('error', err, task.data);\n }\n }\n\n if (numRunning <= (q.concurrency - q.buffer) ) {\n trigger('unsaturated');\n }\n\n if (q.idle()) {\n trigger('drain');\n }\n q.process();\n };\n }\n\n function _maybeDrain(data) {\n if (data.length === 0 && q.idle()) {\n // call drain immediately if there are no tasks\n setImmediate$1(() => trigger('drain'));\n return true\n }\n return false\n }\n\n const eventMethod = (name) => (handler) => {\n if (!handler) {\n return new Promise((resolve, reject) => {\n once(name, (err, data) => {\n if (err) return reject(err)\n resolve(data);\n });\n })\n }\n off(name);\n on(name, handler);\n\n };\n\n var isProcessing = false;\n var q = {\n _tasks: new DLL(),\n _createTaskItem (data, callback) {\n return {\n data,\n callback\n };\n },\n *[Symbol.iterator] () {\n yield* q._tasks[Symbol.iterator]();\n },\n concurrency,\n payload,\n buffer: concurrency / 4,\n started: false,\n paused: false,\n push (data, callback) {\n if (Array.isArray(data)) {\n if (_maybeDrain(data)) return\n return data.map(datum => _insert(datum, false, false, callback))\n }\n return _insert(data, false, false, callback);\n },\n pushAsync (data, callback) {\n if (Array.isArray(data)) {\n if (_maybeDrain(data)) return\n return data.map(datum => _insert(datum, false, true, callback))\n }\n return _insert(data, false, true, callback);\n },\n kill () {\n off();\n q._tasks.empty();\n },\n unshift (data, callback) {\n if (Array.isArray(data)) {\n if (_maybeDrain(data)) return\n return data.map(datum => _insert(datum, true, false, callback))\n }\n return _insert(data, true, false, callback);\n },\n unshiftAsync (data, callback) {\n if (Array.isArray(data)) {\n if (_maybeDrain(data)) return\n return data.map(datum => _insert(datum, true, true, callback))\n }\n return _insert(data, true, true, callback);\n },\n remove (testFn) {\n q._tasks.remove(testFn);\n },\n process () {\n // Avoid trying to start too many processing operations. This can occur\n // when callbacks resolve synchronously (#1267).\n if (isProcessing) {\n return;\n }\n isProcessing = true;\n while(!q.paused && numRunning < q.concurrency && q._tasks.length){\n var tasks = [], data = [];\n var l = q._tasks.length;\n if (q.payload) l = Math.min(l, q.payload);\n for (var i = 0; i < l; i++) {\n var node = q._tasks.shift();\n tasks.push(node);\n workersList.push(node);\n data.push(node.data);\n }\n\n numRunning += 1;\n\n if (q._tasks.length === 0) {\n trigger('empty');\n }\n\n if (numRunning === q.concurrency) {\n trigger('saturated');\n }\n\n var cb = onlyOnce(_createCB(tasks));\n _worker(data, cb);\n }\n isProcessing = false;\n },\n length () {\n return q._tasks.length;\n },\n running () {\n return numRunning;\n },\n workersList () {\n return workersList;\n },\n idle() {\n return q._tasks.length + numRunning === 0;\n },\n pause () {\n q.paused = true;\n },\n resume () {\n if (q.paused === false) { return; }\n q.paused = false;\n setImmediate$1(q.process);\n }\n };\n // define these as fixed properties, so people get useful errors when updating\n Object.defineProperties(q, {\n saturated: {\n writable: false,\n value: eventMethod('saturated')\n },\n unsaturated: {\n writable: false,\n value: eventMethod('unsaturated')\n },\n empty: {\n writable: false,\n value: eventMethod('empty')\n },\n drain: {\n writable: false,\n value: eventMethod('drain')\n },\n error: {\n writable: false,\n value: eventMethod('error')\n },\n });\n return q;\n}\n\n/**\n * Creates a `cargo` object with the specified payload. Tasks added to the\n * cargo will be processed altogether (up to the `payload` limit). If the\n * `worker` is in progress, the task is queued until it becomes available. Once\n * the `worker` has completed some tasks, each callback of those tasks is\n * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)\n * for how `cargo` and `queue` work.\n *\n * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers\n * at a time, cargo passes an array of tasks to a single worker, repeating\n * when the worker is finished.\n *\n * @name cargo\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.queue]{@link module:ControlFlow.queue}\n * @category Control Flow\n * @param {AsyncFunction} worker - An asynchronous function for processing an array\n * of queued tasks. Invoked with `(tasks, callback)`.\n * @param {number} [payload=Infinity] - An optional `integer` for determining\n * how many tasks should be processed per round; if omitted, the default is\n * unlimited.\n * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can\n * attached as certain properties to listen for specific events during the\n * lifecycle of the cargo and inner queue.\n * @example\n *\n * // create a cargo object with payload 2\n * var cargo = async.cargo(function(tasks, callback) {\n * for (var i=0; i {\n * console.log(result);\n * // 6000\n * // which is the sum of the file sizes of the three files\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Error Handling\n * async.reduce(withMissingFileList, 0, getFileSizeInBytes)\n * .then( result => {\n * console.log(result);\n * }).catch( err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.reduce(fileList, 0, getFileSizeInBytes);\n * console.log(result);\n * // 6000\n * // which is the sum of the file sizes of the three files\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // Error Handling\n * async () => {\n * try {\n * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes);\n * console.log(result);\n * }\n * catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * }\n * }\n *\n */\nfunction reduce(coll, memo, iteratee, callback) {\n callback = once(callback);\n var _iteratee = wrapAsync(iteratee);\n return eachOfSeries$1(coll, (x, i, iterCb) => {\n _iteratee(memo, x, (err, v) => {\n memo = v;\n iterCb(err);\n });\n }, err => callback(err, memo));\n}\nvar reduce$1 = awaitify(reduce, 4);\n\n/**\n * Version of the compose function that is more natural to read. Each function\n * consumes the return value of the previous function. It is the equivalent of\n * [compose]{@link module:ControlFlow.compose} with the arguments reversed.\n *\n * Each function is executed with the `this` binding of the composed function.\n *\n * @name seq\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.compose]{@link module:ControlFlow.compose}\n * @category Control Flow\n * @param {...AsyncFunction} functions - the asynchronous functions to compose\n * @returns {Function} a function that composes the `functions` in order\n * @example\n *\n * // Requires lodash (or underscore), express3 and dresende's orm2.\n * // Part of an app, that fetches cats of the logged user.\n * // This example uses `seq` function to avoid overnesting and error\n * // handling clutter.\n * app.get('/cats', function(request, response) {\n * var User = request.models.User;\n * async.seq(\n * User.get.bind(User), // 'User.get' has signature (id, callback(err, data))\n * function(user, fn) {\n * user.getCats(fn); // 'getCats' has signature (callback(err, data))\n * }\n * )(req.session.user_id, function (err, cats) {\n * if (err) {\n * console.error(err);\n * response.json({ status: 'error', message: err.message });\n * } else {\n * response.json({ status: 'ok', message: 'Cats found', data: cats });\n * }\n * });\n * });\n */\nfunction seq(...functions) {\n var _functions = functions.map(wrapAsync);\n return function (...args) {\n var that = this;\n\n var cb = args[args.length - 1];\n if (typeof cb == 'function') {\n args.pop();\n } else {\n cb = promiseCallback();\n }\n\n reduce$1(_functions, args, (newargs, fn, iterCb) => {\n fn.apply(that, newargs.concat((err, ...nextargs) => {\n iterCb(err, nextargs);\n }));\n },\n (err, results) => cb(err, ...results));\n\n return cb[PROMISE_SYMBOL]\n };\n}\n\n/**\n * Creates a function which is a composition of the passed asynchronous\n * functions. Each function consumes the return value of the function that\n * follows. Composing functions `f()`, `g()`, and `h()` would produce the result\n * of `f(g(h()))`, only this version uses callbacks to obtain the return values.\n *\n * If the last argument to the composed function is not a function, a promise\n * is returned when you call it.\n *\n * Each function is executed with the `this` binding of the composed function.\n *\n * @name compose\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {...AsyncFunction} functions - the asynchronous functions to compose\n * @returns {Function} an asynchronous function that is the composed\n * asynchronous `functions`\n * @example\n *\n * function add1(n, callback) {\n * setTimeout(function () {\n * callback(null, n + 1);\n * }, 10);\n * }\n *\n * function mul3(n, callback) {\n * setTimeout(function () {\n * callback(null, n * 3);\n * }, 10);\n * }\n *\n * var add1mul3 = async.compose(mul3, add1);\n * add1mul3(4, function (err, result) {\n * // result now equals 15\n * });\n */\nfunction compose(...args) {\n return seq(...args.reverse());\n}\n\n/**\n * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time.\n *\n * @name mapLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an array of the\n * transformed items from the `coll`. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction mapLimit (coll, limit, iteratee, callback) {\n return _asyncMap(eachOfLimit$2(limit), coll, iteratee, callback)\n}\nvar mapLimit$1 = awaitify(mapLimit, 4);\n\n/**\n * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time.\n *\n * @name concatLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.concat]{@link module:Collections.concat}\n * @category Collection\n * @alias flatMapLimit\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,\n * which should use an array as its result. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is an array\n * containing the concatenated results of the `iteratee` function. Invoked with\n * (err, results).\n * @returns A Promise, if no callback is passed\n */\nfunction concatLimit(coll, limit, iteratee, callback) {\n var _iteratee = wrapAsync(iteratee);\n return mapLimit$1(coll, limit, (val, iterCb) => {\n _iteratee(val, (err, ...args) => {\n if (err) return iterCb(err);\n return iterCb(err, args);\n });\n }, (err, mapResults) => {\n var result = [];\n for (var i = 0; i < mapResults.length; i++) {\n if (mapResults[i]) {\n result = result.concat(...mapResults[i]);\n }\n }\n\n return callback(err, result);\n });\n}\nvar concatLimit$1 = awaitify(concatLimit, 4);\n\n/**\n * Applies `iteratee` to each item in `coll`, concatenating the results. Returns\n * the concatenated list. The `iteratee`s are called in parallel, and the\n * results are concatenated as they return. The results array will be returned in\n * the original order of `coll` passed to the `iteratee` function.\n *\n * @name concat\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @alias flatMap\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,\n * which should use an array as its result. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is an array\n * containing the concatenated results of the `iteratee` function. Invoked with\n * (err, results).\n * @returns A Promise, if no callback is passed\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n * // dir4 does not exist\n *\n * let directoryList = ['dir1','dir2','dir3'];\n * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4'];\n *\n * // Using callbacks\n * async.concat(directoryList, fs.readdir, function(err, results) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ]\n * }\n * });\n *\n * // Error Handling\n * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) {\n * if (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4 does not exist\n * } else {\n * console.log(results);\n * }\n * });\n *\n * // Using Promises\n * async.concat(directoryList, fs.readdir)\n * .then(results => {\n * console.log(results);\n * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ]\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // Error Handling\n * async.concat(withMissingDirectoryList, fs.readdir)\n * .then(results => {\n * console.log(results);\n * }).catch(err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4 does not exist\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let results = await async.concat(directoryList, fs.readdir);\n * console.log(results);\n * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ]\n * } catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // Error Handling\n * async () => {\n * try {\n * let results = await async.concat(withMissingDirectoryList, fs.readdir);\n * console.log(results);\n * } catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4 does not exist\n * }\n * }\n *\n */\nfunction concat(coll, iteratee, callback) {\n return concatLimit$1(coll, Infinity, iteratee, callback)\n}\nvar concat$1 = awaitify(concat, 3);\n\n/**\n * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time.\n *\n * @name concatSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.concat]{@link module:Collections.concat}\n * @category Collection\n * @alias flatMapSeries\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`.\n * The iteratee should complete with an array an array of results.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is an array\n * containing the concatenated results of the `iteratee` function. Invoked with\n * (err, results).\n * @returns A Promise, if no callback is passed\n */\nfunction concatSeries(coll, iteratee, callback) {\n return concatLimit$1(coll, 1, iteratee, callback)\n}\nvar concatSeries$1 = awaitify(concatSeries, 3);\n\n/**\n * Returns a function that when called, calls-back with the values provided.\n * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to\n * [`auto`]{@link module:ControlFlow.auto}.\n *\n * @name constant\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {...*} arguments... - Any number of arguments to automatically invoke\n * callback with.\n * @returns {AsyncFunction} Returns a function that when invoked, automatically\n * invokes the callback with the previous given arguments.\n * @example\n *\n * async.waterfall([\n * async.constant(42),\n * function (value, next) {\n * // value === 42\n * },\n * //...\n * ], callback);\n *\n * async.waterfall([\n * async.constant(filename, \"utf8\"),\n * fs.readFile,\n * function (fileData, next) {\n * //...\n * }\n * //...\n * ], callback);\n *\n * async.auto({\n * hostname: async.constant(\"https://server.net/\"),\n * port: findFreePort,\n * launchServer: [\"hostname\", \"port\", function (options, cb) {\n * startServer(options, cb);\n * }],\n * //...\n * }, callback);\n */\nfunction constant$1(...args) {\n return function (...ignoredArgs/*, callback*/) {\n var callback = ignoredArgs.pop();\n return callback(null, ...args);\n };\n}\n\nfunction _createTester(check, getResult) {\n return (eachfn, arr, _iteratee, cb) => {\n var testPassed = false;\n var testResult;\n const iteratee = wrapAsync(_iteratee);\n eachfn(arr, (value, _, callback) => {\n iteratee(value, (err, result) => {\n if (err || err === false) return callback(err);\n\n if (check(result) && !testResult) {\n testPassed = true;\n testResult = getResult(true, value);\n return callback(null, breakLoop);\n }\n callback();\n });\n }, err => {\n if (err) return cb(err);\n cb(null, testPassed ? testResult : getResult(false));\n });\n };\n}\n\n/**\n * Returns the first value in `coll` that passes an async truth test. The\n * `iteratee` is applied in parallel, meaning the first iteratee to return\n * `true` will fire the detect `callback` with that result. That means the\n * result might not be the first item in the original `coll` (in terms of order)\n * that passes the test.\n\n * If order within the original `coll` is important, then look at\n * [`detectSeries`]{@link module:Collections.detectSeries}.\n *\n * @name detect\n * @static\n * @memberOf module:Collections\n * @method\n * @alias find\n * @category Collections\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n *\n * // asynchronous function that checks if a file exists\n * function fileExists(file, callback) {\n * fs.access(file, fs.constants.F_OK, (err) => {\n * callback(null, !err);\n * });\n * }\n *\n * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists,\n * function(err, result) {\n * console.log(result);\n * // dir1/file1.txt\n * // result now equals the first file in the list that exists\n * }\n *);\n *\n * // Using Promises\n * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists)\n * .then(result => {\n * console.log(result);\n * // dir1/file1.txt\n * // result now equals the first file in the list that exists\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists);\n * console.log(result);\n * // dir1/file1.txt\n * // result now equals the file in the list that exists\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction detect(coll, iteratee, callback) {\n return _createTester(bool => bool, (res, item) => item)(eachOf$1, coll, iteratee, callback)\n}\nvar detect$1 = awaitify(detect, 3);\n\n/**\n * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name detectLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.detect]{@link module:Collections.detect}\n * @alias findLimit\n * @category Collections\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction detectLimit(coll, limit, iteratee, callback) {\n return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(limit), coll, iteratee, callback)\n}\nvar detectLimit$1 = awaitify(detectLimit, 4);\n\n/**\n * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.\n *\n * @name detectSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.detect]{@link module:Collections.detect}\n * @alias findSeries\n * @category Collections\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction detectSeries(coll, iteratee, callback) {\n return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(1), coll, iteratee, callback)\n}\n\nvar detectSeries$1 = awaitify(detectSeries, 3);\n\nfunction consoleFunc(name) {\n return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => {\n /* istanbul ignore else */\n if (typeof console === 'object') {\n /* istanbul ignore else */\n if (err) {\n /* istanbul ignore else */\n if (console.error) {\n console.error(err);\n }\n } else if (console[name]) { /* istanbul ignore else */\n resultArgs.forEach(x => console[name](x));\n }\n }\n })\n}\n\n/**\n * Logs the result of an [`async` function]{@link AsyncFunction} to the\n * `console` using `console.dir` to display the properties of the resulting object.\n * Only works in Node.js or in browsers that support `console.dir` and\n * `console.error` (such as FF and Chrome).\n * If multiple arguments are returned from the async function,\n * `console.dir` is called on each argument in order.\n *\n * @name dir\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} function - The function you want to eventually apply\n * all arguments to.\n * @param {...*} arguments... - Any number of arguments to apply to the function.\n * @example\n *\n * // in a module\n * var hello = function(name, callback) {\n * setTimeout(function() {\n * callback(null, {hello: name});\n * }, 1000);\n * };\n *\n * // in the node repl\n * node> async.dir(hello, 'world');\n * {hello: 'world'}\n */\nvar dir = consoleFunc('dir');\n\n/**\n * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in\n * the order of operations, the arguments `test` and `iteratee` are switched.\n *\n * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n *\n * @name doWhilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {AsyncFunction} iteratee - A function which is called each time `test`\n * passes. Invoked with (callback).\n * @param {AsyncFunction} test - asynchronous truth test to perform after each\n * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the\n * non-error args from the previous callback of `iteratee`.\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `iteratee` has stopped.\n * `callback` will be passed an error and any arguments passed to the final\n * `iteratee`'s callback. Invoked with (err, [results]);\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction doWhilst(iteratee, test, callback) {\n callback = onlyOnce(callback);\n var _fn = wrapAsync(iteratee);\n var _test = wrapAsync(test);\n var results;\n\n function next(err, ...args) {\n if (err) return callback(err);\n if (err === false) return;\n results = args;\n _test(...args, check);\n }\n\n function check(err, truth) {\n if (err) return callback(err);\n if (err === false) return;\n if (!truth) return callback(null, ...results);\n _fn(next);\n }\n\n return check(null, true);\n}\n\nvar doWhilst$1 = awaitify(doWhilst, 3);\n\n/**\n * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the\n * argument ordering differs from `until`.\n *\n * @name doUntil\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.doWhilst]{@link module:ControlFlow.doWhilst}\n * @category Control Flow\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` fails. Invoked with (callback).\n * @param {AsyncFunction} test - asynchronous truth test to perform after each\n * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the\n * non-error args from the previous callback of `iteratee`\n * @param {Function} [callback] - A callback which is called after the test\n * function has passed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction doUntil(iteratee, test, callback) {\n const _test = wrapAsync(test);\n return doWhilst$1(iteratee, (...args) => {\n const cb = args.pop();\n _test(...args, (err, truth) => cb (err, !truth));\n }, callback);\n}\n\nfunction _withoutIndex(iteratee) {\n return (value, index, callback) => iteratee(value, callback);\n}\n\n/**\n * Applies the function `iteratee` to each item in `coll`, in parallel.\n * The `iteratee` is called with an item from the list, and a callback for when\n * it has finished. If the `iteratee` passes an error to its `callback`, the\n * main `callback` (for the `each` function) is immediately called with the\n * error.\n *\n * Note, that since this function applies `iteratee` to each item in parallel,\n * there is no guarantee that the iteratee functions will complete in order.\n *\n * @name each\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEach\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to\n * each item in `coll`. Invoked with (item, callback).\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOf`.\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n * // dir4 does not exist\n *\n * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt'];\n * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt'];\n *\n * // asynchronous function that deletes a file\n * const deleteFile = function(file, callback) {\n * fs.unlink(file, callback);\n * };\n *\n * // Using callbacks\n * async.each(fileList, deleteFile, function(err) {\n * if( err ) {\n * console.log(err);\n * } else {\n * console.log('All files have been deleted successfully');\n * }\n * });\n *\n * // Error Handling\n * async.each(withMissingFileList, deleteFile, function(err){\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4/file2.txt does not exist\n * // dir1/file1.txt could have been deleted\n * });\n *\n * // Using Promises\n * async.each(fileList, deleteFile)\n * .then( () => {\n * console.log('All files have been deleted successfully');\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Error Handling\n * async.each(fileList, deleteFile)\n * .then( () => {\n * console.log('All files have been deleted successfully');\n * }).catch( err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4/file2.txt does not exist\n * // dir1/file1.txt could have been deleted\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * await async.each(files, deleteFile);\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // Error Handling\n * async () => {\n * try {\n * await async.each(withMissingFileList, deleteFile);\n * }\n * catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * // since dir4/file2.txt does not exist\n * // dir1/file1.txt could have been deleted\n * }\n * }\n *\n */\nfunction eachLimit$2(coll, iteratee, callback) {\n return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback);\n}\n\nvar each = awaitify(eachLimit$2, 3);\n\n/**\n * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.\n *\n * @name eachLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOfLimit`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction eachLimit(coll, limit, iteratee, callback) {\n return eachOfLimit$2(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback);\n}\nvar eachLimit$1 = awaitify(eachLimit, 4);\n\n/**\n * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.\n *\n * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item\n * in series and therefore the iteratee functions will complete in order.\n\n * @name eachSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachSeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in `coll`.\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOfSeries`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction eachSeries(coll, iteratee, callback) {\n return eachLimit$1(coll, 1, iteratee, callback)\n}\nvar eachSeries$1 = awaitify(eachSeries, 3);\n\n/**\n * Wrap an async function and ensure it calls its callback on a later tick of\n * the event loop. If the function already calls its callback on a next tick,\n * no extra deferral is added. This is useful for preventing stack overflows\n * (`RangeError: Maximum call stack size exceeded`) and generally keeping\n * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)\n * contained. ES2017 `async` functions are returned as-is -- they are immune\n * to Zalgo's corrupting influences, as they always resolve on a later tick.\n *\n * @name ensureAsync\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - an async function, one that expects a node-style\n * callback as its last argument.\n * @returns {AsyncFunction} Returns a wrapped function with the exact same call\n * signature as the function passed in.\n * @example\n *\n * function sometimesAsync(arg, callback) {\n * if (cache[arg]) {\n * return callback(null, cache[arg]); // this would be synchronous!!\n * } else {\n * doSomeIO(arg, callback); // this IO would be asynchronous\n * }\n * }\n *\n * // this has a risk of stack overflows if many results are cached in a row\n * async.mapSeries(args, sometimesAsync, done);\n *\n * // this will defer sometimesAsync's callback if necessary,\n * // preventing stack overflows\n * async.mapSeries(args, async.ensureAsync(sometimesAsync), done);\n */\nfunction ensureAsync(fn) {\n if (isAsync(fn)) return fn;\n return function (...args/*, callback*/) {\n var callback = args.pop();\n var sync = true;\n args.push((...innerArgs) => {\n if (sync) {\n setImmediate$1(() => callback(...innerArgs));\n } else {\n callback(...innerArgs);\n }\n });\n fn.apply(this, args);\n sync = false;\n };\n}\n\n/**\n * Returns `true` if every element in `coll` satisfies an async test. If any\n * iteratee call returns `false`, the main `callback` is immediately called.\n *\n * @name every\n * @static\n * @memberOf module:Collections\n * @method\n * @alias all\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in parallel.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n * // dir4 does not exist\n *\n * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt'];\n * const withMissingFileList = ['file1.txt','file2.txt','file4.txt'];\n *\n * // asynchronous function that checks if a file exists\n * function fileExists(file, callback) {\n * fs.access(file, fs.constants.F_OK, (err) => {\n * callback(null, !err);\n * });\n * }\n *\n * // Using callbacks\n * async.every(fileList, fileExists, function(err, result) {\n * console.log(result);\n * // true\n * // result is true since every file exists\n * });\n *\n * async.every(withMissingFileList, fileExists, function(err, result) {\n * console.log(result);\n * // false\n * // result is false since NOT every file exists\n * });\n *\n * // Using Promises\n * async.every(fileList, fileExists)\n * .then( result => {\n * console.log(result);\n * // true\n * // result is true since every file exists\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * async.every(withMissingFileList, fileExists)\n * .then( result => {\n * console.log(result);\n * // false\n * // result is false since NOT every file exists\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.every(fileList, fileExists);\n * console.log(result);\n * // true\n * // result is true since every file exists\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * async () => {\n * try {\n * let result = await async.every(withMissingFileList, fileExists);\n * console.log(result);\n * // false\n * // result is false since NOT every file exists\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction every(coll, iteratee, callback) {\n return _createTester(bool => !bool, res => !res)(eachOf$1, coll, iteratee, callback)\n}\nvar every$1 = awaitify(every, 3);\n\n/**\n * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.\n *\n * @name everyLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.every]{@link module:Collections.every}\n * @alias allLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in parallel.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction everyLimit(coll, limit, iteratee, callback) {\n return _createTester(bool => !bool, res => !res)(eachOfLimit$2(limit), coll, iteratee, callback)\n}\nvar everyLimit$1 = awaitify(everyLimit, 4);\n\n/**\n * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.\n *\n * @name everySeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.every]{@link module:Collections.every}\n * @alias allSeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in series.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction everySeries(coll, iteratee, callback) {\n return _createTester(bool => !bool, res => !res)(eachOfSeries$1, coll, iteratee, callback)\n}\nvar everySeries$1 = awaitify(everySeries, 3);\n\nfunction filterArray(eachfn, arr, iteratee, callback) {\n var truthValues = new Array(arr.length);\n eachfn(arr, (x, index, iterCb) => {\n iteratee(x, (err, v) => {\n truthValues[index] = !!v;\n iterCb(err);\n });\n }, err => {\n if (err) return callback(err);\n var results = [];\n for (var i = 0; i < arr.length; i++) {\n if (truthValues[i]) results.push(arr[i]);\n }\n callback(null, results);\n });\n}\n\nfunction filterGeneric(eachfn, coll, iteratee, callback) {\n var results = [];\n eachfn(coll, (x, index, iterCb) => {\n iteratee(x, (err, v) => {\n if (err) return iterCb(err);\n if (v) {\n results.push({index, value: x});\n }\n iterCb(err);\n });\n }, err => {\n if (err) return callback(err);\n callback(null, results\n .sort((a, b) => a.index - b.index)\n .map(v => v.value));\n });\n}\n\nfunction _filter(eachfn, coll, iteratee, callback) {\n var filter = isArrayLike(coll) ? filterArray : filterGeneric;\n return filter(eachfn, coll, wrapAsync(iteratee), callback);\n}\n\n/**\n * Returns a new array of all the values in `coll` which pass an async truth\n * test. This operation is performed in parallel, but the results array will be\n * in the same order as the original.\n *\n * @name filter\n * @static\n * @memberOf module:Collections\n * @method\n * @alias select\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback provided\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n *\n * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt'];\n *\n * // asynchronous function that checks if a file exists\n * function fileExists(file, callback) {\n * fs.access(file, fs.constants.F_OK, (err) => {\n * callback(null, !err);\n * });\n * }\n *\n * // Using callbacks\n * async.filter(files, fileExists, function(err, results) {\n * if(err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // [ 'dir1/file1.txt', 'dir2/file3.txt' ]\n * // results is now an array of the existing files\n * }\n * });\n *\n * // Using Promises\n * async.filter(files, fileExists)\n * .then(results => {\n * console.log(results);\n * // [ 'dir1/file1.txt', 'dir2/file3.txt' ]\n * // results is now an array of the existing files\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let results = await async.filter(files, fileExists);\n * console.log(results);\n * // [ 'dir1/file1.txt', 'dir2/file3.txt' ]\n * // results is now an array of the existing files\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction filter (coll, iteratee, callback) {\n return _filter(eachOf$1, coll, iteratee, callback)\n}\nvar filter$1 = awaitify(filter, 3);\n\n/**\n * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name filterLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @alias selectLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction filterLimit (coll, limit, iteratee, callback) {\n return _filter(eachOfLimit$2(limit), coll, iteratee, callback)\n}\nvar filterLimit$1 = awaitify(filterLimit, 4);\n\n/**\n * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time.\n *\n * @name filterSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @alias selectSeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results)\n * @returns {Promise} a promise, if no callback provided\n */\nfunction filterSeries (coll, iteratee, callback) {\n return _filter(eachOfSeries$1, coll, iteratee, callback)\n}\nvar filterSeries$1 = awaitify(filterSeries, 3);\n\n/**\n * Calls the asynchronous function `fn` with a callback parameter that allows it\n * to call itself again, in series, indefinitely.\n\n * If an error is passed to the callback then `errback` is called with the\n * error, and execution stops, otherwise it will never be called.\n *\n * @name forever\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} fn - an async function to call repeatedly.\n * Invoked with (next).\n * @param {Function} [errback] - when `fn` passes an error to it's callback,\n * this function will be called, and execution stops. Invoked with (err).\n * @returns {Promise} a promise that rejects if an error occurs and an errback\n * is not passed\n * @example\n *\n * async.forever(\n * function(next) {\n * // next is suitable for passing to things that need a callback(err [, whatever]);\n * // it will result in this function being called again.\n * },\n * function(err) {\n * // if next is called with a value in its first parameter, it will appear\n * // in here as 'err', and execution will stop.\n * }\n * );\n */\nfunction forever(fn, errback) {\n var done = onlyOnce(errback);\n var task = wrapAsync(ensureAsync(fn));\n\n function next(err) {\n if (err) return done(err);\n if (err === false) return;\n task(next);\n }\n return next();\n}\nvar forever$1 = awaitify(forever, 2);\n\n/**\n * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time.\n *\n * @name groupByLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.groupBy]{@link module:Collections.groupBy}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whoses\n * properties are arrays of values which returned the corresponding key.\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction groupByLimit(coll, limit, iteratee, callback) {\n var _iteratee = wrapAsync(iteratee);\n return mapLimit$1(coll, limit, (val, iterCb) => {\n _iteratee(val, (err, key) => {\n if (err) return iterCb(err);\n return iterCb(err, {key, val});\n });\n }, (err, mapResults) => {\n var result = {};\n // from MDN, handle object having an `hasOwnProperty` prop\n var {hasOwnProperty} = Object.prototype;\n\n for (var i = 0; i < mapResults.length; i++) {\n if (mapResults[i]) {\n var {key} = mapResults[i];\n var {val} = mapResults[i];\n\n if (hasOwnProperty.call(result, key)) {\n result[key].push(val);\n } else {\n result[key] = [val];\n }\n }\n }\n\n return callback(err, result);\n });\n}\n\nvar groupByLimit$1 = awaitify(groupByLimit, 4);\n\n/**\n * Returns a new object, where each value corresponds to an array of items, from\n * `coll`, that returned the corresponding key. That is, the keys of the object\n * correspond to the values passed to the `iteratee` callback.\n *\n * Note: Since this function applies the `iteratee` to each item in parallel,\n * there is no guarantee that the `iteratee` functions will complete in order.\n * However, the values for each key in the `result` will be in the same order as\n * the original `coll`. For Objects, the values will roughly be in the order of\n * the original Objects' keys (but this can vary across JavaScript engines).\n *\n * @name groupBy\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whoses\n * properties are arrays of values which returned the corresponding key.\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n * // dir4 does not exist\n *\n * const files = ['dir1/file1.txt','dir2','dir4']\n *\n * // asynchronous function that detects file type as none, file, or directory\n * function detectFile(file, callback) {\n * fs.stat(file, function(err, stat) {\n * if (err) {\n * return callback(null, 'none');\n * }\n * callback(null, stat.isDirectory() ? 'directory' : 'file');\n * });\n * }\n *\n * //Using callbacks\n * async.groupBy(files, detectFile, function(err, result) {\n * if(err) {\n * console.log(err);\n * } else {\n *\t console.log(result);\n * // {\n * // file: [ 'dir1/file1.txt' ],\n * // none: [ 'dir4' ],\n * // directory: [ 'dir2']\n * // }\n * // result is object containing the files grouped by type\n * }\n * });\n *\n * // Using Promises\n * async.groupBy(files, detectFile)\n * .then( result => {\n * console.log(result);\n * // {\n * // file: [ 'dir1/file1.txt' ],\n * // none: [ 'dir4' ],\n * // directory: [ 'dir2']\n * // }\n * // result is object containing the files grouped by type\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.groupBy(files, detectFile);\n * console.log(result);\n * // {\n * // file: [ 'dir1/file1.txt' ],\n * // none: [ 'dir4' ],\n * // directory: [ 'dir2']\n * // }\n * // result is object containing the files grouped by type\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction groupBy (coll, iteratee, callback) {\n return groupByLimit$1(coll, Infinity, iteratee, callback)\n}\n\n/**\n * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time.\n *\n * @name groupBySeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.groupBy]{@link module:Collections.groupBy}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whose\n * properties are arrays of values which returned the corresponding key.\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction groupBySeries (coll, iteratee, callback) {\n return groupByLimit$1(coll, 1, iteratee, callback)\n}\n\n/**\n * Logs the result of an `async` function to the `console`. Only works in\n * Node.js or in browsers that support `console.log` and `console.error` (such\n * as FF and Chrome). If multiple arguments are returned from the async\n * function, `console.log` is called on each argument in order.\n *\n * @name log\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} function - The function you want to eventually apply\n * all arguments to.\n * @param {...*} arguments... - Any number of arguments to apply to the function.\n * @example\n *\n * // in a module\n * var hello = function(name, callback) {\n * setTimeout(function() {\n * callback(null, 'hello ' + name);\n * }, 1000);\n * };\n *\n * // in the node repl\n * node> async.log(hello, 'world');\n * 'hello world'\n */\nvar log = consoleFunc('log');\n\n/**\n * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name mapValuesLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.mapValues]{@link module:Collections.mapValues}\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction mapValuesLimit(obj, limit, iteratee, callback) {\n callback = once(callback);\n var newObj = {};\n var _iteratee = wrapAsync(iteratee);\n return eachOfLimit$2(limit)(obj, (val, key, next) => {\n _iteratee(val, key, (err, result) => {\n if (err) return next(err);\n newObj[key] = result;\n next(err);\n });\n }, err => callback(err, newObj));\n}\n\nvar mapValuesLimit$1 = awaitify(mapValuesLimit, 4);\n\n/**\n * A relative of [`map`]{@link module:Collections.map}, designed for use with objects.\n *\n * Produces a new Object by mapping each value of `obj` through the `iteratee`\n * function. The `iteratee` is called each `value` and `key` from `obj` and a\n * callback for when it has finished processing. Each of these callbacks takes\n * two arguments: an `error`, and the transformed item from `obj`. If `iteratee`\n * passes an error to its callback, the main `callback` (for the `mapValues`\n * function) is immediately called with the error.\n *\n * Note, the order of the keys in the result is not guaranteed. The keys will\n * be roughly in the order they complete, (but this is very engine-specific)\n *\n * @name mapValues\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * // file1.txt is a file that is 1000 bytes in size\n * // file2.txt is a file that is 2000 bytes in size\n * // file3.txt is a file that is 3000 bytes in size\n * // file4.txt does not exist\n *\n * const fileMap = {\n * f1: 'file1.txt',\n * f2: 'file2.txt',\n * f3: 'file3.txt'\n * };\n *\n * const withMissingFileMap = {\n * f1: 'file1.txt',\n * f2: 'file2.txt',\n * f3: 'file4.txt'\n * };\n *\n * // asynchronous function that returns the file size in bytes\n * function getFileSizeInBytes(file, key, callback) {\n * fs.stat(file, function(err, stat) {\n * if (err) {\n * return callback(err);\n * }\n * callback(null, stat.size);\n * });\n * }\n *\n * // Using callbacks\n * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(result);\n * // result is now a map of file size in bytes for each file, e.g.\n * // {\n * // f1: 1000,\n * // f2: 2000,\n * // f3: 3000\n * // }\n * }\n * });\n *\n * // Error handling\n * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) {\n * if (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * } else {\n * console.log(result);\n * }\n * });\n *\n * // Using Promises\n * async.mapValues(fileMap, getFileSizeInBytes)\n * .then( result => {\n * console.log(result);\n * // result is now a map of file size in bytes for each file, e.g.\n * // {\n * // f1: 1000,\n * // f2: 2000,\n * // f3: 3000\n * // }\n * }).catch (err => {\n * console.log(err);\n * });\n *\n * // Error Handling\n * async.mapValues(withMissingFileMap, getFileSizeInBytes)\n * .then( result => {\n * console.log(result);\n * }).catch (err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.mapValues(fileMap, getFileSizeInBytes);\n * console.log(result);\n * // result is now a map of file size in bytes for each file, e.g.\n * // {\n * // f1: 1000,\n * // f2: 2000,\n * // f3: 3000\n * // }\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // Error Handling\n * async () => {\n * try {\n * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes);\n * console.log(result);\n * }\n * catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * }\n * }\n *\n */\nfunction mapValues(obj, iteratee, callback) {\n return mapValuesLimit$1(obj, Infinity, iteratee, callback)\n}\n\n/**\n * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time.\n *\n * @name mapValuesSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.mapValues]{@link module:Collections.mapValues}\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction mapValuesSeries(obj, iteratee, callback) {\n return mapValuesLimit$1(obj, 1, iteratee, callback)\n}\n\n/**\n * Caches the results of an async function. When creating a hash to store\n * function results against, the callback is omitted from the hash and an\n * optional hash function can be used.\n *\n * **Note: if the async function errs, the result will not be cached and\n * subsequent calls will call the wrapped function.**\n *\n * If no hash function is specified, the first argument is used as a hash key,\n * which may work reasonably if it is a string or a data type that converts to a\n * distinct string. Note that objects and arrays will not behave reasonably.\n * Neither will cases where the other arguments are significant. In such cases,\n * specify your own hash function.\n *\n * The cache of results is exposed as the `memo` property of the function\n * returned by `memoize`.\n *\n * @name memoize\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - The async function to proxy and cache results from.\n * @param {Function} hasher - An optional function for generating a custom hash\n * for storing results. It has all the arguments applied to it apart from the\n * callback, and must be synchronous.\n * @returns {AsyncFunction} a memoized version of `fn`\n * @example\n *\n * var slow_fn = function(name, callback) {\n * // do something\n * callback(null, result);\n * };\n * var fn = async.memoize(slow_fn);\n *\n * // fn can now be used as if it were slow_fn\n * fn('some name', function() {\n * // callback\n * });\n */\nfunction memoize(fn, hasher = v => v) {\n var memo = Object.create(null);\n var queues = Object.create(null);\n var _fn = wrapAsync(fn);\n var memoized = initialParams((args, callback) => {\n var key = hasher(...args);\n if (key in memo) {\n setImmediate$1(() => callback(null, ...memo[key]));\n } else if (key in queues) {\n queues[key].push(callback);\n } else {\n queues[key] = [callback];\n _fn(...args, (err, ...resultArgs) => {\n // #1465 don't memoize if an error occurred\n if (!err) {\n memo[key] = resultArgs;\n }\n var q = queues[key];\n delete queues[key];\n for (var i = 0, l = q.length; i < l; i++) {\n q[i](err, ...resultArgs);\n }\n });\n }\n });\n memoized.memo = memo;\n memoized.unmemoized = fn;\n return memoized;\n}\n\n/* istanbul ignore file */\n\n/**\n * Calls `callback` on a later loop around the event loop. In Node.js this just\n * calls `process.nextTick`. In the browser it will use `setImmediate` if\n * available, otherwise `setTimeout(callback, 0)`, which means other higher\n * priority events may precede the execution of `callback`.\n *\n * This is used internally for browser-compatibility purposes.\n *\n * @name nextTick\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.setImmediate]{@link module:Utils.setImmediate}\n * @category Util\n * @param {Function} callback - The function to call on a later loop around\n * the event loop. Invoked with (args...).\n * @param {...*} args... - any number of additional arguments to pass to the\n * callback on the next tick.\n * @example\n *\n * var call_order = [];\n * async.nextTick(function() {\n * call_order.push('two');\n * // call_order now equals ['one','two']\n * });\n * call_order.push('one');\n *\n * async.setImmediate(function (a, b, c) {\n * // a, b, and c equal 1, 2, and 3\n * }, 1, 2, 3);\n */\nvar _defer;\n\nif (hasNextTick) {\n _defer = process.nextTick;\n} else if (hasSetImmediate) {\n _defer = setImmediate;\n} else {\n _defer = fallback;\n}\n\nvar nextTick = wrap(_defer);\n\nvar _parallel = awaitify((eachfn, tasks, callback) => {\n var results = isArrayLike(tasks) ? [] : {};\n\n eachfn(tasks, (task, key, taskCb) => {\n wrapAsync(task)((err, ...result) => {\n if (result.length < 2) {\n [result] = result;\n }\n results[key] = result;\n taskCb(err);\n });\n }, err => callback(err, results));\n}, 3);\n\n/**\n * Run the `tasks` collection of functions in parallel, without waiting until\n * the previous function has completed. If any of the functions pass an error to\n * its callback, the main `callback` is immediately called with the value of the\n * error. Once the `tasks` have completed, the results are passed to the final\n * `callback` as an array.\n *\n * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about\n * parallel execution of code. If your tasks do not use any timers or perform\n * any I/O, they will actually be executed in series. Any synchronous setup\n * sections for each task will happen one after the other. JavaScript remains\n * single-threaded.\n *\n * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the\n * execution of other tasks when a task fails.\n *\n * It is also possible to use an object instead of an array. Each property will\n * be run as a function and the results will be passed to the final `callback`\n * as an object instead of an array. This can be a more readable way of handling\n * results from {@link async.parallel}.\n *\n * @name parallel\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of\n * [async functions]{@link AsyncFunction} to run.\n * Each async function can complete with any number of optional `result` values.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed successfully. This function gets a results array\n * (or object) containing all the result arguments passed to the task callbacks.\n * Invoked with (err, results).\n * @returns {Promise} a promise, if a callback is not passed\n *\n * @example\n *\n * //Using Callbacks\n * async.parallel([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ], function(err, results) {\n * console.log(results);\n * // results is equal to ['one','two'] even though\n * // the second function had a shorter timeout.\n * });\n *\n * // an example using an object instead of an array\n * async.parallel({\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * callback(null, 2);\n * }, 100);\n * }\n * }, function(err, results) {\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * });\n *\n * //Using Promises\n * async.parallel([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ]).then(results => {\n * console.log(results);\n * // results is equal to ['one','two'] even though\n * // the second function had a shorter timeout.\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // an example using an object instead of an array\n * async.parallel({\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * callback(null, 2);\n * }, 100);\n * }\n * }).then(results => {\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * //Using async/await\n * async () => {\n * try {\n * let results = await async.parallel([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ]);\n * console.log(results);\n * // results is equal to ['one','two'] even though\n * // the second function had a shorter timeout.\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // an example using an object instead of an array\n * async () => {\n * try {\n * let results = await async.parallel({\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * callback(null, 2);\n * }, 100);\n * }\n * });\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction parallel(tasks, callback) {\n return _parallel(eachOf$1, tasks, callback);\n}\n\n/**\n * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name parallelLimit\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.parallel]{@link module:ControlFlow.parallel}\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of\n * [async functions]{@link AsyncFunction} to run.\n * Each async function can complete with any number of optional `result` values.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed successfully. This function gets a results array\n * (or object) containing all the result arguments passed to the task callbacks.\n * Invoked with (err, results).\n * @returns {Promise} a promise, if a callback is not passed\n */\nfunction parallelLimit(tasks, limit, callback) {\n return _parallel(eachOfLimit$2(limit), tasks, callback);\n}\n\n/**\n * A queue of tasks for the worker function to complete.\n * @typedef {Iterable} QueueObject\n * @memberOf module:ControlFlow\n * @property {Function} length - a function returning the number of items\n * waiting to be processed. Invoke with `queue.length()`.\n * @property {boolean} started - a boolean indicating whether or not any\n * items have been pushed and processed by the queue.\n * @property {Function} running - a function returning the number of items\n * currently being processed. Invoke with `queue.running()`.\n * @property {Function} workersList - a function returning the array of items\n * currently being processed. Invoke with `queue.workersList()`.\n * @property {Function} idle - a function returning false if there are items\n * waiting or being processed, or true if not. Invoke with `queue.idle()`.\n * @property {number} concurrency - an integer for determining how many `worker`\n * functions should be run in parallel. This property can be changed after a\n * `queue` is created to alter the concurrency on-the-fly.\n * @property {number} payload - an integer that specifies how many items are\n * passed to the worker function at a time. only applies if this is a\n * [cargo]{@link module:ControlFlow.cargo} object\n * @property {AsyncFunction} push - add a new task to the `queue`. Calls `callback`\n * once the `worker` has finished processing the task. Instead of a single task,\n * a `tasks` array can be submitted. The respective callback is used for every\n * task in the list. Invoke with `queue.push(task, [callback])`,\n * @property {AsyncFunction} unshift - add a new task to the front of the `queue`.\n * Invoke with `queue.unshift(task, [callback])`.\n * @property {AsyncFunction} pushAsync - the same as `q.push`, except this returns\n * a promise that rejects if an error occurs.\n * @property {AsyncFunction} unshiftAsync - the same as `q.unshift`, except this returns\n * a promise that rejects if an error occurs.\n * @property {Function} remove - remove items from the queue that match a test\n * function. The test function will be passed an object with a `data` property,\n * and a `priority` property, if this is a\n * [priorityQueue]{@link module:ControlFlow.priorityQueue} object.\n * Invoked with `queue.remove(testFn)`, where `testFn` is of the form\n * `function ({data, priority}) {}` and returns a Boolean.\n * @property {Function} saturated - a function that sets a callback that is\n * called when the number of running workers hits the `concurrency` limit, and\n * further tasks will be queued. If the callback is omitted, `q.saturated()`\n * returns a promise for the next occurrence.\n * @property {Function} unsaturated - a function that sets a callback that is\n * called when the number of running workers is less than the `concurrency` &\n * `buffer` limits, and further tasks will not be queued. If the callback is\n * omitted, `q.unsaturated()` returns a promise for the next occurrence.\n * @property {number} buffer - A minimum threshold buffer in order to say that\n * the `queue` is `unsaturated`.\n * @property {Function} empty - a function that sets a callback that is called\n * when the last item from the `queue` is given to a `worker`. If the callback\n * is omitted, `q.empty()` returns a promise for the next occurrence.\n * @property {Function} drain - a function that sets a callback that is called\n * when the last item from the `queue` has returned from the `worker`. If the\n * callback is omitted, `q.drain()` returns a promise for the next occurrence.\n * @property {Function} error - a function that sets a callback that is called\n * when a task errors. Has the signature `function(error, task)`. If the\n * callback is omitted, `error()` returns a promise that rejects on the next\n * error.\n * @property {boolean} paused - a boolean for determining whether the queue is\n * in a paused state.\n * @property {Function} pause - a function that pauses the processing of tasks\n * until `resume()` is called. Invoke with `queue.pause()`.\n * @property {Function} resume - a function that resumes the processing of\n * queued tasks when the queue is paused. Invoke with `queue.resume()`.\n * @property {Function} kill - a function that removes the `drain` callback and\n * empties remaining tasks from the queue forcing it to go idle. No more tasks\n * should be pushed to the queue after calling this function. Invoke with `queue.kill()`.\n *\n * @example\n * const q = async.queue(worker, 2)\n * q.push(item1)\n * q.push(item2)\n * q.push(item3)\n * // queues are iterable, spread into an array to inspect\n * const items = [...q] // [item1, item2, item3]\n * // or use for of\n * for (let item of q) {\n * console.log(item)\n * }\n *\n * q.drain(() => {\n * console.log('all done')\n * })\n * // or\n * await q.drain()\n */\n\n/**\n * Creates a `queue` object with the specified `concurrency`. Tasks added to the\n * `queue` are processed in parallel (up to the `concurrency` limit). If all\n * `worker`s are in progress, the task is queued until one becomes available.\n * Once a `worker` completes a `task`, that `task`'s callback is called.\n *\n * @name queue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} worker - An async function for processing a queued task.\n * If you want to handle errors from an individual task, pass a callback to\n * `q.push()`. Invoked with (task, callback).\n * @param {number} [concurrency=1] - An `integer` for determining how many\n * `worker` functions should be run in parallel. If omitted, the concurrency\n * defaults to `1`. If the concurrency is `0`, an error is thrown.\n * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can be\n * attached as certain properties to listen for specific events during the\n * lifecycle of the queue.\n * @example\n *\n * // create a queue object with concurrency 2\n * var q = async.queue(function(task, callback) {\n * console.log('hello ' + task.name);\n * callback();\n * }, 2);\n *\n * // assign a callback\n * q.drain(function() {\n * console.log('all items have been processed');\n * });\n * // or await the end\n * await q.drain()\n *\n * // assign an error callback\n * q.error(function(err, task) {\n * console.error('task experienced an error');\n * });\n *\n * // add some items to the queue\n * q.push({name: 'foo'}, function(err) {\n * console.log('finished processing foo');\n * });\n * // callback is optional\n * q.push({name: 'bar'});\n *\n * // add some items to the queue (batch-wise)\n * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) {\n * console.log('finished processing item');\n * });\n *\n * // add some items to the front of the queue\n * q.unshift({name: 'bar'}, function (err) {\n * console.log('finished processing bar');\n * });\n */\nfunction queue (worker, concurrency) {\n var _worker = wrapAsync(worker);\n return queue$1((items, cb) => {\n _worker(items[0], cb);\n }, concurrency, 1);\n}\n\n// Binary min-heap implementation used for priority queue.\n// Implementation is stable, i.e. push time is considered for equal priorities\nclass Heap {\n constructor() {\n this.heap = [];\n this.pushCount = Number.MIN_SAFE_INTEGER;\n }\n\n get length() {\n return this.heap.length;\n }\n\n empty () {\n this.heap = [];\n return this;\n }\n\n percUp(index) {\n let p;\n\n while (index > 0 && smaller(this.heap[index], this.heap[p=parent(index)])) {\n let t = this.heap[index];\n this.heap[index] = this.heap[p];\n this.heap[p] = t;\n\n index = p;\n }\n }\n\n percDown(index) {\n let l;\n\n while ((l=leftChi(index)) < this.heap.length) {\n if (l+1 < this.heap.length && smaller(this.heap[l+1], this.heap[l])) {\n l = l+1;\n }\n\n if (smaller(this.heap[index], this.heap[l])) {\n break;\n }\n\n let t = this.heap[index];\n this.heap[index] = this.heap[l];\n this.heap[l] = t;\n\n index = l;\n }\n }\n\n push(node) {\n node.pushCount = ++this.pushCount;\n this.heap.push(node);\n this.percUp(this.heap.length-1);\n }\n\n unshift(node) {\n return this.heap.push(node);\n }\n\n shift() {\n let [top] = this.heap;\n\n this.heap[0] = this.heap[this.heap.length-1];\n this.heap.pop();\n this.percDown(0);\n\n return top;\n }\n\n toArray() {\n return [...this];\n }\n\n *[Symbol.iterator] () {\n for (let i = 0; i < this.heap.length; i++) {\n yield this.heap[i].data;\n }\n }\n\n remove (testFn) {\n let j = 0;\n for (let i = 0; i < this.heap.length; i++) {\n if (!testFn(this.heap[i])) {\n this.heap[j] = this.heap[i];\n j++;\n }\n }\n\n this.heap.splice(j);\n\n for (let i = parent(this.heap.length-1); i >= 0; i--) {\n this.percDown(i);\n }\n\n return this;\n }\n}\n\nfunction leftChi(i) {\n return (i<<1)+1;\n}\n\nfunction parent(i) {\n return ((i+1)>>1)-1;\n}\n\nfunction smaller(x, y) {\n if (x.priority !== y.priority) {\n return x.priority < y.priority;\n }\n else {\n return x.pushCount < y.pushCount;\n }\n}\n\n/**\n * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and\n * completed in ascending priority order.\n *\n * @name priorityQueue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.queue]{@link module:ControlFlow.queue}\n * @category Control Flow\n * @param {AsyncFunction} worker - An async function for processing a queued task.\n * If you want to handle errors from an individual task, pass a callback to\n * `q.push()`.\n * Invoked with (task, callback).\n * @param {number} concurrency - An `integer` for determining how many `worker`\n * functions should be run in parallel. If omitted, the concurrency defaults to\n * `1`. If the concurrency is `0`, an error is thrown.\n * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are three\n * differences between `queue` and `priorityQueue` objects:\n * * `push(task, priority, [callback])` - `priority` should be a number. If an\n * array of `tasks` is given, all tasks will be assigned the same priority.\n * * `pushAsync(task, priority, [callback])` - the same as `priorityQueue.push`,\n * except this returns a promise that rejects if an error occurs.\n * * The `unshift` and `unshiftAsync` methods were removed.\n */\nfunction priorityQueue(worker, concurrency) {\n // Start with a normal queue\n var q = queue(worker, concurrency);\n\n var {\n push,\n pushAsync\n } = q;\n\n q._tasks = new Heap();\n q._createTaskItem = ({data, priority}, callback) => {\n return {\n data,\n priority,\n callback\n };\n };\n\n function createDataItems(tasks, priority) {\n if (!Array.isArray(tasks)) {\n return {data: tasks, priority};\n }\n return tasks.map(data => { return {data, priority}; });\n }\n\n // Override push to accept second parameter representing priority\n q.push = function(data, priority = 0, callback) {\n return push(createDataItems(data, priority), callback);\n };\n\n q.pushAsync = function(data, priority = 0, callback) {\n return pushAsync(createDataItems(data, priority), callback);\n };\n\n // Remove unshift functions\n delete q.unshift;\n delete q.unshiftAsync;\n\n return q;\n}\n\n/**\n * Runs the `tasks` array of functions in parallel, without waiting until the\n * previous function has completed. Once any of the `tasks` complete or pass an\n * error to its callback, the main `callback` is immediately called. It's\n * equivalent to `Promise.race()`.\n *\n * @name race\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction}\n * to run. Each function can complete with an optional `result` value.\n * @param {Function} callback - A callback to run once any of the functions have\n * completed. This function gets an error or result from the first function that\n * completed. Invoked with (err, result).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * async.race([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ],\n * // main callback\n * function(err, result) {\n * // the result will be equal to 'two' as it finishes earlier\n * });\n */\nfunction race(tasks, callback) {\n callback = once(callback);\n if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions'));\n if (!tasks.length) return callback();\n for (var i = 0, l = tasks.length; i < l; i++) {\n wrapAsync(tasks[i])(callback);\n }\n}\n\nvar race$1 = awaitify(race, 2);\n\n/**\n * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order.\n *\n * @name reduceRight\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reduce]{@link module:Collections.reduce}\n * @alias foldr\n * @category Collection\n * @param {Array} array - A collection to iterate over.\n * @param {*} memo - The initial state of the reduction.\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * array to produce the next step in the reduction.\n * The `iteratee` should complete with the next state of the reduction.\n * If the iteratee completes with an error, the reduction is stopped and the\n * main `callback` is immediately called with the error.\n * Invoked with (memo, item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result is the reduced value. Invoked with\n * (err, result).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction reduceRight (array, memo, iteratee, callback) {\n var reversed = [...array].reverse();\n return reduce$1(reversed, memo, iteratee, callback);\n}\n\n/**\n * Wraps the async function in another function that always completes with a\n * result object, even when it errors.\n *\n * The result object has either the property `error` or `value`.\n *\n * @name reflect\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - The async function you want to wrap\n * @returns {Function} - A function that always passes null to it's callback as\n * the error. The second argument to the callback will be an `object` with\n * either an `error` or a `value` property.\n * @example\n *\n * async.parallel([\n * async.reflect(function(callback) {\n * // do some stuff ...\n * callback(null, 'one');\n * }),\n * async.reflect(function(callback) {\n * // do some more stuff but error ...\n * callback('bad stuff happened');\n * }),\n * async.reflect(function(callback) {\n * // do some more stuff ...\n * callback(null, 'two');\n * })\n * ],\n * // optional callback\n * function(err, results) {\n * // values\n * // results[0].value = 'one'\n * // results[1].error = 'bad stuff happened'\n * // results[2].value = 'two'\n * });\n */\nfunction reflect(fn) {\n var _fn = wrapAsync(fn);\n return initialParams(function reflectOn(args, reflectCallback) {\n args.push((error, ...cbArgs) => {\n let retVal = {};\n if (error) {\n retVal.error = error;\n }\n if (cbArgs.length > 0){\n var value = cbArgs;\n if (cbArgs.length <= 1) {\n [value] = cbArgs;\n }\n retVal.value = value;\n }\n reflectCallback(null, retVal);\n });\n\n return _fn.apply(this, args);\n });\n}\n\n/**\n * A helper function that wraps an array or an object of functions with `reflect`.\n *\n * @name reflectAll\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.reflect]{@link module:Utils.reflect}\n * @category Util\n * @param {Array|Object|Iterable} tasks - The collection of\n * [async functions]{@link AsyncFunction} to wrap in `async.reflect`.\n * @returns {Array} Returns an array of async functions, each wrapped in\n * `async.reflect`\n * @example\n *\n * let tasks = [\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * // do some more stuff but error ...\n * callback(new Error('bad stuff happened'));\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ];\n *\n * async.parallel(async.reflectAll(tasks),\n * // optional callback\n * function(err, results) {\n * // values\n * // results[0].value = 'one'\n * // results[1].error = Error('bad stuff happened')\n * // results[2].value = 'two'\n * });\n *\n * // an example using an object instead of an array\n * let tasks = {\n * one: function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * two: function(callback) {\n * callback('two');\n * },\n * three: function(callback) {\n * setTimeout(function() {\n * callback(null, 'three');\n * }, 100);\n * }\n * };\n *\n * async.parallel(async.reflectAll(tasks),\n * // optional callback\n * function(err, results) {\n * // values\n * // results.one.value = 'one'\n * // results.two.error = 'two'\n * // results.three.value = 'three'\n * });\n */\nfunction reflectAll(tasks) {\n var results;\n if (Array.isArray(tasks)) {\n results = tasks.map(reflect);\n } else {\n results = {};\n Object.keys(tasks).forEach(key => {\n results[key] = reflect.call(this, tasks[key]);\n });\n }\n return results;\n}\n\nfunction reject$2(eachfn, arr, _iteratee, callback) {\n const iteratee = wrapAsync(_iteratee);\n return _filter(eachfn, arr, (value, cb) => {\n iteratee(value, (err, v) => {\n cb(err, !v);\n });\n }, callback);\n}\n\n/**\n * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test.\n *\n * @name reject\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n *\n * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt'];\n *\n * // asynchronous function that checks if a file exists\n * function fileExists(file, callback) {\n * fs.access(file, fs.constants.F_OK, (err) => {\n * callback(null, !err);\n * });\n * }\n *\n * // Using callbacks\n * async.reject(fileList, fileExists, function(err, results) {\n * // [ 'dir3/file6.txt' ]\n * // results now equals an array of the non-existing files\n * });\n *\n * // Using Promises\n * async.reject(fileList, fileExists)\n * .then( results => {\n * console.log(results);\n * // [ 'dir3/file6.txt' ]\n * // results now equals an array of the non-existing files\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let results = await async.reject(fileList, fileExists);\n * console.log(results);\n * // [ 'dir3/file6.txt' ]\n * // results now equals an array of the non-existing files\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction reject (coll, iteratee, callback) {\n return reject$2(eachOf$1, coll, iteratee, callback)\n}\nvar reject$1 = awaitify(reject, 3);\n\n/**\n * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name rejectLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reject]{@link module:Collections.reject}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction rejectLimit (coll, limit, iteratee, callback) {\n return reject$2(eachOfLimit$2(limit), coll, iteratee, callback)\n}\nvar rejectLimit$1 = awaitify(rejectLimit, 4);\n\n/**\n * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time.\n *\n * @name rejectSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reject]{@link module:Collections.reject}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction rejectSeries (coll, iteratee, callback) {\n return reject$2(eachOfSeries$1, coll, iteratee, callback)\n}\nvar rejectSeries$1 = awaitify(rejectSeries, 3);\n\nfunction constant(value) {\n return function () {\n return value;\n }\n}\n\n/**\n * Attempts to get a successful response from `task` no more than `times` times\n * before returning an error. If the task is successful, the `callback` will be\n * passed the result of the successful task. If all attempts fail, the callback\n * will be passed the error and result (if any) of the final attempt.\n *\n * @name retry\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @see [async.retryable]{@link module:ControlFlow.retryable}\n * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an\n * object with `times` and `interval` or a number.\n * * `times` - The number of attempts to make before giving up. The default\n * is `5`.\n * * `interval` - The time to wait between retries, in milliseconds. The\n * default is `0`. The interval may also be specified as a function of the\n * retry count (see example).\n * * `errorFilter` - An optional synchronous function that is invoked on\n * erroneous result. If it returns `true` the retry attempts will continue;\n * if the function returns `false` the retry flow is aborted with the current\n * attempt's error and result being returned to the final callback.\n * Invoked with (err).\n * * If `opts` is a number, the number specifies the number of times to retry,\n * with the default interval of `0`.\n * @param {AsyncFunction} task - An async function to retry.\n * Invoked with (callback).\n * @param {Function} [callback] - An optional callback which is called when the\n * task has succeeded, or after the final failed attempt. It receives the `err`\n * and `result` arguments of the last attempt at completing the `task`. Invoked\n * with (err, results).\n * @returns {Promise} a promise if no callback provided\n *\n * @example\n *\n * // The `retry` function can be used as a stand-alone control flow by passing\n * // a callback, as shown below:\n *\n * // try calling apiMethod 3 times\n * async.retry(3, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod 3 times, waiting 200 ms between each retry\n * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod 10 times with exponential backoff\n * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds)\n * async.retry({\n * times: 10,\n * interval: function(retryCount) {\n * return 50 * Math.pow(2, retryCount);\n * }\n * }, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod the default 5 times no delay between each retry\n * async.retry(apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // try calling apiMethod only when error condition satisfies, all other\n * // errors will abort the retry control flow and return to final callback\n * async.retry({\n * errorFilter: function(err) {\n * return err.message === 'Temporary error'; // only retry on a specific error\n * }\n * }, apiMethod, function(err, result) {\n * // do something with the result\n * });\n *\n * // to retry individual methods that are not as reliable within other\n * // control flow functions, use the `retryable` wrapper:\n * async.auto({\n * users: api.getUsers.bind(api),\n * payments: async.retryable(3, api.getPayments.bind(api))\n * }, function(err, results) {\n * // do something with the results\n * });\n *\n */\nconst DEFAULT_TIMES = 5;\nconst DEFAULT_INTERVAL = 0;\n\nfunction retry(opts, task, callback) {\n var options = {\n times: DEFAULT_TIMES,\n intervalFunc: constant(DEFAULT_INTERVAL)\n };\n\n if (arguments.length < 3 && typeof opts === 'function') {\n callback = task || promiseCallback();\n task = opts;\n } else {\n parseTimes(options, opts);\n callback = callback || promiseCallback();\n }\n\n if (typeof task !== 'function') {\n throw new Error(\"Invalid arguments for async.retry\");\n }\n\n var _task = wrapAsync(task);\n\n var attempt = 1;\n function retryAttempt() {\n _task((err, ...args) => {\n if (err === false) return\n if (err && attempt++ < options.times &&\n (typeof options.errorFilter != 'function' ||\n options.errorFilter(err))) {\n setTimeout(retryAttempt, options.intervalFunc(attempt - 1));\n } else {\n callback(err, ...args);\n }\n });\n }\n\n retryAttempt();\n return callback[PROMISE_SYMBOL]\n}\n\nfunction parseTimes(acc, t) {\n if (typeof t === 'object') {\n acc.times = +t.times || DEFAULT_TIMES;\n\n acc.intervalFunc = typeof t.interval === 'function' ?\n t.interval :\n constant(+t.interval || DEFAULT_INTERVAL);\n\n acc.errorFilter = t.errorFilter;\n } else if (typeof t === 'number' || typeof t === 'string') {\n acc.times = +t || DEFAULT_TIMES;\n } else {\n throw new Error(\"Invalid arguments for async.retry\");\n }\n}\n\n/**\n * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method\n * wraps a task and makes it retryable, rather than immediately calling it\n * with retries.\n *\n * @name retryable\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.retry]{@link module:ControlFlow.retry}\n * @category Control Flow\n * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional\n * options, exactly the same as from `retry`, except for a `opts.arity` that\n * is the arity of the `task` function, defaulting to `task.length`\n * @param {AsyncFunction} task - the asynchronous function to wrap.\n * This function will be passed any arguments passed to the returned wrapper.\n * Invoked with (...args, callback).\n * @returns {AsyncFunction} The wrapped function, which when invoked, will\n * retry on an error, based on the parameters specified in `opts`.\n * This function will accept the same parameters as `task`.\n * @example\n *\n * async.auto({\n * dep1: async.retryable(3, getFromFlakyService),\n * process: [\"dep1\", async.retryable(3, function (results, cb) {\n * maybeProcessData(results.dep1, cb);\n * })]\n * }, callback);\n */\nfunction retryable (opts, task) {\n if (!task) {\n task = opts;\n opts = null;\n }\n let arity = (opts && opts.arity) || task.length;\n if (isAsync(task)) {\n arity += 1;\n }\n var _task = wrapAsync(task);\n return initialParams((args, callback) => {\n if (args.length < arity - 1 || callback == null) {\n args.push(callback);\n callback = promiseCallback();\n }\n function taskFn(cb) {\n _task(...args, cb);\n }\n\n if (opts) retry(opts, taskFn, callback);\n else retry(taskFn, callback);\n\n return callback[PROMISE_SYMBOL]\n });\n}\n\n/**\n * Run the functions in the `tasks` collection in series, each one running once\n * the previous function has completed. If any functions in the series pass an\n * error to its callback, no more functions are run, and `callback` is\n * immediately called with the value of the error. Otherwise, `callback`\n * receives an array of results when `tasks` have completed.\n *\n * It is also possible to use an object instead of an array. Each property will\n * be run as a function, and the results will be passed to the final `callback`\n * as an object instead of an array. This can be a more readable way of handling\n * results from {@link async.series}.\n *\n * **Note** that while many implementations preserve the order of object\n * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)\n * explicitly states that\n *\n * > The mechanics and order of enumerating the properties is not specified.\n *\n * So if you rely on the order in which your series of functions are executed,\n * and want this to work on all platforms, consider using an array.\n *\n * @name series\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing\n * [async functions]{@link AsyncFunction} to run in series.\n * Each function can complete with any number of optional `result` values.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This function gets a results array (or object)\n * containing all the result arguments passed to the `task` callbacks. Invoked\n * with (err, result).\n * @return {Promise} a promise, if no callback is passed\n * @example\n *\n * //Using Callbacks\n * async.series([\n * function(callback) {\n * setTimeout(function() {\n * // do some async task\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * // then do another async task\n * callback(null, 'two');\n * }, 100);\n * }\n * ], function(err, results) {\n * console.log(results);\n * // results is equal to ['one','two']\n * });\n *\n * // an example using objects instead of arrays\n * async.series({\n * one: function(callback) {\n * setTimeout(function() {\n * // do some async task\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * // then do another async task\n * callback(null, 2);\n * }, 100);\n * }\n * }, function(err, results) {\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * });\n *\n * //Using Promises\n * async.series([\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * callback(null, 'two');\n * }, 100);\n * }\n * ]).then(results => {\n * console.log(results);\n * // results is equal to ['one','two']\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // an example using an object instead of an array\n * async.series({\n * one: function(callback) {\n * setTimeout(function() {\n * // do some async task\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * // then do another async task\n * callback(null, 2);\n * }, 100);\n * }\n * }).then(results => {\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * //Using async/await\n * async () => {\n * try {\n * let results = await async.series([\n * function(callback) {\n * setTimeout(function() {\n * // do some async task\n * callback(null, 'one');\n * }, 200);\n * },\n * function(callback) {\n * setTimeout(function() {\n * // then do another async task\n * callback(null, 'two');\n * }, 100);\n * }\n * ]);\n * console.log(results);\n * // results is equal to ['one','two']\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * // an example using an object instead of an array\n * async () => {\n * try {\n * let results = await async.parallel({\n * one: function(callback) {\n * setTimeout(function() {\n * // do some async task\n * callback(null, 1);\n * }, 200);\n * },\n * two: function(callback) {\n * setTimeout(function() {\n * // then do another async task\n * callback(null, 2);\n * }, 100);\n * }\n * });\n * console.log(results);\n * // results is equal to: { one: 1, two: 2 }\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction series(tasks, callback) {\n return _parallel(eachOfSeries$1, tasks, callback);\n}\n\n/**\n * Returns `true` if at least one element in the `coll` satisfies an async test.\n * If any iteratee call returns `true`, the main `callback` is immediately\n * called.\n *\n * @name some\n * @static\n * @memberOf module:Collections\n * @method\n * @alias any\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in parallel.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n * @example\n *\n * // dir1 is a directory that contains file1.txt, file2.txt\n * // dir2 is a directory that contains file3.txt, file4.txt\n * // dir3 is a directory that contains file5.txt\n * // dir4 does not exist\n *\n * // asynchronous function that checks if a file exists\n * function fileExists(file, callback) {\n * fs.access(file, fs.constants.F_OK, (err) => {\n * callback(null, !err);\n * });\n * }\n *\n * // Using callbacks\n * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists,\n * function(err, result) {\n * console.log(result);\n * // true\n * // result is true since some file in the list exists\n * }\n *);\n *\n * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists,\n * function(err, result) {\n * console.log(result);\n * // false\n * // result is false since none of the files exists\n * }\n *);\n *\n * // Using Promises\n * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists)\n * .then( result => {\n * console.log(result);\n * // true\n * // result is true since some file in the list exists\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists)\n * .then( result => {\n * console.log(result);\n * // false\n * // result is false since none of the files exists\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists);\n * console.log(result);\n * // true\n * // result is true since some file in the list exists\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n * async () => {\n * try {\n * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists);\n * console.log(result);\n * // false\n * // result is false since none of the files exists\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction some(coll, iteratee, callback) {\n return _createTester(Boolean, res => res)(eachOf$1, coll, iteratee, callback)\n}\nvar some$1 = awaitify(some, 3);\n\n/**\n * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.\n *\n * @name someLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.some]{@link module:Collections.some}\n * @alias anyLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in parallel.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction someLimit(coll, limit, iteratee, callback) {\n return _createTester(Boolean, res => res)(eachOfLimit$2(limit), coll, iteratee, callback)\n}\nvar someLimit$1 = awaitify(someLimit, 4);\n\n/**\n * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.\n *\n * @name someSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.some]{@link module:Collections.some}\n * @alias anySeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in series.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction someSeries(coll, iteratee, callback) {\n return _createTester(Boolean, res => res)(eachOfSeries$1, coll, iteratee, callback)\n}\nvar someSeries$1 = awaitify(someSeries, 3);\n\n/**\n * Sorts a list by the results of running each `coll` value through an async\n * `iteratee`.\n *\n * @name sortBy\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a value to use as the sort criteria as\n * its `result`.\n * Invoked with (item, callback).\n * @param {Function} callback - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is the items\n * from the original `coll` sorted by the values returned by the `iteratee`\n * calls. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback passed\n * @example\n *\n * // bigfile.txt is a file that is 251100 bytes in size\n * // mediumfile.txt is a file that is 11000 bytes in size\n * // smallfile.txt is a file that is 121 bytes in size\n *\n * // asynchronous function that returns the file size in bytes\n * function getFileSizeInBytes(file, callback) {\n * fs.stat(file, function(err, stat) {\n * if (err) {\n * return callback(err);\n * }\n * callback(null, stat.size);\n * });\n * }\n *\n * // Using callbacks\n * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes,\n * function(err, results) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // results is now the original array of files sorted by\n * // file size (ascending by default), e.g.\n * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt']\n * }\n * }\n * );\n *\n * // By modifying the callback parameter the\n * // sorting order can be influenced:\n *\n * // ascending order\n * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) {\n * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) {\n * if (getFileSizeErr) return callback(getFileSizeErr);\n * callback(null, fileSize);\n * });\n * }, function(err, results) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // results is now the original array of files sorted by\n * // file size (ascending by default), e.g.\n * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt']\n * }\n * }\n * );\n *\n * // descending order\n * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) {\n * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) {\n * if (getFileSizeErr) {\n * return callback(getFileSizeErr);\n * }\n * callback(null, fileSize * -1);\n * });\n * }, function(err, results) {\n * if (err) {\n * console.log(err);\n * } else {\n * console.log(results);\n * // results is now the original array of files sorted by\n * // file size (ascending by default), e.g.\n * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt']\n * }\n * }\n * );\n *\n * // Error handling\n * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes,\n * function(err, results) {\n * if (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * } else {\n * console.log(results);\n * }\n * }\n * );\n *\n * // Using Promises\n * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes)\n * .then( results => {\n * console.log(results);\n * // results is now the original array of files sorted by\n * // file size (ascending by default), e.g.\n * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt']\n * }).catch( err => {\n * console.log(err);\n * });\n *\n * // Error handling\n * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes)\n * .then( results => {\n * console.log(results);\n * }).catch( err => {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * });\n *\n * // Using async/await\n * (async () => {\n * try {\n * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes);\n * console.log(results);\n * // results is now the original array of files sorted by\n * // file size (ascending by default), e.g.\n * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt']\n * }\n * catch (err) {\n * console.log(err);\n * }\n * })();\n *\n * // Error handling\n * async () => {\n * try {\n * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes);\n * console.log(results);\n * }\n * catch (err) {\n * console.log(err);\n * // [ Error: ENOENT: no such file or directory ]\n * }\n * }\n *\n */\nfunction sortBy (coll, iteratee, callback) {\n var _iteratee = wrapAsync(iteratee);\n return map$1(coll, (x, iterCb) => {\n _iteratee(x, (err, criteria) => {\n if (err) return iterCb(err);\n iterCb(err, {value: x, criteria});\n });\n }, (err, results) => {\n if (err) return callback(err);\n callback(null, results.sort(comparator).map(v => v.value));\n });\n\n function comparator(left, right) {\n var a = left.criteria, b = right.criteria;\n return a < b ? -1 : a > b ? 1 : 0;\n }\n}\nvar sortBy$1 = awaitify(sortBy, 3);\n\n/**\n * Sets a time limit on an asynchronous function. If the function does not call\n * its callback within the specified milliseconds, it will be called with a\n * timeout error. The code property for the error object will be `'ETIMEDOUT'`.\n *\n * @name timeout\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} asyncFn - The async function to limit in time.\n * @param {number} milliseconds - The specified time limit.\n * @param {*} [info] - Any variable you want attached (`string`, `object`, etc)\n * to timeout Error for more information..\n * @returns {AsyncFunction} Returns a wrapped function that can be used with any\n * of the control flow functions.\n * Invoke this function with the same parameters as you would `asyncFunc`.\n * @example\n *\n * function myFunction(foo, callback) {\n * doAsyncTask(foo, function(err, data) {\n * // handle errors\n * if (err) return callback(err);\n *\n * // do some stuff ...\n *\n * // return processed data\n * return callback(null, data);\n * });\n * }\n *\n * var wrapped = async.timeout(myFunction, 1000);\n *\n * // call `wrapped` as you would `myFunction`\n * wrapped({ bar: 'bar' }, function(err, data) {\n * // if `myFunction` takes < 1000 ms to execute, `err`\n * // and `data` will have their expected values\n *\n * // else `err` will be an Error with the code 'ETIMEDOUT'\n * });\n */\nfunction timeout(asyncFn, milliseconds, info) {\n var fn = wrapAsync(asyncFn);\n\n return initialParams((args, callback) => {\n var timedOut = false;\n var timer;\n\n function timeoutCallback() {\n var name = asyncFn.name || 'anonymous';\n var error = new Error('Callback function \"' + name + '\" timed out.');\n error.code = 'ETIMEDOUT';\n if (info) {\n error.info = info;\n }\n timedOut = true;\n callback(error);\n }\n\n args.push((...cbArgs) => {\n if (!timedOut) {\n callback(...cbArgs);\n clearTimeout(timer);\n }\n });\n\n // setup timer and call original function\n timer = setTimeout(timeoutCallback, milliseconds);\n fn(...args);\n });\n}\n\nfunction range(size) {\n var result = Array(size);\n while (size--) {\n result[size] = size;\n }\n return result;\n}\n\n/**\n * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name timesLimit\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.times]{@link module:ControlFlow.times}\n * @category Control Flow\n * @param {number} count - The number of times to run the function.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see [async.map]{@link module:Collections.map}.\n * @returns {Promise} a promise, if no callback is provided\n */\nfunction timesLimit(count, limit, iteratee, callback) {\n var _iteratee = wrapAsync(iteratee);\n return mapLimit$1(range(count), limit, _iteratee, callback);\n}\n\n/**\n * Calls the `iteratee` function `n` times, and accumulates results in the same\n * manner you would use with [map]{@link module:Collections.map}.\n *\n * @name times\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Control Flow\n * @param {number} n - The number of times to run the function.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see {@link module:Collections.map}.\n * @returns {Promise} a promise, if no callback is provided\n * @example\n *\n * // Pretend this is some complicated async factory\n * var createUser = function(id, callback) {\n * callback(null, {\n * id: 'user' + id\n * });\n * };\n *\n * // generate 5 users\n * async.times(5, function(n, next) {\n * createUser(n, function(err, user) {\n * next(err, user);\n * });\n * }, function(err, users) {\n * // we should now have 5 users\n * });\n */\nfunction times (n, iteratee, callback) {\n return timesLimit(n, Infinity, iteratee, callback)\n}\n\n/**\n * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time.\n *\n * @name timesSeries\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.times]{@link module:ControlFlow.times}\n * @category Control Flow\n * @param {number} n - The number of times to run the function.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see {@link module:Collections.map}.\n * @returns {Promise} a promise, if no callback is provided\n */\nfunction timesSeries (n, iteratee, callback) {\n return timesLimit(n, 1, iteratee, callback)\n}\n\n/**\n * A relative of `reduce`. Takes an Object or Array, and iterates over each\n * element in parallel, each step potentially mutating an `accumulator` value.\n * The type of the accumulator defaults to the type of collection passed in.\n *\n * @name transform\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {*} [accumulator] - The initial state of the transform. If omitted,\n * it will default to an empty Object or Array, depending on the type of `coll`\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * collection that potentially modifies the accumulator.\n * Invoked with (accumulator, item, key, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result is the transformed accumulator.\n * Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n * @example\n *\n * // file1.txt is a file that is 1000 bytes in size\n * // file2.txt is a file that is 2000 bytes in size\n * // file3.txt is a file that is 3000 bytes in size\n *\n * // helper function that returns human-readable size format from bytes\n * function formatBytes(bytes, decimals = 2) {\n * // implementation not included for brevity\n * return humanReadbleFilesize;\n * }\n *\n * const fileList = ['file1.txt','file2.txt','file3.txt'];\n *\n * // asynchronous function that returns the file size, transformed to human-readable format\n * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc.\n * function transformFileSize(acc, value, key, callback) {\n * fs.stat(value, function(err, stat) {\n * if (err) {\n * return callback(err);\n * }\n * acc[key] = formatBytes(stat.size);\n * callback(null);\n * });\n * }\n *\n * // Using callbacks\n * async.transform(fileList, transformFileSize, function(err, result) {\n * if(err) {\n * console.log(err);\n * } else {\n * console.log(result);\n * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ]\n * }\n * });\n *\n * // Using Promises\n * async.transform(fileList, transformFileSize)\n * .then(result => {\n * console.log(result);\n * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ]\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * (async () => {\n * try {\n * let result = await async.transform(fileList, transformFileSize);\n * console.log(result);\n * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ]\n * }\n * catch (err) {\n * console.log(err);\n * }\n * })();\n *\n * @example\n *\n * // file1.txt is a file that is 1000 bytes in size\n * // file2.txt is a file that is 2000 bytes in size\n * // file3.txt is a file that is 3000 bytes in size\n *\n * // helper function that returns human-readable size format from bytes\n * function formatBytes(bytes, decimals = 2) {\n * // implementation not included for brevity\n * return humanReadbleFilesize;\n * }\n *\n * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' };\n *\n * // asynchronous function that returns the file size, transformed to human-readable format\n * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc.\n * function transformFileSize(acc, value, key, callback) {\n * fs.stat(value, function(err, stat) {\n * if (err) {\n * return callback(err);\n * }\n * acc[key] = formatBytes(stat.size);\n * callback(null);\n * });\n * }\n *\n * // Using callbacks\n * async.transform(fileMap, transformFileSize, function(err, result) {\n * if(err) {\n * console.log(err);\n * } else {\n * console.log(result);\n * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' }\n * }\n * });\n *\n * // Using Promises\n * async.transform(fileMap, transformFileSize)\n * .then(result => {\n * console.log(result);\n * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' }\n * }).catch(err => {\n * console.log(err);\n * });\n *\n * // Using async/await\n * async () => {\n * try {\n * let result = await async.transform(fileMap, transformFileSize);\n * console.log(result);\n * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' }\n * }\n * catch (err) {\n * console.log(err);\n * }\n * }\n *\n */\nfunction transform (coll, accumulator, iteratee, callback) {\n if (arguments.length <= 3 && typeof accumulator === 'function') {\n callback = iteratee;\n iteratee = accumulator;\n accumulator = Array.isArray(coll) ? [] : {};\n }\n callback = once(callback || promiseCallback());\n var _iteratee = wrapAsync(iteratee);\n\n eachOf$1(coll, (v, k, cb) => {\n _iteratee(accumulator, v, k, cb);\n }, err => callback(err, accumulator));\n return callback[PROMISE_SYMBOL]\n}\n\n/**\n * It runs each task in series but stops whenever any of the functions were\n * successful. If one of the tasks were successful, the `callback` will be\n * passed the result of the successful task. If all tasks fail, the callback\n * will be passed the error and result (if any) of the final attempt.\n *\n * @name tryEach\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to\n * run, each function is passed a `callback(err, result)` it must call on\n * completion with an error `err` (which can be `null`) and an optional `result`\n * value.\n * @param {Function} [callback] - An optional callback which is called when one\n * of the tasks has succeeded, or all have failed. It receives the `err` and\n * `result` arguments of the last attempt at completing the `task`. Invoked with\n * (err, results).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n * async.tryEach([\n * function getDataFromFirstWebsite(callback) {\n * // Try getting the data from the first website\n * callback(err, data);\n * },\n * function getDataFromSecondWebsite(callback) {\n * // First website failed,\n * // Try getting the data from the backup website\n * callback(err, data);\n * }\n * ],\n * // optional callback\n * function(err, results) {\n * Now do something with the data.\n * });\n *\n */\nfunction tryEach(tasks, callback) {\n var error = null;\n var result;\n return eachSeries$1(tasks, (task, taskCb) => {\n wrapAsync(task)((err, ...args) => {\n if (err === false) return taskCb(err);\n\n if (args.length < 2) {\n [result] = args;\n } else {\n result = args;\n }\n error = err;\n taskCb(err ? null : {});\n });\n }, () => callback(error, result));\n}\n\nvar tryEach$1 = awaitify(tryEach);\n\n/**\n * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original,\n * unmemoized form. Handy for testing.\n *\n * @name unmemoize\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.memoize]{@link module:Utils.memoize}\n * @category Util\n * @param {AsyncFunction} fn - the memoized function\n * @returns {AsyncFunction} a function that calls the original unmemoized function\n */\nfunction unmemoize(fn) {\n return (...args) => {\n return (fn.unmemoized || fn)(...args);\n };\n}\n\n/**\n * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when\n * stopped, or an error occurs.\n *\n * @name whilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} test - asynchronous truth test to perform before each\n * execution of `iteratee`. Invoked with (callback).\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` passes. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * var count = 0;\n * async.whilst(\n * function test(cb) { cb(null, count < 5); },\n * function iter(callback) {\n * count++;\n * setTimeout(function() {\n * callback(null, count);\n * }, 1000);\n * },\n * function (err, n) {\n * // 5 seconds have passed, n = 5\n * }\n * );\n */\nfunction whilst(test, iteratee, callback) {\n callback = onlyOnce(callback);\n var _fn = wrapAsync(iteratee);\n var _test = wrapAsync(test);\n var results = [];\n\n function next(err, ...rest) {\n if (err) return callback(err);\n results = rest;\n if (err === false) return;\n _test(check);\n }\n\n function check(err, truth) {\n if (err) return callback(err);\n if (err === false) return;\n if (!truth) return callback(null, ...results);\n _fn(next);\n }\n\n return _test(check);\n}\nvar whilst$1 = awaitify(whilst, 3);\n\n/**\n * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when\n * stopped, or an error occurs. `callback` will be passed an error and any\n * arguments passed to the final `iteratee`'s callback.\n *\n * The inverse of [whilst]{@link module:ControlFlow.whilst}.\n *\n * @name until\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {AsyncFunction} test - asynchronous truth test to perform before each\n * execution of `iteratee`. Invoked with (callback).\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` fails. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has passed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n * @returns {Promise} a promise, if a callback is not passed\n *\n * @example\n * const results = []\n * let finished = false\n * async.until(function test(cb) {\n * cb(null, finished)\n * }, function iter(next) {\n * fetchPage(url, (err, body) => {\n * if (err) return next(err)\n * results = results.concat(body.objects)\n * finished = !!body.next\n * next(err)\n * })\n * }, function done (err) {\n * // all pages have been fetched\n * })\n */\nfunction until(test, iteratee, callback) {\n const _test = wrapAsync(test);\n return whilst$1((cb) => _test((err, truth) => cb (err, !truth)), iteratee, callback);\n}\n\n/**\n * Runs the `tasks` array of functions in series, each passing their results to\n * the next in the array. However, if any of the `tasks` pass an error to their\n * own callback, the next function is not executed, and the main `callback` is\n * immediately called with the error.\n *\n * @name waterfall\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array} tasks - An array of [async functions]{@link AsyncFunction}\n * to run.\n * Each function should complete with any number of `result` values.\n * The `result` values will be passed as arguments, in order, to the next task.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This will be passed the results of the last task's\n * callback. Invoked with (err, [results]).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * async.waterfall([\n * function(callback) {\n * callback(null, 'one', 'two');\n * },\n * function(arg1, arg2, callback) {\n * // arg1 now equals 'one' and arg2 now equals 'two'\n * callback(null, 'three');\n * },\n * function(arg1, callback) {\n * // arg1 now equals 'three'\n * callback(null, 'done');\n * }\n * ], function (err, result) {\n * // result now equals 'done'\n * });\n *\n * // Or, with named functions:\n * async.waterfall([\n * myFirstFunction,\n * mySecondFunction,\n * myLastFunction,\n * ], function (err, result) {\n * // result now equals 'done'\n * });\n * function myFirstFunction(callback) {\n * callback(null, 'one', 'two');\n * }\n * function mySecondFunction(arg1, arg2, callback) {\n * // arg1 now equals 'one' and arg2 now equals 'two'\n * callback(null, 'three');\n * }\n * function myLastFunction(arg1, callback) {\n * // arg1 now equals 'three'\n * callback(null, 'done');\n * }\n */\nfunction waterfall (tasks, callback) {\n callback = once(callback);\n if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions'));\n if (!tasks.length) return callback();\n var taskIndex = 0;\n\n function nextTask(args) {\n var task = wrapAsync(tasks[taskIndex++]);\n task(...args, onlyOnce(next));\n }\n\n function next(err, ...args) {\n if (err === false) return\n if (err || taskIndex === tasks.length) {\n return callback(err, ...args);\n }\n nextTask(args);\n }\n\n nextTask([]);\n}\n\nvar waterfall$1 = awaitify(waterfall);\n\n/**\n * An \"async function\" in the context of Async is an asynchronous function with\n * a variable number of parameters, with the final parameter being a callback.\n * (`function (arg1, arg2, ..., callback) {}`)\n * The final callback is of the form `callback(err, results...)`, which must be\n * called once the function is completed. The callback should be called with a\n * Error as its first argument to signal that an error occurred.\n * Otherwise, if no error occurred, it should be called with `null` as the first\n * argument, and any additional `result` arguments that may apply, to signal\n * successful completion.\n * The callback must be called exactly once, ideally on a later tick of the\n * JavaScript event loop.\n *\n * This type of function is also referred to as a \"Node-style async function\",\n * or a \"continuation passing-style function\" (CPS). Most of the methods of this\n * library are themselves CPS/Node-style async functions, or functions that\n * return CPS/Node-style async functions.\n *\n * Wherever we accept a Node-style async function, we also directly accept an\n * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}.\n * In this case, the `async` function will not be passed a final callback\n * argument, and any thrown error will be used as the `err` argument of the\n * implicit callback, and the return value will be used as the `result` value.\n * (i.e. a `rejected` of the returned Promise becomes the `err` callback\n * argument, and a `resolved` value becomes the `result`.)\n *\n * Note, due to JavaScript limitations, we can only detect native `async`\n * functions and not transpilied implementations.\n * Your environment must have `async`/`await` support for this to work.\n * (e.g. Node > v7.6, or a recent version of a modern browser).\n * If you are using `async` functions through a transpiler (e.g. Babel), you\n * must still wrap the function with [asyncify]{@link module:Utils.asyncify},\n * because the `async function` will be compiled to an ordinary function that\n * returns a promise.\n *\n * @typedef {Function} AsyncFunction\n * @static\n */\n\n\nvar index = {\n apply,\n applyEach,\n applyEachSeries,\n asyncify,\n auto,\n autoInject,\n cargo: cargo$1,\n cargoQueue: cargo,\n compose,\n concat: concat$1,\n concatLimit: concatLimit$1,\n concatSeries: concatSeries$1,\n constant: constant$1,\n detect: detect$1,\n detectLimit: detectLimit$1,\n detectSeries: detectSeries$1,\n dir,\n doUntil,\n doWhilst: doWhilst$1,\n each,\n eachLimit: eachLimit$1,\n eachOf: eachOf$1,\n eachOfLimit: eachOfLimit$1,\n eachOfSeries: eachOfSeries$1,\n eachSeries: eachSeries$1,\n ensureAsync,\n every: every$1,\n everyLimit: everyLimit$1,\n everySeries: everySeries$1,\n filter: filter$1,\n filterLimit: filterLimit$1,\n filterSeries: filterSeries$1,\n forever: forever$1,\n groupBy,\n groupByLimit: groupByLimit$1,\n groupBySeries,\n log,\n map: map$1,\n mapLimit: mapLimit$1,\n mapSeries: mapSeries$1,\n mapValues,\n mapValuesLimit: mapValuesLimit$1,\n mapValuesSeries,\n memoize,\n nextTick,\n parallel,\n parallelLimit,\n priorityQueue,\n queue,\n race: race$1,\n reduce: reduce$1,\n reduceRight,\n reflect,\n reflectAll,\n reject: reject$1,\n rejectLimit: rejectLimit$1,\n rejectSeries: rejectSeries$1,\n retry,\n retryable,\n seq,\n series,\n setImmediate: setImmediate$1,\n some: some$1,\n someLimit: someLimit$1,\n someSeries: someSeries$1,\n sortBy: sortBy$1,\n timeout,\n times,\n timesLimit,\n timesSeries,\n transform,\n tryEach: tryEach$1,\n unmemoize,\n until,\n waterfall: waterfall$1,\n whilst: whilst$1,\n\n // aliases\n all: every$1,\n allLimit: everyLimit$1,\n allSeries: everySeries$1,\n any: some$1,\n anyLimit: someLimit$1,\n anySeries: someSeries$1,\n find: detect$1,\n findLimit: detectLimit$1,\n findSeries: detectSeries$1,\n flatMap: concat$1,\n flatMapLimit: concatLimit$1,\n flatMapSeries: concatSeries$1,\n forEach: each,\n forEachSeries: eachSeries$1,\n forEachLimit: eachLimit$1,\n forEachOf: eachOf$1,\n forEachOfSeries: eachOfSeries$1,\n forEachOfLimit: eachOfLimit$1,\n inject: reduce$1,\n foldl: reduce$1,\n foldr: reduceRight,\n select: filter$1,\n selectLimit: filterLimit$1,\n selectSeries: filterSeries$1,\n wrapSync: asyncify,\n during: whilst$1,\n doDuring: doWhilst$1\n};\n\nexport { every$1 as all, everyLimit$1 as allLimit, everySeries$1 as allSeries, some$1 as any, someLimit$1 as anyLimit, someSeries$1 as anySeries, apply, applyEach, applyEachSeries, asyncify, auto, autoInject, cargo$1 as cargo, cargo as cargoQueue, compose, concat$1 as concat, concatLimit$1 as concatLimit, concatSeries$1 as concatSeries, constant$1 as constant, index as default, detect$1 as detect, detectLimit$1 as detectLimit, detectSeries$1 as detectSeries, dir, doWhilst$1 as doDuring, doUntil, doWhilst$1 as doWhilst, whilst$1 as during, each, eachLimit$1 as eachLimit, eachOf$1 as eachOf, eachOfLimit$1 as eachOfLimit, eachOfSeries$1 as eachOfSeries, eachSeries$1 as eachSeries, ensureAsync, every$1 as every, everyLimit$1 as everyLimit, everySeries$1 as everySeries, filter$1 as filter, filterLimit$1 as filterLimit, filterSeries$1 as filterSeries, detect$1 as find, detectLimit$1 as findLimit, detectSeries$1 as findSeries, concat$1 as flatMap, concatLimit$1 as flatMapLimit, concatSeries$1 as flatMapSeries, reduce$1 as foldl, reduceRight as foldr, each as forEach, eachLimit$1 as forEachLimit, eachOf$1 as forEachOf, eachOfLimit$1 as forEachOfLimit, eachOfSeries$1 as forEachOfSeries, eachSeries$1 as forEachSeries, forever$1 as forever, groupBy, groupByLimit$1 as groupByLimit, groupBySeries, reduce$1 as inject, log, map$1 as map, mapLimit$1 as mapLimit, mapSeries$1 as mapSeries, mapValues, mapValuesLimit$1 as mapValuesLimit, mapValuesSeries, memoize, nextTick, parallel, parallelLimit, priorityQueue, queue, race$1 as race, reduce$1 as reduce, reduceRight, reflect, reflectAll, reject$1 as reject, rejectLimit$1 as rejectLimit, rejectSeries$1 as rejectSeries, retry, retryable, filter$1 as select, filterLimit$1 as selectLimit, filterSeries$1 as selectSeries, seq, series, setImmediate$1 as setImmediate, some$1 as some, someLimit$1 as someLimit, someSeries$1 as someSeries, sortBy$1 as sortBy, timeout, times, timesLimit, timesSeries, transform, tryEach$1 as tryEach, unmemoize, until, waterfall$1 as waterfall, whilst$1 as whilst, asyncify as wrapSync };\n","var constants = require('constants')\n\nvar origCwd = process.cwd\nvar cwd = null\n\nvar platform = process.env.GRACEFUL_FS_PLATFORM || process.platform\n\nprocess.cwd = function() {\n if (!cwd)\n cwd = origCwd.call(process)\n return cwd\n}\ntry {\n process.cwd()\n} catch (er) {}\n\n// This check is needed until node.js 12 is required\nif (typeof process.chdir === 'function') {\n var chdir = process.chdir\n process.chdir = function (d) {\n cwd = null\n chdir.call(process, d)\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)\n}\n\nmodule.exports = patch\n\nfunction patch (fs) {\n // (re-)implement some things that are known busted or missing.\n\n // lchmod, broken prior to 0.6.2\n // back-port the fix here.\n if (constants.hasOwnProperty('O_SYMLINK') &&\n process.version.match(/^v0\\.6\\.[0-2]|^v0\\.5\\./)) {\n patchLchmod(fs)\n }\n\n // lutimes implementation, or no-op\n if (!fs.lutimes) {\n patchLutimes(fs)\n }\n\n // https://github.com/isaacs/node-graceful-fs/issues/4\n // Chown should not fail on einval or eperm if non-root.\n // It should not fail on enosys ever, as this just indicates\n // that a fs doesn't support the intended operation.\n\n fs.chown = chownFix(fs.chown)\n fs.fchown = chownFix(fs.fchown)\n fs.lchown = chownFix(fs.lchown)\n\n fs.chmod = chmodFix(fs.chmod)\n fs.fchmod = chmodFix(fs.fchmod)\n fs.lchmod = chmodFix(fs.lchmod)\n\n fs.chownSync = chownFixSync(fs.chownSync)\n fs.fchownSync = chownFixSync(fs.fchownSync)\n fs.lchownSync = chownFixSync(fs.lchownSync)\n\n fs.chmodSync = chmodFixSync(fs.chmodSync)\n fs.fchmodSync = chmodFixSync(fs.fchmodSync)\n fs.lchmodSync = chmodFixSync(fs.lchmodSync)\n\n fs.stat = statFix(fs.stat)\n fs.fstat = statFix(fs.fstat)\n fs.lstat = statFix(fs.lstat)\n\n fs.statSync = statFixSync(fs.statSync)\n fs.fstatSync = statFixSync(fs.fstatSync)\n fs.lstatSync = statFixSync(fs.lstatSync)\n\n // if lchmod/lchown do not exist, then make them no-ops\n if (fs.chmod && !fs.lchmod) {\n fs.lchmod = function (path, mode, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchmodSync = function () {}\n }\n if (fs.chown && !fs.lchown) {\n fs.lchown = function (path, uid, gid, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchownSync = function () {}\n }\n\n // on Windows, A/V software can lock the directory, causing this\n // to fail with an EACCES or EPERM if the directory contains newly\n // created files. Try again on failure, for up to 60 seconds.\n\n // Set the timeout this long because some Windows Anti-Virus, such as Parity\n // bit9, may lock files for up to a minute, causing npm package install\n // failures. Also, take care to yield the scheduler. Windows scheduling gives\n // CPU to a busy looping process, which can cause the program causing the lock\n // contention to be starved of CPU by node, so the contention doesn't resolve.\n if (platform === \"win32\") {\n fs.rename = typeof fs.rename !== 'function' ? fs.rename\n : (function (fs$rename) {\n function rename (from, to, cb) {\n var start = Date.now()\n var backoff = 0;\n fs$rename(from, to, function CB (er) {\n if (er\n && (er.code === \"EACCES\" || er.code === \"EPERM\" || er.code === \"EBUSY\")\n && Date.now() - start < 60000) {\n setTimeout(function() {\n fs.stat(to, function (stater, st) {\n if (stater && stater.code === \"ENOENT\")\n fs$rename(from, to, CB);\n else\n cb(er)\n })\n }, backoff)\n if (backoff < 100)\n backoff += 10;\n return;\n }\n if (cb) cb(er)\n })\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)\n return rename\n })(fs.rename)\n }\n\n // if read() returns EAGAIN, then just try it again.\n fs.read = typeof fs.read !== 'function' ? fs.read\n : (function (fs$read) {\n function read (fd, buffer, offset, length, position, callback_) {\n var callback\n if (callback_ && typeof callback_ === 'function') {\n var eagCounter = 0\n callback = function (er, _, __) {\n if (er && er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n callback_.apply(this, arguments)\n }\n }\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n\n // This ensures `util.promisify` works as it does for native `fs.read`.\n if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)\n return read\n })(fs.read)\n\n fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync\n : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {\n var eagCounter = 0\n while (true) {\n try {\n return fs$readSync.call(fs, fd, buffer, offset, length, position)\n } catch (er) {\n if (er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n continue\n }\n throw er\n }\n }\n }})(fs.readSync)\n\n function patchLchmod (fs) {\n fs.lchmod = function (path, mode, callback) {\n fs.open( path\n , constants.O_WRONLY | constants.O_SYMLINK\n , mode\n , function (err, fd) {\n if (err) {\n if (callback) callback(err)\n return\n }\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n fs.fchmod(fd, mode, function (err) {\n fs.close(fd, function(err2) {\n if (callback) callback(err || err2)\n })\n })\n })\n }\n\n fs.lchmodSync = function (path, mode) {\n var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)\n\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n var threw = true\n var ret\n try {\n ret = fs.fchmodSync(fd, mode)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n }\n\n function patchLutimes (fs) {\n if (constants.hasOwnProperty(\"O_SYMLINK\") && fs.futimes) {\n fs.lutimes = function (path, at, mt, cb) {\n fs.open(path, constants.O_SYMLINK, function (er, fd) {\n if (er) {\n if (cb) cb(er)\n return\n }\n fs.futimes(fd, at, mt, function (er) {\n fs.close(fd, function (er2) {\n if (cb) cb(er || er2)\n })\n })\n })\n }\n\n fs.lutimesSync = function (path, at, mt) {\n var fd = fs.openSync(path, constants.O_SYMLINK)\n var ret\n var threw = true\n try {\n ret = fs.futimesSync(fd, at, mt)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n\n } else if (fs.futimes) {\n fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }\n fs.lutimesSync = function () {}\n }\n }\n\n function chmodFix (orig) {\n if (!orig) return orig\n return function (target, mode, cb) {\n return orig.call(fs, target, mode, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chmodFixSync (orig) {\n if (!orig) return orig\n return function (target, mode) {\n try {\n return orig.call(fs, target, mode)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n\n function chownFix (orig) {\n if (!orig) return orig\n return function (target, uid, gid, cb) {\n return orig.call(fs, target, uid, gid, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chownFixSync (orig) {\n if (!orig) return orig\n return function (target, uid, gid) {\n try {\n return orig.call(fs, target, uid, gid)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n function statFix (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n function callback (er, stats) {\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n if (cb) cb.apply(this, arguments)\n }\n return options ? orig.call(fs, target, options, callback)\n : orig.call(fs, target, callback)\n }\n }\n\n function statFixSync (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options) {\n var stats = options ? orig.call(fs, target, options)\n : orig.call(fs, target)\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n return stats;\n }\n }\n\n // ENOSYS means that the fs doesn't support the op. Just ignore\n // that, because it doesn't matter.\n //\n // if there's no getuid, or if getuid() is something other\n // than 0, and the error is EINVAL or EPERM, then just ignore\n // it.\n //\n // This specific case is a silent failure in cp, install, tar,\n // and most other unix tools that manage permissions.\n //\n // When running as root, or if other types of errors are\n // encountered, then it's strict.\n function chownErOk (er) {\n if (!er)\n return true\n\n if (er.code === \"ENOSYS\")\n return true\n\n var nonroot = !process.getuid || process.getuid() !== 0\n if (nonroot) {\n if (er.code === \"EINVAL\" || er.code === \"EPERM\")\n return true\n }\n\n return false\n }\n}\n","var Stream = require('stream').Stream\n\nmodule.exports = legacy\n\nfunction legacy (fs) {\n return {\n ReadStream: ReadStream,\n WriteStream: WriteStream\n }\n\n function ReadStream (path, options) {\n if (!(this instanceof ReadStream)) return new ReadStream(path, options);\n\n Stream.call(this);\n\n var self = this;\n\n this.path = path;\n this.fd = null;\n this.readable = true;\n this.paused = false;\n\n this.flags = 'r';\n this.mode = 438; /*=0666*/\n this.bufferSize = 64 * 1024;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.encoding) this.setEncoding(this.encoding);\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.end === undefined) {\n this.end = Infinity;\n } else if ('number' !== typeof this.end) {\n throw TypeError('end must be a Number');\n }\n\n if (this.start > this.end) {\n throw new Error('start must be <= end');\n }\n\n this.pos = this.start;\n }\n\n if (this.fd !== null) {\n process.nextTick(function() {\n self._read();\n });\n return;\n }\n\n fs.open(this.path, this.flags, this.mode, function (err, fd) {\n if (err) {\n self.emit('error', err);\n self.readable = false;\n return;\n }\n\n self.fd = fd;\n self.emit('open', fd);\n self._read();\n })\n }\n\n function WriteStream (path, options) {\n if (!(this instanceof WriteStream)) return new WriteStream(path, options);\n\n Stream.call(this);\n\n this.path = path;\n this.fd = null;\n this.writable = true;\n\n this.flags = 'w';\n this.encoding = 'binary';\n this.mode = 438; /*=0666*/\n this.bytesWritten = 0;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.start < 0) {\n throw new Error('start must be >= zero');\n }\n\n this.pos = this.start;\n }\n\n this.busy = false;\n this._queue = [];\n\n if (this.fd === null) {\n this._open = fs.open;\n this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);\n this.flush();\n }\n }\n}\n","'use strict'\n\nmodule.exports = clone\n\nvar getPrototypeOf = Object.getPrototypeOf || function (obj) {\n return obj.__proto__\n}\n\nfunction clone (obj) {\n if (obj === null || typeof obj !== 'object')\n return obj\n\n if (obj instanceof Object)\n var copy = { __proto__: getPrototypeOf(obj) }\n else\n var copy = Object.create(null)\n\n Object.getOwnPropertyNames(obj).forEach(function (key) {\n Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))\n })\n\n return copy\n}\n","var fs = require('fs')\nvar polyfills = require('./polyfills.js')\nvar legacy = require('./legacy-streams.js')\nvar clone = require('./clone.js')\n\nvar util = require('util')\n\n/* istanbul ignore next - node 0.x polyfill */\nvar gracefulQueue\nvar previousSymbol\n\n/* istanbul ignore else - node 0.x polyfill */\nif (typeof Symbol === 'function' && typeof Symbol.for === 'function') {\n gracefulQueue = Symbol.for('graceful-fs.queue')\n // This is used in testing by future versions\n previousSymbol = Symbol.for('graceful-fs.previous')\n} else {\n gracefulQueue = '___graceful-fs.queue'\n previousSymbol = '___graceful-fs.previous'\n}\n\nfunction noop () {}\n\nfunction publishQueue(context, queue) {\n Object.defineProperty(context, gracefulQueue, {\n get: function() {\n return queue\n }\n })\n}\n\nvar debug = noop\nif (util.debuglog)\n debug = util.debuglog('gfs4')\nelse if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || ''))\n debug = function() {\n var m = util.format.apply(util, arguments)\n m = 'GFS4: ' + m.split(/\\n/).join('\\nGFS4: ')\n console.error(m)\n }\n\n// Once time initialization\nif (!fs[gracefulQueue]) {\n // This queue can be shared by multiple loaded instances\n var queue = global[gracefulQueue] || []\n publishQueue(fs, queue)\n\n // Patch fs.close/closeSync to shared queue version, because we need\n // to retry() whenever a close happens *anywhere* in the program.\n // This is essential when multiple graceful-fs instances are\n // in play at the same time.\n fs.close = (function (fs$close) {\n function close (fd, cb) {\n return fs$close.call(fs, fd, function (err) {\n // This function uses the graceful-fs shared queue\n if (!err) {\n resetQueue()\n }\n\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n })\n }\n\n Object.defineProperty(close, previousSymbol, {\n value: fs$close\n })\n return close\n })(fs.close)\n\n fs.closeSync = (function (fs$closeSync) {\n function closeSync (fd) {\n // This function uses the graceful-fs shared queue\n fs$closeSync.apply(fs, arguments)\n resetQueue()\n }\n\n Object.defineProperty(closeSync, previousSymbol, {\n value: fs$closeSync\n })\n return closeSync\n })(fs.closeSync)\n\n if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || '')) {\n process.on('exit', function() {\n debug(fs[gracefulQueue])\n require('assert').equal(fs[gracefulQueue].length, 0)\n })\n }\n}\n\nif (!global[gracefulQueue]) {\n publishQueue(global, fs[gracefulQueue]);\n}\n\nmodule.exports = patch(clone(fs))\nif (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {\n module.exports = patch(fs)\n fs.__patched = true;\n}\n\nfunction patch (fs) {\n // Everything that references the open() function needs to be in here\n polyfills(fs)\n fs.gracefulify = patch\n\n fs.createReadStream = createReadStream\n fs.createWriteStream = createWriteStream\n var fs$readFile = fs.readFile\n fs.readFile = readFile\n function readFile (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$readFile(path, options, cb)\n\n function go$readFile (path, options, cb, startTime) {\n return fs$readFile(path, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$writeFile = fs.writeFile\n fs.writeFile = writeFile\n function writeFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$writeFile(path, data, options, cb)\n\n function go$writeFile (path, data, options, cb, startTime) {\n return fs$writeFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$appendFile = fs.appendFile\n if (fs$appendFile)\n fs.appendFile = appendFile\n function appendFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$appendFile(path, data, options, cb)\n\n function go$appendFile (path, data, options, cb, startTime) {\n return fs$appendFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$copyFile = fs.copyFile\n if (fs$copyFile)\n fs.copyFile = copyFile\n function copyFile (src, dest, flags, cb) {\n if (typeof flags === 'function') {\n cb = flags\n flags = 0\n }\n return go$copyFile(src, dest, flags, cb)\n\n function go$copyFile (src, dest, flags, cb, startTime) {\n return fs$copyFile(src, dest, flags, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$readdir = fs.readdir\n fs.readdir = readdir\n var noReaddirOptionVersions = /^v[0-5]\\./\n function readdir (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n var go$readdir = noReaddirOptionVersions.test(process.version)\n ? function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n : function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, options, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n\n return go$readdir(path, options, cb)\n\n function fs$readdirCallback (path, options, cb, startTime) {\n return function (err, files) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([\n go$readdir,\n [path, options, cb],\n err,\n startTime || Date.now(),\n Date.now()\n ])\n else {\n if (files && files.sort)\n files.sort()\n\n if (typeof cb === 'function')\n cb.call(this, err, files)\n }\n }\n }\n }\n\n if (process.version.substr(0, 4) === 'v0.8') {\n var legStreams = legacy(fs)\n ReadStream = legStreams.ReadStream\n WriteStream = legStreams.WriteStream\n }\n\n var fs$ReadStream = fs.ReadStream\n if (fs$ReadStream) {\n ReadStream.prototype = Object.create(fs$ReadStream.prototype)\n ReadStream.prototype.open = ReadStream$open\n }\n\n var fs$WriteStream = fs.WriteStream\n if (fs$WriteStream) {\n WriteStream.prototype = Object.create(fs$WriteStream.prototype)\n WriteStream.prototype.open = WriteStream$open\n }\n\n Object.defineProperty(fs, 'ReadStream', {\n get: function () {\n return ReadStream\n },\n set: function (val) {\n ReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n Object.defineProperty(fs, 'WriteStream', {\n get: function () {\n return WriteStream\n },\n set: function (val) {\n WriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n // legacy names\n var FileReadStream = ReadStream\n Object.defineProperty(fs, 'FileReadStream', {\n get: function () {\n return FileReadStream\n },\n set: function (val) {\n FileReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n var FileWriteStream = WriteStream\n Object.defineProperty(fs, 'FileWriteStream', {\n get: function () {\n return FileWriteStream\n },\n set: function (val) {\n FileWriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n function ReadStream (path, options) {\n if (this instanceof ReadStream)\n return fs$ReadStream.apply(this, arguments), this\n else\n return ReadStream.apply(Object.create(ReadStream.prototype), arguments)\n }\n\n function ReadStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n if (that.autoClose)\n that.destroy()\n\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n that.read()\n }\n })\n }\n\n function WriteStream (path, options) {\n if (this instanceof WriteStream)\n return fs$WriteStream.apply(this, arguments), this\n else\n return WriteStream.apply(Object.create(WriteStream.prototype), arguments)\n }\n\n function WriteStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n that.destroy()\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n }\n })\n }\n\n function createReadStream (path, options) {\n return new fs.ReadStream(path, options)\n }\n\n function createWriteStream (path, options) {\n return new fs.WriteStream(path, options)\n }\n\n var fs$open = fs.open\n fs.open = open\n function open (path, flags, mode, cb) {\n if (typeof mode === 'function')\n cb = mode, mode = null\n\n return go$open(path, flags, mode, cb)\n\n function go$open (path, flags, mode, cb, startTime) {\n return fs$open(path, flags, mode, function (err, fd) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n return fs\n}\n\nfunction enqueue (elem) {\n debug('ENQUEUE', elem[0].name, elem[1])\n fs[gracefulQueue].push(elem)\n retry()\n}\n\n// keep track of the timeout between retry() calls\nvar retryTimer\n\n// reset the startTime and lastTime to now\n// this resets the start of the 60 second overall timeout as well as the\n// delay between attempts so that we'll retry these jobs sooner\nfunction resetQueue () {\n var now = Date.now()\n for (var i = 0; i < fs[gracefulQueue].length; ++i) {\n // entries that are only a length of 2 are from an older version, don't\n // bother modifying those since they'll be retried anyway.\n if (fs[gracefulQueue][i].length > 2) {\n fs[gracefulQueue][i][3] = now // startTime\n fs[gracefulQueue][i][4] = now // lastTime\n }\n }\n // call retry to make sure we're actively processing the queue\n retry()\n}\n\nfunction retry () {\n // clear the timer and remove it to help prevent unintended concurrency\n clearTimeout(retryTimer)\n retryTimer = undefined\n\n if (fs[gracefulQueue].length === 0)\n return\n\n var elem = fs[gracefulQueue].shift()\n var fn = elem[0]\n var args = elem[1]\n // these items may be unset if they were added by an older graceful-fs\n var err = elem[2]\n var startTime = elem[3]\n var lastTime = elem[4]\n\n // if we don't have a startTime we have no way of knowing if we've waited\n // long enough, so go ahead and retry this item now\n if (startTime === undefined) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args)\n } else if (Date.now() - startTime >= 60000) {\n // it's been more than 60 seconds total, bail now\n debug('TIMEOUT', fn.name, args)\n var cb = args.pop()\n if (typeof cb === 'function')\n cb.call(null, err)\n } else {\n // the amount of time between the last attempt and right now\n var sinceAttempt = Date.now() - lastTime\n // the amount of time between when we first tried, and when we last tried\n // rounded up to at least 1\n var sinceStart = Math.max(lastTime - startTime, 1)\n // backoff. wait longer than the total time we've been retrying, but only\n // up to a maximum of 100ms\n var desiredDelay = Math.min(sinceStart * 1.2, 100)\n // it's been long enough since the last retry, do it again\n if (sinceAttempt >= desiredDelay) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args.concat([startTime]))\n } else {\n // if we can't do this job yet, push it to the end of the queue\n // and let the next iteration check again\n fs[gracefulQueue].push(elem)\n }\n }\n\n // schedule our next run if one isn't already scheduled\n if (retryTimer === undefined) {\n retryTimer = setTimeout(retry, 0)\n }\n}\n","'use strict';\n\nconst isStream = stream =>\n\tstream !== null &&\n\ttypeof stream === 'object' &&\n\ttypeof stream.pipe === 'function';\n\nisStream.writable = stream =>\n\tisStream(stream) &&\n\tstream.writable !== false &&\n\ttypeof stream._write === 'function' &&\n\ttypeof stream._writableState === 'object';\n\nisStream.readable = stream =>\n\tisStream(stream) &&\n\tstream.readable !== false &&\n\ttypeof stream._read === 'function' &&\n\ttypeof stream._readableState === 'object';\n\nisStream.duplex = stream =>\n\tisStream.writable(stream) &&\n\tisStream.readable(stream);\n\nisStream.transform = stream =>\n\tisStream.duplex(stream) &&\n\ttypeof stream._transform === 'function';\n\nmodule.exports = isStream;\n","'use strict';\n\nif (typeof process === 'undefined' ||\n !process.version ||\n process.version.indexOf('v0.') === 0 ||\n process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n module.exports = { nextTick: nextTick };\n} else {\n module.exports = process\n}\n\nfunction nextTick(fn, arg1, arg2, arg3) {\n if (typeof fn !== 'function') {\n throw new TypeError('\"callback\" argument must be a function');\n }\n var len = arguments.length;\n var args, i;\n switch (len) {\n case 0:\n case 1:\n return process.nextTick(fn);\n case 2:\n return process.nextTick(function afterTickOne() {\n fn.call(null, arg1);\n });\n case 3:\n return process.nextTick(function afterTickTwo() {\n fn.call(null, arg1, arg2);\n });\n case 4:\n return process.nextTick(function afterTickThree() {\n fn.call(null, arg1, arg2, arg3);\n });\n default:\n args = new Array(len - 1);\n i = 0;\n while (i < args.length) {\n args[i++] = arguments[i];\n }\n return process.nextTick(function afterTick() {\n fn.apply(null, args);\n });\n }\n}\n\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","module.exports = require('stream');\n","/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('buffer').Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","try {\n var util = require('util');\n /* istanbul ignore next */\n if (typeof util.inherits !== 'function') throw '';\n module.exports = util.inherits;\n} catch (e) {\n /* istanbul ignore next */\n module.exports = require('./inherits_browser.js');\n}\n","'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = require('safe-buffer').Buffer;\nvar util = require('util');\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({ length: this.length });\n return this.constructor.name + ' ' + obj;\n };\n}","'use strict';\n\n/**/\n\nvar pna = require('process-nextick-args');\n/**/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err) {\n if (!this._writableState) {\n pna.nextTick(emitErrorNT, this, err);\n } else if (!this._writableState.errorEmitted) {\n this._writableState.errorEmitted = true;\n pna.nextTick(emitErrorNT, this, err);\n }\n }\n\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n if (!_this._writableState) {\n pna.nextTick(emitErrorNT, _this, err);\n } else if (!_this._writableState.errorEmitted) {\n _this._writableState.errorEmitted = true;\n pna.nextTick(emitErrorNT, _this, err);\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finalCalled = false;\n this._writableState.prefinished = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};","\n/**\n * For Node.js, simply re-export the core `util.deprecate` function.\n */\n\nmodule.exports = require('util').deprecate;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict';\n\n/**/\n\nvar pna = require('process-nextick-args');\n/**/\n\nmodule.exports = Writable;\n\n/* */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* */\n\n/**/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/**/\n\n/**/\nvar Duplex;\n/**/\n\nWritable.WritableState = WritableState;\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\n/**/\nvar internalUtil = {\n deprecate: require('util-deprecate')\n};\n/**/\n\n/**/\nvar Stream = require('./internal/streams/stream');\n/**/\n\n/**/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/**/\n\nvar destroyImpl = require('./internal/streams/destroy');\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /**/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /**/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n\n // reuse the free corkReq.\n state.corkedRequestsFree.next = corkReq;\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict';\n\n/**/\n\nvar pna = require('process-nextick-args');\n/**/\n\n/**/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/**/\n\nmodule.exports = Duplex;\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\nvar Readable = require('./_stream_readable');\nvar Writable = require('./_stream_writable');\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/**/\n\nvar Buffer = require('safe-buffer').Buffer;\n/**/\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n encoding = '' + encoding;\n switch (encoding && encoding.toLowerCase()) {\n case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':\n return true;\n default:\n return false;\n }\n};\n\nfunction _normalizeEncoding(enc) {\n if (!enc) return 'utf8';\n var retried;\n while (true) {\n switch (enc) {\n case 'utf8':\n case 'utf-8':\n return 'utf8';\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return 'utf16le';\n case 'latin1':\n case 'binary':\n return 'latin1';\n case 'base64':\n case 'ascii':\n case 'hex':\n return enc;\n default:\n if (retried) return; // undefined\n enc = ('' + enc).toLowerCase();\n retried = true;\n }\n }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n this.encoding = normalizeEncoding(encoding);\n var nb;\n switch (this.encoding) {\n case 'utf16le':\n this.text = utf16Text;\n this.end = utf16End;\n nb = 4;\n break;\n case 'utf8':\n this.fillLast = utf8FillLast;\n nb = 4;\n break;\n case 'base64':\n this.text = base64Text;\n this.end = base64End;\n nb = 3;\n break;\n default:\n this.write = simpleWrite;\n this.end = simpleEnd;\n return;\n }\n this.lastNeed = 0;\n this.lastTotal = 0;\n this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n if (buf.length === 0) return '';\n var r;\n var i;\n if (this.lastNeed) {\n r = this.fillLast(buf);\n if (r === undefined) return '';\n i = this.lastNeed;\n this.lastNeed = 0;\n } else {\n i = 0;\n }\n if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte. If an invalid byte is detected, -2 is returned.\nfunction utf8CheckByte(byte) {\n if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n return byte >> 6 === 0x02 ? -1 : -2;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// a single UTF-8 replacement character ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n var p = this.lastTotal - this.lastNeed;\n var r = utf8CheckExtraBytes(this, buf, p);\n if (r !== undefined) return r;\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, p, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, p, 0, buf.length);\n this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character is added when ending on a partial\n// character.\nfunction utf8End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + '\\ufffd';\n return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n return r.slice(0, -1);\n }\n }\n return r;\n }\n this.lastNeed = 1;\n this.lastTotal = 2;\n this.lastChar[0] = buf[buf.length - 1];\n return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) {\n var end = this.lastTotal - this.lastNeed;\n return r + this.lastChar.toString('utf16le', 0, end);\n }\n return r;\n}\n\nfunction base64Text(buf, i) {\n var n = (buf.length - i) % 3;\n if (n === 0) return buf.toString('base64', i);\n this.lastNeed = 3 - n;\n this.lastTotal = 3;\n if (n === 1) {\n this.lastChar[0] = buf[buf.length - 1];\n } else {\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n }\n return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n return buf && buf.length ? this.write(buf) : '';\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/**/\n\nvar pna = require('process-nextick-args');\n/**/\n\nmodule.exports = Readable;\n\n/**/\nvar isArray = require('isarray');\n/**/\n\n/**/\nvar Duplex;\n/**/\n\nReadable.ReadableState = ReadableState;\n\n/**/\nvar EE = require('events').EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/**/\n\n/**/\nvar Stream = require('./internal/streams/stream');\n/**/\n\n/**/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/**/\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\n/**/\nvar debugUtil = require('util');\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/**/\n\nvar BufferList = require('./internal/streams/BufferList');\nvar destroyImpl = require('./internal/streams/destroy');\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', state.awaitDrain);\n state.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, { hasUnpiped: false });\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict';\n\nmodule.exports = Transform;\n\nvar Duplex = require('./_stream_duplex');\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\n\nvar Transform = require('./_stream_transform');\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};","var Stream = require('stream');\nif (process.env.READABLE_STREAM === 'disable' && Stream) {\n module.exports = Stream;\n exports = module.exports = Stream.Readable;\n exports.Readable = Stream.Readable;\n exports.Writable = Stream.Writable;\n exports.Duplex = Stream.Duplex;\n exports.Transform = Stream.Transform;\n exports.PassThrough = Stream.PassThrough;\n exports.Stream = Stream;\n} else {\n exports = module.exports = require('./lib/_stream_readable.js');\n exports.Stream = Stream || exports;\n exports.Readable = exports;\n exports.Writable = require('./lib/_stream_writable.js');\n exports.Duplex = require('./lib/_stream_duplex.js');\n exports.Transform = require('./lib/_stream_transform.js');\n exports.PassThrough = require('./lib/_stream_passthrough.js');\n}\n","module.exports = require('./readable').PassThrough\n","var util = require('util');\nvar PassThrough = require('readable-stream/passthrough');\n\nmodule.exports = {\n Readable: Readable,\n Writable: Writable\n};\n\nutil.inherits(Readable, PassThrough);\nutil.inherits(Writable, PassThrough);\n\n// Patch the given method of instance so that the callback\n// is executed once, before the actual method is called the\n// first time.\nfunction beforeFirstCall(instance, method, callback) {\n instance[method] = function() {\n delete instance[method];\n callback.apply(this, arguments);\n return this[method].apply(this, arguments);\n };\n}\n\nfunction Readable(fn, options) {\n if (!(this instanceof Readable))\n return new Readable(fn, options);\n\n PassThrough.call(this, options);\n\n beforeFirstCall(this, '_read', function() {\n var source = fn.call(this, options);\n var emit = this.emit.bind(this, 'error');\n source.on('error', emit);\n source.pipe(this);\n });\n\n this.emit('readable');\n}\n\nfunction Writable(fn, options) {\n if (!(this instanceof Writable))\n return new Writable(fn, options);\n\n PassThrough.call(this, options);\n\n beforeFirstCall(this, '_write', function() {\n var destination = fn.call(this, options);\n var emit = this.emit.bind(this, 'error');\n destination.on('error', emit);\n this.pipe(destination);\n });\n\n this.emit('writable');\n}\n\n","/*!\n * normalize-path \n *\n * Copyright (c) 2014-2018, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nmodule.exports = function(path, stripTrailing) {\n if (typeof path !== 'string') {\n throw new TypeError('expected path to be a string');\n }\n\n if (path === '\\\\' || path === '/') return '/';\n\n var len = path.length;\n if (len <= 1) return path;\n\n // ensure that win32 namespaces has two leading slashes, so that the path is\n // handled properly by the win32 version of path.parse() after being normalized\n // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces\n var prefix = '';\n if (len > 4 && path[3] === '\\\\') {\n var ch = path[2];\n if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\\\\\') {\n path = path.slice(2);\n prefix = '//';\n }\n }\n\n var segs = path.split(/[/\\\\]+/);\n if (stripTrailing !== false && segs[segs.length - 1] === '') {\n segs.pop();\n }\n return prefix + segs.join('/');\n};\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n","var baseRest = require('./_baseRest'),\n eq = require('./eq'),\n isIterateeCall = require('./_isIterateeCall'),\n keysIn = require('./keysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n});\n\nmodule.exports = defaults;\n","'use strict'\n\n/*\n This file is a reduced and adapted version of the main lib/internal/per_context/primordials.js file defined at\n\n https://github.com/nodejs/node/blob/main/lib/internal/per_context/primordials.js\n\n Don't try to replace with the original file and keep it up to date with the upstream file.\n*/\n\n// This is a simplified version of AggregateError\nclass AggregateError extends Error {\n constructor(errors) {\n if (!Array.isArray(errors)) {\n throw new TypeError(`Expected input to be an Array, got ${typeof errors}`)\n }\n let message = ''\n for (let i = 0; i < errors.length; i++) {\n message += ` ${errors[i].stack}\\n`\n }\n super(message)\n this.name = 'AggregateError'\n this.errors = errors\n }\n}\nmodule.exports = {\n AggregateError,\n ArrayIsArray(self) {\n return Array.isArray(self)\n },\n ArrayPrototypeIncludes(self, el) {\n return self.includes(el)\n },\n ArrayPrototypeIndexOf(self, el) {\n return self.indexOf(el)\n },\n ArrayPrototypeJoin(self, sep) {\n return self.join(sep)\n },\n ArrayPrototypeMap(self, fn) {\n return self.map(fn)\n },\n ArrayPrototypePop(self, el) {\n return self.pop(el)\n },\n ArrayPrototypePush(self, el) {\n return self.push(el)\n },\n ArrayPrototypeSlice(self, start, end) {\n return self.slice(start, end)\n },\n Error,\n FunctionPrototypeCall(fn, thisArgs, ...args) {\n return fn.call(thisArgs, ...args)\n },\n FunctionPrototypeSymbolHasInstance(self, instance) {\n return Function.prototype[Symbol.hasInstance].call(self, instance)\n },\n MathFloor: Math.floor,\n Number,\n NumberIsInteger: Number.isInteger,\n NumberIsNaN: Number.isNaN,\n NumberMAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER,\n NumberMIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER,\n NumberParseInt: Number.parseInt,\n ObjectDefineProperties(self, props) {\n return Object.defineProperties(self, props)\n },\n ObjectDefineProperty(self, name, prop) {\n return Object.defineProperty(self, name, prop)\n },\n ObjectGetOwnPropertyDescriptor(self, name) {\n return Object.getOwnPropertyDescriptor(self, name)\n },\n ObjectKeys(obj) {\n return Object.keys(obj)\n },\n ObjectSetPrototypeOf(target, proto) {\n return Object.setPrototypeOf(target, proto)\n },\n Promise,\n PromisePrototypeCatch(self, fn) {\n return self.catch(fn)\n },\n PromisePrototypeThen(self, thenFn, catchFn) {\n return self.then(thenFn, catchFn)\n },\n PromiseReject(err) {\n return Promise.reject(err)\n },\n PromiseResolve(val) {\n return Promise.resolve(val)\n },\n ReflectApply: Reflect.apply,\n RegExpPrototypeTest(self, value) {\n return self.test(value)\n },\n SafeSet: Set,\n String,\n StringPrototypeSlice(self, start, end) {\n return self.slice(start, end)\n },\n StringPrototypeToLowerCase(self) {\n return self.toLowerCase()\n },\n StringPrototypeToUpperCase(self) {\n return self.toUpperCase()\n },\n StringPrototypeTrim(self) {\n return self.trim()\n },\n Symbol,\n SymbolFor: Symbol.for,\n SymbolAsyncIterator: Symbol.asyncIterator,\n SymbolHasInstance: Symbol.hasInstance,\n SymbolIterator: Symbol.iterator,\n SymbolDispose: Symbol.dispose || Symbol('Symbol.dispose'),\n SymbolAsyncDispose: Symbol.asyncDispose || Symbol('Symbol.asyncDispose'),\n TypedArrayPrototypeSet(self, buf, len) {\n return self.set(buf, len)\n },\n Boolean,\n Uint8Array\n}\n","'use strict'\n\n/*\n This file is a reduced and adapted version of the main lib/internal/util/inspect.js file defined at\n\n https://github.com/nodejs/node/blob/main/lib/internal/util/inspect.js\n\n Don't try to replace with the original file and keep it up to date with the upstream file.\n*/\nmodule.exports = {\n format(format, ...args) {\n // Simplified version of https://nodejs.org/api/util.html#utilformatformat-args\n return format.replace(/%([sdifj])/g, function (...[_unused, type]) {\n const replacement = args.shift()\n if (type === 'f') {\n return replacement.toFixed(6)\n } else if (type === 'j') {\n return JSON.stringify(replacement)\n } else if (type === 's' && typeof replacement === 'object') {\n const ctor = replacement.constructor !== Object ? replacement.constructor.name : ''\n return `${ctor} {}`.trim()\n } else {\n return replacement.toString()\n }\n })\n },\n inspect(value) {\n // Vastly simplified version of https://nodejs.org/api/util.html#utilinspectobject-options\n switch (typeof value) {\n case 'string':\n if (value.includes(\"'\")) {\n if (!value.includes('\"')) {\n return `\"${value}\"`\n } else if (!value.includes('`') && !value.includes('${')) {\n return `\\`${value}\\``\n }\n }\n return `'${value}'`\n case 'number':\n if (isNaN(value)) {\n return 'NaN'\n } else if (Object.is(value, -0)) {\n return String(value)\n }\n return value\n case 'bigint':\n return `${String(value)}n`\n case 'boolean':\n case 'undefined':\n return String(value)\n case 'object':\n return '{}'\n }\n }\n}\n","'use strict'\n\nconst { format, inspect } = require('./util/inspect')\nconst { AggregateError: CustomAggregateError } = require('./primordials')\n\n/*\n This file is a reduced and adapted version of the main lib/internal/errors.js file defined at\n\n https://github.com/nodejs/node/blob/main/lib/internal/errors.js\n\n Don't try to replace with the original file and keep it up to date (starting from E(...) definitions)\n with the upstream file.\n*/\n\nconst AggregateError = globalThis.AggregateError || CustomAggregateError\nconst kIsNodeError = Symbol('kIsNodeError')\nconst kTypes = [\n 'string',\n 'function',\n 'number',\n 'object',\n // Accept 'Function' and 'Object' as alternative to the lower cased version.\n 'Function',\n 'Object',\n 'boolean',\n 'bigint',\n 'symbol'\n]\nconst classRegExp = /^([A-Z][a-z0-9]*)+$/\nconst nodeInternalPrefix = '__node_internal_'\nconst codes = {}\nfunction assert(value, message) {\n if (!value) {\n throw new codes.ERR_INTERNAL_ASSERTION(message)\n }\n}\n\n// Only use this for integers! Decimal numbers do not work with this function.\nfunction addNumericalSeparator(val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\nfunction getMessage(key, msg, args) {\n if (typeof msg === 'function') {\n assert(\n msg.length <= args.length,\n // Default options do not count.\n `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`\n )\n return msg(...args)\n }\n const expectedLength = (msg.match(/%[dfijoOs]/g) || []).length\n assert(\n expectedLength === args.length,\n `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`\n )\n if (args.length === 0) {\n return msg\n }\n return format(msg, ...args)\n}\nfunction E(code, message, Base) {\n if (!Base) {\n Base = Error\n }\n class NodeError extends Base {\n constructor(...args) {\n super(getMessage(code, message, args))\n }\n toString() {\n return `${this.name} [${code}]: ${this.message}`\n }\n }\n Object.defineProperties(NodeError.prototype, {\n name: {\n value: Base.name,\n writable: true,\n enumerable: false,\n configurable: true\n },\n toString: {\n value() {\n return `${this.name} [${code}]: ${this.message}`\n },\n writable: true,\n enumerable: false,\n configurable: true\n }\n })\n NodeError.prototype.code = code\n NodeError.prototype[kIsNodeError] = true\n codes[code] = NodeError\n}\nfunction hideStackFrames(fn) {\n // We rename the functions that will be hidden to cut off the stacktrace\n // at the outermost one\n const hidden = nodeInternalPrefix + fn.name\n Object.defineProperty(fn, 'name', {\n value: hidden\n })\n return fn\n}\nfunction aggregateTwoErrors(innerError, outerError) {\n if (innerError && outerError && innerError !== outerError) {\n if (Array.isArray(outerError.errors)) {\n // If `outerError` is already an `AggregateError`.\n outerError.errors.push(innerError)\n return outerError\n }\n const err = new AggregateError([outerError, innerError], outerError.message)\n err.code = outerError.code\n return err\n }\n return innerError || outerError\n}\nclass AbortError extends Error {\n constructor(message = 'The operation was aborted', options = undefined) {\n if (options !== undefined && typeof options !== 'object') {\n throw new codes.ERR_INVALID_ARG_TYPE('options', 'Object', options)\n }\n super(message, options)\n this.code = 'ABORT_ERR'\n this.name = 'AbortError'\n }\n}\nE('ERR_ASSERTION', '%s', Error)\nE(\n 'ERR_INVALID_ARG_TYPE',\n (name, expected, actual) => {\n assert(typeof name === 'string', \"'name' must be a string\")\n if (!Array.isArray(expected)) {\n expected = [expected]\n }\n let msg = 'The '\n if (name.endsWith(' argument')) {\n // For cases like 'first argument'\n msg += `${name} `\n } else {\n msg += `\"${name}\" ${name.includes('.') ? 'property' : 'argument'} `\n }\n msg += 'must be '\n const types = []\n const instances = []\n const other = []\n for (const value of expected) {\n assert(typeof value === 'string', 'All expected entries have to be of type string')\n if (kTypes.includes(value)) {\n types.push(value.toLowerCase())\n } else if (classRegExp.test(value)) {\n instances.push(value)\n } else {\n assert(value !== 'object', 'The value \"object\" should be written as \"Object\"')\n other.push(value)\n }\n }\n\n // Special handle `object` in case other instances are allowed to outline\n // the differences between each other.\n if (instances.length > 0) {\n const pos = types.indexOf('object')\n if (pos !== -1) {\n types.splice(types, pos, 1)\n instances.push('Object')\n }\n }\n if (types.length > 0) {\n switch (types.length) {\n case 1:\n msg += `of type ${types[0]}`\n break\n case 2:\n msg += `one of type ${types[0]} or ${types[1]}`\n break\n default: {\n const last = types.pop()\n msg += `one of type ${types.join(', ')}, or ${last}`\n }\n }\n if (instances.length > 0 || other.length > 0) {\n msg += ' or '\n }\n }\n if (instances.length > 0) {\n switch (instances.length) {\n case 1:\n msg += `an instance of ${instances[0]}`\n break\n case 2:\n msg += `an instance of ${instances[0]} or ${instances[1]}`\n break\n default: {\n const last = instances.pop()\n msg += `an instance of ${instances.join(', ')}, or ${last}`\n }\n }\n if (other.length > 0) {\n msg += ' or '\n }\n }\n switch (other.length) {\n case 0:\n break\n case 1:\n if (other[0].toLowerCase() !== other[0]) {\n msg += 'an '\n }\n msg += `${other[0]}`\n break\n case 2:\n msg += `one of ${other[0]} or ${other[1]}`\n break\n default: {\n const last = other.pop()\n msg += `one of ${other.join(', ')}, or ${last}`\n }\n }\n if (actual == null) {\n msg += `. Received ${actual}`\n } else if (typeof actual === 'function' && actual.name) {\n msg += `. Received function ${actual.name}`\n } else if (typeof actual === 'object') {\n var _actual$constructor\n if (\n (_actual$constructor = actual.constructor) !== null &&\n _actual$constructor !== undefined &&\n _actual$constructor.name\n ) {\n msg += `. Received an instance of ${actual.constructor.name}`\n } else {\n const inspected = inspect(actual, {\n depth: -1\n })\n msg += `. Received ${inspected}`\n }\n } else {\n let inspected = inspect(actual, {\n colors: false\n })\n if (inspected.length > 25) {\n inspected = `${inspected.slice(0, 25)}...`\n }\n msg += `. Received type ${typeof actual} (${inspected})`\n }\n return msg\n },\n TypeError\n)\nE(\n 'ERR_INVALID_ARG_VALUE',\n (name, value, reason = 'is invalid') => {\n let inspected = inspect(value)\n if (inspected.length > 128) {\n inspected = inspected.slice(0, 128) + '...'\n }\n const type = name.includes('.') ? 'property' : 'argument'\n return `The ${type} '${name}' ${reason}. Received ${inspected}`\n },\n TypeError\n)\nE(\n 'ERR_INVALID_RETURN_VALUE',\n (input, name, value) => {\n var _value$constructor\n const type =\n value !== null &&\n value !== undefined &&\n (_value$constructor = value.constructor) !== null &&\n _value$constructor !== undefined &&\n _value$constructor.name\n ? `instance of ${value.constructor.name}`\n : `type ${typeof value}`\n return `Expected ${input} to be returned from the \"${name}\"` + ` function but got ${type}.`\n },\n TypeError\n)\nE(\n 'ERR_MISSING_ARGS',\n (...args) => {\n assert(args.length > 0, 'At least one arg needs to be specified')\n let msg\n const len = args.length\n args = (Array.isArray(args) ? args : [args]).map((a) => `\"${a}\"`).join(' or ')\n switch (len) {\n case 1:\n msg += `The ${args[0]} argument`\n break\n case 2:\n msg += `The ${args[0]} and ${args[1]} arguments`\n break\n default:\n {\n const last = args.pop()\n msg += `The ${args.join(', ')}, and ${last} arguments`\n }\n break\n }\n return `${msg} must be specified`\n },\n TypeError\n)\nE(\n 'ERR_OUT_OF_RANGE',\n (str, range, input) => {\n assert(range, 'Missing \"range\" argument')\n let received\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n const limit = BigInt(2) ** BigInt(32)\n if (input > limit || input < -limit) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n } else {\n received = inspect(input)\n }\n return `The value of \"${str}\" is out of range. It must be ${range}. Received ${received}`\n },\n RangeError\n)\nE('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times', Error)\nE('ERR_METHOD_NOT_IMPLEMENTED', 'The %s method is not implemented', Error)\nE('ERR_STREAM_ALREADY_FINISHED', 'Cannot call %s after a stream was finished', Error)\nE('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable', Error)\nE('ERR_STREAM_DESTROYED', 'Cannot call %s after a stream was destroyed', Error)\nE('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError)\nE('ERR_STREAM_PREMATURE_CLOSE', 'Premature close', Error)\nE('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF', Error)\nE('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event', Error)\nE('ERR_STREAM_WRITE_AFTER_END', 'write after end', Error)\nE('ERR_UNKNOWN_ENCODING', 'Unknown encoding: %s', TypeError)\nmodule.exports = {\n AbortError,\n aggregateTwoErrors: hideStackFrames(aggregateTwoErrors),\n hideStackFrames,\n codes\n}\n","/**\n * @typedef {object} PrivateData\n * @property {EventTarget} eventTarget The event target.\n * @property {{type:string}} event The original event object.\n * @property {number} eventPhase The current event phase.\n * @property {EventTarget|null} currentTarget The current event target.\n * @property {boolean} canceled The flag to prevent default.\n * @property {boolean} stopped The flag to stop propagation.\n * @property {boolean} immediateStopped The flag to stop propagation immediately.\n * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.\n * @property {number} timeStamp The unix time.\n * @private\n */\n\n/**\n * Private data for event wrappers.\n * @type {WeakMap}\n * @private\n */\nconst privateData = new WeakMap()\n\n/**\n * Cache for wrapper classes.\n * @type {WeakMap}\n * @private\n */\nconst wrappers = new WeakMap()\n\n/**\n * Get private data.\n * @param {Event} event The event object to get private data.\n * @returns {PrivateData} The private data of the event.\n * @private\n */\nfunction pd(event) {\n const retv = privateData.get(event)\n console.assert(\n retv != null,\n \"'this' is expected an Event object, but got\",\n event\n )\n return retv\n}\n\n/**\n * https://dom.spec.whatwg.org/#set-the-canceled-flag\n * @param data {PrivateData} private data.\n */\nfunction setCancelFlag(data) {\n if (data.passiveListener != null) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(\n \"Unable to preventDefault inside passive event listener invocation.\",\n data.passiveListener\n )\n }\n return\n }\n if (!data.event.cancelable) {\n return\n }\n\n data.canceled = true\n if (typeof data.event.preventDefault === \"function\") {\n data.event.preventDefault()\n }\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#interface-event\n * @private\n */\n/**\n * The event wrapper.\n * @constructor\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Event|{type:string}} event The original event to wrap.\n */\nfunction Event(eventTarget, event) {\n privateData.set(this, {\n eventTarget,\n event,\n eventPhase: 2,\n currentTarget: eventTarget,\n canceled: false,\n stopped: false,\n immediateStopped: false,\n passiveListener: null,\n timeStamp: event.timeStamp || Date.now(),\n })\n\n // https://heycam.github.io/webidl/#Unforgeable\n Object.defineProperty(this, \"isTrusted\", { value: false, enumerable: true })\n\n // Define accessors\n const keys = Object.keys(event)\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n if (!(key in this)) {\n Object.defineProperty(this, key, defineRedirectDescriptor(key))\n }\n }\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEvent.prototype = {\n /**\n * The type of this event.\n * @type {string}\n */\n get type() {\n return pd(this).event.type\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get target() {\n return pd(this).eventTarget\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get currentTarget() {\n return pd(this).currentTarget\n },\n\n /**\n * @returns {EventTarget[]} The composed path of this event.\n */\n composedPath() {\n const currentTarget = pd(this).currentTarget\n if (currentTarget == null) {\n return []\n }\n return [currentTarget]\n },\n\n /**\n * Constant of NONE.\n * @type {number}\n */\n get NONE() {\n return 0\n },\n\n /**\n * Constant of CAPTURING_PHASE.\n * @type {number}\n */\n get CAPTURING_PHASE() {\n return 1\n },\n\n /**\n * Constant of AT_TARGET.\n * @type {number}\n */\n get AT_TARGET() {\n return 2\n },\n\n /**\n * Constant of BUBBLING_PHASE.\n * @type {number}\n */\n get BUBBLING_PHASE() {\n return 3\n },\n\n /**\n * The target of this event.\n * @type {number}\n */\n get eventPhase() {\n return pd(this).eventPhase\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopPropagation() {\n const data = pd(this)\n\n data.stopped = true\n if (typeof data.event.stopPropagation === \"function\") {\n data.event.stopPropagation()\n }\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopImmediatePropagation() {\n const data = pd(this)\n\n data.stopped = true\n data.immediateStopped = true\n if (typeof data.event.stopImmediatePropagation === \"function\") {\n data.event.stopImmediatePropagation()\n }\n },\n\n /**\n * The flag to be bubbling.\n * @type {boolean}\n */\n get bubbles() {\n return Boolean(pd(this).event.bubbles)\n },\n\n /**\n * The flag to be cancelable.\n * @type {boolean}\n */\n get cancelable() {\n return Boolean(pd(this).event.cancelable)\n },\n\n /**\n * Cancel this event.\n * @returns {void}\n */\n preventDefault() {\n setCancelFlag(pd(this))\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n */\n get defaultPrevented() {\n return pd(this).canceled\n },\n\n /**\n * The flag to be composed.\n * @type {boolean}\n */\n get composed() {\n return Boolean(pd(this).event.composed)\n },\n\n /**\n * The unix time of this event.\n * @type {number}\n */\n get timeStamp() {\n return pd(this).timeStamp\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n * @deprecated\n */\n get srcElement() {\n return pd(this).eventTarget\n },\n\n /**\n * The flag to stop event bubbling.\n * @type {boolean}\n * @deprecated\n */\n get cancelBubble() {\n return pd(this).stopped\n },\n set cancelBubble(value) {\n if (!value) {\n return\n }\n const data = pd(this)\n\n data.stopped = true\n if (typeof data.event.cancelBubble === \"boolean\") {\n data.event.cancelBubble = true\n }\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n * @deprecated\n */\n get returnValue() {\n return !pd(this).canceled\n },\n set returnValue(value) {\n if (!value) {\n setCancelFlag(pd(this))\n }\n },\n\n /**\n * Initialize this event object. But do nothing under event dispatching.\n * @param {string} type The event type.\n * @param {boolean} [bubbles=false] The flag to be possible to bubble up.\n * @param {boolean} [cancelable=false] The flag to be possible to cancel.\n * @deprecated\n */\n initEvent() {\n // Do nothing.\n },\n}\n\n// `constructor` is not enumerable.\nObject.defineProperty(Event.prototype, \"constructor\", {\n value: Event,\n configurable: true,\n writable: true,\n})\n\n// Ensure `event instanceof window.Event` is `true`.\nif (typeof window !== \"undefined\" && typeof window.Event !== \"undefined\") {\n Object.setPrototypeOf(Event.prototype, window.Event.prototype)\n\n // Make association for wrappers.\n wrappers.set(window.Event.prototype, Event)\n}\n\n/**\n * Get the property descriptor to redirect a given property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to redirect the property.\n * @private\n */\nfunction defineRedirectDescriptor(key) {\n return {\n get() {\n return pd(this).event[key]\n },\n set(value) {\n pd(this).event[key] = value\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Get the property descriptor to call a given method property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to call the method property.\n * @private\n */\nfunction defineCallDescriptor(key) {\n return {\n value() {\n const event = pd(this).event\n return event[key].apply(event, arguments)\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define new wrapper class.\n * @param {Function} BaseEvent The base wrapper class.\n * @param {Object} proto The prototype of the original event.\n * @returns {Function} The defined wrapper class.\n * @private\n */\nfunction defineWrapper(BaseEvent, proto) {\n const keys = Object.keys(proto)\n if (keys.length === 0) {\n return BaseEvent\n }\n\n /** CustomEvent */\n function CustomEvent(eventTarget, event) {\n BaseEvent.call(this, eventTarget, event)\n }\n\n CustomEvent.prototype = Object.create(BaseEvent.prototype, {\n constructor: { value: CustomEvent, configurable: true, writable: true },\n })\n\n // Define accessors.\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n if (!(key in BaseEvent.prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, key)\n const isFunc = typeof descriptor.value === \"function\"\n Object.defineProperty(\n CustomEvent.prototype,\n key,\n isFunc\n ? defineCallDescriptor(key)\n : defineRedirectDescriptor(key)\n )\n }\n }\n\n return CustomEvent\n}\n\n/**\n * Get the wrapper class of a given prototype.\n * @param {Object} proto The prototype of the original event to get its wrapper.\n * @returns {Function} The wrapper class.\n * @private\n */\nfunction getWrapper(proto) {\n if (proto == null || proto === Object.prototype) {\n return Event\n }\n\n let wrapper = wrappers.get(proto)\n if (wrapper == null) {\n wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto)\n wrappers.set(proto, wrapper)\n }\n return wrapper\n}\n\n/**\n * Wrap a given event to management a dispatching.\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Object} event The event to wrap.\n * @returns {Event} The wrapper instance.\n * @private\n */\nexport function wrapEvent(eventTarget, event) {\n const Wrapper = getWrapper(Object.getPrototypeOf(event))\n return new Wrapper(eventTarget, event)\n}\n\n/**\n * Get the immediateStopped flag of a given event.\n * @param {Event} event The event to get.\n * @returns {boolean} The flag to stop propagation immediately.\n * @private\n */\nexport function isStopped(event) {\n return pd(event).immediateStopped\n}\n\n/**\n * Set the current event phase of a given event.\n * @param {Event} event The event to set current target.\n * @param {number} eventPhase New event phase.\n * @returns {void}\n * @private\n */\nexport function setEventPhase(event, eventPhase) {\n pd(event).eventPhase = eventPhase\n}\n\n/**\n * Set the current target of a given event.\n * @param {Event} event The event to set current target.\n * @param {EventTarget|null} currentTarget New current target.\n * @returns {void}\n * @private\n */\nexport function setCurrentTarget(event, currentTarget) {\n pd(event).currentTarget = currentTarget\n}\n\n/**\n * Set a passive listener of a given event.\n * @param {Event} event The event to set current target.\n * @param {Function|null} passiveListener New passive listener.\n * @returns {void}\n * @private\n */\nexport function setPassiveListener(event, passiveListener) {\n pd(event).passiveListener = passiveListener\n}\n","import {\n isStopped,\n setCurrentTarget,\n setEventPhase,\n setPassiveListener,\n wrapEvent,\n} from \"./event.mjs\"\n\n/**\n * @typedef {object} ListenerNode\n * @property {Function} listener\n * @property {1|2|3} listenerType\n * @property {boolean} passive\n * @property {boolean} once\n * @property {ListenerNode|null} next\n * @private\n */\n\n/**\n * @type {WeakMap>}\n * @private\n */\nconst listenersMap = new WeakMap()\n\n// Listener types\nconst CAPTURE = 1\nconst BUBBLE = 2\nconst ATTRIBUTE = 3\n\n/**\n * Check whether a given value is an object or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an object.\n */\nfunction isObject(x) {\n return x !== null && typeof x === \"object\" //eslint-disable-line no-restricted-syntax\n}\n\n/**\n * Get listeners.\n * @param {EventTarget} eventTarget The event target to get.\n * @returns {Map} The listeners.\n * @private\n */\nfunction getListeners(eventTarget) {\n const listeners = listenersMap.get(eventTarget)\n if (listeners == null) {\n throw new TypeError(\n \"'this' is expected an EventTarget object, but got another value.\"\n )\n }\n return listeners\n}\n\n/**\n * Get the property descriptor for the event attribute of a given event.\n * @param {string} eventName The event name to get property descriptor.\n * @returns {PropertyDescriptor} The property descriptor.\n * @private\n */\nfunction defineEventAttributeDescriptor(eventName) {\n return {\n get() {\n const listeners = getListeners(this)\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n return node.listener\n }\n node = node.next\n }\n return null\n },\n\n set(listener) {\n if (typeof listener !== \"function\" && !isObject(listener)) {\n listener = null // eslint-disable-line no-param-reassign\n }\n const listeners = getListeners(this)\n\n // Traverse to the tail while removing old value.\n let prev = null\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n // Remove old value.\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n } else {\n prev = node\n }\n\n node = node.next\n }\n\n // Add new value.\n if (listener !== null) {\n const newNode = {\n listener,\n listenerType: ATTRIBUTE,\n passive: false,\n once: false,\n next: null,\n }\n if (prev === null) {\n listeners.set(eventName, newNode)\n } else {\n prev.next = newNode\n }\n }\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define an event attribute (e.g. `eventTarget.onclick`).\n * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.\n * @param {string} eventName The event name to define.\n * @returns {void}\n */\nfunction defineEventAttribute(eventTargetPrototype, eventName) {\n Object.defineProperty(\n eventTargetPrototype,\n `on${eventName}`,\n defineEventAttributeDescriptor(eventName)\n )\n}\n\n/**\n * Define a custom EventTarget with event attributes.\n * @param {string[]} eventNames Event names for event attributes.\n * @returns {EventTarget} The custom EventTarget.\n * @private\n */\nfunction defineCustomEventTarget(eventNames) {\n /** CustomEventTarget */\n function CustomEventTarget() {\n EventTarget.call(this)\n }\n\n CustomEventTarget.prototype = Object.create(EventTarget.prototype, {\n constructor: {\n value: CustomEventTarget,\n configurable: true,\n writable: true,\n },\n })\n\n for (let i = 0; i < eventNames.length; ++i) {\n defineEventAttribute(CustomEventTarget.prototype, eventNames[i])\n }\n\n return CustomEventTarget\n}\n\n/**\n * EventTarget.\n *\n * - This is constructor if no arguments.\n * - This is a function which returns a CustomEventTarget constructor if there are arguments.\n *\n * For example:\n *\n * class A extends EventTarget {}\n * class B extends EventTarget(\"message\") {}\n * class C extends EventTarget(\"message\", \"error\") {}\n * class D extends EventTarget([\"message\", \"error\"]) {}\n */\nfunction EventTarget() {\n /*eslint-disable consistent-return */\n if (this instanceof EventTarget) {\n listenersMap.set(this, new Map())\n return\n }\n if (arguments.length === 1 && Array.isArray(arguments[0])) {\n return defineCustomEventTarget(arguments[0])\n }\n if (arguments.length > 0) {\n const types = new Array(arguments.length)\n for (let i = 0; i < arguments.length; ++i) {\n types[i] = arguments[i]\n }\n return defineCustomEventTarget(types)\n }\n throw new TypeError(\"Cannot call a class as a function\")\n /*eslint-enable consistent-return */\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEventTarget.prototype = {\n /**\n * Add a given listener to this event target.\n * @param {string} eventName The event name to add.\n * @param {Function} listener The listener to add.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n addEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n if (typeof listener !== \"function\" && !isObject(listener)) {\n throw new TypeError(\"'listener' should be a function or an object.\")\n }\n\n const listeners = getListeners(this)\n const optionsIsObj = isObject(options)\n const capture = optionsIsObj\n ? Boolean(options.capture)\n : Boolean(options)\n const listenerType = capture ? CAPTURE : BUBBLE\n const newNode = {\n listener,\n listenerType,\n passive: optionsIsObj && Boolean(options.passive),\n once: optionsIsObj && Boolean(options.once),\n next: null,\n }\n\n // Set it as the first node if the first node is null.\n let node = listeners.get(eventName)\n if (node === undefined) {\n listeners.set(eventName, newNode)\n return\n }\n\n // Traverse to the tail while checking duplication..\n let prev = null\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n // Should ignore duplication.\n return\n }\n prev = node\n node = node.next\n }\n\n // Add it.\n prev.next = newNode\n },\n\n /**\n * Remove a given listener from this event target.\n * @param {string} eventName The event name to remove.\n * @param {Function} listener The listener to remove.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n removeEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n\n const listeners = getListeners(this)\n const capture = isObject(options)\n ? Boolean(options.capture)\n : Boolean(options)\n const listenerType = capture ? CAPTURE : BUBBLE\n\n let prev = null\n let node = listeners.get(eventName)\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n return\n }\n\n prev = node\n node = node.next\n }\n },\n\n /**\n * Dispatch a given event.\n * @param {Event|{type:string}} event The event to dispatch.\n * @returns {boolean} `false` if canceled.\n */\n dispatchEvent(event) {\n if (event == null || typeof event.type !== \"string\") {\n throw new TypeError('\"event.type\" should be a string.')\n }\n\n // If listeners aren't registered, terminate.\n const listeners = getListeners(this)\n const eventName = event.type\n let node = listeners.get(eventName)\n if (node == null) {\n return true\n }\n\n // Since we cannot rewrite several properties, so wrap object.\n const wrappedEvent = wrapEvent(this, event)\n\n // This doesn't process capturing phase and bubbling phase.\n // This isn't participating in a tree.\n let prev = null\n while (node != null) {\n // Remove this listener if it's once\n if (node.once) {\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n } else {\n prev = node\n }\n\n // Call this listener\n setPassiveListener(\n wrappedEvent,\n node.passive ? node.listener : null\n )\n if (typeof node.listener === \"function\") {\n try {\n node.listener.call(this, wrappedEvent)\n } catch (err) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(err)\n }\n }\n } else if (\n node.listenerType !== ATTRIBUTE &&\n typeof node.listener.handleEvent === \"function\"\n ) {\n node.listener.handleEvent(wrappedEvent)\n }\n\n // Break if `event.stopImmediatePropagation` was called.\n if (isStopped(wrappedEvent)) {\n break\n }\n\n node = node.next\n }\n setPassiveListener(wrappedEvent, null)\n setEventPhase(wrappedEvent, 0)\n setCurrentTarget(wrappedEvent, null)\n\n return !wrappedEvent.defaultPrevented\n },\n}\n\n// `constructor` is not enumerable.\nObject.defineProperty(EventTarget.prototype, \"constructor\", {\n value: EventTarget,\n configurable: true,\n writable: true,\n})\n\n// Ensure `eventTarget instanceof window.EventTarget` is `true`.\nif (\n typeof window !== \"undefined\" &&\n typeof window.EventTarget !== \"undefined\"\n) {\n Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype)\n}\n\nexport { defineEventAttribute, EventTarget }\nexport default EventTarget\n","import {\n // Event,\n EventTarget,\n // Type,\n defineEventAttribute,\n} from \"event-target-shim\"\n\n// Known Limitation\n// Use `any` because the type of `AbortSignal` in `lib.dom.d.ts` is wrong and\n// to make assignable our `AbortSignal` into that.\n// https://github.com/Microsoft/TSJS-lib-generator/pull/623\ntype Events = {\n abort: any // Event & Type<\"abort\">\n}\ntype EventAttributes = {\n onabort: any // Event & Type<\"abort\">\n}\n\n/**\n * The signal class.\n * @see https://dom.spec.whatwg.org/#abortsignal\n */\nexport default class AbortSignal extends EventTarget {\n /**\n * AbortSignal cannot be constructed directly.\n */\n public constructor() {\n super()\n throw new TypeError(\"AbortSignal cannot be constructed directly\")\n }\n\n /**\n * Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise.\n */\n public get aborted(): boolean {\n const aborted = abortedFlags.get(this)\n if (typeof aborted !== \"boolean\") {\n throw new TypeError(\n `Expected 'this' to be an 'AbortSignal' object, but got ${\n this === null ? \"null\" : typeof this\n }`,\n )\n }\n return aborted\n }\n}\ndefineEventAttribute(AbortSignal.prototype, \"abort\")\n\n/**\n * Create an AbortSignal object.\n */\nexport function createAbortSignal(): AbortSignal {\n const signal = Object.create(AbortSignal.prototype)\n EventTarget.call(signal)\n abortedFlags.set(signal, false)\n return signal\n}\n\n/**\n * Abort a given signal.\n */\nexport function abortSignal(signal: AbortSignal): void {\n if (abortedFlags.get(signal) !== false) {\n return\n }\n\n abortedFlags.set(signal, true)\n signal.dispatchEvent<\"abort\">({ type: \"abort\" })\n}\n\n/**\n * Aborted flag for each instances.\n */\nconst abortedFlags = new WeakMap()\n\n// Properties should be enumerable.\nObject.defineProperties(AbortSignal.prototype, {\n aborted: { enumerable: true },\n})\n\n// `toString()` should return `\"[object AbortSignal]\"`\nif (typeof Symbol === \"function\" && typeof Symbol.toStringTag === \"symbol\") {\n Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, {\n configurable: true,\n value: \"AbortSignal\",\n })\n}\n","import AbortSignal, { abortSignal, createAbortSignal } from \"./abort-signal\"\n\n/**\n * The AbortController.\n * @see https://dom.spec.whatwg.org/#abortcontroller\n */\nexport default class AbortController {\n /**\n * Initialize this controller.\n */\n public constructor() {\n signals.set(this, createAbortSignal())\n }\n\n /**\n * Returns the `AbortSignal` object associated with this object.\n */\n public get signal(): AbortSignal {\n return getSignal(this)\n }\n\n /**\n * Abort and signal to any observers that the associated activity is to be aborted.\n */\n public abort(): void {\n abortSignal(getSignal(this))\n }\n}\n\n/**\n * Associated signals.\n */\nconst signals = new WeakMap()\n\n/**\n * Get the associated signal of a given controller.\n */\nfunction getSignal(controller: AbortController): AbortSignal {\n const signal = signals.get(controller)\n if (signal == null) {\n throw new TypeError(\n `Expected 'this' to be an 'AbortController' object, but got ${\n controller === null ? \"null\" : typeof controller\n }`,\n )\n }\n return signal\n}\n\n// Properties should be enumerable.\nObject.defineProperties(AbortController.prototype, {\n signal: { enumerable: true },\n abort: { enumerable: true },\n})\n\nif (typeof Symbol === \"function\" && typeof Symbol.toStringTag === \"symbol\") {\n Object.defineProperty(AbortController.prototype, Symbol.toStringTag, {\n configurable: true,\n value: \"AbortController\",\n })\n}\n\nexport { AbortController, AbortSignal }\n","'use strict'\n\nconst bufferModule = require('buffer')\nconst { format, inspect } = require('./util/inspect')\nconst {\n codes: { ERR_INVALID_ARG_TYPE }\n} = require('./errors')\nconst { kResistStopPropagation, AggregateError, SymbolDispose } = require('./primordials')\nconst AbortSignal = globalThis.AbortSignal || require('abort-controller').AbortSignal\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nconst AsyncFunction = Object.getPrototypeOf(async function () {}).constructor\nconst Blob = globalThis.Blob || bufferModule.Blob\n/* eslint-disable indent */\nconst isBlob =\n typeof Blob !== 'undefined'\n ? function isBlob(b) {\n // eslint-disable-next-line indent\n return b instanceof Blob\n }\n : function isBlob(b) {\n return false\n }\n/* eslint-enable indent */\n\nconst validateAbortSignal = (signal, name) => {\n if (signal !== undefined && (signal === null || typeof signal !== 'object' || !('aborted' in signal))) {\n throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal)\n }\n}\nconst validateFunction = (value, name) => {\n if (typeof value !== 'function') {\n throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)\n }\n}\nmodule.exports = {\n AggregateError,\n kEmptyObject: Object.freeze({}),\n once(callback) {\n let called = false\n return function (...args) {\n if (called) {\n return\n }\n called = true\n callback.apply(this, args)\n }\n },\n createDeferredPromise: function () {\n let resolve\n let reject\n\n // eslint-disable-next-line promise/param-names\n const promise = new Promise((res, rej) => {\n resolve = res\n reject = rej\n })\n return {\n promise,\n resolve,\n reject\n }\n },\n promisify(fn) {\n return new Promise((resolve, reject) => {\n fn((err, ...args) => {\n if (err) {\n return reject(err)\n }\n return resolve(...args)\n })\n })\n },\n debuglog() {\n return function () {}\n },\n format,\n inspect,\n types: {\n isAsyncFunction(fn) {\n return fn instanceof AsyncFunction\n },\n isArrayBufferView(arr) {\n return ArrayBuffer.isView(arr)\n }\n },\n isBlob,\n deprecate(fn, message) {\n return fn\n },\n addAbortListener:\n require('events').addAbortListener ||\n function addAbortListener(signal, listener) {\n if (signal === undefined) {\n throw new ERR_INVALID_ARG_TYPE('signal', 'AbortSignal', signal)\n }\n validateAbortSignal(signal, 'signal')\n validateFunction(listener, 'listener')\n let removeEventListener\n if (signal.aborted) {\n queueMicrotask(() => listener())\n } else {\n signal.addEventListener('abort', listener, {\n __proto__: null,\n once: true,\n [kResistStopPropagation]: true\n })\n removeEventListener = () => {\n signal.removeEventListener('abort', listener)\n }\n }\n return {\n __proto__: null,\n [SymbolDispose]() {\n var _removeEventListener\n ;(_removeEventListener = removeEventListener) === null || _removeEventListener === undefined\n ? undefined\n : _removeEventListener()\n }\n }\n },\n AbortSignalAny:\n AbortSignal.any ||\n function AbortSignalAny(signals) {\n // Fast path if there is only one signal.\n if (signals.length === 1) {\n return signals[0]\n }\n const ac = new AbortController()\n const abort = () => ac.abort()\n signals.forEach((signal) => {\n validateAbortSignal(signal, 'signals')\n signal.addEventListener('abort', abort, {\n once: true\n })\n })\n ac.signal.addEventListener(\n 'abort',\n () => {\n signals.forEach((signal) => signal.removeEventListener('abort', abort))\n },\n {\n once: true\n }\n )\n return ac.signal\n }\n}\nmodule.exports.promisify.custom = Symbol.for('nodejs.util.promisify.custom')\n","/* eslint jsdoc/require-jsdoc: \"error\" */\n\n'use strict'\n\nconst {\n ArrayIsArray,\n ArrayPrototypeIncludes,\n ArrayPrototypeJoin,\n ArrayPrototypeMap,\n NumberIsInteger,\n NumberIsNaN,\n NumberMAX_SAFE_INTEGER,\n NumberMIN_SAFE_INTEGER,\n NumberParseInt,\n ObjectPrototypeHasOwnProperty,\n RegExpPrototypeExec,\n String,\n StringPrototypeToUpperCase,\n StringPrototypeTrim\n} = require('../ours/primordials')\nconst {\n hideStackFrames,\n codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL }\n} = require('../ours/errors')\nconst { normalizeEncoding } = require('../ours/util')\nconst { isAsyncFunction, isArrayBufferView } = require('../ours/util').types\nconst signals = {}\n\n/**\n * @param {*} value\n * @returns {boolean}\n */\nfunction isInt32(value) {\n return value === (value | 0)\n}\n\n/**\n * @param {*} value\n * @returns {boolean}\n */\nfunction isUint32(value) {\n return value === value >>> 0\n}\nconst octalReg = /^[0-7]+$/\nconst modeDesc = 'must be a 32-bit unsigned integer or an octal string'\n\n/**\n * Parse and validate values that will be converted into mode_t (the S_*\n * constants). Only valid numbers and octal strings are allowed. They could be\n * converted to 32-bit unsigned integers or non-negative signed integers in the\n * C++ land, but any value higher than 0o777 will result in platform-specific\n * behaviors.\n * @param {*} value Values to be validated\n * @param {string} name Name of the argument\n * @param {number} [def] If specified, will be returned for invalid values\n * @returns {number}\n */\nfunction parseFileMode(value, name, def) {\n if (typeof value === 'undefined') {\n value = def\n }\n if (typeof value === 'string') {\n if (RegExpPrototypeExec(octalReg, value) === null) {\n throw new ERR_INVALID_ARG_VALUE(name, value, modeDesc)\n }\n value = NumberParseInt(value, 8)\n }\n validateUint32(value, name)\n return value\n}\n\n/**\n * @callback validateInteger\n * @param {*} value\n * @param {string} name\n * @param {number} [min]\n * @param {number} [max]\n * @returns {asserts value is number}\n */\n\n/** @type {validateInteger} */\nconst validateInteger = hideStackFrames((value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) => {\n if (typeof value !== 'number') throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n if (!NumberIsInteger(value)) throw new ERR_OUT_OF_RANGE(name, 'an integer', value)\n if (value < min || value > max) throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value)\n})\n\n/**\n * @callback validateInt32\n * @param {*} value\n * @param {string} name\n * @param {number} [min]\n * @param {number} [max]\n * @returns {asserts value is number}\n */\n\n/** @type {validateInt32} */\nconst validateInt32 = hideStackFrames((value, name, min = -2147483648, max = 2147483647) => {\n // The defaults for min and max correspond to the limits of 32-bit integers.\n if (typeof value !== 'number') {\n throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n if (!NumberIsInteger(value)) {\n throw new ERR_OUT_OF_RANGE(name, 'an integer', value)\n }\n if (value < min || value > max) {\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value)\n }\n})\n\n/**\n * @callback validateUint32\n * @param {*} value\n * @param {string} name\n * @param {number|boolean} [positive=false]\n * @returns {asserts value is number}\n */\n\n/** @type {validateUint32} */\nconst validateUint32 = hideStackFrames((value, name, positive = false) => {\n if (typeof value !== 'number') {\n throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n if (!NumberIsInteger(value)) {\n throw new ERR_OUT_OF_RANGE(name, 'an integer', value)\n }\n const min = positive ? 1 : 0\n // 2 ** 32 === 4294967296\n const max = 4294967295\n if (value < min || value > max) {\n throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value)\n }\n})\n\n/**\n * @callback validateString\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is string}\n */\n\n/** @type {validateString} */\nfunction validateString(value, name) {\n if (typeof value !== 'string') throw new ERR_INVALID_ARG_TYPE(name, 'string', value)\n}\n\n/**\n * @callback validateNumber\n * @param {*} value\n * @param {string} name\n * @param {number} [min]\n * @param {number} [max]\n * @returns {asserts value is number}\n */\n\n/** @type {validateNumber} */\nfunction validateNumber(value, name, min = undefined, max) {\n if (typeof value !== 'number') throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n if (\n (min != null && value < min) ||\n (max != null && value > max) ||\n ((min != null || max != null) && NumberIsNaN(value))\n ) {\n throw new ERR_OUT_OF_RANGE(\n name,\n `${min != null ? `>= ${min}` : ''}${min != null && max != null ? ' && ' : ''}${max != null ? `<= ${max}` : ''}`,\n value\n )\n }\n}\n\n/**\n * @callback validateOneOf\n * @template T\n * @param {T} value\n * @param {string} name\n * @param {T[]} oneOf\n */\n\n/** @type {validateOneOf} */\nconst validateOneOf = hideStackFrames((value, name, oneOf) => {\n if (!ArrayPrototypeIncludes(oneOf, value)) {\n const allowed = ArrayPrototypeJoin(\n ArrayPrototypeMap(oneOf, (v) => (typeof v === 'string' ? `'${v}'` : String(v))),\n ', '\n )\n const reason = 'must be one of: ' + allowed\n throw new ERR_INVALID_ARG_VALUE(name, value, reason)\n }\n})\n\n/**\n * @callback validateBoolean\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is boolean}\n */\n\n/** @type {validateBoolean} */\nfunction validateBoolean(value, name) {\n if (typeof value !== 'boolean') throw new ERR_INVALID_ARG_TYPE(name, 'boolean', value)\n}\n\n/**\n * @param {any} options\n * @param {string} key\n * @param {boolean} defaultValue\n * @returns {boolean}\n */\nfunction getOwnPropertyValueOrDefault(options, key, defaultValue) {\n return options == null || !ObjectPrototypeHasOwnProperty(options, key) ? defaultValue : options[key]\n}\n\n/**\n * @callback validateObject\n * @param {*} value\n * @param {string} name\n * @param {{\n * allowArray?: boolean,\n * allowFunction?: boolean,\n * nullable?: boolean\n * }} [options]\n */\n\n/** @type {validateObject} */\nconst validateObject = hideStackFrames((value, name, options = null) => {\n const allowArray = getOwnPropertyValueOrDefault(options, 'allowArray', false)\n const allowFunction = getOwnPropertyValueOrDefault(options, 'allowFunction', false)\n const nullable = getOwnPropertyValueOrDefault(options, 'nullable', false)\n if (\n (!nullable && value === null) ||\n (!allowArray && ArrayIsArray(value)) ||\n (typeof value !== 'object' && (!allowFunction || typeof value !== 'function'))\n ) {\n throw new ERR_INVALID_ARG_TYPE(name, 'Object', value)\n }\n})\n\n/**\n * @callback validateDictionary - We are using the Web IDL Standard definition\n * of \"dictionary\" here, which means any value\n * whose Type is either Undefined, Null, or\n * Object (which includes functions).\n * @param {*} value\n * @param {string} name\n * @see https://webidl.spec.whatwg.org/#es-dictionary\n * @see https://tc39.es/ecma262/#table-typeof-operator-results\n */\n\n/** @type {validateDictionary} */\nconst validateDictionary = hideStackFrames((value, name) => {\n if (value != null && typeof value !== 'object' && typeof value !== 'function') {\n throw new ERR_INVALID_ARG_TYPE(name, 'a dictionary', value)\n }\n})\n\n/**\n * @callback validateArray\n * @param {*} value\n * @param {string} name\n * @param {number} [minLength]\n * @returns {asserts value is any[]}\n */\n\n/** @type {validateArray} */\nconst validateArray = hideStackFrames((value, name, minLength = 0) => {\n if (!ArrayIsArray(value)) {\n throw new ERR_INVALID_ARG_TYPE(name, 'Array', value)\n }\n if (value.length < minLength) {\n const reason = `must be longer than ${minLength}`\n throw new ERR_INVALID_ARG_VALUE(name, value, reason)\n }\n})\n\n/**\n * @callback validateStringArray\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is string[]}\n */\n\n/** @type {validateStringArray} */\nfunction validateStringArray(value, name) {\n validateArray(value, name)\n for (let i = 0; i < value.length; i++) {\n validateString(value[i], `${name}[${i}]`)\n }\n}\n\n/**\n * @callback validateBooleanArray\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is boolean[]}\n */\n\n/** @type {validateBooleanArray} */\nfunction validateBooleanArray(value, name) {\n validateArray(value, name)\n for (let i = 0; i < value.length; i++) {\n validateBoolean(value[i], `${name}[${i}]`)\n }\n}\n\n/**\n * @callback validateAbortSignalArray\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is AbortSignal[]}\n */\n\n/** @type {validateAbortSignalArray} */\nfunction validateAbortSignalArray(value, name) {\n validateArray(value, name)\n for (let i = 0; i < value.length; i++) {\n const signal = value[i]\n const indexedName = `${name}[${i}]`\n if (signal == null) {\n throw new ERR_INVALID_ARG_TYPE(indexedName, 'AbortSignal', signal)\n }\n validateAbortSignal(signal, indexedName)\n }\n}\n\n/**\n * @param {*} signal\n * @param {string} [name='signal']\n * @returns {asserts signal is keyof signals}\n */\nfunction validateSignalName(signal, name = 'signal') {\n validateString(signal, name)\n if (signals[signal] === undefined) {\n if (signals[StringPrototypeToUpperCase(signal)] !== undefined) {\n throw new ERR_UNKNOWN_SIGNAL(signal + ' (signals must use all capital letters)')\n }\n throw new ERR_UNKNOWN_SIGNAL(signal)\n }\n}\n\n/**\n * @callback validateBuffer\n * @param {*} buffer\n * @param {string} [name='buffer']\n * @returns {asserts buffer is ArrayBufferView}\n */\n\n/** @type {validateBuffer} */\nconst validateBuffer = hideStackFrames((buffer, name = 'buffer') => {\n if (!isArrayBufferView(buffer)) {\n throw new ERR_INVALID_ARG_TYPE(name, ['Buffer', 'TypedArray', 'DataView'], buffer)\n }\n})\n\n/**\n * @param {string} data\n * @param {string} encoding\n */\nfunction validateEncoding(data, encoding) {\n const normalizedEncoding = normalizeEncoding(encoding)\n const length = data.length\n if (normalizedEncoding === 'hex' && length % 2 !== 0) {\n throw new ERR_INVALID_ARG_VALUE('encoding', encoding, `is invalid for data of length ${length}`)\n }\n}\n\n/**\n * Check that the port number is not NaN when coerced to a number,\n * is an integer and that it falls within the legal range of port numbers.\n * @param {*} port\n * @param {string} [name='Port']\n * @param {boolean} [allowZero=true]\n * @returns {number}\n */\nfunction validatePort(port, name = 'Port', allowZero = true) {\n if (\n (typeof port !== 'number' && typeof port !== 'string') ||\n (typeof port === 'string' && StringPrototypeTrim(port).length === 0) ||\n +port !== +port >>> 0 ||\n port > 0xffff ||\n (port === 0 && !allowZero)\n ) {\n throw new ERR_SOCKET_BAD_PORT(name, port, allowZero)\n }\n return port | 0\n}\n\n/**\n * @callback validateAbortSignal\n * @param {*} signal\n * @param {string} name\n */\n\n/** @type {validateAbortSignal} */\nconst validateAbortSignal = hideStackFrames((signal, name) => {\n if (signal !== undefined && (signal === null || typeof signal !== 'object' || !('aborted' in signal))) {\n throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal)\n }\n})\n\n/**\n * @callback validateFunction\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is Function}\n */\n\n/** @type {validateFunction} */\nconst validateFunction = hideStackFrames((value, name) => {\n if (typeof value !== 'function') throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)\n})\n\n/**\n * @callback validatePlainFunction\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is Function}\n */\n\n/** @type {validatePlainFunction} */\nconst validatePlainFunction = hideStackFrames((value, name) => {\n if (typeof value !== 'function' || isAsyncFunction(value)) throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)\n})\n\n/**\n * @callback validateUndefined\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is undefined}\n */\n\n/** @type {validateUndefined} */\nconst validateUndefined = hideStackFrames((value, name) => {\n if (value !== undefined) throw new ERR_INVALID_ARG_TYPE(name, 'undefined', value)\n})\n\n/**\n * @template T\n * @param {T} value\n * @param {string} name\n * @param {T[]} union\n */\nfunction validateUnion(value, name, union) {\n if (!ArrayPrototypeIncludes(union, value)) {\n throw new ERR_INVALID_ARG_TYPE(name, `('${ArrayPrototypeJoin(union, '|')}')`, value)\n }\n}\n\n/*\n The rules for the Link header field are described here:\n https://www.rfc-editor.org/rfc/rfc8288.html#section-3\n\n This regex validates any string surrounded by angle brackets\n (not necessarily a valid URI reference) followed by zero or more\n link-params separated by semicolons.\n*/\nconst linkValueRegExp = /^(?:<[^>]*>)(?:\\s*;\\s*[^;\"\\s]+(?:=(\")?[^;\"\\s]*\\1)?)*$/\n\n/**\n * @param {any} value\n * @param {string} name\n */\nfunction validateLinkHeaderFormat(value, name) {\n if (typeof value === 'undefined' || !RegExpPrototypeExec(linkValueRegExp, value)) {\n throw new ERR_INVALID_ARG_VALUE(\n name,\n value,\n 'must be an array or string of format \"; rel=preload; as=style\"'\n )\n }\n}\n\n/**\n * @param {any} hints\n * @return {string}\n */\nfunction validateLinkHeaderValue(hints) {\n if (typeof hints === 'string') {\n validateLinkHeaderFormat(hints, 'hints')\n return hints\n } else if (ArrayIsArray(hints)) {\n const hintsLength = hints.length\n let result = ''\n if (hintsLength === 0) {\n return result\n }\n for (let i = 0; i < hintsLength; i++) {\n const link = hints[i]\n validateLinkHeaderFormat(link, 'hints')\n result += link\n if (i !== hintsLength - 1) {\n result += ', '\n }\n }\n return result\n }\n throw new ERR_INVALID_ARG_VALUE(\n 'hints',\n hints,\n 'must be an array or string of format \"; rel=preload; as=style\"'\n )\n}\nmodule.exports = {\n isInt32,\n isUint32,\n parseFileMode,\n validateArray,\n validateStringArray,\n validateBooleanArray,\n validateAbortSignalArray,\n validateBoolean,\n validateBuffer,\n validateDictionary,\n validateEncoding,\n validateFunction,\n validateInt32,\n validateInteger,\n validateNumber,\n validateObject,\n validateOneOf,\n validatePlainFunction,\n validatePort,\n validateSignalName,\n validateString,\n validateUint32,\n validateUndefined,\n validateUnion,\n validateAbortSignal,\n validateLinkHeaderValue\n}\n","// for now just expose the builtin process global from node.js\nmodule.exports = global.process;\n","'use strict'\n\nconst { SymbolAsyncIterator, SymbolIterator, SymbolFor } = require('../../ours/primordials')\n\n// We need to use SymbolFor to make these globally available\n// for interopt with readable-stream, i.e. readable-stream\n// and node core needs to be able to read/write private state\n// from each other for proper interoperability.\nconst kIsDestroyed = SymbolFor('nodejs.stream.destroyed')\nconst kIsErrored = SymbolFor('nodejs.stream.errored')\nconst kIsReadable = SymbolFor('nodejs.stream.readable')\nconst kIsWritable = SymbolFor('nodejs.stream.writable')\nconst kIsDisturbed = SymbolFor('nodejs.stream.disturbed')\nconst kIsClosedPromise = SymbolFor('nodejs.webstream.isClosedPromise')\nconst kControllerErrorFunction = SymbolFor('nodejs.webstream.controllerErrorFunction')\nfunction isReadableNodeStream(obj, strict = false) {\n var _obj$_readableState\n return !!(\n (\n obj &&\n typeof obj.pipe === 'function' &&\n typeof obj.on === 'function' &&\n (!strict || (typeof obj.pause === 'function' && typeof obj.resume === 'function')) &&\n (!obj._writableState ||\n ((_obj$_readableState = obj._readableState) === null || _obj$_readableState === undefined\n ? undefined\n : _obj$_readableState.readable) !== false) &&\n // Duplex\n (!obj._writableState || obj._readableState)\n ) // Writable has .pipe.\n )\n}\nfunction isWritableNodeStream(obj) {\n var _obj$_writableState\n return !!(\n (\n obj &&\n typeof obj.write === 'function' &&\n typeof obj.on === 'function' &&\n (!obj._readableState ||\n ((_obj$_writableState = obj._writableState) === null || _obj$_writableState === undefined\n ? undefined\n : _obj$_writableState.writable) !== false)\n ) // Duplex\n )\n}\nfunction isDuplexNodeStream(obj) {\n return !!(\n obj &&\n typeof obj.pipe === 'function' &&\n obj._readableState &&\n typeof obj.on === 'function' &&\n typeof obj.write === 'function'\n )\n}\nfunction isNodeStream(obj) {\n return (\n obj &&\n (obj._readableState ||\n obj._writableState ||\n (typeof obj.write === 'function' && typeof obj.on === 'function') ||\n (typeof obj.pipe === 'function' && typeof obj.on === 'function'))\n )\n}\nfunction isReadableStream(obj) {\n return !!(\n obj &&\n !isNodeStream(obj) &&\n typeof obj.pipeThrough === 'function' &&\n typeof obj.getReader === 'function' &&\n typeof obj.cancel === 'function'\n )\n}\nfunction isWritableStream(obj) {\n return !!(obj && !isNodeStream(obj) && typeof obj.getWriter === 'function' && typeof obj.abort === 'function')\n}\nfunction isTransformStream(obj) {\n return !!(obj && !isNodeStream(obj) && typeof obj.readable === 'object' && typeof obj.writable === 'object')\n}\nfunction isWebStream(obj) {\n return isReadableStream(obj) || isWritableStream(obj) || isTransformStream(obj)\n}\nfunction isIterable(obj, isAsync) {\n if (obj == null) return false\n if (isAsync === true) return typeof obj[SymbolAsyncIterator] === 'function'\n if (isAsync === false) return typeof obj[SymbolIterator] === 'function'\n return typeof obj[SymbolAsyncIterator] === 'function' || typeof obj[SymbolIterator] === 'function'\n}\nfunction isDestroyed(stream) {\n if (!isNodeStream(stream)) return null\n const wState = stream._writableState\n const rState = stream._readableState\n const state = wState || rState\n return !!(stream.destroyed || stream[kIsDestroyed] || (state !== null && state !== undefined && state.destroyed))\n}\n\n// Have been end():d.\nfunction isWritableEnded(stream) {\n if (!isWritableNodeStream(stream)) return null\n if (stream.writableEnded === true) return true\n const wState = stream._writableState\n if (wState !== null && wState !== undefined && wState.errored) return false\n if (typeof (wState === null || wState === undefined ? undefined : wState.ended) !== 'boolean') return null\n return wState.ended\n}\n\n// Have emitted 'finish'.\nfunction isWritableFinished(stream, strict) {\n if (!isWritableNodeStream(stream)) return null\n if (stream.writableFinished === true) return true\n const wState = stream._writableState\n if (wState !== null && wState !== undefined && wState.errored) return false\n if (typeof (wState === null || wState === undefined ? undefined : wState.finished) !== 'boolean') return null\n return !!(wState.finished || (strict === false && wState.ended === true && wState.length === 0))\n}\n\n// Have been push(null):d.\nfunction isReadableEnded(stream) {\n if (!isReadableNodeStream(stream)) return null\n if (stream.readableEnded === true) return true\n const rState = stream._readableState\n if (!rState || rState.errored) return false\n if (typeof (rState === null || rState === undefined ? undefined : rState.ended) !== 'boolean') return null\n return rState.ended\n}\n\n// Have emitted 'end'.\nfunction isReadableFinished(stream, strict) {\n if (!isReadableNodeStream(stream)) return null\n const rState = stream._readableState\n if (rState !== null && rState !== undefined && rState.errored) return false\n if (typeof (rState === null || rState === undefined ? undefined : rState.endEmitted) !== 'boolean') return null\n return !!(rState.endEmitted || (strict === false && rState.ended === true && rState.length === 0))\n}\nfunction isReadable(stream) {\n if (stream && stream[kIsReadable] != null) return stream[kIsReadable]\n if (typeof (stream === null || stream === undefined ? undefined : stream.readable) !== 'boolean') return null\n if (isDestroyed(stream)) return false\n return isReadableNodeStream(stream) && stream.readable && !isReadableFinished(stream)\n}\nfunction isWritable(stream) {\n if (stream && stream[kIsWritable] != null) return stream[kIsWritable]\n if (typeof (stream === null || stream === undefined ? undefined : stream.writable) !== 'boolean') return null\n if (isDestroyed(stream)) return false\n return isWritableNodeStream(stream) && stream.writable && !isWritableEnded(stream)\n}\nfunction isFinished(stream, opts) {\n if (!isNodeStream(stream)) {\n return null\n }\n if (isDestroyed(stream)) {\n return true\n }\n if ((opts === null || opts === undefined ? undefined : opts.readable) !== false && isReadable(stream)) {\n return false\n }\n if ((opts === null || opts === undefined ? undefined : opts.writable) !== false && isWritable(stream)) {\n return false\n }\n return true\n}\nfunction isWritableErrored(stream) {\n var _stream$_writableStat, _stream$_writableStat2\n if (!isNodeStream(stream)) {\n return null\n }\n if (stream.writableErrored) {\n return stream.writableErrored\n }\n return (_stream$_writableStat =\n (_stream$_writableStat2 = stream._writableState) === null || _stream$_writableStat2 === undefined\n ? undefined\n : _stream$_writableStat2.errored) !== null && _stream$_writableStat !== undefined\n ? _stream$_writableStat\n : null\n}\nfunction isReadableErrored(stream) {\n var _stream$_readableStat, _stream$_readableStat2\n if (!isNodeStream(stream)) {\n return null\n }\n if (stream.readableErrored) {\n return stream.readableErrored\n }\n return (_stream$_readableStat =\n (_stream$_readableStat2 = stream._readableState) === null || _stream$_readableStat2 === undefined\n ? undefined\n : _stream$_readableStat2.errored) !== null && _stream$_readableStat !== undefined\n ? _stream$_readableStat\n : null\n}\nfunction isClosed(stream) {\n if (!isNodeStream(stream)) {\n return null\n }\n if (typeof stream.closed === 'boolean') {\n return stream.closed\n }\n const wState = stream._writableState\n const rState = stream._readableState\n if (\n typeof (wState === null || wState === undefined ? undefined : wState.closed) === 'boolean' ||\n typeof (rState === null || rState === undefined ? undefined : rState.closed) === 'boolean'\n ) {\n return (\n (wState === null || wState === undefined ? undefined : wState.closed) ||\n (rState === null || rState === undefined ? undefined : rState.closed)\n )\n }\n if (typeof stream._closed === 'boolean' && isOutgoingMessage(stream)) {\n return stream._closed\n }\n return null\n}\nfunction isOutgoingMessage(stream) {\n return (\n typeof stream._closed === 'boolean' &&\n typeof stream._defaultKeepAlive === 'boolean' &&\n typeof stream._removedConnection === 'boolean' &&\n typeof stream._removedContLen === 'boolean'\n )\n}\nfunction isServerResponse(stream) {\n return typeof stream._sent100 === 'boolean' && isOutgoingMessage(stream)\n}\nfunction isServerRequest(stream) {\n var _stream$req\n return (\n typeof stream._consuming === 'boolean' &&\n typeof stream._dumped === 'boolean' &&\n ((_stream$req = stream.req) === null || _stream$req === undefined ? undefined : _stream$req.upgradeOrConnect) ===\n undefined\n )\n}\nfunction willEmitClose(stream) {\n if (!isNodeStream(stream)) return null\n const wState = stream._writableState\n const rState = stream._readableState\n const state = wState || rState\n return (\n (!state && isServerResponse(stream)) || !!(state && state.autoDestroy && state.emitClose && state.closed === false)\n )\n}\nfunction isDisturbed(stream) {\n var _stream$kIsDisturbed\n return !!(\n stream &&\n ((_stream$kIsDisturbed = stream[kIsDisturbed]) !== null && _stream$kIsDisturbed !== undefined\n ? _stream$kIsDisturbed\n : stream.readableDidRead || stream.readableAborted)\n )\n}\nfunction isErrored(stream) {\n var _ref,\n _ref2,\n _ref3,\n _ref4,\n _ref5,\n _stream$kIsErrored,\n _stream$_readableStat3,\n _stream$_writableStat3,\n _stream$_readableStat4,\n _stream$_writableStat4\n return !!(\n stream &&\n ((_ref =\n (_ref2 =\n (_ref3 =\n (_ref4 =\n (_ref5 =\n (_stream$kIsErrored = stream[kIsErrored]) !== null && _stream$kIsErrored !== undefined\n ? _stream$kIsErrored\n : stream.readableErrored) !== null && _ref5 !== undefined\n ? _ref5\n : stream.writableErrored) !== null && _ref4 !== undefined\n ? _ref4\n : (_stream$_readableStat3 = stream._readableState) === null || _stream$_readableStat3 === undefined\n ? undefined\n : _stream$_readableStat3.errorEmitted) !== null && _ref3 !== undefined\n ? _ref3\n : (_stream$_writableStat3 = stream._writableState) === null || _stream$_writableStat3 === undefined\n ? undefined\n : _stream$_writableStat3.errorEmitted) !== null && _ref2 !== undefined\n ? _ref2\n : (_stream$_readableStat4 = stream._readableState) === null || _stream$_readableStat4 === undefined\n ? undefined\n : _stream$_readableStat4.errored) !== null && _ref !== undefined\n ? _ref\n : (_stream$_writableStat4 = stream._writableState) === null || _stream$_writableStat4 === undefined\n ? undefined\n : _stream$_writableStat4.errored)\n )\n}\nmodule.exports = {\n isDestroyed,\n kIsDestroyed,\n isDisturbed,\n kIsDisturbed,\n isErrored,\n kIsErrored,\n isReadable,\n kIsReadable,\n kIsClosedPromise,\n kControllerErrorFunction,\n kIsWritable,\n isClosed,\n isDuplexNodeStream,\n isFinished,\n isIterable,\n isReadableNodeStream,\n isReadableStream,\n isReadableEnded,\n isReadableFinished,\n isReadableErrored,\n isNodeStream,\n isWebStream,\n isWritable,\n isWritableNodeStream,\n isWritableStream,\n isWritableEnded,\n isWritableFinished,\n isWritableErrored,\n isServerRequest,\n isServerResponse,\n willEmitClose,\n isTransformStream\n}\n","// Ported from https://github.com/mafintosh/end-of-stream with\n// permission from the author, Mathias Buus (@mafintosh).\n\n'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst { AbortError, codes } = require('../../ours/errors')\nconst { ERR_INVALID_ARG_TYPE, ERR_STREAM_PREMATURE_CLOSE } = codes\nconst { kEmptyObject, once } = require('../../ours/util')\nconst { validateAbortSignal, validateFunction, validateObject, validateBoolean } = require('../validators')\nconst { Promise, PromisePrototypeThen, SymbolDispose } = require('../../ours/primordials')\nconst {\n isClosed,\n isReadable,\n isReadableNodeStream,\n isReadableStream,\n isReadableFinished,\n isReadableErrored,\n isWritable,\n isWritableNodeStream,\n isWritableStream,\n isWritableFinished,\n isWritableErrored,\n isNodeStream,\n willEmitClose: _willEmitClose,\n kIsClosedPromise\n} = require('./utils')\nlet addAbortListener\nfunction isRequest(stream) {\n return stream.setHeader && typeof stream.abort === 'function'\n}\nconst nop = () => {}\nfunction eos(stream, options, callback) {\n var _options$readable, _options$writable\n if (arguments.length === 2) {\n callback = options\n options = kEmptyObject\n } else if (options == null) {\n options = kEmptyObject\n } else {\n validateObject(options, 'options')\n }\n validateFunction(callback, 'callback')\n validateAbortSignal(options.signal, 'options.signal')\n callback = once(callback)\n if (isReadableStream(stream) || isWritableStream(stream)) {\n return eosWeb(stream, options, callback)\n }\n if (!isNodeStream(stream)) {\n throw new ERR_INVALID_ARG_TYPE('stream', ['ReadableStream', 'WritableStream', 'Stream'], stream)\n }\n const readable =\n (_options$readable = options.readable) !== null && _options$readable !== undefined\n ? _options$readable\n : isReadableNodeStream(stream)\n const writable =\n (_options$writable = options.writable) !== null && _options$writable !== undefined\n ? _options$writable\n : isWritableNodeStream(stream)\n const wState = stream._writableState\n const rState = stream._readableState\n const onlegacyfinish = () => {\n if (!stream.writable) {\n onfinish()\n }\n }\n\n // TODO (ronag): Improve soft detection to include core modules and\n // common ecosystem modules that do properly emit 'close' but fail\n // this generic check.\n let willEmitClose =\n _willEmitClose(stream) && isReadableNodeStream(stream) === readable && isWritableNodeStream(stream) === writable\n let writableFinished = isWritableFinished(stream, false)\n const onfinish = () => {\n writableFinished = true\n // Stream should not be destroyed here. If it is that\n // means that user space is doing something differently and\n // we cannot trust willEmitClose.\n if (stream.destroyed) {\n willEmitClose = false\n }\n if (willEmitClose && (!stream.readable || readable)) {\n return\n }\n if (!readable || readableFinished) {\n callback.call(stream)\n }\n }\n let readableFinished = isReadableFinished(stream, false)\n const onend = () => {\n readableFinished = true\n // Stream should not be destroyed here. If it is that\n // means that user space is doing something differently and\n // we cannot trust willEmitClose.\n if (stream.destroyed) {\n willEmitClose = false\n }\n if (willEmitClose && (!stream.writable || writable)) {\n return\n }\n if (!writable || writableFinished) {\n callback.call(stream)\n }\n }\n const onerror = (err) => {\n callback.call(stream, err)\n }\n let closed = isClosed(stream)\n const onclose = () => {\n closed = true\n const errored = isWritableErrored(stream) || isReadableErrored(stream)\n if (errored && typeof errored !== 'boolean') {\n return callback.call(stream, errored)\n }\n if (readable && !readableFinished && isReadableNodeStream(stream, true)) {\n if (!isReadableFinished(stream, false)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE())\n }\n if (writable && !writableFinished) {\n if (!isWritableFinished(stream, false)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE())\n }\n callback.call(stream)\n }\n const onclosed = () => {\n closed = true\n const errored = isWritableErrored(stream) || isReadableErrored(stream)\n if (errored && typeof errored !== 'boolean') {\n return callback.call(stream, errored)\n }\n callback.call(stream)\n }\n const onrequest = () => {\n stream.req.on('finish', onfinish)\n }\n if (isRequest(stream)) {\n stream.on('complete', onfinish)\n if (!willEmitClose) {\n stream.on('abort', onclose)\n }\n if (stream.req) {\n onrequest()\n } else {\n stream.on('request', onrequest)\n }\n } else if (writable && !wState) {\n // legacy streams\n stream.on('end', onlegacyfinish)\n stream.on('close', onlegacyfinish)\n }\n\n // Not all streams will emit 'close' after 'aborted'.\n if (!willEmitClose && typeof stream.aborted === 'boolean') {\n stream.on('aborted', onclose)\n }\n stream.on('end', onend)\n stream.on('finish', onfinish)\n if (options.error !== false) {\n stream.on('error', onerror)\n }\n stream.on('close', onclose)\n if (closed) {\n process.nextTick(onclose)\n } else if (\n (wState !== null && wState !== undefined && wState.errorEmitted) ||\n (rState !== null && rState !== undefined && rState.errorEmitted)\n ) {\n if (!willEmitClose) {\n process.nextTick(onclosed)\n }\n } else if (\n !readable &&\n (!willEmitClose || isReadable(stream)) &&\n (writableFinished || isWritable(stream) === false)\n ) {\n process.nextTick(onclosed)\n } else if (\n !writable &&\n (!willEmitClose || isWritable(stream)) &&\n (readableFinished || isReadable(stream) === false)\n ) {\n process.nextTick(onclosed)\n } else if (rState && stream.req && stream.aborted) {\n process.nextTick(onclosed)\n }\n const cleanup = () => {\n callback = nop\n stream.removeListener('aborted', onclose)\n stream.removeListener('complete', onfinish)\n stream.removeListener('abort', onclose)\n stream.removeListener('request', onrequest)\n if (stream.req) stream.req.removeListener('finish', onfinish)\n stream.removeListener('end', onlegacyfinish)\n stream.removeListener('close', onlegacyfinish)\n stream.removeListener('finish', onfinish)\n stream.removeListener('end', onend)\n stream.removeListener('error', onerror)\n stream.removeListener('close', onclose)\n }\n if (options.signal && !closed) {\n const abort = () => {\n // Keep it because cleanup removes it.\n const endCallback = callback\n cleanup()\n endCallback.call(\n stream,\n new AbortError(undefined, {\n cause: options.signal.reason\n })\n )\n }\n if (options.signal.aborted) {\n process.nextTick(abort)\n } else {\n addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n const disposable = addAbortListener(options.signal, abort)\n const originalCallback = callback\n callback = once((...args) => {\n disposable[SymbolDispose]()\n originalCallback.apply(stream, args)\n })\n }\n }\n return cleanup\n}\nfunction eosWeb(stream, options, callback) {\n let isAborted = false\n let abort = nop\n if (options.signal) {\n abort = () => {\n isAborted = true\n callback.call(\n stream,\n new AbortError(undefined, {\n cause: options.signal.reason\n })\n )\n }\n if (options.signal.aborted) {\n process.nextTick(abort)\n } else {\n addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n const disposable = addAbortListener(options.signal, abort)\n const originalCallback = callback\n callback = once((...args) => {\n disposable[SymbolDispose]()\n originalCallback.apply(stream, args)\n })\n }\n }\n const resolverFn = (...args) => {\n if (!isAborted) {\n process.nextTick(() => callback.apply(stream, args))\n }\n }\n PromisePrototypeThen(stream[kIsClosedPromise].promise, resolverFn, resolverFn)\n return nop\n}\nfunction finished(stream, opts) {\n var _opts\n let autoCleanup = false\n if (opts === null) {\n opts = kEmptyObject\n }\n if ((_opts = opts) !== null && _opts !== undefined && _opts.cleanup) {\n validateBoolean(opts.cleanup, 'cleanup')\n autoCleanup = opts.cleanup\n }\n return new Promise((resolve, reject) => {\n const cleanup = eos(stream, opts, (err) => {\n if (autoCleanup) {\n cleanup()\n }\n if (err) {\n reject(err)\n } else {\n resolve()\n }\n })\n })\n}\nmodule.exports = eos\nmodule.exports.finished = finished\n","'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst {\n aggregateTwoErrors,\n codes: { ERR_MULTIPLE_CALLBACK },\n AbortError\n} = require('../../ours/errors')\nconst { Symbol } = require('../../ours/primordials')\nconst { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require('./utils')\nconst kDestroy = Symbol('kDestroy')\nconst kConstruct = Symbol('kConstruct')\nfunction checkError(err, w, r) {\n if (err) {\n // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364\n err.stack // eslint-disable-line no-unused-expressions\n\n if (w && !w.errored) {\n w.errored = err\n }\n if (r && !r.errored) {\n r.errored = err\n }\n }\n}\n\n// Backwards compat. cb() is undocumented and unused in core but\n// unfortunately might be used by modules.\nfunction destroy(err, cb) {\n const r = this._readableState\n const w = this._writableState\n // With duplex streams we use the writable side for state.\n const s = w || r\n if ((w !== null && w !== undefined && w.destroyed) || (r !== null && r !== undefined && r.destroyed)) {\n if (typeof cb === 'function') {\n cb()\n }\n return this\n }\n\n // We set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n checkError(err, w, r)\n if (w) {\n w.destroyed = true\n }\n if (r) {\n r.destroyed = true\n }\n\n // If still constructing then defer calling _destroy.\n if (!s.constructed) {\n this.once(kDestroy, function (er) {\n _destroy(this, aggregateTwoErrors(er, err), cb)\n })\n } else {\n _destroy(this, err, cb)\n }\n return this\n}\nfunction _destroy(self, err, cb) {\n let called = false\n function onDestroy(err) {\n if (called) {\n return\n }\n called = true\n const r = self._readableState\n const w = self._writableState\n checkError(err, w, r)\n if (w) {\n w.closed = true\n }\n if (r) {\n r.closed = true\n }\n if (typeof cb === 'function') {\n cb(err)\n }\n if (err) {\n process.nextTick(emitErrorCloseNT, self, err)\n } else {\n process.nextTick(emitCloseNT, self)\n }\n }\n try {\n self._destroy(err || null, onDestroy)\n } catch (err) {\n onDestroy(err)\n }\n}\nfunction emitErrorCloseNT(self, err) {\n emitErrorNT(self, err)\n emitCloseNT(self)\n}\nfunction emitCloseNT(self) {\n const r = self._readableState\n const w = self._writableState\n if (w) {\n w.closeEmitted = true\n }\n if (r) {\n r.closeEmitted = true\n }\n if ((w !== null && w !== undefined && w.emitClose) || (r !== null && r !== undefined && r.emitClose)) {\n self.emit('close')\n }\n}\nfunction emitErrorNT(self, err) {\n const r = self._readableState\n const w = self._writableState\n if ((w !== null && w !== undefined && w.errorEmitted) || (r !== null && r !== undefined && r.errorEmitted)) {\n return\n }\n if (w) {\n w.errorEmitted = true\n }\n if (r) {\n r.errorEmitted = true\n }\n self.emit('error', err)\n}\nfunction undestroy() {\n const r = this._readableState\n const w = this._writableState\n if (r) {\n r.constructed = true\n r.closed = false\n r.closeEmitted = false\n r.destroyed = false\n r.errored = null\n r.errorEmitted = false\n r.reading = false\n r.ended = r.readable === false\n r.endEmitted = r.readable === false\n }\n if (w) {\n w.constructed = true\n w.destroyed = false\n w.closed = false\n w.closeEmitted = false\n w.errored = null\n w.errorEmitted = false\n w.finalCalled = false\n w.prefinished = false\n w.ended = w.writable === false\n w.ending = w.writable === false\n w.finished = w.writable === false\n }\n}\nfunction errorOrDestroy(stream, err, sync) {\n // We have tests that rely on errors being emitted\n // in the same tick, so changing this is semver major.\n // For now when you opt-in to autoDestroy we allow\n // the error to be emitted nextTick. In a future\n // semver major update we should change the default to this.\n\n const r = stream._readableState\n const w = stream._writableState\n if ((w !== null && w !== undefined && w.destroyed) || (r !== null && r !== undefined && r.destroyed)) {\n return this\n }\n if ((r !== null && r !== undefined && r.autoDestroy) || (w !== null && w !== undefined && w.autoDestroy))\n stream.destroy(err)\n else if (err) {\n // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364\n err.stack // eslint-disable-line no-unused-expressions\n\n if (w && !w.errored) {\n w.errored = err\n }\n if (r && !r.errored) {\n r.errored = err\n }\n if (sync) {\n process.nextTick(emitErrorNT, stream, err)\n } else {\n emitErrorNT(stream, err)\n }\n }\n}\nfunction construct(stream, cb) {\n if (typeof stream._construct !== 'function') {\n return\n }\n const r = stream._readableState\n const w = stream._writableState\n if (r) {\n r.constructed = false\n }\n if (w) {\n w.constructed = false\n }\n stream.once(kConstruct, cb)\n if (stream.listenerCount(kConstruct) > 1) {\n // Duplex\n return\n }\n process.nextTick(constructNT, stream)\n}\nfunction constructNT(stream) {\n let called = false\n function onConstruct(err) {\n if (called) {\n errorOrDestroy(stream, err !== null && err !== undefined ? err : new ERR_MULTIPLE_CALLBACK())\n return\n }\n called = true\n const r = stream._readableState\n const w = stream._writableState\n const s = w || r\n if (r) {\n r.constructed = true\n }\n if (w) {\n w.constructed = true\n }\n if (s.destroyed) {\n stream.emit(kDestroy, err)\n } else if (err) {\n errorOrDestroy(stream, err, true)\n } else {\n process.nextTick(emitConstructNT, stream)\n }\n }\n try {\n stream._construct((err) => {\n process.nextTick(onConstruct, err)\n })\n } catch (err) {\n process.nextTick(onConstruct, err)\n }\n}\nfunction emitConstructNT(stream) {\n stream.emit(kConstruct)\n}\nfunction isRequest(stream) {\n return (stream === null || stream === undefined ? undefined : stream.setHeader) && typeof stream.abort === 'function'\n}\nfunction emitCloseLegacy(stream) {\n stream.emit('close')\n}\nfunction emitErrorCloseLegacy(stream, err) {\n stream.emit('error', err)\n process.nextTick(emitCloseLegacy, stream)\n}\n\n// Normalize destroy for legacy.\nfunction destroyer(stream, err) {\n if (!stream || isDestroyed(stream)) {\n return\n }\n if (!err && !isFinished(stream)) {\n err = new AbortError()\n }\n\n // TODO: Remove isRequest branches.\n if (isServerRequest(stream)) {\n stream.socket = null\n stream.destroy(err)\n } else if (isRequest(stream)) {\n stream.abort()\n } else if (isRequest(stream.req)) {\n stream.req.abort()\n } else if (typeof stream.destroy === 'function') {\n stream.destroy(err)\n } else if (typeof stream.close === 'function') {\n // TODO: Don't lose err?\n stream.close()\n } else if (err) {\n process.nextTick(emitErrorCloseLegacy, stream, err)\n } else {\n process.nextTick(emitCloseLegacy, stream)\n }\n if (!stream.destroyed) {\n stream[kIsDestroyed] = true\n }\n}\nmodule.exports = {\n construct,\n destroyer,\n destroy,\n undestroy,\n errorOrDestroy\n}\n","'use strict'\n\nconst { ArrayIsArray, ObjectSetPrototypeOf } = require('../../ours/primordials')\nconst { EventEmitter: EE } = require('events')\nfunction Stream(opts) {\n EE.call(this, opts)\n}\nObjectSetPrototypeOf(Stream.prototype, EE.prototype)\nObjectSetPrototypeOf(Stream, EE)\nStream.prototype.pipe = function (dest, options) {\n const source = this\n function ondata(chunk) {\n if (dest.writable && dest.write(chunk) === false && source.pause) {\n source.pause()\n }\n }\n source.on('data', ondata)\n function ondrain() {\n if (source.readable && source.resume) {\n source.resume()\n }\n }\n dest.on('drain', ondrain)\n\n // If the 'end' option is not supplied, dest.end() will be called when\n // source gets the 'end' or 'close' events. Only dest.end() once.\n if (!dest._isStdio && (!options || options.end !== false)) {\n source.on('end', onend)\n source.on('close', onclose)\n }\n let didOnEnd = false\n function onend() {\n if (didOnEnd) return\n didOnEnd = true\n dest.end()\n }\n function onclose() {\n if (didOnEnd) return\n didOnEnd = true\n if (typeof dest.destroy === 'function') dest.destroy()\n }\n\n // Don't leave dangling pipes when there are errors.\n function onerror(er) {\n cleanup()\n if (EE.listenerCount(this, 'error') === 0) {\n this.emit('error', er)\n }\n }\n prependListener(source, 'error', onerror)\n prependListener(dest, 'error', onerror)\n\n // Remove all the event listeners that were added.\n function cleanup() {\n source.removeListener('data', ondata)\n dest.removeListener('drain', ondrain)\n source.removeListener('end', onend)\n source.removeListener('close', onclose)\n source.removeListener('error', onerror)\n dest.removeListener('error', onerror)\n source.removeListener('end', cleanup)\n source.removeListener('close', cleanup)\n dest.removeListener('close', cleanup)\n }\n source.on('end', cleanup)\n source.on('close', cleanup)\n dest.on('close', cleanup)\n dest.emit('pipe', source)\n\n // Allow for unix-like usage: A.pipe(B).pipe(C)\n return dest\n}\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn)\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn)\n else if (ArrayIsArray(emitter._events[event])) emitter._events[event].unshift(fn)\n else emitter._events[event] = [fn, emitter._events[event]]\n}\nmodule.exports = {\n Stream,\n prependListener\n}\n","'use strict'\n\nconst { SymbolDispose } = require('../../ours/primordials')\nconst { AbortError, codes } = require('../../ours/errors')\nconst { isNodeStream, isWebStream, kControllerErrorFunction } = require('./utils')\nconst eos = require('./end-of-stream')\nconst { ERR_INVALID_ARG_TYPE } = codes\nlet addAbortListener\n\n// This method is inlined here for readable-stream\n// It also does not allow for signal to not exist on the stream\n// https://github.com/nodejs/node/pull/36061#discussion_r533718029\nconst validateAbortSignal = (signal, name) => {\n if (typeof signal !== 'object' || !('aborted' in signal)) {\n throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal)\n }\n}\nmodule.exports.addAbortSignal = function addAbortSignal(signal, stream) {\n validateAbortSignal(signal, 'signal')\n if (!isNodeStream(stream) && !isWebStream(stream)) {\n throw new ERR_INVALID_ARG_TYPE('stream', ['ReadableStream', 'WritableStream', 'Stream'], stream)\n }\n return module.exports.addAbortSignalNoValidate(signal, stream)\n}\nmodule.exports.addAbortSignalNoValidate = function (signal, stream) {\n if (typeof signal !== 'object' || !('aborted' in signal)) {\n return stream\n }\n const onAbort = isNodeStream(stream)\n ? () => {\n stream.destroy(\n new AbortError(undefined, {\n cause: signal.reason\n })\n )\n }\n : () => {\n stream[kControllerErrorFunction](\n new AbortError(undefined, {\n cause: signal.reason\n })\n )\n }\n if (signal.aborted) {\n onAbort()\n } else {\n addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n const disposable = addAbortListener(signal, onAbort)\n eos(stream, disposable[SymbolDispose])\n }\n return stream\n}\n","'use strict'\n\nconst { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array } = require('../../ours/primordials')\nconst { Buffer } = require('buffer')\nconst { inspect } = require('../../ours/util')\nmodule.exports = class BufferList {\n constructor() {\n this.head = null\n this.tail = null\n this.length = 0\n }\n push(v) {\n const entry = {\n data: v,\n next: null\n }\n if (this.length > 0) this.tail.next = entry\n else this.head = entry\n this.tail = entry\n ++this.length\n }\n unshift(v) {\n const entry = {\n data: v,\n next: this.head\n }\n if (this.length === 0) this.tail = entry\n this.head = entry\n ++this.length\n }\n shift() {\n if (this.length === 0) return\n const ret = this.head.data\n if (this.length === 1) this.head = this.tail = null\n else this.head = this.head.next\n --this.length\n return ret\n }\n clear() {\n this.head = this.tail = null\n this.length = 0\n }\n join(s) {\n if (this.length === 0) return ''\n let p = this.head\n let ret = '' + p.data\n while ((p = p.next) !== null) ret += s + p.data\n return ret\n }\n concat(n) {\n if (this.length === 0) return Buffer.alloc(0)\n const ret = Buffer.allocUnsafe(n >>> 0)\n let p = this.head\n let i = 0\n while (p) {\n TypedArrayPrototypeSet(ret, p.data, i)\n i += p.data.length\n p = p.next\n }\n return ret\n }\n\n // Consumes a specified amount of bytes or characters from the buffered data.\n consume(n, hasStrings) {\n const data = this.head.data\n if (n < data.length) {\n // `slice` is the same for buffers and strings.\n const slice = data.slice(0, n)\n this.head.data = data.slice(n)\n return slice\n }\n if (n === data.length) {\n // First chunk is a perfect match.\n return this.shift()\n }\n // Result spans more than one buffer.\n return hasStrings ? this._getString(n) : this._getBuffer(n)\n }\n first() {\n return this.head.data\n }\n *[SymbolIterator]() {\n for (let p = this.head; p; p = p.next) {\n yield p.data\n }\n }\n\n // Consumes a specified amount of characters from the buffered data.\n _getString(n) {\n let ret = ''\n let p = this.head\n let c = 0\n do {\n const str = p.data\n if (n > str.length) {\n ret += str\n n -= str.length\n } else {\n if (n === str.length) {\n ret += str\n ++c\n if (p.next) this.head = p.next\n else this.head = this.tail = null\n } else {\n ret += StringPrototypeSlice(str, 0, n)\n this.head = p\n p.data = StringPrototypeSlice(str, n)\n }\n break\n }\n ++c\n } while ((p = p.next) !== null)\n this.length -= c\n return ret\n }\n\n // Consumes a specified amount of bytes from the buffered data.\n _getBuffer(n) {\n const ret = Buffer.allocUnsafe(n)\n const retLen = n\n let p = this.head\n let c = 0\n do {\n const buf = p.data\n if (n > buf.length) {\n TypedArrayPrototypeSet(ret, buf, retLen - n)\n n -= buf.length\n } else {\n if (n === buf.length) {\n TypedArrayPrototypeSet(ret, buf, retLen - n)\n ++c\n if (p.next) this.head = p.next\n else this.head = this.tail = null\n } else {\n TypedArrayPrototypeSet(ret, new Uint8Array(buf.buffer, buf.byteOffset, n), retLen - n)\n this.head = p\n p.data = buf.slice(n)\n }\n break\n }\n ++c\n } while ((p = p.next) !== null)\n this.length -= c\n return ret\n }\n\n // Make sure the linked list only shows the minimal necessary information.\n [Symbol.for('nodejs.util.inspect.custom')](_, options) {\n return inspect(this, {\n ...options,\n // Only inspect one level.\n depth: 0,\n // It should not recurse.\n customInspect: false\n })\n }\n}\n","'use strict'\n\nconst { MathFloor, NumberIsInteger } = require('../../ours/primordials')\nconst { validateInteger } = require('../validators')\nconst { ERR_INVALID_ARG_VALUE } = require('../../ours/errors').codes\nlet defaultHighWaterMarkBytes = 16 * 1024\nlet defaultHighWaterMarkObjectMode = 16\nfunction highWaterMarkFrom(options, isDuplex, duplexKey) {\n return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null\n}\nfunction getDefaultHighWaterMark(objectMode) {\n return objectMode ? defaultHighWaterMarkObjectMode : defaultHighWaterMarkBytes\n}\nfunction setDefaultHighWaterMark(objectMode, value) {\n validateInteger(value, 'value', 0)\n if (objectMode) {\n defaultHighWaterMarkObjectMode = value\n } else {\n defaultHighWaterMarkBytes = value\n }\n}\nfunction getHighWaterMark(state, options, duplexKey, isDuplex) {\n const hwm = highWaterMarkFrom(options, isDuplex, duplexKey)\n if (hwm != null) {\n if (!NumberIsInteger(hwm) || hwm < 0) {\n const name = isDuplex ? `options.${duplexKey}` : 'options.highWaterMark'\n throw new ERR_INVALID_ARG_VALUE(name, hwm)\n }\n return MathFloor(hwm)\n }\n\n // Default value\n return getDefaultHighWaterMark(state.objectMode)\n}\nmodule.exports = {\n getHighWaterMark,\n getDefaultHighWaterMark,\n setDefaultHighWaterMark\n}\n","/*! safe-buffer. MIT License. Feross Aboukhadijeh */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/**/\n\nvar Buffer = require('safe-buffer').Buffer;\n/**/\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n encoding = '' + encoding;\n switch (encoding && encoding.toLowerCase()) {\n case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':\n return true;\n default:\n return false;\n }\n};\n\nfunction _normalizeEncoding(enc) {\n if (!enc) return 'utf8';\n var retried;\n while (true) {\n switch (enc) {\n case 'utf8':\n case 'utf-8':\n return 'utf8';\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return 'utf16le';\n case 'latin1':\n case 'binary':\n return 'latin1';\n case 'base64':\n case 'ascii':\n case 'hex':\n return enc;\n default:\n if (retried) return; // undefined\n enc = ('' + enc).toLowerCase();\n retried = true;\n }\n }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n this.encoding = normalizeEncoding(encoding);\n var nb;\n switch (this.encoding) {\n case 'utf16le':\n this.text = utf16Text;\n this.end = utf16End;\n nb = 4;\n break;\n case 'utf8':\n this.fillLast = utf8FillLast;\n nb = 4;\n break;\n case 'base64':\n this.text = base64Text;\n this.end = base64End;\n nb = 3;\n break;\n default:\n this.write = simpleWrite;\n this.end = simpleEnd;\n return;\n }\n this.lastNeed = 0;\n this.lastTotal = 0;\n this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n if (buf.length === 0) return '';\n var r;\n var i;\n if (this.lastNeed) {\n r = this.fillLast(buf);\n if (r === undefined) return '';\n i = this.lastNeed;\n this.lastNeed = 0;\n } else {\n i = 0;\n }\n if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte. If an invalid byte is detected, -2 is returned.\nfunction utf8CheckByte(byte) {\n if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n return byte >> 6 === 0x02 ? -1 : -2;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// a single UTF-8 replacement character ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n var p = this.lastTotal - this.lastNeed;\n var r = utf8CheckExtraBytes(this, buf, p);\n if (r !== undefined) return r;\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, p, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, p, 0, buf.length);\n this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character is added when ending on a partial\n// character.\nfunction utf8End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + '\\ufffd';\n return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n return r.slice(0, -1);\n }\n }\n return r;\n }\n this.lastNeed = 1;\n this.lastTotal = 2;\n this.lastChar[0] = buf[buf.length - 1];\n return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) {\n var end = this.lastTotal - this.lastNeed;\n return r + this.lastChar.toString('utf16le', 0, end);\n }\n return r;\n}\n\nfunction base64Text(buf, i) {\n var n = (buf.length - i) % 3;\n if (n === 0) return buf.toString('base64', i);\n this.lastNeed = 3 - n;\n this.lastTotal = 3;\n if (n === 1) {\n this.lastChar[0] = buf[buf.length - 1];\n } else {\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n }\n return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n return buf && buf.length ? this.write(buf) : '';\n}","'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require('../../ours/primordials')\nconst { Buffer } = require('buffer')\nconst { ERR_INVALID_ARG_TYPE, ERR_STREAM_NULL_VALUES } = require('../../ours/errors').codes\nfunction from(Readable, iterable, opts) {\n let iterator\n if (typeof iterable === 'string' || iterable instanceof Buffer) {\n return new Readable({\n objectMode: true,\n ...opts,\n read() {\n this.push(iterable)\n this.push(null)\n }\n })\n }\n let isAsync\n if (iterable && iterable[SymbolAsyncIterator]) {\n isAsync = true\n iterator = iterable[SymbolAsyncIterator]()\n } else if (iterable && iterable[SymbolIterator]) {\n isAsync = false\n iterator = iterable[SymbolIterator]()\n } else {\n throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable)\n }\n const readable = new Readable({\n objectMode: true,\n highWaterMark: 1,\n // TODO(ronag): What options should be allowed?\n ...opts\n })\n\n // Flag to protect against _read\n // being called before last iteration completion.\n let reading = false\n readable._read = function () {\n if (!reading) {\n reading = true\n next()\n }\n }\n readable._destroy = function (error, cb) {\n PromisePrototypeThen(\n close(error),\n () => process.nextTick(cb, error),\n // nextTick is here in case cb throws\n (e) => process.nextTick(cb, e || error)\n )\n }\n async function close(error) {\n const hadError = error !== undefined && error !== null\n const hasThrow = typeof iterator.throw === 'function'\n if (hadError && hasThrow) {\n const { value, done } = await iterator.throw(error)\n await value\n if (done) {\n return\n }\n }\n if (typeof iterator.return === 'function') {\n const { value } = await iterator.return()\n await value\n }\n }\n async function next() {\n for (;;) {\n try {\n const { value, done } = isAsync ? await iterator.next() : iterator.next()\n if (done) {\n readable.push(null)\n } else {\n const res = value && typeof value.then === 'function' ? await value : value\n if (res === null) {\n reading = false\n throw new ERR_STREAM_NULL_VALUES()\n } else if (readable.push(res)) {\n continue\n } else {\n reading = false\n }\n }\n } catch (err) {\n readable.destroy(err)\n }\n break\n }\n }\n return readable\n}\nmodule.exports = from\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst {\n ArrayPrototypeIndexOf,\n NumberIsInteger,\n NumberIsNaN,\n NumberParseInt,\n ObjectDefineProperties,\n ObjectKeys,\n ObjectSetPrototypeOf,\n Promise,\n SafeSet,\n SymbolAsyncDispose,\n SymbolAsyncIterator,\n Symbol\n} = require('../../ours/primordials')\nmodule.exports = Readable\nReadable.ReadableState = ReadableState\nconst { EventEmitter: EE } = require('events')\nconst { Stream, prependListener } = require('./legacy')\nconst { Buffer } = require('buffer')\nconst { addAbortSignal } = require('./add-abort-signal')\nconst eos = require('./end-of-stream')\nlet debug = require('../../ours/util').debuglog('stream', (fn) => {\n debug = fn\n})\nconst BufferList = require('./buffer_list')\nconst destroyImpl = require('./destroy')\nconst { getHighWaterMark, getDefaultHighWaterMark } = require('./state')\nconst {\n aggregateTwoErrors,\n codes: {\n ERR_INVALID_ARG_TYPE,\n ERR_METHOD_NOT_IMPLEMENTED,\n ERR_OUT_OF_RANGE,\n ERR_STREAM_PUSH_AFTER_EOF,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT\n },\n AbortError\n} = require('../../ours/errors')\nconst { validateObject } = require('../validators')\nconst kPaused = Symbol('kPaused')\nconst { StringDecoder } = require('string_decoder/')\nconst from = require('./from')\nObjectSetPrototypeOf(Readable.prototype, Stream.prototype)\nObjectSetPrototypeOf(Readable, Stream)\nconst nop = () => {}\nconst { errorOrDestroy } = destroyImpl\nconst kObjectMode = 1 << 0\nconst kEnded = 1 << 1\nconst kEndEmitted = 1 << 2\nconst kReading = 1 << 3\nconst kConstructed = 1 << 4\nconst kSync = 1 << 5\nconst kNeedReadable = 1 << 6\nconst kEmittedReadable = 1 << 7\nconst kReadableListening = 1 << 8\nconst kResumeScheduled = 1 << 9\nconst kErrorEmitted = 1 << 10\nconst kEmitClose = 1 << 11\nconst kAutoDestroy = 1 << 12\nconst kDestroyed = 1 << 13\nconst kClosed = 1 << 14\nconst kCloseEmitted = 1 << 15\nconst kMultiAwaitDrain = 1 << 16\nconst kReadingMore = 1 << 17\nconst kDataEmitted = 1 << 18\n\n// TODO(benjamingr) it is likely slower to do it this way than with free functions\nfunction makeBitMapDescriptor(bit) {\n return {\n enumerable: false,\n get() {\n return (this.state & bit) !== 0\n },\n set(value) {\n if (value) this.state |= bit\n else this.state &= ~bit\n }\n }\n}\nObjectDefineProperties(ReadableState.prototype, {\n objectMode: makeBitMapDescriptor(kObjectMode),\n ended: makeBitMapDescriptor(kEnded),\n endEmitted: makeBitMapDescriptor(kEndEmitted),\n reading: makeBitMapDescriptor(kReading),\n // Stream is still being constructed and cannot be\n // destroyed until construction finished or failed.\n // Async construction is opt in, therefore we start as\n // constructed.\n constructed: makeBitMapDescriptor(kConstructed),\n // A flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n sync: makeBitMapDescriptor(kSync),\n // Whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n needReadable: makeBitMapDescriptor(kNeedReadable),\n emittedReadable: makeBitMapDescriptor(kEmittedReadable),\n readableListening: makeBitMapDescriptor(kReadableListening),\n resumeScheduled: makeBitMapDescriptor(kResumeScheduled),\n // True if the error was already emitted and should not be thrown again.\n errorEmitted: makeBitMapDescriptor(kErrorEmitted),\n emitClose: makeBitMapDescriptor(kEmitClose),\n autoDestroy: makeBitMapDescriptor(kAutoDestroy),\n // Has it been destroyed.\n destroyed: makeBitMapDescriptor(kDestroyed),\n // Indicates whether the stream has finished destroying.\n closed: makeBitMapDescriptor(kClosed),\n // True if close has been emitted or would have been emitted\n // depending on emitClose.\n closeEmitted: makeBitMapDescriptor(kCloseEmitted),\n multiAwaitDrain: makeBitMapDescriptor(kMultiAwaitDrain),\n // If true, a maybeReadMore has been scheduled.\n readingMore: makeBitMapDescriptor(kReadingMore),\n dataEmitted: makeBitMapDescriptor(kDataEmitted)\n})\nfunction ReadableState(options, stream, isDuplex) {\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof require('./duplex')\n\n // Bit map field to store ReadableState more effciently with 1 bit per field\n // instead of a V8 slot per field.\n this.state = kEmitClose | kAutoDestroy | kConstructed | kSync\n // Object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away.\n if (options && options.objectMode) this.state |= kObjectMode\n if (isDuplex && options && options.readableObjectMode) this.state |= kObjectMode\n\n // The point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n this.highWaterMark = options\n ? getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex)\n : getDefaultHighWaterMark(false)\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift().\n this.buffer = new BufferList()\n this.length = 0\n this.pipes = []\n this.flowing = null\n this[kPaused] = null\n\n // Should close be emitted on destroy. Defaults to true.\n if (options && options.emitClose === false) this.state &= ~kEmitClose\n\n // Should .destroy() be called after 'end' (and potentially 'finish').\n if (options && options.autoDestroy === false) this.state &= ~kAutoDestroy\n\n // Indicates whether the stream has errored. When true no further\n // _read calls, 'data' or 'readable' events should occur. This is needed\n // since when autoDestroy is disabled we need a way to tell whether the\n // stream has failed.\n this.errored = null\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = (options && options.defaultEncoding) || 'utf8'\n\n // Ref the piped dest which we need a drain event on it\n // type: null | Writable | Set.\n this.awaitDrainWriters = null\n this.decoder = null\n this.encoding = null\n if (options && options.encoding) {\n this.decoder = new StringDecoder(options.encoding)\n this.encoding = options.encoding\n }\n}\nfunction Readable(options) {\n if (!(this instanceof Readable)) return new Readable(options)\n\n // Checking for a Stream.Duplex instance is faster here instead of inside\n // the ReadableState constructor, at least with V8 6.5.\n const isDuplex = this instanceof require('./duplex')\n this._readableState = new ReadableState(options, this, isDuplex)\n if (options) {\n if (typeof options.read === 'function') this._read = options.read\n if (typeof options.destroy === 'function') this._destroy = options.destroy\n if (typeof options.construct === 'function') this._construct = options.construct\n if (options.signal && !isDuplex) addAbortSignal(options.signal, this)\n }\n Stream.call(this, options)\n destroyImpl.construct(this, () => {\n if (this._readableState.needReadable) {\n maybeReadMore(this, this._readableState)\n }\n })\n}\nReadable.prototype.destroy = destroyImpl.destroy\nReadable.prototype._undestroy = destroyImpl.undestroy\nReadable.prototype._destroy = function (err, cb) {\n cb(err)\n}\nReadable.prototype[EE.captureRejectionSymbol] = function (err) {\n this.destroy(err)\n}\nReadable.prototype[SymbolAsyncDispose] = function () {\n let error\n if (!this.destroyed) {\n error = this.readableEnded ? null : new AbortError()\n this.destroy(error)\n }\n return new Promise((resolve, reject) => eos(this, (err) => (err && err !== error ? reject(err) : resolve(null))))\n}\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n return readableAddChunk(this, chunk, encoding, false)\n}\n\n// Unshift should *always* be something directly out of read().\nReadable.prototype.unshift = function (chunk, encoding) {\n return readableAddChunk(this, chunk, encoding, true)\n}\nfunction readableAddChunk(stream, chunk, encoding, addToFront) {\n debug('readableAddChunk', chunk)\n const state = stream._readableState\n let err\n if ((state.state & kObjectMode) === 0) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding\n if (state.encoding !== encoding) {\n if (addToFront && state.encoding) {\n // When unshifting, if state.encoding is set, we have to save\n // the string in the BufferList with the state encoding.\n chunk = Buffer.from(chunk, encoding).toString(state.encoding)\n } else {\n chunk = Buffer.from(chunk, encoding)\n encoding = ''\n }\n }\n } else if (chunk instanceof Buffer) {\n encoding = ''\n } else if (Stream._isUint8Array(chunk)) {\n chunk = Stream._uint8ArrayToBuffer(chunk)\n encoding = ''\n } else if (chunk != null) {\n err = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk)\n }\n }\n if (err) {\n errorOrDestroy(stream, err)\n } else if (chunk === null) {\n state.state &= ~kReading\n onEofChunk(stream, state)\n } else if ((state.state & kObjectMode) !== 0 || (chunk && chunk.length > 0)) {\n if (addToFront) {\n if ((state.state & kEndEmitted) !== 0) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT())\n else if (state.destroyed || state.errored) return false\n else addChunk(stream, state, chunk, true)\n } else if (state.ended) {\n errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF())\n } else if (state.destroyed || state.errored) {\n return false\n } else {\n state.state &= ~kReading\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk)\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false)\n else maybeReadMore(stream, state)\n } else {\n addChunk(stream, state, chunk, false)\n }\n }\n } else if (!addToFront) {\n state.state &= ~kReading\n maybeReadMore(stream, state)\n }\n\n // We can push more data if we are below the highWaterMark.\n // Also, if we have no data yet, we can stand some more bytes.\n // This is to work around cases where hwm=0, such as the repl.\n return !state.ended && (state.length < state.highWaterMark || state.length === 0)\n}\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync && stream.listenerCount('data') > 0) {\n // Use the guard to avoid creating `Set()` repeatedly\n // when we have multiple pipes.\n if ((state.state & kMultiAwaitDrain) !== 0) {\n state.awaitDrainWriters.clear()\n } else {\n state.awaitDrainWriters = null\n }\n state.dataEmitted = true\n stream.emit('data', chunk)\n } else {\n // Update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length\n if (addToFront) state.buffer.unshift(chunk)\n else state.buffer.push(chunk)\n if ((state.state & kNeedReadable) !== 0) emitReadable(stream)\n }\n maybeReadMore(stream, state)\n}\nReadable.prototype.isPaused = function () {\n const state = this._readableState\n return state[kPaused] === true || state.flowing === false\n}\n\n// Backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n const decoder = new StringDecoder(enc)\n this._readableState.decoder = decoder\n // If setEncoding(null), decoder.encoding equals utf8.\n this._readableState.encoding = this._readableState.decoder.encoding\n const buffer = this._readableState.buffer\n // Iterate over current buffer to convert already stored Buffers:\n let content = ''\n for (const data of buffer) {\n content += decoder.write(data)\n }\n buffer.clear()\n if (content !== '') buffer.push(content)\n this._readableState.length = content.length\n return this\n}\n\n// Don't raise the hwm > 1GB.\nconst MAX_HWM = 0x40000000\nfunction computeNewHighWaterMark(n) {\n if (n > MAX_HWM) {\n throw new ERR_OUT_OF_RANGE('size', '<= 1GiB', n)\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts.\n n--\n n |= n >>> 1\n n |= n >>> 2\n n |= n >>> 4\n n |= n >>> 8\n n |= n >>> 16\n n++\n }\n return n\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || (state.length === 0 && state.ended)) return 0\n if ((state.state & kObjectMode) !== 0) return 1\n if (NumberIsNaN(n)) {\n // Only flow one buffer at a time.\n if (state.flowing && state.length) return state.buffer.first().length\n return state.length\n }\n if (n <= state.length) return n\n return state.ended ? state.length : 0\n}\n\n// You can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n)\n // Same as parseInt(undefined, 10), however V8 7.3 performance regressed\n // in this scenario, so we are doing it manually.\n if (n === undefined) {\n n = NaN\n } else if (!NumberIsInteger(n)) {\n n = NumberParseInt(n, 10)\n }\n const state = this._readableState\n const nOrig = n\n\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n)\n if (n !== 0) state.state &= ~kEmittedReadable\n\n // If we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (\n n === 0 &&\n state.needReadable &&\n ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)\n ) {\n debug('read: emitReadable', state.length, state.ended)\n if (state.length === 0 && state.ended) endReadable(this)\n else emitReadable(this)\n return null\n }\n n = howMuchToRead(n, state)\n\n // If we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this)\n return null\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n let doRead = (state.state & kNeedReadable) !== 0\n debug('need readable', doRead)\n\n // If we currently have less than the highWaterMark, then also read some.\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true\n debug('length less than watermark', doRead)\n }\n\n // However, if we've ended, then there's no point, if we're already\n // reading, then it's unnecessary, if we're constructing we have to wait,\n // and if we're destroyed or errored, then it's not allowed,\n if (state.ended || state.reading || state.destroyed || state.errored || !state.constructed) {\n doRead = false\n debug('reading, ended or constructing', doRead)\n } else if (doRead) {\n debug('do read')\n state.state |= kReading | kSync\n // If the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.state |= kNeedReadable\n\n // Call internal read method\n try {\n this._read(state.highWaterMark)\n } catch (err) {\n errorOrDestroy(this, err)\n }\n state.state &= ~kSync\n\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state)\n }\n let ret\n if (n > 0) ret = fromList(n, state)\n else ret = null\n if (ret === null) {\n state.needReadable = state.length <= state.highWaterMark\n n = 0\n } else {\n state.length -= n\n if (state.multiAwaitDrain) {\n state.awaitDrainWriters.clear()\n } else {\n state.awaitDrainWriters = null\n }\n }\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this)\n }\n if (ret !== null && !state.errorEmitted && !state.closeEmitted) {\n state.dataEmitted = true\n this.emit('data', ret)\n }\n return ret\n}\nfunction onEofChunk(stream, state) {\n debug('onEofChunk')\n if (state.ended) return\n if (state.decoder) {\n const chunk = state.decoder.end()\n if (chunk && chunk.length) {\n state.buffer.push(chunk)\n state.length += state.objectMode ? 1 : chunk.length\n }\n }\n state.ended = true\n if (state.sync) {\n // If we are sync, wait until next tick to emit the data.\n // Otherwise we risk emitting data in the flow()\n // the readable code triggers during a read() call.\n emitReadable(stream)\n } else {\n // Emit 'readable' now to make sure it gets picked up.\n state.needReadable = false\n state.emittedReadable = true\n // We have to emit readable now that we are EOF. Modules\n // in the ecosystem (e.g. dicer) rely on this event being sync.\n emitReadable_(stream)\n }\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n const state = stream._readableState\n debug('emitReadable', state.needReadable, state.emittedReadable)\n state.needReadable = false\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing)\n state.emittedReadable = true\n process.nextTick(emitReadable_, stream)\n }\n}\nfunction emitReadable_(stream) {\n const state = stream._readableState\n debug('emitReadable_', state.destroyed, state.length, state.ended)\n if (!state.destroyed && !state.errored && (state.length || state.ended)) {\n stream.emit('readable')\n state.emittedReadable = false\n }\n\n // The stream needs another readable event if:\n // 1. It is not flowing, as the flow mechanism will take\n // care of it.\n // 2. It is not ended.\n // 3. It is below the highWaterMark, so we can schedule\n // another readable later.\n state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark\n flow(stream)\n}\n\n// At this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore && state.constructed) {\n state.readingMore = true\n process.nextTick(maybeReadMore_, stream, state)\n }\n}\nfunction maybeReadMore_(stream, state) {\n // Attempt to read more data if we should.\n //\n // The conditions for reading more data are (one of):\n // - Not enough data buffered (state.length < state.highWaterMark). The loop\n // is responsible for filling the buffer with enough data if such data\n // is available. If highWaterMark is 0 and we are not in the flowing mode\n // we should _not_ attempt to buffer any extra data. We'll get more data\n // when the stream consumer calls read() instead.\n // - No data in the buffer, and the stream is in flowing mode. In this mode\n // the loop below is responsible for ensuring read() is called. Failing to\n // call read here would abort the flow and there's no other mechanism for\n // continuing the flow if the stream consumer has just subscribed to the\n // 'data' event.\n //\n // In addition to the above conditions to keep reading data, the following\n // conditions prevent the data from being read:\n // - The stream has ended (state.ended).\n // - There is already a pending 'read' operation (state.reading). This is a\n // case where the stream has called the implementation defined _read()\n // method, but they are processing the call asynchronously and have _not_\n // called push() with new data. In this case we skip performing more\n // read()s. The execution ends in this method again after the _read() ends\n // up calling push() with more data.\n while (\n !state.reading &&\n !state.ended &&\n (state.length < state.highWaterMark || (state.flowing && state.length === 0))\n ) {\n const len = state.length\n debug('maybeReadMore read 0')\n stream.read(0)\n if (len === state.length)\n // Didn't get any data, stop spinning.\n break\n }\n state.readingMore = false\n}\n\n// Abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n throw new ERR_METHOD_NOT_IMPLEMENTED('_read()')\n}\nReadable.prototype.pipe = function (dest, pipeOpts) {\n const src = this\n const state = this._readableState\n if (state.pipes.length === 1) {\n if (!state.multiAwaitDrain) {\n state.multiAwaitDrain = true\n state.awaitDrainWriters = new SafeSet(state.awaitDrainWriters ? [state.awaitDrainWriters] : [])\n }\n }\n state.pipes.push(dest)\n debug('pipe count=%d opts=%j', state.pipes.length, pipeOpts)\n const doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr\n const endFn = doEnd ? onend : unpipe\n if (state.endEmitted) process.nextTick(endFn)\n else src.once('end', endFn)\n dest.on('unpipe', onunpipe)\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe')\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true\n cleanup()\n }\n }\n }\n function onend() {\n debug('onend')\n dest.end()\n }\n let ondrain\n let cleanedUp = false\n function cleanup() {\n debug('cleanup')\n // Cleanup event handlers once the pipe is broken.\n dest.removeListener('close', onclose)\n dest.removeListener('finish', onfinish)\n if (ondrain) {\n dest.removeListener('drain', ondrain)\n }\n dest.removeListener('error', onerror)\n dest.removeListener('unpipe', onunpipe)\n src.removeListener('end', onend)\n src.removeListener('end', unpipe)\n src.removeListener('data', ondata)\n cleanedUp = true\n\n // If the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (ondrain && state.awaitDrainWriters && (!dest._writableState || dest._writableState.needDrain)) ondrain()\n }\n function pause() {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if (!cleanedUp) {\n if (state.pipes.length === 1 && state.pipes[0] === dest) {\n debug('false write response, pause', 0)\n state.awaitDrainWriters = dest\n state.multiAwaitDrain = false\n } else if (state.pipes.length > 1 && state.pipes.includes(dest)) {\n debug('false write response, pause', state.awaitDrainWriters.size)\n state.awaitDrainWriters.add(dest)\n }\n src.pause()\n }\n if (!ondrain) {\n // When the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n ondrain = pipeOnDrain(src, dest)\n dest.on('drain', ondrain)\n }\n }\n src.on('data', ondata)\n function ondata(chunk) {\n debug('ondata')\n const ret = dest.write(chunk)\n debug('dest.write', ret)\n if (ret === false) {\n pause()\n }\n }\n\n // If the dest has an error, then stop piping into it.\n // However, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er)\n unpipe()\n dest.removeListener('error', onerror)\n if (dest.listenerCount('error') === 0) {\n const s = dest._writableState || dest._readableState\n if (s && !s.errorEmitted) {\n // User incorrectly emitted 'error' directly on the stream.\n errorOrDestroy(dest, er)\n } else {\n dest.emit('error', er)\n }\n }\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror)\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish)\n unpipe()\n }\n dest.once('close', onclose)\n function onfinish() {\n debug('onfinish')\n dest.removeListener('close', onclose)\n unpipe()\n }\n dest.once('finish', onfinish)\n function unpipe() {\n debug('unpipe')\n src.unpipe(dest)\n }\n\n // Tell the dest that it's being piped to.\n dest.emit('pipe', src)\n\n // Start the flow if it hasn't been started already.\n\n if (dest.writableNeedDrain === true) {\n pause()\n } else if (!state.flowing) {\n debug('pipe resume')\n src.resume()\n }\n return dest\n}\nfunction pipeOnDrain(src, dest) {\n return function pipeOnDrainFunctionResult() {\n const state = src._readableState\n\n // `ondrain` will call directly,\n // `this` maybe not a reference to dest,\n // so we use the real dest here.\n if (state.awaitDrainWriters === dest) {\n debug('pipeOnDrain', 1)\n state.awaitDrainWriters = null\n } else if (state.multiAwaitDrain) {\n debug('pipeOnDrain', state.awaitDrainWriters.size)\n state.awaitDrainWriters.delete(dest)\n }\n if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) && src.listenerCount('data')) {\n src.resume()\n }\n }\n}\nReadable.prototype.unpipe = function (dest) {\n const state = this._readableState\n const unpipeInfo = {\n hasUnpiped: false\n }\n\n // If we're not piping anywhere, then do nothing.\n if (state.pipes.length === 0) return this\n if (!dest) {\n // remove all.\n const dests = state.pipes\n state.pipes = []\n this.pause()\n for (let i = 0; i < dests.length; i++)\n dests[i].emit('unpipe', this, {\n hasUnpiped: false\n })\n return this\n }\n\n // Try to find the right one.\n const index = ArrayPrototypeIndexOf(state.pipes, dest)\n if (index === -1) return this\n state.pipes.splice(index, 1)\n if (state.pipes.length === 0) this.pause()\n dest.emit('unpipe', this, unpipeInfo)\n return this\n}\n\n// Set up data events if they are asked for\n// Ensure readable listeners eventually get something.\nReadable.prototype.on = function (ev, fn) {\n const res = Stream.prototype.on.call(this, ev, fn)\n const state = this._readableState\n if (ev === 'data') {\n // Update readableListening so that resume() may be a no-op\n // a few lines down. This is needed to support once('readable').\n state.readableListening = this.listenerCount('readable') > 0\n\n // Try start flowing on next tick if stream isn't explicitly paused.\n if (state.flowing !== false) this.resume()\n } else if (ev === 'readable') {\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true\n state.flowing = false\n state.emittedReadable = false\n debug('on readable', state.length, state.reading)\n if (state.length) {\n emitReadable(this)\n } else if (!state.reading) {\n process.nextTick(nReadingNextTick, this)\n }\n }\n }\n return res\n}\nReadable.prototype.addListener = Readable.prototype.on\nReadable.prototype.removeListener = function (ev, fn) {\n const res = Stream.prototype.removeListener.call(this, ev, fn)\n if (ev === 'readable') {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this)\n }\n return res\n}\nReadable.prototype.off = Readable.prototype.removeListener\nReadable.prototype.removeAllListeners = function (ev) {\n const res = Stream.prototype.removeAllListeners.apply(this, arguments)\n if (ev === 'readable' || ev === undefined) {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this)\n }\n return res\n}\nfunction updateReadableListening(self) {\n const state = self._readableState\n state.readableListening = self.listenerCount('readable') > 0\n if (state.resumeScheduled && state[kPaused] === false) {\n // Flowing needs to be set to true now, otherwise\n // the upcoming resume will not flow.\n state.flowing = true\n\n // Crude way to check if we should resume.\n } else if (self.listenerCount('data') > 0) {\n self.resume()\n } else if (!state.readableListening) {\n state.flowing = null\n }\n}\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0')\n self.read(0)\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n const state = this._readableState\n if (!state.flowing) {\n debug('resume')\n // We flow only if there is no one listening\n // for readable, but we still have to call\n // resume().\n state.flowing = !state.readableListening\n resume(this, state)\n }\n state[kPaused] = false\n return this\n}\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true\n process.nextTick(resume_, stream, state)\n }\n}\nfunction resume_(stream, state) {\n debug('resume', state.reading)\n if (!state.reading) {\n stream.read(0)\n }\n state.resumeScheduled = false\n stream.emit('resume')\n flow(stream)\n if (state.flowing && !state.reading) stream.read(0)\n}\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing)\n if (this._readableState.flowing !== false) {\n debug('pause')\n this._readableState.flowing = false\n this.emit('pause')\n }\n this._readableState[kPaused] = true\n return this\n}\nfunction flow(stream) {\n const state = stream._readableState\n debug('flow', state.flowing)\n while (state.flowing && stream.read() !== null);\n}\n\n// Wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n let paused = false\n\n // TODO (ronag): Should this.destroy(err) emit\n // 'error' on the wrapped stream? Would require\n // a static factory method, e.g. Readable.wrap(stream).\n\n stream.on('data', (chunk) => {\n if (!this.push(chunk) && stream.pause) {\n paused = true\n stream.pause()\n }\n })\n stream.on('end', () => {\n this.push(null)\n })\n stream.on('error', (err) => {\n errorOrDestroy(this, err)\n })\n stream.on('close', () => {\n this.destroy()\n })\n stream.on('destroy', () => {\n this.destroy()\n })\n this._read = () => {\n if (paused && stream.resume) {\n paused = false\n stream.resume()\n }\n }\n\n // Proxy all the other methods. Important when wrapping filters and duplexes.\n const streamKeys = ObjectKeys(stream)\n for (let j = 1; j < streamKeys.length; j++) {\n const i = streamKeys[j]\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = stream[i].bind(stream)\n }\n }\n return this\n}\nReadable.prototype[SymbolAsyncIterator] = function () {\n return streamToAsyncIterator(this)\n}\nReadable.prototype.iterator = function (options) {\n if (options !== undefined) {\n validateObject(options, 'options')\n }\n return streamToAsyncIterator(this, options)\n}\nfunction streamToAsyncIterator(stream, options) {\n if (typeof stream.read !== 'function') {\n stream = Readable.wrap(stream, {\n objectMode: true\n })\n }\n const iter = createAsyncIterator(stream, options)\n iter.stream = stream\n return iter\n}\nasync function* createAsyncIterator(stream, options) {\n let callback = nop\n function next(resolve) {\n if (this === stream) {\n callback()\n callback = nop\n } else {\n callback = resolve\n }\n }\n stream.on('readable', next)\n let error\n const cleanup = eos(\n stream,\n {\n writable: false\n },\n (err) => {\n error = err ? aggregateTwoErrors(error, err) : null\n callback()\n callback = nop\n }\n )\n try {\n while (true) {\n const chunk = stream.destroyed ? null : stream.read()\n if (chunk !== null) {\n yield chunk\n } else if (error) {\n throw error\n } else if (error === null) {\n return\n } else {\n await new Promise(next)\n }\n }\n } catch (err) {\n error = aggregateTwoErrors(error, err)\n throw error\n } finally {\n if (\n (error || (options === null || options === undefined ? undefined : options.destroyOnReturn) !== false) &&\n (error === undefined || stream._readableState.autoDestroy)\n ) {\n destroyImpl.destroyer(stream, null)\n } else {\n stream.off('readable', next)\n cleanup()\n }\n }\n}\n\n// Making it explicit these properties are not enumerable\n// because otherwise some prototype manipulation in\n// userland will fail.\nObjectDefineProperties(Readable.prototype, {\n readable: {\n __proto__: null,\n get() {\n const r = this._readableState\n // r.readable === false means that this is part of a Duplex stream\n // where the readable side was disabled upon construction.\n // Compat. The user might manually disable readable side through\n // deprecated setter.\n return !!r && r.readable !== false && !r.destroyed && !r.errorEmitted && !r.endEmitted\n },\n set(val) {\n // Backwards compat.\n if (this._readableState) {\n this._readableState.readable = !!val\n }\n }\n },\n readableDidRead: {\n __proto__: null,\n enumerable: false,\n get: function () {\n return this._readableState.dataEmitted\n }\n },\n readableAborted: {\n __proto__: null,\n enumerable: false,\n get: function () {\n return !!(\n this._readableState.readable !== false &&\n (this._readableState.destroyed || this._readableState.errored) &&\n !this._readableState.endEmitted\n )\n }\n },\n readableHighWaterMark: {\n __proto__: null,\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark\n }\n },\n readableBuffer: {\n __proto__: null,\n enumerable: false,\n get: function () {\n return this._readableState && this._readableState.buffer\n }\n },\n readableFlowing: {\n __proto__: null,\n enumerable: false,\n get: function () {\n return this._readableState.flowing\n },\n set: function (state) {\n if (this._readableState) {\n this._readableState.flowing = state\n }\n }\n },\n readableLength: {\n __proto__: null,\n enumerable: false,\n get() {\n return this._readableState.length\n }\n },\n readableObjectMode: {\n __proto__: null,\n enumerable: false,\n get() {\n return this._readableState ? this._readableState.objectMode : false\n }\n },\n readableEncoding: {\n __proto__: null,\n enumerable: false,\n get() {\n return this._readableState ? this._readableState.encoding : null\n }\n },\n errored: {\n __proto__: null,\n enumerable: false,\n get() {\n return this._readableState ? this._readableState.errored : null\n }\n },\n closed: {\n __proto__: null,\n get() {\n return this._readableState ? this._readableState.closed : false\n }\n },\n destroyed: {\n __proto__: null,\n enumerable: false,\n get() {\n return this._readableState ? this._readableState.destroyed : false\n },\n set(value) {\n // We ignore the value if the stream\n // has not been initialized yet.\n if (!this._readableState) {\n return\n }\n\n // Backward compatibility, the user is explicitly\n // managing destroyed.\n this._readableState.destroyed = value\n }\n },\n readableEnded: {\n __proto__: null,\n enumerable: false,\n get() {\n return this._readableState ? this._readableState.endEmitted : false\n }\n }\n})\nObjectDefineProperties(ReadableState.prototype, {\n // Legacy getter for `pipesCount`.\n pipesCount: {\n __proto__: null,\n get() {\n return this.pipes.length\n }\n },\n // Legacy property for `paused`.\n paused: {\n __proto__: null,\n get() {\n return this[kPaused] !== false\n },\n set(value) {\n this[kPaused] = !!value\n }\n }\n})\n\n// Exposed for testing purposes only.\nReadable._fromList = fromList\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered.\n if (state.length === 0) return null\n let ret\n if (state.objectMode) ret = state.buffer.shift()\n else if (!n || n >= state.length) {\n // Read it all, truncate the list.\n if (state.decoder) ret = state.buffer.join('')\n else if (state.buffer.length === 1) ret = state.buffer.first()\n else ret = state.buffer.concat(state.length)\n state.buffer.clear()\n } else {\n // read part of list.\n ret = state.buffer.consume(n, state.decoder)\n }\n return ret\n}\nfunction endReadable(stream) {\n const state = stream._readableState\n debug('endReadable', state.endEmitted)\n if (!state.endEmitted) {\n state.ended = true\n process.nextTick(endReadableNT, state, stream)\n }\n}\nfunction endReadableNT(state, stream) {\n debug('endReadableNT', state.endEmitted, state.length)\n\n // Check that we didn't get one last unshift.\n if (!state.errored && !state.closeEmitted && !state.endEmitted && state.length === 0) {\n state.endEmitted = true\n stream.emit('end')\n if (stream.writable && stream.allowHalfOpen === false) {\n process.nextTick(endWritableNT, stream)\n } else if (state.autoDestroy) {\n // In case of duplex streams we need a way to detect\n // if the writable side is ready for autoDestroy as well.\n const wState = stream._writableState\n const autoDestroy =\n !wState ||\n (wState.autoDestroy &&\n // We don't expect the writable to ever 'finish'\n // if writable is explicitly set to false.\n (wState.finished || wState.writable === false))\n if (autoDestroy) {\n stream.destroy()\n }\n }\n }\n}\nfunction endWritableNT(stream) {\n const writable = stream.writable && !stream.writableEnded && !stream.destroyed\n if (writable) {\n stream.end()\n }\n}\nReadable.from = function (iterable, opts) {\n return from(Readable, iterable, opts)\n}\nlet webStreamsAdapters\n\n// Lazy to avoid circular references\nfunction lazyWebStreams() {\n if (webStreamsAdapters === undefined) webStreamsAdapters = {}\n return webStreamsAdapters\n}\nReadable.fromWeb = function (readableStream, options) {\n return lazyWebStreams().newStreamReadableFromReadableStream(readableStream, options)\n}\nReadable.toWeb = function (streamReadable, options) {\n return lazyWebStreams().newReadableStreamFromStreamReadable(streamReadable, options)\n}\nReadable.wrap = function (src, options) {\n var _ref, _src$readableObjectMo\n return new Readable({\n objectMode:\n (_ref =\n (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== undefined\n ? _src$readableObjectMo\n : src.objectMode) !== null && _ref !== undefined\n ? _ref\n : true,\n ...options,\n destroy(err, callback) {\n destroyImpl.destroyer(src, err)\n callback(err)\n }\n }).wrap(src)\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst {\n ArrayPrototypeSlice,\n Error,\n FunctionPrototypeSymbolHasInstance,\n ObjectDefineProperty,\n ObjectDefineProperties,\n ObjectSetPrototypeOf,\n StringPrototypeToLowerCase,\n Symbol,\n SymbolHasInstance\n} = require('../../ours/primordials')\nmodule.exports = Writable\nWritable.WritableState = WritableState\nconst { EventEmitter: EE } = require('events')\nconst Stream = require('./legacy').Stream\nconst { Buffer } = require('buffer')\nconst destroyImpl = require('./destroy')\nconst { addAbortSignal } = require('./add-abort-signal')\nconst { getHighWaterMark, getDefaultHighWaterMark } = require('./state')\nconst {\n ERR_INVALID_ARG_TYPE,\n ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK,\n ERR_STREAM_CANNOT_PIPE,\n ERR_STREAM_DESTROYED,\n ERR_STREAM_ALREADY_FINISHED,\n ERR_STREAM_NULL_VALUES,\n ERR_STREAM_WRITE_AFTER_END,\n ERR_UNKNOWN_ENCODING\n} = require('../../ours/errors').codes\nconst { errorOrDestroy } = destroyImpl\nObjectSetPrototypeOf(Writable.prototype, Stream.prototype)\nObjectSetPrototypeOf(Writable, Stream)\nfunction nop() {}\nconst kOnFinished = Symbol('kOnFinished')\nfunction WritableState(options, stream, isDuplex) {\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream,\n // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof require('./duplex')\n\n // Object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!(options && options.objectMode)\n if (isDuplex) this.objectMode = this.objectMode || !!(options && options.writableObjectMode)\n\n // The point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write().\n this.highWaterMark = options\n ? getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex)\n : getDefaultHighWaterMark(false)\n\n // if _final has been called.\n this.finalCalled = false\n\n // drain event flag.\n this.needDrain = false\n // At the start of calling end()\n this.ending = false\n // When end() has been called, and returned.\n this.ended = false\n // When 'finish' is emitted.\n this.finished = false\n\n // Has it been destroyed\n this.destroyed = false\n\n // Should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n const noDecode = !!(options && options.decodeStrings === false)\n this.decodeStrings = !noDecode\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = (options && options.defaultEncoding) || 'utf8'\n\n // Not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0\n\n // A flag to see when we're in the middle of a write.\n this.writing = false\n\n // When true all writes will be buffered until .uncork() call.\n this.corked = 0\n\n // A flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true\n\n // A flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false\n\n // The callback that's passed to _write(chunk, cb).\n this.onwrite = onwrite.bind(undefined, stream)\n\n // The callback that the user supplies to write(chunk, encoding, cb).\n this.writecb = null\n\n // The amount that is being written when _write is called.\n this.writelen = 0\n\n // Storage for data passed to the afterWrite() callback in case of\n // synchronous _write() completion.\n this.afterWriteTickInfo = null\n resetBuffer(this)\n\n // Number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted.\n this.pendingcb = 0\n\n // Stream is still being constructed and cannot be\n // destroyed until construction finished or failed.\n // Async construction is opt in, therefore we start as\n // constructed.\n this.constructed = true\n\n // Emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams.\n this.prefinished = false\n\n // True if the error was already emitted and should not be thrown again.\n this.errorEmitted = false\n\n // Should close be emitted on destroy. Defaults to true.\n this.emitClose = !options || options.emitClose !== false\n\n // Should .destroy() be called after 'finish' (and potentially 'end').\n this.autoDestroy = !options || options.autoDestroy !== false\n\n // Indicates whether the stream has errored. When true all write() calls\n // should return false. This is needed since when autoDestroy\n // is disabled we need a way to tell whether the stream has failed.\n this.errored = null\n\n // Indicates whether the stream has finished destroying.\n this.closed = false\n\n // True if close has been emitted or would have been emitted\n // depending on emitClose.\n this.closeEmitted = false\n this[kOnFinished] = []\n}\nfunction resetBuffer(state) {\n state.buffered = []\n state.bufferedIndex = 0\n state.allBuffers = true\n state.allNoop = true\n}\nWritableState.prototype.getBuffer = function getBuffer() {\n return ArrayPrototypeSlice(this.buffered, this.bufferedIndex)\n}\nObjectDefineProperty(WritableState.prototype, 'bufferedRequestCount', {\n __proto__: null,\n get() {\n return this.buffered.length - this.bufferedIndex\n }\n})\nfunction Writable(options) {\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n\n // Checking for a Stream.Duplex instance is faster here instead of inside\n // the WritableState constructor, at least with V8 6.5.\n const isDuplex = this instanceof require('./duplex')\n if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable, this)) return new Writable(options)\n this._writableState = new WritableState(options, this, isDuplex)\n if (options) {\n if (typeof options.write === 'function') this._write = options.write\n if (typeof options.writev === 'function') this._writev = options.writev\n if (typeof options.destroy === 'function') this._destroy = options.destroy\n if (typeof options.final === 'function') this._final = options.final\n if (typeof options.construct === 'function') this._construct = options.construct\n if (options.signal) addAbortSignal(options.signal, this)\n }\n Stream.call(this, options)\n destroyImpl.construct(this, () => {\n const state = this._writableState\n if (!state.writing) {\n clearBuffer(this, state)\n }\n finishMaybe(this, state)\n })\n}\nObjectDefineProperty(Writable, SymbolHasInstance, {\n __proto__: null,\n value: function (object) {\n if (FunctionPrototypeSymbolHasInstance(this, object)) return true\n if (this !== Writable) return false\n return object && object._writableState instanceof WritableState\n }\n})\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE())\n}\nfunction _write(stream, chunk, encoding, cb) {\n const state = stream._writableState\n if (typeof encoding === 'function') {\n cb = encoding\n encoding = state.defaultEncoding\n } else {\n if (!encoding) encoding = state.defaultEncoding\n else if (encoding !== 'buffer' && !Buffer.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding)\n if (typeof cb !== 'function') cb = nop\n }\n if (chunk === null) {\n throw new ERR_STREAM_NULL_VALUES()\n } else if (!state.objectMode) {\n if (typeof chunk === 'string') {\n if (state.decodeStrings !== false) {\n chunk = Buffer.from(chunk, encoding)\n encoding = 'buffer'\n }\n } else if (chunk instanceof Buffer) {\n encoding = 'buffer'\n } else if (Stream._isUint8Array(chunk)) {\n chunk = Stream._uint8ArrayToBuffer(chunk)\n encoding = 'buffer'\n } else {\n throw new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk)\n }\n }\n let err\n if (state.ending) {\n err = new ERR_STREAM_WRITE_AFTER_END()\n } else if (state.destroyed) {\n err = new ERR_STREAM_DESTROYED('write')\n }\n if (err) {\n process.nextTick(cb, err)\n errorOrDestroy(stream, err, true)\n return err\n }\n state.pendingcb++\n return writeOrBuffer(stream, state, chunk, encoding, cb)\n}\nWritable.prototype.write = function (chunk, encoding, cb) {\n return _write(this, chunk, encoding, cb) === true\n}\nWritable.prototype.cork = function () {\n this._writableState.corked++\n}\nWritable.prototype.uncork = function () {\n const state = this._writableState\n if (state.corked) {\n state.corked--\n if (!state.writing) clearBuffer(this, state)\n }\n}\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = StringPrototypeToLowerCase(encoding)\n if (!Buffer.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding)\n this._writableState.defaultEncoding = encoding\n return this\n}\n\n// If we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, chunk, encoding, callback) {\n const len = state.objectMode ? 1 : chunk.length\n state.length += len\n\n // stream._write resets state.length\n const ret = state.length < state.highWaterMark\n // We must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true\n if (state.writing || state.corked || state.errored || !state.constructed) {\n state.buffered.push({\n chunk,\n encoding,\n callback\n })\n if (state.allBuffers && encoding !== 'buffer') {\n state.allBuffers = false\n }\n if (state.allNoop && callback !== nop) {\n state.allNoop = false\n }\n } else {\n state.writelen = len\n state.writecb = callback\n state.writing = true\n state.sync = true\n stream._write(chunk, encoding, state.onwrite)\n state.sync = false\n }\n\n // Return false if errored or destroyed in order to break\n // any synchronous while(stream.write(data)) loops.\n return ret && !state.errored && !state.destroyed\n}\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len\n state.writecb = cb\n state.writing = true\n state.sync = true\n if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'))\n else if (writev) stream._writev(chunk, state.onwrite)\n else stream._write(chunk, encoding, state.onwrite)\n state.sync = false\n}\nfunction onwriteError(stream, state, er, cb) {\n --state.pendingcb\n cb(er)\n // Ensure callbacks are invoked even when autoDestroy is\n // not enabled. Passing `er` here doesn't make sense since\n // it's related to one specific write, not to the buffered\n // writes.\n errorBuffer(state)\n // This can emit error, but error must always follow cb.\n errorOrDestroy(stream, er)\n}\nfunction onwrite(stream, er) {\n const state = stream._writableState\n const sync = state.sync\n const cb = state.writecb\n if (typeof cb !== 'function') {\n errorOrDestroy(stream, new ERR_MULTIPLE_CALLBACK())\n return\n }\n state.writing = false\n state.writecb = null\n state.length -= state.writelen\n state.writelen = 0\n if (er) {\n // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364\n er.stack // eslint-disable-line no-unused-expressions\n\n if (!state.errored) {\n state.errored = er\n }\n\n // In case of duplex streams we need to notify the readable side of the\n // error.\n if (stream._readableState && !stream._readableState.errored) {\n stream._readableState.errored = er\n }\n if (sync) {\n process.nextTick(onwriteError, stream, state, er, cb)\n } else {\n onwriteError(stream, state, er, cb)\n }\n } else {\n if (state.buffered.length > state.bufferedIndex) {\n clearBuffer(stream, state)\n }\n if (sync) {\n // It is a common case that the callback passed to .write() is always\n // the same. In that case, we do not schedule a new nextTick(), but\n // rather just increase a counter, to improve performance and avoid\n // memory allocations.\n if (state.afterWriteTickInfo !== null && state.afterWriteTickInfo.cb === cb) {\n state.afterWriteTickInfo.count++\n } else {\n state.afterWriteTickInfo = {\n count: 1,\n cb,\n stream,\n state\n }\n process.nextTick(afterWriteTick, state.afterWriteTickInfo)\n }\n } else {\n afterWrite(stream, state, 1, cb)\n }\n }\n}\nfunction afterWriteTick({ stream, state, count, cb }) {\n state.afterWriteTickInfo = null\n return afterWrite(stream, state, count, cb)\n}\nfunction afterWrite(stream, state, count, cb) {\n const needDrain = !state.ending && !stream.destroyed && state.length === 0 && state.needDrain\n if (needDrain) {\n state.needDrain = false\n stream.emit('drain')\n }\n while (count-- > 0) {\n state.pendingcb--\n cb()\n }\n if (state.destroyed) {\n errorBuffer(state)\n }\n finishMaybe(stream, state)\n}\n\n// If there's something in the buffer waiting, then invoke callbacks.\nfunction errorBuffer(state) {\n if (state.writing) {\n return\n }\n for (let n = state.bufferedIndex; n < state.buffered.length; ++n) {\n var _state$errored\n const { chunk, callback } = state.buffered[n]\n const len = state.objectMode ? 1 : chunk.length\n state.length -= len\n callback(\n (_state$errored = state.errored) !== null && _state$errored !== undefined\n ? _state$errored\n : new ERR_STREAM_DESTROYED('write')\n )\n }\n const onfinishCallbacks = state[kOnFinished].splice(0)\n for (let i = 0; i < onfinishCallbacks.length; i++) {\n var _state$errored2\n onfinishCallbacks[i](\n (_state$errored2 = state.errored) !== null && _state$errored2 !== undefined\n ? _state$errored2\n : new ERR_STREAM_DESTROYED('end')\n )\n }\n resetBuffer(state)\n}\n\n// If there's something in the buffer waiting, then process it.\nfunction clearBuffer(stream, state) {\n if (state.corked || state.bufferProcessing || state.destroyed || !state.constructed) {\n return\n }\n const { buffered, bufferedIndex, objectMode } = state\n const bufferedLength = buffered.length - bufferedIndex\n if (!bufferedLength) {\n return\n }\n let i = bufferedIndex\n state.bufferProcessing = true\n if (bufferedLength > 1 && stream._writev) {\n state.pendingcb -= bufferedLength - 1\n const callback = state.allNoop\n ? nop\n : (err) => {\n for (let n = i; n < buffered.length; ++n) {\n buffered[n].callback(err)\n }\n }\n // Make a copy of `buffered` if it's going to be used by `callback` above,\n // since `doWrite` will mutate the array.\n const chunks = state.allNoop && i === 0 ? buffered : ArrayPrototypeSlice(buffered, i)\n chunks.allBuffers = state.allBuffers\n doWrite(stream, state, true, state.length, chunks, '', callback)\n resetBuffer(state)\n } else {\n do {\n const { chunk, encoding, callback } = buffered[i]\n buffered[i++] = null\n const len = objectMode ? 1 : chunk.length\n doWrite(stream, state, false, len, chunk, encoding, callback)\n } while (i < buffered.length && !state.writing)\n if (i === buffered.length) {\n resetBuffer(state)\n } else if (i > 256) {\n buffered.splice(0, i)\n state.bufferedIndex = 0\n } else {\n state.bufferedIndex = i\n }\n }\n state.bufferProcessing = false\n}\nWritable.prototype._write = function (chunk, encoding, cb) {\n if (this._writev) {\n this._writev(\n [\n {\n chunk,\n encoding\n }\n ],\n cb\n )\n } else {\n throw new ERR_METHOD_NOT_IMPLEMENTED('_write()')\n }\n}\nWritable.prototype._writev = null\nWritable.prototype.end = function (chunk, encoding, cb) {\n const state = this._writableState\n if (typeof chunk === 'function') {\n cb = chunk\n chunk = null\n encoding = null\n } else if (typeof encoding === 'function') {\n cb = encoding\n encoding = null\n }\n let err\n if (chunk !== null && chunk !== undefined) {\n const ret = _write(this, chunk, encoding)\n if (ret instanceof Error) {\n err = ret\n }\n }\n\n // .end() fully uncorks.\n if (state.corked) {\n state.corked = 1\n this.uncork()\n }\n if (err) {\n // Do nothing...\n } else if (!state.errored && !state.ending) {\n // This is forgiving in terms of unnecessary calls to end() and can hide\n // logic errors. However, usually such errors are harmless and causing a\n // hard error can be disproportionately destructive. It is not always\n // trivial for the user to determine whether end() needs to be called\n // or not.\n\n state.ending = true\n finishMaybe(this, state, true)\n state.ended = true\n } else if (state.finished) {\n err = new ERR_STREAM_ALREADY_FINISHED('end')\n } else if (state.destroyed) {\n err = new ERR_STREAM_DESTROYED('end')\n }\n if (typeof cb === 'function') {\n if (err || state.finished) {\n process.nextTick(cb, err)\n } else {\n state[kOnFinished].push(cb)\n }\n }\n return this\n}\nfunction needFinish(state) {\n return (\n state.ending &&\n !state.destroyed &&\n state.constructed &&\n state.length === 0 &&\n !state.errored &&\n state.buffered.length === 0 &&\n !state.finished &&\n !state.writing &&\n !state.errorEmitted &&\n !state.closeEmitted\n )\n}\nfunction callFinal(stream, state) {\n let called = false\n function onFinish(err) {\n if (called) {\n errorOrDestroy(stream, err !== null && err !== undefined ? err : ERR_MULTIPLE_CALLBACK())\n return\n }\n called = true\n state.pendingcb--\n if (err) {\n const onfinishCallbacks = state[kOnFinished].splice(0)\n for (let i = 0; i < onfinishCallbacks.length; i++) {\n onfinishCallbacks[i](err)\n }\n errorOrDestroy(stream, err, state.sync)\n } else if (needFinish(state)) {\n state.prefinished = true\n stream.emit('prefinish')\n // Backwards compat. Don't check state.sync here.\n // Some streams assume 'finish' will be emitted\n // asynchronously relative to _final callback.\n state.pendingcb++\n process.nextTick(finish, stream, state)\n }\n }\n state.sync = true\n state.pendingcb++\n try {\n stream._final(onFinish)\n } catch (err) {\n onFinish(err)\n }\n state.sync = false\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function' && !state.destroyed) {\n state.finalCalled = true\n callFinal(stream, state)\n } else {\n state.prefinished = true\n stream.emit('prefinish')\n }\n }\n}\nfunction finishMaybe(stream, state, sync) {\n if (needFinish(state)) {\n prefinish(stream, state)\n if (state.pendingcb === 0) {\n if (sync) {\n state.pendingcb++\n process.nextTick(\n (stream, state) => {\n if (needFinish(state)) {\n finish(stream, state)\n } else {\n state.pendingcb--\n }\n },\n stream,\n state\n )\n } else if (needFinish(state)) {\n state.pendingcb++\n finish(stream, state)\n }\n }\n }\n}\nfunction finish(stream, state) {\n state.pendingcb--\n state.finished = true\n const onfinishCallbacks = state[kOnFinished].splice(0)\n for (let i = 0; i < onfinishCallbacks.length; i++) {\n onfinishCallbacks[i]()\n }\n stream.emit('finish')\n if (state.autoDestroy) {\n // In case of duplex streams we need a way to detect\n // if the readable side is ready for autoDestroy as well.\n const rState = stream._readableState\n const autoDestroy =\n !rState ||\n (rState.autoDestroy &&\n // We don't expect the readable to ever 'end'\n // if readable is explicitly set to false.\n (rState.endEmitted || rState.readable === false))\n if (autoDestroy) {\n stream.destroy()\n }\n }\n}\nObjectDefineProperties(Writable.prototype, {\n closed: {\n __proto__: null,\n get() {\n return this._writableState ? this._writableState.closed : false\n }\n },\n destroyed: {\n __proto__: null,\n get() {\n return this._writableState ? this._writableState.destroyed : false\n },\n set(value) {\n // Backward compatibility, the user is explicitly managing destroyed.\n if (this._writableState) {\n this._writableState.destroyed = value\n }\n }\n },\n writable: {\n __proto__: null,\n get() {\n const w = this._writableState\n // w.writable === false means that this is part of a Duplex stream\n // where the writable side was disabled upon construction.\n // Compat. The user might manually disable writable side through\n // deprecated setter.\n return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended\n },\n set(val) {\n // Backwards compatible.\n if (this._writableState) {\n this._writableState.writable = !!val\n }\n }\n },\n writableFinished: {\n __proto__: null,\n get() {\n return this._writableState ? this._writableState.finished : false\n }\n },\n writableObjectMode: {\n __proto__: null,\n get() {\n return this._writableState ? this._writableState.objectMode : false\n }\n },\n writableBuffer: {\n __proto__: null,\n get() {\n return this._writableState && this._writableState.getBuffer()\n }\n },\n writableEnded: {\n __proto__: null,\n get() {\n return this._writableState ? this._writableState.ending : false\n }\n },\n writableNeedDrain: {\n __proto__: null,\n get() {\n const wState = this._writableState\n if (!wState) return false\n return !wState.destroyed && !wState.ending && wState.needDrain\n }\n },\n writableHighWaterMark: {\n __proto__: null,\n get() {\n return this._writableState && this._writableState.highWaterMark\n }\n },\n writableCorked: {\n __proto__: null,\n get() {\n return this._writableState ? this._writableState.corked : 0\n }\n },\n writableLength: {\n __proto__: null,\n get() {\n return this._writableState && this._writableState.length\n }\n },\n errored: {\n __proto__: null,\n enumerable: false,\n get() {\n return this._writableState ? this._writableState.errored : null\n }\n },\n writableAborted: {\n __proto__: null,\n enumerable: false,\n get: function () {\n return !!(\n this._writableState.writable !== false &&\n (this._writableState.destroyed || this._writableState.errored) &&\n !this._writableState.finished\n )\n }\n }\n})\nconst destroy = destroyImpl.destroy\nWritable.prototype.destroy = function (err, cb) {\n const state = this._writableState\n\n // Invoke pending callbacks.\n if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length)) {\n process.nextTick(errorBuffer, state)\n }\n destroy.call(this, err, cb)\n return this\n}\nWritable.prototype._undestroy = destroyImpl.undestroy\nWritable.prototype._destroy = function (err, cb) {\n cb(err)\n}\nWritable.prototype[EE.captureRejectionSymbol] = function (err) {\n this.destroy(err)\n}\nlet webStreamsAdapters\n\n// Lazy to avoid circular references\nfunction lazyWebStreams() {\n if (webStreamsAdapters === undefined) webStreamsAdapters = {}\n return webStreamsAdapters\n}\nWritable.fromWeb = function (writableStream, options) {\n return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options)\n}\nWritable.toWeb = function (streamWritable) {\n return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable)\n}\n","/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\n;('use strict')\nconst bufferModule = require('buffer')\nconst {\n isReadable,\n isWritable,\n isIterable,\n isNodeStream,\n isReadableNodeStream,\n isWritableNodeStream,\n isDuplexNodeStream,\n isReadableStream,\n isWritableStream\n} = require('./utils')\nconst eos = require('./end-of-stream')\nconst {\n AbortError,\n codes: { ERR_INVALID_ARG_TYPE, ERR_INVALID_RETURN_VALUE }\n} = require('../../ours/errors')\nconst { destroyer } = require('./destroy')\nconst Duplex = require('./duplex')\nconst Readable = require('./readable')\nconst Writable = require('./writable')\nconst { createDeferredPromise } = require('../../ours/util')\nconst from = require('./from')\nconst Blob = globalThis.Blob || bufferModule.Blob\nconst isBlob =\n typeof Blob !== 'undefined'\n ? function isBlob(b) {\n return b instanceof Blob\n }\n : function isBlob(b) {\n return false\n }\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nconst { FunctionPrototypeCall } = require('../../ours/primordials')\n\n// This is needed for pre node 17.\nclass Duplexify extends Duplex {\n constructor(options) {\n super(options)\n\n // https://github.com/nodejs/node/pull/34385\n\n if ((options === null || options === undefined ? undefined : options.readable) === false) {\n this._readableState.readable = false\n this._readableState.ended = true\n this._readableState.endEmitted = true\n }\n if ((options === null || options === undefined ? undefined : options.writable) === false) {\n this._writableState.writable = false\n this._writableState.ending = true\n this._writableState.ended = true\n this._writableState.finished = true\n }\n }\n}\nmodule.exports = function duplexify(body, name) {\n if (isDuplexNodeStream(body)) {\n return body\n }\n if (isReadableNodeStream(body)) {\n return _duplexify({\n readable: body\n })\n }\n if (isWritableNodeStream(body)) {\n return _duplexify({\n writable: body\n })\n }\n if (isNodeStream(body)) {\n return _duplexify({\n writable: false,\n readable: false\n })\n }\n if (isReadableStream(body)) {\n return _duplexify({\n readable: Readable.fromWeb(body)\n })\n }\n if (isWritableStream(body)) {\n return _duplexify({\n writable: Writable.fromWeb(body)\n })\n }\n if (typeof body === 'function') {\n const { value, write, final, destroy } = fromAsyncGen(body)\n if (isIterable(value)) {\n return from(Duplexify, value, {\n // TODO (ronag): highWaterMark?\n objectMode: true,\n write,\n final,\n destroy\n })\n }\n const then = value === null || value === undefined ? undefined : value.then\n if (typeof then === 'function') {\n let d\n const promise = FunctionPrototypeCall(\n then,\n value,\n (val) => {\n if (val != null) {\n throw new ERR_INVALID_RETURN_VALUE('nully', 'body', val)\n }\n },\n (err) => {\n destroyer(d, err)\n }\n )\n return (d = new Duplexify({\n // TODO (ronag): highWaterMark?\n objectMode: true,\n readable: false,\n write,\n final(cb) {\n final(async () => {\n try {\n await promise\n process.nextTick(cb, null)\n } catch (err) {\n process.nextTick(cb, err)\n }\n })\n },\n destroy\n }))\n }\n throw new ERR_INVALID_RETURN_VALUE('Iterable, AsyncIterable or AsyncFunction', name, value)\n }\n if (isBlob(body)) {\n return duplexify(body.arrayBuffer())\n }\n if (isIterable(body)) {\n return from(Duplexify, body, {\n // TODO (ronag): highWaterMark?\n objectMode: true,\n writable: false\n })\n }\n if (\n isReadableStream(body === null || body === undefined ? undefined : body.readable) &&\n isWritableStream(body === null || body === undefined ? undefined : body.writable)\n ) {\n return Duplexify.fromWeb(body)\n }\n if (\n typeof (body === null || body === undefined ? undefined : body.writable) === 'object' ||\n typeof (body === null || body === undefined ? undefined : body.readable) === 'object'\n ) {\n const readable =\n body !== null && body !== undefined && body.readable\n ? isReadableNodeStream(body === null || body === undefined ? undefined : body.readable)\n ? body === null || body === undefined\n ? undefined\n : body.readable\n : duplexify(body.readable)\n : undefined\n const writable =\n body !== null && body !== undefined && body.writable\n ? isWritableNodeStream(body === null || body === undefined ? undefined : body.writable)\n ? body === null || body === undefined\n ? undefined\n : body.writable\n : duplexify(body.writable)\n : undefined\n return _duplexify({\n readable,\n writable\n })\n }\n const then = body === null || body === undefined ? undefined : body.then\n if (typeof then === 'function') {\n let d\n FunctionPrototypeCall(\n then,\n body,\n (val) => {\n if (val != null) {\n d.push(val)\n }\n d.push(null)\n },\n (err) => {\n destroyer(d, err)\n }\n )\n return (d = new Duplexify({\n objectMode: true,\n writable: false,\n read() {}\n }))\n }\n throw new ERR_INVALID_ARG_TYPE(\n name,\n [\n 'Blob',\n 'ReadableStream',\n 'WritableStream',\n 'Stream',\n 'Iterable',\n 'AsyncIterable',\n 'Function',\n '{ readable, writable } pair',\n 'Promise'\n ],\n body\n )\n}\nfunction fromAsyncGen(fn) {\n let { promise, resolve } = createDeferredPromise()\n const ac = new AbortController()\n const signal = ac.signal\n const value = fn(\n (async function* () {\n while (true) {\n const _promise = promise\n promise = null\n const { chunk, done, cb } = await _promise\n process.nextTick(cb)\n if (done) return\n if (signal.aborted)\n throw new AbortError(undefined, {\n cause: signal.reason\n })\n ;({ promise, resolve } = createDeferredPromise())\n yield chunk\n }\n })(),\n {\n signal\n }\n )\n return {\n value,\n write(chunk, encoding, cb) {\n const _resolve = resolve\n resolve = null\n _resolve({\n chunk,\n done: false,\n cb\n })\n },\n final(cb) {\n const _resolve = resolve\n resolve = null\n _resolve({\n done: true,\n cb\n })\n },\n destroy(err, cb) {\n ac.abort()\n cb(err)\n }\n }\n}\nfunction _duplexify(pair) {\n const r = pair.readable && typeof pair.readable.read !== 'function' ? Readable.wrap(pair.readable) : pair.readable\n const w = pair.writable\n let readable = !!isReadable(r)\n let writable = !!isWritable(w)\n let ondrain\n let onfinish\n let onreadable\n let onclose\n let d\n function onfinished(err) {\n const cb = onclose\n onclose = null\n if (cb) {\n cb(err)\n } else if (err) {\n d.destroy(err)\n }\n }\n\n // TODO(ronag): Avoid double buffering.\n // Implement Writable/Readable/Duplex traits.\n // See, https://github.com/nodejs/node/pull/33515.\n d = new Duplexify({\n // TODO (ronag): highWaterMark?\n readableObjectMode: !!(r !== null && r !== undefined && r.readableObjectMode),\n writableObjectMode: !!(w !== null && w !== undefined && w.writableObjectMode),\n readable,\n writable\n })\n if (writable) {\n eos(w, (err) => {\n writable = false\n if (err) {\n destroyer(r, err)\n }\n onfinished(err)\n })\n d._write = function (chunk, encoding, callback) {\n if (w.write(chunk, encoding)) {\n callback()\n } else {\n ondrain = callback\n }\n }\n d._final = function (callback) {\n w.end()\n onfinish = callback\n }\n w.on('drain', function () {\n if (ondrain) {\n const cb = ondrain\n ondrain = null\n cb()\n }\n })\n w.on('finish', function () {\n if (onfinish) {\n const cb = onfinish\n onfinish = null\n cb()\n }\n })\n }\n if (readable) {\n eos(r, (err) => {\n readable = false\n if (err) {\n destroyer(r, err)\n }\n onfinished(err)\n })\n r.on('readable', function () {\n if (onreadable) {\n const cb = onreadable\n onreadable = null\n cb()\n }\n })\n r.on('end', function () {\n d.push(null)\n })\n d._read = function () {\n while (true) {\n const buf = r.read()\n if (buf === null) {\n onreadable = d._read\n return\n }\n if (!d.push(buf)) {\n return\n }\n }\n }\n }\n d._destroy = function (err, callback) {\n if (!err && onclose !== null) {\n err = new AbortError()\n }\n onreadable = null\n ondrain = null\n onfinish = null\n if (onclose === null) {\n callback(err)\n } else {\n onclose = callback\n destroyer(w, err)\n destroyer(r, err)\n }\n }\n return d\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototype inheritance, this class\n// prototypically inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict'\n\nconst {\n ObjectDefineProperties,\n ObjectGetOwnPropertyDescriptor,\n ObjectKeys,\n ObjectSetPrototypeOf\n} = require('../../ours/primordials')\nmodule.exports = Duplex\nconst Readable = require('./readable')\nconst Writable = require('./writable')\nObjectSetPrototypeOf(Duplex.prototype, Readable.prototype)\nObjectSetPrototypeOf(Duplex, Readable)\n{\n const keys = ObjectKeys(Writable.prototype)\n // Allow the keys array to be GC'ed.\n for (let i = 0; i < keys.length; i++) {\n const method = keys[i]\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]\n }\n}\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options)\n Readable.call(this, options)\n Writable.call(this, options)\n if (options) {\n this.allowHalfOpen = options.allowHalfOpen !== false\n if (options.readable === false) {\n this._readableState.readable = false\n this._readableState.ended = true\n this._readableState.endEmitted = true\n }\n if (options.writable === false) {\n this._writableState.writable = false\n this._writableState.ending = true\n this._writableState.ended = true\n this._writableState.finished = true\n }\n } else {\n this.allowHalfOpen = true\n }\n}\nObjectDefineProperties(Duplex.prototype, {\n writable: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writable')\n },\n writableHighWaterMark: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableHighWaterMark')\n },\n writableObjectMode: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableObjectMode')\n },\n writableBuffer: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableBuffer')\n },\n writableLength: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableLength')\n },\n writableFinished: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableFinished')\n },\n writableCorked: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableCorked')\n },\n writableEnded: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableEnded')\n },\n writableNeedDrain: {\n __proto__: null,\n ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableNeedDrain')\n },\n destroyed: {\n __proto__: null,\n get() {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false\n }\n return this._readableState.destroyed && this._writableState.destroyed\n },\n set(value) {\n // Backward compatibility, the user is explicitly\n // managing destroyed.\n if (this._readableState && this._writableState) {\n this._readableState.destroyed = value\n this._writableState.destroyed = value\n }\n }\n }\n})\nlet webStreamsAdapters\n\n// Lazy to avoid circular references\nfunction lazyWebStreams() {\n if (webStreamsAdapters === undefined) webStreamsAdapters = {}\n return webStreamsAdapters\n}\nDuplex.fromWeb = function (pair, options) {\n return lazyWebStreams().newStreamDuplexFromReadableWritablePair(pair, options)\n}\nDuplex.toWeb = function (duplex) {\n return lazyWebStreams().newReadableWritablePairFromDuplex(duplex)\n}\nlet duplexify\nDuplex.from = function (body) {\n if (!duplexify) {\n duplexify = require('./duplexify')\n }\n return duplexify(body, 'body')\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict'\n\nconst { ObjectSetPrototypeOf, Symbol } = require('../../ours/primordials')\nmodule.exports = Transform\nconst { ERR_METHOD_NOT_IMPLEMENTED } = require('../../ours/errors').codes\nconst Duplex = require('./duplex')\nconst { getHighWaterMark } = require('./state')\nObjectSetPrototypeOf(Transform.prototype, Duplex.prototype)\nObjectSetPrototypeOf(Transform, Duplex)\nconst kCallback = Symbol('kCallback')\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options)\n\n // TODO (ronag): This should preferably always be\n // applied but would be semver-major. Or even better;\n // make Transform a Readable with the Writable interface.\n const readableHighWaterMark = options ? getHighWaterMark(this, options, 'readableHighWaterMark', true) : null\n if (readableHighWaterMark === 0) {\n // A Duplex will buffer both on the writable and readable side while\n // a Transform just wants to buffer hwm number of elements. To avoid\n // buffering twice we disable buffering on the writable side.\n options = {\n ...options,\n highWaterMark: null,\n readableHighWaterMark,\n // TODO (ronag): 0 is not optimal since we have\n // a \"bug\" where we check needDrain before calling _write and not after.\n // Refs: https://github.com/nodejs/node/pull/32887\n // Refs: https://github.com/nodejs/node/pull/35941\n writableHighWaterMark: options.writableHighWaterMark || 0\n }\n }\n Duplex.call(this, options)\n\n // We have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false\n this[kCallback] = null\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform\n if (typeof options.flush === 'function') this._flush = options.flush\n }\n\n // When the writable side finishes, then flush out anything remaining.\n // Backwards compat. Some Transform streams incorrectly implement _final\n // instead of or in addition to _flush. By using 'prefinish' instead of\n // implementing _final we continue supporting this unfortunate use case.\n this.on('prefinish', prefinish)\n}\nfunction final(cb) {\n if (typeof this._flush === 'function' && !this.destroyed) {\n this._flush((er, data) => {\n if (er) {\n if (cb) {\n cb(er)\n } else {\n this.destroy(er)\n }\n return\n }\n if (data != null) {\n this.push(data)\n }\n this.push(null)\n if (cb) {\n cb()\n }\n })\n } else {\n this.push(null)\n if (cb) {\n cb()\n }\n }\n}\nfunction prefinish() {\n if (this._final !== final) {\n final.call(this)\n }\n}\nTransform.prototype._final = final\nTransform.prototype._transform = function (chunk, encoding, callback) {\n throw new ERR_METHOD_NOT_IMPLEMENTED('_transform()')\n}\nTransform.prototype._write = function (chunk, encoding, callback) {\n const rState = this._readableState\n const wState = this._writableState\n const length = rState.length\n this._transform(chunk, encoding, (err, val) => {\n if (err) {\n callback(err)\n return\n }\n if (val != null) {\n this.push(val)\n }\n if (\n wState.ended ||\n // Backwards compat.\n length === rState.length ||\n // Backwards compat.\n rState.length < rState.highWaterMark\n ) {\n callback()\n } else {\n this[kCallback] = callback\n }\n })\n}\nTransform.prototype._read = function () {\n if (this[kCallback]) {\n const callback = this[kCallback]\n this[kCallback] = null\n callback()\n }\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict'\n\nconst { ObjectSetPrototypeOf } = require('../../ours/primordials')\nmodule.exports = PassThrough\nconst Transform = require('./transform')\nObjectSetPrototypeOf(PassThrough.prototype, Transform.prototype)\nObjectSetPrototypeOf(PassThrough, Transform)\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options)\n Transform.call(this, options)\n}\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk)\n}\n","/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n// Ported from https://github.com/mafintosh/pump with\n// permission from the author, Mathias Buus (@mafintosh).\n\n;('use strict')\nconst { ArrayIsArray, Promise, SymbolAsyncIterator, SymbolDispose } = require('../../ours/primordials')\nconst eos = require('./end-of-stream')\nconst { once } = require('../../ours/util')\nconst destroyImpl = require('./destroy')\nconst Duplex = require('./duplex')\nconst {\n aggregateTwoErrors,\n codes: {\n ERR_INVALID_ARG_TYPE,\n ERR_INVALID_RETURN_VALUE,\n ERR_MISSING_ARGS,\n ERR_STREAM_DESTROYED,\n ERR_STREAM_PREMATURE_CLOSE\n },\n AbortError\n} = require('../../ours/errors')\nconst { validateFunction, validateAbortSignal } = require('../validators')\nconst {\n isIterable,\n isReadable,\n isReadableNodeStream,\n isNodeStream,\n isTransformStream,\n isWebStream,\n isReadableStream,\n isReadableFinished\n} = require('./utils')\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nlet PassThrough\nlet Readable\nlet addAbortListener\nfunction destroyer(stream, reading, writing) {\n let finished = false\n stream.on('close', () => {\n finished = true\n })\n const cleanup = eos(\n stream,\n {\n readable: reading,\n writable: writing\n },\n (err) => {\n finished = !err\n }\n )\n return {\n destroy: (err) => {\n if (finished) return\n finished = true\n destroyImpl.destroyer(stream, err || new ERR_STREAM_DESTROYED('pipe'))\n },\n cleanup\n }\n}\nfunction popCallback(streams) {\n // Streams should never be an empty array. It should always contain at least\n // a single stream. Therefore optimize for the average case instead of\n // checking for length === 0 as well.\n validateFunction(streams[streams.length - 1], 'streams[stream.length - 1]')\n return streams.pop()\n}\nfunction makeAsyncIterable(val) {\n if (isIterable(val)) {\n return val\n } else if (isReadableNodeStream(val)) {\n // Legacy streams are not Iterable.\n return fromReadable(val)\n }\n throw new ERR_INVALID_ARG_TYPE('val', ['Readable', 'Iterable', 'AsyncIterable'], val)\n}\nasync function* fromReadable(val) {\n if (!Readable) {\n Readable = require('./readable')\n }\n yield* Readable.prototype[SymbolAsyncIterator].call(val)\n}\nasync function pumpToNode(iterable, writable, finish, { end }) {\n let error\n let onresolve = null\n const resume = (err) => {\n if (err) {\n error = err\n }\n if (onresolve) {\n const callback = onresolve\n onresolve = null\n callback()\n }\n }\n const wait = () =>\n new Promise((resolve, reject) => {\n if (error) {\n reject(error)\n } else {\n onresolve = () => {\n if (error) {\n reject(error)\n } else {\n resolve()\n }\n }\n }\n })\n writable.on('drain', resume)\n const cleanup = eos(\n writable,\n {\n readable: false\n },\n resume\n )\n try {\n if (writable.writableNeedDrain) {\n await wait()\n }\n for await (const chunk of iterable) {\n if (!writable.write(chunk)) {\n await wait()\n }\n }\n if (end) {\n writable.end()\n await wait()\n }\n finish()\n } catch (err) {\n finish(error !== err ? aggregateTwoErrors(error, err) : err)\n } finally {\n cleanup()\n writable.off('drain', resume)\n }\n}\nasync function pumpToWeb(readable, writable, finish, { end }) {\n if (isTransformStream(writable)) {\n writable = writable.writable\n }\n // https://streams.spec.whatwg.org/#example-manual-write-with-backpressure\n const writer = writable.getWriter()\n try {\n for await (const chunk of readable) {\n await writer.ready\n writer.write(chunk).catch(() => {})\n }\n await writer.ready\n if (end) {\n await writer.close()\n }\n finish()\n } catch (err) {\n try {\n await writer.abort(err)\n finish(err)\n } catch (err) {\n finish(err)\n }\n }\n}\nfunction pipeline(...streams) {\n return pipelineImpl(streams, once(popCallback(streams)))\n}\nfunction pipelineImpl(streams, callback, opts) {\n if (streams.length === 1 && ArrayIsArray(streams[0])) {\n streams = streams[0]\n }\n if (streams.length < 2) {\n throw new ERR_MISSING_ARGS('streams')\n }\n const ac = new AbortController()\n const signal = ac.signal\n const outerSignal = opts === null || opts === undefined ? undefined : opts.signal\n\n // Need to cleanup event listeners if last stream is readable\n // https://github.com/nodejs/node/issues/35452\n const lastStreamCleanup = []\n validateAbortSignal(outerSignal, 'options.signal')\n function abort() {\n finishImpl(new AbortError())\n }\n addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n let disposable\n if (outerSignal) {\n disposable = addAbortListener(outerSignal, abort)\n }\n let error\n let value\n const destroys = []\n let finishCount = 0\n function finish(err) {\n finishImpl(err, --finishCount === 0)\n }\n function finishImpl(err, final) {\n var _disposable\n if (err && (!error || error.code === 'ERR_STREAM_PREMATURE_CLOSE')) {\n error = err\n }\n if (!error && !final) {\n return\n }\n while (destroys.length) {\n destroys.shift()(error)\n }\n ;(_disposable = disposable) === null || _disposable === undefined ? undefined : _disposable[SymbolDispose]()\n ac.abort()\n if (final) {\n if (!error) {\n lastStreamCleanup.forEach((fn) => fn())\n }\n process.nextTick(callback, error, value)\n }\n }\n let ret\n for (let i = 0; i < streams.length; i++) {\n const stream = streams[i]\n const reading = i < streams.length - 1\n const writing = i > 0\n const end = reading || (opts === null || opts === undefined ? undefined : opts.end) !== false\n const isLastStream = i === streams.length - 1\n if (isNodeStream(stream)) {\n if (end) {\n const { destroy, cleanup } = destroyer(stream, reading, writing)\n destroys.push(destroy)\n if (isReadable(stream) && isLastStream) {\n lastStreamCleanup.push(cleanup)\n }\n }\n\n // Catch stream errors that occur after pipe/pump has completed.\n function onError(err) {\n if (err && err.name !== 'AbortError' && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {\n finish(err)\n }\n }\n stream.on('error', onError)\n if (isReadable(stream) && isLastStream) {\n lastStreamCleanup.push(() => {\n stream.removeListener('error', onError)\n })\n }\n }\n if (i === 0) {\n if (typeof stream === 'function') {\n ret = stream({\n signal\n })\n if (!isIterable(ret)) {\n throw new ERR_INVALID_RETURN_VALUE('Iterable, AsyncIterable or Stream', 'source', ret)\n }\n } else if (isIterable(stream) || isReadableNodeStream(stream) || isTransformStream(stream)) {\n ret = stream\n } else {\n ret = Duplex.from(stream)\n }\n } else if (typeof stream === 'function') {\n if (isTransformStream(ret)) {\n var _ret\n ret = makeAsyncIterable((_ret = ret) === null || _ret === undefined ? undefined : _ret.readable)\n } else {\n ret = makeAsyncIterable(ret)\n }\n ret = stream(ret, {\n signal\n })\n if (reading) {\n if (!isIterable(ret, true)) {\n throw new ERR_INVALID_RETURN_VALUE('AsyncIterable', `transform[${i - 1}]`, ret)\n }\n } else {\n var _ret2\n if (!PassThrough) {\n PassThrough = require('./passthrough')\n }\n\n // If the last argument to pipeline is not a stream\n // we must create a proxy stream so that pipeline(...)\n // always returns a stream which can be further\n // composed through `.pipe(stream)`.\n\n const pt = new PassThrough({\n objectMode: true\n })\n\n // Handle Promises/A+ spec, `then` could be a getter that throws on\n // second use.\n const then = (_ret2 = ret) === null || _ret2 === undefined ? undefined : _ret2.then\n if (typeof then === 'function') {\n finishCount++\n then.call(\n ret,\n (val) => {\n value = val\n if (val != null) {\n pt.write(val)\n }\n if (end) {\n pt.end()\n }\n process.nextTick(finish)\n },\n (err) => {\n pt.destroy(err)\n process.nextTick(finish, err)\n }\n )\n } else if (isIterable(ret, true)) {\n finishCount++\n pumpToNode(ret, pt, finish, {\n end\n })\n } else if (isReadableStream(ret) || isTransformStream(ret)) {\n const toRead = ret.readable || ret\n finishCount++\n pumpToNode(toRead, pt, finish, {\n end\n })\n } else {\n throw new ERR_INVALID_RETURN_VALUE('AsyncIterable or Promise', 'destination', ret)\n }\n ret = pt\n const { destroy, cleanup } = destroyer(ret, false, true)\n destroys.push(destroy)\n if (isLastStream) {\n lastStreamCleanup.push(cleanup)\n }\n }\n } else if (isNodeStream(stream)) {\n if (isReadableNodeStream(ret)) {\n finishCount += 2\n const cleanup = pipe(ret, stream, finish, {\n end\n })\n if (isReadable(stream) && isLastStream) {\n lastStreamCleanup.push(cleanup)\n }\n } else if (isTransformStream(ret) || isReadableStream(ret)) {\n const toRead = ret.readable || ret\n finishCount++\n pumpToNode(toRead, stream, finish, {\n end\n })\n } else if (isIterable(ret)) {\n finishCount++\n pumpToNode(ret, stream, finish, {\n end\n })\n } else {\n throw new ERR_INVALID_ARG_TYPE(\n 'val',\n ['Readable', 'Iterable', 'AsyncIterable', 'ReadableStream', 'TransformStream'],\n ret\n )\n }\n ret = stream\n } else if (isWebStream(stream)) {\n if (isReadableNodeStream(ret)) {\n finishCount++\n pumpToWeb(makeAsyncIterable(ret), stream, finish, {\n end\n })\n } else if (isReadableStream(ret) || isIterable(ret)) {\n finishCount++\n pumpToWeb(ret, stream, finish, {\n end\n })\n } else if (isTransformStream(ret)) {\n finishCount++\n pumpToWeb(ret.readable, stream, finish, {\n end\n })\n } else {\n throw new ERR_INVALID_ARG_TYPE(\n 'val',\n ['Readable', 'Iterable', 'AsyncIterable', 'ReadableStream', 'TransformStream'],\n ret\n )\n }\n ret = stream\n } else {\n ret = Duplex.from(stream)\n }\n }\n if (\n (signal !== null && signal !== undefined && signal.aborted) ||\n (outerSignal !== null && outerSignal !== undefined && outerSignal.aborted)\n ) {\n process.nextTick(abort)\n }\n return ret\n}\nfunction pipe(src, dst, finish, { end }) {\n let ended = false\n dst.on('close', () => {\n if (!ended) {\n // Finish if the destination closes before the source has completed.\n finish(new ERR_STREAM_PREMATURE_CLOSE())\n }\n })\n src.pipe(dst, {\n end: false\n }) // If end is true we already will have a listener to end dst.\n\n if (end) {\n // Compat. Before node v10.12.0 stdio used to throw an error so\n // pipe() did/does not end() stdio destinations.\n // Now they allow it but \"secretly\" don't close the underlying fd.\n\n function endFn() {\n ended = true\n dst.end()\n }\n if (isReadableFinished(src)) {\n // End the destination if the source has already ended.\n process.nextTick(endFn)\n } else {\n src.once('end', endFn)\n }\n } else {\n finish()\n }\n eos(\n src,\n {\n readable: true,\n writable: false\n },\n (err) => {\n const rState = src._readableState\n if (\n err &&\n err.code === 'ERR_STREAM_PREMATURE_CLOSE' &&\n rState &&\n rState.ended &&\n !rState.errored &&\n !rState.errorEmitted\n ) {\n // Some readable streams will emit 'close' before 'end'. However, since\n // this is on the readable side 'end' should still be emitted if the\n // stream has been ended and no error emitted. This should be allowed in\n // favor of backwards compatibility. Since the stream is piped to a\n // destination this should not result in any observable difference.\n // We don't need to check if this is a writable premature close since\n // eos will only fail with premature close on the reading side for\n // duplex streams.\n src.once('end', finish).once('error', finish)\n } else {\n finish(err)\n }\n }\n )\n return eos(\n dst,\n {\n readable: false,\n writable: true\n },\n finish\n )\n}\nmodule.exports = {\n pipelineImpl,\n pipeline\n}\n","'use strict'\n\nconst { pipeline } = require('./pipeline')\nconst Duplex = require('./duplex')\nconst { destroyer } = require('./destroy')\nconst {\n isNodeStream,\n isReadable,\n isWritable,\n isWebStream,\n isTransformStream,\n isWritableStream,\n isReadableStream\n} = require('./utils')\nconst {\n AbortError,\n codes: { ERR_INVALID_ARG_VALUE, ERR_MISSING_ARGS }\n} = require('../../ours/errors')\nconst eos = require('./end-of-stream')\nmodule.exports = function compose(...streams) {\n if (streams.length === 0) {\n throw new ERR_MISSING_ARGS('streams')\n }\n if (streams.length === 1) {\n return Duplex.from(streams[0])\n }\n const orgStreams = [...streams]\n if (typeof streams[0] === 'function') {\n streams[0] = Duplex.from(streams[0])\n }\n if (typeof streams[streams.length - 1] === 'function') {\n const idx = streams.length - 1\n streams[idx] = Duplex.from(streams[idx])\n }\n for (let n = 0; n < streams.length; ++n) {\n if (!isNodeStream(streams[n]) && !isWebStream(streams[n])) {\n // TODO(ronag): Add checks for non streams.\n continue\n }\n if (\n n < streams.length - 1 &&\n !(isReadable(streams[n]) || isReadableStream(streams[n]) || isTransformStream(streams[n]))\n ) {\n throw new ERR_INVALID_ARG_VALUE(`streams[${n}]`, orgStreams[n], 'must be readable')\n }\n if (n > 0 && !(isWritable(streams[n]) || isWritableStream(streams[n]) || isTransformStream(streams[n]))) {\n throw new ERR_INVALID_ARG_VALUE(`streams[${n}]`, orgStreams[n], 'must be writable')\n }\n }\n let ondrain\n let onfinish\n let onreadable\n let onclose\n let d\n function onfinished(err) {\n const cb = onclose\n onclose = null\n if (cb) {\n cb(err)\n } else if (err) {\n d.destroy(err)\n } else if (!readable && !writable) {\n d.destroy()\n }\n }\n const head = streams[0]\n const tail = pipeline(streams, onfinished)\n const writable = !!(isWritable(head) || isWritableStream(head) || isTransformStream(head))\n const readable = !!(isReadable(tail) || isReadableStream(tail) || isTransformStream(tail))\n\n // TODO(ronag): Avoid double buffering.\n // Implement Writable/Readable/Duplex traits.\n // See, https://github.com/nodejs/node/pull/33515.\n d = new Duplex({\n // TODO (ronag): highWaterMark?\n writableObjectMode: !!(head !== null && head !== undefined && head.writableObjectMode),\n readableObjectMode: !!(tail !== null && tail !== undefined && tail.readableObjectMode),\n writable,\n readable\n })\n if (writable) {\n if (isNodeStream(head)) {\n d._write = function (chunk, encoding, callback) {\n if (head.write(chunk, encoding)) {\n callback()\n } else {\n ondrain = callback\n }\n }\n d._final = function (callback) {\n head.end()\n onfinish = callback\n }\n head.on('drain', function () {\n if (ondrain) {\n const cb = ondrain\n ondrain = null\n cb()\n }\n })\n } else if (isWebStream(head)) {\n const writable = isTransformStream(head) ? head.writable : head\n const writer = writable.getWriter()\n d._write = async function (chunk, encoding, callback) {\n try {\n await writer.ready\n writer.write(chunk).catch(() => {})\n callback()\n } catch (err) {\n callback(err)\n }\n }\n d._final = async function (callback) {\n try {\n await writer.ready\n writer.close().catch(() => {})\n onfinish = callback\n } catch (err) {\n callback(err)\n }\n }\n }\n const toRead = isTransformStream(tail) ? tail.readable : tail\n eos(toRead, () => {\n if (onfinish) {\n const cb = onfinish\n onfinish = null\n cb()\n }\n })\n }\n if (readable) {\n if (isNodeStream(tail)) {\n tail.on('readable', function () {\n if (onreadable) {\n const cb = onreadable\n onreadable = null\n cb()\n }\n })\n tail.on('end', function () {\n d.push(null)\n })\n d._read = function () {\n while (true) {\n const buf = tail.read()\n if (buf === null) {\n onreadable = d._read\n return\n }\n if (!d.push(buf)) {\n return\n }\n }\n }\n } else if (isWebStream(tail)) {\n const readable = isTransformStream(tail) ? tail.readable : tail\n const reader = readable.getReader()\n d._read = async function () {\n while (true) {\n try {\n const { value, done } = await reader.read()\n if (!d.push(value)) {\n return\n }\n if (done) {\n d.push(null)\n return\n }\n } catch {\n return\n }\n }\n }\n }\n }\n d._destroy = function (err, callback) {\n if (!err && onclose !== null) {\n err = new AbortError()\n }\n onreadable = null\n ondrain = null\n onfinish = null\n if (onclose === null) {\n callback(err)\n } else {\n onclose = callback\n if (isNodeStream(tail)) {\n destroyer(tail, err)\n }\n }\n }\n return d\n}\n","'use strict'\n\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nconst {\n codes: { ERR_INVALID_ARG_VALUE, ERR_INVALID_ARG_TYPE, ERR_MISSING_ARGS, ERR_OUT_OF_RANGE },\n AbortError\n} = require('../../ours/errors')\nconst { validateAbortSignal, validateInteger, validateObject } = require('../validators')\nconst kWeakHandler = require('../../ours/primordials').Symbol('kWeak')\nconst kResistStopPropagation = require('../../ours/primordials').Symbol('kResistStopPropagation')\nconst { finished } = require('./end-of-stream')\nconst staticCompose = require('./compose')\nconst { addAbortSignalNoValidate } = require('./add-abort-signal')\nconst { isWritable, isNodeStream } = require('./utils')\nconst { deprecate } = require('../../ours/util')\nconst {\n ArrayPrototypePush,\n Boolean,\n MathFloor,\n Number,\n NumberIsNaN,\n Promise,\n PromiseReject,\n PromiseResolve,\n PromisePrototypeThen,\n Symbol\n} = require('../../ours/primordials')\nconst kEmpty = Symbol('kEmpty')\nconst kEof = Symbol('kEof')\nfunction compose(stream, options) {\n if (options != null) {\n validateObject(options, 'options')\n }\n if ((options === null || options === undefined ? undefined : options.signal) != null) {\n validateAbortSignal(options.signal, 'options.signal')\n }\n if (isNodeStream(stream) && !isWritable(stream)) {\n throw new ERR_INVALID_ARG_VALUE('stream', stream, 'must be writable')\n }\n const composedStream = staticCompose(this, stream)\n if (options !== null && options !== undefined && options.signal) {\n // Not validating as we already validated before\n addAbortSignalNoValidate(options.signal, composedStream)\n }\n return composedStream\n}\nfunction map(fn, options) {\n if (typeof fn !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n }\n if (options != null) {\n validateObject(options, 'options')\n }\n if ((options === null || options === undefined ? undefined : options.signal) != null) {\n validateAbortSignal(options.signal, 'options.signal')\n }\n let concurrency = 1\n if ((options === null || options === undefined ? undefined : options.concurrency) != null) {\n concurrency = MathFloor(options.concurrency)\n }\n let highWaterMark = concurrency - 1\n if ((options === null || options === undefined ? undefined : options.highWaterMark) != null) {\n highWaterMark = MathFloor(options.highWaterMark)\n }\n validateInteger(concurrency, 'options.concurrency', 1)\n validateInteger(highWaterMark, 'options.highWaterMark', 0)\n highWaterMark += concurrency\n return async function* map() {\n const signal = require('../../ours/util').AbortSignalAny(\n [options === null || options === undefined ? undefined : options.signal].filter(Boolean)\n )\n const stream = this\n const queue = []\n const signalOpt = {\n signal\n }\n let next\n let resume\n let done = false\n let cnt = 0\n function onCatch() {\n done = true\n afterItemProcessed()\n }\n function afterItemProcessed() {\n cnt -= 1\n maybeResume()\n }\n function maybeResume() {\n if (resume && !done && cnt < concurrency && queue.length < highWaterMark) {\n resume()\n resume = null\n }\n }\n async function pump() {\n try {\n for await (let val of stream) {\n if (done) {\n return\n }\n if (signal.aborted) {\n throw new AbortError()\n }\n try {\n val = fn(val, signalOpt)\n if (val === kEmpty) {\n continue\n }\n val = PromiseResolve(val)\n } catch (err) {\n val = PromiseReject(err)\n }\n cnt += 1\n PromisePrototypeThen(val, afterItemProcessed, onCatch)\n queue.push(val)\n if (next) {\n next()\n next = null\n }\n if (!done && (queue.length >= highWaterMark || cnt >= concurrency)) {\n await new Promise((resolve) => {\n resume = resolve\n })\n }\n }\n queue.push(kEof)\n } catch (err) {\n const val = PromiseReject(err)\n PromisePrototypeThen(val, afterItemProcessed, onCatch)\n queue.push(val)\n } finally {\n done = true\n if (next) {\n next()\n next = null\n }\n }\n }\n pump()\n try {\n while (true) {\n while (queue.length > 0) {\n const val = await queue[0]\n if (val === kEof) {\n return\n }\n if (signal.aborted) {\n throw new AbortError()\n }\n if (val !== kEmpty) {\n yield val\n }\n queue.shift()\n maybeResume()\n }\n await new Promise((resolve) => {\n next = resolve\n })\n }\n } finally {\n done = true\n if (resume) {\n resume()\n resume = null\n }\n }\n }.call(this)\n}\nfunction asIndexedPairs(options = undefined) {\n if (options != null) {\n validateObject(options, 'options')\n }\n if ((options === null || options === undefined ? undefined : options.signal) != null) {\n validateAbortSignal(options.signal, 'options.signal')\n }\n return async function* asIndexedPairs() {\n let index = 0\n for await (const val of this) {\n var _options$signal\n if (\n options !== null &&\n options !== undefined &&\n (_options$signal = options.signal) !== null &&\n _options$signal !== undefined &&\n _options$signal.aborted\n ) {\n throw new AbortError({\n cause: options.signal.reason\n })\n }\n yield [index++, val]\n }\n }.call(this)\n}\nasync function some(fn, options = undefined) {\n for await (const unused of filter.call(this, fn, options)) {\n return true\n }\n return false\n}\nasync function every(fn, options = undefined) {\n if (typeof fn !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n }\n // https://en.wikipedia.org/wiki/De_Morgan%27s_laws\n return !(await some.call(\n this,\n async (...args) => {\n return !(await fn(...args))\n },\n options\n ))\n}\nasync function find(fn, options) {\n for await (const result of filter.call(this, fn, options)) {\n return result\n }\n return undefined\n}\nasync function forEach(fn, options) {\n if (typeof fn !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n }\n async function forEachFn(value, options) {\n await fn(value, options)\n return kEmpty\n }\n // eslint-disable-next-line no-unused-vars\n for await (const unused of map.call(this, forEachFn, options));\n}\nfunction filter(fn, options) {\n if (typeof fn !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n }\n async function filterFn(value, options) {\n if (await fn(value, options)) {\n return value\n }\n return kEmpty\n }\n return map.call(this, filterFn, options)\n}\n\n// Specific to provide better error to reduce since the argument is only\n// missing if the stream has no items in it - but the code is still appropriate\nclass ReduceAwareErrMissingArgs extends ERR_MISSING_ARGS {\n constructor() {\n super('reduce')\n this.message = 'Reduce of an empty stream requires an initial value'\n }\n}\nasync function reduce(reducer, initialValue, options) {\n var _options$signal2\n if (typeof reducer !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('reducer', ['Function', 'AsyncFunction'], reducer)\n }\n if (options != null) {\n validateObject(options, 'options')\n }\n if ((options === null || options === undefined ? undefined : options.signal) != null) {\n validateAbortSignal(options.signal, 'options.signal')\n }\n let hasInitialValue = arguments.length > 1\n if (\n options !== null &&\n options !== undefined &&\n (_options$signal2 = options.signal) !== null &&\n _options$signal2 !== undefined &&\n _options$signal2.aborted\n ) {\n const err = new AbortError(undefined, {\n cause: options.signal.reason\n })\n this.once('error', () => {}) // The error is already propagated\n await finished(this.destroy(err))\n throw err\n }\n const ac = new AbortController()\n const signal = ac.signal\n if (options !== null && options !== undefined && options.signal) {\n const opts = {\n once: true,\n [kWeakHandler]: this,\n [kResistStopPropagation]: true\n }\n options.signal.addEventListener('abort', () => ac.abort(), opts)\n }\n let gotAnyItemFromStream = false\n try {\n for await (const value of this) {\n var _options$signal3\n gotAnyItemFromStream = true\n if (\n options !== null &&\n options !== undefined &&\n (_options$signal3 = options.signal) !== null &&\n _options$signal3 !== undefined &&\n _options$signal3.aborted\n ) {\n throw new AbortError()\n }\n if (!hasInitialValue) {\n initialValue = value\n hasInitialValue = true\n } else {\n initialValue = await reducer(initialValue, value, {\n signal\n })\n }\n }\n if (!gotAnyItemFromStream && !hasInitialValue) {\n throw new ReduceAwareErrMissingArgs()\n }\n } finally {\n ac.abort()\n }\n return initialValue\n}\nasync function toArray(options) {\n if (options != null) {\n validateObject(options, 'options')\n }\n if ((options === null || options === undefined ? undefined : options.signal) != null) {\n validateAbortSignal(options.signal, 'options.signal')\n }\n const result = []\n for await (const val of this) {\n var _options$signal4\n if (\n options !== null &&\n options !== undefined &&\n (_options$signal4 = options.signal) !== null &&\n _options$signal4 !== undefined &&\n _options$signal4.aborted\n ) {\n throw new AbortError(undefined, {\n cause: options.signal.reason\n })\n }\n ArrayPrototypePush(result, val)\n }\n return result\n}\nfunction flatMap(fn, options) {\n const values = map.call(this, fn, options)\n return async function* flatMap() {\n for await (const val of values) {\n yield* val\n }\n }.call(this)\n}\nfunction toIntegerOrInfinity(number) {\n // We coerce here to align with the spec\n // https://github.com/tc39/proposal-iterator-helpers/issues/169\n number = Number(number)\n if (NumberIsNaN(number)) {\n return 0\n }\n if (number < 0) {\n throw new ERR_OUT_OF_RANGE('number', '>= 0', number)\n }\n return number\n}\nfunction drop(number, options = undefined) {\n if (options != null) {\n validateObject(options, 'options')\n }\n if ((options === null || options === undefined ? undefined : options.signal) != null) {\n validateAbortSignal(options.signal, 'options.signal')\n }\n number = toIntegerOrInfinity(number)\n return async function* drop() {\n var _options$signal5\n if (\n options !== null &&\n options !== undefined &&\n (_options$signal5 = options.signal) !== null &&\n _options$signal5 !== undefined &&\n _options$signal5.aborted\n ) {\n throw new AbortError()\n }\n for await (const val of this) {\n var _options$signal6\n if (\n options !== null &&\n options !== undefined &&\n (_options$signal6 = options.signal) !== null &&\n _options$signal6 !== undefined &&\n _options$signal6.aborted\n ) {\n throw new AbortError()\n }\n if (number-- <= 0) {\n yield val\n }\n }\n }.call(this)\n}\nfunction take(number, options = undefined) {\n if (options != null) {\n validateObject(options, 'options')\n }\n if ((options === null || options === undefined ? undefined : options.signal) != null) {\n validateAbortSignal(options.signal, 'options.signal')\n }\n number = toIntegerOrInfinity(number)\n return async function* take() {\n var _options$signal7\n if (\n options !== null &&\n options !== undefined &&\n (_options$signal7 = options.signal) !== null &&\n _options$signal7 !== undefined &&\n _options$signal7.aborted\n ) {\n throw new AbortError()\n }\n for await (const val of this) {\n var _options$signal8\n if (\n options !== null &&\n options !== undefined &&\n (_options$signal8 = options.signal) !== null &&\n _options$signal8 !== undefined &&\n _options$signal8.aborted\n ) {\n throw new AbortError()\n }\n if (number-- > 0) {\n yield val\n }\n\n // Don't get another item from iterator in case we reached the end\n if (number <= 0) {\n return\n }\n }\n }.call(this)\n}\nmodule.exports.streamReturningOperators = {\n asIndexedPairs: deprecate(asIndexedPairs, 'readable.asIndexedPairs will be removed in a future version.'),\n drop,\n filter,\n flatMap,\n map,\n take,\n compose\n}\nmodule.exports.promiseReturningOperators = {\n every,\n forEach,\n reduce,\n toArray,\n some,\n find\n}\n","'use strict'\n\nconst { ArrayPrototypePop, Promise } = require('../ours/primordials')\nconst { isIterable, isNodeStream, isWebStream } = require('../internal/streams/utils')\nconst { pipelineImpl: pl } = require('../internal/streams/pipeline')\nconst { finished } = require('../internal/streams/end-of-stream')\nrequire('../../lib/stream.js')\nfunction pipeline(...streams) {\n return new Promise((resolve, reject) => {\n let signal\n let end\n const lastArg = streams[streams.length - 1]\n if (\n lastArg &&\n typeof lastArg === 'object' &&\n !isNodeStream(lastArg) &&\n !isIterable(lastArg) &&\n !isWebStream(lastArg)\n ) {\n const options = ArrayPrototypePop(streams)\n signal = options.signal\n end = options.end\n }\n pl(\n streams,\n (err, value) => {\n if (err) {\n reject(err)\n } else {\n resolve(value)\n }\n },\n {\n signal,\n end\n }\n )\n })\n}\nmodule.exports = {\n finished,\n pipeline\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict'\n\n/* replacement start */\n\nconst { Buffer } = require('buffer')\n\n/* replacement end */\n\nconst { ObjectDefineProperty, ObjectKeys, ReflectApply } = require('./ours/primordials')\nconst {\n promisify: { custom: customPromisify }\n} = require('./ours/util')\nconst { streamReturningOperators, promiseReturningOperators } = require('./internal/streams/operators')\nconst {\n codes: { ERR_ILLEGAL_CONSTRUCTOR }\n} = require('./ours/errors')\nconst compose = require('./internal/streams/compose')\nconst { setDefaultHighWaterMark, getDefaultHighWaterMark } = require('./internal/streams/state')\nconst { pipeline } = require('./internal/streams/pipeline')\nconst { destroyer } = require('./internal/streams/destroy')\nconst eos = require('./internal/streams/end-of-stream')\nconst internalBuffer = {}\nconst promises = require('./stream/promises')\nconst utils = require('./internal/streams/utils')\nconst Stream = (module.exports = require('./internal/streams/legacy').Stream)\nStream.isDestroyed = utils.isDestroyed\nStream.isDisturbed = utils.isDisturbed\nStream.isErrored = utils.isErrored\nStream.isReadable = utils.isReadable\nStream.isWritable = utils.isWritable\nStream.Readable = require('./internal/streams/readable')\nfor (const key of ObjectKeys(streamReturningOperators)) {\n const op = streamReturningOperators[key]\n function fn(...args) {\n if (new.target) {\n throw ERR_ILLEGAL_CONSTRUCTOR()\n }\n return Stream.Readable.from(ReflectApply(op, this, args))\n }\n ObjectDefineProperty(fn, 'name', {\n __proto__: null,\n value: op.name\n })\n ObjectDefineProperty(fn, 'length', {\n __proto__: null,\n value: op.length\n })\n ObjectDefineProperty(Stream.Readable.prototype, key, {\n __proto__: null,\n value: fn,\n enumerable: false,\n configurable: true,\n writable: true\n })\n}\nfor (const key of ObjectKeys(promiseReturningOperators)) {\n const op = promiseReturningOperators[key]\n function fn(...args) {\n if (new.target) {\n throw ERR_ILLEGAL_CONSTRUCTOR()\n }\n return ReflectApply(op, this, args)\n }\n ObjectDefineProperty(fn, 'name', {\n __proto__: null,\n value: op.name\n })\n ObjectDefineProperty(fn, 'length', {\n __proto__: null,\n value: op.length\n })\n ObjectDefineProperty(Stream.Readable.prototype, key, {\n __proto__: null,\n value: fn,\n enumerable: false,\n configurable: true,\n writable: true\n })\n}\nStream.Writable = require('./internal/streams/writable')\nStream.Duplex = require('./internal/streams/duplex')\nStream.Transform = require('./internal/streams/transform')\nStream.PassThrough = require('./internal/streams/passthrough')\nStream.pipeline = pipeline\nconst { addAbortSignal } = require('./internal/streams/add-abort-signal')\nStream.addAbortSignal = addAbortSignal\nStream.finished = eos\nStream.destroy = destroyer\nStream.compose = compose\nStream.setDefaultHighWaterMark = setDefaultHighWaterMark\nStream.getDefaultHighWaterMark = getDefaultHighWaterMark\nObjectDefineProperty(Stream, 'promises', {\n __proto__: null,\n configurable: true,\n enumerable: true,\n get() {\n return promises\n }\n})\nObjectDefineProperty(pipeline, customPromisify, {\n __proto__: null,\n enumerable: true,\n get() {\n return promises.pipeline\n }\n})\nObjectDefineProperty(eos, customPromisify, {\n __proto__: null,\n enumerable: true,\n get() {\n return promises.finished\n }\n})\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream\nStream._isUint8Array = function isUint8Array(value) {\n return value instanceof Uint8Array\n}\nStream._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength)\n}\n","'use strict'\n\nconst Stream = require('stream')\nif (Stream && process.env.READABLE_STREAM === 'disable') {\n const promises = Stream.promises\n\n // Explicit export naming is needed for ESM\n module.exports._uint8ArrayToBuffer = Stream._uint8ArrayToBuffer\n module.exports._isUint8Array = Stream._isUint8Array\n module.exports.isDisturbed = Stream.isDisturbed\n module.exports.isErrored = Stream.isErrored\n module.exports.isReadable = Stream.isReadable\n module.exports.Readable = Stream.Readable\n module.exports.Writable = Stream.Writable\n module.exports.Duplex = Stream.Duplex\n module.exports.Transform = Stream.Transform\n module.exports.PassThrough = Stream.PassThrough\n module.exports.addAbortSignal = Stream.addAbortSignal\n module.exports.finished = Stream.finished\n module.exports.destroy = Stream.destroy\n module.exports.pipeline = Stream.pipeline\n module.exports.compose = Stream.compose\n Object.defineProperty(Stream, 'promises', {\n configurable: true,\n enumerable: true,\n get() {\n return promises\n }\n })\n module.exports.Stream = Stream.Stream\n} else {\n const CustomStream = require('../stream')\n const promises = require('../stream/promises')\n const originalDestroy = CustomStream.Readable.destroy\n module.exports = CustomStream.Readable\n\n // Explicit export naming is needed for ESM\n module.exports._uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer\n module.exports._isUint8Array = CustomStream._isUint8Array\n module.exports.isDisturbed = CustomStream.isDisturbed\n module.exports.isErrored = CustomStream.isErrored\n module.exports.isReadable = CustomStream.isReadable\n module.exports.Readable = CustomStream.Readable\n module.exports.Writable = CustomStream.Writable\n module.exports.Duplex = CustomStream.Duplex\n module.exports.Transform = CustomStream.Transform\n module.exports.PassThrough = CustomStream.PassThrough\n module.exports.addAbortSignal = CustomStream.addAbortSignal\n module.exports.finished = CustomStream.finished\n module.exports.destroy = CustomStream.destroy\n module.exports.destroy = originalDestroy\n module.exports.pipeline = CustomStream.pipeline\n module.exports.compose = CustomStream.compose\n Object.defineProperty(CustomStream, 'promises', {\n configurable: true,\n enumerable: true,\n get() {\n return promises\n }\n })\n module.exports.Stream = CustomStream.Stream\n}\n\n// Allow default importing\nmodule.exports.default = module.exports\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n","var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n","var baseFlatten = require('./_baseFlatten');\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n","var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n","var baseIndexOf = require('./_baseIndexOf');\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;\n","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arrayIncludesWith;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n arrayMap = require('./_arrayMap'),\n baseUnary = require('./_baseUnary'),\n cacheHas = require('./_cacheHas');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseDifference;\n","var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n","var baseDifference = require('./_baseDifference'),\n baseFlatten = require('./_baseFlatten'),\n baseRest = require('./_baseRest'),\n isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\nvar difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n});\n\nmodule.exports = difference;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n","var Set = require('./_Set'),\n noop = require('./noop'),\n setToArray = require('./_setToArray');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nmodule.exports = createSet;\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n cacheHas = require('./_cacheHas'),\n createSet = require('./_createSet'),\n setToArray = require('./_setToArray');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseUniq;\n","var baseFlatten = require('./_baseFlatten'),\n baseRest = require('./_baseRest'),\n baseUniq = require('./_baseUniq'),\n isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\nvar union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n});\n\nmodule.exports = union;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n","const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: any) => void = (\n pattern: any\n): asserts pattern is string => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n","// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n\n// { : [, /u flag required, negated]\nconst posixClasses: { [k: string]: [e: string, u: boolean, n?: boolean] } = {\n '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n '[:cntrl:]': ['\\\\p{Cc}', true],\n '[:digit:]': ['\\\\p{Nd}', true],\n '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n '[:lower:]': ['\\\\p{Ll}', true],\n '[:print:]': ['\\\\p{C}', true],\n '[:punct:]': ['\\\\p{P}', true],\n '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n '[:upper:]': ['\\\\p{Lu}', true],\n '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n '[:xdigit:]': ['A-Fa-f0-9', false],\n}\n\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s: string) => s.replace(/[[\\]\\\\-]/g, '\\\\$&')\n// escape all regexp magic characters\nconst regexpEscape = (s: string) =>\n s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges: string[]): string => ranges.join('')\n\nexport type ParseClassResult = [\n src: string,\n uFlag: boolean,\n consumed: number,\n hasMagic: boolean\n]\n\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (\n glob: string,\n position: number\n): ParseClassResult => {\n const pos = position\n /* c8 ignore start */\n if (glob.charAt(pos) !== '[') {\n throw new Error('not in a brace expression')\n }\n /* c8 ignore stop */\n const ranges: string[] = []\n const negs: string[] = []\n\n let i = pos + 1\n let sawStart = false\n let uflag = false\n let escaping = false\n let negate = false\n let endPos = pos\n let rangeStart = ''\n WHILE: while (i < glob.length) {\n const c = glob.charAt(i)\n if ((c === '!' || c === '^') && i === pos + 1) {\n negate = true\n i++\n continue\n }\n\n if (c === ']' && sawStart && !escaping) {\n endPos = i + 1\n break\n }\n\n sawStart = true\n if (c === '\\\\') {\n if (!escaping) {\n escaping = true\n i++\n continue\n }\n // escaped \\ char, fall through and treat like normal char\n }\n if (c === '[' && !escaping) {\n // either a posix class, a collation equivalent, or just a [\n for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n if (glob.startsWith(cls, i)) {\n // invalid, [a-[] is fine, but not [a-[:alpha]]\n if (rangeStart) {\n return ['$.', false, glob.length - pos, true]\n }\n i += cls.length\n if (neg) negs.push(unip)\n else ranges.push(unip)\n uflag = uflag || u\n continue WHILE\n }\n }\n }\n\n // now it's just a normal character, effectively\n escaping = false\n if (rangeStart) {\n // throw this range away if it's not valid, but others\n // can still match.\n if (c > rangeStart) {\n ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c))\n } else if (c === rangeStart) {\n ranges.push(braceEscape(c))\n }\n rangeStart = ''\n i++\n continue\n }\n\n // now might be the start of a range.\n // can be either c-d or c-] or c] or c] at this point\n if (glob.startsWith('-]', i + 1)) {\n ranges.push(braceEscape(c + '-'))\n i += 2\n continue\n }\n if (glob.startsWith('-', i + 1)) {\n rangeStart = c\n i += 2\n continue\n }\n\n // not the start of a range, just a single character\n ranges.push(braceEscape(c))\n i++\n }\n\n if (endPos < i) {\n // didn't see the end of the class, not a valid class,\n // but might still be valid as a literal match.\n return ['', false, 0, false]\n }\n\n // if we got no ranges and no negates, then we have a range that\n // cannot possibly match anything, and that poisons the whole glob\n if (!ranges.length && !negs.length) {\n return ['$.', false, glob.length - pos, true]\n }\n\n // if we got one positive range, and it's a single character, then that's\n // not actually a magic pattern, it's just that one literal character.\n // we should not treat that as \"magic\", we should just return the literal\n // character. [_] is a perfectly valid way to escape glob magic chars.\n if (\n negs.length === 0 &&\n ranges.length === 1 &&\n /^\\\\?.$/.test(ranges[0]) &&\n !negate\n ) {\n const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]\n return [regexpEscape(r), false, endPos - pos, false]\n }\n\n const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'\n const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'\n const comb =\n ranges.length && negs.length\n ? '(' + sranges + '|' + snegs + ')'\n : ranges.length\n ? sranges\n : snegs\n\n return [comb, uflag, endPos - pos, true]\n}\n","import { MinimatchOptions } from './index.js'\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link windowsPathsNoEscape} option is used, then square-brace\n * escapes are removed, but not backslash escapes. For example, it will turn\n * the string `'[*]'` into `*`, but it will not turn `'\\\\*'` into `'*'`,\n * becuase `\\` is a path separator in `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both brace escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n */\nexport const unescape = (\n s: string,\n {\n windowsPathsNoEscape = false,\n }: Pick = {}\n) => {\n return windowsPathsNoEscape\n ? s.replace(/\\[([^\\/\\\\])\\]/g, '$1')\n : s.replace(/((?!\\\\).|^)\\[([^\\/\\\\])\\]/g, '$1$2').replace(/\\\\([^\\/])/g, '$1')\n}\n","// parse a single path portion\n\nimport { parseClass } from './brace-expressions.js'\nimport { MinimatchOptions, MMRegExp } from './index.js'\nimport { unescape } from './unescape.js'\n\n// classes [] are handled by the parseClass method\n// for positive extglobs, we sub-parse the contents, and combine,\n// with the appropriate regexp close.\n// for negative extglobs, we sub-parse the contents, but then\n// have to include the rest of the pattern, then the parent, etc.,\n// as the thing that cannot be because RegExp negative lookaheads\n// are different from globs.\n//\n// So for example:\n// a@(i|w!(x|y)z|j)b => ^a(i|w((!?(x|y)zb).*)z|j)b$\n// 1 2 3 4 5 6 1 2 3 46 5 6\n//\n// Assembling the extglob requires not just the negated patterns themselves,\n// but also anything following the negative patterns up to the boundary\n// of the current pattern, plus anything following in the parent pattern.\n//\n//\n// So, first, we parse the string into an AST of extglobs, without turning\n// anything into regexps yet.\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y']}, 'z'], ['j']]}, 'b']\n//\n// Then, for all the negative extglobs, we append whatever comes after in\n// each parent as their tail\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y'], 'z', 'b'}, 'z'], ['j']]}, 'b']\n//\n// Lastly, we turn each of these pieces into a regexp, and join\n//\n// v----- .* because there's more following,\n// v v otherwise, .+ because it must be\n// v v *something* there.\n// ['^a', {@ ['i', 'w(?:(!?(?:x|y).*zb$).*)z', 'j' ]}, 'b$']\n// copy what follows into here--^^^^^\n// ['^a', '(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)', 'b$']\n// ['^a(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)b$']\n\nexport type ExtglobType = '!' | '?' | '+' | '*' | '@'\nconst types = new Set(['!', '?', '+', '*', '@'])\nconst isExtglobType = (c: string | null): c is ExtglobType =>\n types.has(c as ExtglobType)\nconst isExtglobAST = (c: AST): c is AST & { type: ExtglobType } =>\n isExtglobType(c.type)\n\nconst adoptionMap = new Map([\n ['!', ['@']],\n ['?', ['?', '@']],\n ['@', ['@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@']],\n])\n\nconst adoptionWithSpaceMap = new Map([\n ['!', ['?']],\n ['@', ['?']],\n ['+', ['?', '*']],\n])\n\nconst adoptionAnyMap = new Map([\n ['!', ['?', '@']],\n ['?', ['?', '@']],\n ['@', ['?', '@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@', '?', '*']],\n])\n\nconst usurpMap = new Map>([\n ['!', new Map([['!', '@']])],\n ['?', new Map([['*', '*'], ['+', '*']])],\n ['@', new Map([['!', '!'], ['?', '?'], ['@', '@'], ['*', '*'], ['+', '+']])],\n ['+', new Map([['?', '*'], ['*', '*']])],\n])\n\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))'\nconst startNoDot = '(?!\\\\.)'\n\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.'])\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.'])\nconst reSpecials = new Set('().*{}+?[]^$\\\\!')\nconst regExpEscape = (s: string) =>\n s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// any single thing other than /\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?'\n\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\n\nexport class AST {\n type: ExtglobType | null\n readonly #root: AST\n\n #hasMagic?: boolean\n #uflag: boolean = false\n #parts: (string | AST)[] = []\n #parent?: AST\n #parentIndex: number\n #negs: AST[]\n #filledNegs: boolean = false\n #options: MinimatchOptions\n #toString?: string\n // set to true if it's an extglob with no children\n // (which really means one child of '')\n #emptyExt: boolean = false\n\n constructor(\n type: ExtglobType | null,\n parent?: AST,\n options: MinimatchOptions = {}\n ) {\n this.type = type\n // extglobs are inherently magical\n if (type) this.#hasMagic = true\n this.#parent = parent\n this.#root = this.#parent ? this.#parent.#root : this\n this.#options = this.#root === this ? options : this.#root.#options\n this.#negs = this.#root === this ? [] : this.#root.#negs\n if (type === '!' && !this.#root.#filledNegs) this.#negs.push(this)\n this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0\n }\n\n get hasMagic(): boolean | undefined {\n /* c8 ignore start */\n if (this.#hasMagic !== undefined) return this.#hasMagic\n /* c8 ignore stop */\n for (const p of this.#parts) {\n if (typeof p === 'string') continue\n if (p.type || p.hasMagic) return (this.#hasMagic = true)\n }\n // note: will be undefined until we generate the regexp src and find out\n return this.#hasMagic\n }\n\n // reconstructs the pattern\n toString(): string {\n if (this.#toString !== undefined) return this.#toString\n if (!this.type) {\n return (this.#toString = this.#parts.map(p => String(p)).join(''))\n } else {\n return (this.#toString =\n this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')')\n }\n }\n\n #fillNegs() {\n /* c8 ignore start */\n if (this !== this.#root) throw new Error('should only call on root')\n if (this.#filledNegs) return this\n /* c8 ignore stop */\n\n // call toString() once to fill this out\n this.toString()\n this.#filledNegs = true\n let n: AST | undefined\n while ((n = this.#negs.pop())) {\n if (n.type !== '!') continue\n // walk up the tree, appending everthing that comes AFTER parentIndex\n let p: AST | undefined = n\n let pp = p.#parent\n while (pp) {\n for (\n let i = p.#parentIndex + 1;\n !pp.type && i < pp.#parts.length;\n i++\n ) {\n for (const part of n.#parts) {\n /* c8 ignore start */\n if (typeof part === 'string') {\n throw new Error('string part in extglob AST??')\n }\n /* c8 ignore stop */\n part.copyIn(pp.#parts[i])\n }\n }\n p = pp\n pp = p.#parent\n }\n }\n return this\n }\n\n push(...parts: (string | AST)[]) {\n for (const p of parts) {\n if (p === '') continue\n /* c8 ignore start */\n if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) {\n throw new Error('invalid part: ' + p)\n }\n /* c8 ignore stop */\n this.#parts.push(p)\n }\n }\n\n toJSON() {\n const ret: any[] =\n this.type === null\n ? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON()))\n : [this.type, ...this.#parts.map(p => (p as AST).toJSON())]\n if (this.isStart() && !this.type) ret.unshift([])\n if (\n this.isEnd() &&\n (this === this.#root ||\n (this.#root.#filledNegs && this.#parent?.type === '!'))\n ) {\n ret.push({})\n }\n return ret\n }\n\n isStart(): boolean {\n if (this.#root === this) return true\n // if (this.type) return !!this.#parent?.isStart()\n if (!this.#parent?.isStart()) return false\n if (this.#parentIndex === 0) return true\n // if everything AHEAD of this is a negation, then it's still the \"start\"\n const p = this.#parent\n for (let i = 0; i < this.#parentIndex; i++) {\n const pp = p.#parts[i]\n if (!(pp instanceof AST && pp.type === '!')) {\n return false\n }\n }\n return true\n }\n\n isEnd(): boolean {\n if (this.#root === this) return true\n if (this.#parent?.type === '!') return true\n if (!this.#parent?.isEnd()) return false\n if (!this.type) return this.#parent?.isEnd()\n // if not root, it'll always have a parent\n /* c8 ignore start */\n const pl = this.#parent ? this.#parent.#parts.length : 0\n /* c8 ignore stop */\n return this.#parentIndex === pl - 1\n }\n\n copyIn(part: AST | string) {\n if (typeof part === 'string') this.push(part)\n else this.push(part.clone(this))\n }\n\n clone(parent: AST) {\n const c = new AST(this.type, parent)\n for (const p of this.#parts) {\n c.copyIn(p)\n }\n return c\n }\n\n static #parseAST(\n str: string,\n ast: AST,\n pos: number,\n opt: MinimatchOptions,\n extDepth: number\n ): number {\n const maxDepth = opt.maxExtglobRecursion ?? 2\n let escaping = false\n let inBrace = false\n let braceStart = -1\n let braceNeg = false\n if (ast.type === null) {\n // outside of a extglob, append until we find a start\n let i = pos\n let acc = ''\n while (i < str.length) {\n const c = str.charAt(i++)\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping\n acc += c\n continue\n }\n\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true\n }\n } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false\n }\n acc += c\n continue\n } else if (c === '[') {\n inBrace = true\n braceStart = i\n braceNeg = false\n acc += c\n continue\n }\n\n const doRecurse =\n !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n extDepth <= maxDepth\n if (doRecurse) {\n ast.push(acc)\n acc = ''\n const ext = new AST(c, ast)\n i = AST.#parseAST(str, ext, i, opt, extDepth + 1)\n ast.push(ext)\n continue\n }\n acc += c\n }\n ast.push(acc)\n return i\n }\n\n // some kind of extglob, pos is at the (\n // find the next | or )\n let i = pos + 1\n let part = new AST(null, ast)\n const parts: AST[] = []\n let acc = ''\n while (i < str.length) {\n const c = str.charAt(i++)\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping\n acc += c\n continue\n }\n\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true\n }\n } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false\n }\n acc += c\n continue\n } else if (c === '[') {\n inBrace = true\n braceStart = i\n braceNeg = false\n acc += c\n continue\n }\n\n const doRecurse =\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n /* c8 ignore start - the maxDepth is sufficient here */\n (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)))\n /* c8 ignore stop */\n if (doRecurse) {\n const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1\n part.push(acc)\n acc = ''\n const ext = new AST(c, part)\n part.push(ext)\n i = AST.#parseAST(str, ext, i, opt, extDepth + depthAdd)\n continue\n }\n if (c === '|') {\n part.push(acc)\n acc = ''\n parts.push(part)\n part = new AST(null, ast)\n continue\n }\n if (c === ')') {\n if (acc === '' && ast.#parts.length === 0) {\n ast.#emptyExt = true\n }\n part.push(acc)\n acc = ''\n ast.push(...parts, part)\n return i\n }\n acc += c\n }\n\n // unfinished extglob\n // if we got here, it was a malformed extglob! not an extglob, but\n // maybe something else in there.\n ast.type = null\n ast.#hasMagic = undefined\n ast.#parts = [str.substring(pos - 1)]\n return i\n }\n\n #canAdoptWithSpace(child?: AST | string): child is AST & {\n type: null\n parts: [AST & { type: ExtglobType }]\n } {\n return this.#canAdopt(child, adoptionWithSpaceMap)\n }\n\n #canAdopt(\n child?: AST | string,\n map: Map = adoptionMap\n ): child is AST & {\n type: null\n parts: [AST & { type: ExtglobType }]\n } {\n if (\n !child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null\n ) {\n return false\n }\n const gc = child.#parts[0]\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false\n }\n return (this as AST & { type: ExtglobType }).#canAdoptType(\n gc.type,\n map\n )\n }\n\n #canAdoptType(\n c: string,\n map: Map = adoptionAnyMap\n ): c is ExtglobType {\n return !!map.get(this.type as ExtglobType)?.includes(c as ExtglobType)\n }\n\n #adoptWithSpace(\n this: AST & { type: ExtglobType },\n child: AST & { type: null },\n index: number\n ) {\n const gc = child.#parts[0] as AST & { type: ExtglobType }\n const blank = new AST(null, gc, this.options)\n blank.#parts.push('')\n gc.push(blank)\n this.#adopt(child, index)\n }\n\n #adopt(child: AST & { type: null }, index: number) {\n const gc = child.#parts[0] as AST & { type: ExtglobType }\n this.#parts.splice(index, 1, ...gc.#parts)\n for (const p of gc.#parts) {\n if (typeof p === 'object') p.#parent = this\n }\n this.#toString = undefined\n }\n\n #canUsurpType(c: string): boolean {\n const m = usurpMap.get(this.type as ExtglobType)\n return !!(m?.has(c as ExtglobType))\n }\n\n #canUsurp(child?: AST | string): child is AST & {\n type: null\n parts: [AST & { type: ExtglobType }]\n } {\n if (\n !child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null ||\n this.#parts.length !== 1\n ) {\n return false\n }\n const gc = child.#parts[0]\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false\n }\n return (this as AST & { type: ExtglobType }).#canUsurpType(gc.type)\n }\n\n #usurp(this: AST & { type: ExtglobType }, child: AST & { type: null }) {\n const m = usurpMap.get(this.type as ExtglobType)\n const gc = child.#parts[0] as AST & { type: ExtglobType }\n const nt = m?.get(gc.type)\n /* c8 ignore start - impossible */\n if (!nt) return false\n /* c8 ignore stop */\n this.#parts = gc.#parts\n for (const p of this.#parts) {\n if (typeof p === 'object') p.#parent = this\n }\n this.type = nt\n this.#toString = undefined\n this.#emptyExt = false\n }\n\n #flatten() {\n if (!isExtglobAST(this)) {\n for (const p of this.#parts) {\n if (typeof p === 'object') p.#flatten()\n }\n } else {\n let iterations = 0\n let done = false\n do {\n done = true\n for (let i = 0; i < this.#parts.length; i++) {\n const c = this.#parts[i]\n if (typeof c === 'object') {\n c.#flatten()\n if (this.#canAdopt(c)) {\n done = false\n this.#adopt(c, i)\n } else if (this.#canAdoptWithSpace(c)) {\n done = false\n this.#adoptWithSpace(c, i)\n } else if (this.#canUsurp(c)) {\n done = false\n this.#usurp(c)\n }\n }\n }\n } while (!done && ++iterations < 10)\n }\n this.#toString = undefined\n }\n\n static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n const ast = new AST(null, undefined, options)\n AST.#parseAST(pattern, ast, 0, options, 0)\n return ast\n }\n\n // returns the regular expression if there's magic, or the unescaped\n // string if not.\n toMMPattern(): MMRegExp | string {\n // should only be called on root\n /* c8 ignore start */\n if (this !== this.#root) return this.#root.toMMPattern()\n /* c8 ignore stop */\n const glob = this.toString()\n const [re, body, hasMagic, uflag] = this.toRegExpSource()\n // if we're in nocase mode, and not nocaseMagicOnly, then we do\n // still need a regular expression if we have to case-insensitively\n // match capital/lowercase characters.\n const anyMagic =\n hasMagic ||\n this.#hasMagic ||\n (this.#options.nocase &&\n !this.#options.nocaseMagicOnly &&\n glob.toUpperCase() !== glob.toLowerCase())\n if (!anyMagic) {\n return body\n }\n\n const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '')\n return Object.assign(new RegExp(`^${re}$`, flags), {\n _src: re,\n _glob: glob,\n })\n }\n\n get options() {\n return this.#options\n }\n\n // returns the string match, the regexp source, whether there's magic\n // in the regexp (so a regular expression is required) and whether or\n // not the uflag is needed for the regular expression (for posix classes)\n // TODO: instead of injecting the start/end at this point, just return\n // the BODY of the regexp, along with the start/end portions suitable\n // for binding the start/end in either a joined full-path makeRe context\n // (where we bind to (^|/), or a standalone matchPart context (where\n // we bind to ^, and not /). Otherwise slashes get duped!\n //\n // In part-matching mode, the start is:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n // - if dots allowed or not possible: ^\n // - if dots possible and not allowed: ^(?!\\.)\n // end is:\n // - if not isEnd(): nothing\n // - else: $\n //\n // In full-path matching mode, we put the slash at the START of the\n // pattern, so start is:\n // - if first pattern: same as part-matching mode\n // - if not isStart(): nothing\n // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n // - if dots allowed or not possible: /\n // - if dots possible and not allowed: /(?!\\.)\n // end is:\n // - if last pattern, same as part-matching mode\n // - else nothing\n //\n // Always put the (?:$|/) on negated tails, though, because that has to be\n // there to bind the end of the negated pattern portion, and it's easier to\n // just stick it in now rather than try to inject it later in the middle of\n // the pattern.\n //\n // We can just always return the same end, and leave it up to the caller\n // to know whether it's going to be used joined or in parts.\n // And, if the start is adjusted slightly, can do the same there:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n // - if dots allowed or not possible: (?:/|^)\n // - if dots possible and not allowed: (?:/|^)(?!\\.)\n //\n // But it's better to have a simpler binding without a conditional, for\n // performance, so probably better to return both start options.\n //\n // Then the caller just ignores the end if it's not the first pattern,\n // and the start always gets applied.\n //\n // But that's always going to be $ if it's the ending pattern, or nothing,\n // so the caller can just attach $ at the end of the pattern when building.\n //\n // So the todo is:\n // - better detect what kind of start is needed\n // - return both flavors of starting pattern\n // - attach $ at the end of the pattern when creating the actual RegExp\n //\n // Ah, but wait, no, that all only applies to the root when the first pattern\n // is not an extglob. If the first pattern IS an extglob, then we need all\n // that dot prevention biz to live in the extglob portions, because eg\n // +(*|.x*) can match .xy but not .yx.\n //\n // So, return the two flavors if it's #root and the first child is not an\n // AST, otherwise leave it to the child AST to handle it, and there,\n // use the (?:^|/) style of start binding.\n //\n // Even simplified further:\n // - Since the start for a join is eg /(?!\\.) and the start for a part\n // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n // or start or whatever) and prepend ^ or / at the Regexp construction.\n toRegExpSource(\n allowDot?: boolean\n ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n const dot = allowDot ?? !!this.#options.dot\n if (this.#root === this) {\n this.#flatten()\n this.#fillNegs()\n }\n if (!isExtglobAST(this)) {\n const noEmpty = this.isStart() && this.isEnd()\n const src = this.#parts\n .map(p => {\n const [re, _, hasMagic, uflag] =\n typeof p === 'string'\n ? AST.#parseGlob(p, this.#hasMagic, noEmpty)\n : p.toRegExpSource(allowDot)\n this.#hasMagic = this.#hasMagic || hasMagic\n this.#uflag = this.#uflag || uflag\n return re\n })\n .join('')\n\n let start = ''\n if (this.isStart()) {\n if (typeof this.#parts[0] === 'string') {\n // this is the string that will match the start of the pattern,\n // so we need to protect against dots and such.\n\n // '.' and '..' cannot match unless the pattern is that exactly,\n // even if it starts with . or dot:true is set.\n const dotTravAllowed =\n this.#parts.length === 1 && justDots.has(this.#parts[0])\n if (!dotTravAllowed) {\n const aps = addPatternStart\n // check if we have a possibility of matching . or ..,\n // and prevent that.\n const needNoTrav =\n // dots are allowed, and the pattern starts with [ or .\n (dot && aps.has(src.charAt(0))) ||\n // the pattern starts with \\., and then [ or .\n (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n // the pattern starts with \\.\\., and then [ or .\n (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)))\n // no need to prevent dots if it can't match a dot, or if a\n // sub-pattern will be preventing it anyway.\n const needNoDot = !dot && !allowDot && aps.has(src.charAt(0))\n\n start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : ''\n }\n }\n }\n\n // append the \"end of path portion\" pattern to negation tails\n let end = ''\n if (\n this.isEnd() &&\n this.#root.#filledNegs &&\n this.#parent?.type === '!'\n ) {\n end = '(?:$|\\\\/)'\n }\n const final = start + src + end\n return [\n final,\n unescape(src),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ]\n }\n\n // We need to calculate the body *twice* if it's a repeat pattern\n // at the start, once in nodot mode, then again in dot mode, so a\n // pattern like *(?) can match 'x.y'\n\n const repeated = this.type === '*' || this.type === '+'\n // some kind of extglob\n const start = this.type === '!' ? '(?:(?!(?:' : '(?:'\n let body = this.#partsToRegExp(dot)\n\n if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n // invalid extglob, has to at least be *something* present, if it's\n // the entire path portion.\n const s = this.toString()\n const me = this as AST\n me.#parts = [s]\n me.type = null\n me.#hasMagic = undefined\n return [s, unescape(this.toString()), false, false]\n }\n\n // XXX abstract out this map method\n let bodyDotAllowed =\n !repeated || allowDot || dot || !startNoDot\n ? ''\n : this.#partsToRegExp(true)\n if (bodyDotAllowed === body) {\n bodyDotAllowed = ''\n }\n if (bodyDotAllowed) {\n body = `(?:${body})(?:${bodyDotAllowed})*?`\n }\n\n // an empty !() is exactly equivalent to a starNoEmpty\n let final = ''\n if (this.type === '!' && this.#emptyExt) {\n final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty\n } else {\n const close =\n this.type === '!'\n ? // !() must match something,but !(x) can match ''\n '))' +\n (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n star +\n ')'\n : this.type === '@'\n ? ')'\n : this.type === '?'\n ? ')?'\n : this.type === '+' && bodyDotAllowed\n ? ')'\n : this.type === '*' && bodyDotAllowed\n ? `)?`\n : `)${this.type}`\n final = start + body + close\n }\n return [\n final,\n unescape(body),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ]\n }\n\n #partsToRegExp(dot: boolean) {\n return this.#parts\n .map(p => {\n // extglob ASTs should only contain parent ASTs\n /* c8 ignore start */\n if (typeof p === 'string') {\n throw new Error('string type in extglob ast??')\n }\n /* c8 ignore stop */\n // can ignore hasMagic, because extglobs are already always magic\n const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot)\n this.#uflag = this.#uflag || uflag\n return re\n })\n .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n .join('|')\n }\n\n static #parseGlob(\n glob: string,\n hasMagic: boolean | undefined,\n noEmpty: boolean = false\n ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n let escaping = false\n let re = ''\n let uflag = false\n // multiple stars that aren't globstars coalesce into one *\n let inStar = false\n for (let i = 0; i < glob.length; i++) {\n const c = glob.charAt(i)\n if (escaping) {\n escaping = false\n re += (reSpecials.has(c) ? '\\\\' : '') + c\n inStar = false\n continue\n }\n if (c === '\\\\') {\n if (i === glob.length - 1) {\n re += '\\\\\\\\'\n } else {\n escaping = true\n }\n continue\n }\n if (c === '[') {\n const [src, needUflag, consumed, magic] = parseClass(glob, i)\n if (consumed) {\n re += src\n uflag = uflag || needUflag\n i += consumed - 1\n hasMagic = hasMagic || magic\n inStar = false\n continue\n }\n }\n if (c === '*') {\n if (inStar) continue\n inStar = true\n re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star\n hasMagic = true\n continue\n } else {\n inStar = false\n }\n if (c === '?') {\n re += qmark\n hasMagic = true\n continue\n }\n re += regExpEscape(c)\n }\n return [re, unescape(glob), !!hasMagic, uflag]\n }\n}\n","import { MinimatchOptions } from './index.js'\n/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character. In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n */\nexport const escape = (\n s: string,\n {\n windowsPathsNoEscape = false,\n }: Pick = {}\n) => {\n // don't need to escape +@! because we escape the parens\n // that make those magic, and escaping ! as [!] isn't valid,\n // because [!]] is a valid glob class meaning not ']'.\n return windowsPathsNoEscape\n ? s.replace(/[?*()[\\]]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&')\n}\n","import expand from 'brace-expansion'\nimport { assertValidPattern } from './assert-valid-pattern.js'\nimport { AST, ExtglobType } from './ast.js'\nimport { escape } from './escape.js'\nimport { unescape } from './unescape.js'\n\ntype Platform =\n | 'aix'\n | 'android'\n | 'darwin'\n | 'freebsd'\n | 'haiku'\n | 'linux'\n | 'openbsd'\n | 'sunos'\n | 'win32'\n | 'cygwin'\n | 'netbsd'\n\nexport interface MinimatchOptions {\n nobrace?: boolean\n nocomment?: boolean\n nonegate?: boolean\n debug?: boolean\n noglobstar?: boolean\n noext?: boolean\n nonull?: boolean\n windowsPathsNoEscape?: boolean\n allowWindowsEscape?: boolean\n partial?: boolean\n dot?: boolean\n nocase?: boolean\n nocaseMagicOnly?: boolean\n magicalBraces?: boolean\n matchBase?: boolean\n flipNegate?: boolean\n preserveMultipleSlashes?: boolean\n optimizationLevel?: number\n platform?: Platform\n windowsNoMagicRoot?: boolean\n maxGlobstarRecursion?: number\n maxExtglobRecursion?: number\n}\n\nexport const minimatch = (\n p: string,\n pattern: string,\n options: MinimatchOptions = {}\n) => {\n assertValidPattern(pattern)\n\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false\n }\n\n return new Minimatch(pattern, options).match(p)\n}\n\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?\\*\\[\\(]*)$/\nconst starDotExtTest = (ext: string) => (f: string) =>\n !f.startsWith('.') && f.endsWith(ext)\nconst starDotExtTestDot = (ext: string) => (f: string) => f.endsWith(ext)\nconst starDotExtTestNocase = (ext: string) => {\n ext = ext.toLowerCase()\n return (f: string) => !f.startsWith('.') && f.toLowerCase().endsWith(ext)\n}\nconst starDotExtTestNocaseDot = (ext: string) => {\n ext = ext.toLowerCase()\n return (f: string) => f.toLowerCase().endsWith(ext)\n}\nconst starDotStarRE = /^\\*+\\.\\*+$/\nconst starDotStarTest = (f: string) => !f.startsWith('.') && f.includes('.')\nconst starDotStarTestDot = (f: string) =>\n f !== '.' && f !== '..' && f.includes('.')\nconst dotStarRE = /^\\.\\*+$/\nconst dotStarTest = (f: string) => f !== '.' && f !== '..' && f.startsWith('.')\nconst starRE = /^\\*+$/\nconst starTest = (f: string) => f.length !== 0 && !f.startsWith('.')\nconst starTestDot = (f: string) => f.length !== 0 && f !== '.' && f !== '..'\nconst qmarksRE = /^\\?+([^+@!?\\*\\[\\(]*)?$/\nconst qmarksTestNocase = ([$0, ext = '']: RegExpMatchArray) => {\n const noext = qmarksTestNoExt([$0])\n if (!ext) return noext\n ext = ext.toLowerCase()\n return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestNocaseDot = ([$0, ext = '']: RegExpMatchArray) => {\n const noext = qmarksTestNoExtDot([$0])\n if (!ext) return noext\n ext = ext.toLowerCase()\n return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestDot = ([$0, ext = '']: RegExpMatchArray) => {\n const noext = qmarksTestNoExtDot([$0])\n return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTest = ([$0, ext = '']: RegExpMatchArray) => {\n const noext = qmarksTestNoExt([$0])\n return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTestNoExt = ([$0]: RegExpMatchArray) => {\n const len = $0.length\n return (f: string) => f.length === len && !f.startsWith('.')\n}\nconst qmarksTestNoExtDot = ([$0]: RegExpMatchArray) => {\n const len = $0.length\n return (f: string) => f.length === len && f !== '.' && f !== '..'\n}\n\n/* c8 ignore start */\nconst defaultPlatform: Platform = (\n typeof process === 'object' && process\n ? (typeof process.env === 'object' &&\n process.env &&\n process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n process.platform\n : 'posix'\n) as Platform\ntype Sep = '\\\\' | '/'\nconst path: { [k: string]: { sep: Sep } } = {\n win32: { sep: '\\\\' },\n posix: { sep: '/' },\n}\n/* c8 ignore stop */\n\nexport const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep\nminimatch.sep = sep\n\nexport const GLOBSTAR = Symbol('globstar **')\nminimatch.GLOBSTAR = GLOBSTAR\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?'\n\nexport const filter =\n (pattern: string, options: MinimatchOptions = {}) =>\n (p: string) =>\n minimatch(p, pattern, options)\nminimatch.filter = filter\n\nconst ext = (a: MinimatchOptions, b: MinimatchOptions = {}) =>\n Object.assign({}, a, b)\n\nexport const defaults = (def: MinimatchOptions): typeof minimatch => {\n if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n return minimatch\n }\n\n const orig = minimatch\n\n const m = (p: string, pattern: string, options: MinimatchOptions = {}) =>\n orig(p, pattern, ext(def, options))\n\n return Object.assign(m, {\n Minimatch: class Minimatch extends orig.Minimatch {\n constructor(pattern: string, options: MinimatchOptions = {}) {\n super(pattern, ext(def, options))\n }\n static defaults(options: MinimatchOptions) {\n return orig.defaults(ext(def, options)).Minimatch\n }\n },\n\n AST: class AST extends orig.AST {\n /* c8 ignore start */\n constructor(\n type: ExtglobType | null,\n parent?: AST,\n options: MinimatchOptions = {}\n ) {\n super(type, parent, ext(def, options))\n }\n /* c8 ignore stop */\n\n static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n return orig.AST.fromGlob(pattern, ext(def, options))\n }\n },\n\n unescape: (\n s: string,\n options: Pick = {}\n ) => orig.unescape(s, ext(def, options)),\n\n escape: (\n s: string,\n options: Pick = {}\n ) => orig.escape(s, ext(def, options)),\n\n filter: (pattern: string, options: MinimatchOptions = {}) =>\n orig.filter(pattern, ext(def, options)),\n\n defaults: (options: MinimatchOptions) => orig.defaults(ext(def, options)),\n\n makeRe: (pattern: string, options: MinimatchOptions = {}) =>\n orig.makeRe(pattern, ext(def, options)),\n\n braceExpand: (pattern: string, options: MinimatchOptions = {}) =>\n orig.braceExpand(pattern, ext(def, options)),\n\n match: (list: string[], pattern: string, options: MinimatchOptions = {}) =>\n orig.match(list, pattern, ext(def, options)),\n\n sep: orig.sep,\n GLOBSTAR: GLOBSTAR as typeof GLOBSTAR,\n })\n}\nminimatch.defaults = defaults\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (\n pattern: string,\n options: MinimatchOptions = {}\n) => {\n assertValidPattern(pattern)\n\n // Thanks to Yeting Li for\n // improving this regexp to avoid a ReDOS vulnerability.\n if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n // shortcut. no need to expand.\n return [pattern]\n }\n\n return expand(pattern)\n}\nminimatch.braceExpand = braceExpand\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\n\nexport const makeRe = (pattern: string, options: MinimatchOptions = {}) =>\n new Minimatch(pattern, options).makeRe()\nminimatch.makeRe = makeRe\n\nexport const match = (\n list: string[],\n pattern: string,\n options: MinimatchOptions = {}\n) => {\n const mm = new Minimatch(pattern, options)\n list = list.filter(f => mm.match(f))\n if (mm.options.nonull && !list.length) {\n list.push(pattern)\n }\n return list\n}\nminimatch.match = match\n\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/\nconst regExpEscape = (s: string) =>\n s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\nexport type MMRegExp = RegExp & {\n _src?: string\n _glob?: string\n}\n\nexport type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR\nexport type ParseReturn = ParseReturnFiltered | false\n\nexport class Minimatch {\n options: MinimatchOptions\n set: ParseReturnFiltered[][]\n pattern: string\n\n windowsPathsNoEscape: boolean\n nonegate: boolean\n negate: boolean\n comment: boolean\n empty: boolean\n preserveMultipleSlashes: boolean\n partial: boolean\n globSet: string[]\n globParts: string[][]\n nocase: boolean\n\n isWindows: boolean\n platform: Platform\n windowsNoMagicRoot: boolean\n maxGlobstarRecursion: number\n\n regexp: false | null | MMRegExp\n constructor(pattern: string, options: MinimatchOptions = {}) {\n assertValidPattern(pattern)\n\n options = options || {}\n this.options = options\n this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200\n this.pattern = pattern\n this.platform = options.platform || defaultPlatform\n this.isWindows = this.platform === 'win32'\n this.windowsPathsNoEscape =\n !!options.windowsPathsNoEscape || options.allowWindowsEscape === false\n if (this.windowsPathsNoEscape) {\n this.pattern = this.pattern.replace(/\\\\/g, '/')\n }\n this.preserveMultipleSlashes = !!options.preserveMultipleSlashes\n this.regexp = null\n this.negate = false\n this.nonegate = !!options.nonegate\n this.comment = false\n this.empty = false\n this.partial = !!options.partial\n this.nocase = !!this.options.nocase\n this.windowsNoMagicRoot =\n options.windowsNoMagicRoot !== undefined\n ? options.windowsNoMagicRoot\n : !!(this.isWindows && this.nocase)\n\n this.globSet = []\n this.globParts = []\n this.set = []\n\n // make the set of regexps etc.\n this.make()\n }\n\n hasMagic(): boolean {\n if (this.options.magicalBraces && this.set.length > 1) {\n return true\n }\n for (const pattern of this.set) {\n for (const part of pattern) {\n if (typeof part !== 'string') return true\n }\n }\n return false\n }\n\n debug(..._: any[]) {}\n\n make() {\n const pattern = this.pattern\n const options = this.options\n\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true\n return\n }\n\n if (!pattern) {\n this.empty = true\n return\n }\n\n // step 1: figure out negation, etc.\n this.parseNegate()\n\n // step 2: expand braces\n this.globSet = [...new Set(this.braceExpand())]\n\n if (options.debug) {\n this.debug = (...args: any[]) => console.error(...args)\n }\n\n this.debug(this.pattern, this.globSet)\n\n // step 3: now we have a set, so turn each one into a series of\n // path-portion matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n //\n // First, we preprocess to make the glob pattern sets a bit simpler\n // and deduped. There are some perf-killing patterns that can cause\n // problems with a glob walk, but we can simplify them down a bit.\n const rawGlobParts = this.globSet.map(s => this.slashSplit(s))\n this.globParts = this.preprocess(rawGlobParts)\n this.debug(this.pattern, this.globParts)\n\n // glob --> regexps\n let set = this.globParts.map((s, _, __) => {\n if (this.isWindows && this.windowsNoMagicRoot) {\n // check if it's a drive or unc path.\n const isUNC =\n s[0] === '' &&\n s[1] === '' &&\n (s[2] === '?' || !globMagic.test(s[2])) &&\n !globMagic.test(s[3])\n const isDrive = /^[a-z]:/i.test(s[0])\n if (isUNC) {\n return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))]\n } else if (isDrive) {\n return [s[0], ...s.slice(1).map(ss => this.parse(ss))]\n }\n }\n return s.map(ss => this.parse(ss))\n })\n\n this.debug(this.pattern, set)\n\n // filter out everything that didn't compile properly.\n this.set = set.filter(\n s => s.indexOf(false) === -1\n ) as ParseReturnFiltered[][]\n\n // do not treat the ? in UNC paths as magic\n if (this.isWindows) {\n for (let i = 0; i < this.set.length; i++) {\n const p = this.set[i]\n if (\n p[0] === '' &&\n p[1] === '' &&\n this.globParts[i][2] === '?' &&\n typeof p[3] === 'string' &&\n /^[a-z]:$/i.test(p[3])\n ) {\n p[2] = '?'\n }\n }\n }\n\n this.debug(this.pattern, this.set)\n }\n\n // various transforms to equivalent pattern sets that are\n // faster to process in a filesystem walk. The goal is to\n // eliminate what we can, and push all ** patterns as far\n // to the right as possible, even if it increases the number\n // of patterns that we have to process.\n preprocess(globParts: string[][]) {\n // if we're not in globstar mode, then turn all ** into *\n if (this.options.noglobstar) {\n for (let i = 0; i < globParts.length; i++) {\n for (let j = 0; j < globParts[i].length; j++) {\n if (globParts[i][j] === '**') {\n globParts[i][j] = '*'\n }\n }\n }\n }\n\n const { optimizationLevel = 1 } = this.options\n\n if (optimizationLevel >= 2) {\n // aggressive optimization for the purpose of fs walking\n globParts = this.firstPhasePreProcess(globParts)\n globParts = this.secondPhasePreProcess(globParts)\n } else if (optimizationLevel >= 1) {\n // just basic optimizations to remove some .. parts\n globParts = this.levelOneOptimize(globParts)\n } else {\n // just collapse multiple ** portions into one\n globParts = this.adjascentGlobstarOptimize(globParts)\n }\n\n return globParts\n }\n\n // just get rid of adjascent ** portions\n adjascentGlobstarOptimize(globParts: string[][]) {\n return globParts.map(parts => {\n let gs: number = -1\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let i = gs\n while (parts[i + 1] === '**') {\n i++\n }\n if (i !== gs) {\n parts.splice(gs, i - gs)\n }\n }\n return parts\n })\n }\n\n // get rid of adjascent ** and resolve .. portions\n levelOneOptimize(globParts: string[][]) {\n return globParts.map(parts => {\n parts = parts.reduce((set: string[], part) => {\n const prev = set[set.length - 1]\n if (part === '**' && prev === '**') {\n return set\n }\n if (part === '..') {\n if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n set.pop()\n return set\n }\n }\n set.push(part)\n return set\n }, [])\n return parts.length === 0 ? [''] : parts\n })\n }\n\n levelTwoFileOptimize(parts: string | string[]) {\n if (!Array.isArray(parts)) {\n parts = this.slashSplit(parts)\n }\n let didSomething: boolean = false\n do {\n didSomething = false\n //
// -> 
/\n      if (!this.preserveMultipleSlashes) {\n        for (let i = 1; i < parts.length - 1; i++) {\n          const p = parts[i]\n          // don't squeeze out UNC patterns\n          if (i === 1 && p === '' && parts[0] === '') continue\n          if (p === '.' || p === '') {\n            didSomething = true\n            parts.splice(i, 1)\n            i--\n          }\n        }\n        if (\n          parts[0] === '.' &&\n          parts.length === 2 &&\n          (parts[1] === '.' || parts[1] === '')\n        ) {\n          didSomething = true\n          parts.pop()\n        }\n      }\n\n      // 
/

/../ ->

/\n      let dd: number = 0\n      while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n        const p = parts[dd - 1]\n        if (p && p !== '.' && p !== '..' && p !== '**') {\n          didSomething = true\n          parts.splice(dd - 1, 2)\n          dd -= 2\n        }\n      }\n    } while (didSomething)\n    return parts.length === 0 ? [''] : parts\n  }\n\n  // First phase: single-pattern processing\n  // 
 is 1 or more portions\n  //  is 1 or more portions\n  // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n  // 
/

/../ ->

/\n  // **/**/ -> **/\n  //\n  // **/*/ -> */**/ <== not valid because ** doesn't follow\n  // this WOULD be allowed if ** did follow symlinks, or * didn't\n  firstPhasePreProcess(globParts: string[][]) {\n    let didSomething = false\n    do {\n      didSomething = false\n      // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs: number = -1\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss: number = gs\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n            gss++\n          }\n          // eg, if gs is 2 and gss is 4, that means we have 3 **\n          // parts, and can remove 2 of them.\n          if (gss > gs) {\n            parts.splice(gs + 1, gss - gs)\n          }\n\n          let next = parts[gs + 1]\n          const p = parts[gs + 2]\n          const p2 = parts[gs + 3]\n          if (next !== '..') continue\n          if (\n            !p ||\n            p === '.' ||\n            p === '..' ||\n            !p2 ||\n            p2 === '.' ||\n            p2 === '..'\n          ) {\n            continue\n          }\n          didSomething = true\n          // edit parts in place, and push the new one\n          parts.splice(gs, 1)\n          const other = parts.slice(0)\n          other[gs] = '**'\n          globParts.push(other)\n          gs--\n        }\n\n        // 
// -> 
/\n        if (!this.preserveMultipleSlashes) {\n          for (let i = 1; i < parts.length - 1; i++) {\n            const p = parts[i]\n            // don't squeeze out UNC patterns\n            if (i === 1 && p === '' && parts[0] === '') continue\n            if (p === '.' || p === '') {\n              didSomething = true\n              parts.splice(i, 1)\n              i--\n            }\n          }\n          if (\n            parts[0] === '.' &&\n            parts.length === 2 &&\n            (parts[1] === '.' || parts[1] === '')\n          ) {\n            didSomething = true\n            parts.pop()\n          }\n        }\n\n        // 
/

/../ ->

/\n        let dd: number = 0\n        while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n          const p = parts[dd - 1]\n          if (p && p !== '.' && p !== '..' && p !== '**') {\n            didSomething = true\n            const needDot = dd === 1 && parts[dd + 1] === '**'\n            const splin = needDot ? ['.'] : []\n            parts.splice(dd - 1, 2, ...splin)\n            if (parts.length === 0) parts.push('')\n            dd -= 2\n          }\n        }\n      }\n    } while (didSomething)\n\n    return globParts\n  }\n\n  // second phase: multi-pattern dedupes\n  // {
/*/,
/

/} ->

/*/\n  // {
/,
/} -> 
/\n  // {
/**/,
/} -> 
/**/\n  //\n  // {
/**/,
/**/

/} ->

/**/\n  // ^-- not valid because ** doens't follow symlinks\n  secondPhasePreProcess(globParts: string[][]): string[][] {\n    for (let i = 0; i < globParts.length - 1; i++) {\n      for (let j = i + 1; j < globParts.length; j++) {\n        const matched = this.partsMatch(\n          globParts[i],\n          globParts[j],\n          !this.preserveMultipleSlashes\n        )\n        if (matched) {\n          globParts[i] = []\n          globParts[j] = matched\n          break\n        }\n      }\n    }\n    return globParts.filter(gs => gs.length)\n  }\n\n  partsMatch(\n    a: string[],\n    b: string[],\n    emptyGSMatch: boolean = false\n  ): false | string[] {\n    let ai = 0\n    let bi = 0\n    let result: string[] = []\n    let which: string = ''\n    while (ai < a.length && bi < b.length) {\n      if (a[ai] === b[bi]) {\n        result.push(which === 'b' ? b[bi] : a[ai])\n        ai++\n        bi++\n      } else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n        result.push(a[ai])\n        ai++\n      } else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n        result.push(b[bi])\n        bi++\n      } else if (\n        a[ai] === '*' &&\n        b[bi] &&\n        (this.options.dot || !b[bi].startsWith('.')) &&\n        b[bi] !== '**'\n      ) {\n        if (which === 'b') return false\n        which = 'a'\n        result.push(a[ai])\n        ai++\n        bi++\n      } else if (\n        b[bi] === '*' &&\n        a[ai] &&\n        (this.options.dot || !a[ai].startsWith('.')) &&\n        a[ai] !== '**'\n      ) {\n        if (which === 'a') return false\n        which = 'b'\n        result.push(b[bi])\n        ai++\n        bi++\n      } else {\n        return false\n      }\n    }\n    // if we fall out of the loop, it means they two are identical\n    // as long as their lengths match\n    return a.length === b.length && result\n  }\n\n  parseNegate() {\n    if (this.nonegate) return\n\n    const pattern = this.pattern\n    let negate = false\n    let negateOffset = 0\n\n    for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n      negate = !negate\n      negateOffset++\n    }\n\n    if (negateOffset) this.pattern = pattern.slice(negateOffset)\n    this.negate = negate\n  }\n\n  // set partial to true to test if, for example,\n  // \"/a/b\" matches the start of \"/*/b/*/d\"\n  // Partial means, if you run out of file before you run\n  // out of pattern, then that's fine, as long as all\n  // the parts match.\n  matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean = false\n  ) {\n    let fileStartIndex = 0\n    let patternStartIndex = 0\n\n    // UNC paths like //?/X:/... can match X:/... and vice versa\n    // Drive letters in absolute drive or unc paths are always compared\n    // case-insensitively.\n    if (this.isWindows) {\n      const fileDrive =\n        typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0])\n      const fileUNC =\n        !fileDrive &&\n        file[0] === '' &&\n        file[1] === '' &&\n        file[2] === '?' &&\n        /^[a-z]:$/i.test(file[3])\n\n      const patternDrive =\n        typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0])\n      const patternUNC =\n        !patternDrive &&\n        pattern[0] === '' &&\n        pattern[1] === '' &&\n        pattern[2] === '?' &&\n        typeof pattern[3] === 'string' &&\n        /^[a-z]:$/i.test(pattern[3])\n\n      const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined\n      const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined\n      if (typeof fdi === 'number' && typeof pdi === 'number') {\n        const [fd, pd]: [string, string] = [\n          file[fdi],\n          pattern[pdi] as string,\n        ]\n        if (fd.toLowerCase() === pd.toLowerCase()) {\n          pattern[pdi] = fd\n          patternStartIndex = pdi\n          fileStartIndex = fdi\n        }\n      }\n    }\n\n    // resolve and reduce . and .. portions in the file as well.\n    // dont' need to do the second phase, because it's only one string[]\n    const { optimizationLevel = 1 } = this.options\n    if (optimizationLevel >= 2) {\n      file = this.levelTwoFileOptimize(file)\n    }\n\n    if (pattern.includes(GLOBSTAR)) {\n      return this.#matchGlobstar(\n        file, pattern, partial, fileStartIndex, patternStartIndex\n      )\n    }\n\n    return this.#matchOne(\n      file, pattern, partial, fileStartIndex, patternStartIndex\n    )\n  }\n\n  #matchGlobstar(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number\n  ) {\n    const firstgs = pattern.indexOf(GLOBSTAR, patternIndex)\n    const lastgs = pattern.lastIndexOf(GLOBSTAR)\n\n    const [head, body, tail] = partial ? [\n      pattern.slice(patternIndex, firstgs),\n      pattern.slice(firstgs + 1),\n      [],\n    ] : [\n      pattern.slice(patternIndex, firstgs),\n      pattern.slice(firstgs + 1, lastgs),\n      pattern.slice(lastgs + 1),\n    ]\n\n    if (head.length) {\n      const fileHead = file.slice(fileIndex, fileIndex + head.length)\n      if (!this.#matchOne(fileHead, head, partial, 0, 0)) return false\n      fileIndex += head.length\n    }\n\n    let fileTailMatch: number = 0\n    if (tail.length) {\n      if (tail.length + fileIndex > file.length) return false\n      let tailStart = file.length - tail.length\n      if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n        fileTailMatch = tail.length\n      } else {\n        if (\n          file[file.length - 1] !== '' ||\n          fileIndex + tail.length === file.length\n        ) {\n          return false\n        }\n        tailStart--\n        if (!this.#matchOne(file, tail, partial, tailStart, 0)) return false\n        fileTailMatch = tail.length + 1\n      }\n    }\n\n    if (!body.length) {\n      let sawSome = !!fileTailMatch\n      for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n        const f = String(file[i])\n        sawSome = true\n        if (\n          f === '.' || f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      return partial || sawSome\n    }\n\n    const bodySegments: [ParseReturn[], number][] = [[[], 0]]\n    let currentBody: [ParseReturn[], number] = bodySegments[0]\n    let nonGsParts = 0\n    const nonGsPartsSums: number[] = [0]\n    for (const b of body) {\n      if (b === GLOBSTAR) {\n        nonGsPartsSums.push(nonGsParts)\n        currentBody = [[], 0]\n        bodySegments.push(currentBody)\n      } else {\n        currentBody[0].push(b)\n        nonGsParts++\n      }\n    }\n    let i = bodySegments.length - 1\n    const fileLength = file.length - fileTailMatch\n    for (const b of bodySegments) {\n      b[1] = fileLength - ((nonGsPartsSums[i--] as number) + b[0].length)\n    }\n\n    return !!this.#matchGlobStarBodySections(\n      file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch\n    )\n  }\n\n  #matchGlobStarBodySections(\n    file: string[],\n    bodySegments: [ParseReturn[], number][],\n    fileIndex: number,\n    bodyIndex: number,\n    partial: boolean,\n    globStarDepth: number,\n    sawTail: boolean\n  ): boolean | null {\n    const bs = bodySegments[bodyIndex]\n    if (!bs) {\n      for (let i = fileIndex; i < file.length; i++) {\n        sawTail = true\n        const f = file[i]\n        if (\n          f === '.' || f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      return sawTail\n    }\n\n    const [body, after] = bs\n    while (fileIndex <= after) {\n      const m = this.#matchOne(\n        file.slice(0, fileIndex + body.length),\n        body, partial, fileIndex, 0\n      )\n      if (m && globStarDepth < this.maxGlobstarRecursion) {\n        const sub = this.#matchGlobStarBodySections(\n          file, bodySegments, fileIndex + body.length,\n          bodyIndex + 1, partial, globStarDepth + 1, sawTail\n        )\n        if (sub !== false) return sub\n      }\n      const f = file[fileIndex]\n      if (\n        f === '.' || f === '..' ||\n        (!this.options.dot && f.startsWith('.'))\n      ) {\n        return false\n      }\n      fileIndex++\n    }\n    return partial || null\n  }\n\n  #matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number\n  ) {\n    let fi: number\n    let pi: number\n    let pl: number\n    let fl: number\n    for (\n      fi = fileIndex, pi = patternIndex,\n        fl = file.length, pl = pattern.length;\n      fi < fl && pi < pl;\n      fi++, pi++\n    ) {\n      this.debug('matchOne loop')\n      let p = pattern[pi]\n      let f = file[fi]\n\n      this.debug(pattern, p, f)\n\n      /* c8 ignore start */\n      if (p === false || p === GLOBSTAR) return false\n      /* c8 ignore stop */\n\n      let hit: boolean\n      if (typeof p === 'string') {\n        hit = f === p\n        this.debug('string match', p, f, hit)\n      } else {\n        hit = p.test(f)\n        this.debug('pattern match', p, f, hit)\n      }\n\n      if (!hit) return false\n    }\n\n    if (fi === fl && pi === pl) {\n      return true\n    } else if (fi === fl) {\n      return partial\n    } else if (pi === pl) {\n      return fi === fl - 1 && file[fi] === ''\n      /* c8 ignore start */\n    } else {\n      throw new Error('wtf?')\n    }\n    /* c8 ignore stop */\n  }\n\n  braceExpand(): string[] {\n    return braceExpand(this.pattern, this.options)\n  }\n\n  parse(pattern: string): ParseReturn {\n    assertValidPattern(pattern)\n\n    const options = this.options\n\n    // shortcuts\n    if (pattern === '**') return GLOBSTAR\n    if (pattern === '') return ''\n\n    // far and away, the most common glob pattern parts are\n    // *, *.*, and *.  Add a fast check method for those.\n    let m: RegExpMatchArray | null\n    let fastTest: null | ((f: string) => boolean) = null\n    if ((m = pattern.match(starRE))) {\n      fastTest = options.dot ? starTestDot : starTest\n    } else if ((m = pattern.match(starDotExtRE))) {\n      fastTest = (\n        options.nocase\n          ? options.dot\n            ? starDotExtTestNocaseDot\n            : starDotExtTestNocase\n          : options.dot\n          ? starDotExtTestDot\n          : starDotExtTest\n      )(m[1])\n    } else if ((m = pattern.match(qmarksRE))) {\n      fastTest = (\n        options.nocase\n          ? options.dot\n            ? qmarksTestNocaseDot\n            : qmarksTestNocase\n          : options.dot\n          ? qmarksTestDot\n          : qmarksTest\n      )(m)\n    } else if ((m = pattern.match(starDotStarRE))) {\n      fastTest = options.dot ? starDotStarTestDot : starDotStarTest\n    } else if ((m = pattern.match(dotStarRE))) {\n      fastTest = dotStarTest\n    }\n\n    const re = AST.fromGlob(pattern, this.options).toMMPattern()\n    if (fastTest && typeof re === 'object') {\n      // Avoids overriding in frozen environments\n      Reflect.defineProperty(re, 'test', { value: fastTest })\n    }\n    return re\n  }\n\n  makeRe() {\n    if (this.regexp || this.regexp === false) return this.regexp\n\n    // at this point, this.set is a 2d array of partial\n    // pattern strings, or \"**\".\n    //\n    // It's better to use .match().  This function shouldn't\n    // be used, really, but it's pretty convenient sometimes,\n    // when you just want to work with a regex.\n    const set = this.set\n\n    if (!set.length) {\n      this.regexp = false\n      return this.regexp\n    }\n    const options = this.options\n\n    const twoStar = options.noglobstar\n      ? star\n      : options.dot\n      ? twoStarDot\n      : twoStarNoDot\n    const flags = new Set(options.nocase ? ['i'] : [])\n\n    // regexpify non-globstar patterns\n    // if ** is only item, then we just do one twoStar\n    // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n    // if ** is last, append (\\/twoStar|) to previous\n    // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n    // then filter out GLOBSTAR symbols\n    let re = set\n      .map(pattern => {\n        const pp: (string | typeof GLOBSTAR)[] = pattern.map(p => {\n          if (p instanceof RegExp) {\n            for (const f of p.flags.split('')) flags.add(f)\n          }\n          return typeof p === 'string'\n            ? regExpEscape(p)\n            : p === GLOBSTAR\n            ? GLOBSTAR\n            : p._src\n        }) as (string | typeof GLOBSTAR)[]\n        pp.forEach((p, i) => {\n          const next = pp[i + 1]\n          const prev = pp[i - 1]\n          if (p !== GLOBSTAR || prev === GLOBSTAR) {\n            return\n          }\n          if (prev === undefined) {\n            if (next !== undefined && next !== GLOBSTAR) {\n              pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next\n            } else {\n              pp[i] = twoStar\n            }\n          } else if (next === undefined) {\n            pp[i - 1] = prev + '(?:\\\\/|' + twoStar + ')?'\n          } else if (next !== GLOBSTAR) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next\n            pp[i + 1] = GLOBSTAR\n          }\n        })\n        return pp.filter(p => p !== GLOBSTAR).join('/')\n      })\n      .join('|')\n\n    // need to wrap in parens if we had more than one thing with |,\n    // otherwise only the first will be anchored to ^ and the last to $\n    const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', '']\n    // must match entire pattern\n    // ending in a * or ** will make it less strict.\n    re = '^' + open + re + close + '$'\n\n    // can match anything, as long as it's not this.\n    if (this.negate) re = '^(?!' + re + ').+$'\n\n    try {\n      this.regexp = new RegExp(re, [...flags].join(''))\n      /* c8 ignore start */\n    } catch (ex) {\n      // should be impossible\n      this.regexp = false\n    }\n    /* c8 ignore stop */\n    return this.regexp\n  }\n\n  slashSplit(p: string) {\n    // if p starts with // on windows, we preserve that\n    // so that UNC paths aren't broken.  Otherwise, any number of\n    // / characters are coalesced into one, unless\n    // preserveMultipleSlashes is set to true.\n    if (this.preserveMultipleSlashes) {\n      return p.split('/')\n    } else if (this.isWindows && /^\\/\\/[^\\/]+/.test(p)) {\n      // add an extra '' for the one we lose\n      return ['', ...p.split(/\\/+/)]\n    } else {\n      return p.split(/\\/+/)\n    }\n  }\n\n  match(f: string, partial = this.partial) {\n    this.debug('match', f, this.pattern)\n    // short-circuit in the case of busted things.\n    // comments, etc.\n    if (this.comment) {\n      return false\n    }\n    if (this.empty) {\n      return f === ''\n    }\n\n    if (f === '/' && partial) {\n      return true\n    }\n\n    const options = this.options\n\n    // windows: need to use /, not \\\n    if (this.isWindows) {\n      f = f.split('\\\\').join('/')\n    }\n\n    // treat the test path as a set of pathparts.\n    const ff = this.slashSplit(f)\n    this.debug(this.pattern, 'split', ff)\n\n    // just ONE of the pattern sets in this.set needs to match\n    // in order for it to be valid.  If negating, then just one\n    // match means that we have failed.\n    // Either way, return on the first hit.\n\n    const set = this.set\n    this.debug(this.pattern, 'set', set)\n\n    // Find the basename of the path by looking for the last non-empty segment\n    let filename: string = ff[ff.length - 1]\n    if (!filename) {\n      for (let i = ff.length - 2; !filename && i >= 0; i--) {\n        filename = ff[i]\n      }\n    }\n\n    for (let i = 0; i < set.length; i++) {\n      const pattern = set[i]\n      let file = ff\n      if (options.matchBase && pattern.length === 1) {\n        file = [filename]\n      }\n      const hit = this.matchOne(file, pattern, partial)\n      if (hit) {\n        if (options.flipNegate) {\n          return true\n        }\n        return !this.negate\n      }\n    }\n\n    // didn't get any hits.  this is success if it's a negative\n    // pattern, failure otherwise.\n    if (options.flipNegate) {\n      return false\n    }\n    return this.negate\n  }\n\n  static defaults(def: MinimatchOptions) {\n    return minimatch.defaults(def).Minimatch\n  }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js'\nexport { escape } from './escape.js'\nexport { unescape } from './unescape.js'\n/* c8 ignore stop */\nminimatch.AST = AST\nminimatch.Minimatch = Minimatch\nminimatch.escape = escape\nminimatch.unescape = unescape\n","/**\n * @module LRUCache\n */\n\n// module-private names and types\ntype Perf = { now: () => number }\nconst perf: Perf =\n  typeof performance === 'object' &&\n  performance &&\n  typeof performance.now === 'function'\n    ? performance\n    : Date\n\nconst warned = new Set()\n\n// either a function or a class\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n  typeof process === 'object' && !!process ? process : {}\n) as { [k: string]: any }\n/* c8 ignore start */\n\nconst emitWarning = (\n  msg: string,\n  type: string,\n  code: string,\n  fn: ForC\n) => {\n  typeof PROCESS.emitWarning === 'function'\n    ? PROCESS.emitWarning(msg, type, code, fn)\n    : console.error(`[${code}] ${type}: ${msg}`)\n}\n\nlet AC = globalThis.AbortController\nlet AS = globalThis.AbortSignal\n\n/* c8 ignore start */\nif (typeof AC === 'undefined') {\n  //@ts-ignore\n  AS = class AbortSignal {\n    onabort?: (...a: any[]) => any\n    _onabort: ((...a: any[]) => any)[] = []\n    reason?: any\n    aborted: boolean = false\n    addEventListener(_: string, fn: (...a: any[]) => any) {\n      this._onabort.push(fn)\n    }\n  }\n  //@ts-ignore\n  AC = class AbortController {\n    constructor() {\n      warnACPolyfill()\n    }\n    signal = new AS()\n    abort(reason: any) {\n      if (this.signal.aborted) return\n      //@ts-ignore\n      this.signal.reason = reason\n      //@ts-ignore\n      this.signal.aborted = true\n      //@ts-ignore\n      for (const fn of this.signal._onabort) {\n        fn(reason)\n      }\n      this.signal.onabort?.(reason)\n    }\n  }\n  let printACPolyfillWarning =\n    PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1'\n  const warnACPolyfill = () => {\n    if (!printACPolyfillWarning) return\n    printACPolyfillWarning = false\n    emitWarning(\n      'AbortController is not defined. If using lru-cache in ' +\n        'node 14, load an AbortController polyfill from the ' +\n        '`node-abort-controller` package. A minimal polyfill is ' +\n        'provided for use by LRUCache.fetch(), but it should not be ' +\n        'relied upon in other contexts (eg, passing it to other APIs that ' +\n        'use AbortController/AbortSignal might have undesirable effects). ' +\n        'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.',\n      'NO_ABORT_CONTROLLER',\n      'ENOTSUP',\n      warnACPolyfill\n    )\n  }\n}\n/* c8 ignore stop */\n\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: any): n is PosInt =>\n  n && n === Math.floor(n) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values.  Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max: number) =>\n  !isPosInt(max)\n    ? null\n    : max <= Math.pow(2, 8)\n    ? Uint8Array\n    : max <= Math.pow(2, 16)\n    ? Uint16Array\n    : max <= Math.pow(2, 32)\n    ? Uint32Array\n    : max <= Number.MAX_SAFE_INTEGER\n    ? ZeroArray\n    : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n  constructor(size: number) {\n    super(size)\n    this.fill(0)\n  }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n  heap: NumberArray\n  length: number\n  // private constructor\n  static #constructing: boolean = false\n  static create(max: number): StackLike {\n    const HeapCls = getUintArray(max)\n    if (!HeapCls) return []\n    Stack.#constructing = true\n    const s = new Stack(max, HeapCls)\n    Stack.#constructing = false\n    return s\n  }\n  constructor(\n    max: number,\n    HeapCls: { new (n: number): NumberArray }\n  ) {\n    /* c8 ignore start */\n    if (!Stack.#constructing) {\n      throw new TypeError('instantiate Stack using Stack.create(n)')\n    }\n    /* c8 ignore stop */\n    this.heap = new HeapCls(max)\n    this.length = 0\n  }\n  push(n: Index) {\n    this.heap[this.length++] = n\n  }\n  pop(): Index {\n    return this.heap[--this.length] as Index\n  }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n  __returned: BackgroundFetch | undefined\n  __abortController: AbortController\n  __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n  value: V,\n  key: K,\n  reason: LRUCache.DisposeReason\n]\n\nexport namespace LRUCache {\n  /**\n   * An integer greater than 0, reflecting the calculated size of items\n   */\n  export type Size = number\n\n  /**\n   * Integer greater than 0, representing some number of milliseconds, or the\n   * time at which a TTL started counting from.\n   */\n  export type Milliseconds = number\n\n  /**\n   * An integer greater than 0, reflecting a number of items\n   */\n  export type Count = number\n\n  /**\n   * The reason why an item was removed from the cache, passed\n   * to the {@link Disposer} methods.\n   *\n   * - `evict`: The item was evicted because it is the least recently used,\n   *   and the cache is full.\n   * - `set`: A new value was set, overwriting the old value being disposed.\n   * - `delete`: The item was explicitly deleted, either by calling\n   *   {@link LRUCache#delete}, {@link LRUCache#clear}, or\n   *   {@link LRUCache#set} with an undefined value.\n   * - `expire`: The item was removed due to exceeding its TTL.\n   * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n   *   `undefined` or was aborted, causing the item to be deleted.\n   */\n  export type DisposeReason =\n    | 'evict'\n    | 'set'\n    | 'delete'\n    | 'expire'\n    | 'fetch'\n  /**\n   * A method called upon item removal, passed as the\n   * {@link OptionsBase.dispose} and/or\n   * {@link OptionsBase.disposeAfter} options.\n   */\n  export type Disposer = (\n    value: V,\n    key: K,\n    reason: DisposeReason\n  ) => void\n\n  /**\n   * A function that returns the effective calculated size\n   * of an entry in the cache.\n   */\n  export type SizeCalculator = (value: V, key: K) => Size\n\n  /**\n   * Options provided to the\n   * {@link OptionsBase.fetchMethod} function.\n   */\n  export interface FetcherOptions {\n    signal: AbortSignal\n    options: FetcherFetchOptions\n    /**\n     * Object provided in the {@link FetchOptions.context} option to\n     * {@link LRUCache#fetch}\n     */\n    context: FC\n  }\n\n  /**\n   * Occasionally, it may be useful to track the internal behavior of the\n   * cache, particularly for logging, debugging, or for behavior within the\n   * `fetchMethod`. To do this, you can pass a `status` object to the\n   * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n   * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n   *\n   * The `status` option should be a plain JavaScript object. The following\n   * fields will be set on it appropriately, depending on the situation.\n   */\n  export interface Status {\n    /**\n     * The status of a set() operation.\n     *\n     * - add: the item was not found in the cache, and was added\n     * - update: the item was in the cache, with the same value provided\n     * - replace: the item was in the cache, and replaced\n     * - miss: the item was not added to the cache for some reason\n     */\n    set?: 'add' | 'update' | 'replace' | 'miss'\n\n    /**\n     * the ttl stored for the item, or undefined if ttls are not used.\n     */\n    ttl?: Milliseconds\n\n    /**\n     * the start time for the item, or undefined if ttls are not used.\n     */\n    start?: Milliseconds\n\n    /**\n     * The timestamp used for TTL calculation\n     */\n    now?: Milliseconds\n\n    /**\n     * the remaining ttl for the item, or undefined if ttls are not used.\n     */\n    remainingTTL?: Milliseconds\n\n    /**\n     * The calculated size for the item, if sizes are used.\n     */\n    entrySize?: Size\n\n    /**\n     * The total calculated size of the cache, if sizes are used.\n     */\n    totalCalculatedSize?: Size\n\n    /**\n     * A flag indicating that the item was not stored, due to exceeding the\n     * {@link OptionsBase.maxEntrySize}\n     */\n    maxEntrySizeExceeded?: true\n\n    /**\n     * The old value, specified in the case of `set:'update'` or\n     * `set:'replace'`\n     */\n    oldValue?: V\n\n    /**\n     * The results of a {@link LRUCache#has} operation\n     *\n     * - hit: the item was found in the cache\n     * - stale: the item was found in the cache, but is stale\n     * - miss: the item was not found in the cache\n     */\n    has?: 'hit' | 'stale' | 'miss'\n\n    /**\n     * The status of a {@link LRUCache#fetch} operation.\n     * Note that this can change as the underlying fetch() moves through\n     * various states.\n     *\n     * - inflight: there is another fetch() for this key which is in process\n     * - get: there is no {@link OptionsBase.fetchMethod}, so\n     *   {@link LRUCache#get} was called.\n     * - miss: the item is not in cache, and will be fetched.\n     * - hit: the item is in the cache, and was resolved immediately.\n     * - stale: the item is in the cache, but stale.\n     * - refresh: the item is in the cache, and not stale, but\n     *   {@link FetchOptions.forceRefresh} was specified.\n     */\n    fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n    /**\n     * The {@link OptionsBase.fetchMethod} was called\n     */\n    fetchDispatched?: true\n\n    /**\n     * The cached value was updated after a successful call to\n     * {@link OptionsBase.fetchMethod}\n     */\n    fetchUpdated?: true\n\n    /**\n     * The reason for a fetch() rejection.  Either the error raised by the\n     * {@link OptionsBase.fetchMethod}, or the reason for an\n     * AbortSignal.\n     */\n    fetchError?: Error\n\n    /**\n     * The fetch received an abort signal\n     */\n    fetchAborted?: true\n\n    /**\n     * The abort signal received was ignored, and the fetch was allowed to\n     * continue.\n     */\n    fetchAbortIgnored?: true\n\n    /**\n     * The fetchMethod promise resolved successfully\n     */\n    fetchResolved?: true\n\n    /**\n     * The fetchMethod promise was rejected\n     */\n    fetchRejected?: true\n\n    /**\n     * The status of a {@link LRUCache#get} operation.\n     *\n     * - fetching: The item is currently being fetched.  If a previous value\n     *   is present and allowed, that will be returned.\n     * - stale: The item is in the cache, and is stale.\n     * - hit: the item is in the cache\n     * - miss: the item is not in the cache\n     */\n    get?: 'stale' | 'hit' | 'miss'\n\n    /**\n     * A fetch or get operation returned a stale value.\n     */\n    returnedStale?: true\n  }\n\n  /**\n   * options which override the options set in the LRUCache constructor\n   * when calling {@link LRUCache#fetch}.\n   *\n   * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n   * {@link OptionsBase.noDeleteOnFetchRejection},\n   * {@link OptionsBase.allowStaleOnFetchRejection},\n   * {@link FetchOptions.forceRefresh}, and\n   * {@link FetcherOptions.context}\n   *\n   * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n   * function, but the {@link GetOptions} fields will of course have no\n   * effect, as the {@link LRUCache#get} call already happened by the time\n   * the fetchMethod is called.\n   */\n  export interface FetcherFetchOptions\n    extends Pick<\n      OptionsBase,\n      | 'allowStale'\n      | 'updateAgeOnGet'\n      | 'noDeleteOnStaleGet'\n      | 'sizeCalculation'\n      | 'ttl'\n      | 'noDisposeOnSet'\n      | 'noUpdateTTL'\n      | 'noDeleteOnFetchRejection'\n      | 'allowStaleOnFetchRejection'\n      | 'ignoreFetchAbort'\n      | 'allowStaleOnFetchAbort'\n    > {\n    status?: Status\n    size?: Size\n  }\n\n  /**\n   * Options that may be passed to the {@link LRUCache#fetch} method.\n   */\n  export interface FetchOptions\n    extends FetcherFetchOptions {\n    /**\n     * Set to true to force a re-load of the existing data, even if it\n     * is not yet stale.\n     */\n    forceRefresh?: boolean\n    /**\n     * Context provided to the {@link OptionsBase.fetchMethod} as\n     * the {@link FetcherOptions.context} param.\n     *\n     * If the FC type is specified as unknown (the default),\n     * undefined or void, then this is optional.  Otherwise, it will\n     * be required.\n     */\n    context?: FC\n    signal?: AbortSignal\n    status?: Status\n  }\n  /**\n   * Options provided to {@link LRUCache#fetch} when the FC type is something\n   * other than `unknown`, `undefined`, or `void`\n   */\n  export interface FetchOptionsWithContext\n    extends FetchOptions {\n    context: FC\n  }\n  /**\n   * Options provided to {@link LRUCache#fetch} when the FC type is\n   * `undefined` or `void`\n   */\n  export interface FetchOptionsNoContext\n    extends FetchOptions {\n    context?: undefined\n  }\n\n  export interface MemoOptions\n    extends Pick<\n      OptionsBase,\n      | 'allowStale'\n      | 'updateAgeOnGet'\n      | 'noDeleteOnStaleGet'\n      | 'sizeCalculation'\n      | 'ttl'\n      | 'noDisposeOnSet'\n      | 'noUpdateTTL'\n      | 'noDeleteOnFetchRejection'\n      | 'allowStaleOnFetchRejection'\n      | 'ignoreFetchAbort'\n      | 'allowStaleOnFetchAbort'\n    > {\n    /**\n     * Set to true to force a re-load of the existing data, even if it\n     * is not yet stale.\n     */\n    forceRefresh?: boolean\n    /**\n     * Context provided to the {@link OptionsBase.memoMethod} as\n     * the {@link MemoizerOptions.context} param.\n     *\n     * If the FC type is specified as unknown (the default),\n     * undefined or void, then this is optional.  Otherwise, it will\n     * be required.\n     */\n    context?: FC\n    status?: Status\n  }\n  /**\n   * Options provided to {@link LRUCache#memo} when the FC type is something\n   * other than `unknown`, `undefined`, or `void`\n   */\n  export interface MemoOptionsWithContext\n    extends MemoOptions {\n    context: FC\n  }\n  /**\n   * Options provided to {@link LRUCache#memo} when the FC type is\n   * `undefined` or `void`\n   */\n  export interface MemoOptionsNoContext\n    extends MemoOptions {\n    context?: undefined\n  }\n\n  /**\n   * Options provided to the\n   * {@link OptionsBase.memoMethod} function.\n   */\n  export interface MemoizerOptions {\n    options: MemoizerMemoOptions\n    /**\n     * Object provided in the {@link MemoOptions.context} option to\n     * {@link LRUCache#memo}\n     */\n    context: FC\n  }\n\n  /**\n   * options which override the options set in the LRUCache constructor\n   * when calling {@link LRUCache#memo}.\n   *\n   * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n   * {@link MemoOptions.forceRefresh}, and\n   * {@link MemoerOptions.context}\n   *\n   * Any of these may be modified in the {@link OptionsBase.memoMethod}\n   * function, but the {@link GetOptions} fields will of course have no\n   * effect, as the {@link LRUCache#get} call already happened by the time\n   * the memoMethod is called.\n   */\n  export interface MemoizerMemoOptions\n    extends Pick<\n      OptionsBase,\n      | 'allowStale'\n      | 'updateAgeOnGet'\n      | 'noDeleteOnStaleGet'\n      | 'sizeCalculation'\n      | 'ttl'\n      | 'noDisposeOnSet'\n      | 'noUpdateTTL'\n    > {\n    status?: Status\n    size?: Size\n    start?: Milliseconds\n  }\n\n  /**\n   * Options that may be passed to the {@link LRUCache#has} method.\n   */\n  export interface HasOptions\n    extends Pick, 'updateAgeOnHas'> {\n    status?: Status\n  }\n\n  /**\n   * Options that may be passed to the {@link LRUCache#get} method.\n   */\n  export interface GetOptions\n    extends Pick<\n      OptionsBase,\n      'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n    > {\n    status?: Status\n  }\n\n  /**\n   * Options that may be passed to the {@link LRUCache#peek} method.\n   */\n  export interface PeekOptions\n    extends Pick, 'allowStale'> {}\n\n  /**\n   * Options that may be passed to the {@link LRUCache#set} method.\n   */\n  export interface SetOptions\n    extends Pick<\n      OptionsBase,\n      'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n    > {\n    /**\n     * If size tracking is enabled, then setting an explicit size\n     * in the {@link LRUCache#set} call will prevent calling the\n     * {@link OptionsBase.sizeCalculation} function.\n     */\n    size?: Size\n    /**\n     * If TTL tracking is enabled, then setting an explicit start\n     * time in the {@link LRUCache#set} call will override the\n     * default time from `performance.now()` or `Date.now()`.\n     *\n     * Note that it must be a valid value for whichever time-tracking\n     * method is in use.\n     */\n    start?: Milliseconds\n    status?: Status\n  }\n\n  /**\n   * The type signature for the {@link OptionsBase.fetchMethod} option.\n   */\n  export type Fetcher = (\n    key: K,\n    staleValue: V | undefined,\n    options: FetcherOptions\n  ) => Promise | V | undefined | void\n\n  /**\n   * the type signature for the {@link OptionsBase.memoMethod} option.\n   */\n  export type Memoizer = (\n    key: K,\n    staleValue: V | undefined,\n    options: MemoizerOptions\n  ) => V\n\n  /**\n   * Options which may be passed to the {@link LRUCache} constructor.\n   *\n   * Most of these may be overridden in the various options that use\n   * them.\n   *\n   * Despite all being technically optional, the constructor requires that\n   * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n   * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n   *\n   * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n   * (and in fact required by the type definitions here) that the cache\n   * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n   * unbounded storage.\n   *\n   * All options are also available on the {@link LRUCache} instance, making\n   * it safe to pass an LRUCache instance as the options argumemnt to\n   * make another empty cache of the same type.\n   *\n   * Some options are marked as read-only, because changing them after\n   * instantiation is not safe. Changing any of the other options will of\n   * course only have an effect on subsequent method calls.\n   */\n  export interface OptionsBase {\n    /**\n     * The maximum number of items to store in the cache before evicting\n     * old entries. This is read-only on the {@link LRUCache} instance,\n     * and may not be overridden.\n     *\n     * If set, then storage space will be pre-allocated at construction\n     * time, and the cache will perform significantly faster.\n     *\n     * Note that significantly fewer items may be stored, if\n     * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n     * set.\n     *\n     * **It is strongly recommended to set a `max` to prevent unbounded growth\n     * of the cache.**\n     */\n    max?: Count\n\n    /**\n     * Max time in milliseconds for items to live in cache before they are\n     * considered stale.  Note that stale items are NOT preemptively removed by\n     * default, and MAY live in the cache, contributing to its LRU max, long\n     * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n     * set.\n     *\n     * If set to `0` (the default value), then that means \"do not track\n     * TTL\", not \"expire immediately\".\n     *\n     * Also, as this cache is optimized for LRU/MRU operations, some of\n     * the staleness/TTL checks will reduce performance, as they will incur\n     * overhead by deleting items.\n     *\n     * This is not primarily a TTL cache, and does not make strong TTL\n     * guarantees. There is no pre-emptive pruning of expired items, but you\n     * _may_ set a TTL on the cache, and it will treat expired items as missing\n     * when they are fetched, and delete them.\n     *\n     * Optional, but must be a non-negative integer in ms if specified.\n     *\n     * This may be overridden by passing an options object to `cache.set()`.\n     *\n     * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n     * positive integer if set.\n     *\n     * Even if ttl tracking is enabled, **it is strongly recommended to set a\n     * `max` to prevent unbounded growth of the cache.**\n     *\n     * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n     * and `ttlAutopurge` is not set, then a warning will be emitted\n     * cautioning about the potential for unbounded memory consumption.\n     * (The TypeScript definitions will also discourage this.)\n     */\n    ttl?: Milliseconds\n\n    /**\n     * Minimum amount of time in ms in which to check for staleness.\n     * Defaults to 1, which means that the current time is checked\n     * at most once per millisecond.\n     *\n     * Set to 0 to check the current time every time staleness is tested.\n     * (This reduces performance, and is theoretically unnecessary.)\n     *\n     * Setting this to a higher value will improve performance somewhat\n     * while using ttl tracking, albeit at the expense of keeping stale\n     * items around a bit longer than their TTLs would indicate.\n     *\n     * @default 1\n     */\n    ttlResolution?: Milliseconds\n\n    /**\n     * Preemptively remove stale items from the cache.\n     *\n     * Note that this may *significantly* degrade performance, especially if\n     * the cache is storing a large number of items. It is almost always best\n     * to just leave the stale items in the cache, and let them fall out as new\n     * items are added.\n     *\n     * Note that this means that {@link OptionsBase.allowStale} is a bit\n     * pointless, as stale items will be deleted almost as soon as they\n     * expire.\n     *\n     * Use with caution!\n     */\n    ttlAutopurge?: boolean\n\n    /**\n     * When using time-expiring entries with `ttl`, setting this to `true` will\n     * make each item's age reset to 0 whenever it is retrieved from cache with\n     * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n     * of cache based on recency of use, of course.)\n     *\n     * Has no effect if {@link OptionsBase.ttl} is not set.\n     *\n     * This may be overridden by passing an options object to `cache.get()`.\n     */\n    updateAgeOnGet?: boolean\n\n    /**\n     * When using time-expiring entries with `ttl`, setting this to `true` will\n     * make each item's age reset to 0 whenever its presence in the cache is\n     * checked with {@link LRUCache#has}, causing it to not expire. (It can\n     * still fall out of cache based on recency of use, of course.)\n     *\n     * Has no effect if {@link OptionsBase.ttl} is not set.\n     */\n    updateAgeOnHas?: boolean\n\n    /**\n     * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n     * stale data, if available.\n     *\n     * By default, if you set `ttl`, stale items will only be deleted from the\n     * cache when you `get(key)`. That is, it's not preemptively pruning items,\n     * unless {@link OptionsBase.ttlAutopurge} is set.\n     *\n     * If you set `allowStale:true`, it'll return the stale value *as well as*\n     * deleting it. If you don't set this, then it'll return `undefined` when\n     * you try to get a stale entry.\n     *\n     * Note that when a stale entry is fetched, _even if it is returned due to\n     * `allowStale` being set_, it is removed from the cache immediately. You\n     * can suppress this behavior by setting\n     * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n     * the options provided to {@link LRUCache#get}.\n     *\n     * This may be overridden by passing an options object to `cache.get()`.\n     * The `cache.has()` method will always return `false` for stale items.\n     *\n     * Only relevant if a ttl is set.\n     */\n    allowStale?: boolean\n\n    /**\n     * Function that is called on items when they are dropped from the\n     * cache, as `dispose(value, key, reason)`.\n     *\n     * This can be handy if you want to close file descriptors or do\n     * other cleanup tasks when items are no longer stored in the cache.\n     *\n     * **NOTE**: It is called _before_ the item has been fully removed\n     * from the cache, so if you want to put it right back in, you need\n     * to wait until the next tick. If you try to add it back in during\n     * the `dispose()` function call, it will break things in subtle and\n     * weird ways.\n     *\n     * Unlike several other options, this may _not_ be overridden by\n     * passing an option to `set()`, for performance reasons.\n     *\n     * The `reason` will be one of the following strings, corresponding\n     * to the reason for the item's deletion:\n     *\n     * - `evict` Item was evicted to make space for a new addition\n     * - `set` Item was overwritten by a new value\n     * - `expire` Item expired its TTL\n     * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n     *   fetchMethod returning `undefined.\n     * - `delete` Item was removed by explicit `cache.delete(key)`,\n     *   `cache.clear()`, or `cache.set(key, undefined)`.\n     */\n    dispose?: Disposer\n\n    /**\n     * The same as {@link OptionsBase.dispose}, but called *after* the entry\n     * is completely removed and the cache is once again in a clean state.\n     *\n     * It is safe to add an item right back into the cache at this point.\n     * However, note that it is *very* easy to inadvertently create infinite\n     * recursion this way.\n     */\n    disposeAfter?: Disposer\n\n    /**\n     * Set to true to suppress calling the\n     * {@link OptionsBase.dispose} function if the entry key is\n     * still accessible within the cache.\n     *\n     * This may be overridden by passing an options object to\n     * {@link LRUCache#set}.\n     *\n     * Only relevant if `dispose` or `disposeAfter` are set.\n     */\n    noDisposeOnSet?: boolean\n\n    /**\n     * Boolean flag to tell the cache to not update the TTL when setting a new\n     * value for an existing key (ie, when updating a value rather than\n     * inserting a new value).  Note that the TTL value is _always_ set (if\n     * provided) when adding a new entry into the cache.\n     *\n     * Has no effect if a {@link OptionsBase.ttl} is not set.\n     *\n     * May be passed as an option to {@link LRUCache#set}.\n     */\n    noUpdateTTL?: boolean\n\n    /**\n     * Set to a positive integer to track the sizes of items added to the\n     * cache, and automatically evict items in order to stay below this size.\n     * Note that this may result in fewer than `max` items being stored.\n     *\n     * Attempting to add an item to the cache whose calculated size is greater\n     * that this amount will be a no-op. The item will not be cached, and no\n     * other items will be evicted.\n     *\n     * Optional, must be a positive integer if provided.\n     *\n     * Sets `maxEntrySize` to the same value, unless a different value is\n     * provided for `maxEntrySize`.\n     *\n     * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n     * positive integer if set.\n     *\n     * Even if size tracking is enabled, **it is strongly recommended to set a\n     * `max` to prevent unbounded growth of the cache.**\n     *\n     * Note also that size tracking can negatively impact performance,\n     * though for most cases, only minimally.\n     */\n    maxSize?: Size\n\n    /**\n     * The maximum allowed size for any single item in the cache.\n     *\n     * If a larger item is passed to {@link LRUCache#set} or returned by a\n     * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n     * it will not be stored in the cache.\n     *\n     * Attempting to add an item whose calculated size is greater than\n     * this amount will not cache the item or evict any old items, but\n     * WILL delete an existing value if one is already present.\n     *\n     * Optional, must be a positive integer if provided. Defaults to\n     * the value of `maxSize` if provided.\n     */\n    maxEntrySize?: Size\n\n    /**\n     * A function that returns a number indicating the item's size.\n     *\n     * Requires {@link OptionsBase.maxSize} to be set.\n     *\n     * If not provided, and {@link OptionsBase.maxSize} or\n     * {@link OptionsBase.maxEntrySize} are set, then all\n     * {@link LRUCache#set} calls **must** provide an explicit\n     * {@link SetOptions.size} or sizeCalculation param.\n     */\n    sizeCalculation?: SizeCalculator\n\n    /**\n     * Method that provides the implementation for {@link LRUCache#fetch}\n     *\n     * ```ts\n     * fetchMethod(key, staleValue, { signal, options, context })\n     * ```\n     *\n     * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n     * to `Promise.resolve(cache.get(key))`.\n     *\n     * If at any time, `signal.aborted` is set to `true`, or if the\n     * `signal.onabort` method is called, or if it emits an `'abort'` event\n     * which you can listen to with `addEventListener`, then that means that\n     * the fetch should be abandoned. This may be passed along to async\n     * functions aware of AbortController/AbortSignal behavior.\n     *\n     * The `fetchMethod` should **only** return `undefined` or a Promise\n     * resolving to `undefined` if the AbortController signaled an `abort`\n     * event. In all other cases, it should return or resolve to a value\n     * suitable for adding to the cache.\n     *\n     * The `options` object is a union of the options that may be provided to\n     * `set()` and `get()`. If they are modified, then that will result in\n     * modifying the settings to `cache.set()` when the value is resolved, and\n     * in the case of\n     * {@link OptionsBase.noDeleteOnFetchRejection} and\n     * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n     * `fetchMethod` failures.\n     *\n     * For example, a DNS cache may update the TTL based on the value returned\n     * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n     */\n    fetchMethod?: Fetcher\n\n    /**\n     * Method that provides the implementation for {@link LRUCache#memo}\n     */\n    memoMethod?: Memoizer\n\n    /**\n     * Set to true to suppress the deletion of stale data when a\n     * {@link OptionsBase.fetchMethod} returns a rejected promise.\n     */\n    noDeleteOnFetchRejection?: boolean\n\n    /**\n     * Do not delete stale items when they are retrieved with\n     * {@link LRUCache#get}.\n     *\n     * Note that the `get` return value will still be `undefined`\n     * unless {@link OptionsBase.allowStale} is true.\n     *\n     * When using time-expiring entries with `ttl`, by default stale\n     * items will be removed from the cache when the key is accessed\n     * with `cache.get()`.\n     *\n     * Setting this option will cause stale items to remain in the cache, until\n     * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n     * `noDeleteOnStaleGet` set to `false`.\n     *\n     * This may be overridden by passing an options object to `cache.get()`.\n     *\n     * Only relevant if a ttl is used.\n     */\n    noDeleteOnStaleGet?: boolean\n\n    /**\n     * Set to true to allow returning stale data when a\n     * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n     * promise.\n     *\n     * This differs from using {@link OptionsBase.allowStale} in that stale\n     * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n     * fails, not any other times.\n     *\n     * If a `fetchMethod` fails, and there is no stale value available, the\n     * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n     * suppressed.\n     *\n     * Implies `noDeleteOnFetchRejection`.\n     *\n     * This may be set in calls to `fetch()`, or defaulted on the constructor,\n     * or overridden by modifying the options object in the `fetchMethod`.\n     */\n    allowStaleOnFetchRejection?: boolean\n\n    /**\n     * Set to true to return a stale value from the cache when the\n     * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n     * an `'abort'` event, whether user-triggered, or due to internal cache\n     * behavior.\n     *\n     * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n     * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n     * any value it returns will be ignored and not cached.\n     *\n     * Caveat: since fetches are aborted when a new value is explicitly\n     * set in the cache, this can lead to fetch returning a stale value,\n     * since that was the fallback value _at the moment the `fetch()` was\n     * initiated_, even though the new updated value is now present in\n     * the cache.\n     *\n     * For example:\n     *\n     * ```ts\n     * const cache = new LRUCache({\n     *   ttl: 100,\n     *   fetchMethod: async (url, oldValue, { signal }) =>  {\n     *     const res = await fetch(url, { signal })\n     *     return await res.json()\n     *   }\n     * })\n     * cache.set('https://example.com/', { some: 'data' })\n     * // 100ms go by...\n     * const result = cache.fetch('https://example.com/')\n     * cache.set('https://example.com/', { other: 'thing' })\n     * console.log(await result) // { some: 'data' }\n     * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n     * ```\n     */\n    allowStaleOnFetchAbort?: boolean\n\n    /**\n     * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n     * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n     * resulting resolution value, as long as it is not `undefined`.\n     *\n     * When used on its own, this means aborted {@link LRUCache#fetch} calls\n     * are not immediately resolved or rejected when they are aborted, and\n     * instead take the full time to await.\n     *\n     * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n     * {@link LRUCache#fetch} calls will resolve immediately to their stale\n     * cached value or `undefined`, and will continue to process and eventually\n     * update the cache when they resolve, as long as the resulting value is\n     * not `undefined`, thus supporting a \"return stale on timeout while\n     * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n     *\n     * For example:\n     *\n     * ```ts\n     * const c = new LRUCache({\n     *   ttl: 100,\n     *   ignoreFetchAbort: true,\n     *   allowStaleOnFetchAbort: true,\n     *   fetchMethod: async (key, oldValue, { signal }) => {\n     *     // note: do NOT pass the signal to fetch()!\n     *     // let's say this fetch can take a long time.\n     *     const res = await fetch(`https://slow-backend-server/${key}`)\n     *     return await res.json()\n     *   },\n     * })\n     *\n     * // this will return the stale value after 100ms, while still\n     * // updating in the background for next time.\n     * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n     * ```\n     *\n     * **Note**: regardless of this setting, an `abort` event _is still\n     * emitted on the `AbortSignal` object_, so may result in invalid results\n     * when passed to other underlying APIs that use AbortSignals.\n     *\n     * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n     * call to {@link LRUCache#fetch}.\n     */\n    ignoreFetchAbort?: boolean\n  }\n\n  export interface OptionsMaxLimit\n    extends OptionsBase {\n    max: Count\n  }\n  export interface OptionsTTLLimit\n    extends OptionsBase {\n    ttl: Milliseconds\n    ttlAutopurge: boolean\n  }\n  export interface OptionsSizeLimit\n    extends OptionsBase {\n    maxSize: Size\n  }\n\n  /**\n   * The valid safe options for the {@link LRUCache} constructor\n   */\n  export type Options =\n    | OptionsMaxLimit\n    | OptionsSizeLimit\n    | OptionsTTLLimit\n\n  /**\n   * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n   * and returned by {@link LRUCache#info}.\n   */\n  export interface Entry {\n    value: V\n    ttl?: Milliseconds\n    size?: Size\n    start?: Milliseconds\n  }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache\n  implements Map\n{\n  // options that cannot be changed without disaster\n  readonly #max: LRUCache.Count\n  readonly #maxSize: LRUCache.Size\n  readonly #dispose?: LRUCache.Disposer\n  readonly #disposeAfter?: LRUCache.Disposer\n  readonly #fetchMethod?: LRUCache.Fetcher\n  readonly #memoMethod?: LRUCache.Memoizer\n\n  /**\n   * {@link LRUCache.OptionsBase.ttl}\n   */\n  ttl: LRUCache.Milliseconds\n\n  /**\n   * {@link LRUCache.OptionsBase.ttlResolution}\n   */\n  ttlResolution: LRUCache.Milliseconds\n  /**\n   * {@link LRUCache.OptionsBase.ttlAutopurge}\n   */\n  ttlAutopurge: boolean\n  /**\n   * {@link LRUCache.OptionsBase.updateAgeOnGet}\n   */\n  updateAgeOnGet: boolean\n  /**\n   * {@link LRUCache.OptionsBase.updateAgeOnHas}\n   */\n  updateAgeOnHas: boolean\n  /**\n   * {@link LRUCache.OptionsBase.allowStale}\n   */\n  allowStale: boolean\n\n  /**\n   * {@link LRUCache.OptionsBase.noDisposeOnSet}\n   */\n  noDisposeOnSet: boolean\n  /**\n   * {@link LRUCache.OptionsBase.noUpdateTTL}\n   */\n  noUpdateTTL: boolean\n  /**\n   * {@link LRUCache.OptionsBase.maxEntrySize}\n   */\n  maxEntrySize: LRUCache.Size\n  /**\n   * {@link LRUCache.OptionsBase.sizeCalculation}\n   */\n  sizeCalculation?: LRUCache.SizeCalculator\n  /**\n   * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n   */\n  noDeleteOnFetchRejection: boolean\n  /**\n   * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n   */\n  noDeleteOnStaleGet: boolean\n  /**\n   * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n   */\n  allowStaleOnFetchAbort: boolean\n  /**\n   * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n   */\n  allowStaleOnFetchRejection: boolean\n  /**\n   * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n   */\n  ignoreFetchAbort: boolean\n\n  // computed properties\n  #size: LRUCache.Count\n  #calculatedSize: LRUCache.Size\n  #keyMap: Map\n  #keyList: (K | undefined)[]\n  #valList: (V | BackgroundFetch | undefined)[]\n  #next: NumberArray\n  #prev: NumberArray\n  #head: Index\n  #tail: Index\n  #free: StackLike\n  #disposed?: DisposeTask[]\n  #sizes?: ZeroArray\n  #starts?: ZeroArray\n  #ttls?: ZeroArray\n\n  #hasDispose: boolean\n  #hasFetchMethod: boolean\n  #hasDisposeAfter: boolean\n\n  /**\n   * Do not call this method unless you need to inspect the\n   * inner workings of the cache.  If anything returned by this\n   * object is modified in any way, strange breakage may occur.\n   *\n   * These fields are private for a reason!\n   *\n   * @internal\n   */\n  static unsafeExposeInternals<\n    K extends {},\n    V extends {},\n    FC extends unknown = unknown\n  >(c: LRUCache) {\n    return {\n      // properties\n      starts: c.#starts,\n      ttls: c.#ttls,\n      sizes: c.#sizes,\n      keyMap: c.#keyMap as Map,\n      keyList: c.#keyList,\n      valList: c.#valList,\n      next: c.#next,\n      prev: c.#prev,\n      get head() {\n        return c.#head\n      },\n      get tail() {\n        return c.#tail\n      },\n      free: c.#free,\n      // methods\n      isBackgroundFetch: (p: any) => c.#isBackgroundFetch(p),\n      backgroundFetch: (\n        k: K,\n        index: number | undefined,\n        options: LRUCache.FetchOptions,\n        context: any\n      ): BackgroundFetch =>\n        c.#backgroundFetch(\n          k,\n          index as Index | undefined,\n          options,\n          context\n        ),\n      moveToTail: (index: number): void =>\n        c.#moveToTail(index as Index),\n      indexes: (options?: { allowStale: boolean }) =>\n        c.#indexes(options),\n      rindexes: (options?: { allowStale: boolean }) =>\n        c.#rindexes(options),\n      isStale: (index: number | undefined) =>\n        c.#isStale(index as Index),\n    }\n  }\n\n  // Protected read-only members\n\n  /**\n   * {@link LRUCache.OptionsBase.max} (read-only)\n   */\n  get max(): LRUCache.Count {\n    return this.#max\n  }\n  /**\n   * {@link LRUCache.OptionsBase.maxSize} (read-only)\n   */\n  get maxSize(): LRUCache.Count {\n    return this.#maxSize\n  }\n  /**\n   * The total computed size of items in the cache (read-only)\n   */\n  get calculatedSize(): LRUCache.Size {\n    return this.#calculatedSize\n  }\n  /**\n   * The number of items stored in the cache (read-only)\n   */\n  get size(): LRUCache.Count {\n    return this.#size\n  }\n  /**\n   * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n   */\n  get fetchMethod(): LRUCache.Fetcher | undefined {\n    return this.#fetchMethod\n  }\n  get memoMethod(): LRUCache.Memoizer | undefined {\n    return this.#memoMethod\n  }\n  /**\n   * {@link LRUCache.OptionsBase.dispose} (read-only)\n   */\n  get dispose() {\n    return this.#dispose\n  }\n  /**\n   * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n   */\n  get disposeAfter() {\n    return this.#disposeAfter\n  }\n\n  constructor(\n    options: LRUCache.Options | LRUCache\n  ) {\n    const {\n      max = 0,\n      ttl,\n      ttlResolution = 1,\n      ttlAutopurge,\n      updateAgeOnGet,\n      updateAgeOnHas,\n      allowStale,\n      dispose,\n      disposeAfter,\n      noDisposeOnSet,\n      noUpdateTTL,\n      maxSize = 0,\n      maxEntrySize = 0,\n      sizeCalculation,\n      fetchMethod,\n      memoMethod,\n      noDeleteOnFetchRejection,\n      noDeleteOnStaleGet,\n      allowStaleOnFetchRejection,\n      allowStaleOnFetchAbort,\n      ignoreFetchAbort,\n    } = options\n\n    if (max !== 0 && !isPosInt(max)) {\n      throw new TypeError('max option must be a nonnegative integer')\n    }\n\n    const UintArray = max ? getUintArray(max) : Array\n    if (!UintArray) {\n      throw new Error('invalid max value: ' + max)\n    }\n\n    this.#max = max\n    this.#maxSize = maxSize\n    this.maxEntrySize = maxEntrySize || this.#maxSize\n    this.sizeCalculation = sizeCalculation\n    if (this.sizeCalculation) {\n      if (!this.#maxSize && !this.maxEntrySize) {\n        throw new TypeError(\n          'cannot set sizeCalculation without setting maxSize or maxEntrySize'\n        )\n      }\n      if (typeof this.sizeCalculation !== 'function') {\n        throw new TypeError('sizeCalculation set to non-function')\n      }\n    }\n\n    if (\n      memoMethod !== undefined &&\n      typeof memoMethod !== 'function'\n    ) {\n      throw new TypeError('memoMethod must be a function if defined')\n    }\n    this.#memoMethod = memoMethod\n\n    if (\n      fetchMethod !== undefined &&\n      typeof fetchMethod !== 'function'\n    ) {\n      throw new TypeError(\n        'fetchMethod must be a function if specified'\n      )\n    }\n    this.#fetchMethod = fetchMethod\n    this.#hasFetchMethod = !!fetchMethod\n\n    this.#keyMap = new Map()\n    this.#keyList = new Array(max).fill(undefined)\n    this.#valList = new Array(max).fill(undefined)\n    this.#next = new UintArray(max)\n    this.#prev = new UintArray(max)\n    this.#head = 0 as Index\n    this.#tail = 0 as Index\n    this.#free = Stack.create(max)\n    this.#size = 0\n    this.#calculatedSize = 0\n\n    if (typeof dispose === 'function') {\n      this.#dispose = dispose\n    }\n    if (typeof disposeAfter === 'function') {\n      this.#disposeAfter = disposeAfter\n      this.#disposed = []\n    } else {\n      this.#disposeAfter = undefined\n      this.#disposed = undefined\n    }\n    this.#hasDispose = !!this.#dispose\n    this.#hasDisposeAfter = !!this.#disposeAfter\n\n    this.noDisposeOnSet = !!noDisposeOnSet\n    this.noUpdateTTL = !!noUpdateTTL\n    this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n    this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n    this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n    this.ignoreFetchAbort = !!ignoreFetchAbort\n\n    // NB: maxEntrySize is set to maxSize if it's set\n    if (this.maxEntrySize !== 0) {\n      if (this.#maxSize !== 0) {\n        if (!isPosInt(this.#maxSize)) {\n          throw new TypeError(\n            'maxSize must be a positive integer if specified'\n          )\n        }\n      }\n      if (!isPosInt(this.maxEntrySize)) {\n        throw new TypeError(\n          'maxEntrySize must be a positive integer if specified'\n        )\n      }\n      this.#initializeSizeTracking()\n    }\n\n    this.allowStale = !!allowStale\n    this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n    this.updateAgeOnGet = !!updateAgeOnGet\n    this.updateAgeOnHas = !!updateAgeOnHas\n    this.ttlResolution =\n      isPosInt(ttlResolution) || ttlResolution === 0\n        ? ttlResolution\n        : 1\n    this.ttlAutopurge = !!ttlAutopurge\n    this.ttl = ttl || 0\n    if (this.ttl) {\n      if (!isPosInt(this.ttl)) {\n        throw new TypeError(\n          'ttl must be a positive integer if specified'\n        )\n      }\n      this.#initializeTTLTracking()\n    }\n\n    // do not allow completely unbounded caches\n    if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n      throw new TypeError(\n        'At least one of max, maxSize, or ttl is required'\n      )\n    }\n    if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n      const code = 'LRU_CACHE_UNBOUNDED'\n      if (shouldWarn(code)) {\n        warned.add(code)\n        const msg =\n          'TTL caching without ttlAutopurge, max, or maxSize can ' +\n          'result in unbounded memory consumption.'\n        emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n      }\n    }\n  }\n\n  /**\n   * Return the number of ms left in the item's TTL. If item is not in cache,\n   * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n   */\n  getRemainingTTL(key: K) {\n    return this.#keyMap.has(key) ? Infinity : 0\n  }\n\n  #initializeTTLTracking() {\n    const ttls = new ZeroArray(this.#max)\n    const starts = new ZeroArray(this.#max)\n    this.#ttls = ttls\n    this.#starts = starts\n\n    this.#setItemTTL = (index, ttl, start = perf.now()) => {\n      starts[index] = ttl !== 0 ? start : 0\n      ttls[index] = ttl\n      if (ttl !== 0 && this.ttlAutopurge) {\n        const t = setTimeout(() => {\n          if (this.#isStale(index)) {\n            this.#delete(this.#keyList[index] as K, 'expire')\n          }\n        }, ttl + 1)\n        // unref() not supported on all platforms\n        /* c8 ignore start */\n        if (t.unref) {\n          t.unref()\n        }\n        /* c8 ignore stop */\n      }\n    }\n\n    this.#updateItemAge = index => {\n      starts[index] = ttls[index] !== 0 ? perf.now() : 0\n    }\n\n    this.#statusTTL = (status, index) => {\n      if (ttls[index]) {\n        const ttl = ttls[index]\n        const start = starts[index]\n        /* c8 ignore next */\n        if (!ttl || !start) return\n        status.ttl = ttl\n        status.start = start\n        status.now = cachedNow || getNow()\n        const age = status.now - start\n        status.remainingTTL = ttl - age\n      }\n    }\n\n    // debounce calls to perf.now() to 1s so we're not hitting\n    // that costly call repeatedly.\n    let cachedNow = 0\n    const getNow = () => {\n      const n = perf.now()\n      if (this.ttlResolution > 0) {\n        cachedNow = n\n        const t = setTimeout(\n          () => (cachedNow = 0),\n          this.ttlResolution\n        )\n        // not available on all platforms\n        /* c8 ignore start */\n        if (t.unref) {\n          t.unref()\n        }\n        /* c8 ignore stop */\n      }\n      return n\n    }\n\n    this.getRemainingTTL = key => {\n      const index = this.#keyMap.get(key)\n      if (index === undefined) {\n        return 0\n      }\n      const ttl = ttls[index]\n      const start = starts[index]\n      if (!ttl || !start) {\n        return Infinity\n      }\n      const age = (cachedNow || getNow()) - start\n      return ttl - age\n    }\n\n    this.#isStale = index => {\n      const s = starts[index]\n      const t = ttls[index]\n      return !!t && !!s && (cachedNow || getNow()) - s > t\n    }\n  }\n\n  // conditionally set private methods related to TTL\n  #updateItemAge: (index: Index) => void = () => {}\n  #statusTTL: (status: LRUCache.Status, index: Index) => void =\n    () => {}\n  #setItemTTL: (\n    index: Index,\n    ttl: LRUCache.Milliseconds,\n    start?: LRUCache.Milliseconds\n    // ignore because we never call this if we're not already in TTL mode\n    /* c8 ignore start */\n  ) => void = () => {}\n  /* c8 ignore stop */\n\n  #isStale: (index: Index) => boolean = () => false\n\n  #initializeSizeTracking() {\n    const sizes = new ZeroArray(this.#max)\n    this.#calculatedSize = 0\n    this.#sizes = sizes\n    this.#removeItemSize = index => {\n      this.#calculatedSize -= sizes[index] as number\n      sizes[index] = 0\n    }\n    this.#requireSize = (k, v, size, sizeCalculation) => {\n      // provisionally accept background fetches.\n      // actual value size will be checked when they return.\n      if (this.#isBackgroundFetch(v)) {\n        return 0\n      }\n      if (!isPosInt(size)) {\n        if (sizeCalculation) {\n          if (typeof sizeCalculation !== 'function') {\n            throw new TypeError('sizeCalculation must be a function')\n          }\n          size = sizeCalculation(v, k)\n          if (!isPosInt(size)) {\n            throw new TypeError(\n              'sizeCalculation return invalid (expect positive integer)'\n            )\n          }\n        } else {\n          throw new TypeError(\n            'invalid size value (must be positive integer). ' +\n              'When maxSize or maxEntrySize is used, sizeCalculation ' +\n              'or size must be set.'\n          )\n        }\n      }\n      return size\n    }\n    this.#addItemSize = (\n      index: Index,\n      size: LRUCache.Size,\n      status?: LRUCache.Status\n    ) => {\n      sizes[index] = size\n      if (this.#maxSize) {\n        const maxSize = this.#maxSize - (sizes[index] as number)\n        while (this.#calculatedSize > maxSize) {\n          this.#evict(true)\n        }\n      }\n      this.#calculatedSize += sizes[index] as number\n      if (status) {\n        status.entrySize = size\n        status.totalCalculatedSize = this.#calculatedSize\n      }\n    }\n  }\n\n  #removeItemSize: (index: Index) => void = _i => {}\n  #addItemSize: (\n    index: Index,\n    size: LRUCache.Size,\n    status?: LRUCache.Status\n  ) => void = (_i, _s, _st) => {}\n  #requireSize: (\n    k: K,\n    v: V | BackgroundFetch,\n    size?: LRUCache.Size,\n    sizeCalculation?: LRUCache.SizeCalculator\n  ) => LRUCache.Size = (\n    _k: K,\n    _v: V | BackgroundFetch,\n    size?: LRUCache.Size,\n    sizeCalculation?: LRUCache.SizeCalculator\n  ) => {\n    if (size || sizeCalculation) {\n      throw new TypeError(\n        'cannot set size without setting maxSize or maxEntrySize on cache'\n      )\n    }\n    return 0\n  };\n\n  *#indexes({ allowStale = this.allowStale } = {}) {\n    if (this.#size) {\n      for (let i = this.#tail; true; ) {\n        if (!this.#isValidIndex(i)) {\n          break\n        }\n        if (allowStale || !this.#isStale(i)) {\n          yield i\n        }\n        if (i === this.#head) {\n          break\n        } else {\n          i = this.#prev[i] as Index\n        }\n      }\n    }\n  }\n\n  *#rindexes({ allowStale = this.allowStale } = {}) {\n    if (this.#size) {\n      for (let i = this.#head; true; ) {\n        if (!this.#isValidIndex(i)) {\n          break\n        }\n        if (allowStale || !this.#isStale(i)) {\n          yield i\n        }\n        if (i === this.#tail) {\n          break\n        } else {\n          i = this.#next[i] as Index\n        }\n      }\n    }\n  }\n\n  #isValidIndex(index: Index) {\n    return (\n      index !== undefined &&\n      this.#keyMap.get(this.#keyList[index] as K) === index\n    )\n  }\n\n  /**\n   * Return a generator yielding `[key, value]` pairs,\n   * in order from most recently used to least recently used.\n   */\n  *entries() {\n    for (const i of this.#indexes()) {\n      if (\n        this.#valList[i] !== undefined &&\n        this.#keyList[i] !== undefined &&\n        !this.#isBackgroundFetch(this.#valList[i])\n      ) {\n        yield [this.#keyList[i], this.#valList[i]] as [K, V]\n      }\n    }\n  }\n\n  /**\n   * Inverse order version of {@link LRUCache.entries}\n   *\n   * Return a generator yielding `[key, value]` pairs,\n   * in order from least recently used to most recently used.\n   */\n  *rentries() {\n    for (const i of this.#rindexes()) {\n      if (\n        this.#valList[i] !== undefined &&\n        this.#keyList[i] !== undefined &&\n        !this.#isBackgroundFetch(this.#valList[i])\n      ) {\n        yield [this.#keyList[i], this.#valList[i]]\n      }\n    }\n  }\n\n  /**\n   * Return a generator yielding the keys in the cache,\n   * in order from most recently used to least recently used.\n   */\n  *keys() {\n    for (const i of this.#indexes()) {\n      const k = this.#keyList[i]\n      if (\n        k !== undefined &&\n        !this.#isBackgroundFetch(this.#valList[i])\n      ) {\n        yield k\n      }\n    }\n  }\n\n  /**\n   * Inverse order version of {@link LRUCache.keys}\n   *\n   * Return a generator yielding the keys in the cache,\n   * in order from least recently used to most recently used.\n   */\n  *rkeys() {\n    for (const i of this.#rindexes()) {\n      const k = this.#keyList[i]\n      if (\n        k !== undefined &&\n        !this.#isBackgroundFetch(this.#valList[i])\n      ) {\n        yield k\n      }\n    }\n  }\n\n  /**\n   * Return a generator yielding the values in the cache,\n   * in order from most recently used to least recently used.\n   */\n  *values() {\n    for (const i of this.#indexes()) {\n      const v = this.#valList[i]\n      if (\n        v !== undefined &&\n        !this.#isBackgroundFetch(this.#valList[i])\n      ) {\n        yield this.#valList[i] as V\n      }\n    }\n  }\n\n  /**\n   * Inverse order version of {@link LRUCache.values}\n   *\n   * Return a generator yielding the values in the cache,\n   * in order from least recently used to most recently used.\n   */\n  *rvalues() {\n    for (const i of this.#rindexes()) {\n      const v = this.#valList[i]\n      if (\n        v !== undefined &&\n        !this.#isBackgroundFetch(this.#valList[i])\n      ) {\n        yield this.#valList[i]\n      }\n    }\n  }\n\n  /**\n   * Iterating over the cache itself yields the same results as\n   * {@link LRUCache.entries}\n   */\n  [Symbol.iterator]() {\n    return this.entries()\n  }\n\n  /**\n   * A String value that is used in the creation of the default string\n   * description of an object. Called by the built-in method\n   * `Object.prototype.toString`.\n   */\n  [Symbol.toStringTag] = 'LRUCache'\n\n  /**\n   * Find a value for which the supplied fn method returns a truthy value,\n   * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n   */\n  find(\n    fn: (v: V, k: K, self: LRUCache) => boolean,\n    getOptions: LRUCache.GetOptions = {}\n  ) {\n    for (const i of this.#indexes()) {\n      const v = this.#valList[i]\n      const value = this.#isBackgroundFetch(v)\n        ? v.__staleWhileFetching\n        : v\n      if (value === undefined) continue\n      if (fn(value, this.#keyList[i] as K, this)) {\n        return this.get(this.#keyList[i] as K, getOptions)\n      }\n    }\n  }\n\n  /**\n   * Call the supplied function on each item in the cache, in order from most\n   * recently used to least recently used.\n   *\n   * `fn` is called as `fn(value, key, cache)`.\n   *\n   * If `thisp` is provided, function will be called in the `this`-context of\n   * the provided object, or the cache if no `thisp` object is provided.\n   *\n   * Does not update age or recenty of use, or iterate over stale values.\n   */\n  forEach(\n    fn: (v: V, k: K, self: LRUCache) => any,\n    thisp: any = this\n  ) {\n    for (const i of this.#indexes()) {\n      const v = this.#valList[i]\n      const value = this.#isBackgroundFetch(v)\n        ? v.__staleWhileFetching\n        : v\n      if (value === undefined) continue\n      fn.call(thisp, value, this.#keyList[i] as K, this)\n    }\n  }\n\n  /**\n   * The same as {@link LRUCache.forEach} but items are iterated over in\n   * reverse order.  (ie, less recently used items are iterated over first.)\n   */\n  rforEach(\n    fn: (v: V, k: K, self: LRUCache) => any,\n    thisp: any = this\n  ) {\n    for (const i of this.#rindexes()) {\n      const v = this.#valList[i]\n      const value = this.#isBackgroundFetch(v)\n        ? v.__staleWhileFetching\n        : v\n      if (value === undefined) continue\n      fn.call(thisp, value, this.#keyList[i] as K, this)\n    }\n  }\n\n  /**\n   * Delete any stale entries. Returns true if anything was removed,\n   * false otherwise.\n   */\n  purgeStale() {\n    let deleted = false\n    for (const i of this.#rindexes({ allowStale: true })) {\n      if (this.#isStale(i)) {\n        this.#delete(this.#keyList[i] as K, 'expire')\n        deleted = true\n      }\n    }\n    return deleted\n  }\n\n  /**\n   * Get the extended info about a given entry, to get its value, size, and\n   * TTL info simultaneously. Returns `undefined` if the key is not present.\n   *\n   * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n   * serialization, the `start` value is always the current timestamp, and the\n   * `ttl` is a calculated remaining time to live (negative if expired).\n   *\n   * Always returns stale values, if their info is found in the cache, so be\n   * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n   * if relevant.\n   */\n  info(key: K): LRUCache.Entry | undefined {\n    const i = this.#keyMap.get(key)\n    if (i === undefined) return undefined\n    const v = this.#valList[i]\n    const value: V | undefined = this.#isBackgroundFetch(v)\n      ? v.__staleWhileFetching\n      : v\n    if (value === undefined) return undefined\n    const entry: LRUCache.Entry = { value }\n    if (this.#ttls && this.#starts) {\n      const ttl = this.#ttls[i]\n      const start = this.#starts[i]\n      if (ttl && start) {\n        const remain = ttl - (perf.now() - start)\n        entry.ttl = remain\n        entry.start = Date.now()\n      }\n    }\n    if (this.#sizes) {\n      entry.size = this.#sizes[i]\n    }\n    return entry\n  }\n\n  /**\n   * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n   * passed to {@link LRLUCache#load}.\n   *\n   * The `start` fields are calculated relative to a portable `Date.now()`\n   * timestamp, even if `performance.now()` is available.\n   *\n   * Stale entries are always included in the `dump`, even if\n   * {@link LRUCache.OptionsBase.allowStale} is false.\n   *\n   * Note: this returns an actual array, not a generator, so it can be more\n   * easily passed around.\n   */\n  dump() {\n    const arr: [K, LRUCache.Entry][] = []\n    for (const i of this.#indexes({ allowStale: true })) {\n      const key = this.#keyList[i]\n      const v = this.#valList[i]\n      const value: V | undefined = this.#isBackgroundFetch(v)\n        ? v.__staleWhileFetching\n        : v\n      if (value === undefined || key === undefined) continue\n      const entry: LRUCache.Entry = { value }\n      if (this.#ttls && this.#starts) {\n        entry.ttl = this.#ttls[i]\n        // always dump the start relative to a portable timestamp\n        // it's ok for this to be a bit slow, it's a rare operation.\n        const age = perf.now() - (this.#starts[i] as number)\n        entry.start = Math.floor(Date.now() - age)\n      }\n      if (this.#sizes) {\n        entry.size = this.#sizes[i]\n      }\n      arr.unshift([key, entry])\n    }\n    return arr\n  }\n\n  /**\n   * Reset the cache and load in the items in entries in the order listed.\n   *\n   * The shape of the resulting cache may be different if the same options are\n   * not used in both caches.\n   *\n   * The `start` fields are assumed to be calculated relative to a portable\n   * `Date.now()` timestamp, even if `performance.now()` is available.\n   */\n  load(arr: [K, LRUCache.Entry][]) {\n    this.clear()\n    for (const [key, entry] of arr) {\n      if (entry.start) {\n        // entry.start is a portable timestamp, but we may be using\n        // node's performance.now(), so calculate the offset, so that\n        // we get the intended remaining TTL, no matter how long it's\n        // been on ice.\n        //\n        // it's ok for this to be a bit slow, it's a rare operation.\n        const age = Date.now() - entry.start\n        entry.start = perf.now() - age\n      }\n      this.set(key, entry.value, entry)\n    }\n  }\n\n  /**\n   * Add a value to the cache.\n   *\n   * Note: if `undefined` is specified as a value, this is an alias for\n   * {@link LRUCache#delete}\n   *\n   * Fields on the {@link LRUCache.SetOptions} options param will override\n   * their corresponding values in the constructor options for the scope\n   * of this single `set()` operation.\n   *\n   * If `start` is provided, then that will set the effective start\n   * time for the TTL calculation. Note that this must be a previous\n   * value of `performance.now()` if supported, or a previous value of\n   * `Date.now()` if not.\n   *\n   * Options object may also include `size`, which will prevent\n   * calling the `sizeCalculation` function and just use the specified\n   * number if it is a positive integer, and `noDisposeOnSet` which\n   * will prevent calling a `dispose` function in the case of\n   * overwrites.\n   *\n   * If the `size` (or return value of `sizeCalculation`) for a given\n   * entry is greater than `maxEntrySize`, then the item will not be\n   * added to the cache.\n   *\n   * Will update the recency of the entry.\n   *\n   * If the value is `undefined`, then this is an alias for\n   * `cache.delete(key)`. `undefined` is never stored in the cache.\n   */\n  set(\n    k: K,\n    v: V | BackgroundFetch | undefined,\n    setOptions: LRUCache.SetOptions = {}\n  ) {\n    if (v === undefined) {\n      this.delete(k)\n      return this\n    }\n    const {\n      ttl = this.ttl,\n      start,\n      noDisposeOnSet = this.noDisposeOnSet,\n      sizeCalculation = this.sizeCalculation,\n      status,\n    } = setOptions\n    let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n    const size = this.#requireSize(\n      k,\n      v,\n      setOptions.size || 0,\n      sizeCalculation\n    )\n    // if the item doesn't fit, don't do anything\n    // NB: maxEntrySize set to maxSize by default\n    if (this.maxEntrySize && size > this.maxEntrySize) {\n      if (status) {\n        status.set = 'miss'\n        status.maxEntrySizeExceeded = true\n      }\n      // have to delete, in case something is there already.\n      this.#delete(k, 'set')\n      return this\n    }\n    let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n    if (index === undefined) {\n      // addition\n      index = (\n        this.#size === 0\n          ? this.#tail\n          : this.#free.length !== 0\n          ? this.#free.pop()\n          : this.#size === this.#max\n          ? this.#evict(false)\n          : this.#size\n      ) as Index\n      this.#keyList[index] = k\n      this.#valList[index] = v\n      this.#keyMap.set(k, index)\n      this.#next[this.#tail] = index\n      this.#prev[index] = this.#tail\n      this.#tail = index\n      this.#size++\n      this.#addItemSize(index, size, status)\n      if (status) status.set = 'add'\n      noUpdateTTL = false\n    } else {\n      // update\n      this.#moveToTail(index)\n      const oldVal = this.#valList[index] as V | BackgroundFetch\n      if (v !== oldVal) {\n        if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n          oldVal.__abortController.abort(new Error('replaced'))\n          const { __staleWhileFetching: s } = oldVal\n          if (s !== undefined && !noDisposeOnSet) {\n            if (this.#hasDispose) {\n              this.#dispose?.(s as V, k, 'set')\n            }\n            if (this.#hasDisposeAfter) {\n              this.#disposed?.push([s as V, k, 'set'])\n            }\n          }\n        } else if (!noDisposeOnSet) {\n          if (this.#hasDispose) {\n            this.#dispose?.(oldVal as V, k, 'set')\n          }\n          if (this.#hasDisposeAfter) {\n            this.#disposed?.push([oldVal as V, k, 'set'])\n          }\n        }\n        this.#removeItemSize(index)\n        this.#addItemSize(index, size, status)\n        this.#valList[index] = v\n        if (status) {\n          status.set = 'replace'\n          const oldValue =\n            oldVal && this.#isBackgroundFetch(oldVal)\n              ? oldVal.__staleWhileFetching\n              : oldVal\n          if (oldValue !== undefined) status.oldValue = oldValue\n        }\n      } else if (status) {\n        status.set = 'update'\n      }\n    }\n    if (ttl !== 0 && !this.#ttls) {\n      this.#initializeTTLTracking()\n    }\n    if (this.#ttls) {\n      if (!noUpdateTTL) {\n        this.#setItemTTL(index, ttl, start)\n      }\n      if (status) this.#statusTTL(status, index)\n    }\n    if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n      const dt = this.#disposed\n      let task: DisposeTask | undefined\n      while ((task = dt?.shift())) {\n        this.#disposeAfter?.(...task)\n      }\n    }\n    return this\n  }\n\n  /**\n   * Evict the least recently used item, returning its value or\n   * `undefined` if cache is empty.\n   */\n  pop(): V | undefined {\n    try {\n      while (this.#size) {\n        const val = this.#valList[this.#head]\n        this.#evict(true)\n        if (this.#isBackgroundFetch(val)) {\n          if (val.__staleWhileFetching) {\n            return val.__staleWhileFetching\n          }\n        } else if (val !== undefined) {\n          return val\n        }\n      }\n    } finally {\n      if (this.#hasDisposeAfter && this.#disposed) {\n        const dt = this.#disposed\n        let task: DisposeTask | undefined\n        while ((task = dt?.shift())) {\n          this.#disposeAfter?.(...task)\n        }\n      }\n    }\n  }\n\n  #evict(free: boolean) {\n    const head = this.#head\n    const k = this.#keyList[head] as K\n    const v = this.#valList[head] as V\n    if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n      v.__abortController.abort(new Error('evicted'))\n    } else if (this.#hasDispose || this.#hasDisposeAfter) {\n      if (this.#hasDispose) {\n        this.#dispose?.(v, k, 'evict')\n      }\n      if (this.#hasDisposeAfter) {\n        this.#disposed?.push([v, k, 'evict'])\n      }\n    }\n    this.#removeItemSize(head)\n    // if we aren't about to use the index, then null these out\n    if (free) {\n      this.#keyList[head] = undefined\n      this.#valList[head] = undefined\n      this.#free.push(head)\n    }\n    if (this.#size === 1) {\n      this.#head = this.#tail = 0 as Index\n      this.#free.length = 0\n    } else {\n      this.#head = this.#next[head] as Index\n    }\n    this.#keyMap.delete(k)\n    this.#size--\n    return head\n  }\n\n  /**\n   * Check if a key is in the cache, without updating the recency of use.\n   * Will return false if the item is stale, even though it is technically\n   * in the cache.\n   *\n   * Check if a key is in the cache, without updating the recency of\n   * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n   * to `true` in either the options or the constructor.\n   *\n   * Will return `false` if the item is stale, even though it is technically in\n   * the cache. The difference can be determined (if it matters) by using a\n   * `status` argument, and inspecting the `has` field.\n   *\n   * Will not update item age unless\n   * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n   */\n  has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n    const { updateAgeOnHas = this.updateAgeOnHas, status } =\n      hasOptions\n    const index = this.#keyMap.get(k)\n    if (index !== undefined) {\n      const v = this.#valList[index]\n      if (\n        this.#isBackgroundFetch(v) &&\n        v.__staleWhileFetching === undefined\n      ) {\n        return false\n      }\n      if (!this.#isStale(index)) {\n        if (updateAgeOnHas) {\n          this.#updateItemAge(index)\n        }\n        if (status) {\n          status.has = 'hit'\n          this.#statusTTL(status, index)\n        }\n        return true\n      } else if (status) {\n        status.has = 'stale'\n        this.#statusTTL(status, index)\n      }\n    } else if (status) {\n      status.has = 'miss'\n    }\n    return false\n  }\n\n  /**\n   * Like {@link LRUCache#get} but doesn't update recency or delete stale\n   * items.\n   *\n   * Returns `undefined` if the item is stale, unless\n   * {@link LRUCache.OptionsBase.allowStale} is set.\n   */\n  peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n    const { allowStale = this.allowStale } = peekOptions\n    const index = this.#keyMap.get(k)\n    if (\n      index === undefined ||\n      (!allowStale && this.#isStale(index))\n    ) {\n      return\n    }\n    const v = this.#valList[index]\n    // either stale and allowed, or forcing a refresh of non-stale value\n    return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n  }\n\n  #backgroundFetch(\n    k: K,\n    index: Index | undefined,\n    options: LRUCache.FetchOptions,\n    context: any\n  ): BackgroundFetch {\n    const v = index === undefined ? undefined : this.#valList[index]\n    if (this.#isBackgroundFetch(v)) {\n      return v\n    }\n\n    const ac = new AC()\n    const { signal } = options\n    // when/if our AC signals, then stop listening to theirs.\n    signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n      signal: ac.signal,\n    })\n\n    const fetchOpts = {\n      signal: ac.signal,\n      options,\n      context,\n    }\n\n    const cb = (\n      v: V | undefined,\n      updateCache = false\n    ): V | undefined => {\n      const { aborted } = ac.signal\n      const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n      if (options.status) {\n        if (aborted && !updateCache) {\n          options.status.fetchAborted = true\n          options.status.fetchError = ac.signal.reason\n          if (ignoreAbort) options.status.fetchAbortIgnored = true\n        } else {\n          options.status.fetchResolved = true\n        }\n      }\n      if (aborted && !ignoreAbort && !updateCache) {\n        return fetchFail(ac.signal.reason)\n      }\n      // either we didn't abort, and are still here, or we did, and ignored\n      const bf = p as BackgroundFetch\n      if (this.#valList[index as Index] === p) {\n        if (v === undefined) {\n          if (bf.__staleWhileFetching) {\n            this.#valList[index as Index] = bf.__staleWhileFetching\n          } else {\n            this.#delete(k, 'fetch')\n          }\n        } else {\n          if (options.status) options.status.fetchUpdated = true\n          this.set(k, v, fetchOpts.options)\n        }\n      }\n      return v\n    }\n\n    const eb = (er: any) => {\n      if (options.status) {\n        options.status.fetchRejected = true\n        options.status.fetchError = er\n      }\n      return fetchFail(er)\n    }\n\n    const fetchFail = (er: any): V | undefined => {\n      const { aborted } = ac.signal\n      const allowStaleAborted =\n        aborted && options.allowStaleOnFetchAbort\n      const allowStale =\n        allowStaleAborted || options.allowStaleOnFetchRejection\n      const noDelete = allowStale || options.noDeleteOnFetchRejection\n      const bf = p as BackgroundFetch\n      if (this.#valList[index as Index] === p) {\n        // if we allow stale on fetch rejections, then we need to ensure that\n        // the stale value is not removed from the cache when the fetch fails.\n        const del = !noDelete || bf.__staleWhileFetching === undefined\n        if (del) {\n          this.#delete(k, 'fetch')\n        } else if (!allowStaleAborted) {\n          // still replace the *promise* with the stale value,\n          // since we are done with the promise at this point.\n          // leave it untouched if we're still waiting for an\n          // aborted background fetch that hasn't yet returned.\n          this.#valList[index as Index] = bf.__staleWhileFetching\n        }\n      }\n      if (allowStale) {\n        if (options.status && bf.__staleWhileFetching !== undefined) {\n          options.status.returnedStale = true\n        }\n        return bf.__staleWhileFetching\n      } else if (bf.__returned === bf) {\n        throw er\n      }\n    }\n\n    const pcall = (\n      res: (v: V | undefined) => void,\n      rej: (e: any) => void\n    ) => {\n      const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n      if (fmp && fmp instanceof Promise) {\n        fmp.then(v => res(v === undefined ? undefined : v), rej)\n      }\n      // ignored, we go until we finish, regardless.\n      // defer check until we are actually aborting,\n      // so fetchMethod can override.\n      ac.signal.addEventListener('abort', () => {\n        if (\n          !options.ignoreFetchAbort ||\n          options.allowStaleOnFetchAbort\n        ) {\n          res(undefined)\n          // when it eventually resolves, update the cache.\n          if (options.allowStaleOnFetchAbort) {\n            res = v => cb(v, true)\n          }\n        }\n      })\n    }\n\n    if (options.status) options.status.fetchDispatched = true\n    const p = new Promise(pcall).then(cb, eb)\n    const bf: BackgroundFetch = Object.assign(p, {\n      __abortController: ac,\n      __staleWhileFetching: v,\n      __returned: undefined,\n    })\n\n    if (index === undefined) {\n      // internal, don't expose status.\n      this.set(k, bf, { ...fetchOpts.options, status: undefined })\n      index = this.#keyMap.get(k)\n    } else {\n      this.#valList[index] = bf\n    }\n    return bf\n  }\n\n  #isBackgroundFetch(p: any): p is BackgroundFetch {\n    if (!this.#hasFetchMethod) return false\n    const b = p as BackgroundFetch\n    return (\n      !!b &&\n      b instanceof Promise &&\n      b.hasOwnProperty('__staleWhileFetching') &&\n      b.__abortController instanceof AC\n    )\n  }\n\n  /**\n   * Make an asynchronous cached fetch using the\n   * {@link LRUCache.OptionsBase.fetchMethod} function.\n   *\n   * If the value is in the cache and not stale, then the returned\n   * Promise resolves to the value.\n   *\n   * If not in the cache, or beyond its TTL staleness, then\n   * `fetchMethod(key, staleValue, { options, signal, context })` is\n   * called, and the value returned will be added to the cache once\n   * resolved.\n   *\n   * If called with `allowStale`, and an asynchronous fetch is\n   * currently in progress to reload a stale value, then the former\n   * stale value will be returned.\n   *\n   * If called with `forceRefresh`, then the cached item will be\n   * re-fetched, even if it is not stale. However, if `allowStale` is also\n   * set, then the old value will still be returned. This is useful\n   * in cases where you want to force a reload of a cached value. If\n   * a background fetch is already in progress, then `forceRefresh`\n   * has no effect.\n   *\n   * If multiple fetches for the same key are issued, then they will all be\n   * coalesced into a single call to fetchMethod.\n   *\n   * Note that this means that handling options such as\n   * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n   * {@link LRUCache.FetchOptions.signal},\n   * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n   * determined by the FIRST fetch() call for a given key.\n   *\n   * This is a known (fixable) shortcoming which will be addresed on when\n   * someone complains about it, as the fix would involve added complexity and\n   * may not be worth the costs for this edge case.\n   *\n   * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n   * effectively an alias for `Promise.resolve(cache.get(key))`.\n   *\n   * When the fetch method resolves to a value, if the fetch has not\n   * been aborted due to deletion, eviction, or being overwritten,\n   * then it is added to the cache using the options provided.\n   *\n   * If the key is evicted or deleted before the `fetchMethod`\n   * resolves, then the AbortSignal passed to the `fetchMethod` will\n   * receive an `abort` event, and the promise returned by `fetch()`\n   * will reject with the reason for the abort.\n   *\n   * If a `signal` is passed to the `fetch()` call, then aborting the\n   * signal will abort the fetch and cause the `fetch()` promise to\n   * reject with the reason provided.\n   *\n   * **Setting `context`**\n   *\n   * If an `FC` type is set to a type other than `unknown`, `void`, or\n   * `undefined` in the {@link LRUCache} constructor, then all\n   * calls to `cache.fetch()` _must_ provide a `context` option. If\n   * set to `undefined` or `void`, then calls to fetch _must not_\n   * provide a `context` option.\n   *\n   * The `context` param allows you to provide arbitrary data that\n   * might be relevant in the course of fetching the data. It is only\n   * relevant for the course of a single `fetch()` operation, and\n   * discarded afterwards.\n   *\n   * **Note: `fetch()` calls are inflight-unique**\n   *\n   * If you call `fetch()` multiple times with the same key value,\n   * then every call after the first will resolve on the same\n   * promise1,\n   * _even if they have different settings that would otherwise change\n   * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n   * or `ignoreFetchAbort`.\n   *\n   * In most cases, this is not a problem (in fact, only fetching\n   * something once is what you probably want, if you're caching in\n   * the first place). If you are changing the fetch() options\n   * dramatically between runs, there's a good chance that you might\n   * be trying to fit divergent semantics into a single object, and\n   * would be better off with multiple cache instances.\n   *\n   * **1**: Ie, they're not the \"same Promise\", but they resolve at\n   * the same time, because they're both waiting on the same\n   * underlying fetchMethod response.\n   */\n\n  fetch(\n    k: K,\n    fetchOptions: unknown extends FC\n      ? LRUCache.FetchOptions\n      : FC extends undefined | void\n      ? LRUCache.FetchOptionsNoContext\n      : LRUCache.FetchOptionsWithContext\n  ): Promise\n\n  // this overload not allowed if context is required\n  fetch(\n    k: unknown extends FC\n      ? K\n      : FC extends undefined | void\n      ? K\n      : never,\n    fetchOptions?: unknown extends FC\n      ? LRUCache.FetchOptions\n      : FC extends undefined | void\n      ? LRUCache.FetchOptionsNoContext\n      : never\n  ): Promise\n\n  async fetch(\n    k: K,\n    fetchOptions: LRUCache.FetchOptions = {}\n  ): Promise {\n    const {\n      // get options\n      allowStale = this.allowStale,\n      updateAgeOnGet = this.updateAgeOnGet,\n      noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n      // set options\n      ttl = this.ttl,\n      noDisposeOnSet = this.noDisposeOnSet,\n      size = 0,\n      sizeCalculation = this.sizeCalculation,\n      noUpdateTTL = this.noUpdateTTL,\n      // fetch exclusive options\n      noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n      allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n      ignoreFetchAbort = this.ignoreFetchAbort,\n      allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n      context,\n      forceRefresh = false,\n      status,\n      signal,\n    } = fetchOptions\n\n    if (!this.#hasFetchMethod) {\n      if (status) status.fetch = 'get'\n      return this.get(k, {\n        allowStale,\n        updateAgeOnGet,\n        noDeleteOnStaleGet,\n        status,\n      })\n    }\n\n    const options = {\n      allowStale,\n      updateAgeOnGet,\n      noDeleteOnStaleGet,\n      ttl,\n      noDisposeOnSet,\n      size,\n      sizeCalculation,\n      noUpdateTTL,\n      noDeleteOnFetchRejection,\n      allowStaleOnFetchRejection,\n      allowStaleOnFetchAbort,\n      ignoreFetchAbort,\n      status,\n      signal,\n    }\n\n    let index = this.#keyMap.get(k)\n    if (index === undefined) {\n      if (status) status.fetch = 'miss'\n      const p = this.#backgroundFetch(k, index, options, context)\n      return (p.__returned = p)\n    } else {\n      // in cache, maybe already fetching\n      const v = this.#valList[index]\n      if (this.#isBackgroundFetch(v)) {\n        const stale =\n          allowStale && v.__staleWhileFetching !== undefined\n        if (status) {\n          status.fetch = 'inflight'\n          if (stale) status.returnedStale = true\n        }\n        return stale ? v.__staleWhileFetching : (v.__returned = v)\n      }\n\n      // if we force a refresh, that means do NOT serve the cached value,\n      // unless we are already in the process of refreshing the cache.\n      const isStale = this.#isStale(index)\n      if (!forceRefresh && !isStale) {\n        if (status) status.fetch = 'hit'\n        this.#moveToTail(index)\n        if (updateAgeOnGet) {\n          this.#updateItemAge(index)\n        }\n        if (status) this.#statusTTL(status, index)\n        return v\n      }\n\n      // ok, it is stale or a forced refresh, and not already fetching.\n      // refresh the cache.\n      const p = this.#backgroundFetch(k, index, options, context)\n      const hasStale = p.__staleWhileFetching !== undefined\n      const staleVal = hasStale && allowStale\n      if (status) {\n        status.fetch = isStale ? 'stale' : 'refresh'\n        if (staleVal && isStale) status.returnedStale = true\n      }\n      return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n    }\n  }\n\n  /**\n   * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n   * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n   * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n   * because `ignoreFetchAbort` was specified (either to the constructor or\n   * in the {@link LRUCache.FetchOptions}). Also, the\n   * {@link OptionsBase.fetchMethod} may return `undefined` or `void`, making\n   * the test even more complicated.\n   *\n   * Because inferring the cases where `undefined` might be returned are so\n   * cumbersome, but testing for `undefined` can also be annoying, this method\n   * can be used, which will reject if `this.fetch()` resolves to undefined.\n   */\n  forceFetch(\n    k: K,\n    fetchOptions: unknown extends FC\n      ? LRUCache.FetchOptions\n      : FC extends undefined | void\n      ? LRUCache.FetchOptionsNoContext\n      : LRUCache.FetchOptionsWithContext\n  ): Promise\n  // this overload not allowed if context is required\n  forceFetch(\n    k: unknown extends FC\n      ? K\n      : FC extends undefined | void\n      ? K\n      : never,\n    fetchOptions?: unknown extends FC\n      ? LRUCache.FetchOptions\n      : FC extends undefined | void\n      ? LRUCache.FetchOptionsNoContext\n      : never\n  ): Promise\n  async forceFetch(\n    k: K,\n    fetchOptions: LRUCache.FetchOptions = {}\n  ): Promise {\n    const v = await this.fetch(\n      k,\n      fetchOptions as unknown extends FC\n        ? LRUCache.FetchOptions\n        : FC extends undefined | void\n        ? LRUCache.FetchOptionsNoContext\n        : LRUCache.FetchOptionsWithContext\n    )\n    if (v === undefined) throw new Error('fetch() returned undefined')\n    return v\n  }\n\n  /**\n   * If the key is found in the cache, then this is equivalent to\n   * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n   * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n   *\n   * If an `FC` type is set to a type other than `unknown`, `void`, or\n   * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n   * _must_ provide a `context` option. If set to `undefined` or `void`, then\n   * calls to memo _must not_ provide a `context` option.\n   *\n   * The `context` param allows you to provide arbitrary data that might be\n   * relevant in the course of fetching the data. It is only relevant for the\n   * course of a single `memo()` operation, and discarded afterwards.\n   */\n  memo(\n    k: K,\n    memoOptions: unknown extends FC\n      ? LRUCache.MemoOptions\n      : FC extends undefined | void\n      ? LRUCache.MemoOptionsNoContext\n      : LRUCache.MemoOptionsWithContext\n  ): V\n  // this overload not allowed if context is required\n  memo(\n    k: unknown extends FC\n      ? K\n      : FC extends undefined | void\n      ? K\n      : never,\n    memoOptions?: unknown extends FC\n      ? LRUCache.MemoOptions\n      : FC extends undefined | void\n      ? LRUCache.MemoOptionsNoContext\n      : never\n  ): V\n  memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n    const memoMethod = this.#memoMethod\n    if (!memoMethod) {\n      throw new Error('no memoMethod provided to constructor')\n    }\n    const { context, forceRefresh, ...options } = memoOptions\n    const v = this.get(k, options)\n    if (!forceRefresh && v !== undefined) return v\n    const vv = memoMethod(k, v, {\n      options,\n      context,\n    } as LRUCache.MemoizerOptions)\n    this.set(k, vv, options)\n    return vv\n  }\n\n  /**\n   * Return a value from the cache. Will update the recency of the cache\n   * entry found.\n   *\n   * If the key is not found, get() will return `undefined`.\n   */\n  get(k: K, getOptions: LRUCache.GetOptions = {}) {\n    const {\n      allowStale = this.allowStale,\n      updateAgeOnGet = this.updateAgeOnGet,\n      noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n      status,\n    } = getOptions\n    const index = this.#keyMap.get(k)\n    if (index !== undefined) {\n      const value = this.#valList[index]\n      const fetching = this.#isBackgroundFetch(value)\n      if (status) this.#statusTTL(status, index)\n      if (this.#isStale(index)) {\n        if (status) status.get = 'stale'\n        // delete only if not an in-flight background fetch\n        if (!fetching) {\n          if (!noDeleteOnStaleGet) {\n            this.#delete(k, 'expire')\n          }\n          if (status && allowStale) status.returnedStale = true\n          return allowStale ? value : undefined\n        } else {\n          if (\n            status &&\n            allowStale &&\n            value.__staleWhileFetching !== undefined\n          ) {\n            status.returnedStale = true\n          }\n          return allowStale ? value.__staleWhileFetching : undefined\n        }\n      } else {\n        if (status) status.get = 'hit'\n        // if we're currently fetching it, we don't actually have it yet\n        // it's not stale, which means this isn't a staleWhileRefetching.\n        // If it's not stale, and fetching, AND has a __staleWhileFetching\n        // value, then that means the user fetched with {forceRefresh:true},\n        // so it's safe to return that value.\n        if (fetching) {\n          return value.__staleWhileFetching\n        }\n        this.#moveToTail(index)\n        if (updateAgeOnGet) {\n          this.#updateItemAge(index)\n        }\n        return value\n      }\n    } else if (status) {\n      status.get = 'miss'\n    }\n  }\n\n  #connect(p: Index, n: Index) {\n    this.#prev[n] = p\n    this.#next[p] = n\n  }\n\n  #moveToTail(index: Index): void {\n    // if tail already, nothing to do\n    // if head, move head to next[index]\n    // else\n    //   move next[prev[index]] to next[index] (head has no prev)\n    //   move prev[next[index]] to prev[index]\n    // prev[index] = tail\n    // next[tail] = index\n    // tail = index\n    if (index !== this.#tail) {\n      if (index === this.#head) {\n        this.#head = this.#next[index] as Index\n      } else {\n        this.#connect(\n          this.#prev[index] as Index,\n          this.#next[index] as Index\n        )\n      }\n      this.#connect(this.#tail, index)\n      this.#tail = index\n    }\n  }\n\n  /**\n   * Deletes a key out of the cache.\n   *\n   * Returns true if the key was deleted, false otherwise.\n   */\n  delete(k: K) {\n    return this.#delete(k, 'delete')\n  }\n\n  #delete(k: K, reason: LRUCache.DisposeReason) {\n    let deleted = false\n    if (this.#size !== 0) {\n      const index = this.#keyMap.get(k)\n      if (index !== undefined) {\n        deleted = true\n        if (this.#size === 1) {\n          this.#clear(reason)\n        } else {\n          this.#removeItemSize(index)\n          const v = this.#valList[index]\n          if (this.#isBackgroundFetch(v)) {\n            v.__abortController.abort(new Error('deleted'))\n          } else if (this.#hasDispose || this.#hasDisposeAfter) {\n            if (this.#hasDispose) {\n              this.#dispose?.(v as V, k, reason)\n            }\n            if (this.#hasDisposeAfter) {\n              this.#disposed?.push([v as V, k, reason])\n            }\n          }\n          this.#keyMap.delete(k)\n          this.#keyList[index] = undefined\n          this.#valList[index] = undefined\n          if (index === this.#tail) {\n            this.#tail = this.#prev[index] as Index\n          } else if (index === this.#head) {\n            this.#head = this.#next[index] as Index\n          } else {\n            const pi = this.#prev[index] as number\n            this.#next[pi] = this.#next[index] as number\n            const ni = this.#next[index] as number\n            this.#prev[ni] = this.#prev[index] as number\n          }\n          this.#size--\n          this.#free.push(index)\n        }\n      }\n    }\n    if (this.#hasDisposeAfter && this.#disposed?.length) {\n      const dt = this.#disposed\n      let task: DisposeTask | undefined\n      while ((task = dt?.shift())) {\n        this.#disposeAfter?.(...task)\n      }\n    }\n    return deleted\n  }\n\n  /**\n   * Clear the cache entirely, throwing away all values.\n   */\n  clear() {\n    return this.#clear('delete')\n  }\n  #clear(reason: LRUCache.DisposeReason) {\n    for (const index of this.#rindexes({ allowStale: true })) {\n      const v = this.#valList[index]\n      if (this.#isBackgroundFetch(v)) {\n        v.__abortController.abort(new Error('deleted'))\n      } else {\n        const k = this.#keyList[index]\n        if (this.#hasDispose) {\n          this.#dispose?.(v as V, k as K, reason)\n        }\n        if (this.#hasDisposeAfter) {\n          this.#disposed?.push([v as V, k as K, reason])\n        }\n      }\n    }\n\n    this.#keyMap.clear()\n    this.#valList.fill(undefined)\n    this.#keyList.fill(undefined)\n    if (this.#ttls && this.#starts) {\n      this.#ttls.fill(0)\n      this.#starts.fill(0)\n    }\n    if (this.#sizes) {\n      this.#sizes.fill(0)\n    }\n    this.#head = 0 as Index\n    this.#tail = 0 as Index\n    this.#free.length = 0\n    this.#calculatedSize = 0\n    this.#size = 0\n    if (this.#hasDisposeAfter && this.#disposed) {\n      const dt = this.#disposed\n      let task: DisposeTask | undefined\n      while ((task = dt?.shift())) {\n        this.#disposeAfter?.(...task)\n      }\n    }\n  }\n}\n","const proc =\n  typeof process === 'object' && process\n    ? process\n    : {\n        stdout: null,\n        stderr: null,\n      }\nimport { EventEmitter } from 'node:events'\nimport Stream from 'node:stream'\nimport { StringDecoder } from 'node:string_decoder'\n\n/**\n * Same as StringDecoder, but exposing the `lastNeed` flag on the type\n */\ntype SD = StringDecoder & { lastNeed: boolean }\n\nexport type { SD, Pipe, PipeProxyErrors }\n\n/**\n * Return true if the argument is a Minipass stream, Node stream, or something\n * else that Minipass can interact with.\n */\nexport const isStream = (\n  s: any\n): s is Minipass.Readable | Minipass.Writable =>\n  !!s &&\n  typeof s === 'object' &&\n  (s instanceof Minipass ||\n    s instanceof Stream ||\n    isReadable(s) ||\n    isWritable(s))\n\n/**\n * Return true if the argument is a valid {@link Minipass.Readable}\n */\nexport const isReadable = (s: any): s is Minipass.Readable =>\n  !!s &&\n  typeof s === 'object' &&\n  s instanceof EventEmitter &&\n  typeof (s as Minipass.Readable).pipe === 'function' &&\n  // node core Writable streams have a pipe() method, but it throws\n  (s as Minipass.Readable).pipe !== Stream.Writable.prototype.pipe\n\n/**\n * Return true if the argument is a valid {@link Minipass.Writable}\n */\nexport const isWritable = (s: any): s is Minipass.Readable =>\n  !!s &&\n  typeof s === 'object' &&\n  s instanceof EventEmitter &&\n  typeof (s as Minipass.Writable).write === 'function' &&\n  typeof (s as Minipass.Writable).end === 'function'\n\nconst EOF = Symbol('EOF')\nconst MAYBE_EMIT_END = Symbol('maybeEmitEnd')\nconst EMITTED_END = Symbol('emittedEnd')\nconst EMITTING_END = Symbol('emittingEnd')\nconst EMITTED_ERROR = Symbol('emittedError')\nconst CLOSED = Symbol('closed')\nconst READ = Symbol('read')\nconst FLUSH = Symbol('flush')\nconst FLUSHCHUNK = Symbol('flushChunk')\nconst ENCODING = Symbol('encoding')\nconst DECODER = Symbol('decoder')\nconst FLOWING = Symbol('flowing')\nconst PAUSED = Symbol('paused')\nconst RESUME = Symbol('resume')\nconst BUFFER = Symbol('buffer')\nconst PIPES = Symbol('pipes')\nconst BUFFERLENGTH = Symbol('bufferLength')\nconst BUFFERPUSH = Symbol('bufferPush')\nconst BUFFERSHIFT = Symbol('bufferShift')\nconst OBJECTMODE = Symbol('objectMode')\n// internal event when stream is destroyed\nconst DESTROYED = Symbol('destroyed')\n// internal event when stream has an error\nconst ERROR = Symbol('error')\nconst EMITDATA = Symbol('emitData')\nconst EMITEND = Symbol('emitEnd')\nconst EMITEND2 = Symbol('emitEnd2')\nconst ASYNC = Symbol('async')\nconst ABORT = Symbol('abort')\nconst ABORTED = Symbol('aborted')\nconst SIGNAL = Symbol('signal')\nconst DATALISTENERS = Symbol('dataListeners')\nconst DISCARDED = Symbol('discarded')\n\nconst defer = (fn: (...a: any[]) => any) => Promise.resolve().then(fn)\nconst nodefer = (fn: (...a: any[]) => any) => fn()\n\n// events that mean 'the stream is over'\n// these are treated specially, and re-emitted\n// if they are listened for after emitting.\ntype EndishEvent = 'end' | 'finish' | 'prefinish'\nconst isEndish = (ev: any): ev is EndishEvent =>\n  ev === 'end' || ev === 'finish' || ev === 'prefinish'\n\nconst isArrayBufferLike = (b: any): b is ArrayBufferLike =>\n  b instanceof ArrayBuffer ||\n  (!!b &&\n    typeof b === 'object' &&\n    b.constructor &&\n    b.constructor.name === 'ArrayBuffer' &&\n    b.byteLength >= 0)\n\nconst isArrayBufferView = (b: any): b is ArrayBufferView =>\n  !Buffer.isBuffer(b) && ArrayBuffer.isView(b)\n\n/**\n * Options that may be passed to stream.pipe()\n */\nexport interface PipeOptions {\n  /**\n   * end the destination stream when the source stream ends\n   */\n  end?: boolean\n  /**\n   * proxy errors from the source stream to the destination stream\n   */\n  proxyErrors?: boolean\n}\n\n/**\n * Internal class representing a pipe to a destination stream.\n *\n * @internal\n */\nclass Pipe {\n  src: Minipass\n  dest: Minipass\n  opts: PipeOptions\n  ondrain: () => any\n  constructor(\n    src: Minipass,\n    dest: Minipass.Writable,\n    opts: PipeOptions\n  ) {\n    this.src = src\n    this.dest = dest as Minipass\n    this.opts = opts\n    this.ondrain = () => src[RESUME]()\n    this.dest.on('drain', this.ondrain)\n  }\n  unpipe() {\n    this.dest.removeListener('drain', this.ondrain)\n  }\n  // only here for the prototype\n  /* c8 ignore start */\n  proxyErrors(_er: any) {}\n  /* c8 ignore stop */\n  end() {\n    this.unpipe()\n    if (this.opts.end) this.dest.end()\n  }\n}\n\n/**\n * Internal class representing a pipe to a destination stream where\n * errors are proxied.\n *\n * @internal\n */\nclass PipeProxyErrors extends Pipe {\n  unpipe() {\n    this.src.removeListener('error', this.proxyErrors)\n    super.unpipe()\n  }\n  constructor(\n    src: Minipass,\n    dest: Minipass.Writable,\n    opts: PipeOptions\n  ) {\n    super(src, dest, opts)\n    this.proxyErrors = (er: Error) => this.dest.emit('error', er)\n    src.on('error', this.proxyErrors)\n  }\n}\n\nexport namespace Minipass {\n  /**\n   * Encoding used to create a stream that outputs strings rather than\n   * Buffer objects.\n   */\n  export type Encoding = BufferEncoding | 'buffer' | null\n\n  /**\n   * Any stream that Minipass can pipe into\n   */\n  export type Writable =\n    | Minipass\n    | NodeJS.WriteStream\n    | (NodeJS.WriteStream & { fd: number })\n    | (EventEmitter & {\n        end(): any\n        write(chunk: any, ...args: any[]): any\n      })\n\n  /**\n   * Any stream that can be read from\n   */\n  export type Readable =\n    | Minipass\n    | NodeJS.ReadStream\n    | (NodeJS.ReadStream & { fd: number })\n    | (EventEmitter & {\n        pause(): any\n        resume(): any\n        pipe(...destArgs: any[]): any\n      })\n\n  /**\n   * Utility type that can be iterated sync or async\n   */\n  export type DualIterable = Iterable & AsyncIterable\n\n  type EventArguments = Record\n\n  /**\n   * The listing of events that a Minipass class can emit.\n   * Extend this when extending the Minipass class, and pass as\n   * the third template argument.  The key is the name of the event,\n   * and the value is the argument list.\n   *\n   * Any undeclared events will still be allowed, but the handler will get\n   * arguments as `unknown[]`.\n   */\n  export interface Events\n    extends EventArguments {\n    readable: []\n    data: [chunk: RType]\n    error: [er: unknown]\n    abort: [reason: unknown]\n    drain: []\n    resume: []\n    end: []\n    finish: []\n    prefinish: []\n    close: []\n    [DESTROYED]: [er?: unknown]\n    [ERROR]: [er: unknown]\n  }\n\n  /**\n   * String or buffer-like data that can be joined and sliced\n   */\n  export type ContiguousData =\n    | Buffer\n    | ArrayBufferLike\n    | ArrayBufferView\n    | string\n  export type BufferOrString = Buffer | string\n\n  /**\n   * Options passed to the Minipass constructor.\n   */\n  export type SharedOptions = {\n    /**\n     * Defer all data emission and other events until the end of the\n     * current tick, similar to Node core streams\n     */\n    async?: boolean\n    /**\n     * A signal which will abort the stream\n     */\n    signal?: AbortSignal\n    /**\n     * Output string encoding. Set to `null` or `'buffer'` (or omit) to\n     * emit Buffer objects rather than strings.\n     *\n     * Conflicts with `objectMode`\n     */\n    encoding?: BufferEncoding | null | 'buffer'\n    /**\n     * Output data exactly as it was written, supporting non-buffer/string\n     * data (such as arbitrary objects, falsey values, etc.)\n     *\n     * Conflicts with `encoding`\n     */\n    objectMode?: boolean\n  }\n\n  /**\n   * Options for a string encoded output\n   */\n  export type EncodingOptions = SharedOptions & {\n    encoding: BufferEncoding\n    objectMode?: false\n  }\n\n  /**\n   * Options for contiguous data buffer output\n   */\n  export type BufferOptions = SharedOptions & {\n    encoding?: null | 'buffer'\n    objectMode?: false\n  }\n\n  /**\n   * Options for objectMode arbitrary output\n   */\n  export type ObjectModeOptions = SharedOptions & {\n    objectMode: true\n    encoding?: null\n  }\n\n  /**\n   * Utility type to determine allowed options based on read type\n   */\n  export type Options =\n    | ObjectModeOptions\n    | (T extends string\n        ? EncodingOptions\n        : T extends Buffer\n        ? BufferOptions\n        : SharedOptions)\n}\n\nconst isObjectModeOptions = (\n  o: Minipass.SharedOptions\n): o is Minipass.ObjectModeOptions => !!o.objectMode\n\nconst isEncodingOptions = (\n  o: Minipass.SharedOptions\n): o is Minipass.EncodingOptions =>\n  !o.objectMode && !!o.encoding && o.encoding !== 'buffer'\n\n/**\n * Main export, the Minipass class\n *\n * `RType` is the type of data emitted, defaults to Buffer\n *\n * `WType` is the type of data to be written, if RType is buffer or string,\n * then any {@link Minipass.ContiguousData} is allowed.\n *\n * `Events` is the set of event handler signatures that this object\n * will emit, see {@link Minipass.Events}\n */\nexport class Minipass<\n    RType extends unknown = Buffer,\n    WType extends unknown = RType extends Minipass.BufferOrString\n      ? Minipass.ContiguousData\n      : RType,\n    Events extends Minipass.Events = Minipass.Events\n  >\n  extends EventEmitter\n  implements Minipass.DualIterable\n{\n  [FLOWING]: boolean = false;\n  [PAUSED]: boolean = false;\n  [PIPES]: Pipe[] = [];\n  [BUFFER]: RType[] = [];\n  [OBJECTMODE]: boolean;\n  [ENCODING]: BufferEncoding | null;\n  [ASYNC]: boolean;\n  [DECODER]: SD | null;\n  [EOF]: boolean = false;\n  [EMITTED_END]: boolean = false;\n  [EMITTING_END]: boolean = false;\n  [CLOSED]: boolean = false;\n  [EMITTED_ERROR]: unknown = null;\n  [BUFFERLENGTH]: number = 0;\n  [DESTROYED]: boolean = false;\n  [SIGNAL]?: AbortSignal;\n  [ABORTED]: boolean = false;\n  [DATALISTENERS]: number = 0;\n  [DISCARDED]: boolean = false\n\n  /**\n   * true if the stream can be written\n   */\n  writable: boolean = true\n  /**\n   * true if the stream can be read\n   */\n  readable: boolean = true\n\n  /**\n   * If `RType` is Buffer, then options do not need to be provided.\n   * Otherwise, an options object must be provided to specify either\n   * {@link Minipass.SharedOptions.objectMode} or\n   * {@link Minipass.SharedOptions.encoding}, as appropriate.\n   */\n  constructor(\n    ...args:\n      | [Minipass.ObjectModeOptions]\n      | (RType extends Buffer\n          ? [] | [Minipass.Options]\n          : [Minipass.Options])\n  ) {\n    const options: Minipass.Options = (args[0] ||\n      {}) as Minipass.Options\n    super()\n    if (options.objectMode && typeof options.encoding === 'string') {\n      throw new TypeError(\n        'Encoding and objectMode may not be used together'\n      )\n    }\n    if (isObjectModeOptions(options)) {\n      this[OBJECTMODE] = true\n      this[ENCODING] = null\n    } else if (isEncodingOptions(options)) {\n      this[ENCODING] = options.encoding\n      this[OBJECTMODE] = false\n    } else {\n      this[OBJECTMODE] = false\n      this[ENCODING] = null\n    }\n    this[ASYNC] = !!options.async\n    this[DECODER] = this[ENCODING]\n      ? (new StringDecoder(this[ENCODING]) as SD)\n      : null\n\n    //@ts-ignore - private option for debugging and testing\n    if (options && options.debugExposeBuffer === true) {\n      Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] })\n    }\n    //@ts-ignore - private option for debugging and testing\n    if (options && options.debugExposePipes === true) {\n      Object.defineProperty(this, 'pipes', { get: () => this[PIPES] })\n    }\n\n    const { signal } = options\n    if (signal) {\n      this[SIGNAL] = signal\n      if (signal.aborted) {\n        this[ABORT]()\n      } else {\n        signal.addEventListener('abort', () => this[ABORT]())\n      }\n    }\n  }\n\n  /**\n   * The amount of data stored in the buffer waiting to be read.\n   *\n   * For Buffer strings, this will be the total byte length.\n   * For string encoding streams, this will be the string character length,\n   * according to JavaScript's `string.length` logic.\n   * For objectMode streams, this is a count of the items waiting to be\n   * emitted.\n   */\n  get bufferLength() {\n    return this[BUFFERLENGTH]\n  }\n\n  /**\n   * The `BufferEncoding` currently in use, or `null`\n   */\n  get encoding() {\n    return this[ENCODING]\n  }\n\n  /**\n   * @deprecated - This is a read only property\n   */\n  set encoding(_enc) {\n    throw new Error('Encoding must be set at instantiation time')\n  }\n\n  /**\n   * @deprecated - Encoding may only be set at instantiation time\n   */\n  setEncoding(_enc: Minipass.Encoding) {\n    throw new Error('Encoding must be set at instantiation time')\n  }\n\n  /**\n   * True if this is an objectMode stream\n   */\n  get objectMode() {\n    return this[OBJECTMODE]\n  }\n\n  /**\n   * @deprecated - This is a read-only property\n   */\n  set objectMode(_om) {\n    throw new Error('objectMode must be set at instantiation time')\n  }\n\n  /**\n   * true if this is an async stream\n   */\n  get ['async'](): boolean {\n    return this[ASYNC]\n  }\n  /**\n   * Set to true to make this stream async.\n   *\n   * Once set, it cannot be unset, as this would potentially cause incorrect\n   * behavior.  Ie, a sync stream can be made async, but an async stream\n   * cannot be safely made sync.\n   */\n  set ['async'](a: boolean) {\n    this[ASYNC] = this[ASYNC] || !!a\n  }\n\n  // drop everything and get out of the flow completely\n  [ABORT]() {\n    this[ABORTED] = true\n    this.emit('abort', this[SIGNAL]?.reason)\n    this.destroy(this[SIGNAL]?.reason)\n  }\n\n  /**\n   * True if the stream has been aborted.\n   */\n  get aborted() {\n    return this[ABORTED]\n  }\n  /**\n   * No-op setter. Stream aborted status is set via the AbortSignal provided\n   * in the constructor options.\n   */\n  set aborted(_) {}\n\n  /**\n   * Write data into the stream\n   *\n   * If the chunk written is a string, and encoding is not specified, then\n   * `utf8` will be assumed. If the stream encoding matches the encoding of\n   * a written string, and the state of the string decoder allows it, then\n   * the string will be passed through to either the output or the internal\n   * buffer without any processing. Otherwise, it will be turned into a\n   * Buffer object for processing into the desired encoding.\n   *\n   * If provided, `cb` function is called immediately before return for\n   * sync streams, or on next tick for async streams, because for this\n   * base class, a chunk is considered \"processed\" once it is accepted\n   * and either emitted or buffered. That is, the callback does not indicate\n   * that the chunk has been eventually emitted, though of course child\n   * classes can override this function to do whatever processing is required\n   * and call `super.write(...)` only once processing is completed.\n   */\n  write(chunk: WType, cb?: () => void): boolean\n  write(\n    chunk: WType,\n    encoding?: Minipass.Encoding,\n    cb?: () => void\n  ): boolean\n  write(\n    chunk: WType,\n    encoding?: Minipass.Encoding | (() => void),\n    cb?: () => void\n  ): boolean {\n    if (this[ABORTED]) return false\n    if (this[EOF]) throw new Error('write after end')\n\n    if (this[DESTROYED]) {\n      this.emit(\n        'error',\n        Object.assign(\n          new Error('Cannot call write after a stream was destroyed'),\n          { code: 'ERR_STREAM_DESTROYED' }\n        )\n      )\n      return true\n    }\n\n    if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = 'utf8'\n    }\n\n    if (!encoding) encoding = 'utf8'\n\n    const fn = this[ASYNC] ? defer : nodefer\n\n    // convert array buffers and typed array views into buffers\n    // at some point in the future, we may want to do the opposite!\n    // leave strings and buffers as-is\n    // anything is only allowed if in object mode, so throw\n    if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {\n      if (isArrayBufferView(chunk)) {\n        //@ts-ignore - sinful unsafe type changing\n        chunk = Buffer.from(\n          chunk.buffer,\n          chunk.byteOffset,\n          chunk.byteLength\n        )\n      } else if (isArrayBufferLike(chunk)) {\n        //@ts-ignore - sinful unsafe type changing\n        chunk = Buffer.from(chunk)\n      } else if (typeof chunk !== 'string') {\n        throw new Error(\n          'Non-contiguous data written to non-objectMode stream'\n        )\n      }\n    }\n\n    // handle object mode up front, since it's simpler\n    // this yields better performance, fewer checks later.\n    if (this[OBJECTMODE]) {\n      // maybe impossible?\n      /* c8 ignore start */\n      if (this[FLOWING] && this[BUFFERLENGTH] !== 0) this[FLUSH](true)\n      /* c8 ignore stop */\n\n      if (this[FLOWING]) this.emit('data', chunk as unknown as RType)\n      else this[BUFFERPUSH](chunk as unknown as RType)\n\n      if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n\n      if (cb) fn(cb)\n\n      return this[FLOWING]\n    }\n\n    // at this point the chunk is a buffer or string\n    // don't buffer it up or send it to the decoder\n    if (!(chunk as Minipass.BufferOrString).length) {\n      if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n      if (cb) fn(cb)\n      return this[FLOWING]\n    }\n\n    // fast-path writing strings of same encoding to a stream with\n    // an empty buffer, skipping the buffer/decoder dance\n    if (\n      typeof chunk === 'string' &&\n      // unless it is a string already ready for us to use\n      !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)\n    ) {\n      //@ts-ignore - sinful unsafe type change\n      chunk = Buffer.from(chunk, encoding)\n    }\n\n    if (Buffer.isBuffer(chunk) && this[ENCODING]) {\n      //@ts-ignore - sinful unsafe type change\n      chunk = this[DECODER].write(chunk)\n    }\n\n    // Note: flushing CAN potentially switch us into not-flowing mode\n    if (this[FLOWING] && this[BUFFERLENGTH] !== 0) this[FLUSH](true)\n\n    if (this[FLOWING]) this.emit('data', chunk as unknown as RType)\n    else this[BUFFERPUSH](chunk as unknown as RType)\n\n    if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n\n    if (cb) fn(cb)\n\n    return this[FLOWING]\n  }\n\n  /**\n   * Low-level explicit read method.\n   *\n   * In objectMode, the argument is ignored, and one item is returned if\n   * available.\n   *\n   * `n` is the number of bytes (or in the case of encoding streams,\n   * characters) to consume. If `n` is not provided, then the entire buffer\n   * is returned, or `null` is returned if no data is available.\n   *\n   * If `n` is greater that the amount of data in the internal buffer,\n   * then `null` is returned.\n   */\n  read(n?: number | null): RType | null {\n    if (this[DESTROYED]) return null\n    this[DISCARDED] = false\n\n    if (\n      this[BUFFERLENGTH] === 0 ||\n      n === 0 ||\n      (n && n > this[BUFFERLENGTH])\n    ) {\n      this[MAYBE_EMIT_END]()\n      return null\n    }\n\n    if (this[OBJECTMODE]) n = null\n\n    if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {\n      // not object mode, so if we have an encoding, then RType is string\n      // otherwise, must be Buffer\n      this[BUFFER] = [\n        (this[ENCODING]\n          ? this[BUFFER].join('')\n          : Buffer.concat(\n              this[BUFFER] as Buffer[],\n              this[BUFFERLENGTH]\n            )) as RType,\n      ]\n    }\n\n    const ret = this[READ](n || null, this[BUFFER][0] as RType)\n    this[MAYBE_EMIT_END]()\n    return ret\n  }\n\n  [READ](n: number | null, chunk: RType) {\n    if (this[OBJECTMODE]) this[BUFFERSHIFT]()\n    else {\n      const c = chunk as Minipass.BufferOrString\n      if (n === c.length || n === null) this[BUFFERSHIFT]()\n      else if (typeof c === 'string') {\n        this[BUFFER][0] = c.slice(n) as RType\n        chunk = c.slice(0, n) as RType\n        this[BUFFERLENGTH] -= n\n      } else {\n        this[BUFFER][0] = c.subarray(n) as RType\n        chunk = c.subarray(0, n) as RType\n        this[BUFFERLENGTH] -= n\n      }\n    }\n\n    this.emit('data', chunk)\n\n    if (!this[BUFFER].length && !this[EOF]) this.emit('drain')\n\n    return chunk\n  }\n\n  /**\n   * End the stream, optionally providing a final write.\n   *\n   * See {@link Minipass#write} for argument descriptions\n   */\n  end(cb?: () => void): this\n  end(chunk: WType, cb?: () => void): this\n  end(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): this\n  end(\n    chunk?: WType | (() => void),\n    encoding?: Minipass.Encoding | (() => void),\n    cb?: () => void\n  ): this {\n    if (typeof chunk === 'function') {\n      cb = chunk as () => void\n      chunk = undefined\n    }\n    if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = 'utf8'\n    }\n    if (chunk !== undefined) this.write(chunk, encoding)\n    if (cb) this.once('end', cb)\n    this[EOF] = true\n    this.writable = false\n\n    // if we haven't written anything, then go ahead and emit,\n    // even if we're not reading.\n    // we'll re-emit if a new 'end' listener is added anyway.\n    // This makes MP more suitable to write-only use cases.\n    if (this[FLOWING] || !this[PAUSED]) this[MAYBE_EMIT_END]()\n    return this\n  }\n\n  // don't let the internal resume be overwritten\n  [RESUME]() {\n    if (this[DESTROYED]) return\n\n    if (!this[DATALISTENERS] && !this[PIPES].length) {\n      this[DISCARDED] = true\n    }\n    this[PAUSED] = false\n    this[FLOWING] = true\n    this.emit('resume')\n    if (this[BUFFER].length) this[FLUSH]()\n    else if (this[EOF]) this[MAYBE_EMIT_END]()\n    else this.emit('drain')\n  }\n\n  /**\n   * Resume the stream if it is currently in a paused state\n   *\n   * If called when there are no pipe destinations or `data` event listeners,\n   * this will place the stream in a \"discarded\" state, where all data will\n   * be thrown away. The discarded state is removed if a pipe destination or\n   * data handler is added, if pause() is called, or if any synchronous or\n   * asynchronous iteration is started.\n   */\n  resume() {\n    return this[RESUME]()\n  }\n\n  /**\n   * Pause the stream\n   */\n  pause() {\n    this[FLOWING] = false\n    this[PAUSED] = true\n    this[DISCARDED] = false\n  }\n\n  /**\n   * true if the stream has been forcibly destroyed\n   */\n  get destroyed() {\n    return this[DESTROYED]\n  }\n\n  /**\n   * true if the stream is currently in a flowing state, meaning that\n   * any writes will be immediately emitted.\n   */\n  get flowing() {\n    return this[FLOWING]\n  }\n\n  /**\n   * true if the stream is currently in a paused state\n   */\n  get paused() {\n    return this[PAUSED]\n  }\n\n  [BUFFERPUSH](chunk: RType) {\n    if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1\n    else this[BUFFERLENGTH] += (chunk as Minipass.BufferOrString).length\n    this[BUFFER].push(chunk)\n  }\n\n  [BUFFERSHIFT](): RType {\n    if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1\n    else\n      this[BUFFERLENGTH] -= (\n        this[BUFFER][0] as Minipass.BufferOrString\n      ).length\n    return this[BUFFER].shift() as RType\n  }\n\n  [FLUSH](noDrain: boolean = false) {\n    do {} while (\n      this[FLUSHCHUNK](this[BUFFERSHIFT]()) &&\n      this[BUFFER].length\n    )\n\n    if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit('drain')\n  }\n\n  [FLUSHCHUNK](chunk: RType) {\n    this.emit('data', chunk)\n    return this[FLOWING]\n  }\n\n  /**\n   * Pipe all data emitted by this stream into the destination provided.\n   *\n   * Triggers the flow of data.\n   */\n  pipe(dest: W, opts?: PipeOptions): W {\n    if (this[DESTROYED]) return dest\n    this[DISCARDED] = false\n\n    const ended = this[EMITTED_END]\n    opts = opts || {}\n    if (dest === proc.stdout || dest === proc.stderr) opts.end = false\n    else opts.end = opts.end !== false\n    opts.proxyErrors = !!opts.proxyErrors\n\n    // piping an ended stream ends immediately\n    if (ended) {\n      if (opts.end) dest.end()\n    } else {\n      // \"as\" here just ignores the WType, which pipes don't care about,\n      // since they're only consuming from us, and writing to the dest\n      this[PIPES].push(\n        !opts.proxyErrors\n          ? new Pipe(this as Minipass, dest, opts)\n          : new PipeProxyErrors(this as Minipass, dest, opts)\n      )\n      if (this[ASYNC]) defer(() => this[RESUME]())\n      else this[RESUME]()\n    }\n\n    return dest\n  }\n\n  /**\n   * Fully unhook a piped destination stream.\n   *\n   * If the destination stream was the only consumer of this stream (ie,\n   * there are no other piped destinations or `'data'` event listeners)\n   * then the flow of data will stop until there is another consumer or\n   * {@link Minipass#resume} is explicitly called.\n   */\n  unpipe(dest: W) {\n    const p = this[PIPES].find(p => p.dest === dest)\n    if (p) {\n      if (this[PIPES].length === 1) {\n        if (this[FLOWING] && this[DATALISTENERS] === 0) {\n          this[FLOWING] = false\n        }\n        this[PIPES] = []\n      } else this[PIPES].splice(this[PIPES].indexOf(p), 1)\n      p.unpipe()\n    }\n  }\n\n  /**\n   * Alias for {@link Minipass#on}\n   */\n  addListener(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ): this {\n    return this.on(ev, handler)\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.on`, with the following\n   * behavior differences to prevent data loss and unnecessary hangs:\n   *\n   * - Adding a 'data' event handler will trigger the flow of data\n   *\n   * - Adding a 'readable' event handler when there is data waiting to be read\n   *   will cause 'readable' to be emitted immediately.\n   *\n   * - Adding an 'endish' event handler ('end', 'finish', etc.) which has\n   *   already passed will cause the event to be emitted immediately and all\n   *   handlers removed.\n   *\n   * - Adding an 'error' event handler after an error has been emitted will\n   *   cause the event to be re-emitted immediately with the error previously\n   *   raised.\n   */\n  on(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ): this {\n    const ret = super.on(\n      ev as string | symbol,\n      handler as (...a: any[]) => any\n    )\n    if (ev === 'data') {\n      this[DISCARDED] = false\n      this[DATALISTENERS]++\n      if (!this[PIPES].length && !this[FLOWING]) {\n        this[RESUME]()\n      }\n    } else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) {\n      super.emit('readable')\n    } else if (isEndish(ev) && this[EMITTED_END]) {\n      super.emit(ev)\n      this.removeAllListeners(ev)\n    } else if (ev === 'error' && this[EMITTED_ERROR]) {\n      const h = handler as (...a: Events['error']) => any\n      if (this[ASYNC]) defer(() => h.call(this, this[EMITTED_ERROR]))\n      else h.call(this, this[EMITTED_ERROR])\n    }\n    return ret\n  }\n\n  /**\n   * Alias for {@link Minipass#off}\n   */\n  removeListener(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ) {\n    return this.off(ev, handler)\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.off`\n   *\n   * If a 'data' event handler is removed, and it was the last consumer\n   * (ie, there are no pipe destinations or other 'data' event listeners),\n   * then the flow of data will stop until there is another consumer or\n   * {@link Minipass#resume} is explicitly called.\n   */\n  off(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ) {\n    const ret = super.off(\n      ev as string | symbol,\n      handler as (...a: any[]) => any\n    )\n    // if we previously had listeners, and now we don't, and we don't\n    // have any pipes, then stop the flow, unless it's been explicitly\n    // put in a discarded flowing state via stream.resume().\n    if (ev === 'data') {\n      this[DATALISTENERS] = this.listeners('data').length\n      if (\n        this[DATALISTENERS] === 0 &&\n        !this[DISCARDED] &&\n        !this[PIPES].length\n      ) {\n        this[FLOWING] = false\n      }\n    }\n    return ret\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.removeAllListeners`\n   *\n   * If all 'data' event handlers are removed, and they were the last consumer\n   * (ie, there are no pipe destinations), then the flow of data will stop\n   * until there is another consumer or {@link Minipass#resume} is explicitly\n   * called.\n   */\n  removeAllListeners(ev?: Event) {\n    const ret = super.removeAllListeners(ev as string | symbol | undefined)\n    if (ev === 'data' || ev === undefined) {\n      this[DATALISTENERS] = 0\n      if (!this[DISCARDED] && !this[PIPES].length) {\n        this[FLOWING] = false\n      }\n    }\n    return ret\n  }\n\n  /**\n   * true if the 'end' event has been emitted\n   */\n  get emittedEnd() {\n    return this[EMITTED_END]\n  }\n\n  [MAYBE_EMIT_END]() {\n    if (\n      !this[EMITTING_END] &&\n      !this[EMITTED_END] &&\n      !this[DESTROYED] &&\n      this[BUFFER].length === 0 &&\n      this[EOF]\n    ) {\n      this[EMITTING_END] = true\n      this.emit('end')\n      this.emit('prefinish')\n      this.emit('finish')\n      if (this[CLOSED]) this.emit('close')\n      this[EMITTING_END] = false\n    }\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.emit`, with the following\n   * behavior differences to prevent data loss and unnecessary hangs:\n   *\n   * If the stream has been destroyed, and the event is something other\n   * than 'close' or 'error', then `false` is returned and no handlers\n   * are called.\n   *\n   * If the event is 'end', and has already been emitted, then the event\n   * is ignored. If the stream is in a paused or non-flowing state, then\n   * the event will be deferred until data flow resumes. If the stream is\n   * async, then handlers will be called on the next tick rather than\n   * immediately.\n   *\n   * If the event is 'close', and 'end' has not yet been emitted, then\n   * the event will be deferred until after 'end' is emitted.\n   *\n   * If the event is 'error', and an AbortSignal was provided for the stream,\n   * and there are no listeners, then the event is ignored, matching the\n   * behavior of node core streams in the presense of an AbortSignal.\n   *\n   * If the event is 'finish' or 'prefinish', then all listeners will be\n   * removed after emitting the event, to prevent double-firing.\n   */\n  emit(\n    ev: Event,\n    ...args: Events[Event]\n  ): boolean {\n    const data = args[0]\n    // error and close are only events allowed after calling destroy()\n    if (\n      ev !== 'error' &&\n      ev !== 'close' &&\n      ev !== DESTROYED &&\n      this[DESTROYED]\n    ) {\n      return false\n    } else if (ev === 'data') {\n      return !this[OBJECTMODE] && !data\n        ? false\n        : this[ASYNC]\n        ? (defer(() => this[EMITDATA](data as RType)), true)\n        : this[EMITDATA](data as RType)\n    } else if (ev === 'end') {\n      return this[EMITEND]()\n    } else if (ev === 'close') {\n      this[CLOSED] = true\n      // don't emit close before 'end' and 'finish'\n      if (!this[EMITTED_END] && !this[DESTROYED]) return false\n      const ret = super.emit('close')\n      this.removeAllListeners('close')\n      return ret\n    } else if (ev === 'error') {\n      this[EMITTED_ERROR] = data\n      super.emit(ERROR, data)\n      const ret =\n        !this[SIGNAL] || this.listeners('error').length\n          ? super.emit('error', data)\n          : false\n      this[MAYBE_EMIT_END]()\n      return ret\n    } else if (ev === 'resume') {\n      const ret = super.emit('resume')\n      this[MAYBE_EMIT_END]()\n      return ret\n    } else if (ev === 'finish' || ev === 'prefinish') {\n      const ret = super.emit(ev)\n      this.removeAllListeners(ev)\n      return ret\n    }\n\n    // Some other unknown event\n    const ret = super.emit(ev as string, ...args)\n    this[MAYBE_EMIT_END]()\n    return ret\n  }\n\n  [EMITDATA](data: RType) {\n    for (const p of this[PIPES]) {\n      if (p.dest.write(data as RType) === false) this.pause()\n    }\n    const ret = this[DISCARDED] ? false : super.emit('data', data)\n    this[MAYBE_EMIT_END]()\n    return ret\n  }\n\n  [EMITEND]() {\n    if (this[EMITTED_END]) return false\n\n    this[EMITTED_END] = true\n    this.readable = false\n    return this[ASYNC]\n      ? (defer(() => this[EMITEND2]()), true)\n      : this[EMITEND2]()\n  }\n\n  [EMITEND2]() {\n    if (this[DECODER]) {\n      const data = this[DECODER].end()\n      if (data) {\n        for (const p of this[PIPES]) {\n          p.dest.write(data as RType)\n        }\n        if (!this[DISCARDED]) super.emit('data', data)\n      }\n    }\n\n    for (const p of this[PIPES]) {\n      p.end()\n    }\n    const ret = super.emit('end')\n    this.removeAllListeners('end')\n    return ret\n  }\n\n  /**\n   * Return a Promise that resolves to an array of all emitted data once\n   * the stream ends.\n   */\n  async collect(): Promise {\n    const buf: RType[] & { dataLength: number } = Object.assign([], {\n      dataLength: 0,\n    })\n    if (!this[OBJECTMODE]) buf.dataLength = 0\n    // set the promise first, in case an error is raised\n    // by triggering the flow here.\n    const p = this.promise()\n    this.on('data', c => {\n      buf.push(c)\n      if (!this[OBJECTMODE])\n        buf.dataLength += (c as Minipass.BufferOrString).length\n    })\n    await p\n    return buf\n  }\n\n  /**\n   * Return a Promise that resolves to the concatenation of all emitted data\n   * once the stream ends.\n   *\n   * Not allowed on objectMode streams.\n   */\n  async concat(): Promise {\n    if (this[OBJECTMODE]) {\n      throw new Error('cannot concat in objectMode')\n    }\n    const buf = await this.collect()\n    return (\n      this[ENCODING]\n        ? buf.join('')\n        : Buffer.concat(buf as Buffer[], buf.dataLength)\n    ) as RType\n  }\n\n  /**\n   * Return a void Promise that resolves once the stream ends.\n   */\n  async promise(): Promise {\n    return new Promise((resolve, reject) => {\n      this.on(DESTROYED, () => reject(new Error('stream destroyed')))\n      this.on('error', er => reject(er))\n      this.on('end', () => resolve())\n    })\n  }\n\n  /**\n   * Asynchronous `for await of` iteration.\n   *\n   * This will continue emitting all chunks until the stream terminates.\n   */\n  [Symbol.asyncIterator](): AsyncGenerator {\n    // set this up front, in case the consumer doesn't call next()\n    // right away.\n    this[DISCARDED] = false\n    let stopped = false\n    const stop = async (): Promise> => {\n      this.pause()\n      stopped = true\n      return { value: undefined, done: true }\n    }\n    const next = (): Promise> => {\n      if (stopped) return stop()\n      const res = this.read()\n      if (res !== null) return Promise.resolve({ done: false, value: res })\n\n      if (this[EOF]) return stop()\n\n      let resolve!: (res: IteratorResult) => void\n      let reject!: (er: unknown) => void\n      const onerr = (er: unknown) => {\n        this.off('data', ondata)\n        this.off('end', onend)\n        this.off(DESTROYED, ondestroy)\n        stop()\n        reject(er)\n      }\n      const ondata = (value: RType) => {\n        this.off('error', onerr)\n        this.off('end', onend)\n        this.off(DESTROYED, ondestroy)\n        this.pause()\n        resolve({ value, done: !!this[EOF] })\n      }\n      const onend = () => {\n        this.off('error', onerr)\n        this.off('data', ondata)\n        this.off(DESTROYED, ondestroy)\n        stop()\n        resolve({ done: true, value: undefined })\n      }\n      const ondestroy = () => onerr(new Error('stream destroyed'))\n      return new Promise>((res, rej) => {\n        reject = rej\n        resolve = res\n        this.once(DESTROYED, ondestroy)\n        this.once('error', onerr)\n        this.once('end', onend)\n        this.once('data', ondata)\n      })\n    }\n\n    return {\n      next,\n      throw: stop,\n      return: stop,\n      [Symbol.asyncIterator]() {\n        return this\n      },\n      [Symbol.asyncDispose]: async () => {},\n    }\n  }\n\n  /**\n   * Synchronous `for of` iteration.\n   *\n   * The iteration will terminate when the internal buffer runs out, even\n   * if the stream has not yet terminated.\n   */\n  [Symbol.iterator](): Generator {\n    // set this up front, in case the consumer doesn't call next()\n    // right away.\n    this[DISCARDED] = false\n    let stopped = false\n    const stop = (): IteratorReturnResult => {\n      this.pause()\n      this.off(ERROR, stop)\n      this.off(DESTROYED, stop)\n      this.off('end', stop)\n      stopped = true\n      return { done: true, value: undefined }\n    }\n\n    const next = (): IteratorResult => {\n      if (stopped) return stop()\n      const value = this.read()\n      return value === null ? stop() : { done: false, value }\n    }\n\n    this.once('end', stop)\n    this.once(ERROR, stop)\n    this.once(DESTROYED, stop)\n\n    return {\n      next,\n      throw: stop,\n      return: stop,\n      [Symbol.iterator]() {\n        return this\n      },\n      [Symbol.dispose]: () => {},\n    }\n  }\n\n  /**\n   * Destroy a stream, preventing it from being used for any further purpose.\n   *\n   * If the stream has a `close()` method, then it will be called on\n   * destruction.\n   *\n   * After destruction, any attempt to write data, read data, or emit most\n   * events will be ignored.\n   *\n   * If an error argument is provided, then it will be emitted in an\n   * 'error' event.\n   */\n  destroy(er?: unknown) {\n    if (this[DESTROYED]) {\n      if (er) this.emit('error', er)\n      else this.emit(DESTROYED)\n      return this\n    }\n\n    this[DESTROYED] = true\n    this[DISCARDED] = true\n\n    // throw away all buffered data, it's never coming out\n    this[BUFFER].length = 0\n    this[BUFFERLENGTH] = 0\n\n    const wc = this as Minipass & {\n      close?: () => void\n    }\n    if (typeof wc.close === 'function' && !this[CLOSED]) wc.close()\n\n    if (er) this.emit('error', er)\n    // if no error to emit, still reject pending promises\n    else this.emit(DESTROYED)\n\n    return this\n  }\n\n  /**\n   * Alias for {@link isStream}\n   *\n   * Former export location, maintained for backwards compatibility.\n   *\n   * @deprecated\n   */\n  static get isStream() {\n    return isStream\n  }\n}\n","import { LRUCache } from 'lru-cache'\nimport { posix, win32 } from 'node:path'\n\nimport { fileURLToPath } from 'node:url'\n\nimport {\n  lstatSync,\n  readdir as readdirCB,\n  readdirSync,\n  readlinkSync,\n  realpathSync as rps,\n} from 'fs'\nimport * as actualFS from 'node:fs'\n\nconst realpathSync = rps.native\n// TODO: test perf of fs/promises realpath vs realpathCB,\n// since the promises one uses realpath.native\n\nimport { lstat, readdir, readlink, realpath } from 'node:fs/promises'\n\nimport { Minipass } from 'minipass'\nimport type { Dirent, Stats } from 'node:fs'\n\n/**\n * An object that will be used to override the default `fs`\n * methods.  Any methods that are not overridden will use Node's\n * built-in implementations.\n *\n * - lstatSync\n * - readdir (callback `withFileTypes` Dirent variant, used for\n *   readdirCB and most walks)\n * - readdirSync\n * - readlinkSync\n * - realpathSync\n * - promises: Object containing the following async methods:\n *   - lstat\n *   - readdir (Dirent variant only)\n *   - readlink\n *   - realpath\n */\nexport interface FSOption {\n  lstatSync?: (path: string) => Stats\n  readdir?: (\n    path: string,\n    options: { withFileTypes: true },\n    cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any,\n  ) => void\n  readdirSync?: (\n    path: string,\n    options: { withFileTypes: true },\n  ) => Dirent[]\n  readlinkSync?: (path: string) => string\n  realpathSync?: (path: string) => string\n  promises?: {\n    lstat?: (path: string) => Promise\n    readdir?: (\n      path: string,\n      options: { withFileTypes: true },\n    ) => Promise\n    readlink?: (path: string) => Promise\n    realpath?: (path: string) => Promise\n    [k: string]: any\n  }\n  [k: string]: any\n}\n\ninterface FSValue {\n  lstatSync: (path: string) => Stats\n  readdir: (\n    path: string,\n    options: { withFileTypes: true },\n    cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any,\n  ) => void\n  readdirSync: (path: string, options: { withFileTypes: true }) => Dirent[]\n  readlinkSync: (path: string) => string\n  realpathSync: (path: string) => string\n  promises: {\n    lstat: (path: string) => Promise\n    readdir: (\n      path: string,\n      options: { withFileTypes: true },\n    ) => Promise\n    readlink: (path: string) => Promise\n    realpath: (path: string) => Promise\n    [k: string]: any\n  }\n  [k: string]: any\n}\n\nconst defaultFS: FSValue = {\n  lstatSync,\n  readdir: readdirCB,\n  readdirSync,\n  readlinkSync,\n  realpathSync,\n  promises: {\n    lstat,\n    readdir,\n    readlink,\n    realpath,\n  },\n}\n\n// if they just gave us require('fs') then use our default\nconst fsFromOption = (fsOption?: FSOption): FSValue =>\n  !fsOption || fsOption === defaultFS || fsOption === actualFS ?\n    defaultFS\n  : {\n      ...defaultFS,\n      ...fsOption,\n      promises: {\n        ...defaultFS.promises,\n        ...(fsOption.promises || {}),\n      },\n    }\n\n// turn something like //?/c:/ into c:\\\nconst uncDriveRegexp = /^\\\\\\\\\\?\\\\([a-z]:)\\\\?$/i\nconst uncToDrive = (rootPath: string): string =>\n  rootPath.replace(/\\//g, '\\\\').replace(uncDriveRegexp, '$1\\\\')\n\n// windows paths are separated by either / or \\\nconst eitherSep = /[\\\\\\/]/\n\nconst UNKNOWN = 0 // may not even exist, for all we know\nconst IFIFO = 0b0001\nconst IFCHR = 0b0010\nconst IFDIR = 0b0100\nconst IFBLK = 0b0110\nconst IFREG = 0b1000\nconst IFLNK = 0b1010\nconst IFSOCK = 0b1100\nconst IFMT = 0b1111\n\nexport type Type =\n  | 'Unknown'\n  | 'FIFO'\n  | 'CharacterDevice'\n  | 'Directory'\n  | 'BlockDevice'\n  | 'File'\n  | 'SymbolicLink'\n  | 'Socket'\n\n// mask to unset low 4 bits\nconst IFMT_UNKNOWN = ~IFMT\n\n// set after successfully calling readdir() and getting entries.\nconst READDIR_CALLED = 0b0000_0001_0000\n// set after a successful lstat()\nconst LSTAT_CALLED = 0b0000_0010_0000\n// set if an entry (or one of its parents) is definitely not a dir\nconst ENOTDIR = 0b0000_0100_0000\n// set if an entry (or one of its parents) does not exist\n// (can also be set on lstat errors like EACCES or ENAMETOOLONG)\nconst ENOENT = 0b0000_1000_0000\n// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK\n// set if we fail to readlink\nconst ENOREADLINK = 0b0001_0000_0000\n// set if we know realpath() will fail\nconst ENOREALPATH = 0b0010_0000_0000\n\nconst ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH\nconst TYPEMASK = 0b0011_1111_1111\n\nconst entToType = (s: Dirent | Stats) =>\n  s.isFile() ? IFREG\n  : s.isDirectory() ? IFDIR\n  : s.isSymbolicLink() ? IFLNK\n  : s.isCharacterDevice() ? IFCHR\n  : s.isBlockDevice() ? IFBLK\n  : s.isSocket() ? IFSOCK\n  : s.isFIFO() ? IFIFO\n  : UNKNOWN\n\n// normalize unicode path names\nconst normalizeCache = new Map()\nconst normalize = (s: string) => {\n  const c = normalizeCache.get(s)\n  if (c) return c\n  const n = s.normalize('NFKD')\n  normalizeCache.set(s, n)\n  return n\n}\n\nconst normalizeNocaseCache = new Map()\nconst normalizeNocase = (s: string) => {\n  const c = normalizeNocaseCache.get(s)\n  if (c) return c\n  const n = normalize(s.toLowerCase())\n  normalizeNocaseCache.set(s, n)\n  return n\n}\n\n/**\n * Options that may be provided to the Path constructor\n */\nexport interface PathOpts {\n  fullpath?: string\n  relative?: string\n  relativePosix?: string\n  parent?: PathBase\n  /**\n   * See {@link FSOption}\n   */\n  fs?: FSOption\n}\n\n/**\n * An LRUCache for storing resolved path strings or Path objects.\n * @internal\n */\nexport class ResolveCache extends LRUCache {\n  constructor() {\n    super({ max: 256 })\n  }\n}\n\n// In order to prevent blowing out the js heap by allocating hundreds of\n// thousands of Path entries when walking extremely large trees, the \"children\"\n// in this tree are represented by storing an array of Path entries in an\n// LRUCache, indexed by the parent.  At any time, Path.children() may return an\n// empty array, indicating that it doesn't know about any of its children, and\n// thus has to rebuild that cache.  This is fine, it just means that we don't\n// benefit as much from having the cached entries, but huge directory walks\n// don't blow out the stack, and smaller ones are still as fast as possible.\n//\n//It does impose some complexity when building up the readdir data, because we\n//need to pass a reference to the children array that we started with.\n\n/**\n * an LRUCache for storing child entries.\n * @internal\n */\nexport class ChildrenCache extends LRUCache {\n  constructor(maxSize: number = 16 * 1024) {\n    super({\n      maxSize,\n      // parent + children\n      sizeCalculation: a => a.length + 1,\n    })\n  }\n}\n\n/**\n * Array of Path objects, plus a marker indicating the first provisional entry\n *\n * @internal\n */\nexport type Children = PathBase[] & { provisional: number }\n\nconst setAsCwd = Symbol('PathScurry setAsCwd')\n\n/**\n * Path objects are sort of like a super-powered\n * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}\n *\n * Each one represents a single filesystem entry on disk, which may or may not\n * exist. It includes methods for reading various types of information via\n * lstat, readlink, and readdir, and caches all information to the greatest\n * degree possible.\n *\n * Note that fs operations that would normally throw will instead return an\n * \"empty\" value. This is in order to prevent excessive overhead from error\n * stack traces.\n */\nexport abstract class PathBase implements Dirent {\n  /**\n   * the basename of this path\n   *\n   * **Important**: *always* test the path name against any test string\n   * usingthe {@link isNamed} method, and not by directly comparing this\n   * string. Otherwise, unicode path strings that the system sees as identical\n   * will not be properly treated as the same path, leading to incorrect\n   * behavior and possible security issues.\n   */\n  name: string\n  /**\n   * the Path entry corresponding to the path root.\n   *\n   * @internal\n   */\n  root: PathBase\n  /**\n   * All roots found within the current PathScurry family\n   *\n   * @internal\n   */\n  roots: { [k: string]: PathBase }\n  /**\n   * a reference to the parent path, or undefined in the case of root entries\n   *\n   * @internal\n   */\n  parent?: PathBase\n  /**\n   * boolean indicating whether paths are compared case-insensitively\n   * @internal\n   */\n  nocase: boolean\n\n  /**\n   * boolean indicating that this path is the current working directory\n   * of the PathScurry collection that contains it.\n   */\n  isCWD: boolean = false\n\n  /**\n   * the string or regexp used to split paths. On posix, it is `'/'`, and on\n   * windows it is a RegExp matching either `'/'` or `'\\\\'`\n   */\n  abstract splitSep: string | RegExp\n  /**\n   * The path separator string to use when joining paths\n   */\n  abstract sep: string\n\n  // potential default fs override\n  #fs: FSValue\n\n  // Stats fields\n  #dev?: number\n  get dev() {\n    return this.#dev\n  }\n  #mode?: number\n  get mode() {\n    return this.#mode\n  }\n  #nlink?: number\n  get nlink() {\n    return this.#nlink\n  }\n  #uid?: number\n  get uid() {\n    return this.#uid\n  }\n  #gid?: number\n  get gid() {\n    return this.#gid\n  }\n  #rdev?: number\n  get rdev() {\n    return this.#rdev\n  }\n  #blksize?: number\n  get blksize() {\n    return this.#blksize\n  }\n  #ino?: number\n  get ino() {\n    return this.#ino\n  }\n  #size?: number\n  get size() {\n    return this.#size\n  }\n  #blocks?: number\n  get blocks() {\n    return this.#blocks\n  }\n  #atimeMs?: number\n  get atimeMs() {\n    return this.#atimeMs\n  }\n  #mtimeMs?: number\n  get mtimeMs() {\n    return this.#mtimeMs\n  }\n  #ctimeMs?: number\n  get ctimeMs() {\n    return this.#ctimeMs\n  }\n  #birthtimeMs?: number\n  get birthtimeMs() {\n    return this.#birthtimeMs\n  }\n  #atime?: Date\n  get atime() {\n    return this.#atime\n  }\n  #mtime?: Date\n  get mtime() {\n    return this.#mtime\n  }\n  #ctime?: Date\n  get ctime() {\n    return this.#ctime\n  }\n  #birthtime?: Date\n  get birthtime() {\n    return this.#birthtime\n  }\n\n  #matchName: string\n  #depth?: number\n  #fullpath?: string\n  #fullpathPosix?: string\n  #relative?: string\n  #relativePosix?: string\n  #type: number\n  #children: ChildrenCache\n  #linkTarget?: PathBase\n  #realpath?: PathBase\n\n  /**\n   * This property is for compatibility with the Dirent class as of\n   * Node v20, where Dirent['parentPath'] refers to the path of the\n   * directory that was passed to readdir. For root entries, it's the path\n   * to the entry itself.\n   */\n  get parentPath(): string {\n    return (this.parent || this).fullpath()\n  }\n\n  /**\n   * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,\n   * this property refers to the *parent* path, not the path object itself.\n   */\n  get path(): string {\n    return this.parentPath\n  }\n\n  /**\n   * Do not create new Path objects directly.  They should always be accessed\n   * via the PathScurry class or other methods on the Path class.\n   *\n   * @internal\n   */\n  constructor(\n    name: string,\n    type: number = UNKNOWN,\n    root: PathBase | undefined,\n    roots: { [k: string]: PathBase },\n    nocase: boolean,\n    children: ChildrenCache,\n    opts: PathOpts,\n  ) {\n    this.name = name\n    this.#matchName = nocase ? normalizeNocase(name) : normalize(name)\n    this.#type = type & TYPEMASK\n    this.nocase = nocase\n    this.roots = roots\n    this.root = root || this\n    this.#children = children\n    this.#fullpath = opts.fullpath\n    this.#relative = opts.relative\n    this.#relativePosix = opts.relativePosix\n    this.parent = opts.parent\n    if (this.parent) {\n      this.#fs = this.parent.#fs\n    } else {\n      this.#fs = fsFromOption(opts.fs)\n    }\n  }\n\n  /**\n   * Returns the depth of the Path object from its root.\n   *\n   * For example, a path at `/foo/bar` would have a depth of 2.\n   */\n  depth(): number {\n    if (this.#depth !== undefined) return this.#depth\n    if (!this.parent) return (this.#depth = 0)\n    return (this.#depth = this.parent.depth() + 1)\n  }\n\n  /**\n   * @internal\n   */\n  abstract getRootString(path: string): string\n  /**\n   * @internal\n   */\n  abstract getRoot(rootPath: string): PathBase\n  /**\n   * @internal\n   */\n  abstract newChild(name: string, type?: number, opts?: PathOpts): PathBase\n\n  /**\n   * @internal\n   */\n  childrenCache() {\n    return this.#children\n  }\n\n  /**\n   * Get the Path object referenced by the string path, resolved from this Path\n   */\n  resolve(path?: string): PathBase {\n    if (!path) {\n      return this\n    }\n    const rootPath = this.getRootString(path)\n    const dir = path.substring(rootPath.length)\n    const dirParts = dir.split(this.splitSep)\n    const result: PathBase =\n      rootPath ?\n        this.getRoot(rootPath).#resolveParts(dirParts)\n      : this.#resolveParts(dirParts)\n    return result\n  }\n\n  #resolveParts(dirParts: string[]) {\n    let p: PathBase = this\n    for (const part of dirParts) {\n      p = p.child(part)\n    }\n    return p\n  }\n\n  /**\n   * Returns the cached children Path objects, if still available.  If they\n   * have fallen out of the cache, then returns an empty array, and resets the\n   * READDIR_CALLED bit, so that future calls to readdir() will require an fs\n   * lookup.\n   *\n   * @internal\n   */\n  children(): Children {\n    const cached = this.#children.get(this)\n    if (cached) {\n      return cached\n    }\n    const children: Children = Object.assign([], { provisional: 0 })\n    this.#children.set(this, children)\n    this.#type &= ~READDIR_CALLED\n    return children\n  }\n\n  /**\n   * Resolves a path portion and returns or creates the child Path.\n   *\n   * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is\n   * `'..'`.\n   *\n   * This should not be called directly.  If `pathPart` contains any path\n   * separators, it will lead to unsafe undefined behavior.\n   *\n   * Use `Path.resolve()` instead.\n   *\n   * @internal\n   */\n  child(pathPart: string, opts?: PathOpts): PathBase {\n    if (pathPart === '' || pathPart === '.') {\n      return this\n    }\n    if (pathPart === '..') {\n      return this.parent || this\n    }\n\n    // find the child\n    const children = this.children()\n    const name =\n      this.nocase ? normalizeNocase(pathPart) : normalize(pathPart)\n    for (const p of children) {\n      if (p.#matchName === name) {\n        return p\n      }\n    }\n\n    // didn't find it, create provisional child, since it might not\n    // actually exist.  If we know the parent isn't a dir, then\n    // in fact it CAN'T exist.\n    const s = this.parent ? this.sep : ''\n    const fullpath =\n      this.#fullpath ? this.#fullpath + s + pathPart : undefined\n    const pchild = this.newChild(pathPart, UNKNOWN, {\n      ...opts,\n      parent: this,\n      fullpath,\n    })\n\n    if (!this.canReaddir()) {\n      pchild.#type |= ENOENT\n    }\n\n    // don't have to update provisional, because if we have real children,\n    // then provisional is set to children.length, otherwise a lower number\n    children.push(pchild)\n    return pchild\n  }\n\n  /**\n   * The relative path from the cwd. If it does not share an ancestor with\n   * the cwd, then this ends up being equivalent to the fullpath()\n   */\n  relative(): string {\n    if (this.isCWD) return ''\n    if (this.#relative !== undefined) {\n      return this.#relative\n    }\n    const name = this.name\n    const p = this.parent\n    if (!p) {\n      return (this.#relative = this.name)\n    }\n    const pv = p.relative()\n    return pv + (!pv || !p.parent ? '' : this.sep) + name\n  }\n\n  /**\n   * The relative path from the cwd, using / as the path separator.\n   * If it does not share an ancestor with\n   * the cwd, then this ends up being equivalent to the fullpathPosix()\n   * On posix systems, this is identical to relative().\n   */\n  relativePosix(): string {\n    if (this.sep === '/') return this.relative()\n    if (this.isCWD) return ''\n    if (this.#relativePosix !== undefined) return this.#relativePosix\n    const name = this.name\n    const p = this.parent\n    if (!p) {\n      return (this.#relativePosix = this.fullpathPosix())\n    }\n    const pv = p.relativePosix()\n    return pv + (!pv || !p.parent ? '' : '/') + name\n  }\n\n  /**\n   * The fully resolved path string for this Path entry\n   */\n  fullpath(): string {\n    if (this.#fullpath !== undefined) {\n      return this.#fullpath\n    }\n    const name = this.name\n    const p = this.parent\n    if (!p) {\n      return (this.#fullpath = this.name)\n    }\n    const pv = p.fullpath()\n    const fp = pv + (!p.parent ? '' : this.sep) + name\n    return (this.#fullpath = fp)\n  }\n\n  /**\n   * On platforms other than windows, this is identical to fullpath.\n   *\n   * On windows, this is overridden to return the forward-slash form of the\n   * full UNC path.\n   */\n  fullpathPosix(): string {\n    if (this.#fullpathPosix !== undefined) return this.#fullpathPosix\n    if (this.sep === '/') return (this.#fullpathPosix = this.fullpath())\n    if (!this.parent) {\n      const p = this.fullpath().replace(/\\\\/g, '/')\n      if (/^[a-z]:\\//i.test(p)) {\n        return (this.#fullpathPosix = `//?/${p}`)\n      } else {\n        return (this.#fullpathPosix = p)\n      }\n    }\n    const p = this.parent\n    const pfpp = p.fullpathPosix()\n    const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name\n    return (this.#fullpathPosix = fpp)\n  }\n\n  /**\n   * Is the Path of an unknown type?\n   *\n   * Note that we might know *something* about it if there has been a previous\n   * filesystem operation, for example that it does not exist, or is not a\n   * link, or whether it has child entries.\n   */\n  isUnknown(): boolean {\n    return (this.#type & IFMT) === UNKNOWN\n  }\n\n  isType(type: Type): boolean {\n    return this[`is${type}`]()\n  }\n\n  getType(): Type {\n    return (\n      this.isUnknown() ? 'Unknown'\n      : this.isDirectory() ? 'Directory'\n      : this.isFile() ? 'File'\n      : this.isSymbolicLink() ? 'SymbolicLink'\n      : this.isFIFO() ? 'FIFO'\n      : this.isCharacterDevice() ? 'CharacterDevice'\n      : this.isBlockDevice() ? 'BlockDevice'\n      : /* c8 ignore start */ this.isSocket() ? 'Socket'\n      : 'Unknown'\n    )\n    /* c8 ignore stop */\n  }\n\n  /**\n   * Is the Path a regular file?\n   */\n  isFile(): boolean {\n    return (this.#type & IFMT) === IFREG\n  }\n\n  /**\n   * Is the Path a directory?\n   */\n  isDirectory(): boolean {\n    return (this.#type & IFMT) === IFDIR\n  }\n\n  /**\n   * Is the path a character device?\n   */\n  isCharacterDevice(): boolean {\n    return (this.#type & IFMT) === IFCHR\n  }\n\n  /**\n   * Is the path a block device?\n   */\n  isBlockDevice(): boolean {\n    return (this.#type & IFMT) === IFBLK\n  }\n\n  /**\n   * Is the path a FIFO pipe?\n   */\n  isFIFO(): boolean {\n    return (this.#type & IFMT) === IFIFO\n  }\n\n  /**\n   * Is the path a socket?\n   */\n  isSocket(): boolean {\n    return (this.#type & IFMT) === IFSOCK\n  }\n\n  /**\n   * Is the path a symbolic link?\n   */\n  isSymbolicLink(): boolean {\n    return (this.#type & IFLNK) === IFLNK\n  }\n\n  /**\n   * Return the entry if it has been subject of a successful lstat, or\n   * undefined otherwise.\n   *\n   * Does not read the filesystem, so an undefined result *could* simply\n   * mean that we haven't called lstat on it.\n   */\n  lstatCached(): PathBase | undefined {\n    return this.#type & LSTAT_CALLED ? this : undefined\n  }\n\n  /**\n   * Return the cached link target if the entry has been the subject of a\n   * successful readlink, or undefined otherwise.\n   *\n   * Does not read the filesystem, so an undefined result *could* just mean we\n   * don't have any cached data. Only use it if you are very sure that a\n   * readlink() has been called at some point.\n   */\n  readlinkCached(): PathBase | undefined {\n    return this.#linkTarget\n  }\n\n  /**\n   * Returns the cached realpath target if the entry has been the subject\n   * of a successful realpath, or undefined otherwise.\n   *\n   * Does not read the filesystem, so an undefined result *could* just mean we\n   * don't have any cached data. Only use it if you are very sure that a\n   * realpath() has been called at some point.\n   */\n  realpathCached(): PathBase | undefined {\n    return this.#realpath\n  }\n\n  /**\n   * Returns the cached child Path entries array if the entry has been the\n   * subject of a successful readdir(), or [] otherwise.\n   *\n   * Does not read the filesystem, so an empty array *could* just mean we\n   * don't have any cached data. Only use it if you are very sure that a\n   * readdir() has been called recently enough to still be valid.\n   */\n  readdirCached(): PathBase[] {\n    const children = this.children()\n    return children.slice(0, children.provisional)\n  }\n\n  /**\n   * Return true if it's worth trying to readlink.  Ie, we don't (yet) have\n   * any indication that readlink will definitely fail.\n   *\n   * Returns false if the path is known to not be a symlink, if a previous\n   * readlink failed, or if the entry does not exist.\n   */\n  canReadlink(): boolean {\n    if (this.#linkTarget) return true\n    if (!this.parent) return false\n    // cases where it cannot possibly succeed\n    const ifmt = this.#type & IFMT\n    return !(\n      (ifmt !== UNKNOWN && ifmt !== IFLNK) ||\n      this.#type & ENOREADLINK ||\n      this.#type & ENOENT\n    )\n  }\n\n  /**\n   * Return true if readdir has previously been successfully called on this\n   * path, indicating that cachedReaddir() is likely valid.\n   */\n  calledReaddir(): boolean {\n    return !!(this.#type & READDIR_CALLED)\n  }\n\n  /**\n   * Returns true if the path is known to not exist. That is, a previous lstat\n   * or readdir failed to verify its existence when that would have been\n   * expected, or a parent entry was marked either enoent or enotdir.\n   */\n  isENOENT(): boolean {\n    return !!(this.#type & ENOENT)\n  }\n\n  /**\n   * Return true if the path is a match for the given path name.  This handles\n   * case sensitivity and unicode normalization.\n   *\n   * Note: even on case-sensitive systems, it is **not** safe to test the\n   * equality of the `.name` property to determine whether a given pathname\n   * matches, due to unicode normalization mismatches.\n   *\n   * Always use this method instead of testing the `path.name` property\n   * directly.\n   */\n  isNamed(n: string): boolean {\n    return !this.nocase ?\n        this.#matchName === normalize(n)\n      : this.#matchName === normalizeNocase(n)\n  }\n\n  /**\n   * Return the Path object corresponding to the target of a symbolic link.\n   *\n   * If the Path is not a symbolic link, or if the readlink call fails for any\n   * reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   */\n  async readlink(): Promise {\n    const target = this.#linkTarget\n    if (target) {\n      return target\n    }\n    if (!this.canReadlink()) {\n      return undefined\n    }\n    /* c8 ignore start */\n    // already covered by the canReadlink test, here for ts grumples\n    if (!this.parent) {\n      return undefined\n    }\n    /* c8 ignore stop */\n    try {\n      const read = await this.#fs.promises.readlink(this.fullpath())\n      const linkTarget = (await this.parent.realpath())?.resolve(read)\n      if (linkTarget) {\n        return (this.#linkTarget = linkTarget)\n      }\n    } catch (er) {\n      this.#readlinkFail((er as NodeJS.ErrnoException).code)\n      return undefined\n    }\n  }\n\n  /**\n   * Synchronous {@link PathBase.readlink}\n   */\n  readlinkSync(): PathBase | undefined {\n    const target = this.#linkTarget\n    if (target) {\n      return target\n    }\n    if (!this.canReadlink()) {\n      return undefined\n    }\n    /* c8 ignore start */\n    // already covered by the canReadlink test, here for ts grumples\n    if (!this.parent) {\n      return undefined\n    }\n    /* c8 ignore stop */\n    try {\n      const read = this.#fs.readlinkSync(this.fullpath())\n      const linkTarget = this.parent.realpathSync()?.resolve(read)\n      if (linkTarget) {\n        return (this.#linkTarget = linkTarget)\n      }\n    } catch (er) {\n      this.#readlinkFail((er as NodeJS.ErrnoException).code)\n      return undefined\n    }\n  }\n\n  #readdirSuccess(children: Children) {\n    // succeeded, mark readdir called bit\n    this.#type |= READDIR_CALLED\n    // mark all remaining provisional children as ENOENT\n    for (let p = children.provisional; p < children.length; p++) {\n      const c = children[p]\n      if (c) c.#markENOENT()\n    }\n  }\n\n  #markENOENT() {\n    // mark as UNKNOWN and ENOENT\n    if (this.#type & ENOENT) return\n    this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN\n    this.#markChildrenENOENT()\n  }\n\n  #markChildrenENOENT() {\n    // all children are provisional and do not exist\n    const children = this.children()\n    children.provisional = 0\n    for (const p of children) {\n      p.#markENOENT()\n    }\n  }\n\n  #markENOREALPATH() {\n    this.#type |= ENOREALPATH\n    this.#markENOTDIR()\n  }\n\n  // save the information when we know the entry is not a dir\n  #markENOTDIR() {\n    // entry is not a directory, so any children can't exist.\n    // this *should* be impossible, since any children created\n    // after it's been marked ENOTDIR should be marked ENOENT,\n    // so it won't even get to this point.\n    /* c8 ignore start */\n    if (this.#type & ENOTDIR) return\n    /* c8 ignore stop */\n    let t = this.#type\n    // this could happen if we stat a dir, then delete it,\n    // then try to read it or one of its children.\n    if ((t & IFMT) === IFDIR) t &= IFMT_UNKNOWN\n    this.#type = t | ENOTDIR\n    this.#markChildrenENOENT()\n  }\n\n  #readdirFail(code: string = '') {\n    // markENOTDIR and markENOENT also set provisional=0\n    if (code === 'ENOTDIR' || code === 'EPERM') {\n      this.#markENOTDIR()\n    } else if (code === 'ENOENT') {\n      this.#markENOENT()\n    } else {\n      this.children().provisional = 0\n    }\n  }\n\n  #lstatFail(code: string = '') {\n    // Windows just raises ENOENT in this case, disable for win CI\n    /* c8 ignore start */\n    if (code === 'ENOTDIR') {\n      // already know it has a parent by this point\n      const p = this.parent as PathBase\n      p.#markENOTDIR()\n    } else if (code === 'ENOENT') {\n      /* c8 ignore stop */\n      this.#markENOENT()\n    }\n  }\n\n  #readlinkFail(code: string = '') {\n    let ter = this.#type\n    ter |= ENOREADLINK\n    if (code === 'ENOENT') ter |= ENOENT\n    // windows gets a weird error when you try to readlink a file\n    if (code === 'EINVAL' || code === 'UNKNOWN') {\n      // exists, but not a symlink, we don't know WHAT it is, so remove\n      // all IFMT bits.\n      ter &= IFMT_UNKNOWN\n    }\n    this.#type = ter\n    // windows just gets ENOENT in this case.  We do cover the case,\n    // just disabled because it's impossible on Windows CI\n    /* c8 ignore start */\n    if (code === 'ENOTDIR' && this.parent) {\n      this.parent.#markENOTDIR()\n    }\n    /* c8 ignore stop */\n  }\n\n  #readdirAddChild(e: Dirent, c: Children) {\n    return (\n      this.#readdirMaybePromoteChild(e, c) ||\n      this.#readdirAddNewChild(e, c)\n    )\n  }\n\n  #readdirAddNewChild(e: Dirent, c: Children): PathBase {\n    // alloc new entry at head, so it's never provisional\n    const type = entToType(e)\n    const child = this.newChild(e.name, type, { parent: this })\n    const ifmt = child.#type & IFMT\n    if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {\n      child.#type |= ENOTDIR\n    }\n    c.unshift(child)\n    c.provisional++\n    return child\n  }\n\n  #readdirMaybePromoteChild(e: Dirent, c: Children): PathBase | undefined {\n    for (let p = c.provisional; p < c.length; p++) {\n      const pchild = c[p]\n      const name =\n        this.nocase ? normalizeNocase(e.name) : normalize(e.name)\n      if (name !== pchild!.#matchName) {\n        continue\n      }\n\n      return this.#readdirPromoteChild(e, pchild!, p, c)\n    }\n  }\n\n  #readdirPromoteChild(\n    e: Dirent,\n    p: PathBase,\n    index: number,\n    c: Children,\n  ): PathBase {\n    const v = p.name\n    // retain any other flags, but set ifmt from dirent\n    p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e)\n    // case sensitivity fixing when we learn the true name.\n    if (v !== e.name) p.name = e.name\n\n    // just advance provisional index (potentially off the list),\n    // otherwise we have to splice/pop it out and re-insert at head\n    if (index !== c.provisional) {\n      if (index === c.length - 1) c.pop()\n      else c.splice(index, 1)\n      c.unshift(p)\n    }\n    c.provisional++\n    return p\n  }\n\n  /**\n   * Call lstat() on this Path, and update all known information that can be\n   * determined.\n   *\n   * Note that unlike `fs.lstat()`, the returned value does not contain some\n   * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that\n   * information is required, you will need to call `fs.lstat` yourself.\n   *\n   * If the Path refers to a nonexistent file, or if the lstat call fails for\n   * any reason, `undefined` is returned.  Otherwise the updated Path object is\n   * returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   */\n  async lstat(): Promise {\n    if ((this.#type & ENOENT) === 0) {\n      try {\n        this.#applyStat(await this.#fs.promises.lstat(this.fullpath()))\n        return this\n      } catch (er) {\n        this.#lstatFail((er as NodeJS.ErrnoException).code)\n      }\n    }\n  }\n\n  /**\n   * synchronous {@link PathBase.lstat}\n   */\n  lstatSync(): PathBase | undefined {\n    if ((this.#type & ENOENT) === 0) {\n      try {\n        this.#applyStat(this.#fs.lstatSync(this.fullpath()))\n        return this\n      } catch (er) {\n        this.#lstatFail((er as NodeJS.ErrnoException).code)\n      }\n    }\n  }\n\n  #applyStat(st: Stats) {\n    const {\n      atime,\n      atimeMs,\n      birthtime,\n      birthtimeMs,\n      blksize,\n      blocks,\n      ctime,\n      ctimeMs,\n      dev,\n      gid,\n      ino,\n      mode,\n      mtime,\n      mtimeMs,\n      nlink,\n      rdev,\n      size,\n      uid,\n    } = st\n    this.#atime = atime\n    this.#atimeMs = atimeMs\n    this.#birthtime = birthtime\n    this.#birthtimeMs = birthtimeMs\n    this.#blksize = blksize\n    this.#blocks = blocks\n    this.#ctime = ctime\n    this.#ctimeMs = ctimeMs\n    this.#dev = dev\n    this.#gid = gid\n    this.#ino = ino\n    this.#mode = mode\n    this.#mtime = mtime\n    this.#mtimeMs = mtimeMs\n    this.#nlink = nlink\n    this.#rdev = rdev\n    this.#size = size\n    this.#uid = uid\n    const ifmt = entToType(st)\n    // retain any other flags, but set the ifmt\n    this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED\n    if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {\n      this.#type |= ENOTDIR\n    }\n  }\n\n  #onReaddirCB: ((\n    er: NodeJS.ErrnoException | null,\n    entries: Path[],\n  ) => any)[] = []\n  #readdirCBInFlight: boolean = false\n  #callOnReaddirCB(children: Path[]) {\n    this.#readdirCBInFlight = false\n    const cbs = this.#onReaddirCB.slice()\n    this.#onReaddirCB.length = 0\n    cbs.forEach(cb => cb(null, children))\n  }\n\n  /**\n   * Standard node-style callback interface to get list of directory entries.\n   *\n   * If the Path cannot or does not contain any children, then an empty array\n   * is returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   *\n   * @param cb The callback called with (er, entries).  Note that the `er`\n   * param is somewhat extraneous, as all readdir() errors are handled and\n   * simply result in an empty set of entries being returned.\n   * @param allowZalgo Boolean indicating that immediately known results should\n   * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release\n   * zalgo at your peril, the dark pony lord is devious and unforgiving.\n   */\n  readdirCB(\n    cb: (er: NodeJS.ErrnoException | null, entries: PathBase[]) => any,\n    allowZalgo: boolean = false,\n  ): void {\n    if (!this.canReaddir()) {\n      if (allowZalgo) cb(null, [])\n      else queueMicrotask(() => cb(null, []))\n      return\n    }\n\n    const children = this.children()\n    if (this.calledReaddir()) {\n      const c = children.slice(0, children.provisional)\n      if (allowZalgo) cb(null, c)\n      else queueMicrotask(() => cb(null, c))\n      return\n    }\n\n    // don't have to worry about zalgo at this point.\n    this.#onReaddirCB.push(cb)\n    if (this.#readdirCBInFlight) {\n      return\n    }\n    this.#readdirCBInFlight = true\n\n    // else read the directory, fill up children\n    // de-provisionalize any provisional children.\n    const fullpath = this.fullpath()\n    this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {\n      if (er) {\n        this.#readdirFail((er as NodeJS.ErrnoException).code)\n        children.provisional = 0\n      } else {\n        // if we didn't get an error, we always get entries.\n        //@ts-ignore\n        for (const e of entries) {\n          this.#readdirAddChild(e, children)\n        }\n        this.#readdirSuccess(children)\n      }\n      this.#callOnReaddirCB(children.slice(0, children.provisional))\n      return\n    })\n  }\n\n  #asyncReaddirInFlight?: Promise\n\n  /**\n   * Return an array of known child entries.\n   *\n   * If the Path cannot or does not contain any children, then an empty array\n   * is returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   */\n  async readdir(): Promise {\n    if (!this.canReaddir()) {\n      return []\n    }\n\n    const children = this.children()\n    if (this.calledReaddir()) {\n      return children.slice(0, children.provisional)\n    }\n\n    // else read the directory, fill up children\n    // de-provisionalize any provisional children.\n    const fullpath = this.fullpath()\n    if (this.#asyncReaddirInFlight) {\n      await this.#asyncReaddirInFlight\n    } else {\n      /* c8 ignore start */\n      let resolve: () => void = () => {}\n      /* c8 ignore stop */\n      this.#asyncReaddirInFlight = new Promise(\n        res => (resolve = res),\n      )\n      try {\n        for (const e of await this.#fs.promises.readdir(fullpath, {\n          withFileTypes: true,\n        })) {\n          this.#readdirAddChild(e, children)\n        }\n        this.#readdirSuccess(children)\n      } catch (er) {\n        this.#readdirFail((er as NodeJS.ErrnoException).code)\n        children.provisional = 0\n      }\n      this.#asyncReaddirInFlight = undefined\n      resolve()\n    }\n    return children.slice(0, children.provisional)\n  }\n\n  /**\n   * synchronous {@link PathBase.readdir}\n   */\n  readdirSync(): PathBase[] {\n    if (!this.canReaddir()) {\n      return []\n    }\n\n    const children = this.children()\n    if (this.calledReaddir()) {\n      return children.slice(0, children.provisional)\n    }\n\n    // else read the directory, fill up children\n    // de-provisionalize any provisional children.\n    const fullpath = this.fullpath()\n    try {\n      for (const e of this.#fs.readdirSync(fullpath, {\n        withFileTypes: true,\n      })) {\n        this.#readdirAddChild(e, children)\n      }\n      this.#readdirSuccess(children)\n    } catch (er) {\n      this.#readdirFail((er as NodeJS.ErrnoException).code)\n      children.provisional = 0\n    }\n    return children.slice(0, children.provisional)\n  }\n\n  canReaddir() {\n    if (this.#type & ENOCHILD) return false\n    const ifmt = IFMT & this.#type\n    // we always set ENOTDIR when setting IFMT, so should be impossible\n    /* c8 ignore start */\n    if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {\n      return false\n    }\n    /* c8 ignore stop */\n    return true\n  }\n\n  shouldWalk(\n    dirs: Set,\n    walkFilter?: (e: PathBase) => boolean,\n  ): boolean {\n    return (\n      (this.#type & IFDIR) === IFDIR &&\n      !(this.#type & ENOCHILD) &&\n      !dirs.has(this) &&\n      (!walkFilter || walkFilter(this))\n    )\n  }\n\n  /**\n   * Return the Path object corresponding to path as resolved\n   * by realpath(3).\n   *\n   * If the realpath call fails for any reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   * On success, returns a Path object.\n   */\n  async realpath(): Promise {\n    if (this.#realpath) return this.#realpath\n    if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) return undefined\n    try {\n      const rp = await this.#fs.promises.realpath(this.fullpath())\n      return (this.#realpath = this.resolve(rp))\n    } catch (_) {\n      this.#markENOREALPATH()\n    }\n  }\n\n  /**\n   * Synchronous {@link realpath}\n   */\n  realpathSync(): PathBase | undefined {\n    if (this.#realpath) return this.#realpath\n    if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) return undefined\n    try {\n      const rp = this.#fs.realpathSync(this.fullpath())\n      return (this.#realpath = this.resolve(rp))\n    } catch (_) {\n      this.#markENOREALPATH()\n    }\n  }\n\n  /**\n   * Internal method to mark this Path object as the scurry cwd,\n   * called by {@link PathScurry#chdir}\n   *\n   * @internal\n   */\n  [setAsCwd](oldCwd: PathBase): void {\n    if (oldCwd === this) return\n    oldCwd.isCWD = false\n    this.isCWD = true\n\n    const changed = new Set([])\n    let rp = []\n    let p: PathBase = this\n    while (p && p.parent) {\n      changed.add(p)\n      p.#relative = rp.join(this.sep)\n      p.#relativePosix = rp.join('/')\n      p = p.parent\n      rp.push('..')\n    }\n    // now un-memoize parents of old cwd\n    p = oldCwd\n    while (p && p.parent && !changed.has(p)) {\n      p.#relative = undefined\n      p.#relativePosix = undefined\n      p = p.parent\n    }\n  }\n}\n\n/**\n * Path class used on win32 systems\n *\n * Uses `'\\\\'` as the path separator for returned paths, either `'\\\\'` or `'/'`\n * as the path separator for parsing paths.\n */\nexport class PathWin32 extends PathBase {\n  /**\n   * Separator for generating path strings.\n   */\n  sep: '\\\\' = '\\\\'\n  /**\n   * Separator for parsing path strings.\n   */\n  splitSep: RegExp = eitherSep\n\n  /**\n   * Do not create new Path objects directly.  They should always be accessed\n   * via the PathScurry class or other methods on the Path class.\n   *\n   * @internal\n   */\n  constructor(\n    name: string,\n    type: number = UNKNOWN,\n    root: PathBase | undefined,\n    roots: { [k: string]: PathBase },\n    nocase: boolean,\n    children: ChildrenCache,\n    opts: PathOpts,\n  ) {\n    super(name, type, root, roots, nocase, children, opts)\n  }\n\n  /**\n   * @internal\n   */\n  newChild(name: string, type: number = UNKNOWN, opts: PathOpts = {}) {\n    return new PathWin32(\n      name,\n      type,\n      this.root,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      opts,\n    )\n  }\n\n  /**\n   * @internal\n   */\n  getRootString(path: string): string {\n    return win32.parse(path).root\n  }\n\n  /**\n   * @internal\n   */\n  getRoot(rootPath: string): PathBase {\n    rootPath = uncToDrive(rootPath.toUpperCase())\n    if (rootPath === this.root.name) {\n      return this.root\n    }\n    // ok, not that one, check if it matches another we know about\n    for (const [compare, root] of Object.entries(this.roots)) {\n      if (this.sameRoot(rootPath, compare)) {\n        return (this.roots[rootPath] = root)\n      }\n    }\n    // otherwise, have to create a new one.\n    return (this.roots[rootPath] = new PathScurryWin32(\n      rootPath,\n      this,\n    ).root)\n  }\n\n  /**\n   * @internal\n   */\n  sameRoot(rootPath: string, compare: string = this.root.name): boolean {\n    // windows can (rarely) have case-sensitive filesystem, but\n    // UNC and drive letters are always case-insensitive, and canonically\n    // represented uppercase.\n    rootPath = rootPath\n      .toUpperCase()\n      .replace(/\\//g, '\\\\')\n      .replace(uncDriveRegexp, '$1\\\\')\n    return rootPath === compare\n  }\n}\n\n/**\n * Path class used on all posix systems.\n *\n * Uses `'/'` as the path separator.\n */\nexport class PathPosix extends PathBase {\n  /**\n   * separator for parsing path strings\n   */\n  splitSep: '/' = '/'\n  /**\n   * separator for generating path strings\n   */\n  sep: '/' = '/'\n\n  /**\n   * Do not create new Path objects directly.  They should always be accessed\n   * via the PathScurry class or other methods on the Path class.\n   *\n   * @internal\n   */\n  constructor(\n    name: string,\n    type: number = UNKNOWN,\n    root: PathBase | undefined,\n    roots: { [k: string]: PathBase },\n    nocase: boolean,\n    children: ChildrenCache,\n    opts: PathOpts,\n  ) {\n    super(name, type, root, roots, nocase, children, opts)\n  }\n\n  /**\n   * @internal\n   */\n  getRootString(path: string): string {\n    return path.startsWith('/') ? '/' : ''\n  }\n\n  /**\n   * @internal\n   */\n  getRoot(_rootPath: string): PathBase {\n    return this.root\n  }\n\n  /**\n   * @internal\n   */\n  newChild(name: string, type: number = UNKNOWN, opts: PathOpts = {}) {\n    return new PathPosix(\n      name,\n      type,\n      this.root,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      opts,\n    )\n  }\n}\n\n/**\n * Options that may be provided to the PathScurry constructor\n */\nexport interface PathScurryOpts {\n  /**\n   * perform case-insensitive path matching. Default based on platform\n   * subclass.\n   */\n  nocase?: boolean\n  /**\n   * Number of Path entries to keep in the cache of Path child references.\n   *\n   * Setting this higher than 65536 will dramatically increase the data\n   * consumption and construction time overhead of each PathScurry.\n   *\n   * Setting this value to 256 or lower will significantly reduce the data\n   * consumption and construction time overhead, but may also reduce resolve()\n   * and readdir() performance on large filesystems.\n   *\n   * Default `16384`.\n   */\n  childrenCacheSize?: number\n  /**\n   * An object that overrides the built-in functions from the fs and\n   * fs/promises modules.\n   *\n   * See {@link FSOption}\n   */\n  fs?: FSOption\n}\n\n/**\n * The base class for all PathScurry classes, providing the interface for path\n * resolution and filesystem operations.\n *\n * Typically, you should *not* instantiate this class directly, but rather one\n * of the platform-specific classes, or the exported {@link PathScurry} which\n * defaults to the current platform.\n */\nexport abstract class PathScurryBase {\n  /**\n   * The root Path entry for the current working directory of this Scurry\n   */\n  root: PathBase\n  /**\n   * The string path for the root of this Scurry's current working directory\n   */\n  rootPath: string\n  /**\n   * A collection of all roots encountered, referenced by rootPath\n   */\n  roots: { [k: string]: PathBase }\n  /**\n   * The Path entry corresponding to this PathScurry's current working directory.\n   */\n  cwd: PathBase\n  #resolveCache: ResolveCache\n  #resolvePosixCache: ResolveCache\n  #children: ChildrenCache\n  /**\n   * Perform path comparisons case-insensitively.\n   *\n   * Defaults true on Darwin and Windows systems, false elsewhere.\n   */\n  nocase: boolean\n\n  /**\n   * The path separator used for parsing paths\n   *\n   * `'/'` on Posix systems, either `'/'` or `'\\\\'` on Windows\n   */\n  abstract sep: string | RegExp\n\n  #fs: FSValue\n\n  /**\n   * This class should not be instantiated directly.\n   *\n   * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry\n   *\n   * @internal\n   */\n  constructor(\n    cwd: URL | string = process.cwd(),\n    pathImpl: typeof win32 | typeof posix,\n    sep: string | RegExp,\n    {\n      nocase,\n      childrenCacheSize = 16 * 1024,\n      fs = defaultFS,\n    }: PathScurryOpts = {},\n  ) {\n    this.#fs = fsFromOption(fs)\n    if (cwd instanceof URL || cwd.startsWith('file://')) {\n      cwd = fileURLToPath(cwd)\n    }\n    // resolve and split root, and then add to the store.\n    // this is the only time we call path.resolve()\n    const cwdPath = pathImpl.resolve(cwd)\n    this.roots = Object.create(null)\n    this.rootPath = this.parseRootPath(cwdPath)\n    this.#resolveCache = new ResolveCache()\n    this.#resolvePosixCache = new ResolveCache()\n    this.#children = new ChildrenCache(childrenCacheSize)\n\n    const split = cwdPath.substring(this.rootPath.length).split(sep)\n    // resolve('/') leaves '', splits to [''], we don't want that.\n    if (split.length === 1 && !split[0]) {\n      split.pop()\n    }\n    /* c8 ignore start */\n    if (nocase === undefined) {\n      throw new TypeError(\n        'must provide nocase setting to PathScurryBase ctor',\n      )\n    }\n    /* c8 ignore stop */\n    this.nocase = nocase\n    this.root = this.newRoot(this.#fs)\n    this.roots[this.rootPath] = this.root\n    let prev: PathBase = this.root\n    let len = split.length - 1\n    const joinSep = pathImpl.sep\n    let abs = this.rootPath\n    let sawFirst = false\n    for (const part of split) {\n      const l = len--\n      prev = prev.child(part, {\n        relative: new Array(l).fill('..').join(joinSep),\n        relativePosix: new Array(l).fill('..').join('/'),\n        fullpath: (abs += (sawFirst ? '' : joinSep) + part),\n      })\n      sawFirst = true\n    }\n    this.cwd = prev\n  }\n\n  /**\n   * Get the depth of a provided path, string, or the cwd\n   */\n  depth(path: Path | string = this.cwd): number {\n    if (typeof path === 'string') {\n      path = this.cwd.resolve(path)\n    }\n    return path.depth()\n  }\n\n  /**\n   * Parse the root portion of a path string\n   *\n   * @internal\n   */\n  abstract parseRootPath(dir: string): string\n  /**\n   * create a new Path to use as root during construction.\n   *\n   * @internal\n   */\n  abstract newRoot(fs: FSValue): PathBase\n  /**\n   * Determine whether a given path string is absolute\n   */\n  abstract isAbsolute(p: string): boolean\n\n  /**\n   * Return the cache of child entries.  Exposed so subclasses can create\n   * child Path objects in a platform-specific way.\n   *\n   * @internal\n   */\n  childrenCache() {\n    return this.#children\n  }\n\n  /**\n   * Resolve one or more path strings to a resolved string\n   *\n   * Same interface as require('path').resolve.\n   *\n   * Much faster than path.resolve() when called multiple times for the same\n   * path, because the resolved Path objects are cached.  Much slower\n   * otherwise.\n   */\n  resolve(...paths: string[]): string {\n    // first figure out the minimum number of paths we have to test\n    // we always start at cwd, but any absolutes will bump the start\n    let r = ''\n    for (let i = paths.length - 1; i >= 0; i--) {\n      const p = paths[i]\n      if (!p || p === '.') continue\n      r = r ? `${p}/${r}` : p\n      if (this.isAbsolute(p)) {\n        break\n      }\n    }\n    const cached = this.#resolveCache.get(r)\n    if (cached !== undefined) {\n      return cached\n    }\n    const result = this.cwd.resolve(r).fullpath()\n    this.#resolveCache.set(r, result)\n    return result\n  }\n\n  /**\n   * Resolve one or more path strings to a resolved string, returning\n   * the posix path.  Identical to .resolve() on posix systems, but on\n   * windows will return a forward-slash separated UNC path.\n   *\n   * Same interface as require('path').resolve.\n   *\n   * Much faster than path.resolve() when called multiple times for the same\n   * path, because the resolved Path objects are cached.  Much slower\n   * otherwise.\n   */\n  resolvePosix(...paths: string[]): string {\n    // first figure out the minimum number of paths we have to test\n    // we always start at cwd, but any absolutes will bump the start\n    let r = ''\n    for (let i = paths.length - 1; i >= 0; i--) {\n      const p = paths[i]\n      if (!p || p === '.') continue\n      r = r ? `${p}/${r}` : p\n      if (this.isAbsolute(p)) {\n        break\n      }\n    }\n    const cached = this.#resolvePosixCache.get(r)\n    if (cached !== undefined) {\n      return cached\n    }\n    const result = this.cwd.resolve(r).fullpathPosix()\n    this.#resolvePosixCache.set(r, result)\n    return result\n  }\n\n  /**\n   * find the relative path from the cwd to the supplied path string or entry\n   */\n  relative(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.relative()\n  }\n\n  /**\n   * find the relative path from the cwd to the supplied path string or\n   * entry, using / as the path delimiter, even on Windows.\n   */\n  relativePosix(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.relativePosix()\n  }\n\n  /**\n   * Return the basename for the provided string or Path object\n   */\n  basename(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.name\n  }\n\n  /**\n   * Return the dirname for the provided string or Path object\n   */\n  dirname(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return (entry.parent || entry).fullpath()\n  }\n\n  /**\n   * Return an array of known child entries.\n   *\n   * First argument may be either a string, or a Path object.\n   *\n   * If the Path cannot or does not contain any children, then an empty array\n   * is returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   *\n   * Unlike `fs.readdir()`, the `withFileTypes` option defaults to `true`. Set\n   * `{ withFileTypes: false }` to return strings.\n   */\n\n  readdir(): Promise\n  readdir(opts: { withFileTypes: true }): Promise\n  readdir(opts: { withFileTypes: false }): Promise\n  readdir(opts: { withFileTypes: boolean }): Promise\n  readdir(entry: PathBase | string): Promise\n  readdir(\n    entry: PathBase | string,\n    opts: { withFileTypes: true },\n  ): Promise\n  readdir(\n    entry: PathBase | string,\n    opts: { withFileTypes: false },\n  ): Promise\n  readdir(\n    entry: PathBase | string,\n    opts: { withFileTypes: boolean },\n  ): Promise\n  async readdir(\n    entry: PathBase | string | { withFileTypes: boolean } = this.cwd,\n    opts: { withFileTypes: boolean } = {\n      withFileTypes: true,\n    },\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const { withFileTypes } = opts\n    if (!entry.canReaddir()) {\n      return []\n    } else {\n      const p = await entry.readdir()\n      return withFileTypes ? p : p.map(e => e.name)\n    }\n  }\n\n  /**\n   * synchronous {@link PathScurryBase.readdir}\n   */\n  readdirSync(): PathBase[]\n  readdirSync(opts: { withFileTypes: true }): PathBase[]\n  readdirSync(opts: { withFileTypes: false }): string[]\n  readdirSync(opts: { withFileTypes: boolean }): PathBase[] | string[]\n  readdirSync(entry: PathBase | string): PathBase[]\n  readdirSync(\n    entry: PathBase | string,\n    opts: { withFileTypes: true },\n  ): PathBase[]\n  readdirSync(\n    entry: PathBase | string,\n    opts: { withFileTypes: false },\n  ): string[]\n  readdirSync(\n    entry: PathBase | string,\n    opts: { withFileTypes: boolean },\n  ): PathBase[] | string[]\n  readdirSync(\n    entry: PathBase | string | { withFileTypes: boolean } = this.cwd,\n    opts: { withFileTypes: boolean } = {\n      withFileTypes: true,\n    },\n  ): PathBase[] | string[] {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const { withFileTypes = true } = opts\n    if (!entry.canReaddir()) {\n      return []\n    } else if (withFileTypes) {\n      return entry.readdirSync()\n    } else {\n      return entry.readdirSync().map(e => e.name)\n    }\n  }\n\n  /**\n   * Call lstat() on the string or Path object, and update all known\n   * information that can be determined.\n   *\n   * Note that unlike `fs.lstat()`, the returned value does not contain some\n   * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that\n   * information is required, you will need to call `fs.lstat` yourself.\n   *\n   * If the Path refers to a nonexistent file, or if the lstat call fails for\n   * any reason, `undefined` is returned.  Otherwise the updated Path object is\n   * returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   */\n  async lstat(\n    entry: string | PathBase = this.cwd,\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.lstat()\n  }\n\n  /**\n   * synchronous {@link PathScurryBase.lstat}\n   */\n  lstatSync(entry: string | PathBase = this.cwd): PathBase | undefined {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.lstatSync()\n  }\n\n  /**\n   * Return the Path object or string path corresponding to the target of a\n   * symbolic link.\n   *\n   * If the path is not a symbolic link, or if the readlink call fails for any\n   * reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   *\n   * `{withFileTypes}` option defaults to `false`.\n   *\n   * On success, returns a Path object if `withFileTypes` option is true,\n   * otherwise a string.\n   */\n  readlink(): Promise\n  readlink(opt: { withFileTypes: false }): Promise\n  readlink(opt: { withFileTypes: true }): Promise\n  readlink(opt: {\n    withFileTypes: boolean\n  }): Promise\n  readlink(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): Promise\n  readlink(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): Promise\n  readlink(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): Promise\n  async readlink(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = await entry.readlink()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  /**\n   * synchronous {@link PathScurryBase.readlink}\n   */\n  readlinkSync(): string | undefined\n  readlinkSync(opt: { withFileTypes: false }): string | undefined\n  readlinkSync(opt: { withFileTypes: true }): PathBase | undefined\n  readlinkSync(opt: {\n    withFileTypes: boolean\n  }): PathBase | string | undefined\n  readlinkSync(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): string | undefined\n  readlinkSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): PathBase | undefined\n  readlinkSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): string | PathBase | undefined\n  readlinkSync(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): string | PathBase | undefined {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = entry.readlinkSync()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  /**\n   * Return the Path object or string path corresponding to path as resolved\n   * by realpath(3).\n   *\n   * If the realpath call fails for any reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   *\n   * `{withFileTypes}` option defaults to `false`.\n   *\n   * On success, returns a Path object if `withFileTypes` option is true,\n   * otherwise a string.\n   */\n  realpath(): Promise\n  realpath(opt: { withFileTypes: false }): Promise\n  realpath(opt: { withFileTypes: true }): Promise\n  realpath(opt: {\n    withFileTypes: boolean\n  }): Promise\n  realpath(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): Promise\n  realpath(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): Promise\n  realpath(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): Promise\n  async realpath(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = await entry.realpath()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  realpathSync(): string | undefined\n  realpathSync(opt: { withFileTypes: false }): string | undefined\n  realpathSync(opt: { withFileTypes: true }): PathBase | undefined\n  realpathSync(opt: {\n    withFileTypes: boolean\n  }): PathBase | string | undefined\n  realpathSync(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): string | undefined\n  realpathSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): PathBase | undefined\n  realpathSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): string | PathBase | undefined\n  realpathSync(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): string | PathBase | undefined {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = entry.realpathSync()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  /**\n   * Asynchronously walk the directory tree, returning an array of\n   * all path strings or Path objects found.\n   *\n   * Note that this will be extremely memory-hungry on large filesystems.\n   * In such cases, it may be better to use the stream or async iterator\n   * walk implementation.\n   */\n  walk(): Promise\n  walk(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Promise\n  walk(opts: WalkOptionsWithFileTypesFalse): Promise\n  walk(opts: WalkOptions): Promise\n  walk(entry: string | PathBase): Promise\n  walk(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Promise\n  walk(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Promise\n  walk(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Promise\n  async walk(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results: (string | PathBase)[] = []\n    if (!filter || filter(entry)) {\n      results.push(withFileTypes ? entry : entry.fullpath())\n    }\n    const dirs = new Set()\n    const walk = (\n      dir: PathBase,\n      cb: (er?: NodeJS.ErrnoException) => void,\n    ) => {\n      dirs.add(dir)\n      dir.readdirCB((er, entries) => {\n        /* c8 ignore start */\n        if (er) {\n          return cb(er)\n        }\n        /* c8 ignore stop */\n        let len = entries.length\n        if (!len) return cb()\n        const next = () => {\n          if (--len === 0) {\n            cb()\n          }\n        }\n        for (const e of entries) {\n          if (!filter || filter(e)) {\n            results.push(withFileTypes ? e : e.fullpath())\n          }\n          if (follow && e.isSymbolicLink()) {\n            e.realpath()\n              .then(r => (r?.isUnknown() ? r.lstat() : r))\n              .then(r =>\n                r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next(),\n              )\n          } else {\n            if (e.shouldWalk(dirs, walkFilter)) {\n              walk(e, next)\n            } else {\n              next()\n            }\n          }\n        }\n      }, true) // zalgooooooo\n    }\n\n    const start = entry\n    return new Promise((res, rej) => {\n      walk(start, er => {\n        /* c8 ignore start */\n        if (er) return rej(er)\n        /* c8 ignore stop */\n        res(results as PathBase[] | string[])\n      })\n    })\n  }\n\n  /**\n   * Synchronously walk the directory tree, returning an array of\n   * all path strings or Path objects found.\n   *\n   * Note that this will be extremely memory-hungry on large filesystems.\n   * In such cases, it may be better to use the stream or async iterator\n   * walk implementation.\n   */\n  walkSync(): PathBase[]\n  walkSync(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): PathBase[]\n  walkSync(opts: WalkOptionsWithFileTypesFalse): string[]\n  walkSync(opts: WalkOptions): string[] | PathBase[]\n  walkSync(entry: string | PathBase): PathBase[]\n  walkSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n  ): PathBase[]\n  walkSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): string[]\n  walkSync(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): PathBase[] | string[]\n  walkSync(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): PathBase[] | string[] {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results: (string | PathBase)[] = []\n    if (!filter || filter(entry)) {\n      results.push(withFileTypes ? entry : entry.fullpath())\n    }\n    const dirs = new Set([entry])\n    for (const dir of dirs) {\n      const entries = dir.readdirSync()\n      for (const e of entries) {\n        if (!filter || filter(e)) {\n          results.push(withFileTypes ? e : e.fullpath())\n        }\n        let r: PathBase | undefined = e\n        if (e.isSymbolicLink()) {\n          if (!(follow && (r = e.realpathSync()))) continue\n          if (r.isUnknown()) r.lstatSync()\n        }\n        if (r.shouldWalk(dirs, walkFilter)) {\n          dirs.add(r)\n        }\n      }\n    }\n    return results as string[] | PathBase[]\n  }\n\n  /**\n   * Support for `for await`\n   *\n   * Alias for {@link PathScurryBase.iterate}\n   *\n   * Note: As of Node 19, this is very slow, compared to other methods of\n   * walking.  Consider using {@link PathScurryBase.stream} if memory overhead\n   * and backpressure are concerns, or {@link PathScurryBase.walk} if not.\n   */\n  [Symbol.asyncIterator]() {\n    return this.iterate()\n  }\n\n  /**\n   * Async generator form of {@link PathScurryBase.walk}\n   *\n   * Note: As of Node 19, this is very slow, compared to other methods of\n   * walking, especially if most/all of the directory tree has been previously\n   * walked.  Consider using {@link PathScurryBase.stream} if memory overhead\n   * and backpressure are concerns, or {@link PathScurryBase.walk} if not.\n   */\n  iterate(): AsyncGenerator\n  iterate(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): AsyncGenerator\n  iterate(\n    opts: WalkOptionsWithFileTypesFalse,\n  ): AsyncGenerator\n  iterate(opts: WalkOptions): AsyncGenerator\n  iterate(entry: string | PathBase): AsyncGenerator\n  iterate(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): AsyncGenerator\n  iterate(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): AsyncGenerator\n  iterate(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): AsyncGenerator\n  iterate(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    options: WalkOptions = {},\n  ): AsyncGenerator {\n    // iterating async over the stream is significantly more performant,\n    // especially in the warm-cache scenario, because it buffers up directory\n    // entries in the background instead of waiting for a yield for each one.\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      options = entry\n      entry = this.cwd\n    }\n    return this.stream(entry, options)[Symbol.asyncIterator]()\n  }\n\n  /**\n   * Iterating over a PathScurry performs a synchronous walk.\n   *\n   * Alias for {@link PathScurryBase.iterateSync}\n   */\n  [Symbol.iterator]() {\n    return this.iterateSync()\n  }\n\n  iterateSync(): Generator\n  iterateSync(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Generator\n  iterateSync(\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Generator\n  iterateSync(opts: WalkOptions): Generator\n  iterateSync(entry: string | PathBase): Generator\n  iterateSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Generator\n  iterateSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Generator\n  iterateSync(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Generator\n  *iterateSync(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Generator {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    if (!filter || filter(entry)) {\n      yield withFileTypes ? entry : entry.fullpath()\n    }\n    const dirs = new Set([entry])\n    for (const dir of dirs) {\n      const entries = dir.readdirSync()\n      for (const e of entries) {\n        if (!filter || filter(e)) {\n          yield withFileTypes ? e : e.fullpath()\n        }\n        let r: PathBase | undefined = e\n        if (e.isSymbolicLink()) {\n          if (!(follow && (r = e.realpathSync()))) continue\n          if (r.isUnknown()) r.lstatSync()\n        }\n        if (r.shouldWalk(dirs, walkFilter)) {\n          dirs.add(r)\n        }\n      }\n    }\n  }\n\n  /**\n   * Stream form of {@link PathScurryBase.walk}\n   *\n   * Returns a Minipass stream that emits {@link PathBase} objects by default,\n   * or strings if `{ withFileTypes: false }` is set in the options.\n   */\n  stream(): Minipass\n  stream(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Minipass\n  stream(opts: WalkOptionsWithFileTypesFalse): Minipass\n  stream(opts: WalkOptions): Minipass\n  stream(entry: string | PathBase): Minipass\n  stream(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n  ): Minipass\n  stream(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Minipass\n  stream(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Minipass | Minipass\n  stream(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Minipass | Minipass {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results = new Minipass({ objectMode: true })\n    if (!filter || filter(entry)) {\n      results.write(withFileTypes ? entry : entry.fullpath())\n    }\n    const dirs = new Set()\n    const queue: PathBase[] = [entry]\n    let processing = 0\n    const process = () => {\n      let paused = false\n      while (!paused) {\n        const dir = queue.shift()\n        if (!dir) {\n          if (processing === 0) results.end()\n          return\n        }\n\n        processing++\n        dirs.add(dir)\n\n        const onReaddir = (\n          er: null | NodeJS.ErrnoException,\n          entries: PathBase[],\n          didRealpaths: boolean = false,\n        ) => {\n          /* c8 ignore start */\n          if (er) return results.emit('error', er)\n          /* c8 ignore stop */\n          if (follow && !didRealpaths) {\n            const promises: Promise[] = []\n            for (const e of entries) {\n              if (e.isSymbolicLink()) {\n                promises.push(\n                  e\n                    .realpath()\n                    .then((r: PathBase | undefined) =>\n                      r?.isUnknown() ? r.lstat() : r,\n                    ),\n                )\n              }\n            }\n            if (promises.length) {\n              Promise.all(promises).then(() =>\n                onReaddir(null, entries, true),\n              )\n              return\n            }\n          }\n\n          for (const e of entries) {\n            if (e && (!filter || filter(e))) {\n              if (!results.write(withFileTypes ? e : e.fullpath())) {\n                paused = true\n              }\n            }\n          }\n\n          processing--\n          for (const e of entries) {\n            const r = e.realpathCached() || e\n            if (r.shouldWalk(dirs, walkFilter)) {\n              queue.push(r)\n            }\n          }\n          if (paused && !results.flowing) {\n            results.once('drain', process)\n          } else if (!sync) {\n            process()\n          }\n        }\n\n        // zalgo containment\n        let sync = true\n        dir.readdirCB(onReaddir, true)\n        sync = false\n      }\n    }\n    process()\n    return results as Minipass | Minipass\n  }\n\n  /**\n   * Synchronous form of {@link PathScurryBase.stream}\n   *\n   * Returns a Minipass stream that emits {@link PathBase} objects by default,\n   * or strings if `{ withFileTypes: false }` is set in the options.\n   *\n   * Will complete the walk in a single tick if the stream is consumed fully.\n   * Otherwise, will pause as needed for stream backpressure.\n   */\n  streamSync(): Minipass\n  streamSync(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Minipass\n  streamSync(opts: WalkOptionsWithFileTypesFalse): Minipass\n  streamSync(opts: WalkOptions): Minipass\n  streamSync(entry: string | PathBase): Minipass\n  streamSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n  ): Minipass\n  streamSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Minipass\n  streamSync(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Minipass | Minipass\n  streamSync(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Minipass | Minipass {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results = new Minipass({ objectMode: true })\n    const dirs = new Set()\n    if (!filter || filter(entry)) {\n      results.write(withFileTypes ? entry : entry.fullpath())\n    }\n    const queue: PathBase[] = [entry]\n    let processing = 0\n    const process = () => {\n      let paused = false\n      while (!paused) {\n        const dir = queue.shift()\n        if (!dir) {\n          if (processing === 0) results.end()\n          return\n        }\n        processing++\n        dirs.add(dir)\n\n        const entries = dir.readdirSync()\n        for (const e of entries) {\n          if (!filter || filter(e)) {\n            if (!results.write(withFileTypes ? e : e.fullpath())) {\n              paused = true\n            }\n          }\n        }\n        processing--\n        for (const e of entries) {\n          let r: PathBase | undefined = e\n          if (e.isSymbolicLink()) {\n            if (!(follow && (r = e.realpathSync()))) continue\n            if (r.isUnknown()) r.lstatSync()\n          }\n          if (r.shouldWalk(dirs, walkFilter)) {\n            queue.push(r)\n          }\n        }\n      }\n      if (paused && !results.flowing) results.once('drain', process)\n    }\n    process()\n    return results as Minipass | Minipass\n  }\n\n  chdir(path: string | Path = this.cwd) {\n    const oldCwd = this.cwd\n    this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path\n    this.cwd[setAsCwd](oldCwd)\n  }\n}\n\n/**\n * Options provided to all walk methods.\n */\nexport interface WalkOptions {\n  /**\n   * Return results as {@link PathBase} objects rather than strings.\n   * When set to false, results are fully resolved paths, as returned by\n   * {@link PathBase.fullpath}.\n   * @default true\n   */\n  withFileTypes?: boolean\n\n  /**\n   *  Attempt to read directory entries from symbolic links. Otherwise, only\n   *  actual directories are traversed. Regardless of this setting, a given\n   *  target path will only ever be walked once, meaning that a symbolic link\n   *  to a previously traversed directory will never be followed.\n   *\n   *  Setting this imposes a slight performance penalty, because `readlink`\n   *  must be called on all symbolic links encountered, in order to avoid\n   *  infinite cycles.\n   * @default false\n   */\n  follow?: boolean\n\n  /**\n   * Only return entries where the provided function returns true.\n   *\n   * This will not prevent directories from being traversed, even if they do\n   * not pass the filter, though it will prevent directories themselves from\n   * being included in the result set.  See {@link walkFilter}\n   *\n   * Asynchronous functions are not supported here.\n   *\n   * By default, if no filter is provided, all entries and traversed\n   * directories are included.\n   */\n  filter?: (entry: PathBase) => boolean\n\n  /**\n   * Only traverse directories (and in the case of {@link follow} being set to\n   * true, symbolic links to directories) if the provided function returns\n   * true.\n   *\n   * This will not prevent directories from being included in the result set,\n   * even if they do not pass the supplied filter function.  See {@link filter}\n   * to do that.\n   *\n   * Asynchronous functions are not supported here.\n   */\n  walkFilter?: (entry: PathBase) => boolean\n}\n\nexport type WalkOptionsWithFileTypesUnset = WalkOptions & {\n  withFileTypes?: undefined\n}\nexport type WalkOptionsWithFileTypesTrue = WalkOptions & {\n  withFileTypes: true\n}\nexport type WalkOptionsWithFileTypesFalse = WalkOptions & {\n  withFileTypes: false\n}\n\n/**\n * Windows implementation of {@link PathScurryBase}\n *\n * Defaults to case insensitve, uses `'\\\\'` to generate path strings.  Uses\n * {@link PathWin32} for Path objects.\n */\nexport class PathScurryWin32 extends PathScurryBase {\n  /**\n   * separator for generating path strings\n   */\n  sep: '\\\\' = '\\\\'\n\n  constructor(\n    cwd: URL | string = process.cwd(),\n    opts: PathScurryOpts = {},\n  ) {\n    const { nocase = true } = opts\n    super(cwd, win32, '\\\\', { ...opts, nocase })\n    this.nocase = nocase\n    for (let p: PathBase | undefined = this.cwd; p; p = p.parent) {\n      p.nocase = this.nocase\n    }\n  }\n\n  /**\n   * @internal\n   */\n  parseRootPath(dir: string): string {\n    // if the path starts with a single separator, it's not a UNC, and we'll\n    // just get separator as the root, and driveFromUNC will return \\\n    // In that case, mount \\ on the root from the cwd.\n    return win32.parse(dir).root.toUpperCase()\n  }\n\n  /**\n   * @internal\n   */\n  newRoot(fs: FSValue) {\n    return new PathWin32(\n      this.rootPath,\n      IFDIR,\n      undefined,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      { fs },\n    )\n  }\n\n  /**\n   * Return true if the provided path string is an absolute path\n   */\n  isAbsolute(p: string): boolean {\n    return (\n      p.startsWith('/') || p.startsWith('\\\\') || /^[a-z]:(\\/|\\\\)/i.test(p)\n    )\n  }\n}\n\n/**\n * {@link PathScurryBase} implementation for all posix systems other than Darwin.\n *\n * Defaults to case-sensitive matching, uses `'/'` to generate path strings.\n *\n * Uses {@link PathPosix} for Path objects.\n */\nexport class PathScurryPosix extends PathScurryBase {\n  /**\n   * separator for generating path strings\n   */\n  sep: '/' = '/'\n  constructor(\n    cwd: URL | string = process.cwd(),\n    opts: PathScurryOpts = {},\n  ) {\n    const { nocase = false } = opts\n    super(cwd, posix, '/', { ...opts, nocase })\n    this.nocase = nocase\n  }\n\n  /**\n   * @internal\n   */\n  parseRootPath(_dir: string): string {\n    return '/'\n  }\n\n  /**\n   * @internal\n   */\n  newRoot(fs: FSValue) {\n    return new PathPosix(\n      this.rootPath,\n      IFDIR,\n      undefined,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      { fs },\n    )\n  }\n\n  /**\n   * Return true if the provided path string is an absolute path\n   */\n  isAbsolute(p: string): boolean {\n    return p.startsWith('/')\n  }\n}\n\n/**\n * {@link PathScurryBase} implementation for Darwin (macOS) systems.\n *\n * Defaults to case-insensitive matching, uses `'/'` for generating path\n * strings.\n *\n * Uses {@link PathPosix} for Path objects.\n */\nexport class PathScurryDarwin extends PathScurryPosix {\n  constructor(\n    cwd: URL | string = process.cwd(),\n    opts: PathScurryOpts = {},\n  ) {\n    const { nocase = true } = opts\n    super(cwd, { ...opts, nocase })\n  }\n}\n\n/**\n * Default {@link PathBase} implementation for the current platform.\n *\n * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.\n */\nexport const Path = process.platform === 'win32' ? PathWin32 : PathPosix\nexport type Path = PathBase | InstanceType\n\n/**\n * Default {@link PathScurryBase} implementation for the current platform.\n *\n * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on\n * Darwin (macOS) systems, {@link PathScurryPosix} on all others.\n */\nexport const PathScurry:\n  | typeof PathScurryWin32\n  | typeof PathScurryDarwin\n  | typeof PathScurryPosix =\n  process.platform === 'win32' ? PathScurryWin32\n  : process.platform === 'darwin' ? PathScurryDarwin\n  : PathScurryPosix\nexport type PathScurry = PathScurryBase | InstanceType\n","// this is just a very light wrapper around 2 arrays with an offset index\n\nimport { GLOBSTAR } from 'minimatch'\nexport type MMPattern = string | RegExp | typeof GLOBSTAR\n\n// an array of length >= 1\nexport type PatternList = [p: MMPattern, ...rest: MMPattern[]]\nexport type UNCPatternList = [\n  p0: '',\n  p1: '',\n  p2: string,\n  p3: string,\n  ...rest: MMPattern[],\n]\nexport type DrivePatternList = [p0: string, ...rest: MMPattern[]]\nexport type AbsolutePatternList = [p0: '', ...rest: MMPattern[]]\nexport type GlobList = [p: string, ...rest: string[]]\n\nconst isPatternList = (pl: MMPattern[]): pl is PatternList =>\n  pl.length >= 1\nconst isGlobList = (gl: string[]): gl is GlobList => gl.length >= 1\n\n/**\n * An immutable-ish view on an array of glob parts and their parsed\n * results\n */\nexport class Pattern {\n  readonly #patternList: PatternList\n  readonly #globList: GlobList\n  readonly #index: number\n  readonly length: number\n  readonly #platform: NodeJS.Platform\n  #rest?: Pattern | null\n  #globString?: string\n  #isDrive?: boolean\n  #isUNC?: boolean\n  #isAbsolute?: boolean\n  #followGlobstar: boolean = true\n\n  constructor(\n    patternList: MMPattern[],\n    globList: string[],\n    index: number,\n    platform: NodeJS.Platform,\n  ) {\n    if (!isPatternList(patternList)) {\n      throw new TypeError('empty pattern list')\n    }\n    if (!isGlobList(globList)) {\n      throw new TypeError('empty glob list')\n    }\n    if (globList.length !== patternList.length) {\n      throw new TypeError('mismatched pattern list and glob list lengths')\n    }\n    this.length = patternList.length\n    if (index < 0 || index >= this.length) {\n      throw new TypeError('index out of range')\n    }\n    this.#patternList = patternList\n    this.#globList = globList\n    this.#index = index\n    this.#platform = platform\n\n    // normalize root entries of absolute patterns on initial creation.\n    if (this.#index === 0) {\n      // c: => ['c:/']\n      // C:/ => ['C:/']\n      // C:/x => ['C:/', 'x']\n      // //host/share => ['//host/share/']\n      // //host/share/ => ['//host/share/']\n      // //host/share/x => ['//host/share/', 'x']\n      // /etc => ['/', 'etc']\n      // / => ['/']\n      if (this.isUNC()) {\n        // '' / '' / 'host' / 'share'\n        const [p0, p1, p2, p3, ...prest] = this.#patternList\n        const [g0, g1, g2, g3, ...grest] = this.#globList\n        if (prest[0] === '') {\n          // ends in /\n          prest.shift()\n          grest.shift()\n        }\n        const p = [p0, p1, p2, p3, ''].join('/')\n        const g = [g0, g1, g2, g3, ''].join('/')\n        this.#patternList = [p, ...prest]\n        this.#globList = [g, ...grest]\n        this.length = this.#patternList.length\n      } else if (this.isDrive() || this.isAbsolute()) {\n        const [p1, ...prest] = this.#patternList\n        const [g1, ...grest] = this.#globList\n        if (prest[0] === '') {\n          // ends in /\n          prest.shift()\n          grest.shift()\n        }\n        const p = (p1 as string) + '/'\n        const g = g1 + '/'\n        this.#patternList = [p, ...prest]\n        this.#globList = [g, ...grest]\n        this.length = this.#patternList.length\n      }\n    }\n  }\n\n  /**\n   * The first entry in the parsed list of patterns\n   */\n  pattern(): MMPattern {\n    return this.#patternList[this.#index] as MMPattern\n  }\n\n  /**\n   * true of if pattern() returns a string\n   */\n  isString(): boolean {\n    return typeof this.#patternList[this.#index] === 'string'\n  }\n  /**\n   * true of if pattern() returns GLOBSTAR\n   */\n  isGlobstar(): boolean {\n    return this.#patternList[this.#index] === GLOBSTAR\n  }\n  /**\n   * true if pattern() returns a regexp\n   */\n  isRegExp(): boolean {\n    return this.#patternList[this.#index] instanceof RegExp\n  }\n\n  /**\n   * The /-joined set of glob parts that make up this pattern\n   */\n  globString(): string {\n    return (this.#globString =\n      this.#globString ||\n      (this.#index === 0 ?\n        this.isAbsolute() ?\n          this.#globList[0] + this.#globList.slice(1).join('/')\n        : this.#globList.join('/')\n      : this.#globList.slice(this.#index).join('/')))\n  }\n\n  /**\n   * true if there are more pattern parts after this one\n   */\n  hasMore(): boolean {\n    return this.length > this.#index + 1\n  }\n\n  /**\n   * The rest of the pattern after this part, or null if this is the end\n   */\n  rest(): Pattern | null {\n    if (this.#rest !== undefined) return this.#rest\n    if (!this.hasMore()) return (this.#rest = null)\n    this.#rest = new Pattern(\n      this.#patternList,\n      this.#globList,\n      this.#index + 1,\n      this.#platform,\n    )\n    this.#rest.#isAbsolute = this.#isAbsolute\n    this.#rest.#isUNC = this.#isUNC\n    this.#rest.#isDrive = this.#isDrive\n    return this.#rest\n  }\n\n  /**\n   * true if the pattern represents a //unc/path/ on windows\n   */\n  isUNC(): boolean {\n    const pl = this.#patternList\n    return this.#isUNC !== undefined ?\n        this.#isUNC\n      : (this.#isUNC =\n          this.#platform === 'win32' &&\n          this.#index === 0 &&\n          pl[0] === '' &&\n          pl[1] === '' &&\n          typeof pl[2] === 'string' &&\n          !!pl[2] &&\n          typeof pl[3] === 'string' &&\n          !!pl[3])\n  }\n\n  // pattern like C:/...\n  // split = ['C:', ...]\n  // XXX: would be nice to handle patterns like `c:*` to test the cwd\n  // in c: for *, but I don't know of a way to even figure out what that\n  // cwd is without actually chdir'ing into it?\n  /**\n   * True if the pattern starts with a drive letter on Windows\n   */\n  isDrive(): boolean {\n    const pl = this.#patternList\n    return this.#isDrive !== undefined ?\n        this.#isDrive\n      : (this.#isDrive =\n          this.#platform === 'win32' &&\n          this.#index === 0 &&\n          this.length > 1 &&\n          typeof pl[0] === 'string' &&\n          /^[a-z]:$/i.test(pl[0]))\n  }\n\n  // pattern = '/' or '/...' or '/x/...'\n  // split = ['', ''] or ['', ...] or ['', 'x', ...]\n  // Drive and UNC both considered absolute on windows\n  /**\n   * True if the pattern is rooted on an absolute path\n   */\n  isAbsolute(): boolean {\n    const pl = this.#patternList\n    return this.#isAbsolute !== undefined ?\n        this.#isAbsolute\n      : (this.#isAbsolute =\n          (pl[0] === '' && pl.length > 1) ||\n          this.isDrive() ||\n          this.isUNC())\n  }\n\n  /**\n   * consume the root of the pattern, and return it\n   */\n  root(): string {\n    const p = this.#patternList[0]\n    return (\n        typeof p === 'string' && this.isAbsolute() && this.#index === 0\n      ) ?\n        p\n      : ''\n  }\n\n  /**\n   * Check to see if the current globstar pattern is allowed to follow\n   * a symbolic link.\n   */\n  checkFollowGlobstar(): boolean {\n    return !(\n      this.#index === 0 ||\n      !this.isGlobstar() ||\n      !this.#followGlobstar\n    )\n  }\n\n  /**\n   * Mark that the current globstar pattern is following a symbolic link\n   */\n  markFollowGlobstar(): boolean {\n    if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)\n      return false\n    this.#followGlobstar = false\n    return true\n  }\n}\n","// give it a pattern, and it'll be able to tell you if\n// a given path should be ignored.\n// Ignoring a path ignores its children if the pattern ends in /**\n// Ignores are always parsed in dot:true mode\n\nimport { Minimatch, MinimatchOptions } from 'minimatch'\nimport { Path } from 'path-scurry'\nimport { Pattern } from './pattern.js'\nimport { GlobWalkerOpts } from './walker.js'\n\nexport interface IgnoreLike {\n  ignored?: (p: Path) => boolean\n  childrenIgnored?: (p: Path) => boolean\n  add?: (ignore: string) => void\n}\n\nconst defaultPlatform: NodeJS.Platform =\n  (\n    typeof process === 'object' &&\n    process &&\n    typeof process.platform === 'string'\n  ) ?\n    process.platform\n  : 'linux'\n\n/**\n * Class used to process ignored patterns\n */\nexport class Ignore implements IgnoreLike {\n  relative: Minimatch[]\n  relativeChildren: Minimatch[]\n  absolute: Minimatch[]\n  absoluteChildren: Minimatch[]\n  platform: NodeJS.Platform\n  mmopts: MinimatchOptions\n\n  constructor(\n    ignored: string[],\n    {\n      nobrace,\n      nocase,\n      noext,\n      noglobstar,\n      platform = defaultPlatform,\n    }: GlobWalkerOpts,\n  ) {\n    this.relative = []\n    this.absolute = []\n    this.relativeChildren = []\n    this.absoluteChildren = []\n    this.platform = platform\n    this.mmopts = {\n      dot: true,\n      nobrace,\n      nocase,\n      noext,\n      noglobstar,\n      optimizationLevel: 2,\n      platform,\n      nocomment: true,\n      nonegate: true,\n    }\n    for (const ign of ignored) this.add(ign)\n  }\n\n  add(ign: string) {\n    // this is a little weird, but it gives us a clean set of optimized\n    // minimatch matchers, without getting tripped up if one of them\n    // ends in /** inside a brace section, and it's only inefficient at\n    // the start of the walk, not along it.\n    // It'd be nice if the Pattern class just had a .test() method, but\n    // handling globstars is a bit of a pita, and that code already lives\n    // in minimatch anyway.\n    // Another way would be if maybe Minimatch could take its set/globParts\n    // as an option, and then we could at least just use Pattern to test\n    // for absolute-ness.\n    // Yet another way, Minimatch could take an array of glob strings, and\n    // a cwd option, and do the right thing.\n    const mm = new Minimatch(ign, this.mmopts)\n    for (let i = 0; i < mm.set.length; i++) {\n      const parsed = mm.set[i]\n      const globParts = mm.globParts[i]\n      /* c8 ignore start */\n      if (!parsed || !globParts) {\n        throw new Error('invalid pattern object')\n      }\n      // strip off leading ./ portions\n      // https://github.com/isaacs/node-glob/issues/570\n      while (parsed[0] === '.' && globParts[0] === '.') {\n        parsed.shift()\n        globParts.shift()\n      }\n      /* c8 ignore stop */\n      const p = new Pattern(parsed, globParts, 0, this.platform)\n      const m = new Minimatch(p.globString(), this.mmopts)\n      const children = globParts[globParts.length - 1] === '**'\n      const absolute = p.isAbsolute()\n      if (absolute) this.absolute.push(m)\n      else this.relative.push(m)\n      if (children) {\n        if (absolute) this.absoluteChildren.push(m)\n        else this.relativeChildren.push(m)\n      }\n    }\n  }\n\n  ignored(p: Path): boolean {\n    const fullpath = p.fullpath()\n    const fullpaths = `${fullpath}/`\n    const relative = p.relative() || '.'\n    const relatives = `${relative}/`\n    for (const m of this.relative) {\n      if (m.match(relative) || m.match(relatives)) return true\n    }\n    for (const m of this.absolute) {\n      if (m.match(fullpath) || m.match(fullpaths)) return true\n    }\n    return false\n  }\n\n  childrenIgnored(p: Path): boolean {\n    const fullpath = p.fullpath() + '/'\n    const relative = (p.relative() || '.') + '/'\n    for (const m of this.relativeChildren) {\n      if (m.match(relative)) return true\n    }\n    for (const m of this.absoluteChildren) {\n      if (m.match(fullpath)) return true\n    }\n    return false\n  }\n}\n","// synchronous utility for filtering entries and calculating subwalks\n\nimport { GLOBSTAR, MMRegExp } from 'minimatch'\nimport { Path } from 'path-scurry'\nimport { MMPattern, Pattern } from './pattern.js'\nimport { GlobWalkerOpts } from './walker.js'\n\n/**\n * A cache of which patterns have been processed for a given Path\n */\nexport class HasWalkedCache {\n  store: Map>\n  constructor(store: Map> = new Map()) {\n    this.store = store\n  }\n  copy() {\n    return new HasWalkedCache(new Map(this.store))\n  }\n  hasWalked(target: Path, pattern: Pattern) {\n    return this.store.get(target.fullpath())?.has(pattern.globString())\n  }\n  storeWalked(target: Path, pattern: Pattern) {\n    const fullpath = target.fullpath()\n    const cached = this.store.get(fullpath)\n    if (cached) cached.add(pattern.globString())\n    else this.store.set(fullpath, new Set([pattern.globString()]))\n  }\n}\n\n/**\n * A record of which paths have been matched in a given walk step,\n * and whether they only are considered a match if they are a directory,\n * and whether their absolute or relative path should be returned.\n */\nexport class MatchRecord {\n  store: Map = new Map()\n  add(target: Path, absolute: boolean, ifDir: boolean) {\n    const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0)\n    const current = this.store.get(target)\n    this.store.set(target, current === undefined ? n : n & current)\n  }\n  // match, absolute, ifdir\n  entries(): [Path, boolean, boolean][] {\n    return [...this.store.entries()].map(([path, n]) => [\n      path,\n      !!(n & 2),\n      !!(n & 1),\n    ])\n  }\n}\n\n/**\n * A collection of patterns that must be processed in a subsequent step\n * for a given path.\n */\nexport class SubWalks {\n  store: Map = new Map()\n  add(target: Path, pattern: Pattern) {\n    if (!target.canReaddir()) {\n      return\n    }\n    const subs = this.store.get(target)\n    if (subs) {\n      if (!subs.find(p => p.globString() === pattern.globString())) {\n        subs.push(pattern)\n      }\n    } else this.store.set(target, [pattern])\n  }\n  get(target: Path): Pattern[] {\n    const subs = this.store.get(target)\n    /* c8 ignore start */\n    if (!subs) {\n      throw new Error('attempting to walk unknown path')\n    }\n    /* c8 ignore stop */\n    return subs\n  }\n  entries(): [Path, Pattern[]][] {\n    return this.keys().map(k => [k, this.store.get(k) as Pattern[]])\n  }\n  keys(): Path[] {\n    return [...this.store.keys()].filter(t => t.canReaddir())\n  }\n}\n\n/**\n * The class that processes patterns for a given path.\n *\n * Handles child entry filtering, and determining whether a path's\n * directory contents must be read.\n */\nexport class Processor {\n  hasWalkedCache: HasWalkedCache\n  matches = new MatchRecord()\n  subwalks = new SubWalks()\n  patterns?: Pattern[]\n  follow: boolean\n  dot: boolean\n  opts: GlobWalkerOpts\n\n  constructor(opts: GlobWalkerOpts, hasWalkedCache?: HasWalkedCache) {\n    this.opts = opts\n    this.follow = !!opts.follow\n    this.dot = !!opts.dot\n    this.hasWalkedCache =\n      hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache()\n  }\n\n  processPatterns(target: Path, patterns: Pattern[]) {\n    this.patterns = patterns\n    const processingSet: [Path, Pattern][] = patterns.map(p => [target, p])\n\n    // map of paths to the magic-starting subwalks they need to walk\n    // first item in patterns is the filter\n\n    for (let [t, pattern] of processingSet) {\n      this.hasWalkedCache.storeWalked(t, pattern)\n\n      const root = pattern.root()\n      const absolute = pattern.isAbsolute() && this.opts.absolute !== false\n\n      // start absolute patterns at root\n      if (root) {\n        t = t.resolve(\n          root === '/' && this.opts.root !== undefined ?\n            this.opts.root\n          : root,\n        )\n        const rest = pattern.rest()\n        if (!rest) {\n          this.matches.add(t, true, false)\n          continue\n        } else {\n          pattern = rest\n        }\n      }\n\n      if (t.isENOENT()) continue\n\n      let p: MMPattern\n      let rest: Pattern | null\n      let changed = false\n      while (\n        typeof (p = pattern.pattern()) === 'string' &&\n        (rest = pattern.rest())\n      ) {\n        const c = t.resolve(p)\n        t = c\n        pattern = rest\n        changed = true\n      }\n      p = pattern.pattern()\n      rest = pattern.rest()\n      if (changed) {\n        if (this.hasWalkedCache.hasWalked(t, pattern)) continue\n        this.hasWalkedCache.storeWalked(t, pattern)\n      }\n\n      // now we have either a final string for a known entry,\n      // more strings for an unknown entry,\n      // or a pattern starting with magic, mounted on t.\n      if (typeof p === 'string') {\n        // must not be final entry, otherwise we would have\n        // concatenated it earlier.\n        const ifDir = p === '..' || p === '' || p === '.'\n        this.matches.add(t.resolve(p), absolute, ifDir)\n        continue\n      } else if (p === GLOBSTAR) {\n        // if no rest, match and subwalk pattern\n        // if rest, process rest and subwalk pattern\n        // if it's a symlink, but we didn't get here by way of a\n        // globstar match (meaning it's the first time THIS globstar\n        // has traversed a symlink), then we follow it. Otherwise, stop.\n        if (\n          !t.isSymbolicLink() ||\n          this.follow ||\n          pattern.checkFollowGlobstar()\n        ) {\n          this.subwalks.add(t, pattern)\n        }\n        const rp = rest?.pattern()\n        const rrest = rest?.rest()\n        if (!rest || ((rp === '' || rp === '.') && !rrest)) {\n          // only HAS to be a dir if it ends in **/ or **/.\n          // but ending in ** will match files as well.\n          this.matches.add(t, absolute, rp === '' || rp === '.')\n        } else {\n          if (rp === '..') {\n            // this would mean you're matching **/.. at the fs root,\n            // and no thanks, I'm not gonna test that specific case.\n            /* c8 ignore start */\n            const tp = t.parent || t\n            /* c8 ignore stop */\n            if (!rrest) this.matches.add(tp, absolute, true)\n            else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {\n              this.subwalks.add(tp, rrest)\n            }\n          }\n        }\n      } else if (p instanceof RegExp) {\n        this.subwalks.add(t, pattern)\n      }\n    }\n\n    return this\n  }\n\n  subwalkTargets(): Path[] {\n    return this.subwalks.keys()\n  }\n\n  child() {\n    return new Processor(this.opts, this.hasWalkedCache)\n  }\n\n  // return a new Processor containing the subwalks for each\n  // child entry, and a set of matches, and\n  // a hasWalkedCache that's a copy of this one\n  // then we're going to call\n  filterEntries(parent: Path, entries: Path[]): Processor {\n    const patterns = this.subwalks.get(parent)\n    // put matches and entry walks into the results processor\n    const results = this.child()\n    for (const e of entries) {\n      for (const pattern of patterns) {\n        const absolute = pattern.isAbsolute()\n        const p = pattern.pattern()\n        const rest = pattern.rest()\n        if (p === GLOBSTAR) {\n          results.testGlobstar(e, pattern, rest, absolute)\n        } else if (p instanceof RegExp) {\n          results.testRegExp(e, p, rest, absolute)\n        } else {\n          results.testString(e, p, rest, absolute)\n        }\n      }\n    }\n    return results\n  }\n\n  testGlobstar(\n    e: Path,\n    pattern: Pattern,\n    rest: Pattern | null,\n    absolute: boolean,\n  ) {\n    if (this.dot || !e.name.startsWith('.')) {\n      if (!pattern.hasMore()) {\n        this.matches.add(e, absolute, false)\n      }\n      if (e.canReaddir()) {\n        // if we're in follow mode or it's not a symlink, just keep\n        // testing the same pattern. If there's more after the globstar,\n        // then this symlink consumes the globstar. If not, then we can\n        // follow at most ONE symlink along the way, so we mark it, which\n        // also checks to ensure that it wasn't already marked.\n        if (this.follow || !e.isSymbolicLink()) {\n          this.subwalks.add(e, pattern)\n        } else if (e.isSymbolicLink()) {\n          if (rest && pattern.checkFollowGlobstar()) {\n            this.subwalks.add(e, rest)\n          } else if (pattern.markFollowGlobstar()) {\n            this.subwalks.add(e, pattern)\n          }\n        }\n      }\n    }\n    // if the NEXT thing matches this entry, then also add\n    // the rest.\n    if (rest) {\n      const rp = rest.pattern()\n      if (\n        typeof rp === 'string' &&\n        // dots and empty were handled already\n        rp !== '..' &&\n        rp !== '' &&\n        rp !== '.'\n      ) {\n        this.testString(e, rp, rest.rest(), absolute)\n      } else if (rp === '..') {\n        /* c8 ignore start */\n        const ep = e.parent || e\n        /* c8 ignore stop */\n        this.subwalks.add(ep, rest)\n      } else if (rp instanceof RegExp) {\n        this.testRegExp(e, rp, rest.rest(), absolute)\n      }\n    }\n  }\n\n  testRegExp(\n    e: Path,\n    p: MMRegExp,\n    rest: Pattern | null,\n    absolute: boolean,\n  ) {\n    if (!p.test(e.name)) return\n    if (!rest) {\n      this.matches.add(e, absolute, false)\n    } else {\n      this.subwalks.add(e, rest)\n    }\n  }\n\n  testString(e: Path, p: string, rest: Pattern | null, absolute: boolean) {\n    // should never happen?\n    if (!e.isNamed(p)) return\n    if (!rest) {\n      this.matches.add(e, absolute, false)\n    } else {\n      this.subwalks.add(e, rest)\n    }\n  }\n}\n","/**\n * Single-use utility classes to provide functionality to the {@link Glob}\n * methods.\n *\n * @module\n */\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport { Ignore, IgnoreLike } from './ignore.js'\n\n// XXX can we somehow make it so that it NEVER processes a given path more than\n// once, enough that the match set tracking is no longer needed?  that'd speed\n// things up a lot.  Or maybe bring back nounique, and skip it in that case?\n\n// a single minimatch set entry with 1 or more parts\nimport { Pattern } from './pattern.js'\nimport { Processor } from './processor.js'\n\nexport interface GlobWalkerOpts {\n  absolute?: boolean\n  allowWindowsEscape?: boolean\n  cwd?: string | URL\n  dot?: boolean\n  dotRelative?: boolean\n  follow?: boolean\n  ignore?: string | string[] | IgnoreLike\n  mark?: boolean\n  matchBase?: boolean\n  // Note: maxDepth here means \"maximum actual Path.depth()\",\n  // not \"maximum depth beyond cwd\"\n  maxDepth?: number\n  nobrace?: boolean\n  nocase?: boolean\n  nodir?: boolean\n  noext?: boolean\n  noglobstar?: boolean\n  platform?: NodeJS.Platform\n  posix?: boolean\n  realpath?: boolean\n  root?: string\n  stat?: boolean\n  signal?: AbortSignal\n  windowsPathsNoEscape?: boolean\n  withFileTypes?: boolean\n  includeChildMatches?: boolean\n}\n\nexport type GWOFileTypesTrue = GlobWalkerOpts & {\n  withFileTypes: true\n}\nexport type GWOFileTypesFalse = GlobWalkerOpts & {\n  withFileTypes: false\n}\nexport type GWOFileTypesUnset = GlobWalkerOpts & {\n  withFileTypes?: undefined\n}\n\nexport type Result =\n  O extends GWOFileTypesTrue ? Path\n  : O extends GWOFileTypesFalse ? string\n  : O extends GWOFileTypesUnset ? string\n  : Path | string\n\nexport type Matches =\n  O extends GWOFileTypesTrue ? Set\n  : O extends GWOFileTypesFalse ? Set\n  : O extends GWOFileTypesUnset ? Set\n  : Set\n\nexport type MatchStream = Minipass<\n  Result,\n  Result\n>\n\nconst makeIgnore = (\n  ignore: string | string[] | IgnoreLike,\n  opts: GlobWalkerOpts,\n): IgnoreLike =>\n  typeof ignore === 'string' ? new Ignore([ignore], opts)\n  : Array.isArray(ignore) ? new Ignore(ignore, opts)\n  : ignore\n\n/**\n * basic walking utilities that all the glob walker types use\n */\nexport abstract class GlobUtil {\n  path: Path\n  patterns: Pattern[]\n  opts: O\n  seen: Set = new Set()\n  paused: boolean = false\n  aborted: boolean = false\n  #onResume: (() => any)[] = []\n  #ignore?: IgnoreLike\n  #sep: '\\\\' | '/'\n  signal?: AbortSignal\n  maxDepth: number\n  includeChildMatches: boolean\n\n  constructor(patterns: Pattern[], path: Path, opts: O)\n  constructor(patterns: Pattern[], path: Path, opts: O) {\n    this.patterns = patterns\n    this.path = path\n    this.opts = opts\n    this.#sep = !opts.posix && opts.platform === 'win32' ? '\\\\' : '/'\n    this.includeChildMatches = opts.includeChildMatches !== false\n    if (opts.ignore || !this.includeChildMatches) {\n      this.#ignore = makeIgnore(opts.ignore ?? [], opts)\n      if (\n        !this.includeChildMatches &&\n        typeof this.#ignore.add !== 'function'\n      ) {\n        const m = 'cannot ignore child matches, ignore lacks add() method.'\n        throw new Error(m)\n      }\n    }\n    // ignore, always set with maxDepth, but it's optional on the\n    // GlobOptions type\n    /* c8 ignore start */\n    this.maxDepth = opts.maxDepth || Infinity\n    /* c8 ignore stop */\n    if (opts.signal) {\n      this.signal = opts.signal\n      this.signal.addEventListener('abort', () => {\n        this.#onResume.length = 0\n      })\n    }\n  }\n\n  #ignored(path: Path): boolean {\n    return this.seen.has(path) || !!this.#ignore?.ignored?.(path)\n  }\n  #childrenIgnored(path: Path): boolean {\n    return !!this.#ignore?.childrenIgnored?.(path)\n  }\n\n  // backpressure mechanism\n  pause() {\n    this.paused = true\n  }\n  resume() {\n    /* c8 ignore start */\n    if (this.signal?.aborted) return\n    /* c8 ignore stop */\n    this.paused = false\n    let fn: (() => any) | undefined = undefined\n    while (!this.paused && (fn = this.#onResume.shift())) {\n      fn()\n    }\n  }\n  onResume(fn: () => any) {\n    if (this.signal?.aborted) return\n    /* c8 ignore start */\n    if (!this.paused) {\n      fn()\n    } else {\n      /* c8 ignore stop */\n      this.#onResume.push(fn)\n    }\n  }\n\n  // do the requisite realpath/stat checking, and return the path\n  // to add or undefined to filter it out.\n  async matchCheck(e: Path, ifDir: boolean): Promise {\n    if (ifDir && this.opts.nodir) return undefined\n    let rpc: Path | undefined\n    if (this.opts.realpath) {\n      rpc = e.realpathCached() || (await e.realpath())\n      if (!rpc) return undefined\n      e = rpc\n    }\n    const needStat = e.isUnknown() || this.opts.stat\n    const s = needStat ? await e.lstat() : e\n    if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n      const target = await s.realpath()\n      /* c8 ignore start */\n      if (target && (target.isUnknown() || this.opts.stat)) {\n        await target.lstat()\n      }\n      /* c8 ignore stop */\n    }\n    return this.matchCheckTest(s, ifDir)\n  }\n\n  matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined {\n    return (\n        e &&\n          (this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&\n          (!ifDir || e.canReaddir()) &&\n          (!this.opts.nodir || !e.isDirectory()) &&\n          (!this.opts.nodir ||\n            !this.opts.follow ||\n            !e.isSymbolicLink() ||\n            !e.realpathCached()?.isDirectory()) &&\n          !this.#ignored(e)\n      ) ?\n        e\n      : undefined\n  }\n\n  matchCheckSync(e: Path, ifDir: boolean): Path | undefined {\n    if (ifDir && this.opts.nodir) return undefined\n    let rpc: Path | undefined\n    if (this.opts.realpath) {\n      rpc = e.realpathCached() || e.realpathSync()\n      if (!rpc) return undefined\n      e = rpc\n    }\n    const needStat = e.isUnknown() || this.opts.stat\n    const s = needStat ? e.lstatSync() : e\n    if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n      const target = s.realpathSync()\n      if (target && (target?.isUnknown() || this.opts.stat)) {\n        target.lstatSync()\n      }\n    }\n    return this.matchCheckTest(s, ifDir)\n  }\n\n  abstract matchEmit(p: Result): void\n  abstract matchEmit(p: string | Path): void\n\n  matchFinish(e: Path, absolute: boolean) {\n    if (this.#ignored(e)) return\n    // we know we have an ignore if this is false, but TS doesn't\n    if (!this.includeChildMatches && this.#ignore?.add) {\n      const ign = `${e.relativePosix()}/**`\n      this.#ignore.add(ign)\n    }\n    const abs =\n      this.opts.absolute === undefined ? absolute : this.opts.absolute\n    this.seen.add(e)\n    const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''\n    // ok, we have what we need!\n    if (this.opts.withFileTypes) {\n      this.matchEmit(e)\n    } else if (abs) {\n      const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath()\n      this.matchEmit(abs + mark)\n    } else {\n      const rel = this.opts.posix ? e.relativePosix() : e.relative()\n      const pre =\n        this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ?\n          '.' + this.#sep\n        : ''\n      this.matchEmit(!rel ? '.' + mark : pre + rel + mark)\n    }\n  }\n\n  async match(e: Path, absolute: boolean, ifDir: boolean): Promise {\n    const p = await this.matchCheck(e, ifDir)\n    if (p) this.matchFinish(p, absolute)\n  }\n\n  matchSync(e: Path, absolute: boolean, ifDir: boolean): void {\n    const p = this.matchCheckSync(e, ifDir)\n    if (p) this.matchFinish(p, absolute)\n  }\n\n  walkCB(target: Path, patterns: Pattern[], cb: () => any) {\n    /* c8 ignore start */\n    if (this.signal?.aborted) cb()\n    /* c8 ignore stop */\n    this.walkCB2(target, patterns, new Processor(this.opts), cb)\n  }\n\n  walkCB2(\n    target: Path,\n    patterns: Pattern[],\n    processor: Processor,\n    cb: () => any,\n  ) {\n    if (this.#childrenIgnored(target)) return cb()\n    if (this.signal?.aborted) cb()\n    if (this.paused) {\n      this.onResume(() => this.walkCB2(target, patterns, processor, cb))\n      return\n    }\n    processor.processPatterns(target, patterns)\n\n    // done processing.  all of the above is sync, can be abstracted out.\n    // subwalks is a map of paths to the entry filters they need\n    // matches is a map of paths to [absolute, ifDir] tuples.\n    let tasks = 1\n    const next = () => {\n      if (--tasks === 0) cb()\n    }\n\n    for (const [m, absolute, ifDir] of processor.matches.entries()) {\n      if (this.#ignored(m)) continue\n      tasks++\n      this.match(m, absolute, ifDir).then(() => next())\n    }\n\n    for (const t of processor.subwalkTargets()) {\n      if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n        continue\n      }\n      tasks++\n      const childrenCached = t.readdirCached()\n      if (t.calledReaddir())\n        this.walkCB3(t, childrenCached, processor, next)\n      else {\n        t.readdirCB(\n          (_, entries) => this.walkCB3(t, entries, processor, next),\n          true,\n        )\n      }\n    }\n\n    next()\n  }\n\n  walkCB3(\n    target: Path,\n    entries: Path[],\n    processor: Processor,\n    cb: () => any,\n  ) {\n    processor = processor.filterEntries(target, entries)\n\n    let tasks = 1\n    const next = () => {\n      if (--tasks === 0) cb()\n    }\n\n    for (const [m, absolute, ifDir] of processor.matches.entries()) {\n      if (this.#ignored(m)) continue\n      tasks++\n      this.match(m, absolute, ifDir).then(() => next())\n    }\n    for (const [target, patterns] of processor.subwalks.entries()) {\n      tasks++\n      this.walkCB2(target, patterns, processor.child(), next)\n    }\n\n    next()\n  }\n\n  walkCBSync(target: Path, patterns: Pattern[], cb: () => any) {\n    /* c8 ignore start */\n    if (this.signal?.aborted) cb()\n    /* c8 ignore stop */\n    this.walkCB2Sync(target, patterns, new Processor(this.opts), cb)\n  }\n\n  walkCB2Sync(\n    target: Path,\n    patterns: Pattern[],\n    processor: Processor,\n    cb: () => any,\n  ) {\n    if (this.#childrenIgnored(target)) return cb()\n    if (this.signal?.aborted) cb()\n    if (this.paused) {\n      this.onResume(() =>\n        this.walkCB2Sync(target, patterns, processor, cb),\n      )\n      return\n    }\n    processor.processPatterns(target, patterns)\n\n    // done processing.  all of the above is sync, can be abstracted out.\n    // subwalks is a map of paths to the entry filters they need\n    // matches is a map of paths to [absolute, ifDir] tuples.\n    let tasks = 1\n    const next = () => {\n      if (--tasks === 0) cb()\n    }\n\n    for (const [m, absolute, ifDir] of processor.matches.entries()) {\n      if (this.#ignored(m)) continue\n      this.matchSync(m, absolute, ifDir)\n    }\n\n    for (const t of processor.subwalkTargets()) {\n      if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n        continue\n      }\n      tasks++\n      const children = t.readdirSync()\n      this.walkCB3Sync(t, children, processor, next)\n    }\n\n    next()\n  }\n\n  walkCB3Sync(\n    target: Path,\n    entries: Path[],\n    processor: Processor,\n    cb: () => any,\n  ) {\n    processor = processor.filterEntries(target, entries)\n\n    let tasks = 1\n    const next = () => {\n      if (--tasks === 0) cb()\n    }\n\n    for (const [m, absolute, ifDir] of processor.matches.entries()) {\n      if (this.#ignored(m)) continue\n      this.matchSync(m, absolute, ifDir)\n    }\n    for (const [target, patterns] of processor.subwalks.entries()) {\n      tasks++\n      this.walkCB2Sync(target, patterns, processor.child(), next)\n    }\n\n    next()\n  }\n}\n\nexport class GlobWalker<\n  O extends GlobWalkerOpts = GlobWalkerOpts,\n> extends GlobUtil {\n  matches = new Set>()\n\n  constructor(patterns: Pattern[], path: Path, opts: O) {\n    super(patterns, path, opts)\n  }\n\n  matchEmit(e: Result): void {\n    this.matches.add(e)\n  }\n\n  async walk(): Promise>> {\n    if (this.signal?.aborted) throw this.signal.reason\n    if (this.path.isUnknown()) {\n      await this.path.lstat()\n    }\n    await new Promise((res, rej) => {\n      this.walkCB(this.path, this.patterns, () => {\n        if (this.signal?.aborted) {\n          rej(this.signal.reason)\n        } else {\n          res(this.matches)\n        }\n      })\n    })\n    return this.matches\n  }\n\n  walkSync(): Set> {\n    if (this.signal?.aborted) throw this.signal.reason\n    if (this.path.isUnknown()) {\n      this.path.lstatSync()\n    }\n    // nothing for the callback to do, because this never pauses\n    this.walkCBSync(this.path, this.patterns, () => {\n      if (this.signal?.aborted) throw this.signal.reason\n    })\n    return this.matches\n  }\n}\n\nexport class GlobStream<\n  O extends GlobWalkerOpts = GlobWalkerOpts,\n> extends GlobUtil {\n  results: Minipass, Result>\n\n  constructor(patterns: Pattern[], path: Path, opts: O) {\n    super(patterns, path, opts)\n    this.results = new Minipass, Result>({\n      signal: this.signal,\n      objectMode: true,\n    })\n    this.results.on('drain', () => this.resume())\n    this.results.on('resume', () => this.resume())\n  }\n\n  matchEmit(e: Result): void {\n    this.results.write(e)\n    if (!this.results.flowing) this.pause()\n  }\n\n  stream(): MatchStream {\n    const target = this.path\n    if (target.isUnknown()) {\n      target.lstat().then(() => {\n        this.walkCB(target, this.patterns, () => this.results.end())\n      })\n    } else {\n      this.walkCB(target, this.patterns, () => this.results.end())\n    }\n    return this.results\n  }\n\n  streamSync(): MatchStream {\n    if (this.path.isUnknown()) {\n      this.path.lstatSync()\n    }\n    this.walkCBSync(this.path, this.patterns, () => this.results.end())\n    return this.results\n  }\n}\n","import { Minimatch, MinimatchOptions } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport { fileURLToPath } from 'node:url'\nimport {\n  FSOption,\n  Path,\n  PathScurry,\n  PathScurryDarwin,\n  PathScurryPosix,\n  PathScurryWin32,\n} from 'path-scurry'\nimport { IgnoreLike } from './ignore.js'\nimport { Pattern } from './pattern.js'\nimport { GlobStream, GlobWalker } from './walker.js'\n\nexport type MatchSet = Minimatch['set']\nexport type GlobParts = Exclude\n\n// if no process global, just call it linux.\n// so we default to case-sensitive, / separators\nconst defaultPlatform: NodeJS.Platform =\n  (\n    typeof process === 'object' &&\n    process &&\n    typeof process.platform === 'string'\n  ) ?\n    process.platform\n  : 'linux'\n\n/**\n * A `GlobOptions` object may be provided to any of the exported methods, and\n * must be provided to the `Glob` constructor.\n *\n * All options are optional, boolean, and false by default, unless otherwise\n * noted.\n *\n * All resolved options are added to the Glob object as properties.\n *\n * If you are running many `glob` operations, you can pass a Glob object as the\n * `options` argument to a subsequent operation to share the previously loaded\n * cache.\n */\nexport interface GlobOptions {\n  /**\n   * Set to `true` to always receive absolute paths for\n   * matched files. Set to `false` to always return relative paths.\n   *\n   * When this option is not set, absolute paths are returned for patterns\n   * that are absolute, and otherwise paths are returned that are relative\n   * to the `cwd` setting.\n   *\n   * This does _not_ make an extra system call to get\n   * the realpath, it only does string path resolution.\n   *\n   * Conflicts with {@link withFileTypes}\n   */\n  absolute?: boolean\n\n  /**\n   * Set to false to enable {@link windowsPathsNoEscape}\n   *\n   * @deprecated\n   */\n  allowWindowsEscape?: boolean\n\n  /**\n   * The current working directory in which to search. Defaults to\n   * `process.cwd()`.\n   *\n   * May be eiher a string path or a `file://` URL object or string.\n   */\n  cwd?: string | URL\n\n  /**\n   * Include `.dot` files in normal matches and `globstar`\n   * matches. Note that an explicit dot in a portion of the pattern\n   * will always match dot files.\n   */\n  dot?: boolean\n\n  /**\n   * Prepend all relative path strings with `./` (or `.\\` on Windows).\n   *\n   * Without this option, returned relative paths are \"bare\", so instead of\n   * returning `'./foo/bar'`, they are returned as `'foo/bar'`.\n   *\n   * Relative patterns starting with `'../'` are not prepended with `./`, even\n   * if this option is set.\n   */\n  dotRelative?: boolean\n\n  /**\n   * Follow symlinked directories when expanding `**`\n   * patterns. This can result in a lot of duplicate references in\n   * the presence of cyclic links, and make performance quite bad.\n   *\n   * By default, a `**` in a pattern will follow 1 symbolic link if\n   * it is not the first item in the pattern, or none if it is the\n   * first item in the pattern, following the same behavior as Bash.\n   */\n  follow?: boolean\n\n  /**\n   * string or string[], or an object with `ignore` and `ignoreChildren`\n   * methods.\n   *\n   * If a string or string[] is provided, then this is treated as a glob\n   * pattern or array of glob patterns to exclude from matches. To ignore all\n   * children within a directory, as well as the entry itself, append `'/**'`\n   * to the ignore pattern.\n   *\n   * **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of\n   * any other settings.\n   *\n   * If an object is provided that has `ignored(path)` and/or\n   * `childrenIgnored(path)` methods, then these methods will be called to\n   * determine whether any Path is a match or if its children should be\n   * traversed, respectively.\n   */\n  ignore?: string | string[] | IgnoreLike\n\n  /**\n   * Treat brace expansion like `{a,b}` as a \"magic\" pattern. Has no\n   * effect if {@link nobrace} is set.\n   *\n   * Only has effect on the {@link hasMagic} function.\n   */\n  magicalBraces?: boolean\n\n  /**\n   * Add a `/` character to directory matches. Note that this requires\n   * additional stat calls in some cases.\n   */\n  mark?: boolean\n\n  /**\n   * Perform a basename-only match if the pattern does not contain any slash\n   * characters. That is, `*.js` would be treated as equivalent to\n   * `**\\/*.js`, matching all js files in all directories.\n   */\n  matchBase?: boolean\n\n  /**\n   * Limit the directory traversal to a given depth below the cwd.\n   * Note that this does NOT prevent traversal to sibling folders,\n   * root patterns, and so on. It only limits the maximum folder depth\n   * that the walk will descend, relative to the cwd.\n   */\n  maxDepth?: number\n\n  /**\n   * Do not expand `{a,b}` and `{1..3}` brace sets.\n   */\n  nobrace?: boolean\n\n  /**\n   * Perform a case-insensitive match. This defaults to `true` on macOS and\n   * Windows systems, and `false` on all others.\n   *\n   * **Note** `nocase` should only be explicitly set when it is\n   * known that the filesystem's case sensitivity differs from the\n   * platform default. If set `true` on case-sensitive file\n   * systems, or `false` on case-insensitive file systems, then the\n   * walk may return more or less results than expected.\n   */\n  nocase?: boolean\n\n  /**\n   * Do not match directories, only files. (Note: to match\n   * _only_ directories, put a `/` at the end of the pattern.)\n   */\n  nodir?: boolean\n\n  /**\n   * Do not match \"extglob\" patterns such as `+(a|b)`.\n   */\n  noext?: boolean\n\n  /**\n   * Do not match `**` against multiple filenames. (Ie, treat it as a normal\n   * `*` instead.)\n   *\n   * Conflicts with {@link matchBase}\n   */\n  noglobstar?: boolean\n\n  /**\n   * Defaults to value of `process.platform` if available, or `'linux'` if\n   * not. Setting `platform:'win32'` on non-Windows systems may cause strange\n   * behavior.\n   */\n  platform?: NodeJS.Platform\n\n  /**\n   * Set to true to call `fs.realpath` on all of the\n   * results. In the case of an entry that cannot be resolved, the\n   * entry is omitted. This incurs a slight performance penalty, of\n   * course, because of the added system calls.\n   */\n  realpath?: boolean\n\n  /**\n   *\n   * A string path resolved against the `cwd` option, which\n   * is used as the starting point for absolute patterns that start\n   * with `/`, (but not drive letters or UNC paths on Windows).\n   *\n   * Note that this _doesn't_ necessarily limit the walk to the\n   * `root` directory, and doesn't affect the cwd starting point for\n   * non-absolute patterns. A pattern containing `..` will still be\n   * able to traverse out of the root directory, if it is not an\n   * actual root directory on the filesystem, and any non-absolute\n   * patterns will be matched in the `cwd`. For example, the\n   * pattern `/../*` with `{root:'/some/path'}` will return all\n   * files in `/some`, not all files in `/some/path`. The pattern\n   * `*` with `{root:'/some/path'}` will return all the entries in\n   * the cwd, not the entries in `/some/path`.\n   *\n   * To start absolute and non-absolute patterns in the same\n   * path, you can use `{root:''}`. However, be aware that on\n   * Windows systems, a pattern like `x:/*` or `//host/share/*` will\n   * _always_ start in the `x:/` or `//host/share` directory,\n   * regardless of the `root` setting.\n   */\n  root?: string\n\n  /**\n   * A [PathScurry](http://npm.im/path-scurry) object used\n   * to traverse the file system. If the `nocase` option is set\n   * explicitly, then any provided `scurry` object must match this\n   * setting.\n   */\n  scurry?: PathScurry\n\n  /**\n   * Call `lstat()` on all entries, whether required or not to determine\n   * if it's a valid match. When used with {@link withFileTypes}, this means\n   * that matches will include data such as modified time, permissions, and\n   * so on.  Note that this will incur a performance cost due to the added\n   * system calls.\n   */\n  stat?: boolean\n\n  /**\n   * An AbortSignal which will cancel the Glob walk when\n   * triggered.\n   */\n  signal?: AbortSignal\n\n  /**\n   * Use `\\\\` as a path separator _only_, and\n   *  _never_ as an escape character. If set, all `\\\\` characters are\n   *  replaced with `/` in the pattern.\n   *\n   *  Note that this makes it **impossible** to match against paths\n   *  containing literal glob pattern characters, but allows matching\n   *  with patterns constructed using `path.join()` and\n   *  `path.resolve()` on Windows platforms, mimicking the (buggy!)\n   *  behavior of Glob v7 and before on Windows. Please use with\n   *  caution, and be mindful of [the caveat below about Windows\n   *  paths](#windows). (For legacy reasons, this is also set if\n   *  `allowWindowsEscape` is set to the exact value `false`.)\n   */\n  windowsPathsNoEscape?: boolean\n\n  /**\n   * Return [PathScurry](http://npm.im/path-scurry)\n   * `Path` objects instead of strings. These are similar to a\n   * NodeJS `Dirent` object, but with additional methods and\n   * properties.\n   *\n   * Conflicts with {@link absolute}\n   */\n  withFileTypes?: boolean\n\n  /**\n   * An fs implementation to override some or all of the defaults.  See\n   * http://npm.im/path-scurry for details about what can be overridden.\n   */\n  fs?: FSOption\n\n  /**\n   * Just passed along to Minimatch.  Note that this makes all pattern\n   * matching operations slower and *extremely* noisy.\n   */\n  debug?: boolean\n\n  /**\n   * Return `/` delimited paths, even on Windows.\n   *\n   * On posix systems, this has no effect.  But, on Windows, it means that\n   * paths will be `/` delimited, and absolute paths will be their full\n   * resolved UNC forms, eg instead of `'C:\\\\foo\\\\bar'`, it would return\n   * `'//?/C:/foo/bar'`\n   */\n  posix?: boolean\n\n  /**\n   * Do not match any children of any matches. For example, the pattern\n   * `**\\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode.\n   *\n   * This is especially useful for cases like \"find all `node_modules`\n   * folders, but not the ones in `node_modules`\".\n   *\n   * In order to support this, the `Ignore` implementation must support an\n   * `add(pattern: string)` method. If using the default `Ignore` class, then\n   * this is fine, but if this is set to `false`, and a custom `Ignore` is\n   * provided that does not have an `add()` method, then it will throw an\n   * error.\n   *\n   * **Caveat** It *only* ignores matches that would be a descendant of a\n   * previous match, and only if that descendant is matched *after* the\n   * ancestor is encountered. Since the file system walk happens in\n   * indeterminate order, it's possible that a match will already be added\n   * before its ancestor, if multiple or braced patterns are used.\n   *\n   * For example:\n   *\n   * ```ts\n   * const results = await glob([\n   *   // likely to match first, since it's just a stat\n   *   'a/b/c/d/e/f',\n   *\n   *   // this pattern is more complicated! It must to various readdir()\n   *   // calls and test the results against a regular expression, and that\n   *   // is certainly going to take a little bit longer.\n   *   //\n   *   // So, later on, it encounters a match at 'a/b/c/d/e', but it's too\n   *   // late to ignore a/b/c/d/e/f, because it's already been emitted.\n   *   'a/[bdf]/?/[a-z]/*',\n   * ], { includeChildMatches: false })\n   * ```\n   *\n   * It's best to only set this to `false` if you can be reasonably sure that\n   * no components of the pattern will potentially match one another's file\n   * system descendants, or if the occasional included child entry will not\n   * cause problems.\n   *\n   * @default true\n   */\n  includeChildMatches?: boolean\n}\n\nexport type GlobOptionsWithFileTypesTrue = GlobOptions & {\n  withFileTypes: true\n  // string options not relevant if returning Path objects.\n  absolute?: undefined\n  mark?: undefined\n  posix?: undefined\n}\n\nexport type GlobOptionsWithFileTypesFalse = GlobOptions & {\n  withFileTypes?: false\n}\n\nexport type GlobOptionsWithFileTypesUnset = GlobOptions & {\n  withFileTypes?: undefined\n}\n\nexport type Result =\n  Opts extends GlobOptionsWithFileTypesTrue ? Path\n  : Opts extends GlobOptionsWithFileTypesFalse ? string\n  : Opts extends GlobOptionsWithFileTypesUnset ? string\n  : string | Path\nexport type Results = Result[]\n\nexport type FileTypes =\n  Opts extends GlobOptionsWithFileTypesTrue ? true\n  : Opts extends GlobOptionsWithFileTypesFalse ? false\n  : Opts extends GlobOptionsWithFileTypesUnset ? false\n  : boolean\n\n/**\n * An object that can perform glob pattern traversals.\n */\nexport class Glob implements GlobOptions {\n  absolute?: boolean\n  cwd: string\n  root?: string\n  dot: boolean\n  dotRelative: boolean\n  follow: boolean\n  ignore?: string | string[] | IgnoreLike\n  magicalBraces: boolean\n  mark?: boolean\n  matchBase: boolean\n  maxDepth: number\n  nobrace: boolean\n  nocase: boolean\n  nodir: boolean\n  noext: boolean\n  noglobstar: boolean\n  pattern: string[]\n  platform: NodeJS.Platform\n  realpath: boolean\n  scurry: PathScurry\n  stat: boolean\n  signal?: AbortSignal\n  windowsPathsNoEscape: boolean\n  withFileTypes: FileTypes\n  includeChildMatches: boolean\n\n  /**\n   * The options provided to the constructor.\n   */\n  opts: Opts\n\n  /**\n   * An array of parsed immutable {@link Pattern} objects.\n   */\n  patterns: Pattern[]\n\n  /**\n   * All options are stored as properties on the `Glob` object.\n   *\n   * See {@link GlobOptions} for full options descriptions.\n   *\n   * Note that a previous `Glob` object can be passed as the\n   * `GlobOptions` to another `Glob` instantiation to re-use settings\n   * and caches with a new pattern.\n   *\n   * Traversal functions can be called multiple times to run the walk\n   * again.\n   */\n  constructor(pattern: string | string[], opts: Opts) {\n    /* c8 ignore start */\n    if (!opts) throw new TypeError('glob options required')\n    /* c8 ignore stop */\n    this.withFileTypes = !!opts.withFileTypes as FileTypes\n    this.signal = opts.signal\n    this.follow = !!opts.follow\n    this.dot = !!opts.dot\n    this.dotRelative = !!opts.dotRelative\n    this.nodir = !!opts.nodir\n    this.mark = !!opts.mark\n    if (!opts.cwd) {\n      this.cwd = ''\n    } else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {\n      opts.cwd = fileURLToPath(opts.cwd)\n    }\n    this.cwd = opts.cwd || ''\n    this.root = opts.root\n    this.magicalBraces = !!opts.magicalBraces\n    this.nobrace = !!opts.nobrace\n    this.noext = !!opts.noext\n    this.realpath = !!opts.realpath\n    this.absolute = opts.absolute\n    this.includeChildMatches = opts.includeChildMatches !== false\n\n    this.noglobstar = !!opts.noglobstar\n    this.matchBase = !!opts.matchBase\n    this.maxDepth =\n      typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity\n    this.stat = !!opts.stat\n    this.ignore = opts.ignore\n\n    if (this.withFileTypes && this.absolute !== undefined) {\n      throw new Error('cannot set absolute and withFileTypes:true')\n    }\n\n    if (typeof pattern === 'string') {\n      pattern = [pattern]\n    }\n\n    this.windowsPathsNoEscape =\n      !!opts.windowsPathsNoEscape ||\n      (opts as { allowWindowsEscape?: boolean }).allowWindowsEscape ===\n        false\n\n    if (this.windowsPathsNoEscape) {\n      pattern = pattern.map(p => p.replace(/\\\\/g, '/'))\n    }\n\n    if (this.matchBase) {\n      if (opts.noglobstar) {\n        throw new TypeError('base matching requires globstar')\n      }\n      pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`))\n    }\n\n    this.pattern = pattern\n\n    this.platform = opts.platform || defaultPlatform\n    this.opts = { ...opts, platform: this.platform }\n    if (opts.scurry) {\n      this.scurry = opts.scurry\n      if (\n        opts.nocase !== undefined &&\n        opts.nocase !== opts.scurry.nocase\n      ) {\n        throw new Error('nocase option contradicts provided scurry option')\n      }\n    } else {\n      const Scurry =\n        opts.platform === 'win32' ? PathScurryWin32\n        : opts.platform === 'darwin' ? PathScurryDarwin\n        : opts.platform ? PathScurryPosix\n        : PathScurry\n      this.scurry = new Scurry(this.cwd, {\n        nocase: opts.nocase,\n        fs: opts.fs,\n      })\n    }\n    this.nocase = this.scurry.nocase\n\n    // If you do nocase:true on a case-sensitive file system, then\n    // we need to use regexps instead of strings for non-magic\n    // path portions, because statting `aBc` won't return results\n    // for the file `AbC` for example.\n    const nocaseMagicOnly =\n      this.platform === 'darwin' || this.platform === 'win32'\n\n    const mmo: MinimatchOptions = {\n      // default nocase based on platform\n      ...opts,\n      dot: this.dot,\n      matchBase: this.matchBase,\n      nobrace: this.nobrace,\n      nocase: this.nocase,\n      nocaseMagicOnly,\n      nocomment: true,\n      noext: this.noext,\n      nonegate: true,\n      optimizationLevel: 2,\n      platform: this.platform,\n      windowsPathsNoEscape: this.windowsPathsNoEscape,\n      debug: !!this.opts.debug,\n    }\n\n    const mms = this.pattern.map(p => new Minimatch(p, mmo))\n    const [matchSet, globParts] = mms.reduce(\n      (set: [MatchSet, GlobParts], m) => {\n        set[0].push(...m.set)\n        set[1].push(...m.globParts)\n        return set\n      },\n      [[], []],\n    )\n    this.patterns = matchSet.map((set, i) => {\n      const g = globParts[i]\n      /* c8 ignore start */\n      if (!g) throw new Error('invalid pattern object')\n      /* c8 ignore stop */\n      return new Pattern(set, g, 0, this.platform)\n    })\n  }\n\n  /**\n   * Returns a Promise that resolves to the results array.\n   */\n  async walk(): Promise>\n  async walk(): Promise<(string | Path)[]> {\n    // Walkers always return array of Path objects, so we just have to\n    // coerce them into the right shape.  It will have already called\n    // realpath() if the option was set to do so, so we know that's cached.\n    // start out knowing the cwd, at least\n    return [\n      ...(await new GlobWalker(this.patterns, this.scurry.cwd, {\n        ...this.opts,\n        maxDepth:\n          this.maxDepth !== Infinity ?\n            this.maxDepth + this.scurry.cwd.depth()\n          : Infinity,\n        platform: this.platform,\n        nocase: this.nocase,\n        includeChildMatches: this.includeChildMatches,\n      }).walk()),\n    ]\n  }\n\n  /**\n   * synchronous {@link Glob.walk}\n   */\n  walkSync(): Results\n  walkSync(): (string | Path)[] {\n    return [\n      ...new GlobWalker(this.patterns, this.scurry.cwd, {\n        ...this.opts,\n        maxDepth:\n          this.maxDepth !== Infinity ?\n            this.maxDepth + this.scurry.cwd.depth()\n          : Infinity,\n        platform: this.platform,\n        nocase: this.nocase,\n        includeChildMatches: this.includeChildMatches,\n      }).walkSync(),\n    ]\n  }\n\n  /**\n   * Stream results asynchronously.\n   */\n  stream(): Minipass, Result>\n  stream(): Minipass {\n    return new GlobStream(this.patterns, this.scurry.cwd, {\n      ...this.opts,\n      maxDepth:\n        this.maxDepth !== Infinity ?\n          this.maxDepth + this.scurry.cwd.depth()\n        : Infinity,\n      platform: this.platform,\n      nocase: this.nocase,\n      includeChildMatches: this.includeChildMatches,\n    }).stream()\n  }\n\n  /**\n   * Stream results synchronously.\n   */\n  streamSync(): Minipass, Result>\n  streamSync(): Minipass {\n    return new GlobStream(this.patterns, this.scurry.cwd, {\n      ...this.opts,\n      maxDepth:\n        this.maxDepth !== Infinity ?\n          this.maxDepth + this.scurry.cwd.depth()\n        : Infinity,\n      platform: this.platform,\n      nocase: this.nocase,\n      includeChildMatches: this.includeChildMatches,\n    }).streamSync()\n  }\n\n  /**\n   * Default sync iteration function. Returns a Generator that\n   * iterates over the results.\n   */\n  iterateSync(): Generator, void, void> {\n    return this.streamSync()[Symbol.iterator]()\n  }\n  [Symbol.iterator]() {\n    return this.iterateSync()\n  }\n\n  /**\n   * Default async iteration function. Returns an AsyncGenerator that\n   * iterates over the results.\n   */\n  iterate(): AsyncGenerator, void, void> {\n    return this.stream()[Symbol.asyncIterator]()\n  }\n  [Symbol.asyncIterator]() {\n    return this.iterate()\n  }\n}\n","import { Minimatch } from 'minimatch'\nimport { GlobOptions } from './glob.js'\n\n/**\n * Return true if the patterns provided contain any magic glob characters,\n * given the options provided.\n *\n * Brace expansion is not considered \"magic\" unless the `magicalBraces` option\n * is set, as brace expansion just turns one string into an array of strings.\n * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and\n * `'xby'` both do not contain any magic glob characters, and it's treated the\n * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`\n * is in the options, brace expansion _is_ treated as a pattern having magic.\n */\nexport const hasMagic = (\n  pattern: string | string[],\n  options: GlobOptions = {},\n): boolean => {\n  if (!Array.isArray(pattern)) {\n    pattern = [pattern]\n  }\n  for (const p of pattern) {\n    if (new Minimatch(p, options).hasMagic()) return true\n  }\n  return false\n}\n","import { escape, unescape } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport type {\n  GlobOptions,\n  GlobOptionsWithFileTypesFalse,\n  GlobOptionsWithFileTypesTrue,\n  GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nimport { Glob } from './glob.js'\nimport { hasMagic } from './has-magic.js'\n\nexport { escape, unescape } from 'minimatch'\nexport type {\n  FSOption,\n  Path,\n  WalkOptions,\n  WalkOptionsWithFileTypesTrue,\n  WalkOptionsWithFileTypesUnset,\n} from 'path-scurry'\nexport { Glob } from './glob.js'\nexport type {\n  GlobOptions,\n  GlobOptionsWithFileTypesFalse,\n  GlobOptionsWithFileTypesTrue,\n  GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nexport { hasMagic } from './has-magic.js'\nexport { Ignore } from './ignore.js'\nexport type { IgnoreLike } from './ignore.js'\nexport type { MatchStream } from './walker.js'\n\n/**\n * Syncronous form of {@link globStream}. Will read all the matches as fast as\n * you consume them, even all in a single tick if you consume them immediately,\n * but will still respond to backpressure if they're not consumed immediately.\n */\nexport function globStreamSync(\n  pattern: string | string[],\n  options: GlobOptionsWithFileTypesTrue,\n): Minipass\nexport function globStreamSync(\n  pattern: string | string[],\n  options: GlobOptionsWithFileTypesFalse,\n): Minipass\nexport function globStreamSync(\n  pattern: string | string[],\n  options: GlobOptionsWithFileTypesUnset,\n): Minipass\nexport function globStreamSync(\n  pattern: string | string[],\n  options: GlobOptions,\n): Minipass | Minipass\nexport function globStreamSync(\n  pattern: string | string[],\n  options: GlobOptions = {},\n) {\n  return new Glob(pattern, options).streamSync()\n}\n\n/**\n * Return a stream that emits all the strings or `Path` objects and\n * then emits `end` when completed.\n */\nexport function globStream(\n  pattern: string | string[],\n  options: GlobOptionsWithFileTypesFalse,\n): Minipass\nexport function globStream(\n  pattern: string | string[],\n  options: GlobOptionsWithFileTypesTrue,\n): Minipass\nexport function globStream(\n  pattern: string | string[],\n  options?: GlobOptionsWithFileTypesUnset | undefined,\n): Minipass\nexport function globStream(\n  pattern: string | string[],\n  options: GlobOptions,\n): Minipass | Minipass\nexport function globStream(\n  pattern: string | string[],\n  options: GlobOptions = {},\n) {\n  return new Glob(pattern, options).stream()\n}\n\n/**\n * Synchronous form of {@link glob}\n */\nexport function globSync(\n  pattern: string | string[],\n  options: GlobOptionsWithFileTypesFalse,\n): string[]\nexport function globSync(\n  pattern: string | string[],\n  options: GlobOptionsWithFileTypesTrue,\n): Path[]\nexport function globSync(\n  pattern: string | string[],\n  options?: GlobOptionsWithFileTypesUnset | undefined,\n): string[]\nexport function globSync(\n  pattern: string | string[],\n  options: GlobOptions,\n): Path[] | string[]\nexport function globSync(\n  pattern: string | string[],\n  options: GlobOptions = {},\n) {\n  return new Glob(pattern, options).walkSync()\n}\n\n/**\n * Perform an asynchronous glob search for the pattern(s) specified. Returns\n * [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the\n * {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for\n * full option descriptions.\n */\nasync function glob_(\n  pattern: string | string[],\n  options?: GlobOptionsWithFileTypesUnset | undefined,\n): Promise\nasync function glob_(\n  pattern: string | string[],\n  options: GlobOptionsWithFileTypesTrue,\n): Promise\nasync function glob_(\n  pattern: string | string[],\n  options: GlobOptionsWithFileTypesFalse,\n): Promise\nasync function glob_(\n  pattern: string | string[],\n  options: GlobOptions,\n): Promise\nasync function glob_(\n  pattern: string | string[],\n  options: GlobOptions = {},\n) {\n  return new Glob(pattern, options).walk()\n}\n\n/**\n * Return a sync iterator for walking glob pattern matches.\n */\nexport function globIterateSync(\n  pattern: string | string[],\n  options?: GlobOptionsWithFileTypesUnset | undefined,\n): Generator\nexport function globIterateSync(\n  pattern: string | string[],\n  options: GlobOptionsWithFileTypesTrue,\n): Generator\nexport function globIterateSync(\n  pattern: string | string[],\n  options: GlobOptionsWithFileTypesFalse,\n): Generator\nexport function globIterateSync(\n  pattern: string | string[],\n  options: GlobOptions,\n): Generator | Generator\nexport function globIterateSync(\n  pattern: string | string[],\n  options: GlobOptions = {},\n) {\n  return new Glob(pattern, options).iterateSync()\n}\n\n/**\n * Return an async iterator for walking glob pattern matches.\n */\nexport function globIterate(\n  pattern: string | string[],\n  options?: GlobOptionsWithFileTypesUnset | undefined,\n): AsyncGenerator\nexport function globIterate(\n  pattern: string | string[],\n  options: GlobOptionsWithFileTypesTrue,\n): AsyncGenerator\nexport function globIterate(\n  pattern: string | string[],\n  options: GlobOptionsWithFileTypesFalse,\n): AsyncGenerator\nexport function globIterate(\n  pattern: string | string[],\n  options: GlobOptions,\n): AsyncGenerator | AsyncGenerator\nexport function globIterate(\n  pattern: string | string[],\n  options: GlobOptions = {},\n) {\n  return new Glob(pattern, options).iterate()\n}\n\n// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc\nexport const streamSync = globStreamSync\nexport const stream = Object.assign(globStream, { sync: globStreamSync })\nexport const iterateSync = globIterateSync\nexport const iterate = Object.assign(globIterate, {\n  sync: globIterateSync,\n})\nexport const sync = Object.assign(globSync, {\n  stream: globStreamSync,\n  iterate: globIterateSync,\n})\n\nexport const glob = Object.assign(glob_, {\n  glob: glob_,\n  globSync,\n  sync,\n  globStream,\n  stream,\n  globStreamSync,\n  streamSync,\n  globIterate,\n  iterate,\n  globIterateSync,\n  iterateSync,\n  Glob,\n  hasMagic,\n  escape,\n  unescape,\n})\nglob.glob = glob\n","/**\n * archiver-utils\n *\n * Copyright (c) 2012-2014 Chris Talkington, contributors.\n * Licensed under the MIT license.\n * https://github.com/archiverjs/node-archiver/blob/master/LICENSE-MIT\n */\nvar fs = require('graceful-fs');\nvar path = require('path');\n\nvar flatten = require('lodash/flatten');\nvar difference = require('lodash/difference');\nvar union = require('lodash/union');\nvar isPlainObject = require('lodash/isPlainObject');\n\nvar glob = require('glob');\n\nvar file = module.exports = {};\n\nvar pathSeparatorRe = /[\\/\\\\]/g;\n\n// Process specified wildcard glob patterns or filenames against a\n// callback, excluding and uniquing files in the result set.\nvar processPatterns = function(patterns, fn) {\n  // Filepaths to return.\n  var result = [];\n  // Iterate over flattened patterns array.\n  flatten(patterns).forEach(function(pattern) {\n    // If the first character is ! it should be omitted\n    var exclusion = pattern.indexOf('!') === 0;\n    // If the pattern is an exclusion, remove the !\n    if (exclusion) { pattern = pattern.slice(1); }\n    // Find all matching files for this pattern.\n    var matches = fn(pattern);\n    if (exclusion) {\n      // If an exclusion, remove matching files.\n      result = difference(result, matches);\n    } else {\n      // Otherwise add matching files.\n      result = union(result, matches);\n    }\n  });\n  return result;\n};\n\n// True if the file path exists.\nfile.exists = function() {\n  var filepath = path.join.apply(path, arguments);\n  return fs.existsSync(filepath);\n};\n\n// Return an array of all file paths that match the given wildcard patterns.\nfile.expand = function(...args) {\n  // If the first argument is an options object, save those options to pass\n  // into the File.prototype.glob.sync method.\n  var options = isPlainObject(args[0]) ? args.shift() : {};\n  // Use the first argument if it's an Array, otherwise convert the arguments\n  // object to an array and use that.\n  var patterns = Array.isArray(args[0]) ? args[0] : args;\n  // Return empty set if there are no patterns or filepaths.\n  if (patterns.length === 0) { return []; }\n  // Return all matching filepaths.\n  var matches = processPatterns(patterns, function(pattern) {\n    // Find all matching files for this pattern.\n    return glob.sync(pattern, options);\n  });\n  // Filter result set?\n  if (options.filter) {\n    matches = matches.filter(function(filepath) {\n      filepath = path.join(options.cwd || '', filepath);\n      try {\n        if (typeof options.filter === 'function') {\n          return options.filter(filepath);\n        } else {\n          // If the file is of the right type and exists, this should work.\n          return fs.statSync(filepath)[options.filter]();\n        }\n      } catch(e) {\n        // Otherwise, it's probably not the right type.\n        return false;\n      }\n    });\n  }\n  return matches;\n};\n\n// Build a multi task \"files\" object dynamically.\nfile.expandMapping = function(patterns, destBase, options) {\n  options = Object.assign({\n    rename: function(destBase, destPath) {\n      return path.join(destBase || '', destPath);\n    }\n  }, options);\n  var files = [];\n  var fileByDest = {};\n  // Find all files matching pattern, using passed-in options.\n  file.expand(options, patterns).forEach(function(src) {\n    var destPath = src;\n    // Flatten?\n    if (options.flatten) {\n      destPath = path.basename(destPath);\n    }\n    // Change the extension?\n    if (options.ext) {\n      destPath = destPath.replace(/(\\.[^\\/]*)?$/, options.ext);\n    }\n    // Generate destination filename.\n    var dest = options.rename(destBase, destPath, options);\n    // Prepend cwd to src path if necessary.\n    if (options.cwd) { src = path.join(options.cwd, src); }\n    // Normalize filepaths to be unix-style.\n    dest = dest.replace(pathSeparatorRe, '/');\n    src = src.replace(pathSeparatorRe, '/');\n    // Map correct src path to dest path.\n    if (fileByDest[dest]) {\n      // If dest already exists, push this src onto that dest's src array.\n      fileByDest[dest].src.push(src);\n    } else {\n      // Otherwise create a new src-dest file mapping object.\n      files.push({\n        src: [src],\n        dest: dest,\n      });\n      // And store a reference for later use.\n      fileByDest[dest] = files[files.length - 1];\n    }\n  });\n  return files;\n};\n\n// reusing bits of grunt's multi-task source normalization\nfile.normalizeFilesArray = function(data) {\n  var files = [];\n\n  data.forEach(function(obj) {\n    var prop;\n    if ('src' in obj || 'dest' in obj) {\n      files.push(obj);\n    }\n  });\n\n  if (files.length === 0) {\n    return [];\n  }\n\n  files = _(files).chain().forEach(function(obj) {\n    if (!('src' in obj) || !obj.src) { return; }\n    // Normalize .src properties to flattened array.\n    if (Array.isArray(obj.src)) {\n      obj.src = flatten(obj.src);\n    } else {\n      obj.src = [obj.src];\n    }\n  }).map(function(obj) {\n    // Build options object, removing unwanted properties.\n    var expandOptions = Object.assign({}, obj);\n    delete expandOptions.src;\n    delete expandOptions.dest;\n\n    // Expand file mappings.\n    if (obj.expand) {\n      return file.expandMapping(obj.src, obj.dest, expandOptions).map(function(mapObj) {\n        // Copy obj properties to result.\n        var result = Object.assign({}, obj);\n        // Make a clone of the orig obj available.\n        result.orig = Object.assign({}, obj);\n        // Set .src and .dest, processing both as templates.\n        result.src = mapObj.src;\n        result.dest = mapObj.dest;\n        // Remove unwanted properties.\n        ['expand', 'cwd', 'flatten', 'rename', 'ext'].forEach(function(prop) {\n          delete result[prop];\n        });\n        return result;\n      });\n    }\n\n    // Copy obj properties to result, adding an .orig property.\n    var result = Object.assign({}, obj);\n    // Make a clone of the orig obj available.\n    result.orig = Object.assign({}, obj);\n\n    if ('src' in result) {\n      // Expose an expand-on-demand getter method as .src.\n      Object.defineProperty(result, 'src', {\n        enumerable: true,\n        get: function fn() {\n          var src;\n          if (!('result' in fn)) {\n            src = obj.src;\n            // If src is an array, flatten it. Otherwise, make it into an array.\n            src = Array.isArray(src) ? flatten(src) : [src];\n            // Expand src files, memoizing result.\n            fn.result = file.expand(expandOptions, src);\n          }\n          return fn.result;\n        }\n      });\n    }\n\n    if ('dest' in result) {\n      result.dest = obj.dest;\n    }\n\n    return result;\n  }).flatten().value();\n\n  return files;\n};\n","/**\n * archiver-utils\n *\n * Copyright (c) 2015 Chris Talkington.\n * Licensed under the MIT license.\n * https://github.com/archiverjs/archiver-utils/blob/master/LICENSE\n */\nvar fs = require('graceful-fs');\nvar path = require('path');\nvar isStream = require('is-stream');\nvar lazystream = require('lazystream');\nvar normalizePath = require('normalize-path');\nvar defaults = require('lodash/defaults');\n\nvar Stream = require('stream').Stream;\nvar PassThrough = require('readable-stream').PassThrough;\n\nvar utils = module.exports = {};\nutils.file = require('./file.js');\n\nutils.collectStream = function(source, callback) {\n  var collection = [];\n  var size = 0;\n\n  source.on('error', callback);\n\n  source.on('data', function(chunk) {\n    collection.push(chunk);\n    size += chunk.length;\n  });\n\n  source.on('end', function() {\n    var buf = Buffer.alloc(size);\n    var offset = 0;\n\n    collection.forEach(function(data) {\n      data.copy(buf, offset);\n      offset += data.length;\n    });\n\n    callback(null, buf);\n  });\n};\n\nutils.dateify = function(dateish) {\n  dateish = dateish || new Date();\n\n  if (dateish instanceof Date) {\n    dateish = dateish;\n  } else if (typeof dateish === 'string') {\n    dateish = new Date(dateish);\n  } else {\n    dateish = new Date();\n  }\n\n  return dateish;\n};\n\n// this is slightly different from lodash version\nutils.defaults = function(object, source, guard) {\n  var args = arguments;\n  args[0] = args[0] || {};\n\n  return defaults(...args);\n};\n\nutils.isStream = function(source) {\n  return isStream(source);\n};\n\nutils.lazyReadStream = function(filepath) {\n  return new lazystream.Readable(function() {\n    return fs.createReadStream(filepath);\n  });\n};\n\nutils.normalizeInputSource = function(source) {\n  if (source === null) {\n    return Buffer.alloc(0);\n  } else if (typeof source === 'string') {\n    return Buffer.from(source);\n  } else if (utils.isStream(source)) {\n    // Always pipe through a PassThrough stream to guarantee pausing the stream if it's already flowing,\n    // since it will only be processed in a (distant) future iteration of the event loop, and will lose\n    // data if already flowing now.\n    return source.pipe(new PassThrough());\n  }\n\n  return source;\n};\n\nutils.sanitizePath = function(filepath) {\n  return normalizePath(filepath, false).replace(/^\\w+:/, '').replace(/^(\\.\\.\\/|\\/)+/, '');\n};\n\nutils.trailingSlashIt = function(str) {\n  return str.slice(-1) !== '/' ? str + '/' : str;\n};\n\nutils.unixifyPath = function(filepath) {\n  return normalizePath(filepath, false).replace(/^\\w+:/, '');\n};\n\nutils.walkdir = function(dirpath, base, callback) {\n  var results = [];\n\n  if (typeof base === 'function') {\n    callback = base;\n    base = dirpath;\n  }\n\n  fs.readdir(dirpath, function(err, list) {\n    var i = 0;\n    var file;\n    var filepath;\n\n    if (err) {\n      return callback(err);\n    }\n\n    (function next() {\n      file = list[i++];\n\n      if (!file) {\n        return callback(null, results);\n      }\n\n      filepath = path.join(dirpath, file);\n\n      fs.stat(filepath, function(err, stats) {\n        results.push({\n          path: filepath,\n          relative: path.relative(base, filepath).replace(/\\\\/g, '/'),\n          stats: stats\n        });\n\n        if (stats && stats.isDirectory()) {\n          utils.walkdir(filepath, base, function(err, res) {\n\t    if(err){\n\t      return callback(err);\n\t    }\n\n            res.forEach(function(dirEntry) {\n              results.push(dirEntry);\n            });\n\t\t  \n            next();  \n          });\n        } else {\n          next();\n        }\n      });\n    })();\n  });\n};\n","/**\n * Archiver Core\n *\n * @ignore\n * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}\n * @copyright (c) 2012-2014 Chris Talkington, contributors.\n */\n\nvar util = require('util');\n\nconst ERROR_CODES = {\n  'ABORTED': 'archive was aborted',\n  'DIRECTORYDIRPATHREQUIRED': 'diretory dirpath argument must be a non-empty string value',\n  'DIRECTORYFUNCTIONINVALIDDATA': 'invalid data returned by directory custom data function',\n  'ENTRYNAMEREQUIRED': 'entry name must be a non-empty string value',\n  'FILEFILEPATHREQUIRED': 'file filepath argument must be a non-empty string value',\n  'FINALIZING': 'archive already finalizing',\n  'QUEUECLOSED': 'queue closed',\n  'NOENDMETHOD': 'no suitable finalize/end method defined by module',\n  'DIRECTORYNOTSUPPORTED': 'support for directory entries not defined by module',\n  'FORMATSET': 'archive format already set',\n  'INPUTSTEAMBUFFERREQUIRED': 'input source must be valid Stream or Buffer instance',\n  'MODULESET': 'module already set',\n  'SYMLINKNOTSUPPORTED': 'support for symlink entries not defined by module',\n  'SYMLINKFILEPATHREQUIRED': 'symlink filepath argument must be a non-empty string value',\n  'SYMLINKTARGETREQUIRED': 'symlink target argument must be a non-empty string value',\n  'ENTRYNOTSUPPORTED': 'entry not supported'\n};\n\nfunction ArchiverError(code, data) {\n  Error.captureStackTrace(this, this.constructor);\n  //this.name = this.constructor.name;\n  this.message = ERROR_CODES[code] || code;\n  this.code = code;\n  this.data = data;\n}\n\nutil.inherits(ArchiverError, Error);\n\nexports = module.exports = ArchiverError;","'use strict'\n\n/*\n  This file is a reduced and adapted version of the main lib/internal/per_context/primordials.js file defined at\n\n  https://github.com/nodejs/node/blob/main/lib/internal/per_context/primordials.js\n\n  Don't try to replace with the original file and keep it up to date with the upstream file.\n*/\n\n// This is a simplified version of AggregateError\nclass AggregateError extends Error {\n  constructor(errors) {\n    if (!Array.isArray(errors)) {\n      throw new TypeError(`Expected input to be an Array, got ${typeof errors}`)\n    }\n    let message = ''\n    for (let i = 0; i < errors.length; i++) {\n      message += `    ${errors[i].stack}\\n`\n    }\n    super(message)\n    this.name = 'AggregateError'\n    this.errors = errors\n  }\n}\nmodule.exports = {\n  AggregateError,\n  ArrayIsArray(self) {\n    return Array.isArray(self)\n  },\n  ArrayPrototypeIncludes(self, el) {\n    return self.includes(el)\n  },\n  ArrayPrototypeIndexOf(self, el) {\n    return self.indexOf(el)\n  },\n  ArrayPrototypeJoin(self, sep) {\n    return self.join(sep)\n  },\n  ArrayPrototypeMap(self, fn) {\n    return self.map(fn)\n  },\n  ArrayPrototypePop(self, el) {\n    return self.pop(el)\n  },\n  ArrayPrototypePush(self, el) {\n    return self.push(el)\n  },\n  ArrayPrototypeSlice(self, start, end) {\n    return self.slice(start, end)\n  },\n  Error,\n  FunctionPrototypeCall(fn, thisArgs, ...args) {\n    return fn.call(thisArgs, ...args)\n  },\n  FunctionPrototypeSymbolHasInstance(self, instance) {\n    return Function.prototype[Symbol.hasInstance].call(self, instance)\n  },\n  MathFloor: Math.floor,\n  Number,\n  NumberIsInteger: Number.isInteger,\n  NumberIsNaN: Number.isNaN,\n  NumberMAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER,\n  NumberMIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER,\n  NumberParseInt: Number.parseInt,\n  ObjectDefineProperties(self, props) {\n    return Object.defineProperties(self, props)\n  },\n  ObjectDefineProperty(self, name, prop) {\n    return Object.defineProperty(self, name, prop)\n  },\n  ObjectGetOwnPropertyDescriptor(self, name) {\n    return Object.getOwnPropertyDescriptor(self, name)\n  },\n  ObjectKeys(obj) {\n    return Object.keys(obj)\n  },\n  ObjectSetPrototypeOf(target, proto) {\n    return Object.setPrototypeOf(target, proto)\n  },\n  Promise,\n  PromisePrototypeCatch(self, fn) {\n    return self.catch(fn)\n  },\n  PromisePrototypeThen(self, thenFn, catchFn) {\n    return self.then(thenFn, catchFn)\n  },\n  PromiseReject(err) {\n    return Promise.reject(err)\n  },\n  PromiseResolve(val) {\n    return Promise.resolve(val)\n  },\n  ReflectApply: Reflect.apply,\n  RegExpPrototypeTest(self, value) {\n    return self.test(value)\n  },\n  SafeSet: Set,\n  String,\n  StringPrototypeSlice(self, start, end) {\n    return self.slice(start, end)\n  },\n  StringPrototypeToLowerCase(self) {\n    return self.toLowerCase()\n  },\n  StringPrototypeToUpperCase(self) {\n    return self.toUpperCase()\n  },\n  StringPrototypeTrim(self) {\n    return self.trim()\n  },\n  Symbol,\n  SymbolFor: Symbol.for,\n  SymbolAsyncIterator: Symbol.asyncIterator,\n  SymbolHasInstance: Symbol.hasInstance,\n  SymbolIterator: Symbol.iterator,\n  SymbolDispose: Symbol.dispose || Symbol('Symbol.dispose'),\n  SymbolAsyncDispose: Symbol.asyncDispose || Symbol('Symbol.asyncDispose'),\n  TypedArrayPrototypeSet(self, buf, len) {\n    return self.set(buf, len)\n  },\n  Boolean,\n  Uint8Array\n}\n","'use strict'\n\n/*\n  This file is a reduced and adapted version of the main lib/internal/util/inspect.js file defined at\n\n  https://github.com/nodejs/node/blob/main/lib/internal/util/inspect.js\n\n  Don't try to replace with the original file and keep it up to date with the upstream file.\n*/\nmodule.exports = {\n  format(format, ...args) {\n    // Simplified version of https://nodejs.org/api/util.html#utilformatformat-args\n    return format.replace(/%([sdifj])/g, function (...[_unused, type]) {\n      const replacement = args.shift()\n      if (type === 'f') {\n        return replacement.toFixed(6)\n      } else if (type === 'j') {\n        return JSON.stringify(replacement)\n      } else if (type === 's' && typeof replacement === 'object') {\n        const ctor = replacement.constructor !== Object ? replacement.constructor.name : ''\n        return `${ctor} {}`.trim()\n      } else {\n        return replacement.toString()\n      }\n    })\n  },\n  inspect(value) {\n    // Vastly simplified version of https://nodejs.org/api/util.html#utilinspectobject-options\n    switch (typeof value) {\n      case 'string':\n        if (value.includes(\"'\")) {\n          if (!value.includes('\"')) {\n            return `\"${value}\"`\n          } else if (!value.includes('`') && !value.includes('${')) {\n            return `\\`${value}\\``\n          }\n        }\n        return `'${value}'`\n      case 'number':\n        if (isNaN(value)) {\n          return 'NaN'\n        } else if (Object.is(value, -0)) {\n          return String(value)\n        }\n        return value\n      case 'bigint':\n        return `${String(value)}n`\n      case 'boolean':\n      case 'undefined':\n        return String(value)\n      case 'object':\n        return '{}'\n    }\n  }\n}\n","'use strict'\n\nconst { format, inspect } = require('./util/inspect')\nconst { AggregateError: CustomAggregateError } = require('./primordials')\n\n/*\n  This file is a reduced and adapted version of the main lib/internal/errors.js file defined at\n\n  https://github.com/nodejs/node/blob/main/lib/internal/errors.js\n\n  Don't try to replace with the original file and keep it up to date (starting from E(...) definitions)\n  with the upstream file.\n*/\n\nconst AggregateError = globalThis.AggregateError || CustomAggregateError\nconst kIsNodeError = Symbol('kIsNodeError')\nconst kTypes = [\n  'string',\n  'function',\n  'number',\n  'object',\n  // Accept 'Function' and 'Object' as alternative to the lower cased version.\n  'Function',\n  'Object',\n  'boolean',\n  'bigint',\n  'symbol'\n]\nconst classRegExp = /^([A-Z][a-z0-9]*)+$/\nconst nodeInternalPrefix = '__node_internal_'\nconst codes = {}\nfunction assert(value, message) {\n  if (!value) {\n    throw new codes.ERR_INTERNAL_ASSERTION(message)\n  }\n}\n\n// Only use this for integers! Decimal numbers do not work with this function.\nfunction addNumericalSeparator(val) {\n  let res = ''\n  let i = val.length\n  const start = val[0] === '-' ? 1 : 0\n  for (; i >= start + 4; i -= 3) {\n    res = `_${val.slice(i - 3, i)}${res}`\n  }\n  return `${val.slice(0, i)}${res}`\n}\nfunction getMessage(key, msg, args) {\n  if (typeof msg === 'function') {\n    assert(\n      msg.length <= args.length,\n      // Default options do not count.\n      `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`\n    )\n    return msg(...args)\n  }\n  const expectedLength = (msg.match(/%[dfijoOs]/g) || []).length\n  assert(\n    expectedLength === args.length,\n    `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`\n  )\n  if (args.length === 0) {\n    return msg\n  }\n  return format(msg, ...args)\n}\nfunction E(code, message, Base) {\n  if (!Base) {\n    Base = Error\n  }\n  class NodeError extends Base {\n    constructor(...args) {\n      super(getMessage(code, message, args))\n    }\n    toString() {\n      return `${this.name} [${code}]: ${this.message}`\n    }\n  }\n  Object.defineProperties(NodeError.prototype, {\n    name: {\n      value: Base.name,\n      writable: true,\n      enumerable: false,\n      configurable: true\n    },\n    toString: {\n      value() {\n        return `${this.name} [${code}]: ${this.message}`\n      },\n      writable: true,\n      enumerable: false,\n      configurable: true\n    }\n  })\n  NodeError.prototype.code = code\n  NodeError.prototype[kIsNodeError] = true\n  codes[code] = NodeError\n}\nfunction hideStackFrames(fn) {\n  // We rename the functions that will be hidden to cut off the stacktrace\n  // at the outermost one\n  const hidden = nodeInternalPrefix + fn.name\n  Object.defineProperty(fn, 'name', {\n    value: hidden\n  })\n  return fn\n}\nfunction aggregateTwoErrors(innerError, outerError) {\n  if (innerError && outerError && innerError !== outerError) {\n    if (Array.isArray(outerError.errors)) {\n      // If `outerError` is already an `AggregateError`.\n      outerError.errors.push(innerError)\n      return outerError\n    }\n    const err = new AggregateError([outerError, innerError], outerError.message)\n    err.code = outerError.code\n    return err\n  }\n  return innerError || outerError\n}\nclass AbortError extends Error {\n  constructor(message = 'The operation was aborted', options = undefined) {\n    if (options !== undefined && typeof options !== 'object') {\n      throw new codes.ERR_INVALID_ARG_TYPE('options', 'Object', options)\n    }\n    super(message, options)\n    this.code = 'ABORT_ERR'\n    this.name = 'AbortError'\n  }\n}\nE('ERR_ASSERTION', '%s', Error)\nE(\n  'ERR_INVALID_ARG_TYPE',\n  (name, expected, actual) => {\n    assert(typeof name === 'string', \"'name' must be a string\")\n    if (!Array.isArray(expected)) {\n      expected = [expected]\n    }\n    let msg = 'The '\n    if (name.endsWith(' argument')) {\n      // For cases like 'first argument'\n      msg += `${name} `\n    } else {\n      msg += `\"${name}\" ${name.includes('.') ? 'property' : 'argument'} `\n    }\n    msg += 'must be '\n    const types = []\n    const instances = []\n    const other = []\n    for (const value of expected) {\n      assert(typeof value === 'string', 'All expected entries have to be of type string')\n      if (kTypes.includes(value)) {\n        types.push(value.toLowerCase())\n      } else if (classRegExp.test(value)) {\n        instances.push(value)\n      } else {\n        assert(value !== 'object', 'The value \"object\" should be written as \"Object\"')\n        other.push(value)\n      }\n    }\n\n    // Special handle `object` in case other instances are allowed to outline\n    // the differences between each other.\n    if (instances.length > 0) {\n      const pos = types.indexOf('object')\n      if (pos !== -1) {\n        types.splice(types, pos, 1)\n        instances.push('Object')\n      }\n    }\n    if (types.length > 0) {\n      switch (types.length) {\n        case 1:\n          msg += `of type ${types[0]}`\n          break\n        case 2:\n          msg += `one of type ${types[0]} or ${types[1]}`\n          break\n        default: {\n          const last = types.pop()\n          msg += `one of type ${types.join(', ')}, or ${last}`\n        }\n      }\n      if (instances.length > 0 || other.length > 0) {\n        msg += ' or '\n      }\n    }\n    if (instances.length > 0) {\n      switch (instances.length) {\n        case 1:\n          msg += `an instance of ${instances[0]}`\n          break\n        case 2:\n          msg += `an instance of ${instances[0]} or ${instances[1]}`\n          break\n        default: {\n          const last = instances.pop()\n          msg += `an instance of ${instances.join(', ')}, or ${last}`\n        }\n      }\n      if (other.length > 0) {\n        msg += ' or '\n      }\n    }\n    switch (other.length) {\n      case 0:\n        break\n      case 1:\n        if (other[0].toLowerCase() !== other[0]) {\n          msg += 'an '\n        }\n        msg += `${other[0]}`\n        break\n      case 2:\n        msg += `one of ${other[0]} or ${other[1]}`\n        break\n      default: {\n        const last = other.pop()\n        msg += `one of ${other.join(', ')}, or ${last}`\n      }\n    }\n    if (actual == null) {\n      msg += `. Received ${actual}`\n    } else if (typeof actual === 'function' && actual.name) {\n      msg += `. Received function ${actual.name}`\n    } else if (typeof actual === 'object') {\n      var _actual$constructor\n      if (\n        (_actual$constructor = actual.constructor) !== null &&\n        _actual$constructor !== undefined &&\n        _actual$constructor.name\n      ) {\n        msg += `. Received an instance of ${actual.constructor.name}`\n      } else {\n        const inspected = inspect(actual, {\n          depth: -1\n        })\n        msg += `. Received ${inspected}`\n      }\n    } else {\n      let inspected = inspect(actual, {\n        colors: false\n      })\n      if (inspected.length > 25) {\n        inspected = `${inspected.slice(0, 25)}...`\n      }\n      msg += `. Received type ${typeof actual} (${inspected})`\n    }\n    return msg\n  },\n  TypeError\n)\nE(\n  'ERR_INVALID_ARG_VALUE',\n  (name, value, reason = 'is invalid') => {\n    let inspected = inspect(value)\n    if (inspected.length > 128) {\n      inspected = inspected.slice(0, 128) + '...'\n    }\n    const type = name.includes('.') ? 'property' : 'argument'\n    return `The ${type} '${name}' ${reason}. Received ${inspected}`\n  },\n  TypeError\n)\nE(\n  'ERR_INVALID_RETURN_VALUE',\n  (input, name, value) => {\n    var _value$constructor\n    const type =\n      value !== null &&\n      value !== undefined &&\n      (_value$constructor = value.constructor) !== null &&\n      _value$constructor !== undefined &&\n      _value$constructor.name\n        ? `instance of ${value.constructor.name}`\n        : `type ${typeof value}`\n    return `Expected ${input} to be returned from the \"${name}\"` + ` function but got ${type}.`\n  },\n  TypeError\n)\nE(\n  'ERR_MISSING_ARGS',\n  (...args) => {\n    assert(args.length > 0, 'At least one arg needs to be specified')\n    let msg\n    const len = args.length\n    args = (Array.isArray(args) ? args : [args]).map((a) => `\"${a}\"`).join(' or ')\n    switch (len) {\n      case 1:\n        msg += `The ${args[0]} argument`\n        break\n      case 2:\n        msg += `The ${args[0]} and ${args[1]} arguments`\n        break\n      default:\n        {\n          const last = args.pop()\n          msg += `The ${args.join(', ')}, and ${last} arguments`\n        }\n        break\n    }\n    return `${msg} must be specified`\n  },\n  TypeError\n)\nE(\n  'ERR_OUT_OF_RANGE',\n  (str, range, input) => {\n    assert(range, 'Missing \"range\" argument')\n    let received\n    if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n      received = addNumericalSeparator(String(input))\n    } else if (typeof input === 'bigint') {\n      received = String(input)\n      const limit = BigInt(2) ** BigInt(32)\n      if (input > limit || input < -limit) {\n        received = addNumericalSeparator(received)\n      }\n      received += 'n'\n    } else {\n      received = inspect(input)\n    }\n    return `The value of \"${str}\" is out of range. It must be ${range}. Received ${received}`\n  },\n  RangeError\n)\nE('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times', Error)\nE('ERR_METHOD_NOT_IMPLEMENTED', 'The %s method is not implemented', Error)\nE('ERR_STREAM_ALREADY_FINISHED', 'Cannot call %s after a stream was finished', Error)\nE('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable', Error)\nE('ERR_STREAM_DESTROYED', 'Cannot call %s after a stream was destroyed', Error)\nE('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError)\nE('ERR_STREAM_PREMATURE_CLOSE', 'Premature close', Error)\nE('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF', Error)\nE('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event', Error)\nE('ERR_STREAM_WRITE_AFTER_END', 'write after end', Error)\nE('ERR_UNKNOWN_ENCODING', 'Unknown encoding: %s', TypeError)\nmodule.exports = {\n  AbortError,\n  aggregateTwoErrors: hideStackFrames(aggregateTwoErrors),\n  hideStackFrames,\n  codes\n}\n","'use strict'\n\nconst bufferModule = require('buffer')\nconst { format, inspect } = require('./util/inspect')\nconst {\n  codes: { ERR_INVALID_ARG_TYPE }\n} = require('./errors')\nconst { kResistStopPropagation, AggregateError, SymbolDispose } = require('./primordials')\nconst AbortSignal = globalThis.AbortSignal || require('abort-controller').AbortSignal\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nconst AsyncFunction = Object.getPrototypeOf(async function () {}).constructor\nconst Blob = globalThis.Blob || bufferModule.Blob\n/* eslint-disable indent */\nconst isBlob =\n  typeof Blob !== 'undefined'\n    ? function isBlob(b) {\n        // eslint-disable-next-line indent\n        return b instanceof Blob\n      }\n    : function isBlob(b) {\n        return false\n      }\n/* eslint-enable indent */\n\nconst validateAbortSignal = (signal, name) => {\n  if (signal !== undefined && (signal === null || typeof signal !== 'object' || !('aborted' in signal))) {\n    throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal)\n  }\n}\nconst validateFunction = (value, name) => {\n  if (typeof value !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)\n  }\n}\nmodule.exports = {\n  AggregateError,\n  kEmptyObject: Object.freeze({}),\n  once(callback) {\n    let called = false\n    return function (...args) {\n      if (called) {\n        return\n      }\n      called = true\n      callback.apply(this, args)\n    }\n  },\n  createDeferredPromise: function () {\n    let resolve\n    let reject\n\n    // eslint-disable-next-line promise/param-names\n    const promise = new Promise((res, rej) => {\n      resolve = res\n      reject = rej\n    })\n    return {\n      promise,\n      resolve,\n      reject\n    }\n  },\n  promisify(fn) {\n    return new Promise((resolve, reject) => {\n      fn((err, ...args) => {\n        if (err) {\n          return reject(err)\n        }\n        return resolve(...args)\n      })\n    })\n  },\n  debuglog() {\n    return function () {}\n  },\n  format,\n  inspect,\n  types: {\n    isAsyncFunction(fn) {\n      return fn instanceof AsyncFunction\n    },\n    isArrayBufferView(arr) {\n      return ArrayBuffer.isView(arr)\n    }\n  },\n  isBlob,\n  deprecate(fn, message) {\n    return fn\n  },\n  addAbortListener:\n    require('events').addAbortListener ||\n    function addAbortListener(signal, listener) {\n      if (signal === undefined) {\n        throw new ERR_INVALID_ARG_TYPE('signal', 'AbortSignal', signal)\n      }\n      validateAbortSignal(signal, 'signal')\n      validateFunction(listener, 'listener')\n      let removeEventListener\n      if (signal.aborted) {\n        queueMicrotask(() => listener())\n      } else {\n        signal.addEventListener('abort', listener, {\n          __proto__: null,\n          once: true,\n          [kResistStopPropagation]: true\n        })\n        removeEventListener = () => {\n          signal.removeEventListener('abort', listener)\n        }\n      }\n      return {\n        __proto__: null,\n        [SymbolDispose]() {\n          var _removeEventListener\n          ;(_removeEventListener = removeEventListener) === null || _removeEventListener === undefined\n            ? undefined\n            : _removeEventListener()\n        }\n      }\n    },\n  AbortSignalAny:\n    AbortSignal.any ||\n    function AbortSignalAny(signals) {\n      // Fast path if there is only one signal.\n      if (signals.length === 1) {\n        return signals[0]\n      }\n      const ac = new AbortController()\n      const abort = () => ac.abort()\n      signals.forEach((signal) => {\n        validateAbortSignal(signal, 'signals')\n        signal.addEventListener('abort', abort, {\n          once: true\n        })\n      })\n      ac.signal.addEventListener(\n        'abort',\n        () => {\n          signals.forEach((signal) => signal.removeEventListener('abort', abort))\n        },\n        {\n          once: true\n        }\n      )\n      return ac.signal\n    }\n}\nmodule.exports.promisify.custom = Symbol.for('nodejs.util.promisify.custom')\n","/* eslint jsdoc/require-jsdoc: \"error\" */\n\n'use strict'\n\nconst {\n  ArrayIsArray,\n  ArrayPrototypeIncludes,\n  ArrayPrototypeJoin,\n  ArrayPrototypeMap,\n  NumberIsInteger,\n  NumberIsNaN,\n  NumberMAX_SAFE_INTEGER,\n  NumberMIN_SAFE_INTEGER,\n  NumberParseInt,\n  ObjectPrototypeHasOwnProperty,\n  RegExpPrototypeExec,\n  String,\n  StringPrototypeToUpperCase,\n  StringPrototypeTrim\n} = require('../ours/primordials')\nconst {\n  hideStackFrames,\n  codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL }\n} = require('../ours/errors')\nconst { normalizeEncoding } = require('../ours/util')\nconst { isAsyncFunction, isArrayBufferView } = require('../ours/util').types\nconst signals = {}\n\n/**\n * @param {*} value\n * @returns {boolean}\n */\nfunction isInt32(value) {\n  return value === (value | 0)\n}\n\n/**\n * @param {*} value\n * @returns {boolean}\n */\nfunction isUint32(value) {\n  return value === value >>> 0\n}\nconst octalReg = /^[0-7]+$/\nconst modeDesc = 'must be a 32-bit unsigned integer or an octal string'\n\n/**\n * Parse and validate values that will be converted into mode_t (the S_*\n * constants). Only valid numbers and octal strings are allowed. They could be\n * converted to 32-bit unsigned integers or non-negative signed integers in the\n * C++ land, but any value higher than 0o777 will result in platform-specific\n * behaviors.\n * @param {*} value Values to be validated\n * @param {string} name Name of the argument\n * @param {number} [def] If specified, will be returned for invalid values\n * @returns {number}\n */\nfunction parseFileMode(value, name, def) {\n  if (typeof value === 'undefined') {\n    value = def\n  }\n  if (typeof value === 'string') {\n    if (RegExpPrototypeExec(octalReg, value) === null) {\n      throw new ERR_INVALID_ARG_VALUE(name, value, modeDesc)\n    }\n    value = NumberParseInt(value, 8)\n  }\n  validateUint32(value, name)\n  return value\n}\n\n/**\n * @callback validateInteger\n * @param {*} value\n * @param {string} name\n * @param {number} [min]\n * @param {number} [max]\n * @returns {asserts value is number}\n */\n\n/** @type {validateInteger} */\nconst validateInteger = hideStackFrames((value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) => {\n  if (typeof value !== 'number') throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n  if (!NumberIsInteger(value)) throw new ERR_OUT_OF_RANGE(name, 'an integer', value)\n  if (value < min || value > max) throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value)\n})\n\n/**\n * @callback validateInt32\n * @param {*} value\n * @param {string} name\n * @param {number} [min]\n * @param {number} [max]\n * @returns {asserts value is number}\n */\n\n/** @type {validateInt32} */\nconst validateInt32 = hideStackFrames((value, name, min = -2147483648, max = 2147483647) => {\n  // The defaults for min and max correspond to the limits of 32-bit integers.\n  if (typeof value !== 'number') {\n    throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n  }\n  if (!NumberIsInteger(value)) {\n    throw new ERR_OUT_OF_RANGE(name, 'an integer', value)\n  }\n  if (value < min || value > max) {\n    throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value)\n  }\n})\n\n/**\n * @callback validateUint32\n * @param {*} value\n * @param {string} name\n * @param {number|boolean} [positive=false]\n * @returns {asserts value is number}\n */\n\n/** @type {validateUint32} */\nconst validateUint32 = hideStackFrames((value, name, positive = false) => {\n  if (typeof value !== 'number') {\n    throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n  }\n  if (!NumberIsInteger(value)) {\n    throw new ERR_OUT_OF_RANGE(name, 'an integer', value)\n  }\n  const min = positive ? 1 : 0\n  // 2 ** 32 === 4294967296\n  const max = 4294967295\n  if (value < min || value > max) {\n    throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value)\n  }\n})\n\n/**\n * @callback validateString\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is string}\n */\n\n/** @type {validateString} */\nfunction validateString(value, name) {\n  if (typeof value !== 'string') throw new ERR_INVALID_ARG_TYPE(name, 'string', value)\n}\n\n/**\n * @callback validateNumber\n * @param {*} value\n * @param {string} name\n * @param {number} [min]\n * @param {number} [max]\n * @returns {asserts value is number}\n */\n\n/** @type {validateNumber} */\nfunction validateNumber(value, name, min = undefined, max) {\n  if (typeof value !== 'number') throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n  if (\n    (min != null && value < min) ||\n    (max != null && value > max) ||\n    ((min != null || max != null) && NumberIsNaN(value))\n  ) {\n    throw new ERR_OUT_OF_RANGE(\n      name,\n      `${min != null ? `>= ${min}` : ''}${min != null && max != null ? ' && ' : ''}${max != null ? `<= ${max}` : ''}`,\n      value\n    )\n  }\n}\n\n/**\n * @callback validateOneOf\n * @template T\n * @param {T} value\n * @param {string} name\n * @param {T[]} oneOf\n */\n\n/** @type {validateOneOf} */\nconst validateOneOf = hideStackFrames((value, name, oneOf) => {\n  if (!ArrayPrototypeIncludes(oneOf, value)) {\n    const allowed = ArrayPrototypeJoin(\n      ArrayPrototypeMap(oneOf, (v) => (typeof v === 'string' ? `'${v}'` : String(v))),\n      ', '\n    )\n    const reason = 'must be one of: ' + allowed\n    throw new ERR_INVALID_ARG_VALUE(name, value, reason)\n  }\n})\n\n/**\n * @callback validateBoolean\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is boolean}\n */\n\n/** @type {validateBoolean} */\nfunction validateBoolean(value, name) {\n  if (typeof value !== 'boolean') throw new ERR_INVALID_ARG_TYPE(name, 'boolean', value)\n}\n\n/**\n * @param {any} options\n * @param {string} key\n * @param {boolean} defaultValue\n * @returns {boolean}\n */\nfunction getOwnPropertyValueOrDefault(options, key, defaultValue) {\n  return options == null || !ObjectPrototypeHasOwnProperty(options, key) ? defaultValue : options[key]\n}\n\n/**\n * @callback validateObject\n * @param {*} value\n * @param {string} name\n * @param {{\n *   allowArray?: boolean,\n *   allowFunction?: boolean,\n *   nullable?: boolean\n * }} [options]\n */\n\n/** @type {validateObject} */\nconst validateObject = hideStackFrames((value, name, options = null) => {\n  const allowArray = getOwnPropertyValueOrDefault(options, 'allowArray', false)\n  const allowFunction = getOwnPropertyValueOrDefault(options, 'allowFunction', false)\n  const nullable = getOwnPropertyValueOrDefault(options, 'nullable', false)\n  if (\n    (!nullable && value === null) ||\n    (!allowArray && ArrayIsArray(value)) ||\n    (typeof value !== 'object' && (!allowFunction || typeof value !== 'function'))\n  ) {\n    throw new ERR_INVALID_ARG_TYPE(name, 'Object', value)\n  }\n})\n\n/**\n * @callback validateDictionary - We are using the Web IDL Standard definition\n *                                of \"dictionary\" here, which means any value\n *                                whose Type is either Undefined, Null, or\n *                                Object (which includes functions).\n * @param {*} value\n * @param {string} name\n * @see https://webidl.spec.whatwg.org/#es-dictionary\n * @see https://tc39.es/ecma262/#table-typeof-operator-results\n */\n\n/** @type {validateDictionary} */\nconst validateDictionary = hideStackFrames((value, name) => {\n  if (value != null && typeof value !== 'object' && typeof value !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE(name, 'a dictionary', value)\n  }\n})\n\n/**\n * @callback validateArray\n * @param {*} value\n * @param {string} name\n * @param {number} [minLength]\n * @returns {asserts value is any[]}\n */\n\n/** @type {validateArray} */\nconst validateArray = hideStackFrames((value, name, minLength = 0) => {\n  if (!ArrayIsArray(value)) {\n    throw new ERR_INVALID_ARG_TYPE(name, 'Array', value)\n  }\n  if (value.length < minLength) {\n    const reason = `must be longer than ${minLength}`\n    throw new ERR_INVALID_ARG_VALUE(name, value, reason)\n  }\n})\n\n/**\n * @callback validateStringArray\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is string[]}\n */\n\n/** @type {validateStringArray} */\nfunction validateStringArray(value, name) {\n  validateArray(value, name)\n  for (let i = 0; i < value.length; i++) {\n    validateString(value[i], `${name}[${i}]`)\n  }\n}\n\n/**\n * @callback validateBooleanArray\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is boolean[]}\n */\n\n/** @type {validateBooleanArray} */\nfunction validateBooleanArray(value, name) {\n  validateArray(value, name)\n  for (let i = 0; i < value.length; i++) {\n    validateBoolean(value[i], `${name}[${i}]`)\n  }\n}\n\n/**\n * @callback validateAbortSignalArray\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is AbortSignal[]}\n */\n\n/** @type {validateAbortSignalArray} */\nfunction validateAbortSignalArray(value, name) {\n  validateArray(value, name)\n  for (let i = 0; i < value.length; i++) {\n    const signal = value[i]\n    const indexedName = `${name}[${i}]`\n    if (signal == null) {\n      throw new ERR_INVALID_ARG_TYPE(indexedName, 'AbortSignal', signal)\n    }\n    validateAbortSignal(signal, indexedName)\n  }\n}\n\n/**\n * @param {*} signal\n * @param {string} [name='signal']\n * @returns {asserts signal is keyof signals}\n */\nfunction validateSignalName(signal, name = 'signal') {\n  validateString(signal, name)\n  if (signals[signal] === undefined) {\n    if (signals[StringPrototypeToUpperCase(signal)] !== undefined) {\n      throw new ERR_UNKNOWN_SIGNAL(signal + ' (signals must use all capital letters)')\n    }\n    throw new ERR_UNKNOWN_SIGNAL(signal)\n  }\n}\n\n/**\n * @callback validateBuffer\n * @param {*} buffer\n * @param {string} [name='buffer']\n * @returns {asserts buffer is ArrayBufferView}\n */\n\n/** @type {validateBuffer} */\nconst validateBuffer = hideStackFrames((buffer, name = 'buffer') => {\n  if (!isArrayBufferView(buffer)) {\n    throw new ERR_INVALID_ARG_TYPE(name, ['Buffer', 'TypedArray', 'DataView'], buffer)\n  }\n})\n\n/**\n * @param {string} data\n * @param {string} encoding\n */\nfunction validateEncoding(data, encoding) {\n  const normalizedEncoding = normalizeEncoding(encoding)\n  const length = data.length\n  if (normalizedEncoding === 'hex' && length % 2 !== 0) {\n    throw new ERR_INVALID_ARG_VALUE('encoding', encoding, `is invalid for data of length ${length}`)\n  }\n}\n\n/**\n * Check that the port number is not NaN when coerced to a number,\n * is an integer and that it falls within the legal range of port numbers.\n * @param {*} port\n * @param {string} [name='Port']\n * @param {boolean} [allowZero=true]\n * @returns {number}\n */\nfunction validatePort(port, name = 'Port', allowZero = true) {\n  if (\n    (typeof port !== 'number' && typeof port !== 'string') ||\n    (typeof port === 'string' && StringPrototypeTrim(port).length === 0) ||\n    +port !== +port >>> 0 ||\n    port > 0xffff ||\n    (port === 0 && !allowZero)\n  ) {\n    throw new ERR_SOCKET_BAD_PORT(name, port, allowZero)\n  }\n  return port | 0\n}\n\n/**\n * @callback validateAbortSignal\n * @param {*} signal\n * @param {string} name\n */\n\n/** @type {validateAbortSignal} */\nconst validateAbortSignal = hideStackFrames((signal, name) => {\n  if (signal !== undefined && (signal === null || typeof signal !== 'object' || !('aborted' in signal))) {\n    throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal)\n  }\n})\n\n/**\n * @callback validateFunction\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is Function}\n */\n\n/** @type {validateFunction} */\nconst validateFunction = hideStackFrames((value, name) => {\n  if (typeof value !== 'function') throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)\n})\n\n/**\n * @callback validatePlainFunction\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is Function}\n */\n\n/** @type {validatePlainFunction} */\nconst validatePlainFunction = hideStackFrames((value, name) => {\n  if (typeof value !== 'function' || isAsyncFunction(value)) throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)\n})\n\n/**\n * @callback validateUndefined\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is undefined}\n */\n\n/** @type {validateUndefined} */\nconst validateUndefined = hideStackFrames((value, name) => {\n  if (value !== undefined) throw new ERR_INVALID_ARG_TYPE(name, 'undefined', value)\n})\n\n/**\n * @template T\n * @param {T} value\n * @param {string} name\n * @param {T[]} union\n */\nfunction validateUnion(value, name, union) {\n  if (!ArrayPrototypeIncludes(union, value)) {\n    throw new ERR_INVALID_ARG_TYPE(name, `('${ArrayPrototypeJoin(union, '|')}')`, value)\n  }\n}\n\n/*\n  The rules for the Link header field are described here:\n  https://www.rfc-editor.org/rfc/rfc8288.html#section-3\n\n  This regex validates any string surrounded by angle brackets\n  (not necessarily a valid URI reference) followed by zero or more\n  link-params separated by semicolons.\n*/\nconst linkValueRegExp = /^(?:<[^>]*>)(?:\\s*;\\s*[^;\"\\s]+(?:=(\")?[^;\"\\s]*\\1)?)*$/\n\n/**\n * @param {any} value\n * @param {string} name\n */\nfunction validateLinkHeaderFormat(value, name) {\n  if (typeof value === 'undefined' || !RegExpPrototypeExec(linkValueRegExp, value)) {\n    throw new ERR_INVALID_ARG_VALUE(\n      name,\n      value,\n      'must be an array or string of format \"; rel=preload; as=style\"'\n    )\n  }\n}\n\n/**\n * @param {any} hints\n * @return {string}\n */\nfunction validateLinkHeaderValue(hints) {\n  if (typeof hints === 'string') {\n    validateLinkHeaderFormat(hints, 'hints')\n    return hints\n  } else if (ArrayIsArray(hints)) {\n    const hintsLength = hints.length\n    let result = ''\n    if (hintsLength === 0) {\n      return result\n    }\n    for (let i = 0; i < hintsLength; i++) {\n      const link = hints[i]\n      validateLinkHeaderFormat(link, 'hints')\n      result += link\n      if (i !== hintsLength - 1) {\n        result += ', '\n      }\n    }\n    return result\n  }\n  throw new ERR_INVALID_ARG_VALUE(\n    'hints',\n    hints,\n    'must be an array or string of format \"; rel=preload; as=style\"'\n  )\n}\nmodule.exports = {\n  isInt32,\n  isUint32,\n  parseFileMode,\n  validateArray,\n  validateStringArray,\n  validateBooleanArray,\n  validateAbortSignalArray,\n  validateBoolean,\n  validateBuffer,\n  validateDictionary,\n  validateEncoding,\n  validateFunction,\n  validateInt32,\n  validateInteger,\n  validateNumber,\n  validateObject,\n  validateOneOf,\n  validatePlainFunction,\n  validatePort,\n  validateSignalName,\n  validateString,\n  validateUint32,\n  validateUndefined,\n  validateUnion,\n  validateAbortSignal,\n  validateLinkHeaderValue\n}\n","'use strict'\n\nconst { SymbolAsyncIterator, SymbolIterator, SymbolFor } = require('../../ours/primordials')\n\n// We need to use SymbolFor to make these globally available\n// for interopt with readable-stream, i.e. readable-stream\n// and node core needs to be able to read/write private state\n// from each other for proper interoperability.\nconst kIsDestroyed = SymbolFor('nodejs.stream.destroyed')\nconst kIsErrored = SymbolFor('nodejs.stream.errored')\nconst kIsReadable = SymbolFor('nodejs.stream.readable')\nconst kIsWritable = SymbolFor('nodejs.stream.writable')\nconst kIsDisturbed = SymbolFor('nodejs.stream.disturbed')\nconst kIsClosedPromise = SymbolFor('nodejs.webstream.isClosedPromise')\nconst kControllerErrorFunction = SymbolFor('nodejs.webstream.controllerErrorFunction')\nfunction isReadableNodeStream(obj, strict = false) {\n  var _obj$_readableState\n  return !!(\n    (\n      obj &&\n      typeof obj.pipe === 'function' &&\n      typeof obj.on === 'function' &&\n      (!strict || (typeof obj.pause === 'function' && typeof obj.resume === 'function')) &&\n      (!obj._writableState ||\n        ((_obj$_readableState = obj._readableState) === null || _obj$_readableState === undefined\n          ? undefined\n          : _obj$_readableState.readable) !== false) &&\n      // Duplex\n      (!obj._writableState || obj._readableState)\n    ) // Writable has .pipe.\n  )\n}\nfunction isWritableNodeStream(obj) {\n  var _obj$_writableState\n  return !!(\n    (\n      obj &&\n      typeof obj.write === 'function' &&\n      typeof obj.on === 'function' &&\n      (!obj._readableState ||\n        ((_obj$_writableState = obj._writableState) === null || _obj$_writableState === undefined\n          ? undefined\n          : _obj$_writableState.writable) !== false)\n    ) // Duplex\n  )\n}\nfunction isDuplexNodeStream(obj) {\n  return !!(\n    obj &&\n    typeof obj.pipe === 'function' &&\n    obj._readableState &&\n    typeof obj.on === 'function' &&\n    typeof obj.write === 'function'\n  )\n}\nfunction isNodeStream(obj) {\n  return (\n    obj &&\n    (obj._readableState ||\n      obj._writableState ||\n      (typeof obj.write === 'function' && typeof obj.on === 'function') ||\n      (typeof obj.pipe === 'function' && typeof obj.on === 'function'))\n  )\n}\nfunction isReadableStream(obj) {\n  return !!(\n    obj &&\n    !isNodeStream(obj) &&\n    typeof obj.pipeThrough === 'function' &&\n    typeof obj.getReader === 'function' &&\n    typeof obj.cancel === 'function'\n  )\n}\nfunction isWritableStream(obj) {\n  return !!(obj && !isNodeStream(obj) && typeof obj.getWriter === 'function' && typeof obj.abort === 'function')\n}\nfunction isTransformStream(obj) {\n  return !!(obj && !isNodeStream(obj) && typeof obj.readable === 'object' && typeof obj.writable === 'object')\n}\nfunction isWebStream(obj) {\n  return isReadableStream(obj) || isWritableStream(obj) || isTransformStream(obj)\n}\nfunction isIterable(obj, isAsync) {\n  if (obj == null) return false\n  if (isAsync === true) return typeof obj[SymbolAsyncIterator] === 'function'\n  if (isAsync === false) return typeof obj[SymbolIterator] === 'function'\n  return typeof obj[SymbolAsyncIterator] === 'function' || typeof obj[SymbolIterator] === 'function'\n}\nfunction isDestroyed(stream) {\n  if (!isNodeStream(stream)) return null\n  const wState = stream._writableState\n  const rState = stream._readableState\n  const state = wState || rState\n  return !!(stream.destroyed || stream[kIsDestroyed] || (state !== null && state !== undefined && state.destroyed))\n}\n\n// Have been end():d.\nfunction isWritableEnded(stream) {\n  if (!isWritableNodeStream(stream)) return null\n  if (stream.writableEnded === true) return true\n  const wState = stream._writableState\n  if (wState !== null && wState !== undefined && wState.errored) return false\n  if (typeof (wState === null || wState === undefined ? undefined : wState.ended) !== 'boolean') return null\n  return wState.ended\n}\n\n// Have emitted 'finish'.\nfunction isWritableFinished(stream, strict) {\n  if (!isWritableNodeStream(stream)) return null\n  if (stream.writableFinished === true) return true\n  const wState = stream._writableState\n  if (wState !== null && wState !== undefined && wState.errored) return false\n  if (typeof (wState === null || wState === undefined ? undefined : wState.finished) !== 'boolean') return null\n  return !!(wState.finished || (strict === false && wState.ended === true && wState.length === 0))\n}\n\n// Have been push(null):d.\nfunction isReadableEnded(stream) {\n  if (!isReadableNodeStream(stream)) return null\n  if (stream.readableEnded === true) return true\n  const rState = stream._readableState\n  if (!rState || rState.errored) return false\n  if (typeof (rState === null || rState === undefined ? undefined : rState.ended) !== 'boolean') return null\n  return rState.ended\n}\n\n// Have emitted 'end'.\nfunction isReadableFinished(stream, strict) {\n  if (!isReadableNodeStream(stream)) return null\n  const rState = stream._readableState\n  if (rState !== null && rState !== undefined && rState.errored) return false\n  if (typeof (rState === null || rState === undefined ? undefined : rState.endEmitted) !== 'boolean') return null\n  return !!(rState.endEmitted || (strict === false && rState.ended === true && rState.length === 0))\n}\nfunction isReadable(stream) {\n  if (stream && stream[kIsReadable] != null) return stream[kIsReadable]\n  if (typeof (stream === null || stream === undefined ? undefined : stream.readable) !== 'boolean') return null\n  if (isDestroyed(stream)) return false\n  return isReadableNodeStream(stream) && stream.readable && !isReadableFinished(stream)\n}\nfunction isWritable(stream) {\n  if (stream && stream[kIsWritable] != null) return stream[kIsWritable]\n  if (typeof (stream === null || stream === undefined ? undefined : stream.writable) !== 'boolean') return null\n  if (isDestroyed(stream)) return false\n  return isWritableNodeStream(stream) && stream.writable && !isWritableEnded(stream)\n}\nfunction isFinished(stream, opts) {\n  if (!isNodeStream(stream)) {\n    return null\n  }\n  if (isDestroyed(stream)) {\n    return true\n  }\n  if ((opts === null || opts === undefined ? undefined : opts.readable) !== false && isReadable(stream)) {\n    return false\n  }\n  if ((opts === null || opts === undefined ? undefined : opts.writable) !== false && isWritable(stream)) {\n    return false\n  }\n  return true\n}\nfunction isWritableErrored(stream) {\n  var _stream$_writableStat, _stream$_writableStat2\n  if (!isNodeStream(stream)) {\n    return null\n  }\n  if (stream.writableErrored) {\n    return stream.writableErrored\n  }\n  return (_stream$_writableStat =\n    (_stream$_writableStat2 = stream._writableState) === null || _stream$_writableStat2 === undefined\n      ? undefined\n      : _stream$_writableStat2.errored) !== null && _stream$_writableStat !== undefined\n    ? _stream$_writableStat\n    : null\n}\nfunction isReadableErrored(stream) {\n  var _stream$_readableStat, _stream$_readableStat2\n  if (!isNodeStream(stream)) {\n    return null\n  }\n  if (stream.readableErrored) {\n    return stream.readableErrored\n  }\n  return (_stream$_readableStat =\n    (_stream$_readableStat2 = stream._readableState) === null || _stream$_readableStat2 === undefined\n      ? undefined\n      : _stream$_readableStat2.errored) !== null && _stream$_readableStat !== undefined\n    ? _stream$_readableStat\n    : null\n}\nfunction isClosed(stream) {\n  if (!isNodeStream(stream)) {\n    return null\n  }\n  if (typeof stream.closed === 'boolean') {\n    return stream.closed\n  }\n  const wState = stream._writableState\n  const rState = stream._readableState\n  if (\n    typeof (wState === null || wState === undefined ? undefined : wState.closed) === 'boolean' ||\n    typeof (rState === null || rState === undefined ? undefined : rState.closed) === 'boolean'\n  ) {\n    return (\n      (wState === null || wState === undefined ? undefined : wState.closed) ||\n      (rState === null || rState === undefined ? undefined : rState.closed)\n    )\n  }\n  if (typeof stream._closed === 'boolean' && isOutgoingMessage(stream)) {\n    return stream._closed\n  }\n  return null\n}\nfunction isOutgoingMessage(stream) {\n  return (\n    typeof stream._closed === 'boolean' &&\n    typeof stream._defaultKeepAlive === 'boolean' &&\n    typeof stream._removedConnection === 'boolean' &&\n    typeof stream._removedContLen === 'boolean'\n  )\n}\nfunction isServerResponse(stream) {\n  return typeof stream._sent100 === 'boolean' && isOutgoingMessage(stream)\n}\nfunction isServerRequest(stream) {\n  var _stream$req\n  return (\n    typeof stream._consuming === 'boolean' &&\n    typeof stream._dumped === 'boolean' &&\n    ((_stream$req = stream.req) === null || _stream$req === undefined ? undefined : _stream$req.upgradeOrConnect) ===\n      undefined\n  )\n}\nfunction willEmitClose(stream) {\n  if (!isNodeStream(stream)) return null\n  const wState = stream._writableState\n  const rState = stream._readableState\n  const state = wState || rState\n  return (\n    (!state && isServerResponse(stream)) || !!(state && state.autoDestroy && state.emitClose && state.closed === false)\n  )\n}\nfunction isDisturbed(stream) {\n  var _stream$kIsDisturbed\n  return !!(\n    stream &&\n    ((_stream$kIsDisturbed = stream[kIsDisturbed]) !== null && _stream$kIsDisturbed !== undefined\n      ? _stream$kIsDisturbed\n      : stream.readableDidRead || stream.readableAborted)\n  )\n}\nfunction isErrored(stream) {\n  var _ref,\n    _ref2,\n    _ref3,\n    _ref4,\n    _ref5,\n    _stream$kIsErrored,\n    _stream$_readableStat3,\n    _stream$_writableStat3,\n    _stream$_readableStat4,\n    _stream$_writableStat4\n  return !!(\n    stream &&\n    ((_ref =\n      (_ref2 =\n        (_ref3 =\n          (_ref4 =\n            (_ref5 =\n              (_stream$kIsErrored = stream[kIsErrored]) !== null && _stream$kIsErrored !== undefined\n                ? _stream$kIsErrored\n                : stream.readableErrored) !== null && _ref5 !== undefined\n              ? _ref5\n              : stream.writableErrored) !== null && _ref4 !== undefined\n            ? _ref4\n            : (_stream$_readableStat3 = stream._readableState) === null || _stream$_readableStat3 === undefined\n            ? undefined\n            : _stream$_readableStat3.errorEmitted) !== null && _ref3 !== undefined\n          ? _ref3\n          : (_stream$_writableStat3 = stream._writableState) === null || _stream$_writableStat3 === undefined\n          ? undefined\n          : _stream$_writableStat3.errorEmitted) !== null && _ref2 !== undefined\n        ? _ref2\n        : (_stream$_readableStat4 = stream._readableState) === null || _stream$_readableStat4 === undefined\n        ? undefined\n        : _stream$_readableStat4.errored) !== null && _ref !== undefined\n      ? _ref\n      : (_stream$_writableStat4 = stream._writableState) === null || _stream$_writableStat4 === undefined\n      ? undefined\n      : _stream$_writableStat4.errored)\n  )\n}\nmodule.exports = {\n  isDestroyed,\n  kIsDestroyed,\n  isDisturbed,\n  kIsDisturbed,\n  isErrored,\n  kIsErrored,\n  isReadable,\n  kIsReadable,\n  kIsClosedPromise,\n  kControllerErrorFunction,\n  kIsWritable,\n  isClosed,\n  isDuplexNodeStream,\n  isFinished,\n  isIterable,\n  isReadableNodeStream,\n  isReadableStream,\n  isReadableEnded,\n  isReadableFinished,\n  isReadableErrored,\n  isNodeStream,\n  isWebStream,\n  isWritable,\n  isWritableNodeStream,\n  isWritableStream,\n  isWritableEnded,\n  isWritableFinished,\n  isWritableErrored,\n  isServerRequest,\n  isServerResponse,\n  willEmitClose,\n  isTransformStream\n}\n","// Ported from https://github.com/mafintosh/end-of-stream with\n// permission from the author, Mathias Buus (@mafintosh).\n\n'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst { AbortError, codes } = require('../../ours/errors')\nconst { ERR_INVALID_ARG_TYPE, ERR_STREAM_PREMATURE_CLOSE } = codes\nconst { kEmptyObject, once } = require('../../ours/util')\nconst { validateAbortSignal, validateFunction, validateObject, validateBoolean } = require('../validators')\nconst { Promise, PromisePrototypeThen, SymbolDispose } = require('../../ours/primordials')\nconst {\n  isClosed,\n  isReadable,\n  isReadableNodeStream,\n  isReadableStream,\n  isReadableFinished,\n  isReadableErrored,\n  isWritable,\n  isWritableNodeStream,\n  isWritableStream,\n  isWritableFinished,\n  isWritableErrored,\n  isNodeStream,\n  willEmitClose: _willEmitClose,\n  kIsClosedPromise\n} = require('./utils')\nlet addAbortListener\nfunction isRequest(stream) {\n  return stream.setHeader && typeof stream.abort === 'function'\n}\nconst nop = () => {}\nfunction eos(stream, options, callback) {\n  var _options$readable, _options$writable\n  if (arguments.length === 2) {\n    callback = options\n    options = kEmptyObject\n  } else if (options == null) {\n    options = kEmptyObject\n  } else {\n    validateObject(options, 'options')\n  }\n  validateFunction(callback, 'callback')\n  validateAbortSignal(options.signal, 'options.signal')\n  callback = once(callback)\n  if (isReadableStream(stream) || isWritableStream(stream)) {\n    return eosWeb(stream, options, callback)\n  }\n  if (!isNodeStream(stream)) {\n    throw new ERR_INVALID_ARG_TYPE('stream', ['ReadableStream', 'WritableStream', 'Stream'], stream)\n  }\n  const readable =\n    (_options$readable = options.readable) !== null && _options$readable !== undefined\n      ? _options$readable\n      : isReadableNodeStream(stream)\n  const writable =\n    (_options$writable = options.writable) !== null && _options$writable !== undefined\n      ? _options$writable\n      : isWritableNodeStream(stream)\n  const wState = stream._writableState\n  const rState = stream._readableState\n  const onlegacyfinish = () => {\n    if (!stream.writable) {\n      onfinish()\n    }\n  }\n\n  // TODO (ronag): Improve soft detection to include core modules and\n  // common ecosystem modules that do properly emit 'close' but fail\n  // this generic check.\n  let willEmitClose =\n    _willEmitClose(stream) && isReadableNodeStream(stream) === readable && isWritableNodeStream(stream) === writable\n  let writableFinished = isWritableFinished(stream, false)\n  const onfinish = () => {\n    writableFinished = true\n    // Stream should not be destroyed here. If it is that\n    // means that user space is doing something differently and\n    // we cannot trust willEmitClose.\n    if (stream.destroyed) {\n      willEmitClose = false\n    }\n    if (willEmitClose && (!stream.readable || readable)) {\n      return\n    }\n    if (!readable || readableFinished) {\n      callback.call(stream)\n    }\n  }\n  let readableFinished = isReadableFinished(stream, false)\n  const onend = () => {\n    readableFinished = true\n    // Stream should not be destroyed here. If it is that\n    // means that user space is doing something differently and\n    // we cannot trust willEmitClose.\n    if (stream.destroyed) {\n      willEmitClose = false\n    }\n    if (willEmitClose && (!stream.writable || writable)) {\n      return\n    }\n    if (!writable || writableFinished) {\n      callback.call(stream)\n    }\n  }\n  const onerror = (err) => {\n    callback.call(stream, err)\n  }\n  let closed = isClosed(stream)\n  const onclose = () => {\n    closed = true\n    const errored = isWritableErrored(stream) || isReadableErrored(stream)\n    if (errored && typeof errored !== 'boolean') {\n      return callback.call(stream, errored)\n    }\n    if (readable && !readableFinished && isReadableNodeStream(stream, true)) {\n      if (!isReadableFinished(stream, false)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE())\n    }\n    if (writable && !writableFinished) {\n      if (!isWritableFinished(stream, false)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE())\n    }\n    callback.call(stream)\n  }\n  const onclosed = () => {\n    closed = true\n    const errored = isWritableErrored(stream) || isReadableErrored(stream)\n    if (errored && typeof errored !== 'boolean') {\n      return callback.call(stream, errored)\n    }\n    callback.call(stream)\n  }\n  const onrequest = () => {\n    stream.req.on('finish', onfinish)\n  }\n  if (isRequest(stream)) {\n    stream.on('complete', onfinish)\n    if (!willEmitClose) {\n      stream.on('abort', onclose)\n    }\n    if (stream.req) {\n      onrequest()\n    } else {\n      stream.on('request', onrequest)\n    }\n  } else if (writable && !wState) {\n    // legacy streams\n    stream.on('end', onlegacyfinish)\n    stream.on('close', onlegacyfinish)\n  }\n\n  // Not all streams will emit 'close' after 'aborted'.\n  if (!willEmitClose && typeof stream.aborted === 'boolean') {\n    stream.on('aborted', onclose)\n  }\n  stream.on('end', onend)\n  stream.on('finish', onfinish)\n  if (options.error !== false) {\n    stream.on('error', onerror)\n  }\n  stream.on('close', onclose)\n  if (closed) {\n    process.nextTick(onclose)\n  } else if (\n    (wState !== null && wState !== undefined && wState.errorEmitted) ||\n    (rState !== null && rState !== undefined && rState.errorEmitted)\n  ) {\n    if (!willEmitClose) {\n      process.nextTick(onclosed)\n    }\n  } else if (\n    !readable &&\n    (!willEmitClose || isReadable(stream)) &&\n    (writableFinished || isWritable(stream) === false)\n  ) {\n    process.nextTick(onclosed)\n  } else if (\n    !writable &&\n    (!willEmitClose || isWritable(stream)) &&\n    (readableFinished || isReadable(stream) === false)\n  ) {\n    process.nextTick(onclosed)\n  } else if (rState && stream.req && stream.aborted) {\n    process.nextTick(onclosed)\n  }\n  const cleanup = () => {\n    callback = nop\n    stream.removeListener('aborted', onclose)\n    stream.removeListener('complete', onfinish)\n    stream.removeListener('abort', onclose)\n    stream.removeListener('request', onrequest)\n    if (stream.req) stream.req.removeListener('finish', onfinish)\n    stream.removeListener('end', onlegacyfinish)\n    stream.removeListener('close', onlegacyfinish)\n    stream.removeListener('finish', onfinish)\n    stream.removeListener('end', onend)\n    stream.removeListener('error', onerror)\n    stream.removeListener('close', onclose)\n  }\n  if (options.signal && !closed) {\n    const abort = () => {\n      // Keep it because cleanup removes it.\n      const endCallback = callback\n      cleanup()\n      endCallback.call(\n        stream,\n        new AbortError(undefined, {\n          cause: options.signal.reason\n        })\n      )\n    }\n    if (options.signal.aborted) {\n      process.nextTick(abort)\n    } else {\n      addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n      const disposable = addAbortListener(options.signal, abort)\n      const originalCallback = callback\n      callback = once((...args) => {\n        disposable[SymbolDispose]()\n        originalCallback.apply(stream, args)\n      })\n    }\n  }\n  return cleanup\n}\nfunction eosWeb(stream, options, callback) {\n  let isAborted = false\n  let abort = nop\n  if (options.signal) {\n    abort = () => {\n      isAborted = true\n      callback.call(\n        stream,\n        new AbortError(undefined, {\n          cause: options.signal.reason\n        })\n      )\n    }\n    if (options.signal.aborted) {\n      process.nextTick(abort)\n    } else {\n      addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n      const disposable = addAbortListener(options.signal, abort)\n      const originalCallback = callback\n      callback = once((...args) => {\n        disposable[SymbolDispose]()\n        originalCallback.apply(stream, args)\n      })\n    }\n  }\n  const resolverFn = (...args) => {\n    if (!isAborted) {\n      process.nextTick(() => callback.apply(stream, args))\n    }\n  }\n  PromisePrototypeThen(stream[kIsClosedPromise].promise, resolverFn, resolverFn)\n  return nop\n}\nfunction finished(stream, opts) {\n  var _opts\n  let autoCleanup = false\n  if (opts === null) {\n    opts = kEmptyObject\n  }\n  if ((_opts = opts) !== null && _opts !== undefined && _opts.cleanup) {\n    validateBoolean(opts.cleanup, 'cleanup')\n    autoCleanup = opts.cleanup\n  }\n  return new Promise((resolve, reject) => {\n    const cleanup = eos(stream, opts, (err) => {\n      if (autoCleanup) {\n        cleanup()\n      }\n      if (err) {\n        reject(err)\n      } else {\n        resolve()\n      }\n    })\n  })\n}\nmodule.exports = eos\nmodule.exports.finished = finished\n","'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst {\n  aggregateTwoErrors,\n  codes: { ERR_MULTIPLE_CALLBACK },\n  AbortError\n} = require('../../ours/errors')\nconst { Symbol } = require('../../ours/primordials')\nconst { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require('./utils')\nconst kDestroy = Symbol('kDestroy')\nconst kConstruct = Symbol('kConstruct')\nfunction checkError(err, w, r) {\n  if (err) {\n    // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364\n    err.stack // eslint-disable-line no-unused-expressions\n\n    if (w && !w.errored) {\n      w.errored = err\n    }\n    if (r && !r.errored) {\n      r.errored = err\n    }\n  }\n}\n\n// Backwards compat. cb() is undocumented and unused in core but\n// unfortunately might be used by modules.\nfunction destroy(err, cb) {\n  const r = this._readableState\n  const w = this._writableState\n  // With duplex streams we use the writable side for state.\n  const s = w || r\n  if ((w !== null && w !== undefined && w.destroyed) || (r !== null && r !== undefined && r.destroyed)) {\n    if (typeof cb === 'function') {\n      cb()\n    }\n    return this\n  }\n\n  // We set destroyed to true before firing error callbacks in order\n  // to make it re-entrance safe in case destroy() is called within callbacks\n  checkError(err, w, r)\n  if (w) {\n    w.destroyed = true\n  }\n  if (r) {\n    r.destroyed = true\n  }\n\n  // If still constructing then defer calling _destroy.\n  if (!s.constructed) {\n    this.once(kDestroy, function (er) {\n      _destroy(this, aggregateTwoErrors(er, err), cb)\n    })\n  } else {\n    _destroy(this, err, cb)\n  }\n  return this\n}\nfunction _destroy(self, err, cb) {\n  let called = false\n  function onDestroy(err) {\n    if (called) {\n      return\n    }\n    called = true\n    const r = self._readableState\n    const w = self._writableState\n    checkError(err, w, r)\n    if (w) {\n      w.closed = true\n    }\n    if (r) {\n      r.closed = true\n    }\n    if (typeof cb === 'function') {\n      cb(err)\n    }\n    if (err) {\n      process.nextTick(emitErrorCloseNT, self, err)\n    } else {\n      process.nextTick(emitCloseNT, self)\n    }\n  }\n  try {\n    self._destroy(err || null, onDestroy)\n  } catch (err) {\n    onDestroy(err)\n  }\n}\nfunction emitErrorCloseNT(self, err) {\n  emitErrorNT(self, err)\n  emitCloseNT(self)\n}\nfunction emitCloseNT(self) {\n  const r = self._readableState\n  const w = self._writableState\n  if (w) {\n    w.closeEmitted = true\n  }\n  if (r) {\n    r.closeEmitted = true\n  }\n  if ((w !== null && w !== undefined && w.emitClose) || (r !== null && r !== undefined && r.emitClose)) {\n    self.emit('close')\n  }\n}\nfunction emitErrorNT(self, err) {\n  const r = self._readableState\n  const w = self._writableState\n  if ((w !== null && w !== undefined && w.errorEmitted) || (r !== null && r !== undefined && r.errorEmitted)) {\n    return\n  }\n  if (w) {\n    w.errorEmitted = true\n  }\n  if (r) {\n    r.errorEmitted = true\n  }\n  self.emit('error', err)\n}\nfunction undestroy() {\n  const r = this._readableState\n  const w = this._writableState\n  if (r) {\n    r.constructed = true\n    r.closed = false\n    r.closeEmitted = false\n    r.destroyed = false\n    r.errored = null\n    r.errorEmitted = false\n    r.reading = false\n    r.ended = r.readable === false\n    r.endEmitted = r.readable === false\n  }\n  if (w) {\n    w.constructed = true\n    w.destroyed = false\n    w.closed = false\n    w.closeEmitted = false\n    w.errored = null\n    w.errorEmitted = false\n    w.finalCalled = false\n    w.prefinished = false\n    w.ended = w.writable === false\n    w.ending = w.writable === false\n    w.finished = w.writable === false\n  }\n}\nfunction errorOrDestroy(stream, err, sync) {\n  // We have tests that rely on errors being emitted\n  // in the same tick, so changing this is semver major.\n  // For now when you opt-in to autoDestroy we allow\n  // the error to be emitted nextTick. In a future\n  // semver major update we should change the default to this.\n\n  const r = stream._readableState\n  const w = stream._writableState\n  if ((w !== null && w !== undefined && w.destroyed) || (r !== null && r !== undefined && r.destroyed)) {\n    return this\n  }\n  if ((r !== null && r !== undefined && r.autoDestroy) || (w !== null && w !== undefined && w.autoDestroy))\n    stream.destroy(err)\n  else if (err) {\n    // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364\n    err.stack // eslint-disable-line no-unused-expressions\n\n    if (w && !w.errored) {\n      w.errored = err\n    }\n    if (r && !r.errored) {\n      r.errored = err\n    }\n    if (sync) {\n      process.nextTick(emitErrorNT, stream, err)\n    } else {\n      emitErrorNT(stream, err)\n    }\n  }\n}\nfunction construct(stream, cb) {\n  if (typeof stream._construct !== 'function') {\n    return\n  }\n  const r = stream._readableState\n  const w = stream._writableState\n  if (r) {\n    r.constructed = false\n  }\n  if (w) {\n    w.constructed = false\n  }\n  stream.once(kConstruct, cb)\n  if (stream.listenerCount(kConstruct) > 1) {\n    // Duplex\n    return\n  }\n  process.nextTick(constructNT, stream)\n}\nfunction constructNT(stream) {\n  let called = false\n  function onConstruct(err) {\n    if (called) {\n      errorOrDestroy(stream, err !== null && err !== undefined ? err : new ERR_MULTIPLE_CALLBACK())\n      return\n    }\n    called = true\n    const r = stream._readableState\n    const w = stream._writableState\n    const s = w || r\n    if (r) {\n      r.constructed = true\n    }\n    if (w) {\n      w.constructed = true\n    }\n    if (s.destroyed) {\n      stream.emit(kDestroy, err)\n    } else if (err) {\n      errorOrDestroy(stream, err, true)\n    } else {\n      process.nextTick(emitConstructNT, stream)\n    }\n  }\n  try {\n    stream._construct((err) => {\n      process.nextTick(onConstruct, err)\n    })\n  } catch (err) {\n    process.nextTick(onConstruct, err)\n  }\n}\nfunction emitConstructNT(stream) {\n  stream.emit(kConstruct)\n}\nfunction isRequest(stream) {\n  return (stream === null || stream === undefined ? undefined : stream.setHeader) && typeof stream.abort === 'function'\n}\nfunction emitCloseLegacy(stream) {\n  stream.emit('close')\n}\nfunction emitErrorCloseLegacy(stream, err) {\n  stream.emit('error', err)\n  process.nextTick(emitCloseLegacy, stream)\n}\n\n// Normalize destroy for legacy.\nfunction destroyer(stream, err) {\n  if (!stream || isDestroyed(stream)) {\n    return\n  }\n  if (!err && !isFinished(stream)) {\n    err = new AbortError()\n  }\n\n  // TODO: Remove isRequest branches.\n  if (isServerRequest(stream)) {\n    stream.socket = null\n    stream.destroy(err)\n  } else if (isRequest(stream)) {\n    stream.abort()\n  } else if (isRequest(stream.req)) {\n    stream.req.abort()\n  } else if (typeof stream.destroy === 'function') {\n    stream.destroy(err)\n  } else if (typeof stream.close === 'function') {\n    // TODO: Don't lose err?\n    stream.close()\n  } else if (err) {\n    process.nextTick(emitErrorCloseLegacy, stream, err)\n  } else {\n    process.nextTick(emitCloseLegacy, stream)\n  }\n  if (!stream.destroyed) {\n    stream[kIsDestroyed] = true\n  }\n}\nmodule.exports = {\n  construct,\n  destroyer,\n  destroy,\n  undestroy,\n  errorOrDestroy\n}\n","'use strict'\n\nconst { ArrayIsArray, ObjectSetPrototypeOf } = require('../../ours/primordials')\nconst { EventEmitter: EE } = require('events')\nfunction Stream(opts) {\n  EE.call(this, opts)\n}\nObjectSetPrototypeOf(Stream.prototype, EE.prototype)\nObjectSetPrototypeOf(Stream, EE)\nStream.prototype.pipe = function (dest, options) {\n  const source = this\n  function ondata(chunk) {\n    if (dest.writable && dest.write(chunk) === false && source.pause) {\n      source.pause()\n    }\n  }\n  source.on('data', ondata)\n  function ondrain() {\n    if (source.readable && source.resume) {\n      source.resume()\n    }\n  }\n  dest.on('drain', ondrain)\n\n  // If the 'end' option is not supplied, dest.end() will be called when\n  // source gets the 'end' or 'close' events.  Only dest.end() once.\n  if (!dest._isStdio && (!options || options.end !== false)) {\n    source.on('end', onend)\n    source.on('close', onclose)\n  }\n  let didOnEnd = false\n  function onend() {\n    if (didOnEnd) return\n    didOnEnd = true\n    dest.end()\n  }\n  function onclose() {\n    if (didOnEnd) return\n    didOnEnd = true\n    if (typeof dest.destroy === 'function') dest.destroy()\n  }\n\n  // Don't leave dangling pipes when there are errors.\n  function onerror(er) {\n    cleanup()\n    if (EE.listenerCount(this, 'error') === 0) {\n      this.emit('error', er)\n    }\n  }\n  prependListener(source, 'error', onerror)\n  prependListener(dest, 'error', onerror)\n\n  // Remove all the event listeners that were added.\n  function cleanup() {\n    source.removeListener('data', ondata)\n    dest.removeListener('drain', ondrain)\n    source.removeListener('end', onend)\n    source.removeListener('close', onclose)\n    source.removeListener('error', onerror)\n    dest.removeListener('error', onerror)\n    source.removeListener('end', cleanup)\n    source.removeListener('close', cleanup)\n    dest.removeListener('close', cleanup)\n  }\n  source.on('end', cleanup)\n  source.on('close', cleanup)\n  dest.on('close', cleanup)\n  dest.emit('pipe', source)\n\n  // Allow for unix-like usage: A.pipe(B).pipe(C)\n  return dest\n}\nfunction prependListener(emitter, event, fn) {\n  // Sadly this is not cacheable as some libraries bundle their own\n  // event emitter implementation with them.\n  if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn)\n\n  // This is a hack to make sure that our error handler is attached before any\n  // userland ones.  NEVER DO THIS. This is here only because this code needs\n  // to continue to work with older versions of Node.js that do not include\n  // the prependListener() method. The goal is to eventually remove this hack.\n  if (!emitter._events || !emitter._events[event]) emitter.on(event, fn)\n  else if (ArrayIsArray(emitter._events[event])) emitter._events[event].unshift(fn)\n  else emitter._events[event] = [fn, emitter._events[event]]\n}\nmodule.exports = {\n  Stream,\n  prependListener\n}\n","'use strict'\n\nconst { SymbolDispose } = require('../../ours/primordials')\nconst { AbortError, codes } = require('../../ours/errors')\nconst { isNodeStream, isWebStream, kControllerErrorFunction } = require('./utils')\nconst eos = require('./end-of-stream')\nconst { ERR_INVALID_ARG_TYPE } = codes\nlet addAbortListener\n\n// This method is inlined here for readable-stream\n// It also does not allow for signal to not exist on the stream\n// https://github.com/nodejs/node/pull/36061#discussion_r533718029\nconst validateAbortSignal = (signal, name) => {\n  if (typeof signal !== 'object' || !('aborted' in signal)) {\n    throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal)\n  }\n}\nmodule.exports.addAbortSignal = function addAbortSignal(signal, stream) {\n  validateAbortSignal(signal, 'signal')\n  if (!isNodeStream(stream) && !isWebStream(stream)) {\n    throw new ERR_INVALID_ARG_TYPE('stream', ['ReadableStream', 'WritableStream', 'Stream'], stream)\n  }\n  return module.exports.addAbortSignalNoValidate(signal, stream)\n}\nmodule.exports.addAbortSignalNoValidate = function (signal, stream) {\n  if (typeof signal !== 'object' || !('aborted' in signal)) {\n    return stream\n  }\n  const onAbort = isNodeStream(stream)\n    ? () => {\n        stream.destroy(\n          new AbortError(undefined, {\n            cause: signal.reason\n          })\n        )\n      }\n    : () => {\n        stream[kControllerErrorFunction](\n          new AbortError(undefined, {\n            cause: signal.reason\n          })\n        )\n      }\n  if (signal.aborted) {\n    onAbort()\n  } else {\n    addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n    const disposable = addAbortListener(signal, onAbort)\n    eos(stream, disposable[SymbolDispose])\n  }\n  return stream\n}\n","'use strict'\n\nconst { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array } = require('../../ours/primordials')\nconst { Buffer } = require('buffer')\nconst { inspect } = require('../../ours/util')\nmodule.exports = class BufferList {\n  constructor() {\n    this.head = null\n    this.tail = null\n    this.length = 0\n  }\n  push(v) {\n    const entry = {\n      data: v,\n      next: null\n    }\n    if (this.length > 0) this.tail.next = entry\n    else this.head = entry\n    this.tail = entry\n    ++this.length\n  }\n  unshift(v) {\n    const entry = {\n      data: v,\n      next: this.head\n    }\n    if (this.length === 0) this.tail = entry\n    this.head = entry\n    ++this.length\n  }\n  shift() {\n    if (this.length === 0) return\n    const ret = this.head.data\n    if (this.length === 1) this.head = this.tail = null\n    else this.head = this.head.next\n    --this.length\n    return ret\n  }\n  clear() {\n    this.head = this.tail = null\n    this.length = 0\n  }\n  join(s) {\n    if (this.length === 0) return ''\n    let p = this.head\n    let ret = '' + p.data\n    while ((p = p.next) !== null) ret += s + p.data\n    return ret\n  }\n  concat(n) {\n    if (this.length === 0) return Buffer.alloc(0)\n    const ret = Buffer.allocUnsafe(n >>> 0)\n    let p = this.head\n    let i = 0\n    while (p) {\n      TypedArrayPrototypeSet(ret, p.data, i)\n      i += p.data.length\n      p = p.next\n    }\n    return ret\n  }\n\n  // Consumes a specified amount of bytes or characters from the buffered data.\n  consume(n, hasStrings) {\n    const data = this.head.data\n    if (n < data.length) {\n      // `slice` is the same for buffers and strings.\n      const slice = data.slice(0, n)\n      this.head.data = data.slice(n)\n      return slice\n    }\n    if (n === data.length) {\n      // First chunk is a perfect match.\n      return this.shift()\n    }\n    // Result spans more than one buffer.\n    return hasStrings ? this._getString(n) : this._getBuffer(n)\n  }\n  first() {\n    return this.head.data\n  }\n  *[SymbolIterator]() {\n    for (let p = this.head; p; p = p.next) {\n      yield p.data\n    }\n  }\n\n  // Consumes a specified amount of characters from the buffered data.\n  _getString(n) {\n    let ret = ''\n    let p = this.head\n    let c = 0\n    do {\n      const str = p.data\n      if (n > str.length) {\n        ret += str\n        n -= str.length\n      } else {\n        if (n === str.length) {\n          ret += str\n          ++c\n          if (p.next) this.head = p.next\n          else this.head = this.tail = null\n        } else {\n          ret += StringPrototypeSlice(str, 0, n)\n          this.head = p\n          p.data = StringPrototypeSlice(str, n)\n        }\n        break\n      }\n      ++c\n    } while ((p = p.next) !== null)\n    this.length -= c\n    return ret\n  }\n\n  // Consumes a specified amount of bytes from the buffered data.\n  _getBuffer(n) {\n    const ret = Buffer.allocUnsafe(n)\n    const retLen = n\n    let p = this.head\n    let c = 0\n    do {\n      const buf = p.data\n      if (n > buf.length) {\n        TypedArrayPrototypeSet(ret, buf, retLen - n)\n        n -= buf.length\n      } else {\n        if (n === buf.length) {\n          TypedArrayPrototypeSet(ret, buf, retLen - n)\n          ++c\n          if (p.next) this.head = p.next\n          else this.head = this.tail = null\n        } else {\n          TypedArrayPrototypeSet(ret, new Uint8Array(buf.buffer, buf.byteOffset, n), retLen - n)\n          this.head = p\n          p.data = buf.slice(n)\n        }\n        break\n      }\n      ++c\n    } while ((p = p.next) !== null)\n    this.length -= c\n    return ret\n  }\n\n  // Make sure the linked list only shows the minimal necessary information.\n  [Symbol.for('nodejs.util.inspect.custom')](_, options) {\n    return inspect(this, {\n      ...options,\n      // Only inspect one level.\n      depth: 0,\n      // It should not recurse.\n      customInspect: false\n    })\n  }\n}\n","'use strict'\n\nconst { MathFloor, NumberIsInteger } = require('../../ours/primordials')\nconst { validateInteger } = require('../validators')\nconst { ERR_INVALID_ARG_VALUE } = require('../../ours/errors').codes\nlet defaultHighWaterMarkBytes = 16 * 1024\nlet defaultHighWaterMarkObjectMode = 16\nfunction highWaterMarkFrom(options, isDuplex, duplexKey) {\n  return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null\n}\nfunction getDefaultHighWaterMark(objectMode) {\n  return objectMode ? defaultHighWaterMarkObjectMode : defaultHighWaterMarkBytes\n}\nfunction setDefaultHighWaterMark(objectMode, value) {\n  validateInteger(value, 'value', 0)\n  if (objectMode) {\n    defaultHighWaterMarkObjectMode = value\n  } else {\n    defaultHighWaterMarkBytes = value\n  }\n}\nfunction getHighWaterMark(state, options, duplexKey, isDuplex) {\n  const hwm = highWaterMarkFrom(options, isDuplex, duplexKey)\n  if (hwm != null) {\n    if (!NumberIsInteger(hwm) || hwm < 0) {\n      const name = isDuplex ? `options.${duplexKey}` : 'options.highWaterMark'\n      throw new ERR_INVALID_ARG_VALUE(name, hwm)\n    }\n    return MathFloor(hwm)\n  }\n\n  // Default value\n  return getDefaultHighWaterMark(state.objectMode)\n}\nmodule.exports = {\n  getHighWaterMark,\n  getDefaultHighWaterMark,\n  setDefaultHighWaterMark\n}\n","/*! safe-buffer. MIT License. Feross Aboukhadijeh  */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n  for (var key in src) {\n    dst[key] = src[key]\n  }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n  module.exports = buffer\n} else {\n  // Copy properties from require('buffer')\n  copyProps(buffer, exports)\n  exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n  return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n  if (typeof arg === 'number') {\n    throw new TypeError('Argument must not be a number')\n  }\n  return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  var buf = Buffer(size)\n  if (fill !== undefined) {\n    if (typeof encoding === 'string') {\n      buf.fill(fill, encoding)\n    } else {\n      buf.fill(fill)\n    }\n  } else {\n    buf.fill(0)\n  }\n  return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  return buffer.SlowBuffer(size)\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/**/\n\nvar Buffer = require('safe-buffer').Buffer;\n/**/\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n  encoding = '' + encoding;\n  switch (encoding && encoding.toLowerCase()) {\n    case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':\n      return true;\n    default:\n      return false;\n  }\n};\n\nfunction _normalizeEncoding(enc) {\n  if (!enc) return 'utf8';\n  var retried;\n  while (true) {\n    switch (enc) {\n      case 'utf8':\n      case 'utf-8':\n        return 'utf8';\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return 'utf16le';\n      case 'latin1':\n      case 'binary':\n        return 'latin1';\n      case 'base64':\n      case 'ascii':\n      case 'hex':\n        return enc;\n      default:\n        if (retried) return; // undefined\n        enc = ('' + enc).toLowerCase();\n        retried = true;\n    }\n  }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n  var nenc = _normalizeEncoding(enc);\n  if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n  return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n  this.encoding = normalizeEncoding(encoding);\n  var nb;\n  switch (this.encoding) {\n    case 'utf16le':\n      this.text = utf16Text;\n      this.end = utf16End;\n      nb = 4;\n      break;\n    case 'utf8':\n      this.fillLast = utf8FillLast;\n      nb = 4;\n      break;\n    case 'base64':\n      this.text = base64Text;\n      this.end = base64End;\n      nb = 3;\n      break;\n    default:\n      this.write = simpleWrite;\n      this.end = simpleEnd;\n      return;\n  }\n  this.lastNeed = 0;\n  this.lastTotal = 0;\n  this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n  if (buf.length === 0) return '';\n  var r;\n  var i;\n  if (this.lastNeed) {\n    r = this.fillLast(buf);\n    if (r === undefined) return '';\n    i = this.lastNeed;\n    this.lastNeed = 0;\n  } else {\n    i = 0;\n  }\n  if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n  return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n  if (this.lastNeed <= buf.length) {\n    buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n    return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n  }\n  buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n  this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte. If an invalid byte is detected, -2 is returned.\nfunction utf8CheckByte(byte) {\n  if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n  return byte >> 6 === 0x02 ? -1 : -2;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n  var j = buf.length - 1;\n  if (j < i) return 0;\n  var nb = utf8CheckByte(buf[j]);\n  if (nb >= 0) {\n    if (nb > 0) self.lastNeed = nb - 1;\n    return nb;\n  }\n  if (--j < i || nb === -2) return 0;\n  nb = utf8CheckByte(buf[j]);\n  if (nb >= 0) {\n    if (nb > 0) self.lastNeed = nb - 2;\n    return nb;\n  }\n  if (--j < i || nb === -2) return 0;\n  nb = utf8CheckByte(buf[j]);\n  if (nb >= 0) {\n    if (nb > 0) {\n      if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n    }\n    return nb;\n  }\n  return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// a single UTF-8 replacement character ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n  if ((buf[0] & 0xC0) !== 0x80) {\n    self.lastNeed = 0;\n    return '\\ufffd';\n  }\n  if (self.lastNeed > 1 && buf.length > 1) {\n    if ((buf[1] & 0xC0) !== 0x80) {\n      self.lastNeed = 1;\n      return '\\ufffd';\n    }\n    if (self.lastNeed > 2 && buf.length > 2) {\n      if ((buf[2] & 0xC0) !== 0x80) {\n        self.lastNeed = 2;\n        return '\\ufffd';\n      }\n    }\n  }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n  var p = this.lastTotal - this.lastNeed;\n  var r = utf8CheckExtraBytes(this, buf, p);\n  if (r !== undefined) return r;\n  if (this.lastNeed <= buf.length) {\n    buf.copy(this.lastChar, p, 0, this.lastNeed);\n    return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n  }\n  buf.copy(this.lastChar, p, 0, buf.length);\n  this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n  var total = utf8CheckIncomplete(this, buf, i);\n  if (!this.lastNeed) return buf.toString('utf8', i);\n  this.lastTotal = total;\n  var end = buf.length - (total - this.lastNeed);\n  buf.copy(this.lastChar, 0, end);\n  return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character is added when ending on a partial\n// character.\nfunction utf8End(buf) {\n  var r = buf && buf.length ? this.write(buf) : '';\n  if (this.lastNeed) return r + '\\ufffd';\n  return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n  if ((buf.length - i) % 2 === 0) {\n    var r = buf.toString('utf16le', i);\n    if (r) {\n      var c = r.charCodeAt(r.length - 1);\n      if (c >= 0xD800 && c <= 0xDBFF) {\n        this.lastNeed = 2;\n        this.lastTotal = 4;\n        this.lastChar[0] = buf[buf.length - 2];\n        this.lastChar[1] = buf[buf.length - 1];\n        return r.slice(0, -1);\n      }\n    }\n    return r;\n  }\n  this.lastNeed = 1;\n  this.lastTotal = 2;\n  this.lastChar[0] = buf[buf.length - 1];\n  return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n  var r = buf && buf.length ? this.write(buf) : '';\n  if (this.lastNeed) {\n    var end = this.lastTotal - this.lastNeed;\n    return r + this.lastChar.toString('utf16le', 0, end);\n  }\n  return r;\n}\n\nfunction base64Text(buf, i) {\n  var n = (buf.length - i) % 3;\n  if (n === 0) return buf.toString('base64', i);\n  this.lastNeed = 3 - n;\n  this.lastTotal = 3;\n  if (n === 1) {\n    this.lastChar[0] = buf[buf.length - 1];\n  } else {\n    this.lastChar[0] = buf[buf.length - 2];\n    this.lastChar[1] = buf[buf.length - 1];\n  }\n  return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n  var r = buf && buf.length ? this.write(buf) : '';\n  if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n  return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n  return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n  return buf && buf.length ? this.write(buf) : '';\n}","'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require('../../ours/primordials')\nconst { Buffer } = require('buffer')\nconst { ERR_INVALID_ARG_TYPE, ERR_STREAM_NULL_VALUES } = require('../../ours/errors').codes\nfunction from(Readable, iterable, opts) {\n  let iterator\n  if (typeof iterable === 'string' || iterable instanceof Buffer) {\n    return new Readable({\n      objectMode: true,\n      ...opts,\n      read() {\n        this.push(iterable)\n        this.push(null)\n      }\n    })\n  }\n  let isAsync\n  if (iterable && iterable[SymbolAsyncIterator]) {\n    isAsync = true\n    iterator = iterable[SymbolAsyncIterator]()\n  } else if (iterable && iterable[SymbolIterator]) {\n    isAsync = false\n    iterator = iterable[SymbolIterator]()\n  } else {\n    throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable)\n  }\n  const readable = new Readable({\n    objectMode: true,\n    highWaterMark: 1,\n    // TODO(ronag): What options should be allowed?\n    ...opts\n  })\n\n  // Flag to protect against _read\n  // being called before last iteration completion.\n  let reading = false\n  readable._read = function () {\n    if (!reading) {\n      reading = true\n      next()\n    }\n  }\n  readable._destroy = function (error, cb) {\n    PromisePrototypeThen(\n      close(error),\n      () => process.nextTick(cb, error),\n      // nextTick is here in case cb throws\n      (e) => process.nextTick(cb, e || error)\n    )\n  }\n  async function close(error) {\n    const hadError = error !== undefined && error !== null\n    const hasThrow = typeof iterator.throw === 'function'\n    if (hadError && hasThrow) {\n      const { value, done } = await iterator.throw(error)\n      await value\n      if (done) {\n        return\n      }\n    }\n    if (typeof iterator.return === 'function') {\n      const { value } = await iterator.return()\n      await value\n    }\n  }\n  async function next() {\n    for (;;) {\n      try {\n        const { value, done } = isAsync ? await iterator.next() : iterator.next()\n        if (done) {\n          readable.push(null)\n        } else {\n          const res = value && typeof value.then === 'function' ? await value : value\n          if (res === null) {\n            reading = false\n            throw new ERR_STREAM_NULL_VALUES()\n          } else if (readable.push(res)) {\n            continue\n          } else {\n            reading = false\n          }\n        }\n      } catch (err) {\n        readable.destroy(err)\n      }\n      break\n    }\n  }\n  return readable\n}\nmodule.exports = from\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst {\n  ArrayPrototypeIndexOf,\n  NumberIsInteger,\n  NumberIsNaN,\n  NumberParseInt,\n  ObjectDefineProperties,\n  ObjectKeys,\n  ObjectSetPrototypeOf,\n  Promise,\n  SafeSet,\n  SymbolAsyncDispose,\n  SymbolAsyncIterator,\n  Symbol\n} = require('../../ours/primordials')\nmodule.exports = Readable\nReadable.ReadableState = ReadableState\nconst { EventEmitter: EE } = require('events')\nconst { Stream, prependListener } = require('./legacy')\nconst { Buffer } = require('buffer')\nconst { addAbortSignal } = require('./add-abort-signal')\nconst eos = require('./end-of-stream')\nlet debug = require('../../ours/util').debuglog('stream', (fn) => {\n  debug = fn\n})\nconst BufferList = require('./buffer_list')\nconst destroyImpl = require('./destroy')\nconst { getHighWaterMark, getDefaultHighWaterMark } = require('./state')\nconst {\n  aggregateTwoErrors,\n  codes: {\n    ERR_INVALID_ARG_TYPE,\n    ERR_METHOD_NOT_IMPLEMENTED,\n    ERR_OUT_OF_RANGE,\n    ERR_STREAM_PUSH_AFTER_EOF,\n    ERR_STREAM_UNSHIFT_AFTER_END_EVENT\n  },\n  AbortError\n} = require('../../ours/errors')\nconst { validateObject } = require('../validators')\nconst kPaused = Symbol('kPaused')\nconst { StringDecoder } = require('string_decoder/')\nconst from = require('./from')\nObjectSetPrototypeOf(Readable.prototype, Stream.prototype)\nObjectSetPrototypeOf(Readable, Stream)\nconst nop = () => {}\nconst { errorOrDestroy } = destroyImpl\nconst kObjectMode = 1 << 0\nconst kEnded = 1 << 1\nconst kEndEmitted = 1 << 2\nconst kReading = 1 << 3\nconst kConstructed = 1 << 4\nconst kSync = 1 << 5\nconst kNeedReadable = 1 << 6\nconst kEmittedReadable = 1 << 7\nconst kReadableListening = 1 << 8\nconst kResumeScheduled = 1 << 9\nconst kErrorEmitted = 1 << 10\nconst kEmitClose = 1 << 11\nconst kAutoDestroy = 1 << 12\nconst kDestroyed = 1 << 13\nconst kClosed = 1 << 14\nconst kCloseEmitted = 1 << 15\nconst kMultiAwaitDrain = 1 << 16\nconst kReadingMore = 1 << 17\nconst kDataEmitted = 1 << 18\n\n// TODO(benjamingr) it is likely slower to do it this way than with free functions\nfunction makeBitMapDescriptor(bit) {\n  return {\n    enumerable: false,\n    get() {\n      return (this.state & bit) !== 0\n    },\n    set(value) {\n      if (value) this.state |= bit\n      else this.state &= ~bit\n    }\n  }\n}\nObjectDefineProperties(ReadableState.prototype, {\n  objectMode: makeBitMapDescriptor(kObjectMode),\n  ended: makeBitMapDescriptor(kEnded),\n  endEmitted: makeBitMapDescriptor(kEndEmitted),\n  reading: makeBitMapDescriptor(kReading),\n  // Stream is still being constructed and cannot be\n  // destroyed until construction finished or failed.\n  // Async construction is opt in, therefore we start as\n  // constructed.\n  constructed: makeBitMapDescriptor(kConstructed),\n  // A flag to be able to tell if the event 'readable'/'data' is emitted\n  // immediately, or on a later tick.  We set this to true at first, because\n  // any actions that shouldn't happen until \"later\" should generally also\n  // not happen before the first read call.\n  sync: makeBitMapDescriptor(kSync),\n  // Whenever we return null, then we set a flag to say\n  // that we're awaiting a 'readable' event emission.\n  needReadable: makeBitMapDescriptor(kNeedReadable),\n  emittedReadable: makeBitMapDescriptor(kEmittedReadable),\n  readableListening: makeBitMapDescriptor(kReadableListening),\n  resumeScheduled: makeBitMapDescriptor(kResumeScheduled),\n  // True if the error was already emitted and should not be thrown again.\n  errorEmitted: makeBitMapDescriptor(kErrorEmitted),\n  emitClose: makeBitMapDescriptor(kEmitClose),\n  autoDestroy: makeBitMapDescriptor(kAutoDestroy),\n  // Has it been destroyed.\n  destroyed: makeBitMapDescriptor(kDestroyed),\n  // Indicates whether the stream has finished destroying.\n  closed: makeBitMapDescriptor(kClosed),\n  // True if close has been emitted or would have been emitted\n  // depending on emitClose.\n  closeEmitted: makeBitMapDescriptor(kCloseEmitted),\n  multiAwaitDrain: makeBitMapDescriptor(kMultiAwaitDrain),\n  // If true, a maybeReadMore has been scheduled.\n  readingMore: makeBitMapDescriptor(kReadingMore),\n  dataEmitted: makeBitMapDescriptor(kDataEmitted)\n})\nfunction ReadableState(options, stream, isDuplex) {\n  // Duplex streams are both readable and writable, but share\n  // the same options object.\n  // However, some cases require setting options to different\n  // values for the readable and the writable sides of the duplex stream.\n  // These options can be provided separately as readableXXX and writableXXX.\n  if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof require('./duplex')\n\n  // Bit map field to store ReadableState more effciently with 1 bit per field\n  // instead of a V8 slot per field.\n  this.state = kEmitClose | kAutoDestroy | kConstructed | kSync\n  // Object stream flag. Used to make read(n) ignore n and to\n  // make all the buffer merging and length checks go away.\n  if (options && options.objectMode) this.state |= kObjectMode\n  if (isDuplex && options && options.readableObjectMode) this.state |= kObjectMode\n\n  // The point at which it stops calling _read() to fill the buffer\n  // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n  this.highWaterMark = options\n    ? getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex)\n    : getDefaultHighWaterMark(false)\n\n  // A linked list is used to store data chunks instead of an array because the\n  // linked list can remove elements from the beginning faster than\n  // array.shift().\n  this.buffer = new BufferList()\n  this.length = 0\n  this.pipes = []\n  this.flowing = null\n  this[kPaused] = null\n\n  // Should close be emitted on destroy. Defaults to true.\n  if (options && options.emitClose === false) this.state &= ~kEmitClose\n\n  // Should .destroy() be called after 'end' (and potentially 'finish').\n  if (options && options.autoDestroy === false) this.state &= ~kAutoDestroy\n\n  // Indicates whether the stream has errored. When true no further\n  // _read calls, 'data' or 'readable' events should occur. This is needed\n  // since when autoDestroy is disabled we need a way to tell whether the\n  // stream has failed.\n  this.errored = null\n\n  // Crypto is kind of old and crusty.  Historically, its default string\n  // encoding is 'binary' so we have to make this configurable.\n  // Everything else in the universe uses 'utf8', though.\n  this.defaultEncoding = (options && options.defaultEncoding) || 'utf8'\n\n  // Ref the piped dest which we need a drain event on it\n  // type: null | Writable | Set.\n  this.awaitDrainWriters = null\n  this.decoder = null\n  this.encoding = null\n  if (options && options.encoding) {\n    this.decoder = new StringDecoder(options.encoding)\n    this.encoding = options.encoding\n  }\n}\nfunction Readable(options) {\n  if (!(this instanceof Readable)) return new Readable(options)\n\n  // Checking for a Stream.Duplex instance is faster here instead of inside\n  // the ReadableState constructor, at least with V8 6.5.\n  const isDuplex = this instanceof require('./duplex')\n  this._readableState = new ReadableState(options, this, isDuplex)\n  if (options) {\n    if (typeof options.read === 'function') this._read = options.read\n    if (typeof options.destroy === 'function') this._destroy = options.destroy\n    if (typeof options.construct === 'function') this._construct = options.construct\n    if (options.signal && !isDuplex) addAbortSignal(options.signal, this)\n  }\n  Stream.call(this, options)\n  destroyImpl.construct(this, () => {\n    if (this._readableState.needReadable) {\n      maybeReadMore(this, this._readableState)\n    }\n  })\n}\nReadable.prototype.destroy = destroyImpl.destroy\nReadable.prototype._undestroy = destroyImpl.undestroy\nReadable.prototype._destroy = function (err, cb) {\n  cb(err)\n}\nReadable.prototype[EE.captureRejectionSymbol] = function (err) {\n  this.destroy(err)\n}\nReadable.prototype[SymbolAsyncDispose] = function () {\n  let error\n  if (!this.destroyed) {\n    error = this.readableEnded ? null : new AbortError()\n    this.destroy(error)\n  }\n  return new Promise((resolve, reject) => eos(this, (err) => (err && err !== error ? reject(err) : resolve(null))))\n}\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n  return readableAddChunk(this, chunk, encoding, false)\n}\n\n// Unshift should *always* be something directly out of read().\nReadable.prototype.unshift = function (chunk, encoding) {\n  return readableAddChunk(this, chunk, encoding, true)\n}\nfunction readableAddChunk(stream, chunk, encoding, addToFront) {\n  debug('readableAddChunk', chunk)\n  const state = stream._readableState\n  let err\n  if ((state.state & kObjectMode) === 0) {\n    if (typeof chunk === 'string') {\n      encoding = encoding || state.defaultEncoding\n      if (state.encoding !== encoding) {\n        if (addToFront && state.encoding) {\n          // When unshifting, if state.encoding is set, we have to save\n          // the string in the BufferList with the state encoding.\n          chunk = Buffer.from(chunk, encoding).toString(state.encoding)\n        } else {\n          chunk = Buffer.from(chunk, encoding)\n          encoding = ''\n        }\n      }\n    } else if (chunk instanceof Buffer) {\n      encoding = ''\n    } else if (Stream._isUint8Array(chunk)) {\n      chunk = Stream._uint8ArrayToBuffer(chunk)\n      encoding = ''\n    } else if (chunk != null) {\n      err = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk)\n    }\n  }\n  if (err) {\n    errorOrDestroy(stream, err)\n  } else if (chunk === null) {\n    state.state &= ~kReading\n    onEofChunk(stream, state)\n  } else if ((state.state & kObjectMode) !== 0 || (chunk && chunk.length > 0)) {\n    if (addToFront) {\n      if ((state.state & kEndEmitted) !== 0) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT())\n      else if (state.destroyed || state.errored) return false\n      else addChunk(stream, state, chunk, true)\n    } else if (state.ended) {\n      errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF())\n    } else if (state.destroyed || state.errored) {\n      return false\n    } else {\n      state.state &= ~kReading\n      if (state.decoder && !encoding) {\n        chunk = state.decoder.write(chunk)\n        if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false)\n        else maybeReadMore(stream, state)\n      } else {\n        addChunk(stream, state, chunk, false)\n      }\n    }\n  } else if (!addToFront) {\n    state.state &= ~kReading\n    maybeReadMore(stream, state)\n  }\n\n  // We can push more data if we are below the highWaterMark.\n  // Also, if we have no data yet, we can stand some more bytes.\n  // This is to work around cases where hwm=0, such as the repl.\n  return !state.ended && (state.length < state.highWaterMark || state.length === 0)\n}\nfunction addChunk(stream, state, chunk, addToFront) {\n  if (state.flowing && state.length === 0 && !state.sync && stream.listenerCount('data') > 0) {\n    // Use the guard to avoid creating `Set()` repeatedly\n    // when we have multiple pipes.\n    if ((state.state & kMultiAwaitDrain) !== 0) {\n      state.awaitDrainWriters.clear()\n    } else {\n      state.awaitDrainWriters = null\n    }\n    state.dataEmitted = true\n    stream.emit('data', chunk)\n  } else {\n    // Update the buffer info.\n    state.length += state.objectMode ? 1 : chunk.length\n    if (addToFront) state.buffer.unshift(chunk)\n    else state.buffer.push(chunk)\n    if ((state.state & kNeedReadable) !== 0) emitReadable(stream)\n  }\n  maybeReadMore(stream, state)\n}\nReadable.prototype.isPaused = function () {\n  const state = this._readableState\n  return state[kPaused] === true || state.flowing === false\n}\n\n// Backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n  const decoder = new StringDecoder(enc)\n  this._readableState.decoder = decoder\n  // If setEncoding(null), decoder.encoding equals utf8.\n  this._readableState.encoding = this._readableState.decoder.encoding\n  const buffer = this._readableState.buffer\n  // Iterate over current buffer to convert already stored Buffers:\n  let content = ''\n  for (const data of buffer) {\n    content += decoder.write(data)\n  }\n  buffer.clear()\n  if (content !== '') buffer.push(content)\n  this._readableState.length = content.length\n  return this\n}\n\n// Don't raise the hwm > 1GB.\nconst MAX_HWM = 0x40000000\nfunction computeNewHighWaterMark(n) {\n  if (n > MAX_HWM) {\n    throw new ERR_OUT_OF_RANGE('size', '<= 1GiB', n)\n  } else {\n    // Get the next highest power of 2 to prevent increasing hwm excessively in\n    // tiny amounts.\n    n--\n    n |= n >>> 1\n    n |= n >>> 2\n    n |= n >>> 4\n    n |= n >>> 8\n    n |= n >>> 16\n    n++\n  }\n  return n\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n  if (n <= 0 || (state.length === 0 && state.ended)) return 0\n  if ((state.state & kObjectMode) !== 0) return 1\n  if (NumberIsNaN(n)) {\n    // Only flow one buffer at a time.\n    if (state.flowing && state.length) return state.buffer.first().length\n    return state.length\n  }\n  if (n <= state.length) return n\n  return state.ended ? state.length : 0\n}\n\n// You can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n  debug('read', n)\n  // Same as parseInt(undefined, 10), however V8 7.3 performance regressed\n  // in this scenario, so we are doing it manually.\n  if (n === undefined) {\n    n = NaN\n  } else if (!NumberIsInteger(n)) {\n    n = NumberParseInt(n, 10)\n  }\n  const state = this._readableState\n  const nOrig = n\n\n  // If we're asking for more than the current hwm, then raise the hwm.\n  if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n)\n  if (n !== 0) state.state &= ~kEmittedReadable\n\n  // If we're doing read(0) to trigger a readable event, but we\n  // already have a bunch of data in the buffer, then just trigger\n  // the 'readable' event and move on.\n  if (\n    n === 0 &&\n    state.needReadable &&\n    ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)\n  ) {\n    debug('read: emitReadable', state.length, state.ended)\n    if (state.length === 0 && state.ended) endReadable(this)\n    else emitReadable(this)\n    return null\n  }\n  n = howMuchToRead(n, state)\n\n  // If we've ended, and we're now clear, then finish it up.\n  if (n === 0 && state.ended) {\n    if (state.length === 0) endReadable(this)\n    return null\n  }\n\n  // All the actual chunk generation logic needs to be\n  // *below* the call to _read.  The reason is that in certain\n  // synthetic stream cases, such as passthrough streams, _read\n  // may be a completely synchronous operation which may change\n  // the state of the read buffer, providing enough data when\n  // before there was *not* enough.\n  //\n  // So, the steps are:\n  // 1. Figure out what the state of things will be after we do\n  // a read from the buffer.\n  //\n  // 2. If that resulting state will trigger a _read, then call _read.\n  // Note that this may be asynchronous, or synchronous.  Yes, it is\n  // deeply ugly to write APIs this way, but that still doesn't mean\n  // that the Readable class should behave improperly, as streams are\n  // designed to be sync/async agnostic.\n  // Take note if the _read call is sync or async (ie, if the read call\n  // has returned yet), so that we know whether or not it's safe to emit\n  // 'readable' etc.\n  //\n  // 3. Actually pull the requested chunks out of the buffer and return.\n\n  // if we need a readable event, then we need to do some reading.\n  let doRead = (state.state & kNeedReadable) !== 0\n  debug('need readable', doRead)\n\n  // If we currently have less than the highWaterMark, then also read some.\n  if (state.length === 0 || state.length - n < state.highWaterMark) {\n    doRead = true\n    debug('length less than watermark', doRead)\n  }\n\n  // However, if we've ended, then there's no point, if we're already\n  // reading, then it's unnecessary, if we're constructing we have to wait,\n  // and if we're destroyed or errored, then it's not allowed,\n  if (state.ended || state.reading || state.destroyed || state.errored || !state.constructed) {\n    doRead = false\n    debug('reading, ended or constructing', doRead)\n  } else if (doRead) {\n    debug('do read')\n    state.state |= kReading | kSync\n    // If the length is currently zero, then we *need* a readable event.\n    if (state.length === 0) state.state |= kNeedReadable\n\n    // Call internal read method\n    try {\n      this._read(state.highWaterMark)\n    } catch (err) {\n      errorOrDestroy(this, err)\n    }\n    state.state &= ~kSync\n\n    // If _read pushed data synchronously, then `reading` will be false,\n    // and we need to re-evaluate how much data we can return to the user.\n    if (!state.reading) n = howMuchToRead(nOrig, state)\n  }\n  let ret\n  if (n > 0) ret = fromList(n, state)\n  else ret = null\n  if (ret === null) {\n    state.needReadable = state.length <= state.highWaterMark\n    n = 0\n  } else {\n    state.length -= n\n    if (state.multiAwaitDrain) {\n      state.awaitDrainWriters.clear()\n    } else {\n      state.awaitDrainWriters = null\n    }\n  }\n  if (state.length === 0) {\n    // If we have nothing in the buffer, then we want to know\n    // as soon as we *do* get something into the buffer.\n    if (!state.ended) state.needReadable = true\n\n    // If we tried to read() past the EOF, then emit end on the next tick.\n    if (nOrig !== n && state.ended) endReadable(this)\n  }\n  if (ret !== null && !state.errorEmitted && !state.closeEmitted) {\n    state.dataEmitted = true\n    this.emit('data', ret)\n  }\n  return ret\n}\nfunction onEofChunk(stream, state) {\n  debug('onEofChunk')\n  if (state.ended) return\n  if (state.decoder) {\n    const chunk = state.decoder.end()\n    if (chunk && chunk.length) {\n      state.buffer.push(chunk)\n      state.length += state.objectMode ? 1 : chunk.length\n    }\n  }\n  state.ended = true\n  if (state.sync) {\n    // If we are sync, wait until next tick to emit the data.\n    // Otherwise we risk emitting data in the flow()\n    // the readable code triggers during a read() call.\n    emitReadable(stream)\n  } else {\n    // Emit 'readable' now to make sure it gets picked up.\n    state.needReadable = false\n    state.emittedReadable = true\n    // We have to emit readable now that we are EOF. Modules\n    // in the ecosystem (e.g. dicer) rely on this event being sync.\n    emitReadable_(stream)\n  }\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow.  This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n  const state = stream._readableState\n  debug('emitReadable', state.needReadable, state.emittedReadable)\n  state.needReadable = false\n  if (!state.emittedReadable) {\n    debug('emitReadable', state.flowing)\n    state.emittedReadable = true\n    process.nextTick(emitReadable_, stream)\n  }\n}\nfunction emitReadable_(stream) {\n  const state = stream._readableState\n  debug('emitReadable_', state.destroyed, state.length, state.ended)\n  if (!state.destroyed && !state.errored && (state.length || state.ended)) {\n    stream.emit('readable')\n    state.emittedReadable = false\n  }\n\n  // The stream needs another readable event if:\n  // 1. It is not flowing, as the flow mechanism will take\n  //    care of it.\n  // 2. It is not ended.\n  // 3. It is below the highWaterMark, so we can schedule\n  //    another readable later.\n  state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark\n  flow(stream)\n}\n\n// At this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data.  that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n  if (!state.readingMore && state.constructed) {\n    state.readingMore = true\n    process.nextTick(maybeReadMore_, stream, state)\n  }\n}\nfunction maybeReadMore_(stream, state) {\n  // Attempt to read more data if we should.\n  //\n  // The conditions for reading more data are (one of):\n  // - Not enough data buffered (state.length < state.highWaterMark). The loop\n  //   is responsible for filling the buffer with enough data if such data\n  //   is available. If highWaterMark is 0 and we are not in the flowing mode\n  //   we should _not_ attempt to buffer any extra data. We'll get more data\n  //   when the stream consumer calls read() instead.\n  // - No data in the buffer, and the stream is in flowing mode. In this mode\n  //   the loop below is responsible for ensuring read() is called. Failing to\n  //   call read here would abort the flow and there's no other mechanism for\n  //   continuing the flow if the stream consumer has just subscribed to the\n  //   'data' event.\n  //\n  // In addition to the above conditions to keep reading data, the following\n  // conditions prevent the data from being read:\n  // - The stream has ended (state.ended).\n  // - There is already a pending 'read' operation (state.reading). This is a\n  //   case where the stream has called the implementation defined _read()\n  //   method, but they are processing the call asynchronously and have _not_\n  //   called push() with new data. In this case we skip performing more\n  //   read()s. The execution ends in this method again after the _read() ends\n  //   up calling push() with more data.\n  while (\n    !state.reading &&\n    !state.ended &&\n    (state.length < state.highWaterMark || (state.flowing && state.length === 0))\n  ) {\n    const len = state.length\n    debug('maybeReadMore read 0')\n    stream.read(0)\n    if (len === state.length)\n      // Didn't get any data, stop spinning.\n      break\n  }\n  state.readingMore = false\n}\n\n// Abstract method.  to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n  throw new ERR_METHOD_NOT_IMPLEMENTED('_read()')\n}\nReadable.prototype.pipe = function (dest, pipeOpts) {\n  const src = this\n  const state = this._readableState\n  if (state.pipes.length === 1) {\n    if (!state.multiAwaitDrain) {\n      state.multiAwaitDrain = true\n      state.awaitDrainWriters = new SafeSet(state.awaitDrainWriters ? [state.awaitDrainWriters] : [])\n    }\n  }\n  state.pipes.push(dest)\n  debug('pipe count=%d opts=%j', state.pipes.length, pipeOpts)\n  const doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr\n  const endFn = doEnd ? onend : unpipe\n  if (state.endEmitted) process.nextTick(endFn)\n  else src.once('end', endFn)\n  dest.on('unpipe', onunpipe)\n  function onunpipe(readable, unpipeInfo) {\n    debug('onunpipe')\n    if (readable === src) {\n      if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n        unpipeInfo.hasUnpiped = true\n        cleanup()\n      }\n    }\n  }\n  function onend() {\n    debug('onend')\n    dest.end()\n  }\n  let ondrain\n  let cleanedUp = false\n  function cleanup() {\n    debug('cleanup')\n    // Cleanup event handlers once the pipe is broken.\n    dest.removeListener('close', onclose)\n    dest.removeListener('finish', onfinish)\n    if (ondrain) {\n      dest.removeListener('drain', ondrain)\n    }\n    dest.removeListener('error', onerror)\n    dest.removeListener('unpipe', onunpipe)\n    src.removeListener('end', onend)\n    src.removeListener('end', unpipe)\n    src.removeListener('data', ondata)\n    cleanedUp = true\n\n    // If the reader is waiting for a drain event from this\n    // specific writer, then it would cause it to never start\n    // flowing again.\n    // So, if this is awaiting a drain, then we just call it now.\n    // If we don't know, then assume that we are waiting for one.\n    if (ondrain && state.awaitDrainWriters && (!dest._writableState || dest._writableState.needDrain)) ondrain()\n  }\n  function pause() {\n    // If the user unpiped during `dest.write()`, it is possible\n    // to get stuck in a permanently paused state if that write\n    // also returned false.\n    // => Check whether `dest` is still a piping destination.\n    if (!cleanedUp) {\n      if (state.pipes.length === 1 && state.pipes[0] === dest) {\n        debug('false write response, pause', 0)\n        state.awaitDrainWriters = dest\n        state.multiAwaitDrain = false\n      } else if (state.pipes.length > 1 && state.pipes.includes(dest)) {\n        debug('false write response, pause', state.awaitDrainWriters.size)\n        state.awaitDrainWriters.add(dest)\n      }\n      src.pause()\n    }\n    if (!ondrain) {\n      // When the dest drains, it reduces the awaitDrain counter\n      // on the source.  This would be more elegant with a .once()\n      // handler in flow(), but adding and removing repeatedly is\n      // too slow.\n      ondrain = pipeOnDrain(src, dest)\n      dest.on('drain', ondrain)\n    }\n  }\n  src.on('data', ondata)\n  function ondata(chunk) {\n    debug('ondata')\n    const ret = dest.write(chunk)\n    debug('dest.write', ret)\n    if (ret === false) {\n      pause()\n    }\n  }\n\n  // If the dest has an error, then stop piping into it.\n  // However, don't suppress the throwing behavior for this.\n  function onerror(er) {\n    debug('onerror', er)\n    unpipe()\n    dest.removeListener('error', onerror)\n    if (dest.listenerCount('error') === 0) {\n      const s = dest._writableState || dest._readableState\n      if (s && !s.errorEmitted) {\n        // User incorrectly emitted 'error' directly on the stream.\n        errorOrDestroy(dest, er)\n      } else {\n        dest.emit('error', er)\n      }\n    }\n  }\n\n  // Make sure our error handler is attached before userland ones.\n  prependListener(dest, 'error', onerror)\n\n  // Both close and finish should trigger unpipe, but only once.\n  function onclose() {\n    dest.removeListener('finish', onfinish)\n    unpipe()\n  }\n  dest.once('close', onclose)\n  function onfinish() {\n    debug('onfinish')\n    dest.removeListener('close', onclose)\n    unpipe()\n  }\n  dest.once('finish', onfinish)\n  function unpipe() {\n    debug('unpipe')\n    src.unpipe(dest)\n  }\n\n  // Tell the dest that it's being piped to.\n  dest.emit('pipe', src)\n\n  // Start the flow if it hasn't been started already.\n\n  if (dest.writableNeedDrain === true) {\n    pause()\n  } else if (!state.flowing) {\n    debug('pipe resume')\n    src.resume()\n  }\n  return dest\n}\nfunction pipeOnDrain(src, dest) {\n  return function pipeOnDrainFunctionResult() {\n    const state = src._readableState\n\n    // `ondrain` will call directly,\n    // `this` maybe not a reference to dest,\n    // so we use the real dest here.\n    if (state.awaitDrainWriters === dest) {\n      debug('pipeOnDrain', 1)\n      state.awaitDrainWriters = null\n    } else if (state.multiAwaitDrain) {\n      debug('pipeOnDrain', state.awaitDrainWriters.size)\n      state.awaitDrainWriters.delete(dest)\n    }\n    if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) && src.listenerCount('data')) {\n      src.resume()\n    }\n  }\n}\nReadable.prototype.unpipe = function (dest) {\n  const state = this._readableState\n  const unpipeInfo = {\n    hasUnpiped: false\n  }\n\n  // If we're not piping anywhere, then do nothing.\n  if (state.pipes.length === 0) return this\n  if (!dest) {\n    // remove all.\n    const dests = state.pipes\n    state.pipes = []\n    this.pause()\n    for (let i = 0; i < dests.length; i++)\n      dests[i].emit('unpipe', this, {\n        hasUnpiped: false\n      })\n    return this\n  }\n\n  // Try to find the right one.\n  const index = ArrayPrototypeIndexOf(state.pipes, dest)\n  if (index === -1) return this\n  state.pipes.splice(index, 1)\n  if (state.pipes.length === 0) this.pause()\n  dest.emit('unpipe', this, unpipeInfo)\n  return this\n}\n\n// Set up data events if they are asked for\n// Ensure readable listeners eventually get something.\nReadable.prototype.on = function (ev, fn) {\n  const res = Stream.prototype.on.call(this, ev, fn)\n  const state = this._readableState\n  if (ev === 'data') {\n    // Update readableListening so that resume() may be a no-op\n    // a few lines down. This is needed to support once('readable').\n    state.readableListening = this.listenerCount('readable') > 0\n\n    // Try start flowing on next tick if stream isn't explicitly paused.\n    if (state.flowing !== false) this.resume()\n  } else if (ev === 'readable') {\n    if (!state.endEmitted && !state.readableListening) {\n      state.readableListening = state.needReadable = true\n      state.flowing = false\n      state.emittedReadable = false\n      debug('on readable', state.length, state.reading)\n      if (state.length) {\n        emitReadable(this)\n      } else if (!state.reading) {\n        process.nextTick(nReadingNextTick, this)\n      }\n    }\n  }\n  return res\n}\nReadable.prototype.addListener = Readable.prototype.on\nReadable.prototype.removeListener = function (ev, fn) {\n  const res = Stream.prototype.removeListener.call(this, ev, fn)\n  if (ev === 'readable') {\n    // We need to check if there is someone still listening to\n    // readable and reset the state. However this needs to happen\n    // after readable has been emitted but before I/O (nextTick) to\n    // support once('readable', fn) cycles. This means that calling\n    // resume within the same tick will have no\n    // effect.\n    process.nextTick(updateReadableListening, this)\n  }\n  return res\n}\nReadable.prototype.off = Readable.prototype.removeListener\nReadable.prototype.removeAllListeners = function (ev) {\n  const res = Stream.prototype.removeAllListeners.apply(this, arguments)\n  if (ev === 'readable' || ev === undefined) {\n    // We need to check if there is someone still listening to\n    // readable and reset the state. However this needs to happen\n    // after readable has been emitted but before I/O (nextTick) to\n    // support once('readable', fn) cycles. This means that calling\n    // resume within the same tick will have no\n    // effect.\n    process.nextTick(updateReadableListening, this)\n  }\n  return res\n}\nfunction updateReadableListening(self) {\n  const state = self._readableState\n  state.readableListening = self.listenerCount('readable') > 0\n  if (state.resumeScheduled && state[kPaused] === false) {\n    // Flowing needs to be set to true now, otherwise\n    // the upcoming resume will not flow.\n    state.flowing = true\n\n    // Crude way to check if we should resume.\n  } else if (self.listenerCount('data') > 0) {\n    self.resume()\n  } else if (!state.readableListening) {\n    state.flowing = null\n  }\n}\nfunction nReadingNextTick(self) {\n  debug('readable nexttick read 0')\n  self.read(0)\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n  const state = this._readableState\n  if (!state.flowing) {\n    debug('resume')\n    // We flow only if there is no one listening\n    // for readable, but we still have to call\n    // resume().\n    state.flowing = !state.readableListening\n    resume(this, state)\n  }\n  state[kPaused] = false\n  return this\n}\nfunction resume(stream, state) {\n  if (!state.resumeScheduled) {\n    state.resumeScheduled = true\n    process.nextTick(resume_, stream, state)\n  }\n}\nfunction resume_(stream, state) {\n  debug('resume', state.reading)\n  if (!state.reading) {\n    stream.read(0)\n  }\n  state.resumeScheduled = false\n  stream.emit('resume')\n  flow(stream)\n  if (state.flowing && !state.reading) stream.read(0)\n}\nReadable.prototype.pause = function () {\n  debug('call pause flowing=%j', this._readableState.flowing)\n  if (this._readableState.flowing !== false) {\n    debug('pause')\n    this._readableState.flowing = false\n    this.emit('pause')\n  }\n  this._readableState[kPaused] = true\n  return this\n}\nfunction flow(stream) {\n  const state = stream._readableState\n  debug('flow', state.flowing)\n  while (state.flowing && stream.read() !== null);\n}\n\n// Wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n  let paused = false\n\n  // TODO (ronag): Should this.destroy(err) emit\n  // 'error' on the wrapped stream? Would require\n  // a static factory method, e.g. Readable.wrap(stream).\n\n  stream.on('data', (chunk) => {\n    if (!this.push(chunk) && stream.pause) {\n      paused = true\n      stream.pause()\n    }\n  })\n  stream.on('end', () => {\n    this.push(null)\n  })\n  stream.on('error', (err) => {\n    errorOrDestroy(this, err)\n  })\n  stream.on('close', () => {\n    this.destroy()\n  })\n  stream.on('destroy', () => {\n    this.destroy()\n  })\n  this._read = () => {\n    if (paused && stream.resume) {\n      paused = false\n      stream.resume()\n    }\n  }\n\n  // Proxy all the other methods. Important when wrapping filters and duplexes.\n  const streamKeys = ObjectKeys(stream)\n  for (let j = 1; j < streamKeys.length; j++) {\n    const i = streamKeys[j]\n    if (this[i] === undefined && typeof stream[i] === 'function') {\n      this[i] = stream[i].bind(stream)\n    }\n  }\n  return this\n}\nReadable.prototype[SymbolAsyncIterator] = function () {\n  return streamToAsyncIterator(this)\n}\nReadable.prototype.iterator = function (options) {\n  if (options !== undefined) {\n    validateObject(options, 'options')\n  }\n  return streamToAsyncIterator(this, options)\n}\nfunction streamToAsyncIterator(stream, options) {\n  if (typeof stream.read !== 'function') {\n    stream = Readable.wrap(stream, {\n      objectMode: true\n    })\n  }\n  const iter = createAsyncIterator(stream, options)\n  iter.stream = stream\n  return iter\n}\nasync function* createAsyncIterator(stream, options) {\n  let callback = nop\n  function next(resolve) {\n    if (this === stream) {\n      callback()\n      callback = nop\n    } else {\n      callback = resolve\n    }\n  }\n  stream.on('readable', next)\n  let error\n  const cleanup = eos(\n    stream,\n    {\n      writable: false\n    },\n    (err) => {\n      error = err ? aggregateTwoErrors(error, err) : null\n      callback()\n      callback = nop\n    }\n  )\n  try {\n    while (true) {\n      const chunk = stream.destroyed ? null : stream.read()\n      if (chunk !== null) {\n        yield chunk\n      } else if (error) {\n        throw error\n      } else if (error === null) {\n        return\n      } else {\n        await new Promise(next)\n      }\n    }\n  } catch (err) {\n    error = aggregateTwoErrors(error, err)\n    throw error\n  } finally {\n    if (\n      (error || (options === null || options === undefined ? undefined : options.destroyOnReturn) !== false) &&\n      (error === undefined || stream._readableState.autoDestroy)\n    ) {\n      destroyImpl.destroyer(stream, null)\n    } else {\n      stream.off('readable', next)\n      cleanup()\n    }\n  }\n}\n\n// Making it explicit these properties are not enumerable\n// because otherwise some prototype manipulation in\n// userland will fail.\nObjectDefineProperties(Readable.prototype, {\n  readable: {\n    __proto__: null,\n    get() {\n      const r = this._readableState\n      // r.readable === false means that this is part of a Duplex stream\n      // where the readable side was disabled upon construction.\n      // Compat. The user might manually disable readable side through\n      // deprecated setter.\n      return !!r && r.readable !== false && !r.destroyed && !r.errorEmitted && !r.endEmitted\n    },\n    set(val) {\n      // Backwards compat.\n      if (this._readableState) {\n        this._readableState.readable = !!val\n      }\n    }\n  },\n  readableDidRead: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return this._readableState.dataEmitted\n    }\n  },\n  readableAborted: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return !!(\n        this._readableState.readable !== false &&\n        (this._readableState.destroyed || this._readableState.errored) &&\n        !this._readableState.endEmitted\n      )\n    }\n  },\n  readableHighWaterMark: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return this._readableState.highWaterMark\n    }\n  },\n  readableBuffer: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return this._readableState && this._readableState.buffer\n    }\n  },\n  readableFlowing: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return this._readableState.flowing\n    },\n    set: function (state) {\n      if (this._readableState) {\n        this._readableState.flowing = state\n      }\n    }\n  },\n  readableLength: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState.length\n    }\n  },\n  readableObjectMode: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState ? this._readableState.objectMode : false\n    }\n  },\n  readableEncoding: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState ? this._readableState.encoding : null\n    }\n  },\n  errored: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState ? this._readableState.errored : null\n    }\n  },\n  closed: {\n    __proto__: null,\n    get() {\n      return this._readableState ? this._readableState.closed : false\n    }\n  },\n  destroyed: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState ? this._readableState.destroyed : false\n    },\n    set(value) {\n      // We ignore the value if the stream\n      // has not been initialized yet.\n      if (!this._readableState) {\n        return\n      }\n\n      // Backward compatibility, the user is explicitly\n      // managing destroyed.\n      this._readableState.destroyed = value\n    }\n  },\n  readableEnded: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState ? this._readableState.endEmitted : false\n    }\n  }\n})\nObjectDefineProperties(ReadableState.prototype, {\n  // Legacy getter for `pipesCount`.\n  pipesCount: {\n    __proto__: null,\n    get() {\n      return this.pipes.length\n    }\n  },\n  // Legacy property for `paused`.\n  paused: {\n    __proto__: null,\n    get() {\n      return this[kPaused] !== false\n    },\n    set(value) {\n      this[kPaused] = !!value\n    }\n  }\n})\n\n// Exposed for testing purposes only.\nReadable._fromList = fromList\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n  // nothing buffered.\n  if (state.length === 0) return null\n  let ret\n  if (state.objectMode) ret = state.buffer.shift()\n  else if (!n || n >= state.length) {\n    // Read it all, truncate the list.\n    if (state.decoder) ret = state.buffer.join('')\n    else if (state.buffer.length === 1) ret = state.buffer.first()\n    else ret = state.buffer.concat(state.length)\n    state.buffer.clear()\n  } else {\n    // read part of list.\n    ret = state.buffer.consume(n, state.decoder)\n  }\n  return ret\n}\nfunction endReadable(stream) {\n  const state = stream._readableState\n  debug('endReadable', state.endEmitted)\n  if (!state.endEmitted) {\n    state.ended = true\n    process.nextTick(endReadableNT, state, stream)\n  }\n}\nfunction endReadableNT(state, stream) {\n  debug('endReadableNT', state.endEmitted, state.length)\n\n  // Check that we didn't get one last unshift.\n  if (!state.errored && !state.closeEmitted && !state.endEmitted && state.length === 0) {\n    state.endEmitted = true\n    stream.emit('end')\n    if (stream.writable && stream.allowHalfOpen === false) {\n      process.nextTick(endWritableNT, stream)\n    } else if (state.autoDestroy) {\n      // In case of duplex streams we need a way to detect\n      // if the writable side is ready for autoDestroy as well.\n      const wState = stream._writableState\n      const autoDestroy =\n        !wState ||\n        (wState.autoDestroy &&\n          // We don't expect the writable to ever 'finish'\n          // if writable is explicitly set to false.\n          (wState.finished || wState.writable === false))\n      if (autoDestroy) {\n        stream.destroy()\n      }\n    }\n  }\n}\nfunction endWritableNT(stream) {\n  const writable = stream.writable && !stream.writableEnded && !stream.destroyed\n  if (writable) {\n    stream.end()\n  }\n}\nReadable.from = function (iterable, opts) {\n  return from(Readable, iterable, opts)\n}\nlet webStreamsAdapters\n\n// Lazy to avoid circular references\nfunction lazyWebStreams() {\n  if (webStreamsAdapters === undefined) webStreamsAdapters = {}\n  return webStreamsAdapters\n}\nReadable.fromWeb = function (readableStream, options) {\n  return lazyWebStreams().newStreamReadableFromReadableStream(readableStream, options)\n}\nReadable.toWeb = function (streamReadable, options) {\n  return lazyWebStreams().newReadableStreamFromStreamReadable(streamReadable, options)\n}\nReadable.wrap = function (src, options) {\n  var _ref, _src$readableObjectMo\n  return new Readable({\n    objectMode:\n      (_ref =\n        (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== undefined\n          ? _src$readableObjectMo\n          : src.objectMode) !== null && _ref !== undefined\n        ? _ref\n        : true,\n    ...options,\n    destroy(err, callback) {\n      destroyImpl.destroyer(src, err)\n      callback(err)\n    }\n  }).wrap(src)\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst {\n  ArrayPrototypeSlice,\n  Error,\n  FunctionPrototypeSymbolHasInstance,\n  ObjectDefineProperty,\n  ObjectDefineProperties,\n  ObjectSetPrototypeOf,\n  StringPrototypeToLowerCase,\n  Symbol,\n  SymbolHasInstance\n} = require('../../ours/primordials')\nmodule.exports = Writable\nWritable.WritableState = WritableState\nconst { EventEmitter: EE } = require('events')\nconst Stream = require('./legacy').Stream\nconst { Buffer } = require('buffer')\nconst destroyImpl = require('./destroy')\nconst { addAbortSignal } = require('./add-abort-signal')\nconst { getHighWaterMark, getDefaultHighWaterMark } = require('./state')\nconst {\n  ERR_INVALID_ARG_TYPE,\n  ERR_METHOD_NOT_IMPLEMENTED,\n  ERR_MULTIPLE_CALLBACK,\n  ERR_STREAM_CANNOT_PIPE,\n  ERR_STREAM_DESTROYED,\n  ERR_STREAM_ALREADY_FINISHED,\n  ERR_STREAM_NULL_VALUES,\n  ERR_STREAM_WRITE_AFTER_END,\n  ERR_UNKNOWN_ENCODING\n} = require('../../ours/errors').codes\nconst { errorOrDestroy } = destroyImpl\nObjectSetPrototypeOf(Writable.prototype, Stream.prototype)\nObjectSetPrototypeOf(Writable, Stream)\nfunction nop() {}\nconst kOnFinished = Symbol('kOnFinished')\nfunction WritableState(options, stream, isDuplex) {\n  // Duplex streams are both readable and writable, but share\n  // the same options object.\n  // However, some cases require setting options to different\n  // values for the readable and the writable sides of the duplex stream,\n  // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.\n  if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof require('./duplex')\n\n  // Object stream flag to indicate whether or not this stream\n  // contains buffers or objects.\n  this.objectMode = !!(options && options.objectMode)\n  if (isDuplex) this.objectMode = this.objectMode || !!(options && options.writableObjectMode)\n\n  // The point at which write() starts returning false\n  // Note: 0 is a valid value, means that we always return false if\n  // the entire buffer is not flushed immediately on write().\n  this.highWaterMark = options\n    ? getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex)\n    : getDefaultHighWaterMark(false)\n\n  // if _final has been called.\n  this.finalCalled = false\n\n  // drain event flag.\n  this.needDrain = false\n  // At the start of calling end()\n  this.ending = false\n  // When end() has been called, and returned.\n  this.ended = false\n  // When 'finish' is emitted.\n  this.finished = false\n\n  // Has it been destroyed\n  this.destroyed = false\n\n  // Should we decode strings into buffers before passing to _write?\n  // this is here so that some node-core streams can optimize string\n  // handling at a lower level.\n  const noDecode = !!(options && options.decodeStrings === false)\n  this.decodeStrings = !noDecode\n\n  // Crypto is kind of old and crusty.  Historically, its default string\n  // encoding is 'binary' so we have to make this configurable.\n  // Everything else in the universe uses 'utf8', though.\n  this.defaultEncoding = (options && options.defaultEncoding) || 'utf8'\n\n  // Not an actual buffer we keep track of, but a measurement\n  // of how much we're waiting to get pushed to some underlying\n  // socket or file.\n  this.length = 0\n\n  // A flag to see when we're in the middle of a write.\n  this.writing = false\n\n  // When true all writes will be buffered until .uncork() call.\n  this.corked = 0\n\n  // A flag to be able to tell if the onwrite cb is called immediately,\n  // or on a later tick.  We set this to true at first, because any\n  // actions that shouldn't happen until \"later\" should generally also\n  // not happen before the first write call.\n  this.sync = true\n\n  // A flag to know if we're processing previously buffered items, which\n  // may call the _write() callback in the same tick, so that we don't\n  // end up in an overlapped onwrite situation.\n  this.bufferProcessing = false\n\n  // The callback that's passed to _write(chunk, cb).\n  this.onwrite = onwrite.bind(undefined, stream)\n\n  // The callback that the user supplies to write(chunk, encoding, cb).\n  this.writecb = null\n\n  // The amount that is being written when _write is called.\n  this.writelen = 0\n\n  // Storage for data passed to the afterWrite() callback in case of\n  // synchronous _write() completion.\n  this.afterWriteTickInfo = null\n  resetBuffer(this)\n\n  // Number of pending user-supplied write callbacks\n  // this must be 0 before 'finish' can be emitted.\n  this.pendingcb = 0\n\n  // Stream is still being constructed and cannot be\n  // destroyed until construction finished or failed.\n  // Async construction is opt in, therefore we start as\n  // constructed.\n  this.constructed = true\n\n  // Emit prefinish if the only thing we're waiting for is _write cbs\n  // This is relevant for synchronous Transform streams.\n  this.prefinished = false\n\n  // True if the error was already emitted and should not be thrown again.\n  this.errorEmitted = false\n\n  // Should close be emitted on destroy. Defaults to true.\n  this.emitClose = !options || options.emitClose !== false\n\n  // Should .destroy() be called after 'finish' (and potentially 'end').\n  this.autoDestroy = !options || options.autoDestroy !== false\n\n  // Indicates whether the stream has errored. When true all write() calls\n  // should return false. This is needed since when autoDestroy\n  // is disabled we need a way to tell whether the stream has failed.\n  this.errored = null\n\n  // Indicates whether the stream has finished destroying.\n  this.closed = false\n\n  // True if close has been emitted or would have been emitted\n  // depending on emitClose.\n  this.closeEmitted = false\n  this[kOnFinished] = []\n}\nfunction resetBuffer(state) {\n  state.buffered = []\n  state.bufferedIndex = 0\n  state.allBuffers = true\n  state.allNoop = true\n}\nWritableState.prototype.getBuffer = function getBuffer() {\n  return ArrayPrototypeSlice(this.buffered, this.bufferedIndex)\n}\nObjectDefineProperty(WritableState.prototype, 'bufferedRequestCount', {\n  __proto__: null,\n  get() {\n    return this.buffered.length - this.bufferedIndex\n  }\n})\nfunction Writable(options) {\n  // Writable ctor is applied to Duplexes, too.\n  // `realHasInstance` is necessary because using plain `instanceof`\n  // would return false, as no `_writableState` property is attached.\n\n  // Trying to use the custom `instanceof` for Writable here will also break the\n  // Node.js LazyTransform implementation, which has a non-trivial getter for\n  // `_writableState` that would lead to infinite recursion.\n\n  // Checking for a Stream.Duplex instance is faster here instead of inside\n  // the WritableState constructor, at least with V8 6.5.\n  const isDuplex = this instanceof require('./duplex')\n  if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable, this)) return new Writable(options)\n  this._writableState = new WritableState(options, this, isDuplex)\n  if (options) {\n    if (typeof options.write === 'function') this._write = options.write\n    if (typeof options.writev === 'function') this._writev = options.writev\n    if (typeof options.destroy === 'function') this._destroy = options.destroy\n    if (typeof options.final === 'function') this._final = options.final\n    if (typeof options.construct === 'function') this._construct = options.construct\n    if (options.signal) addAbortSignal(options.signal, this)\n  }\n  Stream.call(this, options)\n  destroyImpl.construct(this, () => {\n    const state = this._writableState\n    if (!state.writing) {\n      clearBuffer(this, state)\n    }\n    finishMaybe(this, state)\n  })\n}\nObjectDefineProperty(Writable, SymbolHasInstance, {\n  __proto__: null,\n  value: function (object) {\n    if (FunctionPrototypeSymbolHasInstance(this, object)) return true\n    if (this !== Writable) return false\n    return object && object._writableState instanceof WritableState\n  }\n})\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n  errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE())\n}\nfunction _write(stream, chunk, encoding, cb) {\n  const state = stream._writableState\n  if (typeof encoding === 'function') {\n    cb = encoding\n    encoding = state.defaultEncoding\n  } else {\n    if (!encoding) encoding = state.defaultEncoding\n    else if (encoding !== 'buffer' && !Buffer.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding)\n    if (typeof cb !== 'function') cb = nop\n  }\n  if (chunk === null) {\n    throw new ERR_STREAM_NULL_VALUES()\n  } else if (!state.objectMode) {\n    if (typeof chunk === 'string') {\n      if (state.decodeStrings !== false) {\n        chunk = Buffer.from(chunk, encoding)\n        encoding = 'buffer'\n      }\n    } else if (chunk instanceof Buffer) {\n      encoding = 'buffer'\n    } else if (Stream._isUint8Array(chunk)) {\n      chunk = Stream._uint8ArrayToBuffer(chunk)\n      encoding = 'buffer'\n    } else {\n      throw new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk)\n    }\n  }\n  let err\n  if (state.ending) {\n    err = new ERR_STREAM_WRITE_AFTER_END()\n  } else if (state.destroyed) {\n    err = new ERR_STREAM_DESTROYED('write')\n  }\n  if (err) {\n    process.nextTick(cb, err)\n    errorOrDestroy(stream, err, true)\n    return err\n  }\n  state.pendingcb++\n  return writeOrBuffer(stream, state, chunk, encoding, cb)\n}\nWritable.prototype.write = function (chunk, encoding, cb) {\n  return _write(this, chunk, encoding, cb) === true\n}\nWritable.prototype.cork = function () {\n  this._writableState.corked++\n}\nWritable.prototype.uncork = function () {\n  const state = this._writableState\n  if (state.corked) {\n    state.corked--\n    if (!state.writing) clearBuffer(this, state)\n  }\n}\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n  // node::ParseEncoding() requires lower case.\n  if (typeof encoding === 'string') encoding = StringPrototypeToLowerCase(encoding)\n  if (!Buffer.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding)\n  this._writableState.defaultEncoding = encoding\n  return this\n}\n\n// If we're already writing something, then just put this\n// in the queue, and wait our turn.  Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, chunk, encoding, callback) {\n  const len = state.objectMode ? 1 : chunk.length\n  state.length += len\n\n  // stream._write resets state.length\n  const ret = state.length < state.highWaterMark\n  // We must ensure that previous needDrain will not be reset to false.\n  if (!ret) state.needDrain = true\n  if (state.writing || state.corked || state.errored || !state.constructed) {\n    state.buffered.push({\n      chunk,\n      encoding,\n      callback\n    })\n    if (state.allBuffers && encoding !== 'buffer') {\n      state.allBuffers = false\n    }\n    if (state.allNoop && callback !== nop) {\n      state.allNoop = false\n    }\n  } else {\n    state.writelen = len\n    state.writecb = callback\n    state.writing = true\n    state.sync = true\n    stream._write(chunk, encoding, state.onwrite)\n    state.sync = false\n  }\n\n  // Return false if errored or destroyed in order to break\n  // any synchronous while(stream.write(data)) loops.\n  return ret && !state.errored && !state.destroyed\n}\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n  state.writelen = len\n  state.writecb = cb\n  state.writing = true\n  state.sync = true\n  if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'))\n  else if (writev) stream._writev(chunk, state.onwrite)\n  else stream._write(chunk, encoding, state.onwrite)\n  state.sync = false\n}\nfunction onwriteError(stream, state, er, cb) {\n  --state.pendingcb\n  cb(er)\n  // Ensure callbacks are invoked even when autoDestroy is\n  // not enabled. Passing `er` here doesn't make sense since\n  // it's related to one specific write, not to the buffered\n  // writes.\n  errorBuffer(state)\n  // This can emit error, but error must always follow cb.\n  errorOrDestroy(stream, er)\n}\nfunction onwrite(stream, er) {\n  const state = stream._writableState\n  const sync = state.sync\n  const cb = state.writecb\n  if (typeof cb !== 'function') {\n    errorOrDestroy(stream, new ERR_MULTIPLE_CALLBACK())\n    return\n  }\n  state.writing = false\n  state.writecb = null\n  state.length -= state.writelen\n  state.writelen = 0\n  if (er) {\n    // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364\n    er.stack // eslint-disable-line no-unused-expressions\n\n    if (!state.errored) {\n      state.errored = er\n    }\n\n    // In case of duplex streams we need to notify the readable side of the\n    // error.\n    if (stream._readableState && !stream._readableState.errored) {\n      stream._readableState.errored = er\n    }\n    if (sync) {\n      process.nextTick(onwriteError, stream, state, er, cb)\n    } else {\n      onwriteError(stream, state, er, cb)\n    }\n  } else {\n    if (state.buffered.length > state.bufferedIndex) {\n      clearBuffer(stream, state)\n    }\n    if (sync) {\n      // It is a common case that the callback passed to .write() is always\n      // the same. In that case, we do not schedule a new nextTick(), but\n      // rather just increase a counter, to improve performance and avoid\n      // memory allocations.\n      if (state.afterWriteTickInfo !== null && state.afterWriteTickInfo.cb === cb) {\n        state.afterWriteTickInfo.count++\n      } else {\n        state.afterWriteTickInfo = {\n          count: 1,\n          cb,\n          stream,\n          state\n        }\n        process.nextTick(afterWriteTick, state.afterWriteTickInfo)\n      }\n    } else {\n      afterWrite(stream, state, 1, cb)\n    }\n  }\n}\nfunction afterWriteTick({ stream, state, count, cb }) {\n  state.afterWriteTickInfo = null\n  return afterWrite(stream, state, count, cb)\n}\nfunction afterWrite(stream, state, count, cb) {\n  const needDrain = !state.ending && !stream.destroyed && state.length === 0 && state.needDrain\n  if (needDrain) {\n    state.needDrain = false\n    stream.emit('drain')\n  }\n  while (count-- > 0) {\n    state.pendingcb--\n    cb()\n  }\n  if (state.destroyed) {\n    errorBuffer(state)\n  }\n  finishMaybe(stream, state)\n}\n\n// If there's something in the buffer waiting, then invoke callbacks.\nfunction errorBuffer(state) {\n  if (state.writing) {\n    return\n  }\n  for (let n = state.bufferedIndex; n < state.buffered.length; ++n) {\n    var _state$errored\n    const { chunk, callback } = state.buffered[n]\n    const len = state.objectMode ? 1 : chunk.length\n    state.length -= len\n    callback(\n      (_state$errored = state.errored) !== null && _state$errored !== undefined\n        ? _state$errored\n        : new ERR_STREAM_DESTROYED('write')\n    )\n  }\n  const onfinishCallbacks = state[kOnFinished].splice(0)\n  for (let i = 0; i < onfinishCallbacks.length; i++) {\n    var _state$errored2\n    onfinishCallbacks[i](\n      (_state$errored2 = state.errored) !== null && _state$errored2 !== undefined\n        ? _state$errored2\n        : new ERR_STREAM_DESTROYED('end')\n    )\n  }\n  resetBuffer(state)\n}\n\n// If there's something in the buffer waiting, then process it.\nfunction clearBuffer(stream, state) {\n  if (state.corked || state.bufferProcessing || state.destroyed || !state.constructed) {\n    return\n  }\n  const { buffered, bufferedIndex, objectMode } = state\n  const bufferedLength = buffered.length - bufferedIndex\n  if (!bufferedLength) {\n    return\n  }\n  let i = bufferedIndex\n  state.bufferProcessing = true\n  if (bufferedLength > 1 && stream._writev) {\n    state.pendingcb -= bufferedLength - 1\n    const callback = state.allNoop\n      ? nop\n      : (err) => {\n          for (let n = i; n < buffered.length; ++n) {\n            buffered[n].callback(err)\n          }\n        }\n    // Make a copy of `buffered` if it's going to be used by `callback` above,\n    // since `doWrite` will mutate the array.\n    const chunks = state.allNoop && i === 0 ? buffered : ArrayPrototypeSlice(buffered, i)\n    chunks.allBuffers = state.allBuffers\n    doWrite(stream, state, true, state.length, chunks, '', callback)\n    resetBuffer(state)\n  } else {\n    do {\n      const { chunk, encoding, callback } = buffered[i]\n      buffered[i++] = null\n      const len = objectMode ? 1 : chunk.length\n      doWrite(stream, state, false, len, chunk, encoding, callback)\n    } while (i < buffered.length && !state.writing)\n    if (i === buffered.length) {\n      resetBuffer(state)\n    } else if (i > 256) {\n      buffered.splice(0, i)\n      state.bufferedIndex = 0\n    } else {\n      state.bufferedIndex = i\n    }\n  }\n  state.bufferProcessing = false\n}\nWritable.prototype._write = function (chunk, encoding, cb) {\n  if (this._writev) {\n    this._writev(\n      [\n        {\n          chunk,\n          encoding\n        }\n      ],\n      cb\n    )\n  } else {\n    throw new ERR_METHOD_NOT_IMPLEMENTED('_write()')\n  }\n}\nWritable.prototype._writev = null\nWritable.prototype.end = function (chunk, encoding, cb) {\n  const state = this._writableState\n  if (typeof chunk === 'function') {\n    cb = chunk\n    chunk = null\n    encoding = null\n  } else if (typeof encoding === 'function') {\n    cb = encoding\n    encoding = null\n  }\n  let err\n  if (chunk !== null && chunk !== undefined) {\n    const ret = _write(this, chunk, encoding)\n    if (ret instanceof Error) {\n      err = ret\n    }\n  }\n\n  // .end() fully uncorks.\n  if (state.corked) {\n    state.corked = 1\n    this.uncork()\n  }\n  if (err) {\n    // Do nothing...\n  } else if (!state.errored && !state.ending) {\n    // This is forgiving in terms of unnecessary calls to end() and can hide\n    // logic errors. However, usually such errors are harmless and causing a\n    // hard error can be disproportionately destructive. It is not always\n    // trivial for the user to determine whether end() needs to be called\n    // or not.\n\n    state.ending = true\n    finishMaybe(this, state, true)\n    state.ended = true\n  } else if (state.finished) {\n    err = new ERR_STREAM_ALREADY_FINISHED('end')\n  } else if (state.destroyed) {\n    err = new ERR_STREAM_DESTROYED('end')\n  }\n  if (typeof cb === 'function') {\n    if (err || state.finished) {\n      process.nextTick(cb, err)\n    } else {\n      state[kOnFinished].push(cb)\n    }\n  }\n  return this\n}\nfunction needFinish(state) {\n  return (\n    state.ending &&\n    !state.destroyed &&\n    state.constructed &&\n    state.length === 0 &&\n    !state.errored &&\n    state.buffered.length === 0 &&\n    !state.finished &&\n    !state.writing &&\n    !state.errorEmitted &&\n    !state.closeEmitted\n  )\n}\nfunction callFinal(stream, state) {\n  let called = false\n  function onFinish(err) {\n    if (called) {\n      errorOrDestroy(stream, err !== null && err !== undefined ? err : ERR_MULTIPLE_CALLBACK())\n      return\n    }\n    called = true\n    state.pendingcb--\n    if (err) {\n      const onfinishCallbacks = state[kOnFinished].splice(0)\n      for (let i = 0; i < onfinishCallbacks.length; i++) {\n        onfinishCallbacks[i](err)\n      }\n      errorOrDestroy(stream, err, state.sync)\n    } else if (needFinish(state)) {\n      state.prefinished = true\n      stream.emit('prefinish')\n      // Backwards compat. Don't check state.sync here.\n      // Some streams assume 'finish' will be emitted\n      // asynchronously relative to _final callback.\n      state.pendingcb++\n      process.nextTick(finish, stream, state)\n    }\n  }\n  state.sync = true\n  state.pendingcb++\n  try {\n    stream._final(onFinish)\n  } catch (err) {\n    onFinish(err)\n  }\n  state.sync = false\n}\nfunction prefinish(stream, state) {\n  if (!state.prefinished && !state.finalCalled) {\n    if (typeof stream._final === 'function' && !state.destroyed) {\n      state.finalCalled = true\n      callFinal(stream, state)\n    } else {\n      state.prefinished = true\n      stream.emit('prefinish')\n    }\n  }\n}\nfunction finishMaybe(stream, state, sync) {\n  if (needFinish(state)) {\n    prefinish(stream, state)\n    if (state.pendingcb === 0) {\n      if (sync) {\n        state.pendingcb++\n        process.nextTick(\n          (stream, state) => {\n            if (needFinish(state)) {\n              finish(stream, state)\n            } else {\n              state.pendingcb--\n            }\n          },\n          stream,\n          state\n        )\n      } else if (needFinish(state)) {\n        state.pendingcb++\n        finish(stream, state)\n      }\n    }\n  }\n}\nfunction finish(stream, state) {\n  state.pendingcb--\n  state.finished = true\n  const onfinishCallbacks = state[kOnFinished].splice(0)\n  for (let i = 0; i < onfinishCallbacks.length; i++) {\n    onfinishCallbacks[i]()\n  }\n  stream.emit('finish')\n  if (state.autoDestroy) {\n    // In case of duplex streams we need a way to detect\n    // if the readable side is ready for autoDestroy as well.\n    const rState = stream._readableState\n    const autoDestroy =\n      !rState ||\n      (rState.autoDestroy &&\n        // We don't expect the readable to ever 'end'\n        // if readable is explicitly set to false.\n        (rState.endEmitted || rState.readable === false))\n    if (autoDestroy) {\n      stream.destroy()\n    }\n  }\n}\nObjectDefineProperties(Writable.prototype, {\n  closed: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.closed : false\n    }\n  },\n  destroyed: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.destroyed : false\n    },\n    set(value) {\n      // Backward compatibility, the user is explicitly managing destroyed.\n      if (this._writableState) {\n        this._writableState.destroyed = value\n      }\n    }\n  },\n  writable: {\n    __proto__: null,\n    get() {\n      const w = this._writableState\n      // w.writable === false means that this is part of a Duplex stream\n      // where the writable side was disabled upon construction.\n      // Compat. The user might manually disable writable side through\n      // deprecated setter.\n      return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended\n    },\n    set(val) {\n      // Backwards compatible.\n      if (this._writableState) {\n        this._writableState.writable = !!val\n      }\n    }\n  },\n  writableFinished: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.finished : false\n    }\n  },\n  writableObjectMode: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.objectMode : false\n    }\n  },\n  writableBuffer: {\n    __proto__: null,\n    get() {\n      return this._writableState && this._writableState.getBuffer()\n    }\n  },\n  writableEnded: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.ending : false\n    }\n  },\n  writableNeedDrain: {\n    __proto__: null,\n    get() {\n      const wState = this._writableState\n      if (!wState) return false\n      return !wState.destroyed && !wState.ending && wState.needDrain\n    }\n  },\n  writableHighWaterMark: {\n    __proto__: null,\n    get() {\n      return this._writableState && this._writableState.highWaterMark\n    }\n  },\n  writableCorked: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.corked : 0\n    }\n  },\n  writableLength: {\n    __proto__: null,\n    get() {\n      return this._writableState && this._writableState.length\n    }\n  },\n  errored: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._writableState ? this._writableState.errored : null\n    }\n  },\n  writableAborted: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return !!(\n        this._writableState.writable !== false &&\n        (this._writableState.destroyed || this._writableState.errored) &&\n        !this._writableState.finished\n      )\n    }\n  }\n})\nconst destroy = destroyImpl.destroy\nWritable.prototype.destroy = function (err, cb) {\n  const state = this._writableState\n\n  // Invoke pending callbacks.\n  if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length)) {\n    process.nextTick(errorBuffer, state)\n  }\n  destroy.call(this, err, cb)\n  return this\n}\nWritable.prototype._undestroy = destroyImpl.undestroy\nWritable.prototype._destroy = function (err, cb) {\n  cb(err)\n}\nWritable.prototype[EE.captureRejectionSymbol] = function (err) {\n  this.destroy(err)\n}\nlet webStreamsAdapters\n\n// Lazy to avoid circular references\nfunction lazyWebStreams() {\n  if (webStreamsAdapters === undefined) webStreamsAdapters = {}\n  return webStreamsAdapters\n}\nWritable.fromWeb = function (writableStream, options) {\n  return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options)\n}\nWritable.toWeb = function (streamWritable) {\n  return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable)\n}\n","/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\n;('use strict')\nconst bufferModule = require('buffer')\nconst {\n  isReadable,\n  isWritable,\n  isIterable,\n  isNodeStream,\n  isReadableNodeStream,\n  isWritableNodeStream,\n  isDuplexNodeStream,\n  isReadableStream,\n  isWritableStream\n} = require('./utils')\nconst eos = require('./end-of-stream')\nconst {\n  AbortError,\n  codes: { ERR_INVALID_ARG_TYPE, ERR_INVALID_RETURN_VALUE }\n} = require('../../ours/errors')\nconst { destroyer } = require('./destroy')\nconst Duplex = require('./duplex')\nconst Readable = require('./readable')\nconst Writable = require('./writable')\nconst { createDeferredPromise } = require('../../ours/util')\nconst from = require('./from')\nconst Blob = globalThis.Blob || bufferModule.Blob\nconst isBlob =\n  typeof Blob !== 'undefined'\n    ? function isBlob(b) {\n        return b instanceof Blob\n      }\n    : function isBlob(b) {\n        return false\n      }\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nconst { FunctionPrototypeCall } = require('../../ours/primordials')\n\n// This is needed for pre node 17.\nclass Duplexify extends Duplex {\n  constructor(options) {\n    super(options)\n\n    // https://github.com/nodejs/node/pull/34385\n\n    if ((options === null || options === undefined ? undefined : options.readable) === false) {\n      this._readableState.readable = false\n      this._readableState.ended = true\n      this._readableState.endEmitted = true\n    }\n    if ((options === null || options === undefined ? undefined : options.writable) === false) {\n      this._writableState.writable = false\n      this._writableState.ending = true\n      this._writableState.ended = true\n      this._writableState.finished = true\n    }\n  }\n}\nmodule.exports = function duplexify(body, name) {\n  if (isDuplexNodeStream(body)) {\n    return body\n  }\n  if (isReadableNodeStream(body)) {\n    return _duplexify({\n      readable: body\n    })\n  }\n  if (isWritableNodeStream(body)) {\n    return _duplexify({\n      writable: body\n    })\n  }\n  if (isNodeStream(body)) {\n    return _duplexify({\n      writable: false,\n      readable: false\n    })\n  }\n  if (isReadableStream(body)) {\n    return _duplexify({\n      readable: Readable.fromWeb(body)\n    })\n  }\n  if (isWritableStream(body)) {\n    return _duplexify({\n      writable: Writable.fromWeb(body)\n    })\n  }\n  if (typeof body === 'function') {\n    const { value, write, final, destroy } = fromAsyncGen(body)\n    if (isIterable(value)) {\n      return from(Duplexify, value, {\n        // TODO (ronag): highWaterMark?\n        objectMode: true,\n        write,\n        final,\n        destroy\n      })\n    }\n    const then = value === null || value === undefined ? undefined : value.then\n    if (typeof then === 'function') {\n      let d\n      const promise = FunctionPrototypeCall(\n        then,\n        value,\n        (val) => {\n          if (val != null) {\n            throw new ERR_INVALID_RETURN_VALUE('nully', 'body', val)\n          }\n        },\n        (err) => {\n          destroyer(d, err)\n        }\n      )\n      return (d = new Duplexify({\n        // TODO (ronag): highWaterMark?\n        objectMode: true,\n        readable: false,\n        write,\n        final(cb) {\n          final(async () => {\n            try {\n              await promise\n              process.nextTick(cb, null)\n            } catch (err) {\n              process.nextTick(cb, err)\n            }\n          })\n        },\n        destroy\n      }))\n    }\n    throw new ERR_INVALID_RETURN_VALUE('Iterable, AsyncIterable or AsyncFunction', name, value)\n  }\n  if (isBlob(body)) {\n    return duplexify(body.arrayBuffer())\n  }\n  if (isIterable(body)) {\n    return from(Duplexify, body, {\n      // TODO (ronag): highWaterMark?\n      objectMode: true,\n      writable: false\n    })\n  }\n  if (\n    isReadableStream(body === null || body === undefined ? undefined : body.readable) &&\n    isWritableStream(body === null || body === undefined ? undefined : body.writable)\n  ) {\n    return Duplexify.fromWeb(body)\n  }\n  if (\n    typeof (body === null || body === undefined ? undefined : body.writable) === 'object' ||\n    typeof (body === null || body === undefined ? undefined : body.readable) === 'object'\n  ) {\n    const readable =\n      body !== null && body !== undefined && body.readable\n        ? isReadableNodeStream(body === null || body === undefined ? undefined : body.readable)\n          ? body === null || body === undefined\n            ? undefined\n            : body.readable\n          : duplexify(body.readable)\n        : undefined\n    const writable =\n      body !== null && body !== undefined && body.writable\n        ? isWritableNodeStream(body === null || body === undefined ? undefined : body.writable)\n          ? body === null || body === undefined\n            ? undefined\n            : body.writable\n          : duplexify(body.writable)\n        : undefined\n    return _duplexify({\n      readable,\n      writable\n    })\n  }\n  const then = body === null || body === undefined ? undefined : body.then\n  if (typeof then === 'function') {\n    let d\n    FunctionPrototypeCall(\n      then,\n      body,\n      (val) => {\n        if (val != null) {\n          d.push(val)\n        }\n        d.push(null)\n      },\n      (err) => {\n        destroyer(d, err)\n      }\n    )\n    return (d = new Duplexify({\n      objectMode: true,\n      writable: false,\n      read() {}\n    }))\n  }\n  throw new ERR_INVALID_ARG_TYPE(\n    name,\n    [\n      'Blob',\n      'ReadableStream',\n      'WritableStream',\n      'Stream',\n      'Iterable',\n      'AsyncIterable',\n      'Function',\n      '{ readable, writable } pair',\n      'Promise'\n    ],\n    body\n  )\n}\nfunction fromAsyncGen(fn) {\n  let { promise, resolve } = createDeferredPromise()\n  const ac = new AbortController()\n  const signal = ac.signal\n  const value = fn(\n    (async function* () {\n      while (true) {\n        const _promise = promise\n        promise = null\n        const { chunk, done, cb } = await _promise\n        process.nextTick(cb)\n        if (done) return\n        if (signal.aborted)\n          throw new AbortError(undefined, {\n            cause: signal.reason\n          })\n        ;({ promise, resolve } = createDeferredPromise())\n        yield chunk\n      }\n    })(),\n    {\n      signal\n    }\n  )\n  return {\n    value,\n    write(chunk, encoding, cb) {\n      const _resolve = resolve\n      resolve = null\n      _resolve({\n        chunk,\n        done: false,\n        cb\n      })\n    },\n    final(cb) {\n      const _resolve = resolve\n      resolve = null\n      _resolve({\n        done: true,\n        cb\n      })\n    },\n    destroy(err, cb) {\n      ac.abort()\n      cb(err)\n    }\n  }\n}\nfunction _duplexify(pair) {\n  const r = pair.readable && typeof pair.readable.read !== 'function' ? Readable.wrap(pair.readable) : pair.readable\n  const w = pair.writable\n  let readable = !!isReadable(r)\n  let writable = !!isWritable(w)\n  let ondrain\n  let onfinish\n  let onreadable\n  let onclose\n  let d\n  function onfinished(err) {\n    const cb = onclose\n    onclose = null\n    if (cb) {\n      cb(err)\n    } else if (err) {\n      d.destroy(err)\n    }\n  }\n\n  // TODO(ronag): Avoid double buffering.\n  // Implement Writable/Readable/Duplex traits.\n  // See, https://github.com/nodejs/node/pull/33515.\n  d = new Duplexify({\n    // TODO (ronag): highWaterMark?\n    readableObjectMode: !!(r !== null && r !== undefined && r.readableObjectMode),\n    writableObjectMode: !!(w !== null && w !== undefined && w.writableObjectMode),\n    readable,\n    writable\n  })\n  if (writable) {\n    eos(w, (err) => {\n      writable = false\n      if (err) {\n        destroyer(r, err)\n      }\n      onfinished(err)\n    })\n    d._write = function (chunk, encoding, callback) {\n      if (w.write(chunk, encoding)) {\n        callback()\n      } else {\n        ondrain = callback\n      }\n    }\n    d._final = function (callback) {\n      w.end()\n      onfinish = callback\n    }\n    w.on('drain', function () {\n      if (ondrain) {\n        const cb = ondrain\n        ondrain = null\n        cb()\n      }\n    })\n    w.on('finish', function () {\n      if (onfinish) {\n        const cb = onfinish\n        onfinish = null\n        cb()\n      }\n    })\n  }\n  if (readable) {\n    eos(r, (err) => {\n      readable = false\n      if (err) {\n        destroyer(r, err)\n      }\n      onfinished(err)\n    })\n    r.on('readable', function () {\n      if (onreadable) {\n        const cb = onreadable\n        onreadable = null\n        cb()\n      }\n    })\n    r.on('end', function () {\n      d.push(null)\n    })\n    d._read = function () {\n      while (true) {\n        const buf = r.read()\n        if (buf === null) {\n          onreadable = d._read\n          return\n        }\n        if (!d.push(buf)) {\n          return\n        }\n      }\n    }\n  }\n  d._destroy = function (err, callback) {\n    if (!err && onclose !== null) {\n      err = new AbortError()\n    }\n    onreadable = null\n    ondrain = null\n    onfinish = null\n    if (onclose === null) {\n      callback(err)\n    } else {\n      onclose = callback\n      destroyer(w, err)\n      destroyer(r, err)\n    }\n  }\n  return d\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototype inheritance, this class\n// prototypically inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict'\n\nconst {\n  ObjectDefineProperties,\n  ObjectGetOwnPropertyDescriptor,\n  ObjectKeys,\n  ObjectSetPrototypeOf\n} = require('../../ours/primordials')\nmodule.exports = Duplex\nconst Readable = require('./readable')\nconst Writable = require('./writable')\nObjectSetPrototypeOf(Duplex.prototype, Readable.prototype)\nObjectSetPrototypeOf(Duplex, Readable)\n{\n  const keys = ObjectKeys(Writable.prototype)\n  // Allow the keys array to be GC'ed.\n  for (let i = 0; i < keys.length; i++) {\n    const method = keys[i]\n    if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]\n  }\n}\nfunction Duplex(options) {\n  if (!(this instanceof Duplex)) return new Duplex(options)\n  Readable.call(this, options)\n  Writable.call(this, options)\n  if (options) {\n    this.allowHalfOpen = options.allowHalfOpen !== false\n    if (options.readable === false) {\n      this._readableState.readable = false\n      this._readableState.ended = true\n      this._readableState.endEmitted = true\n    }\n    if (options.writable === false) {\n      this._writableState.writable = false\n      this._writableState.ending = true\n      this._writableState.ended = true\n      this._writableState.finished = true\n    }\n  } else {\n    this.allowHalfOpen = true\n  }\n}\nObjectDefineProperties(Duplex.prototype, {\n  writable: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writable')\n  },\n  writableHighWaterMark: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableHighWaterMark')\n  },\n  writableObjectMode: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableObjectMode')\n  },\n  writableBuffer: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableBuffer')\n  },\n  writableLength: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableLength')\n  },\n  writableFinished: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableFinished')\n  },\n  writableCorked: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableCorked')\n  },\n  writableEnded: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableEnded')\n  },\n  writableNeedDrain: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableNeedDrain')\n  },\n  destroyed: {\n    __proto__: null,\n    get() {\n      if (this._readableState === undefined || this._writableState === undefined) {\n        return false\n      }\n      return this._readableState.destroyed && this._writableState.destroyed\n    },\n    set(value) {\n      // Backward compatibility, the user is explicitly\n      // managing destroyed.\n      if (this._readableState && this._writableState) {\n        this._readableState.destroyed = value\n        this._writableState.destroyed = value\n      }\n    }\n  }\n})\nlet webStreamsAdapters\n\n// Lazy to avoid circular references\nfunction lazyWebStreams() {\n  if (webStreamsAdapters === undefined) webStreamsAdapters = {}\n  return webStreamsAdapters\n}\nDuplex.fromWeb = function (pair, options) {\n  return lazyWebStreams().newStreamDuplexFromReadableWritablePair(pair, options)\n}\nDuplex.toWeb = function (duplex) {\n  return lazyWebStreams().newReadableWritablePairFromDuplex(duplex)\n}\nlet duplexify\nDuplex.from = function (body) {\n  if (!duplexify) {\n    duplexify = require('./duplexify')\n  }\n  return duplexify(body, 'body')\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data.  Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored.  (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation.  For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes.  When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up.  When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer.  When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks.  If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk.  However,\n// a pathological inflate type of transform can cause excessive buffering\n// here.  For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output.  Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output.  In this case, you could write a very small\n// amount of input, and end up with a very large amount of output.  In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform.  A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict'\n\nconst { ObjectSetPrototypeOf, Symbol } = require('../../ours/primordials')\nmodule.exports = Transform\nconst { ERR_METHOD_NOT_IMPLEMENTED } = require('../../ours/errors').codes\nconst Duplex = require('./duplex')\nconst { getHighWaterMark } = require('./state')\nObjectSetPrototypeOf(Transform.prototype, Duplex.prototype)\nObjectSetPrototypeOf(Transform, Duplex)\nconst kCallback = Symbol('kCallback')\nfunction Transform(options) {\n  if (!(this instanceof Transform)) return new Transform(options)\n\n  // TODO (ronag): This should preferably always be\n  // applied but would be semver-major. Or even better;\n  // make Transform a Readable with the Writable interface.\n  const readableHighWaterMark = options ? getHighWaterMark(this, options, 'readableHighWaterMark', true) : null\n  if (readableHighWaterMark === 0) {\n    // A Duplex will buffer both on the writable and readable side while\n    // a Transform just wants to buffer hwm number of elements. To avoid\n    // buffering twice we disable buffering on the writable side.\n    options = {\n      ...options,\n      highWaterMark: null,\n      readableHighWaterMark,\n      // TODO (ronag): 0 is not optimal since we have\n      // a \"bug\" where we check needDrain before calling _write and not after.\n      // Refs: https://github.com/nodejs/node/pull/32887\n      // Refs: https://github.com/nodejs/node/pull/35941\n      writableHighWaterMark: options.writableHighWaterMark || 0\n    }\n  }\n  Duplex.call(this, options)\n\n  // We have implemented the _read method, and done the other things\n  // that Readable wants before the first _read call, so unset the\n  // sync guard flag.\n  this._readableState.sync = false\n  this[kCallback] = null\n  if (options) {\n    if (typeof options.transform === 'function') this._transform = options.transform\n    if (typeof options.flush === 'function') this._flush = options.flush\n  }\n\n  // When the writable side finishes, then flush out anything remaining.\n  // Backwards compat. Some Transform streams incorrectly implement _final\n  // instead of or in addition to _flush. By using 'prefinish' instead of\n  // implementing _final we continue supporting this unfortunate use case.\n  this.on('prefinish', prefinish)\n}\nfunction final(cb) {\n  if (typeof this._flush === 'function' && !this.destroyed) {\n    this._flush((er, data) => {\n      if (er) {\n        if (cb) {\n          cb(er)\n        } else {\n          this.destroy(er)\n        }\n        return\n      }\n      if (data != null) {\n        this.push(data)\n      }\n      this.push(null)\n      if (cb) {\n        cb()\n      }\n    })\n  } else {\n    this.push(null)\n    if (cb) {\n      cb()\n    }\n  }\n}\nfunction prefinish() {\n  if (this._final !== final) {\n    final.call(this)\n  }\n}\nTransform.prototype._final = final\nTransform.prototype._transform = function (chunk, encoding, callback) {\n  throw new ERR_METHOD_NOT_IMPLEMENTED('_transform()')\n}\nTransform.prototype._write = function (chunk, encoding, callback) {\n  const rState = this._readableState\n  const wState = this._writableState\n  const length = rState.length\n  this._transform(chunk, encoding, (err, val) => {\n    if (err) {\n      callback(err)\n      return\n    }\n    if (val != null) {\n      this.push(val)\n    }\n    if (\n      wState.ended ||\n      // Backwards compat.\n      length === rState.length ||\n      // Backwards compat.\n      rState.length < rState.highWaterMark\n    ) {\n      callback()\n    } else {\n      this[kCallback] = callback\n    }\n  })\n}\nTransform.prototype._read = function () {\n  if (this[kCallback]) {\n    const callback = this[kCallback]\n    this[kCallback] = null\n    callback()\n  }\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict'\n\nconst { ObjectSetPrototypeOf } = require('../../ours/primordials')\nmodule.exports = PassThrough\nconst Transform = require('./transform')\nObjectSetPrototypeOf(PassThrough.prototype, Transform.prototype)\nObjectSetPrototypeOf(PassThrough, Transform)\nfunction PassThrough(options) {\n  if (!(this instanceof PassThrough)) return new PassThrough(options)\n  Transform.call(this, options)\n}\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n  cb(null, chunk)\n}\n","/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n// Ported from https://github.com/mafintosh/pump with\n// permission from the author, Mathias Buus (@mafintosh).\n\n;('use strict')\nconst { ArrayIsArray, Promise, SymbolAsyncIterator, SymbolDispose } = require('../../ours/primordials')\nconst eos = require('./end-of-stream')\nconst { once } = require('../../ours/util')\nconst destroyImpl = require('./destroy')\nconst Duplex = require('./duplex')\nconst {\n  aggregateTwoErrors,\n  codes: {\n    ERR_INVALID_ARG_TYPE,\n    ERR_INVALID_RETURN_VALUE,\n    ERR_MISSING_ARGS,\n    ERR_STREAM_DESTROYED,\n    ERR_STREAM_PREMATURE_CLOSE\n  },\n  AbortError\n} = require('../../ours/errors')\nconst { validateFunction, validateAbortSignal } = require('../validators')\nconst {\n  isIterable,\n  isReadable,\n  isReadableNodeStream,\n  isNodeStream,\n  isTransformStream,\n  isWebStream,\n  isReadableStream,\n  isReadableFinished\n} = require('./utils')\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nlet PassThrough\nlet Readable\nlet addAbortListener\nfunction destroyer(stream, reading, writing) {\n  let finished = false\n  stream.on('close', () => {\n    finished = true\n  })\n  const cleanup = eos(\n    stream,\n    {\n      readable: reading,\n      writable: writing\n    },\n    (err) => {\n      finished = !err\n    }\n  )\n  return {\n    destroy: (err) => {\n      if (finished) return\n      finished = true\n      destroyImpl.destroyer(stream, err || new ERR_STREAM_DESTROYED('pipe'))\n    },\n    cleanup\n  }\n}\nfunction popCallback(streams) {\n  // Streams should never be an empty array. It should always contain at least\n  // a single stream. Therefore optimize for the average case instead of\n  // checking for length === 0 as well.\n  validateFunction(streams[streams.length - 1], 'streams[stream.length - 1]')\n  return streams.pop()\n}\nfunction makeAsyncIterable(val) {\n  if (isIterable(val)) {\n    return val\n  } else if (isReadableNodeStream(val)) {\n    // Legacy streams are not Iterable.\n    return fromReadable(val)\n  }\n  throw new ERR_INVALID_ARG_TYPE('val', ['Readable', 'Iterable', 'AsyncIterable'], val)\n}\nasync function* fromReadable(val) {\n  if (!Readable) {\n    Readable = require('./readable')\n  }\n  yield* Readable.prototype[SymbolAsyncIterator].call(val)\n}\nasync function pumpToNode(iterable, writable, finish, { end }) {\n  let error\n  let onresolve = null\n  const resume = (err) => {\n    if (err) {\n      error = err\n    }\n    if (onresolve) {\n      const callback = onresolve\n      onresolve = null\n      callback()\n    }\n  }\n  const wait = () =>\n    new Promise((resolve, reject) => {\n      if (error) {\n        reject(error)\n      } else {\n        onresolve = () => {\n          if (error) {\n            reject(error)\n          } else {\n            resolve()\n          }\n        }\n      }\n    })\n  writable.on('drain', resume)\n  const cleanup = eos(\n    writable,\n    {\n      readable: false\n    },\n    resume\n  )\n  try {\n    if (writable.writableNeedDrain) {\n      await wait()\n    }\n    for await (const chunk of iterable) {\n      if (!writable.write(chunk)) {\n        await wait()\n      }\n    }\n    if (end) {\n      writable.end()\n      await wait()\n    }\n    finish()\n  } catch (err) {\n    finish(error !== err ? aggregateTwoErrors(error, err) : err)\n  } finally {\n    cleanup()\n    writable.off('drain', resume)\n  }\n}\nasync function pumpToWeb(readable, writable, finish, { end }) {\n  if (isTransformStream(writable)) {\n    writable = writable.writable\n  }\n  // https://streams.spec.whatwg.org/#example-manual-write-with-backpressure\n  const writer = writable.getWriter()\n  try {\n    for await (const chunk of readable) {\n      await writer.ready\n      writer.write(chunk).catch(() => {})\n    }\n    await writer.ready\n    if (end) {\n      await writer.close()\n    }\n    finish()\n  } catch (err) {\n    try {\n      await writer.abort(err)\n      finish(err)\n    } catch (err) {\n      finish(err)\n    }\n  }\n}\nfunction pipeline(...streams) {\n  return pipelineImpl(streams, once(popCallback(streams)))\n}\nfunction pipelineImpl(streams, callback, opts) {\n  if (streams.length === 1 && ArrayIsArray(streams[0])) {\n    streams = streams[0]\n  }\n  if (streams.length < 2) {\n    throw new ERR_MISSING_ARGS('streams')\n  }\n  const ac = new AbortController()\n  const signal = ac.signal\n  const outerSignal = opts === null || opts === undefined ? undefined : opts.signal\n\n  // Need to cleanup event listeners if last stream is readable\n  // https://github.com/nodejs/node/issues/35452\n  const lastStreamCleanup = []\n  validateAbortSignal(outerSignal, 'options.signal')\n  function abort() {\n    finishImpl(new AbortError())\n  }\n  addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n  let disposable\n  if (outerSignal) {\n    disposable = addAbortListener(outerSignal, abort)\n  }\n  let error\n  let value\n  const destroys = []\n  let finishCount = 0\n  function finish(err) {\n    finishImpl(err, --finishCount === 0)\n  }\n  function finishImpl(err, final) {\n    var _disposable\n    if (err && (!error || error.code === 'ERR_STREAM_PREMATURE_CLOSE')) {\n      error = err\n    }\n    if (!error && !final) {\n      return\n    }\n    while (destroys.length) {\n      destroys.shift()(error)\n    }\n    ;(_disposable = disposable) === null || _disposable === undefined ? undefined : _disposable[SymbolDispose]()\n    ac.abort()\n    if (final) {\n      if (!error) {\n        lastStreamCleanup.forEach((fn) => fn())\n      }\n      process.nextTick(callback, error, value)\n    }\n  }\n  let ret\n  for (let i = 0; i < streams.length; i++) {\n    const stream = streams[i]\n    const reading = i < streams.length - 1\n    const writing = i > 0\n    const end = reading || (opts === null || opts === undefined ? undefined : opts.end) !== false\n    const isLastStream = i === streams.length - 1\n    if (isNodeStream(stream)) {\n      if (end) {\n        const { destroy, cleanup } = destroyer(stream, reading, writing)\n        destroys.push(destroy)\n        if (isReadable(stream) && isLastStream) {\n          lastStreamCleanup.push(cleanup)\n        }\n      }\n\n      // Catch stream errors that occur after pipe/pump has completed.\n      function onError(err) {\n        if (err && err.name !== 'AbortError' && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {\n          finish(err)\n        }\n      }\n      stream.on('error', onError)\n      if (isReadable(stream) && isLastStream) {\n        lastStreamCleanup.push(() => {\n          stream.removeListener('error', onError)\n        })\n      }\n    }\n    if (i === 0) {\n      if (typeof stream === 'function') {\n        ret = stream({\n          signal\n        })\n        if (!isIterable(ret)) {\n          throw new ERR_INVALID_RETURN_VALUE('Iterable, AsyncIterable or Stream', 'source', ret)\n        }\n      } else if (isIterable(stream) || isReadableNodeStream(stream) || isTransformStream(stream)) {\n        ret = stream\n      } else {\n        ret = Duplex.from(stream)\n      }\n    } else if (typeof stream === 'function') {\n      if (isTransformStream(ret)) {\n        var _ret\n        ret = makeAsyncIterable((_ret = ret) === null || _ret === undefined ? undefined : _ret.readable)\n      } else {\n        ret = makeAsyncIterable(ret)\n      }\n      ret = stream(ret, {\n        signal\n      })\n      if (reading) {\n        if (!isIterable(ret, true)) {\n          throw new ERR_INVALID_RETURN_VALUE('AsyncIterable', `transform[${i - 1}]`, ret)\n        }\n      } else {\n        var _ret2\n        if (!PassThrough) {\n          PassThrough = require('./passthrough')\n        }\n\n        // If the last argument to pipeline is not a stream\n        // we must create a proxy stream so that pipeline(...)\n        // always returns a stream which can be further\n        // composed through `.pipe(stream)`.\n\n        const pt = new PassThrough({\n          objectMode: true\n        })\n\n        // Handle Promises/A+ spec, `then` could be a getter that throws on\n        // second use.\n        const then = (_ret2 = ret) === null || _ret2 === undefined ? undefined : _ret2.then\n        if (typeof then === 'function') {\n          finishCount++\n          then.call(\n            ret,\n            (val) => {\n              value = val\n              if (val != null) {\n                pt.write(val)\n              }\n              if (end) {\n                pt.end()\n              }\n              process.nextTick(finish)\n            },\n            (err) => {\n              pt.destroy(err)\n              process.nextTick(finish, err)\n            }\n          )\n        } else if (isIterable(ret, true)) {\n          finishCount++\n          pumpToNode(ret, pt, finish, {\n            end\n          })\n        } else if (isReadableStream(ret) || isTransformStream(ret)) {\n          const toRead = ret.readable || ret\n          finishCount++\n          pumpToNode(toRead, pt, finish, {\n            end\n          })\n        } else {\n          throw new ERR_INVALID_RETURN_VALUE('AsyncIterable or Promise', 'destination', ret)\n        }\n        ret = pt\n        const { destroy, cleanup } = destroyer(ret, false, true)\n        destroys.push(destroy)\n        if (isLastStream) {\n          lastStreamCleanup.push(cleanup)\n        }\n      }\n    } else if (isNodeStream(stream)) {\n      if (isReadableNodeStream(ret)) {\n        finishCount += 2\n        const cleanup = pipe(ret, stream, finish, {\n          end\n        })\n        if (isReadable(stream) && isLastStream) {\n          lastStreamCleanup.push(cleanup)\n        }\n      } else if (isTransformStream(ret) || isReadableStream(ret)) {\n        const toRead = ret.readable || ret\n        finishCount++\n        pumpToNode(toRead, stream, finish, {\n          end\n        })\n      } else if (isIterable(ret)) {\n        finishCount++\n        pumpToNode(ret, stream, finish, {\n          end\n        })\n      } else {\n        throw new ERR_INVALID_ARG_TYPE(\n          'val',\n          ['Readable', 'Iterable', 'AsyncIterable', 'ReadableStream', 'TransformStream'],\n          ret\n        )\n      }\n      ret = stream\n    } else if (isWebStream(stream)) {\n      if (isReadableNodeStream(ret)) {\n        finishCount++\n        pumpToWeb(makeAsyncIterable(ret), stream, finish, {\n          end\n        })\n      } else if (isReadableStream(ret) || isIterable(ret)) {\n        finishCount++\n        pumpToWeb(ret, stream, finish, {\n          end\n        })\n      } else if (isTransformStream(ret)) {\n        finishCount++\n        pumpToWeb(ret.readable, stream, finish, {\n          end\n        })\n      } else {\n        throw new ERR_INVALID_ARG_TYPE(\n          'val',\n          ['Readable', 'Iterable', 'AsyncIterable', 'ReadableStream', 'TransformStream'],\n          ret\n        )\n      }\n      ret = stream\n    } else {\n      ret = Duplex.from(stream)\n    }\n  }\n  if (\n    (signal !== null && signal !== undefined && signal.aborted) ||\n    (outerSignal !== null && outerSignal !== undefined && outerSignal.aborted)\n  ) {\n    process.nextTick(abort)\n  }\n  return ret\n}\nfunction pipe(src, dst, finish, { end }) {\n  let ended = false\n  dst.on('close', () => {\n    if (!ended) {\n      // Finish if the destination closes before the source has completed.\n      finish(new ERR_STREAM_PREMATURE_CLOSE())\n    }\n  })\n  src.pipe(dst, {\n    end: false\n  }) // If end is true we already will have a listener to end dst.\n\n  if (end) {\n    // Compat. Before node v10.12.0 stdio used to throw an error so\n    // pipe() did/does not end() stdio destinations.\n    // Now they allow it but \"secretly\" don't close the underlying fd.\n\n    function endFn() {\n      ended = true\n      dst.end()\n    }\n    if (isReadableFinished(src)) {\n      // End the destination if the source has already ended.\n      process.nextTick(endFn)\n    } else {\n      src.once('end', endFn)\n    }\n  } else {\n    finish()\n  }\n  eos(\n    src,\n    {\n      readable: true,\n      writable: false\n    },\n    (err) => {\n      const rState = src._readableState\n      if (\n        err &&\n        err.code === 'ERR_STREAM_PREMATURE_CLOSE' &&\n        rState &&\n        rState.ended &&\n        !rState.errored &&\n        !rState.errorEmitted\n      ) {\n        // Some readable streams will emit 'close' before 'end'. However, since\n        // this is on the readable side 'end' should still be emitted if the\n        // stream has been ended and no error emitted. This should be allowed in\n        // favor of backwards compatibility. Since the stream is piped to a\n        // destination this should not result in any observable difference.\n        // We don't need to check if this is a writable premature close since\n        // eos will only fail with premature close on the reading side for\n        // duplex streams.\n        src.once('end', finish).once('error', finish)\n      } else {\n        finish(err)\n      }\n    }\n  )\n  return eos(\n    dst,\n    {\n      readable: false,\n      writable: true\n    },\n    finish\n  )\n}\nmodule.exports = {\n  pipelineImpl,\n  pipeline\n}\n","'use strict'\n\nconst { pipeline } = require('./pipeline')\nconst Duplex = require('./duplex')\nconst { destroyer } = require('./destroy')\nconst {\n  isNodeStream,\n  isReadable,\n  isWritable,\n  isWebStream,\n  isTransformStream,\n  isWritableStream,\n  isReadableStream\n} = require('./utils')\nconst {\n  AbortError,\n  codes: { ERR_INVALID_ARG_VALUE, ERR_MISSING_ARGS }\n} = require('../../ours/errors')\nconst eos = require('./end-of-stream')\nmodule.exports = function compose(...streams) {\n  if (streams.length === 0) {\n    throw new ERR_MISSING_ARGS('streams')\n  }\n  if (streams.length === 1) {\n    return Duplex.from(streams[0])\n  }\n  const orgStreams = [...streams]\n  if (typeof streams[0] === 'function') {\n    streams[0] = Duplex.from(streams[0])\n  }\n  if (typeof streams[streams.length - 1] === 'function') {\n    const idx = streams.length - 1\n    streams[idx] = Duplex.from(streams[idx])\n  }\n  for (let n = 0; n < streams.length; ++n) {\n    if (!isNodeStream(streams[n]) && !isWebStream(streams[n])) {\n      // TODO(ronag): Add checks for non streams.\n      continue\n    }\n    if (\n      n < streams.length - 1 &&\n      !(isReadable(streams[n]) || isReadableStream(streams[n]) || isTransformStream(streams[n]))\n    ) {\n      throw new ERR_INVALID_ARG_VALUE(`streams[${n}]`, orgStreams[n], 'must be readable')\n    }\n    if (n > 0 && !(isWritable(streams[n]) || isWritableStream(streams[n]) || isTransformStream(streams[n]))) {\n      throw new ERR_INVALID_ARG_VALUE(`streams[${n}]`, orgStreams[n], 'must be writable')\n    }\n  }\n  let ondrain\n  let onfinish\n  let onreadable\n  let onclose\n  let d\n  function onfinished(err) {\n    const cb = onclose\n    onclose = null\n    if (cb) {\n      cb(err)\n    } else if (err) {\n      d.destroy(err)\n    } else if (!readable && !writable) {\n      d.destroy()\n    }\n  }\n  const head = streams[0]\n  const tail = pipeline(streams, onfinished)\n  const writable = !!(isWritable(head) || isWritableStream(head) || isTransformStream(head))\n  const readable = !!(isReadable(tail) || isReadableStream(tail) || isTransformStream(tail))\n\n  // TODO(ronag): Avoid double buffering.\n  // Implement Writable/Readable/Duplex traits.\n  // See, https://github.com/nodejs/node/pull/33515.\n  d = new Duplex({\n    // TODO (ronag): highWaterMark?\n    writableObjectMode: !!(head !== null && head !== undefined && head.writableObjectMode),\n    readableObjectMode: !!(tail !== null && tail !== undefined && tail.readableObjectMode),\n    writable,\n    readable\n  })\n  if (writable) {\n    if (isNodeStream(head)) {\n      d._write = function (chunk, encoding, callback) {\n        if (head.write(chunk, encoding)) {\n          callback()\n        } else {\n          ondrain = callback\n        }\n      }\n      d._final = function (callback) {\n        head.end()\n        onfinish = callback\n      }\n      head.on('drain', function () {\n        if (ondrain) {\n          const cb = ondrain\n          ondrain = null\n          cb()\n        }\n      })\n    } else if (isWebStream(head)) {\n      const writable = isTransformStream(head) ? head.writable : head\n      const writer = writable.getWriter()\n      d._write = async function (chunk, encoding, callback) {\n        try {\n          await writer.ready\n          writer.write(chunk).catch(() => {})\n          callback()\n        } catch (err) {\n          callback(err)\n        }\n      }\n      d._final = async function (callback) {\n        try {\n          await writer.ready\n          writer.close().catch(() => {})\n          onfinish = callback\n        } catch (err) {\n          callback(err)\n        }\n      }\n    }\n    const toRead = isTransformStream(tail) ? tail.readable : tail\n    eos(toRead, () => {\n      if (onfinish) {\n        const cb = onfinish\n        onfinish = null\n        cb()\n      }\n    })\n  }\n  if (readable) {\n    if (isNodeStream(tail)) {\n      tail.on('readable', function () {\n        if (onreadable) {\n          const cb = onreadable\n          onreadable = null\n          cb()\n        }\n      })\n      tail.on('end', function () {\n        d.push(null)\n      })\n      d._read = function () {\n        while (true) {\n          const buf = tail.read()\n          if (buf === null) {\n            onreadable = d._read\n            return\n          }\n          if (!d.push(buf)) {\n            return\n          }\n        }\n      }\n    } else if (isWebStream(tail)) {\n      const readable = isTransformStream(tail) ? tail.readable : tail\n      const reader = readable.getReader()\n      d._read = async function () {\n        while (true) {\n          try {\n            const { value, done } = await reader.read()\n            if (!d.push(value)) {\n              return\n            }\n            if (done) {\n              d.push(null)\n              return\n            }\n          } catch {\n            return\n          }\n        }\n      }\n    }\n  }\n  d._destroy = function (err, callback) {\n    if (!err && onclose !== null) {\n      err = new AbortError()\n    }\n    onreadable = null\n    ondrain = null\n    onfinish = null\n    if (onclose === null) {\n      callback(err)\n    } else {\n      onclose = callback\n      if (isNodeStream(tail)) {\n        destroyer(tail, err)\n      }\n    }\n  }\n  return d\n}\n","'use strict'\n\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nconst {\n  codes: { ERR_INVALID_ARG_VALUE, ERR_INVALID_ARG_TYPE, ERR_MISSING_ARGS, ERR_OUT_OF_RANGE },\n  AbortError\n} = require('../../ours/errors')\nconst { validateAbortSignal, validateInteger, validateObject } = require('../validators')\nconst kWeakHandler = require('../../ours/primordials').Symbol('kWeak')\nconst kResistStopPropagation = require('../../ours/primordials').Symbol('kResistStopPropagation')\nconst { finished } = require('./end-of-stream')\nconst staticCompose = require('./compose')\nconst { addAbortSignalNoValidate } = require('./add-abort-signal')\nconst { isWritable, isNodeStream } = require('./utils')\nconst { deprecate } = require('../../ours/util')\nconst {\n  ArrayPrototypePush,\n  Boolean,\n  MathFloor,\n  Number,\n  NumberIsNaN,\n  Promise,\n  PromiseReject,\n  PromiseResolve,\n  PromisePrototypeThen,\n  Symbol\n} = require('../../ours/primordials')\nconst kEmpty = Symbol('kEmpty')\nconst kEof = Symbol('kEof')\nfunction compose(stream, options) {\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  if (isNodeStream(stream) && !isWritable(stream)) {\n    throw new ERR_INVALID_ARG_VALUE('stream', stream, 'must be writable')\n  }\n  const composedStream = staticCompose(this, stream)\n  if (options !== null && options !== undefined && options.signal) {\n    // Not validating as we already validated before\n    addAbortSignalNoValidate(options.signal, composedStream)\n  }\n  return composedStream\n}\nfunction map(fn, options) {\n  if (typeof fn !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n  }\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  let concurrency = 1\n  if ((options === null || options === undefined ? undefined : options.concurrency) != null) {\n    concurrency = MathFloor(options.concurrency)\n  }\n  let highWaterMark = concurrency - 1\n  if ((options === null || options === undefined ? undefined : options.highWaterMark) != null) {\n    highWaterMark = MathFloor(options.highWaterMark)\n  }\n  validateInteger(concurrency, 'options.concurrency', 1)\n  validateInteger(highWaterMark, 'options.highWaterMark', 0)\n  highWaterMark += concurrency\n  return async function* map() {\n    const signal = require('../../ours/util').AbortSignalAny(\n      [options === null || options === undefined ? undefined : options.signal].filter(Boolean)\n    )\n    const stream = this\n    const queue = []\n    const signalOpt = {\n      signal\n    }\n    let next\n    let resume\n    let done = false\n    let cnt = 0\n    function onCatch() {\n      done = true\n      afterItemProcessed()\n    }\n    function afterItemProcessed() {\n      cnt -= 1\n      maybeResume()\n    }\n    function maybeResume() {\n      if (resume && !done && cnt < concurrency && queue.length < highWaterMark) {\n        resume()\n        resume = null\n      }\n    }\n    async function pump() {\n      try {\n        for await (let val of stream) {\n          if (done) {\n            return\n          }\n          if (signal.aborted) {\n            throw new AbortError()\n          }\n          try {\n            val = fn(val, signalOpt)\n            if (val === kEmpty) {\n              continue\n            }\n            val = PromiseResolve(val)\n          } catch (err) {\n            val = PromiseReject(err)\n          }\n          cnt += 1\n          PromisePrototypeThen(val, afterItemProcessed, onCatch)\n          queue.push(val)\n          if (next) {\n            next()\n            next = null\n          }\n          if (!done && (queue.length >= highWaterMark || cnt >= concurrency)) {\n            await new Promise((resolve) => {\n              resume = resolve\n            })\n          }\n        }\n        queue.push(kEof)\n      } catch (err) {\n        const val = PromiseReject(err)\n        PromisePrototypeThen(val, afterItemProcessed, onCatch)\n        queue.push(val)\n      } finally {\n        done = true\n        if (next) {\n          next()\n          next = null\n        }\n      }\n    }\n    pump()\n    try {\n      while (true) {\n        while (queue.length > 0) {\n          const val = await queue[0]\n          if (val === kEof) {\n            return\n          }\n          if (signal.aborted) {\n            throw new AbortError()\n          }\n          if (val !== kEmpty) {\n            yield val\n          }\n          queue.shift()\n          maybeResume()\n        }\n        await new Promise((resolve) => {\n          next = resolve\n        })\n      }\n    } finally {\n      done = true\n      if (resume) {\n        resume()\n        resume = null\n      }\n    }\n  }.call(this)\n}\nfunction asIndexedPairs(options = undefined) {\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  return async function* asIndexedPairs() {\n    let index = 0\n    for await (const val of this) {\n      var _options$signal\n      if (\n        options !== null &&\n        options !== undefined &&\n        (_options$signal = options.signal) !== null &&\n        _options$signal !== undefined &&\n        _options$signal.aborted\n      ) {\n        throw new AbortError({\n          cause: options.signal.reason\n        })\n      }\n      yield [index++, val]\n    }\n  }.call(this)\n}\nasync function some(fn, options = undefined) {\n  for await (const unused of filter.call(this, fn, options)) {\n    return true\n  }\n  return false\n}\nasync function every(fn, options = undefined) {\n  if (typeof fn !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n  }\n  // https://en.wikipedia.org/wiki/De_Morgan%27s_laws\n  return !(await some.call(\n    this,\n    async (...args) => {\n      return !(await fn(...args))\n    },\n    options\n  ))\n}\nasync function find(fn, options) {\n  for await (const result of filter.call(this, fn, options)) {\n    return result\n  }\n  return undefined\n}\nasync function forEach(fn, options) {\n  if (typeof fn !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n  }\n  async function forEachFn(value, options) {\n    await fn(value, options)\n    return kEmpty\n  }\n  // eslint-disable-next-line no-unused-vars\n  for await (const unused of map.call(this, forEachFn, options));\n}\nfunction filter(fn, options) {\n  if (typeof fn !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n  }\n  async function filterFn(value, options) {\n    if (await fn(value, options)) {\n      return value\n    }\n    return kEmpty\n  }\n  return map.call(this, filterFn, options)\n}\n\n// Specific to provide better error to reduce since the argument is only\n// missing if the stream has no items in it - but the code is still appropriate\nclass ReduceAwareErrMissingArgs extends ERR_MISSING_ARGS {\n  constructor() {\n    super('reduce')\n    this.message = 'Reduce of an empty stream requires an initial value'\n  }\n}\nasync function reduce(reducer, initialValue, options) {\n  var _options$signal2\n  if (typeof reducer !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE('reducer', ['Function', 'AsyncFunction'], reducer)\n  }\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  let hasInitialValue = arguments.length > 1\n  if (\n    options !== null &&\n    options !== undefined &&\n    (_options$signal2 = options.signal) !== null &&\n    _options$signal2 !== undefined &&\n    _options$signal2.aborted\n  ) {\n    const err = new AbortError(undefined, {\n      cause: options.signal.reason\n    })\n    this.once('error', () => {}) // The error is already propagated\n    await finished(this.destroy(err))\n    throw err\n  }\n  const ac = new AbortController()\n  const signal = ac.signal\n  if (options !== null && options !== undefined && options.signal) {\n    const opts = {\n      once: true,\n      [kWeakHandler]: this,\n      [kResistStopPropagation]: true\n    }\n    options.signal.addEventListener('abort', () => ac.abort(), opts)\n  }\n  let gotAnyItemFromStream = false\n  try {\n    for await (const value of this) {\n      var _options$signal3\n      gotAnyItemFromStream = true\n      if (\n        options !== null &&\n        options !== undefined &&\n        (_options$signal3 = options.signal) !== null &&\n        _options$signal3 !== undefined &&\n        _options$signal3.aborted\n      ) {\n        throw new AbortError()\n      }\n      if (!hasInitialValue) {\n        initialValue = value\n        hasInitialValue = true\n      } else {\n        initialValue = await reducer(initialValue, value, {\n          signal\n        })\n      }\n    }\n    if (!gotAnyItemFromStream && !hasInitialValue) {\n      throw new ReduceAwareErrMissingArgs()\n    }\n  } finally {\n    ac.abort()\n  }\n  return initialValue\n}\nasync function toArray(options) {\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  const result = []\n  for await (const val of this) {\n    var _options$signal4\n    if (\n      options !== null &&\n      options !== undefined &&\n      (_options$signal4 = options.signal) !== null &&\n      _options$signal4 !== undefined &&\n      _options$signal4.aborted\n    ) {\n      throw new AbortError(undefined, {\n        cause: options.signal.reason\n      })\n    }\n    ArrayPrototypePush(result, val)\n  }\n  return result\n}\nfunction flatMap(fn, options) {\n  const values = map.call(this, fn, options)\n  return async function* flatMap() {\n    for await (const val of values) {\n      yield* val\n    }\n  }.call(this)\n}\nfunction toIntegerOrInfinity(number) {\n  // We coerce here to align with the spec\n  // https://github.com/tc39/proposal-iterator-helpers/issues/169\n  number = Number(number)\n  if (NumberIsNaN(number)) {\n    return 0\n  }\n  if (number < 0) {\n    throw new ERR_OUT_OF_RANGE('number', '>= 0', number)\n  }\n  return number\n}\nfunction drop(number, options = undefined) {\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  number = toIntegerOrInfinity(number)\n  return async function* drop() {\n    var _options$signal5\n    if (\n      options !== null &&\n      options !== undefined &&\n      (_options$signal5 = options.signal) !== null &&\n      _options$signal5 !== undefined &&\n      _options$signal5.aborted\n    ) {\n      throw new AbortError()\n    }\n    for await (const val of this) {\n      var _options$signal6\n      if (\n        options !== null &&\n        options !== undefined &&\n        (_options$signal6 = options.signal) !== null &&\n        _options$signal6 !== undefined &&\n        _options$signal6.aborted\n      ) {\n        throw new AbortError()\n      }\n      if (number-- <= 0) {\n        yield val\n      }\n    }\n  }.call(this)\n}\nfunction take(number, options = undefined) {\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  number = toIntegerOrInfinity(number)\n  return async function* take() {\n    var _options$signal7\n    if (\n      options !== null &&\n      options !== undefined &&\n      (_options$signal7 = options.signal) !== null &&\n      _options$signal7 !== undefined &&\n      _options$signal7.aborted\n    ) {\n      throw new AbortError()\n    }\n    for await (const val of this) {\n      var _options$signal8\n      if (\n        options !== null &&\n        options !== undefined &&\n        (_options$signal8 = options.signal) !== null &&\n        _options$signal8 !== undefined &&\n        _options$signal8.aborted\n      ) {\n        throw new AbortError()\n      }\n      if (number-- > 0) {\n        yield val\n      }\n\n      // Don't get another item from iterator in case we reached the end\n      if (number <= 0) {\n        return\n      }\n    }\n  }.call(this)\n}\nmodule.exports.streamReturningOperators = {\n  asIndexedPairs: deprecate(asIndexedPairs, 'readable.asIndexedPairs will be removed in a future version.'),\n  drop,\n  filter,\n  flatMap,\n  map,\n  take,\n  compose\n}\nmodule.exports.promiseReturningOperators = {\n  every,\n  forEach,\n  reduce,\n  toArray,\n  some,\n  find\n}\n","'use strict'\n\nconst { ArrayPrototypePop, Promise } = require('../ours/primordials')\nconst { isIterable, isNodeStream, isWebStream } = require('../internal/streams/utils')\nconst { pipelineImpl: pl } = require('../internal/streams/pipeline')\nconst { finished } = require('../internal/streams/end-of-stream')\nrequire('../../lib/stream.js')\nfunction pipeline(...streams) {\n  return new Promise((resolve, reject) => {\n    let signal\n    let end\n    const lastArg = streams[streams.length - 1]\n    if (\n      lastArg &&\n      typeof lastArg === 'object' &&\n      !isNodeStream(lastArg) &&\n      !isIterable(lastArg) &&\n      !isWebStream(lastArg)\n    ) {\n      const options = ArrayPrototypePop(streams)\n      signal = options.signal\n      end = options.end\n    }\n    pl(\n      streams,\n      (err, value) => {\n        if (err) {\n          reject(err)\n        } else {\n          resolve(value)\n        }\n      },\n      {\n        signal,\n        end\n      }\n    )\n  })\n}\nmodule.exports = {\n  finished,\n  pipeline\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict'\n\n/* replacement start */\n\nconst { Buffer } = require('buffer')\n\n/* replacement end */\n\nconst { ObjectDefineProperty, ObjectKeys, ReflectApply } = require('./ours/primordials')\nconst {\n  promisify: { custom: customPromisify }\n} = require('./ours/util')\nconst { streamReturningOperators, promiseReturningOperators } = require('./internal/streams/operators')\nconst {\n  codes: { ERR_ILLEGAL_CONSTRUCTOR }\n} = require('./ours/errors')\nconst compose = require('./internal/streams/compose')\nconst { setDefaultHighWaterMark, getDefaultHighWaterMark } = require('./internal/streams/state')\nconst { pipeline } = require('./internal/streams/pipeline')\nconst { destroyer } = require('./internal/streams/destroy')\nconst eos = require('./internal/streams/end-of-stream')\nconst internalBuffer = {}\nconst promises = require('./stream/promises')\nconst utils = require('./internal/streams/utils')\nconst Stream = (module.exports = require('./internal/streams/legacy').Stream)\nStream.isDestroyed = utils.isDestroyed\nStream.isDisturbed = utils.isDisturbed\nStream.isErrored = utils.isErrored\nStream.isReadable = utils.isReadable\nStream.isWritable = utils.isWritable\nStream.Readable = require('./internal/streams/readable')\nfor (const key of ObjectKeys(streamReturningOperators)) {\n  const op = streamReturningOperators[key]\n  function fn(...args) {\n    if (new.target) {\n      throw ERR_ILLEGAL_CONSTRUCTOR()\n    }\n    return Stream.Readable.from(ReflectApply(op, this, args))\n  }\n  ObjectDefineProperty(fn, 'name', {\n    __proto__: null,\n    value: op.name\n  })\n  ObjectDefineProperty(fn, 'length', {\n    __proto__: null,\n    value: op.length\n  })\n  ObjectDefineProperty(Stream.Readable.prototype, key, {\n    __proto__: null,\n    value: fn,\n    enumerable: false,\n    configurable: true,\n    writable: true\n  })\n}\nfor (const key of ObjectKeys(promiseReturningOperators)) {\n  const op = promiseReturningOperators[key]\n  function fn(...args) {\n    if (new.target) {\n      throw ERR_ILLEGAL_CONSTRUCTOR()\n    }\n    return ReflectApply(op, this, args)\n  }\n  ObjectDefineProperty(fn, 'name', {\n    __proto__: null,\n    value: op.name\n  })\n  ObjectDefineProperty(fn, 'length', {\n    __proto__: null,\n    value: op.length\n  })\n  ObjectDefineProperty(Stream.Readable.prototype, key, {\n    __proto__: null,\n    value: fn,\n    enumerable: false,\n    configurable: true,\n    writable: true\n  })\n}\nStream.Writable = require('./internal/streams/writable')\nStream.Duplex = require('./internal/streams/duplex')\nStream.Transform = require('./internal/streams/transform')\nStream.PassThrough = require('./internal/streams/passthrough')\nStream.pipeline = pipeline\nconst { addAbortSignal } = require('./internal/streams/add-abort-signal')\nStream.addAbortSignal = addAbortSignal\nStream.finished = eos\nStream.destroy = destroyer\nStream.compose = compose\nStream.setDefaultHighWaterMark = setDefaultHighWaterMark\nStream.getDefaultHighWaterMark = getDefaultHighWaterMark\nObjectDefineProperty(Stream, 'promises', {\n  __proto__: null,\n  configurable: true,\n  enumerable: true,\n  get() {\n    return promises\n  }\n})\nObjectDefineProperty(pipeline, customPromisify, {\n  __proto__: null,\n  enumerable: true,\n  get() {\n    return promises.pipeline\n  }\n})\nObjectDefineProperty(eos, customPromisify, {\n  __proto__: null,\n  enumerable: true,\n  get() {\n    return promises.finished\n  }\n})\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream\nStream._isUint8Array = function isUint8Array(value) {\n  return value instanceof Uint8Array\n}\nStream._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) {\n  return Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength)\n}\n","'use strict'\n\nconst Stream = require('stream')\nif (Stream && process.env.READABLE_STREAM === 'disable') {\n  const promises = Stream.promises\n\n  // Explicit export naming is needed for ESM\n  module.exports._uint8ArrayToBuffer = Stream._uint8ArrayToBuffer\n  module.exports._isUint8Array = Stream._isUint8Array\n  module.exports.isDisturbed = Stream.isDisturbed\n  module.exports.isErrored = Stream.isErrored\n  module.exports.isReadable = Stream.isReadable\n  module.exports.Readable = Stream.Readable\n  module.exports.Writable = Stream.Writable\n  module.exports.Duplex = Stream.Duplex\n  module.exports.Transform = Stream.Transform\n  module.exports.PassThrough = Stream.PassThrough\n  module.exports.addAbortSignal = Stream.addAbortSignal\n  module.exports.finished = Stream.finished\n  module.exports.destroy = Stream.destroy\n  module.exports.pipeline = Stream.pipeline\n  module.exports.compose = Stream.compose\n  Object.defineProperty(Stream, 'promises', {\n    configurable: true,\n    enumerable: true,\n    get() {\n      return promises\n    }\n  })\n  module.exports.Stream = Stream.Stream\n} else {\n  const CustomStream = require('../stream')\n  const promises = require('../stream/promises')\n  const originalDestroy = CustomStream.Readable.destroy\n  module.exports = CustomStream.Readable\n\n  // Explicit export naming is needed for ESM\n  module.exports._uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer\n  module.exports._isUint8Array = CustomStream._isUint8Array\n  module.exports.isDisturbed = CustomStream.isDisturbed\n  module.exports.isErrored = CustomStream.isErrored\n  module.exports.isReadable = CustomStream.isReadable\n  module.exports.Readable = CustomStream.Readable\n  module.exports.Writable = CustomStream.Writable\n  module.exports.Duplex = CustomStream.Duplex\n  module.exports.Transform = CustomStream.Transform\n  module.exports.PassThrough = CustomStream.PassThrough\n  module.exports.addAbortSignal = CustomStream.addAbortSignal\n  module.exports.finished = CustomStream.finished\n  module.exports.destroy = CustomStream.destroy\n  module.exports.destroy = originalDestroy\n  module.exports.pipeline = CustomStream.pipeline\n  module.exports.compose = CustomStream.compose\n  Object.defineProperty(CustomStream, 'promises', {\n    configurable: true,\n    enumerable: true,\n    get() {\n      return promises\n    }\n  })\n  module.exports.Stream = CustomStream.Stream\n}\n\n// Allow default importing\nmodule.exports.default = module.exports\n","/**\n * Archiver Core\n *\n * @ignore\n * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}\n * @copyright (c) 2012-2014 Chris Talkington, contributors.\n */\nvar fs = require('fs');\nvar glob = require('readdir-glob');\nvar async = require('async');\nvar path = require('path');\nvar util = require('archiver-utils');\n\nvar inherits = require('util').inherits;\nvar ArchiverError = require('./error');\nvar Transform = require('readable-stream').Transform;\n\nvar win32 = process.platform === 'win32';\n\n/**\n * @constructor\n * @param {String} format The archive format to use.\n * @param {(CoreOptions|TransformOptions)} options See also {@link ZipOptions} and {@link TarOptions}.\n */\nvar Archiver = function(format, options) {\n  if (!(this instanceof Archiver)) {\n    return new Archiver(format, options);\n  }\n\n  if (typeof format !== 'string') {\n    options = format;\n    format = 'zip';\n  }\n\n  options = this.options = util.defaults(options, {\n    highWaterMark: 1024 * 1024,\n    statConcurrency: 4\n  });\n\n  Transform.call(this, options);\n\n  this._format = false;\n  this._module = false;\n  this._pending = 0;\n  this._pointer = 0;\n\n  this._entriesCount = 0;\n  this._entriesProcessedCount = 0;\n  this._fsEntriesTotalBytes = 0;\n  this._fsEntriesProcessedBytes = 0;\n\n  this._queue = async.queue(this._onQueueTask.bind(this), 1);\n  this._queue.drain(this._onQueueDrain.bind(this));\n\n  this._statQueue = async.queue(this._onStatQueueTask.bind(this), options.statConcurrency);\n  this._statQueue.drain(this._onQueueDrain.bind(this));\n\n  this._state = {\n    aborted: false,\n    finalize: false,\n    finalizing: false,\n    finalized: false,\n    modulePiped: false\n  };\n\n  this._streams = [];\n};\n\ninherits(Archiver, Transform);\n\n/**\n * Internal logic for `abort`.\n *\n * @private\n * @return void\n */\nArchiver.prototype._abort = function() {\n  this._state.aborted = true;\n  this._queue.kill();\n  this._statQueue.kill();\n\n  if (this._queue.idle()) {\n    this._shutdown();\n  }\n};\n\n/**\n * Internal helper for appending files.\n *\n * @private\n * @param  {String} filepath The source filepath.\n * @param  {EntryData} data The entry data.\n * @return void\n */\nArchiver.prototype._append = function(filepath, data) {\n  data = data || {};\n\n  var task = {\n    source: null,\n    filepath: filepath\n  };\n\n  if (!data.name) {\n    data.name = filepath;\n  }\n\n  data.sourcePath = filepath;\n  task.data = data;\n  this._entriesCount++;\n\n  if (data.stats && data.stats instanceof fs.Stats) {\n    task = this._updateQueueTaskWithStats(task, data.stats);\n    if (task) {\n      if (data.stats.size) {\n        this._fsEntriesTotalBytes += data.stats.size;\n      }\n\n      this._queue.push(task);\n    }\n  } else {\n    this._statQueue.push(task);\n  }\n};\n\n/**\n * Internal logic for `finalize`.\n *\n * @private\n * @return void\n */\nArchiver.prototype._finalize = function() {\n  if (this._state.finalizing || this._state.finalized || this._state.aborted) {\n    return;\n  }\n\n  this._state.finalizing = true;\n\n  this._moduleFinalize();\n\n  this._state.finalizing = false;\n  this._state.finalized = true;\n};\n\n/**\n * Checks the various state variables to determine if we can `finalize`.\n *\n * @private\n * @return {Boolean}\n */\nArchiver.prototype._maybeFinalize = function() {\n  if (this._state.finalizing || this._state.finalized || this._state.aborted) {\n    return false;\n  }\n\n  if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) {\n    this._finalize();\n    return true;\n  }\n\n  return false;\n};\n\n/**\n * Appends an entry to the module.\n *\n * @private\n * @fires  Archiver#entry\n * @param  {(Buffer|Stream)} source\n * @param  {EntryData} data\n * @param  {Function} callback\n * @return void\n */\nArchiver.prototype._moduleAppend = function(source, data, callback) {\n  if (this._state.aborted) {\n    callback();\n    return;\n  }\n\n  this._module.append(source, data, function(err) {\n    this._task = null;\n\n    if (this._state.aborted) {\n      this._shutdown();\n      return;\n    }\n\n    if (err) {\n      this.emit('error', err);\n      setImmediate(callback);\n      return;\n    }\n\n    /**\n     * Fires when the entry's input has been processed and appended to the archive.\n     *\n     * @event Archiver#entry\n     * @type {EntryData}\n     */\n    this.emit('entry', data);\n    this._entriesProcessedCount++;\n\n    if (data.stats && data.stats.size) {\n      this._fsEntriesProcessedBytes += data.stats.size;\n    }\n\n    /**\n     * @event Archiver#progress\n     * @type {ProgressData}\n     */\n    this.emit('progress', {\n      entries: {\n        total: this._entriesCount,\n        processed: this._entriesProcessedCount\n      },\n      fs: {\n        totalBytes: this._fsEntriesTotalBytes,\n        processedBytes: this._fsEntriesProcessedBytes\n      }\n    });\n\n    setImmediate(callback);\n  }.bind(this));\n};\n\n/**\n * Finalizes the module.\n *\n * @private\n * @return void\n */\nArchiver.prototype._moduleFinalize = function() {\n  if (typeof this._module.finalize === 'function') {\n    this._module.finalize();\n  } else if (typeof this._module.end === 'function') {\n    this._module.end();\n  } else {\n    this.emit('error', new ArchiverError('NOENDMETHOD'));\n  }\n};\n\n/**\n * Pipes the module to our internal stream with error bubbling.\n *\n * @private\n * @return void\n */\nArchiver.prototype._modulePipe = function() {\n  this._module.on('error', this._onModuleError.bind(this));\n  this._module.pipe(this);\n  this._state.modulePiped = true;\n};\n\n/**\n * Determines if the current module supports a defined feature.\n *\n * @private\n * @param  {String} key\n * @return {Boolean}\n */\nArchiver.prototype._moduleSupports = function(key) {\n  if (!this._module.supports || !this._module.supports[key]) {\n    return false;\n  }\n\n  return this._module.supports[key];\n};\n\n/**\n * Unpipes the module from our internal stream.\n *\n * @private\n * @return void\n */\nArchiver.prototype._moduleUnpipe = function() {\n  this._module.unpipe(this);\n  this._state.modulePiped = false;\n};\n\n/**\n * Normalizes entry data with fallbacks for key properties.\n *\n * @private\n * @param  {Object} data\n * @param  {fs.Stats} stats\n * @return {Object}\n */\nArchiver.prototype._normalizeEntryData = function(data, stats) {\n  data = util.defaults(data, {\n    type: 'file',\n    name: null,\n    date: null,\n    mode: null,\n    prefix: null,\n    sourcePath: null,\n    stats: false\n  });\n\n  if (stats && data.stats === false) {\n    data.stats = stats;\n  }\n\n  var isDir = data.type === 'directory';\n\n  if (data.name) {\n    if (typeof data.prefix === 'string' && '' !== data.prefix) {\n      data.name = data.prefix + '/' + data.name;\n      data.prefix = null;\n    }\n\n    data.name = util.sanitizePath(data.name);\n\n    if (data.type !== 'symlink' && data.name.slice(-1) === '/') {\n      isDir = true;\n      data.type = 'directory';\n    } else if (isDir) {\n      data.name += '/';\n    }\n  }\n\n  // 511 === 0777; 493 === 0755; 438 === 0666; 420 === 0644\n  if (typeof data.mode === 'number') {\n    if (win32) {\n      data.mode &= 511;\n    } else {\n      data.mode &= 4095\n    }\n  } else if (data.stats && data.mode === null) {\n    if (win32) {\n      data.mode = data.stats.mode & 511;\n    } else {\n      data.mode = data.stats.mode & 4095;\n    }\n\n    // stat isn't reliable on windows; force 0755 for dir\n    if (win32 && isDir) {\n      data.mode = 493;\n    }\n  } else if (data.mode === null) {\n    data.mode = isDir ? 493 : 420;\n  }\n\n  if (data.stats && data.date === null) {\n    data.date = data.stats.mtime;\n  } else {\n    data.date = util.dateify(data.date);\n  }\n\n  return data;\n};\n\n/**\n * Error listener that re-emits error on to our internal stream.\n *\n * @private\n * @param  {Error} err\n * @return void\n */\nArchiver.prototype._onModuleError = function(err) {\n  /**\n   * @event Archiver#error\n   * @type {ErrorData}\n   */\n  this.emit('error', err);\n};\n\n/**\n * Checks the various state variables after queue has drained to determine if\n * we need to `finalize`.\n *\n * @private\n * @return void\n */\nArchiver.prototype._onQueueDrain = function() {\n  if (this._state.finalizing || this._state.finalized || this._state.aborted) {\n    return;\n  }\n\n  if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) {\n    this._finalize();\n  }\n};\n\n/**\n * Appends each queue task to the module.\n *\n * @private\n * @param  {Object} task\n * @param  {Function} callback\n * @return void\n */\nArchiver.prototype._onQueueTask = function(task, callback) {\n  var fullCallback = () => {\n    if(task.data.callback) {\n      task.data.callback();\n    }\n    callback();\n  }\n\n  if (this._state.finalizing || this._state.finalized || this._state.aborted) {\n    fullCallback();\n    return;\n  }\n\n  this._task = task;\n  this._moduleAppend(task.source, task.data, fullCallback);\n};\n\n/**\n * Performs a file stat and reinjects the task back into the queue.\n *\n * @private\n * @param  {Object} task\n * @param  {Function} callback\n * @return void\n */\nArchiver.prototype._onStatQueueTask = function(task, callback) {\n  if (this._state.finalizing || this._state.finalized || this._state.aborted) {\n    callback();\n    return;\n  }\n\n  fs.lstat(task.filepath, function(err, stats) {\n    if (this._state.aborted) {\n      setImmediate(callback);\n      return;\n    }\n\n    if (err) {\n      this._entriesCount--;\n\n      /**\n       * @event Archiver#warning\n       * @type {ErrorData}\n       */\n      this.emit('warning', err);\n      setImmediate(callback);\n      return;\n    }\n\n    task = this._updateQueueTaskWithStats(task, stats);\n\n    if (task) {\n      if (stats.size) {\n        this._fsEntriesTotalBytes += stats.size;\n      }\n\n      this._queue.push(task);\n    }\n\n    setImmediate(callback);\n  }.bind(this));\n};\n\n/**\n * Unpipes the module and ends our internal stream.\n *\n * @private\n * @return void\n */\nArchiver.prototype._shutdown = function() {\n  this._moduleUnpipe();\n  this.end();\n};\n\n/**\n * Tracks the bytes emitted by our internal stream.\n *\n * @private\n * @param  {Buffer} chunk\n * @param  {String} encoding\n * @param  {Function} callback\n * @return void\n */\nArchiver.prototype._transform = function(chunk, encoding, callback) {\n  if (chunk) {\n    this._pointer += chunk.length;\n  }\n\n  callback(null, chunk);\n};\n\n/**\n * Updates and normalizes a queue task using stats data.\n *\n * @private\n * @param  {Object} task\n * @param  {fs.Stats} stats\n * @return {Object}\n */\nArchiver.prototype._updateQueueTaskWithStats = function(task, stats) {\n  if (stats.isFile()) {\n    task.data.type = 'file';\n    task.data.sourceType = 'stream';\n    task.source = util.lazyReadStream(task.filepath);\n  } else if (stats.isDirectory() && this._moduleSupports('directory')) {\n    task.data.name = util.trailingSlashIt(task.data.name);\n    task.data.type = 'directory';\n    task.data.sourcePath = util.trailingSlashIt(task.filepath);\n    task.data.sourceType = 'buffer';\n    task.source = Buffer.concat([]);\n  } else if (stats.isSymbolicLink() && this._moduleSupports('symlink')) {\n    var linkPath = fs.readlinkSync(task.filepath);\n    var dirName = path.dirname(task.filepath);\n    task.data.type = 'symlink';\n    task.data.linkname = path.relative(dirName, path.resolve(dirName, linkPath));\n    task.data.sourceType = 'buffer';\n    task.source = Buffer.concat([]);\n  } else {\n    if (stats.isDirectory()) {\n      this.emit('warning', new ArchiverError('DIRECTORYNOTSUPPORTED', task.data));\n    } else if (stats.isSymbolicLink()) {\n      this.emit('warning', new ArchiverError('SYMLINKNOTSUPPORTED', task.data));\n    } else {\n      this.emit('warning', new ArchiverError('ENTRYNOTSUPPORTED', task.data));\n    }\n\n    return null;\n  }\n\n  task.data = this._normalizeEntryData(task.data, stats);\n\n  return task;\n};\n\n/**\n * Aborts the archiving process, taking a best-effort approach, by:\n *\n * - removing any pending queue tasks\n * - allowing any active queue workers to finish\n * - detaching internal module pipes\n * - ending both sides of the Transform stream\n *\n * It will NOT drain any remaining sources.\n *\n * @return {this}\n */\nArchiver.prototype.abort = function() {\n  if (this._state.aborted || this._state.finalized) {\n    return this;\n  }\n\n  this._abort();\n\n  return this;\n};\n\n/**\n * Appends an input source (text string, buffer, or stream) to the instance.\n *\n * When the instance has received, processed, and emitted the input, the `entry`\n * event is fired.\n *\n * @fires  Archiver#entry\n * @param  {(Buffer|Stream|String)} source The input source.\n * @param  {EntryData} data See also {@link ZipEntryData} and {@link TarEntryData}.\n * @return {this}\n */\nArchiver.prototype.append = function(source, data) {\n  if (this._state.finalize || this._state.aborted) {\n    this.emit('error', new ArchiverError('QUEUECLOSED'));\n    return this;\n  }\n\n  data = this._normalizeEntryData(data);\n\n  if (typeof data.name !== 'string' || data.name.length === 0) {\n    this.emit('error', new ArchiverError('ENTRYNAMEREQUIRED'));\n    return this;\n  }\n\n  if (data.type === 'directory' && !this._moduleSupports('directory')) {\n    this.emit('error', new ArchiverError('DIRECTORYNOTSUPPORTED', { name: data.name }));\n    return this;\n  }\n\n  source = util.normalizeInputSource(source);\n\n  if (Buffer.isBuffer(source)) {\n    data.sourceType = 'buffer';\n  } else if (util.isStream(source)) {\n    data.sourceType = 'stream';\n  } else {\n    this.emit('error', new ArchiverError('INPUTSTEAMBUFFERREQUIRED', { name: data.name }));\n    return this;\n  }\n\n  this._entriesCount++;\n  this._queue.push({\n    data: data,\n    source: source\n  });\n\n  return this;\n};\n\n/**\n * Appends a directory and its files, recursively, given its dirpath.\n *\n * @param  {String} dirpath The source directory path.\n * @param  {String} destpath The destination path within the archive.\n * @param  {(EntryData|Function)} data See also [ZipEntryData]{@link ZipEntryData} and\n * [TarEntryData]{@link TarEntryData}.\n * @return {this}\n */\nArchiver.prototype.directory = function(dirpath, destpath, data) {\n  if (this._state.finalize || this._state.aborted) {\n    this.emit('error', new ArchiverError('QUEUECLOSED'));\n    return this;\n  }\n\n  if (typeof dirpath !== 'string' || dirpath.length === 0) {\n    this.emit('error', new ArchiverError('DIRECTORYDIRPATHREQUIRED'));\n    return this;\n  }\n\n  this._pending++;\n\n  if (destpath === false) {\n    destpath = '';\n  } else if (typeof destpath !== 'string'){\n    destpath = dirpath;\n  }\n\n  var dataFunction = false;\n  if (typeof data === 'function') {\n    dataFunction = data;\n    data = {};\n  } else if (typeof data !== 'object') {\n    data = {};\n  }\n\n  var globOptions = {\n    stat: true,\n    dot: true\n  };\n\n  function onGlobEnd() {\n    this._pending--;\n    this._maybeFinalize();\n  }\n\n  function onGlobError(err) {\n    this.emit('error', err);\n  }\n\n  function onGlobMatch(match){\n    globber.pause();\n\n    var ignoreMatch = false;\n    var entryData = Object.assign({}, data);\n    entryData.name = match.relative;\n    entryData.prefix = destpath;\n    entryData.stats = match.stat;\n    entryData.callback = globber.resume.bind(globber);\n\n    try {\n      if (dataFunction) {\n        entryData = dataFunction(entryData);\n\n        if (entryData === false) {\n          ignoreMatch = true;\n        } else if (typeof entryData !== 'object') {\n          throw new ArchiverError('DIRECTORYFUNCTIONINVALIDDATA', { dirpath: dirpath });\n        }\n      }\n    } catch(e) {\n      this.emit('error', e);\n      return;\n    }\n\n    if (ignoreMatch) {\n      globber.resume();\n      return;\n    }\n\n    this._append(match.absolute, entryData);\n  }\n\n  var globber = glob(dirpath, globOptions);\n  globber.on('error', onGlobError.bind(this));\n  globber.on('match', onGlobMatch.bind(this));\n  globber.on('end', onGlobEnd.bind(this));\n\n  return this;\n};\n\n/**\n * Appends a file given its filepath using a\n * [lazystream]{@link https://github.com/jpommerening/node-lazystream} wrapper to\n * prevent issues with open file limits.\n *\n * When the instance has received, processed, and emitted the file, the `entry`\n * event is fired.\n *\n * @param  {String} filepath The source filepath.\n * @param  {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and\n * [TarEntryData]{@link TarEntryData}.\n * @return {this}\n */\nArchiver.prototype.file = function(filepath, data) {\n  if (this._state.finalize || this._state.aborted) {\n    this.emit('error', new ArchiverError('QUEUECLOSED'));\n    return this;\n  }\n\n  if (typeof filepath !== 'string' || filepath.length === 0) {\n    this.emit('error', new ArchiverError('FILEFILEPATHREQUIRED'));\n    return this;\n  }\n\n  this._append(filepath, data);\n\n  return this;\n};\n\n/**\n * Appends multiple files that match a glob pattern.\n *\n * @param  {String} pattern The [glob pattern]{@link https://github.com/isaacs/minimatch} to match.\n * @param  {Object} options See [node-readdir-glob]{@link https://github.com/yqnn/node-readdir-glob#options}.\n * @param  {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and\n * [TarEntryData]{@link TarEntryData}.\n * @return {this}\n */\nArchiver.prototype.glob = function(pattern, options, data) {\n  this._pending++;\n\n  options = util.defaults(options, {\n    stat: true,\n    pattern: pattern\n  });\n\n  function onGlobEnd() {\n    this._pending--;\n    this._maybeFinalize();\n  }\n\n  function onGlobError(err) {\n    this.emit('error', err);\n  }\n\n  function onGlobMatch(match){\n    globber.pause();\n    var entryData = Object.assign({}, data);\n    entryData.callback = globber.resume.bind(globber);\n    entryData.stats = match.stat;\n    entryData.name = match.relative;\n\n    this._append(match.absolute, entryData);\n  }\n\n  var globber = glob(options.cwd || '.', options);\n  globber.on('error', onGlobError.bind(this));\n  globber.on('match', onGlobMatch.bind(this));\n  globber.on('end', onGlobEnd.bind(this));\n\n  return this;\n};\n\n/**\n * Finalizes the instance and prevents further appending to the archive\n * structure (queue will continue til drained).\n *\n * The `end`, `close` or `finish` events on the destination stream may fire\n * right after calling this method so you should set listeners beforehand to\n * properly detect stream completion.\n *\n * @return {Promise}\n */\nArchiver.prototype.finalize = function() {\n  if (this._state.aborted) {\n    var abortedError = new ArchiverError('ABORTED');\n    this.emit('error', abortedError);\n    return Promise.reject(abortedError);\n  }\n\n  if (this._state.finalize) {\n    var finalizingError = new ArchiverError('FINALIZING');\n    this.emit('error', finalizingError);\n    return Promise.reject(finalizingError);\n  }\n\n  this._state.finalize = true;\n\n  if (this._pending === 0 && this._queue.idle() && this._statQueue.idle()) {\n    this._finalize();\n  }\n\n  var self = this;\n\n  return new Promise(function(resolve, reject) {\n    var errored;\n\n    self._module.on('end', function() {\n      if (!errored) {\n        resolve();\n      }\n    })\n\n    self._module.on('error', function(err) {\n      errored = true;\n      reject(err);\n    })\n  })\n};\n\n/**\n * Sets the module format name used for archiving.\n *\n * @param {String} format The name of the format.\n * @return {this}\n */\nArchiver.prototype.setFormat = function(format) {\n  if (this._format) {\n    this.emit('error', new ArchiverError('FORMATSET'));\n    return this;\n  }\n\n  this._format = format;\n\n  return this;\n};\n\n/**\n * Sets the module used for archiving.\n *\n * @param {Function} module The function for archiver to interact with.\n * @return {this}\n */\nArchiver.prototype.setModule = function(module) {\n  if (this._state.aborted) {\n    this.emit('error', new ArchiverError('ABORTED'));\n    return this;\n  }\n\n  if (this._state.module) {\n    this.emit('error', new ArchiverError('MODULESET'));\n    return this;\n  }\n\n  this._module = module;\n  this._modulePipe();\n\n  return this;\n};\n\n/**\n * Appends a symlink to the instance.\n *\n * This does NOT interact with filesystem and is used for programmatically creating symlinks.\n *\n * @param  {String} filepath The symlink path (within archive).\n * @param  {String} target The target path (within archive).\n * @param  {Number} mode Sets the entry permissions.\n * @return {this}\n */\nArchiver.prototype.symlink = function(filepath, target, mode) {\n  if (this._state.finalize || this._state.aborted) {\n    this.emit('error', new ArchiverError('QUEUECLOSED'));\n    return this;\n  }\n\n  if (typeof filepath !== 'string' || filepath.length === 0) {\n    this.emit('error', new ArchiverError('SYMLINKFILEPATHREQUIRED'));\n    return this;\n  }\n\n  if (typeof target !== 'string' || target.length === 0) {\n    this.emit('error', new ArchiverError('SYMLINKTARGETREQUIRED', { filepath: filepath }));\n    return this;\n  }\n\n  if (!this._moduleSupports('symlink')) {\n    this.emit('error', new ArchiverError('SYMLINKNOTSUPPORTED', { filepath: filepath }));\n    return this;\n  }\n\n  var data = {};\n  data.type = 'symlink';\n  data.name = filepath.replace(/\\\\/g, '/');\n  data.linkname = target.replace(/\\\\/g, '/');\n  data.sourceType = 'buffer';\n\n  if (typeof mode === \"number\") {\n    data.mode = mode;\n  }\n\n  this._entriesCount++;\n  this._queue.push({\n    data: data,\n    source: Buffer.concat([])\n  });\n\n  return this;\n};\n\n/**\n * Returns the current length (in bytes) that has been emitted.\n *\n * @return {Number}\n */\nArchiver.prototype.pointer = function() {\n  return this._pointer;\n};\n\n/**\n * Middleware-like helper that has yet to be fully implemented.\n *\n * @private\n * @param  {Function} plugin\n * @return {this}\n */\nArchiver.prototype.use = function(plugin) {\n  this._streams.push(plugin);\n  return this;\n};\n\nmodule.exports = Archiver;\n\n/**\n * @typedef {Object} CoreOptions\n * @global\n * @property {Number} [statConcurrency=4] Sets the number of workers used to\n * process the internal fs stat queue.\n */\n\n/**\n * @typedef {Object} TransformOptions\n * @property {Boolean} [allowHalfOpen=true] If set to false, then the stream\n * will automatically end the readable side when the writable side ends and vice\n * versa.\n * @property {Boolean} [readableObjectMode=false] Sets objectMode for readable\n * side of the stream. Has no effect if objectMode is true.\n * @property {Boolean} [writableObjectMode=false] Sets objectMode for writable\n * side of the stream. Has no effect if objectMode is true.\n * @property {Boolean} [decodeStrings=true] Whether or not to decode strings\n * into Buffers before passing them to _write(). `Writable`\n * @property {String} [encoding=NULL] If specified, then buffers will be decoded\n * to strings using the specified encoding. `Readable`\n * @property {Number} [highWaterMark=16kb] The maximum number of bytes to store\n * in the internal buffer before ceasing to read from the underlying resource.\n * `Readable` `Writable`\n * @property {Boolean} [objectMode=false] Whether this stream should behave as a\n * stream of objects. Meaning that stream.read(n) returns a single value instead\n * of a Buffer of size n. `Readable` `Writable`\n */\n\n/**\n * @typedef {Object} EntryData\n * @property {String} name Sets the entry name including internal path.\n * @property {(String|Date)} [date=NOW()] Sets the entry date.\n * @property {Number} [mode=D:0755/F:0644] Sets the entry permissions.\n * @property {String} [prefix] Sets a path prefix for the entry name. Useful\n * when working with methods like `directory` or `glob`.\n * @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing\n * for reduction of fs stat calls when stat data is already known.\n */\n\n/**\n * @typedef {Object} ErrorData\n * @property {String} message The message of the error.\n * @property {String} code The error code assigned to this error.\n * @property {String} data Additional data provided for reporting or debugging (where available).\n */\n\n/**\n * @typedef {Object} ProgressData\n * @property {Object} entries\n * @property {Number} entries.total Number of entries that have been appended.\n * @property {Number} entries.processed Number of entries that have been processed.\n * @property {Object} fs\n * @property {Number} fs.totalBytes Number of bytes that have been appended. Calculated asynchronously and might not be accurate: it growth while entries are added. (based on fs.Stats)\n * @property {Number} fs.processedBytes Number of bytes that have been processed. (based on fs.Stats)\n */\n","/**\n * node-compress-commons\n *\n * Copyright (c) 2014 Chris Talkington, contributors.\n * Licensed under the MIT license.\n * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT\n */\nvar ArchiveEntry = module.exports = function() {};\n\nArchiveEntry.prototype.getName = function() {};\n\nArchiveEntry.prototype.getSize = function() {};\n\nArchiveEntry.prototype.getLastModifiedDate = function() {};\n\nArchiveEntry.prototype.isDirectory = function() {};","/**\n * node-compress-commons\n *\n * Copyright (c) 2014 Chris Talkington, contributors.\n * Licensed under the MIT license.\n * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT\n */\nvar util = module.exports = {};\n\nutil.dateToDos = function(d, forceLocalTime) {\n  forceLocalTime = forceLocalTime || false;\n\n  var year = forceLocalTime ? d.getFullYear() : d.getUTCFullYear();\n\n  if (year < 1980) {\n    return 2162688; // 1980-1-1 00:00:00\n  } else if (year >= 2044) {\n    return 2141175677; // 2043-12-31 23:59:58\n  }\n\n  var val = {\n    year: year,\n    month: forceLocalTime ? d.getMonth() : d.getUTCMonth(),\n    date: forceLocalTime ? d.getDate() : d.getUTCDate(),\n    hours: forceLocalTime ? d.getHours() : d.getUTCHours(),\n    minutes: forceLocalTime ? d.getMinutes() : d.getUTCMinutes(),\n    seconds: forceLocalTime ? d.getSeconds() : d.getUTCSeconds()\n  };\n\n  return ((val.year - 1980) << 25) | ((val.month + 1) << 21) | (val.date << 16) |\n    (val.hours << 11) | (val.minutes << 5) | (val.seconds / 2);\n};\n\nutil.dosToDate = function(dos) {\n  return new Date(((dos >> 25) & 0x7f) + 1980, ((dos >> 21) & 0x0f) - 1, (dos >> 16) & 0x1f, (dos >> 11) & 0x1f, (dos >> 5) & 0x3f, (dos & 0x1f) << 1);\n};\n\nutil.fromDosTime = function(buf) {\n  return util.dosToDate(buf.readUInt32LE(0));\n};\n\nutil.getEightBytes = function(v) {\n  var buf = Buffer.alloc(8);\n  buf.writeUInt32LE(v % 0x0100000000, 0);\n  buf.writeUInt32LE((v / 0x0100000000) | 0, 4);\n\n  return buf;\n};\n\nutil.getShortBytes = function(v) {\n  var buf = Buffer.alloc(2);\n  buf.writeUInt16LE((v & 0xFFFF) >>> 0, 0);\n\n  return buf;\n};\n\nutil.getShortBytesValue = function(buf, offset) {\n  return buf.readUInt16LE(offset);\n};\n\nutil.getLongBytes = function(v) {\n  var buf = Buffer.alloc(4);\n  buf.writeUInt32LE((v & 0xFFFFFFFF) >>> 0, 0);\n\n  return buf;\n};\n\nutil.getLongBytesValue = function(buf, offset) {\n  return buf.readUInt32LE(offset);\n};\n\nutil.toDosTime = function(d) {\n  return util.getLongBytes(util.dateToDos(d));\n};","/**\n * node-compress-commons\n *\n * Copyright (c) 2014 Chris Talkington, contributors.\n * Licensed under the MIT license.\n * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT\n */\nvar zipUtil = require('./util');\n\nvar DATA_DESCRIPTOR_FLAG = 1 << 3;\nvar ENCRYPTION_FLAG = 1 << 0;\nvar NUMBER_OF_SHANNON_FANO_TREES_FLAG = 1 << 2;\nvar SLIDING_DICTIONARY_SIZE_FLAG = 1 << 1;\nvar STRONG_ENCRYPTION_FLAG = 1 << 6;\nvar UFT8_NAMES_FLAG = 1 << 11;\n\nvar GeneralPurposeBit = module.exports = function() {\n  if (!(this instanceof GeneralPurposeBit)) {\n    return new GeneralPurposeBit();\n  }\n\n  this.descriptor = false;\n  this.encryption = false;\n  this.utf8 = false;\n  this.numberOfShannonFanoTrees = 0;\n  this.strongEncryption = false;\n  this.slidingDictionarySize = 0;\n\n  return this;\n};\n\nGeneralPurposeBit.prototype.encode = function() {\n  return zipUtil.getShortBytes(\n    (this.descriptor ? DATA_DESCRIPTOR_FLAG : 0) |\n    (this.utf8 ? UFT8_NAMES_FLAG : 0) |\n    (this.encryption ? ENCRYPTION_FLAG : 0) |\n    (this.strongEncryption ? STRONG_ENCRYPTION_FLAG : 0)\n  );\n};\n\nGeneralPurposeBit.prototype.parse = function(buf, offset) {\n  var flag = zipUtil.getShortBytesValue(buf, offset);\n  var gbp = new GeneralPurposeBit();\n\n  gbp.useDataDescriptor((flag & DATA_DESCRIPTOR_FLAG) !== 0);\n  gbp.useUTF8ForNames((flag & UFT8_NAMES_FLAG) !== 0);\n  gbp.useStrongEncryption((flag & STRONG_ENCRYPTION_FLAG) !== 0);\n  gbp.useEncryption((flag & ENCRYPTION_FLAG) !== 0);\n  gbp.setSlidingDictionarySize((flag & SLIDING_DICTIONARY_SIZE_FLAG) !== 0 ? 8192 : 4096);\n  gbp.setNumberOfShannonFanoTrees((flag & NUMBER_OF_SHANNON_FANO_TREES_FLAG) !== 0 ? 3 : 2);\n\n  return gbp;\n};\n\nGeneralPurposeBit.prototype.setNumberOfShannonFanoTrees = function(n) {\n  this.numberOfShannonFanoTrees = n;\n};\n\nGeneralPurposeBit.prototype.getNumberOfShannonFanoTrees = function() {\n  return this.numberOfShannonFanoTrees;\n};\n\nGeneralPurposeBit.prototype.setSlidingDictionarySize = function(n) {\n  this.slidingDictionarySize = n;\n};\n\nGeneralPurposeBit.prototype.getSlidingDictionarySize = function() {\n  return this.slidingDictionarySize;\n};\n\nGeneralPurposeBit.prototype.useDataDescriptor = function(b) {\n  this.descriptor = b;\n};\n\nGeneralPurposeBit.prototype.usesDataDescriptor = function() {\n  return this.descriptor;\n};\n\nGeneralPurposeBit.prototype.useEncryption = function(b) {\n  this.encryption = b;\n};\n\nGeneralPurposeBit.prototype.usesEncryption = function() {\n  return this.encryption;\n};\n\nGeneralPurposeBit.prototype.useStrongEncryption = function(b) {\n  this.strongEncryption = b;\n};\n\nGeneralPurposeBit.prototype.usesStrongEncryption = function() {\n  return this.strongEncryption;\n};\n\nGeneralPurposeBit.prototype.useUTF8ForNames = function(b) {\n  this.utf8 = b;\n};\n\nGeneralPurposeBit.prototype.usesUTF8ForNames = function() {\n  return this.utf8;\n};","/**\n * node-compress-commons\n *\n * Copyright (c) 2014 Chris Talkington, contributors.\n * Licensed under the MIT license.\n * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT\n */\nmodule.exports = {\n    /**\n     * Bits used for permissions (and sticky bit)\n     */\n    PERM_MASK: 4095, // 07777\n\n    /**\n     * Bits used to indicate the filesystem object type.\n     */\n    FILE_TYPE_FLAG: 61440, // 0170000\n\n    /**\n     * Indicates symbolic links.\n     */\n    LINK_FLAG: 40960, // 0120000\n\n    /**\n     * Indicates plain files.\n     */\n    FILE_FLAG: 32768, // 0100000\n\n    /**\n     * Indicates directories.\n     */\n    DIR_FLAG: 16384, // 040000\n\n    // ----------------------------------------------------------\n    // somewhat arbitrary choices that are quite common for shared\n    // installations\n    // -----------------------------------------------------------\n\n    /**\n     * Default permissions for symbolic links.\n     */\n    DEFAULT_LINK_PERM: 511, // 0777\n\n    /**\n     * Default permissions for directories.\n     */\n    DEFAULT_DIR_PERM: 493, // 0755\n\n    /**\n     * Default permissions for plain files.\n     */\n    DEFAULT_FILE_PERM: 420 // 0644\n};","/**\n * node-compress-commons\n *\n * Copyright (c) 2014 Chris Talkington, contributors.\n * Licensed under the MIT license.\n * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT\n */\nmodule.exports = {\n  WORD: 4,\n  DWORD: 8,\n  EMPTY: Buffer.alloc(0),\n\n  SHORT: 2,\n  SHORT_MASK: 0xffff,\n  SHORT_SHIFT: 16,\n  SHORT_ZERO: Buffer.from(Array(2)),\n  LONG: 4,\n  LONG_ZERO: Buffer.from(Array(4)),\n\n  MIN_VERSION_INITIAL: 10,\n  MIN_VERSION_DATA_DESCRIPTOR: 20,\n  MIN_VERSION_ZIP64: 45,\n  VERSION_MADEBY: 45,\n\n  METHOD_STORED: 0,\n  METHOD_DEFLATED: 8,\n\n  PLATFORM_UNIX: 3,\n  PLATFORM_FAT: 0,\n\n  SIG_LFH: 0x04034b50,\n  SIG_DD: 0x08074b50,\n  SIG_CFH: 0x02014b50,\n  SIG_EOCD: 0x06054b50,\n  SIG_ZIP64_EOCD: 0x06064B50,\n  SIG_ZIP64_EOCD_LOC: 0x07064B50,\n\n  ZIP64_MAGIC_SHORT: 0xffff,\n  ZIP64_MAGIC: 0xffffffff,\n  ZIP64_EXTRA_ID: 0x0001,\n\n  ZLIB_NO_COMPRESSION: 0,\n  ZLIB_BEST_SPEED: 1,\n  ZLIB_BEST_COMPRESSION: 9,\n  ZLIB_DEFAULT_COMPRESSION: -1,\n\n  MODE_MASK: 0xFFF,\n  DEFAULT_FILE_MODE: 33188, // 010644 = -rw-r--r-- = S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH\n  DEFAULT_DIR_MODE: 16877,  // 040755 = drwxr-xr-x = S_IFDIR | S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH\n\n  EXT_FILE_ATTR_DIR: 1106051088,  // 010173200020 = drwxr-xr-x = (((S_IFDIR | 0755) << 16) | S_DOS_D)\n  EXT_FILE_ATTR_FILE: 2175008800, // 020151000040 = -rw-r--r-- = (((S_IFREG | 0644) << 16) | S_DOS_A) >>> 0\n\n  // Unix file types\n  S_IFMT: 61440,   // 0170000 type of file mask\n  S_IFIFO: 4096,   // 010000 named pipe (fifo)\n  S_IFCHR: 8192,   // 020000 character special\n  S_IFDIR: 16384,  // 040000 directory\n  S_IFBLK: 24576,  // 060000 block special\n  S_IFREG: 32768,  // 0100000 regular\n  S_IFLNK: 40960,  // 0120000 symbolic link\n  S_IFSOCK: 49152, // 0140000 socket\n\n  // DOS file type flags\n  S_DOS_A: 32, // 040 Archive\n  S_DOS_D: 16, // 020 Directory\n  S_DOS_V: 8,  // 010 Volume\n  S_DOS_S: 4,  // 04 System\n  S_DOS_H: 2,  // 02 Hidden\n  S_DOS_R: 1   // 01 Read Only\n};\n","/**\n * node-compress-commons\n *\n * Copyright (c) 2014 Chris Talkington, contributors.\n * Licensed under the MIT license.\n * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT\n */\nvar inherits = require('util').inherits;\nvar normalizePath = require('normalize-path');\n\nvar ArchiveEntry = require('../archive-entry');\nvar GeneralPurposeBit = require('./general-purpose-bit');\nvar UnixStat = require('./unix-stat');\n\nvar constants = require('./constants');\nvar zipUtil = require('./util');\n\nvar ZipArchiveEntry = module.exports = function(name) {\n  if (!(this instanceof ZipArchiveEntry)) {\n    return new ZipArchiveEntry(name);\n  }\n\n  ArchiveEntry.call(this);\n\n  this.platform = constants.PLATFORM_FAT;\n  this.method = -1;\n\n  this.name = null;\n  this.size = 0;\n  this.csize = 0;\n  this.gpb = new GeneralPurposeBit();\n  this.crc = 0;\n  this.time = -1;\n\n  this.minver = constants.MIN_VERSION_INITIAL;\n  this.mode = -1;\n  this.extra = null;\n  this.exattr = 0;\n  this.inattr = 0;\n  this.comment = null;\n\n  if (name) {\n    this.setName(name);\n  }\n};\n\ninherits(ZipArchiveEntry, ArchiveEntry);\n\n/**\n * Returns the extra fields related to the entry.\n *\n * @returns {Buffer}\n */\nZipArchiveEntry.prototype.getCentralDirectoryExtra = function() {\n  return this.getExtra();\n};\n\n/**\n * Returns the comment set for the entry.\n *\n * @returns {string}\n */\nZipArchiveEntry.prototype.getComment = function() {\n  return this.comment !== null ? this.comment : '';\n};\n\n/**\n * Returns the compressed size of the entry.\n *\n * @returns {number}\n */\nZipArchiveEntry.prototype.getCompressedSize = function() {\n  return this.csize;\n};\n\n/**\n * Returns the CRC32 digest for the entry.\n *\n * @returns {number}\n */\nZipArchiveEntry.prototype.getCrc = function() {\n  return this.crc;\n};\n\n/**\n * Returns the external file attributes for the entry.\n *\n * @returns {number}\n */\nZipArchiveEntry.prototype.getExternalAttributes = function() {\n  return this.exattr;\n};\n\n/**\n * Returns the extra fields related to the entry.\n *\n * @returns {Buffer}\n */\nZipArchiveEntry.prototype.getExtra = function() {\n  return this.extra !== null ? this.extra : constants.EMPTY;\n};\n\n/**\n * Returns the general purpose bits related to the entry.\n *\n * @returns {GeneralPurposeBit}\n */\nZipArchiveEntry.prototype.getGeneralPurposeBit = function() {\n  return this.gpb;\n};\n\n/**\n * Returns the internal file attributes for the entry.\n *\n * @returns {number}\n */\nZipArchiveEntry.prototype.getInternalAttributes = function() {\n  return this.inattr;\n};\n\n/**\n * Returns the last modified date of the entry.\n *\n * @returns {number}\n */\nZipArchiveEntry.prototype.getLastModifiedDate = function() {\n  return this.getTime();\n};\n\n/**\n * Returns the extra fields related to the entry.\n *\n * @returns {Buffer}\n */\nZipArchiveEntry.prototype.getLocalFileDataExtra = function() {\n  return this.getExtra();\n};\n\n/**\n * Returns the compression method used on the entry.\n *\n * @returns {number}\n */\nZipArchiveEntry.prototype.getMethod = function() {\n  return this.method;\n};\n\n/**\n * Returns the filename of the entry.\n *\n * @returns {string}\n */\nZipArchiveEntry.prototype.getName = function() {\n  return this.name;\n};\n\n/**\n * Returns the platform on which the entry was made.\n *\n * @returns {number}\n */\nZipArchiveEntry.prototype.getPlatform = function() {\n  return this.platform;\n};\n\n/**\n * Returns the size of the entry.\n *\n * @returns {number}\n */\nZipArchiveEntry.prototype.getSize = function() {\n  return this.size;\n};\n\n/**\n * Returns a date object representing the last modified date of the entry.\n *\n * @returns {number|Date}\n */\nZipArchiveEntry.prototype.getTime = function() {\n  return this.time !== -1 ? zipUtil.dosToDate(this.time) : -1;\n};\n\n/**\n * Returns the DOS timestamp for the entry.\n *\n * @returns {number}\n */\nZipArchiveEntry.prototype.getTimeDos = function() {\n  return this.time !== -1 ? this.time : 0;\n};\n\n/**\n * Returns the UNIX file permissions for the entry.\n *\n * @returns {number}\n */\nZipArchiveEntry.prototype.getUnixMode = function() {\n  return this.platform !== constants.PLATFORM_UNIX ? 0 : ((this.getExternalAttributes() >> constants.SHORT_SHIFT) & constants.SHORT_MASK);\n};\n\n/**\n * Returns the version of ZIP needed to extract the entry.\n *\n * @returns {number}\n */\nZipArchiveEntry.prototype.getVersionNeededToExtract = function() {\n  return this.minver;\n};\n\n/**\n * Sets the comment of the entry.\n *\n * @param comment\n */\nZipArchiveEntry.prototype.setComment = function(comment) {\n  if (Buffer.byteLength(comment) !== comment.length) {\n    this.getGeneralPurposeBit().useUTF8ForNames(true);\n  }\n\n  this.comment = comment;\n};\n\n/**\n * Sets the compressed size of the entry.\n *\n * @param size\n */\nZipArchiveEntry.prototype.setCompressedSize = function(size) {\n  if (size < 0) {\n    throw new Error('invalid entry compressed size');\n  }\n\n  this.csize = size;\n};\n\n/**\n * Sets the checksum of the entry.\n *\n * @param crc\n */\nZipArchiveEntry.prototype.setCrc = function(crc) {\n  if (crc < 0) {\n    throw new Error('invalid entry crc32');\n  }\n\n  this.crc = crc;\n};\n\n/**\n * Sets the external file attributes of the entry.\n *\n * @param attr\n */\nZipArchiveEntry.prototype.setExternalAttributes = function(attr) {\n  this.exattr = attr >>> 0;\n};\n\n/**\n * Sets the extra fields related to the entry.\n *\n * @param extra\n */\nZipArchiveEntry.prototype.setExtra = function(extra) {\n  this.extra = extra;\n};\n\n/**\n * Sets the general purpose bits related to the entry.\n *\n * @param gpb\n */\nZipArchiveEntry.prototype.setGeneralPurposeBit = function(gpb) {\n  if (!(gpb instanceof GeneralPurposeBit)) {\n    throw new Error('invalid entry GeneralPurposeBit');\n  }\n\n  this.gpb = gpb;\n};\n\n/**\n * Sets the internal file attributes of the entry.\n *\n * @param attr\n */\nZipArchiveEntry.prototype.setInternalAttributes = function(attr) {\n  this.inattr = attr;\n};\n\n/**\n * Sets the compression method of the entry.\n *\n * @param method\n */\nZipArchiveEntry.prototype.setMethod = function(method) {\n  if (method < 0) {\n    throw new Error('invalid entry compression method');\n  }\n\n  this.method = method;\n};\n\n/**\n * Sets the name of the entry.\n *\n * @param name\n * @param prependSlash\n */\nZipArchiveEntry.prototype.setName = function(name, prependSlash = false) {\n  name = normalizePath(name, false)\n    .replace(/^\\w+:/, '')\n    .replace(/^(\\.\\.\\/|\\/)+/, '');\n\n  if (prependSlash) {\n    name = `/${name}`;\n  }\n\n  if (Buffer.byteLength(name) !== name.length) {\n    this.getGeneralPurposeBit().useUTF8ForNames(true);\n  }\n\n  this.name = name;\n};\n\n/**\n * Sets the platform on which the entry was made.\n *\n * @param platform\n */\nZipArchiveEntry.prototype.setPlatform = function(platform) {\n  this.platform = platform;\n};\n\n/**\n * Sets the size of the entry.\n *\n * @param size\n */\nZipArchiveEntry.prototype.setSize = function(size) {\n  if (size < 0) {\n    throw new Error('invalid entry size');\n  }\n\n  this.size = size;\n};\n\n/**\n * Sets the time of the entry.\n *\n * @param time\n * @param forceLocalTime\n */\nZipArchiveEntry.prototype.setTime = function(time, forceLocalTime) {\n  if (!(time instanceof Date)) {\n    throw new Error('invalid entry time');\n  }\n\n  this.time = zipUtil.dateToDos(time, forceLocalTime);\n};\n\n/**\n * Sets the UNIX file permissions for the entry.\n *\n * @param mode\n */\nZipArchiveEntry.prototype.setUnixMode = function(mode) {\n  mode |= this.isDirectory() ? constants.S_IFDIR : constants.S_IFREG;\n\n  var extattr = 0;\n  extattr |= (mode << constants.SHORT_SHIFT) | (this.isDirectory() ? constants.S_DOS_D : constants.S_DOS_A);\n\n  this.setExternalAttributes(extattr);\n  this.mode = mode & constants.MODE_MASK;\n  this.platform = constants.PLATFORM_UNIX;\n};\n\n/**\n * Sets the version of ZIP needed to extract this entry.\n *\n * @param minver\n */\nZipArchiveEntry.prototype.setVersionNeededToExtract = function(minver) {\n  this.minver = minver;\n};\n\n/**\n * Returns true if this entry represents a directory.\n *\n * @returns {boolean}\n */\nZipArchiveEntry.prototype.isDirectory = function() {\n  return this.getName().slice(-1) === '/';\n};\n\n/**\n * Returns true if this entry represents a unix symlink,\n * in which case the entry's content contains the target path\n * for the symlink.\n *\n * @returns {boolean}\n */\nZipArchiveEntry.prototype.isUnixSymlink = function() {\n  return (this.getUnixMode() & UnixStat.FILE_TYPE_FLAG) === UnixStat.LINK_FLAG;\n};\n\n/**\n * Returns true if this entry is using the ZIP64 extension of ZIP.\n *\n * @returns {boolean}\n */\nZipArchiveEntry.prototype.isZip64 = function() {\n  return this.csize > constants.ZIP64_MAGIC || this.size > constants.ZIP64_MAGIC;\n};\n","'use strict'\n\n/*\n  This file is a reduced and adapted version of the main lib/internal/per_context/primordials.js file defined at\n\n  https://github.com/nodejs/node/blob/main/lib/internal/per_context/primordials.js\n\n  Don't try to replace with the original file and keep it up to date with the upstream file.\n*/\n\n// This is a simplified version of AggregateError\nclass AggregateError extends Error {\n  constructor(errors) {\n    if (!Array.isArray(errors)) {\n      throw new TypeError(`Expected input to be an Array, got ${typeof errors}`)\n    }\n    let message = ''\n    for (let i = 0; i < errors.length; i++) {\n      message += `    ${errors[i].stack}\\n`\n    }\n    super(message)\n    this.name = 'AggregateError'\n    this.errors = errors\n  }\n}\nmodule.exports = {\n  AggregateError,\n  ArrayIsArray(self) {\n    return Array.isArray(self)\n  },\n  ArrayPrototypeIncludes(self, el) {\n    return self.includes(el)\n  },\n  ArrayPrototypeIndexOf(self, el) {\n    return self.indexOf(el)\n  },\n  ArrayPrototypeJoin(self, sep) {\n    return self.join(sep)\n  },\n  ArrayPrototypeMap(self, fn) {\n    return self.map(fn)\n  },\n  ArrayPrototypePop(self, el) {\n    return self.pop(el)\n  },\n  ArrayPrototypePush(self, el) {\n    return self.push(el)\n  },\n  ArrayPrototypeSlice(self, start, end) {\n    return self.slice(start, end)\n  },\n  Error,\n  FunctionPrototypeCall(fn, thisArgs, ...args) {\n    return fn.call(thisArgs, ...args)\n  },\n  FunctionPrototypeSymbolHasInstance(self, instance) {\n    return Function.prototype[Symbol.hasInstance].call(self, instance)\n  },\n  MathFloor: Math.floor,\n  Number,\n  NumberIsInteger: Number.isInteger,\n  NumberIsNaN: Number.isNaN,\n  NumberMAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER,\n  NumberMIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER,\n  NumberParseInt: Number.parseInt,\n  ObjectDefineProperties(self, props) {\n    return Object.defineProperties(self, props)\n  },\n  ObjectDefineProperty(self, name, prop) {\n    return Object.defineProperty(self, name, prop)\n  },\n  ObjectGetOwnPropertyDescriptor(self, name) {\n    return Object.getOwnPropertyDescriptor(self, name)\n  },\n  ObjectKeys(obj) {\n    return Object.keys(obj)\n  },\n  ObjectSetPrototypeOf(target, proto) {\n    return Object.setPrototypeOf(target, proto)\n  },\n  Promise,\n  PromisePrototypeCatch(self, fn) {\n    return self.catch(fn)\n  },\n  PromisePrototypeThen(self, thenFn, catchFn) {\n    return self.then(thenFn, catchFn)\n  },\n  PromiseReject(err) {\n    return Promise.reject(err)\n  },\n  PromiseResolve(val) {\n    return Promise.resolve(val)\n  },\n  ReflectApply: Reflect.apply,\n  RegExpPrototypeTest(self, value) {\n    return self.test(value)\n  },\n  SafeSet: Set,\n  String,\n  StringPrototypeSlice(self, start, end) {\n    return self.slice(start, end)\n  },\n  StringPrototypeToLowerCase(self) {\n    return self.toLowerCase()\n  },\n  StringPrototypeToUpperCase(self) {\n    return self.toUpperCase()\n  },\n  StringPrototypeTrim(self) {\n    return self.trim()\n  },\n  Symbol,\n  SymbolFor: Symbol.for,\n  SymbolAsyncIterator: Symbol.asyncIterator,\n  SymbolHasInstance: Symbol.hasInstance,\n  SymbolIterator: Symbol.iterator,\n  SymbolDispose: Symbol.dispose || Symbol('Symbol.dispose'),\n  SymbolAsyncDispose: Symbol.asyncDispose || Symbol('Symbol.asyncDispose'),\n  TypedArrayPrototypeSet(self, buf, len) {\n    return self.set(buf, len)\n  },\n  Boolean,\n  Uint8Array\n}\n","'use strict'\n\n/*\n  This file is a reduced and adapted version of the main lib/internal/util/inspect.js file defined at\n\n  https://github.com/nodejs/node/blob/main/lib/internal/util/inspect.js\n\n  Don't try to replace with the original file and keep it up to date with the upstream file.\n*/\nmodule.exports = {\n  format(format, ...args) {\n    // Simplified version of https://nodejs.org/api/util.html#utilformatformat-args\n    return format.replace(/%([sdifj])/g, function (...[_unused, type]) {\n      const replacement = args.shift()\n      if (type === 'f') {\n        return replacement.toFixed(6)\n      } else if (type === 'j') {\n        return JSON.stringify(replacement)\n      } else if (type === 's' && typeof replacement === 'object') {\n        const ctor = replacement.constructor !== Object ? replacement.constructor.name : ''\n        return `${ctor} {}`.trim()\n      } else {\n        return replacement.toString()\n      }\n    })\n  },\n  inspect(value) {\n    // Vastly simplified version of https://nodejs.org/api/util.html#utilinspectobject-options\n    switch (typeof value) {\n      case 'string':\n        if (value.includes(\"'\")) {\n          if (!value.includes('\"')) {\n            return `\"${value}\"`\n          } else if (!value.includes('`') && !value.includes('${')) {\n            return `\\`${value}\\``\n          }\n        }\n        return `'${value}'`\n      case 'number':\n        if (isNaN(value)) {\n          return 'NaN'\n        } else if (Object.is(value, -0)) {\n          return String(value)\n        }\n        return value\n      case 'bigint':\n        return `${String(value)}n`\n      case 'boolean':\n      case 'undefined':\n        return String(value)\n      case 'object':\n        return '{}'\n    }\n  }\n}\n","'use strict'\n\nconst { format, inspect } = require('./util/inspect')\nconst { AggregateError: CustomAggregateError } = require('./primordials')\n\n/*\n  This file is a reduced and adapted version of the main lib/internal/errors.js file defined at\n\n  https://github.com/nodejs/node/blob/main/lib/internal/errors.js\n\n  Don't try to replace with the original file and keep it up to date (starting from E(...) definitions)\n  with the upstream file.\n*/\n\nconst AggregateError = globalThis.AggregateError || CustomAggregateError\nconst kIsNodeError = Symbol('kIsNodeError')\nconst kTypes = [\n  'string',\n  'function',\n  'number',\n  'object',\n  // Accept 'Function' and 'Object' as alternative to the lower cased version.\n  'Function',\n  'Object',\n  'boolean',\n  'bigint',\n  'symbol'\n]\nconst classRegExp = /^([A-Z][a-z0-9]*)+$/\nconst nodeInternalPrefix = '__node_internal_'\nconst codes = {}\nfunction assert(value, message) {\n  if (!value) {\n    throw new codes.ERR_INTERNAL_ASSERTION(message)\n  }\n}\n\n// Only use this for integers! Decimal numbers do not work with this function.\nfunction addNumericalSeparator(val) {\n  let res = ''\n  let i = val.length\n  const start = val[0] === '-' ? 1 : 0\n  for (; i >= start + 4; i -= 3) {\n    res = `_${val.slice(i - 3, i)}${res}`\n  }\n  return `${val.slice(0, i)}${res}`\n}\nfunction getMessage(key, msg, args) {\n  if (typeof msg === 'function') {\n    assert(\n      msg.length <= args.length,\n      // Default options do not count.\n      `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`\n    )\n    return msg(...args)\n  }\n  const expectedLength = (msg.match(/%[dfijoOs]/g) || []).length\n  assert(\n    expectedLength === args.length,\n    `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`\n  )\n  if (args.length === 0) {\n    return msg\n  }\n  return format(msg, ...args)\n}\nfunction E(code, message, Base) {\n  if (!Base) {\n    Base = Error\n  }\n  class NodeError extends Base {\n    constructor(...args) {\n      super(getMessage(code, message, args))\n    }\n    toString() {\n      return `${this.name} [${code}]: ${this.message}`\n    }\n  }\n  Object.defineProperties(NodeError.prototype, {\n    name: {\n      value: Base.name,\n      writable: true,\n      enumerable: false,\n      configurable: true\n    },\n    toString: {\n      value() {\n        return `${this.name} [${code}]: ${this.message}`\n      },\n      writable: true,\n      enumerable: false,\n      configurable: true\n    }\n  })\n  NodeError.prototype.code = code\n  NodeError.prototype[kIsNodeError] = true\n  codes[code] = NodeError\n}\nfunction hideStackFrames(fn) {\n  // We rename the functions that will be hidden to cut off the stacktrace\n  // at the outermost one\n  const hidden = nodeInternalPrefix + fn.name\n  Object.defineProperty(fn, 'name', {\n    value: hidden\n  })\n  return fn\n}\nfunction aggregateTwoErrors(innerError, outerError) {\n  if (innerError && outerError && innerError !== outerError) {\n    if (Array.isArray(outerError.errors)) {\n      // If `outerError` is already an `AggregateError`.\n      outerError.errors.push(innerError)\n      return outerError\n    }\n    const err = new AggregateError([outerError, innerError], outerError.message)\n    err.code = outerError.code\n    return err\n  }\n  return innerError || outerError\n}\nclass AbortError extends Error {\n  constructor(message = 'The operation was aborted', options = undefined) {\n    if (options !== undefined && typeof options !== 'object') {\n      throw new codes.ERR_INVALID_ARG_TYPE('options', 'Object', options)\n    }\n    super(message, options)\n    this.code = 'ABORT_ERR'\n    this.name = 'AbortError'\n  }\n}\nE('ERR_ASSERTION', '%s', Error)\nE(\n  'ERR_INVALID_ARG_TYPE',\n  (name, expected, actual) => {\n    assert(typeof name === 'string', \"'name' must be a string\")\n    if (!Array.isArray(expected)) {\n      expected = [expected]\n    }\n    let msg = 'The '\n    if (name.endsWith(' argument')) {\n      // For cases like 'first argument'\n      msg += `${name} `\n    } else {\n      msg += `\"${name}\" ${name.includes('.') ? 'property' : 'argument'} `\n    }\n    msg += 'must be '\n    const types = []\n    const instances = []\n    const other = []\n    for (const value of expected) {\n      assert(typeof value === 'string', 'All expected entries have to be of type string')\n      if (kTypes.includes(value)) {\n        types.push(value.toLowerCase())\n      } else if (classRegExp.test(value)) {\n        instances.push(value)\n      } else {\n        assert(value !== 'object', 'The value \"object\" should be written as \"Object\"')\n        other.push(value)\n      }\n    }\n\n    // Special handle `object` in case other instances are allowed to outline\n    // the differences between each other.\n    if (instances.length > 0) {\n      const pos = types.indexOf('object')\n      if (pos !== -1) {\n        types.splice(types, pos, 1)\n        instances.push('Object')\n      }\n    }\n    if (types.length > 0) {\n      switch (types.length) {\n        case 1:\n          msg += `of type ${types[0]}`\n          break\n        case 2:\n          msg += `one of type ${types[0]} or ${types[1]}`\n          break\n        default: {\n          const last = types.pop()\n          msg += `one of type ${types.join(', ')}, or ${last}`\n        }\n      }\n      if (instances.length > 0 || other.length > 0) {\n        msg += ' or '\n      }\n    }\n    if (instances.length > 0) {\n      switch (instances.length) {\n        case 1:\n          msg += `an instance of ${instances[0]}`\n          break\n        case 2:\n          msg += `an instance of ${instances[0]} or ${instances[1]}`\n          break\n        default: {\n          const last = instances.pop()\n          msg += `an instance of ${instances.join(', ')}, or ${last}`\n        }\n      }\n      if (other.length > 0) {\n        msg += ' or '\n      }\n    }\n    switch (other.length) {\n      case 0:\n        break\n      case 1:\n        if (other[0].toLowerCase() !== other[0]) {\n          msg += 'an '\n        }\n        msg += `${other[0]}`\n        break\n      case 2:\n        msg += `one of ${other[0]} or ${other[1]}`\n        break\n      default: {\n        const last = other.pop()\n        msg += `one of ${other.join(', ')}, or ${last}`\n      }\n    }\n    if (actual == null) {\n      msg += `. Received ${actual}`\n    } else if (typeof actual === 'function' && actual.name) {\n      msg += `. Received function ${actual.name}`\n    } else if (typeof actual === 'object') {\n      var _actual$constructor\n      if (\n        (_actual$constructor = actual.constructor) !== null &&\n        _actual$constructor !== undefined &&\n        _actual$constructor.name\n      ) {\n        msg += `. Received an instance of ${actual.constructor.name}`\n      } else {\n        const inspected = inspect(actual, {\n          depth: -1\n        })\n        msg += `. Received ${inspected}`\n      }\n    } else {\n      let inspected = inspect(actual, {\n        colors: false\n      })\n      if (inspected.length > 25) {\n        inspected = `${inspected.slice(0, 25)}...`\n      }\n      msg += `. Received type ${typeof actual} (${inspected})`\n    }\n    return msg\n  },\n  TypeError\n)\nE(\n  'ERR_INVALID_ARG_VALUE',\n  (name, value, reason = 'is invalid') => {\n    let inspected = inspect(value)\n    if (inspected.length > 128) {\n      inspected = inspected.slice(0, 128) + '...'\n    }\n    const type = name.includes('.') ? 'property' : 'argument'\n    return `The ${type} '${name}' ${reason}. Received ${inspected}`\n  },\n  TypeError\n)\nE(\n  'ERR_INVALID_RETURN_VALUE',\n  (input, name, value) => {\n    var _value$constructor\n    const type =\n      value !== null &&\n      value !== undefined &&\n      (_value$constructor = value.constructor) !== null &&\n      _value$constructor !== undefined &&\n      _value$constructor.name\n        ? `instance of ${value.constructor.name}`\n        : `type ${typeof value}`\n    return `Expected ${input} to be returned from the \"${name}\"` + ` function but got ${type}.`\n  },\n  TypeError\n)\nE(\n  'ERR_MISSING_ARGS',\n  (...args) => {\n    assert(args.length > 0, 'At least one arg needs to be specified')\n    let msg\n    const len = args.length\n    args = (Array.isArray(args) ? args : [args]).map((a) => `\"${a}\"`).join(' or ')\n    switch (len) {\n      case 1:\n        msg += `The ${args[0]} argument`\n        break\n      case 2:\n        msg += `The ${args[0]} and ${args[1]} arguments`\n        break\n      default:\n        {\n          const last = args.pop()\n          msg += `The ${args.join(', ')}, and ${last} arguments`\n        }\n        break\n    }\n    return `${msg} must be specified`\n  },\n  TypeError\n)\nE(\n  'ERR_OUT_OF_RANGE',\n  (str, range, input) => {\n    assert(range, 'Missing \"range\" argument')\n    let received\n    if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n      received = addNumericalSeparator(String(input))\n    } else if (typeof input === 'bigint') {\n      received = String(input)\n      const limit = BigInt(2) ** BigInt(32)\n      if (input > limit || input < -limit) {\n        received = addNumericalSeparator(received)\n      }\n      received += 'n'\n    } else {\n      received = inspect(input)\n    }\n    return `The value of \"${str}\" is out of range. It must be ${range}. Received ${received}`\n  },\n  RangeError\n)\nE('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times', Error)\nE('ERR_METHOD_NOT_IMPLEMENTED', 'The %s method is not implemented', Error)\nE('ERR_STREAM_ALREADY_FINISHED', 'Cannot call %s after a stream was finished', Error)\nE('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable', Error)\nE('ERR_STREAM_DESTROYED', 'Cannot call %s after a stream was destroyed', Error)\nE('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError)\nE('ERR_STREAM_PREMATURE_CLOSE', 'Premature close', Error)\nE('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF', Error)\nE('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event', Error)\nE('ERR_STREAM_WRITE_AFTER_END', 'write after end', Error)\nE('ERR_UNKNOWN_ENCODING', 'Unknown encoding: %s', TypeError)\nmodule.exports = {\n  AbortError,\n  aggregateTwoErrors: hideStackFrames(aggregateTwoErrors),\n  hideStackFrames,\n  codes\n}\n","'use strict'\n\nconst bufferModule = require('buffer')\nconst { format, inspect } = require('./util/inspect')\nconst {\n  codes: { ERR_INVALID_ARG_TYPE }\n} = require('./errors')\nconst { kResistStopPropagation, AggregateError, SymbolDispose } = require('./primordials')\nconst AbortSignal = globalThis.AbortSignal || require('abort-controller').AbortSignal\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nconst AsyncFunction = Object.getPrototypeOf(async function () {}).constructor\nconst Blob = globalThis.Blob || bufferModule.Blob\n/* eslint-disable indent */\nconst isBlob =\n  typeof Blob !== 'undefined'\n    ? function isBlob(b) {\n        // eslint-disable-next-line indent\n        return b instanceof Blob\n      }\n    : function isBlob(b) {\n        return false\n      }\n/* eslint-enable indent */\n\nconst validateAbortSignal = (signal, name) => {\n  if (signal !== undefined && (signal === null || typeof signal !== 'object' || !('aborted' in signal))) {\n    throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal)\n  }\n}\nconst validateFunction = (value, name) => {\n  if (typeof value !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)\n  }\n}\nmodule.exports = {\n  AggregateError,\n  kEmptyObject: Object.freeze({}),\n  once(callback) {\n    let called = false\n    return function (...args) {\n      if (called) {\n        return\n      }\n      called = true\n      callback.apply(this, args)\n    }\n  },\n  createDeferredPromise: function () {\n    let resolve\n    let reject\n\n    // eslint-disable-next-line promise/param-names\n    const promise = new Promise((res, rej) => {\n      resolve = res\n      reject = rej\n    })\n    return {\n      promise,\n      resolve,\n      reject\n    }\n  },\n  promisify(fn) {\n    return new Promise((resolve, reject) => {\n      fn((err, ...args) => {\n        if (err) {\n          return reject(err)\n        }\n        return resolve(...args)\n      })\n    })\n  },\n  debuglog() {\n    return function () {}\n  },\n  format,\n  inspect,\n  types: {\n    isAsyncFunction(fn) {\n      return fn instanceof AsyncFunction\n    },\n    isArrayBufferView(arr) {\n      return ArrayBuffer.isView(arr)\n    }\n  },\n  isBlob,\n  deprecate(fn, message) {\n    return fn\n  },\n  addAbortListener:\n    require('events').addAbortListener ||\n    function addAbortListener(signal, listener) {\n      if (signal === undefined) {\n        throw new ERR_INVALID_ARG_TYPE('signal', 'AbortSignal', signal)\n      }\n      validateAbortSignal(signal, 'signal')\n      validateFunction(listener, 'listener')\n      let removeEventListener\n      if (signal.aborted) {\n        queueMicrotask(() => listener())\n      } else {\n        signal.addEventListener('abort', listener, {\n          __proto__: null,\n          once: true,\n          [kResistStopPropagation]: true\n        })\n        removeEventListener = () => {\n          signal.removeEventListener('abort', listener)\n        }\n      }\n      return {\n        __proto__: null,\n        [SymbolDispose]() {\n          var _removeEventListener\n          ;(_removeEventListener = removeEventListener) === null || _removeEventListener === undefined\n            ? undefined\n            : _removeEventListener()\n        }\n      }\n    },\n  AbortSignalAny:\n    AbortSignal.any ||\n    function AbortSignalAny(signals) {\n      // Fast path if there is only one signal.\n      if (signals.length === 1) {\n        return signals[0]\n      }\n      const ac = new AbortController()\n      const abort = () => ac.abort()\n      signals.forEach((signal) => {\n        validateAbortSignal(signal, 'signals')\n        signal.addEventListener('abort', abort, {\n          once: true\n        })\n      })\n      ac.signal.addEventListener(\n        'abort',\n        () => {\n          signals.forEach((signal) => signal.removeEventListener('abort', abort))\n        },\n        {\n          once: true\n        }\n      )\n      return ac.signal\n    }\n}\nmodule.exports.promisify.custom = Symbol.for('nodejs.util.promisify.custom')\n","/* eslint jsdoc/require-jsdoc: \"error\" */\n\n'use strict'\n\nconst {\n  ArrayIsArray,\n  ArrayPrototypeIncludes,\n  ArrayPrototypeJoin,\n  ArrayPrototypeMap,\n  NumberIsInteger,\n  NumberIsNaN,\n  NumberMAX_SAFE_INTEGER,\n  NumberMIN_SAFE_INTEGER,\n  NumberParseInt,\n  ObjectPrototypeHasOwnProperty,\n  RegExpPrototypeExec,\n  String,\n  StringPrototypeToUpperCase,\n  StringPrototypeTrim\n} = require('../ours/primordials')\nconst {\n  hideStackFrames,\n  codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL }\n} = require('../ours/errors')\nconst { normalizeEncoding } = require('../ours/util')\nconst { isAsyncFunction, isArrayBufferView } = require('../ours/util').types\nconst signals = {}\n\n/**\n * @param {*} value\n * @returns {boolean}\n */\nfunction isInt32(value) {\n  return value === (value | 0)\n}\n\n/**\n * @param {*} value\n * @returns {boolean}\n */\nfunction isUint32(value) {\n  return value === value >>> 0\n}\nconst octalReg = /^[0-7]+$/\nconst modeDesc = 'must be a 32-bit unsigned integer or an octal string'\n\n/**\n * Parse and validate values that will be converted into mode_t (the S_*\n * constants). Only valid numbers and octal strings are allowed. They could be\n * converted to 32-bit unsigned integers or non-negative signed integers in the\n * C++ land, but any value higher than 0o777 will result in platform-specific\n * behaviors.\n * @param {*} value Values to be validated\n * @param {string} name Name of the argument\n * @param {number} [def] If specified, will be returned for invalid values\n * @returns {number}\n */\nfunction parseFileMode(value, name, def) {\n  if (typeof value === 'undefined') {\n    value = def\n  }\n  if (typeof value === 'string') {\n    if (RegExpPrototypeExec(octalReg, value) === null) {\n      throw new ERR_INVALID_ARG_VALUE(name, value, modeDesc)\n    }\n    value = NumberParseInt(value, 8)\n  }\n  validateUint32(value, name)\n  return value\n}\n\n/**\n * @callback validateInteger\n * @param {*} value\n * @param {string} name\n * @param {number} [min]\n * @param {number} [max]\n * @returns {asserts value is number}\n */\n\n/** @type {validateInteger} */\nconst validateInteger = hideStackFrames((value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) => {\n  if (typeof value !== 'number') throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n  if (!NumberIsInteger(value)) throw new ERR_OUT_OF_RANGE(name, 'an integer', value)\n  if (value < min || value > max) throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value)\n})\n\n/**\n * @callback validateInt32\n * @param {*} value\n * @param {string} name\n * @param {number} [min]\n * @param {number} [max]\n * @returns {asserts value is number}\n */\n\n/** @type {validateInt32} */\nconst validateInt32 = hideStackFrames((value, name, min = -2147483648, max = 2147483647) => {\n  // The defaults for min and max correspond to the limits of 32-bit integers.\n  if (typeof value !== 'number') {\n    throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n  }\n  if (!NumberIsInteger(value)) {\n    throw new ERR_OUT_OF_RANGE(name, 'an integer', value)\n  }\n  if (value < min || value > max) {\n    throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value)\n  }\n})\n\n/**\n * @callback validateUint32\n * @param {*} value\n * @param {string} name\n * @param {number|boolean} [positive=false]\n * @returns {asserts value is number}\n */\n\n/** @type {validateUint32} */\nconst validateUint32 = hideStackFrames((value, name, positive = false) => {\n  if (typeof value !== 'number') {\n    throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n  }\n  if (!NumberIsInteger(value)) {\n    throw new ERR_OUT_OF_RANGE(name, 'an integer', value)\n  }\n  const min = positive ? 1 : 0\n  // 2 ** 32 === 4294967296\n  const max = 4294967295\n  if (value < min || value > max) {\n    throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value)\n  }\n})\n\n/**\n * @callback validateString\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is string}\n */\n\n/** @type {validateString} */\nfunction validateString(value, name) {\n  if (typeof value !== 'string') throw new ERR_INVALID_ARG_TYPE(name, 'string', value)\n}\n\n/**\n * @callback validateNumber\n * @param {*} value\n * @param {string} name\n * @param {number} [min]\n * @param {number} [max]\n * @returns {asserts value is number}\n */\n\n/** @type {validateNumber} */\nfunction validateNumber(value, name, min = undefined, max) {\n  if (typeof value !== 'number') throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n  if (\n    (min != null && value < min) ||\n    (max != null && value > max) ||\n    ((min != null || max != null) && NumberIsNaN(value))\n  ) {\n    throw new ERR_OUT_OF_RANGE(\n      name,\n      `${min != null ? `>= ${min}` : ''}${min != null && max != null ? ' && ' : ''}${max != null ? `<= ${max}` : ''}`,\n      value\n    )\n  }\n}\n\n/**\n * @callback validateOneOf\n * @template T\n * @param {T} value\n * @param {string} name\n * @param {T[]} oneOf\n */\n\n/** @type {validateOneOf} */\nconst validateOneOf = hideStackFrames((value, name, oneOf) => {\n  if (!ArrayPrototypeIncludes(oneOf, value)) {\n    const allowed = ArrayPrototypeJoin(\n      ArrayPrototypeMap(oneOf, (v) => (typeof v === 'string' ? `'${v}'` : String(v))),\n      ', '\n    )\n    const reason = 'must be one of: ' + allowed\n    throw new ERR_INVALID_ARG_VALUE(name, value, reason)\n  }\n})\n\n/**\n * @callback validateBoolean\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is boolean}\n */\n\n/** @type {validateBoolean} */\nfunction validateBoolean(value, name) {\n  if (typeof value !== 'boolean') throw new ERR_INVALID_ARG_TYPE(name, 'boolean', value)\n}\n\n/**\n * @param {any} options\n * @param {string} key\n * @param {boolean} defaultValue\n * @returns {boolean}\n */\nfunction getOwnPropertyValueOrDefault(options, key, defaultValue) {\n  return options == null || !ObjectPrototypeHasOwnProperty(options, key) ? defaultValue : options[key]\n}\n\n/**\n * @callback validateObject\n * @param {*} value\n * @param {string} name\n * @param {{\n *   allowArray?: boolean,\n *   allowFunction?: boolean,\n *   nullable?: boolean\n * }} [options]\n */\n\n/** @type {validateObject} */\nconst validateObject = hideStackFrames((value, name, options = null) => {\n  const allowArray = getOwnPropertyValueOrDefault(options, 'allowArray', false)\n  const allowFunction = getOwnPropertyValueOrDefault(options, 'allowFunction', false)\n  const nullable = getOwnPropertyValueOrDefault(options, 'nullable', false)\n  if (\n    (!nullable && value === null) ||\n    (!allowArray && ArrayIsArray(value)) ||\n    (typeof value !== 'object' && (!allowFunction || typeof value !== 'function'))\n  ) {\n    throw new ERR_INVALID_ARG_TYPE(name, 'Object', value)\n  }\n})\n\n/**\n * @callback validateDictionary - We are using the Web IDL Standard definition\n *                                of \"dictionary\" here, which means any value\n *                                whose Type is either Undefined, Null, or\n *                                Object (which includes functions).\n * @param {*} value\n * @param {string} name\n * @see https://webidl.spec.whatwg.org/#es-dictionary\n * @see https://tc39.es/ecma262/#table-typeof-operator-results\n */\n\n/** @type {validateDictionary} */\nconst validateDictionary = hideStackFrames((value, name) => {\n  if (value != null && typeof value !== 'object' && typeof value !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE(name, 'a dictionary', value)\n  }\n})\n\n/**\n * @callback validateArray\n * @param {*} value\n * @param {string} name\n * @param {number} [minLength]\n * @returns {asserts value is any[]}\n */\n\n/** @type {validateArray} */\nconst validateArray = hideStackFrames((value, name, minLength = 0) => {\n  if (!ArrayIsArray(value)) {\n    throw new ERR_INVALID_ARG_TYPE(name, 'Array', value)\n  }\n  if (value.length < minLength) {\n    const reason = `must be longer than ${minLength}`\n    throw new ERR_INVALID_ARG_VALUE(name, value, reason)\n  }\n})\n\n/**\n * @callback validateStringArray\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is string[]}\n */\n\n/** @type {validateStringArray} */\nfunction validateStringArray(value, name) {\n  validateArray(value, name)\n  for (let i = 0; i < value.length; i++) {\n    validateString(value[i], `${name}[${i}]`)\n  }\n}\n\n/**\n * @callback validateBooleanArray\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is boolean[]}\n */\n\n/** @type {validateBooleanArray} */\nfunction validateBooleanArray(value, name) {\n  validateArray(value, name)\n  for (let i = 0; i < value.length; i++) {\n    validateBoolean(value[i], `${name}[${i}]`)\n  }\n}\n\n/**\n * @callback validateAbortSignalArray\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is AbortSignal[]}\n */\n\n/** @type {validateAbortSignalArray} */\nfunction validateAbortSignalArray(value, name) {\n  validateArray(value, name)\n  for (let i = 0; i < value.length; i++) {\n    const signal = value[i]\n    const indexedName = `${name}[${i}]`\n    if (signal == null) {\n      throw new ERR_INVALID_ARG_TYPE(indexedName, 'AbortSignal', signal)\n    }\n    validateAbortSignal(signal, indexedName)\n  }\n}\n\n/**\n * @param {*} signal\n * @param {string} [name='signal']\n * @returns {asserts signal is keyof signals}\n */\nfunction validateSignalName(signal, name = 'signal') {\n  validateString(signal, name)\n  if (signals[signal] === undefined) {\n    if (signals[StringPrototypeToUpperCase(signal)] !== undefined) {\n      throw new ERR_UNKNOWN_SIGNAL(signal + ' (signals must use all capital letters)')\n    }\n    throw new ERR_UNKNOWN_SIGNAL(signal)\n  }\n}\n\n/**\n * @callback validateBuffer\n * @param {*} buffer\n * @param {string} [name='buffer']\n * @returns {asserts buffer is ArrayBufferView}\n */\n\n/** @type {validateBuffer} */\nconst validateBuffer = hideStackFrames((buffer, name = 'buffer') => {\n  if (!isArrayBufferView(buffer)) {\n    throw new ERR_INVALID_ARG_TYPE(name, ['Buffer', 'TypedArray', 'DataView'], buffer)\n  }\n})\n\n/**\n * @param {string} data\n * @param {string} encoding\n */\nfunction validateEncoding(data, encoding) {\n  const normalizedEncoding = normalizeEncoding(encoding)\n  const length = data.length\n  if (normalizedEncoding === 'hex' && length % 2 !== 0) {\n    throw new ERR_INVALID_ARG_VALUE('encoding', encoding, `is invalid for data of length ${length}`)\n  }\n}\n\n/**\n * Check that the port number is not NaN when coerced to a number,\n * is an integer and that it falls within the legal range of port numbers.\n * @param {*} port\n * @param {string} [name='Port']\n * @param {boolean} [allowZero=true]\n * @returns {number}\n */\nfunction validatePort(port, name = 'Port', allowZero = true) {\n  if (\n    (typeof port !== 'number' && typeof port !== 'string') ||\n    (typeof port === 'string' && StringPrototypeTrim(port).length === 0) ||\n    +port !== +port >>> 0 ||\n    port > 0xffff ||\n    (port === 0 && !allowZero)\n  ) {\n    throw new ERR_SOCKET_BAD_PORT(name, port, allowZero)\n  }\n  return port | 0\n}\n\n/**\n * @callback validateAbortSignal\n * @param {*} signal\n * @param {string} name\n */\n\n/** @type {validateAbortSignal} */\nconst validateAbortSignal = hideStackFrames((signal, name) => {\n  if (signal !== undefined && (signal === null || typeof signal !== 'object' || !('aborted' in signal))) {\n    throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal)\n  }\n})\n\n/**\n * @callback validateFunction\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is Function}\n */\n\n/** @type {validateFunction} */\nconst validateFunction = hideStackFrames((value, name) => {\n  if (typeof value !== 'function') throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)\n})\n\n/**\n * @callback validatePlainFunction\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is Function}\n */\n\n/** @type {validatePlainFunction} */\nconst validatePlainFunction = hideStackFrames((value, name) => {\n  if (typeof value !== 'function' || isAsyncFunction(value)) throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)\n})\n\n/**\n * @callback validateUndefined\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is undefined}\n */\n\n/** @type {validateUndefined} */\nconst validateUndefined = hideStackFrames((value, name) => {\n  if (value !== undefined) throw new ERR_INVALID_ARG_TYPE(name, 'undefined', value)\n})\n\n/**\n * @template T\n * @param {T} value\n * @param {string} name\n * @param {T[]} union\n */\nfunction validateUnion(value, name, union) {\n  if (!ArrayPrototypeIncludes(union, value)) {\n    throw new ERR_INVALID_ARG_TYPE(name, `('${ArrayPrototypeJoin(union, '|')}')`, value)\n  }\n}\n\n/*\n  The rules for the Link header field are described here:\n  https://www.rfc-editor.org/rfc/rfc8288.html#section-3\n\n  This regex validates any string surrounded by angle brackets\n  (not necessarily a valid URI reference) followed by zero or more\n  link-params separated by semicolons.\n*/\nconst linkValueRegExp = /^(?:<[^>]*>)(?:\\s*;\\s*[^;\"\\s]+(?:=(\")?[^;\"\\s]*\\1)?)*$/\n\n/**\n * @param {any} value\n * @param {string} name\n */\nfunction validateLinkHeaderFormat(value, name) {\n  if (typeof value === 'undefined' || !RegExpPrototypeExec(linkValueRegExp, value)) {\n    throw new ERR_INVALID_ARG_VALUE(\n      name,\n      value,\n      'must be an array or string of format \"; rel=preload; as=style\"'\n    )\n  }\n}\n\n/**\n * @param {any} hints\n * @return {string}\n */\nfunction validateLinkHeaderValue(hints) {\n  if (typeof hints === 'string') {\n    validateLinkHeaderFormat(hints, 'hints')\n    return hints\n  } else if (ArrayIsArray(hints)) {\n    const hintsLength = hints.length\n    let result = ''\n    if (hintsLength === 0) {\n      return result\n    }\n    for (let i = 0; i < hintsLength; i++) {\n      const link = hints[i]\n      validateLinkHeaderFormat(link, 'hints')\n      result += link\n      if (i !== hintsLength - 1) {\n        result += ', '\n      }\n    }\n    return result\n  }\n  throw new ERR_INVALID_ARG_VALUE(\n    'hints',\n    hints,\n    'must be an array or string of format \"; rel=preload; as=style\"'\n  )\n}\nmodule.exports = {\n  isInt32,\n  isUint32,\n  parseFileMode,\n  validateArray,\n  validateStringArray,\n  validateBooleanArray,\n  validateAbortSignalArray,\n  validateBoolean,\n  validateBuffer,\n  validateDictionary,\n  validateEncoding,\n  validateFunction,\n  validateInt32,\n  validateInteger,\n  validateNumber,\n  validateObject,\n  validateOneOf,\n  validatePlainFunction,\n  validatePort,\n  validateSignalName,\n  validateString,\n  validateUint32,\n  validateUndefined,\n  validateUnion,\n  validateAbortSignal,\n  validateLinkHeaderValue\n}\n","'use strict'\n\nconst { SymbolAsyncIterator, SymbolIterator, SymbolFor } = require('../../ours/primordials')\n\n// We need to use SymbolFor to make these globally available\n// for interopt with readable-stream, i.e. readable-stream\n// and node core needs to be able to read/write private state\n// from each other for proper interoperability.\nconst kIsDestroyed = SymbolFor('nodejs.stream.destroyed')\nconst kIsErrored = SymbolFor('nodejs.stream.errored')\nconst kIsReadable = SymbolFor('nodejs.stream.readable')\nconst kIsWritable = SymbolFor('nodejs.stream.writable')\nconst kIsDisturbed = SymbolFor('nodejs.stream.disturbed')\nconst kIsClosedPromise = SymbolFor('nodejs.webstream.isClosedPromise')\nconst kControllerErrorFunction = SymbolFor('nodejs.webstream.controllerErrorFunction')\nfunction isReadableNodeStream(obj, strict = false) {\n  var _obj$_readableState\n  return !!(\n    (\n      obj &&\n      typeof obj.pipe === 'function' &&\n      typeof obj.on === 'function' &&\n      (!strict || (typeof obj.pause === 'function' && typeof obj.resume === 'function')) &&\n      (!obj._writableState ||\n        ((_obj$_readableState = obj._readableState) === null || _obj$_readableState === undefined\n          ? undefined\n          : _obj$_readableState.readable) !== false) &&\n      // Duplex\n      (!obj._writableState || obj._readableState)\n    ) // Writable has .pipe.\n  )\n}\nfunction isWritableNodeStream(obj) {\n  var _obj$_writableState\n  return !!(\n    (\n      obj &&\n      typeof obj.write === 'function' &&\n      typeof obj.on === 'function' &&\n      (!obj._readableState ||\n        ((_obj$_writableState = obj._writableState) === null || _obj$_writableState === undefined\n          ? undefined\n          : _obj$_writableState.writable) !== false)\n    ) // Duplex\n  )\n}\nfunction isDuplexNodeStream(obj) {\n  return !!(\n    obj &&\n    typeof obj.pipe === 'function' &&\n    obj._readableState &&\n    typeof obj.on === 'function' &&\n    typeof obj.write === 'function'\n  )\n}\nfunction isNodeStream(obj) {\n  return (\n    obj &&\n    (obj._readableState ||\n      obj._writableState ||\n      (typeof obj.write === 'function' && typeof obj.on === 'function') ||\n      (typeof obj.pipe === 'function' && typeof obj.on === 'function'))\n  )\n}\nfunction isReadableStream(obj) {\n  return !!(\n    obj &&\n    !isNodeStream(obj) &&\n    typeof obj.pipeThrough === 'function' &&\n    typeof obj.getReader === 'function' &&\n    typeof obj.cancel === 'function'\n  )\n}\nfunction isWritableStream(obj) {\n  return !!(obj && !isNodeStream(obj) && typeof obj.getWriter === 'function' && typeof obj.abort === 'function')\n}\nfunction isTransformStream(obj) {\n  return !!(obj && !isNodeStream(obj) && typeof obj.readable === 'object' && typeof obj.writable === 'object')\n}\nfunction isWebStream(obj) {\n  return isReadableStream(obj) || isWritableStream(obj) || isTransformStream(obj)\n}\nfunction isIterable(obj, isAsync) {\n  if (obj == null) return false\n  if (isAsync === true) return typeof obj[SymbolAsyncIterator] === 'function'\n  if (isAsync === false) return typeof obj[SymbolIterator] === 'function'\n  return typeof obj[SymbolAsyncIterator] === 'function' || typeof obj[SymbolIterator] === 'function'\n}\nfunction isDestroyed(stream) {\n  if (!isNodeStream(stream)) return null\n  const wState = stream._writableState\n  const rState = stream._readableState\n  const state = wState || rState\n  return !!(stream.destroyed || stream[kIsDestroyed] || (state !== null && state !== undefined && state.destroyed))\n}\n\n// Have been end():d.\nfunction isWritableEnded(stream) {\n  if (!isWritableNodeStream(stream)) return null\n  if (stream.writableEnded === true) return true\n  const wState = stream._writableState\n  if (wState !== null && wState !== undefined && wState.errored) return false\n  if (typeof (wState === null || wState === undefined ? undefined : wState.ended) !== 'boolean') return null\n  return wState.ended\n}\n\n// Have emitted 'finish'.\nfunction isWritableFinished(stream, strict) {\n  if (!isWritableNodeStream(stream)) return null\n  if (stream.writableFinished === true) return true\n  const wState = stream._writableState\n  if (wState !== null && wState !== undefined && wState.errored) return false\n  if (typeof (wState === null || wState === undefined ? undefined : wState.finished) !== 'boolean') return null\n  return !!(wState.finished || (strict === false && wState.ended === true && wState.length === 0))\n}\n\n// Have been push(null):d.\nfunction isReadableEnded(stream) {\n  if (!isReadableNodeStream(stream)) return null\n  if (stream.readableEnded === true) return true\n  const rState = stream._readableState\n  if (!rState || rState.errored) return false\n  if (typeof (rState === null || rState === undefined ? undefined : rState.ended) !== 'boolean') return null\n  return rState.ended\n}\n\n// Have emitted 'end'.\nfunction isReadableFinished(stream, strict) {\n  if (!isReadableNodeStream(stream)) return null\n  const rState = stream._readableState\n  if (rState !== null && rState !== undefined && rState.errored) return false\n  if (typeof (rState === null || rState === undefined ? undefined : rState.endEmitted) !== 'boolean') return null\n  return !!(rState.endEmitted || (strict === false && rState.ended === true && rState.length === 0))\n}\nfunction isReadable(stream) {\n  if (stream && stream[kIsReadable] != null) return stream[kIsReadable]\n  if (typeof (stream === null || stream === undefined ? undefined : stream.readable) !== 'boolean') return null\n  if (isDestroyed(stream)) return false\n  return isReadableNodeStream(stream) && stream.readable && !isReadableFinished(stream)\n}\nfunction isWritable(stream) {\n  if (stream && stream[kIsWritable] != null) return stream[kIsWritable]\n  if (typeof (stream === null || stream === undefined ? undefined : stream.writable) !== 'boolean') return null\n  if (isDestroyed(stream)) return false\n  return isWritableNodeStream(stream) && stream.writable && !isWritableEnded(stream)\n}\nfunction isFinished(stream, opts) {\n  if (!isNodeStream(stream)) {\n    return null\n  }\n  if (isDestroyed(stream)) {\n    return true\n  }\n  if ((opts === null || opts === undefined ? undefined : opts.readable) !== false && isReadable(stream)) {\n    return false\n  }\n  if ((opts === null || opts === undefined ? undefined : opts.writable) !== false && isWritable(stream)) {\n    return false\n  }\n  return true\n}\nfunction isWritableErrored(stream) {\n  var _stream$_writableStat, _stream$_writableStat2\n  if (!isNodeStream(stream)) {\n    return null\n  }\n  if (stream.writableErrored) {\n    return stream.writableErrored\n  }\n  return (_stream$_writableStat =\n    (_stream$_writableStat2 = stream._writableState) === null || _stream$_writableStat2 === undefined\n      ? undefined\n      : _stream$_writableStat2.errored) !== null && _stream$_writableStat !== undefined\n    ? _stream$_writableStat\n    : null\n}\nfunction isReadableErrored(stream) {\n  var _stream$_readableStat, _stream$_readableStat2\n  if (!isNodeStream(stream)) {\n    return null\n  }\n  if (stream.readableErrored) {\n    return stream.readableErrored\n  }\n  return (_stream$_readableStat =\n    (_stream$_readableStat2 = stream._readableState) === null || _stream$_readableStat2 === undefined\n      ? undefined\n      : _stream$_readableStat2.errored) !== null && _stream$_readableStat !== undefined\n    ? _stream$_readableStat\n    : null\n}\nfunction isClosed(stream) {\n  if (!isNodeStream(stream)) {\n    return null\n  }\n  if (typeof stream.closed === 'boolean') {\n    return stream.closed\n  }\n  const wState = stream._writableState\n  const rState = stream._readableState\n  if (\n    typeof (wState === null || wState === undefined ? undefined : wState.closed) === 'boolean' ||\n    typeof (rState === null || rState === undefined ? undefined : rState.closed) === 'boolean'\n  ) {\n    return (\n      (wState === null || wState === undefined ? undefined : wState.closed) ||\n      (rState === null || rState === undefined ? undefined : rState.closed)\n    )\n  }\n  if (typeof stream._closed === 'boolean' && isOutgoingMessage(stream)) {\n    return stream._closed\n  }\n  return null\n}\nfunction isOutgoingMessage(stream) {\n  return (\n    typeof stream._closed === 'boolean' &&\n    typeof stream._defaultKeepAlive === 'boolean' &&\n    typeof stream._removedConnection === 'boolean' &&\n    typeof stream._removedContLen === 'boolean'\n  )\n}\nfunction isServerResponse(stream) {\n  return typeof stream._sent100 === 'boolean' && isOutgoingMessage(stream)\n}\nfunction isServerRequest(stream) {\n  var _stream$req\n  return (\n    typeof stream._consuming === 'boolean' &&\n    typeof stream._dumped === 'boolean' &&\n    ((_stream$req = stream.req) === null || _stream$req === undefined ? undefined : _stream$req.upgradeOrConnect) ===\n      undefined\n  )\n}\nfunction willEmitClose(stream) {\n  if (!isNodeStream(stream)) return null\n  const wState = stream._writableState\n  const rState = stream._readableState\n  const state = wState || rState\n  return (\n    (!state && isServerResponse(stream)) || !!(state && state.autoDestroy && state.emitClose && state.closed === false)\n  )\n}\nfunction isDisturbed(stream) {\n  var _stream$kIsDisturbed\n  return !!(\n    stream &&\n    ((_stream$kIsDisturbed = stream[kIsDisturbed]) !== null && _stream$kIsDisturbed !== undefined\n      ? _stream$kIsDisturbed\n      : stream.readableDidRead || stream.readableAborted)\n  )\n}\nfunction isErrored(stream) {\n  var _ref,\n    _ref2,\n    _ref3,\n    _ref4,\n    _ref5,\n    _stream$kIsErrored,\n    _stream$_readableStat3,\n    _stream$_writableStat3,\n    _stream$_readableStat4,\n    _stream$_writableStat4\n  return !!(\n    stream &&\n    ((_ref =\n      (_ref2 =\n        (_ref3 =\n          (_ref4 =\n            (_ref5 =\n              (_stream$kIsErrored = stream[kIsErrored]) !== null && _stream$kIsErrored !== undefined\n                ? _stream$kIsErrored\n                : stream.readableErrored) !== null && _ref5 !== undefined\n              ? _ref5\n              : stream.writableErrored) !== null && _ref4 !== undefined\n            ? _ref4\n            : (_stream$_readableStat3 = stream._readableState) === null || _stream$_readableStat3 === undefined\n            ? undefined\n            : _stream$_readableStat3.errorEmitted) !== null && _ref3 !== undefined\n          ? _ref3\n          : (_stream$_writableStat3 = stream._writableState) === null || _stream$_writableStat3 === undefined\n          ? undefined\n          : _stream$_writableStat3.errorEmitted) !== null && _ref2 !== undefined\n        ? _ref2\n        : (_stream$_readableStat4 = stream._readableState) === null || _stream$_readableStat4 === undefined\n        ? undefined\n        : _stream$_readableStat4.errored) !== null && _ref !== undefined\n      ? _ref\n      : (_stream$_writableStat4 = stream._writableState) === null || _stream$_writableStat4 === undefined\n      ? undefined\n      : _stream$_writableStat4.errored)\n  )\n}\nmodule.exports = {\n  isDestroyed,\n  kIsDestroyed,\n  isDisturbed,\n  kIsDisturbed,\n  isErrored,\n  kIsErrored,\n  isReadable,\n  kIsReadable,\n  kIsClosedPromise,\n  kControllerErrorFunction,\n  kIsWritable,\n  isClosed,\n  isDuplexNodeStream,\n  isFinished,\n  isIterable,\n  isReadableNodeStream,\n  isReadableStream,\n  isReadableEnded,\n  isReadableFinished,\n  isReadableErrored,\n  isNodeStream,\n  isWebStream,\n  isWritable,\n  isWritableNodeStream,\n  isWritableStream,\n  isWritableEnded,\n  isWritableFinished,\n  isWritableErrored,\n  isServerRequest,\n  isServerResponse,\n  willEmitClose,\n  isTransformStream\n}\n","// Ported from https://github.com/mafintosh/end-of-stream with\n// permission from the author, Mathias Buus (@mafintosh).\n\n'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst { AbortError, codes } = require('../../ours/errors')\nconst { ERR_INVALID_ARG_TYPE, ERR_STREAM_PREMATURE_CLOSE } = codes\nconst { kEmptyObject, once } = require('../../ours/util')\nconst { validateAbortSignal, validateFunction, validateObject, validateBoolean } = require('../validators')\nconst { Promise, PromisePrototypeThen, SymbolDispose } = require('../../ours/primordials')\nconst {\n  isClosed,\n  isReadable,\n  isReadableNodeStream,\n  isReadableStream,\n  isReadableFinished,\n  isReadableErrored,\n  isWritable,\n  isWritableNodeStream,\n  isWritableStream,\n  isWritableFinished,\n  isWritableErrored,\n  isNodeStream,\n  willEmitClose: _willEmitClose,\n  kIsClosedPromise\n} = require('./utils')\nlet addAbortListener\nfunction isRequest(stream) {\n  return stream.setHeader && typeof stream.abort === 'function'\n}\nconst nop = () => {}\nfunction eos(stream, options, callback) {\n  var _options$readable, _options$writable\n  if (arguments.length === 2) {\n    callback = options\n    options = kEmptyObject\n  } else if (options == null) {\n    options = kEmptyObject\n  } else {\n    validateObject(options, 'options')\n  }\n  validateFunction(callback, 'callback')\n  validateAbortSignal(options.signal, 'options.signal')\n  callback = once(callback)\n  if (isReadableStream(stream) || isWritableStream(stream)) {\n    return eosWeb(stream, options, callback)\n  }\n  if (!isNodeStream(stream)) {\n    throw new ERR_INVALID_ARG_TYPE('stream', ['ReadableStream', 'WritableStream', 'Stream'], stream)\n  }\n  const readable =\n    (_options$readable = options.readable) !== null && _options$readable !== undefined\n      ? _options$readable\n      : isReadableNodeStream(stream)\n  const writable =\n    (_options$writable = options.writable) !== null && _options$writable !== undefined\n      ? _options$writable\n      : isWritableNodeStream(stream)\n  const wState = stream._writableState\n  const rState = stream._readableState\n  const onlegacyfinish = () => {\n    if (!stream.writable) {\n      onfinish()\n    }\n  }\n\n  // TODO (ronag): Improve soft detection to include core modules and\n  // common ecosystem modules that do properly emit 'close' but fail\n  // this generic check.\n  let willEmitClose =\n    _willEmitClose(stream) && isReadableNodeStream(stream) === readable && isWritableNodeStream(stream) === writable\n  let writableFinished = isWritableFinished(stream, false)\n  const onfinish = () => {\n    writableFinished = true\n    // Stream should not be destroyed here. If it is that\n    // means that user space is doing something differently and\n    // we cannot trust willEmitClose.\n    if (stream.destroyed) {\n      willEmitClose = false\n    }\n    if (willEmitClose && (!stream.readable || readable)) {\n      return\n    }\n    if (!readable || readableFinished) {\n      callback.call(stream)\n    }\n  }\n  let readableFinished = isReadableFinished(stream, false)\n  const onend = () => {\n    readableFinished = true\n    // Stream should not be destroyed here. If it is that\n    // means that user space is doing something differently and\n    // we cannot trust willEmitClose.\n    if (stream.destroyed) {\n      willEmitClose = false\n    }\n    if (willEmitClose && (!stream.writable || writable)) {\n      return\n    }\n    if (!writable || writableFinished) {\n      callback.call(stream)\n    }\n  }\n  const onerror = (err) => {\n    callback.call(stream, err)\n  }\n  let closed = isClosed(stream)\n  const onclose = () => {\n    closed = true\n    const errored = isWritableErrored(stream) || isReadableErrored(stream)\n    if (errored && typeof errored !== 'boolean') {\n      return callback.call(stream, errored)\n    }\n    if (readable && !readableFinished && isReadableNodeStream(stream, true)) {\n      if (!isReadableFinished(stream, false)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE())\n    }\n    if (writable && !writableFinished) {\n      if (!isWritableFinished(stream, false)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE())\n    }\n    callback.call(stream)\n  }\n  const onclosed = () => {\n    closed = true\n    const errored = isWritableErrored(stream) || isReadableErrored(stream)\n    if (errored && typeof errored !== 'boolean') {\n      return callback.call(stream, errored)\n    }\n    callback.call(stream)\n  }\n  const onrequest = () => {\n    stream.req.on('finish', onfinish)\n  }\n  if (isRequest(stream)) {\n    stream.on('complete', onfinish)\n    if (!willEmitClose) {\n      stream.on('abort', onclose)\n    }\n    if (stream.req) {\n      onrequest()\n    } else {\n      stream.on('request', onrequest)\n    }\n  } else if (writable && !wState) {\n    // legacy streams\n    stream.on('end', onlegacyfinish)\n    stream.on('close', onlegacyfinish)\n  }\n\n  // Not all streams will emit 'close' after 'aborted'.\n  if (!willEmitClose && typeof stream.aborted === 'boolean') {\n    stream.on('aborted', onclose)\n  }\n  stream.on('end', onend)\n  stream.on('finish', onfinish)\n  if (options.error !== false) {\n    stream.on('error', onerror)\n  }\n  stream.on('close', onclose)\n  if (closed) {\n    process.nextTick(onclose)\n  } else if (\n    (wState !== null && wState !== undefined && wState.errorEmitted) ||\n    (rState !== null && rState !== undefined && rState.errorEmitted)\n  ) {\n    if (!willEmitClose) {\n      process.nextTick(onclosed)\n    }\n  } else if (\n    !readable &&\n    (!willEmitClose || isReadable(stream)) &&\n    (writableFinished || isWritable(stream) === false)\n  ) {\n    process.nextTick(onclosed)\n  } else if (\n    !writable &&\n    (!willEmitClose || isWritable(stream)) &&\n    (readableFinished || isReadable(stream) === false)\n  ) {\n    process.nextTick(onclosed)\n  } else if (rState && stream.req && stream.aborted) {\n    process.nextTick(onclosed)\n  }\n  const cleanup = () => {\n    callback = nop\n    stream.removeListener('aborted', onclose)\n    stream.removeListener('complete', onfinish)\n    stream.removeListener('abort', onclose)\n    stream.removeListener('request', onrequest)\n    if (stream.req) stream.req.removeListener('finish', onfinish)\n    stream.removeListener('end', onlegacyfinish)\n    stream.removeListener('close', onlegacyfinish)\n    stream.removeListener('finish', onfinish)\n    stream.removeListener('end', onend)\n    stream.removeListener('error', onerror)\n    stream.removeListener('close', onclose)\n  }\n  if (options.signal && !closed) {\n    const abort = () => {\n      // Keep it because cleanup removes it.\n      const endCallback = callback\n      cleanup()\n      endCallback.call(\n        stream,\n        new AbortError(undefined, {\n          cause: options.signal.reason\n        })\n      )\n    }\n    if (options.signal.aborted) {\n      process.nextTick(abort)\n    } else {\n      addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n      const disposable = addAbortListener(options.signal, abort)\n      const originalCallback = callback\n      callback = once((...args) => {\n        disposable[SymbolDispose]()\n        originalCallback.apply(stream, args)\n      })\n    }\n  }\n  return cleanup\n}\nfunction eosWeb(stream, options, callback) {\n  let isAborted = false\n  let abort = nop\n  if (options.signal) {\n    abort = () => {\n      isAborted = true\n      callback.call(\n        stream,\n        new AbortError(undefined, {\n          cause: options.signal.reason\n        })\n      )\n    }\n    if (options.signal.aborted) {\n      process.nextTick(abort)\n    } else {\n      addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n      const disposable = addAbortListener(options.signal, abort)\n      const originalCallback = callback\n      callback = once((...args) => {\n        disposable[SymbolDispose]()\n        originalCallback.apply(stream, args)\n      })\n    }\n  }\n  const resolverFn = (...args) => {\n    if (!isAborted) {\n      process.nextTick(() => callback.apply(stream, args))\n    }\n  }\n  PromisePrototypeThen(stream[kIsClosedPromise].promise, resolverFn, resolverFn)\n  return nop\n}\nfunction finished(stream, opts) {\n  var _opts\n  let autoCleanup = false\n  if (opts === null) {\n    opts = kEmptyObject\n  }\n  if ((_opts = opts) !== null && _opts !== undefined && _opts.cleanup) {\n    validateBoolean(opts.cleanup, 'cleanup')\n    autoCleanup = opts.cleanup\n  }\n  return new Promise((resolve, reject) => {\n    const cleanup = eos(stream, opts, (err) => {\n      if (autoCleanup) {\n        cleanup()\n      }\n      if (err) {\n        reject(err)\n      } else {\n        resolve()\n      }\n    })\n  })\n}\nmodule.exports = eos\nmodule.exports.finished = finished\n","'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst {\n  aggregateTwoErrors,\n  codes: { ERR_MULTIPLE_CALLBACK },\n  AbortError\n} = require('../../ours/errors')\nconst { Symbol } = require('../../ours/primordials')\nconst { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require('./utils')\nconst kDestroy = Symbol('kDestroy')\nconst kConstruct = Symbol('kConstruct')\nfunction checkError(err, w, r) {\n  if (err) {\n    // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364\n    err.stack // eslint-disable-line no-unused-expressions\n\n    if (w && !w.errored) {\n      w.errored = err\n    }\n    if (r && !r.errored) {\n      r.errored = err\n    }\n  }\n}\n\n// Backwards compat. cb() is undocumented and unused in core but\n// unfortunately might be used by modules.\nfunction destroy(err, cb) {\n  const r = this._readableState\n  const w = this._writableState\n  // With duplex streams we use the writable side for state.\n  const s = w || r\n  if ((w !== null && w !== undefined && w.destroyed) || (r !== null && r !== undefined && r.destroyed)) {\n    if (typeof cb === 'function') {\n      cb()\n    }\n    return this\n  }\n\n  // We set destroyed to true before firing error callbacks in order\n  // to make it re-entrance safe in case destroy() is called within callbacks\n  checkError(err, w, r)\n  if (w) {\n    w.destroyed = true\n  }\n  if (r) {\n    r.destroyed = true\n  }\n\n  // If still constructing then defer calling _destroy.\n  if (!s.constructed) {\n    this.once(kDestroy, function (er) {\n      _destroy(this, aggregateTwoErrors(er, err), cb)\n    })\n  } else {\n    _destroy(this, err, cb)\n  }\n  return this\n}\nfunction _destroy(self, err, cb) {\n  let called = false\n  function onDestroy(err) {\n    if (called) {\n      return\n    }\n    called = true\n    const r = self._readableState\n    const w = self._writableState\n    checkError(err, w, r)\n    if (w) {\n      w.closed = true\n    }\n    if (r) {\n      r.closed = true\n    }\n    if (typeof cb === 'function') {\n      cb(err)\n    }\n    if (err) {\n      process.nextTick(emitErrorCloseNT, self, err)\n    } else {\n      process.nextTick(emitCloseNT, self)\n    }\n  }\n  try {\n    self._destroy(err || null, onDestroy)\n  } catch (err) {\n    onDestroy(err)\n  }\n}\nfunction emitErrorCloseNT(self, err) {\n  emitErrorNT(self, err)\n  emitCloseNT(self)\n}\nfunction emitCloseNT(self) {\n  const r = self._readableState\n  const w = self._writableState\n  if (w) {\n    w.closeEmitted = true\n  }\n  if (r) {\n    r.closeEmitted = true\n  }\n  if ((w !== null && w !== undefined && w.emitClose) || (r !== null && r !== undefined && r.emitClose)) {\n    self.emit('close')\n  }\n}\nfunction emitErrorNT(self, err) {\n  const r = self._readableState\n  const w = self._writableState\n  if ((w !== null && w !== undefined && w.errorEmitted) || (r !== null && r !== undefined && r.errorEmitted)) {\n    return\n  }\n  if (w) {\n    w.errorEmitted = true\n  }\n  if (r) {\n    r.errorEmitted = true\n  }\n  self.emit('error', err)\n}\nfunction undestroy() {\n  const r = this._readableState\n  const w = this._writableState\n  if (r) {\n    r.constructed = true\n    r.closed = false\n    r.closeEmitted = false\n    r.destroyed = false\n    r.errored = null\n    r.errorEmitted = false\n    r.reading = false\n    r.ended = r.readable === false\n    r.endEmitted = r.readable === false\n  }\n  if (w) {\n    w.constructed = true\n    w.destroyed = false\n    w.closed = false\n    w.closeEmitted = false\n    w.errored = null\n    w.errorEmitted = false\n    w.finalCalled = false\n    w.prefinished = false\n    w.ended = w.writable === false\n    w.ending = w.writable === false\n    w.finished = w.writable === false\n  }\n}\nfunction errorOrDestroy(stream, err, sync) {\n  // We have tests that rely on errors being emitted\n  // in the same tick, so changing this is semver major.\n  // For now when you opt-in to autoDestroy we allow\n  // the error to be emitted nextTick. In a future\n  // semver major update we should change the default to this.\n\n  const r = stream._readableState\n  const w = stream._writableState\n  if ((w !== null && w !== undefined && w.destroyed) || (r !== null && r !== undefined && r.destroyed)) {\n    return this\n  }\n  if ((r !== null && r !== undefined && r.autoDestroy) || (w !== null && w !== undefined && w.autoDestroy))\n    stream.destroy(err)\n  else if (err) {\n    // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364\n    err.stack // eslint-disable-line no-unused-expressions\n\n    if (w && !w.errored) {\n      w.errored = err\n    }\n    if (r && !r.errored) {\n      r.errored = err\n    }\n    if (sync) {\n      process.nextTick(emitErrorNT, stream, err)\n    } else {\n      emitErrorNT(stream, err)\n    }\n  }\n}\nfunction construct(stream, cb) {\n  if (typeof stream._construct !== 'function') {\n    return\n  }\n  const r = stream._readableState\n  const w = stream._writableState\n  if (r) {\n    r.constructed = false\n  }\n  if (w) {\n    w.constructed = false\n  }\n  stream.once(kConstruct, cb)\n  if (stream.listenerCount(kConstruct) > 1) {\n    // Duplex\n    return\n  }\n  process.nextTick(constructNT, stream)\n}\nfunction constructNT(stream) {\n  let called = false\n  function onConstruct(err) {\n    if (called) {\n      errorOrDestroy(stream, err !== null && err !== undefined ? err : new ERR_MULTIPLE_CALLBACK())\n      return\n    }\n    called = true\n    const r = stream._readableState\n    const w = stream._writableState\n    const s = w || r\n    if (r) {\n      r.constructed = true\n    }\n    if (w) {\n      w.constructed = true\n    }\n    if (s.destroyed) {\n      stream.emit(kDestroy, err)\n    } else if (err) {\n      errorOrDestroy(stream, err, true)\n    } else {\n      process.nextTick(emitConstructNT, stream)\n    }\n  }\n  try {\n    stream._construct((err) => {\n      process.nextTick(onConstruct, err)\n    })\n  } catch (err) {\n    process.nextTick(onConstruct, err)\n  }\n}\nfunction emitConstructNT(stream) {\n  stream.emit(kConstruct)\n}\nfunction isRequest(stream) {\n  return (stream === null || stream === undefined ? undefined : stream.setHeader) && typeof stream.abort === 'function'\n}\nfunction emitCloseLegacy(stream) {\n  stream.emit('close')\n}\nfunction emitErrorCloseLegacy(stream, err) {\n  stream.emit('error', err)\n  process.nextTick(emitCloseLegacy, stream)\n}\n\n// Normalize destroy for legacy.\nfunction destroyer(stream, err) {\n  if (!stream || isDestroyed(stream)) {\n    return\n  }\n  if (!err && !isFinished(stream)) {\n    err = new AbortError()\n  }\n\n  // TODO: Remove isRequest branches.\n  if (isServerRequest(stream)) {\n    stream.socket = null\n    stream.destroy(err)\n  } else if (isRequest(stream)) {\n    stream.abort()\n  } else if (isRequest(stream.req)) {\n    stream.req.abort()\n  } else if (typeof stream.destroy === 'function') {\n    stream.destroy(err)\n  } else if (typeof stream.close === 'function') {\n    // TODO: Don't lose err?\n    stream.close()\n  } else if (err) {\n    process.nextTick(emitErrorCloseLegacy, stream, err)\n  } else {\n    process.nextTick(emitCloseLegacy, stream)\n  }\n  if (!stream.destroyed) {\n    stream[kIsDestroyed] = true\n  }\n}\nmodule.exports = {\n  construct,\n  destroyer,\n  destroy,\n  undestroy,\n  errorOrDestroy\n}\n","'use strict'\n\nconst { ArrayIsArray, ObjectSetPrototypeOf } = require('../../ours/primordials')\nconst { EventEmitter: EE } = require('events')\nfunction Stream(opts) {\n  EE.call(this, opts)\n}\nObjectSetPrototypeOf(Stream.prototype, EE.prototype)\nObjectSetPrototypeOf(Stream, EE)\nStream.prototype.pipe = function (dest, options) {\n  const source = this\n  function ondata(chunk) {\n    if (dest.writable && dest.write(chunk) === false && source.pause) {\n      source.pause()\n    }\n  }\n  source.on('data', ondata)\n  function ondrain() {\n    if (source.readable && source.resume) {\n      source.resume()\n    }\n  }\n  dest.on('drain', ondrain)\n\n  // If the 'end' option is not supplied, dest.end() will be called when\n  // source gets the 'end' or 'close' events.  Only dest.end() once.\n  if (!dest._isStdio && (!options || options.end !== false)) {\n    source.on('end', onend)\n    source.on('close', onclose)\n  }\n  let didOnEnd = false\n  function onend() {\n    if (didOnEnd) return\n    didOnEnd = true\n    dest.end()\n  }\n  function onclose() {\n    if (didOnEnd) return\n    didOnEnd = true\n    if (typeof dest.destroy === 'function') dest.destroy()\n  }\n\n  // Don't leave dangling pipes when there are errors.\n  function onerror(er) {\n    cleanup()\n    if (EE.listenerCount(this, 'error') === 0) {\n      this.emit('error', er)\n    }\n  }\n  prependListener(source, 'error', onerror)\n  prependListener(dest, 'error', onerror)\n\n  // Remove all the event listeners that were added.\n  function cleanup() {\n    source.removeListener('data', ondata)\n    dest.removeListener('drain', ondrain)\n    source.removeListener('end', onend)\n    source.removeListener('close', onclose)\n    source.removeListener('error', onerror)\n    dest.removeListener('error', onerror)\n    source.removeListener('end', cleanup)\n    source.removeListener('close', cleanup)\n    dest.removeListener('close', cleanup)\n  }\n  source.on('end', cleanup)\n  source.on('close', cleanup)\n  dest.on('close', cleanup)\n  dest.emit('pipe', source)\n\n  // Allow for unix-like usage: A.pipe(B).pipe(C)\n  return dest\n}\nfunction prependListener(emitter, event, fn) {\n  // Sadly this is not cacheable as some libraries bundle their own\n  // event emitter implementation with them.\n  if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn)\n\n  // This is a hack to make sure that our error handler is attached before any\n  // userland ones.  NEVER DO THIS. This is here only because this code needs\n  // to continue to work with older versions of Node.js that do not include\n  // the prependListener() method. The goal is to eventually remove this hack.\n  if (!emitter._events || !emitter._events[event]) emitter.on(event, fn)\n  else if (ArrayIsArray(emitter._events[event])) emitter._events[event].unshift(fn)\n  else emitter._events[event] = [fn, emitter._events[event]]\n}\nmodule.exports = {\n  Stream,\n  prependListener\n}\n","'use strict'\n\nconst { SymbolDispose } = require('../../ours/primordials')\nconst { AbortError, codes } = require('../../ours/errors')\nconst { isNodeStream, isWebStream, kControllerErrorFunction } = require('./utils')\nconst eos = require('./end-of-stream')\nconst { ERR_INVALID_ARG_TYPE } = codes\nlet addAbortListener\n\n// This method is inlined here for readable-stream\n// It also does not allow for signal to not exist on the stream\n// https://github.com/nodejs/node/pull/36061#discussion_r533718029\nconst validateAbortSignal = (signal, name) => {\n  if (typeof signal !== 'object' || !('aborted' in signal)) {\n    throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal)\n  }\n}\nmodule.exports.addAbortSignal = function addAbortSignal(signal, stream) {\n  validateAbortSignal(signal, 'signal')\n  if (!isNodeStream(stream) && !isWebStream(stream)) {\n    throw new ERR_INVALID_ARG_TYPE('stream', ['ReadableStream', 'WritableStream', 'Stream'], stream)\n  }\n  return module.exports.addAbortSignalNoValidate(signal, stream)\n}\nmodule.exports.addAbortSignalNoValidate = function (signal, stream) {\n  if (typeof signal !== 'object' || !('aborted' in signal)) {\n    return stream\n  }\n  const onAbort = isNodeStream(stream)\n    ? () => {\n        stream.destroy(\n          new AbortError(undefined, {\n            cause: signal.reason\n          })\n        )\n      }\n    : () => {\n        stream[kControllerErrorFunction](\n          new AbortError(undefined, {\n            cause: signal.reason\n          })\n        )\n      }\n  if (signal.aborted) {\n    onAbort()\n  } else {\n    addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n    const disposable = addAbortListener(signal, onAbort)\n    eos(stream, disposable[SymbolDispose])\n  }\n  return stream\n}\n","'use strict'\n\nconst { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array } = require('../../ours/primordials')\nconst { Buffer } = require('buffer')\nconst { inspect } = require('../../ours/util')\nmodule.exports = class BufferList {\n  constructor() {\n    this.head = null\n    this.tail = null\n    this.length = 0\n  }\n  push(v) {\n    const entry = {\n      data: v,\n      next: null\n    }\n    if (this.length > 0) this.tail.next = entry\n    else this.head = entry\n    this.tail = entry\n    ++this.length\n  }\n  unshift(v) {\n    const entry = {\n      data: v,\n      next: this.head\n    }\n    if (this.length === 0) this.tail = entry\n    this.head = entry\n    ++this.length\n  }\n  shift() {\n    if (this.length === 0) return\n    const ret = this.head.data\n    if (this.length === 1) this.head = this.tail = null\n    else this.head = this.head.next\n    --this.length\n    return ret\n  }\n  clear() {\n    this.head = this.tail = null\n    this.length = 0\n  }\n  join(s) {\n    if (this.length === 0) return ''\n    let p = this.head\n    let ret = '' + p.data\n    while ((p = p.next) !== null) ret += s + p.data\n    return ret\n  }\n  concat(n) {\n    if (this.length === 0) return Buffer.alloc(0)\n    const ret = Buffer.allocUnsafe(n >>> 0)\n    let p = this.head\n    let i = 0\n    while (p) {\n      TypedArrayPrototypeSet(ret, p.data, i)\n      i += p.data.length\n      p = p.next\n    }\n    return ret\n  }\n\n  // Consumes a specified amount of bytes or characters from the buffered data.\n  consume(n, hasStrings) {\n    const data = this.head.data\n    if (n < data.length) {\n      // `slice` is the same for buffers and strings.\n      const slice = data.slice(0, n)\n      this.head.data = data.slice(n)\n      return slice\n    }\n    if (n === data.length) {\n      // First chunk is a perfect match.\n      return this.shift()\n    }\n    // Result spans more than one buffer.\n    return hasStrings ? this._getString(n) : this._getBuffer(n)\n  }\n  first() {\n    return this.head.data\n  }\n  *[SymbolIterator]() {\n    for (let p = this.head; p; p = p.next) {\n      yield p.data\n    }\n  }\n\n  // Consumes a specified amount of characters from the buffered data.\n  _getString(n) {\n    let ret = ''\n    let p = this.head\n    let c = 0\n    do {\n      const str = p.data\n      if (n > str.length) {\n        ret += str\n        n -= str.length\n      } else {\n        if (n === str.length) {\n          ret += str\n          ++c\n          if (p.next) this.head = p.next\n          else this.head = this.tail = null\n        } else {\n          ret += StringPrototypeSlice(str, 0, n)\n          this.head = p\n          p.data = StringPrototypeSlice(str, n)\n        }\n        break\n      }\n      ++c\n    } while ((p = p.next) !== null)\n    this.length -= c\n    return ret\n  }\n\n  // Consumes a specified amount of bytes from the buffered data.\n  _getBuffer(n) {\n    const ret = Buffer.allocUnsafe(n)\n    const retLen = n\n    let p = this.head\n    let c = 0\n    do {\n      const buf = p.data\n      if (n > buf.length) {\n        TypedArrayPrototypeSet(ret, buf, retLen - n)\n        n -= buf.length\n      } else {\n        if (n === buf.length) {\n          TypedArrayPrototypeSet(ret, buf, retLen - n)\n          ++c\n          if (p.next) this.head = p.next\n          else this.head = this.tail = null\n        } else {\n          TypedArrayPrototypeSet(ret, new Uint8Array(buf.buffer, buf.byteOffset, n), retLen - n)\n          this.head = p\n          p.data = buf.slice(n)\n        }\n        break\n      }\n      ++c\n    } while ((p = p.next) !== null)\n    this.length -= c\n    return ret\n  }\n\n  // Make sure the linked list only shows the minimal necessary information.\n  [Symbol.for('nodejs.util.inspect.custom')](_, options) {\n    return inspect(this, {\n      ...options,\n      // Only inspect one level.\n      depth: 0,\n      // It should not recurse.\n      customInspect: false\n    })\n  }\n}\n","'use strict'\n\nconst { MathFloor, NumberIsInteger } = require('../../ours/primordials')\nconst { validateInteger } = require('../validators')\nconst { ERR_INVALID_ARG_VALUE } = require('../../ours/errors').codes\nlet defaultHighWaterMarkBytes = 16 * 1024\nlet defaultHighWaterMarkObjectMode = 16\nfunction highWaterMarkFrom(options, isDuplex, duplexKey) {\n  return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null\n}\nfunction getDefaultHighWaterMark(objectMode) {\n  return objectMode ? defaultHighWaterMarkObjectMode : defaultHighWaterMarkBytes\n}\nfunction setDefaultHighWaterMark(objectMode, value) {\n  validateInteger(value, 'value', 0)\n  if (objectMode) {\n    defaultHighWaterMarkObjectMode = value\n  } else {\n    defaultHighWaterMarkBytes = value\n  }\n}\nfunction getHighWaterMark(state, options, duplexKey, isDuplex) {\n  const hwm = highWaterMarkFrom(options, isDuplex, duplexKey)\n  if (hwm != null) {\n    if (!NumberIsInteger(hwm) || hwm < 0) {\n      const name = isDuplex ? `options.${duplexKey}` : 'options.highWaterMark'\n      throw new ERR_INVALID_ARG_VALUE(name, hwm)\n    }\n    return MathFloor(hwm)\n  }\n\n  // Default value\n  return getDefaultHighWaterMark(state.objectMode)\n}\nmodule.exports = {\n  getHighWaterMark,\n  getDefaultHighWaterMark,\n  setDefaultHighWaterMark\n}\n","/*! safe-buffer. MIT License. Feross Aboukhadijeh  */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n  for (var key in src) {\n    dst[key] = src[key]\n  }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n  module.exports = buffer\n} else {\n  // Copy properties from require('buffer')\n  copyProps(buffer, exports)\n  exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n  return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n  if (typeof arg === 'number') {\n    throw new TypeError('Argument must not be a number')\n  }\n  return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  var buf = Buffer(size)\n  if (fill !== undefined) {\n    if (typeof encoding === 'string') {\n      buf.fill(fill, encoding)\n    } else {\n      buf.fill(fill)\n    }\n  } else {\n    buf.fill(0)\n  }\n  return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  return buffer.SlowBuffer(size)\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/**/\n\nvar Buffer = require('safe-buffer').Buffer;\n/**/\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n  encoding = '' + encoding;\n  switch (encoding && encoding.toLowerCase()) {\n    case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':\n      return true;\n    default:\n      return false;\n  }\n};\n\nfunction _normalizeEncoding(enc) {\n  if (!enc) return 'utf8';\n  var retried;\n  while (true) {\n    switch (enc) {\n      case 'utf8':\n      case 'utf-8':\n        return 'utf8';\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return 'utf16le';\n      case 'latin1':\n      case 'binary':\n        return 'latin1';\n      case 'base64':\n      case 'ascii':\n      case 'hex':\n        return enc;\n      default:\n        if (retried) return; // undefined\n        enc = ('' + enc).toLowerCase();\n        retried = true;\n    }\n  }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n  var nenc = _normalizeEncoding(enc);\n  if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n  return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n  this.encoding = normalizeEncoding(encoding);\n  var nb;\n  switch (this.encoding) {\n    case 'utf16le':\n      this.text = utf16Text;\n      this.end = utf16End;\n      nb = 4;\n      break;\n    case 'utf8':\n      this.fillLast = utf8FillLast;\n      nb = 4;\n      break;\n    case 'base64':\n      this.text = base64Text;\n      this.end = base64End;\n      nb = 3;\n      break;\n    default:\n      this.write = simpleWrite;\n      this.end = simpleEnd;\n      return;\n  }\n  this.lastNeed = 0;\n  this.lastTotal = 0;\n  this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n  if (buf.length === 0) return '';\n  var r;\n  var i;\n  if (this.lastNeed) {\n    r = this.fillLast(buf);\n    if (r === undefined) return '';\n    i = this.lastNeed;\n    this.lastNeed = 0;\n  } else {\n    i = 0;\n  }\n  if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n  return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n  if (this.lastNeed <= buf.length) {\n    buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n    return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n  }\n  buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n  this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte. If an invalid byte is detected, -2 is returned.\nfunction utf8CheckByte(byte) {\n  if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n  return byte >> 6 === 0x02 ? -1 : -2;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n  var j = buf.length - 1;\n  if (j < i) return 0;\n  var nb = utf8CheckByte(buf[j]);\n  if (nb >= 0) {\n    if (nb > 0) self.lastNeed = nb - 1;\n    return nb;\n  }\n  if (--j < i || nb === -2) return 0;\n  nb = utf8CheckByte(buf[j]);\n  if (nb >= 0) {\n    if (nb > 0) self.lastNeed = nb - 2;\n    return nb;\n  }\n  if (--j < i || nb === -2) return 0;\n  nb = utf8CheckByte(buf[j]);\n  if (nb >= 0) {\n    if (nb > 0) {\n      if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n    }\n    return nb;\n  }\n  return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// a single UTF-8 replacement character ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n  if ((buf[0] & 0xC0) !== 0x80) {\n    self.lastNeed = 0;\n    return '\\ufffd';\n  }\n  if (self.lastNeed > 1 && buf.length > 1) {\n    if ((buf[1] & 0xC0) !== 0x80) {\n      self.lastNeed = 1;\n      return '\\ufffd';\n    }\n    if (self.lastNeed > 2 && buf.length > 2) {\n      if ((buf[2] & 0xC0) !== 0x80) {\n        self.lastNeed = 2;\n        return '\\ufffd';\n      }\n    }\n  }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n  var p = this.lastTotal - this.lastNeed;\n  var r = utf8CheckExtraBytes(this, buf, p);\n  if (r !== undefined) return r;\n  if (this.lastNeed <= buf.length) {\n    buf.copy(this.lastChar, p, 0, this.lastNeed);\n    return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n  }\n  buf.copy(this.lastChar, p, 0, buf.length);\n  this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n  var total = utf8CheckIncomplete(this, buf, i);\n  if (!this.lastNeed) return buf.toString('utf8', i);\n  this.lastTotal = total;\n  var end = buf.length - (total - this.lastNeed);\n  buf.copy(this.lastChar, 0, end);\n  return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character is added when ending on a partial\n// character.\nfunction utf8End(buf) {\n  var r = buf && buf.length ? this.write(buf) : '';\n  if (this.lastNeed) return r + '\\ufffd';\n  return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n  if ((buf.length - i) % 2 === 0) {\n    var r = buf.toString('utf16le', i);\n    if (r) {\n      var c = r.charCodeAt(r.length - 1);\n      if (c >= 0xD800 && c <= 0xDBFF) {\n        this.lastNeed = 2;\n        this.lastTotal = 4;\n        this.lastChar[0] = buf[buf.length - 2];\n        this.lastChar[1] = buf[buf.length - 1];\n        return r.slice(0, -1);\n      }\n    }\n    return r;\n  }\n  this.lastNeed = 1;\n  this.lastTotal = 2;\n  this.lastChar[0] = buf[buf.length - 1];\n  return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n  var r = buf && buf.length ? this.write(buf) : '';\n  if (this.lastNeed) {\n    var end = this.lastTotal - this.lastNeed;\n    return r + this.lastChar.toString('utf16le', 0, end);\n  }\n  return r;\n}\n\nfunction base64Text(buf, i) {\n  var n = (buf.length - i) % 3;\n  if (n === 0) return buf.toString('base64', i);\n  this.lastNeed = 3 - n;\n  this.lastTotal = 3;\n  if (n === 1) {\n    this.lastChar[0] = buf[buf.length - 1];\n  } else {\n    this.lastChar[0] = buf[buf.length - 2];\n    this.lastChar[1] = buf[buf.length - 1];\n  }\n  return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n  var r = buf && buf.length ? this.write(buf) : '';\n  if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n  return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n  return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n  return buf && buf.length ? this.write(buf) : '';\n}","'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require('../../ours/primordials')\nconst { Buffer } = require('buffer')\nconst { ERR_INVALID_ARG_TYPE, ERR_STREAM_NULL_VALUES } = require('../../ours/errors').codes\nfunction from(Readable, iterable, opts) {\n  let iterator\n  if (typeof iterable === 'string' || iterable instanceof Buffer) {\n    return new Readable({\n      objectMode: true,\n      ...opts,\n      read() {\n        this.push(iterable)\n        this.push(null)\n      }\n    })\n  }\n  let isAsync\n  if (iterable && iterable[SymbolAsyncIterator]) {\n    isAsync = true\n    iterator = iterable[SymbolAsyncIterator]()\n  } else if (iterable && iterable[SymbolIterator]) {\n    isAsync = false\n    iterator = iterable[SymbolIterator]()\n  } else {\n    throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable)\n  }\n  const readable = new Readable({\n    objectMode: true,\n    highWaterMark: 1,\n    // TODO(ronag): What options should be allowed?\n    ...opts\n  })\n\n  // Flag to protect against _read\n  // being called before last iteration completion.\n  let reading = false\n  readable._read = function () {\n    if (!reading) {\n      reading = true\n      next()\n    }\n  }\n  readable._destroy = function (error, cb) {\n    PromisePrototypeThen(\n      close(error),\n      () => process.nextTick(cb, error),\n      // nextTick is here in case cb throws\n      (e) => process.nextTick(cb, e || error)\n    )\n  }\n  async function close(error) {\n    const hadError = error !== undefined && error !== null\n    const hasThrow = typeof iterator.throw === 'function'\n    if (hadError && hasThrow) {\n      const { value, done } = await iterator.throw(error)\n      await value\n      if (done) {\n        return\n      }\n    }\n    if (typeof iterator.return === 'function') {\n      const { value } = await iterator.return()\n      await value\n    }\n  }\n  async function next() {\n    for (;;) {\n      try {\n        const { value, done } = isAsync ? await iterator.next() : iterator.next()\n        if (done) {\n          readable.push(null)\n        } else {\n          const res = value && typeof value.then === 'function' ? await value : value\n          if (res === null) {\n            reading = false\n            throw new ERR_STREAM_NULL_VALUES()\n          } else if (readable.push(res)) {\n            continue\n          } else {\n            reading = false\n          }\n        }\n      } catch (err) {\n        readable.destroy(err)\n      }\n      break\n    }\n  }\n  return readable\n}\nmodule.exports = from\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst {\n  ArrayPrototypeIndexOf,\n  NumberIsInteger,\n  NumberIsNaN,\n  NumberParseInt,\n  ObjectDefineProperties,\n  ObjectKeys,\n  ObjectSetPrototypeOf,\n  Promise,\n  SafeSet,\n  SymbolAsyncDispose,\n  SymbolAsyncIterator,\n  Symbol\n} = require('../../ours/primordials')\nmodule.exports = Readable\nReadable.ReadableState = ReadableState\nconst { EventEmitter: EE } = require('events')\nconst { Stream, prependListener } = require('./legacy')\nconst { Buffer } = require('buffer')\nconst { addAbortSignal } = require('./add-abort-signal')\nconst eos = require('./end-of-stream')\nlet debug = require('../../ours/util').debuglog('stream', (fn) => {\n  debug = fn\n})\nconst BufferList = require('./buffer_list')\nconst destroyImpl = require('./destroy')\nconst { getHighWaterMark, getDefaultHighWaterMark } = require('./state')\nconst {\n  aggregateTwoErrors,\n  codes: {\n    ERR_INVALID_ARG_TYPE,\n    ERR_METHOD_NOT_IMPLEMENTED,\n    ERR_OUT_OF_RANGE,\n    ERR_STREAM_PUSH_AFTER_EOF,\n    ERR_STREAM_UNSHIFT_AFTER_END_EVENT\n  },\n  AbortError\n} = require('../../ours/errors')\nconst { validateObject } = require('../validators')\nconst kPaused = Symbol('kPaused')\nconst { StringDecoder } = require('string_decoder/')\nconst from = require('./from')\nObjectSetPrototypeOf(Readable.prototype, Stream.prototype)\nObjectSetPrototypeOf(Readable, Stream)\nconst nop = () => {}\nconst { errorOrDestroy } = destroyImpl\nconst kObjectMode = 1 << 0\nconst kEnded = 1 << 1\nconst kEndEmitted = 1 << 2\nconst kReading = 1 << 3\nconst kConstructed = 1 << 4\nconst kSync = 1 << 5\nconst kNeedReadable = 1 << 6\nconst kEmittedReadable = 1 << 7\nconst kReadableListening = 1 << 8\nconst kResumeScheduled = 1 << 9\nconst kErrorEmitted = 1 << 10\nconst kEmitClose = 1 << 11\nconst kAutoDestroy = 1 << 12\nconst kDestroyed = 1 << 13\nconst kClosed = 1 << 14\nconst kCloseEmitted = 1 << 15\nconst kMultiAwaitDrain = 1 << 16\nconst kReadingMore = 1 << 17\nconst kDataEmitted = 1 << 18\n\n// TODO(benjamingr) it is likely slower to do it this way than with free functions\nfunction makeBitMapDescriptor(bit) {\n  return {\n    enumerable: false,\n    get() {\n      return (this.state & bit) !== 0\n    },\n    set(value) {\n      if (value) this.state |= bit\n      else this.state &= ~bit\n    }\n  }\n}\nObjectDefineProperties(ReadableState.prototype, {\n  objectMode: makeBitMapDescriptor(kObjectMode),\n  ended: makeBitMapDescriptor(kEnded),\n  endEmitted: makeBitMapDescriptor(kEndEmitted),\n  reading: makeBitMapDescriptor(kReading),\n  // Stream is still being constructed and cannot be\n  // destroyed until construction finished or failed.\n  // Async construction is opt in, therefore we start as\n  // constructed.\n  constructed: makeBitMapDescriptor(kConstructed),\n  // A flag to be able to tell if the event 'readable'/'data' is emitted\n  // immediately, or on a later tick.  We set this to true at first, because\n  // any actions that shouldn't happen until \"later\" should generally also\n  // not happen before the first read call.\n  sync: makeBitMapDescriptor(kSync),\n  // Whenever we return null, then we set a flag to say\n  // that we're awaiting a 'readable' event emission.\n  needReadable: makeBitMapDescriptor(kNeedReadable),\n  emittedReadable: makeBitMapDescriptor(kEmittedReadable),\n  readableListening: makeBitMapDescriptor(kReadableListening),\n  resumeScheduled: makeBitMapDescriptor(kResumeScheduled),\n  // True if the error was already emitted and should not be thrown again.\n  errorEmitted: makeBitMapDescriptor(kErrorEmitted),\n  emitClose: makeBitMapDescriptor(kEmitClose),\n  autoDestroy: makeBitMapDescriptor(kAutoDestroy),\n  // Has it been destroyed.\n  destroyed: makeBitMapDescriptor(kDestroyed),\n  // Indicates whether the stream has finished destroying.\n  closed: makeBitMapDescriptor(kClosed),\n  // True if close has been emitted or would have been emitted\n  // depending on emitClose.\n  closeEmitted: makeBitMapDescriptor(kCloseEmitted),\n  multiAwaitDrain: makeBitMapDescriptor(kMultiAwaitDrain),\n  // If true, a maybeReadMore has been scheduled.\n  readingMore: makeBitMapDescriptor(kReadingMore),\n  dataEmitted: makeBitMapDescriptor(kDataEmitted)\n})\nfunction ReadableState(options, stream, isDuplex) {\n  // Duplex streams are both readable and writable, but share\n  // the same options object.\n  // However, some cases require setting options to different\n  // values for the readable and the writable sides of the duplex stream.\n  // These options can be provided separately as readableXXX and writableXXX.\n  if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof require('./duplex')\n\n  // Bit map field to store ReadableState more effciently with 1 bit per field\n  // instead of a V8 slot per field.\n  this.state = kEmitClose | kAutoDestroy | kConstructed | kSync\n  // Object stream flag. Used to make read(n) ignore n and to\n  // make all the buffer merging and length checks go away.\n  if (options && options.objectMode) this.state |= kObjectMode\n  if (isDuplex && options && options.readableObjectMode) this.state |= kObjectMode\n\n  // The point at which it stops calling _read() to fill the buffer\n  // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n  this.highWaterMark = options\n    ? getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex)\n    : getDefaultHighWaterMark(false)\n\n  // A linked list is used to store data chunks instead of an array because the\n  // linked list can remove elements from the beginning faster than\n  // array.shift().\n  this.buffer = new BufferList()\n  this.length = 0\n  this.pipes = []\n  this.flowing = null\n  this[kPaused] = null\n\n  // Should close be emitted on destroy. Defaults to true.\n  if (options && options.emitClose === false) this.state &= ~kEmitClose\n\n  // Should .destroy() be called after 'end' (and potentially 'finish').\n  if (options && options.autoDestroy === false) this.state &= ~kAutoDestroy\n\n  // Indicates whether the stream has errored. When true no further\n  // _read calls, 'data' or 'readable' events should occur. This is needed\n  // since when autoDestroy is disabled we need a way to tell whether the\n  // stream has failed.\n  this.errored = null\n\n  // Crypto is kind of old and crusty.  Historically, its default string\n  // encoding is 'binary' so we have to make this configurable.\n  // Everything else in the universe uses 'utf8', though.\n  this.defaultEncoding = (options && options.defaultEncoding) || 'utf8'\n\n  // Ref the piped dest which we need a drain event on it\n  // type: null | Writable | Set.\n  this.awaitDrainWriters = null\n  this.decoder = null\n  this.encoding = null\n  if (options && options.encoding) {\n    this.decoder = new StringDecoder(options.encoding)\n    this.encoding = options.encoding\n  }\n}\nfunction Readable(options) {\n  if (!(this instanceof Readable)) return new Readable(options)\n\n  // Checking for a Stream.Duplex instance is faster here instead of inside\n  // the ReadableState constructor, at least with V8 6.5.\n  const isDuplex = this instanceof require('./duplex')\n  this._readableState = new ReadableState(options, this, isDuplex)\n  if (options) {\n    if (typeof options.read === 'function') this._read = options.read\n    if (typeof options.destroy === 'function') this._destroy = options.destroy\n    if (typeof options.construct === 'function') this._construct = options.construct\n    if (options.signal && !isDuplex) addAbortSignal(options.signal, this)\n  }\n  Stream.call(this, options)\n  destroyImpl.construct(this, () => {\n    if (this._readableState.needReadable) {\n      maybeReadMore(this, this._readableState)\n    }\n  })\n}\nReadable.prototype.destroy = destroyImpl.destroy\nReadable.prototype._undestroy = destroyImpl.undestroy\nReadable.prototype._destroy = function (err, cb) {\n  cb(err)\n}\nReadable.prototype[EE.captureRejectionSymbol] = function (err) {\n  this.destroy(err)\n}\nReadable.prototype[SymbolAsyncDispose] = function () {\n  let error\n  if (!this.destroyed) {\n    error = this.readableEnded ? null : new AbortError()\n    this.destroy(error)\n  }\n  return new Promise((resolve, reject) => eos(this, (err) => (err && err !== error ? reject(err) : resolve(null))))\n}\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n  return readableAddChunk(this, chunk, encoding, false)\n}\n\n// Unshift should *always* be something directly out of read().\nReadable.prototype.unshift = function (chunk, encoding) {\n  return readableAddChunk(this, chunk, encoding, true)\n}\nfunction readableAddChunk(stream, chunk, encoding, addToFront) {\n  debug('readableAddChunk', chunk)\n  const state = stream._readableState\n  let err\n  if ((state.state & kObjectMode) === 0) {\n    if (typeof chunk === 'string') {\n      encoding = encoding || state.defaultEncoding\n      if (state.encoding !== encoding) {\n        if (addToFront && state.encoding) {\n          // When unshifting, if state.encoding is set, we have to save\n          // the string in the BufferList with the state encoding.\n          chunk = Buffer.from(chunk, encoding).toString(state.encoding)\n        } else {\n          chunk = Buffer.from(chunk, encoding)\n          encoding = ''\n        }\n      }\n    } else if (chunk instanceof Buffer) {\n      encoding = ''\n    } else if (Stream._isUint8Array(chunk)) {\n      chunk = Stream._uint8ArrayToBuffer(chunk)\n      encoding = ''\n    } else if (chunk != null) {\n      err = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk)\n    }\n  }\n  if (err) {\n    errorOrDestroy(stream, err)\n  } else if (chunk === null) {\n    state.state &= ~kReading\n    onEofChunk(stream, state)\n  } else if ((state.state & kObjectMode) !== 0 || (chunk && chunk.length > 0)) {\n    if (addToFront) {\n      if ((state.state & kEndEmitted) !== 0) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT())\n      else if (state.destroyed || state.errored) return false\n      else addChunk(stream, state, chunk, true)\n    } else if (state.ended) {\n      errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF())\n    } else if (state.destroyed || state.errored) {\n      return false\n    } else {\n      state.state &= ~kReading\n      if (state.decoder && !encoding) {\n        chunk = state.decoder.write(chunk)\n        if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false)\n        else maybeReadMore(stream, state)\n      } else {\n        addChunk(stream, state, chunk, false)\n      }\n    }\n  } else if (!addToFront) {\n    state.state &= ~kReading\n    maybeReadMore(stream, state)\n  }\n\n  // We can push more data if we are below the highWaterMark.\n  // Also, if we have no data yet, we can stand some more bytes.\n  // This is to work around cases where hwm=0, such as the repl.\n  return !state.ended && (state.length < state.highWaterMark || state.length === 0)\n}\nfunction addChunk(stream, state, chunk, addToFront) {\n  if (state.flowing && state.length === 0 && !state.sync && stream.listenerCount('data') > 0) {\n    // Use the guard to avoid creating `Set()` repeatedly\n    // when we have multiple pipes.\n    if ((state.state & kMultiAwaitDrain) !== 0) {\n      state.awaitDrainWriters.clear()\n    } else {\n      state.awaitDrainWriters = null\n    }\n    state.dataEmitted = true\n    stream.emit('data', chunk)\n  } else {\n    // Update the buffer info.\n    state.length += state.objectMode ? 1 : chunk.length\n    if (addToFront) state.buffer.unshift(chunk)\n    else state.buffer.push(chunk)\n    if ((state.state & kNeedReadable) !== 0) emitReadable(stream)\n  }\n  maybeReadMore(stream, state)\n}\nReadable.prototype.isPaused = function () {\n  const state = this._readableState\n  return state[kPaused] === true || state.flowing === false\n}\n\n// Backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n  const decoder = new StringDecoder(enc)\n  this._readableState.decoder = decoder\n  // If setEncoding(null), decoder.encoding equals utf8.\n  this._readableState.encoding = this._readableState.decoder.encoding\n  const buffer = this._readableState.buffer\n  // Iterate over current buffer to convert already stored Buffers:\n  let content = ''\n  for (const data of buffer) {\n    content += decoder.write(data)\n  }\n  buffer.clear()\n  if (content !== '') buffer.push(content)\n  this._readableState.length = content.length\n  return this\n}\n\n// Don't raise the hwm > 1GB.\nconst MAX_HWM = 0x40000000\nfunction computeNewHighWaterMark(n) {\n  if (n > MAX_HWM) {\n    throw new ERR_OUT_OF_RANGE('size', '<= 1GiB', n)\n  } else {\n    // Get the next highest power of 2 to prevent increasing hwm excessively in\n    // tiny amounts.\n    n--\n    n |= n >>> 1\n    n |= n >>> 2\n    n |= n >>> 4\n    n |= n >>> 8\n    n |= n >>> 16\n    n++\n  }\n  return n\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n  if (n <= 0 || (state.length === 0 && state.ended)) return 0\n  if ((state.state & kObjectMode) !== 0) return 1\n  if (NumberIsNaN(n)) {\n    // Only flow one buffer at a time.\n    if (state.flowing && state.length) return state.buffer.first().length\n    return state.length\n  }\n  if (n <= state.length) return n\n  return state.ended ? state.length : 0\n}\n\n// You can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n  debug('read', n)\n  // Same as parseInt(undefined, 10), however V8 7.3 performance regressed\n  // in this scenario, so we are doing it manually.\n  if (n === undefined) {\n    n = NaN\n  } else if (!NumberIsInteger(n)) {\n    n = NumberParseInt(n, 10)\n  }\n  const state = this._readableState\n  const nOrig = n\n\n  // If we're asking for more than the current hwm, then raise the hwm.\n  if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n)\n  if (n !== 0) state.state &= ~kEmittedReadable\n\n  // If we're doing read(0) to trigger a readable event, but we\n  // already have a bunch of data in the buffer, then just trigger\n  // the 'readable' event and move on.\n  if (\n    n === 0 &&\n    state.needReadable &&\n    ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)\n  ) {\n    debug('read: emitReadable', state.length, state.ended)\n    if (state.length === 0 && state.ended) endReadable(this)\n    else emitReadable(this)\n    return null\n  }\n  n = howMuchToRead(n, state)\n\n  // If we've ended, and we're now clear, then finish it up.\n  if (n === 0 && state.ended) {\n    if (state.length === 0) endReadable(this)\n    return null\n  }\n\n  // All the actual chunk generation logic needs to be\n  // *below* the call to _read.  The reason is that in certain\n  // synthetic stream cases, such as passthrough streams, _read\n  // may be a completely synchronous operation which may change\n  // the state of the read buffer, providing enough data when\n  // before there was *not* enough.\n  //\n  // So, the steps are:\n  // 1. Figure out what the state of things will be after we do\n  // a read from the buffer.\n  //\n  // 2. If that resulting state will trigger a _read, then call _read.\n  // Note that this may be asynchronous, or synchronous.  Yes, it is\n  // deeply ugly to write APIs this way, but that still doesn't mean\n  // that the Readable class should behave improperly, as streams are\n  // designed to be sync/async agnostic.\n  // Take note if the _read call is sync or async (ie, if the read call\n  // has returned yet), so that we know whether or not it's safe to emit\n  // 'readable' etc.\n  //\n  // 3. Actually pull the requested chunks out of the buffer and return.\n\n  // if we need a readable event, then we need to do some reading.\n  let doRead = (state.state & kNeedReadable) !== 0\n  debug('need readable', doRead)\n\n  // If we currently have less than the highWaterMark, then also read some.\n  if (state.length === 0 || state.length - n < state.highWaterMark) {\n    doRead = true\n    debug('length less than watermark', doRead)\n  }\n\n  // However, if we've ended, then there's no point, if we're already\n  // reading, then it's unnecessary, if we're constructing we have to wait,\n  // and if we're destroyed or errored, then it's not allowed,\n  if (state.ended || state.reading || state.destroyed || state.errored || !state.constructed) {\n    doRead = false\n    debug('reading, ended or constructing', doRead)\n  } else if (doRead) {\n    debug('do read')\n    state.state |= kReading | kSync\n    // If the length is currently zero, then we *need* a readable event.\n    if (state.length === 0) state.state |= kNeedReadable\n\n    // Call internal read method\n    try {\n      this._read(state.highWaterMark)\n    } catch (err) {\n      errorOrDestroy(this, err)\n    }\n    state.state &= ~kSync\n\n    // If _read pushed data synchronously, then `reading` will be false,\n    // and we need to re-evaluate how much data we can return to the user.\n    if (!state.reading) n = howMuchToRead(nOrig, state)\n  }\n  let ret\n  if (n > 0) ret = fromList(n, state)\n  else ret = null\n  if (ret === null) {\n    state.needReadable = state.length <= state.highWaterMark\n    n = 0\n  } else {\n    state.length -= n\n    if (state.multiAwaitDrain) {\n      state.awaitDrainWriters.clear()\n    } else {\n      state.awaitDrainWriters = null\n    }\n  }\n  if (state.length === 0) {\n    // If we have nothing in the buffer, then we want to know\n    // as soon as we *do* get something into the buffer.\n    if (!state.ended) state.needReadable = true\n\n    // If we tried to read() past the EOF, then emit end on the next tick.\n    if (nOrig !== n && state.ended) endReadable(this)\n  }\n  if (ret !== null && !state.errorEmitted && !state.closeEmitted) {\n    state.dataEmitted = true\n    this.emit('data', ret)\n  }\n  return ret\n}\nfunction onEofChunk(stream, state) {\n  debug('onEofChunk')\n  if (state.ended) return\n  if (state.decoder) {\n    const chunk = state.decoder.end()\n    if (chunk && chunk.length) {\n      state.buffer.push(chunk)\n      state.length += state.objectMode ? 1 : chunk.length\n    }\n  }\n  state.ended = true\n  if (state.sync) {\n    // If we are sync, wait until next tick to emit the data.\n    // Otherwise we risk emitting data in the flow()\n    // the readable code triggers during a read() call.\n    emitReadable(stream)\n  } else {\n    // Emit 'readable' now to make sure it gets picked up.\n    state.needReadable = false\n    state.emittedReadable = true\n    // We have to emit readable now that we are EOF. Modules\n    // in the ecosystem (e.g. dicer) rely on this event being sync.\n    emitReadable_(stream)\n  }\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow.  This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n  const state = stream._readableState\n  debug('emitReadable', state.needReadable, state.emittedReadable)\n  state.needReadable = false\n  if (!state.emittedReadable) {\n    debug('emitReadable', state.flowing)\n    state.emittedReadable = true\n    process.nextTick(emitReadable_, stream)\n  }\n}\nfunction emitReadable_(stream) {\n  const state = stream._readableState\n  debug('emitReadable_', state.destroyed, state.length, state.ended)\n  if (!state.destroyed && !state.errored && (state.length || state.ended)) {\n    stream.emit('readable')\n    state.emittedReadable = false\n  }\n\n  // The stream needs another readable event if:\n  // 1. It is not flowing, as the flow mechanism will take\n  //    care of it.\n  // 2. It is not ended.\n  // 3. It is below the highWaterMark, so we can schedule\n  //    another readable later.\n  state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark\n  flow(stream)\n}\n\n// At this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data.  that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n  if (!state.readingMore && state.constructed) {\n    state.readingMore = true\n    process.nextTick(maybeReadMore_, stream, state)\n  }\n}\nfunction maybeReadMore_(stream, state) {\n  // Attempt to read more data if we should.\n  //\n  // The conditions for reading more data are (one of):\n  // - Not enough data buffered (state.length < state.highWaterMark). The loop\n  //   is responsible for filling the buffer with enough data if such data\n  //   is available. If highWaterMark is 0 and we are not in the flowing mode\n  //   we should _not_ attempt to buffer any extra data. We'll get more data\n  //   when the stream consumer calls read() instead.\n  // - No data in the buffer, and the stream is in flowing mode. In this mode\n  //   the loop below is responsible for ensuring read() is called. Failing to\n  //   call read here would abort the flow and there's no other mechanism for\n  //   continuing the flow if the stream consumer has just subscribed to the\n  //   'data' event.\n  //\n  // In addition to the above conditions to keep reading data, the following\n  // conditions prevent the data from being read:\n  // - The stream has ended (state.ended).\n  // - There is already a pending 'read' operation (state.reading). This is a\n  //   case where the stream has called the implementation defined _read()\n  //   method, but they are processing the call asynchronously and have _not_\n  //   called push() with new data. In this case we skip performing more\n  //   read()s. The execution ends in this method again after the _read() ends\n  //   up calling push() with more data.\n  while (\n    !state.reading &&\n    !state.ended &&\n    (state.length < state.highWaterMark || (state.flowing && state.length === 0))\n  ) {\n    const len = state.length\n    debug('maybeReadMore read 0')\n    stream.read(0)\n    if (len === state.length)\n      // Didn't get any data, stop spinning.\n      break\n  }\n  state.readingMore = false\n}\n\n// Abstract method.  to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n  throw new ERR_METHOD_NOT_IMPLEMENTED('_read()')\n}\nReadable.prototype.pipe = function (dest, pipeOpts) {\n  const src = this\n  const state = this._readableState\n  if (state.pipes.length === 1) {\n    if (!state.multiAwaitDrain) {\n      state.multiAwaitDrain = true\n      state.awaitDrainWriters = new SafeSet(state.awaitDrainWriters ? [state.awaitDrainWriters] : [])\n    }\n  }\n  state.pipes.push(dest)\n  debug('pipe count=%d opts=%j', state.pipes.length, pipeOpts)\n  const doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr\n  const endFn = doEnd ? onend : unpipe\n  if (state.endEmitted) process.nextTick(endFn)\n  else src.once('end', endFn)\n  dest.on('unpipe', onunpipe)\n  function onunpipe(readable, unpipeInfo) {\n    debug('onunpipe')\n    if (readable === src) {\n      if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n        unpipeInfo.hasUnpiped = true\n        cleanup()\n      }\n    }\n  }\n  function onend() {\n    debug('onend')\n    dest.end()\n  }\n  let ondrain\n  let cleanedUp = false\n  function cleanup() {\n    debug('cleanup')\n    // Cleanup event handlers once the pipe is broken.\n    dest.removeListener('close', onclose)\n    dest.removeListener('finish', onfinish)\n    if (ondrain) {\n      dest.removeListener('drain', ondrain)\n    }\n    dest.removeListener('error', onerror)\n    dest.removeListener('unpipe', onunpipe)\n    src.removeListener('end', onend)\n    src.removeListener('end', unpipe)\n    src.removeListener('data', ondata)\n    cleanedUp = true\n\n    // If the reader is waiting for a drain event from this\n    // specific writer, then it would cause it to never start\n    // flowing again.\n    // So, if this is awaiting a drain, then we just call it now.\n    // If we don't know, then assume that we are waiting for one.\n    if (ondrain && state.awaitDrainWriters && (!dest._writableState || dest._writableState.needDrain)) ondrain()\n  }\n  function pause() {\n    // If the user unpiped during `dest.write()`, it is possible\n    // to get stuck in a permanently paused state if that write\n    // also returned false.\n    // => Check whether `dest` is still a piping destination.\n    if (!cleanedUp) {\n      if (state.pipes.length === 1 && state.pipes[0] === dest) {\n        debug('false write response, pause', 0)\n        state.awaitDrainWriters = dest\n        state.multiAwaitDrain = false\n      } else if (state.pipes.length > 1 && state.pipes.includes(dest)) {\n        debug('false write response, pause', state.awaitDrainWriters.size)\n        state.awaitDrainWriters.add(dest)\n      }\n      src.pause()\n    }\n    if (!ondrain) {\n      // When the dest drains, it reduces the awaitDrain counter\n      // on the source.  This would be more elegant with a .once()\n      // handler in flow(), but adding and removing repeatedly is\n      // too slow.\n      ondrain = pipeOnDrain(src, dest)\n      dest.on('drain', ondrain)\n    }\n  }\n  src.on('data', ondata)\n  function ondata(chunk) {\n    debug('ondata')\n    const ret = dest.write(chunk)\n    debug('dest.write', ret)\n    if (ret === false) {\n      pause()\n    }\n  }\n\n  // If the dest has an error, then stop piping into it.\n  // However, don't suppress the throwing behavior for this.\n  function onerror(er) {\n    debug('onerror', er)\n    unpipe()\n    dest.removeListener('error', onerror)\n    if (dest.listenerCount('error') === 0) {\n      const s = dest._writableState || dest._readableState\n      if (s && !s.errorEmitted) {\n        // User incorrectly emitted 'error' directly on the stream.\n        errorOrDestroy(dest, er)\n      } else {\n        dest.emit('error', er)\n      }\n    }\n  }\n\n  // Make sure our error handler is attached before userland ones.\n  prependListener(dest, 'error', onerror)\n\n  // Both close and finish should trigger unpipe, but only once.\n  function onclose() {\n    dest.removeListener('finish', onfinish)\n    unpipe()\n  }\n  dest.once('close', onclose)\n  function onfinish() {\n    debug('onfinish')\n    dest.removeListener('close', onclose)\n    unpipe()\n  }\n  dest.once('finish', onfinish)\n  function unpipe() {\n    debug('unpipe')\n    src.unpipe(dest)\n  }\n\n  // Tell the dest that it's being piped to.\n  dest.emit('pipe', src)\n\n  // Start the flow if it hasn't been started already.\n\n  if (dest.writableNeedDrain === true) {\n    pause()\n  } else if (!state.flowing) {\n    debug('pipe resume')\n    src.resume()\n  }\n  return dest\n}\nfunction pipeOnDrain(src, dest) {\n  return function pipeOnDrainFunctionResult() {\n    const state = src._readableState\n\n    // `ondrain` will call directly,\n    // `this` maybe not a reference to dest,\n    // so we use the real dest here.\n    if (state.awaitDrainWriters === dest) {\n      debug('pipeOnDrain', 1)\n      state.awaitDrainWriters = null\n    } else if (state.multiAwaitDrain) {\n      debug('pipeOnDrain', state.awaitDrainWriters.size)\n      state.awaitDrainWriters.delete(dest)\n    }\n    if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) && src.listenerCount('data')) {\n      src.resume()\n    }\n  }\n}\nReadable.prototype.unpipe = function (dest) {\n  const state = this._readableState\n  const unpipeInfo = {\n    hasUnpiped: false\n  }\n\n  // If we're not piping anywhere, then do nothing.\n  if (state.pipes.length === 0) return this\n  if (!dest) {\n    // remove all.\n    const dests = state.pipes\n    state.pipes = []\n    this.pause()\n    for (let i = 0; i < dests.length; i++)\n      dests[i].emit('unpipe', this, {\n        hasUnpiped: false\n      })\n    return this\n  }\n\n  // Try to find the right one.\n  const index = ArrayPrototypeIndexOf(state.pipes, dest)\n  if (index === -1) return this\n  state.pipes.splice(index, 1)\n  if (state.pipes.length === 0) this.pause()\n  dest.emit('unpipe', this, unpipeInfo)\n  return this\n}\n\n// Set up data events if they are asked for\n// Ensure readable listeners eventually get something.\nReadable.prototype.on = function (ev, fn) {\n  const res = Stream.prototype.on.call(this, ev, fn)\n  const state = this._readableState\n  if (ev === 'data') {\n    // Update readableListening so that resume() may be a no-op\n    // a few lines down. This is needed to support once('readable').\n    state.readableListening = this.listenerCount('readable') > 0\n\n    // Try start flowing on next tick if stream isn't explicitly paused.\n    if (state.flowing !== false) this.resume()\n  } else if (ev === 'readable') {\n    if (!state.endEmitted && !state.readableListening) {\n      state.readableListening = state.needReadable = true\n      state.flowing = false\n      state.emittedReadable = false\n      debug('on readable', state.length, state.reading)\n      if (state.length) {\n        emitReadable(this)\n      } else if (!state.reading) {\n        process.nextTick(nReadingNextTick, this)\n      }\n    }\n  }\n  return res\n}\nReadable.prototype.addListener = Readable.prototype.on\nReadable.prototype.removeListener = function (ev, fn) {\n  const res = Stream.prototype.removeListener.call(this, ev, fn)\n  if (ev === 'readable') {\n    // We need to check if there is someone still listening to\n    // readable and reset the state. However this needs to happen\n    // after readable has been emitted but before I/O (nextTick) to\n    // support once('readable', fn) cycles. This means that calling\n    // resume within the same tick will have no\n    // effect.\n    process.nextTick(updateReadableListening, this)\n  }\n  return res\n}\nReadable.prototype.off = Readable.prototype.removeListener\nReadable.prototype.removeAllListeners = function (ev) {\n  const res = Stream.prototype.removeAllListeners.apply(this, arguments)\n  if (ev === 'readable' || ev === undefined) {\n    // We need to check if there is someone still listening to\n    // readable and reset the state. However this needs to happen\n    // after readable has been emitted but before I/O (nextTick) to\n    // support once('readable', fn) cycles. This means that calling\n    // resume within the same tick will have no\n    // effect.\n    process.nextTick(updateReadableListening, this)\n  }\n  return res\n}\nfunction updateReadableListening(self) {\n  const state = self._readableState\n  state.readableListening = self.listenerCount('readable') > 0\n  if (state.resumeScheduled && state[kPaused] === false) {\n    // Flowing needs to be set to true now, otherwise\n    // the upcoming resume will not flow.\n    state.flowing = true\n\n    // Crude way to check if we should resume.\n  } else if (self.listenerCount('data') > 0) {\n    self.resume()\n  } else if (!state.readableListening) {\n    state.flowing = null\n  }\n}\nfunction nReadingNextTick(self) {\n  debug('readable nexttick read 0')\n  self.read(0)\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n  const state = this._readableState\n  if (!state.flowing) {\n    debug('resume')\n    // We flow only if there is no one listening\n    // for readable, but we still have to call\n    // resume().\n    state.flowing = !state.readableListening\n    resume(this, state)\n  }\n  state[kPaused] = false\n  return this\n}\nfunction resume(stream, state) {\n  if (!state.resumeScheduled) {\n    state.resumeScheduled = true\n    process.nextTick(resume_, stream, state)\n  }\n}\nfunction resume_(stream, state) {\n  debug('resume', state.reading)\n  if (!state.reading) {\n    stream.read(0)\n  }\n  state.resumeScheduled = false\n  stream.emit('resume')\n  flow(stream)\n  if (state.flowing && !state.reading) stream.read(0)\n}\nReadable.prototype.pause = function () {\n  debug('call pause flowing=%j', this._readableState.flowing)\n  if (this._readableState.flowing !== false) {\n    debug('pause')\n    this._readableState.flowing = false\n    this.emit('pause')\n  }\n  this._readableState[kPaused] = true\n  return this\n}\nfunction flow(stream) {\n  const state = stream._readableState\n  debug('flow', state.flowing)\n  while (state.flowing && stream.read() !== null);\n}\n\n// Wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n  let paused = false\n\n  // TODO (ronag): Should this.destroy(err) emit\n  // 'error' on the wrapped stream? Would require\n  // a static factory method, e.g. Readable.wrap(stream).\n\n  stream.on('data', (chunk) => {\n    if (!this.push(chunk) && stream.pause) {\n      paused = true\n      stream.pause()\n    }\n  })\n  stream.on('end', () => {\n    this.push(null)\n  })\n  stream.on('error', (err) => {\n    errorOrDestroy(this, err)\n  })\n  stream.on('close', () => {\n    this.destroy()\n  })\n  stream.on('destroy', () => {\n    this.destroy()\n  })\n  this._read = () => {\n    if (paused && stream.resume) {\n      paused = false\n      stream.resume()\n    }\n  }\n\n  // Proxy all the other methods. Important when wrapping filters and duplexes.\n  const streamKeys = ObjectKeys(stream)\n  for (let j = 1; j < streamKeys.length; j++) {\n    const i = streamKeys[j]\n    if (this[i] === undefined && typeof stream[i] === 'function') {\n      this[i] = stream[i].bind(stream)\n    }\n  }\n  return this\n}\nReadable.prototype[SymbolAsyncIterator] = function () {\n  return streamToAsyncIterator(this)\n}\nReadable.prototype.iterator = function (options) {\n  if (options !== undefined) {\n    validateObject(options, 'options')\n  }\n  return streamToAsyncIterator(this, options)\n}\nfunction streamToAsyncIterator(stream, options) {\n  if (typeof stream.read !== 'function') {\n    stream = Readable.wrap(stream, {\n      objectMode: true\n    })\n  }\n  const iter = createAsyncIterator(stream, options)\n  iter.stream = stream\n  return iter\n}\nasync function* createAsyncIterator(stream, options) {\n  let callback = nop\n  function next(resolve) {\n    if (this === stream) {\n      callback()\n      callback = nop\n    } else {\n      callback = resolve\n    }\n  }\n  stream.on('readable', next)\n  let error\n  const cleanup = eos(\n    stream,\n    {\n      writable: false\n    },\n    (err) => {\n      error = err ? aggregateTwoErrors(error, err) : null\n      callback()\n      callback = nop\n    }\n  )\n  try {\n    while (true) {\n      const chunk = stream.destroyed ? null : stream.read()\n      if (chunk !== null) {\n        yield chunk\n      } else if (error) {\n        throw error\n      } else if (error === null) {\n        return\n      } else {\n        await new Promise(next)\n      }\n    }\n  } catch (err) {\n    error = aggregateTwoErrors(error, err)\n    throw error\n  } finally {\n    if (\n      (error || (options === null || options === undefined ? undefined : options.destroyOnReturn) !== false) &&\n      (error === undefined || stream._readableState.autoDestroy)\n    ) {\n      destroyImpl.destroyer(stream, null)\n    } else {\n      stream.off('readable', next)\n      cleanup()\n    }\n  }\n}\n\n// Making it explicit these properties are not enumerable\n// because otherwise some prototype manipulation in\n// userland will fail.\nObjectDefineProperties(Readable.prototype, {\n  readable: {\n    __proto__: null,\n    get() {\n      const r = this._readableState\n      // r.readable === false means that this is part of a Duplex stream\n      // where the readable side was disabled upon construction.\n      // Compat. The user might manually disable readable side through\n      // deprecated setter.\n      return !!r && r.readable !== false && !r.destroyed && !r.errorEmitted && !r.endEmitted\n    },\n    set(val) {\n      // Backwards compat.\n      if (this._readableState) {\n        this._readableState.readable = !!val\n      }\n    }\n  },\n  readableDidRead: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return this._readableState.dataEmitted\n    }\n  },\n  readableAborted: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return !!(\n        this._readableState.readable !== false &&\n        (this._readableState.destroyed || this._readableState.errored) &&\n        !this._readableState.endEmitted\n      )\n    }\n  },\n  readableHighWaterMark: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return this._readableState.highWaterMark\n    }\n  },\n  readableBuffer: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return this._readableState && this._readableState.buffer\n    }\n  },\n  readableFlowing: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return this._readableState.flowing\n    },\n    set: function (state) {\n      if (this._readableState) {\n        this._readableState.flowing = state\n      }\n    }\n  },\n  readableLength: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState.length\n    }\n  },\n  readableObjectMode: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState ? this._readableState.objectMode : false\n    }\n  },\n  readableEncoding: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState ? this._readableState.encoding : null\n    }\n  },\n  errored: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState ? this._readableState.errored : null\n    }\n  },\n  closed: {\n    __proto__: null,\n    get() {\n      return this._readableState ? this._readableState.closed : false\n    }\n  },\n  destroyed: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState ? this._readableState.destroyed : false\n    },\n    set(value) {\n      // We ignore the value if the stream\n      // has not been initialized yet.\n      if (!this._readableState) {\n        return\n      }\n\n      // Backward compatibility, the user is explicitly\n      // managing destroyed.\n      this._readableState.destroyed = value\n    }\n  },\n  readableEnded: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState ? this._readableState.endEmitted : false\n    }\n  }\n})\nObjectDefineProperties(ReadableState.prototype, {\n  // Legacy getter for `pipesCount`.\n  pipesCount: {\n    __proto__: null,\n    get() {\n      return this.pipes.length\n    }\n  },\n  // Legacy property for `paused`.\n  paused: {\n    __proto__: null,\n    get() {\n      return this[kPaused] !== false\n    },\n    set(value) {\n      this[kPaused] = !!value\n    }\n  }\n})\n\n// Exposed for testing purposes only.\nReadable._fromList = fromList\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n  // nothing buffered.\n  if (state.length === 0) return null\n  let ret\n  if (state.objectMode) ret = state.buffer.shift()\n  else if (!n || n >= state.length) {\n    // Read it all, truncate the list.\n    if (state.decoder) ret = state.buffer.join('')\n    else if (state.buffer.length === 1) ret = state.buffer.first()\n    else ret = state.buffer.concat(state.length)\n    state.buffer.clear()\n  } else {\n    // read part of list.\n    ret = state.buffer.consume(n, state.decoder)\n  }\n  return ret\n}\nfunction endReadable(stream) {\n  const state = stream._readableState\n  debug('endReadable', state.endEmitted)\n  if (!state.endEmitted) {\n    state.ended = true\n    process.nextTick(endReadableNT, state, stream)\n  }\n}\nfunction endReadableNT(state, stream) {\n  debug('endReadableNT', state.endEmitted, state.length)\n\n  // Check that we didn't get one last unshift.\n  if (!state.errored && !state.closeEmitted && !state.endEmitted && state.length === 0) {\n    state.endEmitted = true\n    stream.emit('end')\n    if (stream.writable && stream.allowHalfOpen === false) {\n      process.nextTick(endWritableNT, stream)\n    } else if (state.autoDestroy) {\n      // In case of duplex streams we need a way to detect\n      // if the writable side is ready for autoDestroy as well.\n      const wState = stream._writableState\n      const autoDestroy =\n        !wState ||\n        (wState.autoDestroy &&\n          // We don't expect the writable to ever 'finish'\n          // if writable is explicitly set to false.\n          (wState.finished || wState.writable === false))\n      if (autoDestroy) {\n        stream.destroy()\n      }\n    }\n  }\n}\nfunction endWritableNT(stream) {\n  const writable = stream.writable && !stream.writableEnded && !stream.destroyed\n  if (writable) {\n    stream.end()\n  }\n}\nReadable.from = function (iterable, opts) {\n  return from(Readable, iterable, opts)\n}\nlet webStreamsAdapters\n\n// Lazy to avoid circular references\nfunction lazyWebStreams() {\n  if (webStreamsAdapters === undefined) webStreamsAdapters = {}\n  return webStreamsAdapters\n}\nReadable.fromWeb = function (readableStream, options) {\n  return lazyWebStreams().newStreamReadableFromReadableStream(readableStream, options)\n}\nReadable.toWeb = function (streamReadable, options) {\n  return lazyWebStreams().newReadableStreamFromStreamReadable(streamReadable, options)\n}\nReadable.wrap = function (src, options) {\n  var _ref, _src$readableObjectMo\n  return new Readable({\n    objectMode:\n      (_ref =\n        (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== undefined\n          ? _src$readableObjectMo\n          : src.objectMode) !== null && _ref !== undefined\n        ? _ref\n        : true,\n    ...options,\n    destroy(err, callback) {\n      destroyImpl.destroyer(src, err)\n      callback(err)\n    }\n  }).wrap(src)\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst {\n  ArrayPrototypeSlice,\n  Error,\n  FunctionPrototypeSymbolHasInstance,\n  ObjectDefineProperty,\n  ObjectDefineProperties,\n  ObjectSetPrototypeOf,\n  StringPrototypeToLowerCase,\n  Symbol,\n  SymbolHasInstance\n} = require('../../ours/primordials')\nmodule.exports = Writable\nWritable.WritableState = WritableState\nconst { EventEmitter: EE } = require('events')\nconst Stream = require('./legacy').Stream\nconst { Buffer } = require('buffer')\nconst destroyImpl = require('./destroy')\nconst { addAbortSignal } = require('./add-abort-signal')\nconst { getHighWaterMark, getDefaultHighWaterMark } = require('./state')\nconst {\n  ERR_INVALID_ARG_TYPE,\n  ERR_METHOD_NOT_IMPLEMENTED,\n  ERR_MULTIPLE_CALLBACK,\n  ERR_STREAM_CANNOT_PIPE,\n  ERR_STREAM_DESTROYED,\n  ERR_STREAM_ALREADY_FINISHED,\n  ERR_STREAM_NULL_VALUES,\n  ERR_STREAM_WRITE_AFTER_END,\n  ERR_UNKNOWN_ENCODING\n} = require('../../ours/errors').codes\nconst { errorOrDestroy } = destroyImpl\nObjectSetPrototypeOf(Writable.prototype, Stream.prototype)\nObjectSetPrototypeOf(Writable, Stream)\nfunction nop() {}\nconst kOnFinished = Symbol('kOnFinished')\nfunction WritableState(options, stream, isDuplex) {\n  // Duplex streams are both readable and writable, but share\n  // the same options object.\n  // However, some cases require setting options to different\n  // values for the readable and the writable sides of the duplex stream,\n  // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.\n  if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof require('./duplex')\n\n  // Object stream flag to indicate whether or not this stream\n  // contains buffers or objects.\n  this.objectMode = !!(options && options.objectMode)\n  if (isDuplex) this.objectMode = this.objectMode || !!(options && options.writableObjectMode)\n\n  // The point at which write() starts returning false\n  // Note: 0 is a valid value, means that we always return false if\n  // the entire buffer is not flushed immediately on write().\n  this.highWaterMark = options\n    ? getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex)\n    : getDefaultHighWaterMark(false)\n\n  // if _final has been called.\n  this.finalCalled = false\n\n  // drain event flag.\n  this.needDrain = false\n  // At the start of calling end()\n  this.ending = false\n  // When end() has been called, and returned.\n  this.ended = false\n  // When 'finish' is emitted.\n  this.finished = false\n\n  // Has it been destroyed\n  this.destroyed = false\n\n  // Should we decode strings into buffers before passing to _write?\n  // this is here so that some node-core streams can optimize string\n  // handling at a lower level.\n  const noDecode = !!(options && options.decodeStrings === false)\n  this.decodeStrings = !noDecode\n\n  // Crypto is kind of old and crusty.  Historically, its default string\n  // encoding is 'binary' so we have to make this configurable.\n  // Everything else in the universe uses 'utf8', though.\n  this.defaultEncoding = (options && options.defaultEncoding) || 'utf8'\n\n  // Not an actual buffer we keep track of, but a measurement\n  // of how much we're waiting to get pushed to some underlying\n  // socket or file.\n  this.length = 0\n\n  // A flag to see when we're in the middle of a write.\n  this.writing = false\n\n  // When true all writes will be buffered until .uncork() call.\n  this.corked = 0\n\n  // A flag to be able to tell if the onwrite cb is called immediately,\n  // or on a later tick.  We set this to true at first, because any\n  // actions that shouldn't happen until \"later\" should generally also\n  // not happen before the first write call.\n  this.sync = true\n\n  // A flag to know if we're processing previously buffered items, which\n  // may call the _write() callback in the same tick, so that we don't\n  // end up in an overlapped onwrite situation.\n  this.bufferProcessing = false\n\n  // The callback that's passed to _write(chunk, cb).\n  this.onwrite = onwrite.bind(undefined, stream)\n\n  // The callback that the user supplies to write(chunk, encoding, cb).\n  this.writecb = null\n\n  // The amount that is being written when _write is called.\n  this.writelen = 0\n\n  // Storage for data passed to the afterWrite() callback in case of\n  // synchronous _write() completion.\n  this.afterWriteTickInfo = null\n  resetBuffer(this)\n\n  // Number of pending user-supplied write callbacks\n  // this must be 0 before 'finish' can be emitted.\n  this.pendingcb = 0\n\n  // Stream is still being constructed and cannot be\n  // destroyed until construction finished or failed.\n  // Async construction is opt in, therefore we start as\n  // constructed.\n  this.constructed = true\n\n  // Emit prefinish if the only thing we're waiting for is _write cbs\n  // This is relevant for synchronous Transform streams.\n  this.prefinished = false\n\n  // True if the error was already emitted and should not be thrown again.\n  this.errorEmitted = false\n\n  // Should close be emitted on destroy. Defaults to true.\n  this.emitClose = !options || options.emitClose !== false\n\n  // Should .destroy() be called after 'finish' (and potentially 'end').\n  this.autoDestroy = !options || options.autoDestroy !== false\n\n  // Indicates whether the stream has errored. When true all write() calls\n  // should return false. This is needed since when autoDestroy\n  // is disabled we need a way to tell whether the stream has failed.\n  this.errored = null\n\n  // Indicates whether the stream has finished destroying.\n  this.closed = false\n\n  // True if close has been emitted or would have been emitted\n  // depending on emitClose.\n  this.closeEmitted = false\n  this[kOnFinished] = []\n}\nfunction resetBuffer(state) {\n  state.buffered = []\n  state.bufferedIndex = 0\n  state.allBuffers = true\n  state.allNoop = true\n}\nWritableState.prototype.getBuffer = function getBuffer() {\n  return ArrayPrototypeSlice(this.buffered, this.bufferedIndex)\n}\nObjectDefineProperty(WritableState.prototype, 'bufferedRequestCount', {\n  __proto__: null,\n  get() {\n    return this.buffered.length - this.bufferedIndex\n  }\n})\nfunction Writable(options) {\n  // Writable ctor is applied to Duplexes, too.\n  // `realHasInstance` is necessary because using plain `instanceof`\n  // would return false, as no `_writableState` property is attached.\n\n  // Trying to use the custom `instanceof` for Writable here will also break the\n  // Node.js LazyTransform implementation, which has a non-trivial getter for\n  // `_writableState` that would lead to infinite recursion.\n\n  // Checking for a Stream.Duplex instance is faster here instead of inside\n  // the WritableState constructor, at least with V8 6.5.\n  const isDuplex = this instanceof require('./duplex')\n  if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable, this)) return new Writable(options)\n  this._writableState = new WritableState(options, this, isDuplex)\n  if (options) {\n    if (typeof options.write === 'function') this._write = options.write\n    if (typeof options.writev === 'function') this._writev = options.writev\n    if (typeof options.destroy === 'function') this._destroy = options.destroy\n    if (typeof options.final === 'function') this._final = options.final\n    if (typeof options.construct === 'function') this._construct = options.construct\n    if (options.signal) addAbortSignal(options.signal, this)\n  }\n  Stream.call(this, options)\n  destroyImpl.construct(this, () => {\n    const state = this._writableState\n    if (!state.writing) {\n      clearBuffer(this, state)\n    }\n    finishMaybe(this, state)\n  })\n}\nObjectDefineProperty(Writable, SymbolHasInstance, {\n  __proto__: null,\n  value: function (object) {\n    if (FunctionPrototypeSymbolHasInstance(this, object)) return true\n    if (this !== Writable) return false\n    return object && object._writableState instanceof WritableState\n  }\n})\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n  errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE())\n}\nfunction _write(stream, chunk, encoding, cb) {\n  const state = stream._writableState\n  if (typeof encoding === 'function') {\n    cb = encoding\n    encoding = state.defaultEncoding\n  } else {\n    if (!encoding) encoding = state.defaultEncoding\n    else if (encoding !== 'buffer' && !Buffer.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding)\n    if (typeof cb !== 'function') cb = nop\n  }\n  if (chunk === null) {\n    throw new ERR_STREAM_NULL_VALUES()\n  } else if (!state.objectMode) {\n    if (typeof chunk === 'string') {\n      if (state.decodeStrings !== false) {\n        chunk = Buffer.from(chunk, encoding)\n        encoding = 'buffer'\n      }\n    } else if (chunk instanceof Buffer) {\n      encoding = 'buffer'\n    } else if (Stream._isUint8Array(chunk)) {\n      chunk = Stream._uint8ArrayToBuffer(chunk)\n      encoding = 'buffer'\n    } else {\n      throw new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk)\n    }\n  }\n  let err\n  if (state.ending) {\n    err = new ERR_STREAM_WRITE_AFTER_END()\n  } else if (state.destroyed) {\n    err = new ERR_STREAM_DESTROYED('write')\n  }\n  if (err) {\n    process.nextTick(cb, err)\n    errorOrDestroy(stream, err, true)\n    return err\n  }\n  state.pendingcb++\n  return writeOrBuffer(stream, state, chunk, encoding, cb)\n}\nWritable.prototype.write = function (chunk, encoding, cb) {\n  return _write(this, chunk, encoding, cb) === true\n}\nWritable.prototype.cork = function () {\n  this._writableState.corked++\n}\nWritable.prototype.uncork = function () {\n  const state = this._writableState\n  if (state.corked) {\n    state.corked--\n    if (!state.writing) clearBuffer(this, state)\n  }\n}\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n  // node::ParseEncoding() requires lower case.\n  if (typeof encoding === 'string') encoding = StringPrototypeToLowerCase(encoding)\n  if (!Buffer.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding)\n  this._writableState.defaultEncoding = encoding\n  return this\n}\n\n// If we're already writing something, then just put this\n// in the queue, and wait our turn.  Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, chunk, encoding, callback) {\n  const len = state.objectMode ? 1 : chunk.length\n  state.length += len\n\n  // stream._write resets state.length\n  const ret = state.length < state.highWaterMark\n  // We must ensure that previous needDrain will not be reset to false.\n  if (!ret) state.needDrain = true\n  if (state.writing || state.corked || state.errored || !state.constructed) {\n    state.buffered.push({\n      chunk,\n      encoding,\n      callback\n    })\n    if (state.allBuffers && encoding !== 'buffer') {\n      state.allBuffers = false\n    }\n    if (state.allNoop && callback !== nop) {\n      state.allNoop = false\n    }\n  } else {\n    state.writelen = len\n    state.writecb = callback\n    state.writing = true\n    state.sync = true\n    stream._write(chunk, encoding, state.onwrite)\n    state.sync = false\n  }\n\n  // Return false if errored or destroyed in order to break\n  // any synchronous while(stream.write(data)) loops.\n  return ret && !state.errored && !state.destroyed\n}\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n  state.writelen = len\n  state.writecb = cb\n  state.writing = true\n  state.sync = true\n  if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'))\n  else if (writev) stream._writev(chunk, state.onwrite)\n  else stream._write(chunk, encoding, state.onwrite)\n  state.sync = false\n}\nfunction onwriteError(stream, state, er, cb) {\n  --state.pendingcb\n  cb(er)\n  // Ensure callbacks are invoked even when autoDestroy is\n  // not enabled. Passing `er` here doesn't make sense since\n  // it's related to one specific write, not to the buffered\n  // writes.\n  errorBuffer(state)\n  // This can emit error, but error must always follow cb.\n  errorOrDestroy(stream, er)\n}\nfunction onwrite(stream, er) {\n  const state = stream._writableState\n  const sync = state.sync\n  const cb = state.writecb\n  if (typeof cb !== 'function') {\n    errorOrDestroy(stream, new ERR_MULTIPLE_CALLBACK())\n    return\n  }\n  state.writing = false\n  state.writecb = null\n  state.length -= state.writelen\n  state.writelen = 0\n  if (er) {\n    // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364\n    er.stack // eslint-disable-line no-unused-expressions\n\n    if (!state.errored) {\n      state.errored = er\n    }\n\n    // In case of duplex streams we need to notify the readable side of the\n    // error.\n    if (stream._readableState && !stream._readableState.errored) {\n      stream._readableState.errored = er\n    }\n    if (sync) {\n      process.nextTick(onwriteError, stream, state, er, cb)\n    } else {\n      onwriteError(stream, state, er, cb)\n    }\n  } else {\n    if (state.buffered.length > state.bufferedIndex) {\n      clearBuffer(stream, state)\n    }\n    if (sync) {\n      // It is a common case that the callback passed to .write() is always\n      // the same. In that case, we do not schedule a new nextTick(), but\n      // rather just increase a counter, to improve performance and avoid\n      // memory allocations.\n      if (state.afterWriteTickInfo !== null && state.afterWriteTickInfo.cb === cb) {\n        state.afterWriteTickInfo.count++\n      } else {\n        state.afterWriteTickInfo = {\n          count: 1,\n          cb,\n          stream,\n          state\n        }\n        process.nextTick(afterWriteTick, state.afterWriteTickInfo)\n      }\n    } else {\n      afterWrite(stream, state, 1, cb)\n    }\n  }\n}\nfunction afterWriteTick({ stream, state, count, cb }) {\n  state.afterWriteTickInfo = null\n  return afterWrite(stream, state, count, cb)\n}\nfunction afterWrite(stream, state, count, cb) {\n  const needDrain = !state.ending && !stream.destroyed && state.length === 0 && state.needDrain\n  if (needDrain) {\n    state.needDrain = false\n    stream.emit('drain')\n  }\n  while (count-- > 0) {\n    state.pendingcb--\n    cb()\n  }\n  if (state.destroyed) {\n    errorBuffer(state)\n  }\n  finishMaybe(stream, state)\n}\n\n// If there's something in the buffer waiting, then invoke callbacks.\nfunction errorBuffer(state) {\n  if (state.writing) {\n    return\n  }\n  for (let n = state.bufferedIndex; n < state.buffered.length; ++n) {\n    var _state$errored\n    const { chunk, callback } = state.buffered[n]\n    const len = state.objectMode ? 1 : chunk.length\n    state.length -= len\n    callback(\n      (_state$errored = state.errored) !== null && _state$errored !== undefined\n        ? _state$errored\n        : new ERR_STREAM_DESTROYED('write')\n    )\n  }\n  const onfinishCallbacks = state[kOnFinished].splice(0)\n  for (let i = 0; i < onfinishCallbacks.length; i++) {\n    var _state$errored2\n    onfinishCallbacks[i](\n      (_state$errored2 = state.errored) !== null && _state$errored2 !== undefined\n        ? _state$errored2\n        : new ERR_STREAM_DESTROYED('end')\n    )\n  }\n  resetBuffer(state)\n}\n\n// If there's something in the buffer waiting, then process it.\nfunction clearBuffer(stream, state) {\n  if (state.corked || state.bufferProcessing || state.destroyed || !state.constructed) {\n    return\n  }\n  const { buffered, bufferedIndex, objectMode } = state\n  const bufferedLength = buffered.length - bufferedIndex\n  if (!bufferedLength) {\n    return\n  }\n  let i = bufferedIndex\n  state.bufferProcessing = true\n  if (bufferedLength > 1 && stream._writev) {\n    state.pendingcb -= bufferedLength - 1\n    const callback = state.allNoop\n      ? nop\n      : (err) => {\n          for (let n = i; n < buffered.length; ++n) {\n            buffered[n].callback(err)\n          }\n        }\n    // Make a copy of `buffered` if it's going to be used by `callback` above,\n    // since `doWrite` will mutate the array.\n    const chunks = state.allNoop && i === 0 ? buffered : ArrayPrototypeSlice(buffered, i)\n    chunks.allBuffers = state.allBuffers\n    doWrite(stream, state, true, state.length, chunks, '', callback)\n    resetBuffer(state)\n  } else {\n    do {\n      const { chunk, encoding, callback } = buffered[i]\n      buffered[i++] = null\n      const len = objectMode ? 1 : chunk.length\n      doWrite(stream, state, false, len, chunk, encoding, callback)\n    } while (i < buffered.length && !state.writing)\n    if (i === buffered.length) {\n      resetBuffer(state)\n    } else if (i > 256) {\n      buffered.splice(0, i)\n      state.bufferedIndex = 0\n    } else {\n      state.bufferedIndex = i\n    }\n  }\n  state.bufferProcessing = false\n}\nWritable.prototype._write = function (chunk, encoding, cb) {\n  if (this._writev) {\n    this._writev(\n      [\n        {\n          chunk,\n          encoding\n        }\n      ],\n      cb\n    )\n  } else {\n    throw new ERR_METHOD_NOT_IMPLEMENTED('_write()')\n  }\n}\nWritable.prototype._writev = null\nWritable.prototype.end = function (chunk, encoding, cb) {\n  const state = this._writableState\n  if (typeof chunk === 'function') {\n    cb = chunk\n    chunk = null\n    encoding = null\n  } else if (typeof encoding === 'function') {\n    cb = encoding\n    encoding = null\n  }\n  let err\n  if (chunk !== null && chunk !== undefined) {\n    const ret = _write(this, chunk, encoding)\n    if (ret instanceof Error) {\n      err = ret\n    }\n  }\n\n  // .end() fully uncorks.\n  if (state.corked) {\n    state.corked = 1\n    this.uncork()\n  }\n  if (err) {\n    // Do nothing...\n  } else if (!state.errored && !state.ending) {\n    // This is forgiving in terms of unnecessary calls to end() and can hide\n    // logic errors. However, usually such errors are harmless and causing a\n    // hard error can be disproportionately destructive. It is not always\n    // trivial for the user to determine whether end() needs to be called\n    // or not.\n\n    state.ending = true\n    finishMaybe(this, state, true)\n    state.ended = true\n  } else if (state.finished) {\n    err = new ERR_STREAM_ALREADY_FINISHED('end')\n  } else if (state.destroyed) {\n    err = new ERR_STREAM_DESTROYED('end')\n  }\n  if (typeof cb === 'function') {\n    if (err || state.finished) {\n      process.nextTick(cb, err)\n    } else {\n      state[kOnFinished].push(cb)\n    }\n  }\n  return this\n}\nfunction needFinish(state) {\n  return (\n    state.ending &&\n    !state.destroyed &&\n    state.constructed &&\n    state.length === 0 &&\n    !state.errored &&\n    state.buffered.length === 0 &&\n    !state.finished &&\n    !state.writing &&\n    !state.errorEmitted &&\n    !state.closeEmitted\n  )\n}\nfunction callFinal(stream, state) {\n  let called = false\n  function onFinish(err) {\n    if (called) {\n      errorOrDestroy(stream, err !== null && err !== undefined ? err : ERR_MULTIPLE_CALLBACK())\n      return\n    }\n    called = true\n    state.pendingcb--\n    if (err) {\n      const onfinishCallbacks = state[kOnFinished].splice(0)\n      for (let i = 0; i < onfinishCallbacks.length; i++) {\n        onfinishCallbacks[i](err)\n      }\n      errorOrDestroy(stream, err, state.sync)\n    } else if (needFinish(state)) {\n      state.prefinished = true\n      stream.emit('prefinish')\n      // Backwards compat. Don't check state.sync here.\n      // Some streams assume 'finish' will be emitted\n      // asynchronously relative to _final callback.\n      state.pendingcb++\n      process.nextTick(finish, stream, state)\n    }\n  }\n  state.sync = true\n  state.pendingcb++\n  try {\n    stream._final(onFinish)\n  } catch (err) {\n    onFinish(err)\n  }\n  state.sync = false\n}\nfunction prefinish(stream, state) {\n  if (!state.prefinished && !state.finalCalled) {\n    if (typeof stream._final === 'function' && !state.destroyed) {\n      state.finalCalled = true\n      callFinal(stream, state)\n    } else {\n      state.prefinished = true\n      stream.emit('prefinish')\n    }\n  }\n}\nfunction finishMaybe(stream, state, sync) {\n  if (needFinish(state)) {\n    prefinish(stream, state)\n    if (state.pendingcb === 0) {\n      if (sync) {\n        state.pendingcb++\n        process.nextTick(\n          (stream, state) => {\n            if (needFinish(state)) {\n              finish(stream, state)\n            } else {\n              state.pendingcb--\n            }\n          },\n          stream,\n          state\n        )\n      } else if (needFinish(state)) {\n        state.pendingcb++\n        finish(stream, state)\n      }\n    }\n  }\n}\nfunction finish(stream, state) {\n  state.pendingcb--\n  state.finished = true\n  const onfinishCallbacks = state[kOnFinished].splice(0)\n  for (let i = 0; i < onfinishCallbacks.length; i++) {\n    onfinishCallbacks[i]()\n  }\n  stream.emit('finish')\n  if (state.autoDestroy) {\n    // In case of duplex streams we need a way to detect\n    // if the readable side is ready for autoDestroy as well.\n    const rState = stream._readableState\n    const autoDestroy =\n      !rState ||\n      (rState.autoDestroy &&\n        // We don't expect the readable to ever 'end'\n        // if readable is explicitly set to false.\n        (rState.endEmitted || rState.readable === false))\n    if (autoDestroy) {\n      stream.destroy()\n    }\n  }\n}\nObjectDefineProperties(Writable.prototype, {\n  closed: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.closed : false\n    }\n  },\n  destroyed: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.destroyed : false\n    },\n    set(value) {\n      // Backward compatibility, the user is explicitly managing destroyed.\n      if (this._writableState) {\n        this._writableState.destroyed = value\n      }\n    }\n  },\n  writable: {\n    __proto__: null,\n    get() {\n      const w = this._writableState\n      // w.writable === false means that this is part of a Duplex stream\n      // where the writable side was disabled upon construction.\n      // Compat. The user might manually disable writable side through\n      // deprecated setter.\n      return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended\n    },\n    set(val) {\n      // Backwards compatible.\n      if (this._writableState) {\n        this._writableState.writable = !!val\n      }\n    }\n  },\n  writableFinished: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.finished : false\n    }\n  },\n  writableObjectMode: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.objectMode : false\n    }\n  },\n  writableBuffer: {\n    __proto__: null,\n    get() {\n      return this._writableState && this._writableState.getBuffer()\n    }\n  },\n  writableEnded: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.ending : false\n    }\n  },\n  writableNeedDrain: {\n    __proto__: null,\n    get() {\n      const wState = this._writableState\n      if (!wState) return false\n      return !wState.destroyed && !wState.ending && wState.needDrain\n    }\n  },\n  writableHighWaterMark: {\n    __proto__: null,\n    get() {\n      return this._writableState && this._writableState.highWaterMark\n    }\n  },\n  writableCorked: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.corked : 0\n    }\n  },\n  writableLength: {\n    __proto__: null,\n    get() {\n      return this._writableState && this._writableState.length\n    }\n  },\n  errored: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._writableState ? this._writableState.errored : null\n    }\n  },\n  writableAborted: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return !!(\n        this._writableState.writable !== false &&\n        (this._writableState.destroyed || this._writableState.errored) &&\n        !this._writableState.finished\n      )\n    }\n  }\n})\nconst destroy = destroyImpl.destroy\nWritable.prototype.destroy = function (err, cb) {\n  const state = this._writableState\n\n  // Invoke pending callbacks.\n  if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length)) {\n    process.nextTick(errorBuffer, state)\n  }\n  destroy.call(this, err, cb)\n  return this\n}\nWritable.prototype._undestroy = destroyImpl.undestroy\nWritable.prototype._destroy = function (err, cb) {\n  cb(err)\n}\nWritable.prototype[EE.captureRejectionSymbol] = function (err) {\n  this.destroy(err)\n}\nlet webStreamsAdapters\n\n// Lazy to avoid circular references\nfunction lazyWebStreams() {\n  if (webStreamsAdapters === undefined) webStreamsAdapters = {}\n  return webStreamsAdapters\n}\nWritable.fromWeb = function (writableStream, options) {\n  return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options)\n}\nWritable.toWeb = function (streamWritable) {\n  return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable)\n}\n","/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\n;('use strict')\nconst bufferModule = require('buffer')\nconst {\n  isReadable,\n  isWritable,\n  isIterable,\n  isNodeStream,\n  isReadableNodeStream,\n  isWritableNodeStream,\n  isDuplexNodeStream,\n  isReadableStream,\n  isWritableStream\n} = require('./utils')\nconst eos = require('./end-of-stream')\nconst {\n  AbortError,\n  codes: { ERR_INVALID_ARG_TYPE, ERR_INVALID_RETURN_VALUE }\n} = require('../../ours/errors')\nconst { destroyer } = require('./destroy')\nconst Duplex = require('./duplex')\nconst Readable = require('./readable')\nconst Writable = require('./writable')\nconst { createDeferredPromise } = require('../../ours/util')\nconst from = require('./from')\nconst Blob = globalThis.Blob || bufferModule.Blob\nconst isBlob =\n  typeof Blob !== 'undefined'\n    ? function isBlob(b) {\n        return b instanceof Blob\n      }\n    : function isBlob(b) {\n        return false\n      }\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nconst { FunctionPrototypeCall } = require('../../ours/primordials')\n\n// This is needed for pre node 17.\nclass Duplexify extends Duplex {\n  constructor(options) {\n    super(options)\n\n    // https://github.com/nodejs/node/pull/34385\n\n    if ((options === null || options === undefined ? undefined : options.readable) === false) {\n      this._readableState.readable = false\n      this._readableState.ended = true\n      this._readableState.endEmitted = true\n    }\n    if ((options === null || options === undefined ? undefined : options.writable) === false) {\n      this._writableState.writable = false\n      this._writableState.ending = true\n      this._writableState.ended = true\n      this._writableState.finished = true\n    }\n  }\n}\nmodule.exports = function duplexify(body, name) {\n  if (isDuplexNodeStream(body)) {\n    return body\n  }\n  if (isReadableNodeStream(body)) {\n    return _duplexify({\n      readable: body\n    })\n  }\n  if (isWritableNodeStream(body)) {\n    return _duplexify({\n      writable: body\n    })\n  }\n  if (isNodeStream(body)) {\n    return _duplexify({\n      writable: false,\n      readable: false\n    })\n  }\n  if (isReadableStream(body)) {\n    return _duplexify({\n      readable: Readable.fromWeb(body)\n    })\n  }\n  if (isWritableStream(body)) {\n    return _duplexify({\n      writable: Writable.fromWeb(body)\n    })\n  }\n  if (typeof body === 'function') {\n    const { value, write, final, destroy } = fromAsyncGen(body)\n    if (isIterable(value)) {\n      return from(Duplexify, value, {\n        // TODO (ronag): highWaterMark?\n        objectMode: true,\n        write,\n        final,\n        destroy\n      })\n    }\n    const then = value === null || value === undefined ? undefined : value.then\n    if (typeof then === 'function') {\n      let d\n      const promise = FunctionPrototypeCall(\n        then,\n        value,\n        (val) => {\n          if (val != null) {\n            throw new ERR_INVALID_RETURN_VALUE('nully', 'body', val)\n          }\n        },\n        (err) => {\n          destroyer(d, err)\n        }\n      )\n      return (d = new Duplexify({\n        // TODO (ronag): highWaterMark?\n        objectMode: true,\n        readable: false,\n        write,\n        final(cb) {\n          final(async () => {\n            try {\n              await promise\n              process.nextTick(cb, null)\n            } catch (err) {\n              process.nextTick(cb, err)\n            }\n          })\n        },\n        destroy\n      }))\n    }\n    throw new ERR_INVALID_RETURN_VALUE('Iterable, AsyncIterable or AsyncFunction', name, value)\n  }\n  if (isBlob(body)) {\n    return duplexify(body.arrayBuffer())\n  }\n  if (isIterable(body)) {\n    return from(Duplexify, body, {\n      // TODO (ronag): highWaterMark?\n      objectMode: true,\n      writable: false\n    })\n  }\n  if (\n    isReadableStream(body === null || body === undefined ? undefined : body.readable) &&\n    isWritableStream(body === null || body === undefined ? undefined : body.writable)\n  ) {\n    return Duplexify.fromWeb(body)\n  }\n  if (\n    typeof (body === null || body === undefined ? undefined : body.writable) === 'object' ||\n    typeof (body === null || body === undefined ? undefined : body.readable) === 'object'\n  ) {\n    const readable =\n      body !== null && body !== undefined && body.readable\n        ? isReadableNodeStream(body === null || body === undefined ? undefined : body.readable)\n          ? body === null || body === undefined\n            ? undefined\n            : body.readable\n          : duplexify(body.readable)\n        : undefined\n    const writable =\n      body !== null && body !== undefined && body.writable\n        ? isWritableNodeStream(body === null || body === undefined ? undefined : body.writable)\n          ? body === null || body === undefined\n            ? undefined\n            : body.writable\n          : duplexify(body.writable)\n        : undefined\n    return _duplexify({\n      readable,\n      writable\n    })\n  }\n  const then = body === null || body === undefined ? undefined : body.then\n  if (typeof then === 'function') {\n    let d\n    FunctionPrototypeCall(\n      then,\n      body,\n      (val) => {\n        if (val != null) {\n          d.push(val)\n        }\n        d.push(null)\n      },\n      (err) => {\n        destroyer(d, err)\n      }\n    )\n    return (d = new Duplexify({\n      objectMode: true,\n      writable: false,\n      read() {}\n    }))\n  }\n  throw new ERR_INVALID_ARG_TYPE(\n    name,\n    [\n      'Blob',\n      'ReadableStream',\n      'WritableStream',\n      'Stream',\n      'Iterable',\n      'AsyncIterable',\n      'Function',\n      '{ readable, writable } pair',\n      'Promise'\n    ],\n    body\n  )\n}\nfunction fromAsyncGen(fn) {\n  let { promise, resolve } = createDeferredPromise()\n  const ac = new AbortController()\n  const signal = ac.signal\n  const value = fn(\n    (async function* () {\n      while (true) {\n        const _promise = promise\n        promise = null\n        const { chunk, done, cb } = await _promise\n        process.nextTick(cb)\n        if (done) return\n        if (signal.aborted)\n          throw new AbortError(undefined, {\n            cause: signal.reason\n          })\n        ;({ promise, resolve } = createDeferredPromise())\n        yield chunk\n      }\n    })(),\n    {\n      signal\n    }\n  )\n  return {\n    value,\n    write(chunk, encoding, cb) {\n      const _resolve = resolve\n      resolve = null\n      _resolve({\n        chunk,\n        done: false,\n        cb\n      })\n    },\n    final(cb) {\n      const _resolve = resolve\n      resolve = null\n      _resolve({\n        done: true,\n        cb\n      })\n    },\n    destroy(err, cb) {\n      ac.abort()\n      cb(err)\n    }\n  }\n}\nfunction _duplexify(pair) {\n  const r = pair.readable && typeof pair.readable.read !== 'function' ? Readable.wrap(pair.readable) : pair.readable\n  const w = pair.writable\n  let readable = !!isReadable(r)\n  let writable = !!isWritable(w)\n  let ondrain\n  let onfinish\n  let onreadable\n  let onclose\n  let d\n  function onfinished(err) {\n    const cb = onclose\n    onclose = null\n    if (cb) {\n      cb(err)\n    } else if (err) {\n      d.destroy(err)\n    }\n  }\n\n  // TODO(ronag): Avoid double buffering.\n  // Implement Writable/Readable/Duplex traits.\n  // See, https://github.com/nodejs/node/pull/33515.\n  d = new Duplexify({\n    // TODO (ronag): highWaterMark?\n    readableObjectMode: !!(r !== null && r !== undefined && r.readableObjectMode),\n    writableObjectMode: !!(w !== null && w !== undefined && w.writableObjectMode),\n    readable,\n    writable\n  })\n  if (writable) {\n    eos(w, (err) => {\n      writable = false\n      if (err) {\n        destroyer(r, err)\n      }\n      onfinished(err)\n    })\n    d._write = function (chunk, encoding, callback) {\n      if (w.write(chunk, encoding)) {\n        callback()\n      } else {\n        ondrain = callback\n      }\n    }\n    d._final = function (callback) {\n      w.end()\n      onfinish = callback\n    }\n    w.on('drain', function () {\n      if (ondrain) {\n        const cb = ondrain\n        ondrain = null\n        cb()\n      }\n    })\n    w.on('finish', function () {\n      if (onfinish) {\n        const cb = onfinish\n        onfinish = null\n        cb()\n      }\n    })\n  }\n  if (readable) {\n    eos(r, (err) => {\n      readable = false\n      if (err) {\n        destroyer(r, err)\n      }\n      onfinished(err)\n    })\n    r.on('readable', function () {\n      if (onreadable) {\n        const cb = onreadable\n        onreadable = null\n        cb()\n      }\n    })\n    r.on('end', function () {\n      d.push(null)\n    })\n    d._read = function () {\n      while (true) {\n        const buf = r.read()\n        if (buf === null) {\n          onreadable = d._read\n          return\n        }\n        if (!d.push(buf)) {\n          return\n        }\n      }\n    }\n  }\n  d._destroy = function (err, callback) {\n    if (!err && onclose !== null) {\n      err = new AbortError()\n    }\n    onreadable = null\n    ondrain = null\n    onfinish = null\n    if (onclose === null) {\n      callback(err)\n    } else {\n      onclose = callback\n      destroyer(w, err)\n      destroyer(r, err)\n    }\n  }\n  return d\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototype inheritance, this class\n// prototypically inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict'\n\nconst {\n  ObjectDefineProperties,\n  ObjectGetOwnPropertyDescriptor,\n  ObjectKeys,\n  ObjectSetPrototypeOf\n} = require('../../ours/primordials')\nmodule.exports = Duplex\nconst Readable = require('./readable')\nconst Writable = require('./writable')\nObjectSetPrototypeOf(Duplex.prototype, Readable.prototype)\nObjectSetPrototypeOf(Duplex, Readable)\n{\n  const keys = ObjectKeys(Writable.prototype)\n  // Allow the keys array to be GC'ed.\n  for (let i = 0; i < keys.length; i++) {\n    const method = keys[i]\n    if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]\n  }\n}\nfunction Duplex(options) {\n  if (!(this instanceof Duplex)) return new Duplex(options)\n  Readable.call(this, options)\n  Writable.call(this, options)\n  if (options) {\n    this.allowHalfOpen = options.allowHalfOpen !== false\n    if (options.readable === false) {\n      this._readableState.readable = false\n      this._readableState.ended = true\n      this._readableState.endEmitted = true\n    }\n    if (options.writable === false) {\n      this._writableState.writable = false\n      this._writableState.ending = true\n      this._writableState.ended = true\n      this._writableState.finished = true\n    }\n  } else {\n    this.allowHalfOpen = true\n  }\n}\nObjectDefineProperties(Duplex.prototype, {\n  writable: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writable')\n  },\n  writableHighWaterMark: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableHighWaterMark')\n  },\n  writableObjectMode: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableObjectMode')\n  },\n  writableBuffer: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableBuffer')\n  },\n  writableLength: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableLength')\n  },\n  writableFinished: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableFinished')\n  },\n  writableCorked: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableCorked')\n  },\n  writableEnded: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableEnded')\n  },\n  writableNeedDrain: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableNeedDrain')\n  },\n  destroyed: {\n    __proto__: null,\n    get() {\n      if (this._readableState === undefined || this._writableState === undefined) {\n        return false\n      }\n      return this._readableState.destroyed && this._writableState.destroyed\n    },\n    set(value) {\n      // Backward compatibility, the user is explicitly\n      // managing destroyed.\n      if (this._readableState && this._writableState) {\n        this._readableState.destroyed = value\n        this._writableState.destroyed = value\n      }\n    }\n  }\n})\nlet webStreamsAdapters\n\n// Lazy to avoid circular references\nfunction lazyWebStreams() {\n  if (webStreamsAdapters === undefined) webStreamsAdapters = {}\n  return webStreamsAdapters\n}\nDuplex.fromWeb = function (pair, options) {\n  return lazyWebStreams().newStreamDuplexFromReadableWritablePair(pair, options)\n}\nDuplex.toWeb = function (duplex) {\n  return lazyWebStreams().newReadableWritablePairFromDuplex(duplex)\n}\nlet duplexify\nDuplex.from = function (body) {\n  if (!duplexify) {\n    duplexify = require('./duplexify')\n  }\n  return duplexify(body, 'body')\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data.  Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored.  (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation.  For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes.  When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up.  When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer.  When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks.  If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk.  However,\n// a pathological inflate type of transform can cause excessive buffering\n// here.  For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output.  Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output.  In this case, you could write a very small\n// amount of input, and end up with a very large amount of output.  In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform.  A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict'\n\nconst { ObjectSetPrototypeOf, Symbol } = require('../../ours/primordials')\nmodule.exports = Transform\nconst { ERR_METHOD_NOT_IMPLEMENTED } = require('../../ours/errors').codes\nconst Duplex = require('./duplex')\nconst { getHighWaterMark } = require('./state')\nObjectSetPrototypeOf(Transform.prototype, Duplex.prototype)\nObjectSetPrototypeOf(Transform, Duplex)\nconst kCallback = Symbol('kCallback')\nfunction Transform(options) {\n  if (!(this instanceof Transform)) return new Transform(options)\n\n  // TODO (ronag): This should preferably always be\n  // applied but would be semver-major. Or even better;\n  // make Transform a Readable with the Writable interface.\n  const readableHighWaterMark = options ? getHighWaterMark(this, options, 'readableHighWaterMark', true) : null\n  if (readableHighWaterMark === 0) {\n    // A Duplex will buffer both on the writable and readable side while\n    // a Transform just wants to buffer hwm number of elements. To avoid\n    // buffering twice we disable buffering on the writable side.\n    options = {\n      ...options,\n      highWaterMark: null,\n      readableHighWaterMark,\n      // TODO (ronag): 0 is not optimal since we have\n      // a \"bug\" where we check needDrain before calling _write and not after.\n      // Refs: https://github.com/nodejs/node/pull/32887\n      // Refs: https://github.com/nodejs/node/pull/35941\n      writableHighWaterMark: options.writableHighWaterMark || 0\n    }\n  }\n  Duplex.call(this, options)\n\n  // We have implemented the _read method, and done the other things\n  // that Readable wants before the first _read call, so unset the\n  // sync guard flag.\n  this._readableState.sync = false\n  this[kCallback] = null\n  if (options) {\n    if (typeof options.transform === 'function') this._transform = options.transform\n    if (typeof options.flush === 'function') this._flush = options.flush\n  }\n\n  // When the writable side finishes, then flush out anything remaining.\n  // Backwards compat. Some Transform streams incorrectly implement _final\n  // instead of or in addition to _flush. By using 'prefinish' instead of\n  // implementing _final we continue supporting this unfortunate use case.\n  this.on('prefinish', prefinish)\n}\nfunction final(cb) {\n  if (typeof this._flush === 'function' && !this.destroyed) {\n    this._flush((er, data) => {\n      if (er) {\n        if (cb) {\n          cb(er)\n        } else {\n          this.destroy(er)\n        }\n        return\n      }\n      if (data != null) {\n        this.push(data)\n      }\n      this.push(null)\n      if (cb) {\n        cb()\n      }\n    })\n  } else {\n    this.push(null)\n    if (cb) {\n      cb()\n    }\n  }\n}\nfunction prefinish() {\n  if (this._final !== final) {\n    final.call(this)\n  }\n}\nTransform.prototype._final = final\nTransform.prototype._transform = function (chunk, encoding, callback) {\n  throw new ERR_METHOD_NOT_IMPLEMENTED('_transform()')\n}\nTransform.prototype._write = function (chunk, encoding, callback) {\n  const rState = this._readableState\n  const wState = this._writableState\n  const length = rState.length\n  this._transform(chunk, encoding, (err, val) => {\n    if (err) {\n      callback(err)\n      return\n    }\n    if (val != null) {\n      this.push(val)\n    }\n    if (\n      wState.ended ||\n      // Backwards compat.\n      length === rState.length ||\n      // Backwards compat.\n      rState.length < rState.highWaterMark\n    ) {\n      callback()\n    } else {\n      this[kCallback] = callback\n    }\n  })\n}\nTransform.prototype._read = function () {\n  if (this[kCallback]) {\n    const callback = this[kCallback]\n    this[kCallback] = null\n    callback()\n  }\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict'\n\nconst { ObjectSetPrototypeOf } = require('../../ours/primordials')\nmodule.exports = PassThrough\nconst Transform = require('./transform')\nObjectSetPrototypeOf(PassThrough.prototype, Transform.prototype)\nObjectSetPrototypeOf(PassThrough, Transform)\nfunction PassThrough(options) {\n  if (!(this instanceof PassThrough)) return new PassThrough(options)\n  Transform.call(this, options)\n}\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n  cb(null, chunk)\n}\n","/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n// Ported from https://github.com/mafintosh/pump with\n// permission from the author, Mathias Buus (@mafintosh).\n\n;('use strict')\nconst { ArrayIsArray, Promise, SymbolAsyncIterator, SymbolDispose } = require('../../ours/primordials')\nconst eos = require('./end-of-stream')\nconst { once } = require('../../ours/util')\nconst destroyImpl = require('./destroy')\nconst Duplex = require('./duplex')\nconst {\n  aggregateTwoErrors,\n  codes: {\n    ERR_INVALID_ARG_TYPE,\n    ERR_INVALID_RETURN_VALUE,\n    ERR_MISSING_ARGS,\n    ERR_STREAM_DESTROYED,\n    ERR_STREAM_PREMATURE_CLOSE\n  },\n  AbortError\n} = require('../../ours/errors')\nconst { validateFunction, validateAbortSignal } = require('../validators')\nconst {\n  isIterable,\n  isReadable,\n  isReadableNodeStream,\n  isNodeStream,\n  isTransformStream,\n  isWebStream,\n  isReadableStream,\n  isReadableFinished\n} = require('./utils')\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nlet PassThrough\nlet Readable\nlet addAbortListener\nfunction destroyer(stream, reading, writing) {\n  let finished = false\n  stream.on('close', () => {\n    finished = true\n  })\n  const cleanup = eos(\n    stream,\n    {\n      readable: reading,\n      writable: writing\n    },\n    (err) => {\n      finished = !err\n    }\n  )\n  return {\n    destroy: (err) => {\n      if (finished) return\n      finished = true\n      destroyImpl.destroyer(stream, err || new ERR_STREAM_DESTROYED('pipe'))\n    },\n    cleanup\n  }\n}\nfunction popCallback(streams) {\n  // Streams should never be an empty array. It should always contain at least\n  // a single stream. Therefore optimize for the average case instead of\n  // checking for length === 0 as well.\n  validateFunction(streams[streams.length - 1], 'streams[stream.length - 1]')\n  return streams.pop()\n}\nfunction makeAsyncIterable(val) {\n  if (isIterable(val)) {\n    return val\n  } else if (isReadableNodeStream(val)) {\n    // Legacy streams are not Iterable.\n    return fromReadable(val)\n  }\n  throw new ERR_INVALID_ARG_TYPE('val', ['Readable', 'Iterable', 'AsyncIterable'], val)\n}\nasync function* fromReadable(val) {\n  if (!Readable) {\n    Readable = require('./readable')\n  }\n  yield* Readable.prototype[SymbolAsyncIterator].call(val)\n}\nasync function pumpToNode(iterable, writable, finish, { end }) {\n  let error\n  let onresolve = null\n  const resume = (err) => {\n    if (err) {\n      error = err\n    }\n    if (onresolve) {\n      const callback = onresolve\n      onresolve = null\n      callback()\n    }\n  }\n  const wait = () =>\n    new Promise((resolve, reject) => {\n      if (error) {\n        reject(error)\n      } else {\n        onresolve = () => {\n          if (error) {\n            reject(error)\n          } else {\n            resolve()\n          }\n        }\n      }\n    })\n  writable.on('drain', resume)\n  const cleanup = eos(\n    writable,\n    {\n      readable: false\n    },\n    resume\n  )\n  try {\n    if (writable.writableNeedDrain) {\n      await wait()\n    }\n    for await (const chunk of iterable) {\n      if (!writable.write(chunk)) {\n        await wait()\n      }\n    }\n    if (end) {\n      writable.end()\n      await wait()\n    }\n    finish()\n  } catch (err) {\n    finish(error !== err ? aggregateTwoErrors(error, err) : err)\n  } finally {\n    cleanup()\n    writable.off('drain', resume)\n  }\n}\nasync function pumpToWeb(readable, writable, finish, { end }) {\n  if (isTransformStream(writable)) {\n    writable = writable.writable\n  }\n  // https://streams.spec.whatwg.org/#example-manual-write-with-backpressure\n  const writer = writable.getWriter()\n  try {\n    for await (const chunk of readable) {\n      await writer.ready\n      writer.write(chunk).catch(() => {})\n    }\n    await writer.ready\n    if (end) {\n      await writer.close()\n    }\n    finish()\n  } catch (err) {\n    try {\n      await writer.abort(err)\n      finish(err)\n    } catch (err) {\n      finish(err)\n    }\n  }\n}\nfunction pipeline(...streams) {\n  return pipelineImpl(streams, once(popCallback(streams)))\n}\nfunction pipelineImpl(streams, callback, opts) {\n  if (streams.length === 1 && ArrayIsArray(streams[0])) {\n    streams = streams[0]\n  }\n  if (streams.length < 2) {\n    throw new ERR_MISSING_ARGS('streams')\n  }\n  const ac = new AbortController()\n  const signal = ac.signal\n  const outerSignal = opts === null || opts === undefined ? undefined : opts.signal\n\n  // Need to cleanup event listeners if last stream is readable\n  // https://github.com/nodejs/node/issues/35452\n  const lastStreamCleanup = []\n  validateAbortSignal(outerSignal, 'options.signal')\n  function abort() {\n    finishImpl(new AbortError())\n  }\n  addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n  let disposable\n  if (outerSignal) {\n    disposable = addAbortListener(outerSignal, abort)\n  }\n  let error\n  let value\n  const destroys = []\n  let finishCount = 0\n  function finish(err) {\n    finishImpl(err, --finishCount === 0)\n  }\n  function finishImpl(err, final) {\n    var _disposable\n    if (err && (!error || error.code === 'ERR_STREAM_PREMATURE_CLOSE')) {\n      error = err\n    }\n    if (!error && !final) {\n      return\n    }\n    while (destroys.length) {\n      destroys.shift()(error)\n    }\n    ;(_disposable = disposable) === null || _disposable === undefined ? undefined : _disposable[SymbolDispose]()\n    ac.abort()\n    if (final) {\n      if (!error) {\n        lastStreamCleanup.forEach((fn) => fn())\n      }\n      process.nextTick(callback, error, value)\n    }\n  }\n  let ret\n  for (let i = 0; i < streams.length; i++) {\n    const stream = streams[i]\n    const reading = i < streams.length - 1\n    const writing = i > 0\n    const end = reading || (opts === null || opts === undefined ? undefined : opts.end) !== false\n    const isLastStream = i === streams.length - 1\n    if (isNodeStream(stream)) {\n      if (end) {\n        const { destroy, cleanup } = destroyer(stream, reading, writing)\n        destroys.push(destroy)\n        if (isReadable(stream) && isLastStream) {\n          lastStreamCleanup.push(cleanup)\n        }\n      }\n\n      // Catch stream errors that occur after pipe/pump has completed.\n      function onError(err) {\n        if (err && err.name !== 'AbortError' && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {\n          finish(err)\n        }\n      }\n      stream.on('error', onError)\n      if (isReadable(stream) && isLastStream) {\n        lastStreamCleanup.push(() => {\n          stream.removeListener('error', onError)\n        })\n      }\n    }\n    if (i === 0) {\n      if (typeof stream === 'function') {\n        ret = stream({\n          signal\n        })\n        if (!isIterable(ret)) {\n          throw new ERR_INVALID_RETURN_VALUE('Iterable, AsyncIterable or Stream', 'source', ret)\n        }\n      } else if (isIterable(stream) || isReadableNodeStream(stream) || isTransformStream(stream)) {\n        ret = stream\n      } else {\n        ret = Duplex.from(stream)\n      }\n    } else if (typeof stream === 'function') {\n      if (isTransformStream(ret)) {\n        var _ret\n        ret = makeAsyncIterable((_ret = ret) === null || _ret === undefined ? undefined : _ret.readable)\n      } else {\n        ret = makeAsyncIterable(ret)\n      }\n      ret = stream(ret, {\n        signal\n      })\n      if (reading) {\n        if (!isIterable(ret, true)) {\n          throw new ERR_INVALID_RETURN_VALUE('AsyncIterable', `transform[${i - 1}]`, ret)\n        }\n      } else {\n        var _ret2\n        if (!PassThrough) {\n          PassThrough = require('./passthrough')\n        }\n\n        // If the last argument to pipeline is not a stream\n        // we must create a proxy stream so that pipeline(...)\n        // always returns a stream which can be further\n        // composed through `.pipe(stream)`.\n\n        const pt = new PassThrough({\n          objectMode: true\n        })\n\n        // Handle Promises/A+ spec, `then` could be a getter that throws on\n        // second use.\n        const then = (_ret2 = ret) === null || _ret2 === undefined ? undefined : _ret2.then\n        if (typeof then === 'function') {\n          finishCount++\n          then.call(\n            ret,\n            (val) => {\n              value = val\n              if (val != null) {\n                pt.write(val)\n              }\n              if (end) {\n                pt.end()\n              }\n              process.nextTick(finish)\n            },\n            (err) => {\n              pt.destroy(err)\n              process.nextTick(finish, err)\n            }\n          )\n        } else if (isIterable(ret, true)) {\n          finishCount++\n          pumpToNode(ret, pt, finish, {\n            end\n          })\n        } else if (isReadableStream(ret) || isTransformStream(ret)) {\n          const toRead = ret.readable || ret\n          finishCount++\n          pumpToNode(toRead, pt, finish, {\n            end\n          })\n        } else {\n          throw new ERR_INVALID_RETURN_VALUE('AsyncIterable or Promise', 'destination', ret)\n        }\n        ret = pt\n        const { destroy, cleanup } = destroyer(ret, false, true)\n        destroys.push(destroy)\n        if (isLastStream) {\n          lastStreamCleanup.push(cleanup)\n        }\n      }\n    } else if (isNodeStream(stream)) {\n      if (isReadableNodeStream(ret)) {\n        finishCount += 2\n        const cleanup = pipe(ret, stream, finish, {\n          end\n        })\n        if (isReadable(stream) && isLastStream) {\n          lastStreamCleanup.push(cleanup)\n        }\n      } else if (isTransformStream(ret) || isReadableStream(ret)) {\n        const toRead = ret.readable || ret\n        finishCount++\n        pumpToNode(toRead, stream, finish, {\n          end\n        })\n      } else if (isIterable(ret)) {\n        finishCount++\n        pumpToNode(ret, stream, finish, {\n          end\n        })\n      } else {\n        throw new ERR_INVALID_ARG_TYPE(\n          'val',\n          ['Readable', 'Iterable', 'AsyncIterable', 'ReadableStream', 'TransformStream'],\n          ret\n        )\n      }\n      ret = stream\n    } else if (isWebStream(stream)) {\n      if (isReadableNodeStream(ret)) {\n        finishCount++\n        pumpToWeb(makeAsyncIterable(ret), stream, finish, {\n          end\n        })\n      } else if (isReadableStream(ret) || isIterable(ret)) {\n        finishCount++\n        pumpToWeb(ret, stream, finish, {\n          end\n        })\n      } else if (isTransformStream(ret)) {\n        finishCount++\n        pumpToWeb(ret.readable, stream, finish, {\n          end\n        })\n      } else {\n        throw new ERR_INVALID_ARG_TYPE(\n          'val',\n          ['Readable', 'Iterable', 'AsyncIterable', 'ReadableStream', 'TransformStream'],\n          ret\n        )\n      }\n      ret = stream\n    } else {\n      ret = Duplex.from(stream)\n    }\n  }\n  if (\n    (signal !== null && signal !== undefined && signal.aborted) ||\n    (outerSignal !== null && outerSignal !== undefined && outerSignal.aborted)\n  ) {\n    process.nextTick(abort)\n  }\n  return ret\n}\nfunction pipe(src, dst, finish, { end }) {\n  let ended = false\n  dst.on('close', () => {\n    if (!ended) {\n      // Finish if the destination closes before the source has completed.\n      finish(new ERR_STREAM_PREMATURE_CLOSE())\n    }\n  })\n  src.pipe(dst, {\n    end: false\n  }) // If end is true we already will have a listener to end dst.\n\n  if (end) {\n    // Compat. Before node v10.12.0 stdio used to throw an error so\n    // pipe() did/does not end() stdio destinations.\n    // Now they allow it but \"secretly\" don't close the underlying fd.\n\n    function endFn() {\n      ended = true\n      dst.end()\n    }\n    if (isReadableFinished(src)) {\n      // End the destination if the source has already ended.\n      process.nextTick(endFn)\n    } else {\n      src.once('end', endFn)\n    }\n  } else {\n    finish()\n  }\n  eos(\n    src,\n    {\n      readable: true,\n      writable: false\n    },\n    (err) => {\n      const rState = src._readableState\n      if (\n        err &&\n        err.code === 'ERR_STREAM_PREMATURE_CLOSE' &&\n        rState &&\n        rState.ended &&\n        !rState.errored &&\n        !rState.errorEmitted\n      ) {\n        // Some readable streams will emit 'close' before 'end'. However, since\n        // this is on the readable side 'end' should still be emitted if the\n        // stream has been ended and no error emitted. This should be allowed in\n        // favor of backwards compatibility. Since the stream is piped to a\n        // destination this should not result in any observable difference.\n        // We don't need to check if this is a writable premature close since\n        // eos will only fail with premature close on the reading side for\n        // duplex streams.\n        src.once('end', finish).once('error', finish)\n      } else {\n        finish(err)\n      }\n    }\n  )\n  return eos(\n    dst,\n    {\n      readable: false,\n      writable: true\n    },\n    finish\n  )\n}\nmodule.exports = {\n  pipelineImpl,\n  pipeline\n}\n","'use strict'\n\nconst { pipeline } = require('./pipeline')\nconst Duplex = require('./duplex')\nconst { destroyer } = require('./destroy')\nconst {\n  isNodeStream,\n  isReadable,\n  isWritable,\n  isWebStream,\n  isTransformStream,\n  isWritableStream,\n  isReadableStream\n} = require('./utils')\nconst {\n  AbortError,\n  codes: { ERR_INVALID_ARG_VALUE, ERR_MISSING_ARGS }\n} = require('../../ours/errors')\nconst eos = require('./end-of-stream')\nmodule.exports = function compose(...streams) {\n  if (streams.length === 0) {\n    throw new ERR_MISSING_ARGS('streams')\n  }\n  if (streams.length === 1) {\n    return Duplex.from(streams[0])\n  }\n  const orgStreams = [...streams]\n  if (typeof streams[0] === 'function') {\n    streams[0] = Duplex.from(streams[0])\n  }\n  if (typeof streams[streams.length - 1] === 'function') {\n    const idx = streams.length - 1\n    streams[idx] = Duplex.from(streams[idx])\n  }\n  for (let n = 0; n < streams.length; ++n) {\n    if (!isNodeStream(streams[n]) && !isWebStream(streams[n])) {\n      // TODO(ronag): Add checks for non streams.\n      continue\n    }\n    if (\n      n < streams.length - 1 &&\n      !(isReadable(streams[n]) || isReadableStream(streams[n]) || isTransformStream(streams[n]))\n    ) {\n      throw new ERR_INVALID_ARG_VALUE(`streams[${n}]`, orgStreams[n], 'must be readable')\n    }\n    if (n > 0 && !(isWritable(streams[n]) || isWritableStream(streams[n]) || isTransformStream(streams[n]))) {\n      throw new ERR_INVALID_ARG_VALUE(`streams[${n}]`, orgStreams[n], 'must be writable')\n    }\n  }\n  let ondrain\n  let onfinish\n  let onreadable\n  let onclose\n  let d\n  function onfinished(err) {\n    const cb = onclose\n    onclose = null\n    if (cb) {\n      cb(err)\n    } else if (err) {\n      d.destroy(err)\n    } else if (!readable && !writable) {\n      d.destroy()\n    }\n  }\n  const head = streams[0]\n  const tail = pipeline(streams, onfinished)\n  const writable = !!(isWritable(head) || isWritableStream(head) || isTransformStream(head))\n  const readable = !!(isReadable(tail) || isReadableStream(tail) || isTransformStream(tail))\n\n  // TODO(ronag): Avoid double buffering.\n  // Implement Writable/Readable/Duplex traits.\n  // See, https://github.com/nodejs/node/pull/33515.\n  d = new Duplex({\n    // TODO (ronag): highWaterMark?\n    writableObjectMode: !!(head !== null && head !== undefined && head.writableObjectMode),\n    readableObjectMode: !!(tail !== null && tail !== undefined && tail.readableObjectMode),\n    writable,\n    readable\n  })\n  if (writable) {\n    if (isNodeStream(head)) {\n      d._write = function (chunk, encoding, callback) {\n        if (head.write(chunk, encoding)) {\n          callback()\n        } else {\n          ondrain = callback\n        }\n      }\n      d._final = function (callback) {\n        head.end()\n        onfinish = callback\n      }\n      head.on('drain', function () {\n        if (ondrain) {\n          const cb = ondrain\n          ondrain = null\n          cb()\n        }\n      })\n    } else if (isWebStream(head)) {\n      const writable = isTransformStream(head) ? head.writable : head\n      const writer = writable.getWriter()\n      d._write = async function (chunk, encoding, callback) {\n        try {\n          await writer.ready\n          writer.write(chunk).catch(() => {})\n          callback()\n        } catch (err) {\n          callback(err)\n        }\n      }\n      d._final = async function (callback) {\n        try {\n          await writer.ready\n          writer.close().catch(() => {})\n          onfinish = callback\n        } catch (err) {\n          callback(err)\n        }\n      }\n    }\n    const toRead = isTransformStream(tail) ? tail.readable : tail\n    eos(toRead, () => {\n      if (onfinish) {\n        const cb = onfinish\n        onfinish = null\n        cb()\n      }\n    })\n  }\n  if (readable) {\n    if (isNodeStream(tail)) {\n      tail.on('readable', function () {\n        if (onreadable) {\n          const cb = onreadable\n          onreadable = null\n          cb()\n        }\n      })\n      tail.on('end', function () {\n        d.push(null)\n      })\n      d._read = function () {\n        while (true) {\n          const buf = tail.read()\n          if (buf === null) {\n            onreadable = d._read\n            return\n          }\n          if (!d.push(buf)) {\n            return\n          }\n        }\n      }\n    } else if (isWebStream(tail)) {\n      const readable = isTransformStream(tail) ? tail.readable : tail\n      const reader = readable.getReader()\n      d._read = async function () {\n        while (true) {\n          try {\n            const { value, done } = await reader.read()\n            if (!d.push(value)) {\n              return\n            }\n            if (done) {\n              d.push(null)\n              return\n            }\n          } catch {\n            return\n          }\n        }\n      }\n    }\n  }\n  d._destroy = function (err, callback) {\n    if (!err && onclose !== null) {\n      err = new AbortError()\n    }\n    onreadable = null\n    ondrain = null\n    onfinish = null\n    if (onclose === null) {\n      callback(err)\n    } else {\n      onclose = callback\n      if (isNodeStream(tail)) {\n        destroyer(tail, err)\n      }\n    }\n  }\n  return d\n}\n","'use strict'\n\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nconst {\n  codes: { ERR_INVALID_ARG_VALUE, ERR_INVALID_ARG_TYPE, ERR_MISSING_ARGS, ERR_OUT_OF_RANGE },\n  AbortError\n} = require('../../ours/errors')\nconst { validateAbortSignal, validateInteger, validateObject } = require('../validators')\nconst kWeakHandler = require('../../ours/primordials').Symbol('kWeak')\nconst kResistStopPropagation = require('../../ours/primordials').Symbol('kResistStopPropagation')\nconst { finished } = require('./end-of-stream')\nconst staticCompose = require('./compose')\nconst { addAbortSignalNoValidate } = require('./add-abort-signal')\nconst { isWritable, isNodeStream } = require('./utils')\nconst { deprecate } = require('../../ours/util')\nconst {\n  ArrayPrototypePush,\n  Boolean,\n  MathFloor,\n  Number,\n  NumberIsNaN,\n  Promise,\n  PromiseReject,\n  PromiseResolve,\n  PromisePrototypeThen,\n  Symbol\n} = require('../../ours/primordials')\nconst kEmpty = Symbol('kEmpty')\nconst kEof = Symbol('kEof')\nfunction compose(stream, options) {\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  if (isNodeStream(stream) && !isWritable(stream)) {\n    throw new ERR_INVALID_ARG_VALUE('stream', stream, 'must be writable')\n  }\n  const composedStream = staticCompose(this, stream)\n  if (options !== null && options !== undefined && options.signal) {\n    // Not validating as we already validated before\n    addAbortSignalNoValidate(options.signal, composedStream)\n  }\n  return composedStream\n}\nfunction map(fn, options) {\n  if (typeof fn !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n  }\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  let concurrency = 1\n  if ((options === null || options === undefined ? undefined : options.concurrency) != null) {\n    concurrency = MathFloor(options.concurrency)\n  }\n  let highWaterMark = concurrency - 1\n  if ((options === null || options === undefined ? undefined : options.highWaterMark) != null) {\n    highWaterMark = MathFloor(options.highWaterMark)\n  }\n  validateInteger(concurrency, 'options.concurrency', 1)\n  validateInteger(highWaterMark, 'options.highWaterMark', 0)\n  highWaterMark += concurrency\n  return async function* map() {\n    const signal = require('../../ours/util').AbortSignalAny(\n      [options === null || options === undefined ? undefined : options.signal].filter(Boolean)\n    )\n    const stream = this\n    const queue = []\n    const signalOpt = {\n      signal\n    }\n    let next\n    let resume\n    let done = false\n    let cnt = 0\n    function onCatch() {\n      done = true\n      afterItemProcessed()\n    }\n    function afterItemProcessed() {\n      cnt -= 1\n      maybeResume()\n    }\n    function maybeResume() {\n      if (resume && !done && cnt < concurrency && queue.length < highWaterMark) {\n        resume()\n        resume = null\n      }\n    }\n    async function pump() {\n      try {\n        for await (let val of stream) {\n          if (done) {\n            return\n          }\n          if (signal.aborted) {\n            throw new AbortError()\n          }\n          try {\n            val = fn(val, signalOpt)\n            if (val === kEmpty) {\n              continue\n            }\n            val = PromiseResolve(val)\n          } catch (err) {\n            val = PromiseReject(err)\n          }\n          cnt += 1\n          PromisePrototypeThen(val, afterItemProcessed, onCatch)\n          queue.push(val)\n          if (next) {\n            next()\n            next = null\n          }\n          if (!done && (queue.length >= highWaterMark || cnt >= concurrency)) {\n            await new Promise((resolve) => {\n              resume = resolve\n            })\n          }\n        }\n        queue.push(kEof)\n      } catch (err) {\n        const val = PromiseReject(err)\n        PromisePrototypeThen(val, afterItemProcessed, onCatch)\n        queue.push(val)\n      } finally {\n        done = true\n        if (next) {\n          next()\n          next = null\n        }\n      }\n    }\n    pump()\n    try {\n      while (true) {\n        while (queue.length > 0) {\n          const val = await queue[0]\n          if (val === kEof) {\n            return\n          }\n          if (signal.aborted) {\n            throw new AbortError()\n          }\n          if (val !== kEmpty) {\n            yield val\n          }\n          queue.shift()\n          maybeResume()\n        }\n        await new Promise((resolve) => {\n          next = resolve\n        })\n      }\n    } finally {\n      done = true\n      if (resume) {\n        resume()\n        resume = null\n      }\n    }\n  }.call(this)\n}\nfunction asIndexedPairs(options = undefined) {\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  return async function* asIndexedPairs() {\n    let index = 0\n    for await (const val of this) {\n      var _options$signal\n      if (\n        options !== null &&\n        options !== undefined &&\n        (_options$signal = options.signal) !== null &&\n        _options$signal !== undefined &&\n        _options$signal.aborted\n      ) {\n        throw new AbortError({\n          cause: options.signal.reason\n        })\n      }\n      yield [index++, val]\n    }\n  }.call(this)\n}\nasync function some(fn, options = undefined) {\n  for await (const unused of filter.call(this, fn, options)) {\n    return true\n  }\n  return false\n}\nasync function every(fn, options = undefined) {\n  if (typeof fn !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n  }\n  // https://en.wikipedia.org/wiki/De_Morgan%27s_laws\n  return !(await some.call(\n    this,\n    async (...args) => {\n      return !(await fn(...args))\n    },\n    options\n  ))\n}\nasync function find(fn, options) {\n  for await (const result of filter.call(this, fn, options)) {\n    return result\n  }\n  return undefined\n}\nasync function forEach(fn, options) {\n  if (typeof fn !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n  }\n  async function forEachFn(value, options) {\n    await fn(value, options)\n    return kEmpty\n  }\n  // eslint-disable-next-line no-unused-vars\n  for await (const unused of map.call(this, forEachFn, options));\n}\nfunction filter(fn, options) {\n  if (typeof fn !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n  }\n  async function filterFn(value, options) {\n    if (await fn(value, options)) {\n      return value\n    }\n    return kEmpty\n  }\n  return map.call(this, filterFn, options)\n}\n\n// Specific to provide better error to reduce since the argument is only\n// missing if the stream has no items in it - but the code is still appropriate\nclass ReduceAwareErrMissingArgs extends ERR_MISSING_ARGS {\n  constructor() {\n    super('reduce')\n    this.message = 'Reduce of an empty stream requires an initial value'\n  }\n}\nasync function reduce(reducer, initialValue, options) {\n  var _options$signal2\n  if (typeof reducer !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE('reducer', ['Function', 'AsyncFunction'], reducer)\n  }\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  let hasInitialValue = arguments.length > 1\n  if (\n    options !== null &&\n    options !== undefined &&\n    (_options$signal2 = options.signal) !== null &&\n    _options$signal2 !== undefined &&\n    _options$signal2.aborted\n  ) {\n    const err = new AbortError(undefined, {\n      cause: options.signal.reason\n    })\n    this.once('error', () => {}) // The error is already propagated\n    await finished(this.destroy(err))\n    throw err\n  }\n  const ac = new AbortController()\n  const signal = ac.signal\n  if (options !== null && options !== undefined && options.signal) {\n    const opts = {\n      once: true,\n      [kWeakHandler]: this,\n      [kResistStopPropagation]: true\n    }\n    options.signal.addEventListener('abort', () => ac.abort(), opts)\n  }\n  let gotAnyItemFromStream = false\n  try {\n    for await (const value of this) {\n      var _options$signal3\n      gotAnyItemFromStream = true\n      if (\n        options !== null &&\n        options !== undefined &&\n        (_options$signal3 = options.signal) !== null &&\n        _options$signal3 !== undefined &&\n        _options$signal3.aborted\n      ) {\n        throw new AbortError()\n      }\n      if (!hasInitialValue) {\n        initialValue = value\n        hasInitialValue = true\n      } else {\n        initialValue = await reducer(initialValue, value, {\n          signal\n        })\n      }\n    }\n    if (!gotAnyItemFromStream && !hasInitialValue) {\n      throw new ReduceAwareErrMissingArgs()\n    }\n  } finally {\n    ac.abort()\n  }\n  return initialValue\n}\nasync function toArray(options) {\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  const result = []\n  for await (const val of this) {\n    var _options$signal4\n    if (\n      options !== null &&\n      options !== undefined &&\n      (_options$signal4 = options.signal) !== null &&\n      _options$signal4 !== undefined &&\n      _options$signal4.aborted\n    ) {\n      throw new AbortError(undefined, {\n        cause: options.signal.reason\n      })\n    }\n    ArrayPrototypePush(result, val)\n  }\n  return result\n}\nfunction flatMap(fn, options) {\n  const values = map.call(this, fn, options)\n  return async function* flatMap() {\n    for await (const val of values) {\n      yield* val\n    }\n  }.call(this)\n}\nfunction toIntegerOrInfinity(number) {\n  // We coerce here to align with the spec\n  // https://github.com/tc39/proposal-iterator-helpers/issues/169\n  number = Number(number)\n  if (NumberIsNaN(number)) {\n    return 0\n  }\n  if (number < 0) {\n    throw new ERR_OUT_OF_RANGE('number', '>= 0', number)\n  }\n  return number\n}\nfunction drop(number, options = undefined) {\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  number = toIntegerOrInfinity(number)\n  return async function* drop() {\n    var _options$signal5\n    if (\n      options !== null &&\n      options !== undefined &&\n      (_options$signal5 = options.signal) !== null &&\n      _options$signal5 !== undefined &&\n      _options$signal5.aborted\n    ) {\n      throw new AbortError()\n    }\n    for await (const val of this) {\n      var _options$signal6\n      if (\n        options !== null &&\n        options !== undefined &&\n        (_options$signal6 = options.signal) !== null &&\n        _options$signal6 !== undefined &&\n        _options$signal6.aborted\n      ) {\n        throw new AbortError()\n      }\n      if (number-- <= 0) {\n        yield val\n      }\n    }\n  }.call(this)\n}\nfunction take(number, options = undefined) {\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  number = toIntegerOrInfinity(number)\n  return async function* take() {\n    var _options$signal7\n    if (\n      options !== null &&\n      options !== undefined &&\n      (_options$signal7 = options.signal) !== null &&\n      _options$signal7 !== undefined &&\n      _options$signal7.aborted\n    ) {\n      throw new AbortError()\n    }\n    for await (const val of this) {\n      var _options$signal8\n      if (\n        options !== null &&\n        options !== undefined &&\n        (_options$signal8 = options.signal) !== null &&\n        _options$signal8 !== undefined &&\n        _options$signal8.aborted\n      ) {\n        throw new AbortError()\n      }\n      if (number-- > 0) {\n        yield val\n      }\n\n      // Don't get another item from iterator in case we reached the end\n      if (number <= 0) {\n        return\n      }\n    }\n  }.call(this)\n}\nmodule.exports.streamReturningOperators = {\n  asIndexedPairs: deprecate(asIndexedPairs, 'readable.asIndexedPairs will be removed in a future version.'),\n  drop,\n  filter,\n  flatMap,\n  map,\n  take,\n  compose\n}\nmodule.exports.promiseReturningOperators = {\n  every,\n  forEach,\n  reduce,\n  toArray,\n  some,\n  find\n}\n","'use strict'\n\nconst { ArrayPrototypePop, Promise } = require('../ours/primordials')\nconst { isIterable, isNodeStream, isWebStream } = require('../internal/streams/utils')\nconst { pipelineImpl: pl } = require('../internal/streams/pipeline')\nconst { finished } = require('../internal/streams/end-of-stream')\nrequire('../../lib/stream.js')\nfunction pipeline(...streams) {\n  return new Promise((resolve, reject) => {\n    let signal\n    let end\n    const lastArg = streams[streams.length - 1]\n    if (\n      lastArg &&\n      typeof lastArg === 'object' &&\n      !isNodeStream(lastArg) &&\n      !isIterable(lastArg) &&\n      !isWebStream(lastArg)\n    ) {\n      const options = ArrayPrototypePop(streams)\n      signal = options.signal\n      end = options.end\n    }\n    pl(\n      streams,\n      (err, value) => {\n        if (err) {\n          reject(err)\n        } else {\n          resolve(value)\n        }\n      },\n      {\n        signal,\n        end\n      }\n    )\n  })\n}\nmodule.exports = {\n  finished,\n  pipeline\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict'\n\n/* replacement start */\n\nconst { Buffer } = require('buffer')\n\n/* replacement end */\n\nconst { ObjectDefineProperty, ObjectKeys, ReflectApply } = require('./ours/primordials')\nconst {\n  promisify: { custom: customPromisify }\n} = require('./ours/util')\nconst { streamReturningOperators, promiseReturningOperators } = require('./internal/streams/operators')\nconst {\n  codes: { ERR_ILLEGAL_CONSTRUCTOR }\n} = require('./ours/errors')\nconst compose = require('./internal/streams/compose')\nconst { setDefaultHighWaterMark, getDefaultHighWaterMark } = require('./internal/streams/state')\nconst { pipeline } = require('./internal/streams/pipeline')\nconst { destroyer } = require('./internal/streams/destroy')\nconst eos = require('./internal/streams/end-of-stream')\nconst internalBuffer = {}\nconst promises = require('./stream/promises')\nconst utils = require('./internal/streams/utils')\nconst Stream = (module.exports = require('./internal/streams/legacy').Stream)\nStream.isDestroyed = utils.isDestroyed\nStream.isDisturbed = utils.isDisturbed\nStream.isErrored = utils.isErrored\nStream.isReadable = utils.isReadable\nStream.isWritable = utils.isWritable\nStream.Readable = require('./internal/streams/readable')\nfor (const key of ObjectKeys(streamReturningOperators)) {\n  const op = streamReturningOperators[key]\n  function fn(...args) {\n    if (new.target) {\n      throw ERR_ILLEGAL_CONSTRUCTOR()\n    }\n    return Stream.Readable.from(ReflectApply(op, this, args))\n  }\n  ObjectDefineProperty(fn, 'name', {\n    __proto__: null,\n    value: op.name\n  })\n  ObjectDefineProperty(fn, 'length', {\n    __proto__: null,\n    value: op.length\n  })\n  ObjectDefineProperty(Stream.Readable.prototype, key, {\n    __proto__: null,\n    value: fn,\n    enumerable: false,\n    configurable: true,\n    writable: true\n  })\n}\nfor (const key of ObjectKeys(promiseReturningOperators)) {\n  const op = promiseReturningOperators[key]\n  function fn(...args) {\n    if (new.target) {\n      throw ERR_ILLEGAL_CONSTRUCTOR()\n    }\n    return ReflectApply(op, this, args)\n  }\n  ObjectDefineProperty(fn, 'name', {\n    __proto__: null,\n    value: op.name\n  })\n  ObjectDefineProperty(fn, 'length', {\n    __proto__: null,\n    value: op.length\n  })\n  ObjectDefineProperty(Stream.Readable.prototype, key, {\n    __proto__: null,\n    value: fn,\n    enumerable: false,\n    configurable: true,\n    writable: true\n  })\n}\nStream.Writable = require('./internal/streams/writable')\nStream.Duplex = require('./internal/streams/duplex')\nStream.Transform = require('./internal/streams/transform')\nStream.PassThrough = require('./internal/streams/passthrough')\nStream.pipeline = pipeline\nconst { addAbortSignal } = require('./internal/streams/add-abort-signal')\nStream.addAbortSignal = addAbortSignal\nStream.finished = eos\nStream.destroy = destroyer\nStream.compose = compose\nStream.setDefaultHighWaterMark = setDefaultHighWaterMark\nStream.getDefaultHighWaterMark = getDefaultHighWaterMark\nObjectDefineProperty(Stream, 'promises', {\n  __proto__: null,\n  configurable: true,\n  enumerable: true,\n  get() {\n    return promises\n  }\n})\nObjectDefineProperty(pipeline, customPromisify, {\n  __proto__: null,\n  enumerable: true,\n  get() {\n    return promises.pipeline\n  }\n})\nObjectDefineProperty(eos, customPromisify, {\n  __proto__: null,\n  enumerable: true,\n  get() {\n    return promises.finished\n  }\n})\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream\nStream._isUint8Array = function isUint8Array(value) {\n  return value instanceof Uint8Array\n}\nStream._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) {\n  return Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength)\n}\n","'use strict'\n\nconst Stream = require('stream')\nif (Stream && process.env.READABLE_STREAM === 'disable') {\n  const promises = Stream.promises\n\n  // Explicit export naming is needed for ESM\n  module.exports._uint8ArrayToBuffer = Stream._uint8ArrayToBuffer\n  module.exports._isUint8Array = Stream._isUint8Array\n  module.exports.isDisturbed = Stream.isDisturbed\n  module.exports.isErrored = Stream.isErrored\n  module.exports.isReadable = Stream.isReadable\n  module.exports.Readable = Stream.Readable\n  module.exports.Writable = Stream.Writable\n  module.exports.Duplex = Stream.Duplex\n  module.exports.Transform = Stream.Transform\n  module.exports.PassThrough = Stream.PassThrough\n  module.exports.addAbortSignal = Stream.addAbortSignal\n  module.exports.finished = Stream.finished\n  module.exports.destroy = Stream.destroy\n  module.exports.pipeline = Stream.pipeline\n  module.exports.compose = Stream.compose\n  Object.defineProperty(Stream, 'promises', {\n    configurable: true,\n    enumerable: true,\n    get() {\n      return promises\n    }\n  })\n  module.exports.Stream = Stream.Stream\n} else {\n  const CustomStream = require('../stream')\n  const promises = require('../stream/promises')\n  const originalDestroy = CustomStream.Readable.destroy\n  module.exports = CustomStream.Readable\n\n  // Explicit export naming is needed for ESM\n  module.exports._uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer\n  module.exports._isUint8Array = CustomStream._isUint8Array\n  module.exports.isDisturbed = CustomStream.isDisturbed\n  module.exports.isErrored = CustomStream.isErrored\n  module.exports.isReadable = CustomStream.isReadable\n  module.exports.Readable = CustomStream.Readable\n  module.exports.Writable = CustomStream.Writable\n  module.exports.Duplex = CustomStream.Duplex\n  module.exports.Transform = CustomStream.Transform\n  module.exports.PassThrough = CustomStream.PassThrough\n  module.exports.addAbortSignal = CustomStream.addAbortSignal\n  module.exports.finished = CustomStream.finished\n  module.exports.destroy = CustomStream.destroy\n  module.exports.destroy = originalDestroy\n  module.exports.pipeline = CustomStream.pipeline\n  module.exports.compose = CustomStream.compose\n  Object.defineProperty(CustomStream, 'promises', {\n    configurable: true,\n    enumerable: true,\n    get() {\n      return promises\n    }\n  })\n  module.exports.Stream = CustomStream.Stream\n}\n\n// Allow default importing\nmodule.exports.default = module.exports\n","/**\n * node-compress-commons\n *\n * Copyright (c) 2014 Chris Talkington, contributors.\n * Licensed under the MIT license.\n * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT\n */\nvar Stream = require('stream').Stream;\nvar PassThrough = require('readable-stream').PassThrough;\nvar isStream = require('is-stream');\n\nvar util = module.exports = {};\n\nutil.normalizeInputSource = function(source) {\n  if (source === null) {\n    return Buffer.alloc(0);\n  } else if (typeof source === 'string') {\n    return Buffer.from(source);\n  } else if (isStream(source) && !source._readableState) {\n    var normalized = new PassThrough();\n    source.pipe(normalized);\n\n    return normalized;\n  }\n\n  return source;\n};","/**\n * node-compress-commons\n *\n * Copyright (c) 2014 Chris Talkington, contributors.\n * Licensed under the MIT license.\n * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT\n */\nvar inherits = require('util').inherits;\nvar isStream = require('is-stream');\nvar Transform = require('readable-stream').Transform;\n\nvar ArchiveEntry = require('./archive-entry');\nvar util = require('../util');\n\nvar ArchiveOutputStream = module.exports = function(options) {\n  if (!(this instanceof ArchiveOutputStream)) {\n    return new ArchiveOutputStream(options);\n  }\n\n  Transform.call(this, options);\n\n  this.offset = 0;\n  this._archive = {\n    finish: false,\n    finished: false,\n    processing: false\n  };\n};\n\ninherits(ArchiveOutputStream, Transform);\n\nArchiveOutputStream.prototype._appendBuffer = function(zae, source, callback) {\n  // scaffold only\n};\n\nArchiveOutputStream.prototype._appendStream = function(zae, source, callback) {\n  // scaffold only\n};\n\nArchiveOutputStream.prototype._emitErrorCallback = function(err) {\n  if (err) {\n    this.emit('error', err);\n  }\n};\n\nArchiveOutputStream.prototype._finish = function(ae) {\n  // scaffold only\n};\n\nArchiveOutputStream.prototype._normalizeEntry = function(ae) {\n  // scaffold only\n};\n\nArchiveOutputStream.prototype._transform = function(chunk, encoding, callback) {\n  callback(null, chunk);\n};\n\nArchiveOutputStream.prototype.entry = function(ae, source, callback) {\n  source = source || null;\n\n  if (typeof callback !== 'function') {\n    callback = this._emitErrorCallback.bind(this);\n  }\n\n  if (!(ae instanceof ArchiveEntry)) {\n    callback(new Error('not a valid instance of ArchiveEntry'));\n    return;\n  }\n\n  if (this._archive.finish || this._archive.finished) {\n    callback(new Error('unacceptable entry after finish'));\n    return;\n  }\n\n  if (this._archive.processing) {\n    callback(new Error('already processing an entry'));\n    return;\n  }\n\n  this._archive.processing = true;\n  this._normalizeEntry(ae);\n  this._entry = ae;\n\n  source = util.normalizeInputSource(source);\n\n  if (Buffer.isBuffer(source)) {\n    this._appendBuffer(ae, source, callback);\n  } else if (isStream(source)) {\n    this._appendStream(ae, source, callback);\n  } else {\n    this._archive.processing = false;\n    callback(new Error('input source must be valid Stream or Buffer instance'));\n    return;\n  }\n\n  return this;\n};\n\nArchiveOutputStream.prototype.finish = function() {\n  if (this._archive.processing) {\n    this._archive.finish = true;\n    return;\n  }\n\n  this._finish();\n};\n\nArchiveOutputStream.prototype.getBytesWritten = function() {\n  return this.offset;\n};\n\nArchiveOutputStream.prototype.write = function(chunk, cb) {\n  if (chunk) {\n    this.offset += chunk.length;\n  }\n\n  return Transform.prototype.write.call(this, chunk, cb);\n};","/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */\n/* vim: set ts=2: */\n/*exported CRC32 */\nvar CRC32;\n(function (factory) {\n\t/*jshint ignore:start */\n\t/*eslint-disable */\n\tif(typeof DO_NOT_EXPORT_CRC === 'undefined') {\n\t\tif('object' === typeof exports) {\n\t\t\tfactory(exports);\n\t\t} else if ('function' === typeof define && define.amd) {\n\t\t\tdefine(function () {\n\t\t\t\tvar module = {};\n\t\t\t\tfactory(module);\n\t\t\t\treturn module;\n\t\t\t});\n\t\t} else {\n\t\t\tfactory(CRC32 = {});\n\t\t}\n\t} else {\n\t\tfactory(CRC32 = {});\n\t}\n\t/*eslint-enable */\n\t/*jshint ignore:end */\n}(function(CRC32) {\nCRC32.version = '1.2.2';\n/*global Int32Array */\nfunction signed_crc_table() {\n\tvar c = 0, table = new Array(256);\n\n\tfor(var n =0; n != 256; ++n){\n\t\tc = n;\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\ttable[n] = c;\n\t}\n\n\treturn typeof Int32Array !== 'undefined' ? new Int32Array(table) : table;\n}\n\nvar T0 = signed_crc_table();\nfunction slice_by_16_tables(T) {\n\tvar c = 0, v = 0, n = 0, table = typeof Int32Array !== 'undefined' ? new Int32Array(4096) : new Array(4096) ;\n\n\tfor(n = 0; n != 256; ++n) table[n] = T[n];\n\tfor(n = 0; n != 256; ++n) {\n\t\tv = T[n];\n\t\tfor(c = 256 + n; c < 4096; c += 256) v = table[c] = (v >>> 8) ^ T[v & 0xFF];\n\t}\n\tvar out = [];\n\tfor(n = 1; n != 16; ++n) out[n - 1] = typeof Int32Array !== 'undefined' ? table.subarray(n * 256, n * 256 + 256) : table.slice(n * 256, n * 256 + 256);\n\treturn out;\n}\nvar TT = slice_by_16_tables(T0);\nvar T1 = TT[0],  T2 = TT[1],  T3 = TT[2],  T4 = TT[3],  T5 = TT[4];\nvar T6 = TT[5],  T7 = TT[6],  T8 = TT[7],  T9 = TT[8],  Ta = TT[9];\nvar Tb = TT[10], Tc = TT[11], Td = TT[12], Te = TT[13], Tf = TT[14];\nfunction crc32_bstr(bstr, seed) {\n\tvar C = seed ^ -1;\n\tfor(var i = 0, L = bstr.length; i < L;) C = (C>>>8) ^ T0[(C^bstr.charCodeAt(i++))&0xFF];\n\treturn ~C;\n}\n\nfunction crc32_buf(B, seed) {\n\tvar C = seed ^ -1, L = B.length - 15, i = 0;\n\tfor(; i < L;) C =\n\t\tTf[B[i++] ^ (C & 255)] ^\n\t\tTe[B[i++] ^ ((C >> 8) & 255)] ^\n\t\tTd[B[i++] ^ ((C >> 16) & 255)] ^\n\t\tTc[B[i++] ^ (C >>> 24)] ^\n\t\tTb[B[i++]] ^ Ta[B[i++]] ^ T9[B[i++]] ^ T8[B[i++]] ^\n\t\tT7[B[i++]] ^ T6[B[i++]] ^ T5[B[i++]] ^ T4[B[i++]] ^\n\t\tT3[B[i++]] ^ T2[B[i++]] ^ T1[B[i++]] ^ T0[B[i++]];\n\tL += 15;\n\twhile(i < L) C = (C>>>8) ^ T0[(C^B[i++])&0xFF];\n\treturn ~C;\n}\n\nfunction crc32_str(str, seed) {\n\tvar C = seed ^ -1;\n\tfor(var i = 0, L = str.length, c = 0, d = 0; i < L;) {\n\t\tc = str.charCodeAt(i++);\n\t\tif(c < 0x80) {\n\t\t\tC = (C>>>8) ^ T0[(C^c)&0xFF];\n\t\t} else if(c < 0x800) {\n\t\t\tC = (C>>>8) ^ T0[(C ^ (192|((c>>6)&31)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF];\n\t\t} else if(c >= 0xD800 && c < 0xE000) {\n\t\t\tc = (c&1023)+64; d = str.charCodeAt(i++)&1023;\n\t\t\tC = (C>>>8) ^ T0[(C ^ (240|((c>>8)&7)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|((c>>2)&63)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|((d>>6)&15)|((c&3)<<4)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|(d&63)))&0xFF];\n\t\t} else {\n\t\t\tC = (C>>>8) ^ T0[(C ^ (224|((c>>12)&15)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|((c>>6)&63)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF];\n\t\t}\n\t}\n\treturn ~C;\n}\nCRC32.table = T0;\n// $FlowIgnore\nCRC32.bstr = crc32_bstr;\n// $FlowIgnore\nCRC32.buf = crc32_buf;\n// $FlowIgnore\nCRC32.str = crc32_str;\n}));\n","'use strict'\n\n/*\n  This file is a reduced and adapted version of the main lib/internal/per_context/primordials.js file defined at\n\n  https://github.com/nodejs/node/blob/main/lib/internal/per_context/primordials.js\n\n  Don't try to replace with the original file and keep it up to date with the upstream file.\n*/\n\n// This is a simplified version of AggregateError\nclass AggregateError extends Error {\n  constructor(errors) {\n    if (!Array.isArray(errors)) {\n      throw new TypeError(`Expected input to be an Array, got ${typeof errors}`)\n    }\n    let message = ''\n    for (let i = 0; i < errors.length; i++) {\n      message += `    ${errors[i].stack}\\n`\n    }\n    super(message)\n    this.name = 'AggregateError'\n    this.errors = errors\n  }\n}\nmodule.exports = {\n  AggregateError,\n  ArrayIsArray(self) {\n    return Array.isArray(self)\n  },\n  ArrayPrototypeIncludes(self, el) {\n    return self.includes(el)\n  },\n  ArrayPrototypeIndexOf(self, el) {\n    return self.indexOf(el)\n  },\n  ArrayPrototypeJoin(self, sep) {\n    return self.join(sep)\n  },\n  ArrayPrototypeMap(self, fn) {\n    return self.map(fn)\n  },\n  ArrayPrototypePop(self, el) {\n    return self.pop(el)\n  },\n  ArrayPrototypePush(self, el) {\n    return self.push(el)\n  },\n  ArrayPrototypeSlice(self, start, end) {\n    return self.slice(start, end)\n  },\n  Error,\n  FunctionPrototypeCall(fn, thisArgs, ...args) {\n    return fn.call(thisArgs, ...args)\n  },\n  FunctionPrototypeSymbolHasInstance(self, instance) {\n    return Function.prototype[Symbol.hasInstance].call(self, instance)\n  },\n  MathFloor: Math.floor,\n  Number,\n  NumberIsInteger: Number.isInteger,\n  NumberIsNaN: Number.isNaN,\n  NumberMAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER,\n  NumberMIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER,\n  NumberParseInt: Number.parseInt,\n  ObjectDefineProperties(self, props) {\n    return Object.defineProperties(self, props)\n  },\n  ObjectDefineProperty(self, name, prop) {\n    return Object.defineProperty(self, name, prop)\n  },\n  ObjectGetOwnPropertyDescriptor(self, name) {\n    return Object.getOwnPropertyDescriptor(self, name)\n  },\n  ObjectKeys(obj) {\n    return Object.keys(obj)\n  },\n  ObjectSetPrototypeOf(target, proto) {\n    return Object.setPrototypeOf(target, proto)\n  },\n  Promise,\n  PromisePrototypeCatch(self, fn) {\n    return self.catch(fn)\n  },\n  PromisePrototypeThen(self, thenFn, catchFn) {\n    return self.then(thenFn, catchFn)\n  },\n  PromiseReject(err) {\n    return Promise.reject(err)\n  },\n  PromiseResolve(val) {\n    return Promise.resolve(val)\n  },\n  ReflectApply: Reflect.apply,\n  RegExpPrototypeTest(self, value) {\n    return self.test(value)\n  },\n  SafeSet: Set,\n  String,\n  StringPrototypeSlice(self, start, end) {\n    return self.slice(start, end)\n  },\n  StringPrototypeToLowerCase(self) {\n    return self.toLowerCase()\n  },\n  StringPrototypeToUpperCase(self) {\n    return self.toUpperCase()\n  },\n  StringPrototypeTrim(self) {\n    return self.trim()\n  },\n  Symbol,\n  SymbolFor: Symbol.for,\n  SymbolAsyncIterator: Symbol.asyncIterator,\n  SymbolHasInstance: Symbol.hasInstance,\n  SymbolIterator: Symbol.iterator,\n  SymbolDispose: Symbol.dispose || Symbol('Symbol.dispose'),\n  SymbolAsyncDispose: Symbol.asyncDispose || Symbol('Symbol.asyncDispose'),\n  TypedArrayPrototypeSet(self, buf, len) {\n    return self.set(buf, len)\n  },\n  Boolean,\n  Uint8Array\n}\n","'use strict'\n\n/*\n  This file is a reduced and adapted version of the main lib/internal/util/inspect.js file defined at\n\n  https://github.com/nodejs/node/blob/main/lib/internal/util/inspect.js\n\n  Don't try to replace with the original file and keep it up to date with the upstream file.\n*/\nmodule.exports = {\n  format(format, ...args) {\n    // Simplified version of https://nodejs.org/api/util.html#utilformatformat-args\n    return format.replace(/%([sdifj])/g, function (...[_unused, type]) {\n      const replacement = args.shift()\n      if (type === 'f') {\n        return replacement.toFixed(6)\n      } else if (type === 'j') {\n        return JSON.stringify(replacement)\n      } else if (type === 's' && typeof replacement === 'object') {\n        const ctor = replacement.constructor !== Object ? replacement.constructor.name : ''\n        return `${ctor} {}`.trim()\n      } else {\n        return replacement.toString()\n      }\n    })\n  },\n  inspect(value) {\n    // Vastly simplified version of https://nodejs.org/api/util.html#utilinspectobject-options\n    switch (typeof value) {\n      case 'string':\n        if (value.includes(\"'\")) {\n          if (!value.includes('\"')) {\n            return `\"${value}\"`\n          } else if (!value.includes('`') && !value.includes('${')) {\n            return `\\`${value}\\``\n          }\n        }\n        return `'${value}'`\n      case 'number':\n        if (isNaN(value)) {\n          return 'NaN'\n        } else if (Object.is(value, -0)) {\n          return String(value)\n        }\n        return value\n      case 'bigint':\n        return `${String(value)}n`\n      case 'boolean':\n      case 'undefined':\n        return String(value)\n      case 'object':\n        return '{}'\n    }\n  }\n}\n","'use strict'\n\nconst { format, inspect } = require('./util/inspect')\nconst { AggregateError: CustomAggregateError } = require('./primordials')\n\n/*\n  This file is a reduced and adapted version of the main lib/internal/errors.js file defined at\n\n  https://github.com/nodejs/node/blob/main/lib/internal/errors.js\n\n  Don't try to replace with the original file and keep it up to date (starting from E(...) definitions)\n  with the upstream file.\n*/\n\nconst AggregateError = globalThis.AggregateError || CustomAggregateError\nconst kIsNodeError = Symbol('kIsNodeError')\nconst kTypes = [\n  'string',\n  'function',\n  'number',\n  'object',\n  // Accept 'Function' and 'Object' as alternative to the lower cased version.\n  'Function',\n  'Object',\n  'boolean',\n  'bigint',\n  'symbol'\n]\nconst classRegExp = /^([A-Z][a-z0-9]*)+$/\nconst nodeInternalPrefix = '__node_internal_'\nconst codes = {}\nfunction assert(value, message) {\n  if (!value) {\n    throw new codes.ERR_INTERNAL_ASSERTION(message)\n  }\n}\n\n// Only use this for integers! Decimal numbers do not work with this function.\nfunction addNumericalSeparator(val) {\n  let res = ''\n  let i = val.length\n  const start = val[0] === '-' ? 1 : 0\n  for (; i >= start + 4; i -= 3) {\n    res = `_${val.slice(i - 3, i)}${res}`\n  }\n  return `${val.slice(0, i)}${res}`\n}\nfunction getMessage(key, msg, args) {\n  if (typeof msg === 'function') {\n    assert(\n      msg.length <= args.length,\n      // Default options do not count.\n      `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`\n    )\n    return msg(...args)\n  }\n  const expectedLength = (msg.match(/%[dfijoOs]/g) || []).length\n  assert(\n    expectedLength === args.length,\n    `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`\n  )\n  if (args.length === 0) {\n    return msg\n  }\n  return format(msg, ...args)\n}\nfunction E(code, message, Base) {\n  if (!Base) {\n    Base = Error\n  }\n  class NodeError extends Base {\n    constructor(...args) {\n      super(getMessage(code, message, args))\n    }\n    toString() {\n      return `${this.name} [${code}]: ${this.message}`\n    }\n  }\n  Object.defineProperties(NodeError.prototype, {\n    name: {\n      value: Base.name,\n      writable: true,\n      enumerable: false,\n      configurable: true\n    },\n    toString: {\n      value() {\n        return `${this.name} [${code}]: ${this.message}`\n      },\n      writable: true,\n      enumerable: false,\n      configurable: true\n    }\n  })\n  NodeError.prototype.code = code\n  NodeError.prototype[kIsNodeError] = true\n  codes[code] = NodeError\n}\nfunction hideStackFrames(fn) {\n  // We rename the functions that will be hidden to cut off the stacktrace\n  // at the outermost one\n  const hidden = nodeInternalPrefix + fn.name\n  Object.defineProperty(fn, 'name', {\n    value: hidden\n  })\n  return fn\n}\nfunction aggregateTwoErrors(innerError, outerError) {\n  if (innerError && outerError && innerError !== outerError) {\n    if (Array.isArray(outerError.errors)) {\n      // If `outerError` is already an `AggregateError`.\n      outerError.errors.push(innerError)\n      return outerError\n    }\n    const err = new AggregateError([outerError, innerError], outerError.message)\n    err.code = outerError.code\n    return err\n  }\n  return innerError || outerError\n}\nclass AbortError extends Error {\n  constructor(message = 'The operation was aborted', options = undefined) {\n    if (options !== undefined && typeof options !== 'object') {\n      throw new codes.ERR_INVALID_ARG_TYPE('options', 'Object', options)\n    }\n    super(message, options)\n    this.code = 'ABORT_ERR'\n    this.name = 'AbortError'\n  }\n}\nE('ERR_ASSERTION', '%s', Error)\nE(\n  'ERR_INVALID_ARG_TYPE',\n  (name, expected, actual) => {\n    assert(typeof name === 'string', \"'name' must be a string\")\n    if (!Array.isArray(expected)) {\n      expected = [expected]\n    }\n    let msg = 'The '\n    if (name.endsWith(' argument')) {\n      // For cases like 'first argument'\n      msg += `${name} `\n    } else {\n      msg += `\"${name}\" ${name.includes('.') ? 'property' : 'argument'} `\n    }\n    msg += 'must be '\n    const types = []\n    const instances = []\n    const other = []\n    for (const value of expected) {\n      assert(typeof value === 'string', 'All expected entries have to be of type string')\n      if (kTypes.includes(value)) {\n        types.push(value.toLowerCase())\n      } else if (classRegExp.test(value)) {\n        instances.push(value)\n      } else {\n        assert(value !== 'object', 'The value \"object\" should be written as \"Object\"')\n        other.push(value)\n      }\n    }\n\n    // Special handle `object` in case other instances are allowed to outline\n    // the differences between each other.\n    if (instances.length > 0) {\n      const pos = types.indexOf('object')\n      if (pos !== -1) {\n        types.splice(types, pos, 1)\n        instances.push('Object')\n      }\n    }\n    if (types.length > 0) {\n      switch (types.length) {\n        case 1:\n          msg += `of type ${types[0]}`\n          break\n        case 2:\n          msg += `one of type ${types[0]} or ${types[1]}`\n          break\n        default: {\n          const last = types.pop()\n          msg += `one of type ${types.join(', ')}, or ${last}`\n        }\n      }\n      if (instances.length > 0 || other.length > 0) {\n        msg += ' or '\n      }\n    }\n    if (instances.length > 0) {\n      switch (instances.length) {\n        case 1:\n          msg += `an instance of ${instances[0]}`\n          break\n        case 2:\n          msg += `an instance of ${instances[0]} or ${instances[1]}`\n          break\n        default: {\n          const last = instances.pop()\n          msg += `an instance of ${instances.join(', ')}, or ${last}`\n        }\n      }\n      if (other.length > 0) {\n        msg += ' or '\n      }\n    }\n    switch (other.length) {\n      case 0:\n        break\n      case 1:\n        if (other[0].toLowerCase() !== other[0]) {\n          msg += 'an '\n        }\n        msg += `${other[0]}`\n        break\n      case 2:\n        msg += `one of ${other[0]} or ${other[1]}`\n        break\n      default: {\n        const last = other.pop()\n        msg += `one of ${other.join(', ')}, or ${last}`\n      }\n    }\n    if (actual == null) {\n      msg += `. Received ${actual}`\n    } else if (typeof actual === 'function' && actual.name) {\n      msg += `. Received function ${actual.name}`\n    } else if (typeof actual === 'object') {\n      var _actual$constructor\n      if (\n        (_actual$constructor = actual.constructor) !== null &&\n        _actual$constructor !== undefined &&\n        _actual$constructor.name\n      ) {\n        msg += `. Received an instance of ${actual.constructor.name}`\n      } else {\n        const inspected = inspect(actual, {\n          depth: -1\n        })\n        msg += `. Received ${inspected}`\n      }\n    } else {\n      let inspected = inspect(actual, {\n        colors: false\n      })\n      if (inspected.length > 25) {\n        inspected = `${inspected.slice(0, 25)}...`\n      }\n      msg += `. Received type ${typeof actual} (${inspected})`\n    }\n    return msg\n  },\n  TypeError\n)\nE(\n  'ERR_INVALID_ARG_VALUE',\n  (name, value, reason = 'is invalid') => {\n    let inspected = inspect(value)\n    if (inspected.length > 128) {\n      inspected = inspected.slice(0, 128) + '...'\n    }\n    const type = name.includes('.') ? 'property' : 'argument'\n    return `The ${type} '${name}' ${reason}. Received ${inspected}`\n  },\n  TypeError\n)\nE(\n  'ERR_INVALID_RETURN_VALUE',\n  (input, name, value) => {\n    var _value$constructor\n    const type =\n      value !== null &&\n      value !== undefined &&\n      (_value$constructor = value.constructor) !== null &&\n      _value$constructor !== undefined &&\n      _value$constructor.name\n        ? `instance of ${value.constructor.name}`\n        : `type ${typeof value}`\n    return `Expected ${input} to be returned from the \"${name}\"` + ` function but got ${type}.`\n  },\n  TypeError\n)\nE(\n  'ERR_MISSING_ARGS',\n  (...args) => {\n    assert(args.length > 0, 'At least one arg needs to be specified')\n    let msg\n    const len = args.length\n    args = (Array.isArray(args) ? args : [args]).map((a) => `\"${a}\"`).join(' or ')\n    switch (len) {\n      case 1:\n        msg += `The ${args[0]} argument`\n        break\n      case 2:\n        msg += `The ${args[0]} and ${args[1]} arguments`\n        break\n      default:\n        {\n          const last = args.pop()\n          msg += `The ${args.join(', ')}, and ${last} arguments`\n        }\n        break\n    }\n    return `${msg} must be specified`\n  },\n  TypeError\n)\nE(\n  'ERR_OUT_OF_RANGE',\n  (str, range, input) => {\n    assert(range, 'Missing \"range\" argument')\n    let received\n    if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n      received = addNumericalSeparator(String(input))\n    } else if (typeof input === 'bigint') {\n      received = String(input)\n      const limit = BigInt(2) ** BigInt(32)\n      if (input > limit || input < -limit) {\n        received = addNumericalSeparator(received)\n      }\n      received += 'n'\n    } else {\n      received = inspect(input)\n    }\n    return `The value of \"${str}\" is out of range. It must be ${range}. Received ${received}`\n  },\n  RangeError\n)\nE('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times', Error)\nE('ERR_METHOD_NOT_IMPLEMENTED', 'The %s method is not implemented', Error)\nE('ERR_STREAM_ALREADY_FINISHED', 'Cannot call %s after a stream was finished', Error)\nE('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable', Error)\nE('ERR_STREAM_DESTROYED', 'Cannot call %s after a stream was destroyed', Error)\nE('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError)\nE('ERR_STREAM_PREMATURE_CLOSE', 'Premature close', Error)\nE('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF', Error)\nE('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event', Error)\nE('ERR_STREAM_WRITE_AFTER_END', 'write after end', Error)\nE('ERR_UNKNOWN_ENCODING', 'Unknown encoding: %s', TypeError)\nmodule.exports = {\n  AbortError,\n  aggregateTwoErrors: hideStackFrames(aggregateTwoErrors),\n  hideStackFrames,\n  codes\n}\n","'use strict'\n\nconst bufferModule = require('buffer')\nconst { format, inspect } = require('./util/inspect')\nconst {\n  codes: { ERR_INVALID_ARG_TYPE }\n} = require('./errors')\nconst { kResistStopPropagation, AggregateError, SymbolDispose } = require('./primordials')\nconst AbortSignal = globalThis.AbortSignal || require('abort-controller').AbortSignal\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nconst AsyncFunction = Object.getPrototypeOf(async function () {}).constructor\nconst Blob = globalThis.Blob || bufferModule.Blob\n/* eslint-disable indent */\nconst isBlob =\n  typeof Blob !== 'undefined'\n    ? function isBlob(b) {\n        // eslint-disable-next-line indent\n        return b instanceof Blob\n      }\n    : function isBlob(b) {\n        return false\n      }\n/* eslint-enable indent */\n\nconst validateAbortSignal = (signal, name) => {\n  if (signal !== undefined && (signal === null || typeof signal !== 'object' || !('aborted' in signal))) {\n    throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal)\n  }\n}\nconst validateFunction = (value, name) => {\n  if (typeof value !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)\n  }\n}\nmodule.exports = {\n  AggregateError,\n  kEmptyObject: Object.freeze({}),\n  once(callback) {\n    let called = false\n    return function (...args) {\n      if (called) {\n        return\n      }\n      called = true\n      callback.apply(this, args)\n    }\n  },\n  createDeferredPromise: function () {\n    let resolve\n    let reject\n\n    // eslint-disable-next-line promise/param-names\n    const promise = new Promise((res, rej) => {\n      resolve = res\n      reject = rej\n    })\n    return {\n      promise,\n      resolve,\n      reject\n    }\n  },\n  promisify(fn) {\n    return new Promise((resolve, reject) => {\n      fn((err, ...args) => {\n        if (err) {\n          return reject(err)\n        }\n        return resolve(...args)\n      })\n    })\n  },\n  debuglog() {\n    return function () {}\n  },\n  format,\n  inspect,\n  types: {\n    isAsyncFunction(fn) {\n      return fn instanceof AsyncFunction\n    },\n    isArrayBufferView(arr) {\n      return ArrayBuffer.isView(arr)\n    }\n  },\n  isBlob,\n  deprecate(fn, message) {\n    return fn\n  },\n  addAbortListener:\n    require('events').addAbortListener ||\n    function addAbortListener(signal, listener) {\n      if (signal === undefined) {\n        throw new ERR_INVALID_ARG_TYPE('signal', 'AbortSignal', signal)\n      }\n      validateAbortSignal(signal, 'signal')\n      validateFunction(listener, 'listener')\n      let removeEventListener\n      if (signal.aborted) {\n        queueMicrotask(() => listener())\n      } else {\n        signal.addEventListener('abort', listener, {\n          __proto__: null,\n          once: true,\n          [kResistStopPropagation]: true\n        })\n        removeEventListener = () => {\n          signal.removeEventListener('abort', listener)\n        }\n      }\n      return {\n        __proto__: null,\n        [SymbolDispose]() {\n          var _removeEventListener\n          ;(_removeEventListener = removeEventListener) === null || _removeEventListener === undefined\n            ? undefined\n            : _removeEventListener()\n        }\n      }\n    },\n  AbortSignalAny:\n    AbortSignal.any ||\n    function AbortSignalAny(signals) {\n      // Fast path if there is only one signal.\n      if (signals.length === 1) {\n        return signals[0]\n      }\n      const ac = new AbortController()\n      const abort = () => ac.abort()\n      signals.forEach((signal) => {\n        validateAbortSignal(signal, 'signals')\n        signal.addEventListener('abort', abort, {\n          once: true\n        })\n      })\n      ac.signal.addEventListener(\n        'abort',\n        () => {\n          signals.forEach((signal) => signal.removeEventListener('abort', abort))\n        },\n        {\n          once: true\n        }\n      )\n      return ac.signal\n    }\n}\nmodule.exports.promisify.custom = Symbol.for('nodejs.util.promisify.custom')\n","/* eslint jsdoc/require-jsdoc: \"error\" */\n\n'use strict'\n\nconst {\n  ArrayIsArray,\n  ArrayPrototypeIncludes,\n  ArrayPrototypeJoin,\n  ArrayPrototypeMap,\n  NumberIsInteger,\n  NumberIsNaN,\n  NumberMAX_SAFE_INTEGER,\n  NumberMIN_SAFE_INTEGER,\n  NumberParseInt,\n  ObjectPrototypeHasOwnProperty,\n  RegExpPrototypeExec,\n  String,\n  StringPrototypeToUpperCase,\n  StringPrototypeTrim\n} = require('../ours/primordials')\nconst {\n  hideStackFrames,\n  codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL }\n} = require('../ours/errors')\nconst { normalizeEncoding } = require('../ours/util')\nconst { isAsyncFunction, isArrayBufferView } = require('../ours/util').types\nconst signals = {}\n\n/**\n * @param {*} value\n * @returns {boolean}\n */\nfunction isInt32(value) {\n  return value === (value | 0)\n}\n\n/**\n * @param {*} value\n * @returns {boolean}\n */\nfunction isUint32(value) {\n  return value === value >>> 0\n}\nconst octalReg = /^[0-7]+$/\nconst modeDesc = 'must be a 32-bit unsigned integer or an octal string'\n\n/**\n * Parse and validate values that will be converted into mode_t (the S_*\n * constants). Only valid numbers and octal strings are allowed. They could be\n * converted to 32-bit unsigned integers or non-negative signed integers in the\n * C++ land, but any value higher than 0o777 will result in platform-specific\n * behaviors.\n * @param {*} value Values to be validated\n * @param {string} name Name of the argument\n * @param {number} [def] If specified, will be returned for invalid values\n * @returns {number}\n */\nfunction parseFileMode(value, name, def) {\n  if (typeof value === 'undefined') {\n    value = def\n  }\n  if (typeof value === 'string') {\n    if (RegExpPrototypeExec(octalReg, value) === null) {\n      throw new ERR_INVALID_ARG_VALUE(name, value, modeDesc)\n    }\n    value = NumberParseInt(value, 8)\n  }\n  validateUint32(value, name)\n  return value\n}\n\n/**\n * @callback validateInteger\n * @param {*} value\n * @param {string} name\n * @param {number} [min]\n * @param {number} [max]\n * @returns {asserts value is number}\n */\n\n/** @type {validateInteger} */\nconst validateInteger = hideStackFrames((value, name, min = NumberMIN_SAFE_INTEGER, max = NumberMAX_SAFE_INTEGER) => {\n  if (typeof value !== 'number') throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n  if (!NumberIsInteger(value)) throw new ERR_OUT_OF_RANGE(name, 'an integer', value)\n  if (value < min || value > max) throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value)\n})\n\n/**\n * @callback validateInt32\n * @param {*} value\n * @param {string} name\n * @param {number} [min]\n * @param {number} [max]\n * @returns {asserts value is number}\n */\n\n/** @type {validateInt32} */\nconst validateInt32 = hideStackFrames((value, name, min = -2147483648, max = 2147483647) => {\n  // The defaults for min and max correspond to the limits of 32-bit integers.\n  if (typeof value !== 'number') {\n    throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n  }\n  if (!NumberIsInteger(value)) {\n    throw new ERR_OUT_OF_RANGE(name, 'an integer', value)\n  }\n  if (value < min || value > max) {\n    throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value)\n  }\n})\n\n/**\n * @callback validateUint32\n * @param {*} value\n * @param {string} name\n * @param {number|boolean} [positive=false]\n * @returns {asserts value is number}\n */\n\n/** @type {validateUint32} */\nconst validateUint32 = hideStackFrames((value, name, positive = false) => {\n  if (typeof value !== 'number') {\n    throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n  }\n  if (!NumberIsInteger(value)) {\n    throw new ERR_OUT_OF_RANGE(name, 'an integer', value)\n  }\n  const min = positive ? 1 : 0\n  // 2 ** 32 === 4294967296\n  const max = 4294967295\n  if (value < min || value > max) {\n    throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value)\n  }\n})\n\n/**\n * @callback validateString\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is string}\n */\n\n/** @type {validateString} */\nfunction validateString(value, name) {\n  if (typeof value !== 'string') throw new ERR_INVALID_ARG_TYPE(name, 'string', value)\n}\n\n/**\n * @callback validateNumber\n * @param {*} value\n * @param {string} name\n * @param {number} [min]\n * @param {number} [max]\n * @returns {asserts value is number}\n */\n\n/** @type {validateNumber} */\nfunction validateNumber(value, name, min = undefined, max) {\n  if (typeof value !== 'number') throw new ERR_INVALID_ARG_TYPE(name, 'number', value)\n  if (\n    (min != null && value < min) ||\n    (max != null && value > max) ||\n    ((min != null || max != null) && NumberIsNaN(value))\n  ) {\n    throw new ERR_OUT_OF_RANGE(\n      name,\n      `${min != null ? `>= ${min}` : ''}${min != null && max != null ? ' && ' : ''}${max != null ? `<= ${max}` : ''}`,\n      value\n    )\n  }\n}\n\n/**\n * @callback validateOneOf\n * @template T\n * @param {T} value\n * @param {string} name\n * @param {T[]} oneOf\n */\n\n/** @type {validateOneOf} */\nconst validateOneOf = hideStackFrames((value, name, oneOf) => {\n  if (!ArrayPrototypeIncludes(oneOf, value)) {\n    const allowed = ArrayPrototypeJoin(\n      ArrayPrototypeMap(oneOf, (v) => (typeof v === 'string' ? `'${v}'` : String(v))),\n      ', '\n    )\n    const reason = 'must be one of: ' + allowed\n    throw new ERR_INVALID_ARG_VALUE(name, value, reason)\n  }\n})\n\n/**\n * @callback validateBoolean\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is boolean}\n */\n\n/** @type {validateBoolean} */\nfunction validateBoolean(value, name) {\n  if (typeof value !== 'boolean') throw new ERR_INVALID_ARG_TYPE(name, 'boolean', value)\n}\n\n/**\n * @param {any} options\n * @param {string} key\n * @param {boolean} defaultValue\n * @returns {boolean}\n */\nfunction getOwnPropertyValueOrDefault(options, key, defaultValue) {\n  return options == null || !ObjectPrototypeHasOwnProperty(options, key) ? defaultValue : options[key]\n}\n\n/**\n * @callback validateObject\n * @param {*} value\n * @param {string} name\n * @param {{\n *   allowArray?: boolean,\n *   allowFunction?: boolean,\n *   nullable?: boolean\n * }} [options]\n */\n\n/** @type {validateObject} */\nconst validateObject = hideStackFrames((value, name, options = null) => {\n  const allowArray = getOwnPropertyValueOrDefault(options, 'allowArray', false)\n  const allowFunction = getOwnPropertyValueOrDefault(options, 'allowFunction', false)\n  const nullable = getOwnPropertyValueOrDefault(options, 'nullable', false)\n  if (\n    (!nullable && value === null) ||\n    (!allowArray && ArrayIsArray(value)) ||\n    (typeof value !== 'object' && (!allowFunction || typeof value !== 'function'))\n  ) {\n    throw new ERR_INVALID_ARG_TYPE(name, 'Object', value)\n  }\n})\n\n/**\n * @callback validateDictionary - We are using the Web IDL Standard definition\n *                                of \"dictionary\" here, which means any value\n *                                whose Type is either Undefined, Null, or\n *                                Object (which includes functions).\n * @param {*} value\n * @param {string} name\n * @see https://webidl.spec.whatwg.org/#es-dictionary\n * @see https://tc39.es/ecma262/#table-typeof-operator-results\n */\n\n/** @type {validateDictionary} */\nconst validateDictionary = hideStackFrames((value, name) => {\n  if (value != null && typeof value !== 'object' && typeof value !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE(name, 'a dictionary', value)\n  }\n})\n\n/**\n * @callback validateArray\n * @param {*} value\n * @param {string} name\n * @param {number} [minLength]\n * @returns {asserts value is any[]}\n */\n\n/** @type {validateArray} */\nconst validateArray = hideStackFrames((value, name, minLength = 0) => {\n  if (!ArrayIsArray(value)) {\n    throw new ERR_INVALID_ARG_TYPE(name, 'Array', value)\n  }\n  if (value.length < minLength) {\n    const reason = `must be longer than ${minLength}`\n    throw new ERR_INVALID_ARG_VALUE(name, value, reason)\n  }\n})\n\n/**\n * @callback validateStringArray\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is string[]}\n */\n\n/** @type {validateStringArray} */\nfunction validateStringArray(value, name) {\n  validateArray(value, name)\n  for (let i = 0; i < value.length; i++) {\n    validateString(value[i], `${name}[${i}]`)\n  }\n}\n\n/**\n * @callback validateBooleanArray\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is boolean[]}\n */\n\n/** @type {validateBooleanArray} */\nfunction validateBooleanArray(value, name) {\n  validateArray(value, name)\n  for (let i = 0; i < value.length; i++) {\n    validateBoolean(value[i], `${name}[${i}]`)\n  }\n}\n\n/**\n * @callback validateAbortSignalArray\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is AbortSignal[]}\n */\n\n/** @type {validateAbortSignalArray} */\nfunction validateAbortSignalArray(value, name) {\n  validateArray(value, name)\n  for (let i = 0; i < value.length; i++) {\n    const signal = value[i]\n    const indexedName = `${name}[${i}]`\n    if (signal == null) {\n      throw new ERR_INVALID_ARG_TYPE(indexedName, 'AbortSignal', signal)\n    }\n    validateAbortSignal(signal, indexedName)\n  }\n}\n\n/**\n * @param {*} signal\n * @param {string} [name='signal']\n * @returns {asserts signal is keyof signals}\n */\nfunction validateSignalName(signal, name = 'signal') {\n  validateString(signal, name)\n  if (signals[signal] === undefined) {\n    if (signals[StringPrototypeToUpperCase(signal)] !== undefined) {\n      throw new ERR_UNKNOWN_SIGNAL(signal + ' (signals must use all capital letters)')\n    }\n    throw new ERR_UNKNOWN_SIGNAL(signal)\n  }\n}\n\n/**\n * @callback validateBuffer\n * @param {*} buffer\n * @param {string} [name='buffer']\n * @returns {asserts buffer is ArrayBufferView}\n */\n\n/** @type {validateBuffer} */\nconst validateBuffer = hideStackFrames((buffer, name = 'buffer') => {\n  if (!isArrayBufferView(buffer)) {\n    throw new ERR_INVALID_ARG_TYPE(name, ['Buffer', 'TypedArray', 'DataView'], buffer)\n  }\n})\n\n/**\n * @param {string} data\n * @param {string} encoding\n */\nfunction validateEncoding(data, encoding) {\n  const normalizedEncoding = normalizeEncoding(encoding)\n  const length = data.length\n  if (normalizedEncoding === 'hex' && length % 2 !== 0) {\n    throw new ERR_INVALID_ARG_VALUE('encoding', encoding, `is invalid for data of length ${length}`)\n  }\n}\n\n/**\n * Check that the port number is not NaN when coerced to a number,\n * is an integer and that it falls within the legal range of port numbers.\n * @param {*} port\n * @param {string} [name='Port']\n * @param {boolean} [allowZero=true]\n * @returns {number}\n */\nfunction validatePort(port, name = 'Port', allowZero = true) {\n  if (\n    (typeof port !== 'number' && typeof port !== 'string') ||\n    (typeof port === 'string' && StringPrototypeTrim(port).length === 0) ||\n    +port !== +port >>> 0 ||\n    port > 0xffff ||\n    (port === 0 && !allowZero)\n  ) {\n    throw new ERR_SOCKET_BAD_PORT(name, port, allowZero)\n  }\n  return port | 0\n}\n\n/**\n * @callback validateAbortSignal\n * @param {*} signal\n * @param {string} name\n */\n\n/** @type {validateAbortSignal} */\nconst validateAbortSignal = hideStackFrames((signal, name) => {\n  if (signal !== undefined && (signal === null || typeof signal !== 'object' || !('aborted' in signal))) {\n    throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal)\n  }\n})\n\n/**\n * @callback validateFunction\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is Function}\n */\n\n/** @type {validateFunction} */\nconst validateFunction = hideStackFrames((value, name) => {\n  if (typeof value !== 'function') throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)\n})\n\n/**\n * @callback validatePlainFunction\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is Function}\n */\n\n/** @type {validatePlainFunction} */\nconst validatePlainFunction = hideStackFrames((value, name) => {\n  if (typeof value !== 'function' || isAsyncFunction(value)) throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)\n})\n\n/**\n * @callback validateUndefined\n * @param {*} value\n * @param {string} name\n * @returns {asserts value is undefined}\n */\n\n/** @type {validateUndefined} */\nconst validateUndefined = hideStackFrames((value, name) => {\n  if (value !== undefined) throw new ERR_INVALID_ARG_TYPE(name, 'undefined', value)\n})\n\n/**\n * @template T\n * @param {T} value\n * @param {string} name\n * @param {T[]} union\n */\nfunction validateUnion(value, name, union) {\n  if (!ArrayPrototypeIncludes(union, value)) {\n    throw new ERR_INVALID_ARG_TYPE(name, `('${ArrayPrototypeJoin(union, '|')}')`, value)\n  }\n}\n\n/*\n  The rules for the Link header field are described here:\n  https://www.rfc-editor.org/rfc/rfc8288.html#section-3\n\n  This regex validates any string surrounded by angle brackets\n  (not necessarily a valid URI reference) followed by zero or more\n  link-params separated by semicolons.\n*/\nconst linkValueRegExp = /^(?:<[^>]*>)(?:\\s*;\\s*[^;\"\\s]+(?:=(\")?[^;\"\\s]*\\1)?)*$/\n\n/**\n * @param {any} value\n * @param {string} name\n */\nfunction validateLinkHeaderFormat(value, name) {\n  if (typeof value === 'undefined' || !RegExpPrototypeExec(linkValueRegExp, value)) {\n    throw new ERR_INVALID_ARG_VALUE(\n      name,\n      value,\n      'must be an array or string of format \"; rel=preload; as=style\"'\n    )\n  }\n}\n\n/**\n * @param {any} hints\n * @return {string}\n */\nfunction validateLinkHeaderValue(hints) {\n  if (typeof hints === 'string') {\n    validateLinkHeaderFormat(hints, 'hints')\n    return hints\n  } else if (ArrayIsArray(hints)) {\n    const hintsLength = hints.length\n    let result = ''\n    if (hintsLength === 0) {\n      return result\n    }\n    for (let i = 0; i < hintsLength; i++) {\n      const link = hints[i]\n      validateLinkHeaderFormat(link, 'hints')\n      result += link\n      if (i !== hintsLength - 1) {\n        result += ', '\n      }\n    }\n    return result\n  }\n  throw new ERR_INVALID_ARG_VALUE(\n    'hints',\n    hints,\n    'must be an array or string of format \"; rel=preload; as=style\"'\n  )\n}\nmodule.exports = {\n  isInt32,\n  isUint32,\n  parseFileMode,\n  validateArray,\n  validateStringArray,\n  validateBooleanArray,\n  validateAbortSignalArray,\n  validateBoolean,\n  validateBuffer,\n  validateDictionary,\n  validateEncoding,\n  validateFunction,\n  validateInt32,\n  validateInteger,\n  validateNumber,\n  validateObject,\n  validateOneOf,\n  validatePlainFunction,\n  validatePort,\n  validateSignalName,\n  validateString,\n  validateUint32,\n  validateUndefined,\n  validateUnion,\n  validateAbortSignal,\n  validateLinkHeaderValue\n}\n","'use strict'\n\nconst { SymbolAsyncIterator, SymbolIterator, SymbolFor } = require('../../ours/primordials')\n\n// We need to use SymbolFor to make these globally available\n// for interopt with readable-stream, i.e. readable-stream\n// and node core needs to be able to read/write private state\n// from each other for proper interoperability.\nconst kIsDestroyed = SymbolFor('nodejs.stream.destroyed')\nconst kIsErrored = SymbolFor('nodejs.stream.errored')\nconst kIsReadable = SymbolFor('nodejs.stream.readable')\nconst kIsWritable = SymbolFor('nodejs.stream.writable')\nconst kIsDisturbed = SymbolFor('nodejs.stream.disturbed')\nconst kIsClosedPromise = SymbolFor('nodejs.webstream.isClosedPromise')\nconst kControllerErrorFunction = SymbolFor('nodejs.webstream.controllerErrorFunction')\nfunction isReadableNodeStream(obj, strict = false) {\n  var _obj$_readableState\n  return !!(\n    (\n      obj &&\n      typeof obj.pipe === 'function' &&\n      typeof obj.on === 'function' &&\n      (!strict || (typeof obj.pause === 'function' && typeof obj.resume === 'function')) &&\n      (!obj._writableState ||\n        ((_obj$_readableState = obj._readableState) === null || _obj$_readableState === undefined\n          ? undefined\n          : _obj$_readableState.readable) !== false) &&\n      // Duplex\n      (!obj._writableState || obj._readableState)\n    ) // Writable has .pipe.\n  )\n}\nfunction isWritableNodeStream(obj) {\n  var _obj$_writableState\n  return !!(\n    (\n      obj &&\n      typeof obj.write === 'function' &&\n      typeof obj.on === 'function' &&\n      (!obj._readableState ||\n        ((_obj$_writableState = obj._writableState) === null || _obj$_writableState === undefined\n          ? undefined\n          : _obj$_writableState.writable) !== false)\n    ) // Duplex\n  )\n}\nfunction isDuplexNodeStream(obj) {\n  return !!(\n    obj &&\n    typeof obj.pipe === 'function' &&\n    obj._readableState &&\n    typeof obj.on === 'function' &&\n    typeof obj.write === 'function'\n  )\n}\nfunction isNodeStream(obj) {\n  return (\n    obj &&\n    (obj._readableState ||\n      obj._writableState ||\n      (typeof obj.write === 'function' && typeof obj.on === 'function') ||\n      (typeof obj.pipe === 'function' && typeof obj.on === 'function'))\n  )\n}\nfunction isReadableStream(obj) {\n  return !!(\n    obj &&\n    !isNodeStream(obj) &&\n    typeof obj.pipeThrough === 'function' &&\n    typeof obj.getReader === 'function' &&\n    typeof obj.cancel === 'function'\n  )\n}\nfunction isWritableStream(obj) {\n  return !!(obj && !isNodeStream(obj) && typeof obj.getWriter === 'function' && typeof obj.abort === 'function')\n}\nfunction isTransformStream(obj) {\n  return !!(obj && !isNodeStream(obj) && typeof obj.readable === 'object' && typeof obj.writable === 'object')\n}\nfunction isWebStream(obj) {\n  return isReadableStream(obj) || isWritableStream(obj) || isTransformStream(obj)\n}\nfunction isIterable(obj, isAsync) {\n  if (obj == null) return false\n  if (isAsync === true) return typeof obj[SymbolAsyncIterator] === 'function'\n  if (isAsync === false) return typeof obj[SymbolIterator] === 'function'\n  return typeof obj[SymbolAsyncIterator] === 'function' || typeof obj[SymbolIterator] === 'function'\n}\nfunction isDestroyed(stream) {\n  if (!isNodeStream(stream)) return null\n  const wState = stream._writableState\n  const rState = stream._readableState\n  const state = wState || rState\n  return !!(stream.destroyed || stream[kIsDestroyed] || (state !== null && state !== undefined && state.destroyed))\n}\n\n// Have been end():d.\nfunction isWritableEnded(stream) {\n  if (!isWritableNodeStream(stream)) return null\n  if (stream.writableEnded === true) return true\n  const wState = stream._writableState\n  if (wState !== null && wState !== undefined && wState.errored) return false\n  if (typeof (wState === null || wState === undefined ? undefined : wState.ended) !== 'boolean') return null\n  return wState.ended\n}\n\n// Have emitted 'finish'.\nfunction isWritableFinished(stream, strict) {\n  if (!isWritableNodeStream(stream)) return null\n  if (stream.writableFinished === true) return true\n  const wState = stream._writableState\n  if (wState !== null && wState !== undefined && wState.errored) return false\n  if (typeof (wState === null || wState === undefined ? undefined : wState.finished) !== 'boolean') return null\n  return !!(wState.finished || (strict === false && wState.ended === true && wState.length === 0))\n}\n\n// Have been push(null):d.\nfunction isReadableEnded(stream) {\n  if (!isReadableNodeStream(stream)) return null\n  if (stream.readableEnded === true) return true\n  const rState = stream._readableState\n  if (!rState || rState.errored) return false\n  if (typeof (rState === null || rState === undefined ? undefined : rState.ended) !== 'boolean') return null\n  return rState.ended\n}\n\n// Have emitted 'end'.\nfunction isReadableFinished(stream, strict) {\n  if (!isReadableNodeStream(stream)) return null\n  const rState = stream._readableState\n  if (rState !== null && rState !== undefined && rState.errored) return false\n  if (typeof (rState === null || rState === undefined ? undefined : rState.endEmitted) !== 'boolean') return null\n  return !!(rState.endEmitted || (strict === false && rState.ended === true && rState.length === 0))\n}\nfunction isReadable(stream) {\n  if (stream && stream[kIsReadable] != null) return stream[kIsReadable]\n  if (typeof (stream === null || stream === undefined ? undefined : stream.readable) !== 'boolean') return null\n  if (isDestroyed(stream)) return false\n  return isReadableNodeStream(stream) && stream.readable && !isReadableFinished(stream)\n}\nfunction isWritable(stream) {\n  if (stream && stream[kIsWritable] != null) return stream[kIsWritable]\n  if (typeof (stream === null || stream === undefined ? undefined : stream.writable) !== 'boolean') return null\n  if (isDestroyed(stream)) return false\n  return isWritableNodeStream(stream) && stream.writable && !isWritableEnded(stream)\n}\nfunction isFinished(stream, opts) {\n  if (!isNodeStream(stream)) {\n    return null\n  }\n  if (isDestroyed(stream)) {\n    return true\n  }\n  if ((opts === null || opts === undefined ? undefined : opts.readable) !== false && isReadable(stream)) {\n    return false\n  }\n  if ((opts === null || opts === undefined ? undefined : opts.writable) !== false && isWritable(stream)) {\n    return false\n  }\n  return true\n}\nfunction isWritableErrored(stream) {\n  var _stream$_writableStat, _stream$_writableStat2\n  if (!isNodeStream(stream)) {\n    return null\n  }\n  if (stream.writableErrored) {\n    return stream.writableErrored\n  }\n  return (_stream$_writableStat =\n    (_stream$_writableStat2 = stream._writableState) === null || _stream$_writableStat2 === undefined\n      ? undefined\n      : _stream$_writableStat2.errored) !== null && _stream$_writableStat !== undefined\n    ? _stream$_writableStat\n    : null\n}\nfunction isReadableErrored(stream) {\n  var _stream$_readableStat, _stream$_readableStat2\n  if (!isNodeStream(stream)) {\n    return null\n  }\n  if (stream.readableErrored) {\n    return stream.readableErrored\n  }\n  return (_stream$_readableStat =\n    (_stream$_readableStat2 = stream._readableState) === null || _stream$_readableStat2 === undefined\n      ? undefined\n      : _stream$_readableStat2.errored) !== null && _stream$_readableStat !== undefined\n    ? _stream$_readableStat\n    : null\n}\nfunction isClosed(stream) {\n  if (!isNodeStream(stream)) {\n    return null\n  }\n  if (typeof stream.closed === 'boolean') {\n    return stream.closed\n  }\n  const wState = stream._writableState\n  const rState = stream._readableState\n  if (\n    typeof (wState === null || wState === undefined ? undefined : wState.closed) === 'boolean' ||\n    typeof (rState === null || rState === undefined ? undefined : rState.closed) === 'boolean'\n  ) {\n    return (\n      (wState === null || wState === undefined ? undefined : wState.closed) ||\n      (rState === null || rState === undefined ? undefined : rState.closed)\n    )\n  }\n  if (typeof stream._closed === 'boolean' && isOutgoingMessage(stream)) {\n    return stream._closed\n  }\n  return null\n}\nfunction isOutgoingMessage(stream) {\n  return (\n    typeof stream._closed === 'boolean' &&\n    typeof stream._defaultKeepAlive === 'boolean' &&\n    typeof stream._removedConnection === 'boolean' &&\n    typeof stream._removedContLen === 'boolean'\n  )\n}\nfunction isServerResponse(stream) {\n  return typeof stream._sent100 === 'boolean' && isOutgoingMessage(stream)\n}\nfunction isServerRequest(stream) {\n  var _stream$req\n  return (\n    typeof stream._consuming === 'boolean' &&\n    typeof stream._dumped === 'boolean' &&\n    ((_stream$req = stream.req) === null || _stream$req === undefined ? undefined : _stream$req.upgradeOrConnect) ===\n      undefined\n  )\n}\nfunction willEmitClose(stream) {\n  if (!isNodeStream(stream)) return null\n  const wState = stream._writableState\n  const rState = stream._readableState\n  const state = wState || rState\n  return (\n    (!state && isServerResponse(stream)) || !!(state && state.autoDestroy && state.emitClose && state.closed === false)\n  )\n}\nfunction isDisturbed(stream) {\n  var _stream$kIsDisturbed\n  return !!(\n    stream &&\n    ((_stream$kIsDisturbed = stream[kIsDisturbed]) !== null && _stream$kIsDisturbed !== undefined\n      ? _stream$kIsDisturbed\n      : stream.readableDidRead || stream.readableAborted)\n  )\n}\nfunction isErrored(stream) {\n  var _ref,\n    _ref2,\n    _ref3,\n    _ref4,\n    _ref5,\n    _stream$kIsErrored,\n    _stream$_readableStat3,\n    _stream$_writableStat3,\n    _stream$_readableStat4,\n    _stream$_writableStat4\n  return !!(\n    stream &&\n    ((_ref =\n      (_ref2 =\n        (_ref3 =\n          (_ref4 =\n            (_ref5 =\n              (_stream$kIsErrored = stream[kIsErrored]) !== null && _stream$kIsErrored !== undefined\n                ? _stream$kIsErrored\n                : stream.readableErrored) !== null && _ref5 !== undefined\n              ? _ref5\n              : stream.writableErrored) !== null && _ref4 !== undefined\n            ? _ref4\n            : (_stream$_readableStat3 = stream._readableState) === null || _stream$_readableStat3 === undefined\n            ? undefined\n            : _stream$_readableStat3.errorEmitted) !== null && _ref3 !== undefined\n          ? _ref3\n          : (_stream$_writableStat3 = stream._writableState) === null || _stream$_writableStat3 === undefined\n          ? undefined\n          : _stream$_writableStat3.errorEmitted) !== null && _ref2 !== undefined\n        ? _ref2\n        : (_stream$_readableStat4 = stream._readableState) === null || _stream$_readableStat4 === undefined\n        ? undefined\n        : _stream$_readableStat4.errored) !== null && _ref !== undefined\n      ? _ref\n      : (_stream$_writableStat4 = stream._writableState) === null || _stream$_writableStat4 === undefined\n      ? undefined\n      : _stream$_writableStat4.errored)\n  )\n}\nmodule.exports = {\n  isDestroyed,\n  kIsDestroyed,\n  isDisturbed,\n  kIsDisturbed,\n  isErrored,\n  kIsErrored,\n  isReadable,\n  kIsReadable,\n  kIsClosedPromise,\n  kControllerErrorFunction,\n  kIsWritable,\n  isClosed,\n  isDuplexNodeStream,\n  isFinished,\n  isIterable,\n  isReadableNodeStream,\n  isReadableStream,\n  isReadableEnded,\n  isReadableFinished,\n  isReadableErrored,\n  isNodeStream,\n  isWebStream,\n  isWritable,\n  isWritableNodeStream,\n  isWritableStream,\n  isWritableEnded,\n  isWritableFinished,\n  isWritableErrored,\n  isServerRequest,\n  isServerResponse,\n  willEmitClose,\n  isTransformStream\n}\n","// Ported from https://github.com/mafintosh/end-of-stream with\n// permission from the author, Mathias Buus (@mafintosh).\n\n'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst { AbortError, codes } = require('../../ours/errors')\nconst { ERR_INVALID_ARG_TYPE, ERR_STREAM_PREMATURE_CLOSE } = codes\nconst { kEmptyObject, once } = require('../../ours/util')\nconst { validateAbortSignal, validateFunction, validateObject, validateBoolean } = require('../validators')\nconst { Promise, PromisePrototypeThen, SymbolDispose } = require('../../ours/primordials')\nconst {\n  isClosed,\n  isReadable,\n  isReadableNodeStream,\n  isReadableStream,\n  isReadableFinished,\n  isReadableErrored,\n  isWritable,\n  isWritableNodeStream,\n  isWritableStream,\n  isWritableFinished,\n  isWritableErrored,\n  isNodeStream,\n  willEmitClose: _willEmitClose,\n  kIsClosedPromise\n} = require('./utils')\nlet addAbortListener\nfunction isRequest(stream) {\n  return stream.setHeader && typeof stream.abort === 'function'\n}\nconst nop = () => {}\nfunction eos(stream, options, callback) {\n  var _options$readable, _options$writable\n  if (arguments.length === 2) {\n    callback = options\n    options = kEmptyObject\n  } else if (options == null) {\n    options = kEmptyObject\n  } else {\n    validateObject(options, 'options')\n  }\n  validateFunction(callback, 'callback')\n  validateAbortSignal(options.signal, 'options.signal')\n  callback = once(callback)\n  if (isReadableStream(stream) || isWritableStream(stream)) {\n    return eosWeb(stream, options, callback)\n  }\n  if (!isNodeStream(stream)) {\n    throw new ERR_INVALID_ARG_TYPE('stream', ['ReadableStream', 'WritableStream', 'Stream'], stream)\n  }\n  const readable =\n    (_options$readable = options.readable) !== null && _options$readable !== undefined\n      ? _options$readable\n      : isReadableNodeStream(stream)\n  const writable =\n    (_options$writable = options.writable) !== null && _options$writable !== undefined\n      ? _options$writable\n      : isWritableNodeStream(stream)\n  const wState = stream._writableState\n  const rState = stream._readableState\n  const onlegacyfinish = () => {\n    if (!stream.writable) {\n      onfinish()\n    }\n  }\n\n  // TODO (ronag): Improve soft detection to include core modules and\n  // common ecosystem modules that do properly emit 'close' but fail\n  // this generic check.\n  let willEmitClose =\n    _willEmitClose(stream) && isReadableNodeStream(stream) === readable && isWritableNodeStream(stream) === writable\n  let writableFinished = isWritableFinished(stream, false)\n  const onfinish = () => {\n    writableFinished = true\n    // Stream should not be destroyed here. If it is that\n    // means that user space is doing something differently and\n    // we cannot trust willEmitClose.\n    if (stream.destroyed) {\n      willEmitClose = false\n    }\n    if (willEmitClose && (!stream.readable || readable)) {\n      return\n    }\n    if (!readable || readableFinished) {\n      callback.call(stream)\n    }\n  }\n  let readableFinished = isReadableFinished(stream, false)\n  const onend = () => {\n    readableFinished = true\n    // Stream should not be destroyed here. If it is that\n    // means that user space is doing something differently and\n    // we cannot trust willEmitClose.\n    if (stream.destroyed) {\n      willEmitClose = false\n    }\n    if (willEmitClose && (!stream.writable || writable)) {\n      return\n    }\n    if (!writable || writableFinished) {\n      callback.call(stream)\n    }\n  }\n  const onerror = (err) => {\n    callback.call(stream, err)\n  }\n  let closed = isClosed(stream)\n  const onclose = () => {\n    closed = true\n    const errored = isWritableErrored(stream) || isReadableErrored(stream)\n    if (errored && typeof errored !== 'boolean') {\n      return callback.call(stream, errored)\n    }\n    if (readable && !readableFinished && isReadableNodeStream(stream, true)) {\n      if (!isReadableFinished(stream, false)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE())\n    }\n    if (writable && !writableFinished) {\n      if (!isWritableFinished(stream, false)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE())\n    }\n    callback.call(stream)\n  }\n  const onclosed = () => {\n    closed = true\n    const errored = isWritableErrored(stream) || isReadableErrored(stream)\n    if (errored && typeof errored !== 'boolean') {\n      return callback.call(stream, errored)\n    }\n    callback.call(stream)\n  }\n  const onrequest = () => {\n    stream.req.on('finish', onfinish)\n  }\n  if (isRequest(stream)) {\n    stream.on('complete', onfinish)\n    if (!willEmitClose) {\n      stream.on('abort', onclose)\n    }\n    if (stream.req) {\n      onrequest()\n    } else {\n      stream.on('request', onrequest)\n    }\n  } else if (writable && !wState) {\n    // legacy streams\n    stream.on('end', onlegacyfinish)\n    stream.on('close', onlegacyfinish)\n  }\n\n  // Not all streams will emit 'close' after 'aborted'.\n  if (!willEmitClose && typeof stream.aborted === 'boolean') {\n    stream.on('aborted', onclose)\n  }\n  stream.on('end', onend)\n  stream.on('finish', onfinish)\n  if (options.error !== false) {\n    stream.on('error', onerror)\n  }\n  stream.on('close', onclose)\n  if (closed) {\n    process.nextTick(onclose)\n  } else if (\n    (wState !== null && wState !== undefined && wState.errorEmitted) ||\n    (rState !== null && rState !== undefined && rState.errorEmitted)\n  ) {\n    if (!willEmitClose) {\n      process.nextTick(onclosed)\n    }\n  } else if (\n    !readable &&\n    (!willEmitClose || isReadable(stream)) &&\n    (writableFinished || isWritable(stream) === false)\n  ) {\n    process.nextTick(onclosed)\n  } else if (\n    !writable &&\n    (!willEmitClose || isWritable(stream)) &&\n    (readableFinished || isReadable(stream) === false)\n  ) {\n    process.nextTick(onclosed)\n  } else if (rState && stream.req && stream.aborted) {\n    process.nextTick(onclosed)\n  }\n  const cleanup = () => {\n    callback = nop\n    stream.removeListener('aborted', onclose)\n    stream.removeListener('complete', onfinish)\n    stream.removeListener('abort', onclose)\n    stream.removeListener('request', onrequest)\n    if (stream.req) stream.req.removeListener('finish', onfinish)\n    stream.removeListener('end', onlegacyfinish)\n    stream.removeListener('close', onlegacyfinish)\n    stream.removeListener('finish', onfinish)\n    stream.removeListener('end', onend)\n    stream.removeListener('error', onerror)\n    stream.removeListener('close', onclose)\n  }\n  if (options.signal && !closed) {\n    const abort = () => {\n      // Keep it because cleanup removes it.\n      const endCallback = callback\n      cleanup()\n      endCallback.call(\n        stream,\n        new AbortError(undefined, {\n          cause: options.signal.reason\n        })\n      )\n    }\n    if (options.signal.aborted) {\n      process.nextTick(abort)\n    } else {\n      addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n      const disposable = addAbortListener(options.signal, abort)\n      const originalCallback = callback\n      callback = once((...args) => {\n        disposable[SymbolDispose]()\n        originalCallback.apply(stream, args)\n      })\n    }\n  }\n  return cleanup\n}\nfunction eosWeb(stream, options, callback) {\n  let isAborted = false\n  let abort = nop\n  if (options.signal) {\n    abort = () => {\n      isAborted = true\n      callback.call(\n        stream,\n        new AbortError(undefined, {\n          cause: options.signal.reason\n        })\n      )\n    }\n    if (options.signal.aborted) {\n      process.nextTick(abort)\n    } else {\n      addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n      const disposable = addAbortListener(options.signal, abort)\n      const originalCallback = callback\n      callback = once((...args) => {\n        disposable[SymbolDispose]()\n        originalCallback.apply(stream, args)\n      })\n    }\n  }\n  const resolverFn = (...args) => {\n    if (!isAborted) {\n      process.nextTick(() => callback.apply(stream, args))\n    }\n  }\n  PromisePrototypeThen(stream[kIsClosedPromise].promise, resolverFn, resolverFn)\n  return nop\n}\nfunction finished(stream, opts) {\n  var _opts\n  let autoCleanup = false\n  if (opts === null) {\n    opts = kEmptyObject\n  }\n  if ((_opts = opts) !== null && _opts !== undefined && _opts.cleanup) {\n    validateBoolean(opts.cleanup, 'cleanup')\n    autoCleanup = opts.cleanup\n  }\n  return new Promise((resolve, reject) => {\n    const cleanup = eos(stream, opts, (err) => {\n      if (autoCleanup) {\n        cleanup()\n      }\n      if (err) {\n        reject(err)\n      } else {\n        resolve()\n      }\n    })\n  })\n}\nmodule.exports = eos\nmodule.exports.finished = finished\n","'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst {\n  aggregateTwoErrors,\n  codes: { ERR_MULTIPLE_CALLBACK },\n  AbortError\n} = require('../../ours/errors')\nconst { Symbol } = require('../../ours/primordials')\nconst { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require('./utils')\nconst kDestroy = Symbol('kDestroy')\nconst kConstruct = Symbol('kConstruct')\nfunction checkError(err, w, r) {\n  if (err) {\n    // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364\n    err.stack // eslint-disable-line no-unused-expressions\n\n    if (w && !w.errored) {\n      w.errored = err\n    }\n    if (r && !r.errored) {\n      r.errored = err\n    }\n  }\n}\n\n// Backwards compat. cb() is undocumented and unused in core but\n// unfortunately might be used by modules.\nfunction destroy(err, cb) {\n  const r = this._readableState\n  const w = this._writableState\n  // With duplex streams we use the writable side for state.\n  const s = w || r\n  if ((w !== null && w !== undefined && w.destroyed) || (r !== null && r !== undefined && r.destroyed)) {\n    if (typeof cb === 'function') {\n      cb()\n    }\n    return this\n  }\n\n  // We set destroyed to true before firing error callbacks in order\n  // to make it re-entrance safe in case destroy() is called within callbacks\n  checkError(err, w, r)\n  if (w) {\n    w.destroyed = true\n  }\n  if (r) {\n    r.destroyed = true\n  }\n\n  // If still constructing then defer calling _destroy.\n  if (!s.constructed) {\n    this.once(kDestroy, function (er) {\n      _destroy(this, aggregateTwoErrors(er, err), cb)\n    })\n  } else {\n    _destroy(this, err, cb)\n  }\n  return this\n}\nfunction _destroy(self, err, cb) {\n  let called = false\n  function onDestroy(err) {\n    if (called) {\n      return\n    }\n    called = true\n    const r = self._readableState\n    const w = self._writableState\n    checkError(err, w, r)\n    if (w) {\n      w.closed = true\n    }\n    if (r) {\n      r.closed = true\n    }\n    if (typeof cb === 'function') {\n      cb(err)\n    }\n    if (err) {\n      process.nextTick(emitErrorCloseNT, self, err)\n    } else {\n      process.nextTick(emitCloseNT, self)\n    }\n  }\n  try {\n    self._destroy(err || null, onDestroy)\n  } catch (err) {\n    onDestroy(err)\n  }\n}\nfunction emitErrorCloseNT(self, err) {\n  emitErrorNT(self, err)\n  emitCloseNT(self)\n}\nfunction emitCloseNT(self) {\n  const r = self._readableState\n  const w = self._writableState\n  if (w) {\n    w.closeEmitted = true\n  }\n  if (r) {\n    r.closeEmitted = true\n  }\n  if ((w !== null && w !== undefined && w.emitClose) || (r !== null && r !== undefined && r.emitClose)) {\n    self.emit('close')\n  }\n}\nfunction emitErrorNT(self, err) {\n  const r = self._readableState\n  const w = self._writableState\n  if ((w !== null && w !== undefined && w.errorEmitted) || (r !== null && r !== undefined && r.errorEmitted)) {\n    return\n  }\n  if (w) {\n    w.errorEmitted = true\n  }\n  if (r) {\n    r.errorEmitted = true\n  }\n  self.emit('error', err)\n}\nfunction undestroy() {\n  const r = this._readableState\n  const w = this._writableState\n  if (r) {\n    r.constructed = true\n    r.closed = false\n    r.closeEmitted = false\n    r.destroyed = false\n    r.errored = null\n    r.errorEmitted = false\n    r.reading = false\n    r.ended = r.readable === false\n    r.endEmitted = r.readable === false\n  }\n  if (w) {\n    w.constructed = true\n    w.destroyed = false\n    w.closed = false\n    w.closeEmitted = false\n    w.errored = null\n    w.errorEmitted = false\n    w.finalCalled = false\n    w.prefinished = false\n    w.ended = w.writable === false\n    w.ending = w.writable === false\n    w.finished = w.writable === false\n  }\n}\nfunction errorOrDestroy(stream, err, sync) {\n  // We have tests that rely on errors being emitted\n  // in the same tick, so changing this is semver major.\n  // For now when you opt-in to autoDestroy we allow\n  // the error to be emitted nextTick. In a future\n  // semver major update we should change the default to this.\n\n  const r = stream._readableState\n  const w = stream._writableState\n  if ((w !== null && w !== undefined && w.destroyed) || (r !== null && r !== undefined && r.destroyed)) {\n    return this\n  }\n  if ((r !== null && r !== undefined && r.autoDestroy) || (w !== null && w !== undefined && w.autoDestroy))\n    stream.destroy(err)\n  else if (err) {\n    // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364\n    err.stack // eslint-disable-line no-unused-expressions\n\n    if (w && !w.errored) {\n      w.errored = err\n    }\n    if (r && !r.errored) {\n      r.errored = err\n    }\n    if (sync) {\n      process.nextTick(emitErrorNT, stream, err)\n    } else {\n      emitErrorNT(stream, err)\n    }\n  }\n}\nfunction construct(stream, cb) {\n  if (typeof stream._construct !== 'function') {\n    return\n  }\n  const r = stream._readableState\n  const w = stream._writableState\n  if (r) {\n    r.constructed = false\n  }\n  if (w) {\n    w.constructed = false\n  }\n  stream.once(kConstruct, cb)\n  if (stream.listenerCount(kConstruct) > 1) {\n    // Duplex\n    return\n  }\n  process.nextTick(constructNT, stream)\n}\nfunction constructNT(stream) {\n  let called = false\n  function onConstruct(err) {\n    if (called) {\n      errorOrDestroy(stream, err !== null && err !== undefined ? err : new ERR_MULTIPLE_CALLBACK())\n      return\n    }\n    called = true\n    const r = stream._readableState\n    const w = stream._writableState\n    const s = w || r\n    if (r) {\n      r.constructed = true\n    }\n    if (w) {\n      w.constructed = true\n    }\n    if (s.destroyed) {\n      stream.emit(kDestroy, err)\n    } else if (err) {\n      errorOrDestroy(stream, err, true)\n    } else {\n      process.nextTick(emitConstructNT, stream)\n    }\n  }\n  try {\n    stream._construct((err) => {\n      process.nextTick(onConstruct, err)\n    })\n  } catch (err) {\n    process.nextTick(onConstruct, err)\n  }\n}\nfunction emitConstructNT(stream) {\n  stream.emit(kConstruct)\n}\nfunction isRequest(stream) {\n  return (stream === null || stream === undefined ? undefined : stream.setHeader) && typeof stream.abort === 'function'\n}\nfunction emitCloseLegacy(stream) {\n  stream.emit('close')\n}\nfunction emitErrorCloseLegacy(stream, err) {\n  stream.emit('error', err)\n  process.nextTick(emitCloseLegacy, stream)\n}\n\n// Normalize destroy for legacy.\nfunction destroyer(stream, err) {\n  if (!stream || isDestroyed(stream)) {\n    return\n  }\n  if (!err && !isFinished(stream)) {\n    err = new AbortError()\n  }\n\n  // TODO: Remove isRequest branches.\n  if (isServerRequest(stream)) {\n    stream.socket = null\n    stream.destroy(err)\n  } else if (isRequest(stream)) {\n    stream.abort()\n  } else if (isRequest(stream.req)) {\n    stream.req.abort()\n  } else if (typeof stream.destroy === 'function') {\n    stream.destroy(err)\n  } else if (typeof stream.close === 'function') {\n    // TODO: Don't lose err?\n    stream.close()\n  } else if (err) {\n    process.nextTick(emitErrorCloseLegacy, stream, err)\n  } else {\n    process.nextTick(emitCloseLegacy, stream)\n  }\n  if (!stream.destroyed) {\n    stream[kIsDestroyed] = true\n  }\n}\nmodule.exports = {\n  construct,\n  destroyer,\n  destroy,\n  undestroy,\n  errorOrDestroy\n}\n","'use strict'\n\nconst { ArrayIsArray, ObjectSetPrototypeOf } = require('../../ours/primordials')\nconst { EventEmitter: EE } = require('events')\nfunction Stream(opts) {\n  EE.call(this, opts)\n}\nObjectSetPrototypeOf(Stream.prototype, EE.prototype)\nObjectSetPrototypeOf(Stream, EE)\nStream.prototype.pipe = function (dest, options) {\n  const source = this\n  function ondata(chunk) {\n    if (dest.writable && dest.write(chunk) === false && source.pause) {\n      source.pause()\n    }\n  }\n  source.on('data', ondata)\n  function ondrain() {\n    if (source.readable && source.resume) {\n      source.resume()\n    }\n  }\n  dest.on('drain', ondrain)\n\n  // If the 'end' option is not supplied, dest.end() will be called when\n  // source gets the 'end' or 'close' events.  Only dest.end() once.\n  if (!dest._isStdio && (!options || options.end !== false)) {\n    source.on('end', onend)\n    source.on('close', onclose)\n  }\n  let didOnEnd = false\n  function onend() {\n    if (didOnEnd) return\n    didOnEnd = true\n    dest.end()\n  }\n  function onclose() {\n    if (didOnEnd) return\n    didOnEnd = true\n    if (typeof dest.destroy === 'function') dest.destroy()\n  }\n\n  // Don't leave dangling pipes when there are errors.\n  function onerror(er) {\n    cleanup()\n    if (EE.listenerCount(this, 'error') === 0) {\n      this.emit('error', er)\n    }\n  }\n  prependListener(source, 'error', onerror)\n  prependListener(dest, 'error', onerror)\n\n  // Remove all the event listeners that were added.\n  function cleanup() {\n    source.removeListener('data', ondata)\n    dest.removeListener('drain', ondrain)\n    source.removeListener('end', onend)\n    source.removeListener('close', onclose)\n    source.removeListener('error', onerror)\n    dest.removeListener('error', onerror)\n    source.removeListener('end', cleanup)\n    source.removeListener('close', cleanup)\n    dest.removeListener('close', cleanup)\n  }\n  source.on('end', cleanup)\n  source.on('close', cleanup)\n  dest.on('close', cleanup)\n  dest.emit('pipe', source)\n\n  // Allow for unix-like usage: A.pipe(B).pipe(C)\n  return dest\n}\nfunction prependListener(emitter, event, fn) {\n  // Sadly this is not cacheable as some libraries bundle their own\n  // event emitter implementation with them.\n  if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn)\n\n  // This is a hack to make sure that our error handler is attached before any\n  // userland ones.  NEVER DO THIS. This is here only because this code needs\n  // to continue to work with older versions of Node.js that do not include\n  // the prependListener() method. The goal is to eventually remove this hack.\n  if (!emitter._events || !emitter._events[event]) emitter.on(event, fn)\n  else if (ArrayIsArray(emitter._events[event])) emitter._events[event].unshift(fn)\n  else emitter._events[event] = [fn, emitter._events[event]]\n}\nmodule.exports = {\n  Stream,\n  prependListener\n}\n","'use strict'\n\nconst { SymbolDispose } = require('../../ours/primordials')\nconst { AbortError, codes } = require('../../ours/errors')\nconst { isNodeStream, isWebStream, kControllerErrorFunction } = require('./utils')\nconst eos = require('./end-of-stream')\nconst { ERR_INVALID_ARG_TYPE } = codes\nlet addAbortListener\n\n// This method is inlined here for readable-stream\n// It also does not allow for signal to not exist on the stream\n// https://github.com/nodejs/node/pull/36061#discussion_r533718029\nconst validateAbortSignal = (signal, name) => {\n  if (typeof signal !== 'object' || !('aborted' in signal)) {\n    throw new ERR_INVALID_ARG_TYPE(name, 'AbortSignal', signal)\n  }\n}\nmodule.exports.addAbortSignal = function addAbortSignal(signal, stream) {\n  validateAbortSignal(signal, 'signal')\n  if (!isNodeStream(stream) && !isWebStream(stream)) {\n    throw new ERR_INVALID_ARG_TYPE('stream', ['ReadableStream', 'WritableStream', 'Stream'], stream)\n  }\n  return module.exports.addAbortSignalNoValidate(signal, stream)\n}\nmodule.exports.addAbortSignalNoValidate = function (signal, stream) {\n  if (typeof signal !== 'object' || !('aborted' in signal)) {\n    return stream\n  }\n  const onAbort = isNodeStream(stream)\n    ? () => {\n        stream.destroy(\n          new AbortError(undefined, {\n            cause: signal.reason\n          })\n        )\n      }\n    : () => {\n        stream[kControllerErrorFunction](\n          new AbortError(undefined, {\n            cause: signal.reason\n          })\n        )\n      }\n  if (signal.aborted) {\n    onAbort()\n  } else {\n    addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n    const disposable = addAbortListener(signal, onAbort)\n    eos(stream, disposable[SymbolDispose])\n  }\n  return stream\n}\n","'use strict'\n\nconst { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array } = require('../../ours/primordials')\nconst { Buffer } = require('buffer')\nconst { inspect } = require('../../ours/util')\nmodule.exports = class BufferList {\n  constructor() {\n    this.head = null\n    this.tail = null\n    this.length = 0\n  }\n  push(v) {\n    const entry = {\n      data: v,\n      next: null\n    }\n    if (this.length > 0) this.tail.next = entry\n    else this.head = entry\n    this.tail = entry\n    ++this.length\n  }\n  unshift(v) {\n    const entry = {\n      data: v,\n      next: this.head\n    }\n    if (this.length === 0) this.tail = entry\n    this.head = entry\n    ++this.length\n  }\n  shift() {\n    if (this.length === 0) return\n    const ret = this.head.data\n    if (this.length === 1) this.head = this.tail = null\n    else this.head = this.head.next\n    --this.length\n    return ret\n  }\n  clear() {\n    this.head = this.tail = null\n    this.length = 0\n  }\n  join(s) {\n    if (this.length === 0) return ''\n    let p = this.head\n    let ret = '' + p.data\n    while ((p = p.next) !== null) ret += s + p.data\n    return ret\n  }\n  concat(n) {\n    if (this.length === 0) return Buffer.alloc(0)\n    const ret = Buffer.allocUnsafe(n >>> 0)\n    let p = this.head\n    let i = 0\n    while (p) {\n      TypedArrayPrototypeSet(ret, p.data, i)\n      i += p.data.length\n      p = p.next\n    }\n    return ret\n  }\n\n  // Consumes a specified amount of bytes or characters from the buffered data.\n  consume(n, hasStrings) {\n    const data = this.head.data\n    if (n < data.length) {\n      // `slice` is the same for buffers and strings.\n      const slice = data.slice(0, n)\n      this.head.data = data.slice(n)\n      return slice\n    }\n    if (n === data.length) {\n      // First chunk is a perfect match.\n      return this.shift()\n    }\n    // Result spans more than one buffer.\n    return hasStrings ? this._getString(n) : this._getBuffer(n)\n  }\n  first() {\n    return this.head.data\n  }\n  *[SymbolIterator]() {\n    for (let p = this.head; p; p = p.next) {\n      yield p.data\n    }\n  }\n\n  // Consumes a specified amount of characters from the buffered data.\n  _getString(n) {\n    let ret = ''\n    let p = this.head\n    let c = 0\n    do {\n      const str = p.data\n      if (n > str.length) {\n        ret += str\n        n -= str.length\n      } else {\n        if (n === str.length) {\n          ret += str\n          ++c\n          if (p.next) this.head = p.next\n          else this.head = this.tail = null\n        } else {\n          ret += StringPrototypeSlice(str, 0, n)\n          this.head = p\n          p.data = StringPrototypeSlice(str, n)\n        }\n        break\n      }\n      ++c\n    } while ((p = p.next) !== null)\n    this.length -= c\n    return ret\n  }\n\n  // Consumes a specified amount of bytes from the buffered data.\n  _getBuffer(n) {\n    const ret = Buffer.allocUnsafe(n)\n    const retLen = n\n    let p = this.head\n    let c = 0\n    do {\n      const buf = p.data\n      if (n > buf.length) {\n        TypedArrayPrototypeSet(ret, buf, retLen - n)\n        n -= buf.length\n      } else {\n        if (n === buf.length) {\n          TypedArrayPrototypeSet(ret, buf, retLen - n)\n          ++c\n          if (p.next) this.head = p.next\n          else this.head = this.tail = null\n        } else {\n          TypedArrayPrototypeSet(ret, new Uint8Array(buf.buffer, buf.byteOffset, n), retLen - n)\n          this.head = p\n          p.data = buf.slice(n)\n        }\n        break\n      }\n      ++c\n    } while ((p = p.next) !== null)\n    this.length -= c\n    return ret\n  }\n\n  // Make sure the linked list only shows the minimal necessary information.\n  [Symbol.for('nodejs.util.inspect.custom')](_, options) {\n    return inspect(this, {\n      ...options,\n      // Only inspect one level.\n      depth: 0,\n      // It should not recurse.\n      customInspect: false\n    })\n  }\n}\n","'use strict'\n\nconst { MathFloor, NumberIsInteger } = require('../../ours/primordials')\nconst { validateInteger } = require('../validators')\nconst { ERR_INVALID_ARG_VALUE } = require('../../ours/errors').codes\nlet defaultHighWaterMarkBytes = 16 * 1024\nlet defaultHighWaterMarkObjectMode = 16\nfunction highWaterMarkFrom(options, isDuplex, duplexKey) {\n  return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null\n}\nfunction getDefaultHighWaterMark(objectMode) {\n  return objectMode ? defaultHighWaterMarkObjectMode : defaultHighWaterMarkBytes\n}\nfunction setDefaultHighWaterMark(objectMode, value) {\n  validateInteger(value, 'value', 0)\n  if (objectMode) {\n    defaultHighWaterMarkObjectMode = value\n  } else {\n    defaultHighWaterMarkBytes = value\n  }\n}\nfunction getHighWaterMark(state, options, duplexKey, isDuplex) {\n  const hwm = highWaterMarkFrom(options, isDuplex, duplexKey)\n  if (hwm != null) {\n    if (!NumberIsInteger(hwm) || hwm < 0) {\n      const name = isDuplex ? `options.${duplexKey}` : 'options.highWaterMark'\n      throw new ERR_INVALID_ARG_VALUE(name, hwm)\n    }\n    return MathFloor(hwm)\n  }\n\n  // Default value\n  return getDefaultHighWaterMark(state.objectMode)\n}\nmodule.exports = {\n  getHighWaterMark,\n  getDefaultHighWaterMark,\n  setDefaultHighWaterMark\n}\n","/*! safe-buffer. MIT License. Feross Aboukhadijeh  */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n  for (var key in src) {\n    dst[key] = src[key]\n  }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n  module.exports = buffer\n} else {\n  // Copy properties from require('buffer')\n  copyProps(buffer, exports)\n  exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n  return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n  if (typeof arg === 'number') {\n    throw new TypeError('Argument must not be a number')\n  }\n  return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  var buf = Buffer(size)\n  if (fill !== undefined) {\n    if (typeof encoding === 'string') {\n      buf.fill(fill, encoding)\n    } else {\n      buf.fill(fill)\n    }\n  } else {\n    buf.fill(0)\n  }\n  return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  return buffer.SlowBuffer(size)\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/**/\n\nvar Buffer = require('safe-buffer').Buffer;\n/**/\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n  encoding = '' + encoding;\n  switch (encoding && encoding.toLowerCase()) {\n    case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':\n      return true;\n    default:\n      return false;\n  }\n};\n\nfunction _normalizeEncoding(enc) {\n  if (!enc) return 'utf8';\n  var retried;\n  while (true) {\n    switch (enc) {\n      case 'utf8':\n      case 'utf-8':\n        return 'utf8';\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return 'utf16le';\n      case 'latin1':\n      case 'binary':\n        return 'latin1';\n      case 'base64':\n      case 'ascii':\n      case 'hex':\n        return enc;\n      default:\n        if (retried) return; // undefined\n        enc = ('' + enc).toLowerCase();\n        retried = true;\n    }\n  }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n  var nenc = _normalizeEncoding(enc);\n  if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n  return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n  this.encoding = normalizeEncoding(encoding);\n  var nb;\n  switch (this.encoding) {\n    case 'utf16le':\n      this.text = utf16Text;\n      this.end = utf16End;\n      nb = 4;\n      break;\n    case 'utf8':\n      this.fillLast = utf8FillLast;\n      nb = 4;\n      break;\n    case 'base64':\n      this.text = base64Text;\n      this.end = base64End;\n      nb = 3;\n      break;\n    default:\n      this.write = simpleWrite;\n      this.end = simpleEnd;\n      return;\n  }\n  this.lastNeed = 0;\n  this.lastTotal = 0;\n  this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n  if (buf.length === 0) return '';\n  var r;\n  var i;\n  if (this.lastNeed) {\n    r = this.fillLast(buf);\n    if (r === undefined) return '';\n    i = this.lastNeed;\n    this.lastNeed = 0;\n  } else {\n    i = 0;\n  }\n  if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n  return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n  if (this.lastNeed <= buf.length) {\n    buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n    return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n  }\n  buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n  this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte. If an invalid byte is detected, -2 is returned.\nfunction utf8CheckByte(byte) {\n  if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n  return byte >> 6 === 0x02 ? -1 : -2;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n  var j = buf.length - 1;\n  if (j < i) return 0;\n  var nb = utf8CheckByte(buf[j]);\n  if (nb >= 0) {\n    if (nb > 0) self.lastNeed = nb - 1;\n    return nb;\n  }\n  if (--j < i || nb === -2) return 0;\n  nb = utf8CheckByte(buf[j]);\n  if (nb >= 0) {\n    if (nb > 0) self.lastNeed = nb - 2;\n    return nb;\n  }\n  if (--j < i || nb === -2) return 0;\n  nb = utf8CheckByte(buf[j]);\n  if (nb >= 0) {\n    if (nb > 0) {\n      if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n    }\n    return nb;\n  }\n  return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// a single UTF-8 replacement character ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n  if ((buf[0] & 0xC0) !== 0x80) {\n    self.lastNeed = 0;\n    return '\\ufffd';\n  }\n  if (self.lastNeed > 1 && buf.length > 1) {\n    if ((buf[1] & 0xC0) !== 0x80) {\n      self.lastNeed = 1;\n      return '\\ufffd';\n    }\n    if (self.lastNeed > 2 && buf.length > 2) {\n      if ((buf[2] & 0xC0) !== 0x80) {\n        self.lastNeed = 2;\n        return '\\ufffd';\n      }\n    }\n  }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n  var p = this.lastTotal - this.lastNeed;\n  var r = utf8CheckExtraBytes(this, buf, p);\n  if (r !== undefined) return r;\n  if (this.lastNeed <= buf.length) {\n    buf.copy(this.lastChar, p, 0, this.lastNeed);\n    return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n  }\n  buf.copy(this.lastChar, p, 0, buf.length);\n  this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n  var total = utf8CheckIncomplete(this, buf, i);\n  if (!this.lastNeed) return buf.toString('utf8', i);\n  this.lastTotal = total;\n  var end = buf.length - (total - this.lastNeed);\n  buf.copy(this.lastChar, 0, end);\n  return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character is added when ending on a partial\n// character.\nfunction utf8End(buf) {\n  var r = buf && buf.length ? this.write(buf) : '';\n  if (this.lastNeed) return r + '\\ufffd';\n  return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n  if ((buf.length - i) % 2 === 0) {\n    var r = buf.toString('utf16le', i);\n    if (r) {\n      var c = r.charCodeAt(r.length - 1);\n      if (c >= 0xD800 && c <= 0xDBFF) {\n        this.lastNeed = 2;\n        this.lastTotal = 4;\n        this.lastChar[0] = buf[buf.length - 2];\n        this.lastChar[1] = buf[buf.length - 1];\n        return r.slice(0, -1);\n      }\n    }\n    return r;\n  }\n  this.lastNeed = 1;\n  this.lastTotal = 2;\n  this.lastChar[0] = buf[buf.length - 1];\n  return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n  var r = buf && buf.length ? this.write(buf) : '';\n  if (this.lastNeed) {\n    var end = this.lastTotal - this.lastNeed;\n    return r + this.lastChar.toString('utf16le', 0, end);\n  }\n  return r;\n}\n\nfunction base64Text(buf, i) {\n  var n = (buf.length - i) % 3;\n  if (n === 0) return buf.toString('base64', i);\n  this.lastNeed = 3 - n;\n  this.lastTotal = 3;\n  if (n === 1) {\n    this.lastChar[0] = buf[buf.length - 1];\n  } else {\n    this.lastChar[0] = buf[buf.length - 2];\n    this.lastChar[1] = buf[buf.length - 1];\n  }\n  return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n  var r = buf && buf.length ? this.write(buf) : '';\n  if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n  return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n  return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n  return buf && buf.length ? this.write(buf) : '';\n}","'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require('../../ours/primordials')\nconst { Buffer } = require('buffer')\nconst { ERR_INVALID_ARG_TYPE, ERR_STREAM_NULL_VALUES } = require('../../ours/errors').codes\nfunction from(Readable, iterable, opts) {\n  let iterator\n  if (typeof iterable === 'string' || iterable instanceof Buffer) {\n    return new Readable({\n      objectMode: true,\n      ...opts,\n      read() {\n        this.push(iterable)\n        this.push(null)\n      }\n    })\n  }\n  let isAsync\n  if (iterable && iterable[SymbolAsyncIterator]) {\n    isAsync = true\n    iterator = iterable[SymbolAsyncIterator]()\n  } else if (iterable && iterable[SymbolIterator]) {\n    isAsync = false\n    iterator = iterable[SymbolIterator]()\n  } else {\n    throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable)\n  }\n  const readable = new Readable({\n    objectMode: true,\n    highWaterMark: 1,\n    // TODO(ronag): What options should be allowed?\n    ...opts\n  })\n\n  // Flag to protect against _read\n  // being called before last iteration completion.\n  let reading = false\n  readable._read = function () {\n    if (!reading) {\n      reading = true\n      next()\n    }\n  }\n  readable._destroy = function (error, cb) {\n    PromisePrototypeThen(\n      close(error),\n      () => process.nextTick(cb, error),\n      // nextTick is here in case cb throws\n      (e) => process.nextTick(cb, e || error)\n    )\n  }\n  async function close(error) {\n    const hadError = error !== undefined && error !== null\n    const hasThrow = typeof iterator.throw === 'function'\n    if (hadError && hasThrow) {\n      const { value, done } = await iterator.throw(error)\n      await value\n      if (done) {\n        return\n      }\n    }\n    if (typeof iterator.return === 'function') {\n      const { value } = await iterator.return()\n      await value\n    }\n  }\n  async function next() {\n    for (;;) {\n      try {\n        const { value, done } = isAsync ? await iterator.next() : iterator.next()\n        if (done) {\n          readable.push(null)\n        } else {\n          const res = value && typeof value.then === 'function' ? await value : value\n          if (res === null) {\n            reading = false\n            throw new ERR_STREAM_NULL_VALUES()\n          } else if (readable.push(res)) {\n            continue\n          } else {\n            reading = false\n          }\n        }\n      } catch (err) {\n        readable.destroy(err)\n      }\n      break\n    }\n  }\n  return readable\n}\nmodule.exports = from\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst {\n  ArrayPrototypeIndexOf,\n  NumberIsInteger,\n  NumberIsNaN,\n  NumberParseInt,\n  ObjectDefineProperties,\n  ObjectKeys,\n  ObjectSetPrototypeOf,\n  Promise,\n  SafeSet,\n  SymbolAsyncDispose,\n  SymbolAsyncIterator,\n  Symbol\n} = require('../../ours/primordials')\nmodule.exports = Readable\nReadable.ReadableState = ReadableState\nconst { EventEmitter: EE } = require('events')\nconst { Stream, prependListener } = require('./legacy')\nconst { Buffer } = require('buffer')\nconst { addAbortSignal } = require('./add-abort-signal')\nconst eos = require('./end-of-stream')\nlet debug = require('../../ours/util').debuglog('stream', (fn) => {\n  debug = fn\n})\nconst BufferList = require('./buffer_list')\nconst destroyImpl = require('./destroy')\nconst { getHighWaterMark, getDefaultHighWaterMark } = require('./state')\nconst {\n  aggregateTwoErrors,\n  codes: {\n    ERR_INVALID_ARG_TYPE,\n    ERR_METHOD_NOT_IMPLEMENTED,\n    ERR_OUT_OF_RANGE,\n    ERR_STREAM_PUSH_AFTER_EOF,\n    ERR_STREAM_UNSHIFT_AFTER_END_EVENT\n  },\n  AbortError\n} = require('../../ours/errors')\nconst { validateObject } = require('../validators')\nconst kPaused = Symbol('kPaused')\nconst { StringDecoder } = require('string_decoder/')\nconst from = require('./from')\nObjectSetPrototypeOf(Readable.prototype, Stream.prototype)\nObjectSetPrototypeOf(Readable, Stream)\nconst nop = () => {}\nconst { errorOrDestroy } = destroyImpl\nconst kObjectMode = 1 << 0\nconst kEnded = 1 << 1\nconst kEndEmitted = 1 << 2\nconst kReading = 1 << 3\nconst kConstructed = 1 << 4\nconst kSync = 1 << 5\nconst kNeedReadable = 1 << 6\nconst kEmittedReadable = 1 << 7\nconst kReadableListening = 1 << 8\nconst kResumeScheduled = 1 << 9\nconst kErrorEmitted = 1 << 10\nconst kEmitClose = 1 << 11\nconst kAutoDestroy = 1 << 12\nconst kDestroyed = 1 << 13\nconst kClosed = 1 << 14\nconst kCloseEmitted = 1 << 15\nconst kMultiAwaitDrain = 1 << 16\nconst kReadingMore = 1 << 17\nconst kDataEmitted = 1 << 18\n\n// TODO(benjamingr) it is likely slower to do it this way than with free functions\nfunction makeBitMapDescriptor(bit) {\n  return {\n    enumerable: false,\n    get() {\n      return (this.state & bit) !== 0\n    },\n    set(value) {\n      if (value) this.state |= bit\n      else this.state &= ~bit\n    }\n  }\n}\nObjectDefineProperties(ReadableState.prototype, {\n  objectMode: makeBitMapDescriptor(kObjectMode),\n  ended: makeBitMapDescriptor(kEnded),\n  endEmitted: makeBitMapDescriptor(kEndEmitted),\n  reading: makeBitMapDescriptor(kReading),\n  // Stream is still being constructed and cannot be\n  // destroyed until construction finished or failed.\n  // Async construction is opt in, therefore we start as\n  // constructed.\n  constructed: makeBitMapDescriptor(kConstructed),\n  // A flag to be able to tell if the event 'readable'/'data' is emitted\n  // immediately, or on a later tick.  We set this to true at first, because\n  // any actions that shouldn't happen until \"later\" should generally also\n  // not happen before the first read call.\n  sync: makeBitMapDescriptor(kSync),\n  // Whenever we return null, then we set a flag to say\n  // that we're awaiting a 'readable' event emission.\n  needReadable: makeBitMapDescriptor(kNeedReadable),\n  emittedReadable: makeBitMapDescriptor(kEmittedReadable),\n  readableListening: makeBitMapDescriptor(kReadableListening),\n  resumeScheduled: makeBitMapDescriptor(kResumeScheduled),\n  // True if the error was already emitted and should not be thrown again.\n  errorEmitted: makeBitMapDescriptor(kErrorEmitted),\n  emitClose: makeBitMapDescriptor(kEmitClose),\n  autoDestroy: makeBitMapDescriptor(kAutoDestroy),\n  // Has it been destroyed.\n  destroyed: makeBitMapDescriptor(kDestroyed),\n  // Indicates whether the stream has finished destroying.\n  closed: makeBitMapDescriptor(kClosed),\n  // True if close has been emitted or would have been emitted\n  // depending on emitClose.\n  closeEmitted: makeBitMapDescriptor(kCloseEmitted),\n  multiAwaitDrain: makeBitMapDescriptor(kMultiAwaitDrain),\n  // If true, a maybeReadMore has been scheduled.\n  readingMore: makeBitMapDescriptor(kReadingMore),\n  dataEmitted: makeBitMapDescriptor(kDataEmitted)\n})\nfunction ReadableState(options, stream, isDuplex) {\n  // Duplex streams are both readable and writable, but share\n  // the same options object.\n  // However, some cases require setting options to different\n  // values for the readable and the writable sides of the duplex stream.\n  // These options can be provided separately as readableXXX and writableXXX.\n  if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof require('./duplex')\n\n  // Bit map field to store ReadableState more effciently with 1 bit per field\n  // instead of a V8 slot per field.\n  this.state = kEmitClose | kAutoDestroy | kConstructed | kSync\n  // Object stream flag. Used to make read(n) ignore n and to\n  // make all the buffer merging and length checks go away.\n  if (options && options.objectMode) this.state |= kObjectMode\n  if (isDuplex && options && options.readableObjectMode) this.state |= kObjectMode\n\n  // The point at which it stops calling _read() to fill the buffer\n  // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n  this.highWaterMark = options\n    ? getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex)\n    : getDefaultHighWaterMark(false)\n\n  // A linked list is used to store data chunks instead of an array because the\n  // linked list can remove elements from the beginning faster than\n  // array.shift().\n  this.buffer = new BufferList()\n  this.length = 0\n  this.pipes = []\n  this.flowing = null\n  this[kPaused] = null\n\n  // Should close be emitted on destroy. Defaults to true.\n  if (options && options.emitClose === false) this.state &= ~kEmitClose\n\n  // Should .destroy() be called after 'end' (and potentially 'finish').\n  if (options && options.autoDestroy === false) this.state &= ~kAutoDestroy\n\n  // Indicates whether the stream has errored. When true no further\n  // _read calls, 'data' or 'readable' events should occur. This is needed\n  // since when autoDestroy is disabled we need a way to tell whether the\n  // stream has failed.\n  this.errored = null\n\n  // Crypto is kind of old and crusty.  Historically, its default string\n  // encoding is 'binary' so we have to make this configurable.\n  // Everything else in the universe uses 'utf8', though.\n  this.defaultEncoding = (options && options.defaultEncoding) || 'utf8'\n\n  // Ref the piped dest which we need a drain event on it\n  // type: null | Writable | Set.\n  this.awaitDrainWriters = null\n  this.decoder = null\n  this.encoding = null\n  if (options && options.encoding) {\n    this.decoder = new StringDecoder(options.encoding)\n    this.encoding = options.encoding\n  }\n}\nfunction Readable(options) {\n  if (!(this instanceof Readable)) return new Readable(options)\n\n  // Checking for a Stream.Duplex instance is faster here instead of inside\n  // the ReadableState constructor, at least with V8 6.5.\n  const isDuplex = this instanceof require('./duplex')\n  this._readableState = new ReadableState(options, this, isDuplex)\n  if (options) {\n    if (typeof options.read === 'function') this._read = options.read\n    if (typeof options.destroy === 'function') this._destroy = options.destroy\n    if (typeof options.construct === 'function') this._construct = options.construct\n    if (options.signal && !isDuplex) addAbortSignal(options.signal, this)\n  }\n  Stream.call(this, options)\n  destroyImpl.construct(this, () => {\n    if (this._readableState.needReadable) {\n      maybeReadMore(this, this._readableState)\n    }\n  })\n}\nReadable.prototype.destroy = destroyImpl.destroy\nReadable.prototype._undestroy = destroyImpl.undestroy\nReadable.prototype._destroy = function (err, cb) {\n  cb(err)\n}\nReadable.prototype[EE.captureRejectionSymbol] = function (err) {\n  this.destroy(err)\n}\nReadable.prototype[SymbolAsyncDispose] = function () {\n  let error\n  if (!this.destroyed) {\n    error = this.readableEnded ? null : new AbortError()\n    this.destroy(error)\n  }\n  return new Promise((resolve, reject) => eos(this, (err) => (err && err !== error ? reject(err) : resolve(null))))\n}\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n  return readableAddChunk(this, chunk, encoding, false)\n}\n\n// Unshift should *always* be something directly out of read().\nReadable.prototype.unshift = function (chunk, encoding) {\n  return readableAddChunk(this, chunk, encoding, true)\n}\nfunction readableAddChunk(stream, chunk, encoding, addToFront) {\n  debug('readableAddChunk', chunk)\n  const state = stream._readableState\n  let err\n  if ((state.state & kObjectMode) === 0) {\n    if (typeof chunk === 'string') {\n      encoding = encoding || state.defaultEncoding\n      if (state.encoding !== encoding) {\n        if (addToFront && state.encoding) {\n          // When unshifting, if state.encoding is set, we have to save\n          // the string in the BufferList with the state encoding.\n          chunk = Buffer.from(chunk, encoding).toString(state.encoding)\n        } else {\n          chunk = Buffer.from(chunk, encoding)\n          encoding = ''\n        }\n      }\n    } else if (chunk instanceof Buffer) {\n      encoding = ''\n    } else if (Stream._isUint8Array(chunk)) {\n      chunk = Stream._uint8ArrayToBuffer(chunk)\n      encoding = ''\n    } else if (chunk != null) {\n      err = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk)\n    }\n  }\n  if (err) {\n    errorOrDestroy(stream, err)\n  } else if (chunk === null) {\n    state.state &= ~kReading\n    onEofChunk(stream, state)\n  } else if ((state.state & kObjectMode) !== 0 || (chunk && chunk.length > 0)) {\n    if (addToFront) {\n      if ((state.state & kEndEmitted) !== 0) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT())\n      else if (state.destroyed || state.errored) return false\n      else addChunk(stream, state, chunk, true)\n    } else if (state.ended) {\n      errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF())\n    } else if (state.destroyed || state.errored) {\n      return false\n    } else {\n      state.state &= ~kReading\n      if (state.decoder && !encoding) {\n        chunk = state.decoder.write(chunk)\n        if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false)\n        else maybeReadMore(stream, state)\n      } else {\n        addChunk(stream, state, chunk, false)\n      }\n    }\n  } else if (!addToFront) {\n    state.state &= ~kReading\n    maybeReadMore(stream, state)\n  }\n\n  // We can push more data if we are below the highWaterMark.\n  // Also, if we have no data yet, we can stand some more bytes.\n  // This is to work around cases where hwm=0, such as the repl.\n  return !state.ended && (state.length < state.highWaterMark || state.length === 0)\n}\nfunction addChunk(stream, state, chunk, addToFront) {\n  if (state.flowing && state.length === 0 && !state.sync && stream.listenerCount('data') > 0) {\n    // Use the guard to avoid creating `Set()` repeatedly\n    // when we have multiple pipes.\n    if ((state.state & kMultiAwaitDrain) !== 0) {\n      state.awaitDrainWriters.clear()\n    } else {\n      state.awaitDrainWriters = null\n    }\n    state.dataEmitted = true\n    stream.emit('data', chunk)\n  } else {\n    // Update the buffer info.\n    state.length += state.objectMode ? 1 : chunk.length\n    if (addToFront) state.buffer.unshift(chunk)\n    else state.buffer.push(chunk)\n    if ((state.state & kNeedReadable) !== 0) emitReadable(stream)\n  }\n  maybeReadMore(stream, state)\n}\nReadable.prototype.isPaused = function () {\n  const state = this._readableState\n  return state[kPaused] === true || state.flowing === false\n}\n\n// Backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n  const decoder = new StringDecoder(enc)\n  this._readableState.decoder = decoder\n  // If setEncoding(null), decoder.encoding equals utf8.\n  this._readableState.encoding = this._readableState.decoder.encoding\n  const buffer = this._readableState.buffer\n  // Iterate over current buffer to convert already stored Buffers:\n  let content = ''\n  for (const data of buffer) {\n    content += decoder.write(data)\n  }\n  buffer.clear()\n  if (content !== '') buffer.push(content)\n  this._readableState.length = content.length\n  return this\n}\n\n// Don't raise the hwm > 1GB.\nconst MAX_HWM = 0x40000000\nfunction computeNewHighWaterMark(n) {\n  if (n > MAX_HWM) {\n    throw new ERR_OUT_OF_RANGE('size', '<= 1GiB', n)\n  } else {\n    // Get the next highest power of 2 to prevent increasing hwm excessively in\n    // tiny amounts.\n    n--\n    n |= n >>> 1\n    n |= n >>> 2\n    n |= n >>> 4\n    n |= n >>> 8\n    n |= n >>> 16\n    n++\n  }\n  return n\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n  if (n <= 0 || (state.length === 0 && state.ended)) return 0\n  if ((state.state & kObjectMode) !== 0) return 1\n  if (NumberIsNaN(n)) {\n    // Only flow one buffer at a time.\n    if (state.flowing && state.length) return state.buffer.first().length\n    return state.length\n  }\n  if (n <= state.length) return n\n  return state.ended ? state.length : 0\n}\n\n// You can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n  debug('read', n)\n  // Same as parseInt(undefined, 10), however V8 7.3 performance regressed\n  // in this scenario, so we are doing it manually.\n  if (n === undefined) {\n    n = NaN\n  } else if (!NumberIsInteger(n)) {\n    n = NumberParseInt(n, 10)\n  }\n  const state = this._readableState\n  const nOrig = n\n\n  // If we're asking for more than the current hwm, then raise the hwm.\n  if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n)\n  if (n !== 0) state.state &= ~kEmittedReadable\n\n  // If we're doing read(0) to trigger a readable event, but we\n  // already have a bunch of data in the buffer, then just trigger\n  // the 'readable' event and move on.\n  if (\n    n === 0 &&\n    state.needReadable &&\n    ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)\n  ) {\n    debug('read: emitReadable', state.length, state.ended)\n    if (state.length === 0 && state.ended) endReadable(this)\n    else emitReadable(this)\n    return null\n  }\n  n = howMuchToRead(n, state)\n\n  // If we've ended, and we're now clear, then finish it up.\n  if (n === 0 && state.ended) {\n    if (state.length === 0) endReadable(this)\n    return null\n  }\n\n  // All the actual chunk generation logic needs to be\n  // *below* the call to _read.  The reason is that in certain\n  // synthetic stream cases, such as passthrough streams, _read\n  // may be a completely synchronous operation which may change\n  // the state of the read buffer, providing enough data when\n  // before there was *not* enough.\n  //\n  // So, the steps are:\n  // 1. Figure out what the state of things will be after we do\n  // a read from the buffer.\n  //\n  // 2. If that resulting state will trigger a _read, then call _read.\n  // Note that this may be asynchronous, or synchronous.  Yes, it is\n  // deeply ugly to write APIs this way, but that still doesn't mean\n  // that the Readable class should behave improperly, as streams are\n  // designed to be sync/async agnostic.\n  // Take note if the _read call is sync or async (ie, if the read call\n  // has returned yet), so that we know whether or not it's safe to emit\n  // 'readable' etc.\n  //\n  // 3. Actually pull the requested chunks out of the buffer and return.\n\n  // if we need a readable event, then we need to do some reading.\n  let doRead = (state.state & kNeedReadable) !== 0\n  debug('need readable', doRead)\n\n  // If we currently have less than the highWaterMark, then also read some.\n  if (state.length === 0 || state.length - n < state.highWaterMark) {\n    doRead = true\n    debug('length less than watermark', doRead)\n  }\n\n  // However, if we've ended, then there's no point, if we're already\n  // reading, then it's unnecessary, if we're constructing we have to wait,\n  // and if we're destroyed or errored, then it's not allowed,\n  if (state.ended || state.reading || state.destroyed || state.errored || !state.constructed) {\n    doRead = false\n    debug('reading, ended or constructing', doRead)\n  } else if (doRead) {\n    debug('do read')\n    state.state |= kReading | kSync\n    // If the length is currently zero, then we *need* a readable event.\n    if (state.length === 0) state.state |= kNeedReadable\n\n    // Call internal read method\n    try {\n      this._read(state.highWaterMark)\n    } catch (err) {\n      errorOrDestroy(this, err)\n    }\n    state.state &= ~kSync\n\n    // If _read pushed data synchronously, then `reading` will be false,\n    // and we need to re-evaluate how much data we can return to the user.\n    if (!state.reading) n = howMuchToRead(nOrig, state)\n  }\n  let ret\n  if (n > 0) ret = fromList(n, state)\n  else ret = null\n  if (ret === null) {\n    state.needReadable = state.length <= state.highWaterMark\n    n = 0\n  } else {\n    state.length -= n\n    if (state.multiAwaitDrain) {\n      state.awaitDrainWriters.clear()\n    } else {\n      state.awaitDrainWriters = null\n    }\n  }\n  if (state.length === 0) {\n    // If we have nothing in the buffer, then we want to know\n    // as soon as we *do* get something into the buffer.\n    if (!state.ended) state.needReadable = true\n\n    // If we tried to read() past the EOF, then emit end on the next tick.\n    if (nOrig !== n && state.ended) endReadable(this)\n  }\n  if (ret !== null && !state.errorEmitted && !state.closeEmitted) {\n    state.dataEmitted = true\n    this.emit('data', ret)\n  }\n  return ret\n}\nfunction onEofChunk(stream, state) {\n  debug('onEofChunk')\n  if (state.ended) return\n  if (state.decoder) {\n    const chunk = state.decoder.end()\n    if (chunk && chunk.length) {\n      state.buffer.push(chunk)\n      state.length += state.objectMode ? 1 : chunk.length\n    }\n  }\n  state.ended = true\n  if (state.sync) {\n    // If we are sync, wait until next tick to emit the data.\n    // Otherwise we risk emitting data in the flow()\n    // the readable code triggers during a read() call.\n    emitReadable(stream)\n  } else {\n    // Emit 'readable' now to make sure it gets picked up.\n    state.needReadable = false\n    state.emittedReadable = true\n    // We have to emit readable now that we are EOF. Modules\n    // in the ecosystem (e.g. dicer) rely on this event being sync.\n    emitReadable_(stream)\n  }\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow.  This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n  const state = stream._readableState\n  debug('emitReadable', state.needReadable, state.emittedReadable)\n  state.needReadable = false\n  if (!state.emittedReadable) {\n    debug('emitReadable', state.flowing)\n    state.emittedReadable = true\n    process.nextTick(emitReadable_, stream)\n  }\n}\nfunction emitReadable_(stream) {\n  const state = stream._readableState\n  debug('emitReadable_', state.destroyed, state.length, state.ended)\n  if (!state.destroyed && !state.errored && (state.length || state.ended)) {\n    stream.emit('readable')\n    state.emittedReadable = false\n  }\n\n  // The stream needs another readable event if:\n  // 1. It is not flowing, as the flow mechanism will take\n  //    care of it.\n  // 2. It is not ended.\n  // 3. It is below the highWaterMark, so we can schedule\n  //    another readable later.\n  state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark\n  flow(stream)\n}\n\n// At this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data.  that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n  if (!state.readingMore && state.constructed) {\n    state.readingMore = true\n    process.nextTick(maybeReadMore_, stream, state)\n  }\n}\nfunction maybeReadMore_(stream, state) {\n  // Attempt to read more data if we should.\n  //\n  // The conditions for reading more data are (one of):\n  // - Not enough data buffered (state.length < state.highWaterMark). The loop\n  //   is responsible for filling the buffer with enough data if such data\n  //   is available. If highWaterMark is 0 and we are not in the flowing mode\n  //   we should _not_ attempt to buffer any extra data. We'll get more data\n  //   when the stream consumer calls read() instead.\n  // - No data in the buffer, and the stream is in flowing mode. In this mode\n  //   the loop below is responsible for ensuring read() is called. Failing to\n  //   call read here would abort the flow and there's no other mechanism for\n  //   continuing the flow if the stream consumer has just subscribed to the\n  //   'data' event.\n  //\n  // In addition to the above conditions to keep reading data, the following\n  // conditions prevent the data from being read:\n  // - The stream has ended (state.ended).\n  // - There is already a pending 'read' operation (state.reading). This is a\n  //   case where the stream has called the implementation defined _read()\n  //   method, but they are processing the call asynchronously and have _not_\n  //   called push() with new data. In this case we skip performing more\n  //   read()s. The execution ends in this method again after the _read() ends\n  //   up calling push() with more data.\n  while (\n    !state.reading &&\n    !state.ended &&\n    (state.length < state.highWaterMark || (state.flowing && state.length === 0))\n  ) {\n    const len = state.length\n    debug('maybeReadMore read 0')\n    stream.read(0)\n    if (len === state.length)\n      // Didn't get any data, stop spinning.\n      break\n  }\n  state.readingMore = false\n}\n\n// Abstract method.  to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n  throw new ERR_METHOD_NOT_IMPLEMENTED('_read()')\n}\nReadable.prototype.pipe = function (dest, pipeOpts) {\n  const src = this\n  const state = this._readableState\n  if (state.pipes.length === 1) {\n    if (!state.multiAwaitDrain) {\n      state.multiAwaitDrain = true\n      state.awaitDrainWriters = new SafeSet(state.awaitDrainWriters ? [state.awaitDrainWriters] : [])\n    }\n  }\n  state.pipes.push(dest)\n  debug('pipe count=%d opts=%j', state.pipes.length, pipeOpts)\n  const doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr\n  const endFn = doEnd ? onend : unpipe\n  if (state.endEmitted) process.nextTick(endFn)\n  else src.once('end', endFn)\n  dest.on('unpipe', onunpipe)\n  function onunpipe(readable, unpipeInfo) {\n    debug('onunpipe')\n    if (readable === src) {\n      if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n        unpipeInfo.hasUnpiped = true\n        cleanup()\n      }\n    }\n  }\n  function onend() {\n    debug('onend')\n    dest.end()\n  }\n  let ondrain\n  let cleanedUp = false\n  function cleanup() {\n    debug('cleanup')\n    // Cleanup event handlers once the pipe is broken.\n    dest.removeListener('close', onclose)\n    dest.removeListener('finish', onfinish)\n    if (ondrain) {\n      dest.removeListener('drain', ondrain)\n    }\n    dest.removeListener('error', onerror)\n    dest.removeListener('unpipe', onunpipe)\n    src.removeListener('end', onend)\n    src.removeListener('end', unpipe)\n    src.removeListener('data', ondata)\n    cleanedUp = true\n\n    // If the reader is waiting for a drain event from this\n    // specific writer, then it would cause it to never start\n    // flowing again.\n    // So, if this is awaiting a drain, then we just call it now.\n    // If we don't know, then assume that we are waiting for one.\n    if (ondrain && state.awaitDrainWriters && (!dest._writableState || dest._writableState.needDrain)) ondrain()\n  }\n  function pause() {\n    // If the user unpiped during `dest.write()`, it is possible\n    // to get stuck in a permanently paused state if that write\n    // also returned false.\n    // => Check whether `dest` is still a piping destination.\n    if (!cleanedUp) {\n      if (state.pipes.length === 1 && state.pipes[0] === dest) {\n        debug('false write response, pause', 0)\n        state.awaitDrainWriters = dest\n        state.multiAwaitDrain = false\n      } else if (state.pipes.length > 1 && state.pipes.includes(dest)) {\n        debug('false write response, pause', state.awaitDrainWriters.size)\n        state.awaitDrainWriters.add(dest)\n      }\n      src.pause()\n    }\n    if (!ondrain) {\n      // When the dest drains, it reduces the awaitDrain counter\n      // on the source.  This would be more elegant with a .once()\n      // handler in flow(), but adding and removing repeatedly is\n      // too slow.\n      ondrain = pipeOnDrain(src, dest)\n      dest.on('drain', ondrain)\n    }\n  }\n  src.on('data', ondata)\n  function ondata(chunk) {\n    debug('ondata')\n    const ret = dest.write(chunk)\n    debug('dest.write', ret)\n    if (ret === false) {\n      pause()\n    }\n  }\n\n  // If the dest has an error, then stop piping into it.\n  // However, don't suppress the throwing behavior for this.\n  function onerror(er) {\n    debug('onerror', er)\n    unpipe()\n    dest.removeListener('error', onerror)\n    if (dest.listenerCount('error') === 0) {\n      const s = dest._writableState || dest._readableState\n      if (s && !s.errorEmitted) {\n        // User incorrectly emitted 'error' directly on the stream.\n        errorOrDestroy(dest, er)\n      } else {\n        dest.emit('error', er)\n      }\n    }\n  }\n\n  // Make sure our error handler is attached before userland ones.\n  prependListener(dest, 'error', onerror)\n\n  // Both close and finish should trigger unpipe, but only once.\n  function onclose() {\n    dest.removeListener('finish', onfinish)\n    unpipe()\n  }\n  dest.once('close', onclose)\n  function onfinish() {\n    debug('onfinish')\n    dest.removeListener('close', onclose)\n    unpipe()\n  }\n  dest.once('finish', onfinish)\n  function unpipe() {\n    debug('unpipe')\n    src.unpipe(dest)\n  }\n\n  // Tell the dest that it's being piped to.\n  dest.emit('pipe', src)\n\n  // Start the flow if it hasn't been started already.\n\n  if (dest.writableNeedDrain === true) {\n    pause()\n  } else if (!state.flowing) {\n    debug('pipe resume')\n    src.resume()\n  }\n  return dest\n}\nfunction pipeOnDrain(src, dest) {\n  return function pipeOnDrainFunctionResult() {\n    const state = src._readableState\n\n    // `ondrain` will call directly,\n    // `this` maybe not a reference to dest,\n    // so we use the real dest here.\n    if (state.awaitDrainWriters === dest) {\n      debug('pipeOnDrain', 1)\n      state.awaitDrainWriters = null\n    } else if (state.multiAwaitDrain) {\n      debug('pipeOnDrain', state.awaitDrainWriters.size)\n      state.awaitDrainWriters.delete(dest)\n    }\n    if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) && src.listenerCount('data')) {\n      src.resume()\n    }\n  }\n}\nReadable.prototype.unpipe = function (dest) {\n  const state = this._readableState\n  const unpipeInfo = {\n    hasUnpiped: false\n  }\n\n  // If we're not piping anywhere, then do nothing.\n  if (state.pipes.length === 0) return this\n  if (!dest) {\n    // remove all.\n    const dests = state.pipes\n    state.pipes = []\n    this.pause()\n    for (let i = 0; i < dests.length; i++)\n      dests[i].emit('unpipe', this, {\n        hasUnpiped: false\n      })\n    return this\n  }\n\n  // Try to find the right one.\n  const index = ArrayPrototypeIndexOf(state.pipes, dest)\n  if (index === -1) return this\n  state.pipes.splice(index, 1)\n  if (state.pipes.length === 0) this.pause()\n  dest.emit('unpipe', this, unpipeInfo)\n  return this\n}\n\n// Set up data events if they are asked for\n// Ensure readable listeners eventually get something.\nReadable.prototype.on = function (ev, fn) {\n  const res = Stream.prototype.on.call(this, ev, fn)\n  const state = this._readableState\n  if (ev === 'data') {\n    // Update readableListening so that resume() may be a no-op\n    // a few lines down. This is needed to support once('readable').\n    state.readableListening = this.listenerCount('readable') > 0\n\n    // Try start flowing on next tick if stream isn't explicitly paused.\n    if (state.flowing !== false) this.resume()\n  } else if (ev === 'readable') {\n    if (!state.endEmitted && !state.readableListening) {\n      state.readableListening = state.needReadable = true\n      state.flowing = false\n      state.emittedReadable = false\n      debug('on readable', state.length, state.reading)\n      if (state.length) {\n        emitReadable(this)\n      } else if (!state.reading) {\n        process.nextTick(nReadingNextTick, this)\n      }\n    }\n  }\n  return res\n}\nReadable.prototype.addListener = Readable.prototype.on\nReadable.prototype.removeListener = function (ev, fn) {\n  const res = Stream.prototype.removeListener.call(this, ev, fn)\n  if (ev === 'readable') {\n    // We need to check if there is someone still listening to\n    // readable and reset the state. However this needs to happen\n    // after readable has been emitted but before I/O (nextTick) to\n    // support once('readable', fn) cycles. This means that calling\n    // resume within the same tick will have no\n    // effect.\n    process.nextTick(updateReadableListening, this)\n  }\n  return res\n}\nReadable.prototype.off = Readable.prototype.removeListener\nReadable.prototype.removeAllListeners = function (ev) {\n  const res = Stream.prototype.removeAllListeners.apply(this, arguments)\n  if (ev === 'readable' || ev === undefined) {\n    // We need to check if there is someone still listening to\n    // readable and reset the state. However this needs to happen\n    // after readable has been emitted but before I/O (nextTick) to\n    // support once('readable', fn) cycles. This means that calling\n    // resume within the same tick will have no\n    // effect.\n    process.nextTick(updateReadableListening, this)\n  }\n  return res\n}\nfunction updateReadableListening(self) {\n  const state = self._readableState\n  state.readableListening = self.listenerCount('readable') > 0\n  if (state.resumeScheduled && state[kPaused] === false) {\n    // Flowing needs to be set to true now, otherwise\n    // the upcoming resume will not flow.\n    state.flowing = true\n\n    // Crude way to check if we should resume.\n  } else if (self.listenerCount('data') > 0) {\n    self.resume()\n  } else if (!state.readableListening) {\n    state.flowing = null\n  }\n}\nfunction nReadingNextTick(self) {\n  debug('readable nexttick read 0')\n  self.read(0)\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n  const state = this._readableState\n  if (!state.flowing) {\n    debug('resume')\n    // We flow only if there is no one listening\n    // for readable, but we still have to call\n    // resume().\n    state.flowing = !state.readableListening\n    resume(this, state)\n  }\n  state[kPaused] = false\n  return this\n}\nfunction resume(stream, state) {\n  if (!state.resumeScheduled) {\n    state.resumeScheduled = true\n    process.nextTick(resume_, stream, state)\n  }\n}\nfunction resume_(stream, state) {\n  debug('resume', state.reading)\n  if (!state.reading) {\n    stream.read(0)\n  }\n  state.resumeScheduled = false\n  stream.emit('resume')\n  flow(stream)\n  if (state.flowing && !state.reading) stream.read(0)\n}\nReadable.prototype.pause = function () {\n  debug('call pause flowing=%j', this._readableState.flowing)\n  if (this._readableState.flowing !== false) {\n    debug('pause')\n    this._readableState.flowing = false\n    this.emit('pause')\n  }\n  this._readableState[kPaused] = true\n  return this\n}\nfunction flow(stream) {\n  const state = stream._readableState\n  debug('flow', state.flowing)\n  while (state.flowing && stream.read() !== null);\n}\n\n// Wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n  let paused = false\n\n  // TODO (ronag): Should this.destroy(err) emit\n  // 'error' on the wrapped stream? Would require\n  // a static factory method, e.g. Readable.wrap(stream).\n\n  stream.on('data', (chunk) => {\n    if (!this.push(chunk) && stream.pause) {\n      paused = true\n      stream.pause()\n    }\n  })\n  stream.on('end', () => {\n    this.push(null)\n  })\n  stream.on('error', (err) => {\n    errorOrDestroy(this, err)\n  })\n  stream.on('close', () => {\n    this.destroy()\n  })\n  stream.on('destroy', () => {\n    this.destroy()\n  })\n  this._read = () => {\n    if (paused && stream.resume) {\n      paused = false\n      stream.resume()\n    }\n  }\n\n  // Proxy all the other methods. Important when wrapping filters and duplexes.\n  const streamKeys = ObjectKeys(stream)\n  for (let j = 1; j < streamKeys.length; j++) {\n    const i = streamKeys[j]\n    if (this[i] === undefined && typeof stream[i] === 'function') {\n      this[i] = stream[i].bind(stream)\n    }\n  }\n  return this\n}\nReadable.prototype[SymbolAsyncIterator] = function () {\n  return streamToAsyncIterator(this)\n}\nReadable.prototype.iterator = function (options) {\n  if (options !== undefined) {\n    validateObject(options, 'options')\n  }\n  return streamToAsyncIterator(this, options)\n}\nfunction streamToAsyncIterator(stream, options) {\n  if (typeof stream.read !== 'function') {\n    stream = Readable.wrap(stream, {\n      objectMode: true\n    })\n  }\n  const iter = createAsyncIterator(stream, options)\n  iter.stream = stream\n  return iter\n}\nasync function* createAsyncIterator(stream, options) {\n  let callback = nop\n  function next(resolve) {\n    if (this === stream) {\n      callback()\n      callback = nop\n    } else {\n      callback = resolve\n    }\n  }\n  stream.on('readable', next)\n  let error\n  const cleanup = eos(\n    stream,\n    {\n      writable: false\n    },\n    (err) => {\n      error = err ? aggregateTwoErrors(error, err) : null\n      callback()\n      callback = nop\n    }\n  )\n  try {\n    while (true) {\n      const chunk = stream.destroyed ? null : stream.read()\n      if (chunk !== null) {\n        yield chunk\n      } else if (error) {\n        throw error\n      } else if (error === null) {\n        return\n      } else {\n        await new Promise(next)\n      }\n    }\n  } catch (err) {\n    error = aggregateTwoErrors(error, err)\n    throw error\n  } finally {\n    if (\n      (error || (options === null || options === undefined ? undefined : options.destroyOnReturn) !== false) &&\n      (error === undefined || stream._readableState.autoDestroy)\n    ) {\n      destroyImpl.destroyer(stream, null)\n    } else {\n      stream.off('readable', next)\n      cleanup()\n    }\n  }\n}\n\n// Making it explicit these properties are not enumerable\n// because otherwise some prototype manipulation in\n// userland will fail.\nObjectDefineProperties(Readable.prototype, {\n  readable: {\n    __proto__: null,\n    get() {\n      const r = this._readableState\n      // r.readable === false means that this is part of a Duplex stream\n      // where the readable side was disabled upon construction.\n      // Compat. The user might manually disable readable side through\n      // deprecated setter.\n      return !!r && r.readable !== false && !r.destroyed && !r.errorEmitted && !r.endEmitted\n    },\n    set(val) {\n      // Backwards compat.\n      if (this._readableState) {\n        this._readableState.readable = !!val\n      }\n    }\n  },\n  readableDidRead: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return this._readableState.dataEmitted\n    }\n  },\n  readableAborted: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return !!(\n        this._readableState.readable !== false &&\n        (this._readableState.destroyed || this._readableState.errored) &&\n        !this._readableState.endEmitted\n      )\n    }\n  },\n  readableHighWaterMark: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return this._readableState.highWaterMark\n    }\n  },\n  readableBuffer: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return this._readableState && this._readableState.buffer\n    }\n  },\n  readableFlowing: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return this._readableState.flowing\n    },\n    set: function (state) {\n      if (this._readableState) {\n        this._readableState.flowing = state\n      }\n    }\n  },\n  readableLength: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState.length\n    }\n  },\n  readableObjectMode: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState ? this._readableState.objectMode : false\n    }\n  },\n  readableEncoding: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState ? this._readableState.encoding : null\n    }\n  },\n  errored: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState ? this._readableState.errored : null\n    }\n  },\n  closed: {\n    __proto__: null,\n    get() {\n      return this._readableState ? this._readableState.closed : false\n    }\n  },\n  destroyed: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState ? this._readableState.destroyed : false\n    },\n    set(value) {\n      // We ignore the value if the stream\n      // has not been initialized yet.\n      if (!this._readableState) {\n        return\n      }\n\n      // Backward compatibility, the user is explicitly\n      // managing destroyed.\n      this._readableState.destroyed = value\n    }\n  },\n  readableEnded: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._readableState ? this._readableState.endEmitted : false\n    }\n  }\n})\nObjectDefineProperties(ReadableState.prototype, {\n  // Legacy getter for `pipesCount`.\n  pipesCount: {\n    __proto__: null,\n    get() {\n      return this.pipes.length\n    }\n  },\n  // Legacy property for `paused`.\n  paused: {\n    __proto__: null,\n    get() {\n      return this[kPaused] !== false\n    },\n    set(value) {\n      this[kPaused] = !!value\n    }\n  }\n})\n\n// Exposed for testing purposes only.\nReadable._fromList = fromList\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n  // nothing buffered.\n  if (state.length === 0) return null\n  let ret\n  if (state.objectMode) ret = state.buffer.shift()\n  else if (!n || n >= state.length) {\n    // Read it all, truncate the list.\n    if (state.decoder) ret = state.buffer.join('')\n    else if (state.buffer.length === 1) ret = state.buffer.first()\n    else ret = state.buffer.concat(state.length)\n    state.buffer.clear()\n  } else {\n    // read part of list.\n    ret = state.buffer.consume(n, state.decoder)\n  }\n  return ret\n}\nfunction endReadable(stream) {\n  const state = stream._readableState\n  debug('endReadable', state.endEmitted)\n  if (!state.endEmitted) {\n    state.ended = true\n    process.nextTick(endReadableNT, state, stream)\n  }\n}\nfunction endReadableNT(state, stream) {\n  debug('endReadableNT', state.endEmitted, state.length)\n\n  // Check that we didn't get one last unshift.\n  if (!state.errored && !state.closeEmitted && !state.endEmitted && state.length === 0) {\n    state.endEmitted = true\n    stream.emit('end')\n    if (stream.writable && stream.allowHalfOpen === false) {\n      process.nextTick(endWritableNT, stream)\n    } else if (state.autoDestroy) {\n      // In case of duplex streams we need a way to detect\n      // if the writable side is ready for autoDestroy as well.\n      const wState = stream._writableState\n      const autoDestroy =\n        !wState ||\n        (wState.autoDestroy &&\n          // We don't expect the writable to ever 'finish'\n          // if writable is explicitly set to false.\n          (wState.finished || wState.writable === false))\n      if (autoDestroy) {\n        stream.destroy()\n      }\n    }\n  }\n}\nfunction endWritableNT(stream) {\n  const writable = stream.writable && !stream.writableEnded && !stream.destroyed\n  if (writable) {\n    stream.end()\n  }\n}\nReadable.from = function (iterable, opts) {\n  return from(Readable, iterable, opts)\n}\nlet webStreamsAdapters\n\n// Lazy to avoid circular references\nfunction lazyWebStreams() {\n  if (webStreamsAdapters === undefined) webStreamsAdapters = {}\n  return webStreamsAdapters\n}\nReadable.fromWeb = function (readableStream, options) {\n  return lazyWebStreams().newStreamReadableFromReadableStream(readableStream, options)\n}\nReadable.toWeb = function (streamReadable, options) {\n  return lazyWebStreams().newReadableStreamFromStreamReadable(streamReadable, options)\n}\nReadable.wrap = function (src, options) {\n  var _ref, _src$readableObjectMo\n  return new Readable({\n    objectMode:\n      (_ref =\n        (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== undefined\n          ? _src$readableObjectMo\n          : src.objectMode) !== null && _ref !== undefined\n        ? _ref\n        : true,\n    ...options,\n    destroy(err, callback) {\n      destroyImpl.destroyer(src, err)\n      callback(err)\n    }\n  }).wrap(src)\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict'\n\n/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\nconst {\n  ArrayPrototypeSlice,\n  Error,\n  FunctionPrototypeSymbolHasInstance,\n  ObjectDefineProperty,\n  ObjectDefineProperties,\n  ObjectSetPrototypeOf,\n  StringPrototypeToLowerCase,\n  Symbol,\n  SymbolHasInstance\n} = require('../../ours/primordials')\nmodule.exports = Writable\nWritable.WritableState = WritableState\nconst { EventEmitter: EE } = require('events')\nconst Stream = require('./legacy').Stream\nconst { Buffer } = require('buffer')\nconst destroyImpl = require('./destroy')\nconst { addAbortSignal } = require('./add-abort-signal')\nconst { getHighWaterMark, getDefaultHighWaterMark } = require('./state')\nconst {\n  ERR_INVALID_ARG_TYPE,\n  ERR_METHOD_NOT_IMPLEMENTED,\n  ERR_MULTIPLE_CALLBACK,\n  ERR_STREAM_CANNOT_PIPE,\n  ERR_STREAM_DESTROYED,\n  ERR_STREAM_ALREADY_FINISHED,\n  ERR_STREAM_NULL_VALUES,\n  ERR_STREAM_WRITE_AFTER_END,\n  ERR_UNKNOWN_ENCODING\n} = require('../../ours/errors').codes\nconst { errorOrDestroy } = destroyImpl\nObjectSetPrototypeOf(Writable.prototype, Stream.prototype)\nObjectSetPrototypeOf(Writable, Stream)\nfunction nop() {}\nconst kOnFinished = Symbol('kOnFinished')\nfunction WritableState(options, stream, isDuplex) {\n  // Duplex streams are both readable and writable, but share\n  // the same options object.\n  // However, some cases require setting options to different\n  // values for the readable and the writable sides of the duplex stream,\n  // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.\n  if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof require('./duplex')\n\n  // Object stream flag to indicate whether or not this stream\n  // contains buffers or objects.\n  this.objectMode = !!(options && options.objectMode)\n  if (isDuplex) this.objectMode = this.objectMode || !!(options && options.writableObjectMode)\n\n  // The point at which write() starts returning false\n  // Note: 0 is a valid value, means that we always return false if\n  // the entire buffer is not flushed immediately on write().\n  this.highWaterMark = options\n    ? getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex)\n    : getDefaultHighWaterMark(false)\n\n  // if _final has been called.\n  this.finalCalled = false\n\n  // drain event flag.\n  this.needDrain = false\n  // At the start of calling end()\n  this.ending = false\n  // When end() has been called, and returned.\n  this.ended = false\n  // When 'finish' is emitted.\n  this.finished = false\n\n  // Has it been destroyed\n  this.destroyed = false\n\n  // Should we decode strings into buffers before passing to _write?\n  // this is here so that some node-core streams can optimize string\n  // handling at a lower level.\n  const noDecode = !!(options && options.decodeStrings === false)\n  this.decodeStrings = !noDecode\n\n  // Crypto is kind of old and crusty.  Historically, its default string\n  // encoding is 'binary' so we have to make this configurable.\n  // Everything else in the universe uses 'utf8', though.\n  this.defaultEncoding = (options && options.defaultEncoding) || 'utf8'\n\n  // Not an actual buffer we keep track of, but a measurement\n  // of how much we're waiting to get pushed to some underlying\n  // socket or file.\n  this.length = 0\n\n  // A flag to see when we're in the middle of a write.\n  this.writing = false\n\n  // When true all writes will be buffered until .uncork() call.\n  this.corked = 0\n\n  // A flag to be able to tell if the onwrite cb is called immediately,\n  // or on a later tick.  We set this to true at first, because any\n  // actions that shouldn't happen until \"later\" should generally also\n  // not happen before the first write call.\n  this.sync = true\n\n  // A flag to know if we're processing previously buffered items, which\n  // may call the _write() callback in the same tick, so that we don't\n  // end up in an overlapped onwrite situation.\n  this.bufferProcessing = false\n\n  // The callback that's passed to _write(chunk, cb).\n  this.onwrite = onwrite.bind(undefined, stream)\n\n  // The callback that the user supplies to write(chunk, encoding, cb).\n  this.writecb = null\n\n  // The amount that is being written when _write is called.\n  this.writelen = 0\n\n  // Storage for data passed to the afterWrite() callback in case of\n  // synchronous _write() completion.\n  this.afterWriteTickInfo = null\n  resetBuffer(this)\n\n  // Number of pending user-supplied write callbacks\n  // this must be 0 before 'finish' can be emitted.\n  this.pendingcb = 0\n\n  // Stream is still being constructed and cannot be\n  // destroyed until construction finished or failed.\n  // Async construction is opt in, therefore we start as\n  // constructed.\n  this.constructed = true\n\n  // Emit prefinish if the only thing we're waiting for is _write cbs\n  // This is relevant for synchronous Transform streams.\n  this.prefinished = false\n\n  // True if the error was already emitted and should not be thrown again.\n  this.errorEmitted = false\n\n  // Should close be emitted on destroy. Defaults to true.\n  this.emitClose = !options || options.emitClose !== false\n\n  // Should .destroy() be called after 'finish' (and potentially 'end').\n  this.autoDestroy = !options || options.autoDestroy !== false\n\n  // Indicates whether the stream has errored. When true all write() calls\n  // should return false. This is needed since when autoDestroy\n  // is disabled we need a way to tell whether the stream has failed.\n  this.errored = null\n\n  // Indicates whether the stream has finished destroying.\n  this.closed = false\n\n  // True if close has been emitted or would have been emitted\n  // depending on emitClose.\n  this.closeEmitted = false\n  this[kOnFinished] = []\n}\nfunction resetBuffer(state) {\n  state.buffered = []\n  state.bufferedIndex = 0\n  state.allBuffers = true\n  state.allNoop = true\n}\nWritableState.prototype.getBuffer = function getBuffer() {\n  return ArrayPrototypeSlice(this.buffered, this.bufferedIndex)\n}\nObjectDefineProperty(WritableState.prototype, 'bufferedRequestCount', {\n  __proto__: null,\n  get() {\n    return this.buffered.length - this.bufferedIndex\n  }\n})\nfunction Writable(options) {\n  // Writable ctor is applied to Duplexes, too.\n  // `realHasInstance` is necessary because using plain `instanceof`\n  // would return false, as no `_writableState` property is attached.\n\n  // Trying to use the custom `instanceof` for Writable here will also break the\n  // Node.js LazyTransform implementation, which has a non-trivial getter for\n  // `_writableState` that would lead to infinite recursion.\n\n  // Checking for a Stream.Duplex instance is faster here instead of inside\n  // the WritableState constructor, at least with V8 6.5.\n  const isDuplex = this instanceof require('./duplex')\n  if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable, this)) return new Writable(options)\n  this._writableState = new WritableState(options, this, isDuplex)\n  if (options) {\n    if (typeof options.write === 'function') this._write = options.write\n    if (typeof options.writev === 'function') this._writev = options.writev\n    if (typeof options.destroy === 'function') this._destroy = options.destroy\n    if (typeof options.final === 'function') this._final = options.final\n    if (typeof options.construct === 'function') this._construct = options.construct\n    if (options.signal) addAbortSignal(options.signal, this)\n  }\n  Stream.call(this, options)\n  destroyImpl.construct(this, () => {\n    const state = this._writableState\n    if (!state.writing) {\n      clearBuffer(this, state)\n    }\n    finishMaybe(this, state)\n  })\n}\nObjectDefineProperty(Writable, SymbolHasInstance, {\n  __proto__: null,\n  value: function (object) {\n    if (FunctionPrototypeSymbolHasInstance(this, object)) return true\n    if (this !== Writable) return false\n    return object && object._writableState instanceof WritableState\n  }\n})\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n  errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE())\n}\nfunction _write(stream, chunk, encoding, cb) {\n  const state = stream._writableState\n  if (typeof encoding === 'function') {\n    cb = encoding\n    encoding = state.defaultEncoding\n  } else {\n    if (!encoding) encoding = state.defaultEncoding\n    else if (encoding !== 'buffer' && !Buffer.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding)\n    if (typeof cb !== 'function') cb = nop\n  }\n  if (chunk === null) {\n    throw new ERR_STREAM_NULL_VALUES()\n  } else if (!state.objectMode) {\n    if (typeof chunk === 'string') {\n      if (state.decodeStrings !== false) {\n        chunk = Buffer.from(chunk, encoding)\n        encoding = 'buffer'\n      }\n    } else if (chunk instanceof Buffer) {\n      encoding = 'buffer'\n    } else if (Stream._isUint8Array(chunk)) {\n      chunk = Stream._uint8ArrayToBuffer(chunk)\n      encoding = 'buffer'\n    } else {\n      throw new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk)\n    }\n  }\n  let err\n  if (state.ending) {\n    err = new ERR_STREAM_WRITE_AFTER_END()\n  } else if (state.destroyed) {\n    err = new ERR_STREAM_DESTROYED('write')\n  }\n  if (err) {\n    process.nextTick(cb, err)\n    errorOrDestroy(stream, err, true)\n    return err\n  }\n  state.pendingcb++\n  return writeOrBuffer(stream, state, chunk, encoding, cb)\n}\nWritable.prototype.write = function (chunk, encoding, cb) {\n  return _write(this, chunk, encoding, cb) === true\n}\nWritable.prototype.cork = function () {\n  this._writableState.corked++\n}\nWritable.prototype.uncork = function () {\n  const state = this._writableState\n  if (state.corked) {\n    state.corked--\n    if (!state.writing) clearBuffer(this, state)\n  }\n}\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n  // node::ParseEncoding() requires lower case.\n  if (typeof encoding === 'string') encoding = StringPrototypeToLowerCase(encoding)\n  if (!Buffer.isEncoding(encoding)) throw new ERR_UNKNOWN_ENCODING(encoding)\n  this._writableState.defaultEncoding = encoding\n  return this\n}\n\n// If we're already writing something, then just put this\n// in the queue, and wait our turn.  Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, chunk, encoding, callback) {\n  const len = state.objectMode ? 1 : chunk.length\n  state.length += len\n\n  // stream._write resets state.length\n  const ret = state.length < state.highWaterMark\n  // We must ensure that previous needDrain will not be reset to false.\n  if (!ret) state.needDrain = true\n  if (state.writing || state.corked || state.errored || !state.constructed) {\n    state.buffered.push({\n      chunk,\n      encoding,\n      callback\n    })\n    if (state.allBuffers && encoding !== 'buffer') {\n      state.allBuffers = false\n    }\n    if (state.allNoop && callback !== nop) {\n      state.allNoop = false\n    }\n  } else {\n    state.writelen = len\n    state.writecb = callback\n    state.writing = true\n    state.sync = true\n    stream._write(chunk, encoding, state.onwrite)\n    state.sync = false\n  }\n\n  // Return false if errored or destroyed in order to break\n  // any synchronous while(stream.write(data)) loops.\n  return ret && !state.errored && !state.destroyed\n}\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n  state.writelen = len\n  state.writecb = cb\n  state.writing = true\n  state.sync = true\n  if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'))\n  else if (writev) stream._writev(chunk, state.onwrite)\n  else stream._write(chunk, encoding, state.onwrite)\n  state.sync = false\n}\nfunction onwriteError(stream, state, er, cb) {\n  --state.pendingcb\n  cb(er)\n  // Ensure callbacks are invoked even when autoDestroy is\n  // not enabled. Passing `er` here doesn't make sense since\n  // it's related to one specific write, not to the buffered\n  // writes.\n  errorBuffer(state)\n  // This can emit error, but error must always follow cb.\n  errorOrDestroy(stream, er)\n}\nfunction onwrite(stream, er) {\n  const state = stream._writableState\n  const sync = state.sync\n  const cb = state.writecb\n  if (typeof cb !== 'function') {\n    errorOrDestroy(stream, new ERR_MULTIPLE_CALLBACK())\n    return\n  }\n  state.writing = false\n  state.writecb = null\n  state.length -= state.writelen\n  state.writelen = 0\n  if (er) {\n    // Avoid V8 leak, https://github.com/nodejs/node/pull/34103#issuecomment-652002364\n    er.stack // eslint-disable-line no-unused-expressions\n\n    if (!state.errored) {\n      state.errored = er\n    }\n\n    // In case of duplex streams we need to notify the readable side of the\n    // error.\n    if (stream._readableState && !stream._readableState.errored) {\n      stream._readableState.errored = er\n    }\n    if (sync) {\n      process.nextTick(onwriteError, stream, state, er, cb)\n    } else {\n      onwriteError(stream, state, er, cb)\n    }\n  } else {\n    if (state.buffered.length > state.bufferedIndex) {\n      clearBuffer(stream, state)\n    }\n    if (sync) {\n      // It is a common case that the callback passed to .write() is always\n      // the same. In that case, we do not schedule a new nextTick(), but\n      // rather just increase a counter, to improve performance and avoid\n      // memory allocations.\n      if (state.afterWriteTickInfo !== null && state.afterWriteTickInfo.cb === cb) {\n        state.afterWriteTickInfo.count++\n      } else {\n        state.afterWriteTickInfo = {\n          count: 1,\n          cb,\n          stream,\n          state\n        }\n        process.nextTick(afterWriteTick, state.afterWriteTickInfo)\n      }\n    } else {\n      afterWrite(stream, state, 1, cb)\n    }\n  }\n}\nfunction afterWriteTick({ stream, state, count, cb }) {\n  state.afterWriteTickInfo = null\n  return afterWrite(stream, state, count, cb)\n}\nfunction afterWrite(stream, state, count, cb) {\n  const needDrain = !state.ending && !stream.destroyed && state.length === 0 && state.needDrain\n  if (needDrain) {\n    state.needDrain = false\n    stream.emit('drain')\n  }\n  while (count-- > 0) {\n    state.pendingcb--\n    cb()\n  }\n  if (state.destroyed) {\n    errorBuffer(state)\n  }\n  finishMaybe(stream, state)\n}\n\n// If there's something in the buffer waiting, then invoke callbacks.\nfunction errorBuffer(state) {\n  if (state.writing) {\n    return\n  }\n  for (let n = state.bufferedIndex; n < state.buffered.length; ++n) {\n    var _state$errored\n    const { chunk, callback } = state.buffered[n]\n    const len = state.objectMode ? 1 : chunk.length\n    state.length -= len\n    callback(\n      (_state$errored = state.errored) !== null && _state$errored !== undefined\n        ? _state$errored\n        : new ERR_STREAM_DESTROYED('write')\n    )\n  }\n  const onfinishCallbacks = state[kOnFinished].splice(0)\n  for (let i = 0; i < onfinishCallbacks.length; i++) {\n    var _state$errored2\n    onfinishCallbacks[i](\n      (_state$errored2 = state.errored) !== null && _state$errored2 !== undefined\n        ? _state$errored2\n        : new ERR_STREAM_DESTROYED('end')\n    )\n  }\n  resetBuffer(state)\n}\n\n// If there's something in the buffer waiting, then process it.\nfunction clearBuffer(stream, state) {\n  if (state.corked || state.bufferProcessing || state.destroyed || !state.constructed) {\n    return\n  }\n  const { buffered, bufferedIndex, objectMode } = state\n  const bufferedLength = buffered.length - bufferedIndex\n  if (!bufferedLength) {\n    return\n  }\n  let i = bufferedIndex\n  state.bufferProcessing = true\n  if (bufferedLength > 1 && stream._writev) {\n    state.pendingcb -= bufferedLength - 1\n    const callback = state.allNoop\n      ? nop\n      : (err) => {\n          for (let n = i; n < buffered.length; ++n) {\n            buffered[n].callback(err)\n          }\n        }\n    // Make a copy of `buffered` if it's going to be used by `callback` above,\n    // since `doWrite` will mutate the array.\n    const chunks = state.allNoop && i === 0 ? buffered : ArrayPrototypeSlice(buffered, i)\n    chunks.allBuffers = state.allBuffers\n    doWrite(stream, state, true, state.length, chunks, '', callback)\n    resetBuffer(state)\n  } else {\n    do {\n      const { chunk, encoding, callback } = buffered[i]\n      buffered[i++] = null\n      const len = objectMode ? 1 : chunk.length\n      doWrite(stream, state, false, len, chunk, encoding, callback)\n    } while (i < buffered.length && !state.writing)\n    if (i === buffered.length) {\n      resetBuffer(state)\n    } else if (i > 256) {\n      buffered.splice(0, i)\n      state.bufferedIndex = 0\n    } else {\n      state.bufferedIndex = i\n    }\n  }\n  state.bufferProcessing = false\n}\nWritable.prototype._write = function (chunk, encoding, cb) {\n  if (this._writev) {\n    this._writev(\n      [\n        {\n          chunk,\n          encoding\n        }\n      ],\n      cb\n    )\n  } else {\n    throw new ERR_METHOD_NOT_IMPLEMENTED('_write()')\n  }\n}\nWritable.prototype._writev = null\nWritable.prototype.end = function (chunk, encoding, cb) {\n  const state = this._writableState\n  if (typeof chunk === 'function') {\n    cb = chunk\n    chunk = null\n    encoding = null\n  } else if (typeof encoding === 'function') {\n    cb = encoding\n    encoding = null\n  }\n  let err\n  if (chunk !== null && chunk !== undefined) {\n    const ret = _write(this, chunk, encoding)\n    if (ret instanceof Error) {\n      err = ret\n    }\n  }\n\n  // .end() fully uncorks.\n  if (state.corked) {\n    state.corked = 1\n    this.uncork()\n  }\n  if (err) {\n    // Do nothing...\n  } else if (!state.errored && !state.ending) {\n    // This is forgiving in terms of unnecessary calls to end() and can hide\n    // logic errors. However, usually such errors are harmless and causing a\n    // hard error can be disproportionately destructive. It is not always\n    // trivial for the user to determine whether end() needs to be called\n    // or not.\n\n    state.ending = true\n    finishMaybe(this, state, true)\n    state.ended = true\n  } else if (state.finished) {\n    err = new ERR_STREAM_ALREADY_FINISHED('end')\n  } else if (state.destroyed) {\n    err = new ERR_STREAM_DESTROYED('end')\n  }\n  if (typeof cb === 'function') {\n    if (err || state.finished) {\n      process.nextTick(cb, err)\n    } else {\n      state[kOnFinished].push(cb)\n    }\n  }\n  return this\n}\nfunction needFinish(state) {\n  return (\n    state.ending &&\n    !state.destroyed &&\n    state.constructed &&\n    state.length === 0 &&\n    !state.errored &&\n    state.buffered.length === 0 &&\n    !state.finished &&\n    !state.writing &&\n    !state.errorEmitted &&\n    !state.closeEmitted\n  )\n}\nfunction callFinal(stream, state) {\n  let called = false\n  function onFinish(err) {\n    if (called) {\n      errorOrDestroy(stream, err !== null && err !== undefined ? err : ERR_MULTIPLE_CALLBACK())\n      return\n    }\n    called = true\n    state.pendingcb--\n    if (err) {\n      const onfinishCallbacks = state[kOnFinished].splice(0)\n      for (let i = 0; i < onfinishCallbacks.length; i++) {\n        onfinishCallbacks[i](err)\n      }\n      errorOrDestroy(stream, err, state.sync)\n    } else if (needFinish(state)) {\n      state.prefinished = true\n      stream.emit('prefinish')\n      // Backwards compat. Don't check state.sync here.\n      // Some streams assume 'finish' will be emitted\n      // asynchronously relative to _final callback.\n      state.pendingcb++\n      process.nextTick(finish, stream, state)\n    }\n  }\n  state.sync = true\n  state.pendingcb++\n  try {\n    stream._final(onFinish)\n  } catch (err) {\n    onFinish(err)\n  }\n  state.sync = false\n}\nfunction prefinish(stream, state) {\n  if (!state.prefinished && !state.finalCalled) {\n    if (typeof stream._final === 'function' && !state.destroyed) {\n      state.finalCalled = true\n      callFinal(stream, state)\n    } else {\n      state.prefinished = true\n      stream.emit('prefinish')\n    }\n  }\n}\nfunction finishMaybe(stream, state, sync) {\n  if (needFinish(state)) {\n    prefinish(stream, state)\n    if (state.pendingcb === 0) {\n      if (sync) {\n        state.pendingcb++\n        process.nextTick(\n          (stream, state) => {\n            if (needFinish(state)) {\n              finish(stream, state)\n            } else {\n              state.pendingcb--\n            }\n          },\n          stream,\n          state\n        )\n      } else if (needFinish(state)) {\n        state.pendingcb++\n        finish(stream, state)\n      }\n    }\n  }\n}\nfunction finish(stream, state) {\n  state.pendingcb--\n  state.finished = true\n  const onfinishCallbacks = state[kOnFinished].splice(0)\n  for (let i = 0; i < onfinishCallbacks.length; i++) {\n    onfinishCallbacks[i]()\n  }\n  stream.emit('finish')\n  if (state.autoDestroy) {\n    // In case of duplex streams we need a way to detect\n    // if the readable side is ready for autoDestroy as well.\n    const rState = stream._readableState\n    const autoDestroy =\n      !rState ||\n      (rState.autoDestroy &&\n        // We don't expect the readable to ever 'end'\n        // if readable is explicitly set to false.\n        (rState.endEmitted || rState.readable === false))\n    if (autoDestroy) {\n      stream.destroy()\n    }\n  }\n}\nObjectDefineProperties(Writable.prototype, {\n  closed: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.closed : false\n    }\n  },\n  destroyed: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.destroyed : false\n    },\n    set(value) {\n      // Backward compatibility, the user is explicitly managing destroyed.\n      if (this._writableState) {\n        this._writableState.destroyed = value\n      }\n    }\n  },\n  writable: {\n    __proto__: null,\n    get() {\n      const w = this._writableState\n      // w.writable === false means that this is part of a Duplex stream\n      // where the writable side was disabled upon construction.\n      // Compat. The user might manually disable writable side through\n      // deprecated setter.\n      return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended\n    },\n    set(val) {\n      // Backwards compatible.\n      if (this._writableState) {\n        this._writableState.writable = !!val\n      }\n    }\n  },\n  writableFinished: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.finished : false\n    }\n  },\n  writableObjectMode: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.objectMode : false\n    }\n  },\n  writableBuffer: {\n    __proto__: null,\n    get() {\n      return this._writableState && this._writableState.getBuffer()\n    }\n  },\n  writableEnded: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.ending : false\n    }\n  },\n  writableNeedDrain: {\n    __proto__: null,\n    get() {\n      const wState = this._writableState\n      if (!wState) return false\n      return !wState.destroyed && !wState.ending && wState.needDrain\n    }\n  },\n  writableHighWaterMark: {\n    __proto__: null,\n    get() {\n      return this._writableState && this._writableState.highWaterMark\n    }\n  },\n  writableCorked: {\n    __proto__: null,\n    get() {\n      return this._writableState ? this._writableState.corked : 0\n    }\n  },\n  writableLength: {\n    __proto__: null,\n    get() {\n      return this._writableState && this._writableState.length\n    }\n  },\n  errored: {\n    __proto__: null,\n    enumerable: false,\n    get() {\n      return this._writableState ? this._writableState.errored : null\n    }\n  },\n  writableAborted: {\n    __proto__: null,\n    enumerable: false,\n    get: function () {\n      return !!(\n        this._writableState.writable !== false &&\n        (this._writableState.destroyed || this._writableState.errored) &&\n        !this._writableState.finished\n      )\n    }\n  }\n})\nconst destroy = destroyImpl.destroy\nWritable.prototype.destroy = function (err, cb) {\n  const state = this._writableState\n\n  // Invoke pending callbacks.\n  if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length)) {\n    process.nextTick(errorBuffer, state)\n  }\n  destroy.call(this, err, cb)\n  return this\n}\nWritable.prototype._undestroy = destroyImpl.undestroy\nWritable.prototype._destroy = function (err, cb) {\n  cb(err)\n}\nWritable.prototype[EE.captureRejectionSymbol] = function (err) {\n  this.destroy(err)\n}\nlet webStreamsAdapters\n\n// Lazy to avoid circular references\nfunction lazyWebStreams() {\n  if (webStreamsAdapters === undefined) webStreamsAdapters = {}\n  return webStreamsAdapters\n}\nWritable.fromWeb = function (writableStream, options) {\n  return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options)\n}\nWritable.toWeb = function (streamWritable) {\n  return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable)\n}\n","/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n\n;('use strict')\nconst bufferModule = require('buffer')\nconst {\n  isReadable,\n  isWritable,\n  isIterable,\n  isNodeStream,\n  isReadableNodeStream,\n  isWritableNodeStream,\n  isDuplexNodeStream,\n  isReadableStream,\n  isWritableStream\n} = require('./utils')\nconst eos = require('./end-of-stream')\nconst {\n  AbortError,\n  codes: { ERR_INVALID_ARG_TYPE, ERR_INVALID_RETURN_VALUE }\n} = require('../../ours/errors')\nconst { destroyer } = require('./destroy')\nconst Duplex = require('./duplex')\nconst Readable = require('./readable')\nconst Writable = require('./writable')\nconst { createDeferredPromise } = require('../../ours/util')\nconst from = require('./from')\nconst Blob = globalThis.Blob || bufferModule.Blob\nconst isBlob =\n  typeof Blob !== 'undefined'\n    ? function isBlob(b) {\n        return b instanceof Blob\n      }\n    : function isBlob(b) {\n        return false\n      }\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nconst { FunctionPrototypeCall } = require('../../ours/primordials')\n\n// This is needed for pre node 17.\nclass Duplexify extends Duplex {\n  constructor(options) {\n    super(options)\n\n    // https://github.com/nodejs/node/pull/34385\n\n    if ((options === null || options === undefined ? undefined : options.readable) === false) {\n      this._readableState.readable = false\n      this._readableState.ended = true\n      this._readableState.endEmitted = true\n    }\n    if ((options === null || options === undefined ? undefined : options.writable) === false) {\n      this._writableState.writable = false\n      this._writableState.ending = true\n      this._writableState.ended = true\n      this._writableState.finished = true\n    }\n  }\n}\nmodule.exports = function duplexify(body, name) {\n  if (isDuplexNodeStream(body)) {\n    return body\n  }\n  if (isReadableNodeStream(body)) {\n    return _duplexify({\n      readable: body\n    })\n  }\n  if (isWritableNodeStream(body)) {\n    return _duplexify({\n      writable: body\n    })\n  }\n  if (isNodeStream(body)) {\n    return _duplexify({\n      writable: false,\n      readable: false\n    })\n  }\n  if (isReadableStream(body)) {\n    return _duplexify({\n      readable: Readable.fromWeb(body)\n    })\n  }\n  if (isWritableStream(body)) {\n    return _duplexify({\n      writable: Writable.fromWeb(body)\n    })\n  }\n  if (typeof body === 'function') {\n    const { value, write, final, destroy } = fromAsyncGen(body)\n    if (isIterable(value)) {\n      return from(Duplexify, value, {\n        // TODO (ronag): highWaterMark?\n        objectMode: true,\n        write,\n        final,\n        destroy\n      })\n    }\n    const then = value === null || value === undefined ? undefined : value.then\n    if (typeof then === 'function') {\n      let d\n      const promise = FunctionPrototypeCall(\n        then,\n        value,\n        (val) => {\n          if (val != null) {\n            throw new ERR_INVALID_RETURN_VALUE('nully', 'body', val)\n          }\n        },\n        (err) => {\n          destroyer(d, err)\n        }\n      )\n      return (d = new Duplexify({\n        // TODO (ronag): highWaterMark?\n        objectMode: true,\n        readable: false,\n        write,\n        final(cb) {\n          final(async () => {\n            try {\n              await promise\n              process.nextTick(cb, null)\n            } catch (err) {\n              process.nextTick(cb, err)\n            }\n          })\n        },\n        destroy\n      }))\n    }\n    throw new ERR_INVALID_RETURN_VALUE('Iterable, AsyncIterable or AsyncFunction', name, value)\n  }\n  if (isBlob(body)) {\n    return duplexify(body.arrayBuffer())\n  }\n  if (isIterable(body)) {\n    return from(Duplexify, body, {\n      // TODO (ronag): highWaterMark?\n      objectMode: true,\n      writable: false\n    })\n  }\n  if (\n    isReadableStream(body === null || body === undefined ? undefined : body.readable) &&\n    isWritableStream(body === null || body === undefined ? undefined : body.writable)\n  ) {\n    return Duplexify.fromWeb(body)\n  }\n  if (\n    typeof (body === null || body === undefined ? undefined : body.writable) === 'object' ||\n    typeof (body === null || body === undefined ? undefined : body.readable) === 'object'\n  ) {\n    const readable =\n      body !== null && body !== undefined && body.readable\n        ? isReadableNodeStream(body === null || body === undefined ? undefined : body.readable)\n          ? body === null || body === undefined\n            ? undefined\n            : body.readable\n          : duplexify(body.readable)\n        : undefined\n    const writable =\n      body !== null && body !== undefined && body.writable\n        ? isWritableNodeStream(body === null || body === undefined ? undefined : body.writable)\n          ? body === null || body === undefined\n            ? undefined\n            : body.writable\n          : duplexify(body.writable)\n        : undefined\n    return _duplexify({\n      readable,\n      writable\n    })\n  }\n  const then = body === null || body === undefined ? undefined : body.then\n  if (typeof then === 'function') {\n    let d\n    FunctionPrototypeCall(\n      then,\n      body,\n      (val) => {\n        if (val != null) {\n          d.push(val)\n        }\n        d.push(null)\n      },\n      (err) => {\n        destroyer(d, err)\n      }\n    )\n    return (d = new Duplexify({\n      objectMode: true,\n      writable: false,\n      read() {}\n    }))\n  }\n  throw new ERR_INVALID_ARG_TYPE(\n    name,\n    [\n      'Blob',\n      'ReadableStream',\n      'WritableStream',\n      'Stream',\n      'Iterable',\n      'AsyncIterable',\n      'Function',\n      '{ readable, writable } pair',\n      'Promise'\n    ],\n    body\n  )\n}\nfunction fromAsyncGen(fn) {\n  let { promise, resolve } = createDeferredPromise()\n  const ac = new AbortController()\n  const signal = ac.signal\n  const value = fn(\n    (async function* () {\n      while (true) {\n        const _promise = promise\n        promise = null\n        const { chunk, done, cb } = await _promise\n        process.nextTick(cb)\n        if (done) return\n        if (signal.aborted)\n          throw new AbortError(undefined, {\n            cause: signal.reason\n          })\n        ;({ promise, resolve } = createDeferredPromise())\n        yield chunk\n      }\n    })(),\n    {\n      signal\n    }\n  )\n  return {\n    value,\n    write(chunk, encoding, cb) {\n      const _resolve = resolve\n      resolve = null\n      _resolve({\n        chunk,\n        done: false,\n        cb\n      })\n    },\n    final(cb) {\n      const _resolve = resolve\n      resolve = null\n      _resolve({\n        done: true,\n        cb\n      })\n    },\n    destroy(err, cb) {\n      ac.abort()\n      cb(err)\n    }\n  }\n}\nfunction _duplexify(pair) {\n  const r = pair.readable && typeof pair.readable.read !== 'function' ? Readable.wrap(pair.readable) : pair.readable\n  const w = pair.writable\n  let readable = !!isReadable(r)\n  let writable = !!isWritable(w)\n  let ondrain\n  let onfinish\n  let onreadable\n  let onclose\n  let d\n  function onfinished(err) {\n    const cb = onclose\n    onclose = null\n    if (cb) {\n      cb(err)\n    } else if (err) {\n      d.destroy(err)\n    }\n  }\n\n  // TODO(ronag): Avoid double buffering.\n  // Implement Writable/Readable/Duplex traits.\n  // See, https://github.com/nodejs/node/pull/33515.\n  d = new Duplexify({\n    // TODO (ronag): highWaterMark?\n    readableObjectMode: !!(r !== null && r !== undefined && r.readableObjectMode),\n    writableObjectMode: !!(w !== null && w !== undefined && w.writableObjectMode),\n    readable,\n    writable\n  })\n  if (writable) {\n    eos(w, (err) => {\n      writable = false\n      if (err) {\n        destroyer(r, err)\n      }\n      onfinished(err)\n    })\n    d._write = function (chunk, encoding, callback) {\n      if (w.write(chunk, encoding)) {\n        callback()\n      } else {\n        ondrain = callback\n      }\n    }\n    d._final = function (callback) {\n      w.end()\n      onfinish = callback\n    }\n    w.on('drain', function () {\n      if (ondrain) {\n        const cb = ondrain\n        ondrain = null\n        cb()\n      }\n    })\n    w.on('finish', function () {\n      if (onfinish) {\n        const cb = onfinish\n        onfinish = null\n        cb()\n      }\n    })\n  }\n  if (readable) {\n    eos(r, (err) => {\n      readable = false\n      if (err) {\n        destroyer(r, err)\n      }\n      onfinished(err)\n    })\n    r.on('readable', function () {\n      if (onreadable) {\n        const cb = onreadable\n        onreadable = null\n        cb()\n      }\n    })\n    r.on('end', function () {\n      d.push(null)\n    })\n    d._read = function () {\n      while (true) {\n        const buf = r.read()\n        if (buf === null) {\n          onreadable = d._read\n          return\n        }\n        if (!d.push(buf)) {\n          return\n        }\n      }\n    }\n  }\n  d._destroy = function (err, callback) {\n    if (!err && onclose !== null) {\n      err = new AbortError()\n    }\n    onreadable = null\n    ondrain = null\n    onfinish = null\n    if (onclose === null) {\n      callback(err)\n    } else {\n      onclose = callback\n      destroyer(w, err)\n      destroyer(r, err)\n    }\n  }\n  return d\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototype inheritance, this class\n// prototypically inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict'\n\nconst {\n  ObjectDefineProperties,\n  ObjectGetOwnPropertyDescriptor,\n  ObjectKeys,\n  ObjectSetPrototypeOf\n} = require('../../ours/primordials')\nmodule.exports = Duplex\nconst Readable = require('./readable')\nconst Writable = require('./writable')\nObjectSetPrototypeOf(Duplex.prototype, Readable.prototype)\nObjectSetPrototypeOf(Duplex, Readable)\n{\n  const keys = ObjectKeys(Writable.prototype)\n  // Allow the keys array to be GC'ed.\n  for (let i = 0; i < keys.length; i++) {\n    const method = keys[i]\n    if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]\n  }\n}\nfunction Duplex(options) {\n  if (!(this instanceof Duplex)) return new Duplex(options)\n  Readable.call(this, options)\n  Writable.call(this, options)\n  if (options) {\n    this.allowHalfOpen = options.allowHalfOpen !== false\n    if (options.readable === false) {\n      this._readableState.readable = false\n      this._readableState.ended = true\n      this._readableState.endEmitted = true\n    }\n    if (options.writable === false) {\n      this._writableState.writable = false\n      this._writableState.ending = true\n      this._writableState.ended = true\n      this._writableState.finished = true\n    }\n  } else {\n    this.allowHalfOpen = true\n  }\n}\nObjectDefineProperties(Duplex.prototype, {\n  writable: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writable')\n  },\n  writableHighWaterMark: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableHighWaterMark')\n  },\n  writableObjectMode: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableObjectMode')\n  },\n  writableBuffer: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableBuffer')\n  },\n  writableLength: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableLength')\n  },\n  writableFinished: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableFinished')\n  },\n  writableCorked: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableCorked')\n  },\n  writableEnded: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableEnded')\n  },\n  writableNeedDrain: {\n    __proto__: null,\n    ...ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableNeedDrain')\n  },\n  destroyed: {\n    __proto__: null,\n    get() {\n      if (this._readableState === undefined || this._writableState === undefined) {\n        return false\n      }\n      return this._readableState.destroyed && this._writableState.destroyed\n    },\n    set(value) {\n      // Backward compatibility, the user is explicitly\n      // managing destroyed.\n      if (this._readableState && this._writableState) {\n        this._readableState.destroyed = value\n        this._writableState.destroyed = value\n      }\n    }\n  }\n})\nlet webStreamsAdapters\n\n// Lazy to avoid circular references\nfunction lazyWebStreams() {\n  if (webStreamsAdapters === undefined) webStreamsAdapters = {}\n  return webStreamsAdapters\n}\nDuplex.fromWeb = function (pair, options) {\n  return lazyWebStreams().newStreamDuplexFromReadableWritablePair(pair, options)\n}\nDuplex.toWeb = function (duplex) {\n  return lazyWebStreams().newReadableWritablePairFromDuplex(duplex)\n}\nlet duplexify\nDuplex.from = function (body) {\n  if (!duplexify) {\n    duplexify = require('./duplexify')\n  }\n  return duplexify(body, 'body')\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data.  Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored.  (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation.  For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes.  When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up.  When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer.  When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks.  If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk.  However,\n// a pathological inflate type of transform can cause excessive buffering\n// here.  For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output.  Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output.  In this case, you could write a very small\n// amount of input, and end up with a very large amount of output.  In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform.  A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict'\n\nconst { ObjectSetPrototypeOf, Symbol } = require('../../ours/primordials')\nmodule.exports = Transform\nconst { ERR_METHOD_NOT_IMPLEMENTED } = require('../../ours/errors').codes\nconst Duplex = require('./duplex')\nconst { getHighWaterMark } = require('./state')\nObjectSetPrototypeOf(Transform.prototype, Duplex.prototype)\nObjectSetPrototypeOf(Transform, Duplex)\nconst kCallback = Symbol('kCallback')\nfunction Transform(options) {\n  if (!(this instanceof Transform)) return new Transform(options)\n\n  // TODO (ronag): This should preferably always be\n  // applied but would be semver-major. Or even better;\n  // make Transform a Readable with the Writable interface.\n  const readableHighWaterMark = options ? getHighWaterMark(this, options, 'readableHighWaterMark', true) : null\n  if (readableHighWaterMark === 0) {\n    // A Duplex will buffer both on the writable and readable side while\n    // a Transform just wants to buffer hwm number of elements. To avoid\n    // buffering twice we disable buffering on the writable side.\n    options = {\n      ...options,\n      highWaterMark: null,\n      readableHighWaterMark,\n      // TODO (ronag): 0 is not optimal since we have\n      // a \"bug\" where we check needDrain before calling _write and not after.\n      // Refs: https://github.com/nodejs/node/pull/32887\n      // Refs: https://github.com/nodejs/node/pull/35941\n      writableHighWaterMark: options.writableHighWaterMark || 0\n    }\n  }\n  Duplex.call(this, options)\n\n  // We have implemented the _read method, and done the other things\n  // that Readable wants before the first _read call, so unset the\n  // sync guard flag.\n  this._readableState.sync = false\n  this[kCallback] = null\n  if (options) {\n    if (typeof options.transform === 'function') this._transform = options.transform\n    if (typeof options.flush === 'function') this._flush = options.flush\n  }\n\n  // When the writable side finishes, then flush out anything remaining.\n  // Backwards compat. Some Transform streams incorrectly implement _final\n  // instead of or in addition to _flush. By using 'prefinish' instead of\n  // implementing _final we continue supporting this unfortunate use case.\n  this.on('prefinish', prefinish)\n}\nfunction final(cb) {\n  if (typeof this._flush === 'function' && !this.destroyed) {\n    this._flush((er, data) => {\n      if (er) {\n        if (cb) {\n          cb(er)\n        } else {\n          this.destroy(er)\n        }\n        return\n      }\n      if (data != null) {\n        this.push(data)\n      }\n      this.push(null)\n      if (cb) {\n        cb()\n      }\n    })\n  } else {\n    this.push(null)\n    if (cb) {\n      cb()\n    }\n  }\n}\nfunction prefinish() {\n  if (this._final !== final) {\n    final.call(this)\n  }\n}\nTransform.prototype._final = final\nTransform.prototype._transform = function (chunk, encoding, callback) {\n  throw new ERR_METHOD_NOT_IMPLEMENTED('_transform()')\n}\nTransform.prototype._write = function (chunk, encoding, callback) {\n  const rState = this._readableState\n  const wState = this._writableState\n  const length = rState.length\n  this._transform(chunk, encoding, (err, val) => {\n    if (err) {\n      callback(err)\n      return\n    }\n    if (val != null) {\n      this.push(val)\n    }\n    if (\n      wState.ended ||\n      // Backwards compat.\n      length === rState.length ||\n      // Backwards compat.\n      rState.length < rState.highWaterMark\n    ) {\n      callback()\n    } else {\n      this[kCallback] = callback\n    }\n  })\n}\nTransform.prototype._read = function () {\n  if (this[kCallback]) {\n    const callback = this[kCallback]\n    this[kCallback] = null\n    callback()\n  }\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict'\n\nconst { ObjectSetPrototypeOf } = require('../../ours/primordials')\nmodule.exports = PassThrough\nconst Transform = require('./transform')\nObjectSetPrototypeOf(PassThrough.prototype, Transform.prototype)\nObjectSetPrototypeOf(PassThrough, Transform)\nfunction PassThrough(options) {\n  if (!(this instanceof PassThrough)) return new PassThrough(options)\n  Transform.call(this, options)\n}\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n  cb(null, chunk)\n}\n","/* replacement start */\n\nconst process = require('process/')\n\n/* replacement end */\n// Ported from https://github.com/mafintosh/pump with\n// permission from the author, Mathias Buus (@mafintosh).\n\n;('use strict')\nconst { ArrayIsArray, Promise, SymbolAsyncIterator, SymbolDispose } = require('../../ours/primordials')\nconst eos = require('./end-of-stream')\nconst { once } = require('../../ours/util')\nconst destroyImpl = require('./destroy')\nconst Duplex = require('./duplex')\nconst {\n  aggregateTwoErrors,\n  codes: {\n    ERR_INVALID_ARG_TYPE,\n    ERR_INVALID_RETURN_VALUE,\n    ERR_MISSING_ARGS,\n    ERR_STREAM_DESTROYED,\n    ERR_STREAM_PREMATURE_CLOSE\n  },\n  AbortError\n} = require('../../ours/errors')\nconst { validateFunction, validateAbortSignal } = require('../validators')\nconst {\n  isIterable,\n  isReadable,\n  isReadableNodeStream,\n  isNodeStream,\n  isTransformStream,\n  isWebStream,\n  isReadableStream,\n  isReadableFinished\n} = require('./utils')\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nlet PassThrough\nlet Readable\nlet addAbortListener\nfunction destroyer(stream, reading, writing) {\n  let finished = false\n  stream.on('close', () => {\n    finished = true\n  })\n  const cleanup = eos(\n    stream,\n    {\n      readable: reading,\n      writable: writing\n    },\n    (err) => {\n      finished = !err\n    }\n  )\n  return {\n    destroy: (err) => {\n      if (finished) return\n      finished = true\n      destroyImpl.destroyer(stream, err || new ERR_STREAM_DESTROYED('pipe'))\n    },\n    cleanup\n  }\n}\nfunction popCallback(streams) {\n  // Streams should never be an empty array. It should always contain at least\n  // a single stream. Therefore optimize for the average case instead of\n  // checking for length === 0 as well.\n  validateFunction(streams[streams.length - 1], 'streams[stream.length - 1]')\n  return streams.pop()\n}\nfunction makeAsyncIterable(val) {\n  if (isIterable(val)) {\n    return val\n  } else if (isReadableNodeStream(val)) {\n    // Legacy streams are not Iterable.\n    return fromReadable(val)\n  }\n  throw new ERR_INVALID_ARG_TYPE('val', ['Readable', 'Iterable', 'AsyncIterable'], val)\n}\nasync function* fromReadable(val) {\n  if (!Readable) {\n    Readable = require('./readable')\n  }\n  yield* Readable.prototype[SymbolAsyncIterator].call(val)\n}\nasync function pumpToNode(iterable, writable, finish, { end }) {\n  let error\n  let onresolve = null\n  const resume = (err) => {\n    if (err) {\n      error = err\n    }\n    if (onresolve) {\n      const callback = onresolve\n      onresolve = null\n      callback()\n    }\n  }\n  const wait = () =>\n    new Promise((resolve, reject) => {\n      if (error) {\n        reject(error)\n      } else {\n        onresolve = () => {\n          if (error) {\n            reject(error)\n          } else {\n            resolve()\n          }\n        }\n      }\n    })\n  writable.on('drain', resume)\n  const cleanup = eos(\n    writable,\n    {\n      readable: false\n    },\n    resume\n  )\n  try {\n    if (writable.writableNeedDrain) {\n      await wait()\n    }\n    for await (const chunk of iterable) {\n      if (!writable.write(chunk)) {\n        await wait()\n      }\n    }\n    if (end) {\n      writable.end()\n      await wait()\n    }\n    finish()\n  } catch (err) {\n    finish(error !== err ? aggregateTwoErrors(error, err) : err)\n  } finally {\n    cleanup()\n    writable.off('drain', resume)\n  }\n}\nasync function pumpToWeb(readable, writable, finish, { end }) {\n  if (isTransformStream(writable)) {\n    writable = writable.writable\n  }\n  // https://streams.spec.whatwg.org/#example-manual-write-with-backpressure\n  const writer = writable.getWriter()\n  try {\n    for await (const chunk of readable) {\n      await writer.ready\n      writer.write(chunk).catch(() => {})\n    }\n    await writer.ready\n    if (end) {\n      await writer.close()\n    }\n    finish()\n  } catch (err) {\n    try {\n      await writer.abort(err)\n      finish(err)\n    } catch (err) {\n      finish(err)\n    }\n  }\n}\nfunction pipeline(...streams) {\n  return pipelineImpl(streams, once(popCallback(streams)))\n}\nfunction pipelineImpl(streams, callback, opts) {\n  if (streams.length === 1 && ArrayIsArray(streams[0])) {\n    streams = streams[0]\n  }\n  if (streams.length < 2) {\n    throw new ERR_MISSING_ARGS('streams')\n  }\n  const ac = new AbortController()\n  const signal = ac.signal\n  const outerSignal = opts === null || opts === undefined ? undefined : opts.signal\n\n  // Need to cleanup event listeners if last stream is readable\n  // https://github.com/nodejs/node/issues/35452\n  const lastStreamCleanup = []\n  validateAbortSignal(outerSignal, 'options.signal')\n  function abort() {\n    finishImpl(new AbortError())\n  }\n  addAbortListener = addAbortListener || require('../../ours/util').addAbortListener\n  let disposable\n  if (outerSignal) {\n    disposable = addAbortListener(outerSignal, abort)\n  }\n  let error\n  let value\n  const destroys = []\n  let finishCount = 0\n  function finish(err) {\n    finishImpl(err, --finishCount === 0)\n  }\n  function finishImpl(err, final) {\n    var _disposable\n    if (err && (!error || error.code === 'ERR_STREAM_PREMATURE_CLOSE')) {\n      error = err\n    }\n    if (!error && !final) {\n      return\n    }\n    while (destroys.length) {\n      destroys.shift()(error)\n    }\n    ;(_disposable = disposable) === null || _disposable === undefined ? undefined : _disposable[SymbolDispose]()\n    ac.abort()\n    if (final) {\n      if (!error) {\n        lastStreamCleanup.forEach((fn) => fn())\n      }\n      process.nextTick(callback, error, value)\n    }\n  }\n  let ret\n  for (let i = 0; i < streams.length; i++) {\n    const stream = streams[i]\n    const reading = i < streams.length - 1\n    const writing = i > 0\n    const end = reading || (opts === null || opts === undefined ? undefined : opts.end) !== false\n    const isLastStream = i === streams.length - 1\n    if (isNodeStream(stream)) {\n      if (end) {\n        const { destroy, cleanup } = destroyer(stream, reading, writing)\n        destroys.push(destroy)\n        if (isReadable(stream) && isLastStream) {\n          lastStreamCleanup.push(cleanup)\n        }\n      }\n\n      // Catch stream errors that occur after pipe/pump has completed.\n      function onError(err) {\n        if (err && err.name !== 'AbortError' && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {\n          finish(err)\n        }\n      }\n      stream.on('error', onError)\n      if (isReadable(stream) && isLastStream) {\n        lastStreamCleanup.push(() => {\n          stream.removeListener('error', onError)\n        })\n      }\n    }\n    if (i === 0) {\n      if (typeof stream === 'function') {\n        ret = stream({\n          signal\n        })\n        if (!isIterable(ret)) {\n          throw new ERR_INVALID_RETURN_VALUE('Iterable, AsyncIterable or Stream', 'source', ret)\n        }\n      } else if (isIterable(stream) || isReadableNodeStream(stream) || isTransformStream(stream)) {\n        ret = stream\n      } else {\n        ret = Duplex.from(stream)\n      }\n    } else if (typeof stream === 'function') {\n      if (isTransformStream(ret)) {\n        var _ret\n        ret = makeAsyncIterable((_ret = ret) === null || _ret === undefined ? undefined : _ret.readable)\n      } else {\n        ret = makeAsyncIterable(ret)\n      }\n      ret = stream(ret, {\n        signal\n      })\n      if (reading) {\n        if (!isIterable(ret, true)) {\n          throw new ERR_INVALID_RETURN_VALUE('AsyncIterable', `transform[${i - 1}]`, ret)\n        }\n      } else {\n        var _ret2\n        if (!PassThrough) {\n          PassThrough = require('./passthrough')\n        }\n\n        // If the last argument to pipeline is not a stream\n        // we must create a proxy stream so that pipeline(...)\n        // always returns a stream which can be further\n        // composed through `.pipe(stream)`.\n\n        const pt = new PassThrough({\n          objectMode: true\n        })\n\n        // Handle Promises/A+ spec, `then` could be a getter that throws on\n        // second use.\n        const then = (_ret2 = ret) === null || _ret2 === undefined ? undefined : _ret2.then\n        if (typeof then === 'function') {\n          finishCount++\n          then.call(\n            ret,\n            (val) => {\n              value = val\n              if (val != null) {\n                pt.write(val)\n              }\n              if (end) {\n                pt.end()\n              }\n              process.nextTick(finish)\n            },\n            (err) => {\n              pt.destroy(err)\n              process.nextTick(finish, err)\n            }\n          )\n        } else if (isIterable(ret, true)) {\n          finishCount++\n          pumpToNode(ret, pt, finish, {\n            end\n          })\n        } else if (isReadableStream(ret) || isTransformStream(ret)) {\n          const toRead = ret.readable || ret\n          finishCount++\n          pumpToNode(toRead, pt, finish, {\n            end\n          })\n        } else {\n          throw new ERR_INVALID_RETURN_VALUE('AsyncIterable or Promise', 'destination', ret)\n        }\n        ret = pt\n        const { destroy, cleanup } = destroyer(ret, false, true)\n        destroys.push(destroy)\n        if (isLastStream) {\n          lastStreamCleanup.push(cleanup)\n        }\n      }\n    } else if (isNodeStream(stream)) {\n      if (isReadableNodeStream(ret)) {\n        finishCount += 2\n        const cleanup = pipe(ret, stream, finish, {\n          end\n        })\n        if (isReadable(stream) && isLastStream) {\n          lastStreamCleanup.push(cleanup)\n        }\n      } else if (isTransformStream(ret) || isReadableStream(ret)) {\n        const toRead = ret.readable || ret\n        finishCount++\n        pumpToNode(toRead, stream, finish, {\n          end\n        })\n      } else if (isIterable(ret)) {\n        finishCount++\n        pumpToNode(ret, stream, finish, {\n          end\n        })\n      } else {\n        throw new ERR_INVALID_ARG_TYPE(\n          'val',\n          ['Readable', 'Iterable', 'AsyncIterable', 'ReadableStream', 'TransformStream'],\n          ret\n        )\n      }\n      ret = stream\n    } else if (isWebStream(stream)) {\n      if (isReadableNodeStream(ret)) {\n        finishCount++\n        pumpToWeb(makeAsyncIterable(ret), stream, finish, {\n          end\n        })\n      } else if (isReadableStream(ret) || isIterable(ret)) {\n        finishCount++\n        pumpToWeb(ret, stream, finish, {\n          end\n        })\n      } else if (isTransformStream(ret)) {\n        finishCount++\n        pumpToWeb(ret.readable, stream, finish, {\n          end\n        })\n      } else {\n        throw new ERR_INVALID_ARG_TYPE(\n          'val',\n          ['Readable', 'Iterable', 'AsyncIterable', 'ReadableStream', 'TransformStream'],\n          ret\n        )\n      }\n      ret = stream\n    } else {\n      ret = Duplex.from(stream)\n    }\n  }\n  if (\n    (signal !== null && signal !== undefined && signal.aborted) ||\n    (outerSignal !== null && outerSignal !== undefined && outerSignal.aborted)\n  ) {\n    process.nextTick(abort)\n  }\n  return ret\n}\nfunction pipe(src, dst, finish, { end }) {\n  let ended = false\n  dst.on('close', () => {\n    if (!ended) {\n      // Finish if the destination closes before the source has completed.\n      finish(new ERR_STREAM_PREMATURE_CLOSE())\n    }\n  })\n  src.pipe(dst, {\n    end: false\n  }) // If end is true we already will have a listener to end dst.\n\n  if (end) {\n    // Compat. Before node v10.12.0 stdio used to throw an error so\n    // pipe() did/does not end() stdio destinations.\n    // Now they allow it but \"secretly\" don't close the underlying fd.\n\n    function endFn() {\n      ended = true\n      dst.end()\n    }\n    if (isReadableFinished(src)) {\n      // End the destination if the source has already ended.\n      process.nextTick(endFn)\n    } else {\n      src.once('end', endFn)\n    }\n  } else {\n    finish()\n  }\n  eos(\n    src,\n    {\n      readable: true,\n      writable: false\n    },\n    (err) => {\n      const rState = src._readableState\n      if (\n        err &&\n        err.code === 'ERR_STREAM_PREMATURE_CLOSE' &&\n        rState &&\n        rState.ended &&\n        !rState.errored &&\n        !rState.errorEmitted\n      ) {\n        // Some readable streams will emit 'close' before 'end'. However, since\n        // this is on the readable side 'end' should still be emitted if the\n        // stream has been ended and no error emitted. This should be allowed in\n        // favor of backwards compatibility. Since the stream is piped to a\n        // destination this should not result in any observable difference.\n        // We don't need to check if this is a writable premature close since\n        // eos will only fail with premature close on the reading side for\n        // duplex streams.\n        src.once('end', finish).once('error', finish)\n      } else {\n        finish(err)\n      }\n    }\n  )\n  return eos(\n    dst,\n    {\n      readable: false,\n      writable: true\n    },\n    finish\n  )\n}\nmodule.exports = {\n  pipelineImpl,\n  pipeline\n}\n","'use strict'\n\nconst { pipeline } = require('./pipeline')\nconst Duplex = require('./duplex')\nconst { destroyer } = require('./destroy')\nconst {\n  isNodeStream,\n  isReadable,\n  isWritable,\n  isWebStream,\n  isTransformStream,\n  isWritableStream,\n  isReadableStream\n} = require('./utils')\nconst {\n  AbortError,\n  codes: { ERR_INVALID_ARG_VALUE, ERR_MISSING_ARGS }\n} = require('../../ours/errors')\nconst eos = require('./end-of-stream')\nmodule.exports = function compose(...streams) {\n  if (streams.length === 0) {\n    throw new ERR_MISSING_ARGS('streams')\n  }\n  if (streams.length === 1) {\n    return Duplex.from(streams[0])\n  }\n  const orgStreams = [...streams]\n  if (typeof streams[0] === 'function') {\n    streams[0] = Duplex.from(streams[0])\n  }\n  if (typeof streams[streams.length - 1] === 'function') {\n    const idx = streams.length - 1\n    streams[idx] = Duplex.from(streams[idx])\n  }\n  for (let n = 0; n < streams.length; ++n) {\n    if (!isNodeStream(streams[n]) && !isWebStream(streams[n])) {\n      // TODO(ronag): Add checks for non streams.\n      continue\n    }\n    if (\n      n < streams.length - 1 &&\n      !(isReadable(streams[n]) || isReadableStream(streams[n]) || isTransformStream(streams[n]))\n    ) {\n      throw new ERR_INVALID_ARG_VALUE(`streams[${n}]`, orgStreams[n], 'must be readable')\n    }\n    if (n > 0 && !(isWritable(streams[n]) || isWritableStream(streams[n]) || isTransformStream(streams[n]))) {\n      throw new ERR_INVALID_ARG_VALUE(`streams[${n}]`, orgStreams[n], 'must be writable')\n    }\n  }\n  let ondrain\n  let onfinish\n  let onreadable\n  let onclose\n  let d\n  function onfinished(err) {\n    const cb = onclose\n    onclose = null\n    if (cb) {\n      cb(err)\n    } else if (err) {\n      d.destroy(err)\n    } else if (!readable && !writable) {\n      d.destroy()\n    }\n  }\n  const head = streams[0]\n  const tail = pipeline(streams, onfinished)\n  const writable = !!(isWritable(head) || isWritableStream(head) || isTransformStream(head))\n  const readable = !!(isReadable(tail) || isReadableStream(tail) || isTransformStream(tail))\n\n  // TODO(ronag): Avoid double buffering.\n  // Implement Writable/Readable/Duplex traits.\n  // See, https://github.com/nodejs/node/pull/33515.\n  d = new Duplex({\n    // TODO (ronag): highWaterMark?\n    writableObjectMode: !!(head !== null && head !== undefined && head.writableObjectMode),\n    readableObjectMode: !!(tail !== null && tail !== undefined && tail.readableObjectMode),\n    writable,\n    readable\n  })\n  if (writable) {\n    if (isNodeStream(head)) {\n      d._write = function (chunk, encoding, callback) {\n        if (head.write(chunk, encoding)) {\n          callback()\n        } else {\n          ondrain = callback\n        }\n      }\n      d._final = function (callback) {\n        head.end()\n        onfinish = callback\n      }\n      head.on('drain', function () {\n        if (ondrain) {\n          const cb = ondrain\n          ondrain = null\n          cb()\n        }\n      })\n    } else if (isWebStream(head)) {\n      const writable = isTransformStream(head) ? head.writable : head\n      const writer = writable.getWriter()\n      d._write = async function (chunk, encoding, callback) {\n        try {\n          await writer.ready\n          writer.write(chunk).catch(() => {})\n          callback()\n        } catch (err) {\n          callback(err)\n        }\n      }\n      d._final = async function (callback) {\n        try {\n          await writer.ready\n          writer.close().catch(() => {})\n          onfinish = callback\n        } catch (err) {\n          callback(err)\n        }\n      }\n    }\n    const toRead = isTransformStream(tail) ? tail.readable : tail\n    eos(toRead, () => {\n      if (onfinish) {\n        const cb = onfinish\n        onfinish = null\n        cb()\n      }\n    })\n  }\n  if (readable) {\n    if (isNodeStream(tail)) {\n      tail.on('readable', function () {\n        if (onreadable) {\n          const cb = onreadable\n          onreadable = null\n          cb()\n        }\n      })\n      tail.on('end', function () {\n        d.push(null)\n      })\n      d._read = function () {\n        while (true) {\n          const buf = tail.read()\n          if (buf === null) {\n            onreadable = d._read\n            return\n          }\n          if (!d.push(buf)) {\n            return\n          }\n        }\n      }\n    } else if (isWebStream(tail)) {\n      const readable = isTransformStream(tail) ? tail.readable : tail\n      const reader = readable.getReader()\n      d._read = async function () {\n        while (true) {\n          try {\n            const { value, done } = await reader.read()\n            if (!d.push(value)) {\n              return\n            }\n            if (done) {\n              d.push(null)\n              return\n            }\n          } catch {\n            return\n          }\n        }\n      }\n    }\n  }\n  d._destroy = function (err, callback) {\n    if (!err && onclose !== null) {\n      err = new AbortError()\n    }\n    onreadable = null\n    ondrain = null\n    onfinish = null\n    if (onclose === null) {\n      callback(err)\n    } else {\n      onclose = callback\n      if (isNodeStream(tail)) {\n        destroyer(tail, err)\n      }\n    }\n  }\n  return d\n}\n","'use strict'\n\nconst AbortController = globalThis.AbortController || require('abort-controller').AbortController\nconst {\n  codes: { ERR_INVALID_ARG_VALUE, ERR_INVALID_ARG_TYPE, ERR_MISSING_ARGS, ERR_OUT_OF_RANGE },\n  AbortError\n} = require('../../ours/errors')\nconst { validateAbortSignal, validateInteger, validateObject } = require('../validators')\nconst kWeakHandler = require('../../ours/primordials').Symbol('kWeak')\nconst kResistStopPropagation = require('../../ours/primordials').Symbol('kResistStopPropagation')\nconst { finished } = require('./end-of-stream')\nconst staticCompose = require('./compose')\nconst { addAbortSignalNoValidate } = require('./add-abort-signal')\nconst { isWritable, isNodeStream } = require('./utils')\nconst { deprecate } = require('../../ours/util')\nconst {\n  ArrayPrototypePush,\n  Boolean,\n  MathFloor,\n  Number,\n  NumberIsNaN,\n  Promise,\n  PromiseReject,\n  PromiseResolve,\n  PromisePrototypeThen,\n  Symbol\n} = require('../../ours/primordials')\nconst kEmpty = Symbol('kEmpty')\nconst kEof = Symbol('kEof')\nfunction compose(stream, options) {\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  if (isNodeStream(stream) && !isWritable(stream)) {\n    throw new ERR_INVALID_ARG_VALUE('stream', stream, 'must be writable')\n  }\n  const composedStream = staticCompose(this, stream)\n  if (options !== null && options !== undefined && options.signal) {\n    // Not validating as we already validated before\n    addAbortSignalNoValidate(options.signal, composedStream)\n  }\n  return composedStream\n}\nfunction map(fn, options) {\n  if (typeof fn !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n  }\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  let concurrency = 1\n  if ((options === null || options === undefined ? undefined : options.concurrency) != null) {\n    concurrency = MathFloor(options.concurrency)\n  }\n  let highWaterMark = concurrency - 1\n  if ((options === null || options === undefined ? undefined : options.highWaterMark) != null) {\n    highWaterMark = MathFloor(options.highWaterMark)\n  }\n  validateInteger(concurrency, 'options.concurrency', 1)\n  validateInteger(highWaterMark, 'options.highWaterMark', 0)\n  highWaterMark += concurrency\n  return async function* map() {\n    const signal = require('../../ours/util').AbortSignalAny(\n      [options === null || options === undefined ? undefined : options.signal].filter(Boolean)\n    )\n    const stream = this\n    const queue = []\n    const signalOpt = {\n      signal\n    }\n    let next\n    let resume\n    let done = false\n    let cnt = 0\n    function onCatch() {\n      done = true\n      afterItemProcessed()\n    }\n    function afterItemProcessed() {\n      cnt -= 1\n      maybeResume()\n    }\n    function maybeResume() {\n      if (resume && !done && cnt < concurrency && queue.length < highWaterMark) {\n        resume()\n        resume = null\n      }\n    }\n    async function pump() {\n      try {\n        for await (let val of stream) {\n          if (done) {\n            return\n          }\n          if (signal.aborted) {\n            throw new AbortError()\n          }\n          try {\n            val = fn(val, signalOpt)\n            if (val === kEmpty) {\n              continue\n            }\n            val = PromiseResolve(val)\n          } catch (err) {\n            val = PromiseReject(err)\n          }\n          cnt += 1\n          PromisePrototypeThen(val, afterItemProcessed, onCatch)\n          queue.push(val)\n          if (next) {\n            next()\n            next = null\n          }\n          if (!done && (queue.length >= highWaterMark || cnt >= concurrency)) {\n            await new Promise((resolve) => {\n              resume = resolve\n            })\n          }\n        }\n        queue.push(kEof)\n      } catch (err) {\n        const val = PromiseReject(err)\n        PromisePrototypeThen(val, afterItemProcessed, onCatch)\n        queue.push(val)\n      } finally {\n        done = true\n        if (next) {\n          next()\n          next = null\n        }\n      }\n    }\n    pump()\n    try {\n      while (true) {\n        while (queue.length > 0) {\n          const val = await queue[0]\n          if (val === kEof) {\n            return\n          }\n          if (signal.aborted) {\n            throw new AbortError()\n          }\n          if (val !== kEmpty) {\n            yield val\n          }\n          queue.shift()\n          maybeResume()\n        }\n        await new Promise((resolve) => {\n          next = resolve\n        })\n      }\n    } finally {\n      done = true\n      if (resume) {\n        resume()\n        resume = null\n      }\n    }\n  }.call(this)\n}\nfunction asIndexedPairs(options = undefined) {\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  return async function* asIndexedPairs() {\n    let index = 0\n    for await (const val of this) {\n      var _options$signal\n      if (\n        options !== null &&\n        options !== undefined &&\n        (_options$signal = options.signal) !== null &&\n        _options$signal !== undefined &&\n        _options$signal.aborted\n      ) {\n        throw new AbortError({\n          cause: options.signal.reason\n        })\n      }\n      yield [index++, val]\n    }\n  }.call(this)\n}\nasync function some(fn, options = undefined) {\n  for await (const unused of filter.call(this, fn, options)) {\n    return true\n  }\n  return false\n}\nasync function every(fn, options = undefined) {\n  if (typeof fn !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n  }\n  // https://en.wikipedia.org/wiki/De_Morgan%27s_laws\n  return !(await some.call(\n    this,\n    async (...args) => {\n      return !(await fn(...args))\n    },\n    options\n  ))\n}\nasync function find(fn, options) {\n  for await (const result of filter.call(this, fn, options)) {\n    return result\n  }\n  return undefined\n}\nasync function forEach(fn, options) {\n  if (typeof fn !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n  }\n  async function forEachFn(value, options) {\n    await fn(value, options)\n    return kEmpty\n  }\n  // eslint-disable-next-line no-unused-vars\n  for await (const unused of map.call(this, forEachFn, options));\n}\nfunction filter(fn, options) {\n  if (typeof fn !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE('fn', ['Function', 'AsyncFunction'], fn)\n  }\n  async function filterFn(value, options) {\n    if (await fn(value, options)) {\n      return value\n    }\n    return kEmpty\n  }\n  return map.call(this, filterFn, options)\n}\n\n// Specific to provide better error to reduce since the argument is only\n// missing if the stream has no items in it - but the code is still appropriate\nclass ReduceAwareErrMissingArgs extends ERR_MISSING_ARGS {\n  constructor() {\n    super('reduce')\n    this.message = 'Reduce of an empty stream requires an initial value'\n  }\n}\nasync function reduce(reducer, initialValue, options) {\n  var _options$signal2\n  if (typeof reducer !== 'function') {\n    throw new ERR_INVALID_ARG_TYPE('reducer', ['Function', 'AsyncFunction'], reducer)\n  }\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  let hasInitialValue = arguments.length > 1\n  if (\n    options !== null &&\n    options !== undefined &&\n    (_options$signal2 = options.signal) !== null &&\n    _options$signal2 !== undefined &&\n    _options$signal2.aborted\n  ) {\n    const err = new AbortError(undefined, {\n      cause: options.signal.reason\n    })\n    this.once('error', () => {}) // The error is already propagated\n    await finished(this.destroy(err))\n    throw err\n  }\n  const ac = new AbortController()\n  const signal = ac.signal\n  if (options !== null && options !== undefined && options.signal) {\n    const opts = {\n      once: true,\n      [kWeakHandler]: this,\n      [kResistStopPropagation]: true\n    }\n    options.signal.addEventListener('abort', () => ac.abort(), opts)\n  }\n  let gotAnyItemFromStream = false\n  try {\n    for await (const value of this) {\n      var _options$signal3\n      gotAnyItemFromStream = true\n      if (\n        options !== null &&\n        options !== undefined &&\n        (_options$signal3 = options.signal) !== null &&\n        _options$signal3 !== undefined &&\n        _options$signal3.aborted\n      ) {\n        throw new AbortError()\n      }\n      if (!hasInitialValue) {\n        initialValue = value\n        hasInitialValue = true\n      } else {\n        initialValue = await reducer(initialValue, value, {\n          signal\n        })\n      }\n    }\n    if (!gotAnyItemFromStream && !hasInitialValue) {\n      throw new ReduceAwareErrMissingArgs()\n    }\n  } finally {\n    ac.abort()\n  }\n  return initialValue\n}\nasync function toArray(options) {\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  const result = []\n  for await (const val of this) {\n    var _options$signal4\n    if (\n      options !== null &&\n      options !== undefined &&\n      (_options$signal4 = options.signal) !== null &&\n      _options$signal4 !== undefined &&\n      _options$signal4.aborted\n    ) {\n      throw new AbortError(undefined, {\n        cause: options.signal.reason\n      })\n    }\n    ArrayPrototypePush(result, val)\n  }\n  return result\n}\nfunction flatMap(fn, options) {\n  const values = map.call(this, fn, options)\n  return async function* flatMap() {\n    for await (const val of values) {\n      yield* val\n    }\n  }.call(this)\n}\nfunction toIntegerOrInfinity(number) {\n  // We coerce here to align with the spec\n  // https://github.com/tc39/proposal-iterator-helpers/issues/169\n  number = Number(number)\n  if (NumberIsNaN(number)) {\n    return 0\n  }\n  if (number < 0) {\n    throw new ERR_OUT_OF_RANGE('number', '>= 0', number)\n  }\n  return number\n}\nfunction drop(number, options = undefined) {\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  number = toIntegerOrInfinity(number)\n  return async function* drop() {\n    var _options$signal5\n    if (\n      options !== null &&\n      options !== undefined &&\n      (_options$signal5 = options.signal) !== null &&\n      _options$signal5 !== undefined &&\n      _options$signal5.aborted\n    ) {\n      throw new AbortError()\n    }\n    for await (const val of this) {\n      var _options$signal6\n      if (\n        options !== null &&\n        options !== undefined &&\n        (_options$signal6 = options.signal) !== null &&\n        _options$signal6 !== undefined &&\n        _options$signal6.aborted\n      ) {\n        throw new AbortError()\n      }\n      if (number-- <= 0) {\n        yield val\n      }\n    }\n  }.call(this)\n}\nfunction take(number, options = undefined) {\n  if (options != null) {\n    validateObject(options, 'options')\n  }\n  if ((options === null || options === undefined ? undefined : options.signal) != null) {\n    validateAbortSignal(options.signal, 'options.signal')\n  }\n  number = toIntegerOrInfinity(number)\n  return async function* take() {\n    var _options$signal7\n    if (\n      options !== null &&\n      options !== undefined &&\n      (_options$signal7 = options.signal) !== null &&\n      _options$signal7 !== undefined &&\n      _options$signal7.aborted\n    ) {\n      throw new AbortError()\n    }\n    for await (const val of this) {\n      var _options$signal8\n      if (\n        options !== null &&\n        options !== undefined &&\n        (_options$signal8 = options.signal) !== null &&\n        _options$signal8 !== undefined &&\n        _options$signal8.aborted\n      ) {\n        throw new AbortError()\n      }\n      if (number-- > 0) {\n        yield val\n      }\n\n      // Don't get another item from iterator in case we reached the end\n      if (number <= 0) {\n        return\n      }\n    }\n  }.call(this)\n}\nmodule.exports.streamReturningOperators = {\n  asIndexedPairs: deprecate(asIndexedPairs, 'readable.asIndexedPairs will be removed in a future version.'),\n  drop,\n  filter,\n  flatMap,\n  map,\n  take,\n  compose\n}\nmodule.exports.promiseReturningOperators = {\n  every,\n  forEach,\n  reduce,\n  toArray,\n  some,\n  find\n}\n","'use strict'\n\nconst { ArrayPrototypePop, Promise } = require('../ours/primordials')\nconst { isIterable, isNodeStream, isWebStream } = require('../internal/streams/utils')\nconst { pipelineImpl: pl } = require('../internal/streams/pipeline')\nconst { finished } = require('../internal/streams/end-of-stream')\nrequire('../../lib/stream.js')\nfunction pipeline(...streams) {\n  return new Promise((resolve, reject) => {\n    let signal\n    let end\n    const lastArg = streams[streams.length - 1]\n    if (\n      lastArg &&\n      typeof lastArg === 'object' &&\n      !isNodeStream(lastArg) &&\n      !isIterable(lastArg) &&\n      !isWebStream(lastArg)\n    ) {\n      const options = ArrayPrototypePop(streams)\n      signal = options.signal\n      end = options.end\n    }\n    pl(\n      streams,\n      (err, value) => {\n        if (err) {\n          reject(err)\n        } else {\n          resolve(value)\n        }\n      },\n      {\n        signal,\n        end\n      }\n    )\n  })\n}\nmodule.exports = {\n  finished,\n  pipeline\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict'\n\n/* replacement start */\n\nconst { Buffer } = require('buffer')\n\n/* replacement end */\n\nconst { ObjectDefineProperty, ObjectKeys, ReflectApply } = require('./ours/primordials')\nconst {\n  promisify: { custom: customPromisify }\n} = require('./ours/util')\nconst { streamReturningOperators, promiseReturningOperators } = require('./internal/streams/operators')\nconst {\n  codes: { ERR_ILLEGAL_CONSTRUCTOR }\n} = require('./ours/errors')\nconst compose = require('./internal/streams/compose')\nconst { setDefaultHighWaterMark, getDefaultHighWaterMark } = require('./internal/streams/state')\nconst { pipeline } = require('./internal/streams/pipeline')\nconst { destroyer } = require('./internal/streams/destroy')\nconst eos = require('./internal/streams/end-of-stream')\nconst internalBuffer = {}\nconst promises = require('./stream/promises')\nconst utils = require('./internal/streams/utils')\nconst Stream = (module.exports = require('./internal/streams/legacy').Stream)\nStream.isDestroyed = utils.isDestroyed\nStream.isDisturbed = utils.isDisturbed\nStream.isErrored = utils.isErrored\nStream.isReadable = utils.isReadable\nStream.isWritable = utils.isWritable\nStream.Readable = require('./internal/streams/readable')\nfor (const key of ObjectKeys(streamReturningOperators)) {\n  const op = streamReturningOperators[key]\n  function fn(...args) {\n    if (new.target) {\n      throw ERR_ILLEGAL_CONSTRUCTOR()\n    }\n    return Stream.Readable.from(ReflectApply(op, this, args))\n  }\n  ObjectDefineProperty(fn, 'name', {\n    __proto__: null,\n    value: op.name\n  })\n  ObjectDefineProperty(fn, 'length', {\n    __proto__: null,\n    value: op.length\n  })\n  ObjectDefineProperty(Stream.Readable.prototype, key, {\n    __proto__: null,\n    value: fn,\n    enumerable: false,\n    configurable: true,\n    writable: true\n  })\n}\nfor (const key of ObjectKeys(promiseReturningOperators)) {\n  const op = promiseReturningOperators[key]\n  function fn(...args) {\n    if (new.target) {\n      throw ERR_ILLEGAL_CONSTRUCTOR()\n    }\n    return ReflectApply(op, this, args)\n  }\n  ObjectDefineProperty(fn, 'name', {\n    __proto__: null,\n    value: op.name\n  })\n  ObjectDefineProperty(fn, 'length', {\n    __proto__: null,\n    value: op.length\n  })\n  ObjectDefineProperty(Stream.Readable.prototype, key, {\n    __proto__: null,\n    value: fn,\n    enumerable: false,\n    configurable: true,\n    writable: true\n  })\n}\nStream.Writable = require('./internal/streams/writable')\nStream.Duplex = require('./internal/streams/duplex')\nStream.Transform = require('./internal/streams/transform')\nStream.PassThrough = require('./internal/streams/passthrough')\nStream.pipeline = pipeline\nconst { addAbortSignal } = require('./internal/streams/add-abort-signal')\nStream.addAbortSignal = addAbortSignal\nStream.finished = eos\nStream.destroy = destroyer\nStream.compose = compose\nStream.setDefaultHighWaterMark = setDefaultHighWaterMark\nStream.getDefaultHighWaterMark = getDefaultHighWaterMark\nObjectDefineProperty(Stream, 'promises', {\n  __proto__: null,\n  configurable: true,\n  enumerable: true,\n  get() {\n    return promises\n  }\n})\nObjectDefineProperty(pipeline, customPromisify, {\n  __proto__: null,\n  enumerable: true,\n  get() {\n    return promises.pipeline\n  }\n})\nObjectDefineProperty(eos, customPromisify, {\n  __proto__: null,\n  enumerable: true,\n  get() {\n    return promises.finished\n  }\n})\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream\nStream._isUint8Array = function isUint8Array(value) {\n  return value instanceof Uint8Array\n}\nStream._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) {\n  return Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength)\n}\n","'use strict'\n\nconst Stream = require('stream')\nif (Stream && process.env.READABLE_STREAM === 'disable') {\n  const promises = Stream.promises\n\n  // Explicit export naming is needed for ESM\n  module.exports._uint8ArrayToBuffer = Stream._uint8ArrayToBuffer\n  module.exports._isUint8Array = Stream._isUint8Array\n  module.exports.isDisturbed = Stream.isDisturbed\n  module.exports.isErrored = Stream.isErrored\n  module.exports.isReadable = Stream.isReadable\n  module.exports.Readable = Stream.Readable\n  module.exports.Writable = Stream.Writable\n  module.exports.Duplex = Stream.Duplex\n  module.exports.Transform = Stream.Transform\n  module.exports.PassThrough = Stream.PassThrough\n  module.exports.addAbortSignal = Stream.addAbortSignal\n  module.exports.finished = Stream.finished\n  module.exports.destroy = Stream.destroy\n  module.exports.pipeline = Stream.pipeline\n  module.exports.compose = Stream.compose\n  Object.defineProperty(Stream, 'promises', {\n    configurable: true,\n    enumerable: true,\n    get() {\n      return promises\n    }\n  })\n  module.exports.Stream = Stream.Stream\n} else {\n  const CustomStream = require('../stream')\n  const promises = require('../stream/promises')\n  const originalDestroy = CustomStream.Readable.destroy\n  module.exports = CustomStream.Readable\n\n  // Explicit export naming is needed for ESM\n  module.exports._uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer\n  module.exports._isUint8Array = CustomStream._isUint8Array\n  module.exports.isDisturbed = CustomStream.isDisturbed\n  module.exports.isErrored = CustomStream.isErrored\n  module.exports.isReadable = CustomStream.isReadable\n  module.exports.Readable = CustomStream.Readable\n  module.exports.Writable = CustomStream.Writable\n  module.exports.Duplex = CustomStream.Duplex\n  module.exports.Transform = CustomStream.Transform\n  module.exports.PassThrough = CustomStream.PassThrough\n  module.exports.addAbortSignal = CustomStream.addAbortSignal\n  module.exports.finished = CustomStream.finished\n  module.exports.destroy = CustomStream.destroy\n  module.exports.destroy = originalDestroy\n  module.exports.pipeline = CustomStream.pipeline\n  module.exports.compose = CustomStream.compose\n  Object.defineProperty(CustomStream, 'promises', {\n    configurable: true,\n    enumerable: true,\n    get() {\n      return promises\n    }\n  })\n  module.exports.Stream = CustomStream.Stream\n}\n\n// Allow default importing\nmodule.exports.default = module.exports\n","/**\n * node-crc32-stream\n *\n * Copyright (c) 2014 Chris Talkington, contributors.\n * Licensed under the MIT license.\n * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT\n */\n\n 'use strict';\n\nconst {Transform} = require('readable-stream');\n\nconst crc32 = require('crc-32');\n\nclass CRC32Stream extends Transform {\n  constructor(options) {\n    super(options);\n    this.checksum = Buffer.allocUnsafe(4);\n    this.checksum.writeInt32BE(0, 0);\n\n    this.rawSize = 0;\n  }\n\n  _transform(chunk, encoding, callback) {\n    if (chunk) {\n      this.checksum = crc32.buf(chunk, this.checksum) >>> 0;\n      this.rawSize += chunk.length;\n    }\n\n    callback(null, chunk);\n  }\n\n  digest(encoding) {\n    const checksum = Buffer.allocUnsafe(4);\n    checksum.writeUInt32BE(this.checksum >>> 0, 0);\n    return encoding ? checksum.toString(encoding) : checksum;\n  }\n\n  hex() {\n    return this.digest('hex').toUpperCase();\n  }\n\n  size() {\n    return this.rawSize;\n  }\n}\n\nmodule.exports = CRC32Stream;\n","/**\n * node-crc32-stream\n *\n * Copyright (c) 2014 Chris Talkington, contributors.\n * Licensed under the MIT license.\n * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT\n */\n\n'use strict';\n\nconst {DeflateRaw} = require('zlib');\n\nconst crc32 = require('crc-32');\n\nclass DeflateCRC32Stream extends DeflateRaw {\n  constructor(options) {\n    super(options);\n\n    this.checksum = Buffer.allocUnsafe(4);\n    this.checksum.writeInt32BE(0, 0);\n\n    this.rawSize = 0;\n    this.compressedSize = 0;\n  }\n\n  push(chunk, encoding) {\n    if (chunk) {\n      this.compressedSize += chunk.length;\n    }\n\n    return super.push(chunk, encoding);\n  }\n\n  _transform(chunk, encoding, callback) {\n    if (chunk) {\n      this.checksum = crc32.buf(chunk, this.checksum) >>> 0;\n      this.rawSize += chunk.length;\n    }\n\n    super._transform(chunk, encoding, callback)\n  }\n\n  digest(encoding) {\n    const checksum = Buffer.allocUnsafe(4);\n    checksum.writeUInt32BE(this.checksum >>> 0, 0);\n    return encoding ? checksum.toString(encoding) : checksum;\n  }\n\n  hex() {\n    return this.digest('hex').toUpperCase();\n  }\n\n  size(compressed = false) {\n    if (compressed) {\n      return this.compressedSize;\n    } else {\n      return this.rawSize;\n    }\n  }\n}\n\nmodule.exports = DeflateCRC32Stream;\n","/**\n * node-crc32-stream\n *\n * Copyright (c) 2014 Chris Talkington, contributors.\n * Licensed under the MIT license.\n * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT\n */\n\n'use strict';\n\nmodule.exports = {\n  CRC32Stream: require('./crc32-stream'),\n  DeflateCRC32Stream: require('./deflate-crc32-stream')\n}\n","/**\n * node-compress-commons\n *\n * Copyright (c) 2014 Chris Talkington, contributors.\n * Licensed under the MIT license.\n * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT\n */\nvar inherits = require('util').inherits;\nvar crc32 = require('crc-32');\nvar {CRC32Stream} = require('crc32-stream');\nvar {DeflateCRC32Stream} = require('crc32-stream');\n\nvar ArchiveOutputStream = require('../archive-output-stream');\nvar ZipArchiveEntry = require('./zip-archive-entry');\nvar GeneralPurposeBit = require('./general-purpose-bit');\n\nvar constants = require('./constants');\nvar util = require('../../util');\nvar zipUtil = require('./util');\n\nvar ZipArchiveOutputStream = module.exports = function(options) {\n  if (!(this instanceof ZipArchiveOutputStream)) {\n    return new ZipArchiveOutputStream(options);\n  }\n\n  options = this.options = this._defaults(options);\n\n  ArchiveOutputStream.call(this, options);\n\n  this._entry = null;\n  this._entries = [];\n  this._archive = {\n    centralLength: 0,\n    centralOffset: 0,\n    comment: '',\n    finish: false,\n    finished: false,\n    processing: false,\n    forceZip64: options.forceZip64,\n    forceLocalTime: options.forceLocalTime\n  };\n};\n\ninherits(ZipArchiveOutputStream, ArchiveOutputStream);\n\nZipArchiveOutputStream.prototype._afterAppend = function(ae) {\n  this._entries.push(ae);\n\n  if (ae.getGeneralPurposeBit().usesDataDescriptor()) {\n    this._writeDataDescriptor(ae);\n  }\n\n  this._archive.processing = false;\n  this._entry = null;\n\n  if (this._archive.finish && !this._archive.finished) {\n    this._finish();\n  }\n};\n\nZipArchiveOutputStream.prototype._appendBuffer = function(ae, source, callback) {\n  if (source.length === 0) {\n    ae.setMethod(constants.METHOD_STORED);\n  }\n\n  var method = ae.getMethod();\n\n  if (method === constants.METHOD_STORED) {\n    ae.setSize(source.length);\n    ae.setCompressedSize(source.length);\n    ae.setCrc(crc32.buf(source) >>> 0);\n  }\n\n  this._writeLocalFileHeader(ae);\n\n  if (method === constants.METHOD_STORED) {\n    this.write(source);\n    this._afterAppend(ae);\n    callback(null, ae);\n    return;\n  } else if (method === constants.METHOD_DEFLATED) {\n    this._smartStream(ae, callback).end(source);\n    return;\n  } else {\n    callback(new Error('compression method ' + method + ' not implemented'));\n    return;\n  }\n};\n\nZipArchiveOutputStream.prototype._appendStream = function(ae, source, callback) {\n  ae.getGeneralPurposeBit().useDataDescriptor(true);\n  ae.setVersionNeededToExtract(constants.MIN_VERSION_DATA_DESCRIPTOR);\n\n  this._writeLocalFileHeader(ae);\n\n  var smart = this._smartStream(ae, callback);\n  source.once('error', function(err) {\n    smart.emit('error', err);\n    smart.end();\n  })\n  source.pipe(smart);\n};\n\nZipArchiveOutputStream.prototype._defaults = function(o) {\n  if (typeof o !== 'object') {\n    o = {};\n  }\n\n  if (typeof o.zlib !== 'object') {\n    o.zlib = {};\n  }\n\n  if (typeof o.zlib.level !== 'number') {\n    o.zlib.level = constants.ZLIB_BEST_SPEED;\n  }\n\n  o.forceZip64 = !!o.forceZip64;\n  o.forceLocalTime = !!o.forceLocalTime;\n\n  return o;\n};\n\nZipArchiveOutputStream.prototype._finish = function() {\n  this._archive.centralOffset = this.offset;\n\n  this._entries.forEach(function(ae) {\n    this._writeCentralFileHeader(ae);\n  }.bind(this));\n\n  this._archive.centralLength = this.offset - this._archive.centralOffset;\n\n  if (this.isZip64()) {\n    this._writeCentralDirectoryZip64();\n  }\n\n  this._writeCentralDirectoryEnd();\n\n  this._archive.processing = false;\n  this._archive.finish = true;\n  this._archive.finished = true;\n  this.end();\n};\n\nZipArchiveOutputStream.prototype._normalizeEntry = function(ae) {\n  if (ae.getMethod() === -1) {\n    ae.setMethod(constants.METHOD_DEFLATED);\n  }\n\n  if (ae.getMethod() === constants.METHOD_DEFLATED) {\n    ae.getGeneralPurposeBit().useDataDescriptor(true);\n    ae.setVersionNeededToExtract(constants.MIN_VERSION_DATA_DESCRIPTOR);\n  }\n\n  if (ae.getTime() === -1) {\n    ae.setTime(new Date(), this._archive.forceLocalTime);\n  }\n\n  ae._offsets = {\n    file: 0,\n    data: 0,\n    contents: 0,\n  };\n};\n\nZipArchiveOutputStream.prototype._smartStream = function(ae, callback) {\n  var deflate = ae.getMethod() === constants.METHOD_DEFLATED;\n  var process = deflate ? new DeflateCRC32Stream(this.options.zlib) : new CRC32Stream();\n  var error = null;\n\n  function handleStuff() {\n    var digest = process.digest().readUInt32BE(0);\n    ae.setCrc(digest);\n    ae.setSize(process.size());\n    ae.setCompressedSize(process.size(true));\n    this._afterAppend(ae);\n    callback(error, ae);\n  }\n\n  process.once('end', handleStuff.bind(this));\n  process.once('error', function(err) {\n    error = err;\n  });\n\n  process.pipe(this, { end: false });\n\n  return process;\n};\n\nZipArchiveOutputStream.prototype._writeCentralDirectoryEnd = function() {\n  var records = this._entries.length;\n  var size = this._archive.centralLength;\n  var offset = this._archive.centralOffset;\n\n  if (this.isZip64()) {\n    records = constants.ZIP64_MAGIC_SHORT;\n    size = constants.ZIP64_MAGIC;\n    offset = constants.ZIP64_MAGIC;\n  }\n\n  // signature\n  this.write(zipUtil.getLongBytes(constants.SIG_EOCD));\n\n  // disk numbers\n  this.write(constants.SHORT_ZERO);\n  this.write(constants.SHORT_ZERO);\n\n  // number of entries\n  this.write(zipUtil.getShortBytes(records));\n  this.write(zipUtil.getShortBytes(records));\n\n  // length and location of CD\n  this.write(zipUtil.getLongBytes(size));\n  this.write(zipUtil.getLongBytes(offset));\n\n  // archive comment\n  var comment = this.getComment();\n  var commentLength = Buffer.byteLength(comment);\n  this.write(zipUtil.getShortBytes(commentLength));\n  this.write(comment);\n};\n\nZipArchiveOutputStream.prototype._writeCentralDirectoryZip64 = function() {\n  // signature\n  this.write(zipUtil.getLongBytes(constants.SIG_ZIP64_EOCD));\n\n  // size of the ZIP64 EOCD record\n  this.write(zipUtil.getEightBytes(44));\n\n  // version made by\n  this.write(zipUtil.getShortBytes(constants.MIN_VERSION_ZIP64));\n\n  // version to extract\n  this.write(zipUtil.getShortBytes(constants.MIN_VERSION_ZIP64));\n\n  // disk numbers\n  this.write(constants.LONG_ZERO);\n  this.write(constants.LONG_ZERO);\n\n  // number of entries\n  this.write(zipUtil.getEightBytes(this._entries.length));\n  this.write(zipUtil.getEightBytes(this._entries.length));\n\n  // length and location of CD\n  this.write(zipUtil.getEightBytes(this._archive.centralLength));\n  this.write(zipUtil.getEightBytes(this._archive.centralOffset));\n\n  // extensible data sector\n  // not implemented at this time\n\n  // end of central directory locator\n  this.write(zipUtil.getLongBytes(constants.SIG_ZIP64_EOCD_LOC));\n\n  // disk number holding the ZIP64 EOCD record\n  this.write(constants.LONG_ZERO);\n\n  // relative offset of the ZIP64 EOCD record\n  this.write(zipUtil.getEightBytes(this._archive.centralOffset + this._archive.centralLength));\n\n  // total number of disks\n  this.write(zipUtil.getLongBytes(1));\n};\n\nZipArchiveOutputStream.prototype._writeCentralFileHeader = function(ae) {\n  var gpb = ae.getGeneralPurposeBit();\n  var method = ae.getMethod();\n  var fileOffset = ae._offsets.file;\n\n  var size = ae.getSize();\n  var compressedSize = ae.getCompressedSize();\n\n  if (ae.isZip64() || fileOffset > constants.ZIP64_MAGIC) {\n    size = constants.ZIP64_MAGIC;\n    compressedSize = constants.ZIP64_MAGIC;\n    fileOffset = constants.ZIP64_MAGIC;\n\n    ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64);\n\n    var extraBuf = Buffer.concat([\n      zipUtil.getShortBytes(constants.ZIP64_EXTRA_ID),\n      zipUtil.getShortBytes(24),\n      zipUtil.getEightBytes(ae.getSize()),\n      zipUtil.getEightBytes(ae.getCompressedSize()),\n      zipUtil.getEightBytes(ae._offsets.file)\n    ], 28);\n\n    ae.setExtra(extraBuf);\n  }\n\n  // signature\n  this.write(zipUtil.getLongBytes(constants.SIG_CFH));\n\n  // version made by\n  this.write(zipUtil.getShortBytes((ae.getPlatform() << 8) | constants.VERSION_MADEBY));\n\n  // version to extract and general bit flag\n  this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract()));\n  this.write(gpb.encode());\n\n  // compression method\n  this.write(zipUtil.getShortBytes(method));\n\n  // datetime\n  this.write(zipUtil.getLongBytes(ae.getTimeDos()));\n\n  // crc32 checksum\n  this.write(zipUtil.getLongBytes(ae.getCrc()));\n\n  // sizes\n  this.write(zipUtil.getLongBytes(compressedSize));\n  this.write(zipUtil.getLongBytes(size));\n\n  var name = ae.getName();\n  var comment = ae.getComment();\n  var extra = ae.getCentralDirectoryExtra();\n\n  if (gpb.usesUTF8ForNames()) {\n    name = Buffer.from(name);\n    comment = Buffer.from(comment);\n  }\n\n  // name length\n  this.write(zipUtil.getShortBytes(name.length));\n\n  // extra length\n  this.write(zipUtil.getShortBytes(extra.length));\n\n  // comments length\n  this.write(zipUtil.getShortBytes(comment.length));\n\n  // disk number start\n  this.write(constants.SHORT_ZERO);\n\n  // internal attributes\n  this.write(zipUtil.getShortBytes(ae.getInternalAttributes()));\n\n  // external attributes\n  this.write(zipUtil.getLongBytes(ae.getExternalAttributes()));\n\n  // relative offset of LFH\n  this.write(zipUtil.getLongBytes(fileOffset));\n\n  // name\n  this.write(name);\n\n  // extra\n  this.write(extra);\n\n  // comment\n  this.write(comment);\n};\n\nZipArchiveOutputStream.prototype._writeDataDescriptor = function(ae) {\n  // signature\n  this.write(zipUtil.getLongBytes(constants.SIG_DD));\n\n  // crc32 checksum\n  this.write(zipUtil.getLongBytes(ae.getCrc()));\n\n  // sizes\n  if (ae.isZip64()) {\n    this.write(zipUtil.getEightBytes(ae.getCompressedSize()));\n    this.write(zipUtil.getEightBytes(ae.getSize()));\n  } else {\n    this.write(zipUtil.getLongBytes(ae.getCompressedSize()));\n    this.write(zipUtil.getLongBytes(ae.getSize()));\n  }\n};\n\nZipArchiveOutputStream.prototype._writeLocalFileHeader = function(ae) {\n  var gpb = ae.getGeneralPurposeBit();\n  var method = ae.getMethod();\n  var name = ae.getName();\n  var extra = ae.getLocalFileDataExtra();\n\n  if (ae.isZip64()) {\n    gpb.useDataDescriptor(true);\n    ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64);\n  }\n\n  if (gpb.usesUTF8ForNames()) {\n    name = Buffer.from(name);\n  }\n\n  ae._offsets.file = this.offset;\n\n  // signature\n  this.write(zipUtil.getLongBytes(constants.SIG_LFH));\n\n  // version to extract and general bit flag\n  this.write(zipUtil.getShortBytes(ae.getVersionNeededToExtract()));\n  this.write(gpb.encode());\n\n  // compression method\n  this.write(zipUtil.getShortBytes(method));\n\n  // datetime\n  this.write(zipUtil.getLongBytes(ae.getTimeDos()));\n\n  ae._offsets.data = this.offset;\n\n  // crc32 checksum and sizes\n  if (gpb.usesDataDescriptor()) {\n    this.write(constants.LONG_ZERO);\n    this.write(constants.LONG_ZERO);\n    this.write(constants.LONG_ZERO);\n  } else {\n    this.write(zipUtil.getLongBytes(ae.getCrc()));\n    this.write(zipUtil.getLongBytes(ae.getCompressedSize()));\n    this.write(zipUtil.getLongBytes(ae.getSize()));\n  }\n\n  // name length\n  this.write(zipUtil.getShortBytes(name.length));\n\n  // extra length\n  this.write(zipUtil.getShortBytes(extra.length));\n\n  // name\n  this.write(name);\n\n  // extra\n  this.write(extra);\n\n  ae._offsets.contents = this.offset;\n};\n\nZipArchiveOutputStream.prototype.getComment = function(comment) {\n  return this._archive.comment !== null ? this._archive.comment : '';\n};\n\nZipArchiveOutputStream.prototype.isZip64 = function() {\n  return this._archive.forceZip64 || this._entries.length > constants.ZIP64_MAGIC_SHORT || this._archive.centralLength > constants.ZIP64_MAGIC || this._archive.centralOffset > constants.ZIP64_MAGIC;\n};\n\nZipArchiveOutputStream.prototype.setComment = function(comment) {\n  this._archive.comment = comment;\n};\n","/**\n * node-compress-commons\n *\n * Copyright (c) 2014 Chris Talkington, contributors.\n * Licensed under the MIT license.\n * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT\n */\nmodule.exports = {\n  ArchiveEntry: require('./archivers/archive-entry'),\n  ZipArchiveEntry: require('./archivers/zip/zip-archive-entry'),\n  ArchiveOutputStream: require('./archivers/archive-output-stream'),\n  ZipArchiveOutputStream: require('./archivers/zip/zip-archive-output-stream')\n};","/**\n * ZipStream\n *\n * @ignore\n * @license [MIT]{@link https://github.com/archiverjs/node-zip-stream/blob/master/LICENSE}\n * @copyright (c) 2014 Chris Talkington, contributors.\n */\nvar inherits = require('util').inherits;\n\nvar ZipArchiveOutputStream = require('compress-commons').ZipArchiveOutputStream;\nvar ZipArchiveEntry = require('compress-commons').ZipArchiveEntry;\n\nvar util = require('archiver-utils');\n\n/**\n * @constructor\n * @extends external:ZipArchiveOutputStream\n * @param {Object} [options]\n * @param {String} [options.comment] Sets the zip archive comment.\n * @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC.\n * @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers.\n * @param {Boolean} [options.store=false] Sets the compression method to STORE.\n * @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}\n * to control compression.\n */\nvar ZipStream = module.exports = function(options) {\n  if (!(this instanceof ZipStream)) {\n    return new ZipStream(options);\n  }\n\n  options = this.options = options || {};\n  options.zlib = options.zlib || {};\n\n  ZipArchiveOutputStream.call(this, options);\n\n  if (typeof options.level === 'number' && options.level >= 0) {\n    options.zlib.level = options.level;\n    delete options.level;\n  }\n\n  if (!options.forceZip64 && typeof options.zlib.level === 'number' && options.zlib.level === 0) {\n    options.store = true;\n  }\n\n  options.namePrependSlash = options.namePrependSlash || false;\n\n  if (options.comment && options.comment.length > 0) {\n    this.setComment(options.comment);\n  }\n};\n\ninherits(ZipStream, ZipArchiveOutputStream);\n\n/**\n * Normalizes entry data with fallbacks for key properties.\n *\n * @private\n * @param  {Object} data\n * @return {Object}\n */\nZipStream.prototype._normalizeFileData = function(data) {\n  data = util.defaults(data, {\n    type: 'file',\n    name: null,\n    namePrependSlash: this.options.namePrependSlash,\n    linkname: null,\n    date: null,\n    mode: null,\n    store: this.options.store,\n    comment: ''\n  });\n\n  var isDir = data.type === 'directory';\n  var isSymlink = data.type === 'symlink';\n\n  if (data.name) {\n    data.name = util.sanitizePath(data.name);\n\n    if (!isSymlink && data.name.slice(-1) === '/') {\n      isDir = true;\n      data.type = 'directory';\n    } else if (isDir) {\n      data.name += '/';\n    }\n  }\n\n  if (isDir || isSymlink) {\n    data.store = true;\n  }\n\n  data.date = util.dateify(data.date);\n\n  return data;\n};\n\n/**\n * Appends an entry given an input source (text string, buffer, or stream).\n *\n * @param  {(Buffer|Stream|String)} source The input source.\n * @param  {Object} data\n * @param  {String} data.name Sets the entry name including internal path.\n * @param  {String} [data.comment] Sets the entry comment.\n * @param  {(String|Date)} [data.date=NOW()] Sets the entry date.\n * @param  {Number} [data.mode=D:0755/F:0644] Sets the entry permissions.\n * @param  {Boolean} [data.store=options.store] Sets the compression method to STORE.\n * @param  {String} [data.type=file] Sets the entry type. Defaults to `directory`\n * if name ends with trailing slash.\n * @param  {Function} callback\n * @return this\n */\nZipStream.prototype.entry = function(source, data, callback) {\n  if (typeof callback !== 'function') {\n    callback = this._emitErrorCallback.bind(this);\n  }\n\n  data = this._normalizeFileData(data);\n\n  if (data.type !== 'file' && data.type !== 'directory' && data.type !== 'symlink') {\n    callback(new Error(data.type + ' entries not currently supported'));\n    return;\n  }\n\n  if (typeof data.name !== 'string' || data.name.length === 0) {\n    callback(new Error('entry name must be a non-empty string value'));\n    return;\n  }\n\n  if (data.type === 'symlink' && typeof data.linkname !== 'string') {\n    callback(new Error('entry linkname must be a non-empty string value when type equals symlink'));\n    return;\n  }\n\n  var entry = new ZipArchiveEntry(data.name);\n  entry.setTime(data.date, this.options.forceLocalTime);\n\n  if (data.namePrependSlash) {\n    entry.setName(data.name, true);\n  }\n\n  if (data.store) {\n    entry.setMethod(0);\n  }\n\n  if (data.comment.length > 0) {\n    entry.setComment(data.comment);\n  }\n\n  if (data.type === 'symlink' && typeof data.mode !== 'number') {\n    data.mode = 40960; // 0120000\n  }\n\n  if (typeof data.mode === 'number') {\n    if (data.type === 'symlink') {\n      data.mode |= 40960;\n    }\n\n    entry.setUnixMode(data.mode);\n  }\n\n  if (data.type === 'symlink' && typeof data.linkname === 'string') {\n    source = Buffer.from(data.linkname);\n  }\n\n  return ZipArchiveOutputStream.prototype.entry.call(this, entry, source, callback);\n};\n\n/**\n * Finalizes the instance and prevents further appending to the archive\n * structure (queue will continue til drained).\n *\n * @return void\n */\nZipStream.prototype.finalize = function() {\n  this.finish();\n};\n\n/**\n * Returns the current number of bytes written to this stream.\n * @function ZipStream#getBytesWritten\n * @returns {Number}\n */\n\n/**\n * Compress Commons ZipArchiveOutputStream\n * @external ZipArchiveOutputStream\n * @see {@link https://github.com/archiverjs/node-compress-commons}\n */\n","/**\n * ZIP Format Plugin\n *\n * @module plugins/zip\n * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}\n * @copyright (c) 2012-2014 Chris Talkington, contributors.\n */\nvar engine = require('zip-stream');\nvar util = require('archiver-utils');\n\n/**\n * @constructor\n * @param {ZipOptions} [options]\n * @param {String} [options.comment] Sets the zip archive comment.\n * @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC.\n * @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers.\n * @param {Boolean} [options.namePrependSlash=false] Prepends a forward slash to archive file paths.\n * @param {Boolean} [options.store=false] Sets the compression method to STORE.\n * @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}\n */\nvar Zip = function(options) {\n  if (!(this instanceof Zip)) {\n    return new Zip(options);\n  }\n\n  options = this.options = util.defaults(options, {\n    comment: '',\n    forceUTC: false,\n    namePrependSlash: false,\n    store: false\n  });\n\n  this.supports = {\n    directory: true,\n    symlink: true\n  };\n\n  this.engine = new engine(options);\n};\n\n/**\n * @param  {(Buffer|Stream)} source\n * @param  {ZipEntryData} data\n * @param  {String} data.name Sets the entry name including internal path.\n * @param  {(String|Date)} [data.date=NOW()] Sets the entry date.\n * @param  {Number} [data.mode=D:0755/F:0644] Sets the entry permissions.\n * @param  {String} [data.prefix] Sets a path prefix for the entry name. Useful\n * when working with methods like `directory` or `glob`.\n * @param  {fs.Stats} [data.stats] Sets the fs stat data for this entry allowing\n * for reduction of fs stat calls when stat data is already known.\n * @param  {Boolean} [data.store=ZipOptions.store] Sets the compression method to STORE.\n * @param  {Function} callback\n * @return void\n */\nZip.prototype.append = function(source, data, callback) {\n  this.engine.entry(source, data, callback);\n};\n\n/**\n * @return void\n */\nZip.prototype.finalize = function() {\n  this.engine.finalize();\n};\n\n/**\n * @return this.engine\n */\nZip.prototype.on = function() {\n  return this.engine.on.apply(this.engine, arguments);\n};\n\n/**\n * @return this.engine\n */\nZip.prototype.pipe = function() {\n  return this.engine.pipe.apply(this.engine, arguments);\n};\n\n/**\n * @return this.engine\n */\nZip.prototype.unpipe = function() {\n  return this.engine.unpipe.apply(this.engine, arguments);\n};\n\nmodule.exports = Zip;\n\n/**\n * @typedef {Object} ZipOptions\n * @global\n * @property {String} [comment] Sets the zip archive comment.\n * @property {Boolean} [forceLocalTime=false] Forces the archive to contain local file times instead of UTC.\n * @property {Boolean} [forceZip64=false] Forces the archive to contain ZIP64 headers.\n * @prpperty {Boolean} [namePrependSlash=false] Prepends a forward slash to archive file paths.\n * @property {Boolean} [store=false] Sets the compression method to STORE.\n * @property {Object} [zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}\n * to control compression.\n * @property {*} [*] See [zip-stream]{@link https://archiverjs.com/zip-stream/ZipStream.html} documentation for current list of properties.\n */\n\n/**\n * @typedef {Object} ZipEntryData\n * @global\n * @property {String} name Sets the entry name including internal path.\n * @property {(String|Date)} [date=NOW()] Sets the entry date.\n * @property {Number} [mode=D:0755/F:0644] Sets the entry permissions.\n * @property {Boolean} [namePrependSlash=ZipOptions.namePrependSlash] Prepends a forward slash to archive file paths.\n * @property {String} [prefix] Sets a path prefix for the entry name. Useful\n * when working with methods like `directory` or `glob`.\n * @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing\n * for reduction of fs stat calls when stat data is already known.\n * @property {Boolean} [store=ZipOptions.store] Sets the compression method to STORE.\n */\n\n/**\n * ZipStream Module\n * @external ZipStream\n * @see {@link https://www.archiverjs.com/zip-stream/ZipStream.html}\n */\n","module.exports = class FixedFIFO {\n  constructor (hwm) {\n    if (!(hwm > 0) || ((hwm - 1) & hwm) !== 0) throw new Error('Max size for a FixedFIFO should be a power of two')\n    this.buffer = new Array(hwm)\n    this.mask = hwm - 1\n    this.top = 0\n    this.btm = 0\n    this.next = null\n  }\n\n  clear () {\n    this.top = this.btm = 0\n    this.next = null\n    this.buffer.fill(undefined)\n  }\n\n  push (data) {\n    if (this.buffer[this.top] !== undefined) return false\n    this.buffer[this.top] = data\n    this.top = (this.top + 1) & this.mask\n    return true\n  }\n\n  shift () {\n    const last = this.buffer[this.btm]\n    if (last === undefined) return undefined\n    this.buffer[this.btm] = undefined\n    this.btm = (this.btm + 1) & this.mask\n    return last\n  }\n\n  peek () {\n    return this.buffer[this.btm]\n  }\n\n  isEmpty () {\n    return this.buffer[this.btm] === undefined\n  }\n}\n","const FixedFIFO = require('./fixed-size')\n\nmodule.exports = class FastFIFO {\n  constructor (hwm) {\n    this.hwm = hwm || 16\n    this.head = new FixedFIFO(this.hwm)\n    this.tail = this.head\n    this.length = 0\n  }\n\n  clear () {\n    this.head = this.tail\n    this.head.clear()\n    this.length = 0\n  }\n\n  push (val) {\n    this.length++\n    if (!this.head.push(val)) {\n      const prev = this.head\n      this.head = prev.next = new FixedFIFO(2 * this.head.buffer.length)\n      this.head.push(val)\n    }\n  }\n\n  shift () {\n    if (this.length !== 0) this.length--\n    const val = this.tail.shift()\n    if (val === undefined && this.tail.next) {\n      const next = this.tail.next\n      this.tail.next = null\n      this.tail = next\n      return this.tail.shift()\n    }\n\n    return val\n  }\n\n  peek () {\n    const val = this.tail.peek()\n    if (val === undefined && this.tail.next) return this.tail.next.peek()\n    return val\n  }\n\n  isEmpty () {\n    return this.length === 0\n  }\n}\n","function isBuffer (value) {\n  return Buffer.isBuffer(value) || value instanceof Uint8Array\n}\n\nfunction isEncoding (encoding) {\n  return Buffer.isEncoding(encoding)\n}\n\nfunction alloc (size, fill, encoding) {\n  return Buffer.alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n  return Buffer.allocUnsafe(size)\n}\n\nfunction allocUnsafeSlow (size) {\n  return Buffer.allocUnsafeSlow(size)\n}\n\nfunction byteLength (string, encoding) {\n  return Buffer.byteLength(string, encoding)\n}\n\nfunction compare (a, b) {\n  return Buffer.compare(a, b)\n}\n\nfunction concat (buffers, totalLength) {\n  return Buffer.concat(buffers, totalLength)\n}\n\nfunction copy (source, target, targetStart, start, end) {\n  return toBuffer(source).copy(target, targetStart, start, end)\n}\n\nfunction equals (a, b) {\n  return toBuffer(a).equals(b)\n}\n\nfunction fill (buffer, value, offset, end, encoding) {\n  return toBuffer(buffer).fill(value, offset, end, encoding)\n}\n\nfunction from (value, encodingOrOffset, length) {\n  return Buffer.from(value, encodingOrOffset, length)\n}\n\nfunction includes (buffer, value, byteOffset, encoding) {\n  return toBuffer(buffer).includes(value, byteOffset, encoding)\n}\n\nfunction indexOf (buffer, value, byfeOffset, encoding) {\n  return toBuffer(buffer).indexOf(value, byfeOffset, encoding)\n}\n\nfunction lastIndexOf (buffer, value, byteOffset, encoding) {\n  return toBuffer(buffer).lastIndexOf(value, byteOffset, encoding)\n}\n\nfunction swap16 (buffer) {\n  return toBuffer(buffer).swap16()\n}\n\nfunction swap32 (buffer) {\n  return toBuffer(buffer).swap32()\n}\n\nfunction swap64 (buffer) {\n  return toBuffer(buffer).swap64()\n}\n\nfunction toBuffer (buffer) {\n  if (Buffer.isBuffer(buffer)) return buffer\n  return Buffer.from(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\nfunction toString (buffer, encoding, start, end) {\n  return toBuffer(buffer).toString(encoding, start, end)\n}\n\nfunction write (buffer, string, offset, length, encoding) {\n  return toBuffer(buffer).write(string, offset, length, encoding)\n}\n\nfunction writeDoubleLE (buffer, value, offset) {\n  return toBuffer(buffer).writeDoubleLE(value, offset)\n}\n\nfunction writeFloatLE (buffer, value, offset) {\n  return toBuffer(buffer).writeFloatLE(value, offset)\n}\n\nfunction writeUInt32LE (buffer, value, offset) {\n  return toBuffer(buffer).writeUInt32LE(value, offset)\n}\n\nfunction writeInt32LE (buffer, value, offset) {\n  return toBuffer(buffer).writeInt32LE(value, offset)\n}\n\nfunction readDoubleLE (buffer, offset) {\n  return toBuffer(buffer).readDoubleLE(offset)\n}\n\nfunction readFloatLE (buffer, offset) {\n  return toBuffer(buffer).readFloatLE(offset)\n}\n\nfunction readUInt32LE (buffer, offset) {\n  return toBuffer(buffer).readUInt32LE(offset)\n}\n\nfunction readInt32LE (buffer, offset) {\n  return toBuffer(buffer).readInt32LE(offset)\n}\n\nfunction writeDoubleBE (buffer, value, offset) {\n  return toBuffer(buffer).writeDoubleBE(value, offset)\n}\n\nfunction writeFloatBE (buffer, value, offset) {\n  return toBuffer(buffer).writeFloatBE(value, offset)\n}\n\nfunction writeUInt32BE (buffer, value, offset) {\n  return toBuffer(buffer).writeUInt32BE(value, offset)\n}\n\nfunction writeInt32BE (buffer, value, offset) {\n  return toBuffer(buffer).writeInt32BE(value, offset)\n}\n\nfunction readDoubleBE (buffer, offset) {\n  return toBuffer(buffer).readDoubleBE(offset)\n}\n\nfunction readFloatBE (buffer, offset) {\n  return toBuffer(buffer).readFloatBE(offset)\n}\n\nfunction readUInt32BE (buffer, offset) {\n  return toBuffer(buffer).readUInt32BE(offset)\n}\n\nfunction readInt32BE (buffer, offset) {\n  return toBuffer(buffer).readInt32BE(offset)\n}\n\nmodule.exports = {\n  isBuffer,\n  isEncoding,\n  alloc,\n  allocUnsafe,\n  allocUnsafeSlow,\n  byteLength,\n  compare,\n  concat,\n  copy,\n  equals,\n  fill,\n  from,\n  includes,\n  indexOf,\n  lastIndexOf,\n  swap16,\n  swap32,\n  swap64,\n  toBuffer,\n  toString,\n  write,\n  writeDoubleLE,\n  writeFloatLE,\n  writeUInt32LE,\n  writeInt32LE,\n  readDoubleLE,\n  readFloatLE,\n  readUInt32LE,\n  readInt32LE,\n  writeDoubleBE,\n  writeFloatBE,\n  writeUInt32BE,\n  writeInt32BE,\n  readDoubleBE,\n  readFloatBE,\n  readUInt32BE,\n  readInt32BE\n\n}\n","const b4a = require('b4a')\n\nmodule.exports = class PassThroughDecoder {\n  constructor (encoding) {\n    this.encoding = encoding\n  }\n\n  get remaining () {\n    return 0\n  }\n\n  decode (tail) {\n    return b4a.toString(tail, this.encoding)\n  }\n\n  flush () {\n    return ''\n  }\n}\n","const b4a = require('b4a')\n\n/**\n * https://encoding.spec.whatwg.org/#utf-8-decoder\n */\nmodule.exports = class UTF8Decoder {\n  constructor () {\n    this.codePoint = 0\n    this.bytesSeen = 0\n    this.bytesNeeded = 0\n    this.lowerBoundary = 0x80\n    this.upperBoundary = 0xbf\n  }\n\n  get remaining () {\n    return this.bytesSeen\n  }\n\n  decode (data) {\n    // If we have a fast path, just sniff if the last part is a boundary\n    if (this.bytesNeeded === 0) {\n      let isBoundary = true\n\n      for (let i = Math.max(0, data.byteLength - 4), n = data.byteLength; i < n && isBoundary; i++) {\n        isBoundary = data[i] <= 0x7f\n      }\n\n      if (isBoundary) return b4a.toString(data, 'utf8')\n    }\n\n    let result = ''\n\n    for (let i = 0, n = data.byteLength; i < n; i++) {\n      const byte = data[i]\n\n      if (this.bytesNeeded === 0) {\n        if (byte <= 0x7f) {\n          result += String.fromCharCode(byte)\n        } else {\n          this.bytesSeen = 1\n\n          if (byte >= 0xc2 && byte <= 0xdf) {\n            this.bytesNeeded = 2\n            this.codePoint = byte & 0x1f\n          } else if (byte >= 0xe0 && byte <= 0xef) {\n            if (byte === 0xe0) this.lowerBoundary = 0xa0\n            else if (byte === 0xed) this.upperBoundary = 0x9f\n            this.bytesNeeded = 3\n            this.codePoint = byte & 0xf\n          } else if (byte >= 0xf0 && byte <= 0xf4) {\n            if (byte === 0xf0) this.lowerBoundary = 0x90\n            if (byte === 0xf4) this.upperBoundary = 0x8f\n            this.bytesNeeded = 4\n            this.codePoint = byte & 0x7\n          } else {\n            result += '\\ufffd'\n          }\n        }\n\n        continue\n      }\n\n      if (byte < this.lowerBoundary || byte > this.upperBoundary) {\n        this.codePoint = 0\n        this.bytesNeeded = 0\n        this.bytesSeen = 0\n        this.lowerBoundary = 0x80\n        this.upperBoundary = 0xbf\n\n        result += '\\ufffd'\n\n        continue\n      }\n\n      this.lowerBoundary = 0x80\n      this.upperBoundary = 0xbf\n\n      this.codePoint = (this.codePoint << 6) | (byte & 0x3f)\n      this.bytesSeen++\n\n      if (this.bytesSeen !== this.bytesNeeded) continue\n\n      result += String.fromCodePoint(this.codePoint)\n\n      this.codePoint = 0\n      this.bytesNeeded = 0\n      this.bytesSeen = 0\n    }\n\n    return result\n  }\n\n  flush () {\n    const result = this.bytesNeeded > 0 ? '\\ufffd' : ''\n\n    this.codePoint = 0\n    this.bytesNeeded = 0\n    this.bytesSeen = 0\n    this.lowerBoundary = 0x80\n    this.upperBoundary = 0xbf\n\n    return result\n  }\n}\n","const PassThroughDecoder = require('./lib/pass-through-decoder')\nconst UTF8Decoder = require('./lib/utf8-decoder')\n\nmodule.exports = class TextDecoder {\n  constructor (encoding = 'utf8') {\n    this.encoding = normalizeEncoding(encoding)\n\n    switch (this.encoding) {\n      case 'utf8':\n        this.decoder = new UTF8Decoder()\n        break\n      case 'utf16le':\n      case 'base64':\n        throw new Error('Unsupported encoding: ' + this.encoding)\n      default:\n        this.decoder = new PassThroughDecoder(this.encoding)\n    }\n  }\n\n  get remaining () {\n    return this.decoder.remaining\n  }\n\n  push (data) {\n    if (typeof data === 'string') return data\n    return this.decoder.decode(data)\n  }\n\n  // For Node.js compatibility\n  write (data) {\n    return this.push(data)\n  }\n\n  end (data) {\n    let result = ''\n    if (data) result = this.push(data)\n    result += this.decoder.flush()\n    return result\n  }\n}\n\nfunction normalizeEncoding (encoding) {\n  encoding = encoding.toLowerCase()\n\n  switch (encoding) {\n    case 'utf8':\n    case 'utf-8':\n      return 'utf8'\n    case 'ucs2':\n    case 'ucs-2':\n    case 'utf16le':\n    case 'utf-16le':\n      return 'utf16le'\n    case 'latin1':\n    case 'binary':\n      return 'latin1'\n    case 'base64':\n    case 'ascii':\n    case 'hex':\n      return encoding\n    default:\n      throw new Error('Unknown encoding: ' + encoding)\n  }\n};\n","const { EventEmitter } = require('events')\nconst STREAM_DESTROYED = new Error('Stream was destroyed')\nconst PREMATURE_CLOSE = new Error('Premature close')\n\nconst FIFO = require('fast-fifo')\nconst TextDecoder = require('text-decoder')\n\n/* eslint-disable no-multi-spaces */\n\n// 29 bits used total (4 from shared, 14 from read, and 11 from write)\nconst MAX = ((1 << 29) - 1)\n\n// Shared state\nconst OPENING       = 0b0001\nconst PREDESTROYING = 0b0010\nconst DESTROYING    = 0b0100\nconst DESTROYED     = 0b1000\n\nconst NOT_OPENING = MAX ^ OPENING\nconst NOT_PREDESTROYING = MAX ^ PREDESTROYING\n\n// Read state (4 bit offset from shared state)\nconst READ_ACTIVE           = 0b00000000000001 << 4\nconst READ_UPDATING         = 0b00000000000010 << 4\nconst READ_PRIMARY          = 0b00000000000100 << 4\nconst READ_QUEUED           = 0b00000000001000 << 4\nconst READ_RESUMED          = 0b00000000010000 << 4\nconst READ_PIPE_DRAINED     = 0b00000000100000 << 4\nconst READ_ENDING           = 0b00000001000000 << 4\nconst READ_EMIT_DATA        = 0b00000010000000 << 4\nconst READ_EMIT_READABLE    = 0b00000100000000 << 4\nconst READ_EMITTED_READABLE = 0b00001000000000 << 4\nconst READ_DONE             = 0b00010000000000 << 4\nconst READ_NEXT_TICK        = 0b00100000000000 << 4\nconst READ_NEEDS_PUSH       = 0b01000000000000 << 4\nconst READ_READ_AHEAD       = 0b10000000000000 << 4\n\n// Combined read state\nconst READ_FLOWING = READ_RESUMED | READ_PIPE_DRAINED\nconst READ_ACTIVE_AND_NEEDS_PUSH = READ_ACTIVE | READ_NEEDS_PUSH\nconst READ_PRIMARY_AND_ACTIVE = READ_PRIMARY | READ_ACTIVE\nconst READ_EMIT_READABLE_AND_QUEUED = READ_EMIT_READABLE | READ_QUEUED\nconst READ_RESUMED_READ_AHEAD = READ_RESUMED | READ_READ_AHEAD\n\nconst READ_NOT_ACTIVE             = MAX ^ READ_ACTIVE\nconst READ_NON_PRIMARY            = MAX ^ READ_PRIMARY\nconst READ_NON_PRIMARY_AND_PUSHED = MAX ^ (READ_PRIMARY | READ_NEEDS_PUSH)\nconst READ_PUSHED                 = MAX ^ READ_NEEDS_PUSH\nconst READ_PAUSED                 = MAX ^ READ_RESUMED\nconst READ_NOT_QUEUED             = MAX ^ (READ_QUEUED | READ_EMITTED_READABLE)\nconst READ_NOT_ENDING             = MAX ^ READ_ENDING\nconst READ_PIPE_NOT_DRAINED       = MAX ^ READ_FLOWING\nconst READ_NOT_NEXT_TICK          = MAX ^ READ_NEXT_TICK\nconst READ_NOT_UPDATING           = MAX ^ READ_UPDATING\nconst READ_NO_READ_AHEAD          = MAX ^ READ_READ_AHEAD\nconst READ_PAUSED_NO_READ_AHEAD   = MAX ^ READ_RESUMED_READ_AHEAD\n\n// Write state (18 bit offset, 4 bit offset from shared state and 14 from read state)\nconst WRITE_ACTIVE     = 0b00000000001 << 18\nconst WRITE_UPDATING   = 0b00000000010 << 18\nconst WRITE_PRIMARY    = 0b00000000100 << 18\nconst WRITE_QUEUED     = 0b00000001000 << 18\nconst WRITE_UNDRAINED  = 0b00000010000 << 18\nconst WRITE_DONE       = 0b00000100000 << 18\nconst WRITE_EMIT_DRAIN = 0b00001000000 << 18\nconst WRITE_NEXT_TICK  = 0b00010000000 << 18\nconst WRITE_WRITING    = 0b00100000000 << 18\nconst WRITE_FINISHING  = 0b01000000000 << 18\nconst WRITE_CORKED     = 0b10000000000 << 18\n\nconst WRITE_NOT_ACTIVE    = MAX ^ (WRITE_ACTIVE | WRITE_WRITING)\nconst WRITE_NON_PRIMARY   = MAX ^ WRITE_PRIMARY\nconst WRITE_NOT_FINISHING = MAX ^ (WRITE_ACTIVE | WRITE_FINISHING)\nconst WRITE_DRAINED       = MAX ^ WRITE_UNDRAINED\nconst WRITE_NOT_QUEUED    = MAX ^ WRITE_QUEUED\nconst WRITE_NOT_NEXT_TICK = MAX ^ WRITE_NEXT_TICK\nconst WRITE_NOT_UPDATING  = MAX ^ WRITE_UPDATING\nconst WRITE_NOT_CORKED    = MAX ^ WRITE_CORKED\n\n// Combined shared state\nconst ACTIVE = READ_ACTIVE | WRITE_ACTIVE\nconst NOT_ACTIVE = MAX ^ ACTIVE\nconst DONE = READ_DONE | WRITE_DONE\nconst DESTROY_STATUS = DESTROYING | DESTROYED | PREDESTROYING\nconst OPEN_STATUS = DESTROY_STATUS | OPENING\nconst AUTO_DESTROY = DESTROY_STATUS | DONE\nconst NON_PRIMARY = WRITE_NON_PRIMARY & READ_NON_PRIMARY\nconst ACTIVE_OR_TICKING = WRITE_NEXT_TICK | READ_NEXT_TICK\nconst TICKING = ACTIVE_OR_TICKING & NOT_ACTIVE\nconst IS_OPENING = OPEN_STATUS | TICKING\n\n// Combined shared state and read state\nconst READ_PRIMARY_STATUS = OPEN_STATUS | READ_ENDING | READ_DONE\nconst READ_STATUS = OPEN_STATUS | READ_DONE | READ_QUEUED\nconst READ_ENDING_STATUS = OPEN_STATUS | READ_ENDING | READ_QUEUED\nconst READ_READABLE_STATUS = OPEN_STATUS | READ_EMIT_READABLE | READ_QUEUED | READ_EMITTED_READABLE\nconst SHOULD_NOT_READ = OPEN_STATUS | READ_ACTIVE | READ_ENDING | READ_DONE | READ_NEEDS_PUSH | READ_READ_AHEAD\nconst READ_BACKPRESSURE_STATUS = DESTROY_STATUS | READ_ENDING | READ_DONE\nconst READ_UPDATE_SYNC_STATUS = READ_UPDATING | OPEN_STATUS | READ_NEXT_TICK | READ_PRIMARY\nconst READ_NEXT_TICK_OR_OPENING = READ_NEXT_TICK | OPENING\n\n// Combined write state\nconst WRITE_PRIMARY_STATUS = OPEN_STATUS | WRITE_FINISHING | WRITE_DONE\nconst WRITE_QUEUED_AND_UNDRAINED = WRITE_QUEUED | WRITE_UNDRAINED\nconst WRITE_QUEUED_AND_ACTIVE = WRITE_QUEUED | WRITE_ACTIVE\nconst WRITE_DRAIN_STATUS = WRITE_QUEUED | WRITE_UNDRAINED | OPEN_STATUS | WRITE_ACTIVE\nconst WRITE_STATUS = OPEN_STATUS | WRITE_ACTIVE | WRITE_QUEUED | WRITE_CORKED\nconst WRITE_PRIMARY_AND_ACTIVE = WRITE_PRIMARY | WRITE_ACTIVE\nconst WRITE_ACTIVE_AND_WRITING = WRITE_ACTIVE | WRITE_WRITING\nconst WRITE_FINISHING_STATUS = OPEN_STATUS | WRITE_FINISHING | WRITE_QUEUED_AND_ACTIVE | WRITE_DONE\nconst WRITE_BACKPRESSURE_STATUS = WRITE_UNDRAINED | DESTROY_STATUS | WRITE_FINISHING | WRITE_DONE\nconst WRITE_UPDATE_SYNC_STATUS = WRITE_UPDATING | OPEN_STATUS | WRITE_NEXT_TICK | WRITE_PRIMARY\nconst WRITE_DROP_DATA = WRITE_FINISHING | WRITE_DONE | DESTROY_STATUS\n\nconst asyncIterator = Symbol.asyncIterator || Symbol('asyncIterator')\n\nclass WritableState {\n  constructor (stream, { highWaterMark = 16384, map = null, mapWritable, byteLength, byteLengthWritable } = {}) {\n    this.stream = stream\n    this.queue = new FIFO()\n    this.highWaterMark = highWaterMark\n    this.buffered = 0\n    this.error = null\n    this.pipeline = null\n    this.drains = null // if we add more seldomly used helpers we might them into a subobject so its a single ptr\n    this.byteLength = byteLengthWritable || byteLength || defaultByteLength\n    this.map = mapWritable || map\n    this.afterWrite = afterWrite.bind(this)\n    this.afterUpdateNextTick = updateWriteNT.bind(this)\n  }\n\n  get ended () {\n    return (this.stream._duplexState & WRITE_DONE) !== 0\n  }\n\n  push (data) {\n    if ((this.stream._duplexState & WRITE_DROP_DATA) !== 0) return false\n    if (this.map !== null) data = this.map(data)\n\n    this.buffered += this.byteLength(data)\n    this.queue.push(data)\n\n    if (this.buffered < this.highWaterMark) {\n      this.stream._duplexState |= WRITE_QUEUED\n      return true\n    }\n\n    this.stream._duplexState |= WRITE_QUEUED_AND_UNDRAINED\n    return false\n  }\n\n  shift () {\n    const data = this.queue.shift()\n\n    this.buffered -= this.byteLength(data)\n    if (this.buffered === 0) this.stream._duplexState &= WRITE_NOT_QUEUED\n\n    return data\n  }\n\n  end (data) {\n    if (typeof data === 'function') this.stream.once('finish', data)\n    else if (data !== undefined && data !== null) this.push(data)\n    this.stream._duplexState = (this.stream._duplexState | WRITE_FINISHING) & WRITE_NON_PRIMARY\n  }\n\n  autoBatch (data, cb) {\n    const buffer = []\n    const stream = this.stream\n\n    buffer.push(data)\n    while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED_AND_ACTIVE) {\n      buffer.push(stream._writableState.shift())\n    }\n\n    if ((stream._duplexState & OPEN_STATUS) !== 0) return cb(null)\n    stream._writev(buffer, cb)\n  }\n\n  update () {\n    const stream = this.stream\n\n    stream._duplexState |= WRITE_UPDATING\n\n    do {\n      while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED) {\n        const data = this.shift()\n        stream._duplexState |= WRITE_ACTIVE_AND_WRITING\n        stream._write(data, this.afterWrite)\n      }\n\n      if ((stream._duplexState & WRITE_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary()\n    } while (this.continueUpdate() === true)\n\n    stream._duplexState &= WRITE_NOT_UPDATING\n  }\n\n  updateNonPrimary () {\n    const stream = this.stream\n\n    if ((stream._duplexState & WRITE_FINISHING_STATUS) === WRITE_FINISHING) {\n      stream._duplexState = stream._duplexState | WRITE_ACTIVE\n      stream._final(afterFinal.bind(this))\n      return\n    }\n\n    if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) {\n      if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) {\n        stream._duplexState |= ACTIVE\n        stream._destroy(afterDestroy.bind(this))\n      }\n      return\n    }\n\n    if ((stream._duplexState & IS_OPENING) === OPENING) {\n      stream._duplexState = (stream._duplexState | ACTIVE) & NOT_OPENING\n      stream._open(afterOpen.bind(this))\n    }\n  }\n\n  continueUpdate () {\n    if ((this.stream._duplexState & WRITE_NEXT_TICK) === 0) return false\n    this.stream._duplexState &= WRITE_NOT_NEXT_TICK\n    return true\n  }\n\n  updateCallback () {\n    if ((this.stream._duplexState & WRITE_UPDATE_SYNC_STATUS) === WRITE_PRIMARY) this.update()\n    else this.updateNextTick()\n  }\n\n  updateNextTick () {\n    if ((this.stream._duplexState & WRITE_NEXT_TICK) !== 0) return\n    this.stream._duplexState |= WRITE_NEXT_TICK\n    if ((this.stream._duplexState & WRITE_UPDATING) === 0) queueMicrotask(this.afterUpdateNextTick)\n  }\n}\n\nclass ReadableState {\n  constructor (stream, { highWaterMark = 16384, map = null, mapReadable, byteLength, byteLengthReadable } = {}) {\n    this.stream = stream\n    this.queue = new FIFO()\n    this.highWaterMark = highWaterMark === 0 ? 1 : highWaterMark\n    this.buffered = 0\n    this.readAhead = highWaterMark > 0\n    this.error = null\n    this.pipeline = null\n    this.byteLength = byteLengthReadable || byteLength || defaultByteLength\n    this.map = mapReadable || map\n    this.pipeTo = null\n    this.afterRead = afterRead.bind(this)\n    this.afterUpdateNextTick = updateReadNT.bind(this)\n  }\n\n  get ended () {\n    return (this.stream._duplexState & READ_DONE) !== 0\n  }\n\n  pipe (pipeTo, cb) {\n    if (this.pipeTo !== null) throw new Error('Can only pipe to one destination')\n    if (typeof cb !== 'function') cb = null\n\n    this.stream._duplexState |= READ_PIPE_DRAINED\n    this.pipeTo = pipeTo\n    this.pipeline = new Pipeline(this.stream, pipeTo, cb)\n\n    if (cb) this.stream.on('error', noop) // We already error handle this so supress crashes\n\n    if (isStreamx(pipeTo)) {\n      pipeTo._writableState.pipeline = this.pipeline\n      if (cb) pipeTo.on('error', noop) // We already error handle this so supress crashes\n      pipeTo.on('finish', this.pipeline.finished.bind(this.pipeline)) // TODO: just call finished from pipeTo itself\n    } else {\n      const onerror = this.pipeline.done.bind(this.pipeline, pipeTo)\n      const onclose = this.pipeline.done.bind(this.pipeline, pipeTo, null) // onclose has a weird bool arg\n      pipeTo.on('error', onerror)\n      pipeTo.on('close', onclose)\n      pipeTo.on('finish', this.pipeline.finished.bind(this.pipeline))\n    }\n\n    pipeTo.on('drain', afterDrain.bind(this))\n    this.stream.emit('piping', pipeTo)\n    pipeTo.emit('pipe', this.stream)\n  }\n\n  push (data) {\n    const stream = this.stream\n\n    if (data === null) {\n      this.highWaterMark = 0\n      stream._duplexState = (stream._duplexState | READ_ENDING) & READ_NON_PRIMARY_AND_PUSHED\n      return false\n    }\n\n    if (this.map !== null) {\n      data = this.map(data)\n      if (data === null) {\n        stream._duplexState &= READ_PUSHED\n        return this.buffered < this.highWaterMark\n      }\n    }\n\n    this.buffered += this.byteLength(data)\n    this.queue.push(data)\n\n    stream._duplexState = (stream._duplexState | READ_QUEUED) & READ_PUSHED\n\n    return this.buffered < this.highWaterMark\n  }\n\n  shift () {\n    const data = this.queue.shift()\n\n    this.buffered -= this.byteLength(data)\n    if (this.buffered === 0) this.stream._duplexState &= READ_NOT_QUEUED\n    return data\n  }\n\n  unshift (data) {\n    const pending = [this.map !== null ? this.map(data) : data]\n    while (this.buffered > 0) pending.push(this.shift())\n\n    for (let i = 0; i < pending.length - 1; i++) {\n      const data = pending[i]\n      this.buffered += this.byteLength(data)\n      this.queue.push(data)\n    }\n\n    this.push(pending[pending.length - 1])\n  }\n\n  read () {\n    const stream = this.stream\n\n    if ((stream._duplexState & READ_STATUS) === READ_QUEUED) {\n      const data = this.shift()\n      if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream._duplexState &= READ_PIPE_NOT_DRAINED\n      if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit('data', data)\n      return data\n    }\n\n    if (this.readAhead === false) {\n      stream._duplexState |= READ_READ_AHEAD\n      this.updateNextTick()\n    }\n\n    return null\n  }\n\n  drain () {\n    const stream = this.stream\n\n    while ((stream._duplexState & READ_STATUS) === READ_QUEUED && (stream._duplexState & READ_FLOWING) !== 0) {\n      const data = this.shift()\n      if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream._duplexState &= READ_PIPE_NOT_DRAINED\n      if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit('data', data)\n    }\n  }\n\n  update () {\n    const stream = this.stream\n\n    stream._duplexState |= READ_UPDATING\n\n    do {\n      this.drain()\n\n      while (this.buffered < this.highWaterMark && (stream._duplexState & SHOULD_NOT_READ) === READ_READ_AHEAD) {\n        stream._duplexState |= READ_ACTIVE_AND_NEEDS_PUSH\n        stream._read(this.afterRead)\n        this.drain()\n      }\n\n      if ((stream._duplexState & READ_READABLE_STATUS) === READ_EMIT_READABLE_AND_QUEUED) {\n        stream._duplexState |= READ_EMITTED_READABLE\n        stream.emit('readable')\n      }\n\n      if ((stream._duplexState & READ_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary()\n    } while (this.continueUpdate() === true)\n\n    stream._duplexState &= READ_NOT_UPDATING\n  }\n\n  updateNonPrimary () {\n    const stream = this.stream\n\n    if ((stream._duplexState & READ_ENDING_STATUS) === READ_ENDING) {\n      stream._duplexState = (stream._duplexState | READ_DONE) & READ_NOT_ENDING\n      stream.emit('end')\n      if ((stream._duplexState & AUTO_DESTROY) === DONE) stream._duplexState |= DESTROYING\n      if (this.pipeTo !== null) this.pipeTo.end()\n    }\n\n    if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) {\n      if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) {\n        stream._duplexState |= ACTIVE\n        stream._destroy(afterDestroy.bind(this))\n      }\n      return\n    }\n\n    if ((stream._duplexState & IS_OPENING) === OPENING) {\n      stream._duplexState = (stream._duplexState | ACTIVE) & NOT_OPENING\n      stream._open(afterOpen.bind(this))\n    }\n  }\n\n  continueUpdate () {\n    if ((this.stream._duplexState & READ_NEXT_TICK) === 0) return false\n    this.stream._duplexState &= READ_NOT_NEXT_TICK\n    return true\n  }\n\n  updateCallback () {\n    if ((this.stream._duplexState & READ_UPDATE_SYNC_STATUS) === READ_PRIMARY) this.update()\n    else this.updateNextTick()\n  }\n\n  updateNextTickIfOpen () {\n    if ((this.stream._duplexState & READ_NEXT_TICK_OR_OPENING) !== 0) return\n    this.stream._duplexState |= READ_NEXT_TICK\n    if ((this.stream._duplexState & READ_UPDATING) === 0) queueMicrotask(this.afterUpdateNextTick)\n  }\n\n  updateNextTick () {\n    if ((this.stream._duplexState & READ_NEXT_TICK) !== 0) return\n    this.stream._duplexState |= READ_NEXT_TICK\n    if ((this.stream._duplexState & READ_UPDATING) === 0) queueMicrotask(this.afterUpdateNextTick)\n  }\n}\n\nclass TransformState {\n  constructor (stream) {\n    this.data = null\n    this.afterTransform = afterTransform.bind(stream)\n    this.afterFinal = null\n  }\n}\n\nclass Pipeline {\n  constructor (src, dst, cb) {\n    this.from = src\n    this.to = dst\n    this.afterPipe = cb\n    this.error = null\n    this.pipeToFinished = false\n  }\n\n  finished () {\n    this.pipeToFinished = true\n  }\n\n  done (stream, err) {\n    if (err) this.error = err\n\n    if (stream === this.to) {\n      this.to = null\n\n      if (this.from !== null) {\n        if ((this.from._duplexState & READ_DONE) === 0 || !this.pipeToFinished) {\n          this.from.destroy(this.error || new Error('Writable stream closed prematurely'))\n        }\n        return\n      }\n    }\n\n    if (stream === this.from) {\n      this.from = null\n\n      if (this.to !== null) {\n        if ((stream._duplexState & READ_DONE) === 0) {\n          this.to.destroy(this.error || new Error('Readable stream closed before ending'))\n        }\n        return\n      }\n    }\n\n    if (this.afterPipe !== null) this.afterPipe(this.error)\n    this.to = this.from = this.afterPipe = null\n  }\n}\n\nfunction afterDrain () {\n  this.stream._duplexState |= READ_PIPE_DRAINED\n  this.updateCallback()\n}\n\nfunction afterFinal (err) {\n  const stream = this.stream\n  if (err) stream.destroy(err)\n  if ((stream._duplexState & DESTROY_STATUS) === 0) {\n    stream._duplexState |= WRITE_DONE\n    stream.emit('finish')\n  }\n  if ((stream._duplexState & AUTO_DESTROY) === DONE) {\n    stream._duplexState |= DESTROYING\n  }\n\n  stream._duplexState &= WRITE_NOT_FINISHING\n\n  // no need to wait the extra tick here, so we short circuit that\n  if ((stream._duplexState & WRITE_UPDATING) === 0) this.update()\n  else this.updateNextTick()\n}\n\nfunction afterDestroy (err) {\n  const stream = this.stream\n\n  if (!err && this.error !== STREAM_DESTROYED) err = this.error\n  if (err) stream.emit('error', err)\n  stream._duplexState |= DESTROYED\n  stream.emit('close')\n\n  const rs = stream._readableState\n  const ws = stream._writableState\n\n  if (rs !== null && rs.pipeline !== null) rs.pipeline.done(stream, err)\n\n  if (ws !== null) {\n    while (ws.drains !== null && ws.drains.length > 0) ws.drains.shift().resolve(false)\n    if (ws.pipeline !== null) ws.pipeline.done(stream, err)\n  }\n}\n\nfunction afterWrite (err) {\n  const stream = this.stream\n\n  if (err) stream.destroy(err)\n  stream._duplexState &= WRITE_NOT_ACTIVE\n\n  if (this.drains !== null) tickDrains(this.drains)\n\n  if ((stream._duplexState & WRITE_DRAIN_STATUS) === WRITE_UNDRAINED) {\n    stream._duplexState &= WRITE_DRAINED\n    if ((stream._duplexState & WRITE_EMIT_DRAIN) === WRITE_EMIT_DRAIN) {\n      stream.emit('drain')\n    }\n  }\n\n  this.updateCallback()\n}\n\nfunction afterRead (err) {\n  if (err) this.stream.destroy(err)\n  this.stream._duplexState &= READ_NOT_ACTIVE\n  if (this.readAhead === false && (this.stream._duplexState & READ_RESUMED) === 0) this.stream._duplexState &= READ_NO_READ_AHEAD\n  this.updateCallback()\n}\n\nfunction updateReadNT () {\n  if ((this.stream._duplexState & READ_UPDATING) === 0) {\n    this.stream._duplexState &= READ_NOT_NEXT_TICK\n    this.update()\n  }\n}\n\nfunction updateWriteNT () {\n  if ((this.stream._duplexState & WRITE_UPDATING) === 0) {\n    this.stream._duplexState &= WRITE_NOT_NEXT_TICK\n    this.update()\n  }\n}\n\nfunction tickDrains (drains) {\n  for (let i = 0; i < drains.length; i++) {\n    // drains.writes are monotonic, so if one is 0 its always the first one\n    if (--drains[i].writes === 0) {\n      drains.shift().resolve(true)\n      i--\n    }\n  }\n}\n\nfunction afterOpen (err) {\n  const stream = this.stream\n\n  if (err) stream.destroy(err)\n\n  if ((stream._duplexState & DESTROYING) === 0) {\n    if ((stream._duplexState & READ_PRIMARY_STATUS) === 0) stream._duplexState |= READ_PRIMARY\n    if ((stream._duplexState & WRITE_PRIMARY_STATUS) === 0) stream._duplexState |= WRITE_PRIMARY\n    stream.emit('open')\n  }\n\n  stream._duplexState &= NOT_ACTIVE\n\n  if (stream._writableState !== null) {\n    stream._writableState.updateCallback()\n  }\n\n  if (stream._readableState !== null) {\n    stream._readableState.updateCallback()\n  }\n}\n\nfunction afterTransform (err, data) {\n  if (data !== undefined && data !== null) this.push(data)\n  this._writableState.afterWrite(err)\n}\n\nfunction newListener (name) {\n  if (this._readableState !== null) {\n    if (name === 'data') {\n      this._duplexState |= (READ_EMIT_DATA | READ_RESUMED_READ_AHEAD)\n      this._readableState.updateNextTick()\n    }\n    if (name === 'readable') {\n      this._duplexState |= READ_EMIT_READABLE\n      this._readableState.updateNextTick()\n    }\n  }\n\n  if (this._writableState !== null) {\n    if (name === 'drain') {\n      this._duplexState |= WRITE_EMIT_DRAIN\n      this._writableState.updateNextTick()\n    }\n  }\n}\n\nclass Stream extends EventEmitter {\n  constructor (opts) {\n    super()\n\n    this._duplexState = 0\n    this._readableState = null\n    this._writableState = null\n\n    if (opts) {\n      if (opts.open) this._open = opts.open\n      if (opts.destroy) this._destroy = opts.destroy\n      if (opts.predestroy) this._predestroy = opts.predestroy\n      if (opts.signal) {\n        opts.signal.addEventListener('abort', abort.bind(this))\n      }\n    }\n\n    this.on('newListener', newListener)\n  }\n\n  _open (cb) {\n    cb(null)\n  }\n\n  _destroy (cb) {\n    cb(null)\n  }\n\n  _predestroy () {\n    // does nothing\n  }\n\n  get readable () {\n    return this._readableState !== null ? true : undefined\n  }\n\n  get writable () {\n    return this._writableState !== null ? true : undefined\n  }\n\n  get destroyed () {\n    return (this._duplexState & DESTROYED) !== 0\n  }\n\n  get destroying () {\n    return (this._duplexState & DESTROY_STATUS) !== 0\n  }\n\n  destroy (err) {\n    if ((this._duplexState & DESTROY_STATUS) === 0) {\n      if (!err) err = STREAM_DESTROYED\n      this._duplexState = (this._duplexState | DESTROYING) & NON_PRIMARY\n\n      if (this._readableState !== null) {\n        this._readableState.highWaterMark = 0\n        this._readableState.error = err\n      }\n      if (this._writableState !== null) {\n        this._writableState.highWaterMark = 0\n        this._writableState.error = err\n      }\n\n      this._duplexState |= PREDESTROYING\n      this._predestroy()\n      this._duplexState &= NOT_PREDESTROYING\n\n      if (this._readableState !== null) this._readableState.updateNextTick()\n      if (this._writableState !== null) this._writableState.updateNextTick()\n    }\n  }\n}\n\nclass Readable extends Stream {\n  constructor (opts) {\n    super(opts)\n\n    this._duplexState |= OPENING | WRITE_DONE | READ_READ_AHEAD\n    this._readableState = new ReadableState(this, opts)\n\n    if (opts) {\n      if (this._readableState.readAhead === false) this._duplexState &= READ_NO_READ_AHEAD\n      if (opts.read) this._read = opts.read\n      if (opts.eagerOpen) this._readableState.updateNextTick()\n      if (opts.encoding) this.setEncoding(opts.encoding)\n    }\n  }\n\n  setEncoding (encoding) {\n    const dec = new TextDecoder(encoding)\n    const map = this._readableState.map || echo\n    this._readableState.map = mapOrSkip\n    return this\n\n    function mapOrSkip (data) {\n      const next = dec.push(data)\n      return next === '' && (data.byteLength !== 0 || dec.remaining > 0) ? null : map(next)\n    }\n  }\n\n  _read (cb) {\n    cb(null)\n  }\n\n  pipe (dest, cb) {\n    this._readableState.updateNextTick()\n    this._readableState.pipe(dest, cb)\n    return dest\n  }\n\n  read () {\n    this._readableState.updateNextTick()\n    return this._readableState.read()\n  }\n\n  push (data) {\n    this._readableState.updateNextTickIfOpen()\n    return this._readableState.push(data)\n  }\n\n  unshift (data) {\n    this._readableState.updateNextTickIfOpen()\n    return this._readableState.unshift(data)\n  }\n\n  resume () {\n    this._duplexState |= READ_RESUMED_READ_AHEAD\n    this._readableState.updateNextTick()\n    return this\n  }\n\n  pause () {\n    this._duplexState &= (this._readableState.readAhead === false ? READ_PAUSED_NO_READ_AHEAD : READ_PAUSED)\n    return this\n  }\n\n  static _fromAsyncIterator (ite, opts) {\n    let destroy\n\n    const rs = new Readable({\n      ...opts,\n      read (cb) {\n        ite.next().then(push).then(cb.bind(null, null)).catch(cb)\n      },\n      predestroy () {\n        destroy = ite.return()\n      },\n      destroy (cb) {\n        if (!destroy) return cb(null)\n        destroy.then(cb.bind(null, null)).catch(cb)\n      }\n    })\n\n    return rs\n\n    function push (data) {\n      if (data.done) rs.push(null)\n      else rs.push(data.value)\n    }\n  }\n\n  static from (data, opts) {\n    if (isReadStreamx(data)) return data\n    if (data[asyncIterator]) return this._fromAsyncIterator(data[asyncIterator](), opts)\n    if (!Array.isArray(data)) data = data === undefined ? [] : [data]\n\n    let i = 0\n    return new Readable({\n      ...opts,\n      read (cb) {\n        this.push(i === data.length ? null : data[i++])\n        cb(null)\n      }\n    })\n  }\n\n  static isBackpressured (rs) {\n    return (rs._duplexState & READ_BACKPRESSURE_STATUS) !== 0 || rs._readableState.buffered >= rs._readableState.highWaterMark\n  }\n\n  static isPaused (rs) {\n    return (rs._duplexState & READ_RESUMED) === 0\n  }\n\n  [asyncIterator] () {\n    const stream = this\n\n    let error = null\n    let promiseResolve = null\n    let promiseReject = null\n\n    this.on('error', (err) => { error = err })\n    this.on('readable', onreadable)\n    this.on('close', onclose)\n\n    return {\n      [asyncIterator] () {\n        return this\n      },\n      next () {\n        return new Promise(function (resolve, reject) {\n          promiseResolve = resolve\n          promiseReject = reject\n          const data = stream.read()\n          if (data !== null) ondata(data)\n          else if ((stream._duplexState & DESTROYED) !== 0) ondata(null)\n        })\n      },\n      return () {\n        return destroy(null)\n      },\n      throw (err) {\n        return destroy(err)\n      }\n    }\n\n    function onreadable () {\n      if (promiseResolve !== null) ondata(stream.read())\n    }\n\n    function onclose () {\n      if (promiseResolve !== null) ondata(null)\n    }\n\n    function ondata (data) {\n      if (promiseReject === null) return\n      if (error) promiseReject(error)\n      else if (data === null && (stream._duplexState & READ_DONE) === 0) promiseReject(STREAM_DESTROYED)\n      else promiseResolve({ value: data, done: data === null })\n      promiseReject = promiseResolve = null\n    }\n\n    function destroy (err) {\n      stream.destroy(err)\n      return new Promise((resolve, reject) => {\n        if (stream._duplexState & DESTROYED) return resolve({ value: undefined, done: true })\n        stream.once('close', function () {\n          if (err) reject(err)\n          else resolve({ value: undefined, done: true })\n        })\n      })\n    }\n  }\n}\n\nclass Writable extends Stream {\n  constructor (opts) {\n    super(opts)\n\n    this._duplexState |= OPENING | READ_DONE\n    this._writableState = new WritableState(this, opts)\n\n    if (opts) {\n      if (opts.writev) this._writev = opts.writev\n      if (opts.write) this._write = opts.write\n      if (opts.final) this._final = opts.final\n      if (opts.eagerOpen) this._writableState.updateNextTick()\n    }\n  }\n\n  cork () {\n    this._duplexState |= WRITE_CORKED\n  }\n\n  uncork () {\n    this._duplexState &= WRITE_NOT_CORKED\n    this._writableState.updateNextTick()\n  }\n\n  _writev (batch, cb) {\n    cb(null)\n  }\n\n  _write (data, cb) {\n    this._writableState.autoBatch(data, cb)\n  }\n\n  _final (cb) {\n    cb(null)\n  }\n\n  static isBackpressured (ws) {\n    return (ws._duplexState & WRITE_BACKPRESSURE_STATUS) !== 0\n  }\n\n  static drained (ws) {\n    if (ws.destroyed) return Promise.resolve(false)\n    const state = ws._writableState\n    const pending = (isWritev(ws) ? Math.min(1, state.queue.length) : state.queue.length)\n    const writes = pending + ((ws._duplexState & WRITE_WRITING) ? 1 : 0)\n    if (writes === 0) return Promise.resolve(true)\n    if (state.drains === null) state.drains = []\n    return new Promise((resolve) => {\n      state.drains.push({ writes, resolve })\n    })\n  }\n\n  write (data) {\n    this._writableState.updateNextTick()\n    return this._writableState.push(data)\n  }\n\n  end (data) {\n    this._writableState.updateNextTick()\n    this._writableState.end(data)\n    return this\n  }\n}\n\nclass Duplex extends Readable { // and Writable\n  constructor (opts) {\n    super(opts)\n\n    this._duplexState = OPENING | (this._duplexState & READ_READ_AHEAD)\n    this._writableState = new WritableState(this, opts)\n\n    if (opts) {\n      if (opts.writev) this._writev = opts.writev\n      if (opts.write) this._write = opts.write\n      if (opts.final) this._final = opts.final\n    }\n  }\n\n  cork () {\n    this._duplexState |= WRITE_CORKED\n  }\n\n  uncork () {\n    this._duplexState &= WRITE_NOT_CORKED\n    this._writableState.updateNextTick()\n  }\n\n  _writev (batch, cb) {\n    cb(null)\n  }\n\n  _write (data, cb) {\n    this._writableState.autoBatch(data, cb)\n  }\n\n  _final (cb) {\n    cb(null)\n  }\n\n  write (data) {\n    this._writableState.updateNextTick()\n    return this._writableState.push(data)\n  }\n\n  end (data) {\n    this._writableState.updateNextTick()\n    this._writableState.end(data)\n    return this\n  }\n}\n\nclass Transform extends Duplex {\n  constructor (opts) {\n    super(opts)\n    this._transformState = new TransformState(this)\n\n    if (opts) {\n      if (opts.transform) this._transform = opts.transform\n      if (opts.flush) this._flush = opts.flush\n    }\n  }\n\n  _write (data, cb) {\n    if (this._readableState.buffered >= this._readableState.highWaterMark) {\n      this._transformState.data = data\n    } else {\n      this._transform(data, this._transformState.afterTransform)\n    }\n  }\n\n  _read (cb) {\n    if (this._transformState.data !== null) {\n      const data = this._transformState.data\n      this._transformState.data = null\n      cb(null)\n      this._transform(data, this._transformState.afterTransform)\n    } else {\n      cb(null)\n    }\n  }\n\n  destroy (err) {\n    super.destroy(err)\n    if (this._transformState.data !== null) {\n      this._transformState.data = null\n      this._transformState.afterTransform()\n    }\n  }\n\n  _transform (data, cb) {\n    cb(null, data)\n  }\n\n  _flush (cb) {\n    cb(null)\n  }\n\n  _final (cb) {\n    this._transformState.afterFinal = cb\n    this._flush(transformAfterFlush.bind(this))\n  }\n}\n\nclass PassThrough extends Transform {}\n\nfunction transformAfterFlush (err, data) {\n  const cb = this._transformState.afterFinal\n  if (err) return cb(err)\n  if (data !== null && data !== undefined) this.push(data)\n  this.push(null)\n  cb(null)\n}\n\nfunction pipelinePromise (...streams) {\n  return new Promise((resolve, reject) => {\n    return pipeline(...streams, (err) => {\n      if (err) return reject(err)\n      resolve()\n    })\n  })\n}\n\nfunction pipeline (stream, ...streams) {\n  const all = Array.isArray(stream) ? [...stream, ...streams] : [stream, ...streams]\n  const done = (all.length && typeof all[all.length - 1] === 'function') ? all.pop() : null\n\n  if (all.length < 2) throw new Error('Pipeline requires at least 2 streams')\n\n  let src = all[0]\n  let dest = null\n  let error = null\n\n  for (let i = 1; i < all.length; i++) {\n    dest = all[i]\n\n    if (isStreamx(src)) {\n      src.pipe(dest, onerror)\n    } else {\n      errorHandle(src, true, i > 1, onerror)\n      src.pipe(dest)\n    }\n\n    src = dest\n  }\n\n  if (done) {\n    let fin = false\n\n    const autoDestroy = isStreamx(dest) || !!(dest._writableState && dest._writableState.autoDestroy)\n\n    dest.on('error', (err) => {\n      if (error === null) error = err\n    })\n\n    dest.on('finish', () => {\n      fin = true\n      if (!autoDestroy) done(error)\n    })\n\n    if (autoDestroy) {\n      dest.on('close', () => done(error || (fin ? null : PREMATURE_CLOSE)))\n    }\n  }\n\n  return dest\n\n  function errorHandle (s, rd, wr, onerror) {\n    s.on('error', onerror)\n    s.on('close', onclose)\n\n    function onclose () {\n      if (rd && s._readableState && !s._readableState.ended) return onerror(PREMATURE_CLOSE)\n      if (wr && s._writableState && !s._writableState.ended) return onerror(PREMATURE_CLOSE)\n    }\n  }\n\n  function onerror (err) {\n    if (!err || error) return\n    error = err\n\n    for (const s of all) {\n      s.destroy(err)\n    }\n  }\n}\n\nfunction echo (s) {\n  return s\n}\n\nfunction isStream (stream) {\n  return !!stream._readableState || !!stream._writableState\n}\n\nfunction isStreamx (stream) {\n  return typeof stream._duplexState === 'number' && isStream(stream)\n}\n\nfunction isEnded (stream) {\n  return !!stream._readableState && stream._readableState.ended\n}\n\nfunction isFinished (stream) {\n  return !!stream._writableState && stream._writableState.ended\n}\n\nfunction getStreamError (stream, opts = {}) {\n  const err = (stream._readableState && stream._readableState.error) || (stream._writableState && stream._writableState.error)\n\n  // avoid implicit errors by default\n  return (!opts.all && err === STREAM_DESTROYED) ? null : err\n}\n\nfunction isReadStreamx (stream) {\n  return isStreamx(stream) && stream.readable\n}\n\nfunction isDisturbed (stream) {\n  return (stream._duplexState & OPENING) !== OPENING || (stream._duplexState & ACTIVE_OR_TICKING) !== 0\n}\n\nfunction isTypedArray (data) {\n  return typeof data === 'object' && data !== null && typeof data.byteLength === 'number'\n}\n\nfunction defaultByteLength (data) {\n  return isTypedArray(data) ? data.byteLength : 1024\n}\n\nfunction noop () {}\n\nfunction abort () {\n  this.destroy(new Error('Stream aborted.'))\n}\n\nfunction isWritev (s) {\n  return s._writev !== Writable.prototype._writev && s._writev !== Duplex.prototype._writev\n}\n\nmodule.exports = {\n  pipeline,\n  pipelinePromise,\n  isStream,\n  isStreamx,\n  isEnded,\n  isFinished,\n  isDisturbed,\n  getStreamError,\n  Stream,\n  Writable,\n  Readable,\n  Duplex,\n  Transform,\n  // Export PassThrough for compatibility with Node.js core's stream module\n  PassThrough\n}\n","const b4a = require('b4a')\n\nconst ZEROS = '0000000000000000000'\nconst SEVENS = '7777777777777777777'\nconst ZERO_OFFSET = '0'.charCodeAt(0)\nconst USTAR_MAGIC = b4a.from([0x75, 0x73, 0x74, 0x61, 0x72, 0x00]) // ustar\\x00\nconst USTAR_VER = b4a.from([ZERO_OFFSET, ZERO_OFFSET])\nconst GNU_MAGIC = b4a.from([0x75, 0x73, 0x74, 0x61, 0x72, 0x20]) // ustar\\x20\nconst GNU_VER = b4a.from([0x20, 0x00])\nconst MASK = 0o7777\nconst MAGIC_OFFSET = 257\nconst VERSION_OFFSET = 263\n\nexports.decodeLongPath = function decodeLongPath (buf, encoding) {\n  return decodeStr(buf, 0, buf.length, encoding)\n}\n\nexports.encodePax = function encodePax (opts) { // TODO: encode more stuff in pax\n  let result = ''\n  if (opts.name) result += addLength(' path=' + opts.name + '\\n')\n  if (opts.linkname) result += addLength(' linkpath=' + opts.linkname + '\\n')\n  const pax = opts.pax\n  if (pax) {\n    for (const key in pax) {\n      result += addLength(' ' + key + '=' + pax[key] + '\\n')\n    }\n  }\n  return b4a.from(result)\n}\n\nexports.decodePax = function decodePax (buf) {\n  const result = {}\n\n  while (buf.length) {\n    let i = 0\n    while (i < buf.length && buf[i] !== 32) i++\n    const len = parseInt(b4a.toString(buf.subarray(0, i)), 10)\n    if (!len) return result\n\n    const b = b4a.toString(buf.subarray(i + 1, len - 1))\n    const keyIndex = b.indexOf('=')\n    if (keyIndex === -1) return result\n    result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1)\n\n    buf = buf.subarray(len)\n  }\n\n  return result\n}\n\nexports.encode = function encode (opts) {\n  const buf = b4a.alloc(512)\n  let name = opts.name\n  let prefix = ''\n\n  if (opts.typeflag === 5 && name[name.length - 1] !== '/') name += '/'\n  if (b4a.byteLength(name) !== name.length) return null // utf-8\n\n  while (b4a.byteLength(name) > 100) {\n    const i = name.indexOf('/')\n    if (i === -1) return null\n    prefix += prefix ? '/' + name.slice(0, i) : name.slice(0, i)\n    name = name.slice(i + 1)\n  }\n\n  if (b4a.byteLength(name) > 100 || b4a.byteLength(prefix) > 155) return null\n  if (opts.linkname && b4a.byteLength(opts.linkname) > 100) return null\n\n  b4a.write(buf, name)\n  b4a.write(buf, encodeOct(opts.mode & MASK, 6), 100)\n  b4a.write(buf, encodeOct(opts.uid, 6), 108)\n  b4a.write(buf, encodeOct(opts.gid, 6), 116)\n  encodeSize(opts.size, buf, 124)\n  b4a.write(buf, encodeOct((opts.mtime.getTime() / 1000) | 0, 11), 136)\n\n  buf[156] = ZERO_OFFSET + toTypeflag(opts.type)\n\n  if (opts.linkname) b4a.write(buf, opts.linkname, 157)\n\n  b4a.copy(USTAR_MAGIC, buf, MAGIC_OFFSET)\n  b4a.copy(USTAR_VER, buf, VERSION_OFFSET)\n  if (opts.uname) b4a.write(buf, opts.uname, 265)\n  if (opts.gname) b4a.write(buf, opts.gname, 297)\n  b4a.write(buf, encodeOct(opts.devmajor || 0, 6), 329)\n  b4a.write(buf, encodeOct(opts.devminor || 0, 6), 337)\n\n  if (prefix) b4a.write(buf, prefix, 345)\n\n  b4a.write(buf, encodeOct(cksum(buf), 6), 148)\n\n  return buf\n}\n\nexports.decode = function decode (buf, filenameEncoding, allowUnknownFormat) {\n  let typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET\n\n  let name = decodeStr(buf, 0, 100, filenameEncoding)\n  const mode = decodeOct(buf, 100, 8)\n  const uid = decodeOct(buf, 108, 8)\n  const gid = decodeOct(buf, 116, 8)\n  const size = decodeOct(buf, 124, 12)\n  const mtime = decodeOct(buf, 136, 12)\n  const type = toType(typeflag)\n  const linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100, filenameEncoding)\n  const uname = decodeStr(buf, 265, 32)\n  const gname = decodeStr(buf, 297, 32)\n  const devmajor = decodeOct(buf, 329, 8)\n  const devminor = decodeOct(buf, 337, 8)\n\n  const c = cksum(buf)\n\n  // checksum is still initial value if header was null.\n  if (c === 8 * 32) return null\n\n  // valid checksum\n  if (c !== decodeOct(buf, 148, 8)) throw new Error('Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?')\n\n  if (isUSTAR(buf)) {\n    // ustar (posix) format.\n    // prepend prefix, if present.\n    if (buf[345]) name = decodeStr(buf, 345, 155, filenameEncoding) + '/' + name\n  } else if (isGNU(buf)) {\n    // 'gnu'/'oldgnu' format. Similar to ustar, but has support for incremental and\n    // multi-volume tarballs.\n  } else {\n    if (!allowUnknownFormat) {\n      throw new Error('Invalid tar header: unknown format.')\n    }\n  }\n\n  // to support old tar versions that use trailing / to indicate dirs\n  if (typeflag === 0 && name && name[name.length - 1] === '/') typeflag = 5\n\n  return {\n    name,\n    mode,\n    uid,\n    gid,\n    size,\n    mtime: new Date(1000 * mtime),\n    type,\n    linkname,\n    uname,\n    gname,\n    devmajor,\n    devminor,\n    pax: null\n  }\n}\n\nfunction isUSTAR (buf) {\n  return b4a.equals(USTAR_MAGIC, buf.subarray(MAGIC_OFFSET, MAGIC_OFFSET + 6))\n}\n\nfunction isGNU (buf) {\n  return b4a.equals(GNU_MAGIC, buf.subarray(MAGIC_OFFSET, MAGIC_OFFSET + 6)) &&\n    b4a.equals(GNU_VER, buf.subarray(VERSION_OFFSET, VERSION_OFFSET + 2))\n}\n\nfunction clamp (index, len, defaultValue) {\n  if (typeof index !== 'number') return defaultValue\n  index = ~~index // Coerce to integer.\n  if (index >= len) return len\n  if (index >= 0) return index\n  index += len\n  if (index >= 0) return index\n  return 0\n}\n\nfunction toType (flag) {\n  switch (flag) {\n    case 0:\n      return 'file'\n    case 1:\n      return 'link'\n    case 2:\n      return 'symlink'\n    case 3:\n      return 'character-device'\n    case 4:\n      return 'block-device'\n    case 5:\n      return 'directory'\n    case 6:\n      return 'fifo'\n    case 7:\n      return 'contiguous-file'\n    case 72:\n      return 'pax-header'\n    case 55:\n      return 'pax-global-header'\n    case 27:\n      return 'gnu-long-link-path'\n    case 28:\n    case 30:\n      return 'gnu-long-path'\n  }\n\n  return null\n}\n\nfunction toTypeflag (flag) {\n  switch (flag) {\n    case 'file':\n      return 0\n    case 'link':\n      return 1\n    case 'symlink':\n      return 2\n    case 'character-device':\n      return 3\n    case 'block-device':\n      return 4\n    case 'directory':\n      return 5\n    case 'fifo':\n      return 6\n    case 'contiguous-file':\n      return 7\n    case 'pax-header':\n      return 72\n  }\n\n  return 0\n}\n\nfunction indexOf (block, num, offset, end) {\n  for (; offset < end; offset++) {\n    if (block[offset] === num) return offset\n  }\n  return end\n}\n\nfunction cksum (block) {\n  let sum = 8 * 32\n  for (let i = 0; i < 148; i++) sum += block[i]\n  for (let j = 156; j < 512; j++) sum += block[j]\n  return sum\n}\n\nfunction encodeOct (val, n) {\n  val = val.toString(8)\n  if (val.length > n) return SEVENS.slice(0, n) + ' '\n  return ZEROS.slice(0, n - val.length) + val + ' '\n}\n\nfunction encodeSizeBin (num, buf, off) {\n  buf[off] = 0x80\n  for (let i = 11; i > 0; i--) {\n    buf[off + i] = num & 0xff\n    num = Math.floor(num / 0x100)\n  }\n}\n\nfunction encodeSize (num, buf, off) {\n  if (num.toString(8).length > 11) {\n    encodeSizeBin(num, buf, off)\n  } else {\n    b4a.write(buf, encodeOct(num, 11), off)\n  }\n}\n\n/* Copied from the node-tar repo and modified to meet\n * tar-stream coding standard.\n *\n * Source: https://github.com/npm/node-tar/blob/51b6627a1f357d2eb433e7378e5f05e83b7aa6cd/lib/header.js#L349\n */\nfunction parse256 (buf) {\n  // first byte MUST be either 80 or FF\n  // 80 for positive, FF for 2's comp\n  let positive\n  if (buf[0] === 0x80) positive = true\n  else if (buf[0] === 0xFF) positive = false\n  else return null\n\n  // build up a base-256 tuple from the least sig to the highest\n  const tuple = []\n  let i\n  for (i = buf.length - 1; i > 0; i--) {\n    const byte = buf[i]\n    if (positive) tuple.push(byte)\n    else tuple.push(0xFF - byte)\n  }\n\n  let sum = 0\n  const l = tuple.length\n  for (i = 0; i < l; i++) {\n    sum += tuple[i] * Math.pow(256, i)\n  }\n\n  return positive ? sum : -1 * sum\n}\n\nfunction decodeOct (val, offset, length) {\n  val = val.subarray(offset, offset + length)\n  offset = 0\n\n  // If prefixed with 0x80 then parse as a base-256 integer\n  if (val[offset] & 0x80) {\n    return parse256(val)\n  } else {\n    // Older versions of tar can prefix with spaces\n    while (offset < val.length && val[offset] === 32) offset++\n    const end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length)\n    while (offset < end && val[offset] === 0) offset++\n    if (end === offset) return 0\n    return parseInt(b4a.toString(val.subarray(offset, end)), 8)\n  }\n}\n\nfunction decodeStr (val, offset, length, encoding) {\n  return b4a.toString(val.subarray(offset, indexOf(val, 0, offset, offset + length)), encoding)\n}\n\nfunction addLength (str) {\n  const len = b4a.byteLength(str)\n  let digits = Math.floor(Math.log(len) / Math.log(10)) + 1\n  if (len + digits >= Math.pow(10, digits)) digits++\n\n  return (len + digits) + str\n}\n","const { Writable, Readable, getStreamError } = require('streamx')\nconst FIFO = require('fast-fifo')\nconst b4a = require('b4a')\nconst headers = require('./headers')\n\nconst EMPTY = b4a.alloc(0)\n\nclass BufferList {\n  constructor () {\n    this.buffered = 0\n    this.shifted = 0\n    this.queue = new FIFO()\n\n    this._offset = 0\n  }\n\n  push (buffer) {\n    this.buffered += buffer.byteLength\n    this.queue.push(buffer)\n  }\n\n  shiftFirst (size) {\n    return this._buffered === 0 ? null : this._next(size)\n  }\n\n  shift (size) {\n    if (size > this.buffered) return null\n    if (size === 0) return EMPTY\n\n    let chunk = this._next(size)\n\n    if (size === chunk.byteLength) return chunk // likely case\n\n    const chunks = [chunk]\n\n    while ((size -= chunk.byteLength) > 0) {\n      chunk = this._next(size)\n      chunks.push(chunk)\n    }\n\n    return b4a.concat(chunks)\n  }\n\n  _next (size) {\n    const buf = this.queue.peek()\n    const rem = buf.byteLength - this._offset\n\n    if (size >= rem) {\n      const sub = this._offset ? buf.subarray(this._offset, buf.byteLength) : buf\n      this.queue.shift()\n      this._offset = 0\n      this.buffered -= rem\n      this.shifted += rem\n      return sub\n    }\n\n    this.buffered -= size\n    this.shifted += size\n\n    return buf.subarray(this._offset, (this._offset += size))\n  }\n}\n\nclass Source extends Readable {\n  constructor (self, header, offset) {\n    super()\n\n    this.header = header\n    this.offset = offset\n\n    this._parent = self\n  }\n\n  _read (cb) {\n    if (this.header.size === 0) {\n      this.push(null)\n    }\n    if (this._parent._stream === this) {\n      this._parent._update()\n    }\n    cb(null)\n  }\n\n  _predestroy () {\n    this._parent.destroy(getStreamError(this))\n  }\n\n  _detach () {\n    if (this._parent._stream === this) {\n      this._parent._stream = null\n      this._parent._missing = overflow(this.header.size)\n      this._parent._update()\n    }\n  }\n\n  _destroy (cb) {\n    this._detach()\n    cb(null)\n  }\n}\n\nclass Extract extends Writable {\n  constructor (opts) {\n    super(opts)\n\n    if (!opts) opts = {}\n\n    this._buffer = new BufferList()\n    this._offset = 0\n    this._header = null\n    this._stream = null\n    this._missing = 0\n    this._longHeader = false\n    this._callback = noop\n    this._locked = false\n    this._finished = false\n    this._pax = null\n    this._paxGlobal = null\n    this._gnuLongPath = null\n    this._gnuLongLinkPath = null\n    this._filenameEncoding = opts.filenameEncoding || 'utf-8'\n    this._allowUnknownFormat = !!opts.allowUnknownFormat\n    this._unlockBound = this._unlock.bind(this)\n  }\n\n  _unlock (err) {\n    this._locked = false\n\n    if (err) {\n      this.destroy(err)\n      this._continueWrite(err)\n      return\n    }\n\n    this._update()\n  }\n\n  _consumeHeader () {\n    if (this._locked) return false\n\n    this._offset = this._buffer.shifted\n\n    try {\n      this._header = headers.decode(this._buffer.shift(512), this._filenameEncoding, this._allowUnknownFormat)\n    } catch (err) {\n      this._continueWrite(err)\n      return false\n    }\n\n    if (!this._header) return true\n\n    switch (this._header.type) {\n      case 'gnu-long-path':\n      case 'gnu-long-link-path':\n      case 'pax-global-header':\n      case 'pax-header':\n        this._longHeader = true\n        this._missing = this._header.size\n        return true\n    }\n\n    this._locked = true\n    this._applyLongHeaders()\n\n    if (this._header.size === 0 || this._header.type === 'directory') {\n      this.emit('entry', this._header, this._createStream(), this._unlockBound)\n      return true\n    }\n\n    this._stream = this._createStream()\n    this._missing = this._header.size\n\n    this.emit('entry', this._header, this._stream, this._unlockBound)\n    return true\n  }\n\n  _applyLongHeaders () {\n    if (this._gnuLongPath) {\n      this._header.name = this._gnuLongPath\n      this._gnuLongPath = null\n    }\n\n    if (this._gnuLongLinkPath) {\n      this._header.linkname = this._gnuLongLinkPath\n      this._gnuLongLinkPath = null\n    }\n\n    if (this._pax) {\n      if (this._pax.path) this._header.name = this._pax.path\n      if (this._pax.linkpath) this._header.linkname = this._pax.linkpath\n      if (this._pax.size) this._header.size = parseInt(this._pax.size, 10)\n      this._header.pax = this._pax\n      this._pax = null\n    }\n  }\n\n  _decodeLongHeader (buf) {\n    switch (this._header.type) {\n      case 'gnu-long-path':\n        this._gnuLongPath = headers.decodeLongPath(buf, this._filenameEncoding)\n        break\n      case 'gnu-long-link-path':\n        this._gnuLongLinkPath = headers.decodeLongPath(buf, this._filenameEncoding)\n        break\n      case 'pax-global-header':\n        this._paxGlobal = headers.decodePax(buf)\n        break\n      case 'pax-header':\n        this._pax = this._paxGlobal === null\n          ? headers.decodePax(buf)\n          : Object.assign({}, this._paxGlobal, headers.decodePax(buf))\n        break\n    }\n  }\n\n  _consumeLongHeader () {\n    this._longHeader = false\n    this._missing = overflow(this._header.size)\n\n    const buf = this._buffer.shift(this._header.size)\n\n    try {\n      this._decodeLongHeader(buf)\n    } catch (err) {\n      this._continueWrite(err)\n      return false\n    }\n\n    return true\n  }\n\n  _consumeStream () {\n    const buf = this._buffer.shiftFirst(this._missing)\n    if (buf === null) return false\n\n    this._missing -= buf.byteLength\n    const drained = this._stream.push(buf)\n\n    if (this._missing === 0) {\n      this._stream.push(null)\n      if (drained) this._stream._detach()\n      return drained && this._locked === false\n    }\n\n    return drained\n  }\n\n  _createStream () {\n    return new Source(this, this._header, this._offset)\n  }\n\n  _update () {\n    while (this._buffer.buffered > 0 && !this.destroying) {\n      if (this._missing > 0) {\n        if (this._stream !== null) {\n          if (this._consumeStream() === false) return\n          continue\n        }\n\n        if (this._longHeader === true) {\n          if (this._missing > this._buffer.buffered) break\n          if (this._consumeLongHeader() === false) return false\n          continue\n        }\n\n        const ignore = this._buffer.shiftFirst(this._missing)\n        if (ignore !== null) this._missing -= ignore.byteLength\n        continue\n      }\n\n      if (this._buffer.buffered < 512) break\n      if (this._stream !== null || this._consumeHeader() === false) return\n    }\n\n    this._continueWrite(null)\n  }\n\n  _continueWrite (err) {\n    const cb = this._callback\n    this._callback = noop\n    cb(err)\n  }\n\n  _write (data, cb) {\n    this._callback = cb\n    this._buffer.push(data)\n    this._update()\n  }\n\n  _final (cb) {\n    this._finished = this._missing === 0 && this._buffer.buffered === 0\n    cb(this._finished ? null : new Error('Unexpected end of data'))\n  }\n\n  _predestroy () {\n    this._continueWrite(null)\n  }\n\n  _destroy (cb) {\n    if (this._stream) this._stream.destroy(getStreamError(this))\n    cb(null)\n  }\n\n  [Symbol.asyncIterator] () {\n    let error = null\n\n    let promiseResolve = null\n    let promiseReject = null\n\n    let entryStream = null\n    let entryCallback = null\n\n    const extract = this\n\n    this.on('entry', onentry)\n    this.on('error', (err) => { error = err })\n    this.on('close', onclose)\n\n    return {\n      [Symbol.asyncIterator] () {\n        return this\n      },\n      next () {\n        return new Promise(onnext)\n      },\n      return () {\n        return destroy(null)\n      },\n      throw (err) {\n        return destroy(err)\n      }\n    }\n\n    function consumeCallback (err) {\n      if (!entryCallback) return\n      const cb = entryCallback\n      entryCallback = null\n      cb(err)\n    }\n\n    function onnext (resolve, reject) {\n      if (error) {\n        return reject(error)\n      }\n\n      if (entryStream) {\n        resolve({ value: entryStream, done: false })\n        entryStream = null\n        return\n      }\n\n      promiseResolve = resolve\n      promiseReject = reject\n\n      consumeCallback(null)\n\n      if (extract._finished && promiseResolve) {\n        promiseResolve({ value: undefined, done: true })\n        promiseResolve = promiseReject = null\n      }\n    }\n\n    function onentry (header, stream, callback) {\n      entryCallback = callback\n      stream.on('error', noop) // no way around this due to tick sillyness\n\n      if (promiseResolve) {\n        promiseResolve({ value: stream, done: false })\n        promiseResolve = promiseReject = null\n      } else {\n        entryStream = stream\n      }\n    }\n\n    function onclose () {\n      consumeCallback(error)\n      if (!promiseResolve) return\n      if (error) promiseReject(error)\n      else promiseResolve({ value: undefined, done: true })\n      promiseResolve = promiseReject = null\n    }\n\n    function destroy (err) {\n      extract.destroy(err)\n      consumeCallback(err)\n      return new Promise((resolve, reject) => {\n        if (extract.destroyed) return resolve({ value: undefined, done: true })\n        extract.once('close', function () {\n          if (err) reject(err)\n          else resolve({ value: undefined, done: true })\n        })\n      })\n    }\n  }\n}\n\nmodule.exports = function extract (opts) {\n  return new Extract(opts)\n}\n\nfunction noop () {}\n\nfunction overflow (size) {\n  size &= 511\n  return size && 512 - size\n}\n","const constants = { // just for envs without fs\n  S_IFMT: 61440,\n  S_IFDIR: 16384,\n  S_IFCHR: 8192,\n  S_IFBLK: 24576,\n  S_IFIFO: 4096,\n  S_IFLNK: 40960\n}\n\ntry {\n  module.exports = require('fs').constants || constants\n} catch {\n  module.exports = constants\n}\n","const { Readable, Writable, getStreamError } = require('streamx')\nconst b4a = require('b4a')\n\nconst constants = require('./constants')\nconst headers = require('./headers')\n\nconst DMODE = 0o755\nconst FMODE = 0o644\n\nconst END_OF_TAR = b4a.alloc(1024)\n\nclass Sink extends Writable {\n  constructor (pack, header, callback) {\n    super({ mapWritable, eagerOpen: true })\n\n    this.written = 0\n    this.header = header\n\n    this._callback = callback\n    this._linkname = null\n    this._isLinkname = header.type === 'symlink' && !header.linkname\n    this._isVoid = header.type !== 'file' && header.type !== 'contiguous-file'\n    this._finished = false\n    this._pack = pack\n    this._openCallback = null\n\n    if (this._pack._stream === null) this._pack._stream = this\n    else this._pack._pending.push(this)\n  }\n\n  _open (cb) {\n    this._openCallback = cb\n    if (this._pack._stream === this) this._continueOpen()\n  }\n\n  _continuePack (err) {\n    if (this._callback === null) return\n\n    const callback = this._callback\n    this._callback = null\n\n    callback(err)\n  }\n\n  _continueOpen () {\n    if (this._pack._stream === null) this._pack._stream = this\n\n    const cb = this._openCallback\n    this._openCallback = null\n    if (cb === null) return\n\n    if (this._pack.destroying) return cb(new Error('pack stream destroyed'))\n    if (this._pack._finalized) return cb(new Error('pack stream is already finalized'))\n\n    this._pack._stream = this\n\n    if (!this._isLinkname) {\n      this._pack._encode(this.header)\n    }\n\n    if (this._isVoid) {\n      this._finish()\n      this._continuePack(null)\n    }\n\n    cb(null)\n  }\n\n  _write (data, cb) {\n    if (this._isLinkname) {\n      this._linkname = this._linkname ? b4a.concat([this._linkname, data]) : data\n      return cb(null)\n    }\n\n    if (this._isVoid) {\n      if (data.byteLength > 0) {\n        return cb(new Error('No body allowed for this entry'))\n      }\n      return cb()\n    }\n\n    this.written += data.byteLength\n    if (this._pack.push(data)) return cb()\n    this._pack._drain = cb\n  }\n\n  _finish () {\n    if (this._finished) return\n    this._finished = true\n\n    if (this._isLinkname) {\n      this.header.linkname = this._linkname ? b4a.toString(this._linkname, 'utf-8') : ''\n      this._pack._encode(this.header)\n    }\n\n    overflow(this._pack, this.header.size)\n\n    this._pack._done(this)\n  }\n\n  _final (cb) {\n    if (this.written !== this.header.size) { // corrupting tar\n      return cb(new Error('Size mismatch'))\n    }\n\n    this._finish()\n    cb(null)\n  }\n\n  _getError () {\n    return getStreamError(this) || new Error('tar entry destroyed')\n  }\n\n  _predestroy () {\n    this._pack.destroy(this._getError())\n  }\n\n  _destroy (cb) {\n    this._pack._done(this)\n\n    this._continuePack(this._finished ? null : this._getError())\n\n    cb()\n  }\n}\n\nclass Pack extends Readable {\n  constructor (opts) {\n    super(opts)\n    this._drain = noop\n    this._finalized = false\n    this._finalizing = false\n    this._pending = []\n    this._stream = null\n  }\n\n  entry (header, buffer, callback) {\n    if (this._finalized || this.destroying) throw new Error('already finalized or destroyed')\n\n    if (typeof buffer === 'function') {\n      callback = buffer\n      buffer = null\n    }\n\n    if (!callback) callback = noop\n\n    if (!header.size || header.type === 'symlink') header.size = 0\n    if (!header.type) header.type = modeToType(header.mode)\n    if (!header.mode) header.mode = header.type === 'directory' ? DMODE : FMODE\n    if (!header.uid) header.uid = 0\n    if (!header.gid) header.gid = 0\n    if (!header.mtime) header.mtime = new Date()\n\n    if (typeof buffer === 'string') buffer = b4a.from(buffer)\n\n    const sink = new Sink(this, header, callback)\n\n    if (b4a.isBuffer(buffer)) {\n      header.size = buffer.byteLength\n      sink.write(buffer)\n      sink.end()\n      return sink\n    }\n\n    if (sink._isVoid) {\n      return sink\n    }\n\n    return sink\n  }\n\n  finalize () {\n    if (this._stream || this._pending.length > 0) {\n      this._finalizing = true\n      return\n    }\n\n    if (this._finalized) return\n    this._finalized = true\n\n    this.push(END_OF_TAR)\n    this.push(null)\n  }\n\n  _done (stream) {\n    if (stream !== this._stream) return\n\n    this._stream = null\n\n    if (this._finalizing) this.finalize()\n    if (this._pending.length) this._pending.shift()._continueOpen()\n  }\n\n  _encode (header) {\n    if (!header.pax) {\n      const buf = headers.encode(header)\n      if (buf) {\n        this.push(buf)\n        return\n      }\n    }\n    this._encodePax(header)\n  }\n\n  _encodePax (header) {\n    const paxHeader = headers.encodePax({\n      name: header.name,\n      linkname: header.linkname,\n      pax: header.pax\n    })\n\n    const newHeader = {\n      name: 'PaxHeader',\n      mode: header.mode,\n      uid: header.uid,\n      gid: header.gid,\n      size: paxHeader.byteLength,\n      mtime: header.mtime,\n      type: 'pax-header',\n      linkname: header.linkname && 'PaxHeader',\n      uname: header.uname,\n      gname: header.gname,\n      devmajor: header.devmajor,\n      devminor: header.devminor\n    }\n\n    this.push(headers.encode(newHeader))\n    this.push(paxHeader)\n    overflow(this, paxHeader.byteLength)\n\n    newHeader.size = header.size\n    newHeader.type = header.type\n    this.push(headers.encode(newHeader))\n  }\n\n  _doDrain () {\n    const drain = this._drain\n    this._drain = noop\n    drain()\n  }\n\n  _predestroy () {\n    const err = getStreamError(this)\n\n    if (this._stream) this._stream.destroy(err)\n\n    while (this._pending.length) {\n      const stream = this._pending.shift()\n      stream.destroy(err)\n      stream._continueOpen()\n    }\n\n    this._doDrain()\n  }\n\n  _read (cb) {\n    this._doDrain()\n    cb()\n  }\n}\n\nmodule.exports = function pack (opts) {\n  return new Pack(opts)\n}\n\nfunction modeToType (mode) {\n  switch (mode & constants.S_IFMT) {\n    case constants.S_IFBLK: return 'block-device'\n    case constants.S_IFCHR: return 'character-device'\n    case constants.S_IFDIR: return 'directory'\n    case constants.S_IFIFO: return 'fifo'\n    case constants.S_IFLNK: return 'symlink'\n  }\n\n  return 'file'\n}\n\nfunction noop () {}\n\nfunction overflow (self, size) {\n  size &= 511\n  if (size) self.push(END_OF_TAR.subarray(0, 512 - size))\n}\n\nfunction mapWritable (buf) {\n  return b4a.isBuffer(buf) ? buf : b4a.from(buf)\n}\n","exports.extract = require('./extract')\nexports.pack = require('./pack')\n","/**\n * TAR Format Plugin\n *\n * @module plugins/tar\n * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}\n * @copyright (c) 2012-2014 Chris Talkington, contributors.\n */\nvar zlib = require('zlib');\n\nvar engine = require('tar-stream');\nvar util = require('archiver-utils');\n\n/**\n * @constructor\n * @param {TarOptions} options\n */\nvar Tar = function(options) {\n  if (!(this instanceof Tar)) {\n    return new Tar(options);\n  }\n\n  options = this.options = util.defaults(options, {\n    gzip: false\n  });\n\n  if (typeof options.gzipOptions !== 'object') {\n    options.gzipOptions = {};\n  }\n\n  this.supports = {\n    directory: true,\n    symlink: true\n  };\n\n  this.engine = engine.pack(options);\n  this.compressor = false;\n\n  if (options.gzip) {\n    this.compressor = zlib.createGzip(options.gzipOptions);\n    this.compressor.on('error', this._onCompressorError.bind(this));\n  }\n};\n\n/**\n * [_onCompressorError description]\n *\n * @private\n * @param  {Error} err\n * @return void\n */\nTar.prototype._onCompressorError = function(err) {\n  this.engine.emit('error', err);\n};\n\n/**\n * [append description]\n *\n * @param  {(Buffer|Stream)} source\n * @param  {TarEntryData} data\n * @param  {Function} callback\n * @return void\n */\nTar.prototype.append = function(source, data, callback) {\n  var self = this;\n\n  data.mtime = data.date;\n\n  function append(err, sourceBuffer) {\n    if (err) {\n      callback(err);\n      return;\n    }\n\n    self.engine.entry(data, sourceBuffer, function(err) {\n      callback(err, data);\n    });\n  }\n\n  if (data.sourceType === 'buffer') {\n    append(null, source);\n  } else if (data.sourceType === 'stream' && data.stats) {\n    data.size = data.stats.size;\n\n    var entry = self.engine.entry(data, function(err) {\n      callback(err, data);\n    });\n\n    source.pipe(entry);\n  } else if (data.sourceType === 'stream') {\n    util.collectStream(source, append);\n  }\n};\n\n/**\n * [finalize description]\n *\n * @return void\n */\nTar.prototype.finalize = function() {\n  this.engine.finalize();\n};\n\n/**\n * [on description]\n *\n * @return this.engine\n */\nTar.prototype.on = function() {\n  return this.engine.on.apply(this.engine, arguments);\n};\n\n/**\n * [pipe description]\n *\n * @param  {String} destination\n * @param  {Object} options\n * @return this.engine\n */\nTar.prototype.pipe = function(destination, options) {\n  if (this.compressor) {\n    return this.engine.pipe.apply(this.engine, [this.compressor]).pipe(destination, options);\n  } else {\n    return this.engine.pipe.apply(this.engine, arguments);\n  }\n};\n\n/**\n * [unpipe description]\n *\n * @return this.engine\n */\nTar.prototype.unpipe = function() {\n  if (this.compressor) {\n    return this.compressor.unpipe.apply(this.compressor, arguments);\n  } else {\n    return this.engine.unpipe.apply(this.engine, arguments);\n  }\n};\n\nmodule.exports = Tar;\n\n/**\n * @typedef {Object} TarOptions\n * @global\n * @property {Boolean} [gzip=false] Compress the tar archive using gzip.\n * @property {Object} [gzipOptions] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}\n * to control compression.\n * @property {*} [*] See [tar-stream]{@link https://github.com/mafintosh/tar-stream} documentation for additional properties.\n */\n\n/**\n * @typedef {Object} TarEntryData\n * @global\n * @property {String} name Sets the entry name including internal path.\n * @property {(String|Date)} [date=NOW()] Sets the entry date.\n * @property {Number} [mode=D:0755/F:0644] Sets the entry permissions.\n * @property {String} [prefix] Sets a path prefix for the entry name. Useful\n * when working with methods like `directory` or `glob`.\n * @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing\n * for reduction of fs stat calls when stat data is already known.\n */\n\n/**\n * TarStream Module\n * @external TarStream\n * @see {@link https://github.com/mafintosh/tar-stream}\n */\n","'use strict';\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nconst CRC_TABLE = new Int32Array([\n  0,\n  1996959894,\n  3993919788,\n  2567524794,\n  124634137,\n  1886057615,\n  3915621685,\n  2657392035,\n  249268274,\n  2044508324,\n  3772115230,\n  2547177864,\n  162941995,\n  2125561021,\n  3887607047,\n  2428444049,\n  498536548,\n  1789927666,\n  4089016648,\n  2227061214,\n  450548861,\n  1843258603,\n  4107580753,\n  2211677639,\n  325883990,\n  1684777152,\n  4251122042,\n  2321926636,\n  335633487,\n  1661365465,\n  4195302755,\n  2366115317,\n  997073096,\n  1281953886,\n  3579855332,\n  2724688242,\n  1006888145,\n  1258607687,\n  3524101629,\n  2768942443,\n  901097722,\n  1119000684,\n  3686517206,\n  2898065728,\n  853044451,\n  1172266101,\n  3705015759,\n  2882616665,\n  651767980,\n  1373503546,\n  3369554304,\n  3218104598,\n  565507253,\n  1454621731,\n  3485111705,\n  3099436303,\n  671266974,\n  1594198024,\n  3322730930,\n  2970347812,\n  795835527,\n  1483230225,\n  3244367275,\n  3060149565,\n  1994146192,\n  31158534,\n  2563907772,\n  4023717930,\n  1907459465,\n  112637215,\n  2680153253,\n  3904427059,\n  2013776290,\n  251722036,\n  2517215374,\n  3775830040,\n  2137656763,\n  141376813,\n  2439277719,\n  3865271297,\n  1802195444,\n  476864866,\n  2238001368,\n  4066508878,\n  1812370925,\n  453092731,\n  2181625025,\n  4111451223,\n  1706088902,\n  314042704,\n  2344532202,\n  4240017532,\n  1658658271,\n  366619977,\n  2362670323,\n  4224994405,\n  1303535960,\n  984961486,\n  2747007092,\n  3569037538,\n  1256170817,\n  1037604311,\n  2765210733,\n  3554079995,\n  1131014506,\n  879679996,\n  2909243462,\n  3663771856,\n  1141124467,\n  855842277,\n  2852801631,\n  3708648649,\n  1342533948,\n  654459306,\n  3188396048,\n  3373015174,\n  1466479909,\n  544179635,\n  3110523913,\n  3462522015,\n  1591671054,\n  702138776,\n  2966460450,\n  3352799412,\n  1504918807,\n  783551873,\n  3082640443,\n  3233442989,\n  3988292384,\n  2596254646,\n  62317068,\n  1957810842,\n  3939845945,\n  2647816111,\n  81470997,\n  1943803523,\n  3814918930,\n  2489596804,\n  225274430,\n  2053790376,\n  3826175755,\n  2466906013,\n  167816743,\n  2097651377,\n  4027552580,\n  2265490386,\n  503444072,\n  1762050814,\n  4150417245,\n  2154129355,\n  426522225,\n  1852507879,\n  4275313526,\n  2312317920,\n  282753626,\n  1742555852,\n  4189708143,\n  2394877945,\n  397917763,\n  1622183637,\n  3604390888,\n  2714866558,\n  953729732,\n  1340076626,\n  3518719985,\n  2797360999,\n  1068828381,\n  1219638859,\n  3624741850,\n  2936675148,\n  906185462,\n  1090812512,\n  3747672003,\n  2825379669,\n  829329135,\n  1181335161,\n  3412177804,\n  3160834842,\n  628085408,\n  1382605366,\n  3423369109,\n  3138078467,\n  570562233,\n  1426400815,\n  3317316542,\n  2998733608,\n  733239954,\n  1555261956,\n  3268935591,\n  3050360625,\n  752459403,\n  1541320221,\n  2607071920,\n  3965973030,\n  1969922972,\n  40735498,\n  2617837225,\n  3943577151,\n  1913087877,\n  83908371,\n  2512341634,\n  3803740692,\n  2075208622,\n  213261112,\n  2463272603,\n  3855990285,\n  2094854071,\n  198958881,\n  2262029012,\n  4057260610,\n  1759359992,\n  534414190,\n  2176718541,\n  4139329115,\n  1873836001,\n  414664567,\n  2282248934,\n  4279200368,\n  1711684554,\n  285281116,\n  2405801727,\n  4167216745,\n  1634467795,\n  376229701,\n  2685067896,\n  3608007406,\n  1308918612,\n  956543938,\n  2808555105,\n  3495958263,\n  1231636301,\n  1047427035,\n  2932959818,\n  3654703836,\n  1088359270,\n  936918e3,\n  2847714899,\n  3736837829,\n  1202900863,\n  817233897,\n  3183342108,\n  3401237130,\n  1404277552,\n  615818150,\n  3134207493,\n  3453421203,\n  1423857449,\n  601450431,\n  3009837614,\n  3294710456,\n  1567103746,\n  711928724,\n  3020668471,\n  3272380065,\n  1510334235,\n  755167117\n]);\nfunction ensureBuffer(input) {\n  if (Buffer.isBuffer(input)) {\n    return input;\n  }\n  if (typeof input === \"number\") {\n    return Buffer.alloc(input);\n  } else if (typeof input === \"string\") {\n    return Buffer.from(input);\n  } else {\n    throw new Error(\"input must be buffer, number, or string, received \" + typeof input);\n  }\n}\nfunction bufferizeInt(num) {\n  const tmp = ensureBuffer(4);\n  tmp.writeInt32BE(num, 0);\n  return tmp;\n}\nfunction _crc32(buf, previous) {\n  buf = ensureBuffer(buf);\n  if (Buffer.isBuffer(previous)) {\n    previous = previous.readUInt32BE(0);\n  }\n  let crc = ~~previous ^ -1;\n  for (var n = 0; n < buf.length; n++) {\n    crc = CRC_TABLE[(crc ^ buf[n]) & 255] ^ crc >>> 8;\n  }\n  return crc ^ -1;\n}\nfunction crc32() {\n  return bufferizeInt(_crc32.apply(null, arguments));\n}\ncrc32.signed = function() {\n  return _crc32.apply(null, arguments);\n};\ncrc32.unsigned = function() {\n  return _crc32.apply(null, arguments) >>> 0;\n};\nvar bufferCrc32 = crc32;\n\nconst index = /*@__PURE__*/getDefaultExportFromCjs(bufferCrc32);\n\nmodule.exports = index;\n","/**\n * JSON Format Plugin\n *\n * @module plugins/json\n * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}\n * @copyright (c) 2012-2014 Chris Talkington, contributors.\n */\nvar inherits = require('util').inherits;\nvar Transform = require('readable-stream').Transform;\n\nvar crc32 = require('buffer-crc32');\nvar util = require('archiver-utils');\n\n/**\n * @constructor\n * @param {(JsonOptions|TransformOptions)} options\n */\nvar Json = function(options) {\n  if (!(this instanceof Json)) {\n    return new Json(options);\n  }\n\n  options = this.options = util.defaults(options, {});\n\n  Transform.call(this, options);\n\n  this.supports = {\n    directory: true,\n    symlink: true\n  };\n\n  this.files = [];\n};\n\ninherits(Json, Transform);\n\n/**\n * [_transform description]\n *\n * @private\n * @param  {Buffer}   chunk\n * @param  {String}   encoding\n * @param  {Function} callback\n * @return void\n */\nJson.prototype._transform = function(chunk, encoding, callback) {\n  callback(null, chunk);\n};\n\n/**\n * [_writeStringified description]\n *\n * @private\n * @return void\n */\nJson.prototype._writeStringified = function() {\n  var fileString = JSON.stringify(this.files);\n  this.write(fileString);\n};\n\n/**\n * [append description]\n *\n * @param  {(Buffer|Stream)}   source\n * @param  {EntryData}   data\n * @param  {Function} callback\n * @return void\n */\nJson.prototype.append = function(source, data, callback) {\n  var self = this;\n\n  data.crc32 = 0;\n\n  function onend(err, sourceBuffer) {\n    if (err) {\n      callback(err);\n      return;\n    }\n\n    data.size = sourceBuffer.length || 0;\n    data.crc32 = crc32.unsigned(sourceBuffer);\n\n    self.files.push(data);\n\n    callback(null, data);\n  }\n\n  if (data.sourceType === 'buffer') {\n    onend(null, source);\n  } else if (data.sourceType === 'stream') {\n    util.collectStream(source, onend);\n  }\n};\n\n/**\n * [finalize description]\n *\n * @return void\n */\nJson.prototype.finalize = function() {\n  this._writeStringified();\n  this.end();\n};\n\nmodule.exports = Json;\n\n/**\n * @typedef {Object} JsonOptions\n * @global\n */\n","/**\n * Archiver Vending\n *\n * @ignore\n * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}\n * @copyright (c) 2012-2014 Chris Talkington, contributors.\n */\nvar Archiver = require('./lib/core');\n\nvar formats = {};\n\n/**\n * Dispenses a new Archiver instance.\n *\n * @constructor\n * @param  {String} format The archive format to use.\n * @param  {Object} options See [Archiver]{@link Archiver}\n * @return {Archiver}\n */\nvar vending = function(format, options) {\n  return vending.create(format, options);\n};\n\n/**\n * Creates a new Archiver instance.\n *\n * @param  {String} format The archive format to use.\n * @param  {Object} options See [Archiver]{@link Archiver}\n * @return {Archiver}\n */\nvending.create = function(format, options) {\n  if (formats[format]) {\n    var instance = new Archiver(format, options);\n    instance.setFormat(format);\n    instance.setModule(new formats[format](options));\n\n    return instance;\n  } else {\n    throw new Error('create(' + format + '): format not registered');\n  }\n};\n\n/**\n * Registers a format for use with archiver.\n *\n * @param  {String} format The name of the format.\n * @param  {Function} module The function for archiver to interact with.\n * @return void\n */\nvending.registerFormat = function(format, module) {\n  if (formats[format]) {\n    throw new Error('register(' + format + '): format already registered');\n  }\n\n  if (typeof module !== 'function') {\n    throw new Error('register(' + format + '): format module invalid');\n  }\n\n  if (typeof module.prototype.append !== 'function' || typeof module.prototype.finalize !== 'function') {\n    throw new Error('register(' + format + '): format module missing methods');\n  }\n\n  formats[format] = module;\n};\n\n/**\n * Check if the format is already registered.\n * \n * @param {String} format the name of the format.\n * @return boolean\n */\nvending.isRegisteredFormat = function (format) {\n  if (formats[format]) {\n    return true;\n  }\n  \n  return false;\n};\n\nvending.registerFormat('zip', require('./lib/plugins/zip'));\nvending.registerFormat('tar', require('./lib/plugins/tar'));\nvending.registerFormat('json', require('./lib/plugins/json'));\n\nmodule.exports = vending;","module.exports = Traverse;\nfunction Traverse (obj) {\n    if (!(this instanceof Traverse)) return new Traverse(obj);\n    this.value = obj;\n}\n\nTraverse.prototype.get = function (ps) {\n    var node = this.value;\n    for (var i = 0; i < ps.length; i ++) {\n        var key = ps[i];\n        if (!Object.hasOwnProperty.call(node, key)) {\n            node = undefined;\n            break;\n        }\n        node = node[key];\n    }\n    return node;\n};\n\nTraverse.prototype.set = function (ps, value) {\n    var node = this.value;\n    for (var i = 0; i < ps.length - 1; i ++) {\n        var key = ps[i];\n        if (!Object.hasOwnProperty.call(node, key)) node[key] = {};\n        node = node[key];\n    }\n    node[ps[i]] = value;\n    return value;\n};\n\nTraverse.prototype.map = function (cb) {\n    return walk(this.value, cb, true);\n};\n\nTraverse.prototype.forEach = function (cb) {\n    this.value = walk(this.value, cb, false);\n    return this.value;\n};\n\nTraverse.prototype.reduce = function (cb, init) {\n    var skip = arguments.length === 1;\n    var acc = skip ? this.value : init;\n    this.forEach(function (x) {\n        if (!this.isRoot || !skip) {\n            acc = cb.call(this, acc, x);\n        }\n    });\n    return acc;\n};\n\nTraverse.prototype.deepEqual = function (obj) {\n    if (arguments.length !== 1) {\n        throw new Error(\n            'deepEqual requires exactly one object to compare against'\n        );\n    }\n    \n    var equal = true;\n    var node = obj;\n    \n    this.forEach(function (y) {\n        var notEqual = (function () {\n            equal = false;\n            //this.stop();\n            return undefined;\n        }).bind(this);\n        \n        //if (node === undefined || node === null) return notEqual();\n        \n        if (!this.isRoot) {\n        /*\n            if (!Object.hasOwnProperty.call(node, this.key)) {\n                return notEqual();\n            }\n        */\n            if (typeof node !== 'object') return notEqual();\n            node = node[this.key];\n        }\n        \n        var x = node;\n        \n        this.post(function () {\n            node = x;\n        });\n        \n        var toS = function (o) {\n            return Object.prototype.toString.call(o);\n        };\n        \n        if (this.circular) {\n            if (Traverse(obj).get(this.circular.path) !== x) notEqual();\n        }\n        else if (typeof x !== typeof y) {\n            notEqual();\n        }\n        else if (x === null || y === null || x === undefined || y === undefined) {\n            if (x !== y) notEqual();\n        }\n        else if (x.__proto__ !== y.__proto__) {\n            notEqual();\n        }\n        else if (x === y) {\n            // nop\n        }\n        else if (typeof x === 'function') {\n            if (x instanceof RegExp) {\n                // both regexps on account of the __proto__ check\n                if (x.toString() != y.toString()) notEqual();\n            }\n            else if (x !== y) notEqual();\n        }\n        else if (typeof x === 'object') {\n            if (toS(y) === '[object Arguments]'\n            || toS(x) === '[object Arguments]') {\n                if (toS(x) !== toS(y)) {\n                    notEqual();\n                }\n            }\n            else if (x instanceof Date || y instanceof Date) {\n                if (!(x instanceof Date) || !(y instanceof Date)\n                || x.getTime() !== y.getTime()) {\n                    notEqual();\n                }\n            }\n            else {\n                var kx = Object.keys(x);\n                var ky = Object.keys(y);\n                if (kx.length !== ky.length) return notEqual();\n                for (var i = 0; i < kx.length; i++) {\n                    var k = kx[i];\n                    if (!Object.hasOwnProperty.call(y, k)) {\n                        notEqual();\n                    }\n                }\n            }\n        }\n    });\n    \n    return equal;\n};\n\nTraverse.prototype.paths = function () {\n    var acc = [];\n    this.forEach(function (x) {\n        acc.push(this.path); \n    });\n    return acc;\n};\n\nTraverse.prototype.nodes = function () {\n    var acc = [];\n    this.forEach(function (x) {\n        acc.push(this.node);\n    });\n    return acc;\n};\n\nTraverse.prototype.clone = function () {\n    var parents = [], nodes = [];\n    \n    return (function clone (src) {\n        for (var i = 0; i < parents.length; i++) {\n            if (parents[i] === src) {\n                return nodes[i];\n            }\n        }\n        \n        if (typeof src === 'object' && src !== null) {\n            var dst = copy(src);\n            \n            parents.push(src);\n            nodes.push(dst);\n            \n            Object.keys(src).forEach(function (key) {\n                dst[key] = clone(src[key]);\n            });\n            \n            parents.pop();\n            nodes.pop();\n            return dst;\n        }\n        else {\n            return src;\n        }\n    })(this.value);\n};\n\nfunction walk (root, cb, immutable) {\n    var path = [];\n    var parents = [];\n    var alive = true;\n    \n    return (function walker (node_) {\n        var node = immutable ? copy(node_) : node_;\n        var modifiers = {};\n        \n        var state = {\n            node : node,\n            node_ : node_,\n            path : [].concat(path),\n            parent : parents.slice(-1)[0],\n            key : path.slice(-1)[0],\n            isRoot : path.length === 0,\n            level : path.length,\n            circular : null,\n            update : function (x) {\n                if (!state.isRoot) {\n                    state.parent.node[state.key] = x;\n                }\n                state.node = x;\n            },\n            'delete' : function () {\n                delete state.parent.node[state.key];\n            },\n            remove : function () {\n                if (Array.isArray(state.parent.node)) {\n                    state.parent.node.splice(state.key, 1);\n                }\n                else {\n                    delete state.parent.node[state.key];\n                }\n            },\n            before : function (f) { modifiers.before = f },\n            after : function (f) { modifiers.after = f },\n            pre : function (f) { modifiers.pre = f },\n            post : function (f) { modifiers.post = f },\n            stop : function () { alive = false }\n        };\n        \n        if (!alive) return state;\n        \n        if (typeof node === 'object' && node !== null) {\n            state.isLeaf = Object.keys(node).length == 0;\n            \n            for (var i = 0; i < parents.length; i++) {\n                if (parents[i].node_ === node_) {\n                    state.circular = parents[i];\n                    break;\n                }\n            }\n        }\n        else {\n            state.isLeaf = true;\n        }\n        \n        state.notLeaf = !state.isLeaf;\n        state.notRoot = !state.isRoot;\n        \n        // use return values to update if defined\n        var ret = cb.call(state, state.node);\n        if (ret !== undefined && state.update) state.update(ret);\n        if (modifiers.before) modifiers.before.call(state, state.node);\n        \n        if (typeof state.node == 'object'\n        && state.node !== null && !state.circular) {\n            parents.push(state);\n            \n            var keys = Object.keys(state.node);\n            keys.forEach(function (key, i) {\n                path.push(key);\n                \n                if (modifiers.pre) modifiers.pre.call(state, state.node[key], key);\n                \n                var child = walker(state.node[key]);\n                if (immutable && Object.hasOwnProperty.call(state.node, key)) {\n                    state.node[key] = child.node;\n                }\n                \n                child.isLast = i == keys.length - 1;\n                child.isFirst = i == 0;\n                \n                if (modifiers.post) modifiers.post.call(state, child);\n                \n                path.pop();\n            });\n            parents.pop();\n        }\n        \n        if (modifiers.after) modifiers.after.call(state, state.node);\n        \n        return state;\n    })(root).node;\n}\n\nObject.keys(Traverse.prototype).forEach(function (key) {\n    Traverse[key] = function (obj) {\n        var args = [].slice.call(arguments, 1);\n        var t = Traverse(obj);\n        return t[key].apply(t, args);\n    };\n});\n\nfunction copy (src) {\n    if (typeof src === 'object' && src !== null) {\n        var dst;\n        \n        if (Array.isArray(src)) {\n            dst = [];\n        }\n        else if (src instanceof Date) {\n            dst = new Date(src);\n        }\n        else if (src instanceof Boolean) {\n            dst = new Boolean(src);\n        }\n        else if (src instanceof Number) {\n            dst = new Number(src);\n        }\n        else if (src instanceof String) {\n            dst = new String(src);\n        }\n        else {\n            dst = Object.create(Object.getPrototypeOf(src));\n        }\n        \n        Object.keys(src).forEach(function (key) {\n            dst[key] = src[key];\n        });\n        return dst;\n    }\n    else return src;\n}\n","var Traverse = require('traverse');\nvar EventEmitter = require('events').EventEmitter;\n\nmodule.exports = Chainsaw;\nfunction Chainsaw (builder) {\n    var saw = Chainsaw.saw(builder, {});\n    var r = builder.call(saw.handlers, saw);\n    if (r !== undefined) saw.handlers = r;\n    saw.record();\n    return saw.chain();\n};\n\nChainsaw.light = function ChainsawLight (builder) {\n    var saw = Chainsaw.saw(builder, {});\n    var r = builder.call(saw.handlers, saw);\n    if (r !== undefined) saw.handlers = r;\n    return saw.chain();\n};\n\nChainsaw.saw = function (builder, handlers) {\n    var saw = new EventEmitter;\n    saw.handlers = handlers;\n    saw.actions = [];\n\n    saw.chain = function () {\n        var ch = Traverse(saw.handlers).map(function (node) {\n            if (this.isRoot) return node;\n            var ps = this.path;\n\n            if (typeof node === 'function') {\n                this.update(function () {\n                    saw.actions.push({\n                        path : ps,\n                        args : [].slice.call(arguments)\n                    });\n                    return ch;\n                });\n            }\n        });\n\n        process.nextTick(function () {\n            saw.emit('begin');\n            saw.next();\n        });\n\n        return ch;\n    };\n\n    saw.pop = function () {\n        return saw.actions.shift();\n    };\n\n    saw.next = function () {\n        var action = saw.pop();\n\n        if (!action) {\n            saw.emit('end');\n        }\n        else if (!action.trap) {\n            var node = saw.handlers;\n            action.path.forEach(function (key) { node = node[key] });\n            node.apply(saw.handlers, action.args);\n        }\n    };\n\n    saw.nest = function (cb) {\n        var args = [].slice.call(arguments, 1);\n        var autonext = true;\n\n        if (typeof cb === 'boolean') {\n            var autonext = cb;\n            cb = args.shift();\n        }\n\n        var s = Chainsaw.saw(builder, {});\n        var r = builder.call(s.handlers, s);\n\n        if (r !== undefined) s.handlers = r;\n\n        // If we are recording...\n        if (\"undefined\" !== typeof saw.step) {\n            // ... our children should, too\n            s.record();\n        }\n\n        cb.apply(s.chain(), args);\n        if (autonext !== false) s.on('end', saw.next);\n    };\n\n    saw.record = function () {\n        upgradeChainsaw(saw);\n    };\n\n    ['trap', 'down', 'jump'].forEach(function (method) {\n        saw[method] = function () {\n            throw new Error(\"To use the trap, down and jump features, please \"+\n                            \"call record() first to start recording actions.\");\n        };\n    });\n\n    return saw;\n};\n\nfunction upgradeChainsaw(saw) {\n    saw.step = 0;\n\n    // override pop\n    saw.pop = function () {\n        return saw.actions[saw.step++];\n    };\n\n    saw.trap = function (name, cb) {\n        var ps = Array.isArray(name) ? name : [name];\n        saw.actions.push({\n            path : ps,\n            step : saw.step,\n            cb : cb,\n            trap : true\n        });\n    };\n\n    saw.down = function (name) {\n        var ps = (Array.isArray(name) ? name : [name]).join('/');\n        var i = saw.actions.slice(saw.step).map(function (x) {\n            if (x.trap && x.step <= saw.step) return false;\n            return x.path.join('/') == ps;\n        }).indexOf(true);\n\n        if (i >= 0) saw.step += i;\n        else saw.step = saw.actions.length;\n\n        var act = saw.actions[saw.step - 1];\n        if (act && act.trap) {\n            // It's a trap!\n            saw.step = act.step;\n            act.cb();\n        }\n        else saw.next();\n    };\n\n    saw.jump = function (step) {\n        saw.step = step;\n        saw.next();\n    };\n};\n","module.exports = Buffers;\n\nfunction Buffers (bufs) {\n    if (!(this instanceof Buffers)) return new Buffers(bufs);\n    this.buffers = bufs || [];\n    this.length = this.buffers.reduce(function (size, buf) {\n        return size + buf.length\n    }, 0);\n}\n\nBuffers.prototype.push = function () {\n    for (var i = 0; i < arguments.length; i++) {\n        if (!Buffer.isBuffer(arguments[i])) {\n            throw new TypeError('Tried to push a non-buffer');\n        }\n    }\n    \n    for (var i = 0; i < arguments.length; i++) {\n        var buf = arguments[i];\n        this.buffers.push(buf);\n        this.length += buf.length;\n    }\n    return this.length;\n};\n\nBuffers.prototype.unshift = function () {\n    for (var i = 0; i < arguments.length; i++) {\n        if (!Buffer.isBuffer(arguments[i])) {\n            throw new TypeError('Tried to unshift a non-buffer');\n        }\n    }\n    \n    for (var i = 0; i < arguments.length; i++) {\n        var buf = arguments[i];\n        this.buffers.unshift(buf);\n        this.length += buf.length;\n    }\n    return this.length;\n};\n\nBuffers.prototype.copy = function (dst, dStart, start, end) {\n    return this.slice(start, end).copy(dst, dStart, 0, end - start);\n};\n\nBuffers.prototype.splice = function (i, howMany) {\n    var buffers = this.buffers;\n    var index = i >= 0 ? i : this.length - i;\n    var reps = [].slice.call(arguments, 2);\n    \n    if (howMany === undefined) {\n        howMany = this.length - index;\n    }\n    else if (howMany > this.length - index) {\n        howMany = this.length - index;\n    }\n    \n    for (var i = 0; i < reps.length; i++) {\n        this.length += reps[i].length;\n    }\n    \n    var removed = new Buffers();\n    var bytes = 0;\n    \n    var startBytes = 0;\n    for (\n        var ii = 0;\n        ii < buffers.length && startBytes + buffers[ii].length < index;\n        ii ++\n    ) { startBytes += buffers[ii].length }\n    \n    if (index - startBytes > 0) {\n        var start = index - startBytes;\n        \n        if (start + howMany < buffers[ii].length) {\n            removed.push(buffers[ii].slice(start, start + howMany));\n            \n            var orig = buffers[ii];\n            //var buf = new Buffer(orig.length - howMany);\n            var buf0 = new Buffer(start);\n            for (var i = 0; i < start; i++) {\n                buf0[i] = orig[i];\n            }\n            \n            var buf1 = new Buffer(orig.length - start - howMany);\n            for (var i = start + howMany; i < orig.length; i++) {\n                buf1[ i - howMany - start ] = orig[i]\n            }\n            \n            if (reps.length > 0) {\n                var reps_ = reps.slice();\n                reps_.unshift(buf0);\n                reps_.push(buf1);\n                buffers.splice.apply(buffers, [ ii, 1 ].concat(reps_));\n                ii += reps_.length;\n                reps = [];\n            }\n            else {\n                buffers.splice(ii, 1, buf0, buf1);\n                //buffers[ii] = buf;\n                ii += 2;\n            }\n        }\n        else {\n            removed.push(buffers[ii].slice(start));\n            buffers[ii] = buffers[ii].slice(0, start);\n            ii ++;\n        }\n    }\n    \n    if (reps.length > 0) {\n        buffers.splice.apply(buffers, [ ii, 0 ].concat(reps));\n        ii += reps.length;\n    }\n    \n    while (removed.length < howMany) {\n        var buf = buffers[ii];\n        var len = buf.length;\n        var take = Math.min(len, howMany - removed.length);\n        \n        if (take === len) {\n            removed.push(buf);\n            buffers.splice(ii, 1);\n        }\n        else {\n            removed.push(buf.slice(0, take));\n            buffers[ii] = buffers[ii].slice(take);\n        }\n    }\n    \n    this.length -= removed.length;\n    \n    return removed;\n};\n \nBuffers.prototype.slice = function (i, j) {\n    var buffers = this.buffers;\n    if (j === undefined) j = this.length;\n    if (i === undefined) i = 0;\n    \n    if (j > this.length) j = this.length;\n    \n    var startBytes = 0;\n    for (\n        var si = 0;\n        si < buffers.length && startBytes + buffers[si].length <= i;\n        si ++\n    ) { startBytes += buffers[si].length }\n    \n    var target = new Buffer(j - i);\n    \n    var ti = 0;\n    for (var ii = si; ti < j - i && ii < buffers.length; ii++) {\n        var len = buffers[ii].length;\n        \n        var start = ti === 0 ? i - startBytes : 0;\n        var end = ti + len >= j - i\n            ? Math.min(start + (j - i) - ti, len)\n            : len\n        ;\n        \n        buffers[ii].copy(target, ti, start, end);\n        ti += end - start;\n    }\n    \n    return target;\n};\n\nBuffers.prototype.pos = function (i) {\n    if (i < 0 || i >= this.length) throw new Error('oob');\n    var l = i, bi = 0, bu = null;\n    for (;;) {\n        bu = this.buffers[bi];\n        if (l < bu.length) {\n            return {buf: bi, offset: l};\n        } else {\n            l -= bu.length;\n        }\n        bi++;\n    }\n};\n\nBuffers.prototype.get = function get (i) {\n    var pos = this.pos(i);\n\n    return this.buffers[pos.buf].get(pos.offset);\n};\n\nBuffers.prototype.set = function set (i, b) {\n    var pos = this.pos(i);\n\n    return this.buffers[pos.buf].set(pos.offset, b);\n};\n\nBuffers.prototype.indexOf = function (needle, offset) {\n    if (\"string\" === typeof needle) {\n        needle = new Buffer(needle);\n    } else if (needle instanceof Buffer) {\n        // already a buffer\n    } else {\n        throw new Error('Invalid type for a search string');\n    }\n\n    if (!needle.length) {\n        return 0;\n    }\n\n    if (!this.length) {\n        return -1;\n    }\n\n    var i = 0, j = 0, match = 0, mstart, pos = 0;\n\n    // start search from a particular point in the virtual buffer\n    if (offset) {\n        var p = this.pos(offset);\n        i = p.buf;\n        j = p.offset;\n        pos = offset;\n    }\n\n    // for each character in virtual buffer\n    for (;;) {\n        while (j >= this.buffers[i].length) {\n            j = 0;\n            i++;\n\n            if (i >= this.buffers.length) {\n                // search string not found\n                return -1;\n            }\n        }\n\n        var char = this.buffers[i][j];\n\n        if (char == needle[match]) {\n            // keep track where match started\n            if (match == 0) {\n                mstart = {\n                    i: i,\n                    j: j,\n                    pos: pos\n                };\n            }\n            match++;\n            if (match == needle.length) {\n                // full match\n                return mstart.pos;\n            }\n        } else if (match != 0) {\n            // a partial match ended, go back to match starting position\n            // this will continue the search at the next character\n            i = mstart.i;\n            j = mstart.j;\n            pos = mstart.pos;\n            match = 0;\n        }\n\n        j++;\n        pos++;\n    }\n};\n\nBuffers.prototype.toBuffer = function() {\n    return this.slice();\n}\n\nBuffers.prototype.toString = function(encoding, start, end) {\n    return this.slice(start, end).toString(encoding);\n}\n","module.exports = function (store) {\n    function getset (name, value) {\n        var node = vars.store;\n        var keys = name.split('.');\n        keys.slice(0,-1).forEach(function (k) {\n            if (node[k] === undefined) node[k] = {};\n            node = node[k]\n        });\n        var key = keys[keys.length - 1];\n        if (arguments.length == 1) {\n            return node[key];\n        }\n        else {\n            return node[key] = value;\n        }\n    }\n    \n    var vars = {\n        get : function (name) {\n            return getset(name);\n        },\n        set : function (name, value) {\n            return getset(name, value);\n        },\n        store : store || {},\n    };\n    return vars;\n};\n","var Chainsaw = require('chainsaw');\nvar EventEmitter = require('events').EventEmitter;\nvar Buffers = require('buffers');\nvar Vars = require('./lib/vars.js');\nvar Stream = require('stream').Stream;\n\nexports = module.exports = function (bufOrEm, eventName) {\n    if (Buffer.isBuffer(bufOrEm)) {\n        return exports.parse(bufOrEm);\n    }\n    \n    var s = exports.stream();\n    if (bufOrEm && bufOrEm.pipe) {\n        bufOrEm.pipe(s);\n    }\n    else if (bufOrEm) {\n        bufOrEm.on(eventName || 'data', function (buf) {\n            s.write(buf);\n        });\n        \n        bufOrEm.on('end', function () {\n            s.end();\n        });\n    }\n    return s;\n};\n\nexports.stream = function (input) {\n    if (input) return exports.apply(null, arguments);\n    \n    var pending = null;\n    function getBytes (bytes, cb, skip) {\n        pending = {\n            bytes : bytes,\n            skip : skip,\n            cb : function (buf) {\n                pending = null;\n                cb(buf);\n            },\n        };\n        dispatch();\n    }\n    \n    var offset = null;\n    function dispatch () {\n        if (!pending) {\n            if (caughtEnd) done = true;\n            return;\n        }\n        if (typeof pending === 'function') {\n            pending();\n        }\n        else {\n            var bytes = offset + pending.bytes;\n            \n            if (buffers.length >= bytes) {\n                var buf;\n                if (offset == null) {\n                    buf = buffers.splice(0, bytes);\n                    if (!pending.skip) {\n                        buf = buf.slice();\n                    }\n                }\n                else {\n                    if (!pending.skip) {\n                        buf = buffers.slice(offset, bytes);\n                    }\n                    offset = bytes;\n                }\n                \n                if (pending.skip) {\n                    pending.cb();\n                }\n                else {\n                    pending.cb(buf);\n                }\n            }\n        }\n    }\n    \n    function builder (saw) {\n        function next () { if (!done) saw.next() }\n        \n        var self = words(function (bytes, cb) {\n            return function (name) {\n                getBytes(bytes, function (buf) {\n                    vars.set(name, cb(buf));\n                    next();\n                });\n            };\n        });\n        \n        self.tap = function (cb) {\n            saw.nest(cb, vars.store);\n        };\n        \n        self.into = function (key, cb) {\n            if (!vars.get(key)) vars.set(key, {});\n            var parent = vars;\n            vars = Vars(parent.get(key));\n            \n            saw.nest(function () {\n                cb.apply(this, arguments);\n                this.tap(function () {\n                    vars = parent;\n                });\n            }, vars.store);\n        };\n        \n        self.flush = function () {\n            vars.store = {};\n            next();\n        };\n        \n        self.loop = function (cb) {\n            var end = false;\n            \n            saw.nest(false, function loop () {\n                this.vars = vars.store;\n                cb.call(this, function () {\n                    end = true;\n                    next();\n                }, vars.store);\n                this.tap(function () {\n                    if (end) saw.next()\n                    else loop.call(this)\n                }.bind(this));\n            }, vars.store);\n        };\n        \n        self.buffer = function (name, bytes) {\n            if (typeof bytes === 'string') {\n                bytes = vars.get(bytes);\n            }\n            \n            getBytes(bytes, function (buf) {\n                vars.set(name, buf);\n                next();\n            });\n        };\n        \n        self.skip = function (bytes) {\n            if (typeof bytes === 'string') {\n                bytes = vars.get(bytes);\n            }\n            \n            getBytes(bytes, function () {\n                next();\n            });\n        };\n        \n        self.scan = function find (name, search) {\n            if (typeof search === 'string') {\n                search = new Buffer(search);\n            }\n            else if (!Buffer.isBuffer(search)) {\n                throw new Error('search must be a Buffer or a string');\n            }\n            \n            var taken = 0;\n            pending = function () {\n                var pos = buffers.indexOf(search, offset + taken);\n                var i = pos-offset-taken;\n                if (pos !== -1) {\n                    pending = null;\n                    if (offset != null) {\n                        vars.set(\n                            name,\n                            buffers.slice(offset, offset + taken + i)\n                        );\n                        offset += taken + i + search.length;\n                    }\n                    else {\n                        vars.set(\n                            name,\n                            buffers.slice(0, taken + i)\n                        );\n                        buffers.splice(0, taken + i + search.length);\n                    }\n                    next();\n                    dispatch();\n                } else {\n                    i = Math.max(buffers.length - search.length - offset - taken, 0);\n\t\t\t\t}\n                taken += i;\n            };\n            dispatch();\n        };\n        \n        self.peek = function (cb) {\n            offset = 0;\n            saw.nest(function () {\n                cb.call(this, vars.store);\n                this.tap(function () {\n                    offset = null;\n                });\n            });\n        };\n        \n        return self;\n    };\n    \n    var stream = Chainsaw.light(builder);\n    stream.writable = true;\n    \n    var buffers = Buffers();\n    \n    stream.write = function (buf) {\n        buffers.push(buf);\n        dispatch();\n    };\n    \n    var vars = Vars();\n    \n    var done = false, caughtEnd = false;\n    stream.end = function () {\n        caughtEnd = true;\n    };\n    \n    stream.pipe = Stream.prototype.pipe;\n    Object.getOwnPropertyNames(EventEmitter.prototype).forEach(function (name) {\n        stream[name] = EventEmitter.prototype[name];\n    });\n    \n    return stream;\n};\n\nexports.parse = function parse (buffer) {\n    var self = words(function (bytes, cb) {\n        return function (name) {\n            if (offset + bytes <= buffer.length) {\n                var buf = buffer.slice(offset, offset + bytes);\n                offset += bytes;\n                vars.set(name, cb(buf));\n            }\n            else {\n                vars.set(name, null);\n            }\n            return self;\n        };\n    });\n    \n    var offset = 0;\n    var vars = Vars();\n    self.vars = vars.store;\n    \n    self.tap = function (cb) {\n        cb.call(self, vars.store);\n        return self;\n    };\n    \n    self.into = function (key, cb) {\n        if (!vars.get(key)) {\n            vars.set(key, {});\n        }\n        var parent = vars;\n        vars = Vars(parent.get(key));\n        cb.call(self, vars.store);\n        vars = parent;\n        return self;\n    };\n    \n    self.loop = function (cb) {\n        var end = false;\n        var ender = function () { end = true };\n        while (end === false) {\n            cb.call(self, ender, vars.store);\n        }\n        return self;\n    };\n    \n    self.buffer = function (name, size) {\n        if (typeof size === 'string') {\n            size = vars.get(size);\n        }\n        var buf = buffer.slice(offset, Math.min(buffer.length, offset + size));\n        offset += size;\n        vars.set(name, buf);\n        \n        return self;\n    };\n    \n    self.skip = function (bytes) {\n        if (typeof bytes === 'string') {\n            bytes = vars.get(bytes);\n        }\n        offset += bytes;\n        \n        return self;\n    };\n    \n    self.scan = function (name, search) {\n        if (typeof search === 'string') {\n            search = new Buffer(search);\n        }\n        else if (!Buffer.isBuffer(search)) {\n            throw new Error('search must be a Buffer or a string');\n        }\n        vars.set(name, null);\n        \n        // simple but slow string search\n        for (var i = 0; i + offset <= buffer.length - search.length + 1; i++) {\n            for (\n                var j = 0;\n                j < search.length && buffer[offset+i+j] === search[j];\n                j++\n            );\n            if (j === search.length) break;\n        }\n        \n        vars.set(name, buffer.slice(offset, offset + i));\n        offset += i + search.length;\n        return self;\n    };\n    \n    self.peek = function (cb) {\n        var was = offset;\n        cb.call(self, vars.store);\n        offset = was;\n        return self;\n    };\n    \n    self.flush = function () {\n        vars.store = {};\n        return self;\n    };\n    \n    self.eof = function () {\n        return offset >= buffer.length;\n    };\n    \n    return self;\n};\n\n// convert byte strings to unsigned little endian numbers\nfunction decodeLEu (bytes) {\n    var acc = 0;\n    for (var i = 0; i < bytes.length; i++) {\n        acc += Math.pow(256,i) * bytes[i];\n    }\n    return acc;\n}\n\n// convert byte strings to unsigned big endian numbers\nfunction decodeBEu (bytes) {\n    var acc = 0;\n    for (var i = 0; i < bytes.length; i++) {\n        acc += Math.pow(256, bytes.length - i - 1) * bytes[i];\n    }\n    return acc;\n}\n\n// convert byte strings to signed big endian numbers\nfunction decodeBEs (bytes) {\n    var val = decodeBEu(bytes);\n    if ((bytes[0] & 0x80) == 0x80) {\n        val -= Math.pow(256, bytes.length);\n    }\n    return val;\n}\n\n// convert byte strings to signed little endian numbers\nfunction decodeLEs (bytes) {\n    var val = decodeLEu(bytes);\n    if ((bytes[bytes.length - 1] & 0x80) == 0x80) {\n        val -= Math.pow(256, bytes.length);\n    }\n    return val;\n}\n\nfunction words (decode) {\n    var self = {};\n    \n    [ 1, 2, 4, 8 ].forEach(function (bytes) {\n        var bits = bytes * 8;\n        \n        self['word' + bits + 'le']\n        = self['word' + bits + 'lu']\n        = decode(bytes, decodeLEu);\n        \n        self['word' + bits + 'ls']\n        = decode(bytes, decodeLEs);\n        \n        self['word' + bits + 'be']\n        = self['word' + bits + 'bu']\n        = decode(bytes, decodeBEu);\n        \n        self['word' + bits + 'bs']\n        = decode(bytes, decodeBEs);\n    });\n    \n    // word8be(n) == word8le(n) for all n\n    self.word8 = self.word8u = self.word8be;\n    self.word8s = self.word8bs;\n    \n    return self;\n}\n","var Transform = require('stream').Transform;\nvar util = require('util');\n\nfunction MatcherStream(patternDesc, matchFn) {\n    if (!(this instanceof MatcherStream)) {\n        return new MatcherStream();\n    }\n\n    Transform.call(this);\n\n    var p = typeof patternDesc === 'object' ? patternDesc.pattern : patternDesc;\n\n    this.pattern = Buffer.isBuffer(p) ? p : Buffer.from(p);\n    this.requiredLength = this.pattern.length;\n    if (patternDesc.requiredExtraSize) this.requiredLength += patternDesc.requiredExtraSize;\n\n    this.data = new Buffer('');\n    this.bytesSoFar = 0;\n\n    this.matchFn = matchFn;\n}\n\nutil.inherits(MatcherStream, Transform);\n\nMatcherStream.prototype.checkDataChunk = function (ignoreMatchZero) {\n    var enoughData = this.data.length >= this.requiredLength; // strict more than ?\n    if (!enoughData) { return; }\n\n    var matchIndex = this.data.indexOf(this.pattern, ignoreMatchZero ? 1 : 0);\n    if (matchIndex >= 0 && matchIndex + this.requiredLength > this.data.length) {\n        if (matchIndex > 0) {\n            var packet = this.data.slice(0, matchIndex);\n            this.push(packet);\n            this.bytesSoFar += matchIndex;\n            this.data = this.data.slice(matchIndex);\n        }\n        return;\n    }\n\n    if (matchIndex === -1) {\n        var packetLen = this.data.length - this.requiredLength + 1;\n\n        var packet = this.data.slice(0, packetLen);\n        this.push(packet);\n        this.bytesSoFar += packetLen;\n        this.data = this.data.slice(packetLen);\n        return;\n    }\n\n    // found match\n    if (matchIndex > 0) {\n        var packet = this.data.slice(0, matchIndex);\n        this.data = this.data.slice(matchIndex);\n        this.push(packet);\n        this.bytesSoFar += matchIndex;\n    }\n\n    var finished = this.matchFn ? this.matchFn(this.data, this.bytesSoFar) : true;\n    if (finished) {\n        this.data = new Buffer('');\n        return;\n    }\n\n    return true;\n}\n\nMatcherStream.prototype._transform = function (chunk, encoding, cb) {\n    this.data = Buffer.concat([this.data, chunk]);\n\n    var firstIteration = true;\n    while (this.checkDataChunk(!firstIteration)) {\n        firstIteration = false;\n    }\n\n    cb();\n}\n\nMatcherStream.prototype._flush = function (cb) {\n    if (this.data.length > 0) {\n        var firstIteration = true;\n        while (this.checkDataChunk(!firstIteration)) {\n            firstIteration = false;\n        }\n    }\n\n    if (this.data.length > 0) {\n        this.push(this.data);\n        this.data = null;\n    }\n\n    cb();\n}\n\nmodule.exports = MatcherStream;","'use strict';\n\nvar stream = require('stream');\nvar inherits = require('util').inherits;\n\nfunction Entry() {\n    if (!(this instanceof Entry)) {\n        return new Entry();\n    }\n\n    stream.PassThrough.call(this);\n\n    this.path = null;\n    this.type = null;\n    this.isDirectory = false;\n}\n\ninherits(Entry, stream.PassThrough);\n\nEntry.prototype.autodrain = function () {\n    return this.pipe(new stream.Transform({ transform: function (d, e, cb) { cb(); } }));\n}\n\nmodule.exports = Entry;","'use strict';\n\nvar binary = require('binary');\nvar stream = require('stream');\nvar util = require('util');\nvar zlib = require('zlib');\nvar MatcherStream = require('./matcher-stream');\nvar Entry = require('./entry');\n\nconst states = {\n    STREAM_START:                         0,\n    START:                                1,\n    LOCAL_FILE_HEADER:                    2,\n    LOCAL_FILE_HEADER_SUFFIX:             3,\n    FILE_DATA:                            4,\n    FILE_DATA_END:                        5,\n    DATA_DESCRIPTOR:                      6,\n    CENTRAL_DIRECTORY_FILE_HEADER:        7,\n    CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX: 8,\n    CDIR64_END:                           9,\n    CDIR64_END_DATA_SECTOR:               10,\n    CDIR64_LOCATOR:                       11,\n    CENTRAL_DIRECTORY_END:                12,\n    CENTRAL_DIRECTORY_END_COMMENT:        13,\n    TRAILING_JUNK:                        14,\n\n    ERROR: 99\n}\n\nconst FOUR_GIGS = 4294967296;\n\nconst SIG_LOCAL_FILE_HEADER  = 0x04034b50;\nconst SIG_DATA_DESCRIPTOR    = 0x08074b50;\nconst SIG_CDIR_RECORD        = 0x02014b50;\nconst SIG_CDIR64_RECORD_END  = 0x06064b50;\nconst SIG_CDIR64_LOCATOR_END = 0x07064b50;\nconst SIG_CDIR_RECORD_END    = 0x06054b50;\n\nfunction UnzipStream(options) {\n    if (!(this instanceof UnzipStream)) {\n        return new UnzipStream(options);\n    }\n\n    stream.Transform.call(this);\n\n    this.options = options || {};\n    this.data = new Buffer('');\n    this.state = states.STREAM_START;\n    this.skippedBytes = 0;\n    this.parsedEntity = null;\n    this.outStreamInfo = {};\n}\n\nutil.inherits(UnzipStream, stream.Transform);\n\nUnzipStream.prototype.processDataChunk = function (chunk) {\n    var requiredLength;\n\n    switch (this.state) {\n        case states.STREAM_START:\n        case states.START:\n            requiredLength = 4;\n            break;\n        case states.LOCAL_FILE_HEADER:\n            requiredLength = 26;\n            break;\n        case states.LOCAL_FILE_HEADER_SUFFIX:\n            requiredLength = this.parsedEntity.fileNameLength + this.parsedEntity.extraFieldLength;\n            break;\n        case states.DATA_DESCRIPTOR:\n            requiredLength = 12;\n            break;\n        case states.CENTRAL_DIRECTORY_FILE_HEADER:\n            requiredLength = 42;\n            break;\n        case states.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:\n            requiredLength = this.parsedEntity.fileNameLength + this.parsedEntity.extraFieldLength + this.parsedEntity.fileCommentLength;\n            break;\n        case states.CDIR64_END:\n            requiredLength = 52;\n            break;\n        case states.CDIR64_END_DATA_SECTOR:\n            requiredLength = this.parsedEntity.centralDirectoryRecordSize - 44;\n            break;\n        case states.CDIR64_LOCATOR:\n            requiredLength = 16;\n            break;\n        case states.CENTRAL_DIRECTORY_END:\n            requiredLength = 18;\n            break;\n        case states.CENTRAL_DIRECTORY_END_COMMENT:\n            requiredLength = this.parsedEntity.commentLength;\n            break;\n        case states.FILE_DATA:\n            return 0;\n        case states.FILE_DATA_END:\n            return 0;\n        case states.TRAILING_JUNK:\n            if (this.options.debug) console.log(\"found\", chunk.length, \"bytes of TRAILING_JUNK\");\n            return chunk.length;\n        default:\n            return chunk.length;\n    }\n\n    var chunkLength = chunk.length;\n    if (chunkLength < requiredLength) {\n        return 0;\n    }\n\n    switch (this.state) {\n        case states.STREAM_START:\n        case states.START:\n            var signature = chunk.readUInt32LE(0);\n            switch (signature) {\n                case SIG_LOCAL_FILE_HEADER:\n                    this.state = states.LOCAL_FILE_HEADER;\n                    break;\n                case SIG_CDIR_RECORD:\n                    this.state = states.CENTRAL_DIRECTORY_FILE_HEADER;\n                    break;\n                case SIG_CDIR64_RECORD_END:\n                    this.state = states.CDIR64_END;\n                    break;\n                case SIG_CDIR64_LOCATOR_END:\n                    this.state = states.CDIR64_LOCATOR;\n                    break;\n                case SIG_CDIR_RECORD_END:\n                    this.state = states.CENTRAL_DIRECTORY_END;\n                    break;\n                default:\n                    var isStreamStart = this.state === states.STREAM_START;\n                    if (!isStreamStart && (signature & 0xffff) !== 0x4b50 && this.skippedBytes < 26) {\n                        // we'll allow a padding of max 28 bytes\n                        var remaining = signature;\n                        var toSkip = 4;\n                        for (var i = 1; i < 4 && remaining !== 0; i++) {\n                            remaining = remaining >>> 8;\n                            if ((remaining & 0xff) === 0x50) {\n                                toSkip = i;\n                                break;\n                            }\n                        }\n                        this.skippedBytes += toSkip;\n                        if (this.options.debug) console.log('Skipped', this.skippedBytes, 'bytes');\n                        return toSkip;\n                    }\n                    this.state = states.ERROR;\n                    var errMsg = isStreamStart ? \"Not a valid zip file\" : \"Invalid signature in zip file\";\n                    if (this.options.debug) {\n                        var sig = chunk.readUInt32LE(0);\n                        var asString;\n                        try { asString = chunk.slice(0, 4).toString(); } catch (e) {}\n                        console.log(\"Unexpected signature in zip file: 0x\" + sig.toString(16), '\"' + asString + '\", skipped', this.skippedBytes, 'bytes');\n                    }\n                    this.emit(\"error\", new Error(errMsg));\n                    return chunk.length;\n            }\n            this.skippedBytes = 0;\n            return requiredLength;\n\n        case states.LOCAL_FILE_HEADER:\n            this.parsedEntity = this._readFile(chunk);\n            this.state = states.LOCAL_FILE_HEADER_SUFFIX;\n\n            return requiredLength;\n\n        case states.LOCAL_FILE_HEADER_SUFFIX:\n            var entry = new Entry();\n            var isUtf8 = (this.parsedEntity.flags & 0x800) !== 0;\n            entry.path = this._decodeString(chunk.slice(0, this.parsedEntity.fileNameLength), isUtf8);\n            var extraDataBuffer = chunk.slice(this.parsedEntity.fileNameLength, this.parsedEntity.fileNameLength + this.parsedEntity.extraFieldLength);\n            var extra = this._readExtraFields(extraDataBuffer);\n            if (extra && extra.parsed) {\n                if (extra.parsed.path && !isUtf8) {\n                    entry.path = extra.parsed.path;\n                }\n                if (Number.isFinite(extra.parsed.uncompressedSize) && this.parsedEntity.uncompressedSize === FOUR_GIGS-1) {\n                    this.parsedEntity.uncompressedSize = extra.parsed.uncompressedSize;\n                }\n                if (Number.isFinite(extra.parsed.compressedSize) && this.parsedEntity.compressedSize === FOUR_GIGS-1) {\n                    this.parsedEntity.compressedSize = extra.parsed.compressedSize;\n                }\n            }\n            this.parsedEntity.extra = extra.parsed || {};\n\n            if (this.options.debug) {\n                const debugObj = Object.assign({}, this.parsedEntity, {\n                    path: entry.path,\n                    flags: '0x' + this.parsedEntity.flags.toString(16),\n                    extraFields: extra && extra.debug\n                });\n                console.log(\"decoded LOCAL_FILE_HEADER:\", JSON.stringify(debugObj, null, 2));\n            }\n            this._prepareOutStream(this.parsedEntity, entry);\n\n            this.emit(\"entry\", entry);\n\n            this.state = states.FILE_DATA;\n\n            return requiredLength;\n\n        case states.CENTRAL_DIRECTORY_FILE_HEADER:\n            this.parsedEntity = this._readCentralDirectoryEntry(chunk);\n            this.state = states.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX;\n\n            return requiredLength;\n\n        case states.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:\n            // got file name in chunk[0..]\n            var isUtf8 = (this.parsedEntity.flags & 0x800) !== 0;\n            var path = this._decodeString(chunk.slice(0, this.parsedEntity.fileNameLength), isUtf8);\n            var extraDataBuffer = chunk.slice(this.parsedEntity.fileNameLength, this.parsedEntity.fileNameLength + this.parsedEntity.extraFieldLength);\n            var extra = this._readExtraFields(extraDataBuffer);\n            if (extra && extra.parsed && extra.parsed.path && !isUtf8) {\n                path = extra.parsed.path;\n            }\n            this.parsedEntity.extra = extra.parsed;\n\n            var isUnix = ((this.parsedEntity.versionMadeBy & 0xff00) >> 8) === 3;\n            var unixAttrs, isSymlink;\n            if (isUnix) {\n                unixAttrs = this.parsedEntity.externalFileAttributes >>> 16;\n                var fileType = unixAttrs >>> 12;\n                isSymlink = (fileType & 0o12) === 0o12; // __S_IFLNK\n            }\n            if (this.options.debug) {\n                const debugObj = Object.assign({}, this.parsedEntity, {\n                    path: path,\n                    flags: '0x' + this.parsedEntity.flags.toString(16),\n                    unixAttrs: unixAttrs && '0' + unixAttrs.toString(8),\n                    isSymlink: isSymlink,\n                    extraFields: extra.debug,\n                });\n                console.log(\"decoded CENTRAL_DIRECTORY_FILE_HEADER:\", JSON.stringify(debugObj, null, 2));\n            }\n            this.state = states.START;\n\n            return requiredLength;\n\n        case states.CDIR64_END:\n            this.parsedEntity = this._readEndOfCentralDirectory64(chunk);\n            if (this.options.debug) {\n                console.log(\"decoded CDIR64_END_RECORD:\", this.parsedEntity);\n            }\n            this.state = states.CDIR64_END_DATA_SECTOR;\n\n            return requiredLength;\n\n        case states.CDIR64_END_DATA_SECTOR:\n            this.state = states.START;\n\n            return requiredLength;\n\n        case states.CDIR64_LOCATOR:\n            // ignore, nothing interesting\n            this.state = states.START;\n\n            return requiredLength;\n\n        case states.CENTRAL_DIRECTORY_END:\n            this.parsedEntity = this._readEndOfCentralDirectory(chunk);\n            if (this.options.debug) {\n                console.log(\"decoded CENTRAL_DIRECTORY_END:\", this.parsedEntity);\n            }\n            this.state = states.CENTRAL_DIRECTORY_END_COMMENT;\n\n            return requiredLength;\n\n        case states.CENTRAL_DIRECTORY_END_COMMENT:\n            if (this.options.debug) {\n                console.log(\"decoded CENTRAL_DIRECTORY_END_COMMENT:\", chunk.slice(0, requiredLength).toString());\n            }\n            this.state = states.TRAILING_JUNK;\n\n            return requiredLength;\n\n        case states.ERROR:\n            return chunk.length; // discard\n\n        default:\n            console.log(\"didn't handle state #\", this.state, \"discarding\");\n            return chunk.length;\n    }\n}\n\nUnzipStream.prototype._prepareOutStream = function (vars, entry) {\n    var self = this;\n\n    var isDirectory = vars.uncompressedSize === 0 && /[\\/\\\\]$/.test(entry.path);\n    // protect against malicious zip files which want to extract to parent dirs\n    entry.path = entry.path.replace(/(?<=^|[/\\\\]+)[.][.]+(?=[/\\\\]+|$)/g, \".\");\n    entry.type = isDirectory ? 'Directory' : 'File';\n    entry.isDirectory = isDirectory;\n\n    var fileSizeKnown = !(vars.flags & 0x08);\n    if (fileSizeKnown) {\n        entry.size = vars.uncompressedSize;\n    }\n\n    var isVersionSupported = vars.versionsNeededToExtract <= 45;\n\n    this.outStreamInfo = {\n        stream: null,\n        limit: fileSizeKnown ? vars.compressedSize : -1,\n        written: 0\n    };\n\n    if (!fileSizeKnown) {\n        var pattern = new Buffer(4);\n        pattern.writeUInt32LE(SIG_DATA_DESCRIPTOR, 0);\n        var zip64Mode = vars.extra.zip64Mode;\n        var extraSize = zip64Mode ? 20 : 12;\n        var searchPattern = {\n            pattern: pattern,\n            requiredExtraSize: extraSize\n        }\n\n        var matcherStream = new MatcherStream(searchPattern, function (matchedChunk, sizeSoFar) {\n            var vars = self._readDataDescriptor(matchedChunk, zip64Mode);\n\n            var compressedSizeMatches = vars.compressedSize === sizeSoFar;\n            // let's also deal with archives with 4GiB+ files without zip64\n            if (!zip64Mode && !compressedSizeMatches && sizeSoFar >= FOUR_GIGS) {\n                var overflown = sizeSoFar - FOUR_GIGS;\n                while (overflown >= 0) {\n                    compressedSizeMatches = vars.compressedSize === overflown;\n                    if (compressedSizeMatches) break;\n                    overflown -= FOUR_GIGS;\n                }\n            }\n            if (!compressedSizeMatches) { return; }\n\n            self.state = states.FILE_DATA_END;\n            var sliceOffset = zip64Mode ? 24 : 16;\n            if (self.data.length > 0) {\n                self.data = Buffer.concat([matchedChunk.slice(sliceOffset), self.data]);\n            } else {\n                self.data = matchedChunk.slice(sliceOffset);\n            }\n\n            return true;\n        });\n        this.outStreamInfo.stream = matcherStream;\n    } else {\n        this.outStreamInfo.stream = new stream.PassThrough();\n    }\n\n    var isEncrypted = (vars.flags & 0x01) || (vars.flags & 0x40);\n    if (isEncrypted || !isVersionSupported) {\n        var message = isEncrypted ? \"Encrypted files are not supported!\"\n            : (\"Zip version \" + Math.floor(vars.versionsNeededToExtract / 10) + \".\" + vars.versionsNeededToExtract % 10 + \" is not supported\");\n\n        entry.skip = true;\n        setImmediate(() => {\n            self.emit('error', new Error(message));\n        });\n\n        // try to skip over this entry\n        this.outStreamInfo.stream.pipe(new Entry().autodrain());\n        return;\n    }\n\n    var isCompressed = vars.compressionMethod > 0;\n    if (isCompressed) {\n        var inflater = zlib.createInflateRaw();\n        inflater.on('error', function (err) {\n            self.state = states.ERROR;\n            self.emit('error', err);\n        });\n        this.outStreamInfo.stream.pipe(inflater).pipe(entry);\n    } else {\n        this.outStreamInfo.stream.pipe(entry);\n    }\n\n    if (this._drainAllEntries) {\n        entry.autodrain();\n    }\n}\n\nUnzipStream.prototype._readFile = function (data) {\n    var vars = binary.parse(data)\n        .word16lu('versionsNeededToExtract')\n        .word16lu('flags')\n        .word16lu('compressionMethod')\n        .word16lu('lastModifiedTime')\n        .word16lu('lastModifiedDate')\n        .word32lu('crc32')\n        .word32lu('compressedSize')\n        .word32lu('uncompressedSize')\n        .word16lu('fileNameLength')\n        .word16lu('extraFieldLength')\n        .vars;\n\n    return vars;\n}\n\nUnzipStream.prototype._readExtraFields = function (data) {\n    var extra = {};\n    var result = { parsed: extra };\n    if (this.options.debug) {\n        result.debug = [];\n    }\n    var index = 0;\n    while (index < data.length) {\n        var vars = binary.parse(data)\n            .skip(index)\n            .word16lu('extraId')\n            .word16lu('extraSize')\n            .vars;\n\n        index += 4;\n\n        var fieldType = undefined;\n        switch (vars.extraId) {\n            case 0x0001:\n                fieldType = \"Zip64 extended information extra field\";\n                var z64vars = binary.parse(data.slice(index, index+vars.extraSize))\n                    .word64lu('uncompressedSize')\n                    .word64lu('compressedSize')\n                    .word64lu('offsetToLocalHeader')\n                    .word32lu('diskStartNumber')\n                    .vars;\n                if (z64vars.uncompressedSize !== null) {\n                    extra.uncompressedSize = z64vars.uncompressedSize;\n                }\n                if (z64vars.compressedSize !== null) {\n                    extra.compressedSize = z64vars.compressedSize;\n                }\n                extra.zip64Mode = true;\n                break;\n            case 0x000a:\n                fieldType = \"NTFS extra field\";\n                break;\n            case 0x5455:\n                fieldType = \"extended timestamp\";\n                var timestampFields = data.readUInt8(index);\n                var offset = 1;\n                if (vars.extraSize >= offset + 4 && timestampFields & 1) {\n                    extra.mtime = new Date(data.readUInt32LE(index + offset) * 1000);\n                    offset += 4;\n                }\n                if (vars.extraSize >= offset + 4 && timestampFields & 2) {\n                    extra.atime = new Date(data.readUInt32LE(index + offset) * 1000);\n                    offset += 4;\n                }\n                if (vars.extraSize >= offset + 4 && timestampFields & 4) {\n                    extra.ctime = new Date(data.readUInt32LE(index + offset) * 1000);\n                }\n                break;\n            case 0x7075:\n                fieldType = \"Info-ZIP Unicode Path Extra Field\";\n                var fieldVer = data.readUInt8(index);\n                if (fieldVer === 1) {\n                    var offset = 1;\n                    // TODO: should be checking this against our path buffer\n                    var nameCrc32 = data.readUInt32LE(index + offset);\n                    offset += 4;\n                    var pathBuffer = data.slice(index + offset);\n                    extra.path = pathBuffer.toString();\n                }\n                break;\n            case 0x000d:\n            case 0x5855:\n                fieldType = vars.extraId === 0x000d ? \"PKWARE Unix\" : \"Info-ZIP UNIX (type 1)\";\n                var offset = 0;\n                if (vars.extraSize >= 8) {\n                    var atime = new Date(data.readUInt32LE(index + offset) * 1000);\n                    offset += 4;\n                    var mtime = new Date(data.readUInt32LE(index + offset) * 1000);\n                    offset += 4;\n                    extra.atime = atime;\n                    extra.mtime = mtime;\n\n                    if (vars.extraSize >= 12) {\n                        var uid = data.readUInt16LE(index + offset);\n                        offset += 2;\n                        var gid = data.readUInt16LE(index + offset);\n                        offset += 2;\n                        extra.uid = uid;\n                        extra.gid = gid;\n                    }\n                }\n                break;\n            case 0x7855:\n                fieldType = \"Info-ZIP UNIX (type 2)\";\n                var offset = 0;\n                if (vars.extraSize >= 4) {\n                    var uid = data.readUInt16LE(index + offset);\n                    offset += 2;\n                    var gid = data.readUInt16LE(index + offset);\n                    offset += 2;\n                    extra.uid = uid;\n                    extra.gid = gid;\n                }\n                break;\n            case 0x7875:\n                fieldType = \"Info-ZIP New Unix\";\n                var offset = 0;\n                var extraVer = data.readUInt8(index);\n                offset += 1;\n                if (extraVer === 1) {\n                    var uidSize = data.readUInt8(index + offset);\n                    offset += 1;\n                    if (uidSize <= 6) {\n                        extra.uid = data.readUIntLE(index + offset, uidSize);\n                    }\n                    offset += uidSize;\n\n                    var gidSize = data.readUInt8(index + offset);\n                    offset += 1;\n                    if (gidSize <= 6) {\n                        extra.gid = data.readUIntLE(index + offset, gidSize);\n                    }\n                }\n                break;\n            case 0x756e:\n                fieldType = \"ASi Unix\";\n                var offset = 0;\n                if (vars.extraSize >= 14) {\n                    var crc = data.readUInt32LE(index + offset);\n                    offset += 4;\n                    var mode = data.readUInt16LE(index + offset);\n                    offset += 2;\n                    var sizdev = data.readUInt32LE(index + offset);\n                    offset += 4;\n                    var uid = data.readUInt16LE(index + offset);\n                    offset += 2;\n                    var gid = data.readUInt16LE(index + offset);\n                    offset += 2;\n                    extra.mode = mode;\n                    extra.uid = uid;\n                    extra.gid = gid;\n                    if (vars.extraSize > 14) {\n                        var start = index + offset;\n                        var end = index + vars.extraSize - 14;\n                        var symlinkName = this._decodeString(data.slice(start, end));\n                        extra.symlink = symlinkName;\n                    }\n                }\n                break;\n        }\n\n        if (this.options.debug) {\n            result.debug.push({\n                extraId: '0x' + vars.extraId.toString(16),\n                description: fieldType,\n                data: data.slice(index, index + vars.extraSize).inspect()\n            });\n        }\n\n        index += vars.extraSize;\n    }\n\n    return result;\n}\n\nUnzipStream.prototype._readDataDescriptor = function (data, zip64Mode) {\n    if (zip64Mode) {\n        var vars = binary.parse(data)\n            .word32lu('dataDescriptorSignature')\n            .word32lu('crc32')\n            .word64lu('compressedSize')\n            .word64lu('uncompressedSize')\n            .vars;\n\n        return vars;\n    }\n\n    var vars = binary.parse(data)\n        .word32lu('dataDescriptorSignature')\n        .word32lu('crc32')\n        .word32lu('compressedSize')\n        .word32lu('uncompressedSize')\n        .vars;\n\n    return vars;\n}\n\nUnzipStream.prototype._readCentralDirectoryEntry = function (data) {\n    var vars = binary.parse(data)\n        .word16lu('versionMadeBy')\n        .word16lu('versionsNeededToExtract')\n        .word16lu('flags')\n        .word16lu('compressionMethod')\n        .word16lu('lastModifiedTime')\n        .word16lu('lastModifiedDate')\n        .word32lu('crc32')\n        .word32lu('compressedSize')\n        .word32lu('uncompressedSize')\n        .word16lu('fileNameLength')\n        .word16lu('extraFieldLength')\n        .word16lu('fileCommentLength')\n        .word16lu('diskNumber')\n        .word16lu('internalFileAttributes')\n        .word32lu('externalFileAttributes')\n        .word32lu('offsetToLocalFileHeader')\n        .vars;\n\n    return vars;\n}\n\nUnzipStream.prototype._readEndOfCentralDirectory64 = function (data) {\n    var vars = binary.parse(data)\n        .word64lu('centralDirectoryRecordSize')\n        .word16lu('versionMadeBy')\n        .word16lu('versionsNeededToExtract')\n        .word32lu('diskNumber')\n        .word32lu('diskNumberWithCentralDirectoryStart')\n        .word64lu('centralDirectoryEntries')\n        .word64lu('totalCentralDirectoryEntries')\n        .word64lu('sizeOfCentralDirectory')\n        .word64lu('offsetToStartOfCentralDirectory')\n        .vars;\n\n    return vars;\n}\n\nUnzipStream.prototype._readEndOfCentralDirectory = function (data) {\n    var vars = binary.parse(data)\n        .word16lu('diskNumber')\n        .word16lu('diskStart')\n        .word16lu('centralDirectoryEntries')\n        .word16lu('totalCentralDirectoryEntries')\n        .word32lu('sizeOfCentralDirectory')\n        .word32lu('offsetToStartOfCentralDirectory')\n        .word16lu('commentLength')\n        .vars;\n\n    return vars;\n}\n\nconst cp437 = '\\u0000☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&\\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ';\n\nUnzipStream.prototype._decodeString = function (buffer, isUtf8) {\n    if (isUtf8) {\n        return buffer.toString('utf8');\n    }\n    // allow passing custom decoder\n    if (this.options.decodeString) {\n        return this.options.decodeString(buffer);\n    }\n    let result = \"\";\n    for (var i=0; i 0) {\n        this.data = this.data.slice(consume);\n        if (this.data.length === 0) break;\n    }\n\n    if (this.state === states.FILE_DATA) {\n        if (this.outStreamInfo.limit >= 0) {\n            var remaining = this.outStreamInfo.limit - this.outStreamInfo.written;\n            var packet;\n            if (remaining < this.data.length) {\n                packet = this.data.slice(0, remaining);\n                this.data = this.data.slice(remaining);\n            } else {\n                packet = this.data;\n                this.data = new Buffer('');\n            }\n\n            this.outStreamInfo.written += packet.length;\n            if (this.outStreamInfo.limit === this.outStreamInfo.written) {\n                this.state = states.START;\n\n                this.outStreamInfo.stream.end(packet, encoding, cb);\n            } else {\n                this.outStreamInfo.stream.write(packet, encoding, cb);\n            }\n        } else {\n            var packet = this.data;\n            this.data = new Buffer('');\n\n            this.outStreamInfo.written += packet.length;\n            var outputStream = this.outStreamInfo.stream;\n            outputStream.write(packet, encoding, () => {\n                if (this.state === states.FILE_DATA_END) {\n                    this.state = states.START;\n                    return outputStream.end(cb);\n                }\n                cb();\n            });\n        }\n        // we've written to the output stream, letting that write deal with the callback\n        return;\n    }\n\n    cb();\n}\n\nUnzipStream.prototype.drainAll = function () {\n    this._drainAllEntries = true;\n}\n\nUnzipStream.prototype._transform = function (chunk, encoding, cb) {\n    var self = this;\n    if (self.data.length > 0) {\n        self.data = Buffer.concat([self.data, chunk]);\n    } else {\n        self.data = chunk;\n    }\n\n    var startDataLength = self.data.length;\n    var done = function () {\n        if (self.data.length > 0 && self.data.length < startDataLength) {\n            startDataLength = self.data.length;\n            self._parseOrOutput(encoding, done);\n            return;\n        }\n        cb();\n    };\n    self._parseOrOutput(encoding, done);\n}\n\nUnzipStream.prototype._flush = function (cb) {\n    var self = this;\n    if (self.data.length > 0) {\n        self._parseOrOutput('buffer', function () {\n            if (self.data.length > 0) return setImmediate(function () { self._flush(cb); });\n            cb();\n        });\n\n        return;\n    }\n\n    if (self.state === states.FILE_DATA) {\n        // uh oh, something went wrong\n        return cb(new Error(\"Stream finished in an invalid state, uncompression failed\"));\n    }\n\n    setImmediate(cb);\n}\n\nmodule.exports = UnzipStream;\n","var Transform = require('stream').Transform;\nvar util = require('util');\nvar UnzipStream = require('./unzip-stream');\n\nfunction ParserStream(opts) {\n    if (!(this instanceof ParserStream)) {\n        return new ParserStream(opts);\n    }\n\n    var transformOpts = opts || {};\n    Transform.call(this, { readableObjectMode: true });\n\n    this.opts = opts || {};\n    this.unzipStream = new UnzipStream(this.opts);\n\n    var self = this;\n    this.unzipStream.on('entry', function(entry) {\n        self.push(entry);\n    });\n    this.unzipStream.on('error', function(error) {\n        self.emit('error', error);\n    });\n}\n\nutil.inherits(ParserStream, Transform);\n\nParserStream.prototype._transform = function (chunk, encoding, cb) {\n    this.unzipStream.write(chunk, encoding, cb);\n}\n\nParserStream.prototype._flush = function (cb) {\n    var self = this;\n    this.unzipStream.end(function() {\n        process.nextTick(function() { self.emit('close'); });\n        cb();\n    });\n}\n\nParserStream.prototype.on = function(eventName, fn) {\n    if (eventName === 'entry') {\n        return Transform.prototype.on.call(this, 'data', fn);\n    }\n    return Transform.prototype.on.call(this, eventName, fn);\n}\n\nParserStream.prototype.drainAll = function () {\n    this.unzipStream.drainAll();\n    return this.pipe(new Transform({ objectMode: true, transform: function (d, e, cb) { cb(); } }));\n}\n\nmodule.exports = ParserStream;\n","var path = require('path');\nvar fs = require('fs');\nvar _0777 = parseInt('0777', 8);\n\nmodule.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;\n\nfunction mkdirP (p, opts, f, made) {\n    if (typeof opts === 'function') {\n        f = opts;\n        opts = {};\n    }\n    else if (!opts || typeof opts !== 'object') {\n        opts = { mode: opts };\n    }\n    \n    var mode = opts.mode;\n    var xfs = opts.fs || fs;\n    \n    if (mode === undefined) {\n        mode = _0777\n    }\n    if (!made) made = null;\n    \n    var cb = f || /* istanbul ignore next */ function () {};\n    p = path.resolve(p);\n    \n    xfs.mkdir(p, mode, function (er) {\n        if (!er) {\n            made = made || p;\n            return cb(null, made);\n        }\n        switch (er.code) {\n            case 'ENOENT':\n                /* istanbul ignore if */\n                if (path.dirname(p) === p) return cb(er);\n                mkdirP(path.dirname(p), opts, function (er, made) {\n                    /* istanbul ignore if */\n                    if (er) cb(er, made);\n                    else mkdirP(p, opts, cb, made);\n                });\n                break;\n\n            // In the case of any other error, just see if there's a dir\n            // there already.  If so, then hooray!  If not, then something\n            // is borked.\n            default:\n                xfs.stat(p, function (er2, stat) {\n                    // if the stat fails, then that's super weird.\n                    // let the original error be the failure reason.\n                    if (er2 || !stat.isDirectory()) cb(er, made)\n                    else cb(null, made);\n                });\n                break;\n        }\n    });\n}\n\nmkdirP.sync = function sync (p, opts, made) {\n    if (!opts || typeof opts !== 'object') {\n        opts = { mode: opts };\n    }\n    \n    var mode = opts.mode;\n    var xfs = opts.fs || fs;\n    \n    if (mode === undefined) {\n        mode = _0777\n    }\n    if (!made) made = null;\n\n    p = path.resolve(p);\n\n    try {\n        xfs.mkdirSync(p, mode);\n        made = made || p;\n    }\n    catch (err0) {\n        switch (err0.code) {\n            case 'ENOENT' :\n                made = sync(path.dirname(p), opts, made);\n                sync(p, opts, made);\n                break;\n\n            // In the case of any other error, just see if there's a dir\n            // there already.  If so, then hooray!  If not, then something\n            // is borked.\n            default:\n                var stat;\n                try {\n                    stat = xfs.statSync(p);\n                }\n                catch (err1) /* istanbul ignore next */ {\n                    throw err0;\n                }\n                /* istanbul ignore if */\n                if (!stat.isDirectory()) throw err0;\n                break;\n        }\n    }\n\n    return made;\n};\n","var fs = require('fs');\nvar path = require('path');\nvar util = require('util');\nvar mkdirp = require('mkdirp');\nvar Transform = require('stream').Transform;\nvar UnzipStream = require('./unzip-stream');\n\nfunction Extract (opts) {\n    if (!(this instanceof Extract))\n    return new Extract(opts);\n\n    Transform.call(this);\n\n    this.opts = opts || {};\n    this.unzipStream = new UnzipStream(this.opts);\n    this.unfinishedEntries = 0;\n    this.afterFlushWait = false;\n    this.createdDirectories = {};\n\n    var self = this;\n    this.unzipStream.on('entry', this._processEntry.bind(this));\n    this.unzipStream.on('error', function(error) {\n        self.emit('error', error);\n    });\n}\n\nutil.inherits(Extract, Transform);\n\nExtract.prototype._transform = function (chunk, encoding, cb) {\n    this.unzipStream.write(chunk, encoding, cb);\n}\n\nExtract.prototype._flush = function (cb) {\n    var self = this;\n\n    var allDone = function() {\n        process.nextTick(function() { self.emit('close'); });\n        cb();\n    }\n\n    this.unzipStream.end(function() {\n        if (self.unfinishedEntries > 0) {\n            self.afterFlushWait = true;\n            return self.on('await-finished', allDone);\n        }\n        allDone();\n    });\n}\n\nExtract.prototype._processEntry = function (entry) {\n    var self = this;\n    var destPath = path.join(this.opts.path, entry.path);\n    var directory = entry.isDirectory ? destPath : path.dirname(destPath);\n\n    this.unfinishedEntries++;\n\n    var writeFileFn = function() {\n        var pipedStream = fs.createWriteStream(destPath);\n\n        pipedStream.on('close', function() {\n            self.unfinishedEntries--;\n            self._notifyAwaiter();\n        });\n        pipedStream.on('error', function (error) {\n            self.emit('error', error);\n        });\n        entry.pipe(pipedStream);\n    }\n\n    if (this.createdDirectories[directory] || directory === '.') {\n        return writeFileFn();\n    }\n\n    // FIXME: calls to mkdirp can still be duplicated\n    mkdirp(directory, function(err) {\n        if (err) return self.emit('error', err);\n\n        self.createdDirectories[directory] = true;\n\n        if (entry.isDirectory) {\n            self.unfinishedEntries--;\n            self._notifyAwaiter();\n            return;\n        }\n\n        writeFileFn();\n    });\n}\n\nExtract.prototype._notifyAwaiter = function() {\n    if (this.afterFlushWait && this.unfinishedEntries === 0) {\n        this.emit('await-finished');\n        this.afterFlushWait = false;\n    }\n}\n\nmodule.exports = Extract;","'use strict';\n\nexports.Parse = require('./lib/parser-stream');\nexports.Extract = require('./lib/extract');","'use strict'\n\nexports.fromCallback = function (fn) {\n  return Object.defineProperty(function (...args) {\n    if (typeof args[args.length - 1] === 'function') fn.apply(this, args)\n    else {\n      return new Promise((resolve, reject) => {\n        args.push((err, res) => (err != null) ? reject(err) : resolve(res))\n        fn.apply(this, args)\n      })\n    }\n  }, 'name', { value: fn.name })\n}\n\nexports.fromPromise = function (fn) {\n  return Object.defineProperty(function (...args) {\n    const cb = args[args.length - 1]\n    if (typeof cb !== 'function') return fn.apply(this, args)\n    else {\n      args.pop()\n      fn.apply(this, args).then(r => cb(null, r), cb)\n    }\n  }, 'name', { value: fn.name })\n}\n","'use strict'\n// This is adapted from https://github.com/normalize/mz\n// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\n\nconst api = [\n  'access',\n  'appendFile',\n  'chmod',\n  'chown',\n  'close',\n  'copyFile',\n  'cp',\n  'fchmod',\n  'fchown',\n  'fdatasync',\n  'fstat',\n  'fsync',\n  'ftruncate',\n  'futimes',\n  'glob',\n  'lchmod',\n  'lchown',\n  'lutimes',\n  'link',\n  'lstat',\n  'mkdir',\n  'mkdtemp',\n  'open',\n  'opendir',\n  'readdir',\n  'readFile',\n  'readlink',\n  'realpath',\n  'rename',\n  'rm',\n  'rmdir',\n  'stat',\n  'statfs',\n  'symlink',\n  'truncate',\n  'unlink',\n  'utimes',\n  'writeFile'\n].filter(key => {\n  // Some commands are not available on some systems. Ex:\n  // fs.cp was added in Node.js v16.7.0\n  // fs.statfs was added in Node v19.6.0, v18.15.0\n  // fs.glob was added in Node.js v22.0.0\n  // fs.lchown is not available on at least some Linux\n  return typeof fs[key] === 'function'\n})\n\n// Export cloned fs:\nObject.assign(exports, fs)\n\n// Universalify async methods:\napi.forEach(method => {\n  exports[method] = u(fs[method])\n})\n\n// We differ from mz/fs in that we still ship the old, broken, fs.exists()\n// since we are a drop-in replacement for the native module\nexports.exists = function (filename, callback) {\n  if (typeof callback === 'function') {\n    return fs.exists(filename, callback)\n  }\n  return new Promise(resolve => {\n    return fs.exists(filename, resolve)\n  })\n}\n\n// fs.read(), fs.write(), fs.readv(), & fs.writev() need special treatment due to multiple callback args\n\nexports.read = function (fd, buffer, offset, length, position, callback) {\n  if (typeof callback === 'function') {\n    return fs.read(fd, buffer, offset, length, position, callback)\n  }\n  return new Promise((resolve, reject) => {\n    fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {\n      if (err) return reject(err)\n      resolve({ bytesRead, buffer })\n    })\n  })\n}\n\n// Function signature can be\n// fs.write(fd, buffer[, offset[, length[, position]]], callback)\n// OR\n// fs.write(fd, string[, position[, encoding]], callback)\n// We need to handle both cases, so we use ...args\nexports.write = function (fd, buffer, ...args) {\n  if (typeof args[args.length - 1] === 'function') {\n    return fs.write(fd, buffer, ...args)\n  }\n\n  return new Promise((resolve, reject) => {\n    fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {\n      if (err) return reject(err)\n      resolve({ bytesWritten, buffer })\n    })\n  })\n}\n\n// Function signature is\n// s.readv(fd, buffers[, position], callback)\n// We need to handle the optional arg, so we use ...args\nexports.readv = function (fd, buffers, ...args) {\n  if (typeof args[args.length - 1] === 'function') {\n    return fs.readv(fd, buffers, ...args)\n  }\n\n  return new Promise((resolve, reject) => {\n    fs.readv(fd, buffers, ...args, (err, bytesRead, buffers) => {\n      if (err) return reject(err)\n      resolve({ bytesRead, buffers })\n    })\n  })\n}\n\n// Function signature is\n// s.writev(fd, buffers[, position], callback)\n// We need to handle the optional arg, so we use ...args\nexports.writev = function (fd, buffers, ...args) {\n  if (typeof args[args.length - 1] === 'function') {\n    return fs.writev(fd, buffers, ...args)\n  }\n\n  return new Promise((resolve, reject) => {\n    fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {\n      if (err) return reject(err)\n      resolve({ bytesWritten, buffers })\n    })\n  })\n}\n\n// fs.realpath.native sometimes not available if fs is monkey-patched\nif (typeof fs.realpath.native === 'function') {\n  exports.realpath.native = u(fs.realpath.native)\n} else {\n  process.emitWarning(\n    'fs.realpath.native is not a function. Is fs being monkey-patched?',\n    'Warning', 'fs-extra-WARN0003'\n  )\n}\n","// Adapted from https://github.com/sindresorhus/make-dir\n// Copyright (c) Sindre Sorhus  (sindresorhus.com)\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict'\nconst path = require('path')\n\n// https://github.com/nodejs/node/issues/8987\n// https://github.com/libuv/libuv/pull/1088\nmodule.exports.checkPath = function checkPath (pth) {\n  if (process.platform === 'win32') {\n    const pathHasInvalidWinCharacters = /[<>:\"|?*]/.test(pth.replace(path.parse(pth).root, ''))\n\n    if (pathHasInvalidWinCharacters) {\n      const error = new Error(`Path contains invalid characters: ${pth}`)\n      error.code = 'EINVAL'\n      throw error\n    }\n  }\n}\n","'use strict'\nconst fs = require('../fs')\nconst { checkPath } = require('./utils')\n\nconst getMode = options => {\n  const defaults = { mode: 0o777 }\n  if (typeof options === 'number') return options\n  return ({ ...defaults, ...options }).mode\n}\n\nmodule.exports.makeDir = async (dir, options) => {\n  checkPath(dir)\n\n  return fs.mkdir(dir, {\n    mode: getMode(options),\n    recursive: true\n  })\n}\n\nmodule.exports.makeDirSync = (dir, options) => {\n  checkPath(dir)\n\n  return fs.mkdirSync(dir, {\n    mode: getMode(options),\n    recursive: true\n  })\n}\n","'use strict'\nconst u = require('universalify').fromPromise\nconst { makeDir: _makeDir, makeDirSync } = require('./make-dir')\nconst makeDir = u(_makeDir)\n\nmodule.exports = {\n  mkdirs: makeDir,\n  mkdirsSync: makeDirSync,\n  // alias\n  mkdirp: makeDir,\n  mkdirpSync: makeDirSync,\n  ensureDir: makeDir,\n  ensureDirSync: makeDirSync\n}\n","'use strict'\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\n\nfunction pathExists (path) {\n  return fs.access(path).then(() => true).catch(() => false)\n}\n\nmodule.exports = {\n  pathExists: u(pathExists),\n  pathExistsSync: fs.existsSync\n}\n","'use strict'\n\nconst fs = require('../fs')\nconst u = require('universalify').fromPromise\n\nasync function utimesMillis (path, atime, mtime) {\n  // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)\n  const fd = await fs.open(path, 'r+')\n\n  let closeErr = null\n\n  try {\n    await fs.futimes(fd, atime, mtime)\n  } finally {\n    try {\n      await fs.close(fd)\n    } catch (e) {\n      closeErr = e\n    }\n  }\n\n  if (closeErr) {\n    throw closeErr\n  }\n}\n\nfunction utimesMillisSync (path, atime, mtime) {\n  const fd = fs.openSync(path, 'r+')\n  fs.futimesSync(fd, atime, mtime)\n  return fs.closeSync(fd)\n}\n\nmodule.exports = {\n  utimesMillis: u(utimesMillis),\n  utimesMillisSync\n}\n","'use strict'\n\nconst fs = require('../fs')\nconst path = require('path')\nconst u = require('universalify').fromPromise\n\nfunction getStats (src, dest, opts) {\n  const statFunc = opts.dereference\n    ? (file) => fs.stat(file, { bigint: true })\n    : (file) => fs.lstat(file, { bigint: true })\n  return Promise.all([\n    statFunc(src),\n    statFunc(dest).catch(err => {\n      if (err.code === 'ENOENT') return null\n      throw err\n    })\n  ]).then(([srcStat, destStat]) => ({ srcStat, destStat }))\n}\n\nfunction getStatsSync (src, dest, opts) {\n  let destStat\n  const statFunc = opts.dereference\n    ? (file) => fs.statSync(file, { bigint: true })\n    : (file) => fs.lstatSync(file, { bigint: true })\n  const srcStat = statFunc(src)\n  try {\n    destStat = statFunc(dest)\n  } catch (err) {\n    if (err.code === 'ENOENT') return { srcStat, destStat: null }\n    throw err\n  }\n  return { srcStat, destStat }\n}\n\nasync function checkPaths (src, dest, funcName, opts) {\n  const { srcStat, destStat } = await getStats(src, dest, opts)\n  if (destStat) {\n    if (areIdentical(srcStat, destStat)) {\n      const srcBaseName = path.basename(src)\n      const destBaseName = path.basename(dest)\n      if (funcName === 'move' &&\n        srcBaseName !== destBaseName &&\n        srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {\n        return { srcStat, destStat, isChangingCase: true }\n      }\n      throw new Error('Source and destination must not be the same.')\n    }\n    if (srcStat.isDirectory() && !destStat.isDirectory()) {\n      throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)\n    }\n    if (!srcStat.isDirectory() && destStat.isDirectory()) {\n      throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)\n    }\n  }\n\n  if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n    throw new Error(errMsg(src, dest, funcName))\n  }\n\n  return { srcStat, destStat }\n}\n\nfunction checkPathsSync (src, dest, funcName, opts) {\n  const { srcStat, destStat } = getStatsSync(src, dest, opts)\n\n  if (destStat) {\n    if (areIdentical(srcStat, destStat)) {\n      const srcBaseName = path.basename(src)\n      const destBaseName = path.basename(dest)\n      if (funcName === 'move' &&\n        srcBaseName !== destBaseName &&\n        srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {\n        return { srcStat, destStat, isChangingCase: true }\n      }\n      throw new Error('Source and destination must not be the same.')\n    }\n    if (srcStat.isDirectory() && !destStat.isDirectory()) {\n      throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)\n    }\n    if (!srcStat.isDirectory() && destStat.isDirectory()) {\n      throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)\n    }\n  }\n\n  if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n    throw new Error(errMsg(src, dest, funcName))\n  }\n  return { srcStat, destStat }\n}\n\n// recursively check if dest parent is a subdirectory of src.\n// It works for all file types including symlinks since it\n// checks the src and dest inodes. It starts from the deepest\n// parent and stops once it reaches the src parent or the root path.\nasync function checkParentPaths (src, srcStat, dest, funcName) {\n  const srcParent = path.resolve(path.dirname(src))\n  const destParent = path.resolve(path.dirname(dest))\n  if (destParent === srcParent || destParent === path.parse(destParent).root) return\n\n  let destStat\n  try {\n    destStat = await fs.stat(destParent, { bigint: true })\n  } catch (err) {\n    if (err.code === 'ENOENT') return\n    throw err\n  }\n\n  if (areIdentical(srcStat, destStat)) {\n    throw new Error(errMsg(src, dest, funcName))\n  }\n\n  return checkParentPaths(src, srcStat, destParent, funcName)\n}\n\nfunction checkParentPathsSync (src, srcStat, dest, funcName) {\n  const srcParent = path.resolve(path.dirname(src))\n  const destParent = path.resolve(path.dirname(dest))\n  if (destParent === srcParent || destParent === path.parse(destParent).root) return\n  let destStat\n  try {\n    destStat = fs.statSync(destParent, { bigint: true })\n  } catch (err) {\n    if (err.code === 'ENOENT') return\n    throw err\n  }\n  if (areIdentical(srcStat, destStat)) {\n    throw new Error(errMsg(src, dest, funcName))\n  }\n  return checkParentPathsSync(src, srcStat, destParent, funcName)\n}\n\nfunction areIdentical (srcStat, destStat) {\n  return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev\n}\n\n// return true if dest is a subdir of src, otherwise false.\n// It only checks the path strings.\nfunction isSrcSubdir (src, dest) {\n  const srcArr = path.resolve(src).split(path.sep).filter(i => i)\n  const destArr = path.resolve(dest).split(path.sep).filter(i => i)\n  return srcArr.every((cur, i) => destArr[i] === cur)\n}\n\nfunction errMsg (src, dest, funcName) {\n  return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`\n}\n\nmodule.exports = {\n  // checkPaths\n  checkPaths: u(checkPaths),\n  checkPathsSync,\n  // checkParent\n  checkParentPaths: u(checkParentPaths),\n  checkParentPathsSync,\n  // Misc\n  isSrcSubdir,\n  areIdentical\n}\n","'use strict'\n\nconst fs = require('../fs')\nconst path = require('path')\nconst { mkdirs } = require('../mkdirs')\nconst { pathExists } = require('../path-exists')\nconst { utimesMillis } = require('../util/utimes')\nconst stat = require('../util/stat')\n\nasync function copy (src, dest, opts = {}) {\n  if (typeof opts === 'function') {\n    opts = { filter: opts }\n  }\n\n  opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n  opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n  // Warn about using preserveTimestamps on 32-bit node\n  if (opts.preserveTimestamps && process.arch === 'ia32') {\n    process.emitWarning(\n      'Using the preserveTimestamps option in 32-bit node is not recommended;\\n\\n' +\n      '\\tsee https://github.com/jprichardson/node-fs-extra/issues/269',\n      'Warning', 'fs-extra-WARN0001'\n    )\n  }\n\n  const { srcStat, destStat } = await stat.checkPaths(src, dest, 'copy', opts)\n\n  await stat.checkParentPaths(src, srcStat, dest, 'copy')\n\n  const include = await runFilter(src, dest, opts)\n\n  if (!include) return\n\n  // check if the parent of dest exists, and create it if it doesn't exist\n  const destParent = path.dirname(dest)\n  const dirExists = await pathExists(destParent)\n  if (!dirExists) {\n    await mkdirs(destParent)\n  }\n\n  await getStatsAndPerformCopy(destStat, src, dest, opts)\n}\n\nasync function runFilter (src, dest, opts) {\n  if (!opts.filter) return true\n  return opts.filter(src, dest)\n}\n\nasync function getStatsAndPerformCopy (destStat, src, dest, opts) {\n  const statFn = opts.dereference ? fs.stat : fs.lstat\n  const srcStat = await statFn(src)\n\n  if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)\n\n  if (\n    srcStat.isFile() ||\n    srcStat.isCharacterDevice() ||\n    srcStat.isBlockDevice()\n  ) return onFile(srcStat, destStat, src, dest, opts)\n\n  if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)\n  if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)\n  if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)\n  throw new Error(`Unknown file: ${src}`)\n}\n\nasync function onFile (srcStat, destStat, src, dest, opts) {\n  if (!destStat) return copyFile(srcStat, src, dest, opts)\n\n  if (opts.overwrite) {\n    await fs.unlink(dest)\n    return copyFile(srcStat, src, dest, opts)\n  }\n  if (opts.errorOnExist) {\n    throw new Error(`'${dest}' already exists`)\n  }\n}\n\nasync function copyFile (srcStat, src, dest, opts) {\n  await fs.copyFile(src, dest)\n  if (opts.preserveTimestamps) {\n    // Make sure the file is writable before setting the timestamp\n    // otherwise open fails with EPERM when invoked with 'r+'\n    // (through utimes call)\n    if (fileIsNotWritable(srcStat.mode)) {\n      await makeFileWritable(dest, srcStat.mode)\n    }\n\n    // Set timestamps and mode correspondingly\n\n    // Note that The initial srcStat.atime cannot be trusted\n    // because it is modified by the read(2) system call\n    // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n    const updatedSrcStat = await fs.stat(src)\n    await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime)\n  }\n\n  return fs.chmod(dest, srcStat.mode)\n}\n\nfunction fileIsNotWritable (srcMode) {\n  return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode) {\n  return fs.chmod(dest, srcMode | 0o200)\n}\n\nasync function onDir (srcStat, destStat, src, dest, opts) {\n  // the dest directory might not exist, create it\n  if (!destStat) {\n    await fs.mkdir(dest)\n  }\n\n  const promises = []\n\n  // loop through the files in the current directory to copy everything\n  for await (const item of await fs.opendir(src)) {\n    const srcItem = path.join(src, item.name)\n    const destItem = path.join(dest, item.name)\n\n    promises.push(\n      runFilter(srcItem, destItem, opts).then(include => {\n        if (include) {\n          // only copy the item if it matches the filter function\n          return stat.checkPaths(srcItem, destItem, 'copy', opts).then(({ destStat }) => {\n            // If the item is a copyable file, `getStatsAndPerformCopy` will copy it\n            // If the item is a directory, `getStatsAndPerformCopy` will call `onDir` recursively\n            return getStatsAndPerformCopy(destStat, srcItem, destItem, opts)\n          })\n        }\n      })\n    )\n  }\n\n  await Promise.all(promises)\n\n  if (!destStat) {\n    await fs.chmod(dest, srcStat.mode)\n  }\n}\n\nasync function onLink (destStat, src, dest, opts) {\n  let resolvedSrc = await fs.readlink(src)\n  if (opts.dereference) {\n    resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n  }\n  if (!destStat) {\n    return fs.symlink(resolvedSrc, dest)\n  }\n\n  let resolvedDest = null\n  try {\n    resolvedDest = await fs.readlink(dest)\n  } catch (e) {\n    // dest exists and is a regular file or directory,\n    // Windows may throw UNKNOWN error. If dest already exists,\n    // fs throws error anyway, so no need to guard against it here.\n    if (e.code === 'EINVAL' || e.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest)\n    throw e\n  }\n  if (opts.dereference) {\n    resolvedDest = path.resolve(process.cwd(), resolvedDest)\n  }\n  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n    throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)\n  }\n\n  // do not copy if src is a subdir of dest since unlinking\n  // dest in this case would result in removing src contents\n  // and therefore a broken symlink would be created.\n  if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n    throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)\n  }\n\n  // copy the link\n  await fs.unlink(dest)\n  return fs.symlink(resolvedSrc, dest)\n}\n\nmodule.exports = copy\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdirsSync = require('../mkdirs').mkdirsSync\nconst utimesMillisSync = require('../util/utimes').utimesMillisSync\nconst stat = require('../util/stat')\n\nfunction copySync (src, dest, opts) {\n  if (typeof opts === 'function') {\n    opts = { filter: opts }\n  }\n\n  opts = opts || {}\n  opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n  opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n  // Warn about using preserveTimestamps on 32-bit node\n  if (opts.preserveTimestamps && process.arch === 'ia32') {\n    process.emitWarning(\n      'Using the preserveTimestamps option in 32-bit node is not recommended;\\n\\n' +\n      '\\tsee https://github.com/jprichardson/node-fs-extra/issues/269',\n      'Warning', 'fs-extra-WARN0002'\n    )\n  }\n\n  const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)\n  stat.checkParentPathsSync(src, srcStat, dest, 'copy')\n  if (opts.filter && !opts.filter(src, dest)) return\n  const destParent = path.dirname(dest)\n  if (!fs.existsSync(destParent)) mkdirsSync(destParent)\n  return getStats(destStat, src, dest, opts)\n}\n\nfunction getStats (destStat, src, dest, opts) {\n  const statSync = opts.dereference ? fs.statSync : fs.lstatSync\n  const srcStat = statSync(src)\n\n  if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)\n  else if (srcStat.isFile() ||\n           srcStat.isCharacterDevice() ||\n           srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)\n  else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)\n  else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)\n  else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)\n  throw new Error(`Unknown file: ${src}`)\n}\n\nfunction onFile (srcStat, destStat, src, dest, opts) {\n  if (!destStat) return copyFile(srcStat, src, dest, opts)\n  return mayCopyFile(srcStat, src, dest, opts)\n}\n\nfunction mayCopyFile (srcStat, src, dest, opts) {\n  if (opts.overwrite) {\n    fs.unlinkSync(dest)\n    return copyFile(srcStat, src, dest, opts)\n  } else if (opts.errorOnExist) {\n    throw new Error(`'${dest}' already exists`)\n  }\n}\n\nfunction copyFile (srcStat, src, dest, opts) {\n  fs.copyFileSync(src, dest)\n  if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)\n  return setDestMode(dest, srcStat.mode)\n}\n\nfunction handleTimestamps (srcMode, src, dest) {\n  // Make sure the file is writable before setting the timestamp\n  // otherwise open fails with EPERM when invoked with 'r+'\n  // (through utimes call)\n  if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)\n  return setDestTimestamps(src, dest)\n}\n\nfunction fileIsNotWritable (srcMode) {\n  return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode) {\n  return setDestMode(dest, srcMode | 0o200)\n}\n\nfunction setDestMode (dest, srcMode) {\n  return fs.chmodSync(dest, srcMode)\n}\n\nfunction setDestTimestamps (src, dest) {\n  // The initial srcStat.atime cannot be trusted\n  // because it is modified by the read(2) system call\n  // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n  const updatedSrcStat = fs.statSync(src)\n  return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)\n}\n\nfunction onDir (srcStat, destStat, src, dest, opts) {\n  if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)\n  return copyDir(src, dest, opts)\n}\n\nfunction mkDirAndCopy (srcMode, src, dest, opts) {\n  fs.mkdirSync(dest)\n  copyDir(src, dest, opts)\n  return setDestMode(dest, srcMode)\n}\n\nfunction copyDir (src, dest, opts) {\n  const dir = fs.opendirSync(src)\n\n  try {\n    let dirent\n\n    while ((dirent = dir.readSync()) !== null) {\n      copyDirItem(dirent.name, src, dest, opts)\n    }\n  } finally {\n    dir.closeSync()\n  }\n}\n\nfunction copyDirItem (item, src, dest, opts) {\n  const srcItem = path.join(src, item)\n  const destItem = path.join(dest, item)\n  if (opts.filter && !opts.filter(srcItem, destItem)) return\n  const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)\n  return getStats(destStat, srcItem, destItem, opts)\n}\n\nfunction onLink (destStat, src, dest, opts) {\n  let resolvedSrc = fs.readlinkSync(src)\n  if (opts.dereference) {\n    resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n  }\n\n  if (!destStat) {\n    return fs.symlinkSync(resolvedSrc, dest)\n  } else {\n    let resolvedDest\n    try {\n      resolvedDest = fs.readlinkSync(dest)\n    } catch (err) {\n      // dest exists and is a regular file or directory,\n      // Windows may throw UNKNOWN error. If dest already exists,\n      // fs throws error anyway, so no need to guard against it here.\n      if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)\n      throw err\n    }\n    if (opts.dereference) {\n      resolvedDest = path.resolve(process.cwd(), resolvedDest)\n    }\n    if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n      throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)\n    }\n\n    // prevent copy if src is a subdir of dest since unlinking\n    // dest in this case would result in removing src contents\n    // and therefore a broken symlink would be created.\n    if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n      throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)\n    }\n    return copyLink(resolvedSrc, dest)\n  }\n}\n\nfunction copyLink (resolvedSrc, dest) {\n  fs.unlinkSync(dest)\n  return fs.symlinkSync(resolvedSrc, dest)\n}\n\nmodule.exports = copySync\n","'use strict'\n\nconst u = require('universalify').fromPromise\nmodule.exports = {\n  copy: u(require('./copy')),\n  copySync: require('./copy-sync')\n}\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst u = require('universalify').fromCallback\n\nfunction remove (path, callback) {\n  fs.rm(path, { recursive: true, force: true }, callback)\n}\n\nfunction removeSync (path) {\n  fs.rmSync(path, { recursive: true, force: true })\n}\n\nmodule.exports = {\n  remove: u(remove),\n  removeSync\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst remove = require('../remove')\n\nconst emptyDir = u(async function emptyDir (dir) {\n  let items\n  try {\n    items = await fs.readdir(dir)\n  } catch {\n    return mkdir.mkdirs(dir)\n  }\n\n  return Promise.all(items.map(item => remove.remove(path.join(dir, item))))\n})\n\nfunction emptyDirSync (dir) {\n  let items\n  try {\n    items = fs.readdirSync(dir)\n  } catch {\n    return mkdir.mkdirsSync(dir)\n  }\n\n  items.forEach(item => {\n    item = path.join(dir, item)\n    remove.removeSync(item)\n  })\n}\n\nmodule.exports = {\n  emptyDirSync,\n  emptydirSync: emptyDirSync,\n  emptyDir,\n  emptydir: emptyDir\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst path = require('path')\nconst fs = require('../fs')\nconst mkdir = require('../mkdirs')\n\nasync function createFile (file) {\n  let stats\n  try {\n    stats = await fs.stat(file)\n  } catch { }\n  if (stats && stats.isFile()) return\n\n  const dir = path.dirname(file)\n\n  let dirStats = null\n  try {\n    dirStats = await fs.stat(dir)\n  } catch (err) {\n    // if the directory doesn't exist, make it\n    if (err.code === 'ENOENT') {\n      await mkdir.mkdirs(dir)\n      await fs.writeFile(file, '')\n      return\n    } else {\n      throw err\n    }\n  }\n\n  if (dirStats.isDirectory()) {\n    await fs.writeFile(file, '')\n  } else {\n    // parent is not a directory\n    // This is just to cause an internal ENOTDIR error to be thrown\n    await fs.readdir(dir)\n  }\n}\n\nfunction createFileSync (file) {\n  let stats\n  try {\n    stats = fs.statSync(file)\n  } catch { }\n  if (stats && stats.isFile()) return\n\n  const dir = path.dirname(file)\n  try {\n    if (!fs.statSync(dir).isDirectory()) {\n      // parent is not a directory\n      // This is just to cause an internal ENOTDIR error to be thrown\n      fs.readdirSync(dir)\n    }\n  } catch (err) {\n    // If the stat call above failed because the directory doesn't exist, create it\n    if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir)\n    else throw err\n  }\n\n  fs.writeFileSync(file, '')\n}\n\nmodule.exports = {\n  createFile: u(createFile),\n  createFileSync\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst path = require('path')\nconst fs = require('../fs')\nconst mkdir = require('../mkdirs')\nconst { pathExists } = require('../path-exists')\nconst { areIdentical } = require('../util/stat')\n\nasync function createLink (srcpath, dstpath) {\n  let dstStat\n  try {\n    dstStat = await fs.lstat(dstpath)\n  } catch {\n    // ignore error\n  }\n\n  let srcStat\n  try {\n    srcStat = await fs.lstat(srcpath)\n  } catch (err) {\n    err.message = err.message.replace('lstat', 'ensureLink')\n    throw err\n  }\n\n  if (dstStat && areIdentical(srcStat, dstStat)) return\n\n  const dir = path.dirname(dstpath)\n\n  const dirExists = await pathExists(dir)\n\n  if (!dirExists) {\n    await mkdir.mkdirs(dir)\n  }\n\n  await fs.link(srcpath, dstpath)\n}\n\nfunction createLinkSync (srcpath, dstpath) {\n  let dstStat\n  try {\n    dstStat = fs.lstatSync(dstpath)\n  } catch {}\n\n  try {\n    const srcStat = fs.lstatSync(srcpath)\n    if (dstStat && areIdentical(srcStat, dstStat)) return\n  } catch (err) {\n    err.message = err.message.replace('lstat', 'ensureLink')\n    throw err\n  }\n\n  const dir = path.dirname(dstpath)\n  const dirExists = fs.existsSync(dir)\n  if (dirExists) return fs.linkSync(srcpath, dstpath)\n  mkdir.mkdirsSync(dir)\n\n  return fs.linkSync(srcpath, dstpath)\n}\n\nmodule.exports = {\n  createLink: u(createLink),\n  createLinkSync\n}\n","'use strict'\n\nconst path = require('path')\nconst fs = require('../fs')\nconst { pathExists } = require('../path-exists')\n\nconst u = require('universalify').fromPromise\n\n/**\n * Function that returns two types of paths, one relative to symlink, and one\n * relative to the current working directory. Checks if path is absolute or\n * relative. If the path is relative, this function checks if the path is\n * relative to symlink or relative to current working directory. This is an\n * initiative to find a smarter `srcpath` to supply when building symlinks.\n * This allows you to determine which path to use out of one of three possible\n * types of source paths. The first is an absolute path. This is detected by\n * `path.isAbsolute()`. When an absolute path is provided, it is checked to\n * see if it exists. If it does it's used, if not an error is returned\n * (callback)/ thrown (sync). The other two options for `srcpath` are a\n * relative url. By default Node's `fs.symlink` works by creating a symlink\n * using `dstpath` and expects the `srcpath` to be relative to the newly\n * created symlink. If you provide a `srcpath` that does not exist on the file\n * system it results in a broken symlink. To minimize this, the function\n * checks to see if the 'relative to symlink' source file exists, and if it\n * does it will use it. If it does not, it checks if there's a file that\n * exists that is relative to the current working directory, if does its used.\n * This preserves the expectations of the original fs.symlink spec and adds\n * the ability to pass in `relative to current working direcotry` paths.\n */\n\nasync function symlinkPaths (srcpath, dstpath) {\n  if (path.isAbsolute(srcpath)) {\n    try {\n      await fs.lstat(srcpath)\n    } catch (err) {\n      err.message = err.message.replace('lstat', 'ensureSymlink')\n      throw err\n    }\n\n    return {\n      toCwd: srcpath,\n      toDst: srcpath\n    }\n  }\n\n  const dstdir = path.dirname(dstpath)\n  const relativeToDst = path.join(dstdir, srcpath)\n\n  const exists = await pathExists(relativeToDst)\n  if (exists) {\n    return {\n      toCwd: relativeToDst,\n      toDst: srcpath\n    }\n  }\n\n  try {\n    await fs.lstat(srcpath)\n  } catch (err) {\n    err.message = err.message.replace('lstat', 'ensureSymlink')\n    throw err\n  }\n\n  return {\n    toCwd: srcpath,\n    toDst: path.relative(dstdir, srcpath)\n  }\n}\n\nfunction symlinkPathsSync (srcpath, dstpath) {\n  if (path.isAbsolute(srcpath)) {\n    const exists = fs.existsSync(srcpath)\n    if (!exists) throw new Error('absolute srcpath does not exist')\n    return {\n      toCwd: srcpath,\n      toDst: srcpath\n    }\n  }\n\n  const dstdir = path.dirname(dstpath)\n  const relativeToDst = path.join(dstdir, srcpath)\n  const exists = fs.existsSync(relativeToDst)\n  if (exists) {\n    return {\n      toCwd: relativeToDst,\n      toDst: srcpath\n    }\n  }\n\n  const srcExists = fs.existsSync(srcpath)\n  if (!srcExists) throw new Error('relative srcpath does not exist')\n  return {\n    toCwd: srcpath,\n    toDst: path.relative(dstdir, srcpath)\n  }\n}\n\nmodule.exports = {\n  symlinkPaths: u(symlinkPaths),\n  symlinkPathsSync\n}\n","'use strict'\n\nconst fs = require('../fs')\nconst u = require('universalify').fromPromise\n\nasync function symlinkType (srcpath, type) {\n  if (type) return type\n\n  let stats\n  try {\n    stats = await fs.lstat(srcpath)\n  } catch {\n    return 'file'\n  }\n\n  return (stats && stats.isDirectory()) ? 'dir' : 'file'\n}\n\nfunction symlinkTypeSync (srcpath, type) {\n  if (type) return type\n\n  let stats\n  try {\n    stats = fs.lstatSync(srcpath)\n  } catch {\n    return 'file'\n  }\n  return (stats && stats.isDirectory()) ? 'dir' : 'file'\n}\n\nmodule.exports = {\n  symlinkType: u(symlinkType),\n  symlinkTypeSync\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst path = require('path')\nconst fs = require('../fs')\n\nconst { mkdirs, mkdirsSync } = require('../mkdirs')\n\nconst { symlinkPaths, symlinkPathsSync } = require('./symlink-paths')\nconst { symlinkType, symlinkTypeSync } = require('./symlink-type')\n\nconst { pathExists } = require('../path-exists')\n\nconst { areIdentical } = require('../util/stat')\n\nasync function createSymlink (srcpath, dstpath, type) {\n  let stats\n  try {\n    stats = await fs.lstat(dstpath)\n  } catch { }\n\n  if (stats && stats.isSymbolicLink()) {\n    const [srcStat, dstStat] = await Promise.all([\n      fs.stat(srcpath),\n      fs.stat(dstpath)\n    ])\n\n    if (areIdentical(srcStat, dstStat)) return\n  }\n\n  const relative = await symlinkPaths(srcpath, dstpath)\n  srcpath = relative.toDst\n  const toType = await symlinkType(relative.toCwd, type)\n  const dir = path.dirname(dstpath)\n\n  if (!(await pathExists(dir))) {\n    await mkdirs(dir)\n  }\n\n  return fs.symlink(srcpath, dstpath, toType)\n}\n\nfunction createSymlinkSync (srcpath, dstpath, type) {\n  let stats\n  try {\n    stats = fs.lstatSync(dstpath)\n  } catch { }\n  if (stats && stats.isSymbolicLink()) {\n    const srcStat = fs.statSync(srcpath)\n    const dstStat = fs.statSync(dstpath)\n    if (areIdentical(srcStat, dstStat)) return\n  }\n\n  const relative = symlinkPathsSync(srcpath, dstpath)\n  srcpath = relative.toDst\n  type = symlinkTypeSync(relative.toCwd, type)\n  const dir = path.dirname(dstpath)\n  const exists = fs.existsSync(dir)\n  if (exists) return fs.symlinkSync(srcpath, dstpath, type)\n  mkdirsSync(dir)\n  return fs.symlinkSync(srcpath, dstpath, type)\n}\n\nmodule.exports = {\n  createSymlink: u(createSymlink),\n  createSymlinkSync\n}\n","'use strict'\n\nconst { createFile, createFileSync } = require('./file')\nconst { createLink, createLinkSync } = require('./link')\nconst { createSymlink, createSymlinkSync } = require('./symlink')\n\nmodule.exports = {\n  // file\n  createFile,\n  createFileSync,\n  ensureFile: createFile,\n  ensureFileSync: createFileSync,\n  // link\n  createLink,\n  createLinkSync,\n  ensureLink: createLink,\n  ensureLinkSync: createLinkSync,\n  // symlink\n  createSymlink,\n  createSymlinkSync,\n  ensureSymlink: createSymlink,\n  ensureSymlinkSync: createSymlinkSync\n}\n","function stringify (obj, { EOL = '\\n', finalEOL = true, replacer = null, spaces } = {}) {\n  const EOF = finalEOL ? EOL : ''\n  const str = JSON.stringify(obj, replacer, spaces)\n\n  return str.replace(/\\n/g, EOL) + EOF\n}\n\nfunction stripBom (content) {\n  // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified\n  if (Buffer.isBuffer(content)) content = content.toString('utf8')\n  return content.replace(/^\\uFEFF/, '')\n}\n\nmodule.exports = { stringify, stripBom }\n","let _fs\ntry {\n  _fs = require('graceful-fs')\n} catch (_) {\n  _fs = require('fs')\n}\nconst universalify = require('universalify')\nconst { stringify, stripBom } = require('./utils')\n\nasync function _readFile (file, options = {}) {\n  if (typeof options === 'string') {\n    options = { encoding: options }\n  }\n\n  const fs = options.fs || _fs\n\n  const shouldThrow = 'throws' in options ? options.throws : true\n\n  let data = await universalify.fromCallback(fs.readFile)(file, options)\n\n  data = stripBom(data)\n\n  let obj\n  try {\n    obj = JSON.parse(data, options ? options.reviver : null)\n  } catch (err) {\n    if (shouldThrow) {\n      err.message = `${file}: ${err.message}`\n      throw err\n    } else {\n      return null\n    }\n  }\n\n  return obj\n}\n\nconst readFile = universalify.fromPromise(_readFile)\n\nfunction readFileSync (file, options = {}) {\n  if (typeof options === 'string') {\n    options = { encoding: options }\n  }\n\n  const fs = options.fs || _fs\n\n  const shouldThrow = 'throws' in options ? options.throws : true\n\n  try {\n    let content = fs.readFileSync(file, options)\n    content = stripBom(content)\n    return JSON.parse(content, options.reviver)\n  } catch (err) {\n    if (shouldThrow) {\n      err.message = `${file}: ${err.message}`\n      throw err\n    } else {\n      return null\n    }\n  }\n}\n\nasync function _writeFile (file, obj, options = {}) {\n  const fs = options.fs || _fs\n\n  const str = stringify(obj, options)\n\n  await universalify.fromCallback(fs.writeFile)(file, str, options)\n}\n\nconst writeFile = universalify.fromPromise(_writeFile)\n\nfunction writeFileSync (file, obj, options = {}) {\n  const fs = options.fs || _fs\n\n  const str = stringify(obj, options)\n  // not sure if fs.writeFileSync returns anything, but just in case\n  return fs.writeFileSync(file, str, options)\n}\n\nconst jsonfile = {\n  readFile,\n  readFileSync,\n  writeFile,\n  writeFileSync\n}\n\nmodule.exports = jsonfile\n","'use strict'\n\nconst jsonFile = require('jsonfile')\n\nmodule.exports = {\n  // jsonfile exports\n  readJson: jsonFile.readFile,\n  readJsonSync: jsonFile.readFileSync,\n  writeJson: jsonFile.writeFile,\n  writeJsonSync: jsonFile.writeFileSync\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst pathExists = require('../path-exists').pathExists\n\nasync function outputFile (file, data, encoding = 'utf-8') {\n  const dir = path.dirname(file)\n\n  if (!(await pathExists(dir))) {\n    await mkdir.mkdirs(dir)\n  }\n\n  return fs.writeFile(file, data, encoding)\n}\n\nfunction outputFileSync (file, ...args) {\n  const dir = path.dirname(file)\n  if (!fs.existsSync(dir)) {\n    mkdir.mkdirsSync(dir)\n  }\n\n  fs.writeFileSync(file, ...args)\n}\n\nmodule.exports = {\n  outputFile: u(outputFile),\n  outputFileSync\n}\n","'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFile } = require('../output-file')\n\nasync function outputJson (file, data, options = {}) {\n  const str = stringify(data, options)\n\n  await outputFile(file, str, options)\n}\n\nmodule.exports = outputJson\n","'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFileSync } = require('../output-file')\n\nfunction outputJsonSync (file, data, options) {\n  const str = stringify(data, options)\n\n  outputFileSync(file, str, options)\n}\n\nmodule.exports = outputJsonSync\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst jsonFile = require('./jsonfile')\n\njsonFile.outputJson = u(require('./output-json'))\njsonFile.outputJsonSync = require('./output-json-sync')\n// aliases\njsonFile.outputJSON = jsonFile.outputJson\njsonFile.outputJSONSync = jsonFile.outputJsonSync\njsonFile.writeJSON = jsonFile.writeJson\njsonFile.writeJSONSync = jsonFile.writeJsonSync\njsonFile.readJSON = jsonFile.readJson\njsonFile.readJSONSync = jsonFile.readJsonSync\n\nmodule.exports = jsonFile\n","'use strict'\n\nconst fs = require('../fs')\nconst path = require('path')\nconst { copy } = require('../copy')\nconst { remove } = require('../remove')\nconst { mkdirp } = require('../mkdirs')\nconst { pathExists } = require('../path-exists')\nconst stat = require('../util/stat')\n\nasync function move (src, dest, opts = {}) {\n  const overwrite = opts.overwrite || opts.clobber || false\n\n  const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, 'move', opts)\n\n  await stat.checkParentPaths(src, srcStat, dest, 'move')\n\n  // If the parent of dest is not root, make sure it exists before proceeding\n  const destParent = path.dirname(dest)\n  const parsedParentPath = path.parse(destParent)\n  if (parsedParentPath.root !== destParent) {\n    await mkdirp(destParent)\n  }\n\n  return doRename(src, dest, overwrite, isChangingCase)\n}\n\nasync function doRename (src, dest, overwrite, isChangingCase) {\n  if (!isChangingCase) {\n    if (overwrite) {\n      await remove(dest)\n    } else if (await pathExists(dest)) {\n      throw new Error('dest already exists.')\n    }\n  }\n\n  try {\n    // Try w/ rename first, and try copy + remove if EXDEV\n    await fs.rename(src, dest)\n  } catch (err) {\n    if (err.code !== 'EXDEV') {\n      throw err\n    }\n    await moveAcrossDevice(src, dest, overwrite)\n  }\n}\n\nasync function moveAcrossDevice (src, dest, overwrite) {\n  const opts = {\n    overwrite,\n    errorOnExist: true,\n    preserveTimestamps: true\n  }\n\n  await copy(src, dest, opts)\n  return remove(src)\n}\n\nmodule.exports = move\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst copySync = require('../copy').copySync\nconst removeSync = require('../remove').removeSync\nconst mkdirpSync = require('../mkdirs').mkdirpSync\nconst stat = require('../util/stat')\n\nfunction moveSync (src, dest, opts) {\n  opts = opts || {}\n  const overwrite = opts.overwrite || opts.clobber || false\n\n  const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, 'move', opts)\n  stat.checkParentPathsSync(src, srcStat, dest, 'move')\n  if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest))\n  return doRename(src, dest, overwrite, isChangingCase)\n}\n\nfunction isParentRoot (dest) {\n  const parent = path.dirname(dest)\n  const parsedPath = path.parse(parent)\n  return parsedPath.root === parent\n}\n\nfunction doRename (src, dest, overwrite, isChangingCase) {\n  if (isChangingCase) return rename(src, dest, overwrite)\n  if (overwrite) {\n    removeSync(dest)\n    return rename(src, dest, overwrite)\n  }\n  if (fs.existsSync(dest)) throw new Error('dest already exists.')\n  return rename(src, dest, overwrite)\n}\n\nfunction rename (src, dest, overwrite) {\n  try {\n    fs.renameSync(src, dest)\n  } catch (err) {\n    if (err.code !== 'EXDEV') throw err\n    return moveAcrossDevice(src, dest, overwrite)\n  }\n}\n\nfunction moveAcrossDevice (src, dest, overwrite) {\n  const opts = {\n    overwrite,\n    errorOnExist: true,\n    preserveTimestamps: true\n  }\n  copySync(src, dest, opts)\n  return removeSync(src)\n}\n\nmodule.exports = moveSync\n","'use strict'\n\nconst u = require('universalify').fromPromise\nmodule.exports = {\n  move: u(require('./move')),\n  moveSync: require('./move-sync')\n}\n","'use strict'\n\nmodule.exports = {\n  // Export promiseified graceful-fs:\n  ...require('./fs'),\n  // Export extra methods:\n  ...require('./copy'),\n  ...require('./empty'),\n  ...require('./ensure'),\n  ...require('./json'),\n  ...require('./mkdirs'),\n  ...require('./move'),\n  ...require('./output-file'),\n  ...require('./path-exists'),\n  ...require('./remove')\n}\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  exports.defaults = {\n    \"0.1\": {\n      explicitCharkey: false,\n      trim: true,\n      normalize: true,\n      normalizeTags: false,\n      attrkey: \"@\",\n      charkey: \"#\",\n      explicitArray: false,\n      ignoreAttrs: false,\n      mergeAttrs: false,\n      explicitRoot: false,\n      validator: null,\n      xmlns: false,\n      explicitChildren: false,\n      childkey: '@@',\n      charsAsChildren: false,\n      includeWhiteChars: false,\n      async: false,\n      strict: true,\n      attrNameProcessors: null,\n      attrValueProcessors: null,\n      tagNameProcessors: null,\n      valueProcessors: null,\n      emptyTag: ''\n    },\n    \"0.2\": {\n      explicitCharkey: false,\n      trim: false,\n      normalize: false,\n      normalizeTags: false,\n      attrkey: \"$\",\n      charkey: \"_\",\n      explicitArray: true,\n      ignoreAttrs: false,\n      mergeAttrs: false,\n      explicitRoot: true,\n      validator: null,\n      xmlns: false,\n      explicitChildren: false,\n      preserveChildrenOrder: false,\n      childkey: '$$',\n      charsAsChildren: false,\n      includeWhiteChars: false,\n      async: false,\n      strict: true,\n      attrNameProcessors: null,\n      attrValueProcessors: null,\n      tagNameProcessors: null,\n      valueProcessors: null,\n      rootName: 'root',\n      xmldec: {\n        'version': '1.0',\n        'encoding': 'UTF-8',\n        'standalone': true\n      },\n      doctype: null,\n      renderOpts: {\n        'pretty': true,\n        'indent': '  ',\n        'newline': '\\n'\n      },\n      headless: false,\n      chunkSize: 10000,\n      emptyTag: '',\n      cdata: false\n    }\n  };\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var assign, getValue, isArray, isEmpty, isFunction, isObject, isPlainObject,\n    slice = [].slice,\n    hasProp = {}.hasOwnProperty;\n\n  assign = function() {\n    var i, key, len, source, sources, target;\n    target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : [];\n    if (isFunction(Object.assign)) {\n      Object.assign.apply(null, arguments);\n    } else {\n      for (i = 0, len = sources.length; i < len; i++) {\n        source = sources[i];\n        if (source != null) {\n          for (key in source) {\n            if (!hasProp.call(source, key)) continue;\n            target[key] = source[key];\n          }\n        }\n      }\n    }\n    return target;\n  };\n\n  isFunction = function(val) {\n    return !!val && Object.prototype.toString.call(val) === '[object Function]';\n  };\n\n  isObject = function(val) {\n    var ref;\n    return !!val && ((ref = typeof val) === 'function' || ref === 'object');\n  };\n\n  isArray = function(val) {\n    if (isFunction(Array.isArray)) {\n      return Array.isArray(val);\n    } else {\n      return Object.prototype.toString.call(val) === '[object Array]';\n    }\n  };\n\n  isEmpty = function(val) {\n    var key;\n    if (isArray(val)) {\n      return !val.length;\n    } else {\n      for (key in val) {\n        if (!hasProp.call(val, key)) continue;\n        return false;\n      }\n      return true;\n    }\n  };\n\n  isPlainObject = function(val) {\n    var ctor, proto;\n    return isObject(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && (typeof ctor === 'function') && (ctor instanceof ctor) && (Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object));\n  };\n\n  getValue = function(obj) {\n    if (isFunction(obj.valueOf)) {\n      return obj.valueOf();\n    } else {\n      return obj;\n    }\n  };\n\n  module.exports.assign = assign;\n\n  module.exports.isFunction = isFunction;\n\n  module.exports.isObject = isObject;\n\n  module.exports.isArray = isArray;\n\n  module.exports.isEmpty = isEmpty;\n\n  module.exports.isPlainObject = isPlainObject;\n\n  module.exports.getValue = getValue;\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var XMLDOMImplementation;\n\n  module.exports = XMLDOMImplementation = (function() {\n    function XMLDOMImplementation() {}\n\n    XMLDOMImplementation.prototype.hasFeature = function(feature, version) {\n      return true;\n    };\n\n    XMLDOMImplementation.prototype.createDocumentType = function(qualifiedName, publicId, systemId) {\n      throw new Error(\"This DOM method is not implemented.\");\n    };\n\n    XMLDOMImplementation.prototype.createDocument = function(namespaceURI, qualifiedName, doctype) {\n      throw new Error(\"This DOM method is not implemented.\");\n    };\n\n    XMLDOMImplementation.prototype.createHTMLDocument = function(title) {\n      throw new Error(\"This DOM method is not implemented.\");\n    };\n\n    XMLDOMImplementation.prototype.getFeature = function(feature, version) {\n      throw new Error(\"This DOM method is not implemented.\");\n    };\n\n    return XMLDOMImplementation;\n\n  })();\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var XMLDOMErrorHandler;\n\n  module.exports = XMLDOMErrorHandler = (function() {\n    function XMLDOMErrorHandler() {}\n\n    XMLDOMErrorHandler.prototype.handleError = function(error) {\n      throw new Error(error);\n    };\n\n    return XMLDOMErrorHandler;\n\n  })();\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var XMLDOMStringList;\n\n  module.exports = XMLDOMStringList = (function() {\n    function XMLDOMStringList(arr) {\n      this.arr = arr || [];\n    }\n\n    Object.defineProperty(XMLDOMStringList.prototype, 'length', {\n      get: function() {\n        return this.arr.length;\n      }\n    });\n\n    XMLDOMStringList.prototype.item = function(index) {\n      return this.arr[index] || null;\n    };\n\n    XMLDOMStringList.prototype.contains = function(str) {\n      return this.arr.indexOf(str) !== -1;\n    };\n\n    return XMLDOMStringList;\n\n  })();\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var XMLDOMConfiguration, XMLDOMErrorHandler, XMLDOMStringList;\n\n  XMLDOMErrorHandler = require('./XMLDOMErrorHandler');\n\n  XMLDOMStringList = require('./XMLDOMStringList');\n\n  module.exports = XMLDOMConfiguration = (function() {\n    function XMLDOMConfiguration() {\n      var clonedSelf;\n      this.defaultParams = {\n        \"canonical-form\": false,\n        \"cdata-sections\": false,\n        \"comments\": false,\n        \"datatype-normalization\": false,\n        \"element-content-whitespace\": true,\n        \"entities\": true,\n        \"error-handler\": new XMLDOMErrorHandler(),\n        \"infoset\": true,\n        \"validate-if-schema\": false,\n        \"namespaces\": true,\n        \"namespace-declarations\": true,\n        \"normalize-characters\": false,\n        \"schema-location\": '',\n        \"schema-type\": '',\n        \"split-cdata-sections\": true,\n        \"validate\": false,\n        \"well-formed\": true\n      };\n      this.params = clonedSelf = Object.create(this.defaultParams);\n    }\n\n    Object.defineProperty(XMLDOMConfiguration.prototype, 'parameterNames', {\n      get: function() {\n        return new XMLDOMStringList(Object.keys(this.defaultParams));\n      }\n    });\n\n    XMLDOMConfiguration.prototype.getParameter = function(name) {\n      if (this.params.hasOwnProperty(name)) {\n        return this.params[name];\n      } else {\n        return null;\n      }\n    };\n\n    XMLDOMConfiguration.prototype.canSetParameter = function(name, value) {\n      return true;\n    };\n\n    XMLDOMConfiguration.prototype.setParameter = function(name, value) {\n      if (value != null) {\n        return this.params[name] = value;\n      } else {\n        return delete this.params[name];\n      }\n    };\n\n    return XMLDOMConfiguration;\n\n  })();\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  module.exports = {\n    Element: 1,\n    Attribute: 2,\n    Text: 3,\n    CData: 4,\n    EntityReference: 5,\n    EntityDeclaration: 6,\n    ProcessingInstruction: 7,\n    Comment: 8,\n    Document: 9,\n    DocType: 10,\n    DocumentFragment: 11,\n    NotationDeclaration: 12,\n    Declaration: 201,\n    Raw: 202,\n    AttributeDeclaration: 203,\n    ElementDeclaration: 204,\n    Dummy: 205\n  };\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, XMLAttribute, XMLNode;\n\n  NodeType = require('./NodeType');\n\n  XMLNode = require('./XMLNode');\n\n  module.exports = XMLAttribute = (function() {\n    function XMLAttribute(parent, name, value) {\n      this.parent = parent;\n      if (this.parent) {\n        this.options = this.parent.options;\n        this.stringify = this.parent.stringify;\n      }\n      if (name == null) {\n        throw new Error(\"Missing attribute name. \" + this.debugInfo(name));\n      }\n      this.name = this.stringify.name(name);\n      this.value = this.stringify.attValue(value);\n      this.type = NodeType.Attribute;\n      this.isId = false;\n      this.schemaTypeInfo = null;\n    }\n\n    Object.defineProperty(XMLAttribute.prototype, 'nodeType', {\n      get: function() {\n        return this.type;\n      }\n    });\n\n    Object.defineProperty(XMLAttribute.prototype, 'ownerElement', {\n      get: function() {\n        return this.parent;\n      }\n    });\n\n    Object.defineProperty(XMLAttribute.prototype, 'textContent', {\n      get: function() {\n        return this.value;\n      },\n      set: function(value) {\n        return this.value = value || '';\n      }\n    });\n\n    Object.defineProperty(XMLAttribute.prototype, 'namespaceURI', {\n      get: function() {\n        return '';\n      }\n    });\n\n    Object.defineProperty(XMLAttribute.prototype, 'prefix', {\n      get: function() {\n        return '';\n      }\n    });\n\n    Object.defineProperty(XMLAttribute.prototype, 'localName', {\n      get: function() {\n        return this.name;\n      }\n    });\n\n    Object.defineProperty(XMLAttribute.prototype, 'specified', {\n      get: function() {\n        return true;\n      }\n    });\n\n    XMLAttribute.prototype.clone = function() {\n      return Object.create(this);\n    };\n\n    XMLAttribute.prototype.toString = function(options) {\n      return this.options.writer.attribute(this, this.options.writer.filterOptions(options));\n    };\n\n    XMLAttribute.prototype.debugInfo = function(name) {\n      name = name || this.name;\n      if (name == null) {\n        return \"parent: <\" + this.parent.name + \">\";\n      } else {\n        return \"attribute: {\" + name + \"}, parent: <\" + this.parent.name + \">\";\n      }\n    };\n\n    XMLAttribute.prototype.isEqualNode = function(node) {\n      if (node.namespaceURI !== this.namespaceURI) {\n        return false;\n      }\n      if (node.prefix !== this.prefix) {\n        return false;\n      }\n      if (node.localName !== this.localName) {\n        return false;\n      }\n      if (node.value !== this.value) {\n        return false;\n      }\n      return true;\n    };\n\n    return XMLAttribute;\n\n  })();\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var XMLNamedNodeMap;\n\n  module.exports = XMLNamedNodeMap = (function() {\n    function XMLNamedNodeMap(nodes) {\n      this.nodes = nodes;\n    }\n\n    Object.defineProperty(XMLNamedNodeMap.prototype, 'length', {\n      get: function() {\n        return Object.keys(this.nodes).length || 0;\n      }\n    });\n\n    XMLNamedNodeMap.prototype.clone = function() {\n      return this.nodes = null;\n    };\n\n    XMLNamedNodeMap.prototype.getNamedItem = function(name) {\n      return this.nodes[name];\n    };\n\n    XMLNamedNodeMap.prototype.setNamedItem = function(node) {\n      var oldNode;\n      oldNode = this.nodes[node.nodeName];\n      this.nodes[node.nodeName] = node;\n      return oldNode || null;\n    };\n\n    XMLNamedNodeMap.prototype.removeNamedItem = function(name) {\n      var oldNode;\n      oldNode = this.nodes[name];\n      delete this.nodes[name];\n      return oldNode || null;\n    };\n\n    XMLNamedNodeMap.prototype.item = function(index) {\n      return this.nodes[Object.keys(this.nodes)[index]] || null;\n    };\n\n    XMLNamedNodeMap.prototype.getNamedItemNS = function(namespaceURI, localName) {\n      throw new Error(\"This DOM method is not implemented.\");\n    };\n\n    XMLNamedNodeMap.prototype.setNamedItemNS = function(node) {\n      throw new Error(\"This DOM method is not implemented.\");\n    };\n\n    XMLNamedNodeMap.prototype.removeNamedItemNS = function(namespaceURI, localName) {\n      throw new Error(\"This DOM method is not implemented.\");\n    };\n\n    return XMLNamedNodeMap;\n\n  })();\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue, isFunction, isObject, ref,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  ref = require('./Utility'), isObject = ref.isObject, isFunction = ref.isFunction, getValue = ref.getValue;\n\n  XMLNode = require('./XMLNode');\n\n  NodeType = require('./NodeType');\n\n  XMLAttribute = require('./XMLAttribute');\n\n  XMLNamedNodeMap = require('./XMLNamedNodeMap');\n\n  module.exports = XMLElement = (function(superClass) {\n    extend(XMLElement, superClass);\n\n    function XMLElement(parent, name, attributes) {\n      var child, j, len, ref1;\n      XMLElement.__super__.constructor.call(this, parent);\n      if (name == null) {\n        throw new Error(\"Missing element name. \" + this.debugInfo());\n      }\n      this.name = this.stringify.name(name);\n      this.type = NodeType.Element;\n      this.attribs = {};\n      this.schemaTypeInfo = null;\n      if (attributes != null) {\n        this.attribute(attributes);\n      }\n      if (parent.type === NodeType.Document) {\n        this.isRoot = true;\n        this.documentObject = parent;\n        parent.rootObject = this;\n        if (parent.children) {\n          ref1 = parent.children;\n          for (j = 0, len = ref1.length; j < len; j++) {\n            child = ref1[j];\n            if (child.type === NodeType.DocType) {\n              child.name = this.name;\n              break;\n            }\n          }\n        }\n      }\n    }\n\n    Object.defineProperty(XMLElement.prototype, 'tagName', {\n      get: function() {\n        return this.name;\n      }\n    });\n\n    Object.defineProperty(XMLElement.prototype, 'namespaceURI', {\n      get: function() {\n        return '';\n      }\n    });\n\n    Object.defineProperty(XMLElement.prototype, 'prefix', {\n      get: function() {\n        return '';\n      }\n    });\n\n    Object.defineProperty(XMLElement.prototype, 'localName', {\n      get: function() {\n        return this.name;\n      }\n    });\n\n    Object.defineProperty(XMLElement.prototype, 'id', {\n      get: function() {\n        throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n      }\n    });\n\n    Object.defineProperty(XMLElement.prototype, 'className', {\n      get: function() {\n        throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n      }\n    });\n\n    Object.defineProperty(XMLElement.prototype, 'classList', {\n      get: function() {\n        throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n      }\n    });\n\n    Object.defineProperty(XMLElement.prototype, 'attributes', {\n      get: function() {\n        if (!this.attributeMap || !this.attributeMap.nodes) {\n          this.attributeMap = new XMLNamedNodeMap(this.attribs);\n        }\n        return this.attributeMap;\n      }\n    });\n\n    XMLElement.prototype.clone = function() {\n      var att, attName, clonedSelf, ref1;\n      clonedSelf = Object.create(this);\n      if (clonedSelf.isRoot) {\n        clonedSelf.documentObject = null;\n      }\n      clonedSelf.attribs = {};\n      ref1 = this.attribs;\n      for (attName in ref1) {\n        if (!hasProp.call(ref1, attName)) continue;\n        att = ref1[attName];\n        clonedSelf.attribs[attName] = att.clone();\n      }\n      clonedSelf.children = [];\n      this.children.forEach(function(child) {\n        var clonedChild;\n        clonedChild = child.clone();\n        clonedChild.parent = clonedSelf;\n        return clonedSelf.children.push(clonedChild);\n      });\n      return clonedSelf;\n    };\n\n    XMLElement.prototype.attribute = function(name, value) {\n      var attName, attValue;\n      if (name != null) {\n        name = getValue(name);\n      }\n      if (isObject(name)) {\n        for (attName in name) {\n          if (!hasProp.call(name, attName)) continue;\n          attValue = name[attName];\n          this.attribute(attName, attValue);\n        }\n      } else {\n        if (isFunction(value)) {\n          value = value.apply();\n        }\n        if (this.options.keepNullAttributes && (value == null)) {\n          this.attribs[name] = new XMLAttribute(this, name, \"\");\n        } else if (value != null) {\n          this.attribs[name] = new XMLAttribute(this, name, value);\n        }\n      }\n      return this;\n    };\n\n    XMLElement.prototype.removeAttribute = function(name) {\n      var attName, j, len;\n      if (name == null) {\n        throw new Error(\"Missing attribute name. \" + this.debugInfo());\n      }\n      name = getValue(name);\n      if (Array.isArray(name)) {\n        for (j = 0, len = name.length; j < len; j++) {\n          attName = name[j];\n          delete this.attribs[attName];\n        }\n      } else {\n        delete this.attribs[name];\n      }\n      return this;\n    };\n\n    XMLElement.prototype.toString = function(options) {\n      return this.options.writer.element(this, this.options.writer.filterOptions(options));\n    };\n\n    XMLElement.prototype.att = function(name, value) {\n      return this.attribute(name, value);\n    };\n\n    XMLElement.prototype.a = function(name, value) {\n      return this.attribute(name, value);\n    };\n\n    XMLElement.prototype.getAttribute = function(name) {\n      if (this.attribs.hasOwnProperty(name)) {\n        return this.attribs[name].value;\n      } else {\n        return null;\n      }\n    };\n\n    XMLElement.prototype.setAttribute = function(name, value) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLElement.prototype.getAttributeNode = function(name) {\n      if (this.attribs.hasOwnProperty(name)) {\n        return this.attribs[name];\n      } else {\n        return null;\n      }\n    };\n\n    XMLElement.prototype.setAttributeNode = function(newAttr) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLElement.prototype.removeAttributeNode = function(oldAttr) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLElement.prototype.getElementsByTagName = function(name) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLElement.prototype.getAttributeNS = function(namespaceURI, localName) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLElement.prototype.setAttributeNS = function(namespaceURI, qualifiedName, value) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLElement.prototype.removeAttributeNS = function(namespaceURI, localName) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLElement.prototype.getAttributeNodeNS = function(namespaceURI, localName) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLElement.prototype.setAttributeNodeNS = function(newAttr) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLElement.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLElement.prototype.hasAttribute = function(name) {\n      return this.attribs.hasOwnProperty(name);\n    };\n\n    XMLElement.prototype.hasAttributeNS = function(namespaceURI, localName) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLElement.prototype.setIdAttribute = function(name, isId) {\n      if (this.attribs.hasOwnProperty(name)) {\n        return this.attribs[name].isId;\n      } else {\n        return isId;\n      }\n    };\n\n    XMLElement.prototype.setIdAttributeNS = function(namespaceURI, localName, isId) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLElement.prototype.setIdAttributeNode = function(idAttr, isId) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLElement.prototype.getElementsByTagName = function(tagname) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLElement.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLElement.prototype.getElementsByClassName = function(classNames) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLElement.prototype.isEqualNode = function(node) {\n      var i, j, ref1;\n      if (!XMLElement.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {\n        return false;\n      }\n      if (node.namespaceURI !== this.namespaceURI) {\n        return false;\n      }\n      if (node.prefix !== this.prefix) {\n        return false;\n      }\n      if (node.localName !== this.localName) {\n        return false;\n      }\n      if (node.attribs.length !== this.attribs.length) {\n        return false;\n      }\n      for (i = j = 0, ref1 = this.attribs.length - 1; 0 <= ref1 ? j <= ref1 : j >= ref1; i = 0 <= ref1 ? ++j : --j) {\n        if (!this.attribs[i].isEqualNode(node.attribs[i])) {\n          return false;\n        }\n      }\n      return true;\n    };\n\n    return XMLElement;\n\n  })(XMLNode);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var XMLCharacterData, XMLNode,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  XMLNode = require('./XMLNode');\n\n  module.exports = XMLCharacterData = (function(superClass) {\n    extend(XMLCharacterData, superClass);\n\n    function XMLCharacterData(parent) {\n      XMLCharacterData.__super__.constructor.call(this, parent);\n      this.value = '';\n    }\n\n    Object.defineProperty(XMLCharacterData.prototype, 'data', {\n      get: function() {\n        return this.value;\n      },\n      set: function(value) {\n        return this.value = value || '';\n      }\n    });\n\n    Object.defineProperty(XMLCharacterData.prototype, 'length', {\n      get: function() {\n        return this.value.length;\n      }\n    });\n\n    Object.defineProperty(XMLCharacterData.prototype, 'textContent', {\n      get: function() {\n        return this.value;\n      },\n      set: function(value) {\n        return this.value = value || '';\n      }\n    });\n\n    XMLCharacterData.prototype.clone = function() {\n      return Object.create(this);\n    };\n\n    XMLCharacterData.prototype.substringData = function(offset, count) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLCharacterData.prototype.appendData = function(arg) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLCharacterData.prototype.insertData = function(offset, arg) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLCharacterData.prototype.deleteData = function(offset, count) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLCharacterData.prototype.replaceData = function(offset, count, arg) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLCharacterData.prototype.isEqualNode = function(node) {\n      if (!XMLCharacterData.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {\n        return false;\n      }\n      if (node.data !== this.data) {\n        return false;\n      }\n      return true;\n    };\n\n    return XMLCharacterData;\n\n  })(XMLNode);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, XMLCData, XMLCharacterData,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  NodeType = require('./NodeType');\n\n  XMLCharacterData = require('./XMLCharacterData');\n\n  module.exports = XMLCData = (function(superClass) {\n    extend(XMLCData, superClass);\n\n    function XMLCData(parent, text) {\n      XMLCData.__super__.constructor.call(this, parent);\n      if (text == null) {\n        throw new Error(\"Missing CDATA text. \" + this.debugInfo());\n      }\n      this.name = \"#cdata-section\";\n      this.type = NodeType.CData;\n      this.value = this.stringify.cdata(text);\n    }\n\n    XMLCData.prototype.clone = function() {\n      return Object.create(this);\n    };\n\n    XMLCData.prototype.toString = function(options) {\n      return this.options.writer.cdata(this, this.options.writer.filterOptions(options));\n    };\n\n    return XMLCData;\n\n  })(XMLCharacterData);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, XMLCharacterData, XMLComment,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  NodeType = require('./NodeType');\n\n  XMLCharacterData = require('./XMLCharacterData');\n\n  module.exports = XMLComment = (function(superClass) {\n    extend(XMLComment, superClass);\n\n    function XMLComment(parent, text) {\n      XMLComment.__super__.constructor.call(this, parent);\n      if (text == null) {\n        throw new Error(\"Missing comment text. \" + this.debugInfo());\n      }\n      this.name = \"#comment\";\n      this.type = NodeType.Comment;\n      this.value = this.stringify.comment(text);\n    }\n\n    XMLComment.prototype.clone = function() {\n      return Object.create(this);\n    };\n\n    XMLComment.prototype.toString = function(options) {\n      return this.options.writer.comment(this, this.options.writer.filterOptions(options));\n    };\n\n    return XMLComment;\n\n  })(XMLCharacterData);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, XMLDeclaration, XMLNode, isObject,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  isObject = require('./Utility').isObject;\n\n  XMLNode = require('./XMLNode');\n\n  NodeType = require('./NodeType');\n\n  module.exports = XMLDeclaration = (function(superClass) {\n    extend(XMLDeclaration, superClass);\n\n    function XMLDeclaration(parent, version, encoding, standalone) {\n      var ref;\n      XMLDeclaration.__super__.constructor.call(this, parent);\n      if (isObject(version)) {\n        ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone;\n      }\n      if (!version) {\n        version = '1.0';\n      }\n      this.type = NodeType.Declaration;\n      this.version = this.stringify.xmlVersion(version);\n      if (encoding != null) {\n        this.encoding = this.stringify.xmlEncoding(encoding);\n      }\n      if (standalone != null) {\n        this.standalone = this.stringify.xmlStandalone(standalone);\n      }\n    }\n\n    XMLDeclaration.prototype.toString = function(options) {\n      return this.options.writer.declaration(this, this.options.writer.filterOptions(options));\n    };\n\n    return XMLDeclaration;\n\n  })(XMLNode);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, XMLDTDAttList, XMLNode,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  XMLNode = require('./XMLNode');\n\n  NodeType = require('./NodeType');\n\n  module.exports = XMLDTDAttList = (function(superClass) {\n    extend(XMLDTDAttList, superClass);\n\n    function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {\n      XMLDTDAttList.__super__.constructor.call(this, parent);\n      if (elementName == null) {\n        throw new Error(\"Missing DTD element name. \" + this.debugInfo());\n      }\n      if (attributeName == null) {\n        throw new Error(\"Missing DTD attribute name. \" + this.debugInfo(elementName));\n      }\n      if (!attributeType) {\n        throw new Error(\"Missing DTD attribute type. \" + this.debugInfo(elementName));\n      }\n      if (!defaultValueType) {\n        throw new Error(\"Missing DTD attribute default. \" + this.debugInfo(elementName));\n      }\n      if (defaultValueType.indexOf('#') !== 0) {\n        defaultValueType = '#' + defaultValueType;\n      }\n      if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) {\n        throw new Error(\"Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. \" + this.debugInfo(elementName));\n      }\n      if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) {\n        throw new Error(\"Default value only applies to #FIXED or #DEFAULT. \" + this.debugInfo(elementName));\n      }\n      this.elementName = this.stringify.name(elementName);\n      this.type = NodeType.AttributeDeclaration;\n      this.attributeName = this.stringify.name(attributeName);\n      this.attributeType = this.stringify.dtdAttType(attributeType);\n      if (defaultValue) {\n        this.defaultValue = this.stringify.dtdAttDefault(defaultValue);\n      }\n      this.defaultValueType = defaultValueType;\n    }\n\n    XMLDTDAttList.prototype.toString = function(options) {\n      return this.options.writer.dtdAttList(this, this.options.writer.filterOptions(options));\n    };\n\n    return XMLDTDAttList;\n\n  })(XMLNode);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, XMLDTDEntity, XMLNode, isObject,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  isObject = require('./Utility').isObject;\n\n  XMLNode = require('./XMLNode');\n\n  NodeType = require('./NodeType');\n\n  module.exports = XMLDTDEntity = (function(superClass) {\n    extend(XMLDTDEntity, superClass);\n\n    function XMLDTDEntity(parent, pe, name, value) {\n      XMLDTDEntity.__super__.constructor.call(this, parent);\n      if (name == null) {\n        throw new Error(\"Missing DTD entity name. \" + this.debugInfo(name));\n      }\n      if (value == null) {\n        throw new Error(\"Missing DTD entity value. \" + this.debugInfo(name));\n      }\n      this.pe = !!pe;\n      this.name = this.stringify.name(name);\n      this.type = NodeType.EntityDeclaration;\n      if (!isObject(value)) {\n        this.value = this.stringify.dtdEntityValue(value);\n        this.internal = true;\n      } else {\n        if (!value.pubID && !value.sysID) {\n          throw new Error(\"Public and/or system identifiers are required for an external entity. \" + this.debugInfo(name));\n        }\n        if (value.pubID && !value.sysID) {\n          throw new Error(\"System identifier is required for a public external entity. \" + this.debugInfo(name));\n        }\n        this.internal = false;\n        if (value.pubID != null) {\n          this.pubID = this.stringify.dtdPubID(value.pubID);\n        }\n        if (value.sysID != null) {\n          this.sysID = this.stringify.dtdSysID(value.sysID);\n        }\n        if (value.nData != null) {\n          this.nData = this.stringify.dtdNData(value.nData);\n        }\n        if (this.pe && this.nData) {\n          throw new Error(\"Notation declaration is not allowed in a parameter entity. \" + this.debugInfo(name));\n        }\n      }\n    }\n\n    Object.defineProperty(XMLDTDEntity.prototype, 'publicId', {\n      get: function() {\n        return this.pubID;\n      }\n    });\n\n    Object.defineProperty(XMLDTDEntity.prototype, 'systemId', {\n      get: function() {\n        return this.sysID;\n      }\n    });\n\n    Object.defineProperty(XMLDTDEntity.prototype, 'notationName', {\n      get: function() {\n        return this.nData || null;\n      }\n    });\n\n    Object.defineProperty(XMLDTDEntity.prototype, 'inputEncoding', {\n      get: function() {\n        return null;\n      }\n    });\n\n    Object.defineProperty(XMLDTDEntity.prototype, 'xmlEncoding', {\n      get: function() {\n        return null;\n      }\n    });\n\n    Object.defineProperty(XMLDTDEntity.prototype, 'xmlVersion', {\n      get: function() {\n        return null;\n      }\n    });\n\n    XMLDTDEntity.prototype.toString = function(options) {\n      return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(options));\n    };\n\n    return XMLDTDEntity;\n\n  })(XMLNode);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, XMLDTDElement, XMLNode,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  XMLNode = require('./XMLNode');\n\n  NodeType = require('./NodeType');\n\n  module.exports = XMLDTDElement = (function(superClass) {\n    extend(XMLDTDElement, superClass);\n\n    function XMLDTDElement(parent, name, value) {\n      XMLDTDElement.__super__.constructor.call(this, parent);\n      if (name == null) {\n        throw new Error(\"Missing DTD element name. \" + this.debugInfo());\n      }\n      if (!value) {\n        value = '(#PCDATA)';\n      }\n      if (Array.isArray(value)) {\n        value = '(' + value.join(',') + ')';\n      }\n      this.name = this.stringify.name(name);\n      this.type = NodeType.ElementDeclaration;\n      this.value = this.stringify.dtdElementValue(value);\n    }\n\n    XMLDTDElement.prototype.toString = function(options) {\n      return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options));\n    };\n\n    return XMLDTDElement;\n\n  })(XMLNode);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, XMLDTDNotation, XMLNode,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  XMLNode = require('./XMLNode');\n\n  NodeType = require('./NodeType');\n\n  module.exports = XMLDTDNotation = (function(superClass) {\n    extend(XMLDTDNotation, superClass);\n\n    function XMLDTDNotation(parent, name, value) {\n      XMLDTDNotation.__super__.constructor.call(this, parent);\n      if (name == null) {\n        throw new Error(\"Missing DTD notation name. \" + this.debugInfo(name));\n      }\n      if (!value.pubID && !value.sysID) {\n        throw new Error(\"Public or system identifiers are required for an external entity. \" + this.debugInfo(name));\n      }\n      this.name = this.stringify.name(name);\n      this.type = NodeType.NotationDeclaration;\n      if (value.pubID != null) {\n        this.pubID = this.stringify.dtdPubID(value.pubID);\n      }\n      if (value.sysID != null) {\n        this.sysID = this.stringify.dtdSysID(value.sysID);\n      }\n    }\n\n    Object.defineProperty(XMLDTDNotation.prototype, 'publicId', {\n      get: function() {\n        return this.pubID;\n      }\n    });\n\n    Object.defineProperty(XMLDTDNotation.prototype, 'systemId', {\n      get: function() {\n        return this.sysID;\n      }\n    });\n\n    XMLDTDNotation.prototype.toString = function(options) {\n      return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(options));\n    };\n\n    return XMLDTDNotation;\n\n  })(XMLNode);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLNamedNodeMap, XMLNode, isObject,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  isObject = require('./Utility').isObject;\n\n  XMLNode = require('./XMLNode');\n\n  NodeType = require('./NodeType');\n\n  XMLDTDAttList = require('./XMLDTDAttList');\n\n  XMLDTDEntity = require('./XMLDTDEntity');\n\n  XMLDTDElement = require('./XMLDTDElement');\n\n  XMLDTDNotation = require('./XMLDTDNotation');\n\n  XMLNamedNodeMap = require('./XMLNamedNodeMap');\n\n  module.exports = XMLDocType = (function(superClass) {\n    extend(XMLDocType, superClass);\n\n    function XMLDocType(parent, pubID, sysID) {\n      var child, i, len, ref, ref1, ref2;\n      XMLDocType.__super__.constructor.call(this, parent);\n      this.type = NodeType.DocType;\n      if (parent.children) {\n        ref = parent.children;\n        for (i = 0, len = ref.length; i < len; i++) {\n          child = ref[i];\n          if (child.type === NodeType.Element) {\n            this.name = child.name;\n            break;\n          }\n        }\n      }\n      this.documentObject = parent;\n      if (isObject(pubID)) {\n        ref1 = pubID, pubID = ref1.pubID, sysID = ref1.sysID;\n      }\n      if (sysID == null) {\n        ref2 = [pubID, sysID], sysID = ref2[0], pubID = ref2[1];\n      }\n      if (pubID != null) {\n        this.pubID = this.stringify.dtdPubID(pubID);\n      }\n      if (sysID != null) {\n        this.sysID = this.stringify.dtdSysID(sysID);\n      }\n    }\n\n    Object.defineProperty(XMLDocType.prototype, 'entities', {\n      get: function() {\n        var child, i, len, nodes, ref;\n        nodes = {};\n        ref = this.children;\n        for (i = 0, len = ref.length; i < len; i++) {\n          child = ref[i];\n          if ((child.type === NodeType.EntityDeclaration) && !child.pe) {\n            nodes[child.name] = child;\n          }\n        }\n        return new XMLNamedNodeMap(nodes);\n      }\n    });\n\n    Object.defineProperty(XMLDocType.prototype, 'notations', {\n      get: function() {\n        var child, i, len, nodes, ref;\n        nodes = {};\n        ref = this.children;\n        for (i = 0, len = ref.length; i < len; i++) {\n          child = ref[i];\n          if (child.type === NodeType.NotationDeclaration) {\n            nodes[child.name] = child;\n          }\n        }\n        return new XMLNamedNodeMap(nodes);\n      }\n    });\n\n    Object.defineProperty(XMLDocType.prototype, 'publicId', {\n      get: function() {\n        return this.pubID;\n      }\n    });\n\n    Object.defineProperty(XMLDocType.prototype, 'systemId', {\n      get: function() {\n        return this.sysID;\n      }\n    });\n\n    Object.defineProperty(XMLDocType.prototype, 'internalSubset', {\n      get: function() {\n        throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n      }\n    });\n\n    XMLDocType.prototype.element = function(name, value) {\n      var child;\n      child = new XMLDTDElement(this, name, value);\n      this.children.push(child);\n      return this;\n    };\n\n    XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {\n      var child;\n      child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);\n      this.children.push(child);\n      return this;\n    };\n\n    XMLDocType.prototype.entity = function(name, value) {\n      var child;\n      child = new XMLDTDEntity(this, false, name, value);\n      this.children.push(child);\n      return this;\n    };\n\n    XMLDocType.prototype.pEntity = function(name, value) {\n      var child;\n      child = new XMLDTDEntity(this, true, name, value);\n      this.children.push(child);\n      return this;\n    };\n\n    XMLDocType.prototype.notation = function(name, value) {\n      var child;\n      child = new XMLDTDNotation(this, name, value);\n      this.children.push(child);\n      return this;\n    };\n\n    XMLDocType.prototype.toString = function(options) {\n      return this.options.writer.docType(this, this.options.writer.filterOptions(options));\n    };\n\n    XMLDocType.prototype.ele = function(name, value) {\n      return this.element(name, value);\n    };\n\n    XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {\n      return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);\n    };\n\n    XMLDocType.prototype.ent = function(name, value) {\n      return this.entity(name, value);\n    };\n\n    XMLDocType.prototype.pent = function(name, value) {\n      return this.pEntity(name, value);\n    };\n\n    XMLDocType.prototype.not = function(name, value) {\n      return this.notation(name, value);\n    };\n\n    XMLDocType.prototype.up = function() {\n      return this.root() || this.documentObject;\n    };\n\n    XMLDocType.prototype.isEqualNode = function(node) {\n      if (!XMLDocType.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {\n        return false;\n      }\n      if (node.name !== this.name) {\n        return false;\n      }\n      if (node.publicId !== this.publicId) {\n        return false;\n      }\n      if (node.systemId !== this.systemId) {\n        return false;\n      }\n      return true;\n    };\n\n    return XMLDocType;\n\n  })(XMLNode);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, XMLNode, XMLRaw,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  NodeType = require('./NodeType');\n\n  XMLNode = require('./XMLNode');\n\n  module.exports = XMLRaw = (function(superClass) {\n    extend(XMLRaw, superClass);\n\n    function XMLRaw(parent, text) {\n      XMLRaw.__super__.constructor.call(this, parent);\n      if (text == null) {\n        throw new Error(\"Missing raw text. \" + this.debugInfo());\n      }\n      this.type = NodeType.Raw;\n      this.value = this.stringify.raw(text);\n    }\n\n    XMLRaw.prototype.clone = function() {\n      return Object.create(this);\n    };\n\n    XMLRaw.prototype.toString = function(options) {\n      return this.options.writer.raw(this, this.options.writer.filterOptions(options));\n    };\n\n    return XMLRaw;\n\n  })(XMLNode);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, XMLCharacterData, XMLText,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  NodeType = require('./NodeType');\n\n  XMLCharacterData = require('./XMLCharacterData');\n\n  module.exports = XMLText = (function(superClass) {\n    extend(XMLText, superClass);\n\n    function XMLText(parent, text) {\n      XMLText.__super__.constructor.call(this, parent);\n      if (text == null) {\n        throw new Error(\"Missing element text. \" + this.debugInfo());\n      }\n      this.name = \"#text\";\n      this.type = NodeType.Text;\n      this.value = this.stringify.text(text);\n    }\n\n    Object.defineProperty(XMLText.prototype, 'isElementContentWhitespace', {\n      get: function() {\n        throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n      }\n    });\n\n    Object.defineProperty(XMLText.prototype, 'wholeText', {\n      get: function() {\n        var next, prev, str;\n        str = '';\n        prev = this.previousSibling;\n        while (prev) {\n          str = prev.data + str;\n          prev = prev.previousSibling;\n        }\n        str += this.data;\n        next = this.nextSibling;\n        while (next) {\n          str = str + next.data;\n          next = next.nextSibling;\n        }\n        return str;\n      }\n    });\n\n    XMLText.prototype.clone = function() {\n      return Object.create(this);\n    };\n\n    XMLText.prototype.toString = function(options) {\n      return this.options.writer.text(this, this.options.writer.filterOptions(options));\n    };\n\n    XMLText.prototype.splitText = function(offset) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLText.prototype.replaceWholeText = function(content) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    return XMLText;\n\n  })(XMLCharacterData);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, XMLCharacterData, XMLProcessingInstruction,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  NodeType = require('./NodeType');\n\n  XMLCharacterData = require('./XMLCharacterData');\n\n  module.exports = XMLProcessingInstruction = (function(superClass) {\n    extend(XMLProcessingInstruction, superClass);\n\n    function XMLProcessingInstruction(parent, target, value) {\n      XMLProcessingInstruction.__super__.constructor.call(this, parent);\n      if (target == null) {\n        throw new Error(\"Missing instruction target. \" + this.debugInfo());\n      }\n      this.type = NodeType.ProcessingInstruction;\n      this.target = this.stringify.insTarget(target);\n      this.name = this.target;\n      if (value) {\n        this.value = this.stringify.insValue(value);\n      }\n    }\n\n    XMLProcessingInstruction.prototype.clone = function() {\n      return Object.create(this);\n    };\n\n    XMLProcessingInstruction.prototype.toString = function(options) {\n      return this.options.writer.processingInstruction(this, this.options.writer.filterOptions(options));\n    };\n\n    XMLProcessingInstruction.prototype.isEqualNode = function(node) {\n      if (!XMLProcessingInstruction.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {\n        return false;\n      }\n      if (node.target !== this.target) {\n        return false;\n      }\n      return true;\n    };\n\n    return XMLProcessingInstruction;\n\n  })(XMLCharacterData);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, XMLDummy, XMLNode,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  XMLNode = require('./XMLNode');\n\n  NodeType = require('./NodeType');\n\n  module.exports = XMLDummy = (function(superClass) {\n    extend(XMLDummy, superClass);\n\n    function XMLDummy(parent) {\n      XMLDummy.__super__.constructor.call(this, parent);\n      this.type = NodeType.Dummy;\n    }\n\n    XMLDummy.prototype.clone = function() {\n      return Object.create(this);\n    };\n\n    XMLDummy.prototype.toString = function(options) {\n      return '';\n    };\n\n    return XMLDummy;\n\n  })(XMLNode);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var XMLNodeList;\n\n  module.exports = XMLNodeList = (function() {\n    function XMLNodeList(nodes) {\n      this.nodes = nodes;\n    }\n\n    Object.defineProperty(XMLNodeList.prototype, 'length', {\n      get: function() {\n        return this.nodes.length || 0;\n      }\n    });\n\n    XMLNodeList.prototype.clone = function() {\n      return this.nodes = null;\n    };\n\n    XMLNodeList.prototype.item = function(index) {\n      return this.nodes[index] || null;\n    };\n\n    return XMLNodeList;\n\n  })();\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  module.exports = {\n    Disconnected: 1,\n    Preceding: 2,\n    Following: 4,\n    Contains: 8,\n    ContainedBy: 16,\n    ImplementationSpecific: 32\n  };\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction, isObject, ref1,\n    hasProp = {}.hasOwnProperty;\n\n  ref1 = require('./Utility'), isObject = ref1.isObject, isFunction = ref1.isFunction, isEmpty = ref1.isEmpty, getValue = ref1.getValue;\n\n  XMLElement = null;\n\n  XMLCData = null;\n\n  XMLComment = null;\n\n  XMLDeclaration = null;\n\n  XMLDocType = null;\n\n  XMLRaw = null;\n\n  XMLText = null;\n\n  XMLProcessingInstruction = null;\n\n  XMLDummy = null;\n\n  NodeType = null;\n\n  XMLNodeList = null;\n\n  XMLNamedNodeMap = null;\n\n  DocumentPosition = null;\n\n  module.exports = XMLNode = (function() {\n    function XMLNode(parent1) {\n      this.parent = parent1;\n      if (this.parent) {\n        this.options = this.parent.options;\n        this.stringify = this.parent.stringify;\n      }\n      this.value = null;\n      this.children = [];\n      this.baseURI = null;\n      if (!XMLElement) {\n        XMLElement = require('./XMLElement');\n        XMLCData = require('./XMLCData');\n        XMLComment = require('./XMLComment');\n        XMLDeclaration = require('./XMLDeclaration');\n        XMLDocType = require('./XMLDocType');\n        XMLRaw = require('./XMLRaw');\n        XMLText = require('./XMLText');\n        XMLProcessingInstruction = require('./XMLProcessingInstruction');\n        XMLDummy = require('./XMLDummy');\n        NodeType = require('./NodeType');\n        XMLNodeList = require('./XMLNodeList');\n        XMLNamedNodeMap = require('./XMLNamedNodeMap');\n        DocumentPosition = require('./DocumentPosition');\n      }\n    }\n\n    Object.defineProperty(XMLNode.prototype, 'nodeName', {\n      get: function() {\n        return this.name;\n      }\n    });\n\n    Object.defineProperty(XMLNode.prototype, 'nodeType', {\n      get: function() {\n        return this.type;\n      }\n    });\n\n    Object.defineProperty(XMLNode.prototype, 'nodeValue', {\n      get: function() {\n        return this.value;\n      }\n    });\n\n    Object.defineProperty(XMLNode.prototype, 'parentNode', {\n      get: function() {\n        return this.parent;\n      }\n    });\n\n    Object.defineProperty(XMLNode.prototype, 'childNodes', {\n      get: function() {\n        if (!this.childNodeList || !this.childNodeList.nodes) {\n          this.childNodeList = new XMLNodeList(this.children);\n        }\n        return this.childNodeList;\n      }\n    });\n\n    Object.defineProperty(XMLNode.prototype, 'firstChild', {\n      get: function() {\n        return this.children[0] || null;\n      }\n    });\n\n    Object.defineProperty(XMLNode.prototype, 'lastChild', {\n      get: function() {\n        return this.children[this.children.length - 1] || null;\n      }\n    });\n\n    Object.defineProperty(XMLNode.prototype, 'previousSibling', {\n      get: function() {\n        var i;\n        i = this.parent.children.indexOf(this);\n        return this.parent.children[i - 1] || null;\n      }\n    });\n\n    Object.defineProperty(XMLNode.prototype, 'nextSibling', {\n      get: function() {\n        var i;\n        i = this.parent.children.indexOf(this);\n        return this.parent.children[i + 1] || null;\n      }\n    });\n\n    Object.defineProperty(XMLNode.prototype, 'ownerDocument', {\n      get: function() {\n        return this.document() || null;\n      }\n    });\n\n    Object.defineProperty(XMLNode.prototype, 'textContent', {\n      get: function() {\n        var child, j, len, ref2, str;\n        if (this.nodeType === NodeType.Element || this.nodeType === NodeType.DocumentFragment) {\n          str = '';\n          ref2 = this.children;\n          for (j = 0, len = ref2.length; j < len; j++) {\n            child = ref2[j];\n            if (child.textContent) {\n              str += child.textContent;\n            }\n          }\n          return str;\n        } else {\n          return null;\n        }\n      },\n      set: function(value) {\n        throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n      }\n    });\n\n    XMLNode.prototype.setParent = function(parent) {\n      var child, j, len, ref2, results;\n      this.parent = parent;\n      if (parent) {\n        this.options = parent.options;\n        this.stringify = parent.stringify;\n      }\n      ref2 = this.children;\n      results = [];\n      for (j = 0, len = ref2.length; j < len; j++) {\n        child = ref2[j];\n        results.push(child.setParent(this));\n      }\n      return results;\n    };\n\n    XMLNode.prototype.element = function(name, attributes, text) {\n      var childNode, item, j, k, key, lastChild, len, len1, ref2, ref3, val;\n      lastChild = null;\n      if (attributes === null && (text == null)) {\n        ref2 = [{}, null], attributes = ref2[0], text = ref2[1];\n      }\n      if (attributes == null) {\n        attributes = {};\n      }\n      attributes = getValue(attributes);\n      if (!isObject(attributes)) {\n        ref3 = [attributes, text], text = ref3[0], attributes = ref3[1];\n      }\n      if (name != null) {\n        name = getValue(name);\n      }\n      if (Array.isArray(name)) {\n        for (j = 0, len = name.length; j < len; j++) {\n          item = name[j];\n          lastChild = this.element(item);\n        }\n      } else if (isFunction(name)) {\n        lastChild = this.element(name.apply());\n      } else if (isObject(name)) {\n        for (key in name) {\n          if (!hasProp.call(name, key)) continue;\n          val = name[key];\n          if (isFunction(val)) {\n            val = val.apply();\n          }\n          if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) {\n            lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);\n          } else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty(val)) {\n            lastChild = this.dummy();\n          } else if (isObject(val) && isEmpty(val)) {\n            lastChild = this.element(key);\n          } else if (!this.options.keepNullNodes && (val == null)) {\n            lastChild = this.dummy();\n          } else if (!this.options.separateArrayItems && Array.isArray(val)) {\n            for (k = 0, len1 = val.length; k < len1; k++) {\n              item = val[k];\n              childNode = {};\n              childNode[key] = item;\n              lastChild = this.element(childNode);\n            }\n          } else if (isObject(val)) {\n            if (!this.options.ignoreDecorators && this.stringify.convertTextKey && key.indexOf(this.stringify.convertTextKey) === 0) {\n              lastChild = this.element(val);\n            } else {\n              lastChild = this.element(key);\n              lastChild.element(val);\n            }\n          } else {\n            lastChild = this.element(key, val);\n          }\n        }\n      } else if (!this.options.keepNullNodes && text === null) {\n        lastChild = this.dummy();\n      } else {\n        if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) {\n          lastChild = this.text(text);\n        } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) {\n          lastChild = this.cdata(text);\n        } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) {\n          lastChild = this.comment(text);\n        } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) {\n          lastChild = this.raw(text);\n        } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) {\n          lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text);\n        } else {\n          lastChild = this.node(name, attributes, text);\n        }\n      }\n      if (lastChild == null) {\n        throw new Error(\"Could not create any elements with: \" + name + \". \" + this.debugInfo());\n      }\n      return lastChild;\n    };\n\n    XMLNode.prototype.insertBefore = function(name, attributes, text) {\n      var child, i, newChild, refChild, removed;\n      if (name != null ? name.type : void 0) {\n        newChild = name;\n        refChild = attributes;\n        newChild.setParent(this);\n        if (refChild) {\n          i = children.indexOf(refChild);\n          removed = children.splice(i);\n          children.push(newChild);\n          Array.prototype.push.apply(children, removed);\n        } else {\n          children.push(newChild);\n        }\n        return newChild;\n      } else {\n        if (this.isRoot) {\n          throw new Error(\"Cannot insert elements at root level. \" + this.debugInfo(name));\n        }\n        i = this.parent.children.indexOf(this);\n        removed = this.parent.children.splice(i);\n        child = this.parent.element(name, attributes, text);\n        Array.prototype.push.apply(this.parent.children, removed);\n        return child;\n      }\n    };\n\n    XMLNode.prototype.insertAfter = function(name, attributes, text) {\n      var child, i, removed;\n      if (this.isRoot) {\n        throw new Error(\"Cannot insert elements at root level. \" + this.debugInfo(name));\n      }\n      i = this.parent.children.indexOf(this);\n      removed = this.parent.children.splice(i + 1);\n      child = this.parent.element(name, attributes, text);\n      Array.prototype.push.apply(this.parent.children, removed);\n      return child;\n    };\n\n    XMLNode.prototype.remove = function() {\n      var i, ref2;\n      if (this.isRoot) {\n        throw new Error(\"Cannot remove the root element. \" + this.debugInfo());\n      }\n      i = this.parent.children.indexOf(this);\n      [].splice.apply(this.parent.children, [i, i - i + 1].concat(ref2 = [])), ref2;\n      return this.parent;\n    };\n\n    XMLNode.prototype.node = function(name, attributes, text) {\n      var child, ref2;\n      if (name != null) {\n        name = getValue(name);\n      }\n      attributes || (attributes = {});\n      attributes = getValue(attributes);\n      if (!isObject(attributes)) {\n        ref2 = [attributes, text], text = ref2[0], attributes = ref2[1];\n      }\n      child = new XMLElement(this, name, attributes);\n      if (text != null) {\n        child.text(text);\n      }\n      this.children.push(child);\n      return child;\n    };\n\n    XMLNode.prototype.text = function(value) {\n      var child;\n      if (isObject(value)) {\n        this.element(value);\n      }\n      child = new XMLText(this, value);\n      this.children.push(child);\n      return this;\n    };\n\n    XMLNode.prototype.cdata = function(value) {\n      var child;\n      child = new XMLCData(this, value);\n      this.children.push(child);\n      return this;\n    };\n\n    XMLNode.prototype.comment = function(value) {\n      var child;\n      child = new XMLComment(this, value);\n      this.children.push(child);\n      return this;\n    };\n\n    XMLNode.prototype.commentBefore = function(value) {\n      var child, i, removed;\n      i = this.parent.children.indexOf(this);\n      removed = this.parent.children.splice(i);\n      child = this.parent.comment(value);\n      Array.prototype.push.apply(this.parent.children, removed);\n      return this;\n    };\n\n    XMLNode.prototype.commentAfter = function(value) {\n      var child, i, removed;\n      i = this.parent.children.indexOf(this);\n      removed = this.parent.children.splice(i + 1);\n      child = this.parent.comment(value);\n      Array.prototype.push.apply(this.parent.children, removed);\n      return this;\n    };\n\n    XMLNode.prototype.raw = function(value) {\n      var child;\n      child = new XMLRaw(this, value);\n      this.children.push(child);\n      return this;\n    };\n\n    XMLNode.prototype.dummy = function() {\n      var child;\n      child = new XMLDummy(this);\n      return child;\n    };\n\n    XMLNode.prototype.instruction = function(target, value) {\n      var insTarget, insValue, instruction, j, len;\n      if (target != null) {\n        target = getValue(target);\n      }\n      if (value != null) {\n        value = getValue(value);\n      }\n      if (Array.isArray(target)) {\n        for (j = 0, len = target.length; j < len; j++) {\n          insTarget = target[j];\n          this.instruction(insTarget);\n        }\n      } else if (isObject(target)) {\n        for (insTarget in target) {\n          if (!hasProp.call(target, insTarget)) continue;\n          insValue = target[insTarget];\n          this.instruction(insTarget, insValue);\n        }\n      } else {\n        if (isFunction(value)) {\n          value = value.apply();\n        }\n        instruction = new XMLProcessingInstruction(this, target, value);\n        this.children.push(instruction);\n      }\n      return this;\n    };\n\n    XMLNode.prototype.instructionBefore = function(target, value) {\n      var child, i, removed;\n      i = this.parent.children.indexOf(this);\n      removed = this.parent.children.splice(i);\n      child = this.parent.instruction(target, value);\n      Array.prototype.push.apply(this.parent.children, removed);\n      return this;\n    };\n\n    XMLNode.prototype.instructionAfter = function(target, value) {\n      var child, i, removed;\n      i = this.parent.children.indexOf(this);\n      removed = this.parent.children.splice(i + 1);\n      child = this.parent.instruction(target, value);\n      Array.prototype.push.apply(this.parent.children, removed);\n      return this;\n    };\n\n    XMLNode.prototype.declaration = function(version, encoding, standalone) {\n      var doc, xmldec;\n      doc = this.document();\n      xmldec = new XMLDeclaration(doc, version, encoding, standalone);\n      if (doc.children.length === 0) {\n        doc.children.unshift(xmldec);\n      } else if (doc.children[0].type === NodeType.Declaration) {\n        doc.children[0] = xmldec;\n      } else {\n        doc.children.unshift(xmldec);\n      }\n      return doc.root() || doc;\n    };\n\n    XMLNode.prototype.dtd = function(pubID, sysID) {\n      var child, doc, doctype, i, j, k, len, len1, ref2, ref3;\n      doc = this.document();\n      doctype = new XMLDocType(doc, pubID, sysID);\n      ref2 = doc.children;\n      for (i = j = 0, len = ref2.length; j < len; i = ++j) {\n        child = ref2[i];\n        if (child.type === NodeType.DocType) {\n          doc.children[i] = doctype;\n          return doctype;\n        }\n      }\n      ref3 = doc.children;\n      for (i = k = 0, len1 = ref3.length; k < len1; i = ++k) {\n        child = ref3[i];\n        if (child.isRoot) {\n          doc.children.splice(i, 0, doctype);\n          return doctype;\n        }\n      }\n      doc.children.push(doctype);\n      return doctype;\n    };\n\n    XMLNode.prototype.up = function() {\n      if (this.isRoot) {\n        throw new Error(\"The root node has no parent. Use doc() if you need to get the document object.\");\n      }\n      return this.parent;\n    };\n\n    XMLNode.prototype.root = function() {\n      var node;\n      node = this;\n      while (node) {\n        if (node.type === NodeType.Document) {\n          return node.rootObject;\n        } else if (node.isRoot) {\n          return node;\n        } else {\n          node = node.parent;\n        }\n      }\n    };\n\n    XMLNode.prototype.document = function() {\n      var node;\n      node = this;\n      while (node) {\n        if (node.type === NodeType.Document) {\n          return node;\n        } else {\n          node = node.parent;\n        }\n      }\n    };\n\n    XMLNode.prototype.end = function(options) {\n      return this.document().end(options);\n    };\n\n    XMLNode.prototype.prev = function() {\n      var i;\n      i = this.parent.children.indexOf(this);\n      if (i < 1) {\n        throw new Error(\"Already at the first node. \" + this.debugInfo());\n      }\n      return this.parent.children[i - 1];\n    };\n\n    XMLNode.prototype.next = function() {\n      var i;\n      i = this.parent.children.indexOf(this);\n      if (i === -1 || i === this.parent.children.length - 1) {\n        throw new Error(\"Already at the last node. \" + this.debugInfo());\n      }\n      return this.parent.children[i + 1];\n    };\n\n    XMLNode.prototype.importDocument = function(doc) {\n      var clonedRoot;\n      clonedRoot = doc.root().clone();\n      clonedRoot.parent = this;\n      clonedRoot.isRoot = false;\n      this.children.push(clonedRoot);\n      return this;\n    };\n\n    XMLNode.prototype.debugInfo = function(name) {\n      var ref2, ref3;\n      name = name || this.name;\n      if ((name == null) && !((ref2 = this.parent) != null ? ref2.name : void 0)) {\n        return \"\";\n      } else if (name == null) {\n        return \"parent: <\" + this.parent.name + \">\";\n      } else if (!((ref3 = this.parent) != null ? ref3.name : void 0)) {\n        return \"node: <\" + name + \">\";\n      } else {\n        return \"node: <\" + name + \">, parent: <\" + this.parent.name + \">\";\n      }\n    };\n\n    XMLNode.prototype.ele = function(name, attributes, text) {\n      return this.element(name, attributes, text);\n    };\n\n    XMLNode.prototype.nod = function(name, attributes, text) {\n      return this.node(name, attributes, text);\n    };\n\n    XMLNode.prototype.txt = function(value) {\n      return this.text(value);\n    };\n\n    XMLNode.prototype.dat = function(value) {\n      return this.cdata(value);\n    };\n\n    XMLNode.prototype.com = function(value) {\n      return this.comment(value);\n    };\n\n    XMLNode.prototype.ins = function(target, value) {\n      return this.instruction(target, value);\n    };\n\n    XMLNode.prototype.doc = function() {\n      return this.document();\n    };\n\n    XMLNode.prototype.dec = function(version, encoding, standalone) {\n      return this.declaration(version, encoding, standalone);\n    };\n\n    XMLNode.prototype.e = function(name, attributes, text) {\n      return this.element(name, attributes, text);\n    };\n\n    XMLNode.prototype.n = function(name, attributes, text) {\n      return this.node(name, attributes, text);\n    };\n\n    XMLNode.prototype.t = function(value) {\n      return this.text(value);\n    };\n\n    XMLNode.prototype.d = function(value) {\n      return this.cdata(value);\n    };\n\n    XMLNode.prototype.c = function(value) {\n      return this.comment(value);\n    };\n\n    XMLNode.prototype.r = function(value) {\n      return this.raw(value);\n    };\n\n    XMLNode.prototype.i = function(target, value) {\n      return this.instruction(target, value);\n    };\n\n    XMLNode.prototype.u = function() {\n      return this.up();\n    };\n\n    XMLNode.prototype.importXMLBuilder = function(doc) {\n      return this.importDocument(doc);\n    };\n\n    XMLNode.prototype.replaceChild = function(newChild, oldChild) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLNode.prototype.removeChild = function(oldChild) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLNode.prototype.appendChild = function(newChild) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLNode.prototype.hasChildNodes = function() {\n      return this.children.length !== 0;\n    };\n\n    XMLNode.prototype.cloneNode = function(deep) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLNode.prototype.normalize = function() {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLNode.prototype.isSupported = function(feature, version) {\n      return true;\n    };\n\n    XMLNode.prototype.hasAttributes = function() {\n      return this.attribs.length !== 0;\n    };\n\n    XMLNode.prototype.compareDocumentPosition = function(other) {\n      var ref, res;\n      ref = this;\n      if (ref === other) {\n        return 0;\n      } else if (this.document() !== other.document()) {\n        res = DocumentPosition.Disconnected | DocumentPosition.ImplementationSpecific;\n        if (Math.random() < 0.5) {\n          res |= DocumentPosition.Preceding;\n        } else {\n          res |= DocumentPosition.Following;\n        }\n        return res;\n      } else if (ref.isAncestor(other)) {\n        return DocumentPosition.Contains | DocumentPosition.Preceding;\n      } else if (ref.isDescendant(other)) {\n        return DocumentPosition.Contains | DocumentPosition.Following;\n      } else if (ref.isPreceding(other)) {\n        return DocumentPosition.Preceding;\n      } else {\n        return DocumentPosition.Following;\n      }\n    };\n\n    XMLNode.prototype.isSameNode = function(other) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLNode.prototype.lookupPrefix = function(namespaceURI) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLNode.prototype.isDefaultNamespace = function(namespaceURI) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLNode.prototype.lookupNamespaceURI = function(prefix) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLNode.prototype.isEqualNode = function(node) {\n      var i, j, ref2;\n      if (node.nodeType !== this.nodeType) {\n        return false;\n      }\n      if (node.children.length !== this.children.length) {\n        return false;\n      }\n      for (i = j = 0, ref2 = this.children.length - 1; 0 <= ref2 ? j <= ref2 : j >= ref2; i = 0 <= ref2 ? ++j : --j) {\n        if (!this.children[i].isEqualNode(node.children[i])) {\n          return false;\n        }\n      }\n      return true;\n    };\n\n    XMLNode.prototype.getFeature = function(feature, version) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLNode.prototype.setUserData = function(key, data, handler) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLNode.prototype.getUserData = function(key) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLNode.prototype.contains = function(other) {\n      if (!other) {\n        return false;\n      }\n      return other === this || this.isDescendant(other);\n    };\n\n    XMLNode.prototype.isDescendant = function(node) {\n      var child, isDescendantChild, j, len, ref2;\n      ref2 = this.children;\n      for (j = 0, len = ref2.length; j < len; j++) {\n        child = ref2[j];\n        if (node === child) {\n          return true;\n        }\n        isDescendantChild = child.isDescendant(node);\n        if (isDescendantChild) {\n          return true;\n        }\n      }\n      return false;\n    };\n\n    XMLNode.prototype.isAncestor = function(node) {\n      return node.isDescendant(this);\n    };\n\n    XMLNode.prototype.isPreceding = function(node) {\n      var nodePos, thisPos;\n      nodePos = this.treePosition(node);\n      thisPos = this.treePosition(this);\n      if (nodePos === -1 || thisPos === -1) {\n        return false;\n      } else {\n        return nodePos < thisPos;\n      }\n    };\n\n    XMLNode.prototype.isFollowing = function(node) {\n      var nodePos, thisPos;\n      nodePos = this.treePosition(node);\n      thisPos = this.treePosition(this);\n      if (nodePos === -1 || thisPos === -1) {\n        return false;\n      } else {\n        return nodePos > thisPos;\n      }\n    };\n\n    XMLNode.prototype.treePosition = function(node) {\n      var found, pos;\n      pos = 0;\n      found = false;\n      this.foreachTreeNode(this.document(), function(childNode) {\n        pos++;\n        if (!found && childNode === node) {\n          return found = true;\n        }\n      });\n      if (found) {\n        return pos;\n      } else {\n        return -1;\n      }\n    };\n\n    XMLNode.prototype.foreachTreeNode = function(node, func) {\n      var child, j, len, ref2, res;\n      node || (node = this.document());\n      ref2 = node.children;\n      for (j = 0, len = ref2.length; j < len; j++) {\n        child = ref2[j];\n        if (res = func(child)) {\n          return res;\n        } else {\n          res = this.foreachTreeNode(child, func);\n          if (res) {\n            return res;\n          }\n        }\n      }\n    };\n\n    return XMLNode;\n\n  })();\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var XMLStringifier,\n    bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n    hasProp = {}.hasOwnProperty;\n\n  module.exports = XMLStringifier = (function() {\n    function XMLStringifier(options) {\n      this.assertLegalName = bind(this.assertLegalName, this);\n      this.assertLegalChar = bind(this.assertLegalChar, this);\n      var key, ref, value;\n      options || (options = {});\n      this.options = options;\n      if (!this.options.version) {\n        this.options.version = '1.0';\n      }\n      ref = options.stringify || {};\n      for (key in ref) {\n        if (!hasProp.call(ref, key)) continue;\n        value = ref[key];\n        this[key] = value;\n      }\n    }\n\n    XMLStringifier.prototype.name = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      return this.assertLegalName('' + val || '');\n    };\n\n    XMLStringifier.prototype.text = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      return this.assertLegalChar(this.textEscape('' + val || ''));\n    };\n\n    XMLStringifier.prototype.cdata = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      val = '' + val || '';\n      val = val.replace(']]>', ']]]]>');\n      return this.assertLegalChar(val);\n    };\n\n    XMLStringifier.prototype.comment = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      val = '' + val || '';\n      if (val.match(/--/)) {\n        throw new Error(\"Comment text cannot contain double-hypen: \" + val);\n      }\n      return this.assertLegalChar(val);\n    };\n\n    XMLStringifier.prototype.raw = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      return '' + val || '';\n    };\n\n    XMLStringifier.prototype.attValue = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      return this.assertLegalChar(this.attEscape(val = '' + val || ''));\n    };\n\n    XMLStringifier.prototype.insTarget = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      return this.assertLegalChar('' + val || '');\n    };\n\n    XMLStringifier.prototype.insValue = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      val = '' + val || '';\n      if (val.match(/\\?>/)) {\n        throw new Error(\"Invalid processing instruction value: \" + val);\n      }\n      return this.assertLegalChar(val);\n    };\n\n    XMLStringifier.prototype.xmlVersion = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      val = '' + val || '';\n      if (!val.match(/1\\.[0-9]+/)) {\n        throw new Error(\"Invalid version number: \" + val);\n      }\n      return val;\n    };\n\n    XMLStringifier.prototype.xmlEncoding = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      val = '' + val || '';\n      if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) {\n        throw new Error(\"Invalid encoding: \" + val);\n      }\n      return this.assertLegalChar(val);\n    };\n\n    XMLStringifier.prototype.xmlStandalone = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      if (val) {\n        return \"yes\";\n      } else {\n        return \"no\";\n      }\n    };\n\n    XMLStringifier.prototype.dtdPubID = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      return this.assertLegalChar('' + val || '');\n    };\n\n    XMLStringifier.prototype.dtdSysID = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      return this.assertLegalChar('' + val || '');\n    };\n\n    XMLStringifier.prototype.dtdElementValue = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      return this.assertLegalChar('' + val || '');\n    };\n\n    XMLStringifier.prototype.dtdAttType = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      return this.assertLegalChar('' + val || '');\n    };\n\n    XMLStringifier.prototype.dtdAttDefault = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      return this.assertLegalChar('' + val || '');\n    };\n\n    XMLStringifier.prototype.dtdEntityValue = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      return this.assertLegalChar('' + val || '');\n    };\n\n    XMLStringifier.prototype.dtdNData = function(val) {\n      if (this.options.noValidation) {\n        return val;\n      }\n      return this.assertLegalChar('' + val || '');\n    };\n\n    XMLStringifier.prototype.convertAttKey = '@';\n\n    XMLStringifier.prototype.convertPIKey = '?';\n\n    XMLStringifier.prototype.convertTextKey = '#text';\n\n    XMLStringifier.prototype.convertCDataKey = '#cdata';\n\n    XMLStringifier.prototype.convertCommentKey = '#comment';\n\n    XMLStringifier.prototype.convertRawKey = '#raw';\n\n    XMLStringifier.prototype.assertLegalChar = function(str) {\n      var regex, res;\n      if (this.options.noValidation) {\n        return str;\n      }\n      regex = '';\n      if (this.options.version === '1.0') {\n        regex = /[\\0-\\x08\\x0B\\f\\x0E-\\x1F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/;\n        if (res = str.match(regex)) {\n          throw new Error(\"Invalid character in string: \" + str + \" at index \" + res.index);\n        }\n      } else if (this.options.version === '1.1') {\n        regex = /[\\0\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/;\n        if (res = str.match(regex)) {\n          throw new Error(\"Invalid character in string: \" + str + \" at index \" + res.index);\n        }\n      }\n      return str;\n    };\n\n    XMLStringifier.prototype.assertLegalName = function(str) {\n      var regex;\n      if (this.options.noValidation) {\n        return str;\n      }\n      this.assertLegalChar(str);\n      regex = /^([:A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|[\\uD800-\\uDB7F][\\uDC00-\\uDFFF])([\\x2D\\.0-:A-Z_a-z\\xB7\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u037D\\u037F-\\u1FFF\\u200C\\u200D\\u203F\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|[\\uD800-\\uDB7F][\\uDC00-\\uDFFF])*$/;\n      if (!str.match(regex)) {\n        throw new Error(\"Invalid character in name\");\n      }\n      return str;\n    };\n\n    XMLStringifier.prototype.textEscape = function(str) {\n      var ampregex;\n      if (this.options.noValidation) {\n        return str;\n      }\n      ampregex = this.options.noDoubleEncoding ? /(?!&\\S+;)&/g : /&/g;\n      return str.replace(ampregex, '&').replace(//g, '>').replace(/\\r/g, '
');\n    };\n\n    XMLStringifier.prototype.attEscape = function(str) {\n      var ampregex;\n      if (this.options.noValidation) {\n        return str;\n      }\n      ampregex = this.options.noDoubleEncoding ? /(?!&\\S+;)&/g : /&/g;\n      return str.replace(ampregex, '&').replace(/ 0) {\n          return new Array(indentLevel).join(options.indent);\n        }\n      }\n      return '';\n    };\n\n    XMLWriterBase.prototype.endline = function(node, options, level) {\n      if (!options.pretty || options.suppressPrettyCount) {\n        return '';\n      } else {\n        return options.newline;\n      }\n    };\n\n    XMLWriterBase.prototype.attribute = function(att, options, level) {\n      var r;\n      this.openAttribute(att, options, level);\n      r = ' ' + att.name + '=\"' + att.value + '\"';\n      this.closeAttribute(att, options, level);\n      return r;\n    };\n\n    XMLWriterBase.prototype.cdata = function(node, options, level) {\n      var r;\n      this.openNode(node, options, level);\n      options.state = WriterState.OpenTag;\n      r = this.indent(node, options, level) + '' + this.endline(node, options, level);\n      options.state = WriterState.None;\n      this.closeNode(node, options, level);\n      return r;\n    };\n\n    XMLWriterBase.prototype.comment = function(node, options, level) {\n      var r;\n      this.openNode(node, options, level);\n      options.state = WriterState.OpenTag;\n      r = this.indent(node, options, level) + '' + this.endline(node, options, level);\n      options.state = WriterState.None;\n      this.closeNode(node, options, level);\n      return r;\n    };\n\n    XMLWriterBase.prototype.declaration = function(node, options, level) {\n      var r;\n      this.openNode(node, options, level);\n      options.state = WriterState.OpenTag;\n      r = this.indent(node, options, level) + '';\n      r += this.endline(node, options, level);\n      options.state = WriterState.None;\n      this.closeNode(node, options, level);\n      return r;\n    };\n\n    XMLWriterBase.prototype.docType = function(node, options, level) {\n      var child, i, len, r, ref;\n      level || (level = 0);\n      this.openNode(node, options, level);\n      options.state = WriterState.OpenTag;\n      r = this.indent(node, options, level);\n      r += ' 0) {\n        r += ' [';\n        r += this.endline(node, options, level);\n        options.state = WriterState.InsideTag;\n        ref = node.children;\n        for (i = 0, len = ref.length; i < len; i++) {\n          child = ref[i];\n          r += this.writeChildNode(child, options, level + 1);\n        }\n        options.state = WriterState.CloseTag;\n        r += ']';\n      }\n      options.state = WriterState.CloseTag;\n      r += options.spaceBeforeSlash + '>';\n      r += this.endline(node, options, level);\n      options.state = WriterState.None;\n      this.closeNode(node, options, level);\n      return r;\n    };\n\n    XMLWriterBase.prototype.element = function(node, options, level) {\n      var att, child, childNodeCount, firstChildNode, i, j, len, len1, name, prettySuppressed, r, ref, ref1, ref2;\n      level || (level = 0);\n      prettySuppressed = false;\n      r = '';\n      this.openNode(node, options, level);\n      options.state = WriterState.OpenTag;\n      r += this.indent(node, options, level) + '<' + node.name;\n      ref = node.attribs;\n      for (name in ref) {\n        if (!hasProp.call(ref, name)) continue;\n        att = ref[name];\n        r += this.attribute(att, options, level);\n      }\n      childNodeCount = node.children.length;\n      firstChildNode = childNodeCount === 0 ? null : node.children[0];\n      if (childNodeCount === 0 || node.children.every(function(e) {\n        return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === '';\n      })) {\n        if (options.allowEmpty) {\n          r += '>';\n          options.state = WriterState.CloseTag;\n          r += '' + this.endline(node, options, level);\n        } else {\n          options.state = WriterState.CloseTag;\n          r += options.spaceBeforeSlash + '/>' + this.endline(node, options, level);\n        }\n      } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && (firstChildNode.value != null)) {\n        r += '>';\n        options.state = WriterState.InsideTag;\n        options.suppressPrettyCount++;\n        prettySuppressed = true;\n        r += this.writeChildNode(firstChildNode, options, level + 1);\n        options.suppressPrettyCount--;\n        prettySuppressed = false;\n        options.state = WriterState.CloseTag;\n        r += '' + this.endline(node, options, level);\n      } else {\n        if (options.dontPrettyTextNodes) {\n          ref1 = node.children;\n          for (i = 0, len = ref1.length; i < len; i++) {\n            child = ref1[i];\n            if ((child.type === NodeType.Text || child.type === NodeType.Raw) && (child.value != null)) {\n              options.suppressPrettyCount++;\n              prettySuppressed = true;\n              break;\n            }\n          }\n        }\n        r += '>' + this.endline(node, options, level);\n        options.state = WriterState.InsideTag;\n        ref2 = node.children;\n        for (j = 0, len1 = ref2.length; j < len1; j++) {\n          child = ref2[j];\n          r += this.writeChildNode(child, options, level + 1);\n        }\n        options.state = WriterState.CloseTag;\n        r += this.indent(node, options, level) + '';\n        if (prettySuppressed) {\n          options.suppressPrettyCount--;\n        }\n        r += this.endline(node, options, level);\n        options.state = WriterState.None;\n      }\n      this.closeNode(node, options, level);\n      return r;\n    };\n\n    XMLWriterBase.prototype.writeChildNode = function(node, options, level) {\n      switch (node.type) {\n        case NodeType.CData:\n          return this.cdata(node, options, level);\n        case NodeType.Comment:\n          return this.comment(node, options, level);\n        case NodeType.Element:\n          return this.element(node, options, level);\n        case NodeType.Raw:\n          return this.raw(node, options, level);\n        case NodeType.Text:\n          return this.text(node, options, level);\n        case NodeType.ProcessingInstruction:\n          return this.processingInstruction(node, options, level);\n        case NodeType.Dummy:\n          return '';\n        case NodeType.Declaration:\n          return this.declaration(node, options, level);\n        case NodeType.DocType:\n          return this.docType(node, options, level);\n        case NodeType.AttributeDeclaration:\n          return this.dtdAttList(node, options, level);\n        case NodeType.ElementDeclaration:\n          return this.dtdElement(node, options, level);\n        case NodeType.EntityDeclaration:\n          return this.dtdEntity(node, options, level);\n        case NodeType.NotationDeclaration:\n          return this.dtdNotation(node, options, level);\n        default:\n          throw new Error(\"Unknown XML node type: \" + node.constructor.name);\n      }\n    };\n\n    XMLWriterBase.prototype.processingInstruction = function(node, options, level) {\n      var r;\n      this.openNode(node, options, level);\n      options.state = WriterState.OpenTag;\n      r = this.indent(node, options, level) + '';\n      r += this.endline(node, options, level);\n      options.state = WriterState.None;\n      this.closeNode(node, options, level);\n      return r;\n    };\n\n    XMLWriterBase.prototype.raw = function(node, options, level) {\n      var r;\n      this.openNode(node, options, level);\n      options.state = WriterState.OpenTag;\n      r = this.indent(node, options, level);\n      options.state = WriterState.InsideTag;\n      r += node.value;\n      options.state = WriterState.CloseTag;\n      r += this.endline(node, options, level);\n      options.state = WriterState.None;\n      this.closeNode(node, options, level);\n      return r;\n    };\n\n    XMLWriterBase.prototype.text = function(node, options, level) {\n      var r;\n      this.openNode(node, options, level);\n      options.state = WriterState.OpenTag;\n      r = this.indent(node, options, level);\n      options.state = WriterState.InsideTag;\n      r += node.value;\n      options.state = WriterState.CloseTag;\n      r += this.endline(node, options, level);\n      options.state = WriterState.None;\n      this.closeNode(node, options, level);\n      return r;\n    };\n\n    XMLWriterBase.prototype.dtdAttList = function(node, options, level) {\n      var r;\n      this.openNode(node, options, level);\n      options.state = WriterState.OpenTag;\n      r = this.indent(node, options, level) + '' + this.endline(node, options, level);\n      options.state = WriterState.None;\n      this.closeNode(node, options, level);\n      return r;\n    };\n\n    XMLWriterBase.prototype.dtdElement = function(node, options, level) {\n      var r;\n      this.openNode(node, options, level);\n      options.state = WriterState.OpenTag;\n      r = this.indent(node, options, level) + '' + this.endline(node, options, level);\n      options.state = WriterState.None;\n      this.closeNode(node, options, level);\n      return r;\n    };\n\n    XMLWriterBase.prototype.dtdEntity = function(node, options, level) {\n      var r;\n      this.openNode(node, options, level);\n      options.state = WriterState.OpenTag;\n      r = this.indent(node, options, level) + '' + this.endline(node, options, level);\n      options.state = WriterState.None;\n      this.closeNode(node, options, level);\n      return r;\n    };\n\n    XMLWriterBase.prototype.dtdNotation = function(node, options, level) {\n      var r;\n      this.openNode(node, options, level);\n      options.state = WriterState.OpenTag;\n      r = this.indent(node, options, level) + '' + this.endline(node, options, level);\n      options.state = WriterState.None;\n      this.closeNode(node, options, level);\n      return r;\n    };\n\n    XMLWriterBase.prototype.openNode = function(node, options, level) {};\n\n    XMLWriterBase.prototype.closeNode = function(node, options, level) {};\n\n    XMLWriterBase.prototype.openAttribute = function(att, options, level) {};\n\n    XMLWriterBase.prototype.closeAttribute = function(att, options, level) {};\n\n    return XMLWriterBase;\n\n  })();\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var XMLStringWriter, XMLWriterBase,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  XMLWriterBase = require('./XMLWriterBase');\n\n  module.exports = XMLStringWriter = (function(superClass) {\n    extend(XMLStringWriter, superClass);\n\n    function XMLStringWriter(options) {\n      XMLStringWriter.__super__.constructor.call(this, options);\n    }\n\n    XMLStringWriter.prototype.document = function(doc, options) {\n      var child, i, len, r, ref;\n      options = this.filterOptions(options);\n      r = '';\n      ref = doc.children;\n      for (i = 0, len = ref.length; i < len; i++) {\n        child = ref[i];\n        r += this.writeChildNode(child, options, 0);\n      }\n      if (options.pretty && r.slice(-options.newline.length) === options.newline) {\n        r = r.slice(0, -options.newline.length);\n      }\n      return r;\n    };\n\n    return XMLStringWriter;\n\n  })(XMLWriterBase);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  isPlainObject = require('./Utility').isPlainObject;\n\n  XMLDOMImplementation = require('./XMLDOMImplementation');\n\n  XMLDOMConfiguration = require('./XMLDOMConfiguration');\n\n  XMLNode = require('./XMLNode');\n\n  NodeType = require('./NodeType');\n\n  XMLStringifier = require('./XMLStringifier');\n\n  XMLStringWriter = require('./XMLStringWriter');\n\n  module.exports = XMLDocument = (function(superClass) {\n    extend(XMLDocument, superClass);\n\n    function XMLDocument(options) {\n      XMLDocument.__super__.constructor.call(this, null);\n      this.name = \"#document\";\n      this.type = NodeType.Document;\n      this.documentURI = null;\n      this.domConfig = new XMLDOMConfiguration();\n      options || (options = {});\n      if (!options.writer) {\n        options.writer = new XMLStringWriter();\n      }\n      this.options = options;\n      this.stringify = new XMLStringifier(options);\n    }\n\n    Object.defineProperty(XMLDocument.prototype, 'implementation', {\n      value: new XMLDOMImplementation()\n    });\n\n    Object.defineProperty(XMLDocument.prototype, 'doctype', {\n      get: function() {\n        var child, i, len, ref;\n        ref = this.children;\n        for (i = 0, len = ref.length; i < len; i++) {\n          child = ref[i];\n          if (child.type === NodeType.DocType) {\n            return child;\n          }\n        }\n        return null;\n      }\n    });\n\n    Object.defineProperty(XMLDocument.prototype, 'documentElement', {\n      get: function() {\n        return this.rootObject || null;\n      }\n    });\n\n    Object.defineProperty(XMLDocument.prototype, 'inputEncoding', {\n      get: function() {\n        return null;\n      }\n    });\n\n    Object.defineProperty(XMLDocument.prototype, 'strictErrorChecking', {\n      get: function() {\n        return false;\n      }\n    });\n\n    Object.defineProperty(XMLDocument.prototype, 'xmlEncoding', {\n      get: function() {\n        if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {\n          return this.children[0].encoding;\n        } else {\n          return null;\n        }\n      }\n    });\n\n    Object.defineProperty(XMLDocument.prototype, 'xmlStandalone', {\n      get: function() {\n        if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {\n          return this.children[0].standalone === 'yes';\n        } else {\n          return false;\n        }\n      }\n    });\n\n    Object.defineProperty(XMLDocument.prototype, 'xmlVersion', {\n      get: function() {\n        if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {\n          return this.children[0].version;\n        } else {\n          return \"1.0\";\n        }\n      }\n    });\n\n    Object.defineProperty(XMLDocument.prototype, 'URL', {\n      get: function() {\n        return this.documentURI;\n      }\n    });\n\n    Object.defineProperty(XMLDocument.prototype, 'origin', {\n      get: function() {\n        return null;\n      }\n    });\n\n    Object.defineProperty(XMLDocument.prototype, 'compatMode', {\n      get: function() {\n        return null;\n      }\n    });\n\n    Object.defineProperty(XMLDocument.prototype, 'characterSet', {\n      get: function() {\n        return null;\n      }\n    });\n\n    Object.defineProperty(XMLDocument.prototype, 'contentType', {\n      get: function() {\n        return null;\n      }\n    });\n\n    XMLDocument.prototype.end = function(writer) {\n      var writerOptions;\n      writerOptions = {};\n      if (!writer) {\n        writer = this.options.writer;\n      } else if (isPlainObject(writer)) {\n        writerOptions = writer;\n        writer = this.options.writer;\n      }\n      return writer.document(this, writer.filterOptions(writerOptions));\n    };\n\n    XMLDocument.prototype.toString = function(options) {\n      return this.options.writer.document(this, this.options.writer.filterOptions(options));\n    };\n\n    XMLDocument.prototype.createElement = function(tagName) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.createDocumentFragment = function() {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.createTextNode = function(data) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.createComment = function(data) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.createCDATASection = function(data) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.createProcessingInstruction = function(target, data) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.createAttribute = function(name) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.createEntityReference = function(name) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.getElementsByTagName = function(tagname) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.importNode = function(importedNode, deep) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.createElementNS = function(namespaceURI, qualifiedName) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.createAttributeNS = function(namespaceURI, qualifiedName) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.getElementById = function(elementId) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.adoptNode = function(source) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.normalizeDocument = function() {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.renameNode = function(node, namespaceURI, qualifiedName) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.getElementsByClassName = function(classNames) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.createEvent = function(eventInterface) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.createRange = function() {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.createNodeIterator = function(root, whatToShow, filter) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    XMLDocument.prototype.createTreeWalker = function(root, whatToShow, filter) {\n      throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n    };\n\n    return XMLDocument;\n\n  })(XMLNode);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction, isObject, isPlainObject, ref,\n    hasProp = {}.hasOwnProperty;\n\n  ref = require('./Utility'), isObject = ref.isObject, isFunction = ref.isFunction, isPlainObject = ref.isPlainObject, getValue = ref.getValue;\n\n  NodeType = require('./NodeType');\n\n  XMLDocument = require('./XMLDocument');\n\n  XMLElement = require('./XMLElement');\n\n  XMLCData = require('./XMLCData');\n\n  XMLComment = require('./XMLComment');\n\n  XMLRaw = require('./XMLRaw');\n\n  XMLText = require('./XMLText');\n\n  XMLProcessingInstruction = require('./XMLProcessingInstruction');\n\n  XMLDeclaration = require('./XMLDeclaration');\n\n  XMLDocType = require('./XMLDocType');\n\n  XMLDTDAttList = require('./XMLDTDAttList');\n\n  XMLDTDEntity = require('./XMLDTDEntity');\n\n  XMLDTDElement = require('./XMLDTDElement');\n\n  XMLDTDNotation = require('./XMLDTDNotation');\n\n  XMLAttribute = require('./XMLAttribute');\n\n  XMLStringifier = require('./XMLStringifier');\n\n  XMLStringWriter = require('./XMLStringWriter');\n\n  WriterState = require('./WriterState');\n\n  module.exports = XMLDocumentCB = (function() {\n    function XMLDocumentCB(options, onData, onEnd) {\n      var writerOptions;\n      this.name = \"?xml\";\n      this.type = NodeType.Document;\n      options || (options = {});\n      writerOptions = {};\n      if (!options.writer) {\n        options.writer = new XMLStringWriter();\n      } else if (isPlainObject(options.writer)) {\n        writerOptions = options.writer;\n        options.writer = new XMLStringWriter();\n      }\n      this.options = options;\n      this.writer = options.writer;\n      this.writerOptions = this.writer.filterOptions(writerOptions);\n      this.stringify = new XMLStringifier(options);\n      this.onDataCallback = onData || function() {};\n      this.onEndCallback = onEnd || function() {};\n      this.currentNode = null;\n      this.currentLevel = -1;\n      this.openTags = {};\n      this.documentStarted = false;\n      this.documentCompleted = false;\n      this.root = null;\n    }\n\n    XMLDocumentCB.prototype.createChildNode = function(node) {\n      var att, attName, attributes, child, i, len, ref1, ref2;\n      switch (node.type) {\n        case NodeType.CData:\n          this.cdata(node.value);\n          break;\n        case NodeType.Comment:\n          this.comment(node.value);\n          break;\n        case NodeType.Element:\n          attributes = {};\n          ref1 = node.attribs;\n          for (attName in ref1) {\n            if (!hasProp.call(ref1, attName)) continue;\n            att = ref1[attName];\n            attributes[attName] = att.value;\n          }\n          this.node(node.name, attributes);\n          break;\n        case NodeType.Dummy:\n          this.dummy();\n          break;\n        case NodeType.Raw:\n          this.raw(node.value);\n          break;\n        case NodeType.Text:\n          this.text(node.value);\n          break;\n        case NodeType.ProcessingInstruction:\n          this.instruction(node.target, node.value);\n          break;\n        default:\n          throw new Error(\"This XML node type is not supported in a JS object: \" + node.constructor.name);\n      }\n      ref2 = node.children;\n      for (i = 0, len = ref2.length; i < len; i++) {\n        child = ref2[i];\n        this.createChildNode(child);\n        if (child.type === NodeType.Element) {\n          this.up();\n        }\n      }\n      return this;\n    };\n\n    XMLDocumentCB.prototype.dummy = function() {\n      return this;\n    };\n\n    XMLDocumentCB.prototype.node = function(name, attributes, text) {\n      var ref1;\n      if (name == null) {\n        throw new Error(\"Missing node name.\");\n      }\n      if (this.root && this.currentLevel === -1) {\n        throw new Error(\"Document can only have one root node. \" + this.debugInfo(name));\n      }\n      this.openCurrent();\n      name = getValue(name);\n      if (attributes == null) {\n        attributes = {};\n      }\n      attributes = getValue(attributes);\n      if (!isObject(attributes)) {\n        ref1 = [attributes, text], text = ref1[0], attributes = ref1[1];\n      }\n      this.currentNode = new XMLElement(this, name, attributes);\n      this.currentNode.children = false;\n      this.currentLevel++;\n      this.openTags[this.currentLevel] = this.currentNode;\n      if (text != null) {\n        this.text(text);\n      }\n      return this;\n    };\n\n    XMLDocumentCB.prototype.element = function(name, attributes, text) {\n      var child, i, len, oldValidationFlag, ref1, root;\n      if (this.currentNode && this.currentNode.type === NodeType.DocType) {\n        this.dtdElement.apply(this, arguments);\n      } else {\n        if (Array.isArray(name) || isObject(name) || isFunction(name)) {\n          oldValidationFlag = this.options.noValidation;\n          this.options.noValidation = true;\n          root = new XMLDocument(this.options).element('TEMP_ROOT');\n          root.element(name);\n          this.options.noValidation = oldValidationFlag;\n          ref1 = root.children;\n          for (i = 0, len = ref1.length; i < len; i++) {\n            child = ref1[i];\n            this.createChildNode(child);\n            if (child.type === NodeType.Element) {\n              this.up();\n            }\n          }\n        } else {\n          this.node(name, attributes, text);\n        }\n      }\n      return this;\n    };\n\n    XMLDocumentCB.prototype.attribute = function(name, value) {\n      var attName, attValue;\n      if (!this.currentNode || this.currentNode.children) {\n        throw new Error(\"att() can only be used immediately after an ele() call in callback mode. \" + this.debugInfo(name));\n      }\n      if (name != null) {\n        name = getValue(name);\n      }\n      if (isObject(name)) {\n        for (attName in name) {\n          if (!hasProp.call(name, attName)) continue;\n          attValue = name[attName];\n          this.attribute(attName, attValue);\n        }\n      } else {\n        if (isFunction(value)) {\n          value = value.apply();\n        }\n        if (this.options.keepNullAttributes && (value == null)) {\n          this.currentNode.attribs[name] = new XMLAttribute(this, name, \"\");\n        } else if (value != null) {\n          this.currentNode.attribs[name] = new XMLAttribute(this, name, value);\n        }\n      }\n      return this;\n    };\n\n    XMLDocumentCB.prototype.text = function(value) {\n      var node;\n      this.openCurrent();\n      node = new XMLText(this, value);\n      this.onData(this.writer.text(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);\n      return this;\n    };\n\n    XMLDocumentCB.prototype.cdata = function(value) {\n      var node;\n      this.openCurrent();\n      node = new XMLCData(this, value);\n      this.onData(this.writer.cdata(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);\n      return this;\n    };\n\n    XMLDocumentCB.prototype.comment = function(value) {\n      var node;\n      this.openCurrent();\n      node = new XMLComment(this, value);\n      this.onData(this.writer.comment(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);\n      return this;\n    };\n\n    XMLDocumentCB.prototype.raw = function(value) {\n      var node;\n      this.openCurrent();\n      node = new XMLRaw(this, value);\n      this.onData(this.writer.raw(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);\n      return this;\n    };\n\n    XMLDocumentCB.prototype.instruction = function(target, value) {\n      var i, insTarget, insValue, len, node;\n      this.openCurrent();\n      if (target != null) {\n        target = getValue(target);\n      }\n      if (value != null) {\n        value = getValue(value);\n      }\n      if (Array.isArray(target)) {\n        for (i = 0, len = target.length; i < len; i++) {\n          insTarget = target[i];\n          this.instruction(insTarget);\n        }\n      } else if (isObject(target)) {\n        for (insTarget in target) {\n          if (!hasProp.call(target, insTarget)) continue;\n          insValue = target[insTarget];\n          this.instruction(insTarget, insValue);\n        }\n      } else {\n        if (isFunction(value)) {\n          value = value.apply();\n        }\n        node = new XMLProcessingInstruction(this, target, value);\n        this.onData(this.writer.processingInstruction(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);\n      }\n      return this;\n    };\n\n    XMLDocumentCB.prototype.declaration = function(version, encoding, standalone) {\n      var node;\n      this.openCurrent();\n      if (this.documentStarted) {\n        throw new Error(\"declaration() must be the first node.\");\n      }\n      node = new XMLDeclaration(this, version, encoding, standalone);\n      this.onData(this.writer.declaration(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);\n      return this;\n    };\n\n    XMLDocumentCB.prototype.doctype = function(root, pubID, sysID) {\n      this.openCurrent();\n      if (root == null) {\n        throw new Error(\"Missing root node name.\");\n      }\n      if (this.root) {\n        throw new Error(\"dtd() must come before the root node.\");\n      }\n      this.currentNode = new XMLDocType(this, pubID, sysID);\n      this.currentNode.rootNodeName = root;\n      this.currentNode.children = false;\n      this.currentLevel++;\n      this.openTags[this.currentLevel] = this.currentNode;\n      return this;\n    };\n\n    XMLDocumentCB.prototype.dtdElement = function(name, value) {\n      var node;\n      this.openCurrent();\n      node = new XMLDTDElement(this, name, value);\n      this.onData(this.writer.dtdElement(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);\n      return this;\n    };\n\n    XMLDocumentCB.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {\n      var node;\n      this.openCurrent();\n      node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);\n      this.onData(this.writer.dtdAttList(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);\n      return this;\n    };\n\n    XMLDocumentCB.prototype.entity = function(name, value) {\n      var node;\n      this.openCurrent();\n      node = new XMLDTDEntity(this, false, name, value);\n      this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);\n      return this;\n    };\n\n    XMLDocumentCB.prototype.pEntity = function(name, value) {\n      var node;\n      this.openCurrent();\n      node = new XMLDTDEntity(this, true, name, value);\n      this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);\n      return this;\n    };\n\n    XMLDocumentCB.prototype.notation = function(name, value) {\n      var node;\n      this.openCurrent();\n      node = new XMLDTDNotation(this, name, value);\n      this.onData(this.writer.dtdNotation(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);\n      return this;\n    };\n\n    XMLDocumentCB.prototype.up = function() {\n      if (this.currentLevel < 0) {\n        throw new Error(\"The document node has no parent.\");\n      }\n      if (this.currentNode) {\n        if (this.currentNode.children) {\n          this.closeNode(this.currentNode);\n        } else {\n          this.openNode(this.currentNode);\n        }\n        this.currentNode = null;\n      } else {\n        this.closeNode(this.openTags[this.currentLevel]);\n      }\n      delete this.openTags[this.currentLevel];\n      this.currentLevel--;\n      return this;\n    };\n\n    XMLDocumentCB.prototype.end = function() {\n      while (this.currentLevel >= 0) {\n        this.up();\n      }\n      return this.onEnd();\n    };\n\n    XMLDocumentCB.prototype.openCurrent = function() {\n      if (this.currentNode) {\n        this.currentNode.children = true;\n        return this.openNode(this.currentNode);\n      }\n    };\n\n    XMLDocumentCB.prototype.openNode = function(node) {\n      var att, chunk, name, ref1;\n      if (!node.isOpen) {\n        if (!this.root && this.currentLevel === 0 && node.type === NodeType.Element) {\n          this.root = node;\n        }\n        chunk = '';\n        if (node.type === NodeType.Element) {\n          this.writerOptions.state = WriterState.OpenTag;\n          chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<' + node.name;\n          ref1 = node.attribs;\n          for (name in ref1) {\n            if (!hasProp.call(ref1, name)) continue;\n            att = ref1[name];\n            chunk += this.writer.attribute(att, this.writerOptions, this.currentLevel);\n          }\n          chunk += (node.children ? '>' : '/>') + this.writer.endline(node, this.writerOptions, this.currentLevel);\n          this.writerOptions.state = WriterState.InsideTag;\n        } else {\n          this.writerOptions.state = WriterState.OpenTag;\n          chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '';\n          }\n          chunk += this.writer.endline(node, this.writerOptions, this.currentLevel);\n        }\n        this.onData(chunk, this.currentLevel);\n        return node.isOpen = true;\n      }\n    };\n\n    XMLDocumentCB.prototype.closeNode = function(node) {\n      var chunk;\n      if (!node.isClosed) {\n        chunk = '';\n        this.writerOptions.state = WriterState.CloseTag;\n        if (node.type === NodeType.Element) {\n          chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '' + this.writer.endline(node, this.writerOptions, this.currentLevel);\n        } else {\n          chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + ']>' + this.writer.endline(node, this.writerOptions, this.currentLevel);\n        }\n        this.writerOptions.state = WriterState.None;\n        this.onData(chunk, this.currentLevel);\n        return node.isClosed = true;\n      }\n    };\n\n    XMLDocumentCB.prototype.onData = function(chunk, level) {\n      this.documentStarted = true;\n      return this.onDataCallback(chunk, level + 1);\n    };\n\n    XMLDocumentCB.prototype.onEnd = function() {\n      this.documentCompleted = true;\n      return this.onEndCallback();\n    };\n\n    XMLDocumentCB.prototype.debugInfo = function(name) {\n      if (name == null) {\n        return \"\";\n      } else {\n        return \"node: <\" + name + \">\";\n      }\n    };\n\n    XMLDocumentCB.prototype.ele = function() {\n      return this.element.apply(this, arguments);\n    };\n\n    XMLDocumentCB.prototype.nod = function(name, attributes, text) {\n      return this.node(name, attributes, text);\n    };\n\n    XMLDocumentCB.prototype.txt = function(value) {\n      return this.text(value);\n    };\n\n    XMLDocumentCB.prototype.dat = function(value) {\n      return this.cdata(value);\n    };\n\n    XMLDocumentCB.prototype.com = function(value) {\n      return this.comment(value);\n    };\n\n    XMLDocumentCB.prototype.ins = function(target, value) {\n      return this.instruction(target, value);\n    };\n\n    XMLDocumentCB.prototype.dec = function(version, encoding, standalone) {\n      return this.declaration(version, encoding, standalone);\n    };\n\n    XMLDocumentCB.prototype.dtd = function(root, pubID, sysID) {\n      return this.doctype(root, pubID, sysID);\n    };\n\n    XMLDocumentCB.prototype.e = function(name, attributes, text) {\n      return this.element(name, attributes, text);\n    };\n\n    XMLDocumentCB.prototype.n = function(name, attributes, text) {\n      return this.node(name, attributes, text);\n    };\n\n    XMLDocumentCB.prototype.t = function(value) {\n      return this.text(value);\n    };\n\n    XMLDocumentCB.prototype.d = function(value) {\n      return this.cdata(value);\n    };\n\n    XMLDocumentCB.prototype.c = function(value) {\n      return this.comment(value);\n    };\n\n    XMLDocumentCB.prototype.r = function(value) {\n      return this.raw(value);\n    };\n\n    XMLDocumentCB.prototype.i = function(target, value) {\n      return this.instruction(target, value);\n    };\n\n    XMLDocumentCB.prototype.att = function() {\n      if (this.currentNode && this.currentNode.type === NodeType.DocType) {\n        return this.attList.apply(this, arguments);\n      } else {\n        return this.attribute.apply(this, arguments);\n      }\n    };\n\n    XMLDocumentCB.prototype.a = function() {\n      if (this.currentNode && this.currentNode.type === NodeType.DocType) {\n        return this.attList.apply(this, arguments);\n      } else {\n        return this.attribute.apply(this, arguments);\n      }\n    };\n\n    XMLDocumentCB.prototype.ent = function(name, value) {\n      return this.entity(name, value);\n    };\n\n    XMLDocumentCB.prototype.pent = function(name, value) {\n      return this.pEntity(name, value);\n    };\n\n    XMLDocumentCB.prototype.not = function(name, value) {\n      return this.notation(name, value);\n    };\n\n    return XMLDocumentCB;\n\n  })();\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, WriterState, XMLStreamWriter, XMLWriterBase,\n    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n    hasProp = {}.hasOwnProperty;\n\n  NodeType = require('./NodeType');\n\n  XMLWriterBase = require('./XMLWriterBase');\n\n  WriterState = require('./WriterState');\n\n  module.exports = XMLStreamWriter = (function(superClass) {\n    extend(XMLStreamWriter, superClass);\n\n    function XMLStreamWriter(stream, options) {\n      this.stream = stream;\n      XMLStreamWriter.__super__.constructor.call(this, options);\n    }\n\n    XMLStreamWriter.prototype.endline = function(node, options, level) {\n      if (node.isLastRootNode && options.state === WriterState.CloseTag) {\n        return '';\n      } else {\n        return XMLStreamWriter.__super__.endline.call(this, node, options, level);\n      }\n    };\n\n    XMLStreamWriter.prototype.document = function(doc, options) {\n      var child, i, j, k, len, len1, ref, ref1, results;\n      ref = doc.children;\n      for (i = j = 0, len = ref.length; j < len; i = ++j) {\n        child = ref[i];\n        child.isLastRootNode = i === doc.children.length - 1;\n      }\n      options = this.filterOptions(options);\n      ref1 = doc.children;\n      results = [];\n      for (k = 0, len1 = ref1.length; k < len1; k++) {\n        child = ref1[k];\n        results.push(this.writeChildNode(child, options, 0));\n      }\n      return results;\n    };\n\n    XMLStreamWriter.prototype.attribute = function(att, options, level) {\n      return this.stream.write(XMLStreamWriter.__super__.attribute.call(this, att, options, level));\n    };\n\n    XMLStreamWriter.prototype.cdata = function(node, options, level) {\n      return this.stream.write(XMLStreamWriter.__super__.cdata.call(this, node, options, level));\n    };\n\n    XMLStreamWriter.prototype.comment = function(node, options, level) {\n      return this.stream.write(XMLStreamWriter.__super__.comment.call(this, node, options, level));\n    };\n\n    XMLStreamWriter.prototype.declaration = function(node, options, level) {\n      return this.stream.write(XMLStreamWriter.__super__.declaration.call(this, node, options, level));\n    };\n\n    XMLStreamWriter.prototype.docType = function(node, options, level) {\n      var child, j, len, ref;\n      level || (level = 0);\n      this.openNode(node, options, level);\n      options.state = WriterState.OpenTag;\n      this.stream.write(this.indent(node, options, level));\n      this.stream.write(' 0) {\n        this.stream.write(' [');\n        this.stream.write(this.endline(node, options, level));\n        options.state = WriterState.InsideTag;\n        ref = node.children;\n        for (j = 0, len = ref.length; j < len; j++) {\n          child = ref[j];\n          this.writeChildNode(child, options, level + 1);\n        }\n        options.state = WriterState.CloseTag;\n        this.stream.write(']');\n      }\n      options.state = WriterState.CloseTag;\n      this.stream.write(options.spaceBeforeSlash + '>');\n      this.stream.write(this.endline(node, options, level));\n      options.state = WriterState.None;\n      return this.closeNode(node, options, level);\n    };\n\n    XMLStreamWriter.prototype.element = function(node, options, level) {\n      var att, child, childNodeCount, firstChildNode, j, len, name, prettySuppressed, ref, ref1;\n      level || (level = 0);\n      this.openNode(node, options, level);\n      options.state = WriterState.OpenTag;\n      this.stream.write(this.indent(node, options, level) + '<' + node.name);\n      ref = node.attribs;\n      for (name in ref) {\n        if (!hasProp.call(ref, name)) continue;\n        att = ref[name];\n        this.attribute(att, options, level);\n      }\n      childNodeCount = node.children.length;\n      firstChildNode = childNodeCount === 0 ? null : node.children[0];\n      if (childNodeCount === 0 || node.children.every(function(e) {\n        return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === '';\n      })) {\n        if (options.allowEmpty) {\n          this.stream.write('>');\n          options.state = WriterState.CloseTag;\n          this.stream.write('');\n        } else {\n          options.state = WriterState.CloseTag;\n          this.stream.write(options.spaceBeforeSlash + '/>');\n        }\n      } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && (firstChildNode.value != null)) {\n        this.stream.write('>');\n        options.state = WriterState.InsideTag;\n        options.suppressPrettyCount++;\n        prettySuppressed = true;\n        this.writeChildNode(firstChildNode, options, level + 1);\n        options.suppressPrettyCount--;\n        prettySuppressed = false;\n        options.state = WriterState.CloseTag;\n        this.stream.write('');\n      } else {\n        this.stream.write('>' + this.endline(node, options, level));\n        options.state = WriterState.InsideTag;\n        ref1 = node.children;\n        for (j = 0, len = ref1.length; j < len; j++) {\n          child = ref1[j];\n          this.writeChildNode(child, options, level + 1);\n        }\n        options.state = WriterState.CloseTag;\n        this.stream.write(this.indent(node, options, level) + '');\n      }\n      this.stream.write(this.endline(node, options, level));\n      options.state = WriterState.None;\n      return this.closeNode(node, options, level);\n    };\n\n    XMLStreamWriter.prototype.processingInstruction = function(node, options, level) {\n      return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this, node, options, level));\n    };\n\n    XMLStreamWriter.prototype.raw = function(node, options, level) {\n      return this.stream.write(XMLStreamWriter.__super__.raw.call(this, node, options, level));\n    };\n\n    XMLStreamWriter.prototype.text = function(node, options, level) {\n      return this.stream.write(XMLStreamWriter.__super__.text.call(this, node, options, level));\n    };\n\n    XMLStreamWriter.prototype.dtdAttList = function(node, options, level) {\n      return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this, node, options, level));\n    };\n\n    XMLStreamWriter.prototype.dtdElement = function(node, options, level) {\n      return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this, node, options, level));\n    };\n\n    XMLStreamWriter.prototype.dtdEntity = function(node, options, level) {\n      return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this, node, options, level));\n    };\n\n    XMLStreamWriter.prototype.dtdNotation = function(node, options, level) {\n      return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this, node, options, level));\n    };\n\n    return XMLStreamWriter;\n\n  })(XMLWriterBase);\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction, ref;\n\n  ref = require('./Utility'), assign = ref.assign, isFunction = ref.isFunction;\n\n  XMLDOMImplementation = require('./XMLDOMImplementation');\n\n  XMLDocument = require('./XMLDocument');\n\n  XMLDocumentCB = require('./XMLDocumentCB');\n\n  XMLStringWriter = require('./XMLStringWriter');\n\n  XMLStreamWriter = require('./XMLStreamWriter');\n\n  NodeType = require('./NodeType');\n\n  WriterState = require('./WriterState');\n\n  module.exports.create = function(name, xmldec, doctype, options) {\n    var doc, root;\n    if (name == null) {\n      throw new Error(\"Root element needs a name.\");\n    }\n    options = assign({}, xmldec, doctype, options);\n    doc = new XMLDocument(options);\n    root = doc.element(name);\n    if (!options.headless) {\n      doc.declaration(options);\n      if ((options.pubID != null) || (options.sysID != null)) {\n        doc.dtd(options);\n      }\n    }\n    return root;\n  };\n\n  module.exports.begin = function(options, onData, onEnd) {\n    var ref1;\n    if (isFunction(options)) {\n      ref1 = [options, onData], onData = ref1[0], onEnd = ref1[1];\n      options = {};\n    }\n    if (onData) {\n      return new XMLDocumentCB(options, onData, onEnd);\n    } else {\n      return new XMLDocument(options);\n    }\n  };\n\n  module.exports.stringWriter = function(options) {\n    return new XMLStringWriter(options);\n  };\n\n  module.exports.streamWriter = function(stream, options) {\n    return new XMLStreamWriter(stream, options);\n  };\n\n  module.exports.implementation = new XMLDOMImplementation();\n\n  module.exports.nodeType = NodeType;\n\n  module.exports.writerState = WriterState;\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n  \"use strict\";\n  var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA,\n    hasProp = {}.hasOwnProperty;\n\n  builder = require('xmlbuilder');\n\n  defaults = require('./defaults').defaults;\n\n  requiresCDATA = function(entry) {\n    return typeof entry === \"string\" && (entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0);\n  };\n\n  wrapCDATA = function(entry) {\n    return \"\";\n  };\n\n  escapeCDATA = function(entry) {\n    return entry.replace(']]>', ']]]]>');\n  };\n\n  exports.Builder = (function() {\n    function Builder(opts) {\n      var key, ref, value;\n      this.options = {};\n      ref = defaults[\"0.2\"];\n      for (key in ref) {\n        if (!hasProp.call(ref, key)) continue;\n        value = ref[key];\n        this.options[key] = value;\n      }\n      for (key in opts) {\n        if (!hasProp.call(opts, key)) continue;\n        value = opts[key];\n        this.options[key] = value;\n      }\n    }\n\n    Builder.prototype.buildObject = function(rootObj) {\n      var attrkey, charkey, render, rootElement, rootName;\n      attrkey = this.options.attrkey;\n      charkey = this.options.charkey;\n      if ((Object.keys(rootObj).length === 1) && (this.options.rootName === defaults['0.2'].rootName)) {\n        rootName = Object.keys(rootObj)[0];\n        rootObj = rootObj[rootName];\n      } else {\n        rootName = this.options.rootName;\n      }\n      render = (function(_this) {\n        return function(element, obj) {\n          var attr, child, entry, index, key, value;\n          if (typeof obj !== 'object') {\n            if (_this.options.cdata && requiresCDATA(obj)) {\n              element.raw(wrapCDATA(obj));\n            } else {\n              element.txt(obj);\n            }\n          } else if (Array.isArray(obj)) {\n            for (index in obj) {\n              if (!hasProp.call(obj, index)) continue;\n              child = obj[index];\n              for (key in child) {\n                entry = child[key];\n                element = render(element.ele(key), entry).up();\n              }\n            }\n          } else {\n            for (key in obj) {\n              if (!hasProp.call(obj, key)) continue;\n              child = obj[key];\n              if (key === attrkey) {\n                if (typeof child === \"object\") {\n                  for (attr in child) {\n                    value = child[attr];\n                    element = element.att(attr, value);\n                  }\n                }\n              } else if (key === charkey) {\n                if (_this.options.cdata && requiresCDATA(child)) {\n                  element = element.raw(wrapCDATA(child));\n                } else {\n                  element = element.txt(child);\n                }\n              } else if (Array.isArray(child)) {\n                for (index in child) {\n                  if (!hasProp.call(child, index)) continue;\n                  entry = child[index];\n                  if (typeof entry === 'string') {\n                    if (_this.options.cdata && requiresCDATA(entry)) {\n                      element = element.ele(key).raw(wrapCDATA(entry)).up();\n                    } else {\n                      element = element.ele(key, entry).up();\n                    }\n                  } else {\n                    element = render(element.ele(key), entry).up();\n                  }\n                }\n              } else if (typeof child === \"object\") {\n                element = render(element.ele(key), child).up();\n              } else {\n                if (typeof child === 'string' && _this.options.cdata && requiresCDATA(child)) {\n                  element = element.ele(key).raw(wrapCDATA(child)).up();\n                } else {\n                  if (child == null) {\n                    child = '';\n                  }\n                  element = element.ele(key, child.toString()).up();\n                }\n              }\n            }\n          }\n          return element;\n        };\n      })(this);\n      rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, {\n        headless: this.options.headless,\n        allowSurrogateChars: this.options.allowSurrogateChars\n      });\n      return render(rootElement, rootObj).end(this.options.renderOpts);\n    };\n\n    return Builder;\n\n  })();\n\n}).call(this);\n",";(function (sax) { // wrapper for non-node envs\n  sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }\n  sax.SAXParser = SAXParser\n  sax.SAXStream = SAXStream\n  sax.createStream = createStream\n\n  // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.\n  // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),\n  // since that's the earliest that a buffer overrun could occur.  This way, checks are\n  // as rare as required, but as often as necessary to ensure never crossing this bound.\n  // Furthermore, buffers are only tested at most once per write(), so passing a very\n  // large string into write() might have undesirable effects, but this is manageable by\n  // the caller, so it is assumed to be safe.  Thus, a call to write() may, in the extreme\n  // edge case, result in creating at most one complete copy of the string passed in.\n  // Set to Infinity to have unlimited buffers.\n  sax.MAX_BUFFER_LENGTH = 64 * 1024\n\n  var buffers = [\n    'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype',\n    'procInstName', 'procInstBody', 'entity', 'attribName',\n    'attribValue', 'cdata', 'script'\n  ]\n\n  sax.EVENTS = [\n    'text',\n    'processinginstruction',\n    'sgmldeclaration',\n    'doctype',\n    'comment',\n    'opentagstart',\n    'attribute',\n    'opentag',\n    'closetag',\n    'opencdata',\n    'cdata',\n    'closecdata',\n    'error',\n    'end',\n    'ready',\n    'script',\n    'opennamespace',\n    'closenamespace'\n  ]\n\n  function SAXParser (strict, opt) {\n    if (!(this instanceof SAXParser)) {\n      return new SAXParser(strict, opt)\n    }\n\n    var parser = this\n    clearBuffers(parser)\n    parser.q = parser.c = ''\n    parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH\n    parser.opt = opt || {}\n    parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags\n    parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'\n    parser.tags = []\n    parser.closed = parser.closedRoot = parser.sawRoot = false\n    parser.tag = parser.error = null\n    parser.strict = !!strict\n    parser.noscript = !!(strict || parser.opt.noscript)\n    parser.state = S.BEGIN\n    parser.strictEntities = parser.opt.strictEntities\n    parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES)\n    parser.attribList = []\n\n    // namespaces form a prototype chain.\n    // it always points at the current tag,\n    // which protos to its parent tag.\n    if (parser.opt.xmlns) {\n      parser.ns = Object.create(rootNS)\n    }\n\n    // disallow unquoted attribute values if not otherwise configured\n    // and strict mode is true\n    if (parser.opt.unquotedAttributeValues === undefined) {\n      parser.opt.unquotedAttributeValues = !strict;\n    }\n\n    // mostly just for error reporting\n    parser.trackPosition = parser.opt.position !== false\n    if (parser.trackPosition) {\n      parser.position = parser.line = parser.column = 0\n    }\n    emit(parser, 'onready')\n  }\n\n  if (!Object.create) {\n    Object.create = function (o) {\n      function F () {}\n      F.prototype = o\n      var newf = new F()\n      return newf\n    }\n  }\n\n  if (!Object.keys) {\n    Object.keys = function (o) {\n      var a = []\n      for (var i in o) if (o.hasOwnProperty(i)) a.push(i)\n      return a\n    }\n  }\n\n  function checkBufferLength (parser) {\n    var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)\n    var maxActual = 0\n    for (var i = 0, l = buffers.length; i < l; i++) {\n      var len = parser[buffers[i]].length\n      if (len > maxAllowed) {\n        // Text/cdata nodes can get big, and since they're buffered,\n        // we can get here under normal conditions.\n        // Avoid issues by emitting the text node now,\n        // so at least it won't get any bigger.\n        switch (buffers[i]) {\n          case 'textNode':\n            closeText(parser)\n            break\n\n          case 'cdata':\n            emitNode(parser, 'oncdata', parser.cdata)\n            parser.cdata = ''\n            break\n\n          case 'script':\n            emitNode(parser, 'onscript', parser.script)\n            parser.script = ''\n            break\n\n          default:\n            error(parser, 'Max buffer length exceeded: ' + buffers[i])\n        }\n      }\n      maxActual = Math.max(maxActual, len)\n    }\n    // schedule the next check for the earliest possible buffer overrun.\n    var m = sax.MAX_BUFFER_LENGTH - maxActual\n    parser.bufferCheckPosition = m + parser.position\n  }\n\n  function clearBuffers (parser) {\n    for (var i = 0, l = buffers.length; i < l; i++) {\n      parser[buffers[i]] = ''\n    }\n  }\n\n  function flushBuffers (parser) {\n    closeText(parser)\n    if (parser.cdata !== '') {\n      emitNode(parser, 'oncdata', parser.cdata)\n      parser.cdata = ''\n    }\n    if (parser.script !== '') {\n      emitNode(parser, 'onscript', parser.script)\n      parser.script = ''\n    }\n  }\n\n  SAXParser.prototype = {\n    end: function () { end(this) },\n    write: write,\n    resume: function () { this.error = null; return this },\n    close: function () { return this.write(null) },\n    flush: function () { flushBuffers(this) }\n  }\n\n  var Stream\n  try {\n    Stream = require('stream').Stream\n  } catch (ex) {\n    Stream = function () {}\n  }\n  if (!Stream) Stream = function () {}\n\n  var streamWraps = sax.EVENTS.filter(function (ev) {\n    return ev !== 'error' && ev !== 'end'\n  })\n\n  function createStream (strict, opt) {\n    return new SAXStream(strict, opt)\n  }\n\n  function SAXStream (strict, opt) {\n    if (!(this instanceof SAXStream)) {\n      return new SAXStream(strict, opt)\n    }\n\n    Stream.apply(this)\n\n    this._parser = new SAXParser(strict, opt)\n    this.writable = true\n    this.readable = true\n\n    var me = this\n\n    this._parser.onend = function () {\n      me.emit('end')\n    }\n\n    this._parser.onerror = function (er) {\n      me.emit('error', er)\n\n      // if didn't throw, then means error was handled.\n      // go ahead and clear error, so we can write again.\n      me._parser.error = null\n    }\n\n    this._decoder = null\n\n    streamWraps.forEach(function (ev) {\n      Object.defineProperty(me, 'on' + ev, {\n        get: function () {\n          return me._parser['on' + ev]\n        },\n        set: function (h) {\n          if (!h) {\n            me.removeAllListeners(ev)\n            me._parser['on' + ev] = h\n            return h\n          }\n          me.on(ev, h)\n        },\n        enumerable: true,\n        configurable: false\n      })\n    })\n  }\n\n  SAXStream.prototype = Object.create(Stream.prototype, {\n    constructor: {\n      value: SAXStream\n    }\n  })\n\n  SAXStream.prototype.write = function (data) {\n    if (typeof Buffer === 'function' &&\n      typeof Buffer.isBuffer === 'function' &&\n      Buffer.isBuffer(data)) {\n      if (!this._decoder) {\n        var SD = require('string_decoder').StringDecoder\n        this._decoder = new SD('utf8')\n      }\n      data = this._decoder.write(data)\n    }\n\n    this._parser.write(data.toString())\n    this.emit('data', data)\n    return true\n  }\n\n  SAXStream.prototype.end = function (chunk) {\n    if (chunk && chunk.length) {\n      this.write(chunk)\n    }\n    this._parser.end()\n    return true\n  }\n\n  SAXStream.prototype.on = function (ev, handler) {\n    var me = this\n    if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {\n      me._parser['on' + ev] = function () {\n        var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)\n        args.splice(0, 0, ev)\n        me.emit.apply(me, args)\n      }\n    }\n\n    return Stream.prototype.on.call(me, ev, handler)\n  }\n\n  // this really needs to be replaced with character classes.\n  // XML allows all manner of ridiculous numbers and digits.\n  var CDATA = '[CDATA['\n  var DOCTYPE = 'DOCTYPE'\n  var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'\n  var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'\n  var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }\n\n  // http://www.w3.org/TR/REC-xml/#NT-NameStartChar\n  // This implementation works on strings, a single character at a time\n  // as such, it cannot ever support astral-plane characters (10000-EFFFF)\n  // without a significant breaking change to either this  parser, or the\n  // JavaScript language.  Implementation of an emoji-capable xml parser\n  // is left as an exercise for the reader.\n  var nameStart = /[:_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]/\n\n  var nameBody = /[:_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\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/\n\n  var entityStart = /[#:_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]/\n  var entityBody = /[#:_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\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/\n\n  function isWhitespace (c) {\n    return c === ' ' || c === '\\n' || c === '\\r' || c === '\\t'\n  }\n\n  function isQuote (c) {\n    return c === '\"' || c === '\\''\n  }\n\n  function isAttribEnd (c) {\n    return c === '>' || isWhitespace(c)\n  }\n\n  function isMatch (regex, c) {\n    return regex.test(c)\n  }\n\n  function notMatch (regex, c) {\n    return !isMatch(regex, c)\n  }\n\n  var S = 0\n  sax.STATE = {\n    BEGIN: S++, // leading byte order mark or whitespace\n    BEGIN_WHITESPACE: S++, // leading whitespace\n    TEXT: S++, // general stuff\n    TEXT_ENTITY: S++, // & and such.\n    OPEN_WAKA: S++, // <\n    SGML_DECL: S++, // \n    SCRIPT: S++, //